golang-1.8-race-detector-runtime_0.0+svn285455/0000775000175000017500000000000013040224627021201 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/README.txt0000664000175000017500000000046012341466271022705 0ustar mwhudsonmwhudsonCompiler-RT ================================ This directory and its subdirectories contain source code for the compiler support routines. Compiler-RT is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. ================================ golang-1.8-race-detector-runtime_0.0+svn285455/LICENSE.TXT0000664000175000017500000001030112677052572022674 0ustar mwhudsonmwhudson============================================================================== compiler_rt License ============================================================================== The compiler_rt library is dual licensed under both the University of Illinois "BSD-Like" license and the MIT license. As a user of this code you may choose to use it under either license. As a contributor, you agree to allow your code to be used under both. Full text of the relevant licenses is included below. ============================================================================== University of Illinois/NCSA Open Source License Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT All rights reserved. Developed by: LLVM Team University of Illinois at Urbana-Champaign http://llvm.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. * Neither the names of the LLVM Team, University of Illinois at Urbana-Champaign, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. ============================================================================== Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ============================================================================== Copyrights and Licenses for Third Party Software Distributed with LLVM: ============================================================================== The LLVM software contains code written by third parties. Such software will have its own individual LICENSE.TXT file in the directory in which it appears. This file will describe the copyrights, license, and restrictions which apply to that code. The disclaimer of warranty in the University of Illinois Open Source License applies to all code in the LLVM Distribution, and nothing in any of the other licenses gives permission to use the names of the LLVM Team or the University of Illinois to endorse or promote products derived from this Software. golang-1.8-race-detector-runtime_0.0+svn285455/.arcconfig0000664000175000017500000000012212741710171023131 0ustar mwhudsonmwhudson{ "project_id" : "compiler-rt", "conduit_uri" : "https://reviews.llvm.org/" } golang-1.8-race-detector-runtime_0.0+svn285455/unittests/0000775000175000017500000000000013040224625023241 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/unittests/lit.common.unit.cfg0000664000175000017500000000175712277373467027015 0ustar mwhudsonmwhudson# -*- Python -*- # Configuration file for 'lit' test runner. # This file contains common config setup rules for unit tests in various # compiler-rt testsuites. import os import lit.formats # Setup test format llvm_build_mode = getattr(config, "llvm_build_mode", "Debug") config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test") # Setup test suffixes. config.suffixes = [] # Tweak PATH to include llvm tools dir. llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path # Propagate the temp directory. Windows requires this because it uses \Windows\ # if none of these are present. if 'TMP' in os.environ: config.environment['TMP'] = os.environ['TMP'] if 'TEMP' in os.environ: config.environment['TEMP'] = os.environ['TEMP'] golang-1.8-race-detector-runtime_0.0+svn285455/unittests/CMakeLists.txt0000664000175000017500000000027112661121036026001 0ustar mwhudsonmwhudson# Needed for lit support include(AddLLVM) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.unit.configured.in ${CMAKE_CURRENT_BINARY_DIR}/lit.common.unit.configured) golang-1.8-race-detector-runtime_0.0+svn285455/unittests/lit.common.unit.configured.in0000664000175000017500000000175312704361721030765 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Generic config options for all compiler-rt unit tests. config.target_triple = "@TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_BINARY_DIR@" config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@" config.compiler_rt_libdir = "@COMPILER_RT_LIBRARY_OUTPUT_DIR@" config.llvm_build_mode = "@LLVM_BUILD_MODE@" config.host_arch = "@HOST_ARCH@" config.host_os = "@HOST_OS@" # LLVM tools dir and build mode can be passed in lit parameters, # so try to apply substitution. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError as e: key, = e.args lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) # Setup attributes common for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/unittests/lit.common.unit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/www/0000775000175000017500000000000013040224625022023 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/www/menu.css0000664000175000017500000000112111222514053023471 0ustar mwhudsonmwhudson/***************/ /* page layout */ /***************/ [id=menu] { position:fixed; width:25ex; } [id=content] { /* ***** EDIT THIS VALUE IF CONTENT OVERLAPS MENU ***** */ position:absolute; left:29ex; padding-right:4ex; } /**************/ /* menu style */ /**************/ #menu .submenu { padding-top:1em; display:block; } #menu label { display:block; font-weight: bold; text-align: center; background-color: rgb(192,192,192); } #menu a { padding:0 .2em; display:block; text-align: center; background-color: rgb(235,235,235); } #menu a:visited { color:rgb(100,50,100); }golang-1.8-race-detector-runtime_0.0+svn285455/www/index.html0000664000175000017500000001514512560304710024026 0ustar mwhudsonmwhudson "compiler-rt" Runtime Library

"compiler-rt" runtime libraries

The compiler-rt project consists of:

All of the code in the compiler-rt project is dual licensed under the MIT license and the UIUC License (a BSD-like license).

Clients

Currently compiler-rt is primarily used by the Clang and LLVM projects as the implementation for the runtime compiler support libraries. For more information on using compiler-rt with Clang, please see the Clang Getting Started page.

Platform Support

builtins is known to work on the following platforms:

Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific pages in Clang docs for more details.

Source Structure

A short explanation of the directory structure of compiler-rt:

For testing it is possible to build a generic library and an optimized library. The optimized library is formed by overlaying the optimized versions onto the generic library. Of course, some architectures have additional functions, so the optimized library may have functions not found in the generic version.

Get it and get involved!

Generally, you need to build LLVM/Clang in order to build compiler-rt. You can either follow the Clang's Getting Started page, or build LLVM separately to get llvm-config binary, and then run:

Tests for sanitizer runtimes are ported to llvm-lit and are run by make check-all command in LLVM/Clang/compiler-rt build tree.

compiler-rt libraries are installed to the system with make install command in either LLVM/Clang/compiler-rt or standalone compiler-rt build tree.

compiler-rt doesn't have its own mailing list, if you have questions please email the llvm-dev mailing list. Commits to the compiler-rt SVN module are automatically sent to the llvm-commits mailing list.

golang-1.8-race-detector-runtime_0.0+svn285455/www/menu.html.incl0000664000175000017500000000117412560304710024604 0ustar mwhudsonmwhudson golang-1.8-race-detector-runtime_0.0+svn285455/www/content.css0000664000175000017500000000112611222514053024204 0ustar mwhudsonmwhudsonhtml, body { padding:0px; font-size:small; font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, Helvetica, sans-serif; background-color: #fff; color: #222; line-height:1.5; } h1, h2, h3, tt { color: #000 } h1 { padding-top:0px; margin-top:0px;} h2 { color:#333333; padding-top:0.5em; } h3 { padding-top: 0.5em; margin-bottom: -0.25em; color:#2d58b7} li { padding-bottom: 0.5em; } ul { padding-left:1.5em; } /* Slides */ IMG.img_slide { display: block; margin-left: auto; margin-right: auto } .itemTitle { color:#2d58b7 } /* Tables */ tr { vertical-align:top } golang-1.8-race-detector-runtime_0.0+svn285455/make/0000775000175000017500000000000013040224617022115 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/make/platform/0000775000175000017500000000000013040224617023741 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/make/test/0000775000175000017500000000000013040224617023074 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/cmake/0000775000175000017500000000000013040224625022257 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/cmake/base-config-ix.cmake0000664000175000017500000002060712775263160026074 0ustar mwhudsonmwhudson# The CompilerRT build system requires CMake version 2.8.8 or higher in order # to use its support for building convenience "libraries" as a collection of # .o files. This is particularly useful in producing larger, more complex # runtime libraries. include(CheckIncludeFile) check_include_file(unwind.h HAVE_UNWIND_H) # Top level target used to build all compiler-rt libraries. add_custom_target(compiler-rt ALL) add_custom_target(install-compiler-rt) set_target_properties(compiler-rt PROPERTIES FOLDER "Compiler-RT Misc") # Setting these variables from an LLVM build is sufficient that compiler-rt can # construct the output paths, so it can behave as if it were in-tree here. if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION) set(LLVM_TREE_AVAILABLE On) endif() if (LLVM_TREE_AVAILABLE) # Compute the Clang version from the LLVM version. # FIXME: We should be able to reuse CLANG_VERSION variable calculated # in Clang cmake files, instead of copying the rules here. string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION}) # Setup the paths where compiler-rt runtimes and headers should be stored. set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." ${LLVM_INCLUDE_TESTS}) option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" ${LLVM_ENABLE_WERROR}) # Use just-built Clang to compile/link tests on all platforms, except for # Windows where we need to use clang-cl instead. if(NOT MSVC) set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++) else() set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe) set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe) endif() else() # Take output dir and install path from the user. set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path where built compiler-rt libraries should be stored.") set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH "Path where built compiler-rt executables should be stored.") set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH "Path where built compiler-rt libraries should be installed.") option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) # Use a host compiler to compile/link tests. set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE PATH "Compiler to use for testing") set(COMPILER_RT_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "C++ Compiler to use for testing") endif() if("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[+]*$") set(COMPILER_RT_TEST_COMPILER_ID Clang) elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang.*.exe$") set(COMPILER_RT_TEST_COMPILER_ID Clang) else() set(COMPILER_RT_TEST_COMPILER_ID GNU) endif() string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) set(COMPILER_RT_LIBRARY_OUTPUT_DIR ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) set(COMPILER_RT_LIBRARY_INSTALL_DIR ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) if(APPLE) # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not # the command line tools. If this is the case, we need to find the OS X # sysroot to pass to clang. if(NOT EXISTS /usr/include) execute_process(COMMAND xcodebuild -version -sdk macosx Path OUTPUT_VARIABLE OSX_SYSROOT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}") endif() option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On) option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off) option(COMPILER_RT_ENABLE_TVOS "Enable building for tvOS - Experimental" Off) endif() if(WIN32 AND NOT MINGW AND NOT CYGWIN) set(CMAKE_SHARED_LIBRARY_PREFIX_C "") set(CMAKE_SHARED_LIBRARY_PREFIX_CXX "") set(CMAKE_STATIC_LIBRARY_PREFIX_C "") set(CMAKE_STATIC_LIBRARY_PREFIX_CXX "") set(CMAKE_STATIC_LIBRARY_SUFFIX_C ".lib") set(CMAKE_STATIC_LIBRARY_SUFFIX_CXX ".lib") endif() macro(test_targets) # Find and run MSVC (not clang-cl) and get its version. This will tell clang-cl # what version of MSVC to pretend to be so that the STL works. set(MSVC_VERSION_FLAG "") if (MSVC) # Find and run MSVC (not clang-cl) and get its version. This will tell # clang-cl what version of MSVC to pretend to be so that the STL works. execute_process(COMMAND "$ENV{VSINSTALLDIR}/VC/bin/cl.exe" OUTPUT_QUIET ERROR_VARIABLE MSVC_COMPAT_VERSION ) string(REGEX REPLACE "^.*Compiler Version ([0-9.]+) for .*$" "\\1" MSVC_COMPAT_VERSION "${MSVC_COMPAT_VERSION}") if (MSVC_COMPAT_VERSION MATCHES "^[0-9].+$") set(MSVC_VERSION_FLAG "-fms-compatibility-version=${MSVC_COMPAT_VERSION}") # Add this flag into the host build if this is clang-cl. if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") append("${MSVC_VERSION_FLAG}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) elseif (COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang") # Add this flag to test compiles to suppress clang's auto-detection # logic. append("${MSVC_VERSION_FLAG}" COMPILER_RT_TEST_COMPILER_CFLAGS) endif() endif() endif() # Generate the COMPILER_RT_SUPPORTED_ARCH list. if(ANDROID) # Examine compiler output to determine target architecture. detect_target_arch() set(COMPILER_RT_OS_SUFFIX "-android") elseif(NOT APPLE) # Supported archs for Apple platforms are generated later if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64") if(NOT MSVC) test_target_arch(x86_64 "" "-m64") # FIXME: We build runtimes for both i686 and i386, as "clang -m32" may # target different variant than "$CMAKE_C_COMPILER -m32". This part should # be gone after we resolve PR14109. test_target_arch(i686 __i686__ "-m32") test_target_arch(i386 __i386__ "-m32") else() if (CMAKE_SIZEOF_VOID_P EQUAL 4) test_target_arch(i386 "" "") else() test_target_arch(x86_64 "" "") endif() endif() elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc") TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN) if(HOST_IS_BIG_ENDIAN) test_target_arch(powerpc64 "" "-m64") else() test_target_arch(powerpc64le "" "-m64") endif() elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x") test_target_arch(s390x "" "") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el") # Gcc doesn't accept -m32/-m64 so we do the next best thing and use # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match # clang's default CPU's. In the 64-bit case, we must also specify the ABI # since the default ABI differs between gcc and clang. # FIXME: Ideally, we would build the N32 library too. test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu") test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=64") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips") test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu") test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=64") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm") if(WIN32) test_target_arch(arm "" "" "") else() test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft") test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard") endif() elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch32") test_target_arch(aarch32 "" "-march=armv8-a") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch64") test_target_arch(aarch64 "" "-march=armv8-a") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "wasm32") test_target_arch(wasm32 "" "--target=wasm32-unknown-unknown") elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "wasm64") test_target_arch(wasm64 "" "--target=wasm64-unknown-unknown") endif() set(COMPILER_RT_OS_SUFFIX "") endif() endmacro() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/0000775000175000017500000000000013040224625023667 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/AddCompilerRT.cmake0000664000175000017500000004077413003724413027335 0ustar mwhudsonmwhudsoninclude(ExternalProject) include(CompilerRTUtils) function(set_target_output_directories target output_dir) # For RUNTIME_OUTPUT_DIRECTORY variable, Multi-configuration generators # append a per-configuration subdirectory to the specified directory. # To avoid the appended folder, the configuration specific variable must be # set 'RUNTIME_OUTPUT_DIRECTORY_${CONF}': # RUNTIME_OUTPUT_DIRECTORY_DEBUG, RUNTIME_OUTPUT_DIRECTORY_RELEASE, ... if(CMAKE_CONFIGURATION_TYPES) foreach(build_mode ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER "${build_mode}" CONFIG_SUFFIX) set_target_properties("${target}" PROPERTIES "ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${output_dir} "LIBRARY_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${output_dir} "RUNTIME_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${output_dir}) endforeach() else() set_target_properties("${target}" PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${output_dir} LIBRARY_OUTPUT_DIRECTORY ${output_dir} RUNTIME_OUTPUT_DIRECTORY ${output_dir}) endif() endfunction() # Tries to add an "object library" target for a given list of OSs and/or # architectures with name "." for non-Darwin platforms if # architecture can be targeted, and "." for Darwin platforms. # add_compiler_rt_object_libraries( # OS # ARCHS # SOURCES # CFLAGS # DEFS ) function(add_compiler_rt_object_libraries name) cmake_parse_arguments(LIB "" "" "OS;ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN}) set(libnames) if(APPLE) foreach(os ${LIB_OS}) set(libname "${name}.${os}") set(libnames ${libnames} ${libname}) set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS}) list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) endforeach() else() foreach(arch ${LIB_ARCHS}) set(libname "${name}.${arch}") set(libnames ${libnames} ${libname}) set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS}) if(NOT CAN_TARGET_${arch}) message(FATAL_ERROR "Architecture ${arch} can't be targeted") return() endif() endforeach() endif() foreach(libname ${libnames}) add_library(${libname} OBJECT ${LIB_SOURCES}) set_target_compile_flags(${libname} ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${LIB_CFLAGS}) set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries") if(APPLE) set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}") endif() endforeach() endfunction() # Takes a list of object library targets, and a suffix and appends the proper # TARGET_OBJECTS string to the output variable. # format_object_libs( ...) macro(format_object_libs output suffix) foreach(lib ${ARGN}) list(APPEND ${output} $) endforeach() endmacro() function(add_compiler_rt_component name) add_custom_target(${name}) set_target_properties(${name} PROPERTIES FOLDER "Compiler-RT Misc") if(COMMAND runtime_register_component) runtime_register_component(${name}) endif() add_dependencies(compiler-rt ${name}) endfunction() # Adds static or shared runtime for a list of architectures and operating # systems and puts it in the proper directory in the build and install trees. # add_compiler_rt_runtime( # {STATIC|SHARED} # ARCHS # OS # SOURCES # CFLAGS # LINKFLAGS # DEFS # LINK_LIBS (only for shared library) # OBJECT_LIBS # PARENT_TARGET ) function(add_compiler_rt_runtime name type) if(NOT type MATCHES "^(STATIC|SHARED)$") message(FATAL_ERROR "type argument must be STATIC or SHARED") return() endif() cmake_parse_arguments(LIB "" "PARENT_TARGET" "OS;ARCHS;SOURCES;CFLAGS;LINKFLAGS;DEFS;LINK_LIBS;OBJECT_LIBS" ${ARGN}) set(libnames) if(APPLE) foreach(os ${LIB_OS}) if(type STREQUAL "STATIC") set(libname "${name}_${os}") else() set(libname "${name}_${os}_dynamic") set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS} ${LIB_LINKFLAGS}) endif() list_intersect(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) if(LIB_ARCHS_${libname}) list(APPEND libnames ${libname}) set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} ${LIB_CFLAGS}) set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) set(sources_${libname} ${LIB_SOURCES}) format_object_libs(sources_${libname} ${os} ${LIB_OBJECT_LIBS}) endif() endforeach() else() foreach(arch ${LIB_ARCHS}) if(NOT CAN_TARGET_${arch}) message(FATAL_ERROR "Architecture ${arch} can't be targeted") return() endif() if(type STREQUAL "STATIC") set(libname "${name}-${arch}") set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) else() set(libname "${name}-dynamic-${arch}") set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) set(extra_linkflags_${libname} ${TARGET_${arch}_LINKFLAGS} ${LIB_LINKFLAGS}) if(WIN32) set(output_name_${libname} ${name}_dynamic-${arch}${COMPILER_RT_OS_SUFFIX}) else() set(output_name_${libname} ${name}-${arch}${COMPILER_RT_OS_SUFFIX}) endif() endif() set(sources_${libname} ${LIB_SOURCES}) format_object_libs(sources_${libname} ${arch} ${LIB_OBJECT_LIBS}) set(libnames ${libnames} ${libname}) set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) endforeach() endif() if(NOT libnames) return() endif() if(LIB_PARENT_TARGET) # If the parent targets aren't created we should create them if(NOT TARGET ${LIB_PARENT_TARGET}) add_custom_target(${LIB_PARENT_TARGET}) endif() if(NOT TARGET install-${LIB_PARENT_TARGET}) # The parent install target specifies the parent component to scrape up # anything not installed by the individual install targets, and to handle # installation when running the multi-configuration generators. add_custom_target(install-${LIB_PARENT_TARGET} DEPENDS ${LIB_PARENT_TARGET} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${LIB_PARENT_TARGET} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") set_target_properties(install-${LIB_PARENT_TARGET} PROPERTIES FOLDER "Compiler-RT Misc") add_dependencies(install-compiler-rt install-${LIB_PARENT_TARGET}) endif() endif() foreach(libname ${libnames}) # If you are using a multi-configuration generator we don't generate # per-library install rules, so we fall back to the parent target COMPONENT if(CMAKE_CONFIGURATION_TYPES AND LIB_PARENT_TARGET) set(COMPONENT_OPTION COMPONENT ${LIB_PARENT_TARGET}) else() set(COMPONENT_OPTION COMPONENT ${libname}) endif() add_library(${libname} ${type} ${sources_${libname}}) set_target_compile_flags(${libname} ${extra_cflags_${libname}}) set_target_link_flags(${libname} ${extra_linkflags_${libname}}) set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) set_target_output_directories(${libname} ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${output_name_${libname}}) set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime") if(${type} STREQUAL "SHARED") if(LIB_LINK_LIBS) target_link_libraries(${libname} ${LIB_LINK_LIBS}) endif() if(WIN32 AND NOT CYGWIN AND NOT MINGW) set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") endif() endif() install(TARGETS ${libname} ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} ${COMPONENT_OPTION} LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} ${COMPONENT_OPTION} RUNTIME DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} ${COMPONENT_OPTION}) # We only want to generate per-library install targets if you aren't using # an IDE because the extra targets get cluttered in IDEs. if(NOT CMAKE_CONFIGURATION_TYPES) add_custom_target(install-${libname} DEPENDS ${libname} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${libname} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") # If you have a parent target specified, we bind the new install target # to the parent install target. if(LIB_PARENT_TARGET) add_dependencies(install-${LIB_PARENT_TARGET} install-${libname}) endif() endif() if(APPLE) set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}") endif() if(type STREQUAL "SHARED") rt_externalize_debuginfo(${libname}) endif() endforeach() if(LIB_PARENT_TARGET) add_dependencies(${LIB_PARENT_TARGET} ${libnames}) endif() endfunction() # when cross compiling, COMPILER_RT_TEST_COMPILER_CFLAGS help # in compilation and linking of unittests. string(REPLACE " " ";" COMPILER_RT_UNITTEST_CFLAGS "${COMPILER_RT_TEST_COMPILER_CFLAGS}") set(COMPILER_RT_UNITTEST_LINKFLAGS ${COMPILER_RT_UNITTEST_CFLAGS}) # Unittests support. set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest) set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc) set(COMPILER_RT_GTEST_CFLAGS -DGTEST_NO_LLVM_RAW_OSTREAM=1 -DGTEST_HAS_RTTI=0 -I${COMPILER_RT_GTEST_PATH}/include -I${COMPILER_RT_GTEST_PATH} ) append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_UNITTEST_CFLAGS) if(MSVC) # clang doesn't support exceptions on Windows yet. list(APPEND COMPILER_RT_UNITTEST_CFLAGS -D_HAS_EXCEPTIONS=0) # We should teach clang to understand "#pragma intrinsic", see PR19898. list(APPEND COMPILER_RT_UNITTEST_CFLAGS -Wno-undefined-inline) # Clang doesn't support SEH on Windows yet. list(APPEND COMPILER_RT_GTEST_CFLAGS -DGTEST_HAS_SEH=0) # gtest use a lot of stuff marked as deprecated on Windows. list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations) endif() # Link objects into a single executable with COMPILER_RT_TEST_COMPILER, # using specified link flags. Make executable a part of provided # test_suite. # add_compiler_rt_test( # SUBDIR # OBJECTS # DEPS # LINK_FLAGS ) macro(add_compiler_rt_test test_suite test_name) cmake_parse_arguments(TEST "" "SUBDIR" "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN}) set(output_bin ${CMAKE_CURRENT_BINARY_DIR}) if(TEST_SUBDIR) set(output_bin "${output_bin}/${TEST_SUBDIR}") endif() if(CMAKE_CONFIGURATION_TYPES) set(output_bin "${output_bin}/${CMAKE_CFG_INTDIR}") endif() set(output_bin "${output_bin}/${test_name}") if(MSVC) set(output_bin "${output_bin}.exe") endif() # Use host compiler in a standalone build, and just-built Clang otherwise. if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TEST_DEPS clang) endif() # If we're not on MSVC, include the linker flags from CMAKE but override them # with the provided link flags. This ensures that flags which are required to # link programs at all are included, but the changes needed for the test # trump. With MSVC we can't do that because CMake is set up to run link.exe # when linking, not the compiler. Here, we hack it to use the compiler # because we want to use -fsanitize flags. if(NOT MSVC) set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}") separate_arguments(TEST_LINK_FLAGS) endif() add_custom_target(${test_name} COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} -o "${output_bin}" ${TEST_LINK_FLAGS} DEPENDS ${TEST_DEPS}) set_target_properties(${test_name} PROPERTIES FOLDER "Compiler-RT Tests") # Make the test suite depend on the binary. add_dependencies(${test_suite} ${test_name}) endmacro() macro(add_compiler_rt_resource_file target_name file_name component) set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}") set(dst_file "${COMPILER_RT_OUTPUT_DIR}/${file_name}") add_custom_command(OUTPUT ${dst_file} DEPENDS ${src_file} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file} COMMENT "Copying ${file_name}...") add_custom_target(${target_name} DEPENDS ${dst_file}) # Install in Clang resource directory. install(FILES ${file_name} DESTINATION ${COMPILER_RT_INSTALL_PATH} COMPONENT ${component}) add_dependencies(${component} ${target_name}) set_target_properties(${target_name} PROPERTIES FOLDER "Compiler-RT Misc") endmacro() macro(add_compiler_rt_script name) set(dst ${COMPILER_RT_EXEC_OUTPUT_DIR}/${name}) set(src ${CMAKE_CURRENT_SOURCE_DIR}/${name}) add_custom_command(OUTPUT ${dst} DEPENDS ${src} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} COMMENT "Copying ${name}...") add_custom_target(${name} DEPENDS ${dst}) install(FILES ${dst} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) endmacro(add_compiler_rt_script src name) # Builds custom version of libc++ and installs it in . # Can be used to build sanitized versions of libc++ for running unit tests. # add_custom_libcxx( # DEPS # CFLAGS ) macro(add_custom_libcxx name prefix) if(NOT COMPILER_RT_HAS_LIBCXX_SOURCES) message(FATAL_ERROR "libcxx not found!") endif() cmake_parse_arguments(LIBCXX "" "" "DEPS;CFLAGS" ${ARGN}) foreach(flag ${LIBCXX_CFLAGS}) set(flagstr "${flagstr} ${flag}") endforeach() set(LIBCXX_CFLAGS ${flagstr}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND LIBCXX_DEPS clang) endif() ExternalProject_Add(${name} PREFIX ${prefix} SOURCE_DIR ${COMPILER_RT_LIBCXX_PATH} CMAKE_ARGS -DCMAKE_MAKE_PROGRAM:STRING=${CMAKE_MAKE_PROGRAM} -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_CXX_COMPILER} -DCMAKE_C_FLAGS=${LIBCXX_CFLAGS} -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH= -DLLVM_PATH=${LLVM_MAIN_SRC_DIR} LOG_BUILD 1 LOG_CONFIGURE 1 LOG_INSTALL 1 ) set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL TRUE) ExternalProject_Add_Step(${name} force-reconfigure DEPENDERS configure ALWAYS 1 ) ExternalProject_Add_Step(${name} clobber COMMAND ${CMAKE_COMMAND} -E remove_directory COMMAND ${CMAKE_COMMAND} -E make_directory COMMENT "Clobberring ${name} build directory..." DEPENDERS configure DEPENDS ${LIBCXX_DEPS} ) endmacro() function(rt_externalize_debuginfo name) if(NOT COMPILER_RT_EXTERNALIZE_DEBUGINFO) return() endif() if(NOT COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP) set(strip_command COMMAND xcrun strip -Sl $) endif() if(APPLE) if(CMAKE_CXX_FLAGS MATCHES "-flto" OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto") set(lto_object ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${name}-lto.o) set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-object_path_lto -Wl,${lto_object}") endif() add_custom_command(TARGET ${name} POST_BUILD COMMAND xcrun dsymutil $ ${strip_command}) else() message(FATAL_ERROR "COMPILER_RT_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!") endif() endfunction() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/CompilerRTCompile.cmake0000664000175000017500000001055212653744500030235 0ustar mwhudsonmwhudson# On Windows, CMAKE_*_FLAGS are built for MSVC but we use the GCC clang.exe, # which uses completely different flags. Translate some common flag types, and # drop the rest. function(translate_msvc_cflags out_flags msvc_flags) # Insert an empty string in the list to simplify processing. set(msvc_flags ";${msvc_flags}") # Canonicalize /flag to -flag. string(REPLACE ";/" ";-" msvc_flags "${msvc_flags}") # Make space separated -D and -U flags into joined flags. string(REGEX REPLACE ";-\([DU]\);" ";-\\1" msvc_flags "${msvc_flags}") set(clang_flags "") foreach(flag ${msvc_flags}) if ("${flag}" MATCHES "^-[DU]") # Pass through basic command line macro definitions (-DNDEBUG). list(APPEND clang_flags "${flag}") elseif ("${flag}" MATCHES "^-O[2x]") # Canonicalize normal optimization flags to -O2. list(APPEND clang_flags "-O2") endif() endforeach() set(${out_flags} "${clang_flags}" PARENT_SCOPE) endfunction() # Compile a source into an object file with COMPILER_RT_TEST_COMPILER using # a provided compile flags and dependenices. # clang_compile( # CFLAGS # DEPS ) macro(clang_compile object_file source) cmake_parse_arguments(SOURCE "" "" "CFLAGS;DEPS" ${ARGN}) get_filename_component(source_rpath ${source} REALPATH) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SOURCE_DEPS clang compiler-rt-headers) endif() if (TARGET CompilerRTUnitTestCheckCxx) list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx) endif() string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath}) if(is_cxx) string(REPLACE " " ";" global_flags "${CMAKE_CXX_FLAGS}") else() string(REPLACE " " ";" global_flags "${CMAKE_C_FLAGS}") endif() if (MSVC) translate_msvc_cflags(global_flags "${global_flags}") endif() if (APPLE) set(global_flags ${OSX_SYSROOT_FLAG} ${global_flags}) endif() # Ignore unknown warnings. CMAKE_CXX_FLAGS may contain GCC-specific options # which are not supported by Clang. list(APPEND global_flags -Wno-unknown-warning-option) set(compile_flags ${global_flags} ${SOURCE_CFLAGS}) add_custom_command( OUTPUT ${object_file} COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c -o "${object_file}" ${source_rpath} MAIN_DEPENDENCY ${source} DEPENDS ${SOURCE_DEPS}) endmacro() # On Darwin, there are no system-wide C++ headers and the just-built clang is # therefore not able to compile C++ files unless they are copied/symlinked into # ${LLVM_BINARY_DIR}/include/c++ # The just-built clang is used to build compiler-rt unit tests. Let's detect # this before we try to build the tests and print out a suggestion how to fix # it. # On other platforms, this is currently not an issue. macro(clang_compiler_add_cxx_check) if (APPLE) set(CMD "echo '#include ' | ${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E -x c++ - > /dev/null" "if [ $? != 0 ] " " then echo" " echo 'Your just-built clang cannot find C++ headers, which are needed to build and run compiler-rt tests.'" " echo 'You should copy or symlink your system C++ headers into ${LLVM_BINARY_DIR}/include/c++'" " if [ -d $(dirname $(dirname $(xcrun -f clang)))/include/c++ ]" " then echo 'e.g. with:'" " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/include/c++ '${LLVM_BINARY_DIR}/include/'" " elif [ -d $(dirname $(dirname $(xcrun -f clang)))/lib/c++ ]" " then echo 'e.g. with:'" " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/lib/c++ '${LLVM_BINARY_DIR}/include/'" " fi" " echo 'This can also be fixed by checking out the libcxx project from llvm.org and installing the headers'" " echo 'into your build directory:'" " echo ' cd ${LLVM_MAIN_SRC_DIR}/projects && svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx'" " echo ' cd ${LLVM_BINARY_DIR} && make -C ${LLVM_MAIN_SRC_DIR}/projects/libcxx installheaders HEADER_DIR=${LLVM_BINARY_DIR}/include'" " echo" " false" "fi" ) add_custom_target(CompilerRTUnitTestCheckCxx COMMAND bash -c "${CMD}" COMMENT "Checking that just-built clang can find C++ headers..." VERBATIM) if (TARGET clang) ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang) endif() endif() endmacro() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/CompilerRTDarwinUtils.cmake0000664000175000017500000004153612755703253031123 0ustar mwhudsonmwhudsoninclude(CMakeParseArguments) # On OS X SDKs can be installed anywhere on the base system and xcode-select can # set the default Xcode to use. This function finds the SDKs that are present in # the current Xcode. function(find_darwin_sdk_dir var sdk_name) # Let's first try the internal SDK, otherwise use the public SDK. execute_process( COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path RESULT_VARIABLE result_process OUTPUT_VARIABLE var_internal OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_FILE /dev/null ) if((NOT result_process EQUAL 0) OR "" STREQUAL "${var_internal}") execute_process( COMMAND xcodebuild -version -sdk ${sdk_name} Path RESULT_VARIABLE result_process OUTPUT_VARIABLE var_internal OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_FILE /dev/null ) else() set(${var}_INTERNAL ${var_internal} PARENT_SCOPE) endif() if(result_process EQUAL 0) set(${var} ${var_internal} PARENT_SCOPE) endif() endfunction() # There isn't a clear mapping of what architectures are supported with a given # target platform, but ld's version output does list the architectures it can # link for. function(darwin_get_toolchain_supported_archs output_var) execute_process( COMMAND ld -v ERROR_VARIABLE LINKER_VERSION) string(REGEX MATCH "configured to support archs: ([^\n]+)" ARCHES_MATCHED "${LINKER_VERSION}") if(ARCHES_MATCHED) set(ARCHES "${CMAKE_MATCH_1}") message(STATUS "Got ld supported ARCHES: ${ARCHES}") string(REPLACE " " ";" ARCHES ${ARCHES}) else() # If auto-detecting fails, fall back to a default set message(WARNING "Detecting supported architectures from 'ld -v' failed. Returning default set.") set(ARCHES "i386;x86_64;armv7;armv7s;arm64") endif() set(${output_var} ${ARCHES} PARENT_SCOPE) endfunction() # This function takes an OS and a list of architectures and identifies the # subset of the architectures list that the installed toolchain can target. function(darwin_test_archs os valid_archs) if(${valid_archs}) message(STATUS "Using cached valid architectures for ${os}.") return() endif() set(archs ${ARGN}) if(NOT TEST_COMPILE_ONLY) message(STATUS "Finding valid architectures for ${os}...") set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c) file(WRITE ${SIMPLE_C} "#include \nint main() { printf(__FILE__); return 0; }\n") set(os_linker_flags) foreach(flag ${DARWIN_${os}_LINKFLAGS}) set(os_linker_flags "${os_linker_flags} ${flag}") endforeach() endif() # The simple program will build for x86_64h on the simulator because it is # compatible with x86_64 libraries (mostly), but since x86_64h isn't actually # a valid or useful architecture for the iOS simulator we should drop it. if(${os} MATCHES "^(iossim|tvossim|watchossim)$") list(REMOVE_ITEM archs "x86_64h") endif() set(working_archs) foreach(arch ${archs}) set(arch_linker_flags "-arch ${arch} ${os_linker_flags}") if(TEST_COMPILE_ONLY) try_compile_only(CAN_TARGET_${os}_${arch} -v -arch ${arch} ${DARWIN_${os}_CFLAGS}) else() try_compile(CAN_TARGET_${os}_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_C} COMPILE_DEFINITIONS "-v -arch ${arch}" ${DARWIN_${os}_CFLAGS} CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${arch_linker_flags}" OUTPUT_VARIABLE TEST_OUTPUT) endif() if(${CAN_TARGET_${os}_${arch}}) list(APPEND working_archs ${arch}) else() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Testing compiler for supporting ${os}-${arch}:\n" "${TEST_OUTPUT}\n") endif() endforeach() set(${valid_archs} ${working_archs} CACHE STRING "List of valid architectures for platform ${os}.") endfunction() # This function checks the host cpusubtype to see if it is post-haswell. Haswell # and later machines can run x86_64h binaries. Haswell is cpusubtype 8. function(darwin_filter_host_archs input output) list_intersect(tmp_var DARWIN_osx_ARCHS ${input}) execute_process( COMMAND sysctl hw.cpusubtype OUTPUT_VARIABLE SUBTYPE) string(REGEX MATCH "hw.cpusubtype: ([0-9]*)" SUBTYPE_MATCHED "${SUBTYPE}") set(HASWELL_SUPPORTED Off) if(SUBTYPE_MATCHED) if(${CMAKE_MATCH_1} GREATER 7) set(HASWELL_SUPPORTED On) endif() endif() if(NOT HASWELL_SUPPORTED) list(REMOVE_ITEM tmp_var x86_64h) endif() set(${output} ${tmp_var} PARENT_SCOPE) endfunction() # Read and process the exclude file into a list of symbols function(darwin_read_list_from_file output_var file) if(EXISTS ${file}) file(READ ${file} EXCLUDES) string(REPLACE "\n" ";" EXCLUDES ${EXCLUDES}) set(${output_var} ${EXCLUDES} PARENT_SCOPE) endif() endfunction() # this function takes an OS, architecture and minimum version and provides a # list of builtin functions to exclude function(darwin_find_excluded_builtins_list output_var) cmake_parse_arguments(LIB "" "OS;ARCH;MIN_VERSION" "" ${ARGN}) if(NOT LIB_OS OR NOT LIB_ARCH) message(FATAL_ERROR "Must specify OS and ARCH to darwin_find_excluded_builtins_list!") endif() darwin_read_list_from_file(${LIB_OS}_BUILTINS ${DARWIN_EXCLUDE_DIR}/${LIB_OS}.txt) darwin_read_list_from_file(${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS ${DARWIN_EXCLUDE_DIR}/${LIB_OS}-${LIB_ARCH}.txt) if(LIB_MIN_VERSION) file(GLOB builtin_lists ${DARWIN_EXCLUDE_DIR}/${LIB_OS}*-${LIB_ARCH}.txt) foreach(builtin_list ${builtin_lists}) string(REGEX MATCH "${LIB_OS}([0-9\\.]*)-${LIB_ARCH}.txt" VERSION_MATCHED "${builtin_list}") if (VERSION_MATCHED AND NOT CMAKE_MATCH_1 VERSION_LESS LIB_MIN_VERSION) if(NOT smallest_version) set(smallest_version ${CMAKE_MATCH_1}) elseif(CMAKE_MATCH_1 VERSION_LESS smallest_version) set(smallest_version ${CMAKE_MATCH_1}) endif() endif() endforeach() if(smallest_version) darwin_read_list_from_file(${LIB_ARCH}_${LIB_OS}_BUILTINS ${DARWIN_EXCLUDE_DIR}/${LIB_OS}${smallest_version}-${LIB_ARCH}.txt) endif() endif() set(${output_var} ${${LIB_ARCH}_${LIB_OS}_BUILTINS} ${${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS} ${${LIB_OS}_BUILTINS} PARENT_SCOPE) endfunction() # adds a single builtin library for a single OS & ARCH macro(darwin_add_builtin_library name suffix) cmake_parse_arguments(LIB "" "PARENT_TARGET;OS;ARCH" "SOURCES;CFLAGS;DEFS" ${ARGN}) set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}") add_library(${libname} STATIC ${LIB_SOURCES}) if(DARWIN_${LIB_OS}_SYSROOT) set(sysroot_flag -isysroot ${DARWIN_${LIB_OS}_SYSROOT}) endif() set_target_compile_flags(${libname} ${sysroot_flag} ${DARWIN_${LIB_OS}_BUILTIN_MIN_VER_FLAG} ${LIB_CFLAGS}) set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${libname}${COMPILER_RT_OS_SUFFIX}) set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES ${LIB_ARCH}) if(LIB_PARENT_TARGET) add_dependencies(${LIB_PARENT_TARGET} ${libname}) endif() list(APPEND ${LIB_OS}_${suffix}_libs ${libname}) list(APPEND ${LIB_OS}_${suffix}_lipo_flags -arch ${arch} $) endmacro() function(darwin_lipo_libs name) cmake_parse_arguments(LIB "" "PARENT_TARGET;OUTPUT_DIR;INSTALL_DIR" "LIPO_FLAGS;DEPENDS" ${ARGN}) if(LIB_DEPENDS AND LIB_LIPO_FLAGS) add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR} COMMAND lipo -output ${LIB_OUTPUT_DIR}/lib${name}.a -create ${LIB_LIPO_FLAGS} DEPENDS ${LIB_DEPENDS} ) add_custom_target(${name} DEPENDS ${LIB_OUTPUT_DIR}/lib${name}.a) add_dependencies(${LIB_PARENT_TARGET} ${name}) install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a DESTINATION ${LIB_INSTALL_DIR}) else() message(WARNING "Not generating lipo target for ${name} because no input libraries exist.") endif() endfunction() # Filter out generic versions of routines that are re-implemented in # architecture specific manner. This prevents multiple definitions of the # same symbols, making the symbol selection non-deterministic. function(darwin_filter_builtin_sources output_var exclude_or_include excluded_list) if(exclude_or_include STREQUAL "EXCLUDE") set(filter_action GREATER) set(filter_value -1) elseif(exclude_or_include STREQUAL "INCLUDE") set(filter_action LESS) set(filter_value 0) else() message(FATAL_ERROR "darwin_filter_builtin_sources called without EXCLUDE|INCLUDE") endif() set(intermediate ${ARGN}) foreach (_file ${intermediate}) get_filename_component(_name_we ${_file} NAME_WE) list(FIND ${excluded_list} ${_name_we} _found) if(_found ${filter_action} ${filter_value}) list(REMOVE_ITEM intermediate ${_file}) elseif(${_file} MATCHES ".*/.*\\.S" OR ${_file} MATCHES ".*/.*\\.c") get_filename_component(_name ${_file} NAME) string(REPLACE ".S" ".c" _cname "${_name}") list(REMOVE_ITEM intermediate ${_cname}) endif () endforeach () set(${output_var} ${intermediate} PARENT_SCOPE) endfunction() # Generates builtin libraries for all operating systems specified in ARGN. Each # OS library is constructed by lipo-ing together single-architecture libraries. macro(darwin_add_builtin_libraries) set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes) set(CFLAGS "-fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer") set(CMAKE_C_FLAGS "") set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") set(PROFILE_SOURCES ../profile/InstrProfiling ../profile/InstrProfilingBuffer ../profile/InstrProfilingPlatformDarwin ../profile/InstrProfilingWriter) foreach (os ${ARGN}) list_intersect(DARWIN_BUILTIN_ARCHS DARWIN_${os}_ARCHS BUILTIN_SUPPORTED_ARCH) foreach (arch ${DARWIN_BUILTIN_ARCHS}) darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS OS ${os} ARCH ${arch} MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER}) darwin_filter_builtin_sources(filtered_sources EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS ${${arch}_SOURCES}) darwin_add_builtin_library(clang_rt builtins OS ${os} ARCH ${arch} SOURCES ${filtered_sources} CFLAGS ${CFLAGS} -arch ${arch} PARENT_TARGET builtins) endforeach() # Don't build cc_kext libraries for simulator platforms if(NOT DARWIN_${os}_SKIP_CC_KEXT) foreach (arch ${DARWIN_BUILTIN_ARCHS}) # By not specifying MIN_VERSION this only reads the OS and OS-arch lists. # We don't want to filter out the builtins that are present in libSystem # because kexts can't link libSystem. darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS OS ${os} ARCH ${arch}) darwin_filter_builtin_sources(filtered_sources EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS ${${arch}_SOURCES}) # In addition to the builtins cc_kext includes some profile sources darwin_add_builtin_library(clang_rt cc_kext OS ${os} ARCH ${arch} SOURCES ${filtered_sources} ${PROFILE_SOURCES} CFLAGS ${CFLAGS} -arch ${arch} -mkernel DEFS KERNEL_USE PARENT_TARGET builtins) endforeach() set(archive_name clang_rt.cc_kext_${os}) if(${os} STREQUAL "osx") set(archive_name clang_rt.cc_kext) endif() darwin_lipo_libs(${archive_name} PARENT_TARGET builtins LIPO_FLAGS ${${os}_cc_kext_lipo_flags} DEPENDS ${${os}_cc_kext_libs} OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR} INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR}) endif() endforeach() # We put the x86 sim slices into the archives for their base OS foreach (os ${ARGN}) if(NOT ${os} MATCHES ".*sim$") darwin_lipo_libs(clang_rt.${os} PARENT_TARGET builtins LIPO_FLAGS ${${os}_builtins_lipo_flags} ${${os}sim_builtins_lipo_flags} DEPENDS ${${os}_builtins_libs} ${${os}sim_builtins_libs} OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR} INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR}) endif() endforeach() darwin_add_embedded_builtin_libraries() endmacro() macro(darwin_add_embedded_builtin_libraries) # this is a hacky opt-out. If you can't target both intel and arm # architectures we bail here. set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7) set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7) if(COMPILER_RT_SUPPORTED_ARCH MATCHES ".*armv.*") list(FIND COMPILER_RT_SUPPORTED_ARCH i386 i386_idx) if(i386_idx GREATER -1) list(APPEND DARWIN_HARD_FLOAT_ARCHS i386) endif() list(FIND COMPILER_RT_SUPPORTED_ARCH x86_64 x86_64_idx) if(x86_64_idx GREATER -1) list(APPEND DARWIN_HARD_FLOAT_ARCHS x86_64) endif() set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded) set(CFLAGS "-Oz -Wall -fomit-frame-pointer -ffreestanding") set(CMAKE_C_FLAGS "") set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") set(SOFT_FLOAT_FLAG -mfloat-abi=soft) set(HARD_FLOAT_FLAG -mfloat-abi=hard) set(ENABLE_PIC Off) set(PIC_FLAG -fPIC) set(STATIC_FLAG -static) set(DARWIN_macho_embedded_ARCHS armv6m armv7m armv7em armv7 i386 x86_64) set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") set(CFLAGS_i386 "-march=pentium") darwin_read_list_from_file(common_FUNCTIONS ${MACHO_SYM_DIR}/common.txt) darwin_read_list_from_file(thumb2_FUNCTIONS ${MACHO_SYM_DIR}/thumb2.txt) darwin_read_list_from_file(thumb2_64_FUNCTIONS ${MACHO_SYM_DIR}/thumb2-64.txt) darwin_read_list_from_file(arm_FUNCTIONS ${MACHO_SYM_DIR}/arm.txt) darwin_read_list_from_file(i386_FUNCTIONS ${MACHO_SYM_DIR}/i386.txt) set(armv6m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS}) set(armv7m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS}) set(armv7em_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS}) set(armv7_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS} ${thumb2_64_FUNCTIONS}) set(i386_FUNCTIONS ${common_FUNCTIONS} ${i386_FUNCTIONS}) set(x86_64_FUNCTIONS ${common_FUNCTIONS}) foreach(arch ${DARWIN_macho_embedded_ARCHS}) darwin_filter_builtin_sources(${arch}_filtered_sources INCLUDE ${arch}_FUNCTIONS ${${arch}_SOURCES}) if(NOT ${arch}_filtered_sources) message("${arch}_SOURCES: ${${arch}_SOURCES}") message("${arch}_FUNCTIONS: ${${arch}_FUNCTIONS}") message(FATAL_ERROR "Empty filtered sources!") endif() endforeach() foreach(float_type SOFT HARD) foreach(type PIC STATIC) string(TOLOWER "${float_type}_${type}" lib_suffix) foreach(arch ${DARWIN_${float_type}_FLOAT_ARCHS}) set(DARWIN_macho_embedded_SYSROOT ${DARWIN_osx_SYSROOT}) set(float_flag) if(${arch} MATCHES "^arm") # x86 targets are hard float by default, but the complain about the # float ABI flag, so don't pass it unless we're targeting arm. set(float_flag ${${float_type}_FLOAT_FLAG}) endif() darwin_add_builtin_library(clang_rt ${lib_suffix} OS macho_embedded ARCH ${arch} SOURCES ${${arch}_filtered_sources} CFLAGS ${CFLAGS} -arch ${arch} ${${type}_FLAG} ${float_flag} ${CFLAGS_${arch}} PARENT_TARGET builtins) endforeach() foreach(lib ${macho_embedded_${lib_suffix}_libs}) set_target_properties(${lib} PROPERTIES LINKER_LANGUAGE C) endforeach() darwin_lipo_libs(clang_rt.${lib_suffix} PARENT_TARGET builtins LIPO_FLAGS ${macho_embedded_${lib_suffix}_lipo_flags} DEPENDS ${macho_embedded_${lib_suffix}_libs} OUTPUT_DIR ${DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR} INSTALL_DIR ${DARWIN_macho_embedded_LIBRARY_INSTALL_DIR}) endforeach() endforeach() endif() endmacro() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/CompilerRTUtils.cmake0000664000175000017500000002052612771042144027743 0ustar mwhudsonmwhudsoninclude(CMakePushCheckState) include(CheckSymbolExists) # Because compiler-rt spends a lot of time setting up custom compile flags, # define a handy helper function for it. The compile flags setting in CMake # has serious issues that make its syntax challenging at best. function(set_target_compile_flags target) set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") endforeach() set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}") endfunction() function(set_target_link_flags target) set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") endforeach() set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}") endfunction() # Set the variable var_PYBOOL to True if var holds a true-ish string, # otherwise set it to False. macro(pythonize_bool var) if (${var}) set(${var}_PYBOOL True) else() set(${var}_PYBOOL False) endif() endmacro() # Appends value to all lists in ARGN, if the condition is true. macro(append_list_if condition value) if(${condition}) foreach(list ${ARGN}) list(APPEND ${list} ${value}) endforeach() endif() endmacro() # Appends value to all strings in ARGN, if the condition is true. macro(append_string_if condition value) if(${condition}) foreach(str ${ARGN}) set(${str} "${${str}} ${value}") endforeach() endif() endmacro() macro(append_rtti_flag polarity list) if(${polarity}) append_list_if(COMPILER_RT_HAS_FRTTI_FLAG -frtti ${list}) append_list_if(COMPILER_RT_HAS_GR_FLAG /GR ${list}) else() append_list_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list}) append_list_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list}) endif() endmacro() macro(append_have_file_definition filename varname list) check_include_file("${filename}" "${varname}") if (NOT ${varname}) set("${varname}" 0) endif() list(APPEND ${list} "${varname}=${${varname}}") endmacro() macro(list_intersect output input1 input2) set(${output}) foreach(it ${${input1}}) list(FIND ${input2} ${it} index) if( NOT (index EQUAL -1)) list(APPEND ${output} ${it}) endif() endforeach() endmacro() function(list_replace input_list old new) set(replaced_list) foreach(item ${${input_list}}) if(${item} STREQUAL ${old}) list(APPEND replaced_list ${new}) else() list(APPEND replaced_list ${item}) endif() endforeach() set(${input_list} "${replaced_list}" PARENT_SCOPE) endfunction() # Takes ${ARGN} and puts only supported architectures in @out_var list. function(filter_available_targets out_var) set(archs ${${out_var}}) foreach(arch ${ARGN}) list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) if(NOT (ARCH_INDEX EQUAL -1) AND CAN_TARGET_${arch}) list(APPEND archs ${arch}) endif() endforeach() set(${out_var} ${archs} PARENT_SCOPE) endfunction() function(check_compile_definition def argstring out_var) if("${def}" STREQUAL "") set(${out_var} TRUE PARENT_SCOPE) return() endif() cmake_push_check_state() set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${argstring}") check_symbol_exists(${def} "" ${out_var}) cmake_pop_check_state() endfunction() # test_target_arch( ) # Checks if architecture is supported: runs host compiler with provided # flags to verify that: # 1) is defined (if non-empty) # 2) simple file can be successfully built. # If successful, saves target flags for this architecture. macro(test_target_arch arch def) set(TARGET_${arch}_CFLAGS ${ARGN}) set(TARGET_${arch}_LINKFLAGS ${ARGN}) set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") endforeach() check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF) if(NOT DEFINED CAN_TARGET_${arch}) if(NOT HAS_${arch}_DEF) set(CAN_TARGET_${arch} FALSE) elseif(TEST_COMPILE_ONLY) try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS}) else() set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") set(FLAG_NO_EXCEPTIONS "") if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) set(FLAG_NO_EXCEPTIONS " -fno-exceptions ") endif() try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}" OUTPUT_VARIABLE TARGET_${arch}_OUTPUT CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}") endif() endif() if(${CAN_TARGET_${arch}}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" STREQUAL "${arch}" AND COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE) # Bail out if we cannot target the architecture we plan to test. message(FATAL_ERROR "Cannot compile for ${arch}:\n${TARGET_${arch}_OUTPUT}") endif() endmacro() macro(detect_target_arch) check_symbol_exists(__arm__ "" __ARM) check_symbol_exists(__aarch64__ "" __AARCH64) check_symbol_exists(__x86_64__ "" __X86_64) check_symbol_exists(__i686__ "" __I686) check_symbol_exists(__i386__ "" __I386) check_symbol_exists(__mips__ "" __MIPS) check_symbol_exists(__mips64__ "" __MIPS64) check_symbol_exists(__s390x__ "" __S390X) check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32) check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64) if(__ARM) add_default_target_arch(arm) elseif(__AARCH64) add_default_target_arch(aarch64) elseif(__X86_64) add_default_target_arch(x86_64) elseif(__I686) add_default_target_arch(i686) elseif(__I386) add_default_target_arch(i386) elseif(__MIPS64) # must be checked before __MIPS add_default_target_arch(mips64) elseif(__MIPS) add_default_target_arch(mips) elseif(__S390X) add_default_target_arch(s390x) elseif(__WEBASSEMBLY32) add_default_target_arch(wasm32) elseif(__WEBASSEMBLY64) add_default_target_arch(wasm64) endif() endmacro() macro(load_llvm_config) if (NOT LLVM_CONFIG_PATH) find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") if (NOT LLVM_CONFIG_PATH) message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") endif() endif() execute_process( COMMAND ${LLVM_CONFIG_PATH} "--obj-root" "--bindir" "--libdir" "--src-root" RESULT_VARIABLE HAD_ERROR OUTPUT_VARIABLE CONFIG_OUTPUT) if (HAD_ERROR) message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}") endif() string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) list(GET CONFIG_OUTPUT 0 BINARY_DIR) list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR) list(GET CONFIG_OUTPUT 2 LIBRARY_DIR) list(GET CONFIG_OUTPUT 3 MAIN_SRC_DIR) set(LLVM_BINARY_DIR ${BINARY_DIR} CACHE PATH "Path to LLVM build tree") set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin") set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib") set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") # Make use of LLVM CMake modules. file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") # Get some LLVM variables from LLVMConfig. include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) endmacro() macro(construct_compiler_rt_default_triple) set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${TARGET_TRIPLE} CACHE STRING "Default triple for which compiler-rt runtimes will be built.") if(DEFINED COMPILER_RT_TEST_TARGET_TRIPLE) # Backwards compatibility: this variable used to be called # COMPILER_RT_TEST_TARGET_TRIPLE. set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${COMPILER_RT_TEST_TARGET_TRIPLE}) endif() string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE}) list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH) list(GET TARGET_TRIPLE_LIST 1 COMPILER_RT_DEFAULT_TARGET_OS) list(GET TARGET_TRIPLE_LIST 2 COMPILER_RT_DEFAULT_TARGET_ABI) # Determine if test target triple is specified explicitly, and doesn't match the # default. if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL TARGET_TRIPLE) set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE TRUE) else() set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE FALSE) endif() endmacro() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/CompilerRTLink.cmake0000664000175000017500000000116212540707354027540 0ustar mwhudsonmwhudson# Link a shared library with COMPILER_RT_TEST_COMPILER. # clang_link_shared( # OBJECTS # LINKFLAGS # DEPS ) macro(clang_link_shared so_file) cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SOURCE_DEPS clang) endif() add_custom_command( OUTPUT ${so_file} COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} DEPENDS ${SOURCE_DEPS}) endmacro() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/SanitizerUtils.cmake0000664000175000017500000000600412726360451027672 0ustar mwhudsonmwhudsonset(SANITIZER_GEN_DYNAMIC_LIST ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/gen_dynamic_list.py) set(SANITIZER_LINT_SCRIPT ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/check_lint.sh) # Create a target "--symbols" that would generate the list of # symbols that need to be exported from sanitizer runtime "". Function # interceptors are exported automatically, user can also provide files with # symbol names that should be exported as well. # add_sanitizer_rt_symbols( # ARCHS # PARENT_TARGET # EXTRA ) macro(add_sanitizer_rt_symbols name) cmake_parse_arguments(ARG "" "PARENT_TARGET" "ARCHS;EXTRA" ${ARGN}) foreach(arch ${ARG_ARCHS}) set(target_name ${name}-${arch}) set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${target_name}.syms-stamp) set(extra_args) foreach(arg ${ARG_EXTRA}) list(APPEND extra_args "--extra" ${arg}) endforeach() add_custom_command(OUTPUT ${stamp} COMMAND ${PYTHON_EXECUTABLE} ${SANITIZER_GEN_DYNAMIC_LIST} ${extra_args} $ > $.syms COMMAND ${CMAKE_COMMAND} -E touch ${stamp} DEPENDS ${target_name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating exported symbols for ${target_name}" VERBATIM) add_custom_target(${target_name}-symbols ALL DEPENDS ${stamp} SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA}) install(FILES $.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) if(ARG_PARENT_TARGET) add_dependencies(${ARG_PARENT_TARGET} ${target_name}-symbols) endif() endforeach() endmacro() macro(add_sanitizer_rt_version_list name) set(vers ${CMAKE_CURRENT_BINARY_DIR}/${name}.vers) cmake_parse_arguments(ARG "" "" "LIBS;EXTRA" ${ARGN}) set(args) foreach(arg ${ARG_EXTRA}) list(APPEND args "--extra" ${arg}) endforeach() foreach(arg ${ARG_LIBS}) list(APPEND args "$") endforeach() add_custom_command(OUTPUT ${vers} COMMAND ${PYTHON_EXECUTABLE} ${SANITIZER_GEN_DYNAMIC_LIST} --version-list ${args} > ${vers} DEPENDS ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} ${ARG_LIBS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating version list for ${name}" VERBATIM) add_custom_target(${name}-version-list ALL DEPENDS ${vers}) endmacro() # Add target to check code style for sanitizer runtimes. if(CMAKE_HOST_UNIX) add_custom_target(SanitizerLintCheck COMMAND env LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR= PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} COMPILER_RT=${COMPILER_RT_SOURCE_DIR} ${SANITIZER_LINT_SCRIPT} DEPENDS ${SANITIZER_LINT_SCRIPT} COMMENT "Running lint check for sanitizer sources..." VERBATIM) endif() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/Modules/BuiltinTests.cmake0000664000175000017500000000701112764310376027334 0ustar mwhudsonmwhudsoninclude(CMakeCheckCompilerFlagCommonPatterns) # This function takes an OS and a list of architectures and identifies the # subset of the architectures list that the installed toolchain can target. function(try_compile_only output) cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN}) if(NOT ARG_SOURCE) set(ARG_SOURCE "int foo(int x, int y) { return x + y; }\n") endif() set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c) file(WRITE ${SIMPLE_C} "${ARG_SOURCE}\n") string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions ${CMAKE_C_COMPILE_OBJECT}) set(TRY_COMPILE_FLAGS "${ARG_FLAGS}") if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) list(APPEND TRY_COMPILE_FLAGS "-target ${CMAKE_C_COMPILER_TARGET}") endif() string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}") set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}") foreach(substitution ${substitutions}) if(substitution STREQUAL "") string(REPLACE "" "${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command}) elseif(substitution STREQUAL "") string(REPLACE "" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/test.o" test_compile_command ${test_compile_command}) elseif(substitution STREQUAL "") string(REPLACE "" "${SIMPLE_C}" test_compile_command ${test_compile_command}) elseif(substitution STREQUAL "") string(REPLACE "" "${CMAKE_C_FLAGS} ${extra_flags}" test_compile_command ${test_compile_command}) else() string(REPLACE "${substitution}" "" test_compile_command ${test_compile_command}) endif() endforeach() string(REPLACE " " ";" test_compile_command "${test_compile_command}") execute_process( COMMAND ${test_compile_command} RESULT_VARIABLE result OUTPUT_VARIABLE TEST_OUTPUT ERROR_VARIABLE TEST_ERROR ) CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCCompilerFlag_COMMON_PATTERNS) set(ERRORS_FOUND OFF) foreach(var ${_CheckCCompilerFlag_COMMON_PATTERNS}) if("${var}" STREQUAL "FAIL_REGEX") continue() endif() if("${TEST_ERROR}" MATCHES "${var}" OR "${TEST_OUTPUT}" MATCHES "${var}") set(ERRORS_FOUND ON) endif() endforeach() if(result EQUAL 0 AND NOT ERRORS_FOUND) set(${output} True PARENT_SCOPE) else() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Testing compiler for supporting " ${ARGN} ":\n" "Command: ${test_compile_command}\n" "${TEST_OUTPUT}\n${TEST_ERROR}\n${result}\n") set(${output} False PARENT_SCOPE) endif() endfunction() function(builtin_check_c_compiler_flag flag output) if(NOT DEFINED ${output}) message(STATUS "Performing Test ${output}") try_compile_only(result FLAGS ${flag}) set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}") if(${result}) message(STATUS "Performing Test ${output} - Success") else() message(STATUS "Performing Test ${output} - Failed") endif() endif() endfunction() function(builtin_check_c_compiler_source output source) if(NOT DEFINED ${output}) message(STATUS "Performing Test ${output}") try_compile_only(result SOURCE ${source}) set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}") if(${result}) message(STATUS "Performing Test ${output} - Success") else() message(STATUS "Performing Test ${output} - Failed") endif() endif() endfunction() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/config-ix.cmake0000664000175000017500000004622512775420063025165 0ustar mwhudsonmwhudsoninclude(CMakePushCheckState) include(CheckCXXCompilerFlag) include(CheckLibraryExists) include(CheckSymbolExists) include(TestBigEndian) function(check_linker_flag flag out_var) cmake_push_check_state() set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") check_cxx_compiler_flag("" ${out_var}) cmake_pop_check_state() endfunction() # CodeGen options. check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) check_cxx_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) check_cxx_compiler_flag(-fno-exceptions COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG) check_cxx_compiler_flag(-funwind-tables COMPILER_RT_HAS_FUNWIND_TABLES_FLAG) check_cxx_compiler_flag(-fno-stack-protector COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG) check_cxx_compiler_flag(-fno-sanitize=safe-stack COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG) check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) check_cxx_compiler_flag(-frtti COMPILER_RT_HAS_FRTTI_FLAG) check_cxx_compiler_flag(-fno-rtti COMPILER_RT_HAS_FNO_RTTI_FLAG) check_cxx_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG) check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG) check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG) check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC) check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG) check_cxx_compiler_flag(--sysroot=. COMPILER_RT_HAS_SYSROOT_FLAG) if(NOT WIN32 AND NOT CYGWIN) # MinGW warns if -fvisibility-inlines-hidden is used. check_cxx_compiler_flag("-fvisibility-inlines-hidden" COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG) endif() check_cxx_compiler_flag(/GR COMPILER_RT_HAS_GR_FLAG) check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG) check_cxx_compiler_flag(/MT COMPILER_RT_HAS_MT_FLAG) check_cxx_compiler_flag(/Oy COMPILER_RT_HAS_Oy_FLAG) # Debug info flags. check_cxx_compiler_flag(-gline-tables-only COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG) check_cxx_compiler_flag(-g COMPILER_RT_HAS_G_FLAG) check_cxx_compiler_flag(/Zi COMPILER_RT_HAS_Zi_FLAG) # Warnings. check_cxx_compiler_flag(-Wall COMPILER_RT_HAS_WALL_FLAG) check_cxx_compiler_flag(-Werror COMPILER_RT_HAS_WERROR_FLAG) check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG) check_cxx_compiler_flag("-Werror -Wglobal-constructors" COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG) check_cxx_compiler_flag("-Werror -Wc99-extensions" COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG) check_cxx_compiler_flag("-Werror -Wgnu" COMPILER_RT_HAS_WGNU_FLAG) check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor" COMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG) check_cxx_compiler_flag("-Werror -Wvariadic-macros" COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG) check_cxx_compiler_flag("-Werror -Wunused-parameter" COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG) check_cxx_compiler_flag(/W4 COMPILER_RT_HAS_W4_FLAG) check_cxx_compiler_flag(/WX COMPILER_RT_HAS_WX_FLAG) check_cxx_compiler_flag(/wd4146 COMPILER_RT_HAS_WD4146_FLAG) check_cxx_compiler_flag(/wd4291 COMPILER_RT_HAS_WD4291_FLAG) check_cxx_compiler_flag(/wd4221 COMPILER_RT_HAS_WD4221_FLAG) check_cxx_compiler_flag(/wd4391 COMPILER_RT_HAS_WD4391_FLAG) check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG) check_cxx_compiler_flag(/wd4800 COMPILER_RT_HAS_WD4800_FLAG) # Symbols. check_symbol_exists(__func__ "" COMPILER_RT_HAS_FUNC_SYMBOL) # Libraries. check_library_exists(c fopen "" COMPILER_RT_HAS_LIBC) check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL) check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT) check_library_exists(m pow "" COMPILER_RT_HAS_LIBM) check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD) check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX) # Linker flags. if(ANDROID) check_linker_flag("-Wl,-z,global" COMPILER_RT_HAS_Z_GLOBAL) check_library_exists(log __android_log_write "" COMPILER_RT_HAS_LIBLOG) endif() # Architectures. # List of all architectures we can target. set(COMPILER_RT_SUPPORTED_ARCH) # Try to compile a very simple source file to ensure we can target the given # platform. We use the results of these tests to build only the various target # runtime libraries supported by our current compilers cross-compiling # abilities. set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc) file(WRITE ${SIMPLE_SOURCE} "#include \n#include \nint main() { printf(\"hello, world\"); }\n") # Add $arch as supported with no additional flags. macro(add_default_target_arch arch) set(TARGET_${arch}_CFLAGS "") set(CAN_TARGET_${arch} 1) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) endmacro() # Detect whether the current target platform is 32-bit or 64-bit, and setup # the correct commandline flags needed to attempt to target 32-bit and 64-bit. if (NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8) message(FATAL_ERROR "Please use architecture with 4 or 8 byte pointers.") endif() test_targets() # Returns a list of architecture specific target cflags in @out_var list. function(get_target_flags_for_arch arch out_var) list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) if(ARCH_INDEX EQUAL -1) message(FATAL_ERROR "Unsupported architecture: ${arch}") else() if (NOT APPLE) set(${out_var} ${TARGET_${arch}_CFLAGS} PARENT_SCOPE) else() # This is only called in constructing cflags for tests executing on the # host. This will need to all be cleaned up to support building tests # for cross-targeted hardware (i.e. iOS). set(${out_var} -arch ${arch} PARENT_SCOPE) endif() endif() endfunction() set(ARM64 aarch64) set(ARM32 arm armhf) set(X86 i386 i686) set(X86_64 x86_64) set(MIPS32 mips mipsel) set(MIPS64 mips64 mips64el) set(PPC64 powerpc64 powerpc64le) set(S390X s390x) set(WASM32 wasm32) set(WASM64 wasm64) if(APPLE) set(ARM64 arm64) set(ARM32 armv7 armv7s armv7k) set(X86_64 x86_64 x86_64h) endif() set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X}) set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${PPC64}) set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) set(ALL_LSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64} ${MIPS32} ${MIPS64}) set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}) set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64}) set(ALL_ESAN_SUPPORTED_ARCH ${X86_64} ${MIPS64}) set(ALL_SCUDO_SUPPORTED_ARCH ${X86_64}) set(ALL_XRAY_SUPPORTED_ARCH ${X86_64} ${ARM32}) if(APPLE) include(CompilerRTDarwinUtils) find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx) find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator) find_darwin_sdk_dir(DARWIN_ios_SYSROOT iphoneos) find_darwin_sdk_dir(DARWIN_watchossim_SYSROOT watchsimulator) find_darwin_sdk_dir(DARWIN_watchos_SYSROOT watchos) find_darwin_sdk_dir(DARWIN_tvossim_SYSROOT appletvsimulator) find_darwin_sdk_dir(DARWIN_tvos_SYSROOT appletvos) if(NOT DARWIN_osx_SYSROOT) if(EXISTS /usr/include) set(DARWIN_osx_SYSROOT /) else() message(ERROR "Could not detect OS X Sysroot. Either install Xcode or the Apple Command Line Tools") endif() endif() if(COMPILER_RT_ENABLE_IOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min) set(DARWIN_ios_SANITIZER_MIN_VER_FLAG ${DARWIN_ios_MIN_VER_FLAG}=7.0) endif() if(COMPILER_RT_ENABLE_WATCHOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS watchos) set(DARWIN_watchos_MIN_VER_FLAG -mwatchos-version-min) set(DARWIN_watchos_SANITIZER_MIN_VER_FLAG ${DARWIN_watchos_MIN_VER_FLAG}=2.0) endif() if(COMPILER_RT_ENABLE_TVOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS tvos) set(DARWIN_tvos_MIN_VER_FLAG -mtvos-version-min) set(DARWIN_tvos_SANITIZER_MIN_VER_FLAG ${DARWIN_tvos_MIN_VER_FLAG}=9.0) endif() # Note: In order to target x86_64h on OS X the minimum deployment target must # be 10.8 or higher. set(SANITIZER_COMMON_SUPPORTED_OS osx) set(PROFILE_SUPPORTED_OS osx) set(TSAN_SUPPORTED_OS osx) if(NOT SANITIZER_MIN_OSX_VERSION) string(REGEX MATCH "-mmacosx-version-min=([.0-9]+)" MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}") if(MACOSX_VERSION_MIN_FLAG) set(SANITIZER_MIN_OSX_VERSION "${CMAKE_MATCH_1}") elseif(CMAKE_OSX_DEPLOYMENT_TARGET) set(SANITIZER_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) else() set(SANITIZER_MIN_OSX_VERSION 10.9) endif() if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7") message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}") endif() endif() # We're setting the flag manually for each target OS set(CMAKE_OSX_DEPLOYMENT_TARGET "") set(DARWIN_COMMON_CFLAGS -stdlib=libc++) set(DARWIN_COMMON_LINKFLAGS -stdlib=libc++ -lc++ -lc++abi) check_linker_flag("-fapplication-extension" COMPILER_RT_HAS_APP_EXTENSION) if(COMPILER_RT_HAS_APP_EXTENSION) list(APPEND DARWIN_COMMON_LINKFLAGS "-fapplication-extension") endif() set(DARWIN_osx_CFLAGS ${DARWIN_COMMON_CFLAGS} -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) set(DARWIN_osx_LINKFLAGS ${DARWIN_COMMON_LINKFLAGS} -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) if(DARWIN_osx_SYSROOT) list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT}) list(APPEND DARWIN_osx_LINKFLAGS -isysroot ${DARWIN_osx_SYSROOT}) endif() # Figure out which arches to use for each OS darwin_get_toolchain_supported_archs(toolchain_arches) message(STATUS "Toolchain supported arches: ${toolchain_arches}") if(NOT MACOSX_VERSION_MIN_FLAG) darwin_test_archs(osx DARWIN_osx_ARCHS ${toolchain_arches}) message(STATUS "OSX supported arches: ${DARWIN_osx_ARCHS}") foreach(arch ${DARWIN_osx_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) endforeach() foreach(platform ${DARWIN_EMBEDDED_PLATFORMS}) if(DARWIN_${platform}sim_SYSROOT) set(DARWIN_${platform}sim_CFLAGS ${DARWIN_COMMON_CFLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}sim_SYSROOT}) set(DARWIN_${platform}sim_LINKFLAGS ${DARWIN_COMMON_LINKFLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}sim_SYSROOT}) set(DARWIN_${platform}sim_SKIP_CC_KEXT On) darwin_test_archs(${platform}sim DARWIN_${platform}sim_ARCHS ${toolchain_arches}) message(STATUS "${platform} Simulator supported arches: ${DARWIN_${platform}sim_ARCHS}") if(DARWIN_${platform}sim_ARCHS) list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}sim) list(APPEND PROFILE_SUPPORTED_OS ${platform}sim) if(DARWIN_${platform}_SYSROOT_INTERNAL) list(APPEND TSAN_SUPPORTED_OS ${platform}sim) endif() endif() foreach(arch ${DARWIN_${platform}sim_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) endforeach() endif() if(DARWIN_${platform}_SYSROOT) set(DARWIN_${platform}_CFLAGS ${DARWIN_COMMON_CFLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}_SYSROOT}) set(DARWIN_${platform}_LINKFLAGS ${DARWIN_COMMON_LINKFLAGS} ${DARWIN_${platform}_SANITIZER_MIN_VER_FLAG} -isysroot ${DARWIN_${platform}_SYSROOT}) darwin_test_archs(${platform} DARWIN_${platform}_ARCHS ${toolchain_arches}) message(STATUS "${platform} supported arches: ${DARWIN_${platform}_ARCHS}") if(DARWIN_${platform}_ARCHS) list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}) list(APPEND PROFILE_SUPPORTED_OS ${platform}) endif() foreach(arch ${DARWIN_${platform}_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) endforeach() endif() endforeach() endif() # for list_intersect include(CompilerRTUtils) list_intersect(SANITIZER_COMMON_SUPPORTED_ARCH ALL_SANITIZER_COMMON_SUPPORTED_ARCH COMPILER_RT_SUPPORTED_ARCH ) set(LSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) set(UBSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) list_intersect(ASAN_SUPPORTED_ARCH ALL_ASAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(DFSAN_SUPPORTED_ARCH ALL_DFSAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(LSAN_SUPPORTED_ARCH ALL_LSAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(MSAN_SUPPORTED_ARCH ALL_MSAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(PROFILE_SUPPORTED_ARCH ALL_PROFILE_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(TSAN_SUPPORTED_ARCH ALL_TSAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(UBSAN_SUPPORTED_ARCH ALL_UBSAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(SAFESTACK_SUPPORTED_ARCH ALL_SAFESTACK_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(CFI_SUPPORTED_ARCH ALL_CFI_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(ESAN_SUPPORTED_ARCH ALL_ESAN_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(SCUDO_SUPPORTED_ARCH ALL_SCUDO_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(XRAY_SUPPORTED_ARCH ALL_XRAY_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) else() # Architectures supported by compiler-rt libraries. filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH ${ALL_SANITIZER_COMMON_SUPPORTED_ARCH}) # LSan and UBSan common files should be available on all architectures # supported by other sanitizers (even if they build into dummy object files). filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) filter_available_targets(UBSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) filter_available_targets(ASAN_SUPPORTED_ARCH ${ALL_ASAN_SUPPORTED_ARCH}) filter_available_targets(DFSAN_SUPPORTED_ARCH ${ALL_DFSAN_SUPPORTED_ARCH}) filter_available_targets(LSAN_SUPPORTED_ARCH ${ALL_LSAN_SUPPORTED_ARCH}) filter_available_targets(MSAN_SUPPORTED_ARCH ${ALL_MSAN_SUPPORTED_ARCH}) filter_available_targets(PROFILE_SUPPORTED_ARCH ${ALL_PROFILE_SUPPORTED_ARCH}) filter_available_targets(TSAN_SUPPORTED_ARCH ${ALL_TSAN_SUPPORTED_ARCH}) filter_available_targets(UBSAN_SUPPORTED_ARCH ${ALL_UBSAN_SUPPORTED_ARCH}) filter_available_targets(SAFESTACK_SUPPORTED_ARCH ${ALL_SAFESTACK_SUPPORTED_ARCH}) filter_available_targets(CFI_SUPPORTED_ARCH ${ALL_CFI_SUPPORTED_ARCH}) filter_available_targets(ESAN_SUPPORTED_ARCH ${ALL_ESAN_SUPPORTED_ARCH}) filter_available_targets(SCUDO_SUPPORTED_ARCH ${ALL_SCUDO_SUPPORTED_ARCH}) filter_available_targets(XRAY_SUPPORTED_ARCH ${ALL_XRAY_SUPPORTED_ARCH}) endif() if (MSVC) # See if the DIA SDK is available and usable. set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) set(CAN_SYMBOLIZE 1) else() set(CAN_SYMBOLIZE 0) endif() else() set(CAN_SYMBOLIZE 1) endif() find_program(GOLD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.gold ld.gold ${LLVM_DEFAULT_TARGET_TRIPLE}-ld ld DOC "The gold linker") message(STATUS "Compiler-RT supported architectures: ${COMPILER_RT_SUPPORTED_ARCH}") if(ANDROID) set(OS_NAME "Android") else() set(OS_NAME "${CMAKE_SYSTEM_NAME}") endif() set(ALL_SANITIZERS asan;dfsan;msan;tsan;safestack;cfi;esan;scudo) set(COMPILER_RT_SANITIZERS_TO_BUILD ${ALL_SANITIZERS} CACHE STRING "sanitizers to build if supported on the target (all;${ALL_SANITIZERS})") list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}") if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR (OS_NAME MATCHES "Windows" AND (NOT MINGW AND NOT CYGWIN)))) set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE) else() set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON) set(COMPILER_RT_HAS_INTERCEPTION TRUE) else() set(COMPILER_RT_HAS_INTERCEPTION FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND ASAN_SUPPORTED_ARCH) set(COMPILER_RT_HAS_ASAN TRUE) else() set(COMPILER_RT_HAS_ASAN FALSE) endif() if (OS_NAME MATCHES "Linux|FreeBSD|Windows") set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME TRUE) else() set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME FALSE) endif() # TODO: Add builtins support. if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_DFSAN TRUE) else() set(COMPILER_RT_HAS_DFSAN FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux|FreeBSD") set(COMPILER_RT_HAS_LSAN TRUE) else() set(COMPILER_RT_HAS_LSAN FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND MSAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_MSAN TRUE) else() set(COMPILER_RT_HAS_MSAN FALSE) endif() if (PROFILE_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows") set(COMPILER_RT_HAS_PROFILE TRUE) else() set(COMPILER_RT_HAS_PROFILE FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Darwin|Linux|FreeBSD") set(COMPILER_RT_HAS_TSAN TRUE) else() set(COMPILER_RT_HAS_TSAN FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows") set(COMPILER_RT_HAS_UBSAN TRUE) else() set(COMPILER_RT_HAS_UBSAN FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND OS_NAME MATCHES "Darwin|Linux|FreeBSD") set(COMPILER_RT_HAS_SAFESTACK TRUE) else() set(COMPILER_RT_HAS_SAFESTACK FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND CFI_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_CFI TRUE) else() set(COMPILER_RT_HAS_CFI FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND ESAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_ESAN TRUE) else() set(COMPILER_RT_HAS_ESAN FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND SCUDO_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_SCUDO TRUE) else() set(COMPILER_RT_HAS_SCUDO FALSE) endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND XRAY_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_XRAY TRUE) else() set(COMPILER_RT_HAS_XRAY FALSE) endif() golang-1.8-race-detector-runtime_0.0+svn285455/cmake/builtin-config-ix.cmake0000664000175000017500000001372012756660653026635 0ustar mwhudsonmwhudsoninclude(BuiltinTests) include(CheckCSourceCompiles) # Make all the tests only check the compiler set(TEST_COMPILE_ONLY On) builtin_check_c_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) builtin_check_c_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) builtin_check_c_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) builtin_check_c_compiler_flag(-std=c99 COMPILER_RT_HAS_STD_C99_FLAG) builtin_check_c_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG) builtin_check_c_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG) builtin_check_c_compiler_flag(-ffreestanding COMPILER_RT_HAS_FREESTANDING_FLAG) builtin_check_c_compiler_source(COMPILER_RT_HAS_ATOMIC_KEYWORD " int foo(int x, int y) { _Atomic int result = x * y; return result; } ") set(ARM64 aarch64) set(ARM32 arm armhf) set(X86 i386 i686) set(X86_64 x86_64) set(MIPS32 mips mipsel) set(MIPS64 mips64 mips64el) set(PPC64 powerpc64 powerpc64le) set(WASM32 wasm32) set(WASM64 wasm64) if(APPLE) set(ARM64 arm64) set(ARM32 armv7 armv7k armv7s) set(X86_64 x86_64 x86_64h) endif() set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${WASM32} ${WASM64}) include(CompilerRTUtils) include(CompilerRTDarwinUtils) if(APPLE) find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx) find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator) find_darwin_sdk_dir(DARWIN_ios_SYSROOT iphoneos) find_darwin_sdk_dir(DARWIN_watchossim_SYSROOT watchsimulator) find_darwin_sdk_dir(DARWIN_watchos_SYSROOT watchos) find_darwin_sdk_dir(DARWIN_tvossim_SYSROOT appletvsimulator) find_darwin_sdk_dir(DARWIN_tvos_SYSROOT appletvos) set(DARWIN_EMBEDDED_PLATFORMS) set(DARWIN_osx_BUILTIN_MIN_VER 10.5) set(DARWIN_osx_BUILTIN_MIN_VER_FLAG -mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER}) if(COMPILER_RT_ENABLE_IOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min) set(DARWIN_ios_BUILTIN_MIN_VER 6.0) set(DARWIN_ios_BUILTIN_MIN_VER_FLAG ${DARWIN_ios_MIN_VER_FLAG}=${DARWIN_ios_BUILTIN_MIN_VER}) endif() if(COMPILER_RT_ENABLE_WATCHOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS watchos) set(DARWIN_watchos_MIN_VER_FLAG -mwatchos-version-min) set(DARWIN_watchos_BUILTIN_MIN_VER 2.0) set(DARWIN_watchos_BUILTIN_MIN_VER_FLAG ${DARWIN_watchos_MIN_VER_FLAG}=${DARWIN_watchos_BUILTIN_MIN_VER}) endif() if(COMPILER_RT_ENABLE_TVOS) list(APPEND DARWIN_EMBEDDED_PLATFORMS tvos) set(DARWIN_tvos_MIN_VER_FLAG -mtvos-version-min) set(DARWIN_tvos_BUILTIN_MIN_VER 9.0) set(DARWIN_tvos_BUILTIN_MIN_VER_FLAG ${DARWIN_tvos_MIN_VER_FLAG}=${DARWIN_tvos_BUILTIN_MIN_VER}) endif() set(BUILTIN_SUPPORTED_OS osx) # We're setting the flag manually for each target OS set(CMAKE_OSX_DEPLOYMENT_TARGET "") if(NOT DARWIN_osx_ARCHS) set(DARWIN_osx_ARCHS i386 x86_64 x86_64h) endif() set(DARWIN_sim_ARCHS i386 x86_64) set(DARWIN_device_ARCHS armv7 armv7s armv7k arm64) message(STATUS "OSX supported arches: ${DARWIN_osx_ARCHS}") foreach(arch ${DARWIN_osx_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) endforeach() # Need to build a 10.4 compatible libclang_rt set(DARWIN_10.4_SYSROOT ${DARWIN_osx_SYSROOT}) set(DARWIN_10.4_BUILTIN_MIN_VER 10.4) set(DARWIN_10.4_BUILTIN_MIN_VER_FLAG -mmacosx-version-min=${DARWIN_10.4_BUILTIN_MIN_VER}) set(DARWIN_10.4_SKIP_CC_KEXT On) darwin_test_archs(10.4 DARWIN_10.4_ARCHS i386 x86_64) message(STATUS "OSX 10.4 supported builtin arches: ${DARWIN_10.4_ARCHS}") if(DARWIN_10.4_ARCHS) # don't include the Haswell slice in the 10.4 compatibility library list(REMOVE_ITEM DARWIN_10.4_ARCHS x86_64h) list(APPEND BUILTIN_SUPPORTED_OS 10.4) endif() foreach(platform ${DARWIN_EMBEDDED_PLATFORMS}) if(DARWIN_${platform}sim_SYSROOT) set(DARWIN_${platform}sim_BUILTIN_MIN_VER ${DARWIN_${platform}_BUILTIN_MIN_VER}) set(DARWIN_${platform}sim_BUILTIN_MIN_VER_FLAG ${DARWIN_${platform}_BUILTIN_MIN_VER_FLAG}) set(DARWIN_${platform}sim_SKIP_CC_KEXT On) set(test_arches ${DARWIN_sim_ARCHS}) if(DARWIN_${platform}sim_ARCHS) set(test_arches DARWIN_${platform}sim_ARCHS) endif() darwin_test_archs(${platform}sim DARWIN_${platform}sim_ARCHS ${test_arches}) message(STATUS "${platform} Simulator supported builtin arches: ${DARWIN_${platform}sim_ARCHS}") if(DARWIN_${platform}sim_ARCHS) list(APPEND BUILTIN_SUPPORTED_OS ${platform}sim) endif() foreach(arch ${DARWIN_${platform}sim_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) endforeach() endif() if(DARWIN_${platform}_SYSROOT) set(test_arches ${DARWIN_device_ARCHS}) if(DARWIN_${platform}_ARCHS) set(test_arches DARWIN_${platform}_ARCHS) endif() darwin_test_archs(${platform} DARWIN_${platform}_ARCHS ${test_arches}) message(STATUS "${platform} supported builtin arches: ${DARWIN_${platform}_ARCHS}") if(DARWIN_${platform}_ARCHS) list(APPEND BUILTIN_SUPPORTED_OS ${platform}) endif() foreach(arch ${DARWIN_${platform}_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) endforeach() endif() endforeach() list_intersect(BUILTIN_SUPPORTED_ARCH ALL_BUILTIN_SUPPORTED_ARCH COMPILER_RT_SUPPORTED_ARCH) else() # If we're not building the builtins standalone, just rely on the tests in # config-ix.cmake to tell us what to build. Otherwise we need to do some leg # work here... if(COMPILER_RT_BUILTINS_STANDALONE_BUILD) test_targets() endif() # Architectures supported by compiler-rt libraries. filter_available_targets(BUILTIN_SUPPORTED_ARCH ${ALL_BUILTIN_SUPPORTED_ARCH}) endif() message(STATUS "Builtin supported architectures: ${BUILTIN_SUPPORTED_ARCH}") golang-1.8-race-detector-runtime_0.0+svn285455/cmake/caches/0000775000175000017500000000000013040224625023505 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/cmake/caches/Apple.cmake0000664000175000017500000000143012710452535025554 0ustar mwhudsonmwhudson# This file sets up a CMakeCache for Apple-style builds of compiler-rt. # This configuration matches Apple uses when shipping Xcode releases. set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "") set(COMPILER_RT_HAS_SAFESTACK OFF CACHE BOOL "") set(COMPILER_RT_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "") set(CMAKE_MACOSX_RPATH ON CACHE BOOL "") set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "") set(CMAKE_ASM_FLAGS_RELEASE "-O3" CACHE STRING "") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") set(CMAKE_ASM_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "") golang-1.8-race-detector-runtime_0.0+svn285455/CMakeLists.txt0000664000175000017500000002461112776132747023765 0ustar mwhudsonmwhudson# CMake build for CompilerRT. # # This build assumes that CompilerRT is checked out into the # 'projects/compiler-rt' or 'runtimes/compiler-rt' inside of an LLVM tree. # Standalone build system for CompilerRT is not yet ready. # # An important constraint of the build is that it only produces libraries # based on the ability of the host toolchain to target various platforms. # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) project(CompilerRT C CXX ASM) set(COMPILER_RT_STANDALONE_BUILD TRUE) endif() cmake_minimum_required(VERSION 3.4.3) # FIXME: # The OLD behavior (pre 3.2) for this policy is to not set the value of the # CMAKE_EXE_LINKER_FLAGS variable in the generated test project. The NEW behavior # for this policy is to set the value of the CMAKE_EXE_LINKER_FLAGS variable # in the test project to the same as it is in the calling project. The new # behavior cause the compiler_rt test to fail during try_compile: see # projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:121 such that # CAN_TARGET_${arch} is not set properly. This results in COMPILER_RT_SUPPORTED_ARCH # not being updated properly leading to poblems. cmake_policy(SET CMP0056 OLD) # Add path for custom compiler-rt modules. list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ) include(base-config-ix) include(CompilerRTUtils) option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON) mark_as_advanced(COMPILER_RT_BUILD_BUILTINS) option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON) mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS) option(COMPILER_RT_BUILD_XRAY "Build xray" ON) mark_as_advanced(COMPILER_RT_BUILD_XRAY) if (COMPILER_RT_STANDALONE_BUILD) load_llvm_config() # Find Python interpreter. set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5) include(FindPythonInterp) if(NOT PYTHONINTERP_FOUND) message(FATAL_ERROR " Unable to find Python interpreter required testing. Please install Python or specify the PYTHON_EXECUTABLE CMake variable.") endif() # Define default arguments to lit. set(LIT_ARGS_DEFAULT "-sv") if (MSVC OR XCODE) set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") endif() set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") endif() construct_compiler_rt_default_triple() if ("${COMPILER_RT_DEFAULT_TARGET_ABI}" STREQUAL "androideabi") set(ANDROID 1) endif() set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) # We support running instrumented tests when we're not cross compiling # and target a UNIX-like system or Windows. # We can run tests on Android even when we are cross-compiling. if(("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND (UNIX OR WIN32)) OR ANDROID OR COMPILER_RT_EMULATOR) option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON) else() option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" OFF) endif() option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF) option(COMPILER_RT_EXTERNALIZE_DEBUGINFO "Generate dSYM files and strip executables and libraries (Darwin Only)" OFF) # COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in. pythonize_bool(COMPILER_RT_DEBUG) include(config-ix) if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9") # Mac OS X prior to 10.9 had problems with exporting symbols from # libc++/libc++abi. set(use_cxxabi_default OFF) elseif(MSVC) set(use_cxxabi_default OFF) else() set(use_cxxabi_default ON) endif() option(SANITIZER_CAN_USE_CXXABI "Sanitizers can use cxxabi" ${use_cxxabi_default}) pythonize_bool(SANITIZER_CAN_USE_CXXABI) #================================ # Setup Compiler Flags #================================ if(MSVC) # Override any existing /W flags with /W4. This is what LLVM does. Failing to # remove other /W[0-4] flags will result in a warning about overriding a # previous flag. if (COMPILER_RT_HAS_W4_FLAG) string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") append_string_if(COMPILER_RT_HAS_W4_FLAG /W4 CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() else() append_string_if(COMPILER_RT_HAS_WALL_FLAG -Wall CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() if(COMPILER_RT_ENABLE_WERROR) append_string_if(COMPILER_RT_HAS_WERROR_FLAG -Werror CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append_string_if(COMPILER_RT_HAS_WX_FLAG /WX CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() append_string_if(COMPILER_RT_HAS_STD_CXX11_FLAG -std=c++11 CMAKE_CXX_FLAGS) # Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP. if(NOT COMPILER_RT_HAS_FUNC_SYMBOL) add_definitions(-D__func__=__FUNCTION__) endif() # Provide some common commmandline flags for Sanitizer runtimes. if(NOT WIN32) append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC SANITIZER_COMMON_CFLAGS) endif() append_list_if(COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions SANITIZER_COMMON_CFLAGS) if(NOT COMPILER_RT_DEBUG) append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS) endif() append_list_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG -fvisibility-inlines-hidden SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto SANITIZER_COMMON_CFLAGS) if(MSVC) # Replace the /M[DT][d] flags with /MT, and strip any definitions of _DEBUG, # which cause definition mismatches at link time. # FIXME: In fact, sanitizers should support both /MT and /MD, see PR20214. if(COMPILER_RT_HAS_MT_FLAG) foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) string(REGEX REPLACE "/M[DT]d" "/MT" ${flag_var} "${${flag_var}}") string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") string(REGEX REPLACE "/D_DEBUG" "" ${flag_var} "${${flag_var}}") endforeach() endif() append_list_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS) # VS 2015 (version 1900) added support for thread safe static initialization. # However, ASan interceptors run before CRT initialization, which causes the # new thread safe code to crash. Disable this feature for now. if (MSVC_VERSION GREATER 1899 OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") list(APPEND SANITIZER_COMMON_CFLAGS /Zc:threadSafeInit-) endif() endif() append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) # Build with optimization, unless we're in debug mode. If we're using MSVC, # always respect the optimization flags set by CMAKE_BUILD_TYPE instead. if(NOT COMPILER_RT_DEBUG AND NOT MSVC) list(APPEND SANITIZER_COMMON_CFLAGS -O3) endif() # Determine if we should restrict stack frame sizes. # Stack frames on PowerPC and Mips and in debug biuld can be much larger than # anticipated. # FIXME: Fix all sanitizers and add -Wframe-larger-than to # SANITIZER_COMMON_FLAGS if(COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG AND NOT COMPILER_RT_DEBUG AND NOT ${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "powerpc|mips") set(SANITIZER_LIMIT_FRAME_SIZE TRUE) else() set(SANITIZER_LIMIT_FRAME_SIZE FALSE) endif() # Build sanitizer runtimes with debug info. if(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) elseif(COMPILER_RT_HAS_G_FLAG) list(APPEND SANITIZER_COMMON_CFLAGS -g) elseif(MSVC) # Use /Z7 instead of /Zi for the asan runtime. This avoids the LNK4099 # warning from the MS linker complaining that it can't find the 'vc140.pdb' # file used by our object library compilations. list(APPEND SANITIZER_COMMON_CFLAGS /Z7) llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/Z[i7I]" "/Z7") llvm_replace_compiler_option(CMAKE_CXX_FLAGS_DEBUG "/Z[i7I]" "/Z7") llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7") endif() if(LLVM_ENABLE_MODULES) # Sanitizers cannot be built with -fmodules. The interceptors intentionally # don't include system headers, which is incompatible with modules. list(APPEND SANITIZER_COMMON_CFLAGS -fno-modules) endif() # Turn off several warnings. append_list_if(COMPILER_RT_HAS_WGNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG -Wno-c99-extensions SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG -Wno-non-virtual-dtor SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WD4146_FLAG /wd4146 SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WD4291_FLAG /wd4291 SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WD4391_FLAG /wd4391 SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WD4722_FLAG /wd4722 SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_WD4800_FLAG /wd4800 SANITIZER_COMMON_CFLAGS) # Warnings to turn off for all libraries, not just sanitizers. append_string_if(COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG -Wno-unused-parameter CMAKE_C_FLAGS CMAKE_CXX_FLAGS) add_subdirectory(include) set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx) if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/) set(COMPILER_RT_HAS_LIBCXX_SOURCES TRUE) else() set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE) endif() set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld) if(EXISTS ${COMPILER_RT_LLD_PATH}/) set(COMPILER_RT_HAS_LLD_SOURCES TRUE) else() set(COMPILER_RT_HAS_LLD_SOURCES FALSE) endif() pythonize_bool(COMPILER_RT_HAS_LLD_SOURCES) add_subdirectory(lib) if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(unittests) add_subdirectory(test) endif() golang-1.8-race-detector-runtime_0.0+svn285455/test/0000775000175000017500000000000013040224625022156 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/0000775000175000017500000000000013040224625023266 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/CMakeLists.txt0000664000175000017500000000375712741012374026045 0ustar mwhudsonmwhudsonset(UBSAN_LIT_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(UBSAN_TESTSUITES) set(UBSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) macro(add_ubsan_testsuite test_mode sanitizer arch) set(UBSAN_LIT_TEST_MODE "${test_mode}") set(CONFIG_NAME ${UBSAN_LIT_TEST_MODE}-${arch}) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND UBSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND UBSAN_TEST_DEPS ${sanitizer}) endif() endmacro() set(UBSAN_TEST_ARCH ${UBSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(UBSAN_SUPPORTED_ARCH UBSAN_TEST_ARCH) endif() foreach(arch ${UBSAN_TEST_ARCH}) set(UBSAN_TEST_TARGET_ARCH ${arch}) if(${arch} MATCHES "arm|aarch64") # This is only true if we're cross-compiling. set(UBSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} UBSAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " UBSAN_TEST_TARGET_CFLAGS "${UBSAN_TEST_TARGET_CFLAGS}") endif() add_ubsan_testsuite("Standalone" ubsan ${arch}) if(COMPILER_RT_HAS_ASAN AND ";${ASAN_SUPPORTED_ARCH};" MATCHES ";${arch};") # TODO(wwchrome): Re-enable ubsan for asan win 64-bit when ready. # Disable ubsan with AddressSanitizer tests for Windows 64-bit. if(NOT OS_NAME MATCHES "Windows" OR CMAKE_SIZEOF_VOID_P EQUAL 4) add_ubsan_testsuite("AddressSanitizer" asan ${arch}) endif() endif() if(COMPILER_RT_HAS_MSAN AND ";${MSAN_SUPPORTED_ARCH};" MATCHES ";${arch};") add_ubsan_testsuite("MemorySanitizer" msan ${arch}) endif() if(COMPILER_RT_HAS_TSAN AND ";${TSAN_SUPPORTED_ARCH};" MATCHES ";${arch};") add_ubsan_testsuite("ThreadSanitizer" tsan ${arch}) endif() endforeach() add_lit_testsuite(check-ubsan "Running UndefinedBehaviorSanitizer tests" ${UBSAN_TESTSUITES} DEPENDS ${UBSAN_TEST_DEPS}) set_target_properties(check-ubsan PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/lit.site.cfg.in0000664000175000017500000000073712704361721026123 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.ubsan_lit_test_mode = "@UBSAN_LIT_TEST_MODE@" config.target_cflags = "@UBSAN_TEST_TARGET_CFLAGS@" config.target_arch = "@UBSAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@UBSAN_LIT_TESTS_DIR@/lit.common.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/lit.common.cfg0000664000175000017500000000610012653727130026033 0ustar mwhudsonmwhudson# -*- Python -*- import os def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: lit_config.fatal( "No attribute %r in test configuration! You may need to run " "tests from your build directory or add this attribute " "to lit.site.cfg " % attr_name) return attr_value # Setup source root. config.test_source_root = os.path.dirname(__file__) default_ubsan_opts = [] # Choose between standalone and UBSan+ASan modes. ubsan_lit_test_mode = get_required_attr(config, 'ubsan_lit_test_mode') if ubsan_lit_test_mode == "Standalone": config.name = 'UBSan-Standalone-' + config.target_arch config.available_features.add("ubsan-standalone") clang_ubsan_cflags = [] elif ubsan_lit_test_mode == "AddressSanitizer": config.name = 'UBSan-ASan-' + config.target_arch config.available_features.add("ubsan-asan") clang_ubsan_cflags = ["-fsanitize=address"] default_ubsan_opts += ['detect_leaks=0'] elif ubsan_lit_test_mode == "MemorySanitizer": config.name = 'UBSan-MSan-' + config.target_arch config.available_features.add("ubsan-msan") clang_ubsan_cflags = ["-fsanitize=memory"] elif ubsan_lit_test_mode == "ThreadSanitizer": config.name = 'UBSan-TSan-' + config.target_arch config.available_features.add("ubsan-tsan") clang_ubsan_cflags = ["-fsanitize=thread"] else: lit_config.fatal("Unknown UBSan test mode: %r" % ubsan_lit_test_mode) # Platform-specific default for lit tests. if config.host_os == 'Darwin': # On Darwin, we default to `abort_on_error=1`, which would make tests run # much slower. Let's override this and run lit tests with 'abort_on_error=0'. default_ubsan_opts += ['abort_on_error=0'] default_ubsan_opts += ['log_to_syslog=0'] default_ubsan_opts_str = ':'.join(default_ubsan_opts) if default_ubsan_opts_str: config.environment['UBSAN_OPTIONS'] = default_ubsan_opts_str default_ubsan_opts_str += ':' # Substitution to setup UBSAN_OPTIONS in portable way. config.substitutions.append(('%env_ubsan_opts=', 'env UBSAN_OPTIONS=' + default_ubsan_opts_str)) def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " target_cflags = [get_required_attr(config, "target_cflags")] clang_ubsan_cflags += target_cflags clang_ubsan_cxxflags = config.cxx_mode_flags + clang_ubsan_cflags # Define %clang and %clangxx substitutions to use in test RUN lines. config.substitutions.append( ("%clang ", build_invocation(clang_ubsan_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags)) ) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] # Check that the host supports UndefinedBehaviorSanitizer tests if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows']: config.unsupported = True # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL # because the test hangs or fails on one configuration and not the other. if config.target_arch.startswith('arm') == False and config.target_arch != 'aarch64': config.available_features.add('stable-runtime') golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/0000775000175000017500000000000013040224625025164 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/0000775000175000017500000000000013040224625027043 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/Function/0000775000175000017500000000000013040224625030630 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg0000664000175000017500000000023012231045512033162 0ustar mwhudsonmwhudson# The function type checker is only supported on x86 and x86_64 for now. if config.root.host_arch not in ['x86', 'x86_64']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/Function/function.cpp0000664000175000017500000000227512567135630033201 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=function %s -O3 -g -o %t // RUN: %run %t 2>&1 | FileCheck %s // Verify that we can disable symbolization if needed: // RUN: %env_ubsan_opts=symbolize=0 %run %t 2>&1 | FileCheck %s --check-prefix=NOSYM // -fsanitize=function is unsupported on Darwin yet. // XFAIL: darwin #include void f() {} void g(int x) {} void make_valid_call() { // CHECK-NOT: runtime error: call to function g reinterpret_cast(reinterpret_cast(g))(42); } void make_invalid_call() { // CHECK: function.cpp:25:3: runtime error: call to function f() through pointer to incorrect function type 'void (*)(int)' // CHECK-NEXT: function.cpp:11: note: f() defined here // NOSYM: function.cpp:25:3: runtime error: call to function (unknown) through pointer to incorrect function type 'void (*)(int)' // NOSYM-NEXT: ({{.*}}+0x{{.*}}): note: (unknown) defined here reinterpret_cast(reinterpret_cast(f))(42); } int main(void) { make_valid_call(); make_invalid_call(); // Check that no more errors will be printed. // CHECK-NOT: runtime error: call to function // NOSYM-NOT: runtime error: call to function make_invalid_call(); } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cppgolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-0000664000175000017500000000246112724076234033332 0ustar mwhudsonmwhudson// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-CORRUPTED-VTABLE --strict-whitespace // UNSUPPORTED: win32 // REQUIRES: stable-runtime, cxxabi #include #include struct S { S() {} ~S() {} virtual int v() { return 0; } }; // See the proper definition in ubsan_type_hash_itanium.cc struct VtablePrefix { signed long Offset; std::type_info *TypeInfo; }; int main(int argc, char **argv) { // Test that we don't crash on corrupted vtable when // offset is too large or too small. S Obj; void *Ptr = &Obj; VtablePrefix* RealPrefix = reinterpret_cast( *reinterpret_cast(Ptr)) - 1; VtablePrefix Prefix[2]; Prefix[0].Offset = 1<<21; // Greater than VptrMaxOffset Prefix[0].TypeInfo = RealPrefix->TypeInfo; // Hack Vtable ptr for Obj. *reinterpret_cast(Ptr) = static_cast(&Prefix[1]); // CHECK-CORRUPTED-VTABLE: vptr-corrupted-vtable-itanium.cpp:[[@LINE+3]]:16: runtime error: member call on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'S' // CHECK-CORRUPTED-VTABLE-NEXT: [[PTR]]: note: object has a possibly invalid vptr: abs(offset to top) too big S* Ptr2 = reinterpret_cast(Ptr); return Ptr2->v(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/Helpers/0000775000175000017500000000000013040224625030445 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr.cpp0000664000175000017500000001665413004151634030555 0ustar mwhudsonmwhudson// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t -mllvm -enable-tail-merge=false // RUN: %run %t rT && %run %t mT && %run %t fT && %run %t cT // RUN: %run %t rU && %run %t mU && %run %t fU && %run %t cU // RUN: %run %t rS && %run %t rV && %run %t oV // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t mS 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER --check-prefix=CHECK-%os-MEMBER --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t fS 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t cS 2>&1 | FileCheck %s --check-prefix=CHECK-DOWNCAST --check-prefix=CHECK-%os-DOWNCAST --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t mV 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER --check-prefix=CHECK-%os-MEMBER --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t fV 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t cV 2>&1 | FileCheck %s --check-prefix=CHECK-DOWNCAST --check-prefix=CHECK-%os-DOWNCAST --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t oU 2>&1 | FileCheck %s --check-prefix=CHECK-OFFSET --check-prefix=CHECK-%os-OFFSET --strict-whitespace // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t m0 2>&1 | FileCheck %s --check-prefix=CHECK-NULL-MEMBER --check-prefix=CHECK-%os-NULL-MEMBER --strict-whitespace // RUN: (echo "vptr_check:S"; echo "vptr_check:T"; echo "vptr_check:U") > %t.supp // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t mS // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t fS // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t cS // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t mV // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t fV // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t cV // RUN: %env_ubsan_opts=suppressions='"%t.supp"' %run %t oU // RUN: echo "vptr_check:S" > %t.loc-supp // RUN: %env_ubsan_opts=suppressions='"%t.loc-supp"' not %run %t x- 2>&1 | FileCheck %s --check-prefix=CHECK-LOC-SUPPRESS // REQUIRES: stable-runtime, cxxabi #include #include #include struct S { S() : a(0) {} ~S() {} int a; int f() { return 0; } virtual int v() { return 0; } }; struct T : S { T() : b(0) {} int b; int g() { return 0; } virtual int v() { return 1; } }; struct U : S, T { virtual int v() { return 2; } }; struct V : S {}; // Make p global so that lsan does not complain. T *p = 0; volatile void *sink1, *sink2; int access_p(T *p, char type); int main(int argc, char **argv) { assert(argc > 1); fprintf(stderr, "Test case: %s\n", argv[1]); T t; (void)t.a; (void)t.b; (void)t.f(); (void)t.g(); (void)t.v(); (void)t.S::v(); U u; (void)u.T::a; (void)u.b; (void)u.T::f(); (void)u.g(); (void)u.v(); (void)u.T::v(); (void)((T&)u).S::v(); char Buffer[sizeof(U)] = {}; char TStorage[sizeof(T)]; // Allocate two dummy objects so that the real object // is not on the boundary of mapped memory. Otherwise ubsan // will not be able to describe the vptr in detail. sink1 = new T; sink2 = new U; switch (argv[1][1]) { case '0': p = reinterpret_cast(Buffer); break; case 'S': // Make sure p points to the memory chunk of sufficient size to prevent ASan // reports about out-of-bounds access. p = reinterpret_cast(new(TStorage) S); break; case 'T': p = new T; break; case 'U': p = new U; break; case 'V': p = reinterpret_cast(new U); break; } access_p(p, argv[1][0]); return 0; } int access_p(T *p, char type) { switch (type) { case 'r': // Binding a reference to storage of appropriate size and alignment is OK. {T &r = *p;} return 0; case 'x': for (int i = 0; i < 2; i++) { // Check that the first iteration ("S") succeeds, while the second ("V") fails. p = reinterpret_cast((i == 0) ? new S : new V); // CHECK-LOC-SUPPRESS: vptr.cpp:[[@LINE+5]]:10: runtime error: member call on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' // CHECK-LOC-SUPPRESS-NEXT: [[PTR]]: note: object is of type 'V' // CHECK-LOC-SUPPRESS-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} // CHECK-LOC-SUPPRESS-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} // CHECK-LOC-SUPPRESS-NEXT: {{^ vptr for 'V'}} p->g(); } return 0; case 'm': // CHECK-MEMBER: vptr.cpp:[[@LINE+6]]:15: runtime error: member access within address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' // CHECK-MEMBER-NEXT: [[PTR]]: note: object is of type [[DYN_TYPE:'S'|'U']] // CHECK-MEMBER-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} // CHECK-MEMBER-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} // CHECK-MEMBER-NEXT: {{^ vptr for}} [[DYN_TYPE]] // CHECK-Linux-MEMBER: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] return p->b; // CHECK-NULL-MEMBER: vptr.cpp:[[@LINE-2]]:15: runtime error: member access within address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' // CHECK-NULL-MEMBER-NEXT: [[PTR]]: note: object has invalid vptr // CHECK-NULL-MEMBER-NEXT: {{^ ?.. .. .. .. ?00 00 00 00 ?00 00 00 00 ?}} // CHECK-NULL-MEMBER-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} // CHECK-NULL-MEMBER-NEXT: {{^ invalid vptr}} // CHECK-Linux-NULL-MEMBER: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE-7]] case 'f': // CHECK-MEMFUN: vptr.cpp:[[@LINE+6]]:15: runtime error: member call on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' // CHECK-MEMFUN-NEXT: [[PTR]]: note: object is of type [[DYN_TYPE:'S'|'U']] // CHECK-MEMFUN-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} // CHECK-MEMFUN-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} // CHECK-MEMFUN-NEXT: {{^ vptr for}} [[DYN_TYPE]] // TODO: Add check for stacktrace here. return p->g(); case 'o': // CHECK-OFFSET: vptr.cpp:[[@LINE+6]]:37: runtime error: member call on address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'U' // CHECK-OFFSET-NEXT: 0x{{[0-9a-f]*}}: note: object is base class subobject at offset {{8|16}} within object of type [[DYN_TYPE:'U']] // CHECK-OFFSET-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. }} // CHECK-OFFSET-NEXT: {{^ \^ ( ~~~~~~~~~~~~)?~~~~~~~~~~~ *$}} // CHECK-OFFSET-NEXT: {{^ ( )?vptr for}} 'T' base class of [[DYN_TYPE]] // CHECK-Linux-OFFSET: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] return reinterpret_cast(p)->v() - 2; case 'c': // CHECK-DOWNCAST: vptr.cpp:[[@LINE+6]]:11: runtime error: downcast of address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' // CHECK-DOWNCAST-NEXT: [[PTR]]: note: object is of type [[DYN_TYPE:'S'|'U']] // CHECK-DOWNCAST-NEXT: {{^ .. .. .. .. .. .. .. .. .. .. .. .. }} // CHECK-DOWNCAST-NEXT: {{^ \^~~~~~~~~~~(~~~~~~~~~~~~)? *$}} // CHECK-DOWNCAST-NEXT: {{^ vptr for}} [[DYN_TYPE]] // CHECK-Linux-DOWNCAST: #0 {{.*}}access_p{{.*}}vptr.cpp:[[@LINE+1]] (void)static_cast(reinterpret_cast(p)); return 0; } return 0; } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cppgolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-cons0000664000175000017500000000044312560462622033325 0ustar mwhudsonmwhudson// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr %s -o %t // RUN: %run %t // REQUIRES: cxxabi int volatile n; struct A { virtual ~A() {} }; struct B: virtual A {}; struct C: virtual A { ~C() { n = 0; } }; struct D: virtual B, virtual C {}; int main() { delete new D; } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cppgolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typein0000664000175000017500000000066012665522260033375 0ustar mwhudsonmwhudson// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -fPIC -shared -o %t-lib.so -DBUILD_SO // RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -O3 -o %t %t-lib.so // RUN: %run %t // // REQUIRES: cxxabi struct X { virtual ~X() {} }; X *libCall(); #ifdef BUILD_SO X *libCall() { return new X; } #else int main() { X *px = libCall(); delete px; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp0000664000175000017500000000110012542651006033131 0ustar mwhudsonmwhudson// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: cxxabi struct S { virtual int f() { return 0; } }; struct T : virtual S {}; struct Foo { virtual int f() { return 0; } }; int main(int argc, char **argv) { Foo foo; T *t = (T*)&foo; S *s = t; // CHECK: vptr-virtual-base.cpp:[[@LINE-1]]:10: runtime error: cast to virtual base of address [[PTR:0x[0-9a-f]*]] which does not point to an object of type 'T' // CHECK-NEXT: [[PTR]]: note: object is of type 'Foo' return s->f(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/null.cpp0000664000175000017500000000230212721434626030527 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=null %s -O3 -o %t // RUN: %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD // RUN: %expect_crash %run %t s 2>&1 | FileCheck %s --check-prefix=CHECK-STORE // RUN: %run %t r 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE // RUN: %run %t m 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER // RUN: %run %t f 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN struct S { int f() { return 0; } int k; }; int main(int, char **argv) { int *p = 0; S *s = 0; (void)*p; // ok! switch (argv[1][0]) { case 'l': // CHECK-LOAD: null.cpp:[[@LINE+1]]:12: runtime error: load of null pointer of type 'int' return *p; case 's': // CHECK-STORE: null.cpp:[[@LINE+1]]:5: runtime error: store to null pointer of type 'int' *p = 1; break; case 'r': // CHECK-REFERENCE: null.cpp:[[@LINE+1]]:15: runtime error: reference binding to null pointer of type 'int' {int &r = *p;} break; case 'm': // CHECK-MEMBER: null.cpp:[[@LINE+1]]:15: runtime error: member access within null pointer of type 'S' return s->k; case 'f': // CHECK-MEMFUN: null.cpp:[[@LINE+1]]:15: runtime error: member call on null pointer of type 'S' return s->f(); } } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/TypeCheck/misaligned.cpp0000664000175000017500000001132512721434626031676 0ustar mwhudsonmwhudson// FIXME: This test currently fails on Windows because we use the MSVC linker, // which throws away DWARF debug info. // XFAIL: win32 // // RUN: %clangxx -fsanitize=alignment -g %s -O3 -o %t // RUN: %run %t l0 && %run %t s0 && %run %t r0 && %run %t m0 && %run %t f0 && %run %t n0 && %run %t u0 // RUN: %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --strict-whitespace // RUN: %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE // RUN: %run %t r1 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE // RUN: %run %t m1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER // RUN: %run %t f1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN // RUN: %run %t n1 2>&1 | FileCheck %s --check-prefix=CHECK-NEW // RUN: %run %t u1 2>&1 | FileCheck %s --check-prefix=CHECK-UPCAST // RUN: %env_ubsan_opts=print_stacktrace=1 %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --check-prefix=CHECK-%os-STACK-LOAD // RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment %s -O3 -o %t // RUN: not %run %t w1 2>&1 | FileCheck %s --check-prefix=CHECK-WILD #include struct S { S() {} int f() { return 0; } int k; }; struct T : S { int t; }; int main(int, char **argv) { char c[] __attribute__((aligned(8))) = { 0, 0, 0, 0, 1, 2, 3, 4, 5 }; // Pointer value may be unspecified here, but behavior is not undefined. int *p = (int*)&c[4 + argv[1][1] - '0']; S *s = (S*)p; T *t = (T*)p; void *wild = reinterpret_cast(0x123L); (void)*p; // ok! switch (argv[1][0]) { case 'l': // CHECK-LOAD: misaligned.cpp:[[@LINE+4]]{{(:12)?}}: runtime error: load of misaligned address [[PTR:0x[0-9a-f]*]] for type 'int', which requires 4 byte alignment // CHECK-LOAD-NEXT: [[PTR]]: note: pointer points here // CHECK-LOAD-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-LOAD-NEXT: {{^ \^}} return *p && 0; // Slow stack unwinding is disabled on Darwin for now, see // https://code.google.com/p/address-sanitizer/issues/detail?id=137 // CHECK-Linux-STACK-LOAD: #0 {{.*}}main{{.*}}misaligned.cpp // Check for the already checked line to avoid lit error reports. // CHECK-Darwin-STACK-LOAD: {{ }} case 's': // CHECK-STORE: misaligned.cpp:[[@LINE+4]]{{(:5)?}}: runtime error: store to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int', which requires 4 byte alignment // CHECK-STORE-NEXT: [[PTR]]: note: pointer points here // CHECK-STORE-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-STORE-NEXT: {{^ \^}} *p = 1; break; case 'r': // CHECK-REFERENCE: misaligned.cpp:[[@LINE+4]]{{(:(5|15))?}}: runtime error: reference binding to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int', which requires 4 byte alignment // CHECK-REFERENCE-NEXT: [[PTR]]: note: pointer points here // CHECK-REFERENCE-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-REFERENCE-NEXT: {{^ \^}} {int &r = *p;} break; case 'm': // CHECK-MEMBER: misaligned.cpp:[[@LINE+4]]{{(:15)?}}: runtime error: member access within misaligned address [[PTR:0x[0-9a-f]*]] for type 'S', which requires 4 byte alignment // CHECK-MEMBER-NEXT: [[PTR]]: note: pointer points here // CHECK-MEMBER-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-MEMBER-NEXT: {{^ \^}} return s->k && 0; case 'f': // CHECK-MEMFUN: misaligned.cpp:[[@LINE+4]]{{(:15)?}}: runtime error: member call on misaligned address [[PTR:0x[0-9a-f]*]] for type 'S', which requires 4 byte alignment // CHECK-MEMFUN-NEXT: [[PTR]]: note: pointer points here // CHECK-MEMFUN-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-MEMFUN-NEXT: {{^ \^}} return s->f() && 0; case 'n': // CHECK-NEW: misaligned.cpp:[[@LINE+4]]{{(:21)?}}: runtime error: constructor call on misaligned address [[PTR:0x[0-9a-f]*]] for type 'S', which requires 4 byte alignment // CHECK-NEW-NEXT: [[PTR]]: note: pointer points here // CHECK-NEW-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-NEW-NEXT: {{^ \^}} return (new (s) S)->k && 0; case 'u': { // CHECK-UPCAST: misaligned.cpp:[[@LINE+4]]{{(:17)?}}: runtime error: upcast of misaligned address [[PTR:0x[0-9a-f]*]] for type 'T', which requires 4 byte alignment // CHECK-UPCAST-NEXT: [[PTR]]: note: pointer points here // CHECK-UPCAST-NEXT: {{^ 00 00 00 01 02 03 04 05}} // CHECK-UPCAST-NEXT: {{^ \^}} S *s2 = (S*)t; return s2->f(); } case 'w': // CHECK-WILD: misaligned.cpp:[[@LINE+3]]{{(:35)?}}: runtime error: member access within misaligned address 0x{{0+}}123 for type 'S', which requires 4 byte alignment // CHECK-WILD-NEXT: 0x{{0+}}123: note: pointer points here // CHECK-WILD-NEXT: return static_cast(wild)->k; } } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Float/0000775000175000017500000000000013040224625026231 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Float/cast-overflow.cpp0000664000175000017500000001300012670673613031537 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=float-cast-overflow %s -o %t // RUN: %run %t _ // RUN: %env_ubsan_opts=print_summary=1:report_error_type=1 %run %t 0 2>&1 | FileCheck %s --check-prefix=CHECK-0 // RUN: %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK-1 // RUN: %run %t 2 2>&1 | FileCheck %s --check-prefix=CHECK-2 // RUN: %run %t 3 2>&1 | FileCheck %s --check-prefix=CHECK-3 // RUN: %run %t 4 2>&1 | FileCheck %s --check-prefix=CHECK-4 // RUN: %run %t 5 2>&1 | FileCheck %s --check-prefix=CHECK-5 // RUN: %run %t 6 2>&1 | FileCheck %s --check-prefix=CHECK-6 // FIXME: %run %t 7 2>&1 | FileCheck %s --check-prefix=CHECK-7 // FIXME: not %run %t 8 2>&1 | FileCheck %s --check-prefix=CHECK-8 // RUN: not %run %t 9 2>&1 | FileCheck %s --check-prefix=CHECK-9 // This test assumes float and double are IEEE-754 single- and double-precision. #if defined(__APPLE__) # include # define BYTE_ORDER __DARWIN_BYTE_ORDER # define BIG_ENDIAN __DARWIN_BIG_ENDIAN # define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN #elif defined(__FreeBSD__) # include # define BYTE_ORDER _BYTE_ORDER # define BIG_ENDIAN _BIG_ENDIAN # define LITTLE_ENDIAN _LITTLE_ENDIAN #elif defined(_WIN32) # define BYTE_ORDER 0 # define BIG_ENDIAN 1 # define LITTLE_ENDIAN 0 #else # include # define BYTE_ORDER __BYTE_ORDER # define BIG_ENDIAN __BIG_ENDIAN # define LITTLE_ENDIAN __LITTLE_ENDIAN #endif // __APPLE__ #include #include #include float Inf; float NaN; int main(int argc, char **argv) { float MaxFloatRepresentableAsInt = 0x7fffff80; (int)MaxFloatRepresentableAsInt; // ok (int)-MaxFloatRepresentableAsInt; // ok float MinFloatRepresentableAsInt = -0x7fffffff - 1; (int)MinFloatRepresentableAsInt; // ok float MaxFloatRepresentableAsUInt = 0xffffff00u; (unsigned int)MaxFloatRepresentableAsUInt; // ok #ifdef __SIZEOF_INT128__ unsigned __int128 FloatMaxAsUInt128 = -((unsigned __int128)1 << 104); (void)(float)FloatMaxAsUInt128; // ok #endif float NearlyMinusOne = -0.99999; unsigned Zero = NearlyMinusOne; // ok // Build a '+Inf'. #if BYTE_ORDER == LITTLE_ENDIAN unsigned char InfVal[] = { 0x00, 0x00, 0x80, 0x7f }; #else unsigned char InfVal[] = { 0x7f, 0x80, 0x00, 0x00 }; #endif float Inf; memcpy(&Inf, InfVal, 4); // Build a 'NaN'. #if BYTE_ORDER == LITTLE_ENDIAN unsigned char NaNVal[] = { 0x01, 0x00, 0x80, 0x7f }; #else unsigned char NaNVal[] = { 0x7f, 0x80, 0x00, 0x01 }; #endif float NaN; memcpy(&NaN, NaNVal, 4); double DblInf = (double)Inf; // ok switch (argv[1][0]) { // FIXME: Produce a source location for these checks and test for it here. // Floating point -> integer overflow. case '0': { // Note that values between 0x7ffffe00 and 0x80000000 may or may not // successfully round-trip, depending on the rounding mode. // CHECK-0: {{.*}}cast-overflow.cpp:[[@LINE+1]]:27: runtime error: value 2.14748{{.*}} is outside the range of representable values of type 'int' static int test_int = MaxFloatRepresentableAsInt + 0x80; // CHECK-0: SUMMARY: {{.*}}Sanitizer: float-cast-overflow {{.*}}cast-overflow.cpp:[[@LINE-1]] return 0; } case '1': { // CHECK-1: {{.*}}cast-overflow.cpp:[[@LINE+1]]:27: runtime error: value -2.14748{{.*}} is outside the range of representable values of type 'int' static int test_int = MinFloatRepresentableAsInt - 0x100; return 0; } case '2': { // CHECK-2: {{.*}}cast-overflow.cpp:[[@LINE+2]]:37: runtime error: value -1 is outside the range of representable values of type 'unsigned int' volatile float f = -1.0; volatile unsigned u = (unsigned)f; return 0; } case '3': { // CHECK-3: {{.*}}cast-overflow.cpp:[[@LINE+1]]:37: runtime error: value 4.2949{{.*}} is outside the range of representable values of type 'unsigned int' static int test_int = (unsigned)(MaxFloatRepresentableAsUInt + 0x100); return 0; } case '4': { // CHECK-4: {{.*}}cast-overflow.cpp:[[@LINE+1]]:27: runtime error: value {{.*}} is outside the range of representable values of type 'int' static int test_int = Inf; return 0; } case '5': { // CHECK-5: {{.*}}cast-overflow.cpp:[[@LINE+1]]:27: runtime error: value {{.*}} is outside the range of representable values of type 'int' static int test_int = NaN; return 0; } // Integer -> floating point overflow. case '6': { // CHECK-6: cast-overflow.cpp:[[@LINE+2]]:{{34: runtime error: value 0xffffff00000000000000000000000001 is outside the range of representable values of type 'float'| __int128 not supported}} #if defined(__SIZEOF_INT128__) && !defined(_WIN32) static int test_int = (float)(FloatMaxAsUInt128 + 1); return 0; #else // Print the same line as the check above. That way the test is robust to // line changes around it printf("%s:%d: __int128 not supported", __FILE__, __LINE__ - 5); return 0; #endif } // FIXME: The backend cannot lower __fp16 operations on x86 yet. //case '7': // (__fp16)65504; // ok // // CHECK-7: runtime error: value 65505 is outside the range of representable values of type '__fp16' // return (__fp16)65505; // Floating point -> floating point overflow. case '8': // CHECK-8: {{.*}}cast-overflow.cpp:[[@LINE+1]]:19: runtime error: value 1e+39 is outside the range of representable values of type 'float' return (float)1e39; case '9': volatile long double ld = 300.0; // CHECK-9: {{.*}}cast-overflow.cpp:[[@LINE+1]]:14: runtime error: value 300 is outside the range of representable values of type 'char' char c = ld; return c; } } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/0000775000175000017500000000000013040224625026057 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/coverage-levels.cc0000664000175000017500000000450612730343031031454 0ustar mwhudsonmwhudson// Test various levels of coverage // // FIXME: Port the environment variable logic below for the lit shell. // REQUIRES: shell // // RUN: rm -rf %T/coverage-levels && mkdir %T/coverage-levels // RUN: %clangxx -fsanitize=shift -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func %s -o %t // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // RUN: %clangxx -fsanitize=undefined -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func %s -o %t // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // Also works without any sanitizer. // RUN: %clangxx -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func %s -o %t // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=func %s -o %t // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=bb %s -o %t // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=edge %s -o %t // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%T/coverage-levels"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN // Coverage is not yet implemented in TSan. // XFAIL: ubsan-tsan volatile int sink; int main(int argc, char **argv) { int shift = argc * 32; #if GOOD_SHIFT shift = 3; #endif if ((argc << shift) == 16) // False. return 1; return 0; } // CHECK_WARN: shift exponent 32 is too large // CHECK_NOWARN-NOT: ERROR // FIXME: Currently, coverage instrumentation kicks in after ubsan, so we get // more than the minimal number of instrumented blocks. // FIXME: Currently, ubsan with -fno-sanitize-recover and w/o asan will fail // to dump coverage. // CHECK1: 1 PCs written // CHECK2: 2 PCs written // CHECK3: 2 PCs written golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/Linux/0000775000175000017500000000000013040224625027156 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/Linux/lit.local.cfg0000664000175000017500000000026612500267022031522 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Linux']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc0000664000175000017500000000074112627423454032365 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // __ubsan_default_options() doesn't work on Darwin. // XFAIL: darwin #include extern "C" const char *__ubsan_default_options() { return "halt_on_error=1"; } int main() { (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); // CHECK: ubsan_options.cc:[[@LINE-1]]:44: runtime error: unsigned integer overflow return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/bool.cpp0000664000175000017500000000100012567135630027517 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=bool %s -O3 -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_ubsan_opts=print_summary=1:report_error_type=1 not %run %t 2>&1 | FileCheck %s --check-prefix=SUMMARY unsigned char NotABool = 123; int main(int argc, char **argv) { bool *p = (bool*)&NotABool; // CHECK: bool.cpp:[[@LINE+1]]:10: runtime error: load of value 123, which is not a valid value for type 'bool' return *p; // SUMMARY: SUMMARY: {{.*}}Sanitizer: invalid-bool-load {{.*}}bool.cpp:[[@LINE-1]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/missing_return.cpp0000664000175000017500000000131112567135630031641 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=return -g %s -O3 -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%os-STACKTRACE // CHECK: missing_return.cpp:[[@LINE+1]]:5: runtime error: execution reached the end of a value-returning function without returning a value int f() { // Slow stack unwinding is not available on Darwin for now, see // https://code.google.com/p/address-sanitizer/issues/detail?id=137 // CHECK-Linux-STACKTRACE: #0 {{.*}}f(){{.*}}missing_return.cpp:[[@LINE-3]] // CHECK-FreeBSD-STACKTRACE: #0 {{.*}}f(void){{.*}}missing_return.cpp:[[@LINE-4]] } int main(int, char **argv) { return f(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/bounds.cpp0000664000175000017500000000135012545333146030064 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=bounds %s -O3 -o %t // RUN: %run %t 0 0 0 // RUN: %run %t 1 2 3 // RUN: %expect_crash %run %t 2 0 0 2>&1 | FileCheck %s --check-prefix=CHECK-A-2 // RUN: %run %t 0 3 0 2>&1 | FileCheck %s --check-prefix=CHECK-B-3 // RUN: %run %t 0 0 4 2>&1 | FileCheck %s --check-prefix=CHECK-C-4 int main(int argc, char **argv) { int arr[2][3][4] = {}; return arr[argv[1][0] - '0'][argv[2][0] - '0'][argv[3][0] - '0']; // CHECK-A-2: bounds.cpp:[[@LINE-1]]:10: runtime error: index 2 out of bounds for type 'int [2][3][4]' // CHECK-B-3: bounds.cpp:[[@LINE-2]]:10: runtime error: index 3 out of bounds for type 'int [3][4]' // CHECK-C-4: bounds.cpp:[[@LINE-3]]:10: runtime error: index 4 out of bounds for type 'int [4]' } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/log-path_test.cc0000664000175000017500000000174312571365661031163 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // The globs below do not work in the lit shell. // REQUIRES: shell // RUN: %clangxx -fsanitize=undefined %s -O1 -o %t // Regular run. // RUN: %run %t -4 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.out // Good log_path. // RUN: rm -f %t.log.* // RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t -4 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.* // Run w/o errors should not produce any log. // RUN: rm -f %t.log.* // RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t 4 // RUN: not cat %t.log.* // FIXME: log_path is not supported on Windows yet. // XFAIL: win32 #include #include int main(int argc, char *argv[]) { double a = atof(argv[1]); unsigned int ai = (unsigned int) a; printf("%f %u\n", a, ai); return 0; } // CHECK-ERROR: runtime error: value -4 is outside the range of representable values of type 'unsigned int' golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/unreachable.cpp0000664000175000017500000000036412365565411031051 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=unreachable %s -O3 -o %t && not %run %t 2>&1 | FileCheck %s int main(int, char **argv) { // CHECK: unreachable.cpp:5:3: runtime error: execution reached a __builtin_unreachable() call __builtin_unreachable(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/deduplication.cpp0000664000175000017500000000076412545333146031426 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=undefined %s -o %t && %run %t 2>&1 | FileCheck %s // Verify deduplication works by ensuring only one diag is emitted. #include #include void overflow() { int i = INT_MIN; --i; } int main() { // CHECK: Start fprintf(stderr, "Start\n"); fflush(stderr); // CHECK: runtime error // CHECK-NOT: runtime error // CHECK-NOT: runtime error overflow(); overflow(); overflow(); // CHECK: End fprintf(stderr, "End\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/nonnull-arg.cpp0000664000175000017500000000441012577031120031016 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=nonnull-attribute -fno-sanitize-recover=all %s -O3 -o %t // RUN: %run %t nc // RUN: %run %t nm // RUN: %run %t nf // RUN: %run %t nv // RUN: not %run %t 0c 2>&1 | FileCheck %s --check-prefix=CTOR // RUN: not %run %t 0m 2>&1 | FileCheck %s --check-prefix=METHOD // RUN: not %run %t 0f 2>&1 | FileCheck %s --check-prefix=FUNC // RUN: not %run %t 0v 2>&1 | FileCheck %s --check-prefix=VARIADIC // // AArch64 lacks variadic instrumentation for MSAN. // REQUIRES: stable-runtime class C { int *null_; int *nonnull_; public: C(int *null, __attribute__((nonnull)) int *nonnull) : null_(null), nonnull_(nonnull) {} int value() { return *nonnull_; } int method(int *nonnull, int *null) __attribute__((nonnull(2))) { return *nonnull_ + *nonnull; } }; __attribute__((nonnull)) int func(int *nonnull) { return *nonnull; } #include __attribute__((nonnull)) int variadic(int x, ...) { va_list args; va_start(args, x); int *nonnull = va_arg(args, int*); int res = *nonnull; va_end(args); return res; } int main(int argc, char *argv[]) { int local = 0; int *arg = (argv[1][0] == '0') ? 0x0 : &local; switch (argv[1][1]) { case 'c': return C(0x0, arg).value(); // CTOR: {{.*}}nonnull-arg.cpp:[[@LINE-1]]:21: runtime error: null pointer passed as argument 2, which is declared to never be null // CTOR-NEXT: {{.*}}nonnull-arg.cpp:19:31: note: nonnull attribute specified here case 'm': return C(0x0, &local).method(arg, 0x0); // METHOD: {{.*}}nonnull-arg.cpp:[[@LINE-1]]:36: runtime error: null pointer passed as argument 1, which is declared to never be null // METHOD-NEXT: {{.*}}nonnull-arg.cpp:22:54: note: nonnull attribute specified here case 'f': return func(arg); // FUNC: {{.*}}nonnull-arg.cpp:[[@LINE-1]]:19: runtime error: null pointer passed as argument 1, which is declared to never be null // FUNC-NEXT: {{.*}}nonnull-arg.cpp:27:16: note: nonnull attribute specified here case 'v': return variadic(42, arg); // VARIADIC: {{.*}}nonnull-arg.cpp:[[@LINE-1]]:27: runtime error: null pointer passed as argument 2, which is declared to never be null // VARIADIC-NEXT: {{.*}}nonnull-arg.cpp:30:16: note: nonnull attribute specified here } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/enum.cpp0000664000175000017500000000162112545333146027537 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=enum %s -O3 -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PLAIN // RUN: %clangxx -fsanitize=enum -std=c++11 -DE="class E" %s -O3 -o %t && %run %t // RUN: %clangxx -fsanitize=enum -std=c++11 -DE="class E : bool" %s -O3 -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-BOOL // FIXME: UBSan fails to add the correct instrumentation code for some reason on // Windows. // XFAIL: win32 enum E { a = 1 } e; #undef E int main(int argc, char **argv) { // memset(&e, 0xff, sizeof(e)); for (unsigned char *p = (unsigned char*)&e; p != (unsigned char*)(&e + 1); ++p) *p = 0xff; // CHECK-PLAIN: error: load of value 4294967295, which is not a valid value for type 'enum E' // FIXME: Support marshalling and display of enum class values. // CHECK-BOOL: error: load of value , which is not a valid value for type 'enum E' return (int)e != -1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/nonnull.cpp0000664000175000017500000000075212403407317030257 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=returns-nonnull-attribute %s -O3 -o %t // RUN: %run %t foo // RUN: %run %t 2>&1 | FileCheck %s __attribute__((returns_nonnull)) char *foo(char *a); char *foo(char *a) { return a; // CHECK: nonnull.cpp:[[@LINE+2]]:1: runtime error: null pointer returned from function declared to never return null // CHECK-NEXT: nonnull.cpp:[[@LINE-5]]:16: note: returns_nonnull attribute specified here } int main(int argc, char **argv) { return foo(argv[1]) == 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Misc/vla.c0000664000175000017500000000075012330266131027006 0ustar mwhudsonmwhudson// RUN: %clang -fsanitize=vla-bound %s -O3 -o %t // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-MINUS-ONE // RUN: %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-ZERO // RUN: %run %t a b int main(int argc, char **argv) { // CHECK-MINUS-ONE: vla.c:9:11: runtime error: variable length array bound evaluates to non-positive value -1 // CHECK-ZERO: vla.c:9:11: runtime error: variable length array bound evaluates to non-positive value 0 int arr[argc - 2]; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/0000775000175000017500000000000013040224625026561 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/umul-overflow.cpp0000664000175000017500000000114612330266131032111 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s #include int main() { // These promote to 'int'. (void)(int8_t(-2) * int8_t(0x7f)); (void)(int16_t(0x7fff) * int16_t(0x7fff)); (void)(uint16_t(0xffff) * int16_t(0x7fff)); (void)(uint16_t(0xffff) * uint16_t(0x8000)); // Not an unsigned overflow (void)(uint16_t(0xffff) * uint16_t(0x8001)); (void)(uint32_t(0xffffffff) * uint32_t(0x2)); // CHECK: umul-overflow.cpp:15:31: runtime error: unsigned integer overflow: 4294967295 * 2 cannot be represented in type 'unsigned int' return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/div-overflow.cpp0000664000175000017500000000045712330266131031715 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=signed-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s #include int main() { unsigned(0x80000000) / -1; // CHECK: div-overflow.cpp:9:23: runtime error: division of -2147483648 by -1 cannot be represented in type 'int' int32_t(0x80000000) / -1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/div-zero.cpp0000664000175000017500000000121212545333146031030 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND=0 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND=1U %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx -fsanitize=float-divide-by-zero -DDIVIDEND=1.5 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND='intmax(123)' %s -o %t && %run %t 2>&1 | FileCheck %s #if defined(__SIZEOF_INT128__) && !defined(_WIN32) typedef __int128 intmax; #else typedef long long intmax; #endif int main() { // CHECK: div-zero.cpp:[[@LINE+1]]:12: runtime error: division by zero DIVIDEND / 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/sub-overflow.cpp0000664000175000017500000000243112545333146031727 0ustar mwhudsonmwhudson// RUN: %clangxx -DSUB_I32 -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I32 // RUN: %clangxx -DSUB_I64 -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I64 // RUN: %clangxx -DSUB_I128 -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I128 #include #include int main() { // These promote to 'int'. (void)(int8_t(-2) - int8_t(0x7f)); (void)(int16_t(-2) - int16_t(0x7fff)); #ifdef SUB_I32 (void)(int32_t(-2) - int32_t(0x7fffffff)); // CHECK-SUB_I32: sub-overflow.cpp:[[@LINE-1]]:22: runtime error: signed integer overflow: -2 - 2147483647 cannot be represented in type 'int' #endif #ifdef SUB_I64 (void)(int64_t(-8000000000000000000ll) - int64_t(2000000000000000000ll)); // CHECK-SUB_I64: -8000000000000000000 - 2000000000000000000 cannot be represented in type '{{long( long)?}}' #endif #ifdef SUB_I128 # if defined(__SIZEOF_INT128__) && !defined(_WIN32) (void)(-(__int128_t(1) << 126) - (__int128_t(1) << 126) - 1); # else puts("__int128 not supported"); # endif // CHECK-SUB_I128: {{0x80000000000000000000000000000000 - 1 cannot be represented in type '__int128'|__int128 not supported}} #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/summary.cpp0000664000175000017500000000106112627423454030773 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=integer %s -o %t // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE // RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE // REQUIRES: ubsan-asan #include int main() { (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); // CHECK-NOTYPE: SUMMARY: AddressSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:44 // CHECK-TYPE: SUMMARY: AddressSanitizer: unsigned-integer-overflow {{.*}}summary.cpp:[[@LINE-2]]:44 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/mul-overflow.cpp0000664000175000017500000000077312330266131031731 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=signed-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s #include int main() { // These promote to 'int'. (void)(int8_t(-2) * int8_t(0x7f)); (void)(int16_t(0x7fff) * int16_t(0x7fff)); (void)(uint16_t(0xffff) * int16_t(0x7fff)); (void)(uint16_t(0xffff) * uint16_t(0x8000)); // CHECK: mul-overflow.cpp:13:27: runtime error: signed integer overflow: 65535 * 32769 cannot be represented in type 'int' (void)(uint16_t(0xffff) * uint16_t(0x8001)); } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/suppressions.cpp0000664000175000017500000000271112650510142032041 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=integer -g0 %s -o %t // Suppression by symbol name (unsigned-integer-overflow:do_overflow below) // requires the compiler-rt runtime to be able to symbolize stack addresses. // REQUIRES: can-symbolize // Fails without any suppression. // RUN: %env_ubsan_opts=halt_on_error=1 not %run %t 2>&1 | FileCheck %s // RUN: echo "signed-integer-overflow:%t" > %t.wrong-supp // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.wrong-supp"' not %run %t 2>&1 | FileCheck %s // RUN: echo "unsigned-integer-overflow:do_overflow" > %t.func-supp // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.func-supp"' %run %t // RUN: echo "unsigned-integer-overflow:%t" > %t.module-supp // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.module-supp"' %run %t // Note: file-level suppressions should work even without debug info. // RUN: echo "unsigned-integer-overflow:%s" > %t.file-supp // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.file-supp"' %run %t // Suppressions don't work for unrecoverable kinds. // RUN: %clangxx -fsanitize=integer -fno-sanitize-recover=integer %s -o %t-norecover // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.module-supp"' not %run %t-norecover 2>&1 | FileCheck %s #include extern "C" void do_overflow() { (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); // CHECK: runtime error: unsigned integer overflow } int main() { do_overflow(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/add-overflow.cpp0000664000175000017500000000250012545333146031663 0ustar mwhudsonmwhudson// RUN: %clangxx -DADD_I32 -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=CHECK-ADD_I32 // RUN: %clangxx -DADD_I64 -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=CHECK-ADD_I64 // RUN: %clangxx -DADD_I128 -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck %s --check-prefix=CHECK-ADD_I128 #include #include int main() { // These promote to 'int'. (void)(int8_t(0x7f) + int8_t(0x7f)); (void)(int16_t(0x3fff) + int16_t(0x4000)); #ifdef ADD_I32 int32_t k = 0x12345678; k += 0x789abcde; // CHECK-ADD_I32: add-overflow.cpp:[[@LINE-1]]:5: runtime error: signed integer overflow: 305419896 + 2023406814 cannot be represented in type 'int' #endif #ifdef ADD_I64 (void)(int64_t(8000000000000000000ll) + int64_t(2000000000000000000ll)); // CHECK-ADD_I64: 8000000000000000000 + 2000000000000000000 cannot be represented in type '{{long( long)?}}' #endif #ifdef ADD_I128 # if defined(__SIZEOF_INT128__) && !defined(_WIN32) (void)((__int128_t(1) << 126) + (__int128_t(1) << 126)); # else puts("__int128 not supported"); # endif // CHECK-ADD_I128: {{0x40000000000000000000000000000000 \+ 0x40000000000000000000000000000000 cannot be represented in type '__int128'|__int128 not supported}} #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/uadd-overflow.cpp0000664000175000017500000000256312545333146032061 0ustar mwhudsonmwhudson// RUN: %clangxx -DADD_I32 -fsanitize=unsigned-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=CHECK-ADD_I32 // RUN: %clangxx -DADD_I64 -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=CHECK-ADD_I64 // RUN: %clangxx -DADD_I128 -fsanitize=unsigned-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck %s --check-prefix=CHECK-ADD_I128 #include #include int main() { // These promote to 'int'. (void)(uint8_t(0xff) + uint8_t(0xff)); (void)(uint16_t(0xf0fff) + uint16_t(0x0fff)); #ifdef ADD_I32 uint32_t k = 0x87654321; k += 0xedcba987; // CHECK-ADD_I32: uadd-overflow.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'unsigned int' #endif #ifdef ADD_I64 (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); // CHECK-ADD_I64: 10000000000000000000 + 9000000000000000000 cannot be represented in type 'unsigned {{long( long)?}}' #endif #ifdef ADD_I128 # if defined(__SIZEOF_INT128__) && !defined(_WIN32) (void)((__uint128_t(1) << 127) + (__uint128_t(1) << 127)); # else puts("__int128 not supported"); # endif // CHECK-ADD_I128: {{0x80000000000000000000000000000000 \+ 0x80000000000000000000000000000000 cannot be represented in type 'unsigned __int128'|__int128 not supported}} #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/incdec-overflow.cpp0000664000175000017500000000154312545333146032366 0ustar mwhudsonmwhudson// RUN: %clangxx -DOP=n++ -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=PLUS // RUN: %clangxx -DOP=++n -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=PLUS // RUN: %clangxx -DOP=m-- -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck %s --check-prefix=MINUS // RUN: %clangxx -DOP=--m -fsanitize=signed-integer-overflow %s -o %t4 && %run %t4 2>&1 | FileCheck %s --check-prefix=MINUS #include int main() { int n = 0x7ffffffd; n++; n++; int m = -n - 1; OP; // PLUS: incdec-overflow.cpp:[[@LINE-1]]:3: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' // MINUS: incdec-overflow.cpp:[[@LINE-2]]:3: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/negate-overflow.cpp0000664000175000017500000000132612545333146032403 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=CHECKS // RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=CHECKU int main() { // CHECKS-NOT: runtime error // CHECKU: negate-overflow.cpp:[[@LINE+2]]:3: runtime error: negation of 2147483648 cannot be represented in type 'unsigned int' // CHECKU-NOT: cast to an unsigned -unsigned(-0x7fffffff - 1); // ok // CHECKS: negate-overflow.cpp:[[@LINE+2]]:10: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself // CHECKU-NOT: runtime error return -(-0x7fffffff - 1); } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/uincdec-overflow.cpp0000664000175000017500000000160712545333146032554 0ustar mwhudsonmwhudson// RUN: %clangxx -DOP=n++ -fsanitize=unsigned-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck --check-prefix=CHECK-INC %s // RUN: %clangxx -DOP=++n -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck --check-prefix=CHECK-INC %s // RUN: %clangxx -DOP=m-- -fsanitize=unsigned-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck --check-prefix=CHECK-DEC %s // RUN: %clangxx -DOP=--m -fsanitize=unsigned-integer-overflow %s -o %t4 && %run %t4 2>&1 | FileCheck --check-prefix=CHECK-DEC %s #include int main() { unsigned n = 0xfffffffd; n++; n++; unsigned m = 0; // CHECK-INC: uincdec-overflow.cpp:15:3: runtime error: unsigned integer overflow: 4294967295 + 1 cannot be represented in type 'unsigned int' // CHECK-DEC: uincdec-overflow.cpp:15:3: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int' OP; } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/shift.cpp0000664000175000017500000000554612545333146030424 0ustar mwhudsonmwhudson// RUN: %clangxx -DLSH_OVERFLOW -DOP='<<' -fsanitize=shift-base -fno-sanitize-recover=shift %s -o %t1 && not %run %t1 2>&1 | FileCheck %s --check-prefix=CHECK-LSH_OVERFLOW // RUN: %clangxx -DLSH_OVERFLOW -DOP='<<=' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t2 && not %run %t2 2>&1 | FileCheck %s --check-prefix=CHECK-LSH_OVERFLOW // RUN: %clangxx -DTOO_LOW -DOP='<<' -fsanitize=shift-exponent -fno-sanitize-recover=shift %s -o %t3 && not %run %t3 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW // RUN: %clangxx -DTOO_LOW -DOP='>>' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t4 && not %run %t4 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW // RUN: %clangxx -DTOO_LOW -DOP='<<=' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t5 && not %run %t5 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW // RUN: %clangxx -DTOO_LOW -DOP='>>=' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t6 && not %run %t6 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW // RUN: %clangxx -DTOO_HIGH -DOP='<<' -fsanitize=shift-exponent -fno-sanitize-recover=shift %s -o %t7 && not %run %t7 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH // RUN: %clangxx -DTOO_HIGH -DOP='>>' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t8 && not %run %t8 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH // RUN: %clangxx -DTOO_HIGH -DOP='<<=' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t9 && not %run %t9 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH // RUN: %clangxx -DTOO_HIGH -DOP='>>=' -fsanitize=shift -fno-sanitize-recover=shift %s -o %t10 && not %run %t10 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH // RUN: %clangxx -DLSH_OVERFLOW -DOP='<<' -fsanitize=shift-exponent -fno-sanitize-recover=shift %s -o %t12 && %run %t12 // RUN: %clangxx -DLSH_OVERFLOW -DOP='>>' -fsanitize=shift-exponent -fno-sanitize-recover=shift %s -o %t13 && %run %t13 // RUN: %clangxx -DTOO_LOW -DOP='<<' -fsanitize=shift-base -fno-sanitize-recover=shift %s -o %t14 && %run %t14 // RUN: %clangxx -DTOO_LOW -DOP='>>' -fsanitize=shift-base -fno-sanitize-recover=shift %s -o %t15 && %run %t15 // RUN: %clangxx -DTOO_HIGH -DOP='<<' -fsanitize=shift-base -fno-sanitize-recover=shift %s -o %t16 && %run %t16 // RUN: %clangxx -DTOO_HIGH -DOP='>>' -fsanitize=shift-base -fno-sanitize-recover=shift %s -o %t17 && %run %t17 #include int main() { int a = 1; unsigned b = 1; a <<= 31; // ok in C++11, not ok in C99/C11 b <<= 31; // ok b <<= 1; // still ok, unsigned #ifdef LSH_OVERFLOW // CHECK-LSH_OVERFLOW: shift.cpp:[[@LINE+1]]:5: runtime error: left shift of negative value -2147483648 a OP 1; #endif #ifdef TOO_LOW a = 0; // CHECK-TOO_LOW: shift.cpp:[[@LINE+1]]:5: runtime error: shift exponent -3 is negative a OP (-3); #endif #ifdef TOO_HIGH a = 0; // CHECK-TOO_HIGH: shift.cpp:[[@LINE+1]]:5: runtime error: shift exponent 32 is too large for 32-bit type 'int' a OP 32; #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/no-recover.cpp0000664000175000017500000000236612455051222031353 0ustar mwhudsonmwhudson// RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=RECOVER // RUN: %clangxx -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=all -fsanitize-recover=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=RECOVER // RUN: %clangxx -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=unsigned-integer-overflow %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=ABORT #include int main() { // These promote to 'int'. (void)(uint8_t(0xff) + uint8_t(0xff)); (void)(uint16_t(0xf0fff) + uint16_t(0x0fff)); // RECOVER-NOT: runtime error // ABORT-NOT: runtime error uint32_t k = 0x87654321; k += 0xedcba987; // RECOVER: no-recover.cpp:[[@LINE-1]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'unsigned int' // ABORT: no-recover.cpp:[[@LINE-2]]:5: runtime error: unsigned integer overflow: 2271560481 + 3989547399 cannot be represented in type 'unsigned int' (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); // RECOVER: 10000000000000000000 + 9000000000000000000 cannot be represented in type 'unsigned {{long( long)?}}' // ABORT-NOT: runtime error } golang-1.8-race-detector-runtime_0.0+svn285455/test/ubsan/TestCases/Integer/usub-overflow.cpp0000664000175000017500000000251512545333146032117 0ustar mwhudsonmwhudson// RUN: %clangxx -DSUB_I32 -fsanitize=unsigned-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I32 // RUN: %clangxx -DSUB_I64 -fsanitize=unsigned-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I64 // RUN: %clangxx -DSUB_I128 -fsanitize=unsigned-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I128 #include #include int main() { // These promote to 'int'. (void)(uint8_t(0) - uint8_t(0x7f)); (void)(uint16_t(0) - uint16_t(0x7fff)); #ifdef SUB_I32 (void)(uint32_t(1) - uint32_t(2)); // CHECK-SUB_I32: usub-overflow.cpp:[[@LINE-1]]:22: runtime error: unsigned integer overflow: 1 - 2 cannot be represented in type 'unsigned int' #endif #ifdef SUB_I64 (void)(uint64_t(8000000000000000000ll) - uint64_t(9000000000000000000ll)); // CHECK-SUB_I64: 8000000000000000000 - 9000000000000000000 cannot be represented in type 'unsigned {{long( long)?}}' #endif #ifdef SUB_I128 # if defined(__SIZEOF_INT128__) && !defined(_WIN32) (void)((__uint128_t(1) << 126) - (__uint128_t(1) << 127)); # else puts("__int128 not supported\n"); # endif // CHECK-SUB_I128: {{0x40000000000000000000000000000000 - 0x80000000000000000000000000000000 cannot be represented in type 'unsigned __int128'|__int128 not supported}} #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/0000775000175000017500000000000013040224625024122 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/utils.h0000664000175000017500000000022312537637337025452 0ustar mwhudsonmwhudson#ifndef UTILS_H #define UTILS_H static inline void break_optimization(void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/init.c0000664000175000017500000000022112537637337025246 0ustar mwhudsonmwhudson// RUN: %clang_safestack %s -o %t // RUN: %run %t // Basic smoke test for the runtime library. int main(int argc, char **argv) { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/canary.c0000664000175000017500000000175112703241411025544 0ustar mwhudsonmwhudson// RUN: %clang_safestack -fno-stack-protector -D_FORTIFY_SOURCE=0 -g %s -o %t.nossp // RUN: %run %t.nossp 2>&1 | FileCheck --check-prefix=NOSSP %s // RUN: %clang_safestack -fstack-protector-all -D_FORTIFY_SOURCE=0 -g %s -o %t.ssp // RUN: not --crash %run %t.ssp 2>&1 | FileCheck -check-prefix=SSP %s // Test stack canaries on the unsafe stack. // REQUIRES: stable-runtime #include #include #include __attribute__((noinline)) void f(unsigned *y) { char x; char *volatile p = &x; char *volatile q = (char *)y; assert(p < q); assert(q - p < 1024); // sanity // This has technically undefined behavior, but we know the actual layout of // the unsafe stack and this should not touch anything important. memset(&x, 0xab, q - p + sizeof(*y)); } int main(int argc, char **argv) { unsigned y; // NOSSP: main 1 // SSP: main 1 fprintf(stderr, "main 1\n"); f(&y); // NOSSP: main 2 // SSP-NOT: main 2 fprintf(stderr, "main 2\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/CMakeLists.txt0000664000175000017500000000152612741012374026671 0ustar mwhudsonmwhudsonset(SAFESTACK_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SAFESTACK_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(SAFESTACK_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SAFESTACK_TEST_DEPS safestack) # Some tests require LTO, so add a dependency on the relevant LTO plugin. if(LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR) list(APPEND SAFESTACK_TEST_DEPS LLVMgold ) endif() if(APPLE) list(APPEND SAFESTACK_TEST_DEPS LTO ) endif() endif() configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg ) add_lit_testsuite(check-safestack "Running the SafeStack tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${SAFESTACK_TEST_DEPS}) set_target_properties(check-safestack PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/lit.site.cfg.in0000664000175000017500000000044312704361721026751 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@SAFESTACK_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/lto.c0000664000175000017500000000026412537637337025110 0ustar mwhudsonmwhudson// REQUIRES: lto // RUN: %clang_lto_safestack %s -o %t // RUN: %run %t // Test that safe stack works with LTO. int main() { char c[] = "hello world"; puts(c); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/pthread.c0000664000175000017500000000132112540070157025715 0ustar mwhudsonmwhudson// RUN: %clang_safestack %s -pthread -o %t // RUN: %run %t // XFAIL: darwin // Test that pthreads receive their own unsafe stack. #include #include #include #include "utils.h" static int ptr_test = 42; void *t1_start(void *ptr) { if (ptr != &ptr_test) abort(); // safe stack int val = ptr_test * 5; // unsafe stack char buffer[8096]; // two pages memset(buffer, val, sizeof (buffer)); break_optimization(buffer); return ptr; } int main(int argc, char **argv) { pthread_t t1; void *ptr = NULL; if (pthread_create(&t1, NULL, t1_start, &ptr_test)) abort(); if (pthread_join(t1, &ptr)) abort(); if (ptr != &ptr_test) abort(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/overflow.c0000664000175000017500000000110212643562140026130 0ustar mwhudsonmwhudson// RUN: %clang_safestack %s -o %t // RUN: %run %t // RUN: %clang_nosafestack -fno-stack-protector %s -o %t // RUN: not %run %t // Test that buffer overflows on the unsafe stack do not affect variables on the // safe stack. // REQUIRES: stable-runtime __attribute__((noinline)) void fct(volatile int *buffer) { memset(buffer - 1, 0, 7 * sizeof(int)); } int main(int argc, char **argv) { int prebuf[7]; int value1 = 42; int buffer[5]; int value2 = 42; int postbuf[7]; fct(prebuf + 1); fct(postbuf + 1); fct(buffer); return value1 != 42 || value2 != 42; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/buffer-copy-vla.c0000664000175000017500000000110312537637337027304 0ustar mwhudsonmwhudson// RUN: %clang_safestack %s -o %t // RUN: %run %t #include "utils.h" // Test that loads/stores work correctly for VLAs on the unsafe stack. int main(int argc, char **argv) { int i = 128; break_optimization(&i); char buffer[i]; // check that we can write to a buffer for (i = 0; argv[0][i] && i < sizeof (buffer) - 1; ++i) buffer[i] = argv[0][i]; buffer[i] = '\0'; break_optimization(buffer); // check that we can read from a buffer for (i = 0; argv[0][i] && i < sizeof (buffer) - 1; ++i) if (buffer[i] != argv[0][i]) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/lit.cfg0000664000175000017500000000201012766255016025400 0ustar mwhudsonmwhudson# -*- Python -*- import os # Setup config name. config.name = 'SafeStack' # Setup source root. config.test_source_root = os.path.dirname(__file__) # Test suffixes. config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test'] # Add clang substitutions. config.substitutions.append( ("%clang_nosafestack ", config.clang + " -O0 -fno-sanitize=safe-stack ") ) config.substitutions.append( ("%clang_safestack ", config.clang + " -O0 -fsanitize=safe-stack ") ) if config.lto_supported: config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-flto -fsanitize=safe-stack ']))) # SafeStack tests are currently supported on Linux, FreeBSD and Darwin only. if config.host_os not in ['Linux', 'FreeBSD', 'Darwin']: config.unsupported = True # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL # because the test fail due some runtime issue. if config.target_arch != 'aarch64': config.available_features.add('stable-runtime') golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/pthread-cleanup.c0000664000175000017500000000107412537637337027366 0ustar mwhudsonmwhudson// RUN: %clang_safestack %s -pthread -o %t // RUN: not --crash %run %t // Test that unsafe stacks are deallocated correctly on thread exit. #include #include #include enum { kBufferSize = (1 << 15) }; void *t1_start(void *ptr) { char buffer[kBufferSize]; return buffer; } int main(int argc, char **argv) { pthread_t t1; char *buffer = NULL; if (pthread_create(&t1, NULL, t1_start, NULL)) abort(); if (pthread_join(t1, &buffer)) abort(); // should segfault here memset(buffer, 0, kBufferSize); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/safestack/buffer-copy.c0000664000175000017500000000105212537637337026527 0ustar mwhudsonmwhudson// RUN: %clang_safestack %s -o %t // RUN: %run %t #include "utils.h" // Test that loads/stores work correctly for variables on the unsafe stack. int main(int argc, char **argv) { int i; char buffer[128]; // check that we can write to a buffer for (i = 0; argv[0][i] && i < sizeof (buffer) - 1; ++i) buffer[i] = argv[0][i]; buffer[i] = '\0'; break_optimization(buffer); // check that we can read from a buffer for (i = 0; argv[0][i] && i < sizeof (buffer) - 1; ++i) if (buffer[i] != argv[0][i]) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lit.common.configured.in0000664000175000017500000000365612771042144026727 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Set attribute value if it is unset. def set_default(attr, value): if not getattr(config, attr, None): setattr(config, attr, value) # Generic config options for all compiler-rt lit tests. set_default("target_triple", "@COMPILER_RT_DEFAULT_TARGET_TRIPLE@") set_default("target_cflags", "@COMPILER_RT_TEST_COMPILER_CFLAGS@") set_default("host_arch", "@HOST_ARCH@") set_default("target_arch", "@COMPILER_RT_DEFAULT_TARGET_ARCH@") set_default("host_os", "@HOST_OS@") set_default("llvm_build_mode", "@LLVM_BUILD_MODE@") set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@") set_default("llvm_obj_root", "@LLVM_BINARY_DIR@") set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@") set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@") set_default("llvm_tools_dir", "@LLVM_TOOLS_BINARY_DIR@") set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@") set_default("gold_executable", "@GOLD_EXECUTABLE@") set_default("clang", "@COMPILER_RT_TEST_COMPILER@") set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@") set_default("python_executable", "@PYTHON_EXECUTABLE@") set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@) set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@") set_default("emulator", "@COMPILER_RT_EMULATOR@") set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@) set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@) set_default("can_symbolize", @CAN_SYMBOLIZE@) config.available_features.add('target-is-%s' % config.target_arch) # LLVM tools dir can be passed in lit parameters, so try to # apply substitution. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params except KeyError as e: key, = e.args lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) # Setup attributes common for all compiler-rt projects. lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/0000775000175000017500000000000013040224625023616 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-visibility.cpp0000664000175000017500000000566312752442526030562 0ustar mwhudsonmwhudson// RUN: %clangxx_profgen -fcoverage-mapping %S/Inputs/instrprof-visibility-helper.cpp -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge %t.profraw -o %t.profdata // RUN: llvm-profdata show --all-functions %t.profraw | FileCheck %s --check-prefix=PROFILE // RUN: llvm-cov show %t -instr-profile=%t.profdata | FileCheck %s --check-prefix=COV namespace { #define NO_WEAK #define NO_EXTERN #include "instrprof-visibility-kinds.inc" #undef NO_EXTERN #undef NO_WEAK } namespace N1 { #include "instrprof-visibility-kinds.inc" } int main() { call(); N1::call(); return 0; } // PROFILE-DAG: _ZN2N12f1Ev // PROFILE-DAG: _ZN2N12f2Ev // PROFILE-DAG: _ZN2N12f3Ev // PROFILE-DAG: _ZN2N12f4Ev // PROFILE-DAG: _ZN2N12f5Ev // PROFILE-DAG: _ZN2N12f6Ev // PROFILE-DAG: _ZN2N12f7Ev // PROFILE-DAG: _ZN2N14callEv // PROFILE-DAG: main // PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_14callEv // PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f1Ev // PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f3Ev // PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f5Ev // PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f6Ev // PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f7Ev // PROFILE-DAG: Total functions: 15 // COV-DAG: instrprof-visibility-helper.cpp // COV-DAG: instrprof-visibility-kinds.inc // COV-DAG: _ZN2N12f1Ev // COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f1Ev // COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f3Ev // COV-DAG: _ZN2N12f3Ev // COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f5Ev // COV-DAG: _ZN2N12f5Ev // COV-DAG: _ZN2N12f6Ev // COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f6Ev // COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f7Ev // COV-DAG: _ZN2N12f7Ev // --- Check coverage for functions in the anonymous namespace. // COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_14callEv // COV-DAG: [[CALL:[0-9]+]]|{{ *}}1|void call() { // COV-DAG: {{.*}}|{{ *}}1| f1(); // COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_WEAK // COV-DAG: {{.*}}|{{ *}} | f2(); // COV-DAG: {{.*}}|{{ *}} |#endif // COV-DAG: {{.*}}|{{ *}}1| f3(); // COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_EXTERN // COV-DAG: {{.*}}|{{ *}} | f4(); // COV-DAG: {{.*}}|{{ *}} |#endif // COV-DAG: {{.*}}|{{ *}}1| f5(); // COV-DAG: {{.*}}|{{ *}}1| f6(); // COV-DAG: {{.*}}|{{ *}}1| f7(); // COV-DAG: {{.*}}|{{ *}}1|} // --- Check coverage for functions in namespace N1. // COV-DAG: _ZN2N14callEv // COV-DAG: {{ *}}[[CALL]]|{{ *}}1|void call() { // COV-DAG: {{.*}}|{{ *}}1| f1(); // COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_WEAK // COV-DAG: {{.*}}|{{ *}}1| f2(); // COV-DAG: {{.*}}|{{ *}}1|#endif // COV-DAG: {{.*}}|{{ *}}1| f3(); // COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_EXTERN // COV-DAG: {{.*}}|{{ *}}1| f4(); // COV-DAG: {{.*}}|{{ *}}1|#endif // COV-DAG: {{.*}}|{{ *}}1| f5(); // COV-DAG: {{.*}}|{{ *}}1| f6(); // COV-DAG: {{.*}}|{{ *}}1| f7(); // COV-DAG: {{.*}}|{{ *}}1|} // COV-DAG: instrprof-visibility.cpp golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-dlopen.test0000664000175000017500000000433012415036750030031 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -o %t.d/func.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func.c RUN: %clang_profgen -o %t.d/func2.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func2.c RUN: %clang -o %t-local -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_LOCAL" %S/Inputs/instrprof-dlopen-main.c RUN: %clang -o %t-global -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_GLOBAL" %S/Inputs/instrprof-dlopen-main.c RUN: %clang -c -o %t.d/main.o %S/Inputs/instrprof-dlopen-main.c RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dlopen-func.c %S/Inputs/instrprof-dlopen-func2.c %t.d/main.o RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-local.profraw %run %t-local RUN: env LLVM_PROFILE_FILE=%t-global.profraw %run %t-global RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-local.profdata %t-local.profraw RUN: llvm-profdata merge -o %t-global.profdata %t-global.profraw RUN: %clang_profuse=%t-static.profdata -o %t-func.static.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func.c RUN: %clang_profuse=%t-local.profdata -o %t-func.local.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func.c RUN: %clang_profuse=%t-global.profdata -o %t-func.global.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func.c RUN: diff %t-func.static.ll %t-func.local.ll RUN: diff %t-func.static.ll %t-func.global.ll RUN: %clang_profuse=%t-static.profdata -o %t-func2.static.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func2.c RUN: %clang_profuse=%t-local.profdata -o %t-func2.local.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func2.c RUN: %clang_profuse=%t-global.profdata -o %t-func2.global.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func2.c RUN: diff %t-func2.static.ll %t-func2.local.ll RUN: diff %t-func2.static.ll %t-func2.global.ll RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-main.c RUN: %clang_profuse=%t-local.profdata -o %t-main.local.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-main.c RUN: %clang_profuse=%t-local.profdata -o %t-main.global.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-main.c RUN: diff %t-main.static.ll %t-main.local.ll RUN: diff %t-main.static.ll %t-main.global.ll golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-dump.c0000664000175000017500000000307012752255072026764 0ustar mwhudsonmwhudson/* RUN: rm -fr %t.profdir RUN: %clang_profgen=%t.profdir/default_%m.profraw -o %t -O2 %s RUN: %run %t 2>&1 | FileCheck %s --check-prefix=NO_EXIT_WRITE RUN: llvm-profdata merge -o %t.profdata %t.profdir RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=PROF NO_EXIT_WRITE: Profile data not written to file: already written */ int __llvm_profile_dump(void); void __llvm_profile_reset_counters(void); int foo(int); int bar(int); int skip(int); int main(int argc, const char *argv[]) { int Ret = foo(0); /* region 1 */ __llvm_profile_dump(); /* not profiled -- cleared later. */ skip(0); /* skipped region */ __llvm_profile_reset_counters(); Ret += bar(0); /* region 2 */ __llvm_profile_dump(); skip(1); __llvm_profile_reset_counters(); /* foo's profile will be merged. */ foo(1); /* region 3 */ __llvm_profile_dump(); return Ret; } __attribute__((noinline)) int foo(int X) { /* PROF: define {{.*}} @foo({{.*}}!prof ![[ENT:[0-9]+]] PROF: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] */ return X <= 0 ? -X : X; } __attribute__((noinline)) int skip(int X) { /* PROF: define {{.*}} @skip( PROF: br i1 %{{.*}}, label %{{.*}}, label %{{[^,]+$}} */ return X <= 0 ? -X : X; } __attribute__((noinline)) int bar(int X) { /* PROF-LABEL: define {{.*}} @bar( PROF: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] */ return X <= 0 ? -X : X; } /* PROF: ![[ENT]] = !{!"function_entry_count", i64 2} PROF: ![[PD1]] = !{!"branch_weights", i32 2, i32 2} */ golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-bufferio.c0000664000175000017500000001122712715416122027615 0ustar mwhudsonmwhudson// RUN: %clang_profgen -O3 -o %t %s // RUN: %run %t %t.out.1 %t.out.2 %t.out.3 %t.out.4 // RUN: cat %t.out.1 | FileCheck %s // RUN: diff %t.out.1 %t.out.2 // RUN: diff %t.out.2 %t.out.3 // RUN: diff %t.out.3 %t.out.4 #include #include #include #include typedef struct ProfBufferIO ProfBufferIO; ProfBufferIO *lprofCreateBufferIOInternal(void *File, uint32_t BufferSz); void lprofDeleteBufferIO(ProfBufferIO *BufferIO); int lprofBufferIOWrite(ProfBufferIO *BufferIO, const char *Data, uint32_t Size); int lprofBufferIOFlush(ProfBufferIO *BufferIO); int __llvm_profile_runtime = 0; const char *SmallData = "ABC\n"; const char *MediumData = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\n"; char LargeData[10 * 1024]; int main(int argc, const char *argv[]) { ProfBufferIO *BufferIO; FILE *File[4]; uint32_t IOBufferSize[4] = {8, 128, 8 * 1024, 11 * 1024}; int I, J; if (argc < 5) return 1; for (I = 0; I < 10 * 1024 - 2; I++) LargeData[I] = 'A'; LargeData[I++] = '\n'; LargeData[I++] = '\0'; for (J = 0; J < 4; J++) { File[J] = fopen(argv[1 + J], "w"); if (!File[J]) return 1; BufferIO = lprofCreateBufferIOInternal(File[J], IOBufferSize[J]); lprofBufferIOWrite(BufferIO, "Short Strings:\n", strlen("Short Strings:\n")); for (I = 0; I < 1024; I++) { lprofBufferIOWrite(BufferIO, SmallData, strlen(SmallData)); } lprofBufferIOWrite(BufferIO, "Long Strings:\n", strlen("Long Strings:\n")); for (I = 0; I < 1024; I++) { lprofBufferIOWrite(BufferIO, MediumData, strlen(MediumData)); } lprofBufferIOWrite(BufferIO, "Extra Long Strings:\n", strlen("Extra Long Strings:\n")); for (I = 0; I < 10; I++) { lprofBufferIOWrite(BufferIO, LargeData, strlen(LargeData)); } lprofBufferIOWrite(BufferIO, "Mixed Strings:\n", strlen("Mixed Strings:\n")); for (I = 0; I < 1024; I++) { lprofBufferIOWrite(BufferIO, MediumData, strlen(MediumData)); lprofBufferIOWrite(BufferIO, SmallData, strlen(SmallData)); } lprofBufferIOWrite(BufferIO, "Endings:\n", strlen("Endings:\n")); lprofBufferIOWrite(BufferIO, "END\n", strlen("END\n")); lprofBufferIOWrite(BufferIO, "ENDEND\n", strlen("ENDEND\n")); lprofBufferIOWrite(BufferIO, "ENDENDEND\n", strlen("ENDENDEND\n")); lprofBufferIOWrite(BufferIO, "ENDENDENDEND\n", strlen("ENDENDENDEND\n")); lprofBufferIOFlush(BufferIO); lprofDeleteBufferIO(BufferIO); fclose(File[J]); } return 0; } // CHECK-LABEL: Short Strings: // CHECK: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-NEXT: ABC // CHECK-LABEL: Long Strings: // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-LABEL: Mixed Strings: // CHECK: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-NEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 // CHECK-NEXT: ABC // CHECK-LABEL: Endings: // CHECK: END // CHECK-NEXT: ENDEND // CHECK-NEXT: ENDENDEND // CHECK-NEXT: ENDENDENDEND golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/0000775000175000017500000000000013040224625024715 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-dlopen.test0000664000175000017500000000472712645124335031144 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -o %t.d/func.shared -fPIC -shared -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections %S/../Inputs/instrprof-dlopen-func.c RUN: %clang_profgen -o %t.d/func2.shared -fPIC -shared -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections %S/../Inputs/instrprof-dlopen-func2.c RUN: %clang -o %t-local -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_LOCAL" %S/../Inputs/instrprof-dlopen-main.c RUN: %clang -o %t-global -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_GLOBAL" %S/../Inputs/instrprof-dlopen-main.c RUN: %clang -c -o %t.d/main.o %S/../Inputs/instrprof-dlopen-main.c RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-static %S/../Inputs/instrprof-dlopen-func.c %S/../Inputs/instrprof-dlopen-func2.c %t.d/main.o RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-local.profraw %run %t-local RUN: env LLVM_PROFILE_FILE=%t-global.profraw %run %t-global RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-local.profdata %t-local.profraw RUN: llvm-profdata merge -o %t-global.profdata %t-global.profraw RUN: %clang_profuse=%t-static.profdata -o %t-func.static.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func.c RUN: %clang_profuse=%t-local.profdata -o %t-func.local.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func.c RUN: %clang_profuse=%t-global.profdata -o %t-func.global.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func.c RUN: diff %t-func.static.ll %t-func.local.ll RUN: diff %t-func.static.ll %t-func.global.ll RUN: %clang_profuse=%t-static.profdata -o %t-func2.static.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func2.c RUN: %clang_profuse=%t-local.profdata -o %t-func2.local.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func2.c RUN: %clang_profuse=%t-global.profdata -o %t-func2.global.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func2.c RUN: diff %t-func2.static.ll %t-func2.local.ll RUN: diff %t-func2.static.ll %t-func2.global.ll RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-main.c RUN: %clang_profuse=%t-local.profdata -o %t-main.local.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-main.c RUN: %clang_profuse=%t-local.profdata -o %t-main.global.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-main.c RUN: diff %t-main.static.ll %t-main.local.ll RUN: diff %t-main.static.ll %t-main.global.ll golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/lit.local.cfg0000664000175000017500000000165612645124335027276 0ustar mwhudsonmwhudsonimport subprocess def getRoot(config): if not config.parent: return config return getRoot(config.parent) def is_gold_linker_available(): if not config.gold_executable: return False try: ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE) ld_out = ld_cmd.stdout.read().decode() ld_cmd.wait() except: return False if not '-plugin' in ld_out: return False clang_cmd = subprocess.Popen([config.clang, '-fuse-ld=gold', '-xc', '-'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE) clang_err = clang_cmd.communicate('int main() { return 0; }')[1] if not 'invalid linker' in clang_err: return True return False root = getRoot(config) if root.host_os not in ['Linux'] or not is_gold_linker_available(): config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/comdat_rename.test0000664000175000017500000000074012771264430030425 0ustar mwhudsonmwhudson// RUN: rm -fr %t.prof // RUN: %clangxx_pgogen=%t.prof/ -o %t.gen -O2 %S/../Inputs/comdat_rename_1.cc %S/../Inputs/comdat_rename_2.cc // RUN: %run %t.gen // RUN: llvm-profdata merge -o %t.profdata %t.prof/ // RUN: %clangxx_profuse=%t.profdata -O2 -emit-llvm -S %S/../Inputs/comdat_rename_1.cc -o - | FileCheck %S/../Inputs/comdat_rename_1.cc // RUN: %clangxx_profuse=%t.profdata -O2 -emit-llvm -S %S/../Inputs/comdat_rename_2.cc -o - | FileCheck %S/../Inputs/comdat_rename_2.cc golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/coverage_test.cpp0000664000175000017500000000415012752442526030266 0ustar mwhudsonmwhudson// RUN: %clang_profgen -fuse-ld=gold -O2 -fdata-sections -ffunction-sections -fcoverage-mapping -Wl,--gc-sections -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence 2>&1 | FileCheck %s // BFD linker older than 2.26 has a bug that per-func profile data will be wrongly garbage collected when GC is turned on. We only do end-to-end test here without GC: // RUN: %clang_profgen -O2 -fcoverage-mapping -o %t.2 %s // RUN: env LLVM_PROFILE_FILE=%t.2.profraw %run %t.2 // RUN: llvm-profdata merge -o %t.2.profdata %t.2.profraw // RUN: llvm-cov show %t.2 -instr-profile %t.2.profdata -filename-equivalence 2>&1 | FileCheck %s // Check covmap is not garbage collected when GC is turned on with BFD linker. Due to the bug mentioned above, we can only // do the check with objdump: // RUN: %clang_profgen -O2 -fcoverage-mapping -Wl,--gc-sections -o %t.3 %s // RUN: llvm-objdump -h %t.3 | FileCheck --check-prefix COVMAP %s // Check PIE option // RUN: %clang_profgen -fuse-ld=gold -O2 -fdata-sections -ffunction-sections -fPIE -pie -fcoverage-mapping -Wl,--gc-sections -o %t.pie %s // RUN: env LLVM_PROFILE_FILE=%t.pie.profraw %run %t.pie // RUN: llvm-profdata merge -o %t.pie.profdata %t.pie.profraw // RUN: llvm-cov show %t.pie -instr-profile %t.pie.profdata -filename-equivalence 2>&1 | FileCheck %s void foo(bool cond) { // CHECK: [[@LINE]]| 1|void foo( if (cond) { // CHECK: [[@LINE]]| 1| if (cond) { } // CHECK: [[@LINE]]| 0| } } // CHECK: [[@LINE]]| 1|} void bar() { // CHECK: [[@LINE]]| 1|void bar() { } // CHECK: [[@LINE]]| 1|} void func() { // CHECK: [[@LINE]]| 0|void func( } // CHECK: [[@LINE]]| 0|} int main() { // CHECK: [[@LINE]]| 1|int main( foo(false); // CHECK: [[@LINE]]| 1| foo( bar(); // CHECK: [[@LINE]]| 1| bar( return 0; // CHECK: [[@LINE]]| 1| return } // CHECK: [[@LINE]]| 1|} // COVMAP: __llvm_covmap {{.*}} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/coverage_shared.test0000664000175000017500000000235412656701643030757 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -fdata-sections -ffunction-sections -fcoverage-mapping -c -o %t.d/a.shared.o -fPIC %S/../Inputs/instrprof-dynamic-a.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -fcoverage-mapping -o %t.d/a.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-a.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-static %t.d/a.shared.o %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw RUN: llvm-cov show -instr-profile %t-shared.profdata %t.d/a.shared | FileCheck --check-prefix=COV %S/../Inputs/instrprof-dynamic-a.cpp RUN: llvm-cov show -instr-profile %t-static.profdata %t-static | FileCheck --check-prefix=COV %S/../Inputs/instrprof-dynamic-a.cpp golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-alloc.test0000664000175000017500000000066412722075231030745 0ustar mwhudsonmwhudson// RUN: %clang_profgen -Xclang -fprofile-instrument=llvm -fuse-ld=gold -Wl,-wrap,malloc -Wl,-wrap,calloc -o %t -O3 %S/../Inputs/instrprof-alloc.c // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: %clang_profgen -Xclang -fprofile-instrument=llvm -mllvm -vp-static-alloc=false -fuse-ld=gold -Wl,-wrap,malloc -Wl,-wrap,calloc -o %t.dyn -O3 %S/../Inputs/instrprof-alloc.c // RUN: env LLVM_PROFILE_FILE=%t.profraw not %run %t.dyn golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-dynamic-two-shared.test0000664000175000017500000000325312645124335033353 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t.d/a.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-a.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t.d/b.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-b.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %t.d/b.shared %S/../Inputs/instrprof-dynamic-main.cpp RUN: %clang_profgen -o %t-static %S/../Inputs/instrprof-dynamic-a.cpp %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp RUN: diff %t-a.static.ll %t-a.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp RUN: diff %t-b.static.ll %t-b.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp RUN: diff %t-main.static.ll %t-main.shared.ll golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-basic.c0000664000175000017500000000151612645124335030200 0ustar mwhudsonmwhudson// RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s int begin(int i) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (i) return 0; return 1; } int end(int i) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] if (i) return 0; return 1; } int main(int argc, const char *argv[]) { begin(0); end(1); // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] if (argc) return 0; return 1; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} // CHECK: ![[PD2]] = !{!"branch_weights", i32 2, i32 1} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/coverage_ctors.cpp0000664000175000017500000000173112752442526030443 0ustar mwhudsonmwhudson// RUN: %clangxx_profgen -std=c++11 -fuse-ld=gold -fcoverage-mapping -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence 2>&1 | FileCheck %s struct Base { int B; Base() : B(0) {} Base(const Base &b2) { B = b2.B + 5; } Base(Base &&b2) { B = b2.B + 10; } }; struct Derived : public Base { Derived(const Derived &) = default; // CHECK: [[@LINE]]| 2| Derived(const Derived &) = default; Derived(Derived &&) = default; // CHECK: [[@LINE]]| 1| Derived(Derived &&) = default; Derived() = default; // CHECK: [[@LINE]]| 1| Derived() = default }; Derived dd; int main() { Derived dd2(dd); Derived dd3(dd2); Derived dd4(static_cast(dd3)); if (dd.B != 0 || dd2.B != 5 || dd3.B != 10 || dd4.B != 20) return 1; // CHECK: [[@LINE]]| 0| return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-dynamic-one-shared.test0000664000175000017500000000315212645124335033321 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t.d/a.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-a.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: %clang_profgen -fdata-sections -ffunction-sections -fuse-ld=gold -Wl,--gc-sections -o %t-static %S/../Inputs/instrprof-dynamic-a.cpp %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp RUN: diff %t-a.static.ll %t-a.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp RUN: diff %t-b.static.ll %t-b.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp RUN: diff %t-main.static.ll %t-main.shared.ll golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-merge-vp.c0000664000175000017500000000546312720357763030655 0ustar mwhudsonmwhudson// RUN: %clang_profgen -mllvm --enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=3 -O2 -o %t %s // RUN: %run %t %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata show --all-functions --counts --ic-targets %t.profdata > %t.profdump // RUN: FileCheck --input-file %t.profdump %s --check-prefix=FOO // RUN: FileCheck --input-file %t.profdump %s --check-prefix=BAR #include #include #include #include #include int __llvm_profile_runtime = 0; int __llvm_profile_write_file(); void __llvm_profile_reset_counters(void); void __llvm_profile_merge_from_buffer(const char *, uint64_t); void __llvm_profile_set_filename(const char *); struct __llvm_profile_data; struct ValueProfData; void lprofMergeValueProfData(struct ValueProfData *, struct __llvm_profile_data *); /* Force the vp merger module to be linked in. */ void *Dummy = &lprofMergeValueProfData; void callee1() {} void callee2() {} void callee3() {} typedef void (*FP)(void); FP Fps[3] = {callee1, callee2, callee3}; void foo(int N) { int I, J; for (I = 0; I < 3; I++) for (J = 0; J < I * 2 + 1; J++) Fps[I](); if (N < 2) return; for (I = 0; I < 3; I++) for (J = 0; J < I * 2 + 1; J++) Fps[2 - I](); } /* This function is not profiled */ void bar(void) { int I; for (I = 0; I < 20; I++) Fps[I % 3](); } int main(int argc, const char *argv[]) { int i; if (argc < 2) return 1; const char *FileN = argv[1]; __llvm_profile_set_filename(FileN); /* Start profiling. */ __llvm_profile_reset_counters(); foo(1); /* End profiling by freezing counters and * dump them to the file. */ if (__llvm_profile_write_file()) return 1; /* Read profile data into buffer. */ FILE *File = fopen(FileN, "r"); if (!File) return 1; fseek(File, 0, SEEK_END); uint64_t Size = ftell(File); fseek(File, 0, SEEK_SET); char *Buffer = (char *)malloc(Size); if (Size != fread(Buffer, 1, Size, File)) return 1; fclose(File); /* Its profile will be discarded. */ for (i = 0; i < 10; i++) bar(); /* Start profiling again and merge in previously saved counters in buffer. */ __llvm_profile_reset_counters(); __llvm_profile_merge_from_buffer(Buffer, Size); foo(2); /* End profiling. */ truncate(FileN, 0); if (__llvm_profile_write_file()) return 1; /* Its profile will be discarded. */ bar(); return 0; } // FOO-LABEL: foo: // FOO: Indirect Target Results: // FOO-NEXT: [ 0, callee3, 10 ] // FOO-NEXT: [ 0, callee2, 6 ] // FOO-NEXT: [ 0, callee1, 2 ] // FOO-NEXT: [ 1, callee1, 5 ] // FOO-NEXT: [ 1, callee2, 3 ] // FOO-NEXT: [ 1, callee3, 1 ] // BAR-LABEL: bar: // BAR: [ 0, callee1, 0 ] // BAR-NEXT: [ 0, callee2, 0 ] // BAR-NEXT: [ 0, callee3, 0 ] golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/extern_template.test0000664000175000017500000000230412771264430031025 0ustar mwhudsonmwhudson// RUN: %clang -O2 -c -o %t.0.o %S/../Inputs/extern_template.cpp // RUN: %clang_profgen -O2 -c -o %t.o %S/../Inputs/extern_template.cpp // RUN: %clang_profgen -O2 -fcoverage-mapping %S/../Inputs/extern_template1.cpp %S/../Inputs/extern_template2.cpp %t.o -o %t // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata show --all-functions %t.profraw | FileCheck %s // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-cov show -instr-profile=%t.profdata %t | FileCheck %S/../Inputs/extern_template.h // RUN: %clang_profgen -O2 -fcoverage-mapping %S/../Inputs/extern_template1.cpp %S/../Inputs/extern_template2.cpp %t.0.o -o %t.0 // RUN: env LLVM_PROFILE_FILE=%t.0.profraw %run %t.0 // RUN: llvm-profdata show --all-functions %t.0.profraw | FileCheck %s // RUN: llvm-profdata merge -o %t.0.profdata %t.0.profraw // RUN: llvm-cov show -instr-profile=%t.0.profdata %t.0 | FileCheck %S/../Inputs/extern_template.h #define DEF #include "extern_template.h" #undef DEF extern int bar(); extern int foo(); extern Test TO; int main() { foo(); int R = bar(); if (R != 10) return 1; return 0; } // No duplicate entries // CHECK: _ZN4TestIiE4doItEi: // CHECK-NOT: _ZN4TestIiE4doItEi: golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-cs.c0000664000175000017500000000225712771264430027530 0ustar mwhudsonmwhudson// RUN: rm -fr %t.prof // RUN: %clang_pgogen=%t.prof/ -o %t.gen.cs -O2 %s // RUN: %run %t.gen.cs // RUN: llvm-profdata merge -o %t.cs.profdata %t.prof/ // Check context sensitive profile // RUN: %clang_profuse=%t.cs.profdata -O2 -emit-llvm -S %s -o - | FileCheck %s --check-prefix=CS // // RUN: %clang_profgen=%t.profraw -o %t.gen.cis -O2 %s // RUN: %run %t.gen.cis // RUN: llvm-profdata merge -o %t.cis.profdata %t.profraw // Check context insenstive profile // RUN: %clang_profuse=%t.cis.profdata -O2 -emit-llvm -S %s -o - | FileCheck %s --check-prefix=CIS int g1 = 1; int volatile g2 = 2; static void toggle(int t) { if (t & 1) g1 *= t; else g2 *= t; } int main() { int i; // CS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] // CIS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD:[0-9]+]] toggle(g1); // CS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] // CIS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD:[0-9]+]] toggle(g2); return 0; } // CS: ![[PD1]] = !{!"branch_weights", i32 0, i32 1} // CS: ![[PD2]] = !{!"branch_weights", i32 1, i32 0} // CIS: ![[PD]] = !{!"branch_weights", i32 2, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/coverage_dtor.cpp0000664000175000017500000000124212752442526030256 0ustar mwhudsonmwhudson// RUN: %clang_profgen -x c++ -fno-exceptions -std=c++11 -fuse-ld=gold -fcoverage-mapping -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence 2>&1 | FileCheck %s int g = 100; struct Base { int B; Base(int B_) : B(B_) {} ~Base() { g -= B; } }; struct Derived : public Base { Derived(int K) : Base(K) {} ~Derived() = default; // CHECK: [[@LINE]]| 2| ~Derived() = default; }; int main() { { Derived dd(10); Derived dd2(90); } if (g != 0) return 1; // CHECK: [[@LINE]]| 0| return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-value-prof-warn.test0000664000175000017500000000112112722216736032674 0ustar mwhudsonmwhudsonRUN: %clang_profgen -O2 -mllvm -disable-vp=false -Xclang -fprofile-instrument=llvm -mllvm -vp-static-alloc=true -DSTRESS=1 -o %t.ir.warn %S/../Inputs/instrprof-value-prof-real.c RUN: env LLVM_PROFILE_FILE=%t.ir.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir.warn 2>&1 |FileCheck --check-prefix=WARNING %s # Test that enough static counters have been allocated RUN: env LLVM_PROFILE_FILE=%t.ir.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=150 %run %t.ir.warn 2>&1 |FileCheck --check-prefix=NOWARNING --allow-empty %s # WARNING: LLVM Profile Warning: # NOWARNING-NOT: LLVM Profile Warning: golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-comdat.test0000664000175000017500000000066512771264430031130 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clangxx_profgen -o %t.d/comdat -fcoverage-mapping -fuse-ld=gold %S/../Inputs/instrprof-comdat-1.cpp %S/../Inputs/instrprof-comdat-2.cpp RUN: LLVM_PROFILE_FILE=%t-comdat.profraw %run %t.d/comdat RUN: llvm-profdata merge -o %t.d/comdat.prof %t-comdat.profraw RUN: llvm-cov show --filename-equivalence --instr-profile=%t.d/comdat.prof %t.d/comdat | FileCheck --check-prefix=HEADER %S/../Inputs/instrprof-comdat.h golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Linux/instrprof-file_ex.test0000664000175000017500000000101312725403756031265 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -fprofile-instr-generate %S/../Inputs/instrprof-file_ex.c -o %t RUN: rm -f %t.d/run.dump RUN: %run %t %t.d/run.dump RUN: sort %t.d/run.dump | FileCheck %s CHECK: Dump from Child 0 CHECK-NEXT: Dump from Child 1 CHECK-NEXT: Dump from Child 2 CHECK-NEXT: Dump from Child 3 CHECK-NEXT: Dump from Child 4 CHECK-NEXT: Dump from Child 5 CHECK-NEXT: Dump from Child 6 CHECK-NEXT: Dump from Child 7 CHECK-NEXT: Dump from Child 8 CHECK-NEXT: Dump from Child 9 CHECK-NEXT: Dump from parent 10 golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-value-prof-2.c0000664000175000017500000001320712703522677030245 0ustar mwhudsonmwhudson// RUN: %clang_profgen -O2 -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.profdata > %t.out // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-1 < %t.out // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-2 < %t.out // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-3 < %t.out // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-4 < %t.out // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-5 < %t.out // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-6 < %t.out #include #include #include typedef struct __llvm_profile_data __llvm_profile_data; const __llvm_profile_data *__llvm_profile_begin_data(void); const __llvm_profile_data *__llvm_profile_end_data(void); void __llvm_profile_set_num_value_sites(__llvm_profile_data *Data, uint32_t ValueKind, uint16_t NumValueSites); __llvm_profile_data * __llvm_profile_iterate_data(const __llvm_profile_data *Data); void *__llvm_get_function_addr(const __llvm_profile_data *Data); void __llvm_profile_instrument_target(uint64_t TargetValue, void *Data, uint32_t CounterIndex); void callee1() {} void callee2() {} void caller_without_value_site1() {} void caller_with_value_site_never_called1() {} void caller_with_vp1() {} void caller_with_value_site_never_called2() {} void caller_without_value_site2() {} void caller_with_vp2() {} void (*callee1Ptr)(); void (*callee2Ptr)(); void __attribute__ ((noinline)) setFunctionPointers () { callee1Ptr = callee1; callee2Ptr = callee2; } int main(int argc, const char *argv[]) { unsigned S, NS = 10, V; const __llvm_profile_data *Data, *DataEnd; setFunctionPointers(); Data = __llvm_profile_begin_data(); DataEnd = __llvm_profile_end_data(); for (; Data < DataEnd; Data = __llvm_profile_iterate_data(Data)) { void *func = __llvm_get_function_addr(Data); if (func == caller_without_value_site1 || func == caller_without_value_site2 || func == callee1 || func == callee2 || func == main) continue; __llvm_profile_set_num_value_sites((__llvm_profile_data *)Data, 0 /*IPVK_IndirectCallTarget */, 10); if (func == caller_with_value_site_never_called1 || func == caller_with_value_site_never_called2) continue; for (S = 0; S < NS; S++) { unsigned C; for (C = 0; C < S + 1; C++) { __llvm_profile_instrument_target((uint64_t)callee1Ptr, (void *)Data, S); if (C % 2 == 0) __llvm_profile_instrument_target((uint64_t)callee2Ptr, (void *)Data, S); } } } } // CHECK-1-LABEL: caller_with_value_site_never_called2: // CHECK-1-NEXT: Hash: 0x0000000000000000 // CHECK-1-NEXT: Counters: // CHECK-1-NEXT: Function count // CHECK-1-NEXT: Indirect Call Site Count: 10 // CHECK-1-NEXT: Indirect Target Results: // CHECK-2-LABEL: caller_with_vp2: // CHECK-2-NEXT: Hash: 0x0000000000000000 // CHECK-2-NEXT: Counters: // CHECK-2-NEXT: Function count: // CHECK-2-NEXT: Indirect Call Site Count: 10 // CHECK-2-NEXT: Indirect Target Results: // CHECK-2-NEXT: [ 0, callee1, 1 ] // CHECK-2-NEXT: [ 0, callee2, 1 ] // CHECK-2-NEXT: [ 1, callee1, 2 ] // CHECK-2-NEXT: [ 1, callee2, 1 ] // CHECK-2-NEXT: [ 2, callee1, 3 ] // CHECK-2-NEXT: [ 2, callee2, 2 ] // CHECK-2-NEXT: [ 3, callee1, 4 ] // CHECK-2-NEXT: [ 3, callee2, 2 ] // CHECK-2-NEXT: [ 4, callee1, 5 ] // CHECK-2-NEXT: [ 4, callee2, 3 ] // CHECK-2-NEXT: [ 5, callee1, 6 ] // CHECK-2-NEXT: [ 5, callee2, 3 ] // CHECK-2-NEXT: [ 6, callee1, 7 ] // CHECK-2-NEXT: [ 6, callee2, 4 ] // CHECK-2-NEXT: [ 7, callee1, 8 ] // CHECK-2-NEXT: [ 7, callee2, 4 ] // CHECK-2-NEXT: [ 8, callee1, 9 ] // CHECK-2-NEXT: [ 8, callee2, 5 ] // CHECK-2-NEXT: [ 9, callee1, 10 ] // CHECK-2-NEXT: [ 9, callee2, 5 ] // CHECK-3-LABEL: caller_with_vp1: // CHECK-3-NEXT: Hash: 0x0000000000000000 // CHECK-3-NEXT: Counters: // CHECK-3-NEXT: Function count // CHECK-3-NEXT: Indirect Call Site Count: 10 // CHECK-3-NEXT: Indirect Target Results: // CHECK-3-NEXT: [ 0, callee1, 1 ] // CHECK-3-NEXT: [ 0, callee2, 1 ] // CHECK-3-NEXT: [ 1, callee1, 2 ] // CHECK-3-NEXT: [ 1, callee2, 1 ] // CHECK-3-NEXT: [ 2, callee1, 3 ] // CHECK-3-NEXT: [ 2, callee2, 2 ] // CHECK-3-NEXT: [ 3, callee1, 4 ] // CHECK-3-NEXT: [ 3, callee2, 2 ] // CHECK-3-NEXT: [ 4, callee1, 5 ] // CHECK-3-NEXT: [ 4, callee2, 3 ] // CHECK-3-NEXT: [ 5, callee1, 6 ] // CHECK-3-NEXT: [ 5, callee2, 3 ] // CHECK-3-NEXT: [ 6, callee1, 7 ] // CHECK-3-NEXT: [ 6, callee2, 4 ] // CHECK-3-NEXT: [ 7, callee1, 8 ] // CHECK-3-NEXT: [ 7, callee2, 4 ] // CHECK-3-NEXT: [ 8, callee1, 9 ] // CHECK-3-NEXT: [ 8, callee2, 5 ] // CHECK-3-NEXT: [ 9, callee1, 10 ] // CHECK-3-NEXT: [ 9, callee2, 5 ] // CHECK-4-LABEL: caller_with_value_site_never_called1: // CHECK-4-NEXT: Hash: 0x0000000000000000 // CHECK-4-NEXT: Counters: // CHECK-4-NEXT: Function count: // CHECK-4-NEXT: Indirect Call Site Count: 10 // CHECK-4-NEXT: Indirect Target Results: // CHECK-5-LABEL: caller_without_value_site2: // CHECK-5-NEXT: Hash: 0x0000000000000000 // CHECK-5-NEXT: Counters: // CHECK-5-NEXT: Function count: // CHECK-5-NEXT: Indirect Call Site Count: 0 // CHECK-5-NEXT: Indirect Target Results: // CHECK-6-LABEL: caller_without_value_site1: // CHECK-6-NEXT: Hash: 0x0000000000000000 // CHECK-6-NEXT: Counters: // CHECK-6-NEXT: Function count: // CHECK-6-NEXT: Indirect Call Site Count: 0 // CHECK-6-NEXT: Indirect Target Results: golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-reset-counters.c0000664000175000017500000000105612443651733031004 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s void __llvm_profile_reset_counters(void); void foo(int); int main(void) { foo(0); __llvm_profile_reset_counters(); foo(1); return 0; } void foo(int N) { // CHECK-LABEL: define void @foo( // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[FOO:[0-9]+]] if (N) {} } // CHECK: ![[FOO]] = !{!"branch_weights", i32 2, i32 1} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-visibility-kinds.inc0000664000175000017500000000076012675350047031650 0ustar mwhudsonmwhudsonvoid f1() {} #ifndef NO_WEAK void f2() __attribute__((weak)); void f2() {} #endif void f3() __attribute__((always_inline)); void f3() {} #ifndef NO_EXTERN extern void f4(); #endif void f5() __attribute__((visibility("default"))); void f5() {} void f6() __attribute__((visibility("hidden"))); void f6() {} void f7() __attribute__((visibility("internal"))); void f7() {} void call() { f1(); #ifndef NO_WEAK f2(); #endif f3(); #ifndef NO_EXTERN f4(); #endif f5(); f6(); f7(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-merge-match.test0000664000175000017500000000033412666355326030754 0ustar mwhudsonmwhudson// RUN: mkdir -p %t.d // RUN: %clang_profgen -o %t.d/libt.so -fPIC -shared %S/Inputs/instrprof-merge-match-lib.c // RUN: %clang_profgen -o %t -L %t.d -rpath %t.d %S/Inputs/instrprof-merge-match.c -lt // RUN: %run %t golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-value-prof-evict.test0000664000175000017500000000235612743522660031752 0ustar mwhudsonmwhudson// RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=10 -o %t %S/Inputs/instrprof-value-prof-evict.c // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/Inputs/instrprof-value-prof-evict.c // IR level instrumentation // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=10 -o %t.ir %S/Inputs/instrprof-value-prof-evict.c // RUN: env LLVM_PROFILE_FILE=%t.ir.profraw %run %t.ir // RUN: llvm-profdata merge -o %t.ir.profdata %t.ir.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/Inputs/instrprof-value-prof-evict.c // IR level instrumentation, dynamic allocation // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -o %t.ir.dyn %S/Inputs/instrprof-value-prof-evict.c // RUN: env LLVM_PROFILE_FILE=%t.ir.dyn.profraw %run %t.ir.dyn // RUN: llvm-profdata merge -o %t.ir.dyn.profdata %t.ir.dyn.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/Inputs/instrprof-value-prof-evict.c golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-value-prof.c0000664000175000017500000002272412720163561030102 0ustar mwhudsonmwhudson// RUN: %clang_profgen -mllvm -vp-static-alloc=false -O2 -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: env LLVM_PROFILE_FILE=%t-2.profraw %run %t DO_NOT_INSTRUMENT // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata merge -o %t-2.profdata %t-2.profraw // RUN: llvm-profdata merge -o %t-merged.profdata %t.profraw %t-2.profdata // RUN: llvm-profdata show --all-functions -ic-targets %t-2.profdata | FileCheck %s -check-prefix=NO-VALUE // RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %s // RUN: llvm-profdata show --all-functions -ic-targets %t-merged.profdata | FileCheck %s // // RUN: env LLVM_PROFILE_FILE=%t-3.profraw LLVM_VP_BUFFER_SIZE=1 %run %t // RUN: env LLVM_PROFILE_FILE=%t-4.profraw LLVM_VP_BUFFER_SIZE=8 %run %t // RUN: env LLVM_PROFILE_FILE=%t-5.profraw LLVM_VP_BUFFER_SIZE=128 %run %t // RUN: env LLVM_PROFILE_FILE=%t-6.profraw LLVM_VP_BUFFER_SIZE=1024 %run %t // RUN: env LLVM_PROFILE_FILE=%t-7.profraw LLVM_VP_BUFFER_SIZE=102400 %run %t // RUN: llvm-profdata merge -o %t-3.profdata %t-3.profraw // RUN: llvm-profdata merge -o %t-4.profdata %t-4.profraw // RUN: llvm-profdata merge -o %t-5.profdata %t-5.profraw // RUN: llvm-profdata merge -o %t-6.profdata %t-6.profraw // RUN: llvm-profdata merge -o %t-7.profdata %t-7.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t-3.profdata | FileCheck %s // RUN: llvm-profdata show --all-functions -ic-targets %t-4.profdata | FileCheck %s // RUN: llvm-profdata show --all-functions -ic-targets %t-5.profdata | FileCheck %s // RUN: llvm-profdata show --all-functions -ic-targets %t-6.profdata | FileCheck %s // RUN: llvm-profdata show --all-functions -ic-targets %t-7.profdata | FileCheck %s #include #include #include typedef struct __llvm_profile_data __llvm_profile_data; const __llvm_profile_data *__llvm_profile_begin_data(void); const __llvm_profile_data *__llvm_profile_end_data(void); void __llvm_profile_set_num_value_sites(__llvm_profile_data *Data, uint32_t ValueKind, uint16_t NumValueSites); __llvm_profile_data * __llvm_profile_iterate_data(const __llvm_profile_data *Data); void *__llvm_get_function_addr(const __llvm_profile_data *Data); void __llvm_profile_instrument_target(uint64_t TargetValue, void *Data, uint32_t CounterIndex); #define DEF_FUNC(x) \ void x() {} #define DEF_2_FUNCS(x) DEF_FUNC(x##_1) DEF_FUNC(x##_2) #define DEF_4_FUNCS(x) DEF_2_FUNCS(x##_1) DEF_2_FUNCS(x##_2) #define DEF_8_FUNCS(x) DEF_4_FUNCS(x##_1) DEF_4_FUNCS(x##_2) #define DEF_16_FUNCS(x) DEF_8_FUNCS(x##_1) DEF_8_FUNCS(x##_2) #define DEF_32_FUNCS(x) DEF_16_FUNCS(x##_1) DEF_16_FUNCS(x##_2) #define DEF_64_FUNCS(x) DEF_32_FUNCS(x##_1) DEF_32_FUNCS(x##_2) #define DEF_128_FUNCS(x) DEF_64_FUNCS(x##_1) DEF_64_FUNCS(x##_2) #define FUNC_ADDR(x) &x, #define FUNC_2_ADDRS(x) FUNC_ADDR(x##_1) FUNC_ADDR(x##_2) #define FUNC_4_ADDRS(x) FUNC_2_ADDRS(x##_1) FUNC_2_ADDRS(x##_2) #define FUNC_8_ADDRS(x) FUNC_4_ADDRS(x##_1) FUNC_4_ADDRS(x##_2) #define FUNC_16_ADDRS(x) FUNC_8_ADDRS(x##_1) FUNC_8_ADDRS(x##_2) #define FUNC_32_ADDRS(x) FUNC_16_ADDRS(x##_1) FUNC_16_ADDRS(x##_2) #define FUNC_64_ADDRS(x) FUNC_32_ADDRS(x##_1) FUNC_32_ADDRS(x##_2) #define FUNC_128_ADDRS(x) FUNC_64_ADDRS(x##_1) FUNC_64_ADDRS(x##_2) DEF_8_FUNCS(callee) DEF_128_FUNCS(caller) void *CallerAddrs[] = {FUNC_128_ADDRS(caller)}; void *CalleeAddrs[] = {FUNC_8_ADDRS(callee)}; typedef struct CallerInfo { void *CallerAddr; uint32_t NS; /* Number value sites. */ } CallerInfo; CallerInfo CallerInfos[128]; int cmpaddr(const void *p1, const void *p2) { CallerInfo *addr1 = (CallerInfo *)p1; CallerInfo *addr2 = (CallerInfo *)p2; return (intptr_t)addr2->CallerAddr - (intptr_t)addr1->CallerAddr; } int main(int argc, const char *argv[]) { unsigned S, NS = 0, I, V, doInstrument = 1; const __llvm_profile_data *Data, *DataEnd; if (argc >= 2 && !strcmp(argv[1], "DO_NOT_INSTRUMENT")) doInstrument = 0; for (I = 0; I < 128; I++) { CallerInfos[I].CallerAddr = CallerAddrs[I]; CallerInfos[I].NS = I; } qsort(CallerInfos, sizeof(CallerInfos) / sizeof(CallerInfo), sizeof(CallerInfo), cmpaddr); /* We will synthesis value profile data for 128 callers functions declared. * The number of value sites for each caller function is recorded in * the NS field of the CallerInfo object. For each value site, the number of * callee values is determined by the site index (modulo 8). The frequency * of each callee target synthesized is equal to V + 1, in which V is the * index of the target value for the callsite. */ Data = __llvm_profile_begin_data(); DataEnd = __llvm_profile_end_data(); for (; Data < DataEnd; Data = __llvm_profile_iterate_data(Data)) { void *func = __llvm_get_function_addr(Data); CallerInfo Key, *Res; Key.CallerAddr = func; Res = (CallerInfo *) bsearch(&Key, CallerInfos, sizeof(CallerInfos) / sizeof(CallerInfo), sizeof(CallerInfo), cmpaddr); if (Res) { NS = Res->NS; __llvm_profile_set_num_value_sites((__llvm_profile_data *)Data, 0 /*IPVK_IndirectCallTarget */, NS); if (!doInstrument) { continue; } for (S = 0; S < NS; S++) { for (V = 0; V < S % 8; V++) { unsigned C; for (C = 0; C < V + 1; C++) __llvm_profile_instrument_target((uint64_t)CalleeAddrs[V], (void *)Data, S); } } } } } // NO-VALUE: Indirect Call Site Count: 127 // NO-VALUE-NEXT: Indirect Target Results: // CHECK-LABEL: caller_1_1_1_1_2_2_1: // CHECK: Indirect Call Site Count: 6 // CHECK-NEXT: Indirect Target Results: // CHECK-NEXT: [ 1, callee_1_1_1, 1 ] // CHECK-NEXT: [ 2, callee_1_1_2, 2 ] // CHECK-NEXT: [ 2, callee_1_1_1, 1 ] // CHECK-NEXT: [ 3, callee_1_2_1, 3 ] // CHECK-NEXT: [ 3, callee_1_1_2, 2 ] // CHECK-NEXT: [ 3, callee_1_1_1, 1 ] // CHECK-NEXT: [ 4, callee_1_2_2, 4 ] // CHECK-NEXT: [ 4, callee_1_2_1, 3 ] // CHECK-NEXT: [ 4, callee_1_1_2, 2 ] // CHECK-NEXT: [ 4, callee_1_1_1, 1 ] // CHECK-NEXT: [ 5, callee_2_1_1, 5 ] // CHECK-NEXT: [ 5, callee_1_2_2, 4 ] // CHECK-NEXT: [ 5, callee_1_2_1, 3 ] // CHECK-NEXT: [ 5, callee_1_1_2, 2 ] // CHECK-NEXT: [ 5, callee_1_1_1, 1 ] // CHECK-LABEL: caller_2_2_2_2_2_2_2: // CHECK: Indirect Call Site Count: 127 // CHECK-NEXT: Indirect Target Results: // CHECK-NEXT: [ 1, callee_1_1_1, 1 ] // CHECK-NEXT: [ 2, callee_1_1_2, 2 ] // CHECK-NEXT: [ 2, callee_1_1_1, 1 ] // CHECK-NEXT: [ 3, callee_1_2_1, 3 ] // CHECK-NEXT: [ 3, callee_1_1_2, 2 ] // CHECK-NEXT: [ 3, callee_1_1_1, 1 ] // CHECK-NEXT: [ 4, callee_1_2_2, 4 ] // CHECK-NEXT: [ 4, callee_1_2_1, 3 ] // CHECK-NEXT: [ 4, callee_1_1_2, 2 ] // CHECK-NEXT: [ 4, callee_1_1_1, 1 ] // CHECK-NEXT: [ 5, callee_2_1_1, 5 ] // CHECK-NEXT: [ 5, callee_1_2_2, 4 ] // CHECK-NEXT: [ 5, callee_1_2_1, 3 ] // CHECK-NEXT: [ 5, callee_1_1_2, 2 ] // CHECK-NEXT: [ 5, callee_1_1_1, 1 ] // CHECK-NEXT: [ 6, callee_2_1_2, 6 ] // CHECK-NEXT: [ 6, callee_2_1_1, 5 ] // CHECK-NEXT: [ 6, callee_1_2_2, 4 ] // CHECK-NEXT: [ 6, callee_1_2_1, 3 ] // CHECK-NEXT: [ 6, callee_1_1_2, 2 ] // CHECK-NEXT: [ 6, callee_1_1_1, 1 ] // CHECK-NEXT: [ 7, callee_2_2_1, 7 ] // CHECK-NEXT: [ 7, callee_2_1_2, 6 ] // CHECK-NEXT: [ 7, callee_2_1_1, 5 ] // CHECK-NEXT: [ 7, callee_1_2_2, 4 ] // CHECK-NEXT: [ 7, callee_1_2_1, 3 ] // CHECK-NEXT: [ 7, callee_1_1_2, 2 ] // CHECK-NEXT: [ 7, callee_1_1_1, 1 ] // CHECK-NEXT: [ 9, callee_1_1_1, 1 ] // CHECK-NEXT: [ 10, callee_1_1_2, 2 ] // CHECK-NEXT: [ 10, callee_1_1_1, 1 ] // CHECK-NEXT: [ 11, callee_1_2_1, 3 ] // CHECK-NEXT: [ 11, callee_1_1_2, 2 ] // CHECK-NEXT: [ 11, callee_1_1_1, 1 ] // CHECK-NEXT: [ 12, callee_1_2_2, 4 ] // CHECK-NEXT: [ 12, callee_1_2_1, 3 ] // CHECK-NEXT: [ 12, callee_1_1_2, 2 ] // CHECK-NEXT: [ 12, callee_1_1_1, 1 ] // CHECK-NEXT: [ 13, callee_2_1_1, 5 ] // CHECK-NEXT: [ 13, callee_1_2_2, 4 ] // CHECK-NEXT: [ 13, callee_1_2_1, 3 ] // CHECK-NEXT: [ 13, callee_1_1_2, 2 ] // CHECK-NEXT: [ 13, callee_1_1_1, 1 ] // CHECK-NEXT: [ 14, callee_2_1_2, 6 ] // CHECK-NEXT: [ 14, callee_2_1_1, 5 ] // CHECK-NEXT: [ 14, callee_1_2_2, 4 ] // CHECK-NEXT: [ 14, callee_1_2_1, 3 ] // CHECK-NEXT: [ 14, callee_1_1_2, 2 ] // CHECK-NEXT: [ 14, callee_1_1_1, 1 ] // CHECK-NEXT: [ 15, callee_2_2_1, 7 ] // CHECK-NEXT: [ 15, callee_2_1_2, 6 ] // CHECK-NEXT: [ 15, callee_2_1_1, 5 ] // CHECK-NEXT: [ 15, callee_1_2_2, 4 ] // CHECK-NEXT: [ 15, callee_1_2_1, 3 ] // CHECK-NEXT: [ 15, callee_1_1_2, 2 ] // CHECK-NEXT: [ 15, callee_1_1_1, 1 ] // CHECK-NEXT: [ 17, callee_1_1_1, 1 ] // CHECK-NEXT: [ 18, callee_1_1_2, 2 ] // CHECK-NEXT: [ 18, callee_1_1_1, 1 ] // CHECK-NEXT: [ 19, callee_1_2_1, 3 ] // CHECK-NEXT: [ 19, callee_1_1_2, 2 ] // CHECK-NEXT: [ 19, callee_1_1_1, 1 ] // CHECK-NEXT: [ 20, callee_1_2_2, 4 ] // CHECK-NEXT: [ 20, callee_1_2_1, 3 ] // CHECK-NEXT: [ 20, callee_1_1_2, 2 ] // CHECK-NEXT: [ 20, callee_1_1_1, 1 ] // CHECK-NEXT: [ 21, callee_2_1_1, 5 ] // CHECK-NEXT: [ 21, callee_1_2_2, 4 ] // CHECK-NEXT: [ 21, callee_1_2_1, 3 ] // CHECK-NEXT: [ 21, callee_1_1_2, 2 ] // CHECK-NEXT: [ 21, callee_1_1_1, 1 ] // CHECK-NEXT: [ 22, callee_2_1_2, 6 ] // CHECK-NEXT: [ 22, callee_2_1_1, 5 ] // CHECK-NEXT: [ 22, callee_1_2_2, 4 ] // CHECK-NEXT: [ 22, callee_1_2_1, 3 ] // CHECK-NEXT: [ 22, callee_1_1_2, 2 ] // CHECK-NEXT: [ 22, callee_1_1_1, 1 ] golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-icall-promo.test0000664000175000017500000000152712743522660030777 0ustar mwhudsonmwhudson# IR based instrumentation RUN: %clangxx_pgogen -O2 -c -o %t.1.o %S/Inputs/instrprof-icall-promo_1.cc RUN: %clangxx_pgogen -O2 -c -o %t.2.o %S/Inputs/instrprof-icall-promo_2.cc RUN: %clangxx_pgogen -O2 %t.2.o %t.1.o -o %t.gen.1 RUN: env LLVM_PROFILE_FILE=%t-icall.profraw %run %t.gen.1 RUN: llvm-profdata merge -o %t-icall.profdata %t-icall.profraw RUN: %clangxx_profuse=%t-icall.profdata -O2 -Rpass=pgo-icall-prom -c -o %t.2.use.o %S/Inputs/instrprof-icall-promo_2.cc 2>&1 | FileCheck %s RUN: %clangxx_pgogen -O2 %t.1.o %t.2.o -o %t.gen.2 RUN: env LLVM_PROFILE_FILE=%t-icall2.profraw %run %t.gen.2 RUN: llvm-profdata merge -o %t-icall2.profdata %t-icall2.profraw RUN: %clangxx_profuse=%t-icall2.profdata -O2 -Rpass=pgo-icall-prom -c -o %t.2.use.o %S/Inputs/instrprof-icall-promo_2.cc 2>&1 | FileCheck %s # CHECK: Promote indirect call to golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-darwin-dead-strip.c0000664000175000017500000000500012777257100031331 0ustar mwhudsonmwhudson// REQUIRES: osx-ld64-live_support // REQUIRES: lto // RUN: %clang_profgen=%t.profraw -fcoverage-mapping -mllvm -enable-name-compression=false -Wl,-dead_strip -o %t %s // RUN: %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata show --all-functions %t.profdata | FileCheck %s -check-prefix=PROF // RUN: llvm-cov show %t -instr-profile %t.profdata | FileCheck %s -check-prefix=COV // RUN: nm %t | FileCheck %s -check-prefix=NM // RUN: otool -s __DATA __llvm_prf_names %t | FileCheck %s -check-prefix=PRF_NAMES // RUN: otool -s __DATA __llvm_prf_cnts %t | FileCheck %s -check-prefix=PRF_CNTS // RUN: %clang_lto_profgen=%t.lto.profraw -fcoverage-mapping -mllvm -enable-name-compression=false -Wl,-dead_strip -flto -o %t.lto %s // RUN: %run %t.lto // RUN: llvm-profdata merge -o %t.lto.profdata %t.lto.profraw // RUN: llvm-profdata show --all-functions %t.lto.profdata | FileCheck %s -check-prefix=PROF // RUN: llvm-cov show %t.lto -instr-profile %t.lto.profdata | FileCheck %s -check-prefix=COV // RUN: nm %t.lto | FileCheck %s -check-prefix=NM // RUN: otool -s __DATA __llvm_prf_names %t.lto | FileCheck %s -check-prefix=PRF_NAMES // RUN: otool -s __DATA __llvm_prf_cnts %t.lto | FileCheck %s -check-prefix=PRF_CNTS // Note: We expect foo() and some of the profiling data associated with it to // be dead-stripped. // COV: [[@LINE+1]]{{ *}}|{{ *}}0|void foo() void foo() {} // COV: [[@LINE+1]]{{ *}}|{{ *}}1|int main int main() { return 0; } // NM-NOT: foo // PROF: Counters: // PROF-NEXT: main: // PROF-NEXT: Hash: // PROF-NEXT: Counters: 1 // PROF-NEXT: Function count: 1 // PROF-NEXT: Functions shown: 1 // PROF-NEXT: Total functions: 1 // PROF-NEXT: Maximum function count: 1 // PROF-NEXT: Maximum internal block count: 0 // Note: We don't expect the names of dead-stripped functions to disappear from // __llvm_prf_names, because collectPGOFuncNameStrings() glues the names // together. // PRF_NAMES: Contents of (__DATA,__llvm_prf_names) section // PRF_NAMES-NEXT: {{.*}} 08 00 66 6f 6f 01 6d 61 69 6e{{ +$}} // | | f o o # m a i n // | |___________| // | | // UncompressedLen = 8 | // | // CompressedLen = 0 // Note: We expect the profile counters for dead-stripped functions to also be // dead-stripped. // PRF_CNTS: Contents of (__DATA,__llvm_prf_cnts) section // PRF_CNTS-NEXT: {{.*}} 00 00 00 00 00 00 00 00{{ +$}} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/CMakeLists.txt0000664000175000017500000000242512741012374026364 0ustar mwhudsonmwhudsonset(PROFILE_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(PROFILE_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(PROFILE_TESTSUITES) set(PROFILE_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND PROFILE_TEST_DEPS profile llvm-profdata llvm-cov) endif() set(PROFILE_TEST_ARCH ${PROFILE_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(PROFILE_SUPPORTED_ARCH PROFILE_TEST_ARCH) endif() foreach(arch ${PROFILE_TEST_ARCH}) set(PROFILE_TEST_TARGET_ARCH ${arch}) if(${arch} MATCHES "arm|aarch64") # This is only true if we're cross-compiling. set(PROFILE_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} PROFILE_TEST_TARGET_CFLAGS) string(REPLACE ";" " " PROFILE_TEST_TARGET_CFLAGS "${PROFILE_TEST_TARGET_CFLAGS}") endif() set(CONFIG_NAME Profile-${arch}) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg ) list(APPEND PROFILE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() add_lit_testsuite(check-profile "Running the profile tests" ${PROFILE_TESTSUITES} DEPENDS ${PROFILE_TEST_DEPS}) set_target_properties(check-profile PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-hostname.c0000664000175000017500000000101212733270433027624 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%h.%t-%h.profraw_%h %run %t // RUN: %run uname -n > %t.n // RUN: llvm-profdata merge -o %t.profdata `cat %t.n`.%t-`cat %t.n`.profraw_`cat %t.n` // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s // REQUIRES: shell int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc > 2) return 1; return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-override-filename-with-env.c0000664000175000017500000000076012744254166033162 0ustar mwhudsonmwhudson// RUN: %clang_profgen=%t.bad.profraw -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t.good.profraw %run %t %t.bad.profraw // RUN: llvm-profdata merge -o %t.profdata %t.good.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s void bar () {} int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; bar(); return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/lit.site.cfg.in0000664000175000017500000000074512704361721026452 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.profile_lit_binary_dir = "@PROFILE_LIT_BINARY_DIR@" config.target_cflags = "@PROFILE_TEST_TARGET_CFLAGS@" config.target_arch = "@PROFILE_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@PROFILE_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-override-filename.c0000664000175000017500000000067412744254166031427 0ustar mwhudsonmwhudson// RUN: %clang_profgen=%t.profraw -o %t -O3 %s // RUN: %run %t %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s void bar() {} int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; bar(); return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/gcc-flag-compatibility.test0000664000175000017500000000140412744030037031032 0ustar mwhudsonmwhudsonRUN: rm -rf %t.d RUN: mkdir -p %t.d RUN: %clang_profgen_gcc=%t.d/d1/d2 -o %t.d/code %S/Inputs/gcc-flag-compatibility.c # Test that the instrumented code writes to %t.d/d1/d2/ RUN: %run %t.d/code RUN: llvm-profdata merge -o %t.profdata %t.d/d1/d2/ # Test that we can override the directory and file name with LLVM_PROFILE_FILE. RUN: env LLVM_PROFILE_FILE=%t.d/x1/prof.raw %run %t.d/code RUN: llvm-profdata merge -o %t.profdata %t.d/x1/ # Test that we can specify a directory with -fprofile-use. RUN: llvm-profdata merge -o %t.d/default.profdata %t.d/x1/ RUN: %clang_profuse_gcc=%t.d -o %t.d/code %S/Inputs/gcc-flag-compatibility.c # Test that we can specify a file with -fprofile-use. RUN: %clang_profuse_gcc=%t.profdata -o %t.d/code %S/Inputs/gcc-flag-compatibility.c golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-dynamic-two-shared.test0000664000175000017500000000267312335307355032262 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp RUN: %clang_profgen -o %t.d/b.shared -fPIC -shared %S/Inputs/instrprof-dynamic-b.cpp RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %t.d/b.shared %S/Inputs/instrprof-dynamic-main.cpp RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dynamic-a.cpp %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp RUN: diff %t-a.static.ll %t-a.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp RUN: diff %t-b.static.ll %t-b.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp RUN: diff %t-main.static.ll %t-main.shared.ll golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-value-prof.test0000664000175000017500000000324412743522660030637 0ustar mwhudsonmwhudson// RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -o %t %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // IR level instrumentation // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -o %t.ir %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.ir.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir // RUN: llvm-profdata merge -o %t.ir.profdata %t.ir.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.profdata -o %t.ir.proftxt // RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.proftxt // IR level instrumentation with dynamic memory allocation // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -o %t.ir.dyn %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.ir.dyn.profraw %run %t.ir.dyn // RUN: llvm-profdata merge -o %t.ir.dyn.profdata %t.ir.dyn.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.dyn.profdata -o %t.ir.dyn.proftxt // RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.dyn.proftxt golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-basic.c0000664000175000017500000000514712744527222027107 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=COMMON --check-prefix=ORIG // // RUN: rm -fr %t.dir1 // RUN: mkdir -p %t.dir1 // RUN: env LLVM_PROFILE_FILE=%t.dir1/profraw_e_%1m %run %t // RUN: env LLVM_PROFILE_FILE=%t.dir1/profraw_e_%1m %run %t // RUN: llvm-profdata merge -o %t.em.profdata %t.dir1 // RUN: %clang_profuse=%t.em.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=COMMON --check-prefix=MERGE // // RUN: rm -fr %t.dir2 // RUN: mkdir -p %t.dir2 // RUN: %clang_profgen=%t.dir2/%m.profraw -o %t.merge -O3 %s // RUN: %run %t.merge // RUN: %run %t.merge // RUN: llvm-profdata merge -o %t.m.profdata %t.dir2/ // RUN: %clang_profuse=%t.m.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=COMMON --check-prefix=MERGE // // Test that merging is enabled by default with -fprofile-generate= // RUN: rm -fr %t.dir3 // RUN: mkdir -p %t.dir3 // RUN: %clang_pgogen=%t.dir3/ -o %t.merge3 -O0 %s // RUN: %run %t.merge3 // RUN: %run %t.merge3 // RUN: %run %t.merge3 // RUN: %run %t.merge3 // RUN: llvm-profdata merge -o %t.m3.profdata %t.dir3/ // RUN: %clang_profuse=%t.m3.profdata -O0 -o - -S -emit-llvm %s | FileCheck %s --check-prefix=COMMON --check-prefix=PGOMERGE // // Test that merging is enabled by default with -fprofile-generate // RUN: rm -fr %t.dir4 // RUN: mkdir -p %t.dir4 // RUN: %clang_pgogen -o %t.dir4/merge4 -O0 %s // RUN: cd %t.dir4 // RUN: %run %t.dir4/merge4 // RUN: %run %t.dir4/merge4 // RUN: %run %t.dir4/merge4 // RUN: %run %t.dir4/merge4 // RUN: rm -f %t.dir4/merge4 // RUN: llvm-profdata merge -o %t.m4.profdata ./ // RUN: %clang_profuse=%t.m4.profdata -O0 -o - -S -emit-llvm %s | FileCheck %s --check-prefix=COMMON --check-prefix=PGOMERGE int begin(int i) { // COMMON: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (i) return 0; return 1; } int end(int i) { // COMMON: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] if (i) return 0; return 1; } int main(int argc, const char *argv[]) { begin(0); end(1); // COMMON: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] if (argc) return 0; return 1; } // ORIG: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} // ORIG: ![[PD2]] = !{!"branch_weights", i32 2, i32 1} // MERGE: ![[PD1]] = !{!"branch_weights", i32 1, i32 3} // MERGE: ![[PD2]] = !{!"branch_weights", i32 3, i32 1} // PGOMERGE: ![[PD1]] = !{!"branch_weights", i32 0, i32 4} // PGOMERGE: ![[PD2]] = !{!"branch_weights", i32 4, i32 0} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-set-filename.c0000664000175000017500000000417212727161165030375 0ustar mwhudsonmwhudson// 1. Test that __llvm_profile_set_filename has higher precedence than // the default path. // RUN: %clang_profgen -o %t -O3 %s // RUN: %run %t %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s // RUN: rm %t.profraw // RUN: rm %t.profdata // 2. Test that __llvm_profile_set_filename has higher precedence than // environment variable // RUN: env LLVM_PROFILE_FILE=%t.env.profraw %run %t %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s // RUN: rm %t.profraw // RUN: rm %t.profdata // 3. Test that __llvm_profile_set_filename has higher precedence than // the command line. // RUN: %clang_profgen=%t.cmd.profraw -o %t.cmd -O3 %s // RUN: %run %t.cmd %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s // RUN: rm %t.profraw // RUN: rm %t.profdata // 4. Test that command line has high precedence than the default path // RUN: %clang_profgen=%t.cmd.profraw -DNO_API -o %t.cmd -O3 %s // RUN: %run %t.cmd %t.profraw // RUN: llvm-profdata merge -o %t.cmd.profdata %t.cmd.profraw // RUN: %clang_profuse=%t.cmd.profdata -o - -S -emit-llvm %s | FileCheck %s // RUN: rm %t.cmd.profraw // RUN: rm %t.cmd.profdata // 5. Test that the environment variable has higher precedence than // the command line. // RUN: env LLVM_PROFILE_FILE=%t.env.profraw %run %t.cmd %t.profraw // RUN: llvm-profdata merge -o %t.env.profdata %t.env.profraw // RUN: %clang_profuse=%t.env.profdata -o - -S -emit-llvm %s | FileCheck %s // RUN: rm %t.env.profraw // RUN: rm %t.env.profdata #ifdef CALL_SHARED extern void func(int); #endif void __llvm_profile_set_filename(const char *); int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; #ifndef NO_API __llvm_profile_set_filename(argv[1]); #endif #ifdef CALL_SHARED func(1); #endif return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} // SHARED: Total functions: 2 golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-path.c0000664000175000017500000000175012743576541026765 0ustar mwhudsonmwhudson// RUN: %clang_pgogen -O2 -o %t.0 %s // RUN: %clang_pgogen=%t.d1 -O2 -o %t.1 %s // RUN: %clang_pgogen=%t.d1/%t.d2 -O2 -o %t.2 %s // // RUN: %run %t.0 "" // RUN: env LLVM_PROFILE_FILE=%t.d1/default.profraw %run %t.0 %t.d1/ // RUN: env LLVM_PROFILE_FILE=%t.d1/%t.d2/default.profraw %run %t.0 %t.d1/%t.d2/ // RUN: %run %t.1 %t.d1/ // RUN: %run %t.2 %t.d1/%t.d2/ // RUN: %run %t.2 %t.d1/%t.d2/ %t.d1/%t.d2/%t.d3/blah.profraw %t.d1/%t.d2/%t.d3/ #include const char *__llvm_profile_get_path_prefix(); void __llvm_profile_set_filanem(const char*); int main(int argc, const char *argv[]) { int i; const char *expected; const char *prefix; if (argc < 2) return 1; expected = argv[1]; prefix = __llvm_profile_get_path_prefix(); if (strcmp(prefix, expected)) return 1; if (argc == 4) { __llvm_profile_set_filename(argv[2]); prefix = __llvm_profile_get_path_prefix(); expected = argv[3]; if (strcmp(prefix, expected)) return 1; } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-dynamic-one-shared.test0000664000175000017500000000257212335307355032230 0ustar mwhudsonmwhudsonRUN: mkdir -p %t.d RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dynamic-a.cpp %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp RUN: diff %t-a.static.ll %t-a.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp RUN: diff %t-b.static.ll %t-b.shared.ll RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp RUN: diff %t-main.static.ll %t-main.shared.ll golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-without-libc.c0000664000175000017500000000430012676302437030431 0ustar mwhudsonmwhudson// RUN: %clang_profgen -DCHECK_SYMBOLS -O3 -o %t.symbols %s // RUN: llvm-nm %t.symbols | FileCheck %s --check-prefix=CHECK-SYMBOLS // RUN: %clang_profgen -O3 -o %t %s // RUN: %run %t %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s #include #include #ifndef CHECK_SYMBOLS #include #endif int __llvm_profile_runtime = 0; uint64_t __llvm_profile_get_size_for_buffer(void); int __llvm_profile_write_buffer(char *); void __llvm_profile_merge_from_buffer(const char *, uint64_t Size); int write_buffer(uint64_t, const char *); int main(int argc, const char *argv[]) { // CHECK-LABEL: define {{.*}} @main( // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; const uint64_t MaxSize = 10000; static char Buffer[MaxSize]; uint64_t Size = __llvm_profile_get_size_for_buffer(); if (Size > MaxSize) return 1; int Write = __llvm_profile_write_buffer(Buffer); if (Write) return Write; #ifdef CHECK_SYMBOLS // Don't write it out. Since we're checking the symbols, we don't have libc // available. // Call merge function to make sure it does not bring in libc deps: __llvm_profile_merge_from_buffer(Buffer, Size); return 0; #else // Actually write it out so we can FileCheck the output. FILE *File = fopen(argv[1], "w"); if (!File) return 1; if (fwrite(Buffer, 1, Size, File) != Size) return 1; return fclose(File); #endif } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} // CHECK-SYMBOLS-NOT: {{ }}___cxx_global_var_init // CHECK-SYMBOLS-NOT: {{ }}___llvm_profile_register_write_file_atexit // CHECK-SYMBOLS-NOT: {{ }}___llvm_profile_set_filename // CHECK-SYMBOLS-NOT: {{ }}___llvm_profile_write_file // CHECK-SYMBOLS-NOT: {{ }}_fdopen // CHECK-SYMBOLS-NOT: {{ }}_fopen // CHECK-SYMBOLS-NOT: {{ }}_fwrite // CHECK-SYMBOLS-NOT: {{ }}_getenv // CHECK-SYMBOLS-NOT: {{ }}getenv // CHECK-SYMBOLS-NOT: {{ }}_malloc // CHECK-SYMBOLS-NOT: {{ }}malloc // CHECK-SYMBOLS-NOT: {{ }}_calloc // CHECK-SYMBOLS-NOT: {{ }}calloc // CHECK-SYMBOLS-NOT: {{ }}_free // CHECK-SYMBOLS-NOT: {{ }}free // CHECK-SYMBOLS-NOT: {{ }}_open golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-value-prof-shared.test0000664000175000017500000001226512744562706032114 0ustar mwhudsonmwhudson// RUN: mkdir -p %t.d // RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c // RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -o %t -rpath %t.d %t.d/t.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED // IR level instrumentation // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir %t.d/t.ir.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c // Profile data from shared library will be concatenated to the same raw file. // RUN: env LLVM_PROFILE_FILE=%t.ir.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir // RUN: llvm-profdata merge -o %t.ir.profdata %t.ir.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.profdata -o %t.ir.proftxt // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED // RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.proftxt // Same as above but with profile online merging enabled. // RUN: rm -fr %t.prof/ // RUN: mkdir -p %t.prof/ // RUN: %clang_pgogen=%t.prof -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.m.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c // RUN: %clang_pgogen=%t.prof -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.m %t.d/t.ir.m.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir.m // RUN: llvm-profdata merge -o %t.ir.m.profdata -dump-input-file-list %t.prof/ | count 2 // RUN: llvm-profdata merge -o %t.ir.m.profdata %t.prof/ // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.m.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.m.profdata -o %t.ir.m.proftxt // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.m.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED // RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.m.proftxt // IR level instrumentation: dynamic memory allocation // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.dyn.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.dyn %t.d/t.ir.dyn.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.ir.dyn.profraw %run %t.ir.dyn // RUN: llvm-profdata merge -o %t.ir.dyn.profdata %t.ir.dyn.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.dyn.profdata -o %t.ir.dyn.proftxt // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED // RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.dyn.proftxt // IR level instrumentation: main program uses static counter, shared library uses dynamic memory alloc. // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.dyn.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c // RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.mixed %t.d/t.ir.dyn.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.ir.mixed.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir.mixed // RUN: llvm-profdata merge -o %t.ir.mixed.profdata %t.ir.mixed.profraw // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.mixed.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.mixed.profdata -o %t.ir.mixed.proftxt // RUN: llvm-profdata show --all-functions -ic-targets %t.ir.mixed.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED // RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.mixed.proftxt golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-version-mismatch.c0000664000175000017500000000053112717516576031320 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: %run %t 1 2>&1 | FileCheck %s // override the version variable with a bogus version: unsigned long long __llvm_profile_raw_version = 10000; int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile Error: Runtime and instrumentation version mismatch golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-merge.c0000664000175000017500000000440712666104166027124 0ustar mwhudsonmwhudson// RUN: %clang_profgen -O2 -o %t %s // RUN: %run %t %t.profraw 1 1 // RUN: llvm-profdata show --all-functions --counts %t.profraw | FileCheck %s #include #include #include int __llvm_profile_runtime = 0; uint64_t __llvm_profile_get_size_for_buffer(void); int __llvm_profile_write_buffer(char *); void __llvm_profile_reset_counters(void); void __llvm_profile_merge_from_buffer(const char *, uint64_t); int dumpBuffer(const char *FileN, const char *Buffer, uint64_t Size) { FILE *File = fopen(FileN, "w"); if (!File) return 1; if (fwrite(Buffer, 1, Size, File) != Size) return 1; return fclose(File); } int g = 0; void foo(char c) { if (c == '1') g++; else g--; } /* This function is not profiled */ void bar(int M) { g += M; } int main(int argc, const char *argv[]) { int i; if (argc < 4) return 1; const uint64_t MaxSize = 10000; static char Buffer[MaxSize]; uint64_t Size = __llvm_profile_get_size_for_buffer(); if (Size > MaxSize) return 1; /* Start profiling. */ __llvm_profile_reset_counters(); foo(argv[2][0]); /* End profiling by freezing counters. */ if (__llvm_profile_write_buffer(Buffer)) return 1; /* Its profile will be discarded. */ for (i = 0; i < 10; i++) bar(1); /* Start profiling again and merge in previously saved counters in buffer. */ __llvm_profile_reset_counters(); __llvm_profile_merge_from_buffer(Buffer, Size); foo(argv[3][0]); /* End profiling */ if (__llvm_profile_write_buffer(Buffer)) return 1; /* Its profile will be discarded. */ bar(2); /* Now it is time to dump the profile to file. */ return dumpBuffer(argv[1], Buffer, Size); } // Not profiled // CHECK-LABEL: dumpBuffer: // CHECK: Counters: 3 // CHECK-NEXT: Function count: 0 // CHECK-NEXT: Block counts: [0, 0] // Profiled with entry count == 2 // CHECK-LABEL: foo: // CHECK: Counters: 2 // CHECK-NEXT: Function count: 2 // CHECK-NEXT: Block counts: [2] // Not profiled // CHECK-LABEL: bar: // CHECK: Counters: 1 // CHECK-NEXT Function count: 0 // CHECK-NEXT Block counts: [] // Not profiled // CHECK-LABEL: main: // CHECK: Counters: 6 // CHECK-NEXT: Function count: 0 // CHECK-NEXT: Block counts: [0, 0, 0, 0, 0] golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-write-file-atexit-explicitly.c0000664000175000017500000000116612443651733033553 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: %run %t %t.profraw // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s int __llvm_profile_runtime = 0; int __llvm_profile_register_write_file_atexit(void); void __llvm_profile_set_filename(const char *); int main(int argc, const char *argv[]) { __llvm_profile_register_write_file_atexit(); // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; __llvm_profile_set_filename(argv[1]); return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-write-file-only.c0000664000175000017500000000233112675404665031054 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s int __llvm_profile_runtime = 0; void __llvm_profile_initialize_file(void); int __llvm_profile_write_file(void); void __llvm_profile_set_filename(const char *); int foo(int); int main(int argc, const char *argv[]) { // CHECK-LABEL: define {{.*}} @main( // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc > 42) return 1; // Since the runtime has been suppressed, initialize the file name, as the // writing will fail below as the file name has not been specified. __llvm_profile_initialize_file(); // Write out the profile. __llvm_profile_write_file(); // Change the profile. return foo(0); } int foo(int X) { // There should be no profiling information for @foo, since it was called // after the profile was written (and the atexit was suppressed by defining // profile_runtime). // CHECK-LABEL: define {{.*}} @foo( // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{[^,]+$}} return X <= 0 ? -X : X; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/0000775000175000017500000000000013040224625025100 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/extern_template.h0000664000175000017500000000071112752442526030463 0ustar mwhudsonmwhudsontemplate struct Test { Test() : M(10) {} void doIt(int N) { // CHECK: [[@LINE]]| 2| void doIt if (N > 10) { // CHECK: [[@LINE]]| 2| if (N > 10) { M += 2; // CHECK: [[@LINE]]| 1| M += 2; } else // CHECK: [[@LINE]]| 1| } else M -= 2; // CHECK: [[@LINE]]| 1| M -= 2; } T M; }; #ifdef USE extern template struct Test; #endif #ifdef DEF template struct Test; #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dlopen-func2.c0000664000175000017500000000004012335535402031562 0ustar mwhudsonmwhudsonvoid func2(int K) { if (K) {} } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dynamic-header.h0000664000175000017500000000012612532165425032155 0ustar mwhudsonmwhudsontemplate void bar(int X) { if (X) { X *= 4; } } void a(); void b(); golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-shared-main.c0000664000175000017500000000031112621462443031461 0ustar mwhudsonmwhudsonextern int g1, g2; extern void foo(int n); int main() { int i, j; for (i = 0; i < 1000; i++) for (j = 0; j < 1000; j++) foo(i * j); if (g2 - g1 == 280001) return 0; return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/comdat_rename_2.cc0000664000175000017500000000071312747754476030460 0ustar mwhudsonmwhudson#include "comdat_rename.h" extern void test(FOO *); FOO foo; int main() { test(&foo); foo.caller(20); return 0; } // The copy of 'caller' defined in this module -- it has // 'callee' call remaining. // // CHECK-LABEL: define {{.*}}caller{{.*}} // CHECK: {{.*}} call {{.*}} // CHECK-NOT: br i1 {{.*}} // CHECK: br {{.*}}label %[[BB1:.*]], label{{.*}}!prof ![[PD1:[0-9]+]] // CHECK: {{.*}}[[BB1]]: // CHECK:![[PD1]] = !{!"branch_weights", i32 0, i32 1} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-value-prof-real.c0000664000175000017500000014747412721673267032331 0ustar mwhudsonmwhudson#define DEF_FUNC(x) \ void x() {} #define DEF_2_FUNCS(x) DEF_FUNC(x##_1) DEF_FUNC(x##_2) #define DEF_4_FUNCS(x) DEF_2_FUNCS(x##_1) DEF_2_FUNCS(x##_2) #define DEF_8_FUNCS(x) DEF_4_FUNCS(x##_1) DEF_4_FUNCS(x##_2) #define DEF_16_FUNCS(x) DEF_8_FUNCS(x##_1) DEF_8_FUNCS(x##_2) #define DEF_32_FUNCS(x) DEF_16_FUNCS(x##_1) DEF_16_FUNCS(x##_2) #define DEF_64_FUNCS(x) DEF_32_FUNCS(x##_1) DEF_32_FUNCS(x##_2) #define DEF_128_FUNCS(x) DEF_64_FUNCS(x##_1) DEF_64_FUNCS(x##_2) #define DEF_256_FUNCS(x) DEF_128_FUNCS(x##_1) DEF_128_FUNCS(x##_2) #define DEF_512_FUNCS(x) DEF_256_FUNCS(x##_1) DEF_256_FUNCS(x##_2) #define FUNC_ADDR(x) &x, #define FUNC_2_ADDRS(x) FUNC_ADDR(x##_1) FUNC_ADDR(x##_2) #define FUNC_4_ADDRS(x) FUNC_2_ADDRS(x##_1) FUNC_2_ADDRS(x##_2) #define FUNC_8_ADDRS(x) FUNC_4_ADDRS(x##_1) FUNC_4_ADDRS(x##_2) #define FUNC_16_ADDRS(x) FUNC_8_ADDRS(x##_1) FUNC_8_ADDRS(x##_2) #define FUNC_32_ADDRS(x) FUNC_16_ADDRS(x##_1) FUNC_16_ADDRS(x##_2) #define FUNC_64_ADDRS(x) FUNC_32_ADDRS(x##_1) FUNC_32_ADDRS(x##_2) #define FUNC_128_ADDRS(x) FUNC_64_ADDRS(x##_1) FUNC_64_ADDRS(x##_2) #define FUNC_256_ADDRS(x) FUNC_128_ADDRS(x##_1) FUNC_128_ADDRS(x##_2) #define FUNC_512_ADDRS(x) FUNC_256_ADDRS(x##_1) FUNC_256_ADDRS(x##_2) DEF_512_FUNCS(foo) void *CalleeAddrs[] = {FUNC_512_ADDRS(foo)}; typedef void (*FPT)(void); FPT getFunc(int I) { return CalleeAddrs[I]; } #ifdef SHARED_LIB int shared_entry() { #else #ifdef CALL_SHARED extern int shared_entry(); #endif int main() { #endif int I; for (I = 0; I < 512; I++) { FPT Fp = getFunc(I); int J; for (J = 0; J < 1000 - I; J++) Fp(); Fp = getFunc(511 - I); for (J = 0; J < 2000 - I; J++) Fp(); #ifdef STRESS Fp = getFunc(I); for (J = 0; J < 2000 - I; J++) Fp(); Fp = getFunc(I); for (J = 0; J < 2000 - I; J++) Fp(); Fp = getFunc(I); for (J = 0; J < 2000 - I; J++) Fp(); Fp = getFunc(I); for (J = 0; J < 2000 - I; J++) Fp(); #endif } #ifdef CALL_SHARED shared_entry(); #endif return 0; } // IR: :ir // CHECK-LABEL: main: // CHECK: [ 0, foo_1_1_1_1_1_1_1_1_1, 1000 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_1_1_2, 999 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_1_2_1, 998 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_1_2_2, 997 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_2_1_1, 996 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_2_1_2, 995 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_2_2_1, 994 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_1_2_2_2, 993 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_1_1_1, 992 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_1_1_2, 991 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_1_2_1, 990 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_1_2_2, 989 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_2_1_1, 988 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_2_1_2, 987 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_2_2_1, 986 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_1_2_2_2_2, 985 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_1_1_1, 984 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_1_1_2, 983 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_1_2_1, 982 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_1_2_2, 981 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_2_1_1, 980 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_2_1_2, 979 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_2_2_1, 978 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_1_2_2_2, 977 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_1_1_1, 976 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_1_1_2, 975 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_1_2_1, 974 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_1_2_2, 973 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_2_1_1, 972 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_2_1_2, 971 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_2_2_1, 970 ] // CHECK-NEXT: [ 0, foo_1_1_1_1_2_2_2_2_2, 969 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_1_1_1, 968 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_1_1_2, 967 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_1_2_1, 966 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_1_2_2, 965 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_2_1_1, 964 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_2_1_2, 963 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_2_2_1, 962 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_1_2_2_2, 961 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_1_1_1, 960 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_1_1_2, 959 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_1_2_1, 958 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_1_2_2, 957 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_2_1_1, 956 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_2_1_2, 955 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_2_2_1, 954 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_1_2_2_2_2, 953 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_1_1_1, 952 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_1_1_2, 951 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_1_2_1, 950 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_1_2_2, 949 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_2_1_1, 948 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_2_1_2, 947 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_2_2_1, 946 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_1_2_2_2, 945 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_1_1_1, 944 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_1_1_2, 943 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_1_2_1, 942 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_1_2_2, 941 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_2_1_1, 940 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_2_1_2, 939 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_2_2_1, 938 ] // CHECK-NEXT: [ 0, foo_1_1_1_2_2_2_2_2_2, 937 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_1_1_1, 936 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_1_1_2, 935 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_1_2_1, 934 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_1_2_2, 933 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_2_1_1, 932 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_2_1_2, 931 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_2_2_1, 930 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_1_2_2_2, 929 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_1_1_1, 928 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_1_1_2, 927 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_1_2_1, 926 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_1_2_2, 925 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_2_1_1, 924 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_2_1_2, 923 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_2_2_1, 922 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_1_2_2_2_2, 921 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_1_1_1, 920 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_1_1_2, 919 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_1_2_1, 918 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_1_2_2, 917 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_2_1_1, 916 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_2_1_2, 915 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_2_2_1, 914 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_1_2_2_2, 913 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_1_1_1, 912 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_1_1_2, 911 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_1_2_1, 910 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_1_2_2, 909 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_2_1_1, 908 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_2_1_2, 907 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_2_2_1, 906 ] // CHECK-NEXT: [ 0, foo_1_1_2_1_2_2_2_2_2, 905 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_1_1_1, 904 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_1_1_2, 903 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_1_2_1, 902 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_1_2_2, 901 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_2_1_1, 900 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_2_1_2, 899 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_2_2_1, 898 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_1_2_2_2, 897 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_1_1_1, 896 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_1_1_2, 895 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_1_2_1, 894 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_1_2_2, 893 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_2_1_1, 892 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_2_1_2, 891 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_2_2_1, 890 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_1_2_2_2_2, 889 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_1_1_1, 888 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_1_1_2, 887 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_1_2_1, 886 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_1_2_2, 885 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_2_1_1, 884 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_2_1_2, 883 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_2_2_1, 882 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_1_2_2_2, 881 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_1_1_1, 880 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_1_1_2, 879 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_1_2_1, 878 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_1_2_2, 877 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_2_1_1, 876 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_2_1_2, 875 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_2_2_1, 874 ] // CHECK-NEXT: [ 0, foo_1_1_2_2_2_2_2_2_2, 873 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_1_1_1, 872 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_1_1_2, 871 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_1_2_1, 870 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_1_2_2, 869 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_2_1_1, 868 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_2_1_2, 867 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_2_2_1, 866 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_1_2_2_2, 865 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_1_1_1, 864 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_1_1_2, 863 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_1_2_1, 862 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_1_2_2, 861 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_2_1_1, 860 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_2_1_2, 859 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_2_2_1, 858 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_1_2_2_2_2, 857 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_1_1_1, 856 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_1_1_2, 855 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_1_2_1, 854 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_1_2_2, 853 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_2_1_1, 852 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_2_1_2, 851 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_2_2_1, 850 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_1_2_2_2, 849 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_1_1_1, 848 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_1_1_2, 847 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_1_2_1, 846 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_1_2_2, 845 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_2_1_1, 844 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_2_1_2, 843 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_2_2_1, 842 ] // CHECK-NEXT: [ 0, foo_1_2_1_1_2_2_2_2_2, 841 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_1_1_1, 840 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_1_1_2, 839 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_1_2_1, 838 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_1_2_2, 837 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_2_1_1, 836 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_2_1_2, 835 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_2_2_1, 834 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_1_2_2_2, 833 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_1_1_1, 832 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_1_1_2, 831 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_1_2_1, 830 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_1_2_2, 829 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_2_1_1, 828 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_2_1_2, 827 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_2_2_1, 826 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_1_2_2_2_2, 825 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_1_1_1, 824 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_1_1_2, 823 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_1_2_1, 822 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_1_2_2, 821 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_2_1_1, 820 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_2_1_2, 819 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_2_2_1, 818 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_1_2_2_2, 817 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_1_1_1, 816 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_1_1_2, 815 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_1_2_1, 814 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_1_2_2, 813 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_2_1_1, 812 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_2_1_2, 811 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_2_2_1, 810 ] // CHECK-NEXT: [ 0, foo_1_2_1_2_2_2_2_2_2, 809 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_1_1_1, 808 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_1_1_2, 807 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_1_2_1, 806 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_1_2_2, 805 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_2_1_1, 804 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_2_1_2, 803 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_2_2_1, 802 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_1_2_2_2, 801 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_1_1_1, 800 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_1_1_2, 799 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_1_2_1, 798 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_1_2_2, 797 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_2_1_1, 796 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_2_1_2, 795 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_2_2_1, 794 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_1_2_2_2_2, 793 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_1_1_1, 792 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_1_1_2, 791 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_1_2_1, 790 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_1_2_2, 789 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_2_1_1, 788 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_2_1_2, 787 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_2_2_1, 786 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_1_2_2_2, 785 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_1_1_1, 784 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_1_1_2, 783 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_1_2_1, 782 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_1_2_2, 781 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_2_1_1, 780 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_2_1_2, 779 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_2_2_1, 778 ] // CHECK-NEXT: [ 0, foo_1_2_2_1_2_2_2_2_2, 777 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_1_1_1, 776 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_1_1_2, 775 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_1_2_1, 774 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_1_2_2, 773 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_2_1_1, 772 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_2_1_2, 771 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_2_2_1, 770 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_1_2_2_2, 769 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_1_1_1, 768 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_1_1_2, 767 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_1_2_1, 766 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_1_2_2, 765 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_2_1_1, 764 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_2_1_2, 763 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_2_2_1, 762 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_1_2_2_2_2, 761 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_1_1_1, 760 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_1_1_2, 759 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_1_2_1, 758 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_1_2_2, 757 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_2_1_1, 756 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_2_1_2, 755 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_2_2_1, 754 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_1_2_2_2, 753 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_2_1_1_1, 752 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_2_1_1_2, 751 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_2_1_2_1, 750 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_2_1_2_2, 749 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_2_2_1_1, 748 ] // CHECK-NEXT: [ 0, foo_1_2_2_2_2_2_2_1_2, 747 ] // CHECK-NEXT: [ 0, foo // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_2_2_2, 2000 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_2_2_1, 1999 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_2_1_2, 1998 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_2_1_1, 1997 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_1_2_2, 1996 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_1_2_1, 1995 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_1_1_2, 1994 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_2_1_1_1, 1993 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_2_2_2, 1992 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_2_2_1, 1991 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_2_1_2, 1990 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_2_1_1, 1989 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_1_2_2, 1988 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_1_2_1, 1987 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_1_1_2, 1986 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_2_1_1_1_1, 1985 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_2_2_2, 1984 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_2_2_1, 1983 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_2_1_2, 1982 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_2_1_1, 1981 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_1_2_2, 1980 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_1_2_1, 1979 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_1_1_2, 1978 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_2_1_1_1, 1977 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_2_2_2, 1976 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_2_2_1, 1975 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_2_1_2, 1974 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_2_1_1, 1973 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_1_2_2, 1972 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_1_2_1, 1971 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_1_1_2, 1970 ] // CHECK-NEXT: [ 1, foo_2_2_2_2_1_1_1_1_1, 1969 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_2_2_2, 1968 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_2_2_1, 1967 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_2_1_2, 1966 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_2_1_1, 1965 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_1_2_2, 1964 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_1_2_1, 1963 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_1_1_2, 1962 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_2_1_1_1, 1961 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_2_2_2, 1960 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_2_2_1, 1959 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_2_1_2, 1958 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_2_1_1, 1957 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_1_2_2, 1956 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_1_2_1, 1955 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_1_1_2, 1954 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_2_1_1_1_1, 1953 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_2_2_2, 1952 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_2_2_1, 1951 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_2_1_2, 1950 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_2_1_1, 1949 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_1_2_2, 1948 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_1_2_1, 1947 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_1_1_2, 1946 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_2_1_1_1, 1945 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_2_2_2, 1944 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_2_2_1, 1943 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_2_1_2, 1942 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_2_1_1, 1941 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_1_2_2, 1940 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_1_2_1, 1939 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_1_1_2, 1938 ] // CHECK-NEXT: [ 1, foo_2_2_2_1_1_1_1_1_1, 1937 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_2_2_2, 1936 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_2_2_1, 1935 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_2_1_2, 1934 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_2_1_1, 1933 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_1_2_2, 1932 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_1_2_1, 1931 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_1_1_2, 1930 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_2_1_1_1, 1929 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_2_2_2, 1928 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_2_2_1, 1927 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_2_1_2, 1926 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_2_1_1, 1925 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_1_2_2, 1924 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_1_2_1, 1923 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_1_1_2, 1922 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_2_1_1_1_1, 1921 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_2_2_2, 1920 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_2_2_1, 1919 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_2_1_2, 1918 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_2_1_1, 1917 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_1_2_2, 1916 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_1_2_1, 1915 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_1_1_2, 1914 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_2_1_1_1, 1913 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_2_2_2, 1912 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_2_2_1, 1911 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_2_1_2, 1910 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_2_1_1, 1909 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_1_2_2, 1908 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_1_2_1, 1907 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_1_1_2, 1906 ] // CHECK-NEXT: [ 1, foo_2_2_1_2_1_1_1_1_1, 1905 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_2_2_2, 1904 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_2_2_1, 1903 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_2_1_2, 1902 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_2_1_1, 1901 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_1_2_2, 1900 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_1_2_1, 1899 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_1_1_2, 1898 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_2_1_1_1, 1897 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_2_2_2, 1896 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_2_2_1, 1895 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_2_1_2, 1894 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_2_1_1, 1893 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_1_2_2, 1892 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_1_2_1, 1891 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_1_1_2, 1890 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_2_1_1_1_1, 1889 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_2_2_2, 1888 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_2_2_1, 1887 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_2_1_2, 1886 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_2_1_1, 1885 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_1_2_2, 1884 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_1_2_1, 1883 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_1_1_2, 1882 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_2_1_1_1, 1881 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_2_2_2, 1880 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_2_2_1, 1879 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_2_1_2, 1878 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_2_1_1, 1877 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_1_2_2, 1876 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_1_2_1, 1875 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_1_1_2, 1874 ] // CHECK-NEXT: [ 1, foo_2_2_1_1_1_1_1_1_1, 1873 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_2_2_2, 1872 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_2_2_1, 1871 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_2_1_2, 1870 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_2_1_1, 1869 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_1_2_2, 1868 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_1_2_1, 1867 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_1_1_2, 1866 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_2_1_1_1, 1865 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_2_2_2, 1864 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_2_2_1, 1863 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_2_1_2, 1862 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_2_1_1, 1861 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_1_2_2, 1860 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_1_2_1, 1859 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_1_1_2, 1858 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_2_1_1_1_1, 1857 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_2_2_2, 1856 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_2_2_1, 1855 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_2_1_2, 1854 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_2_1_1, 1853 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_1_2_2, 1852 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_1_2_1, 1851 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_1_1_2, 1850 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_2_1_1_1, 1849 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_2_2_2, 1848 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_2_2_1, 1847 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_2_1_2, 1846 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_2_1_1, 1845 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_1_2_2, 1844 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_1_2_1, 1843 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_1_1_2, 1842 ] // CHECK-NEXT: [ 1, foo_2_1_2_2_1_1_1_1_1, 1841 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_2_2_2, 1840 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_2_2_1, 1839 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_2_1_2, 1838 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_2_1_1, 1837 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_1_2_2, 1836 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_1_2_1, 1835 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_1_1_2, 1834 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_2_1_1_1, 1833 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_2_2_2, 1832 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_2_2_1, 1831 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_2_1_2, 1830 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_2_1_1, 1829 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_1_2_2, 1828 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_1_2_1, 1827 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_1_1_2, 1826 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_2_1_1_1_1, 1825 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_2_2_2, 1824 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_2_2_1, 1823 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_2_1_2, 1822 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_2_1_1, 1821 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_1_2_2, 1820 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_1_2_1, 1819 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_1_1_2, 1818 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_2_1_1_1, 1817 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_2_2_2, 1816 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_2_2_1, 1815 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_2_1_2, 1814 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_2_1_1, 1813 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_1_2_2, 1812 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_1_2_1, 1811 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_1_1_2, 1810 ] // CHECK-NEXT: [ 1, foo_2_1_2_1_1_1_1_1_1, 1809 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_2_2_2, 1808 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_2_2_1, 1807 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_2_1_2, 1806 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_2_1_1, 1805 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_1_2_2, 1804 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_1_2_1, 1803 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_1_1_2, 1802 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_2_1_1_1, 1801 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_2_2_2, 1800 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_2_2_1, 1799 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_2_1_2, 1798 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_2_1_1, 1797 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_1_2_2, 1796 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_1_2_1, 1795 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_1_1_2, 1794 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_2_1_1_1_1, 1793 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_2_2_2, 1792 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_2_2_1, 1791 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_2_1_2, 1790 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_2_1_1, 1789 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_1_2_2, 1788 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_1_2_1, 1787 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_1_1_2, 1786 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_2_1_1_1, 1785 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_2_2_2, 1784 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_2_2_1, 1783 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_2_1_2, 1782 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_2_1_1, 1781 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_1_2_2, 1780 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_1_2_1, 1779 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_1_1_2, 1778 ] // CHECK-NEXT: [ 1, foo_2_1_1_2_1_1_1_1_1, 1777 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_2_2_2, 1776 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_2_2_1, 1775 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_2_1_2, 1774 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_2_1_1, 1773 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_1_2_2, 1772 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_1_2_1, 1771 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_1_1_2, 1770 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_2_1_1_1, 1769 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_2_2_2, 1768 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_2_2_1, 1767 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_2_1_2, 1766 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_2_1_1, 1765 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_1_2_2, 1764 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_1_2_1, 1763 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_1_1_2, 1762 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_2_1_1_1_1, 1761 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_2_2_2, 1760 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_2_2_1, 1759 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_2_1_2, 1758 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_2_1_1, 1757 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_1_2_2, 1756 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_1_2_1, 1755 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_1_1_2, 1754 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_2_1_1_1, 1753 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_1_2_2_2, 1752 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_1_2_2_1, 1751 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_1_2_1_2, 1750 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_1_2_1_1, 1749 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_1_1_2_2, 1748 ] // CHECK-NEXT: [ 1, foo_2_1_1_1_1_1_1_2_1, 1747 ] // CHECK-NEXT: [ 1, foo // SHARED-LABEL: shared_entry: // SHARED: [ 0, foo_1_1_1_1_1_1_1_1_1, 1000 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_1_1_2, 999 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_1_2_1, 998 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_1_2_2, 997 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_2_1_1, 996 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_2_1_2, 995 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_2_2_1, 994 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_1_2_2_2, 993 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_1_1_1, 992 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_1_1_2, 991 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_1_2_1, 990 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_1_2_2, 989 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_2_1_1, 988 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_2_1_2, 987 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_2_2_1, 986 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_1_2_2_2_2, 985 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_1_1_1, 984 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_1_1_2, 983 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_1_2_1, 982 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_1_2_2, 981 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_2_1_1, 980 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_2_1_2, 979 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_2_2_1, 978 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_1_2_2_2, 977 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_1_1_1, 976 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_1_1_2, 975 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_1_2_1, 974 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_1_2_2, 973 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_2_1_1, 972 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_2_1_2, 971 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_2_2_1, 970 ] // SHARED-NEXT: [ 0, foo_1_1_1_1_2_2_2_2_2, 969 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_1_1_1, 968 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_1_1_2, 967 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_1_2_1, 966 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_1_2_2, 965 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_2_1_1, 964 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_2_1_2, 963 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_2_2_1, 962 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_1_2_2_2, 961 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_1_1_1, 960 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_1_1_2, 959 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_1_2_1, 958 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_1_2_2, 957 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_2_1_1, 956 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_2_1_2, 955 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_2_2_1, 954 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_1_2_2_2_2, 953 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_1_1_1, 952 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_1_1_2, 951 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_1_2_1, 950 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_1_2_2, 949 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_2_1_1, 948 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_2_1_2, 947 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_2_2_1, 946 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_1_2_2_2, 945 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_1_1_1, 944 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_1_1_2, 943 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_1_2_1, 942 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_1_2_2, 941 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_2_1_1, 940 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_2_1_2, 939 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_2_2_1, 938 ] // SHARED-NEXT: [ 0, foo_1_1_1_2_2_2_2_2_2, 937 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_1_1_1, 936 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_1_1_2, 935 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_1_2_1, 934 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_1_2_2, 933 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_2_1_1, 932 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_2_1_2, 931 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_2_2_1, 930 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_1_2_2_2, 929 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_1_1_1, 928 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_1_1_2, 927 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_1_2_1, 926 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_1_2_2, 925 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_2_1_1, 924 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_2_1_2, 923 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_2_2_1, 922 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_1_2_2_2_2, 921 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_1_1_1, 920 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_1_1_2, 919 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_1_2_1, 918 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_1_2_2, 917 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_2_1_1, 916 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_2_1_2, 915 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_2_2_1, 914 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_1_2_2_2, 913 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_1_1_1, 912 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_1_1_2, 911 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_1_2_1, 910 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_1_2_2, 909 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_2_1_1, 908 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_2_1_2, 907 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_2_2_1, 906 ] // SHARED-NEXT: [ 0, foo_1_1_2_1_2_2_2_2_2, 905 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_1_1_1, 904 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_1_1_2, 903 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_1_2_1, 902 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_1_2_2, 901 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_2_1_1, 900 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_2_1_2, 899 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_2_2_1, 898 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_1_2_2_2, 897 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_1_1_1, 896 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_1_1_2, 895 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_1_2_1, 894 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_1_2_2, 893 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_2_1_1, 892 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_2_1_2, 891 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_2_2_1, 890 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_1_2_2_2_2, 889 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_1_1_1, 888 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_1_1_2, 887 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_1_2_1, 886 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_1_2_2, 885 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_2_1_1, 884 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_2_1_2, 883 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_2_2_1, 882 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_1_2_2_2, 881 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_1_1_1, 880 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_1_1_2, 879 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_1_2_1, 878 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_1_2_2, 877 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_2_1_1, 876 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_2_1_2, 875 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_2_2_1, 874 ] // SHARED-NEXT: [ 0, foo_1_1_2_2_2_2_2_2_2, 873 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_1_1_1, 872 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_1_1_2, 871 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_1_2_1, 870 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_1_2_2, 869 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_2_1_1, 868 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_2_1_2, 867 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_2_2_1, 866 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_1_2_2_2, 865 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_1_1_1, 864 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_1_1_2, 863 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_1_2_1, 862 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_1_2_2, 861 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_2_1_1, 860 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_2_1_2, 859 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_2_2_1, 858 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_1_2_2_2_2, 857 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_1_1_1, 856 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_1_1_2, 855 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_1_2_1, 854 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_1_2_2, 853 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_2_1_1, 852 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_2_1_2, 851 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_2_2_1, 850 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_1_2_2_2, 849 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_1_1_1, 848 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_1_1_2, 847 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_1_2_1, 846 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_1_2_2, 845 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_2_1_1, 844 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_2_1_2, 843 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_2_2_1, 842 ] // SHARED-NEXT: [ 0, foo_1_2_1_1_2_2_2_2_2, 841 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_1_1_1, 840 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_1_1_2, 839 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_1_2_1, 838 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_1_2_2, 837 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_2_1_1, 836 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_2_1_2, 835 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_2_2_1, 834 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_1_2_2_2, 833 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_1_1_1, 832 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_1_1_2, 831 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_1_2_1, 830 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_1_2_2, 829 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_2_1_1, 828 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_2_1_2, 827 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_2_2_1, 826 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_1_2_2_2_2, 825 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_1_1_1, 824 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_1_1_2, 823 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_1_2_1, 822 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_1_2_2, 821 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_2_1_1, 820 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_2_1_2, 819 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_2_2_1, 818 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_1_2_2_2, 817 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_1_1_1, 816 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_1_1_2, 815 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_1_2_1, 814 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_1_2_2, 813 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_2_1_1, 812 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_2_1_2, 811 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_2_2_1, 810 ] // SHARED-NEXT: [ 0, foo_1_2_1_2_2_2_2_2_2, 809 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_1_1_1, 808 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_1_1_2, 807 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_1_2_1, 806 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_1_2_2, 805 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_2_1_1, 804 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_2_1_2, 803 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_2_2_1, 802 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_1_2_2_2, 801 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_1_1_1, 800 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_1_1_2, 799 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_1_2_1, 798 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_1_2_2, 797 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_2_1_1, 796 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_2_1_2, 795 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_2_2_1, 794 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_1_2_2_2_2, 793 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_1_1_1, 792 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_1_1_2, 791 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_1_2_1, 790 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_1_2_2, 789 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_2_1_1, 788 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_2_1_2, 787 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_2_2_1, 786 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_1_2_2_2, 785 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_1_1_1, 784 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_1_1_2, 783 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_1_2_1, 782 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_1_2_2, 781 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_2_1_1, 780 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_2_1_2, 779 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_2_2_1, 778 ] // SHARED-NEXT: [ 0, foo_1_2_2_1_2_2_2_2_2, 777 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_1_1_1, 776 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_1_1_2, 775 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_1_2_1, 774 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_1_2_2, 773 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_2_1_1, 772 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_2_1_2, 771 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_2_2_1, 770 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_1_2_2_2, 769 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_1_1_1, 768 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_1_1_2, 767 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_1_2_1, 766 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_1_2_2, 765 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_2_1_1, 764 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_2_1_2, 763 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_2_2_1, 762 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_1_2_2_2_2, 761 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_1_1_1, 760 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_1_1_2, 759 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_1_2_1, 758 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_1_2_2, 757 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_2_1_1, 756 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_2_1_2, 755 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_2_2_1, 754 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_1_2_2_2, 753 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_2_1_1_1, 752 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_2_1_1_2, 751 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_2_1_2_1, 750 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_2_1_2_2, 749 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_2_2_1_1, 748 ] // SHARED-NEXT: [ 0, foo_1_2_2_2_2_2_2_1_2, 747 ] // SHARED-NEXT: [ 0, foo // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_2_2_2, 2000 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_2_2_1, 1999 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_2_1_2, 1998 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_2_1_1, 1997 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_1_2_2, 1996 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_1_2_1, 1995 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_1_1_2, 1994 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_2_1_1_1, 1993 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_2_2_2, 1992 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_2_2_1, 1991 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_2_1_2, 1990 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_2_1_1, 1989 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_1_2_2, 1988 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_1_2_1, 1987 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_1_1_2, 1986 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_2_1_1_1_1, 1985 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_2_2_2, 1984 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_2_2_1, 1983 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_2_1_2, 1982 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_2_1_1, 1981 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_1_2_2, 1980 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_1_2_1, 1979 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_1_1_2, 1978 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_2_1_1_1, 1977 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_2_2_2, 1976 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_2_2_1, 1975 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_2_1_2, 1974 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_2_1_1, 1973 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_1_2_2, 1972 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_1_2_1, 1971 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_1_1_2, 1970 ] // SHARED-NEXT: [ 1, foo_2_2_2_2_1_1_1_1_1, 1969 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_2_2_2, 1968 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_2_2_1, 1967 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_2_1_2, 1966 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_2_1_1, 1965 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_1_2_2, 1964 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_1_2_1, 1963 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_1_1_2, 1962 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_2_1_1_1, 1961 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_2_2_2, 1960 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_2_2_1, 1959 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_2_1_2, 1958 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_2_1_1, 1957 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_1_2_2, 1956 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_1_2_1, 1955 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_1_1_2, 1954 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_2_1_1_1_1, 1953 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_2_2_2, 1952 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_2_2_1, 1951 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_2_1_2, 1950 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_2_1_1, 1949 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_1_2_2, 1948 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_1_2_1, 1947 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_1_1_2, 1946 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_2_1_1_1, 1945 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_2_2_2, 1944 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_2_2_1, 1943 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_2_1_2, 1942 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_2_1_1, 1941 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_1_2_2, 1940 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_1_2_1, 1939 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_1_1_2, 1938 ] // SHARED-NEXT: [ 1, foo_2_2_2_1_1_1_1_1_1, 1937 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_2_2_2, 1936 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_2_2_1, 1935 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_2_1_2, 1934 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_2_1_1, 1933 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_1_2_2, 1932 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_1_2_1, 1931 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_1_1_2, 1930 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_2_1_1_1, 1929 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_2_2_2, 1928 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_2_2_1, 1927 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_2_1_2, 1926 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_2_1_1, 1925 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_1_2_2, 1924 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_1_2_1, 1923 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_1_1_2, 1922 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_2_1_1_1_1, 1921 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_2_2_2, 1920 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_2_2_1, 1919 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_2_1_2, 1918 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_2_1_1, 1917 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_1_2_2, 1916 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_1_2_1, 1915 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_1_1_2, 1914 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_2_1_1_1, 1913 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_2_2_2, 1912 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_2_2_1, 1911 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_2_1_2, 1910 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_2_1_1, 1909 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_1_2_2, 1908 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_1_2_1, 1907 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_1_1_2, 1906 ] // SHARED-NEXT: [ 1, foo_2_2_1_2_1_1_1_1_1, 1905 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_2_2_2, 1904 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_2_2_1, 1903 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_2_1_2, 1902 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_2_1_1, 1901 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_1_2_2, 1900 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_1_2_1, 1899 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_1_1_2, 1898 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_2_1_1_1, 1897 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_2_2_2, 1896 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_2_2_1, 1895 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_2_1_2, 1894 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_2_1_1, 1893 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_1_2_2, 1892 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_1_2_1, 1891 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_1_1_2, 1890 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_2_1_1_1_1, 1889 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_2_2_2, 1888 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_2_2_1, 1887 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_2_1_2, 1886 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_2_1_1, 1885 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_1_2_2, 1884 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_1_2_1, 1883 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_1_1_2, 1882 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_2_1_1_1, 1881 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_2_2_2, 1880 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_2_2_1, 1879 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_2_1_2, 1878 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_2_1_1, 1877 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_1_2_2, 1876 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_1_2_1, 1875 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_1_1_2, 1874 ] // SHARED-NEXT: [ 1, foo_2_2_1_1_1_1_1_1_1, 1873 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_2_2_2, 1872 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_2_2_1, 1871 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_2_1_2, 1870 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_2_1_1, 1869 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_1_2_2, 1868 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_1_2_1, 1867 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_1_1_2, 1866 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_2_1_1_1, 1865 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_2_2_2, 1864 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_2_2_1, 1863 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_2_1_2, 1862 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_2_1_1, 1861 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_1_2_2, 1860 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_1_2_1, 1859 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_1_1_2, 1858 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_2_1_1_1_1, 1857 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_2_2_2, 1856 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_2_2_1, 1855 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_2_1_2, 1854 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_2_1_1, 1853 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_1_2_2, 1852 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_1_2_1, 1851 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_1_1_2, 1850 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_2_1_1_1, 1849 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_2_2_2, 1848 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_2_2_1, 1847 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_2_1_2, 1846 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_2_1_1, 1845 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_1_2_2, 1844 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_1_2_1, 1843 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_1_1_2, 1842 ] // SHARED-NEXT: [ 1, foo_2_1_2_2_1_1_1_1_1, 1841 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_2_2_2, 1840 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_2_2_1, 1839 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_2_1_2, 1838 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_2_1_1, 1837 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_1_2_2, 1836 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_1_2_1, 1835 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_1_1_2, 1834 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_2_1_1_1, 1833 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_2_2_2, 1832 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_2_2_1, 1831 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_2_1_2, 1830 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_2_1_1, 1829 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_1_2_2, 1828 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_1_2_1, 1827 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_1_1_2, 1826 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_2_1_1_1_1, 1825 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_2_2_2, 1824 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_2_2_1, 1823 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_2_1_2, 1822 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_2_1_1, 1821 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_1_2_2, 1820 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_1_2_1, 1819 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_1_1_2, 1818 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_2_1_1_1, 1817 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_2_2_2, 1816 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_2_2_1, 1815 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_2_1_2, 1814 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_2_1_1, 1813 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_1_2_2, 1812 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_1_2_1, 1811 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_1_1_2, 1810 ] // SHARED-NEXT: [ 1, foo_2_1_2_1_1_1_1_1_1, 1809 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_2_2_2, 1808 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_2_2_1, 1807 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_2_1_2, 1806 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_2_1_1, 1805 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_1_2_2, 1804 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_1_2_1, 1803 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_1_1_2, 1802 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_2_1_1_1, 1801 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_2_2_2, 1800 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_2_2_1, 1799 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_2_1_2, 1798 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_2_1_1, 1797 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_1_2_2, 1796 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_1_2_1, 1795 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_1_1_2, 1794 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_2_1_1_1_1, 1793 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_2_2_2, 1792 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_2_2_1, 1791 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_2_1_2, 1790 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_2_1_1, 1789 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_1_2_2, 1788 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_1_2_1, 1787 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_1_1_2, 1786 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_2_1_1_1, 1785 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_2_2_2, 1784 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_2_2_1, 1783 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_2_1_2, 1782 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_2_1_1, 1781 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_1_2_2, 1780 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_1_2_1, 1779 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_1_1_2, 1778 ] // SHARED-NEXT: [ 1, foo_2_1_1_2_1_1_1_1_1, 1777 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_2_2_2, 1776 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_2_2_1, 1775 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_2_1_2, 1774 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_2_1_1, 1773 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_1_2_2, 1772 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_1_2_1, 1771 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_1_1_2, 1770 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_2_1_1_1, 1769 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_2_2_2, 1768 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_2_2_1, 1767 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_2_1_2, 1766 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_2_1_1, 1765 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_1_2_2, 1764 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_1_2_1, 1763 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_1_1_2, 1762 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_2_1_1_1_1, 1761 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_2_2_2, 1760 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_2_2_1, 1759 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_2_1_2, 1758 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_2_1_1, 1757 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_1_2_2, 1756 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_1_2_1, 1755 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_1_1_2, 1754 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_2_1_1_1, 1753 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_1_2_2_2, 1752 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_1_2_2_1, 1751 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_1_2_1_2, 1750 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_1_2_1_1, 1749 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_1_1_2_2, 1748 ] // SHARED-NEXT: [ 1, foo_2_1_1_1_1_1_1_2_1, 1747 ] // SHARED-NEXT: [ 1, foo golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-merge-match-lib.c0000664000175000017500000000144612670054656032247 0ustar mwhudsonmwhudson#include #include #include int __llvm_profile_runtime = 0; uint64_t __llvm_profile_get_size_for_buffer(void); int __llvm_profile_write_buffer(char *); void __llvm_profile_reset_counters(void); int __llvm_profile_check_compatibility(const char *, uint64_t); int gg = 0; void bar(char c) { if (c == '1') gg++; else gg--; } /* Returns 0 (size) when an error occurs. */ uint64_t libEntry(char *Buffer, uint64_t MaxSize) { uint64_t Size = __llvm_profile_get_size_for_buffer(); if (Size > MaxSize) return 0; __llvm_profile_reset_counters(); bar('1'); if (__llvm_profile_write_buffer(Buffer)) return 0; /* Now check compatibility. Should return 0. */ if (__llvm_profile_check_compatibility(Buffer, Size)) return 0; return Size; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dynamic-a.cpp0000664000175000017500000000056312752442526031511 0ustar mwhudsonmwhudson#include "instrprof-dynamic-header.h" void a() { // COV: [[@LINE]]| 1|void a if (true) { // COV: [[@LINE]]| 1| if bar(1); // COV: [[@LINE]]| 1| bar bar(1); // COV: [[@LINE]]| 1| bar } // COV: [[@LINE]]| 1| } } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dlopen-main.c0000664000175000017500000000212212336205421031470 0ustar mwhudsonmwhudson #include #include #ifdef DLOPEN_FUNC_DIR #include #else void func(int K); void func2(int K); #endif int main(int argc, char *argv[]) { #ifdef DLOPEN_FUNC_DIR dlerror(); void *f1_handle = dlopen(DLOPEN_FUNC_DIR"/func.shared", DLOPEN_FLAGS); if (f1_handle == NULL) { fprintf(stderr, "unable to open '" DLOPEN_FUNC_DIR "/func.shared': %s\n", dlerror()); return EXIT_FAILURE; } void (*func)(int) = (void (*)(int))dlsym(f1_handle, "func"); if (func == NULL) { fprintf(stderr, "unable to lookup symbol 'func': %s\n", dlerror()); return EXIT_FAILURE; } void *f2_handle = dlopen(DLOPEN_FUNC_DIR"/func2.shared", DLOPEN_FLAGS); if (f2_handle == NULL) { fprintf(stderr, "unable to open '" DLOPEN_FUNC_DIR "/func2.shared': %s\n", dlerror()); return EXIT_FAILURE; } void (*func2)(int) = (void (*)(int))dlsym(f2_handle, "func2"); if (func2 == NULL) { fprintf(stderr, "unable to lookup symbol 'func2': %s\n", dlerror()); return EXIT_FAILURE; } #endif func(1); func2(0); return EXIT_SUCCESS; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/extern_template2.cpp0000664000175000017500000000016512664441431031077 0ustar mwhudsonmwhudson#define USE #include "extern_template.h" #undef USE extern Test TO; int bar() { TO.doIt(5); return TO.M; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dynamic-main.cpp0000664000175000017500000000023512532165425032205 0ustar mwhudsonmwhudson#include "instrprof-dynamic-header.h" void foo(int K) { if (K) {} } int main(int argc, char *argv[]) { foo(5); bar(1); a(); b(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-icall-promo.h0000664000175000017500000000010612724056665031527 0ustar mwhudsonmwhudsonstruct A { virtual int foo() { return 1; }; virtual int bar(); }; golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-file_ex.c0000664000175000017500000000236412726305567030727 0ustar mwhudsonmwhudson/* This is a test case where the parent process forks 10 * children which contend to write to the same file. With * file locking support, the data from each child should not * be lost. */ #include #include #include #include extern FILE *lprofOpenFileEx(const char *); int main(int argc, char *argv[]) { pid_t tid; FILE *F; const char *FN; int child[10]; int c; int i; if (argc < 2) { fprintf(stderr, "Requires one argument \n"); exit(1); } FN = argv[1]; truncate(FN, 0); for (i = 0; i < 10; i++) { c = fork(); // in child: if (c == 0) { FILE *F = lprofOpenFileEx(FN); if (!F) { fprintf(stderr, "Can not open file %s from child\n", FN); exit(1); } fseek(F, 0, SEEK_END); fprintf(F, "Dump from Child %d\n", i); fclose(F); exit(0); } else { child[i] = c; } } // In parent for (i = 0; i < 10; i++) { int child_status; if ((tid = waitpid(child[i], &child_status, 0)) == -1) break; } F = lprofOpenFileEx(FN); if (!F) { fprintf(stderr, "Can not open file %s from parent\n", FN); exit(1); } fseek(F, 0, SEEK_END); fprintf(F, "Dump from parent %d\n", i); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/extern_template.cpp0000664000175000017500000000030012664441431031004 0ustar mwhudsonmwhudson#define DEF #include "extern_template.h" #undef DEF extern int bar(); extern int foo(); extern Test TO; int main() { foo(); int R = bar(); if (R != 10) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-icall-promo_2.cc0000664000175000017500000000032712724056665032113 0ustar mwhudsonmwhudson#include "instrprof-icall-promo.h" extern int ref(A *); int A::bar() { return 2; } extern A *ap; int test() { for (int i = 0; i < 10000; i++) ap->foo(); return ref(ap); } int main() { test(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-shared-lib.c0000664000175000017500000000013212621462443031304 0ustar mwhudsonmwhudsonint g1 = 0; int g2 = 1; void foo(int n) { if (n % 5 == 0) g1++; else g2++; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-visibility-helper.cpp0000664000175000017500000000003612675350047033306 0ustar mwhudsonmwhudsonnamespace N1 { void f4() {} } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/gcc-flag-compatibility.c0000664000175000017500000000013012547526660031567 0ustar mwhudsonmwhudsonint X = 0; int main() { int i; for (i = 0; i < 100; i++) X += i; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-comdat-1.cpp0000664000175000017500000000030512650252267031244 0ustar mwhudsonmwhudson#include "instrprof-comdat.h" int g; extern int bar(int); int main() { FOO Foo; int Res = Foo.DoIt(10); if (Res > 10) g = bar(10); else g = bar(1) + bar(2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/extern_template1.cpp0000664000175000017500000000015712664441431031077 0ustar mwhudsonmwhudson#define USE #include "extern_template.h" #undef USE Test TO; int foo() { TO.doIt(20); return TO.M; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/comdat_rename.h0000664000175000017500000000033412762037262030060 0ustar mwhudsonmwhudsonstruct FOO { FOO() : a(0), b(0) {} int callee(); __attribute__((noinline)) void caller(int n) { int r = callee(); if (r == 0) { a += n; b += 1; } } int a; int volatile b; }; golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dynamic-b.cpp0000664000175000017500000000015012532165425031476 0ustar mwhudsonmwhudson#include "instrprof-dynamic-header.h" void b() { if (true) { bar(1); bar(1); } } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-merge-match.c0000664000175000017500000000223212666355326031500 0ustar mwhudsonmwhudson#include #include #include int __llvm_profile_runtime = 0; uint64_t __llvm_profile_get_size_for_buffer(void); int __llvm_profile_write_buffer(char *); void __llvm_profile_reset_counters(void); int __llvm_profile_check_compatibility(const char *, uint64_t); int g = 0; void foo(char c) { if (c == '1') g++; else g--; } extern uint64_t libEntry(char *Buffer, uint64_t MaxSize); int main(int argc, const char *argv[]) { const uint64_t MaxSize = 10000; static char Buffer[MaxSize]; uint64_t Size = __llvm_profile_get_size_for_buffer(); if (Size > MaxSize) return 1; __llvm_profile_reset_counters(); foo('0'); if (__llvm_profile_write_buffer(Buffer)) return 1; /* Now check compatibility. Should return 0. */ if (__llvm_profile_check_compatibility(Buffer, Size)) return 1; /* Clear the buffer. */ memset(Buffer, 0, MaxSize); /* Collect profile from shared library. */ Size = libEntry(Buffer, MaxSize); if (!Size) return 1; /* Shared library's profile should not match main executable's. */ if (!__llvm_profile_check_compatibility(Buffer, Size)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-icall-promo_1.cc0000664000175000017500000000013712724056665032111 0ustar mwhudsonmwhudson#include "instrprof-icall-promo.h" A a; A* ap = &a; int ref(A* ap) { return ap->A::foo(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-dlopen-func.c0000664000175000017500000000003712335535402031506 0ustar mwhudsonmwhudsonvoid func(int K) { if (K) {} } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/comdat_rename_1.cc0000664000175000017500000000225712747754476030464 0ustar mwhudsonmwhudson#include "comdat_rename.h" // callee's out-of-line instance profile data -- it comes // from external calls to it from comdat_rename_2.cc. // Its inline instance copy's profile data is different and // is collected in 'caller''s context. int FOO::callee() { // CHECK-LABEL: define {{.*}}callee{{.*}} // CHECK-NOT: br i1 {{.*}} // CHECK: br {{.*}}label{{.*}}, label %[[BB1:.*]], !prof ![[PD1:[0-9]+]] // CHECK: {{.*}}[[BB1]]: if (b != 0) return a / b; if (a != 0) return 10 / a; return 0; } // This is the 'caller''s comdat copy (after renaming) in this module. // The profile counters include a copy of counters from 'callee': // // CHECK-LABEL: define {{.*}}caller{{.*}} // CHECK-NOT: br i1 {{.*}} // CHECK: br {{.*}}label{{.*}}, label %[[BB2:.*]], !prof ![[PD2:[0-9]+]] // CHECK: {{.*}}[[BB2]]: // CHECK: br {{.*}}label{{.*}}, label %{{.*}}, !prof !{{.*}} // CHECK: br {{.*}}label %[[BB3:.*]], label %{{.*}} !prof ![[PD3:[0-9]+]] // CHECK: {{.*}}[[BB3]]: // // CHECK:![[PD1]] = !{!"branch_weights", i32 0, i32 1} // CHECK:![[PD2]] = !{!"branch_weights", i32 1, i32 0} // CHECK:![[PD3]] = !{!"branch_weights", i32 {{.*}}, i32 0} void test(FOO *foo) { foo->caller(10); } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-alloc.c0000664000175000017500000000152312722075231030366 0ustar mwhudsonmwhudson/* This test case tests that when static allocation for value * profiler is on, no malloc/calloc calls will be invoked by * profile runtime library. */ #include __attribute__((noinline)) void foo() {} __attribute__((noinline)) void foo2() {} void (*FP)(); int MainEntered = 0; int CallocCalled = 0; int MallocCalled = 0; extern void *__real_calloc(size_t s, size_t n); extern void *__real_malloc(size_t s); void *__wrap_calloc(size_t s, size_t n) { if (MainEntered) CallocCalled = 1; return __real_calloc(s, n); } void *__wrap_malloc(size_t s) { if (MainEntered) MallocCalled = 1; return __real_malloc(s); } void getFP(int i) { if (i % 2) FP = foo; else FP = foo2; } int main() { int i; MainEntered = 1; for (i = 0; i < 100; i++) { getFP(i); FP(); } return CallocCalled + MallocCalled; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-comdat.h0000664000175000017500000000155612752442526030566 0ustar mwhudsonmwhudson// Template instantiations are placed into comdat sections. Check that // coverage data from different instantiations are mapped back to the correct // source regions. template class FOO { public: FOO() : t(0) {} T DoIt(T ti); private: T t; }; template T FOO::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T t += I; // HEADER: [[@LINE]]| 20| t += I; if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti t -= 1; // HEADER: [[@LINE]]| 8| t -= 1; } // HEADER: [[@LINE]]| 10| } // HEADER: [[@LINE]]| 1| return t; // HEADER: [[@LINE]]| 1| return t; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-comdat-2.cpp0000664000175000017500000000024612650252267031251 0ustar mwhudsonmwhudson#include "instrprof-comdat.h" int bar(int I) { FOO Foo; FOO Foo2; if (I > 5) return (int)Foo.DoIt(10); else return (int)Foo2.DoIt(I); } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/Inputs/instrprof-value-prof-evict.c0000664000175000017500000001064112717430646032476 0ustar mwhudsonmwhudsonvoid callee_0() {} void callee_1() {} void callee_2() {} void callee_3() {} void *CalleeAddrs[] = {callee_0, callee_1, callee_2, callee_3}; extern void lprofSetMaxValsPerSite(unsigned); // sequences of callee ids // In the following sequences, // there are two targets, the dominating target is // target 0. int CallSeqTwoTarget_1[] = {0, 0, 0, 0, 0, 1, 1}; int CallSeqTwoTarget_2[] = {1, 1, 0, 0, 0, 0, 0}; int CallSeqTwoTarget_3[] = {1, 0, 0, 1, 0, 0, 0}; int CallSeqTwoTarget_4[] = {0, 0, 0, 1, 0, 1, 0}; // In the following sequences, there are three targets // The dominating target is 0 and has > 50% of total // counts. int CallSeqThreeTarget_1[] = {0, 0, 0, 0, 0, 0, 1, 2, 1}; int CallSeqThreeTarget_2[] = {1, 2, 1, 0, 0, 0, 0, 0, 0}; int CallSeqThreeTarget_3[] = {1, 0, 0, 2, 0, 0, 0, 1, 0}; int CallSeqThreeTarget_4[] = {0, 0, 0, 1, 0, 1, 0, 0, 2}; // Four target sequence -- // There are two cold targets which occupies the value counters // early. There is also a very hot target and a medium hot target // which are invoked in an interleaved fashion -- the length of each // hot period in the sequence is shorter than the cold targets' count. // 1. If only two values are tracked, the Hot and Medium hot targets // should surive in the end // 2. If only three values are tracked, the top three targets should // surive in the end. int CallSeqFourTarget_1[] = {1, 1, 1, 2, 2, 2, 2, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3}; // Same as above, but the cold entries are invoked later. int CallSeqFourTarget_2[] = {0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 1, 1, 1, 2, 2, 2, 2}; // Same as above, but all the targets are interleaved. int CallSeqFourTarget_3[] = {0, 3, 0, 0, 1, 3, 0, 0, 0, 2, 0, 0, 3, 3, 0, 3, 2, 2, 0, 3, 3, 1, 0, 0, 1, 0, 0, 3, 0, 2, 0}; typedef void (*FPT)(void); // Testing value profiling eviction algorithm. FPT getCalleeFunc(int I) { return CalleeAddrs[I]; } int main() { int I; #define INDIRECT_CALLSITE(Sequence, NumValsTracked) \ lprofSetMaxValsPerSite(NumValsTracked); \ for (I = 0; I < sizeof(Sequence) / sizeof(*Sequence); I++) { \ FPT FP = getCalleeFunc(Sequence[I]); \ FP(); \ } // check site, target patterns // CHECK: 0, callee_0 INDIRECT_CALLSITE(CallSeqTwoTarget_1, 1); // CHECK-NEXT: 1, callee_0 INDIRECT_CALLSITE(CallSeqTwoTarget_2, 1); // CHECK-NEXT: 2, callee_0 INDIRECT_CALLSITE(CallSeqTwoTarget_3, 1); // CHECK-NEXT: 3, callee_0 INDIRECT_CALLSITE(CallSeqTwoTarget_4, 1); // CHECK-NEXT: 4, callee_0 INDIRECT_CALLSITE(CallSeqThreeTarget_1, 1); // CHECK-NEXT: 5, callee_0 INDIRECT_CALLSITE(CallSeqThreeTarget_2, 1); // CHECK-NEXT: 6, callee_0 INDIRECT_CALLSITE(CallSeqThreeTarget_3, 1); // CHECK-NEXT: 7, callee_0 INDIRECT_CALLSITE(CallSeqThreeTarget_4, 1); // CHECK-NEXT: 8, callee_0 // CHECK-NEXT: 8, callee_1 INDIRECT_CALLSITE(CallSeqThreeTarget_1, 2); // CHECK-NEXT: 9, callee_0 // CHECK-NEXT: 9, callee_1 INDIRECT_CALLSITE(CallSeqThreeTarget_2, 2); // CHECK-NEXT: 10, callee_0 // CHECK-NEXT: 10, callee_1 INDIRECT_CALLSITE(CallSeqThreeTarget_3, 2); // CHECK-NEXT: 11, callee_0 // CHECK-NEXT: 11, callee_1 INDIRECT_CALLSITE(CallSeqThreeTarget_4, 2); // CHECK-NEXT: 12, callee_0 INDIRECT_CALLSITE(CallSeqFourTarget_1, 1); // CHECK-NEXT: 13, callee_0 INDIRECT_CALLSITE(CallSeqFourTarget_2, 1); // CHECK-NEXT: 14, callee_0 INDIRECT_CALLSITE(CallSeqFourTarget_3, 1); // CHECK-NEXT: 15, callee_0 // CHECK-NEXT: 15, callee_3 INDIRECT_CALLSITE(CallSeqFourTarget_1, 2); // CHECK-NEXT: 16, callee_0 // CHECK-NEXT: 16, callee_3 INDIRECT_CALLSITE(CallSeqFourTarget_2, 2); // CHECK-NEXT: 17, callee_0 // CHECK-NEXT: 17, callee_3 INDIRECT_CALLSITE(CallSeqFourTarget_3, 2); // CHECK-NEXT: 18, callee_0 // CHECK-NEXT: 18, callee_3 // CHECK-NEXT: 18, callee_2 INDIRECT_CALLSITE(CallSeqFourTarget_1, 3); // CHECK-NEXT: 19, callee_0 // CHECK-NEXT: 19, callee_3 // CHECK-NEXT: 19, callee_2 INDIRECT_CALLSITE(CallSeqFourTarget_2, 3); // CHECK-NEXT: 20, callee_0 // CHECK-NEXT: 20, callee_3 // CHECK-NEXT: 20, callee_2 INDIRECT_CALLSITE(CallSeqFourTarget_3, 3); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-shared.test0000664000175000017500000001207712645074632030033 0ustar mwhudsonmwhudson""" This test produces three shared libraries: 1. libt-instr.so is instrumented 2. libt-no-instr1.so is not instrumented 3. libt-no-instr2.so is built with profile rt linked in (via -u), but the object file is built with instrumentation turned off. After the libraries are built, the main program is then built with/without instrumentation and linked against 3 libraries above. The test is to verify that programs linked against these shared objects with and without instrumentation enabled behave as expected. """ RUN: mkdir -p %t.d RUN: %clang_profgen -o %t.d/libt-instr.so -fPIC -shared %S/Inputs/instrprof-shared-lib.c RUN: %clang -o %t.d/libt-no-instr1.so -fPIC -shared %S/Inputs/instrprof-shared-lib.c RUN: %clang -c -o %t.d/instrprof-shared-lib-no-instr2.o -fPIC %S/Inputs/instrprof-shared-lib.c RUN: %clang_profgen -o %t.d/libt-no-instr2.so -fPIC -shared %t.d/instrprof-shared-lib-no-instr2.o RUN: %clang_profgen -o %t-instr-instr -L%t.d -rpath %t.d -lt-instr %S/Inputs/instrprof-shared-main.c RUN: %clang_profgen -o %t-instr-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %S/Inputs/instrprof-shared-main.c RUN: %clang_profgen -o %t-instr-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %S/Inputs/instrprof-shared-main.c RUN: %clang -o %t-no-instr1-instr -L%t.d -rpath %t.d -lt-instr %S/Inputs/instrprof-shared-main.c RUN: %clang -o %t-no-instr1-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %S/Inputs/instrprof-shared-main.c RUN: %clang -o %t-no-instr1-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %S/Inputs/instrprof-shared-main.c RUN: %clang -c -o %t.d/instrprof-shared-main-no-instr2.o %S/Inputs/instrprof-shared-main.c RUN: %clang -o %t-no-instr2-instr -L%t.d -rpath %t.d -lt-instr %t.d/instrprof-shared-main-no-instr2.o RUN: %clang -o %t-no-instr2-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %t.d/instrprof-shared-main-no-instr2.o RUN: %clang -o %t-no-instr2-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %t.d/instrprof-shared-main-no-instr2.o RUN: env LLVM_PROFILE_FILE=%t-instr-instr.profraw %run %t-instr-instr RUN: env LLVM_PROFILE_FILE=%t-instr-no-instr1.profraw %run %t-instr-no-instr1 RUN: env LLVM_PROFILE_FILE=%t-instr-no-instr2.profraw %run %t-instr-no-instr2 RUN: env LLVM_PROFILE_FILE=%t-no-instr1-instr.profraw %run %t-no-instr1-instr RUN: env LLVM_PROFILE_FILE=%t-no-instr2-instr.profraw %run %t-no-instr2-instr RUN: env LLVM_PROFILE_FILE=%t-no-instr1-no-instr1.profraw %run %t-no-instr1-no-instr1 RUN: env LLVM_PROFILE_FILE=%t-no-instr1-no-instr2.profraw %run %t-no-instr1-no-instr2 RUN: env LLVM_PROFILE_FILE=%t-no-instr2-no-instr1.profraw %run %t-no-instr2-no-instr1 RUN: env LLVM_PROFILE_FILE=%t-no-instr2-no-instr2.profraw %run %t-no-instr2-no-instr2 RUN: llvm-profdata merge -o %t-instr-instr.profdata %t-instr-instr.profraw RUN: llvm-profdata merge -o %t-instr-no-instr1.profdata %t-instr-no-instr1.profraw RUN: llvm-profdata merge -o %t-instr-no-instr2.profdata %t-instr-no-instr2.profraw RUN: llvm-profdata merge -o %t-no-instr1-instr.profdata %t-no-instr1-instr.profraw RUN: llvm-profdata merge -o %t-no-instr2-instr.profdata %t-no-instr2-instr.profraw RUN: not llvm-profdata merge -o %t-no-instr1-no-instr1.profdata %t-no-instr1-no-instr1.profraw 2>&1 | FileCheck %s --check-prefix=MISSING-FILE RUN: not llvm-profdata merge -o %t-no-instr2-no-instr1.profdata %t-no-instr2-no-instr1.profraw 2>&1 | FileCheck %s --check-prefix=MISSING-FILE MISSING-FILE: profraw RUN: llvm-profdata show -counts --function main %t-instr-instr.profdata | grep -v 'Total\|Maximum' > %t-main-1 RUN: llvm-profdata show -counts --function main %t-instr-no-instr1.profdata | grep -v 'Total\|Maximum' > %t-main-2 RUN: llvm-profdata show -counts --function main %t-instr-no-instr2.profdata | grep -v 'Total\|Maximum' > %t-main-3 RUN: llvm-profdata show -counts --function foo %t-instr-instr.profdata | grep -v 'Total\|Maximum' > %t-foo-1 RUN: llvm-profdata show -counts --function foo %t-no-instr1-instr.profdata | grep -v 'Total\|Maximum' > %t-foo-2 RUN: llvm-profdata show -counts --function foo %t-no-instr2-instr.profdata | grep -v 'Total\|Maximum' > %t-foo-3 RUN: %clang_profuse=%t-instr-instr.profdata -o %t-main-instr-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-main.c RUN: %clang_profuse=%t-instr-no-instr1.profdata -o %t-main-instr-no-instr1.ll -S -emit-llvm %S/Inputs/instrprof-shared-main.c RUN: %clang_profuse=%t-instr-no-instr2.profdata -o %t-main-instr-no-instr2.ll -S -emit-llvm %S/Inputs/instrprof-shared-main.c RUN: %clang_profuse=%t-instr-instr.profdata -o %t-lib-instr-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c RUN: %clang_profuse=%t-no-instr1-instr.profdata -o %t-lib-no-instr1-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c RUN: %clang_profuse=%t-no-instr2-instr.profdata -o %t-lib-no-instr2-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c RUN: %clang_profuse=%t-instr-instr.profdata -o %t-lib-instr-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c RUN: diff %t-main-instr-no-instr1.ll %t-main-instr-no-instr2.ll RUN: diff %t-lib-no-instr1-instr.ll %t-lib-no-instr2-instr.ll RUN: diff %t-main-1 %t-main-2 RUN: diff %t-main-1 %t-main-3 RUN: diff %t-foo-1 %t-foo-2 RUN: diff %t-foo-1 %t-foo-3 golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/lit.cfg0000664000175000017500000000721512777257100025106 0ustar mwhudsonmwhudson# -*- Python -*- import os def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: lit_config.fatal( "No attribute %r in test configuration! You may need to run " "tests from your build directory or add this attribute " "to lit.site.cfg " % attr_name) return attr_value # Setup config name. config.name = 'Profile-' + config.target_arch # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup executable root. if hasattr(config, 'profile_lit_binary_dir') and \ config.profile_lit_binary_dir is not None: config.test_exec_root = os.path.join(config.profile_lit_binary_dir, config.name) # If the above check didn't work, we're probably in the source tree. Use some # magic to re-execute from the build tree. if config.test_exec_root is None: # The magic relies on knowing compilerrt_site_basedir. compilerrt_basedir = lit_config.params.get('compilerrt_site_basedir', None) if compilerrt_basedir: site_cfg = os.path.join(compilerrt_basedir, 'profile', 'lit.site.cfg') if os.path.exists(site_cfg): lit_config.load_config(config, site_cfg) raise SystemExit if config.host_os in ['Linux']: extra_linkflags = ["-ldl"] else: extra_linkflags = [] # Test suffixes. config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test'] # What to exclude. config.excludes = ['Inputs'] # Clang flags. target_cflags=[get_required_attr(config, "target_cflags")] clang_cflags = target_cflags + extra_linkflags clang_cxxflags = config.cxx_mode_flags + clang_cflags def build_invocation(compile_flags, with_lto = False): lto_flags = [] lto_prefix = [] if with_lto and config.lto_supported: lto_flags += config.lto_flags lto_prefix += config.lto_launch return " " + " ".join(lto_prefix + [config.clang] + lto_flags + compile_flags) + " " # Add clang substitutions. config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) ) config.substitutions.append( ("%clang_profgen ", build_invocation(clang_cflags) + " -fprofile-instr-generate ") ) config.substitutions.append( ("%clang_profgen=", build_invocation(clang_cflags) + " -fprofile-instr-generate=") ) config.substitutions.append( ("%clang_pgogen ", build_invocation(clang_cflags) + " -fprofile-generate ") ) config.substitutions.append( ("%clang_pgogen=", build_invocation(clang_cflags) + " -fprofile-generate=") ) config.substitutions.append( ("%clangxx_profgen ", build_invocation(clang_cxxflags) + " -fprofile-instr-generate ") ) config.substitutions.append( ("%clangxx_profgen=", build_invocation(clang_cxxflags) + " -fprofile-instr-generate=") ) config.substitutions.append( ("%clangxx_pgogen ", build_invocation(clang_cxxflags) + " -fprofile-generate ") ) config.substitutions.append( ("%clangxx_pgogen=", build_invocation(clang_cxxflags) + " -fprofile-generate=") ) config.substitutions.append( ("%clang_profgen_gcc=", build_invocation(clang_cflags) + " -fprofile-generate=") ) config.substitutions.append( ("%clang_profuse_gcc=", build_invocation(clang_cflags) + " -fprofile-use=") ) config.substitutions.append( ("%clang_profuse=", build_invocation(clang_cflags) + " -fprofile-instr-use=") ) config.substitutions.append( ("%clangxx_profuse=", build_invocation(clang_cxxflags) + " -fprofile-instr-use=") ) config.substitutions.append( ("%clang_lto_profgen=", build_invocation(clang_cflags, True) + " -fprofile-instr-generate=") ) if config.host_os not in ['Darwin', 'FreeBSD', 'Linux']: config.unsupported = True if config.target_arch in ['armv7l']: config.unsupported = True ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-set-filename-then-reset-default.cgolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-set-filename-then-reset-defaul0000664000175000017500000000117212520251623033451 0ustar mwhudsonmwhudson// RUN: rm -rf %t.d // RUN: mkdir -p %t.d // RUN: cd %t.d // RUN: %clang_profgen -O3 %s -o %t.out // RUN: %run %t.out %t.d/bad.profraw // RUN: llvm-profdata merge -o %t.d/default.profdata %t.d/default.profraw // RUN: %clang_profuse=%t.d/default.profdata -o - -S -emit-llvm %s | FileCheck %s void __llvm_profile_set_filename(const char *); int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; __llvm_profile_set_filename(argv[1]); __llvm_profile_set_filename(0); return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-override-filename-then-reset-default.cgolang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-override-filename-then-reset-d0000664000175000017500000000117312744254166033476 0ustar mwhudsonmwhudson// RUN: rm -rf %t.d // RUN: mkdir -p %t.d // RUN: cd %t.d // RUN: %clang_profgen -O3 %s -o %t.out // RUN: %run %t.out %t.d/bad.profraw // RUN: llvm-profdata merge -o %t.d/default.profdata %t.d/default.profraw // RUN: %clang_profuse=%t.d/default.profdata -o - -S -emit-llvm %s | FileCheck %s void __llvm_profile_set_filename(const char *); int main(int argc, const char *argv[]) { // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; __llvm_profile_set_filename(argv[1]); __llvm_profile_set_filename(0); return 0; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-write-file.c0000664000175000017500000000243412443651733030072 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t1.profraw %run %t %t2.profraw // RUN: llvm-profdata merge -o %t1.profdata %t1.profraw // RUN: %clang_profuse=%t1.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK // RUN: llvm-profdata merge -o %t2.profdata %t2.profraw // RUN: %clang_profuse=%t2.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK int __llvm_profile_write_file(void); void __llvm_profile_set_filename(const char *); int foo(int); int main(int argc, const char *argv[]) { // CHECK-LABEL: define {{.*}} @main( // CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]] if (argc < 2) return 1; // Write out the profile. __llvm_profile_write_file(); // Change the profile. int Ret = foo(0); // It'll write out again at exit; change the filename so we get two files. __llvm_profile_set_filename(argv[1]); return Ret; } int foo(int X) { // CHECK-LABEL: define {{.*}} @foo( // CHECK1: br i1 %{{.*}}, label %{{.*}}, label %{{[^,]+$}} // CHECK2: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]] return X <= 0 ? -X : X; } // CHECK: ![[PD1]] = !{!"branch_weights", i32 1, i32 2} // CHECK2: ![[PD2]] = !{!"branch_weights", i32 2, i32 1} golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-error.c0000664000175000017500000000035712717516576027167 0ustar mwhudsonmwhudson// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t/ %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile Error: Failed to write file golang-1.8-race-detector-runtime_0.0+svn285455/test/profile/instrprof-set-filename-shared.test0000664000175000017500000000066113001263224032356 0ustar mwhudsonmwhudson# Test that __llvm_profile_set_filename is honored by shared libary too. RUN: mkdir -p %t.d RUN: %clang_profgen=%t.shared.profraw -fPIC -shared -o %t.d/t.shared %S/Inputs/instrprof-dlopen-func.c RUN: %clang_profgen -DCALL_SHARED -o %t.m -O3 -rpath %t.d %t.d/t.shared %S/instrprof-set-filename.c RUN: %run %t.m %t.main.profraw RUN: llvm-profdata show %t.main.profraw | FileCheck --check-prefix=SHARED %s # SHARED: Total functions: 2 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/0000775000175000017500000000000013040224625023123 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_top_suppression.cc0000664000175000017500000000107212623403316027702 0ustar mwhudsonmwhudson// RUN: echo "race_top:TopFunction" > %t.supp // RUN: %clangxx_tsan -O1 %s -o %t // RUN: %env_tsan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck %s // RUN: rm %t.supp #include "test.h" int Global; void TopFunction(int *p) { *p = 1; } void *Thread(void *x) { barrier_wait(&barrier); TopFunction(&Global); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); Global--; barrier_wait(&barrier); pthread_join(t, 0); fprintf(stderr, "DONE\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_malloc.cc0000664000175000017500000000151112517531510026244 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" extern "C" { void AnnotateIgnoreReadsBegin(const char *f, int l); void AnnotateIgnoreReadsEnd(const char *f, int l); void AnnotateIgnoreWritesBegin(const char *f, int l); void AnnotateIgnoreWritesEnd(const char *f, int l); } int *g; void *Thread(void *a) { int *p = 0; while ((p = __atomic_load_n(&g, __ATOMIC_RELAXED)) == 0) usleep(100); // spin-wait *p = 42; return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); AnnotateIgnoreWritesBegin(__FILE__, __LINE__); int *p = new int(0); AnnotateIgnoreWritesEnd(__FILE__, __LINE__); __atomic_store_n(&g, p, __ATOMIC_RELAXED); pthread_join(t, 0); delete p; fprintf(stderr, "OK\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_end_with_ignore.cc0000664000175000017500000000110012342110363030112 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l); void *Thread(void *x) { AnnotateIgnoreReadsBegin("", 0); return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); } // CHECK: ThreadSanitizer: thread T1 finished with ignores enabled, created at: // CHECK: #0 pthread_create // CHECK: #1 main // CHECK: Ignore was enabled at: // CHECK: #0 AnnotateIgnoreReadsBegin // CHECK: #1 Thread golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/malloc_overflow.cc0000664000175000017500000000123112704157670026634 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t // RUN: %env_tsan_opts=allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s #include #include int main() { void *p = malloc((size_t)-1); if (p != 0) fprintf(stderr, "FAIL malloc(-1) = %p\n", p); p = malloc((size_t)-1 / 2); if (p != 0) fprintf(stderr, "FAIL malloc(-1/2) = %p\n", p); p = calloc((size_t)-1, (size_t)-1); if (p != 0) fprintf(stderr, "FAIL calloc(-1, -1) = %p\n", p); p = calloc((size_t)-1 / 2, (size_t)-1 / 2); if (p != 0) fprintf(stderr, "FAIL calloc(-1/2, -1/2) = %p\n", p); fprintf(stderr, "OK\n"); } // CHECK-NOT: FAIL // CHECK-NOT: failed to allocate golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_bad_read_lock.cc0000664000175000017500000000120512342110363027400 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw); int main() { int m = 0; AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1); AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: read lock of a write locked mutex // CHECK: #0 AnnotateRWLockAcquired // CHECK: #1 main // CHECK: Location is stack of main thread. // CHECK: Mutex {{.*}}) created at: // CHECK: #0 AnnotateRWLockAcquired // CHECK: #1 main // CHECK: SUMMARY: ThreadSanitizer: read lock of a write locked mutex golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_acquire_only.cc0000664000175000017500000000064312623335072027273 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" int x; void thread(int tid) { for (int i = 0; i < bench_niter; i++) __atomic_load_n(&x, __ATOMIC_ACQUIRE); } void bench() { __atomic_store_n(&x, 0, __ATOMIC_RELEASE); start_thread_group(bench_nthread, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_cond.cc0000664000175000017500000000227112767252100025720 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" #include #include #include #include // Test that signals can be delivered to blocked pthread_cond_wait. // https://github.com/google/sanitizers/issues/498 int g_thread_run = 1; pthread_mutex_t mutex; pthread_cond_t cond; void sig_handler(int sig) { (void)sig; write(2, "SIGNAL\n", sizeof("SIGNAL\n") - 1); barrier_wait(&barrier); } void* my_thread(void* arg) { pthread_mutex_lock(&mutex); while (g_thread_run) pthread_cond_wait(&cond, &mutex); pthread_mutex_unlock(&mutex); return 0; } int main() { barrier_init(&barrier, 2); pthread_mutex_init(&mutex, 0); pthread_cond_init(&cond, 0); signal(SIGUSR1, &sig_handler); pthread_t thr; pthread_create(&thr, 0, &my_thread, 0); // wait for thread to get inside pthread_cond_wait // (can't use barrier_wait for that) sleep(1); pthread_kill(thr, SIGUSR1); barrier_wait(&barrier); pthread_mutex_lock(&mutex); g_thread_run = 0; pthread_cond_signal(&cond); pthread_mutex_unlock(&mutex); pthread_join(thr, 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK: SIGNAL // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset6.cc0000664000175000017500000000310712626270563025412 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t mtx1; pthread_mutex_t mtx2; pthread_rwlock_t mtx3; void *Thread1(void *x) { barrier_wait(&barrier); pthread_mutex_lock(&mtx1); Global++; pthread_mutex_unlock(&mtx1); return NULL; } void *Thread2(void *x) { pthread_mutex_lock(&mtx1); pthread_mutex_unlock(&mtx1); pthread_mutex_lock(&mtx2); pthread_rwlock_rdlock(&mtx3); Global--; pthread_mutex_unlock(&mtx2); pthread_rwlock_unlock(&mtx3); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]]): // CHECK: Previous write of size 4 at {{.*}} by thread T2 // CHECK: (mutexes: write [[M2:M[0-9]+]], read [[M3:M[0-9]+]]): // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+5]] // CHECK: Mutex [[M2]] (0x{{.*}}) created at: // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+4]] // CHECK: Mutex [[M3]] (0x{{.*}}) created at: // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+3]] pthread_mutex_init(&mtx1, 0); pthread_mutex_init(&mtx2, 0); pthread_rwlock_init(&mtx3, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&mtx1); pthread_mutex_destroy(&mtx2); pthread_rwlock_destroy(&mtx3); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/benign_race.cc0000664000175000017500000000203612704157670025702 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" int Global; int WTFGlobal; extern "C" { void AnnotateBenignRaceSized(const char *f, int l, void *mem, unsigned int size, const char *desc); void WTFAnnotateBenignRaceSized(const char *f, int l, void *mem, unsigned int size, const char *desc); } void *Thread(void *x) { Global = 42; WTFGlobal = 142; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); AnnotateBenignRaceSized(__FILE__, __LINE__, &Global, sizeof(Global), "Race on Global"); WTFAnnotateBenignRaceSized(__FILE__, __LINE__, &WTFGlobal, sizeof(WTFGlobal), "Race on WTFGlobal"); pthread_t t; pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); Global = 43; WTFGlobal = 143; pthread_join(t, 0); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atomic_norace.cc0000664000175000017500000000300212457727212026243 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" const int kTestCount = 4; typedef long long T; T atomics[kTestCount * 2]; void Test(int test, T *p, bool main_thread) { volatile T sink; if (test == 0) { if (main_thread) __atomic_fetch_add(p, 1, __ATOMIC_RELAXED); else __atomic_fetch_add(p, 1, __ATOMIC_RELAXED); } else if (test == 1) { if (main_thread) __atomic_exchange_n(p, 1, __ATOMIC_ACQ_REL); else __atomic_exchange_n(p, 1, __ATOMIC_ACQ_REL); } else if (test == 2) { if (main_thread) sink = __atomic_load_n(p, __ATOMIC_SEQ_CST); else __atomic_store_n(p, 1, __ATOMIC_SEQ_CST); } else if (test == 3) { if (main_thread) sink = __atomic_load_n(p, __ATOMIC_SEQ_CST); else sink = *p; } } void *Thread(void *p) { for (int i = 0; i < kTestCount; i++) { Test(i, &atomics[i], false); } barrier_wait(&barrier); barrier_wait(&barrier); for (int i = 0; i < kTestCount; i++) { fprintf(stderr, "Test %d reverse\n", i); Test(i, &atomics[kTestCount + i], false); } return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); for (int i = 0; i < kTestCount; i++) { fprintf(stderr, "Test %d\n", i); Test(i, &atomics[i], true); } for (int i = 0; i < kTestCount; i++) { Test(i, &atomics[kTestCount + i], true); } barrier_wait(&barrier); pthread_join(t, 0); } // CHECK-NOT: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/halt_on_error.cc0000664000175000017500000000100012623403316026260 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=halt_on_error=1 %deflake %run %t | FileCheck %s #include "test.h" int X; void *Thread(void *x) { barrier_wait(&barrier); X = 42; return 0; } int main() { barrier_init(&barrier, 2); fprintf(stderr, "BEFORE\n"); pthread_t t; pthread_create(&t, 0, Thread, 0); X = 43; barrier_wait(&barrier); pthread_join(t, 0); fprintf(stderr, "AFTER\n"); return 0; } // CHECK: BEFORE // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NOT: AFTER golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_lock_destroyed.cc0000664000175000017500000000125112672277050027677 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %deflake %run %t | FileCheck %s // RUN: %deflake %run %t 1 | FileCheck %s #include #include #include int main(int argc, char *argv[]) { pthread_mutex_t *m = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(m, 0); pthread_mutex_lock(m); pthread_mutex_unlock(m); pthread_mutex_destroy(m); if (argc > 1 && argv[1][0] == '1') free(m); pthread_mutex_lock(m); // CHECK: WARNING: ThreadSanitizer: use of an invalid mutex (e.g. uninitialized or destroyed) // CHECK: #0 pthread_mutex_lock // CHECK: #1 main {{.*}}mutex_lock_destroyed.cc:[[@LINE-3]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_bad_unlock.cc0000664000175000017500000000116112342110363026751 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateRWLockReleased(const char *f, int l, void *m, long rw); int main() { int m = 0; AnnotateRWLockReleased(__FILE__, __LINE__, &m, 1); return 0; } // CHECK: WARNING: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) // CHECK: #0 AnnotateRWLockReleased // CHECK: #1 main // CHECK: Location is stack of main thread. // CHECK: Mutex {{.*}} created at: // CHECK: #0 AnnotateRWLockReleased // CHECK: #1 main // CHECK: SUMMARY: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_leak2.c0000664000175000017500000000050512704157670025627 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include void *Thread(void *x) { return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_detach(t); fprintf(stderr, "PASS\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: thread leak golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_cycle_long.c0000664000175000017500000000217312720016321026626 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: not %run %t 5 2>&1 | FileCheck %s // RUN: not %run %t 10 2>&1 | FileCheck %s // RUN: not %run %t 15 2>&1 | FileCheck %s // RUN: not %run %t 20 2>&1 | FileCheck %s // RUN: %run %t 30 2>&1 | FileCheck %s --check-prefix=CHECK-TOO-LONG-CYCLE #include #include #include int main(int argc, char *argv[]) { int num_mutexes = 5; if (argc > 1) num_mutexes = atoi(argv[1]); pthread_mutex_t m[num_mutexes]; for (int i = 0; i < num_mutexes; ++i) pthread_mutex_init(&m[i], NULL); for (int i = 0; i < num_mutexes - 1; ++i) { pthread_mutex_lock(&m[i]); pthread_mutex_lock(&m[i + 1]); pthread_mutex_unlock(&m[i]); pthread_mutex_unlock(&m[i + 1]); } pthread_mutex_lock(&m[num_mutexes - 1]); pthread_mutex_lock(&m[0]); pthread_mutex_unlock(&m[num_mutexes - 1]); pthread_mutex_unlock(&m[0]); for (int i = 0; i < num_mutexes; ++i) pthread_mutex_destroy(&m[i]); fprintf(stderr, "PASS\n"); } // CHECK: ThreadSanitizer: lock-order-inversion (potential deadlock) // CHECK-TOO-LONG-CYCLE: WARNING: too long mutex cycle found // CHECK: PASS golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_lock_rec_race.cc0000664000175000017500000000250112704157670027217 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include "java.h" jptr varaddr; jptr lockaddr; void *Thread(void *p) { __tsan_java_mutex_lock(lockaddr); __tsan_java_mutex_lock(lockaddr); __tsan_java_mutex_lock(lockaddr); int rec = __tsan_java_mutex_unlock_rec(lockaddr); if (rec != 3) { fprintf(stderr, "FAILED 0 rec=%d\n", rec); exit(1); } *(int*)varaddr = 42; barrier_wait(&barrier); barrier_wait(&barrier); __tsan_java_mutex_lock_rec(lockaddr, rec); __tsan_java_mutex_unlock(lockaddr); __tsan_java_mutex_unlock(lockaddr); __tsan_java_mutex_unlock(lockaddr); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap; *(int*)varaddr = 0; lockaddr = jheap + 8; pthread_t th; pthread_create(&th, 0, Thread, 0); barrier_wait(&barrier); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 43; __tsan_java_mutex_unlock(lockaddr); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NOT: FAILED // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppress_same_stacks.cc0000664000175000017500000000103612342110363027670 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include volatile int N; // Prevent loop unrolling. int **data; void *Thread1(void *x) { for (int i = 0; i < N; i++) data[i][0] = 42; return 0; } int main() { N = 4; data = new int*[N]; for (int i = 0; i < N; i++) data[i] = new int; pthread_t t; pthread_create(&t, 0, Thread1, 0); Thread1(0); pthread_join(t, 0); for (int i = 0; i < N; i++) delete data[i]; delete[] data; } // CHECK: ThreadSanitizer: reported 1 warnings golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_malloc.cc0000664000175000017500000000134212457727212026251 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include #include static void handler(int, siginfo_t*, void*) { // CHECK: WARNING: ThreadSanitizer: signal-unsafe call inside of a signal // CHECK: #0 malloc // CHECK: #{{(1|2)}} handler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_malloc.cc:[[@LINE+2]] // CHECK: SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal{{.*}}handler volatile char *p = (char*)malloc(1); p[0] = 0; free((void*)p); } int main() { struct sigaction act = {}; act.sa_sigaction = &handler; sigaction(SIGPROF, &act, 0); kill(getpid(), SIGPROF); sleep(1); // let the signal handler run return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_reset.cc0000664000175000017500000000271412617405322026121 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // UNSUPPORTED: darwin #include #include #include #include #include #include #include #include volatile int X; int stop; static void handler(int sig) { (void)sig; if (X != 0) printf("bad"); } static void* busy(void *p) { while (__atomic_load_n(&stop, __ATOMIC_RELAXED) == 0) { } return 0; } static void* reset(void *p) { struct sigaction act = {}; for (int i = 0; i < 1000000; i++) { act.sa_handler = &handler; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); exit(1); } act.sa_handler = SIG_IGN; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); exit(1); } } return 0; } int main() { struct sigaction act = {}; act.sa_handler = SIG_IGN; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); exit(1); } itimerval t; t.it_value.tv_sec = 0; t.it_value.tv_usec = 10; t.it_interval = t.it_value; if (setitimer(ITIMER_PROF, &t, 0)) { perror("setitimer"); exit(1); } pthread_t th[2]; pthread_create(&th[0], 0, busy, 0); pthread_create(&th[1], 0, reset, 0); pthread_join(th[1], 0); __atomic_store_n(&stop, 1, __ATOMIC_RELAXED); pthread_join(th[0], 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE // CHECK-NOT: WARNING: ThreadSanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/sunrpc.cc0000664000175000017500000000102312704157670024753 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include void *thr(void *p) { XDR xdrs; char buf[100]; xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE); xdr_destroy(&xdrs); return 0; } int main(int argc, char *argv[]) { pthread_t th[2]; pthread_create(&th[0], 0, thr, 0); pthread_create(&th[1], 0, thr, 0); pthread_join(th[0], 0); pthread_join(th[1], 0); fprintf(stderr, "DONE\n"); // CHECK: DONE return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset7.cc0000664000175000017500000000174612457727212025422 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; __thread int huge[1024*1024]; void *Thread1(void *x) { barrier_wait(&barrier); Global++; return NULL; } void *Thread2(void *x) { pthread_mutex_t *mtx = new pthread_mutex_t; pthread_mutex_init(mtx, 0); pthread_mutex_lock(mtx); Global--; pthread_mutex_unlock(mtx); pthread_mutex_destroy(mtx); delete mtx; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1: // CHECK: Previous write of size 4 at {{.*}} by thread T2 // CHECK: (mutexes: write [[M1:M[0-9]+]]): // CHECK: Mutex [[M1]] is already destroyed // CHECK-NOT: Mutex {{.*}} created at golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/simple_stack2.cc0000664000175000017500000000300012461071552026170 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %T/simple_stack2.cc.exe && %deflake %run %T/simple_stack2.cc.exe | FileCheck %s #include "test.h" int Global; void __attribute__((noinline)) foo1() { Global = 42; } void __attribute__((noinline)) bar1() { volatile int tmp = 42; int tmp2 = tmp; (void)tmp2; foo1(); } void __attribute__((noinline)) foo2() { volatile int tmp = Global; int tmp2 = tmp; (void)tmp2; } void __attribute__((noinline)) bar2() { volatile int tmp = 42; int tmp2 = tmp; (void)tmp2; foo2(); } void *Thread1(void *x) { barrier_wait(&barrier); bar1(); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, NULL, Thread1, NULL); bar2(); barrier_wait(&barrier); pthread_join(t, NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NEXT: Write of size 4 at {{.*}} by thread T1: // CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack2.cc:7{{(:10)?}} (simple_stack2.cc.exe+{{.*}}) // CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack2.cc:14{{(:3)?}} (simple_stack2.cc.exe+{{.*}}) // CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack2.cc:32{{(:3)?}} (simple_stack2.cc.exe+{{.*}}) // CHECK: Previous read of size 4 at {{.*}} by main thread: // CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack2.cc:18{{(:22)?}} (simple_stack2.cc.exe+{{.*}}) // CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack2.cc:27{{(:3)?}} (simple_stack2.cc.exe+{{.*}}) // CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack2.cc:40{{(:3)?}} (simple_stack2.cc.exe+{{.*}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib_lib.h0000664000175000017500000000075212223271415026240 0ustar mwhudsonmwhudson#include #include #include #include #include void *volatile mem; volatile int len; void *Thread(void *p) { while ((p = __atomic_load_n(&mem, __ATOMIC_ACQUIRE)) == 0) usleep(100); memset(p, 0, len); return 0; } extern "C" void libfunc() { pthread_t t; pthread_create(&t, 0, Thread, 0); len = 10; __atomic_store_n(&mem, malloc(len), __ATOMIC_RELEASE); pthread_join(t, 0); free(mem); fprintf(stderr, "OK\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atomic_free2.cc0000664000175000017500000000067112457727212026010 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread(void *a) { barrier_wait(&barrier); __atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST); return 0; } int main() { barrier_init(&barrier, 2); int *a = new int(0); pthread_t t; pthread_create(&t, 0, Thread, a); delete a; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: heap-use-after-free golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/sigsuspend.cc0000664000175000017500000000212212417433313025616 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Always enable asserts. #ifdef NDEBUG #undef NDEBUG #endif #include #include #include #include #include static bool signal_handler_ran = false; void do_nothing_signal_handler(int signum) { write(1, "HANDLER\n", 8); signal_handler_ran = true; } int main() { const int kSignalToTest = SIGSYS; assert(SIG_ERR != signal(kSignalToTest, do_nothing_signal_handler)); sigset_t empty_set; assert(0 == sigemptyset(&empty_set)); sigset_t one_signal = empty_set; assert(0 == sigaddset(&one_signal, kSignalToTest)); sigset_t old_set; assert(0 == sigprocmask(SIG_BLOCK, &one_signal, &old_set)); raise(kSignalToTest); assert(!signal_handler_ran); sigset_t all_but_one; assert(0 == sigfillset(&all_but_one)); assert(0 == sigdelset(&all_but_one, kSignalToTest)); sigsuspend(&all_but_one); assert(signal_handler_ran); // Restore the original set. assert(0 == sigprocmask(SIG_SETMASK, &old_set, NULL)); printf("DONE\n"); } // CHECK: HANDLER // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_close_norace2.cc0000664000175000017500000000107512704157670026637 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include int pipes[2]; void *Thread(void *x) { // wait for shutown signal while (read(pipes[0], &x, 1) != 1) { } close(pipes[0]); close(pipes[1]); return 0; } int main() { if (pipe(pipes)) return 1; pthread_t t; pthread_create(&t, 0, Thread, 0); // send shutdown signal while (write(pipes[1], &t, 1) != 1) { } pthread_join(t, 0); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/blacklist.cc0000664000175000017500000000121312704157670025412 0ustar mwhudsonmwhudson// Test blacklist functionality for TSan. // RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist // RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t && %run %t 2>&1 | FileCheck %s #include #include int Global; void *Thread1(void *x) { Global++; return NULL; } void *Blacklisted_Thread2(void *x) { Global--; return NULL; } int main() { pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "PASS\n"); return 0; } // CHECK-NOT: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignored-interceptors-mmap.cc0000664000175000017500000000321412716715067030546 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NORMAL // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-IGNORE #include #include #include "test.h" extern "C" { void AnnotateIgnoreReadsBegin(const char *f, int l); void AnnotateIgnoreReadsEnd(const char *f, int l); void AnnotateIgnoreWritesBegin(const char *f, int l); void AnnotateIgnoreWritesEnd(const char *f, int l); } void *global_p; int mmap_and_ignore_reads_and_writes() { const size_t kSize = sysconf(_SC_PAGESIZE); void *p = mmap(0, kSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); if (p == MAP_FAILED) return printf("mmap failed with %d\n", errno); munmap(p, kSize); void *new_p = mmap(p, kSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); if (p == MAP_FAILED || p != new_p) return printf("second mmap failed with %d\n", errno); AnnotateIgnoreWritesBegin(__FILE__, __LINE__); global_p = p; AnnotateIgnoreWritesEnd(__FILE__, __LINE__); barrier_wait(&barrier); return 0; } void *Thread(void *a) { barrier_wait(&barrier); ((int*)global_p)[1] = 10; printf("Read the zero value from mmapped memory %d\n", ((int*)global_p)[1]); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); if (mmap_and_ignore_reads_and_writes()) return 1; pthread_join(t, 0); printf("OK\n"); return 0; } // CHECK-NORMAL: WARNING: ThreadSanitizer: data race // CHECK-NORMAL: OK // CHECK-IGNORE_NOT: WARNING: ThreadSanitizer: data race // CHECK-IGNORE: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_dup_race.cc0000664000175000017500000000140012704157670025673 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include "test.h" #include #include #include // dup2(oldfd, newfd) races with close(newfd). int fd; void *Thread(void *x) { barrier_wait(&barrier); if (close(fd) == -1) exit(printf("close failed\n")); return 0; } int main() { barrier_init(&barrier, 2); fd = open("/dev/random", O_RDONLY); int fd2 = open("/dev/random", O_RDONLY); if (fd == -1 || fd2 == -1) exit(printf("open failed\n")); pthread_t th; pthread_create(&th, 0, Thread, 0); if (dup2(fd2, fd) == -1) exit(printf("dup2 failed\n")); barrier_wait(&barrier); pthread_join(th, 0); fprintf(stderr, "DONE\n"); } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/restore_stack.cc0000664000175000017500000000252112457727212026315 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s #include "test.h" int Global; volatile int x; const int kSize = 64 << 10; volatile long data[kSize]; void __attribute__((noinline)) foo() { for (int i = 0; i < kSize; i++) data[i]++; } void *Thread(void *a) { __atomic_store_n(&x, 1, __ATOMIC_RELEASE); foo(); data[0]++; if (a != 0) barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); for (int i = 0; i < 50; i++) { pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); } pthread_t t; pthread_create(&t, 0, Thread, (void*)1); barrier_wait(&barrier); for (int i = 0; i < kSize; i++) data[i]++; pthread_join(t, 0); fprintf(stderr, "DONE\n"); return 0; } // Previously this test produced bogus stack traces like: // Previous write of size 8 at 0x0000006a8ff8 by thread T17: // #0 foo() restore_stack.cc:13:5 (restore_stack.cc.exe+0x00000040622c) // #1 Thread(void*) restore_stack.cc:18:3 (restore_stack.cc.exe+0x000000406283) // #2 __tsan_thread_start_func rtl/tsan_interceptors.cc:886 (restore_stack.cc.exe+0x00000040a749) // #3 Thread(void*) restore_stack.cc:18:3 (restore_stack.cc.exe+0x000000406283) // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NOT: __tsan_thread_start_func // CHECK-NOT: #3 Thread // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_mutex.c0000664000175000017500000000223012672732200026117 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" pthread_mutex_t Mtx; int Global; void *Thread2(void *x) { barrier_wait(&barrier); // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NEXT: Atomic read of size 1 at {{.*}} by thread T2: // CHECK-NEXT: #0 pthread_mutex_lock // CHECK-NEXT: #1 Thread2{{.*}} {{.*}}race_on_mutex.c:[[@LINE+1]]{{(:3)?}} ({{.*}}) pthread_mutex_lock(&Mtx); Global = 43; pthread_mutex_unlock(&Mtx); return NULL; } void *Thread1(void *x) { // CHECK: Previous write of size {{[0-9]+}} at {{.*}} by thread T1: // CHECK: #{{[0-9]+}} {{.*}}pthread_mutex_init {{.*}} ({{.*}}) // CHECK-NEXT: #{{[0-9]+}} Thread1{{.*}} {{.*}}race_on_mutex.c:[[@LINE+1]]{{(:3)?}} ({{.*}}) pthread_mutex_init(&Mtx, 0); pthread_mutex_lock(&Mtx); Global = 42; pthread_mutex_unlock(&Mtx); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&Mtx); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_barrier2.c0000664000175000017500000000135212623335072026473 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // pthread barriers are not available on OS X // UNSUPPORTED: darwin #include #include #include #include pthread_barrier_t B; int Global; void *Thread1(void *x) { if (pthread_barrier_wait(&B) == PTHREAD_BARRIER_SERIAL_THREAD) pthread_barrier_destroy(&B); return NULL; } void *Thread2(void *x) { if (pthread_barrier_wait(&B) == PTHREAD_BARRIER_SERIAL_THREAD) pthread_barrier_destroy(&B); return NULL; } int main() { pthread_barrier_init(&B, 0, 2); pthread_t t; pthread_create(&t, NULL, Thread1, NULL); Thread2(0); pthread_join(t, NULL); return 0; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mop_with_offset.cc0000664000175000017500000000154012627123307026633 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread1(void *x) { int *p = (int*)x; p[0] = 1; barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); char *p = (char*)x; p[2] = 1; return NULL; } int main() { barrier_init(&barrier, 2); int *data = new int(42); print_address("ptr1=", 1, data); print_address("ptr2=", 1, (char*)data + 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, data); pthread_create(&t[1], NULL, Thread2, data); pthread_join(t[0], NULL); pthread_join(t[1], NULL); delete data; } // CHECK: ptr1=[[PTR1:0x[0-9,a-f]+]] // CHECK: ptr2=[[PTR2:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 1 at [[PTR2]] by thread T2: // CHECK: Previous write of size 4 at [[PTR1]] by thread T1: golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/map32bit.cc0000664000175000017500000000211512761301620025052 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include "test.h" #include #include #include // Test for issue: // https://github.com/google/sanitizers/issues/412 // MAP_32BIT flag for mmap is supported only for x86_64. // XFAIL: mips // XFAIL: aarch64 // XFAIL: powerpc64 // MAP_32BIT doesn't exist on OS X. // UNSUPPORTED: darwin void *Thread(void *ptr) { *(int*)ptr = 42; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); void *ptr = mmap(0, 128 << 10, PROT_READ|PROT_WRITE, MAP_32BIT|MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); fprintf(stderr, "ptr=%p\n", ptr); if (ptr == MAP_FAILED) { fprintf(stderr, "mmap failed: %d\n", errno); return 1; } if ((uintptr_t)ptr >= (1ull << 32)) { fprintf(stderr, "ptr is too high\n"); return 1; } pthread_t t; pthread_create(&t, 0, Thread, ptr); barrier_wait(&barrier); *(int*)ptr = 42; pthread_join(t, 0); munmap(ptr, 128 << 10); fprintf(stderr, "DONE\n"); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_double_lock.cc0000664000175000017500000000150412342110363027133 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw); void *ThreadFunc(void *m) { AnnotateRWLockAcquired(__FILE__, __LINE__, m, 1); return 0; } int main() { int m = 0; AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1); pthread_t th; pthread_create(&th, 0, ThreadFunc, &m); pthread_join(th, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: double lock of a mutex // CHECK: #0 AnnotateRWLockAcquired // CHECK: #1 ThreadFunc // CHECK: Location is stack of main thread. // CHECK: Mutex {{.*}} created at: // CHECK: #0 AnnotateRWLockAcquired // CHECK: #1 main // CHECK: SUMMARY: ThreadSanitizer: double lock of a mutex {{.*}}mutex_double_lock.cc{{.*}}ThreadFunc golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/deadlock_detector_stress_test.cc0000664000175000017500000004706412627123307031553 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -DLockType=PthreadMutex // RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOT-SECOND // RUN: %env_tsan_opts=detect_deadlocks=1:second_deadlock_stack=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SECOND // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadSpinLock // RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRWLock // RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RD // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRecursiveMutex // RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REC #include "test.h" #undef NDEBUG #include #include #ifndef LockType #define LockType PthreadMutex #endif // You can optionally pass [test_number [iter_count]] on command line. static int test_number = -1; static int iter_count = 100000; class PthreadMutex { public: explicit PthreadMutex(bool recursive = false) { if (recursive) { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); assert(0 == pthread_mutex_init(&mu_, &attr)); } else { assert(0 == pthread_mutex_init(&mu_, 0)); } } ~PthreadMutex() { assert(0 == pthread_mutex_destroy(&mu_)); (void)padding_; } static bool supports_read_lock() { return false; } static bool supports_recursive_lock() { return false; } void lock() { assert(0 == pthread_mutex_lock(&mu_)); } void unlock() { assert(0 == pthread_mutex_unlock(&mu_)); } bool try_lock() { return 0 == pthread_mutex_trylock(&mu_); } void rdlock() { assert(0); } void rdunlock() { assert(0); } bool try_rdlock() { assert(0); } private: pthread_mutex_t mu_; char padding_[64 - sizeof(pthread_mutex_t)]; }; class PthreadRecursiveMutex : public PthreadMutex { public: PthreadRecursiveMutex() : PthreadMutex(true) { } static bool supports_recursive_lock() { return true; } }; #ifndef __APPLE__ class PthreadSpinLock { public: PthreadSpinLock() { assert(0 == pthread_spin_init(&mu_, 0)); } ~PthreadSpinLock() { assert(0 == pthread_spin_destroy(&mu_)); (void)padding_; } static bool supports_read_lock() { return false; } static bool supports_recursive_lock() { return false; } void lock() { assert(0 == pthread_spin_lock(&mu_)); } void unlock() { assert(0 == pthread_spin_unlock(&mu_)); } bool try_lock() { return 0 == pthread_spin_trylock(&mu_); } void rdlock() { assert(0); } void rdunlock() { assert(0); } bool try_rdlock() { assert(0); } private: pthread_spinlock_t mu_; char padding_[64 - sizeof(pthread_spinlock_t)]; }; #else class PthreadSpinLock : public PthreadMutex { }; #endif class PthreadRWLock { public: PthreadRWLock() { assert(0 == pthread_rwlock_init(&mu_, 0)); } ~PthreadRWLock() { assert(0 == pthread_rwlock_destroy(&mu_)); (void)padding_; } static bool supports_read_lock() { return true; } static bool supports_recursive_lock() { return false; } void lock() { assert(0 == pthread_rwlock_wrlock(&mu_)); } void unlock() { assert(0 == pthread_rwlock_unlock(&mu_)); } bool try_lock() { return 0 == pthread_rwlock_trywrlock(&mu_); } void rdlock() { assert(0 == pthread_rwlock_rdlock(&mu_)); } void rdunlock() { assert(0 == pthread_rwlock_unlock(&mu_)); } bool try_rdlock() { return 0 == pthread_rwlock_tryrdlock(&mu_); } private: pthread_rwlock_t mu_; char padding_[256 - sizeof(pthread_rwlock_t)]; }; class LockTest { public: LockTest() : n_(), locks_() {} void Init(size_t n) { n_ = n; locks_ = new LockType*[n_]; for (size_t i = 0; i < n_; i++) locks_[i] = new LockType; } ~LockTest() { for (size_t i = 0; i < n_; i++) delete locks_[i]; delete [] locks_; } void L(size_t i) { assert(i < n_); locks_[i]->lock(); } void U(size_t i) { assert(i < n_); locks_[i]->unlock(); } void RL(size_t i) { assert(i < n_); locks_[i]->rdlock(); } void RU(size_t i) { assert(i < n_); locks_[i]->rdunlock(); } void *A(size_t i) { assert(i < n_); return locks_[i]; } bool T(size_t i) { assert(i < n_); return locks_[i]->try_lock(); } // Simple lock order onversion. void Test1() { if (test_number > 0 && test_number != 1) return; fprintf(stderr, "Starting Test1\n"); // CHECK: Starting Test1 Init(5); print_address("Expecting lock inversion: ", 2, A(0), A(1)); // CHECK: Expecting lock inversion: [[A1:0x[a-f0-9]*]] [[A2:0x[a-f0-9]*]] Lock_0_1(); Lock_1_0(); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) // CHECK: Cycle in lock order graph: [[M1:M[0-9]+]] ([[A1]]) => [[M2:M[0-9]+]] ([[A2]]) => [[M1]] // CHECK: Mutex [[M2]] acquired here while holding mutex [[M1]] // CHECK: #0 pthread_ // CHECK-SECOND: Mutex [[M1]] previously acquired by the same thread here: // CHECK-SECOND: #0 pthread_ // CHECK-NOT-SECOND: second_deadlock_stack=1 to get more informative warning message // CHECK-NOT-SECOND-NOT: #0 pthread_ // CHECK: Mutex [[M1]] acquired here while holding mutex [[M2]] // CHECK: #0 pthread_ // CHECK-SECOND: Mutex [[M2]] previously acquired by the same thread here: // CHECK-SECOND: #0 pthread_ // CHECK-NOT-SECOND-NOT: #0 pthread_ // CHECK-NOT: WARNING: ThreadSanitizer: } // Simple lock order inversion with 3 locks. void Test2() { if (test_number > 0 && test_number != 2) return; fprintf(stderr, "Starting Test2\n"); // CHECK: Starting Test2 Init(5); print_address("Expecting lock inversion: ", 3, A(0), A(1), A(2)); // CHECK: Expecting lock inversion: [[A1:0x[a-f0-9]*]] [[A2:0x[a-f0-9]*]] [[A3:0x[a-f0-9]*]] Lock2(0, 1); Lock2(1, 2); Lock2(2, 0); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) // CHECK: Cycle in lock order graph: [[M1:M[0-9]+]] ([[A1]]) => [[M2:M[0-9]+]] ([[A2]]) => [[M3:M[0-9]+]] ([[A3]]) => [[M1]] // CHECK-NOT: WARNING: ThreadSanitizer: } // Lock order inversion with lots of new locks created (but not used) // between. Since the new locks are not used we should still detect the // deadlock. void Test3() { if (test_number > 0 && test_number != 3) return; fprintf(stderr, "Starting Test3\n"); // CHECK: Starting Test3 Init(5); Lock_0_1(); L(2); CreateAndDestroyManyLocks(); U(2); Lock_1_0(); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) // CHECK-NOT: WARNING: ThreadSanitizer: } // lock l0=>l1; then create and use lots of locks; then lock l1=>l0. // The deadlock epoch should have changed and we should not report anything. void Test4() { if (test_number > 0 && test_number != 4) return; fprintf(stderr, "Starting Test4\n"); // CHECK: Starting Test4 Init(5); Lock_0_1(); L(2); CreateLockUnlockAndDestroyManyLocks(); U(2); Lock_1_0(); // CHECK-NOT: WARNING: ThreadSanitizer: } void Test5() { if (test_number > 0 && test_number != 5) return; fprintf(stderr, "Starting Test5\n"); // CHECK: Starting Test5 Init(5); RunThreads(&LockTest::Lock_0_1, &LockTest::Lock_1_0); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion // CHECK: Cycle in lock order graph: [[M1:M[0-9]+]] ({{.*}}) => [[M2:M[0-9]+]] ({{.*}}) => [[M1]] // CHECK: Mutex [[M2]] acquired here while holding mutex [[M1]] in thread [[T1:T[0-9]+]] // CHECK: Mutex [[M1]] acquired here while holding mutex [[M2]] in thread [[T2:T[0-9]+]] // CHECK: Thread [[T1]] {{.*}} created by main thread // CHECK: Thread [[T2]] {{.*}} created by main thread // CHECK-NOT: WARNING: ThreadSanitizer: } void Test6() { if (test_number > 0 && test_number != 6) return; fprintf(stderr, "Starting Test6: 3 threads lock/unlock private mutexes\n"); // CHECK: Starting Test6 Init(100); // CHECK-NOT: WARNING: ThreadSanitizer: RunThreads(&LockTest::Lock1_Loop_0, &LockTest::Lock1_Loop_1, &LockTest::Lock1_Loop_2); } void Test7() { if (test_number > 0 && test_number != 7) return; fprintf(stderr, "Starting Test7\n"); // CHECK: Starting Test7 Init(10); L(0); T(1); U(1); U(0); T(1); L(0); U(1); U(0); // CHECK-NOT: WARNING: ThreadSanitizer: fprintf(stderr, "No cycle: 0=>1\n"); // CHECK: No cycle: 0=>1 T(2); L(3); U(3); U(2); L(3); T(2); U(3); U(2); // CHECK-NOT: WARNING: ThreadSanitizer: fprintf(stderr, "No cycle: 2=>3\n"); // CHECK: No cycle: 2=>3 T(4); L(5); U(4); U(5); L(5); L(4); U(4); U(5); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion fprintf(stderr, "Have cycle: 4=>5\n"); // CHECK: Have cycle: 4=>5 L(7); L(6); U(6); U(7); T(6); L(7); U(6); U(7); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion fprintf(stderr, "Have cycle: 6=>7\n"); // CHECK: Have cycle: 6=>7 } void Test8() { if (test_number > 0 && test_number != 8) return; if (!LockType::supports_read_lock()) return; fprintf(stderr, "Starting Test8\n"); Init(5); // CHECK-RD: Starting Test8 RL(0); L(1); RU(0); U(1); L(1); RL(0); RU(0); U(1); // CHECK-RD: WARNING: ThreadSanitizer: lock-order-inversion fprintf(stderr, "Have cycle: 0=>1\n"); // CHECK-RD: Have cycle: 0=>1 RL(2); RL(3); RU(2); RU(3); RL(3); RL(2); RU(2); RU(3); // CHECK-RD: WARNING: ThreadSanitizer: lock-order-inversion fprintf(stderr, "Have cycle: 2=>3\n"); // CHECK-RD: Have cycle: 2=>3 } void Test9() { if (test_number > 0 && test_number != 9) return; if (!LockType::supports_recursive_lock()) return; fprintf(stderr, "Starting Test9\n"); // CHECK-REC: Starting Test9 Init(5); L(0); L(0); L(0); L(1); U(1); U(0); U(0); U(0); L(1); L(1); L(1); L(0); U(0); U(1); U(1); U(1); // CHECK-REC: WARNING: ThreadSanitizer: lock-order-inversion } void Test10() { if (test_number > 0 && test_number != 10) return; fprintf(stderr, "Starting Test10: 4 threads lock/unlock 4 private mutexes, one under another\n"); // CHECK: Starting Test10 Init(100); // CHECK-NOT: WARNING: ThreadSanitizer: RunThreads(&LockTest::Test10_Thread1, &LockTest::Test10_Thread2, &LockTest::Test10_Thread3, &LockTest::Test10_Thread4); } void Test10_Thread1() { Test10_Thread(0); } void Test10_Thread2() { Test10_Thread(10); } void Test10_Thread3() { Test10_Thread(20); } void Test10_Thread4() { Test10_Thread(30); } void Test10_Thread(size_t m) { for (int i = 0; i < iter_count; i++) { L(m + 0); L(m + 1); L(m + 2); L(m + 3); U(m + 3); U(m + 2); U(m + 1); U(m + 0); } } void Test11() { if (test_number > 0 && test_number != 11) return; fprintf(stderr, "Starting Test11: 4 threads lock/unlock 4 private mutexes, all under another private mutex\n"); // CHECK: Starting Test11 Init(500); // CHECK-NOT: WARNING: ThreadSanitizer: RunThreads(&LockTest::Test11_Thread1, &LockTest::Test11_Thread2, &LockTest::Test11_Thread3, &LockTest::Test11_Thread4); } void Test11_Thread1() { Test10_Thread(0); } void Test11_Thread2() { Test10_Thread(10); } void Test11_Thread3() { Test10_Thread(20); } void Test11_Thread4() { Test10_Thread(30); } void Test11_Thread(size_t m) { for (int i = 0; i < iter_count; i++) { L(m); L(m + 100); U(m + 100); L(m + 200); U(m + 200); L(m + 300); U(m + 300); L(m + 400); U(m + 500); U(m); } } void Test12() { if (test_number > 0 && test_number != 12) return; if (!LockType::supports_read_lock()) return; fprintf(stderr, "Starting Test12: 4 threads read lock/unlock 4 shared mutexes, one under another\n"); // CHECK-RD: Starting Test12 Init(500); // CHECK-RD-NOT: WARNING: ThreadSanitizer: RunThreads(&LockTest::Test12_Thread, &LockTest::Test12_Thread, &LockTest::Test12_Thread, &LockTest::Test12_Thread); } void Test12_Thread() { for (int i = 0; i < iter_count; i++) { RL(000); RL(100); RL(200); RL(300); RU(300); RU(200); RU(100); RU(000); } } void Test13() { if (test_number > 0 && test_number != 13) return; if (!LockType::supports_read_lock()) return; fprintf(stderr, "Starting Test13: 4 threads read lock/unlock 4 shared mutexes, all under another shared mutex\n"); // CHECK-RD: Starting Test13 Init(500); // CHECK-RD-NOT: WARNING: ThreadSanitizer: RunThreads(&LockTest::Test13_Thread, &LockTest::Test13_Thread, &LockTest::Test13_Thread, &LockTest::Test13_Thread); } void Test13_Thread() { for (int i = 0; i < iter_count; i++) { RL(0); RL(100); RU(100); RL(200); RU(200); RL(300); RU(300); RL(400); RU(400); RU(0); } } void Test14() { if (test_number > 0 && test_number != 14) return; fprintf(stderr, "Starting Test14: create lots of locks in 4 threads\n"); Init(10); // CHECK-RD: Starting Test14 RunThreads(&LockTest::CreateAndDestroyLocksLoop, &LockTest::CreateAndDestroyLocksLoop, &LockTest::CreateAndDestroyLocksLoop, &LockTest::CreateAndDestroyLocksLoop); } void Test15() { if (test_number > 0 && test_number != 15) return; if (!LockType::supports_read_lock()) return; fprintf(stderr, "Starting Test15: recursive rlock\n"); // DISABLEDCHECK-RD: Starting Test15 Init(5); RL(0); RL(0); RU(0); RU(0); // Recusrive reader lock. RL(0); RL(0); RL(0); RU(0); RU(0); RU(0); // Recusrive reader lock. } // More detailed output test. void Test16() { if (test_number > 0 && test_number != 16) return; fprintf(stderr, "Starting Test16: detailed output test with two locks\n"); // CHECK: Starting Test16 // CHECK: WARNING: ThreadSanitizer: lock-order-inversion // CHECK: acquired here while holding mutex // CHECK: LockTest::Acquire1 // CHECK-NEXT: LockTest::Acquire_0_then_1 // CHECK-SECOND: previously acquired by the same thread here // CHECK-SECOND: LockTest::Acquire0 // CHECK-SECOND-NEXT: LockTest::Acquire_0_then_1 // CHECK: acquired here while holding mutex // CHECK: LockTest::Acquire0 // CHECK-NEXT: LockTest::Acquire_1_then_0 // CHECK-SECOND: previously acquired by the same thread here // CHECK-SECOND: LockTest::Acquire1 // CHECK-SECOND-NEXT: LockTest::Acquire_1_then_0 Init(5); Acquire_0_then_1(); U(0); U(1); Acquire_1_then_0(); U(0); U(1); } // More detailed output test. void Test17() { if (test_number > 0 && test_number != 17) return; fprintf(stderr, "Starting Test17: detailed output test with three locks\n"); // CHECK: Starting Test17 // CHECK: WARNING: ThreadSanitizer: lock-order-inversion // CHECK: LockTest::Acquire1 // CHECK-NEXT: LockTest::Acquire_0_then_1 // CHECK: LockTest::Acquire2 // CHECK-NEXT: LockTest::Acquire_1_then_2 // CHECK: LockTest::Acquire0 // CHECK-NEXT: LockTest::Acquire_2_then_0 Init(5); Acquire_0_then_1(); U(0); U(1); Acquire_1_then_2(); U(1); U(2); Acquire_2_then_0(); U(0); U(2); } __attribute__((noinline)) void Acquire2() { L(2); } __attribute__((noinline)) void Acquire1() { L(1); } __attribute__((noinline)) void Acquire0() { L(0); } __attribute__((noinline)) void Acquire_1_then_0() { Acquire1(); Acquire0(); } __attribute__((noinline)) void Acquire_0_then_1() { Acquire0(); Acquire1(); } __attribute__((noinline)) void Acquire_1_then_2() { Acquire1(); Acquire2(); } __attribute__((noinline)) void Acquire_2_then_0() { Acquire2(); Acquire0(); } // This test creates, locks, unlocks and destroys lots of mutexes. void Test18() { if (test_number > 0 && test_number != 18) return; fprintf(stderr, "Starting Test18: create, lock and destroy 4 locks; all in " "4 threads in a loop\n"); RunThreads(&LockTest::Test18_Thread, &LockTest::Test18_Thread, &LockTest::Test18_Thread, &LockTest::Test18_Thread); } void Test18_Thread() { LockType *l = new LockType[4]; for (size_t i = 0; i < iter_count / 100; i++) { for (int i = 0; i < 4; i++) l[i].lock(); for (int i = 0; i < 4; i++) l[i].unlock(); for (int i = 0; i < 4; i++) l[i].~LockType(); for (int i = 0; i < 4; i++) new ((void*)&l[i]) LockType(); } delete [] l; } void Test19() { if (test_number > 0 && test_number != 19) return; fprintf(stderr, "Starting Test19: lots of lock inversions\n"); const int kNumLocks = 45; Init(kNumLocks); for (int i = 0; i < kNumLocks; i++) { for (int j = 0; j < kNumLocks; j++) L((i + j) % kNumLocks); for (int j = 0; j < kNumLocks; j++) U((i + j) % kNumLocks); } } private: void Lock2(size_t l1, size_t l2) { L(l1); L(l2); U(l2); U(l1); } template void Lock_0_1() { Lock2(0, 1); if (wait) barrier_wait(&barrier); } template void Lock_1_0() { if (wait) barrier_wait(&barrier); Lock2(1, 0); } void Lock1_Loop(size_t i, size_t n_iter) { for (size_t it = 0; it < n_iter; it++) { // if ((it & (it - 1)) == 0) fprintf(stderr, "%zd", i); L(i); U(i); } // fprintf(stderr, "\n"); } void Lock1_Loop_0() { Lock1_Loop(0, iter_count); } void Lock1_Loop_1() { Lock1_Loop(10, iter_count); } void Lock1_Loop_2() { Lock1_Loop(20, iter_count); } void CreateAndDestroyManyLocks() { LockType *create_many_locks_but_never_acquire = new LockType[kDeadlockGraphSize]; (void)create_many_locks_but_never_acquire; delete [] create_many_locks_but_never_acquire; } void CreateAndDestroyLocksLoop() { for (size_t it = 0; it <= iter_count; it++) { LockType some_locks[10]; (void)some_locks; } } void CreateLockUnlockAndDestroyManyLocks() { LockType many_locks[kDeadlockGraphSize]; for (size_t i = 0; i < kDeadlockGraphSize; i++) { many_locks[i].lock(); many_locks[i].unlock(); } } // LockTest Member function callback. struct CB { void (LockTest::*f)(); LockTest *lt; }; // Thread function with CB. static void *Thread(void *param) { CB *cb = (CB*)param; (cb->lt->*cb->f)(); return NULL; } void RunThreads(void (LockTest::*f1)(), void (LockTest::*f2)(), void (LockTest::*f3)() = 0, void (LockTest::*f4)() = 0) { const int kNumThreads = 4; pthread_t t[kNumThreads]; CB cb[kNumThreads] = {{f1, this}, {f2, this}, {f3, this}, {f4, this}}; for (int i = 0; i < kNumThreads && cb[i].f; i++) pthread_create(&t[i], 0, Thread, &cb[i]); for (int i = 0; i < kNumThreads && cb[i].f; i++) pthread_join(t[i], 0); } static const size_t kDeadlockGraphSize = 4096; size_t n_; LockType **locks_; }; int main(int argc, char **argv) { barrier_init(&barrier, 2); if (argc > 1) test_number = atoi(argv[1]); if (argc > 2) iter_count = atoi(argv[2]); LockTest().Test1(); LockTest().Test2(); LockTest().Test3(); LockTest().Test4(); LockTest().Test5(); LockTest().Test6(); LockTest().Test7(); LockTest().Test8(); LockTest().Test9(); LockTest().Test10(); LockTest().Test11(); LockTest().Test12(); LockTest().Test13(); LockTest().Test14(); LockTest().Test15(); LockTest().Test16(); LockTest().Test17(); LockTest().Test18(); LockTest().Test19(); fprintf(stderr, "ALL-DONE\n"); // CHECK: ALL-DONE } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_race.cc0000664000175000017500000000153112704157670025722 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" int Global; extern "C" void AnnotateIgnoreWritesBegin(const char *f, int l); extern "C" void AnnotateIgnoreWritesEnd(const char *f, int l); extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l); extern "C" void AnnotateIgnoreReadsEnd(const char *f, int l); void *Thread(void *x) { AnnotateIgnoreWritesBegin(__FILE__, __LINE__); AnnotateIgnoreReadsBegin(__FILE__, __LINE__); Global = 42; AnnotateIgnoreReadsEnd(__FILE__, __LINE__); AnnotateIgnoreWritesEnd(__FILE__, __LINE__); barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); Global = 43; pthread_join(t, 0); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_bad_read_unlock.cc0000664000175000017500000000133112342110363027743 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw); extern "C" void AnnotateRWLockReleased(const char *f, int l, void *m, long rw); int main() { int m = 0; AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1); AnnotateRWLockReleased(__FILE__, __LINE__, &m, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: read unlock of a write locked mutex // CHECK: #0 AnnotateRWLockReleased // CHECK: #1 main // CHECK: Location is stack of main thread. // CHECK: Mutex {{.*}}) created at: // CHECK: #0 AnnotateRWLockAcquired // CHECK: #1 main // CHECK: SUMMARY: ThreadSanitizer: read unlock of a write locked mutex golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atexit.cc0000664000175000017500000000070012401351247024726 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include class Logger { public: Logger() { fprintf(stderr, "Logger ctor\n"); } ~Logger() { fprintf(stderr, "Logger dtor\n"); } }; Logger logger; void log_from_atexit() { fprintf(stderr, "In log_from_atexit\n"); } int main() { atexit(log_from_atexit); } // CHECK: Logger ctor // CHECK: In log_from_atexit // CHECK: Logger dtor golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/setuid2.c0000664000175000017500000000130112667154632024657 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=flush_memory_ms=1:memory_limit_mb=1 %run %t 2>&1 | FileCheck %s // // setuid(0) hangs on powerpc64 big endian. When this is fixed remove // the unsupported flag. // https://llvm.org/bugs/show_bug.cgi?id=25799 // // UNSUPPORTED: powerpc64-unknown-linux-gnu #include "test.h" #include #include #include // Test that setuid call works in presence of stoptheworld. int main() { unsigned long long tp0, tp1; tp0 = monotonic_clock_ns(); tp1 = monotonic_clock_ns(); while (tp1 - tp0 < 3 * 1000000000ull) { tp1 = monotonic_clock_ns(); setuid(0); } fprintf(stderr, "DONE\n"); return 0; } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_top_suppression1.cc0000664000175000017500000000113212623403316027760 0ustar mwhudsonmwhudson// RUN: echo "race_top:TopFunction" > %t.supp // RUN: %clangxx_tsan -O1 %s -o %t // RUN: %env_tsan_opts=suppressions='%t.supp' %deflake %run %t 2>&1 | FileCheck %s // RUN: rm %t.supp #include "test.h" int Global; void AnotherFunction(int *p) { *p = 1; } void TopFunction(int *p) { AnotherFunction(p); } void *Thread(void *x) { barrier_wait(&barrier); TopFunction(&Global); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); Global--; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/0000775000175000017500000000000013040224625024222 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/check_preinit.cc0000664000175000017500000000274712721626340027357 0ustar mwhudsonmwhudson// RUN: %clang_tsan -fno-sanitize=thread -shared -fPIC -O1 -DBUILD_SO=1 %s -o \ // RUN: %t.so && \ // RUN: %clang_tsan -O1 %s %t.so -o %t && %run %t 2>&1 | FileCheck %s // RUN: llvm-objdump -t %t | FileCheck %s --check-prefix=CHECK-DUMP // CHECK-DUMP: {{[.]preinit_array.*__local_tsan_preinit}} // SANITIZER_CAN_USE_PREINIT_ARRAY is undefined on android. // UNSUPPORTED: android // Test checks if __tsan_init is called from .preinit_array. // Without initialization from .preinit_array, __tsan_init will be called from // constructors of the binary which are called after constructors of shared // library. #include #if BUILD_SO // "volatile" is needed to avoid compiler optimize-out constructors. volatile int counter = 0; volatile int lib_constructor_call = 0; volatile int tsan_init_call = 0; __attribute__ ((constructor)) void LibConstructor() { lib_constructor_call = ++counter; }; #else // BUILD_SO extern int counter; extern int lib_constructor_call; extern int tsan_init_call; volatile int bin_constructor_call = 0; __attribute__ ((constructor)) void BinConstructor() { bin_constructor_call = ++counter; }; namespace __tsan { void OnInitialize() { tsan_init_call = ++counter; } } int main() { // CHECK: TSAN_INIT 1 // CHECK: LIB_CONSTRUCTOR 2 // CHECK: BIN_CONSTRUCTOR 3 printf("TSAN_INIT %d\n", tsan_init_call); printf("LIB_CONSTRUCTOR %d\n", lib_constructor_call); printf("BIN_CONSTRUCTOR %d\n", bin_constructor_call); return 0; } #endif // BUILD_SO golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/lit.local.cfg0000664000175000017500000000026612415701325026572 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Linux']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/mutex_robust2.cc0000664000175000017500000000166112417465730027372 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include #include #include pthread_mutex_t m; int x; void *thr(void *p) { pthread_mutex_lock(&m); x = 42; return 0; } int main() { pthread_mutexattr_t a; pthread_mutexattr_init(&a); pthread_mutexattr_setrobust(&a, PTHREAD_MUTEX_ROBUST); pthread_mutex_init(&m, &a); pthread_t th; pthread_create(&th, 0, thr, 0); sleep(1); if (pthread_mutex_trylock(&m) != EOWNERDEAD) { fprintf(stderr, "not EOWNERDEAD\n"); exit(1); } x = 43; pthread_join(th, 0); fprintf(stderr, "DONE\n"); } // This is a false positive, tsan must not bark at the data race. // But currently it does. // CHECK-NOT: WARNING: ThreadSanitizer WARNING: double lock of mutex // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NOT: EOWNERDEAD // CHECK: DONE // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/check_memcpy.cc0000664000175000017500000000062612631405622027167 0ustar mwhudsonmwhudson// Test that verifies TSan runtime doesn't contain compiler-emitted // memcpy/memmove calls. It builds the binary with TSan and passes it to // check_memcpy.sh script. // RUN: %clangxx_tsan -O1 %s -o %t // RUN: llvm-objdump -d %t | FileCheck %s int main() { return 0; } // CHECK-NOT: callq {{.*<(__interceptor_)?mem(cpy|set)>}} // tail calls: // CHECK-NOT: jmpq {{.*<(__interceptor_)?mem(cpy|set)>}} golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/user_malloc.cc0000664000175000017500000000113612704157670027052 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include // Defined by tsan. extern "C" void *__interceptor_malloc(unsigned long size); extern "C" void __interceptor_free(void *p); extern "C" void *malloc(unsigned long size) { static int first = 0; if (__sync_lock_test_and_set(&first, 1) == 0) fprintf(stderr, "user malloc\n"); return __interceptor_malloc(size); } extern "C" void free(void *p) { __interceptor_free(p); } int main() { volatile char *p = (char*)malloc(10); p[0] = 0; free((void*)p); } // CHECK: user malloc // CHECK-NOT: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/user_fopen.cc0000664000175000017500000000141112415702140026671 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include // Defined by tsan. extern "C" FILE *__interceptor_fopen(const char *file, const char *mode); extern "C" int __interceptor_fileno(FILE *f); extern "C" FILE *fopen(const char *file, const char *mode) { static int first = 0; if (__sync_lock_test_and_set(&first, 1) == 0) printf("user fopen\n"); return __interceptor_fopen(file, mode); } extern "C" int fileno(FILE *f) { static int first = 0; if (__sync_lock_test_and_set(&first, 1) == 0) printf("user fileno\n"); return 1; } int main() { FILE *f = fopen("/dev/zero", "r"); if (f) { char buf; fread(&buf, 1, 1, f); fclose(f); } } // CHECK: user fopen // CHECK-NOT: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Linux/mutex_robust.cc0000664000175000017500000000143212417465730027304 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include pthread_mutex_t m; void *thr(void *p) { pthread_mutex_lock(&m); return 0; } int main() { pthread_mutexattr_t a; pthread_mutexattr_init(&a); pthread_mutexattr_setrobust(&a, PTHREAD_MUTEX_ROBUST); pthread_mutex_init(&m, &a); pthread_t th; pthread_create(&th, 0, thr, 0); sleep(1); if (pthread_mutex_lock(&m) != EOWNERDEAD) { fprintf(stderr, "not EOWNERDEAD\n"); exit(1); } pthread_join(th, 0); fprintf(stderr, "DONE\n"); } // This is a correct code, and tsan must not bark. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK-NOT: EOWNERDEAD // CHECK: DONE // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/static_init5.cc0000664000175000017500000000143012704157670026042 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include struct Cache { int x; explicit Cache(int x) : x(x) { } }; void *AsyncInit(void *p) { return new Cache((int)(long)p); } Cache *CreateCache() { pthread_t t; pthread_create(&t, 0, AsyncInit, (void*)(long)rand()); void *res; pthread_join(t, &res); return (Cache*)res; } void *Thread1(void *x) { static Cache *c = CreateCache(); if (c->x >= RAND_MAX) exit(1); return 0; } int main() { pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); pthread_create(&t[1], 0, Thread1, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); fprintf(stderr, "PASS\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_name2.cc0000664000175000017500000000154312626271123025772 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" // OS X doesn't have pthread_setname_np(tid, name). // UNSUPPORTED: darwin #if defined(__FreeBSD__) #include #define pthread_setname_np pthread_set_name_np #endif long long Global; void *Thread1(void *x) { barrier_wait(&barrier); Global++; return 0; } void *Thread2(void *x) { pthread_setname_np(pthread_self(), "foobar2"); Global--; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 3); pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); pthread_create(&t[1], 0, Thread2, 0); pthread_setname_np(t[0], "foobar1"); barrier_wait(&barrier); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Thread T1 'foobar1' // CHECK: Thread T2 'foobar2' golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_leak4.c0000664000175000017500000000052712704157670025635 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" void *Thread(void *x) { sleep(100); // leave the thread "running" return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK: DONE // CHECK-NOT: WARNING: ThreadSanitizer: thread leak golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_errno.cc0000664000175000017500000000236312632330741026123 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // This test fails on powerpc64 BE (VMA=44), it does not appear to be // a functional problem, but the Tsan report is missing some info. // XFAIL: powerpc64-unknown-linux-gnu #include "test.h" #include #include #include pthread_t mainth; volatile int done; static void MyHandler(int, siginfo_t *s, void *c) { errno = 1; done = 1; } static void* sendsignal(void *p) { barrier_wait(&barrier); pthread_kill(mainth, SIGPROF); return 0; } static __attribute__((noinline)) void loop() { barrier_wait(&barrier); while (done == 0) { volatile char *p = (char*)malloc(1); p[0] = 0; free((void*)p); sched_yield(); } } int main() { barrier_init(&barrier, 2); mainth = pthread_self(); struct sigaction act = {}; act.sa_sigaction = &MyHandler; sigaction(SIGPROF, &act, 0); pthread_t th; pthread_create(&th, 0, sendsignal, 0); loop(); pthread_join(th, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: signal handler spoils errno // CHECK: #0 MyHandler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cc // CHECK: main // CHECK: SUMMARY: ThreadSanitizer: signal handler spoils errno{{.*}}MyHandler golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/allocator_returns_null.cc0000664000175000017500000000504612623403316030235 0ustar mwhudsonmwhudson// Test the behavior of malloc/calloc/realloc when the allocation size is huge. // By default (allocator_may_return_null=0) the process should crash. // With allocator_may_return_null=1 the allocator should return 0. // // RUN: %clangxx_tsan -O0 %s -o %t // RUN: not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH // RUN: %env_tsan_opts=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH // RUN: %env_tsan_opts=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH // RUN: %env_tsan_opts=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH // RUN: %env_tsan_opts=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH // RUN: %env_tsan_opts=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH #include #include #include #include #include #include int main(int argc, char **argv) { volatile size_t size = std::numeric_limits::max() - 10000; assert(argc == 2); char *x = 0; if (!strcmp(argv[1], "malloc")) { fprintf(stderr, "malloc:\n"); x = (char*)malloc(size); } if (!strcmp(argv[1], "calloc")) { fprintf(stderr, "calloc:\n"); x = (char*)calloc(size / 4, 4); } if (!strcmp(argv[1], "calloc-overflow")) { fprintf(stderr, "calloc-overflow:\n"); volatile size_t kMaxSizeT = std::numeric_limits::max(); size_t kArraySize = 4096; volatile size_t kArraySize2 = kMaxSizeT / kArraySize + 10; x = (char*)calloc(kArraySize, kArraySize2); } if (!strcmp(argv[1], "realloc")) { fprintf(stderr, "realloc:\n"); x = (char*)realloc(0, size); } if (!strcmp(argv[1], "realloc-after-malloc")) { fprintf(stderr, "realloc-after-malloc:\n"); char *t = (char*)malloc(100); *t = 42; x = (char*)realloc(t, size); assert(*t == 42); } fprintf(stderr, "x: %p\n", x); return x != 0; } // CHECK-mCRASH: malloc: // CHECK-mCRASH: ThreadSanitizer's allocator is terminating the process // CHECK-cCRASH: calloc: // CHECK-cCRASH: ThreadSanitizer's allocator is terminating the process // CHECK-coCRASH: calloc-overflow: // CHECK-coCRASH: ThreadSanitizer's allocator is terminating the process // CHECK-rCRASH: realloc: // CHECK-rCRASH: ThreadSanitizer's allocator is terminating the process // CHECK-mrCRASH: realloc-after-malloc: // CHECK-mrCRASH: ThreadSanitizer's allocator is terminating the process golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/libcxx/0000775000175000017500000000000013040224625024414 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/libcxx/lit.local.cfg0000664000175000017500000000025512334516370026766 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if not root.has_libcxx: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/libcxx/std_shared_ptr.cc0000664000175000017500000000076112334516370027742 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include int main() { int v1 = 0; int v2 = 0; std::thread t1; std::thread t2; { auto thingy = std::make_shared(42); t1 = std::thread([thingy, &v1] { v1 = *thingy; }); t2 = std::thread([thingy, &v2] { v2 = *thingy; }); } t1.join(); t2.join(); printf("%d %d\n", v1, v2); // CHECK-NOT: ThreadSanitizer: data race // CHECK: 42 42 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/global_race.cc0000664000175000017500000000117412627123307025674 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %T/global_race.cc.exe && %deflake %run %T/global_race.cc.exe | FileCheck %s #include "test.h" int GlobalData[10]; void *Thread(void *a) { barrier_wait(&barrier); GlobalData[2] = 42; return 0; } int main() { barrier_init(&barrier, 2); print_address("addr=", 1, GlobalData); pthread_t t; pthread_create(&t, 0, Thread, 0); GlobalData[2] = 43; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'GlobalData' {{(of size 40 )?}}at [[ADDR]] (global_race.cc.exe+0x{{[0-9,a-f]+}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_move_overlap.cc0000664000175000017500000000377112704157670027154 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // RUN: %run %t arg 2>&1 | FileCheck %s #include "java.h" jptr varaddr1_old; jptr varaddr2_old; jptr lockaddr1_old; jptr lockaddr2_old; jptr varaddr1_new; jptr varaddr2_new; jptr lockaddr1_new; jptr lockaddr2_new; void *Thread(void *p) { barrier_wait(&barrier); __tsan_java_mutex_lock(lockaddr1_new); *(char*)varaddr1_new = 43; __tsan_java_mutex_unlock(lockaddr1_new); __tsan_java_mutex_lock(lockaddr2_new); *(char*)varaddr2_new = 43; __tsan_java_mutex_unlock(lockaddr2_new); return 0; } int main(int argc, char **argv) { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; void *jheap = malloc(kHeapSize); jheap = (char*)jheap + 8; __tsan_java_init((jptr)jheap, kHeapSize); const int kBlockSize = 64; int const kMove = 32; varaddr1_old = (jptr)jheap; lockaddr1_old = (jptr)jheap + 1; varaddr2_old = (jptr)jheap + kBlockSize - 1; lockaddr2_old = (jptr)jheap + kBlockSize - 16; varaddr1_new = varaddr1_old + kMove; lockaddr1_new = lockaddr1_old + kMove; varaddr2_new = varaddr2_old + kMove; lockaddr2_new = lockaddr2_old + kMove; if (argc > 1) { // Move memory backwards. varaddr1_old += kMove; lockaddr1_old += kMove; varaddr2_old += kMove; lockaddr2_old += kMove; varaddr1_new -= kMove; lockaddr1_new -= kMove; varaddr2_new -= kMove; lockaddr2_new -= kMove; } __tsan_java_alloc(varaddr1_old, kBlockSize); pthread_t th; pthread_create(&th, 0, Thread, 0); __tsan_java_mutex_lock(lockaddr1_old); *(char*)varaddr1_old = 43; __tsan_java_mutex_unlock(lockaddr1_old); __tsan_java_mutex_lock(lockaddr2_old); *(char*)varaddr2_old = 43; __tsan_java_mutex_unlock(lockaddr2_old); __tsan_java_move(varaddr1_old, varaddr1_new, kBlockSize); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(varaddr1_new, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/test.h0000664000175000017500000000604712724267213024272 0ustar mwhudsonmwhudson#include #include #include #include #include #include #include #include #ifdef __APPLE__ #include #endif // TSan-invisible barrier. // Tests use it to establish necessary execution order in a way that does not // interfere with tsan (does not establish synchronization between threads). typedef unsigned long long invisible_barrier_t; #ifdef __cplusplus extern "C" { #endif void __tsan_testonly_barrier_init(invisible_barrier_t *barrier, unsigned count); void __tsan_testonly_barrier_wait(invisible_barrier_t *barrier); #ifdef __cplusplus } #endif static inline void barrier_init(invisible_barrier_t *barrier, unsigned count) { __tsan_testonly_barrier_init(barrier, count); } static inline void barrier_wait(invisible_barrier_t *barrier) { __tsan_testonly_barrier_wait(barrier); } // Default instance of the barrier, but a test can declare more manually. invisible_barrier_t barrier; void print_address(const char *str, int n, ...) { fprintf(stderr, "%s", str); va_list ap; va_start(ap, n); while (n--) { void *p = va_arg(ap, void *); #if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) // On FreeBSD, the %p conversion specifier works as 0x%x and thus does not // match to the format used in the diagnotic message. fprintf(stderr, "0x%012lx ", (unsigned long) p); #elif defined(__mips64) fprintf(stderr, "0x%010lx ", (unsigned long) p); #endif } fprintf(stderr, "\n"); } #ifdef __APPLE__ unsigned long long monotonic_clock_ns() { static mach_timebase_info_data_t timebase_info; if (timebase_info.denom == 0) mach_timebase_info(&timebase_info); return (mach_absolute_time() * timebase_info.numer) / timebase_info.denom; } #else unsigned long long monotonic_clock_ns() { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return (unsigned long long)t.tv_sec * 1000000000ull + t.tv_nsec; } #endif //The const kPCInc must be in sync with StackTrace::GetPreviousInstructionPc #if defined(__powerpc64__) // PCs are always 4 byte aligned. const int kPCInc = 4; #elif defined(__sparc__) || defined(__mips__) const int kPCInc = 8; #else const int kPCInc = 1; #endif #ifdef __cplusplus extern "C" { #endif void AnnotateRWLockCreate(const char *f, int l, void *m); void AnnotateRWLockCreateStatic(const char *f, int l, void *m); void AnnotateRWLockDestroy(const char *f, int l, void *m); void AnnotateRWLockAcquired(const char *f, int l, void *m, long is_w); void AnnotateRWLockReleased(const char *f, int l, void *m, long is_w); #ifdef __cplusplus } #endif #define ANNOTATE_RWLOCK_CREATE(m) \ AnnotateRWLockCreate(__FILE__, __LINE__, m) #define ANNOTATE_RWLOCK_CREATE_STATIC(m) \ AnnotateRWLockCreateStatic(__FILE__, __LINE__, m) #define ANNOTATE_RWLOCK_DESTROY(m) \ AnnotateRWLockDestroy(__FILE__, __LINE__, m) #define ANNOTATE_RWLOCK_ACQUIRED(m, is_w) \ AnnotateRWLockAcquired(__FILE__, __LINE__, m, is_w) #define ANNOTATE_RWLOCK_RELEASED(m, is_w) \ AnnotateRWLockReleased(__FILE__, __LINE__, m, is_w) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/static_init3.cc0000664000175000017500000000143512342110363026027 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include #include struct Cache { int x; }; Cache g_cache; Cache *CreateCache() { g_cache.x = rand(); return &g_cache; } _Atomic(Cache*) queue; void *Thread1(void *x) { static Cache *c = CreateCache(); __c11_atomic_store(&queue, c, 0); return 0; } void *Thread2(void *x) { Cache *c = 0; for (;;) { c = __c11_atomic_load(&queue, 0); if (c) break; sched_yield(); } if (c->x >= RAND_MAX) exit(1); return 0; } int main() { pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); pthread_create(&t[1], 0, Thread2, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Unit/0000775000175000017500000000000013040224625024042 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Unit/lit.site.cfg.in0000664000175000017500000000075012704361721026672 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Load common config for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured") # Setup config name. config.name = 'ThreadSanitizer-Unit' # Setup test source and exec root. For unit tests, we define # it as build directory with ASan unit tests. # FIXME: De-hardcode this path. config.test_exec_root = "@COMPILER_RT_BINARY_DIR@/lib/tsan/tests" config.test_source_root = config.test_exec_root golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_end_with_ignore2.cc0000664000175000017500000000054612342110363030211 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateIgnoreWritesBegin(const char *f, int l); int main() { AnnotateIgnoreWritesBegin("", 0); } // CHECK: ThreadSanitizer: main thread finished with ignores enabled // CHECK: Ignore was enabled at: // CHECK: #0 AnnotateIgnoreWritesBegin // CHECK: #1 main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_ten_mutexes.cc0000664000175000017500000000111512623335072027134 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" const int kMutex = 10; pthread_mutex_t mtx[kMutex]; void thread(int tid) { for (int i = 0; i < bench_niter; i++) { int idx = (i % kMutex); if (tid == 0) idx = kMutex - idx - 1; pthread_mutex_lock(&mtx[idx]); pthread_mutex_unlock(&mtx[idx]); } } void bench() { for (int i = 0; i < kMutex; i++) pthread_mutex_init(&mtx[i], 0); start_thread_group(2, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/memcmp_race.cc0000664000175000017500000000205512627123307025711 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include char *data0 = new char[10]; char *data1 = new char[10]; char *data2 = new char[10]; void *Thread1(void *x) { static volatile int size = 1; static volatile int sink; sink = memcmp(data0+5, data1, size); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { static volatile int size = 4; barrier_wait(&barrier); memcpy(data0+5, data2, size); return NULL; } int main() { barrier_init(&barrier, 2); print_address("addr=", 1, &data0[5]); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); return 0; } // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 1 at [[ADDR]] by thread T2: // CHECK: #0 {{(memcpy|memmove)}} // CHECK: #1 Thread2 // CHECK: Previous read of size 1 at [[ADDR]] by thread T1: // CHECK: #0 memcmp // CHECK: #1 Thread1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/tsan-vs-gvn.cc0000664000175000017500000000142512704157670025632 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_tsan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_tsan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s // // Check that load widening is not tsan-hostile. #include #include #include struct { int i; char c1, c2, c3, c4; } S; int G; void *Thread1(void *x) { G = S.c1 + S.c3; return NULL; } void *Thread2(void *x) { S.c2 = 1; return NULL; } int main() { pthread_t t[2]; memset(&S, 123, sizeof(S)); pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "PASS\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: PASS golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/pthread_atfork_deadlock.c0000664000175000017500000000140512627054444030124 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -lpthread -o %t && %deflake %run %t | FileCheck %s // Regression test for // https://github.com/google/sanitizers/issues/468 // When the data race was reported, pthread_atfork() handler used to be // executed which caused another race report in the same thread, which resulted // in a deadlock. #include "test.h" int glob = 0; void *worker(void *unused) { barrier_wait(&barrier); glob++; return NULL; } void atfork() { fprintf(stderr, "ATFORK\n"); glob++; } int main() { barrier_init(&barrier, 2); pthread_atfork(atfork, NULL, NULL); pthread_t t; pthread_create(&t, NULL, worker, NULL); glob++; barrier_wait(&barrier); pthread_join(t, NULL); // CHECK: ThreadSanitizer: data race // CHECK-NOT: ATFORK return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/vptr_harmful_race.cc0000664000175000017500000000151312457727212027150 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include struct A { A() { sem_init(&sem_, 0, 0); } virtual void F() { } void Done() { sem_post(&sem_); } virtual ~A() { sem_wait(&sem_); sem_destroy(&sem_); } sem_t sem_; }; struct B : A { virtual void F() { } virtual ~B() { } }; static A *obj = new B; void *Thread1(void *x) { obj->F(); obj->Done(); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); delete obj; return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race on vptr golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_read.cc0000664000175000017500000000164412457727212026053 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include #include #include #include int fd; char buf; void *Thread1(void *x) { barrier_wait(&barrier); read(fd, &buf, 1); return NULL; } void *Thread2(void *x) { read(fd, &buf, 1); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); fd = open("/dev/random", O_RDONLY); if (fd < 0) { fprintf(stderr, "failed to open /dev/random (%d)\n", errno); return 1; } pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); close(fd); fprintf(stderr, "DONE\n"); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 1 // CHECK: #0 read // CHECK: Previous write of size 1 // CHECK: #0 read // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_leak.c0000664000175000017500000000050612704157670025546 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include void *Thread(void *x) { return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); fprintf(stderr, "PASS\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: thread leak golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/free_race2.c0000664000175000017500000000112212342110363025255 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include void __attribute__((noinline)) foo(int *mem) { free(mem); } void __attribute__((noinline)) bar(int *mem) { mem[0] = 42; } int main() { int *mem = (int*)malloc(100); foo(mem); bar(mem); return 0; } // CHECK: WARNING: ThreadSanitizer: heap-use-after-free // CHECK: Write of size 4 at {{.*}} by main thread: // CHECK: #0 bar // CHECK: #1 main // CHECK: Previous write of size 8 at {{.*}} by main thread: // CHECK: #0 free // CHECK: #{{1|2}} foo // CHECK: #{{2|3}} main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/dlclose.cc0000664000175000017500000000202012631360261025053 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Test case for // https://github.com/google/sanitizers/issues/487 #ifdef BUILD_SO #include extern "C" void sofunc() { fprintf(stderr, "HELLO FROM SO\n"); } #else // BUILD_SO #include #include #include #include #include void *lib; void *lib2; struct Closer { ~Closer() { dlclose(lib); fprintf(stderr, "CLOSED SO\n"); } }; static Closer c; int main(int argc, char *argv[]) { lib = dlopen((std::string(argv[0]) + std::string("-so.so")).c_str(), RTLD_NOW|RTLD_NODELETE); if (lib == 0) { printf("error in dlopen: %s\n", dlerror()); return 1; } void *f = dlsym(lib, "sofunc"); if (f == 0) { printf("error in dlsym: %s\n", dlerror()); return 1; } ((void(*)())f)(); return 0; } #endif // BUILD_SO // CHECK: HELLO FROM SO // CHECK-NOT: Inconsistency detected by ld.so // CHECK: CLOSED SO golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/large_malloc_meta.cc0000664000175000017500000000202712542514715027072 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" #include // Test for previously unbounded memory consumption for large mallocs. // Code allocates a large memory block (that is handled by LargeMmapAllocator), // and forces allocation of meta shadow for the block. Then freed the block. // But meta shadow was not unmapped. Then code occupies the virtual memory // range of the block with something else (that does not need meta shadow). // And repeats. As the result meta shadow growed infinitely. // This program used to consume >2GB. Now it consumes <50MB. int main() { for (int i = 0; i < 1000; i++) { const int kSize = 1 << 20; const int kPageSize = 4 << 10; volatile int *p = new int[kSize]; for (int j = 0; j < kSize; j += kPageSize / sizeof(*p)) __atomic_store_n(&p[i], 1, __ATOMIC_RELEASE); delete[] p; mmap(0, kSize * sizeof(*p) + kPageSize, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); } fprintf(stderr, "DONE\n"); return 0; } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_sync.cc0000664000175000017500000000124712342110363025752 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include extern "C" void AnnotateIgnoreSyncBegin(const char*, int); extern "C" void AnnotateIgnoreSyncEnd(const char*, int); int Global; pthread_mutex_t Mutex = PTHREAD_MUTEX_INITIALIZER; void *Thread(void *x) { AnnotateIgnoreSyncBegin(0, 0); pthread_mutex_lock(&Mutex); Global++; pthread_mutex_unlock(&Mutex); AnnotateIgnoreSyncEnd(0, 0); return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_mutex_lock(&Mutex); Global++; pthread_mutex_unlock(&Mutex); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/load_shared_lib.cc0000664000175000017500000000324212631614547026541 0ustar mwhudsonmwhudson// Check that if the list of shared libraries changes between the two race // reports, the second report occurring in a new shared library is still // symbolized correctly. // RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so // RUN: %clangxx_tsan -O1 %s -o %t -rdynamic && %deflake %run %t | FileCheck %s #ifdef BUILD_SO #include "test.h" int GLOB_SHARED = 0; extern "C" void init_so() { barrier_init(&barrier, 2); } extern "C" void *write_from_so(void *unused) { if (unused == 0) barrier_wait(&barrier); GLOB_SHARED++; if (unused != 0) barrier_wait(&barrier); return NULL; } #else // BUILD_SO #include "test.h" #include #include int GLOB = 0; void *write_glob(void *unused) { if (unused == 0) barrier_wait(&barrier); GLOB++; if (unused != 0) barrier_wait(&barrier); return NULL; } void race_two_threads(void *(*access_callback)(void *unused)) { pthread_t t1, t2; pthread_create(&t1, NULL, access_callback, (void*)1); pthread_create(&t2, NULL, access_callback, NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); } int main(int argc, char *argv[]) { barrier_init(&barrier, 2); std::string path = std::string(argv[0]) + std::string("-so.so"); race_two_threads(write_glob); // CHECK: write_glob void *lib = dlopen(path.c_str(), RTLD_NOW); if (!lib) { printf("error in dlopen(): %s\n", dlerror()); return 1; } void (*init_so)(); *(void **)&init_so = dlsym(lib, "init_so"); init_so(); void *(*write_from_so)(void *unused); *(void **)&write_from_so = dlsym(lib, "write_from_so"); race_two_threads(write_from_so); // CHECK: write_from_so return 0; } #endif // BUILD_SO golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/malloc_stack.cc0000664000175000017500000000107512517531510026073 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" _Atomic(int*) p; void *thr(void *a) { barrier_wait(&barrier); int *pp = __c11_atomic_load(&p, __ATOMIC_RELAXED); *pp = 42; return 0; } int main() { barrier_init(&barrier, 2); pthread_t th; pthread_create(&th, 0, thr, p); __c11_atomic_store(&p, new int, __ATOMIC_RELAXED); barrier_wait(&barrier); pthread_join(th, 0); } // CHECK: data race // CHECK: Previous write // CHECK: #0 operator new // CHECK: Location is heap block // CHECK: #0 operator new golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/stack_sync_reuse.cc0000664000175000017500000000355312627054444027016 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" // Test case https://github.com/google/sanitizers/issues/494 // Tsan sees false HB edge on address pointed to by syncp variable. // It is false because when acquire is done syncp points to a var in one frame, // and during release it points to a var in a different frame. // The code is somewhat tricky because it prevents compiler from optimizing // our accesses away, structured to not introduce other data races and // not introduce other synchronization, and to arrange the vars in different // frames to occupy the same address. // The data race CHECK-NOT below actually must be CHECK, because the program // does contain the data race on global. // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE long global; long *syncp; long *addr; long sink; void *Thread(void *x) { while (__atomic_load_n(&syncp, __ATOMIC_ACQUIRE) == 0) usleep(1000); // spin wait global = 42; __atomic_store_n(syncp, 1, __ATOMIC_RELEASE); __atomic_store_n(&syncp, 0, __ATOMIC_RELAXED); return NULL; } void __attribute__((noinline)) foobar() { __attribute__((aligned(64))) long s; addr = &s; __atomic_store_n(&s, 0, __ATOMIC_RELAXED); __atomic_store_n(&syncp, &s, __ATOMIC_RELEASE); while (__atomic_load_n(&syncp, __ATOMIC_RELAXED) != 0) usleep(1000); // spin wait } void __attribute__((noinline)) barfoo() { __attribute__((aligned(64))) long s; if (addr != &s) { printf("address mismatch addr=%p &s=%p\n", addr, &s); exit(1); } __atomic_store_n(&addr, &s, __ATOMIC_RELAXED); __atomic_store_n(&s, 0, __ATOMIC_RELAXED); sink = __atomic_load_n(&s, __ATOMIC_ACQUIRE); global = 43; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); foobar(); barfoo(); pthread_join(t, 0); if (sink != 0) exit(1); fprintf(stderr, "DONE\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_name.cc0000664000175000017500000000212712457727212025716 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #if defined(__linux__) #define USE_PTHREAD_SETNAME_NP __GLIBC_PREREQ(2, 12) #elif defined(__FreeBSD__) #include #define USE_PTHREAD_SETNAME_NP 1 #define pthread_setname_np pthread_set_name_np #else #define USE_PTHREAD_SETNAME_NP 0 #endif extern "C" void AnnotateThreadName(const char *f, int l, const char *name); int Global; void *Thread1(void *x) { barrier_wait(&barrier); AnnotateThreadName(__FILE__, __LINE__, "Thread1"); Global++; return NULL; } void *Thread2(void *x) { #if USE_PTHREAD_SETNAME_NP pthread_setname_np(pthread_self(), "Thread2"); #else AnnotateThreadName(__FILE__, __LINE__, "Thread2"); #endif Global--; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Thread T1 'Thread1' // CHECK: Thread T2 'Thread2' golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_race.cc0000664000175000017500000000127412515153151025352 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "java.h" void *Thread(void *p) { barrier_wait(&barrier); *(int*)p = 42; return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); pthread_t th; pthread_create(&th, 0, Thread, (void*)jheap); *(int*)jheap = 43; barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_write.cc0000664000175000017500000000120412457727212026131 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include static void handler(int, siginfo_t*, void*) { const char *str = "HELLO FROM SIGNAL\n"; write(2, str, strlen(str)); } int main() { struct sigaction act = {}; act.sa_sigaction = &handler; sigaction(SIGPROF, &act, 0); kill(getpid(), SIGPROF); sleep(1); // let the signal handler run, can't use barrier in sig handler fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: HELLO FROM SIGNAL // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fork_atexit.cc0000664000175000017500000000132612767252671025774 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=50 %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include void foo() { fprintf(stderr, "CHILD ATEXIT\n"); } void *worker(void *unused) { return 0; } int main() { pthread_t t; pthread_create(&t, NULL, worker, NULL); int pid = fork(); if (pid == 0) { // child atexit(foo); fprintf(stderr, "CHILD DONE\n"); } else { pthread_join(t, 0); if (waitpid(pid, 0, 0) == -1) { perror("waitpid"); exit(1); } fprintf(stderr, "PARENT DONE\n"); } } // CHECK: CHILD DONE // CHECK: CHILD ATEXIT // CHECK: PARENT DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/dl_iterate_phdr.cc0000664000175000017500000000240412704157670026576 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // dl_iterate_phdr doesn't exist on OS X. // UNSUPPORTED: darwin #ifdef BUILD_SO #include "test.h" int exported_var = 0; #else // BUILD_SO #include "test.h" #include #include #include #include static int callback(struct dl_phdr_info *info, size_t size, void *data) { if (info->dlpi_name[0] == '\0') info->dlpi_name = "/proc/self/exe"; return !strcmp(info->dlpi_name, "non existent module"); } void *thread(void *unused) { for (int i = 0; i < 1000; i++) { barrier_wait(&barrier); dl_iterate_phdr(callback, 0); } return 0; } int main(int argc, char *argv[]) { barrier_init(&barrier, 2); std::string path = std::string(argv[0]) + std::string("-so.so"); pthread_t th; pthread_create(&th, 0, thread, 0); for (int i = 0; i < 1000; i++) { barrier_wait(&barrier); void *lib = dlopen(path.c_str(), RTLD_NOW); if (!lib) { printf("error in dlopen: %s\n", dlerror()); return 1; } dlclose(lib); } pthread_join(th, 0); fprintf(stderr, "DONE\n"); return 0; } #endif // BUILD_SO // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_block.cc0000664000175000017500000000260012746143155026071 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Test that a signal is not delivered when it is blocked. #include "test.h" #include #include #include int stop; sig_atomic_t signal_blocked; void handler(int signum) { if (signal_blocked) { fprintf(stderr, "signal arrived when blocked\n"); exit(1); } } void *thread(void *arg) { sigset_t myset; sigemptyset(&myset); sigaddset(&myset, SIGUSR1); while (!__atomic_load_n(&stop, __ATOMIC_RELAXED)) { usleep(1); if (pthread_sigmask(SIG_BLOCK, &myset, 0)) { fprintf(stderr, "pthread_sigmask failed %d\n", errno); exit(1); } signal_blocked = 1; usleep(1); signal_blocked = 0; if (pthread_sigmask(SIG_UNBLOCK, &myset, 0)) { fprintf(stderr, "pthread_sigmask failed %d\n", errno); exit(1); } } return 0; } int main(int argc, char** argv) { struct sigaction act = {}; act.sa_handler = &handler; if (sigaction(SIGUSR1, &act, 0)) { fprintf(stderr, "sigaction failed %d\n", errno); return 1; } pthread_t th; pthread_create(&th, 0, thread, 0); for (int i = 0; i < 100000; i++) pthread_kill(th, SIGUSR1); __atomic_store_n(&stop, 1, __ATOMIC_RELAXED); pthread_join(th, 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: ThreadSanitizer CHECK // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/static_init1.cc0000664000175000017500000000101612704157670026036 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include struct P { int x; int y; }; void *Thread(void *x) { static P p = {rand(), rand()}; if (p.x > RAND_MAX || p.y > RAND_MAX) exit(1); return 0; } int main() { pthread_t t[2]; pthread_create(&t[0], 0, Thread, 0); pthread_create(&t[1], 0, Thread, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); fprintf(stderr, "PASS\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/vptr_harmful_race2.cc0000664000175000017500000000151312457727212027232 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include struct A { A() { sem_init(&sem_, 0, 0); } virtual void F() { } void Done() { sem_post(&sem_); } virtual ~A() { sem_wait(&sem_); sem_destroy(&sem_); } sem_t sem_; }; struct B : A { virtual void F() { } virtual ~B() { } }; static A *obj = new B; void *Thread1(void *x) { obj->F(); barrier_wait(&barrier); obj->Done(); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); delete obj; return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race on vptr golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib0.cc.supp0000664000175000017500000000004412223271415026610 0ustar mwhudsonmwhudsoncalled_from_lib:/libignore_lib0.so golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_puts.cc0000664000175000017500000000106012457727212026123 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" char s[] = "abracadabra"; void *Thread0(void *p) { puts(s); barrier_wait(&barrier); return 0; } void *Thread1(void *p) { barrier_wait(&barrier); s[3] = 'z'; return 0; } int main() { barrier_init(&barrier, 2); pthread_t th[2]; pthread_create(&th[0], 0, Thread0, 0); pthread_create(&th[1], 0, Thread1, 0); pthread_join(th[0], 0); pthread_join(th[1], 0); fprintf(stderr, "DONE"); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_recursive.cc0000664000175000017500000000624212627054444027014 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Test case for recursive signal handlers, adopted from: // https://github.com/google/sanitizers/issues/478 // REQUIRES: disabled #include "test.h" #include #include #include static const int kSigSuspend = SIGUSR1; static const int kSigRestart = SIGUSR2; static sem_t g_thread_suspend_ack_sem; static bool g_busy_thread_received_restart; static volatile bool g_busy_thread_garbage_collected; static void SaveRegistersInStack() { // Mono walks thread stacks to detect unreferenced objects. // If last object reference is kept in register the object will be collected // This is why threads can't be suspended with something like pthread_suspend } static void fail(const char *what) { fprintf(stderr, "FAILED: %s (errno=%d)\n", what, errno); exit(1); } static void SuspendHandler(int sig) { int old_errno = errno; SaveRegistersInStack(); // Enable kSigRestart handling, tsan disables signals around signal handlers. sigset_t sigset; sigemptyset(&sigset); pthread_sigmask(SIG_SETMASK, &sigset, 0); // Acknowledge that thread is saved and suspended if (sem_post(&g_thread_suspend_ack_sem) != 0) fail("sem_post failed"); // Wait for wakeup signal. while (!g_busy_thread_received_restart) usleep(100); // wait for kSigRestart signal // Acknowledge that thread restarted if (sem_post(&g_thread_suspend_ack_sem) != 0) fail("sem_post failed"); g_busy_thread_garbage_collected = true; errno = old_errno; } static void RestartHandler(int sig) { g_busy_thread_received_restart = true; } static void StopWorld(pthread_t thread) { if (pthread_kill(thread, kSigSuspend) != 0) fail("pthread_kill failed"); while (sem_wait(&g_thread_suspend_ack_sem) != 0) { if (errno != EINTR) fail("sem_wait failed"); } } static void StartWorld(pthread_t thread) { if (pthread_kill(thread, kSigRestart) != 0) fail("pthread_kill failed"); while (sem_wait(&g_thread_suspend_ack_sem) != 0) { if (errno != EINTR) fail("sem_wait failed"); } } static void CollectGarbage(pthread_t thread) { StopWorld(thread); // Walk stacks StartWorld(thread); } static void Init() { if (sem_init(&g_thread_suspend_ack_sem, 0, 0) != 0) fail("sem_init failed"); struct sigaction act = {}; act.sa_flags = SA_RESTART; act.sa_handler = &SuspendHandler; if (sigaction(kSigSuspend, &act, NULL) != 0) fail("sigaction failed"); act.sa_handler = &RestartHandler; if (sigaction(kSigRestart, &act, NULL) != 0) fail("sigaction failed"); } void* BusyThread(void *arg) { (void)arg; while (!g_busy_thread_garbage_collected) { usleep(100); // Tsan deadlocks without these sleeps } return NULL; } int main(int argc, const char *argv[]) { Init(); pthread_t busy_thread; if (pthread_create(&busy_thread, NULL, &BusyThread, NULL) != 0) fail("pthread_create failed"); CollectGarbage(busy_thread); if (pthread_join(busy_thread, 0) != 0) fail("pthread_join failed"); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: FAILED // CHECK-NOT: ThreadSanitizer CHECK failed // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/lots_of_threads.c0000664000175000017500000000137612714341726026466 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" void *thr(void *arg) { // Create a sync object on stack, so there is something to free on thread end. volatile int x; __atomic_fetch_add(&x, 1, __ATOMIC_SEQ_CST); barrier_wait(&barrier); return 0; } int main() { const int kThreads = 10; barrier_init(&barrier, kThreads + 1); pthread_t t[kThreads]; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 16 << 20); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); for (int i = 0; i < kThreads; i++) pthread_create(&t[i], &attr, thr, 0); pthread_attr_destroy(&attr); barrier_wait(&barrier); sleep(1); fprintf(stderr, "DONE\n"); return 0; } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/deflake.bash0000775000175000017500000000064312342110363025360 0ustar mwhudsonmwhudson#!/usr/bin/env bash # This script is used to deflake inherently flaky tsan tests. # It is invoked from lit tests as: # %deflake mybinary # which is then substituted by lit to: # $(dirname %s)/deflake.bash mybinary # The script runs the target program up to 10 times, # until it fails (i.e. produces a race report). for i in $(seq 1 10); do OUT=`$@ 2>&1` if [[ $? != 0 ]]; then echo "$OUT" exit 0 fi done exit 1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/cond_destruction.cc0000664000175000017500000000255112544550221027005 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // RUN: %run %t arg 2>&1 | FileCheck %s // RUN: %run %t arg arg 2>&1 | FileCheck %s #include "test.h" // Test for destruction of pthread_cond_t. // POSIX states that it is safe to destroy a condition variable upon which no // threads are currently blocked. That is, it is not necessary to wait untill // other threads return from pthread_cond_wait, they just need to be unblocked. pthread_mutex_t m; pthread_cond_t c; bool done1, done2; void *thr(void *p) { pthread_mutex_lock(&m); done1 = true; pthread_cond_signal(&c); while (!done2) pthread_cond_wait(&c, &m); pthread_mutex_unlock(&m); return 0; } int main(int argc, char **argv) { pthread_t th; pthread_mutex_init(&m, 0); pthread_cond_init(&c, 0); pthread_create(&th, 0, thr, 0); pthread_mutex_lock(&m); while (!done1) pthread_cond_wait(&c, &m); done2 = true; // Any of these sequences is legal. if (argc == 1) { pthread_cond_signal(&c); pthread_mutex_unlock(&m); pthread_cond_destroy(&c); } else if (argc == 2) { pthread_mutex_unlock(&m); pthread_cond_signal(&c); pthread_cond_destroy(&c); } else { pthread_cond_signal(&c); pthread_cond_destroy(&c); pthread_mutex_unlock(&m); } pthread_join(th, 0); fprintf(stderr, "DONE\n"); } // CHECK-NOT: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_mutex2.c0000664000175000017500000000102712457727212026214 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread(void *x) { pthread_mutex_lock((pthread_mutex_t*)x); pthread_mutex_unlock((pthread_mutex_t*)x); barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_mutex_t Mtx; pthread_mutex_init(&Mtx, 0); pthread_t t; pthread_create(&t, 0, Thread, &Mtx); barrier_wait(&barrier); pthread_mutex_destroy(&Mtx); pthread_join(t, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mmap_large.cc0000664000175000017500000000156312631650637025556 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #if defined(__FreeBSD__) // The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before // that, it was never implemented. So just define it to zero. #undef MAP_NORESERVE #define MAP_NORESERVE 0 #endif int main() { #ifdef __x86_64__ const size_t kLog2Size = 39; #elif defined(__mips64) || defined(__aarch64__) const size_t kLog2Size = 32; #elif defined(__powerpc64__) const size_t kLog2Size = 39; #endif const uintptr_t kLocation = 0x40ULL << kLog2Size; void *p = mmap( reinterpret_cast(kLocation), 1ULL << kLog2Size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON|MAP_NORESERVE, -1, 0); fprintf(stderr, "DONE %p %d\n", p, errno); return p == MAP_FAILED; } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_leak3.c0000664000175000017500000000067712457727212025642 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread(void *x) { barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); sleep(1); // wait for the thread to finish and exit return 0; } // CHECK: WARNING: ThreadSanitizer: thread leak // CHECK: SUMMARY: ThreadSanitizer: thread leak{{.*}}main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/aligned_vs_unaligned_race.cc0000664000175000017500000000157712704157670030612 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s // Race between an aligned access and an unaligned access, which // touches the same memory region. #include "test.h" #include uint64_t Global[2]; void *Thread1(void *x) { Global[1]++; barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); char *p1 = reinterpret_cast(&Global[0]); struct __attribute__((packed, aligned(1))) u_uint64_t { uint64_t val; }; u_uint64_t *p4 = reinterpret_cast(p1 + 1); (*p4).val++; return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "Pass\n"); // CHECK: ThreadSanitizer: data race // CHECK: Pass return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/simple_race.c0000664000175000017500000000103212457727212025561 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { barrier_wait(&barrier); Global = 42; return NULL; } void *Thread2(void *x) { Global = 43; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); return 0; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/vptr_harmful_race4.cc0000664000175000017500000000102612457727212027233 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" struct A { virtual void F() { } virtual ~A() { } }; struct B : A { virtual void F() { } }; void *Thread(void *x) { barrier_wait(&barrier); ((A*)x)->F(); return 0; } int main() { barrier_init(&barrier, 2); A *obj = new B; pthread_t t; pthread_create(&t, 0, Thread, obj); delete obj; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: heap-use-after-free (virtual call vs free) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_stdout_race.cc0000664000175000017500000000145212457727212026434 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include #include #include int X; void *Thread1(void *x) { barrier_wait(&barrier); int f = open("/dev/random", O_RDONLY); char buf; read(f, &buf, 1); close(f); X = 42; return NULL; } void *Thread2(void *x) { X = 43; write(STDOUT_FILENO, "a", 1); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 // CHECK: #0 Thread1 // CHECK: Previous write of size 4 // CHECK: #0 Thread2 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/static_init6.cc0000664000175000017500000000147412704157670026053 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -stdlib=libstdc++ -static-libstdc++ -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include struct Cache { int x; explicit Cache(int x) : x(x) { } }; void *AsyncInit(void *p) { return new Cache((int)(long)p); } Cache *CreateCache() { pthread_t t; pthread_create(&t, 0, AsyncInit, (void*)(long)rand()); void *res; pthread_join(t, &res); return (Cache*)res; } void *Thread1(void *x) { static Cache *c = CreateCache(); if (c->x >= RAND_MAX) exit(1); return 0; } int main() { pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); pthread_create(&t[1], 0, Thread1, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); fprintf(stderr, "PASS\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset8.cc0000664000175000017500000000177312621444670025420 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t *mtx; void *Thread1(void *x) { barrier_wait(&barrier); pthread_mutex_lock(mtx); Global++; pthread_mutex_unlock(mtx); return NULL; } void *Thread2(void *x) { Global--; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]]): // CHECK: Previous write of size 4 at {{.*}} by thread T2: // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset8.cc mtx = new pthread_mutex_t; pthread_mutex_init(mtx, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(mtx); delete mtx; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_finalizer.cc0000664000175000017500000000132612457727212026433 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" void *Thread(void *p) { barrier_wait(&barrier); __tsan_java_finalize(); *(int*)p = 42; return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); pthread_t th; pthread_create(&th, 0, Thread, (void*)jheap); *(int*)jheap = 43; barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_heap.cc0000664000175000017500000000204712627123307026045 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include #include "test.h" void *Thread1(void *p) { *(int*)p = 42; return 0; } void *Thread2(void *p) { *(int*)p = 44; return 0; } void *alloc() { return malloc(99); } void *AllocThread(void* arg) { return alloc(); } int main() { void *p = 0; pthread_t t[2]; pthread_create(&t[0], 0, AllocThread, 0); pthread_join(t[0], &p); print_address("addr=", 1, p); pthread_create(&t[0], 0, Thread1, (char*)p + 16); pthread_create(&t[1], 0, Thread2, (char*)p + 16); pthread_join(t[0], 0); pthread_join(t[1], 0); return 0; } // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // ... // CHECK: Location is heap block of size 99 at [[ADDR]] allocated by thread T1: // CHCEK: #0 malloc // CHECK: #{{1|2}} alloc // CHECK: #{{2|3}} AllocThread // ... // CHECK: Thread T1 (tid={{.*}}, finished) created by main thread at: // CHECK: #0 pthread_create // CHECK: #1 main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/free_race.c.supp0000664000175000017500000000010112200437744026165 0ustar mwhudsonmwhudson# Suppression for a use-after-free in free_race.c race:^Thread2$ golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/heap_race.cc0000664000175000017500000000073512525202440025344 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include #include #include void *Thread(void *a) { ((int*)a)[0]++; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); int *p = new int(42); pthread_t t; pthread_create(&t, NULL, Thread, p); barrier_wait(&barrier); p[0]++; pthread_join(t, NULL); delete p; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_socketpair_norace.cc0000664000175000017500000000131512704157670027611 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include int fds[2]; int X; void *Thread1(void *x) { X = 42; write(fds[1], "a", 1); close(fds[1]); return NULL; } void *Thread2(void *x) { char buf; while (read(fds[0], &buf, 1) != 1) { } X = 43; close(fds[0]); return NULL; } int main() { socketpair(AF_UNIX, SOCK_STREAM, 0, fds); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_socket_norace.cc0000664000175000017500000000216212704157670026736 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include struct sockaddr_in addr; int X; void *ClientThread(void *x) { X = 42; int c = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connect(c, (struct sockaddr*)&addr, sizeof(addr))) { perror("connect"); exit(1); } if (send(c, "a", 1, 0) != 1) { perror("send"); exit(1); } close(c); return NULL; } int main() { int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); addr.sin_family = AF_INET; inet_pton(AF_INET, "127.0.0.1", &addr.sin_addr); addr.sin_port = INADDR_ANY; socklen_t len = sizeof(addr); bind(s, (sockaddr*)&addr, len); getsockname(s, (sockaddr*)&addr, &len); listen(s, 10); pthread_t t; pthread_create(&t, 0, ClientThread, 0); int c = accept(s, 0, 0); char buf; while (read(c, &buf, 1) != 1) { } X = 43; close(c); close(s); pthread_join(t, 0); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_single_writer.cc0000664000175000017500000000076612623335072027464 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" int x; void thread(int tid) { if (tid == 0) { for (int i = 0; i < bench_niter; i++) __atomic_store_n(&x, 0, __ATOMIC_RELEASE); } else { for (int i = 0; i < bench_niter; i++) __atomic_load_n(&x, __ATOMIC_ACQUIRE); } } void bench() { start_thread_group(bench_nthread, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset5.cc0000664000175000017500000000252312621444670025407 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t mtx1; pthread_mutex_t mtx2; void *Thread1(void *x) { barrier_wait(&barrier); pthread_mutex_lock(&mtx1); Global++; pthread_mutex_unlock(&mtx1); return NULL; } void *Thread2(void *x) { pthread_mutex_lock(&mtx2); Global--; pthread_mutex_unlock(&mtx2); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]]): // CHECK: Previous write of size 4 at {{.*}} by thread T2 // CHECK: (mutexes: write [[M2:M[0-9]+]]): // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset5.cc:[[@LINE+4]] // CHECK: Mutex [[M2]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset5.cc:[[@LINE+5]] pthread_mutex_init(&mtx1, 0); pthread_mutex_init(&mtx2, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&mtx1); pthread_mutex_destroy(&mtx2); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_free.cc0000664000175000017500000000153712517531510025726 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" extern "C" { void AnnotateIgnoreReadsBegin(const char *f, int l); void AnnotateIgnoreReadsEnd(const char *f, int l); void AnnotateIgnoreWritesBegin(const char *f, int l); void AnnotateIgnoreWritesEnd(const char *f, int l); } void *Thread(void *p) { *(int*)p = 42; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); int *p = new int(0); pthread_t t; pthread_create(&t, 0, Thread, p); barrier_wait(&barrier); AnnotateIgnoreReadsBegin(__FILE__, __LINE__); AnnotateIgnoreWritesBegin(__FILE__, __LINE__); free(p); AnnotateIgnoreReadsEnd(__FILE__, __LINE__); AnnotateIgnoreWritesEnd(__FILE__, __LINE__); pthread_join(t, 0); fprintf(stderr, "OK\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/static_init2.cc0000664000175000017500000000114512704157670026042 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include struct Cache { int x; explicit Cache(int x) : x(x) { } }; void foo(Cache *my) { static Cache *c = my ? my : new Cache(rand()); if (c->x >= RAND_MAX) exit(1); } void *Thread(void *x) { foo(new Cache(rand())); return 0; } int main() { pthread_t t[2]; pthread_create(&t[0], 0, Thread, 0); pthread_create(&t[1], 0, Thread, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); fprintf(stderr, "PASS\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppressions_race2.cc.supp0000664000175000017500000000001612155371460030254 0ustar mwhudsonmwhudsonrace:Thread2 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_alloc.cc0000664000175000017500000000162212704157670025541 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" int const kHeapSize = 1024 * 1024; void stress(jptr addr) { for (jptr sz = 8; sz <= 32; sz <<= 1) { for (jptr i = 0; i < kHeapSize / 4 / sz; i++) { __tsan_java_alloc(addr + i * sz, sz); } __tsan_java_move(addr, addr + kHeapSize / 2, kHeapSize / 4); __tsan_java_free(addr + kHeapSize / 2, kHeapSize / 4); } } void *Thread(void *p) { stress((jptr)p); return 0; } int main() { jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); pthread_t th; pthread_create(&th, 0, Thread, (void*)(jheap + kHeapSize / 4)); stress(jheap); pthread_join(th, 0); if (__tsan_java_fini() != 0) { fprintf(stderr, "FAILED\n"); return 1; } fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK-NOT: FAILED // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/CMakeLists.txt0000664000175000017500000000364412741012374025675 0ustar mwhudsonmwhudsonset(TSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "x86_64") list(APPEND TSAN_TEST_DEPS GotsanRuntimeCheck) endif() if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TSAN_TEST_DEPS tsan) endif() if(COMPILER_RT_HAS_LIBCXX_SOURCES AND COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang" AND NOT APPLE) list(APPEND TSAN_TEST_DEPS libcxx_tsan) set(TSAN_HAS_LIBCXX True) else() set(TSAN_HAS_LIBCXX False) endif() set(TSAN_TESTSUITES) set(TSAN_TEST_ARCH ${TSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(TSAN_SUPPORTED_ARCH TSAN_TEST_ARCH) endif() foreach(arch ${TSAN_TEST_ARCH}) set(TSAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX) if(ANDROID OR ${arch} MATCHES "arm|aarch64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) set(TSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} TSAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " TSAN_TEST_TARGET_CFLAGS "${TSAN_TEST_TARGET_CFLAGS}") endif() string(TOUPPER ${arch} ARCH_UPPER_CASE) set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) list(APPEND TSAN_TEST_DEPS TsanUnitTests) list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) endif() add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" ${TSAN_TESTSUITES} DEPENDS ${TSAN_TEST_DEPS}) set_target_properties(check-tsan PROPERTIES FOLDER "Compiler-RT Tests") golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/getline_nohang.cc0000664000175000017500000000166512627054444026435 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t // Make sure TSan doesn't deadlock on a file stream lock at program shutdown. // See https://github.com/google/sanitizers/issues/454 #ifdef __FreeBSD__ #define _WITH_GETLINE // to declare getline() #endif #include #include #include void *thread(void *unused) { char *line = NULL; size_t size; int fd[2]; pipe(fd); // Forge a non-standard stream to make sure it's not closed. FILE *stream = fdopen(fd[0], "r"); while (1) { volatile int res = getline(&line, &size, stream); (void)res; } return NULL; } int main() { pthread_t t; pthread_attr_t a; pthread_attr_init(&a); pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED); pthread_create(&t, &a, thread, NULL); pthread_attr_destroy(&a); fprintf(stderr, "DONE\n"); return 0; // ThreadSanitizer used to hang here because of a deadlock on a file stream. } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppress_same_address.cc0000664000175000017500000000073612457727212030051 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" volatile int X; void *Thread1(void *x) { barrier_wait(&barrier); X = 42; X = 66; X = 78; return 0; } void *Thread2(void *x) { X = 11; X = 99; X = 73; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread1, 0); Thread2(0); pthread_join(t, 0); } // CHECK: ThreadSanitizer: reported 1 warnings golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_tid_recycled.cc0000664000175000017500000000216712626270362026553 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int fds[2]; void *ThreadCreatePipe(void *x) { pipe(fds); return NULL; } void *ThreadDummy(void *x) { return NULL; } void *ThreadWrite(void *x) { write(fds[1], "a", 1); barrier_wait(&barrier); return NULL; } void *ThreadClose(void *x) { barrier_wait(&barrier); close(fds[0]); close(fds[1]); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t_create; pthread_create(&t_create, NULL, ThreadCreatePipe, NULL); pthread_join(t_create, NULL); for (int i = 0; i < 100; i++) { pthread_t t_dummy; pthread_create(&t_dummy, NULL, ThreadDummy, NULL); pthread_join(t_dummy, NULL); } pthread_t t[2]; pthread_create(&t[0], NULL, ThreadWrite, NULL); pthread_create(&t[1], NULL, ThreadClose, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK-NOT: CHECK failed // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 8 // CHECK: #0 close // CHECK: #1 ThreadClose // CHECK: Previous read of size 8 // CHECK: #0 write // CHECK: #1 ThreadWrite golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_sync.cc0000664000175000017500000000206712617405322025754 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // UNSUPPORTED: darwin #include "test.h" #include #include #include #include volatile int X; static void handler(int sig) { (void)sig; if (X != 42) printf("bad"); } static void* thr(void *p) { for (int i = 0; i != 1000; i++) usleep(1000); // process signals return 0; } int main() { const int kThreads = 10; pthread_t th[kThreads]; for (int i = 0; i < kThreads; i++) pthread_create(&th[i], 0, thr, 0); X = 42; struct sigaction act = {}; act.sa_handler = &handler; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); exit(1); } itimerval t; t.it_value.tv_sec = 0; t.it_value.tv_usec = 10; t.it_interval = t.it_value; if (setitimer(ITIMER_PROF, &t, 0)) { perror("setitimer"); exit(1); } for (int i = 0; i < kThreads; i++) pthread_join(th[i], 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE // CHECK-NOT: WARNING: ThreadSanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fork_deadlock.cc0000664000175000017500000000142312701447064026230 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=50 %run %t 2>&1 | FileCheck %s #include "test.h" #include #include #include int counter; static void *incrementer(void *p) { for (;;) __sync_fetch_and_add(&counter, 1); return 0; } int main() { barrier_init(&barrier, 2); pthread_t th1; pthread_create(&th1, 0, incrementer, 0); for (int i = 0; i < 10; i++) { switch (fork()) { default: // parent while (wait(0) < 0) {} fprintf(stderr, "."); break; case 0: // child __sync_fetch_and_add(&counter, 1); exit(0); break; case -1: // error fprintf(stderr, "failed to fork (%d)\n", errno); exit(1); } } fprintf(stderr, "OK\n"); } // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/default_options.cc0000664000175000017500000000113112330266131026624 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include extern "C" const char *__tsan_default_options() { return "report_bugs=0"; } int Global; void *Thread1(void *x) { Global = 42; return NULL; } void *Thread2(void *x) { Global = 43; return NULL; } int main() { pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib2.cc.supp0000664000175000017500000000003512223271415026612 0ustar mwhudsonmwhudsoncalled_from_lib:ignore_lib2 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_detach2.c0000664000175000017500000000116612704157670026147 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" // Test for https://llvm.org/bugs/show_bug.cgi?id=23235 // The bug was that synchronization between thread creation and thread start // is not established if pthread_create is followed by pthread_detach. int x; void *Thread(void *a) { x = 42; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; x = 43; pthread_create(&t, 0, Thread, 0); pthread_detach(t); barrier_wait(&barrier); fprintf(stderr, "PASS\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: PASS golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/simple_race.cc0000664000175000017500000000112412457727212025726 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { barrier_wait(&barrier); Global++; return NULL; } void *Thread2(void *x) { Global--; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: SUMMARY: ThreadSanitizer: data race{{.*}}Thread golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/vptr_harmful_race3.cc0000664000175000017500000000156012457727212027235 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include struct A { A() { sem_init(&sem_, 0, 0); } virtual void F() { } void Done() { sem_post(&sem_); } virtual ~A() { sem_wait(&sem_); sem_destroy(&sem_); } sem_t sem_; }; struct B : A { virtual void F() { } virtual ~B() { } }; static A *obj = new B; static void (A::*fn)() = &A::F; void *Thread1(void *x) { (obj->*fn)(); barrier_wait(&barrier); obj->Done(); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); delete obj; return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race on vptr golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atexit2.cc0000664000175000017500000000065212406151002025006 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include int n; const int N = 10000; static void atexit1() { n++; } static void atexit0() { fprintf(stderr, "run count: %d\n", n); } int main() { atexit(atexit0); for (int i = 0; i < N; i++) atexit(atexit1); } // CHECK-NOT: FATAL: ThreadSanitizer // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: run count: 10000 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/cond_version.c0000664000175000017500000000234212623577344025777 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t -lrt && %run %t 2>&1 | FileCheck %s // Test that pthread_cond is properly intercepted, // previously there were issues with versioned symbols. // CHECK: OK // OS X doesn't have pthread_condattr_setclock. // UNSUPPORTED: darwin #include #include #include #include #include int main() { typedef unsigned long long u64; pthread_mutex_t m; pthread_cond_t c; pthread_condattr_t at; struct timespec ts0, ts1, ts2; int res; u64 sleep; pthread_mutex_init(&m, 0); pthread_condattr_init(&at); pthread_condattr_setclock(&at, CLOCK_MONOTONIC); pthread_cond_init(&c, &at); clock_gettime(CLOCK_MONOTONIC, &ts0); ts1 = ts0; ts1.tv_sec += 2; pthread_mutex_lock(&m); do { res = pthread_cond_timedwait(&c, &m, &ts1); } while (res == 0); pthread_mutex_unlock(&m); clock_gettime(CLOCK_MONOTONIC, &ts2); sleep = (u64)ts2.tv_sec * 1000000000 + ts2.tv_nsec - ((u64)ts0.tv_sec * 1000000000 + ts0.tv_nsec); if (res != ETIMEDOUT) exit(printf("bad return value %d, want %d\n", res, ETIMEDOUT)); if (sleep < 1000000000) exit(printf("bad sleep duration %lluns, want %dns\n", sleep, 1000000000)); fprintf(stderr, "OK\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_speculative_load.cc0000664000175000017500000000121312704157670030453 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Regtest for https://github.com/google/sanitizers/issues/447 // This is a correct program and tsan should not report a race. #include "test.h" int g; __attribute__((noinline)) int foo(int cond) { if (cond) return g; return 0; } void *Thread1(void *p) { barrier_wait(&barrier); long res = foo((long)p); return (void*) res; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread1, 0); g = 1; barrier_wait(&barrier); pthread_join(t, 0); fprintf(stderr, "PASS\n"); // CHECK-NOT: ThreadSanitizer: data race // CHECK: PASS } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/real_deadlock_detector_stress_test.cc0000664000175000017500000001222212623577344032554 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include #include const int kThreads = 4; const int kMutexes = 16 << 10; const int kIters = 400 << 10; const int kMaxPerThread = 10; const int kStateInited = 0; const int kStateNotInited = -1; const int kStateLocked = -2; struct Mutex { int state; pthread_rwlock_t m; }; Mutex mtx[kMutexes]; void check(int res) { if (res != 0) { printf("SOMETHING HAS FAILED\n"); exit(1); } } bool cas(int *a, int oldval, int newval) { return __atomic_compare_exchange_n(a, &oldval, newval, false, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED); } void *Thread(void *seed) { unsigned rnd = (unsigned)(unsigned long)seed; int err; std::vector locked; for (int i = 0; i < kIters; i++) { int what = rand_r(&rnd) % 10; if (what < 4 && locked.size() < kMaxPerThread) { // lock int max_locked = -1; if (!locked.empty()) { max_locked = *std::max_element(locked.begin(), locked.end()); if (max_locked == kMutexes - 1) { i--; continue; } } int id = (rand_r(&rnd) % (kMutexes - max_locked - 1)) + max_locked + 1; Mutex *m = &mtx[id]; // init the mutex if necessary or acquire a reference for (;;) { int old = __atomic_load_n(&m->state, __ATOMIC_RELAXED); if (old == kStateLocked) { sched_yield(); continue; } int newv = old + 1; if (old == kStateNotInited) newv = kStateLocked; if (cas(&m->state, old, newv)) { if (old == kStateNotInited) { if ((err = pthread_rwlock_init(&m->m, 0))) { fprintf(stderr, "pthread_rwlock_init failed with %d\n", err); exit(1); } if (!cas(&m->state, kStateLocked, 1)) { fprintf(stderr, "init commit failed\n"); exit(1); } } break; } } // now we have an inited and referenced mutex, choose what to do bool failed = false; switch (rand_r(&rnd) % 4) { case 0: if ((err = pthread_rwlock_wrlock(&m->m))) { fprintf(stderr, "pthread_rwlock_wrlock failed with %d\n", err); exit(1); } break; case 1: if ((err = pthread_rwlock_rdlock(&m->m))) { fprintf(stderr, "pthread_rwlock_rdlock failed with %d\n", err); exit(1); } break; case 2: err = pthread_rwlock_trywrlock(&m->m); if (err != 0 && err != EBUSY) { fprintf(stderr, "pthread_rwlock_trywrlock failed with %d\n", err); exit(1); } failed = err == EBUSY; break; case 3: err = pthread_rwlock_tryrdlock(&m->m); if (err != 0 && err != EBUSY) { fprintf(stderr, "pthread_rwlock_tryrdlock failed with %d\n", err); exit(1); } failed = err == EBUSY; break; } if (failed) { if (__atomic_fetch_sub(&m->state, 1, __ATOMIC_ACQ_REL) <= 0) { fprintf(stderr, "failed to unref after failed trylock\n"); exit(1); } continue; } locked.push_back(id); } else if (what < 9 && !locked.empty()) { // unlock int pos = rand_r(&rnd) % locked.size(); int id = locked[pos]; locked[pos] = locked[locked.size() - 1]; locked.pop_back(); Mutex *m = &mtx[id]; if ((err = pthread_rwlock_unlock(&m->m))) { fprintf(stderr, "pthread_rwlock_unlock failed with %d\n", err); exit(1); } if (__atomic_fetch_sub(&m->state, 1, __ATOMIC_ACQ_REL) <= 0) { fprintf(stderr, "failed to unref after unlock\n"); exit(1); } } else { // Destroy a random mutex. int id = rand_r(&rnd) % kMutexes; Mutex *m = &mtx[id]; if (!cas(&m->state, kStateInited, kStateLocked)) { i--; continue; } if ((err = pthread_rwlock_destroy(&m->m))) { fprintf(stderr, "pthread_rwlock_destroy failed with %d\n", err); exit(1); } if (!cas(&m->state, kStateLocked, kStateNotInited)) { fprintf(stderr, "destroy commit failed\n"); exit(1); } } } // Unlock all previously locked mutexes, otherwise other threads can deadlock. for (int i = 0; i < locked.size(); i++) { int id = locked[i]; Mutex *m = &mtx[id]; if ((err = pthread_rwlock_unlock(&m->m))) { fprintf(stderr, "pthread_rwlock_unlock failed with %d\n", err); exit(1); } } return 0; } int main() { struct timeval tv; gettimeofday(&tv, NULL); unsigned s = tv.tv_sec + tv.tv_usec; fprintf(stderr, "seed %d\n", s); srand(s); for (int i = 0; i < kMutexes; i++) mtx[i].state = kStateNotInited; pthread_t t[kThreads]; for (int i = 0; i < kThreads; i++) pthread_create(&t[i], 0, Thread, (void*)(unsigned long)rand()); for (int i = 0; i < kThreads; i++) pthread_join(t[i], 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_dup_norace.cc0000664000175000017500000000125612704157670026241 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include int fds[2]; void *Thread1(void *x) { char buf; read(fds[0], &buf, 1); close(fds[0]); return 0; } void *Thread2(void *x) { close(fds[1]); return 0; } int main() { fds[0] = open("/dev/random", O_RDONLY); fds[1] = dup2(fds[0], 100); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/longjmp3.cc0000664000175000017500000000145712754517560025210 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include #include #include #include void bar(jmp_buf env) { volatile int x = 42; longjmp(env, 42); x++; } void foo(jmp_buf env) { volatile int x = 42; bar(env); x++; } void badguy() { pthread_mutex_t mtx; pthread_mutex_init(&mtx, 0); pthread_mutex_lock(&mtx); pthread_mutex_destroy(&mtx); } void mymain() { jmp_buf env; if (setjmp(env) == 42) { badguy(); return; } foo(env); fprintf(stderr, "FAILED\n"); } int main() { volatile int x = 42; mymain(); return x; } // CHECK-NOT: FAILED // CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex // CHECK: #0 pthread_mutex_destroy // CHECK: #1 badguy // CHECK: #2 mymain // CHECK: #3 main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/global_race2.cc0000664000175000017500000000102512627123307025751 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int x; void *Thread(void *a) { barrier_wait(&barrier); x = 1; return 0; } int main() { barrier_init(&barrier, 2); print_address("addr2=", 1, &x); pthread_t t; pthread_create(&t, 0, Thread, 0); x = 0; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: addr2=[[ADDR2:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'x' {{(of size 4 )?}}at [[ADDR2]] ({{.*}}+0x{{[0-9,a-f]+}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/stack_race2.cc0000664000175000017500000000104712457727212025630 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread2(void *a) { barrier_wait(&barrier); *(int*)a = 43; return 0; } void *Thread(void *a) { int Var = 42; pthread_t t; pthread_create(&t, 0, Thread2, &Var); Var = 42; barrier_wait(&barrier); pthread_join(t, 0); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is stack of thread T1. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fork_multithreaded3.cc0000664000175000017500000000141512674752571027414 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include static void *racer(void *p) { *(int*)p = 42; return 0; } int main() { switch (fork()) { default: // parent while (wait(0) < 0) {} break; case 0: // child { int x = 0; pthread_t th1, th2; pthread_create(&th1, 0, racer, &x); pthread_create(&th2, 0, racer, &x); pthread_join(th1, 0); pthread_join(th2, 0); exit(0); break; } case -1: // error fprintf(stderr, "failed to fork (%d)\n", errno); exit(1); } fprintf(stderr, "OK\n"); } // CHECK: ThreadSanitizer: data race // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_thread.cc0000664000175000017500000000172712617405322026251 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // UNSUPPORTED: darwin #include #include #include #include #include #include #include #include volatile int X; static void handler(int sig) { (void)sig; if (X != 0) printf("bad"); } static void* thr(void *p) { return 0; } int main() { struct sigaction act = {}; act.sa_handler = &handler; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); exit(1); } itimerval t; t.it_value.tv_sec = 0; t.it_value.tv_usec = 10; t.it_interval = t.it_value; if (setitimer(ITIMER_PROF, &t, 0)) { perror("setitimer"); exit(1); } for (int i = 0; i < 10000; i++) { pthread_t th; pthread_create(&th, 0, thr, 0); pthread_join(th, 0); } fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE // CHECK-NOT: WARNING: ThreadSanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_with_finished_thread.cc0000664000175000017500000000175012457727212030615 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" // Ensure that we can restore a stack of a finished thread. int g_data; void __attribute__((noinline)) foobar(int *p) { *p = 42; } void *Thread1(void *x) { foobar(&g_data); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); sleep(1); // let the thread finish and exit g_data = 43; return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T2: // CHECK: Previous write of size 4 at {{.*}} by thread T1: // CHECK: #0 foobar // CHECK: #1 Thread1 // CHECK: Thread T1 (tid={{.*}}, finished) created by main thread at: // CHECK: #0 pthread_create // CHECK: #1 main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/lit.site.cfg.in0000664000175000017500000000073512704361721025756 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@" config.has_libcxx = @TSAN_HAS_LIBCXX@ config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@" config.target_arch = "@TSAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset1.cc0000664000175000017500000000173712621444670025411 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t mtx; void *Thread1(void *x) { barrier_wait(&barrier); pthread_mutex_lock(&mtx); Global++; pthread_mutex_unlock(&mtx); return NULL; } void *Thread2(void *x) { Global--; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]]): // CHECK: Previous write of size 4 at {{.*}} by thread T2: // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset1.cc:[[@LINE+1]] pthread_mutex_init(&mtx, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&mtx); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/longjmp4.cc0000664000175000017500000000157212754517560025207 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include #include #include #include #include void bar(jmp_buf env) { volatile int x = 42; jmp_buf env2; memcpy(env2, env, sizeof(jmp_buf)); longjmp(env2, 42); x++; } void foo(jmp_buf env) { volatile int x = 42; bar(env); x++; } void badguy() { pthread_mutex_t mtx; pthread_mutex_init(&mtx, 0); pthread_mutex_lock(&mtx); pthread_mutex_destroy(&mtx); } void mymain() { jmp_buf env; if (setjmp(env) == 42) { badguy(); return; } foo(env); fprintf(stderr, "FAILED\n"); } int main() { volatile int x = 42; mymain(); return x; } // CHECK-NOT: FAILED // CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex // CHECK: #0 pthread_mutex_destroy // CHECK: #1 badguy // CHECK: #2 mymain // CHECK: #3 main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/cond_race.cc0000664000175000017500000000154112517531510025352 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // CHECK-NOT: unlock of unlocked mutex // CHECK: ThreadSanitizer: data race // CHECK: pthread_cond_signal #include "test.h" struct Ctx { pthread_mutex_t m; pthread_cond_t c; bool done; }; void *thr(void *p) { Ctx *c = (Ctx*)p; pthread_mutex_lock(&c->m); c->done = true; pthread_mutex_unlock(&c->m); pthread_cond_signal(&c->c); barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); Ctx *c = new Ctx(); pthread_mutex_init(&c->m, 0); pthread_cond_init(&c->c, 0); pthread_t th; pthread_create(&th, 0, thr, c); pthread_mutex_lock(&c->m); while (!c->done) pthread_cond_wait(&c->c, &c->m); pthread_mutex_unlock(&c->m); // otherwise it can be reported as use-after-free barrier_wait(&barrier); delete c; pthread_join(th, 0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib3.cc0000664000175000017500000000173612623403316025637 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib3.so // RUN: %clangxx_tsan -O1 %s -o %t // RUN: %env_tsan_opts=suppressions='%s.supp' %deflake %run %t | FileCheck %s // Tests that unloading of a library matched against called_from_lib suppression // causes program crash (this is not supported). // Some aarch64 kernels do not support non executable write pages // REQUIRES: stable-runtime #ifndef LIB #include #include #include #include #include #include int main(int argc, char **argv) { std::string lib = std::string(dirname(argv[0])) + "/libignore_lib3.so"; void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW); dlclose(h); fprintf(stderr, "OK\n"); } #else // #ifdef LIB extern "C" void libfunc() { } #endif // #ifdef LIB // CHECK: ThreadSanitizer: library {{.*}} that was matched against called_from_lib suppression 'ignore_lib3.so' is unloaded // CHECK-NOT: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/setuid.c0000664000175000017500000000141612667154632024604 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // // setuid(0) hangs on powerpc64 big endian. When this is fixed remove // the unsupported flag. // https://llvm.org/bugs/show_bug.cgi?id=25799 // // UNSUPPORTED: powerpc64-unknown-linux-gnu #include "test.h" #include #include // Setuid call used to hang because the background tsan thread did not handle // SIGSETXID signal. Note that we don't care whether setuid call succeeds // or not. static void *thread(void *arg) { (void)arg; sleep(1); return 0; } int main() { // Create another thread just for completeness of the picture. pthread_t th; pthread_create(&th, 0, thread, 0); setuid(0); pthread_join(th, 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/blacklist2.cc0000664000175000017500000000227712704157670025507 0ustar mwhudsonmwhudson// Test that blacklisted functions are still contained in the stack trace. // RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist // RUN: echo "fun:*CallTouchGlobal*" >> %t.blacklist // RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t // RUN: %deflake %run %t 2>&1 | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { barrier_wait(&barrier); // CHECK: ThreadSanitizer: data race // CHECK: Write of size 4 // CHECK: #0 Thread1{{.*}}blacklist2.cc:[[@LINE+1]] Global++; return NULL; } void TouchGlobal() { // CHECK: Previous write of size 4 // CHECK: #0 TouchGlobal{{.*}}blacklist2.cc:[[@LINE+1]] Global--; } void CallTouchGlobal() { // CHECK: #1 CallTouchGlobal{{.*}}blacklist2.cc:[[@LINE+1]] TouchGlobal(); } void *Blacklisted_Thread2(void *x) { Global--; // CHECK: #2 Blacklisted_Thread2{{.*}}blacklist2.cc:[[@LINE+1]] CallTouchGlobal(); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "PASS\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/static_init4.cc0000664000175000017500000000122112704157670026037 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include struct Cache { int x; explicit Cache(int x) : x(x) { } }; int g_other; Cache *CreateCache() { g_other = rand(); return new Cache(rand()); } void *Thread1(void *x) { static Cache *c = CreateCache(); if (c->x == g_other) exit(1); return 0; } int main() { pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); pthread_create(&t[1], 0, Thread1, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); fprintf(stderr, "PASS\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/debugging.cc0000664000175000017500000000744312706164165025407 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t // RUN: %deflake %run %t 2>&1 | FileCheck %s #include #include #include #include #include "test.h" extern "C" { void __tsan_on_report(void *report); void *__tsan_get_current_report(); int __tsan_get_report_data(void *report, const char **description, int *count, int *stack_count, int *mop_count, int *loc_count, int *mutex_count, int *thread_count, int *unique_tid_count, void **sleep_trace, unsigned long trace_size); int __tsan_get_report_mop(void *report, unsigned long idx, int *tid, void **addr, int *size, int *write, int *atomic, void **trace, unsigned long trace_size); int __tsan_get_report_thread(void *report, unsigned long idx, int *tid, unsigned long *os_id, int *running, const char **name, int *parent_tid, void **trace, unsigned long trace_size); } long my_global; void *Thread(void *a) { barrier_wait(&barrier); my_global = 42; return NULL; } int main() { barrier_init(&barrier, 2); fprintf(stderr, "&my_global = %p\n", &my_global); // CHECK: &my_global = [[GLOBAL:0x[0-9a-f]+]] pthread_t t; pthread_create(&t, 0, Thread, 0); my_global = 41; barrier_wait(&barrier); pthread_join(t, 0); fprintf(stderr, "Done.\n"); } void __tsan_on_report(void *report) { fprintf(stderr, "__tsan_on_report(%p)\n", report); fprintf(stderr, "__tsan_get_current_report() = %p\n", __tsan_get_current_report()); // CHECK: __tsan_on_report([[REPORT:0x[0-9a-f]+]]) // CHECK: __tsan_get_current_report() = [[REPORT]] const char *description; int count; int stack_count, mop_count, loc_count, mutex_count, thread_count, unique_tid_count; void *sleep_trace[16] = {0}; __tsan_get_report_data(report, &description, &count, &stack_count, &mop_count, &loc_count, &mutex_count, &thread_count, &unique_tid_count, sleep_trace, 16); fprintf(stderr, "report type = '%s', count = %d\n", description, count); // CHECK: report type = 'data-race', count = 0 fprintf(stderr, "mop_count = %d\n", mop_count); // CHECK: mop_count = 2 int tid; void *addr; int size, write, atomic; void *trace[16] = {0}; __tsan_get_report_mop(report, 0, &tid, &addr, &size, &write, &atomic, trace, 16); fprintf(stderr, "tid = %d, addr = %p, size = %d, write = %d, atomic = %d\n", tid, addr, size, write, atomic); // CHECK: tid = 1, addr = [[GLOBAL]], size = 8, write = 1, atomic = 0 fprintf(stderr, "trace[0] = %p, trace[1] = %p\n", trace[0], trace[1]); // CHECK: trace[0] = 0x{{[0-9a-f]+}}, trace[1] = {{0x0|\(nil\)|\(null\)}} __tsan_get_report_mop(report, 1, &tid, &addr, &size, &write, &atomic, trace, 16); fprintf(stderr, "tid = %d, addr = %p, size = %d, write = %d, atomic = %d\n", tid, addr, size, write, atomic); // CHECK: tid = 0, addr = [[GLOBAL]], size = 8, write = 1, atomic = 0 fprintf(stderr, "trace[0] = %p, trace[1] = %p\n", trace[0], trace[1]); // CHECK: trace[0] = 0x{{[0-9a-f]+}}, trace[1] = {{0x0|\(nil\)|\(null\)}} fprintf(stderr, "thread_count = %d\n", thread_count); // CHECK: thread_count = 2 unsigned long os_id; int running; const char *name; int parent_tid; __tsan_get_report_thread(report, 0, &tid, &os_id, &running, &name, &parent_tid, trace, 16); fprintf(stderr, "tid = %d\n", tid); // CHECK: tid = 1 __tsan_get_report_thread(report, 1, &tid, &os_id, &running, &name, &parent_tid, trace, 16); fprintf(stderr, "tid = %d\n", tid); // CHECK: tid = 0 } // CHECK: Done. // CHECK: ThreadSanitizer: reported 1 warnings golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_detach.c0000664000175000017500000000061712704157670026065 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" void *Thread(void *x) { barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); pthread_detach(t); fprintf(stderr, "PASS\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: thread leak // CHECK: PASS golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_lock_move.cc0000664000175000017500000000210712704157670026424 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" jptr varaddr; jptr lockaddr; jptr varaddr2; jptr lockaddr2; void *Thread(void *p) { barrier_wait(&barrier); __tsan_java_mutex_lock(lockaddr2); *(int*)varaddr2 = 42; __tsan_java_mutex_unlock(lockaddr2); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 64; int const kMove = 1024; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap; lockaddr = jheap + 46; varaddr2 = varaddr + kMove; lockaddr2 = lockaddr + kMove; pthread_t th; pthread_create(&th, 0, Thread, 0); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 43; __tsan_java_mutex_unlock(lockaddr); __tsan_java_move(varaddr, varaddr2, kBlockSize); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(varaddr2, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset4.cc0000664000175000017500000000242312621444670025405 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t mtx1; pthread_mutex_t mtx2; void *Thread1(void *x) { pthread_mutex_lock(&mtx1); pthread_mutex_lock(&mtx2); Global++; pthread_mutex_unlock(&mtx2); pthread_mutex_unlock(&mtx1); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); Global--; return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T2: // CHECK: Previous write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]): // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset4.cc:[[@LINE+4]] // CHECK: Mutex [[M2]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset4.cc:[[@LINE+2]] pthread_mutex_init(&mtx1, 0); pthread_mutex_init(&mtx2, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&mtx1); pthread_mutex_destroy(&mtx2); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_volatile.cc0000664000175000017500000000216412457727212026270 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" jptr varaddr; jptr lockaddr; void *Thread(void *p) { while (__atomic_load_n((int*)lockaddr, __ATOMIC_RELAXED) == 0) usleep(1000); // spin-wait __tsan_java_acquire(lockaddr); *(int*)varaddr = 42; return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap; lockaddr = jheap + 8; pthread_t th; pthread_create(&th, 0, Thread, 0); *(int*)varaddr = 43; __tsan_java_release(lockaddr); __atomic_store_n((int*)lockaddr, 1, __ATOMIC_RELAXED); pthread_join(th, 0); *(int*)lockaddr = 0; pthread_create(&th, 0, Thread, 0); *(int*)varaddr = 43; __tsan_java_release_store(lockaddr); __atomic_store_n((int*)lockaddr, 1, __ATOMIC_RELAXED); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/stack_race.cc0000664000175000017500000000066712457727212025555 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread(void *a) { barrier_wait(&barrier); *(int*)a = 43; return 0; } int main() { barrier_init(&barrier, 2); int Var = 42; pthread_t t; pthread_create(&t, 0, Thread, &Var); Var = 43; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is stack of main thread. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/must_deadlock.cc0000664000175000017500000000236412360776301026264 0ustar mwhudsonmwhudson// Test that the deadlock detector can find a deadlock that actually happened. // Currently we will fail to report such a deadlock because we check for // cycles in lock-order graph after pthread_mutex_lock. // RUN: %clangxx_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // XFAIL: * #include #include #include pthread_mutex_t mu1, mu2; pthread_barrier_t barrier; void *Thread(void *p) { // mu2 => mu1 pthread_mutex_lock(&mu2); pthread_barrier_wait(&barrier); pthread_mutex_lock(&mu1); // CHECK: ThreadSanitizer: lock-order-inversion (potential deadlock) pthread_mutex_unlock(&mu1); pthread_mutex_unlock(&mu2); return p; } int main() { pthread_mutex_init(&mu1, NULL); pthread_mutex_init(&mu2, NULL); pthread_barrier_init(&barrier, 0, 2); fprintf(stderr, "This test is going to deadlock and die in 3 seconds\n"); alarm(3); pthread_t t; pthread_create(&t, 0, Thread, 0); // mu1 => mu2 pthread_mutex_lock(&mu1); pthread_barrier_wait(&barrier); pthread_mutex_lock(&mu2); pthread_mutex_unlock(&mu2); pthread_mutex_unlock(&mu1); pthread_join(t, 0); pthread_mutex_destroy(&mu1); pthread_mutex_destroy(&mu2); pthread_barrier_destroy(&barrier); fprintf(stderr, "FAILED\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mop_with_offset2.cc0000664000175000017500000000154012627123307026715 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread1(void *x) { barrier_wait(&barrier); int *p = (int*)x; p[0] = 1; return NULL; } void *Thread2(void *x) { char *p = (char*)x; p[2] = 1; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); int *data = new int(42); print_address("ptr1=", 1, data); print_address("ptr2=", 1, (char*)data + 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, data); pthread_create(&t[1], NULL, Thread2, data); pthread_join(t[0], NULL); pthread_join(t[1], NULL); delete data; } // CHECK: ptr1=[[PTR1:0x[0-9,a-f]+]] // CHECK: ptr2=[[PTR2:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at [[PTR1]] by thread T1: // CHECK: Previous write of size 1 at [[PTR2]] by thread T2: golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/vptr_benign_race.cc0000664000175000017500000000203512623625607026754 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include struct A { A() { pthread_mutex_init(&m, 0); pthread_cond_init(&c, 0); signaled = false; } virtual void F() { } void Done() { pthread_mutex_lock(&m); signaled = true; pthread_cond_signal(&c); pthread_mutex_unlock(&m); } virtual ~A() { } pthread_mutex_t m; pthread_cond_t c; bool signaled; }; struct B : A { virtual void F() { } virtual ~B() { pthread_mutex_lock(&m); while (!signaled) pthread_cond_wait(&c, &m); pthread_mutex_unlock(&m); } }; static A *obj = new B; void *Thread1(void *x) { obj->F(); obj->Done(); return NULL; } void *Thread2(void *x) { delete obj; return NULL; } int main() { pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "PASS\n"); } // CHECK: PASS // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_longjmp.cc0000664000175000017500000000350612754517560026457 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Test case for longjumping out of signal handler: // https://github.com/google/sanitizers/issues/482 // This test fails on powerpc64 BE (VMA=44), a segmentation fault // error happens at the second assignment // "((volatile int *volatile)mem)[1] = 1". // XFAIL: powerpc64-unknown-linux-gnu #include #include #include #include #include #ifdef __APPLE__ #define SIGNAL_TO_HANDLE SIGBUS #else #define SIGNAL_TO_HANDLE SIGSEGV #endif sigjmp_buf fault_jmp; volatile int fault_expected; void sigfault_handler(int sig) { if (!fault_expected) abort(); /* just return from sighandler to proper place */ fault_expected = 0; siglongjmp(fault_jmp, 1); } #define MUST_FAULT(code) do { \ fault_expected = 1; \ if (!sigsetjmp(fault_jmp, 1)) { \ code; /* should pagefault -> sihandler does longjmp */ \ fprintf(stderr, "%s not faulted\n", #code); \ abort(); \ } else { \ fprintf(stderr, "%s faulted ok\n", #code); \ } \ } while (0) int main() { struct sigaction act; act.sa_handler = sigfault_handler; act.sa_flags = 0; if (sigemptyset(&act.sa_mask)) { perror("sigemptyset"); exit(1); } if (sigaction(SIGNAL_TO_HANDLE, &act, NULL)) { perror("sigaction"); exit(1); } void *mem = mmap(0, 4096, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); MUST_FAULT(((volatile int *volatile)mem)[0] = 0); MUST_FAULT(((volatile int *volatile)mem)[1] = 1); MUST_FAULT(((volatile int *volatile)mem)[3] = 1); // Ensure that tsan does not think that we are // in a signal handler. void *volatile p = malloc(10); ((volatile int*)p)[1] = 1; free((void*)p); munmap(p, 4096); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/dtls.c0000664000175000017500000000267112724103176024250 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t // RUN: %clang_tsan %s -DBUILD_SO -fPIC -o %t-so.so -shared // RUN: %run %t 2>&1 | FileCheck %s // Test that tsan cleans up dynamic TLS memory between reuse. #include "test.h" #ifndef BUILD_SO #include #include typedef volatile long *(* get_t)(); get_t GetTls; void *Thread1(void *arg) { pthread_detach(pthread_self()); volatile long *x = GetTls(); *x = 42; fprintf(stderr, "stack: %p dtls: %p\n", &x, x); barrier_wait(&barrier); return 0; } void *Thread2(void *arg) { volatile long *x = GetTls(); *x = 42; fprintf(stderr, "stack: %p dtls: %p\n", &x, x); return 0; } int main(int argc, char *argv[]) { char path[4096]; snprintf(path, sizeof(path), "%s-so.so", argv[0]); void *handle = dlopen(path, RTLD_LAZY); if (!handle) fprintf(stderr, "%s\n", dlerror()); assert(handle != 0); GetTls = (get_t)dlsym(handle, "GetTls"); assert(dlerror() == 0); barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); barrier_wait(&barrier); // Wait for actual thread termination without using pthread_join, // which would synchronize threads. sleep(1); pthread_create(&t[1], 0, Thread2, 0); pthread_join(t[1], 0); fprintf(stderr, "DONE\n"); return 0; } #else // BUILD_SO __thread long huge_thread_local_array[1 << 17]; long *GetTls() { return &huge_thread_local_array[0]; } #endif // CHECK-NOT: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java.h0000664000175000017500000000157612542525314024233 0ustar mwhudsonmwhudson#include "test.h" extern "C" { typedef unsigned long jptr; // NOLINT void __tsan_java_preinit(const char *libjvm_path); void __tsan_java_init(jptr heap_begin, jptr heap_size); int __tsan_java_fini(); void __tsan_java_alloc(jptr ptr, jptr size); void __tsan_java_free(jptr ptr, jptr size); void __tsan_java_move(jptr src, jptr dst, jptr size); void __tsan_java_finalize(); void __tsan_java_mutex_lock(jptr addr); void __tsan_java_mutex_unlock(jptr addr); void __tsan_java_mutex_read_lock(jptr addr); void __tsan_java_mutex_read_unlock(jptr addr); void __tsan_java_mutex_lock_rec(jptr addr, int rec); int __tsan_java_mutex_unlock_rec(jptr addr); int __tsan_java_acquire(jptr addr); int __tsan_java_release(jptr addr); int __tsan_java_release_store(jptr addr); void __tsan_read1_pc(jptr addr, jptr pc); void __tsan_write1_pc(jptr addr, jptr pc); } const jptr kExternalPCBit = 1ULL << 60; golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/tls_race2.cc0000664000175000017500000000131612624545615025325 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK #include "test.h" void *Thread2(void *a) { barrier_wait(&barrier); *(int*)a = 43; return 0; } void *Thread(void *a) { static __thread int Var = 42; pthread_t t; pthread_create(&t, 0, Thread2, &Var); Var = 42; barrier_wait(&barrier); pthread_join(t, 0); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-Linux: Location is TLS of thread T1. // CHECK-FreeBSD: Location is TLS of thread T1. // CHECK-Darwin: Location is heap block of size 4 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/global_race3.cc0000664000175000017500000000122512627123307025754 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" namespace XXX { struct YYY { static int ZZZ[10]; }; int YYY::ZZZ[10]; } void *Thread(void *a) { barrier_wait(&barrier); XXX::YYY::ZZZ[0] = 1; return 0; } int main() { barrier_init(&barrier, 2); print_address("addr3=", 1, XXX::YYY::ZZZ); pthread_t t; pthread_create(&t, 0, Thread, 0); XXX::YYY::ZZZ[0] = 0; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: addr3=[[ADDR3:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'XXX::YYY::ZZZ' {{(of size 40 )?}}at [[ADDR3]] ({{.*}}+0x{{[0-9,a-f]+}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/cond_cancel.c0000664000175000017500000000247712632330741025534 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // CHECK-NOT: WARNING // CHECK: OK // This test is failing on powerpc64 (VMA=44). After calling pthread_cancel, // the Thread-specific data destructors are not called, so the destructor // "thread_finalize" (defined in tsan_interceptors.cc) can not set the status // of the thread to "ThreadStatusFinished" failing a check in "SetJoined" // (defined in sanitizer_thread_registry.cc). It might seem a bug on glibc, // however the same version GLIBC-2.17 will not make fail the test on // powerpc64 BE (VMA=46) // XFAIL: powerpc64-unknown-linux-gnu #include "test.h" pthread_mutex_t m; pthread_cond_t c; int x; static void my_cleanup(void *arg) { printf("my_cleanup\n"); pthread_mutex_unlock((pthread_mutex_t*)arg); } void *thr1(void *p) { pthread_mutex_lock(&m); pthread_cleanup_push(my_cleanup, &m); barrier_wait(&barrier); while (x == 0) pthread_cond_wait(&c, &m); pthread_cleanup_pop(1); return 0; } int main() { barrier_init(&barrier, 2); pthread_t th; pthread_mutex_init(&m, 0); pthread_cond_init(&c, 0); pthread_create(&th, 0, thr1, 0); barrier_wait(&barrier); sleep(1); // let it block on cond var pthread_cancel(th); pthread_join(th, 0); pthread_mutex_lock(&m); pthread_mutex_unlock(&m); fprintf(stderr, "OK\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/interface_atomic_test.c0000664000175000017500000000070612704157670027640 0ustar mwhudsonmwhudson// Test that we can include header with TSan atomic interface. // RUN: %clang_tsan %s -o %t && %run %t 2>&1 | FileCheck %s #include #include int main() { __tsan_atomic32 a; __tsan_atomic32_store(&a, 100, __tsan_memory_order_release); int res = __tsan_atomic32_load(&a, __tsan_memory_order_acquire); if (res == 100) { // CHECK: PASS fprintf(stderr, "PASS\n"); return 0; } return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/longjmp.cc0000664000175000017500000000056512754517560025124 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include int foo(jmp_buf env) { longjmp(env, 42); } int main() { jmp_buf env; if (setjmp(env) == 42) { fprintf(stderr, "JUMPED\n"); return 0; } foo(env); fprintf(stderr, "FAILED\n"); return 0; } // CHECK-NOT: FAILED // CHECK: JUMPED golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/cond.c0000664000175000017500000000206212330266131024211 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK-NOT: ThreadSanitizer WARNING: double lock // CHECK-NOT: ThreadSanitizer WARNING: mutex unlock by another thread // CHECK: OK #include #include #include pthread_mutex_t m; pthread_cond_t c; int x; void *thr1(void *p) { int i; for (i = 0; i < 10; i += 2) { pthread_mutex_lock(&m); while (x != i) pthread_cond_wait(&c, &m); x = i + 1; pthread_cond_signal(&c); pthread_mutex_unlock(&m); } return 0; } void *thr2(void *p) { int i; for (i = 1; i < 10; i += 2) { pthread_mutex_lock(&m); while (x != i) pthread_cond_wait(&c, &m); x = i + 1; pthread_mutex_unlock(&m); pthread_cond_broadcast(&c); } return 0; } int main() { pthread_t th1, th2; pthread_mutex_init(&m, 0); pthread_cond_init(&c, 0); pthread_create(&th1, 0, thr1, 0); pthread_create(&th2, 0, thr2, 0); pthread_join(th1, 0); pthread_join(th2, 0); fprintf(stderr, "OK\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_annotations.cc0000664000175000017500000000161612724267213027225 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" // Test that a linker-initialized mutex can be created/destroyed while in use. // Stub for testing, just invokes annotations. // Meant to be synchronized externally with test barrier. class Mutex { public: void Create(bool linker_initialized = false) { if (linker_initialized) ANNOTATE_RWLOCK_CREATE_STATIC(&state_); else ANNOTATE_RWLOCK_CREATE(&state_); } void Destroy() { ANNOTATE_RWLOCK_DESTROY(&state_); } void Lock() { ANNOTATE_RWLOCK_ACQUIRED(&state_, true); } void Unlock() { ANNOTATE_RWLOCK_RELEASED(&state_, true); } private: long long state_; }; int main() { Mutex m; m.Lock(); m.Create(true); m.Unlock(); m.Lock(); m.Destroy(); m.Unlock(); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/sleep_sync.cc0000664000175000017500000000122512457727212025611 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int X = 0; void MySleep() { sleep(1); // the sleep that must appear in the report } void *Thread(void *p) { barrier_wait(&barrier); MySleep(); // Assume the main thread has done the write. X = 42; return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); X = 43; barrier_wait(&barrier); pthread_join(t, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // ... // CHECK: As if synchronized via sleep: // CHECK-NEXT: #0 sleep // CHECK-NEXT: #1 MySleep // CHECK-NEXT: #2 Thread golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/inlined_memcpy_race.cc0000664000175000017500000000145712704157670027442 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include "test.h" #include int x[4], z[4]; void *MemCpyThread(void *a) { memcpy((int*)a, z, 16); barrier_wait(&barrier); return NULL; } void *MemSetThread(void *a) { barrier_wait(&barrier); memset((int*)a, 0, 16); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; // Race on x between memcpy and memset pthread_create(&t[0], NULL, MemCpyThread, x); pthread_create(&t[1], NULL, MemSetThread, x); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "PASS\n"); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: #0 memset // CHECK: #1 MemSetThread // CHECK: Previous write // CHECK: #0 {{(memcpy|memmove)}} // CHECK: #1 MemCpyThread golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib0.cc0000664000175000017500000000177612661155252025645 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib0.so // RUN: %clangxx_tsan -O1 %s -L%T -lignore_lib0 -o %t // RUN: echo running w/o suppressions: // RUN: env LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP // RUN: echo running with suppressions: // RUN: env LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP // Tests that interceptors coming from a library specified in called_from_lib // suppression are ignored. // Some aarch64 kernels do not support non executable write pages // REQUIRES: stable-runtime #ifndef LIB extern "C" void libfunc(); int main() { libfunc(); } #else // #ifdef LIB #include "ignore_lib_lib.h" #endif // #ifdef LIB // CHECK-NOSUPP: WARNING: ThreadSanitizer: data race // CHECK-NOSUPP: OK // CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race // CHECK-WITHSUPP: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atomic_free.cc0000664000175000017500000000065712457727212025732 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread(void *a) { __atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST); barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); int *a = new int(0); pthread_t t; pthread_create(&t, 0, Thread, a); barrier_wait(&barrier); delete a; pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/unaligned_norace.cc0000664000175000017500000000363712704157670026753 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include uint64_t objs[8*3*3*2][3]; extern "C" { void __tsan_unaligned_read2(void *addr); void __tsan_unaligned_read4(void *addr); void __tsan_unaligned_read8(void *addr); void __tsan_unaligned_write2(void *addr); void __tsan_unaligned_write4(void *addr); void __tsan_unaligned_write8(void *addr); } static void access(char *p, int sz, int rw) { if (rw) { switch (sz) { case 0: __tsan_unaligned_write2(p); break; case 1: __tsan_unaligned_write4(p); break; case 2: __tsan_unaligned_write8(p); break; default: exit(1); } } else { switch (sz) { case 0: __tsan_unaligned_read2(p); break; case 1: __tsan_unaligned_read4(p); break; case 2: __tsan_unaligned_read8(p); break; default: exit(1); } } } static int accesssize(int sz) { switch (sz) { case 0: return 2; case 1: return 4; case 2: return 8; } exit(1); } void Test(bool main) { uint64_t *obj = objs[0]; for (int off = 0; off < 8; off++) { for (int sz1 = 0; sz1 < 3; sz1++) { for (int sz2 = 0; sz2 < 3; sz2++) { for (int rw = 0; rw < 2; rw++) { char *p = (char*)obj + off; if (main) { // printf("thr=%d off=%d sz1=%d sz2=%d rw=%d p=%p\n", // main, off, sz1, sz2, rw, p); access(p, sz1, true); } else { p += accesssize(sz1); // printf("thr=%d off=%d sz1=%d sz2=%d rw=%d p=%p\n", // main, off, sz1, sz2, rw, p); access(p, sz2, rw); } obj += 3; } } } } } void *Thread(void *p) { (void)p; Test(false); return 0; } int main() { pthread_t th; pthread_create(&th, 0, Thread, 0); Test(true); pthread_join(th, 0); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/virtual_inheritance_compile_bug.cc0000664000175000017500000000100212704157670032042 0ustar mwhudsonmwhudson// Regression test for https://github.com/google/sanitizers/issues/410. // The C++ variant is much more compact that the LLVM IR equivalent. // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include struct AAA { virtual long aaa () { return 0; } }; // NOLINT struct BBB: virtual AAA { unsigned long bbb; }; // NOLINT struct CCC: virtual AAA { }; struct DDD: CCC, BBB { DDD(); }; // NOLINT DDD::DDD() { } int main() { DDD d; fprintf(stderr, "OK\n"); } // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_close_norace.cc0000664000175000017500000000125312704157670026553 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" #include #include #include void *Thread1(void *x) { int f = open("/dev/random", O_RDONLY); close(f); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); int f = open("/dev/random", O_RDONLY); close(f); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset3.cc0000664000175000017500000000241712621444670025407 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t mtx1; pthread_mutex_t mtx2; void *Thread1(void *x) { barrier_wait(&barrier); pthread_mutex_lock(&mtx1); pthread_mutex_lock(&mtx2); Global++; pthread_mutex_unlock(&mtx2); pthread_mutex_unlock(&mtx1); return NULL; } void *Thread2(void *x) { Global--; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]): // CHECK: Previous write of size 4 at {{.*}} by thread T2: // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset3.cc:[[@LINE+4]] // CHECK: Mutex [[M2]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset3.cc:[[@LINE+2]] pthread_mutex_init(&mtx1, 0); pthread_mutex_init(&mtx2, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&mtx1); pthread_mutex_destroy(&mtx2); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/longjmp2.cc0000664000175000017500000000067212754517560025205 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include int foo(sigjmp_buf env) { printf("env=%p\n", env); siglongjmp(env, 42); } int main() { sigjmp_buf env; printf("env=%p\n", env); if (sigsetjmp(env, 1) == 42) { fprintf(stderr, "JUMPED\n"); return 0; } foo(env); fprintf(stderr, "FAILED\n"); return 0; } // CHECK-NOT: FAILED // CHECK: JUMPED golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppressions_race2.cc0000664000175000017500000000121212704157670027272 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { Global = 42; barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); Global = 43; return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); return 0; } // CHECK-NOT: failed to open suppressions file // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_mutex.cc0000664000175000017500000000111712623335072025740 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" pthread_mutex_t mtx; pthread_cond_t cv; int x; void thread(int tid) { for (int i = 0; i < bench_niter; i++) { pthread_mutex_lock(&mtx); while (x != i * 2 + tid) pthread_cond_wait(&cv, &mtx); x++; pthread_cond_signal(&cv); pthread_mutex_unlock(&mtx); } } void bench() { pthread_mutex_init(&mtx, 0); pthread_cond_init(&cv, 0); start_thread_group(2, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_lock.cc0000664000175000017500000000162612457727212025403 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" jptr varaddr; jptr lockaddr; void *Thread(void *p) { barrier_wait(&barrier); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 42; __tsan_java_mutex_unlock(lockaddr); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap; lockaddr = jheap + 8; pthread_t th; pthread_create(&th, 0, Thread, 0); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 43; __tsan_java_mutex_unlock(lockaddr); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib4.cc0000664000175000017500000000230312754517560025643 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -shared -o %T/libignore_lib4.so // RUN: %clangxx_tsan -O1 %s -o %t // RUN: echo "called_from_lib:libignore_lib4.so" > %t.supp // RUN: %env_tsan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck %s // powerpc64 big endian bots failed with "FileCheck error: '-' is empty" due // to a segmentation fault. // UNSUPPORTED: powerpc64-unknown-linux-gnu // aarch64 bots failed with "called_from_lib suppression 'libignore_lib4.so' // is matched against 2 libraries". // UNSUPPORTED: aarch64 // Test longjmp in ignored lib. // It used to crash since we jumped out of ScopedInterceptor scope. #include "test.h" #include #include #include #include #include #ifdef LIB extern "C" void myfunc() { for (int i = 0; i < (1 << 20); i++) { jmp_buf env; if (!setjmp(env)) longjmp(env, 1); } } #else int main(int argc, char **argv) { std::string lib = std::string(dirname(argv[0])) + "/libignore_lib4.so"; void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW); void (*func)() = (void(*)())dlsym(h, "myfunc"); func(); fprintf(stderr, "DONE\n"); return 0; } #endif // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/sleep_sync2.cc0000664000175000017500000000073512457727212025700 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int X = 0; void *Thread(void *p) { X = 42; barrier_wait(&barrier); return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; sleep(1); // must not appear in the report pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); X = 43; pthread_join(t, 0); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NOT: As if synchronized via sleep golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atomic_free3.cc0000664000175000017500000000121312617104621025771 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" // Test for https://github.com/google/sanitizers/issues/602 void *Thread(void *a) { __atomic_store_n((int*)a, 1, __ATOMIC_RELAXED); return 0; } int main() { int *a = new int(0); pthread_t t; pthread_create(&t, 0, Thread, a); while (__atomic_load_n(a, __ATOMIC_RELAXED) == 0) sched_yield(); delete a; pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write // CHECK: #0 operator delete // CHECK: #1 main // CHECK: Previous atomic write // CHECK: #0 __tsan_atomic32_store // CHECK: #1 Thread golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppressions_global.cc.supp0000664000175000017500000000002112155371460030514 0ustar mwhudsonmwhudsonrace:RacyGlobal golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/vfork.cc0000664000175000017500000000211512704157670024573 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include int fds[2]; int X; void *Thread1(void *x) { X = 42; write(fds[1], "a", 1); return NULL; } void *Thread2(void *x) { char buf; while (read(fds[0], &buf, 1) != 1) { } X = 43; return NULL; } int main() { pipe(fds); int pid = vfork(); if (pid < 0) { fprintf(stderr, "FAIL to vfork\n"); exit(1); } if (pid == 0) { // child // Closing of fds must not affect parent process. // Strictly saying this is undefined behavior, because vfork child is not // allowed to call any functions other than exec/exit. But this is what // openjdk does. close(fds[0]); close(fds[1]); _exit(0); } pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "DONE\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK-NOT: FAIL to vfork // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_dup_norace2.cc0000664000175000017500000000362712704157670026327 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" #include #include #include #include // dup2(oldfd, newfd) races with read(newfd). // This is not reported as race because: // 1. Some software dups a closed pipe in place of a socket before closing // the socket (to prevent races actually). // 2. Some daemons dup /dev/null in place of stdin/stdout. int fd; void *Thread(void *x) { char buf; int n = read(fd, &buf, 1); if (n != 1) { // This read can "legitimately" fail regadless of the fact that glibc claims // that "there is no instant in the middle of calling dup2 at which new is // closed and not yet a duplicate of old". Strace of the failing runs // looks as follows: // // [pid 122196] open("/dev/urandom", O_RDONLY) = 3 // [pid 122196] open("/dev/urandom", O_RDONLY) = 4 // Process 122382 attached // [pid 122382] read(3, // [pid 122196] dup2(4, 3 // [pid 122382] <... read resumed> 0x7fcd139960b7, 1) = -1 EBADF (Bad file descriptor) // [pid 122196] <... dup2 resumed> ) = 3 // read failed: n=-1 errno=9 // // The failing read does not interfere with what this test tests, // so we just ignore the failure. // // exit(printf("read failed: n=%d errno=%d\n", n, errno)); } return 0; } int main() { fd = open("/dev/urandom", O_RDONLY); int fd2 = open("/dev/urandom", O_RDONLY); if (fd == -1 || fd2 == -1) exit(printf("open failed\n")); pthread_t th; pthread_create(&th, 0, Thread, 0); if (dup2(fd2, fd) == -1) exit(printf("dup2 failed\n")); pthread_join(th, 0); if (close(fd) == -1) exit(printf("close failed\n")); if (close(fd2) == -1) exit(printf("close failed\n")); fprintf(stderr, "DONE\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/pie_test.cc0000664000175000017500000000017412770757652025274 0ustar mwhudsonmwhudson// Check if tsan work with PIE binaries. // RUN: %clang_tsan %s -pie -fpic -o %t && %run %t int main(void) { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_end_with_ignore3.cc0000664000175000017500000000143012342110363030203 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l); extern "C" void AnnotateIgnoreReadsEnd(const char *f, int l); int main() { AnnotateIgnoreReadsBegin("", 0); AnnotateIgnoreReadsBegin("", 0); AnnotateIgnoreReadsEnd("", 0); AnnotateIgnoreReadsEnd("", 0); AnnotateIgnoreReadsBegin("", 0); AnnotateIgnoreReadsBegin("", 0); AnnotateIgnoreReadsEnd("", 0); } // CHECK: ThreadSanitizer: main thread finished with ignores enabled // CHECK: Ignore was enabled at: // CHECK: #0 AnnotateIgnoreReadsBegin // CHECK: #1 main {{.*}}thread_end_with_ignore3.cc:10 // CHECK: Ignore was enabled at: // CHECK: #0 AnnotateIgnoreReadsBegin // CHECK: #1 main {{.*}}thread_end_with_ignore3.cc:11 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_move_overlap_race.cc0000664000175000017500000000257312704157670030145 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t // RUN: %deflake %run %t 2>&1 | FileCheck %s // RUN: %deflake %run %t arg 2>&1 | FileCheck %s #include "java.h" jptr varaddr1_old; jptr varaddr2_old; jptr varaddr1_new; jptr varaddr2_new; void *Thread(void *p) { barrier_wait(&barrier); *(int*)varaddr1_new = 43; *(int*)varaddr2_new = 43; return 0; } int main(int argc, char **argv) { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; void *jheap = malloc(kHeapSize); jheap = (char*)jheap + 8; __tsan_java_init((jptr)jheap, kHeapSize); const int kBlockSize = 64; int const kMove = 32; varaddr1_old = (jptr)jheap; varaddr2_old = (jptr)jheap + kBlockSize - 1; varaddr1_new = varaddr1_old + kMove; varaddr2_new = varaddr2_old + kMove; if (argc > 1) { // Move memory backwards. varaddr1_old += kMove; varaddr2_old += kMove; varaddr1_new -= kMove; varaddr2_new -= kMove; } __tsan_java_alloc(varaddr1_old, kBlockSize); pthread_t th; pthread_create(&th, 0, Thread, 0); *(int*)varaddr1_old = 43; *(int*)varaddr2_old = 43; __tsan_java_move(varaddr1_old, varaddr1_new, kBlockSize); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(varaddr1_new, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppressions_race.cc0000664000175000017500000000121212704157670027210 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { barrier_wait(&barrier); Global = 42; return NULL; } void *Thread2(void *x) { Global = 43; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); return 0; } // CHECK-NOT: failed to open suppressions file // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_lock_rec.cc0000664000175000017500000000270412704157670026232 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" jptr varaddr; jptr lockaddr; void *Thread(void *p) { __tsan_java_mutex_lock(lockaddr); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 42; int rec = __tsan_java_mutex_unlock_rec(lockaddr); if (rec != 2) { fprintf(stderr, "FAILED 0 rec=%d\n", rec); exit(1); } barrier_wait(&barrier); barrier_wait(&barrier); __tsan_java_mutex_lock_rec(lockaddr, rec); if (*(int*)varaddr != 43) { fprintf(stderr, "FAILED 3 var=%d\n", *(int*)varaddr); exit(1); } __tsan_java_mutex_unlock(lockaddr); __tsan_java_mutex_unlock(lockaddr); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap; *(int*)varaddr = 0; lockaddr = jheap + 8; pthread_t th; pthread_create(&th, 0, Thread, 0); barrier_wait(&barrier); __tsan_java_mutex_lock(lockaddr); if (*(int*)varaddr != 42) { fprintf(stderr, "FAILED 1 var=%d\n", *(int*)varaddr); exit(1); } *(int*)varaddr = 43; __tsan_java_mutex_unlock(lockaddr); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK-NOT: FAILED // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/write_in_reader_lock.cc0000664000175000017500000000167612457727212027631 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" pthread_rwlock_t rwlock; int GLOB; void *Thread1(void *p) { (void)p; pthread_rwlock_rdlock(&rwlock); barrier_wait(&barrier); // Write under reader lock. GLOB++; pthread_rwlock_unlock(&rwlock); return 0; } int main(int argc, char *argv[]) { barrier_init(&barrier, 2); pthread_rwlock_init(&rwlock, NULL); pthread_rwlock_rdlock(&rwlock); pthread_t t; pthread_create(&t, 0, Thread1, 0); volatile int x = GLOB; (void)x; pthread_rwlock_unlock(&rwlock); barrier_wait(&barrier); pthread_join(t, 0); pthread_rwlock_destroy(&rwlock); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T1{{.*}}: // CHECK: #0 Thread1(void*) {{.*}}write_in_reader_lock.cc:12 // CHECK: Previous read of size 4 at {{.*}} by main thread{{.*}}: // CHECK: #0 main {{.*}}write_in_reader_lock.cc:23 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/printf-1.c0000664000175000017500000000072112661155252024736 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O2 %s -o %t // RUN: %env_tsan_opts=check_printf=1 %run %t 2>&1 | FileCheck %s // RUN: %env_tsan_opts=check_printf=0 %run %t 2>&1 | FileCheck %s // RUN: %run %t 2>&1 | FileCheck %s #include int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; printf("%c %d %.3f %s\n", c, x, f, s); return 0; // Check that printf works fine under Tsan. // CHECK: 0 12 1.239 34 } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/deep_stack1.cc0000664000175000017500000000163012457727212025630 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t -DORDER1 && %deflake %run %t | FileCheck %s // RUN: %clangxx_tsan -O1 %s -o %t -DORDER2 && %deflake %run %t | FileCheck %s #include "test.h" volatile int X; volatile int N; void (*volatile F)(); static void foo() { if (--N == 0) X = 42; else F(); } void *Thread(void *p) { #ifdef ORDER1 barrier_wait(&barrier); #endif F(); #ifdef ORDER2 barrier_wait(&barrier); #endif return 0; } int main() { barrier_init(&barrier, 2); N = 50000; F = foo; pthread_t t; pthread_attr_t a; pthread_attr_init(&a); pthread_attr_setstacksize(&a, N * 256 + (1 << 20)); pthread_create(&t, &a, Thread, 0); #ifdef ORDER2 barrier_wait(&barrier); #endif X = 43; #ifdef ORDER1 barrier_wait(&barrier); #endif pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: #100 foo // We must output suffucuently large stack (at least 100 frames) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_rwlock.cc0000664000175000017500000000164012704157670025750 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" jptr varaddr; jptr lockaddr; void *Thread(void *p) { barrier_wait(&barrier); __tsan_java_mutex_read_lock(lockaddr); *(int*)varaddr = 42; __tsan_java_mutex_read_unlock(lockaddr); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap; lockaddr = jheap + 8; pthread_t th; pthread_create(&th, 0, Thread, 0); __tsan_java_mutex_lock(lockaddr); *(int*)varaddr = 43; __tsan_java_mutex_unlock(lockaddr); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_pipe_norace.cc0000664000175000017500000000113512704157670026402 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include int fds[2]; int X; void *Thread1(void *x) { X = 42; write(fds[1], "a", 1); return NULL; } void *Thread2(void *x) { char buf; while (read(fds[0], &buf, 1) != 1) { } X = 43; return NULL; } int main() { pipe(fds); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutexset2.cc0000664000175000017500000000173312621444670025406 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; pthread_mutex_t mtx; void *Thread1(void *x) { pthread_mutex_lock(&mtx); Global++; pthread_mutex_unlock(&mtx); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); Global--; return NULL; } int main() { barrier_init(&barrier, 2); // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 at {{.*}} by thread T2: // CHECK: Previous write of size 4 at {{.*}} by thread T1 // CHECK: (mutexes: write [[M1:M[0-9]+]]): // CHECK: Mutex [[M1]] (0x{{.*}}) created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main {{.*}}mutexset2.cc:[[@LINE+1]] pthread_mutex_init(&mtx, 0); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&mtx); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppressions_race.cc.supp0000664000175000017500000000001612155371460030172 0ustar mwhudsonmwhudsonrace:Thread1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_location.cc0000664000175000017500000000126412457727212025731 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int fds[2]; void *Thread1(void *x) { write(fds[1], "a", 1); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); close(fds[0]); close(fds[1]); return NULL; } int main() { barrier_init(&barrier, 2); pipe(fds); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is file descriptor {{[0-9]+}} created by main thread at: // CHECK: #0 pipe // CHECK: #1 main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_shadow_flush.cc0000664000175000017500000000217712364755001027273 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include const long kSmallPage = 4 << 10; const long kLargePage = 2 << 20; const long kStride = 1 << 10; typedef unsigned long uptr; int main(int argc, const char **argv) { uptr mem_size = 4 << 20; if (argc > 1) mem_size = (uptr)atoi(argv[1]) << 20; uptr stride = kSmallPage; if (argc > 2) stride = (uptr)atoi(argv[2]) << 10; int niter = 1; if (argc > 3) niter = atoi(argv[3]); int stride2 = 1; if (argc > 4) stride2 = atoi(argv[4]); uptr sz = mem_size + stride2 * kStride + kLargePage; void *p = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); uptr a = ((uptr)p + kLargePage - 1) & ~(kLargePage - 1); volatile char *mem = (volatile char *)a; for (int i = 0; i < niter; i++) { for (uptr off = 0; off < mem_size; off += stride) { for (uptr off2 = 0; off2 < stride2; off2++) mem[off + off2 * kStride] = 42; } } fprintf(stderr, "DONE\n"); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_local_mutex.cc0000664000175000017500000000132412623335072027112 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" pthread_mutex_t *mtx; const int kStride = 16; void thread(int tid) { for (int i = 0; i < bench_niter; i++) { pthread_mutex_lock(&mtx[tid * kStride]); pthread_mutex_unlock(&mtx[tid * kStride]); } } void bench() { mtx = (pthread_mutex_t*)malloc(bench_nthread * kStride * sizeof(*mtx)); for (int i = 0; i < bench_nthread; i++) { pthread_mutex_init(&mtx[i * kStride], 0); pthread_mutex_lock(&mtx[i * kStride]); pthread_mutex_unlock(&mtx[i * kStride]); } start_thread_group(bench_nthread, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_barrier.c0000664000175000017500000000122012623335072026403 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // pthread barriers are not available on OS X // UNSUPPORTED: darwin #include "test.h" pthread_barrier_t B; int Global; void *Thread1(void *x) { pthread_barrier_init(&B, 0, 2); barrier_wait(&barrier); pthread_barrier_wait(&B); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); pthread_barrier_wait(&B); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, NULL, Thread1, NULL); Thread2(0); pthread_join(t, NULL); pthread_barrier_destroy(&B); return 0; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_stress.cc0000664000175000017500000000077312572026416025765 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s #include "test.h" const int kThreads = 16; const int kIters = 1000; volatile int X = 0; void *thr(void *arg) { for (int i = 0; i < kIters; i++) X++; return 0; } int main() { pthread_t th[kThreads]; for (int i = 0; i < kThreads; i++) pthread_create(&th[i], 0, thr, 0); for (int i = 0; i < kThreads; i++) pthread_join(th[i], 0); fprintf(stderr, "DONE\n"); } // CHECK: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_heap_init.cc0000664000175000017500000000202212704157670026402 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "java.h" #include #include int main() { // Test that munmap interceptor resets meta shadow for the memory range. // Previously __tsan_java_move failed because it encountered non-zero meta // shadow for the destination. int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)mmap(0, kHeapSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); if (jheap == (jptr)MAP_FAILED) return printf("mmap failed with %d\n", errno); __atomic_store_n((int*)jheap, 1, __ATOMIC_RELEASE); munmap((void*)jheap, kHeapSize); jheap = (jptr)mmap((void*)jheap, kHeapSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); if (jheap == (jptr)MAP_FAILED) return printf("second mmap failed with %d\n", errno); __tsan_java_init(jheap, kHeapSize); __tsan_java_move(jheap + 16, jheap, 16); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/suppressions_global.cc0000664000175000017500000000113312704157670027540 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s #include #include int RacyGlobal; void *Thread1(void *x) { RacyGlobal = 42; return NULL; } void *Thread2(void *x) { RacyGlobal = 43; return NULL; } int main() { pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "OK\n"); return 0; } // CHECK-NOT: failed to open suppressions file // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/tiny_race.c0000664000175000017500000000062412457727212025261 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { barrier_wait(&barrier); Global = 42; return x; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread1, 0); Global = 43; barrier_wait(&barrier); pthread_join(t, 0); return Global; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atomic_race.cc0000664000175000017500000000400712457727212025714 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" const int kTestCount = 4; typedef long long T; T atomics[kTestCount * 2]; void Test(int test, T *p, bool main_thread) { volatile T sink; if (test == 0) { if (main_thread) __atomic_fetch_add(p, 1, __ATOMIC_RELAXED); else *p = 42; } else if (test == 1) { if (main_thread) __atomic_fetch_add(p, 1, __ATOMIC_RELAXED); else sink = *p; } else if (test == 2) { if (main_thread) sink = __atomic_load_n(p, __ATOMIC_SEQ_CST); else *p = 42; } else if (test == 3) { if (main_thread) __atomic_store_n(p, 1, __ATOMIC_SEQ_CST); else sink = *p; } } void *Thread(void *p) { for (int i = 0; i < kTestCount; i++) { Test(i, &atomics[i], false); } barrier_wait(&barrier); barrier_wait(&barrier); for (int i = 0; i < kTestCount; i++) { fprintf(stderr, "Test %d reverse\n", i); Test(i, &atomics[kTestCount + i], false); } return 0; } int main() { barrier_init(&barrier, 2); pthread_t t; pthread_create(&t, 0, Thread, 0); barrier_wait(&barrier); for (int i = 0; i < kTestCount; i++) { fprintf(stderr, "Test %d\n", i); Test(i, &atomics[i], true); } for (int i = 0; i < kTestCount; i++) { Test(i, &atomics[kTestCount + i], true); } barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: Test 0 // CHECK: ThreadSanitizer: data race // CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic // CHECK: Test 1 // CHECK: ThreadSanitizer: data race // CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic // CHECK: Test 2 // CHECK: ThreadSanitizer: data race // CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic // CHECK: Test 3 // CHECK: ThreadSanitizer: data race // CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic // CHECK: Test 0 reverse // CHECK: ThreadSanitizer: data race // CHECK: Test 1 reverse // CHECK: ThreadSanitizer: data race // CHECK: Test 2 reverse // CHECK: ThreadSanitizer: data race // CHECK: Test 3 reverse // CHECK: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench.h0000664000175000017500000000313212314046731024355 0ustar mwhudsonmwhudson#include #include #include #include #include #include int bench_nthread; int bench_niter; int grow_clock_var; pthread_barrier_t glow_clock_barrier; void bench(); // defined by user void start_thread_group(int nth, void(*f)(int tid)); void grow_clock_worker(int tid); int main(int argc, char **argv) { bench_nthread = 2; if (argc > 1) bench_nthread = atoi(argv[1]); bench_niter = 100; if (argc > 2) bench_niter = atoi(argv[2]); // Grow thread's clock. int clock_size = 10; if (argc > 1) clock_size = 1000; pthread_barrier_init(&glow_clock_barrier, 0, clock_size); start_thread_group(clock_size, grow_clock_worker); pthread_barrier_destroy(&glow_clock_barrier); __atomic_load_n(&grow_clock_var, __ATOMIC_ACQUIRE); timespec tp0; clock_gettime(CLOCK_MONOTONIC, &tp0); bench(); timespec tp1; clock_gettime(CLOCK_MONOTONIC, &tp1); unsigned long long t = (tp1.tv_sec * 1000000000ULL + tp1.tv_nsec) - (tp0.tv_sec * 1000000000ULL + tp0.tv_nsec); fprintf(stderr, "%llu ns/iter\n", t / bench_niter); fprintf(stderr, "DONE\n"); } void start_thread_group(int nth, void(*f)(int tid)) { pthread_t *th = (pthread_t*)malloc(nth * sizeof(pthread_t)); for (int i = 0; i < nth; i++) pthread_create(&th[i], 0, (void*(*)(void*))f, (void*)(long)i); for (int i = 0; i < nth; i++) pthread_join(th[i], 0); } void grow_clock_worker(int tid) { int res = pthread_barrier_wait(&glow_clock_barrier); if (res == PTHREAD_BARRIER_SERIAL_THREAD) __atomic_store_n(&grow_clock_var, 0, __ATOMIC_RELEASE); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fork_multithreaded.cc0000664000175000017500000000210212701447064027310 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s -check-prefix=CHECK-DIE // RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=die_after_fork=0 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK-NODIE #include "test.h" #include #include #include static void *sleeper(void *p) { sleep(1000); // not intended to exit during test return 0; } static void *nop(void *p) { return 0; } int main() { barrier_init(&barrier, 2); pthread_t th; pthread_create(&th, 0, sleeper, 0); switch (fork()) { default: // parent while (wait(0) < 0) {} break; case 0: // child { pthread_t th2; pthread_create(&th2, 0, nop, 0); exit(0); break; } case -1: // error fprintf(stderr, "failed to fork (%d)\n", errno); exit(1); } fprintf(stderr, "OK\n"); } // CHECK-DIE: ThreadSanitizer: starting new threads after multi-threaded fork is not supported // CHECK-DIE: OK // CHECK-NODIE-NOT: ThreadSanitizer: starting new threads after multi-threaded fork is not supported // CHECK-NODIE: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/lit.cfg0000664000175000017500000000640513001465406024402 0ustar mwhudsonmwhudson# -*- Python -*- import os def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if not attr_value: lit_config.fatal( "No attribute %r in test configuration! You may need to run " "tests from your build directory or add this attribute " "to lit.site.cfg " % attr_name) return attr_value # Setup config name. config.name = 'ThreadSanitizer' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup environment variables for running ThreadSanitizer. default_tsan_opts = "atexit_sleep_ms=0" if config.host_os == 'Darwin': # On Darwin, we default to `abort_on_error=1`, which would make tests run # much slower. Let's override this and run lit tests with 'abort_on_error=0'. default_tsan_opts += ':abort_on_error=0' # Platform-specific default TSAN_OPTIONS for lit tests. if default_tsan_opts: config.environment['TSAN_OPTIONS'] = default_tsan_opts default_tsan_opts += ':' config.substitutions.append(('%env_tsan_opts=', 'env TSAN_OPTIONS=' + default_tsan_opts)) # GCC driver doesn't add necessary compile/link flags with -fsanitize=thread. if config.compiler_id == 'GNU': extra_cflags = ["-fPIE", "-pthread", "-ldl", "-lstdc++", "-lrt", "-pie"] else: extra_cflags = [] # Setup default compiler flags used with -fsanitize=thread option. clang_tsan_cflags = (["-fsanitize=thread", "-Wall"] + [config.target_cflags] + config.debug_info_flags + extra_cflags) clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags + ["-std=c++11"] # Add additional flags if we're using instrumented libc++. # Instrumented libcxx currently not supported on Darwin. if config.has_libcxx and config.host_os != 'Darwin': # FIXME: Dehardcode this path somehow. libcxx_path = os.path.join(config.compiler_rt_obj_root, "lib", "tsan", "libcxx_tsan_" + config.target_arch) libcxx_incdir = os.path.join(libcxx_path, "include", "c++", "v1") libcxx_libdir = os.path.join(libcxx_path, "lib") libcxx_so = os.path.join(libcxx_libdir, "libc++.so") clang_tsan_cxxflags += ["-nostdinc++", "-I%s" % libcxx_incdir, libcxx_so, "-Wl,-rpath=%s" % libcxx_libdir] def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " config.substitutions.append( ("%clang_tsan ", build_invocation(clang_tsan_cflags)) ) config.substitutions.append( ("%clangxx_tsan ", build_invocation(clang_tsan_cxxflags)) ) # Define CHECK-%os to check for OS-dependent output. config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os))) config.substitutions.append( ("%deflake ", os.path.join(os.path.dirname(__file__), "deflake.bash")) ) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm'] # ThreadSanitizer tests are currently supported on FreeBSD, Linux and Darwin. if config.host_os not in ['FreeBSD', 'Linux', 'Darwin']: config.unsupported = True # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL # because the test hangs. if config.target_arch != 'aarch64': config.available_features.add('stable-runtime') golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_destroy_locked.cc0000664000175000017500000000114212342110363027661 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include int main() { pthread_mutex_t m; pthread_mutex_init(&m, 0); pthread_mutex_lock(&m); pthread_mutex_destroy(&m); return 0; } // CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex // CHECK: #0 pthread_mutex_destroy // CHECK: #1 main // CHECK: and: // CHECK: #0 pthread_mutex_lock // CHECK: #1 main // CHECK: Mutex {{.*}} created at: // CHECK: #0 pthread_mutex_init // CHECK: #1 main // CHECK: SUMMARY: ThreadSanitizer: destroy of a locked mutex{{.*}}main golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_race_move.cc0000664000175000017500000000153612457727212026413 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "java.h" jptr varaddr; jptr varaddr2; void *Thread(void *p) { barrier_wait(&barrier); *(int*)varaddr2 = 42; return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 64; int const kMove = 1024; __tsan_java_alloc(jheap, kBlockSize); varaddr = jheap + 16; varaddr2 = varaddr + kMove; pthread_t th; pthread_create(&th, 0, Thread, 0); *(int*)varaddr = 43; __tsan_java_move(varaddr, varaddr2, kBlockSize); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(varaddr2, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/annotate_happens_before.cc0000664000175000017500000000276212461706226030322 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" /* Annotations usage example. Tsan does not see synchronization in barrier_wait. ANNOTATE_HAPPENS_BEFORE/AFTER communicate the synchronization to tsan and prevent the race report. If the compiler does not support __has_feature macro, then you can build with CFLAGS="-fsanitize=thread -DTHREAD_SANITIZER" and then use #ifdef THREAD_SANITIZER to enabled annotations. */ #if defined(__has_feature) && __has_feature(thread_sanitizer) # define ANNOTATE_HAPPENS_BEFORE(addr) \ AnnotateHappensBefore(__FILE__, __LINE__, (void*)(addr)) # define ANNOTATE_HAPPENS_AFTER(addr) \ AnnotateHappensAfter(__FILE__, __LINE__, (void*)(addr)) extern "C" void AnnotateHappensBefore(const char *f, int l, void *addr); extern "C" void AnnotateHappensAfter(const char *f, int l, void *addr); #else # define ANNOTATE_HAPPENS_BEFORE(addr) # define ANNOTATE_HAPPENS_AFTER(addr) #endif int Global; void *Thread1(void *x) { barrier_wait(&barrier); ANNOTATE_HAPPENS_AFTER(&barrier); Global++; return NULL; } void *Thread2(void *x) { Global--; ANNOTATE_HAPPENS_BEFORE(&barrier); barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: data race // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/memcpy_race.cc0000664000175000017500000000202512627123307025722 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include char *data = new char[10]; char *data1 = new char[10]; char *data2 = new char[10]; void *Thread1(void *x) { static volatile int size = 1; memcpy(data+5, data1, size); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { static volatile int size = 4; barrier_wait(&barrier); memcpy(data+3, data2, size); return NULL; } int main() { barrier_init(&barrier, 2); print_address("addr=", 1, &data[5]); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); return 0; } // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 1 at [[ADDR]] by thread T2: // CHECK: #0 {{(memcpy|memmove)}} // CHECK: #1 Thread2 // CHECK: Previous write of size 1 at [[ADDR]] by thread T1: // CHECK: #0 {{(memcpy|memmove)}} // CHECK: #1 Thread1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/0000775000175000017500000000000013040224625024347 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-io-race.mm0000664000175000017500000000350212741207632026762 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s // REQUIRES: disabled #import #import "../test.h" dispatch_queue_t queue; dispatch_data_t data; dispatch_semaphore_t sem; const char *path; long my_global = 0; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); print_address("addr=", 1, &my_global); barrier_init(&barrier, 2); queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; NSData *ns_data = [NSMutableData dataWithLength:1000]; data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); dispatch_io_set_high_water(channel, 1); dispatch_io_write(channel, 0, data, queue, ^(bool done, dispatch_data_t remainingData, int error) { my_global = 42; barrier_wait(&barrier); }); dispatch_io_write(channel, 0, data, queue, ^(bool done, dispatch_data_t remainingData, int error) { barrier_wait(&barrier); my_global = 42; dispatch_semaphore_signal(sem); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); dispatch_io_close(channel, 0); fprintf(stderr, "Done.\n"); return 0; } // CHECK: Hello world. // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'my_global' {{(of size 8 )?}}at [[ADDR]] (gcd-io-race.mm.tmp+0x{{[0-9,a-f]+}}) // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/symbolizer-atos.cc0000664000175000017500000000127012627123307030026 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %env_tsan_opts=verbosity=2:external_symbolizer_path=/usr/bin/atos %deflake %run %t | FileCheck %s #include "../test.h" int GlobalData[10]; void *Thread(void *a) { barrier_wait(&barrier); GlobalData[2] = 42; return 0; } int main() { barrier_init(&barrier, 2); print_address("addr=", 1, GlobalData); pthread_t t; pthread_create(&t, 0, Thread, 0); GlobalData[2] = 43; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: Using atos at user-specified path: /usr/bin/atos // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'GlobalData' at [[ADDR]] ({{.*}}+0x{{[0-9,a-f]+}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/xpc.mm0000664000175000017500000000450212721346410025477 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import long global; int main(int argc, const char *argv[]) { @autoreleasepool { NSLog(@"Hello world."); dispatch_queue_t server_q = dispatch_queue_create("server.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_queue_t client_q = dispatch_queue_create("client.queue", DISPATCH_QUEUE_CONCURRENT); xpc_connection_t server_conn = xpc_connection_create(NULL, server_q); global = 42; xpc_connection_set_event_handler(server_conn, ^(xpc_object_t client) { NSLog(@"global = %ld", global); NSLog(@"server event handler, client = %@", client); if (client == XPC_ERROR_CONNECTION_INTERRUPTED || client == XPC_ERROR_CONNECTION_INVALID) { return; } xpc_connection_set_event_handler(client, ^(xpc_object_t object) { NSLog(@"received message: %@", object); xpc_object_t reply = xpc_dictionary_create_reply(object); if (!reply) return; xpc_dictionary_set_string(reply, "reply", "value"); xpc_connection_t remote = xpc_dictionary_get_remote_connection(object); xpc_connection_send_message(remote, reply); }); xpc_connection_resume(client); }); xpc_connection_resume(server_conn); xpc_endpoint_t endpoint = xpc_endpoint_create(server_conn); xpc_connection_t client_conn = xpc_connection_create_from_endpoint(endpoint); xpc_connection_set_event_handler(client_conn, ^(xpc_object_t event) { NSLog(@"client event handler, event = %@", event); }); xpc_object_t msg = xpc_dictionary_create(NULL, NULL, 0); xpc_dictionary_set_string(msg, "hello", "world"); NSLog(@"sending message: %@", msg); xpc_connection_send_message_with_reply( client_conn, msg, client_q, ^(xpc_object_t object) { NSLog(@"received reply: %@", object); xpc_connection_cancel(client_conn); xpc_connection_cancel(server_conn); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); xpc_connection_resume(client_conn); CFRunLoopRun(); NSLog(@"Done."); } return 0; } // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/symbolizer-dladdr.cc0000664000175000017500000000131112627123307030306 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %env_tsan_opts=verbosity=2:external_symbolizer_path= %deflake %run %t | FileCheck %s #include "../test.h" int GlobalData[10]; void *Thread(void *a) { barrier_wait(&barrier); GlobalData[2] = 42; return 0; } int main() { barrier_init(&barrier, 2); print_address("addr=", 1, GlobalData); pthread_t t; pthread_create(&t, 0, Thread, 0); GlobalData[2] = 43; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: External symbolizer is explicitly disabled. // CHECK: Using dladdr symbolizer. // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'GlobalData' at [[ADDR]] ({{.*}}+0x{{[0-9,a-f]+}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-serial.mm0000664000175000017500000000173212737162531030226 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL); dispatch_semaphore_t sem = dispatch_semaphore_create(0); dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, q); long long interval_ms = 10; dispatch_source_set_timer(timer, dispatch_time(DISPATCH_TIME_NOW, 0), interval_ms * NSEC_PER_MSEC, 0); dispatch_source_set_event_handler(timer, ^{ fprintf(stderr, "timer\n"); global++; if (global > 50) { dispatch_semaphore_signal(sem); } }); dispatch_resume(timer); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-semaphore-norace.mm0000664000175000017500000000123312701442366030673 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main() { NSLog(@"Hello world."); global = 42; dispatch_semaphore_t sem = dispatch_semaphore_create(0); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ global = 43; dispatch_semaphore_signal(sem); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); global = 44; NSLog(@"Done."); return 0; } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/lit.local.cfg0000664000175000017500000000026712621111733026715 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Darwin']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-serial-queue-norace.mm0000664000175000017500000000160212701442366031311 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main() { NSLog(@"Hello world."); NSLog(@"addr=%p\n", &global); dispatch_queue_t q1 = dispatch_queue_create("my.queue1", DISPATCH_QUEUE_CONCURRENT); dispatch_queue_t q2 = dispatch_queue_create("my.queue2", DISPATCH_QUEUE_SERIAL); global = 42; for (int i = 0; i < 10; i++) { dispatch_async(q1, ^{ for (int i = 0; i < 100; i++) { dispatch_sync(q2, ^{ global++; }); } }); } dispatch_barrier_async(q1, ^{ dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); NSLog(@"Done."); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/osspinlock-norace.cc0000664000175000017500000000113012630055574030313 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include int Global; OSSpinLock lock; void *Thread(void *x) { OSSpinLockLock(&lock); Global++; OSSpinLockUnlock(&lock); return NULL; } int main() { fprintf(stderr, "Hello world.\n"); pthread_t t[2]; pthread_create(&t[0], NULL, Thread, NULL); pthread_create(&t[1], NULL, Thread, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/libcxx-shared-ptr-recursive.mm0000664000175000017500000000140312740264474032261 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import struct InnerStruct { ~InnerStruct() { fprintf(stderr, "~InnerStruct\n"); } }; struct MyStruct { std::shared_ptr inner_object; ~MyStruct() { fprintf(stderr, "~MyStruct\n"); } }; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); { std::shared_ptr shared(new MyStruct()); shared->inner_object = std::shared_ptr(new InnerStruct()); } fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: ~MyStruct // CHECK: ~InnerStruct // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/malloc-stack-logging.cc0000664000175000017500000000123012674764646030700 0ustar mwhudsonmwhudson// Test that MallocStackLogging=1 doesn't crash. MallocStackLogging turns on // callbacks from mmap/munmap libc function into libmalloc. Darwin-specific // ThreadState initialization needs to avoid calling the library functions (and // use syscalls directly) to make sure other interceptors aren't called. // RUN: %clangxx_tsan -O1 %s -o %t // RUN: MallocStackLogging=1 %run %t 2>&1 | FileCheck %s #include #include #include void *foo(void *p) { return NULL; } int main() { pthread_t t; pthread_create(&t, NULL, foo, NULL); pthread_join(t, NULL); fprintf(stderr, "Done.\n"); return 0; } // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/xpc-race.mm0000664000175000017500000000452012721346410026407 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s #import #import #import "../test.h" long global; long received_msgs; xpc_connection_t server_conn; xpc_connection_t client_conns[2]; int main(int argc, const char *argv[]) { @autoreleasepool { NSLog(@"Hello world."); barrier_init(&barrier, 2); dispatch_queue_t server_q = dispatch_queue_create("server.queue", DISPATCH_QUEUE_CONCURRENT); server_conn = xpc_connection_create(NULL, server_q); xpc_connection_set_event_handler(server_conn, ^(xpc_object_t client) { NSLog(@"server event handler, client = %@", client); if (client == XPC_ERROR_CONNECTION_INTERRUPTED || client == XPC_ERROR_CONNECTION_INVALID) { return; } xpc_connection_set_event_handler(client, ^(xpc_object_t object) { NSLog(@"received message: %@", object); barrier_wait(&barrier); global = 42; dispatch_sync(dispatch_get_main_queue(), ^{ received_msgs++; if (received_msgs >= 2) { xpc_connection_cancel(client_conns[0]); xpc_connection_cancel(client_conns[1]); xpc_connection_cancel(server_conn); CFRunLoopStop(CFRunLoopGetCurrent()); } }); }); xpc_connection_resume(client); }); xpc_connection_resume(server_conn); xpc_endpoint_t endpoint = xpc_endpoint_create(server_conn); for (int i = 0; i < 2; i++) { client_conns[i] = xpc_connection_create_from_endpoint(endpoint); xpc_connection_set_event_handler(client_conns[i], ^(xpc_object_t event) { NSLog(@"client event handler, event = %@", event); }); xpc_object_t msg = xpc_dictionary_create(NULL, NULL, 0); xpc_dictionary_set_string(msg, "hello", "world"); NSLog(@"sending message: %@", msg); xpc_connection_send_message(client_conns[i], msg); xpc_connection_resume(client_conns[i]); } CFRunLoopRun(); NSLog(@"Done."); } return 0; } // CHECK: Hello world. // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 8 // CHECK: #0 {{.*}}xpc-race.mm:34 // CHECK: Previous write of size 8 // CHECK: #0 {{.*}}xpc-race.mm:34 // CHECK: Location is global 'global' // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-barrier-race.mm0000664000175000017500000000222712734254423030006 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main() { fprintf(stderr, "Hello world.\n"); print_address("addr=", 1, &global); barrier_init(&barrier, 2); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_queue_t bgq = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_barrier_sync(q, ^{ global = 42; }); dispatch_async(bgq, ^{ dispatch_sync(q, ^{ global = 43; barrier_wait(&barrier); }); }); dispatch_async(bgq, ^{ dispatch_sync(q, ^{ barrier_wait(&barrier); global = 44; dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); }); CFRunLoopRun(); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'global' {{(of size 8 )?}}at [[ADDR]] (gcd-barrier-race.mm.tmp+0x{{[0-9,a-f]+}}) // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-io-barrier.mm0000664000175000017500000000263012740740776027511 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import dispatch_queue_t queue; dispatch_data_t data; dispatch_semaphore_t sem; const char *path; long my_global = 0; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; NSData *ns_data = [NSMutableData dataWithLength:1000]; data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); dispatch_io_set_high_water(channel, 1); for (int i = 0; i < 1000; i++) { dispatch_io_barrier(channel, ^{ my_global = 42; }); } dispatch_io_barrier(channel, ^{ my_global = 43; dispatch_semaphore_signal(sem); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); dispatch_io_close(channel, 0); fprintf(stderr, "Done.\n"); return 0; } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-async-norace.mm0000664000175000017500000000106412701442366030027 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main() { NSLog(@"Hello world."); global = 42; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ global = 43; dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); NSLog(@"Done."); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/osatomics-bitops.mm0000664000175000017500000000200412750127234030202 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation -std=c++11 // RUN: %run %t 2>&1 | FileCheck %s #import #import int main(int argc, const char *argv[]) { int value = 1; bool ret = OSAtomicTestAndClear(7, &value); fprintf(stderr, "value = %d, ret = %d\n", value, ret); // CHECK: value = 0, ret = 1 ret = OSAtomicTestAndSet(4, &value); fprintf(stderr, "value = %d, ret = %d\n", value, ret); // CHECK: value = 8, ret = 0 ret = OSAtomicTestAndClear(4, &value); fprintf(stderr, "value = %d, ret = %d\n", value, ret); // CHECK: value = 0, ret = 1 ret = OSAtomicTestAndSet(12, &value); fprintf(stderr, "value = %d, ret = %d\n", value, ret); // CHECK: value = 2048, ret = 0 ret = OSAtomicTestAndSet(13, &value); fprintf(stderr, "value = %d, ret = %d\n", value, ret); // CHECK: value = 3072, ret = 0 ret = OSAtomicTestAndClear(12, &value); fprintf(stderr, "value = %d, ret = %d\n", value, ret); // CHECK: value = 1024, ret = 1 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-apply-race.mm0000664000175000017500000000147412766253102027506 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main(int argc, const char *argv[]) { barrier_init(&barrier, 2); fprintf(stderr, "start\n"); // Warm up GCD (workaround for macOS Sierra where dispatch_apply might run single-threaded). dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ }); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_apply(2, q, ^(size_t i) { global = i; barrier_wait(&barrier); }); fprintf(stderr, "done\n"); return 0; } // CHECK: start // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'global' // CHECK: done golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-registration2.mm0000664000175000017500000000143712701443315031536 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; void handler(void *arg) { fprintf(stderr, "global = %ld\n", global); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); } int main(int argc, const char *argv[]) { dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGHUP, 0, queue); global = 42; dispatch_source_set_registration_handler_f(source, handler); dispatch_resume(source); CFRunLoopRun(); return 0; } // CHECK: global = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-event.mm0000664000175000017500000000150412701443315030056 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main(int argc, const char *argv[]) { dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); dispatch_source_set_timer(source, dispatch_walltime(NULL, 0), 1e9, 5); global = 42; dispatch_source_set_event_handler(source, ^{ fprintf(stderr, "global = %ld\n", global); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); dispatch_resume(source); CFRunLoopRun(); return 0; } // CHECK: global = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-data.mm0000664000175000017500000000165412737446515026374 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL); dispatch_semaphore_t sem = dispatch_semaphore_create(0); global = 44; dispatch_data_t data = dispatch_data_create("buffer", 6, q, ^{ fprintf(stderr, "Data destructor.\n"); global++; dispatch_semaphore_signal(sem); }); dispatch_release(data); data = nil; dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); data = dispatch_data_create("buffer", 6, q, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_release(data); data = nil; fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Data destructor. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/malloc_size.mm0000664000175000017500000000233412721346410027207 0ustar mwhudsonmwhudson// Test that malloc_zone_from_ptr returns a valid zone for a 0-sized allocation. // RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include int some_global; void describe_zone(void *p) { malloc_zone_t *z = malloc_zone_from_ptr(p); if (z) { fprintf(stderr, "zone = %p\n", z); } else { fprintf(stderr, "zone = no zone\n"); } } int main() { void *p; size_t s; p = malloc(0x40); s = malloc_size(p); fprintf(stderr, "size = 0x%zx\n", s); // CHECK: size = 0x40 describe_zone(p); // CHECK: zone = 0x{{[0-9a-f]+}} p = malloc(0); s = malloc_size(p); fprintf(stderr, "size = 0x%zx\n", s); // CHECK: size = 0x1 describe_zone(p); // CHECK: zone = 0x{{[0-9a-f]+}} p = &some_global; s = malloc_size(p); fprintf(stderr, "size = 0x%zx\n", s); // CHECK: size = 0x0 describe_zone(p); // CHECK: zone = no zone p = mmap(0, 0x1000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); if (!p) { fprintf(stderr, "mmap failed\n"); exit(1); } s = malloc_size(p); fprintf(stderr, "size = 0x%zx\n", s); // CHECK: size = 0x0 describe_zone(p); // CHECK: zone = no zone } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-groups-norace.mm0000664000175000017500000000210512701442366030226 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main() { NSLog(@"Hello world."); NSLog(@"addr=%p\n", &global); dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); global = 42; dispatch_group_t g = dispatch_group_create(); dispatch_group_async(g, q, ^{ global = 43; }); dispatch_group_wait(g, DISPATCH_TIME_FOREVER); global = 44; dispatch_group_enter(g); dispatch_async(q, ^{ global = 45; dispatch_group_leave(g); }); dispatch_group_wait(g, DISPATCH_TIME_FOREVER); global = 46; dispatch_group_enter(g); dispatch_async(q, ^{ global = 47; dispatch_group_leave(g); }); dispatch_group_notify(g, q, ^{ global = 48; dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); NSLog(@"Done."); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-apply.mm0000664000175000017500000000211412766253102026566 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; long array[2]; void callback(void *context, size_t i) { long n = global; array[i] = n + i; barrier_wait(&barrier); } int main(int argc, const char *argv[]) { barrier_init(&barrier, 2); fprintf(stderr, "start\n"); // Warm up GCD (workaround for macOS Sierra where dispatch_apply might run single-threaded). dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ }); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); global = 42; dispatch_apply(100, q, ^(size_t i) { long n = global; array[i] = n + i; barrier_wait(&barrier); }); for (int i = 0; i < 100; i++) { fprintf(stderr, "array[%d] = %ld\n", i, array[i]); } global = 43; dispatch_apply_f(100, q, NULL, &callback); fprintf(stderr, "done\n"); return 0; } // CHECK: start // CHECK: done // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/ignored-interceptors.mm0000664000175000017500000000322212735464110031054 0ustar mwhudsonmwhudson// Check that ignore_interceptors_accesses=1 supresses reporting races from // system libraries on OS X. There are currently false positives coming from // libxpc, libdispatch, CoreFoundation and others, because these libraries use // TSan-invisible atomics as synchronization. // RUN: %clang_tsan %s -o %t -framework Foundation // Check that without the flag, there are false positives. // RUN: %deflake %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RACE // With ignore_interceptors_accesses=1, no races are reported. // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s // With ignore_interceptors_accesses=1, races in user's code are still reported. // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t race 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RACE #import #import "../test.h" long global; void *Thread1(void *x) { barrier_wait(&barrier); global = 42; return NULL; } void *Thread2(void *x) { global = 43; barrier_wait(&barrier); return NULL; } int main(int argc, char *argv[]) { fprintf(stderr, "Hello world.\n"); // NSUserDefaults uses XPC which triggers the false positive. NSDictionary *d = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; if (argc > 1 && strcmp(argv[1], "race") == 0) { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK-RACE: SUMMARY: ThreadSanitizer: data race // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-sync-norace.mm0000664000175000017500000000126412701442366027670 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; static const long nIter = 1000; int main() { NSLog(@"Hello world."); global = 42; for (int i = 0; i < nIter; i++) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_sync(dispatch_get_main_queue(), ^{ global = i; if (i == nIter - 1) { CFRunLoopStop(CFRunLoopGetCurrent()); } }); }); } CFRunLoopRun(); NSLog(@"Done."); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/libcxx-shared-ptr.mm0000664000175000017500000000175212740264474030263 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import #import "../test.h" long my_global; struct MyStruct { void setGlobal() { my_global = 42; } ~MyStruct() { my_global = 43; } }; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); print_address("addr=", 1, &my_global); barrier_init(&barrier, 2); std::shared_ptr shared(new MyStruct()); dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); std::weak_ptr weak(shared); dispatch_async(q, ^{ { std::shared_ptr strong = weak.lock(); if (!strong) exit(1); strong->setGlobal(); } barrier_wait(&barrier); }); barrier_wait(&barrier); shared.reset(); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-cancel.mm0000664000175000017500000000154012701443315030162 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main(int argc, const char *argv[]) { dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); dispatch_source_set_timer(source, dispatch_walltime(NULL, 0), 1e9, 5); global = 42; dispatch_source_set_cancel_handler(source, ^{ fprintf(stderr, "global = %ld\n", global); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); dispatch_resume(source); dispatch_cancel(source); CFRunLoopRun(); return 0; } // CHECK: global = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-blocks.mm0000664000175000017500000000147612740264474026736 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import int main() { fprintf(stderr, "start\n"); dispatch_queue_t background_q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_queue_t main_q = dispatch_get_main_queue(); dispatch_async(background_q, ^{ __block long block_var = 0; dispatch_sync(main_q, ^{ block_var = 42; }); fprintf(stderr, "block_var = %ld\n", block_var); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); fprintf(stderr, "done\n"); } // CHECK: start // CHECK: block_var = 42 // CHECK: done // CHECK-NOT: WARNING: ThreadSanitizer // CHECK-NOT: CHECK failed golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/dispatch_main.mm0000664000175000017500000000145112700500015027476 0ustar mwhudsonmwhudson// Check that we don't crash when dispatch_main calls pthread_exit which // quits the main thread. // RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import int main() { fprintf(stderr,"Hello world"); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL); dispatch_async(q, ^{ fprintf(stderr,"1"); }); dispatch_async(q, ^{ fprintf(stderr,"2"); }); dispatch_async(q, ^{ fprintf(stderr,"3"); dispatch_async(dispatch_get_main_queue(), ^{ fprintf(stderr,"Done."); sleep(1); exit(0); }); }); dispatch_main(); } // CHECK: Hello world // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK-NOT: CHECK failed golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-barrier.mm0000664000175000017500000000206212734254423027073 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main() { fprintf(stderr, "Hello world.\n"); print_address("addr=", 1, &global); barrier_init(&barrier, 2); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_queue_t bgq = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(bgq, ^{ dispatch_sync(q, ^{ global = 42; }); barrier_wait(&barrier); }); dispatch_async(bgq, ^{ barrier_wait(&barrier); dispatch_barrier_sync(q, ^{ global = 43; }); dispatch_async(bgq, ^{ barrier_wait(&barrier); global = 44; }); barrier_wait(&barrier); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-groups-leave.mm0000664000175000017500000000235712736735306030073 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import "../test.h" dispatch_semaphore_t sem; long global; long global2; void callback(void *context) { global2 = 48; barrier_wait(&barrier); dispatch_semaphore_signal(sem); } int main() { fprintf(stderr, "Hello world.\n"); barrier_init(&barrier, 2); dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_group_t g = dispatch_group_create(); sem = dispatch_semaphore_create(0); dispatch_group_enter(g); dispatch_async(q, ^{ global = 47; dispatch_group_leave(g); barrier_wait(&barrier); }); dispatch_group_notify(g, q, ^{ global = 48; barrier_wait(&barrier); dispatch_semaphore_signal(sem); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); dispatch_group_enter(g); dispatch_async(q, ^{ global2 = 47; dispatch_group_leave(g); barrier_wait(&barrier); }); dispatch_group_notify_f(g, q, NULL, &callback); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-registration.mm0000664000175000017500000000140712701443315031451 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; int main(int argc, const char *argv[]) { dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGHUP, 0, queue); global = 42; dispatch_source_set_registration_handler(source, ^{ fprintf(stderr, "global = %ld\n", global); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); dispatch_resume(source); CFRunLoopRun(); return 0; } // CHECK: global = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-groups-stress.mm0000664000175000017500000000200212701442366030276 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import void notify_callback(void *context) { // Do nothing. } int main() { NSLog(@"Hello world."); dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); for (int i = 0; i < 300000; i++) { dispatch_group_t g = dispatch_group_create(); dispatch_group_enter(g); dispatch_async(q, ^{ dispatch_group_leave(g); }); dispatch_group_notify(g, q, ^{ // Do nothing. }); dispatch_release(g); } for (int i = 0; i < 300000; i++) { dispatch_group_t g = dispatch_group_create(); dispatch_group_enter(g); dispatch_async(q, ^{ dispatch_group_leave(g); }); dispatch_group_notify_f(g, q, NULL, ¬ify_callback); dispatch_release(g); } NSLog(@"Done."); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK-NOT: CHECK failed golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-event2.mm0000664000175000017500000000153512701443315030144 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; void handler(void *arg) { fprintf(stderr, "global = %ld\n", global); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); } int main(int argc, const char *argv[]) { dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); dispatch_source_set_timer(source, dispatch_walltime(NULL, 0), 1e9, 5); global = 42; dispatch_source_set_event_handler_f(source, &handler); dispatch_resume(source); CFRunLoopRun(); return 0; } // CHECK: global = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/objc-simple.mm0000664000175000017500000000053112734500771027115 0ustar mwhudsonmwhudson// Test that a simple Obj-C program runs and exits without any warnings. // RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import int main() { NSLog(@"Hello world"); } // CHECK: Hello world // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-after.mm0000664000175000017500000000176612717356136026565 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long my_global; long my_global2; void callback(void *context) { my_global2 = 42; dispatch_async(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetMain()); }); } int main(int argc, const char *argv[]) { fprintf(stderr, "start\n"); my_global = 10; dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_MSEC)), q, ^{ my_global = 42; dispatch_async(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetMain()); }); }); CFRunLoopRun(); my_global2 = 10; dispatch_after_f(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_MSEC)), q, NULL, &callback); CFRunLoopRun(); fprintf(stderr, "done\n"); return 0; } // CHECK: start // CHECK: done // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-fd.mm0000664000175000017500000000361712740740776026055 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long my_global = 0; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL); dispatch_semaphore_t sem = dispatch_semaphore_create(0); NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path.fileSystemRepresentation, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); dispatch_io_set_high_water(channel, 1); NSData *ns_data = [NSMutableData dataWithLength:1000]; dispatch_data_t data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); my_global++; dispatch_io_write(channel, 0, data, queue, ^(bool done, dispatch_data_t remainingData, int error) { my_global++; dispatch_async(queue, ^{ my_global++; if (done) { dispatch_semaphore_signal(sem); } }); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; dispatch_io_close(channel, 0); channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path.fileSystemRepresentation, O_RDONLY, 0, queue, ^(int error) { }); dispatch_io_set_high_water(channel, 1); my_global++; dispatch_io_read(channel, 0, SIZE_MAX, queue, ^(bool done, dispatch_data_t remainingData, int error) { my_global++; dispatch_async(queue, ^{ my_global++; if (done) { dispatch_semaphore_signal(sem); } }); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; fprintf(stderr, "Done.\n"); return 0; } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/osatomics-list.mm0000664000175000017500000000142612740264474027673 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation -std=c++11 // RUN: %run %t 2>&1 | FileCheck %s #import #import #include #include "../test.h" typedef struct { void *next; long data; } ListItem; OSQueueHead q; int main(int argc, const char *argv[]) { barrier_init(&barrier, 2); std::thread t1([] { ListItem *li = new ListItem{nullptr, 42}; OSAtomicEnqueue(&q, li, 0); barrier_wait(&barrier); }); std::thread t2([] { barrier_wait(&barrier); ListItem *li = (ListItem *)OSAtomicDequeue(&q, 0); fprintf(stderr, "data = %ld\n", li->data); }); t1.join(); t2.join(); fprintf(stderr, "done\n"); return 0; } // CHECK: data = 42 // CHECK: done // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/libcxx-call-once.mm0000664000175000017500000000127012764235070030036 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation -std=c++11 // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import #import long my_global; std::once_flag once_token; void thread_func() { std::call_once(once_token, [] { my_global = 17; }); long val = my_global; fprintf(stderr, "my_global = %ld\n", val); } int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); std::thread t1(thread_func); std::thread t2(thread_func); t1.join(); t2.join(); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/osatomics-add.mm0000664000175000017500000000132512740264474027446 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation -std=c++11 // RUN: %run %t 2>&1 | FileCheck %s #import #import #include volatile int64_t retainCount = 0; long g = 0; void dealloc() { g = 42; } void release() { if (OSAtomicAdd64Barrier(-1, &retainCount) == 0) { dealloc(); } } void retain() { OSAtomicAdd64Barrier(1, &retainCount); } int main(int argc, const char * argv[]) { fprintf(stderr, "start\n"); retain(); retain(); std::thread t([]{ release(); }); g = 47; release(); t.join(); fprintf(stderr, "end, g = %ld\n", g); return 0; } // CHECK: start // CHECK: end, g = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/dispatch_once_deadlock.mm0000664000175000017500000000141512736734252031351 0ustar mwhudsonmwhudson// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 not %run %t 2>&1 | FileCheck %s #import #import long g = 0; long h = 0; void f() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ g++; }); h++; } extern "C" void __tsan_on_report() { fprintf(stderr, "Report.\n"); f(); } int main() { fprintf(stderr, "Hello world.\n"); f(); pthread_mutex_t mutex = {0}; pthread_mutex_lock(&mutex); fprintf(stderr, "g = %ld.\n", g); fprintf(stderr, "h = %ld.\n", h); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Report. // CHECK: g = 1 // CHECK: h = 2 // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-sync-race.mm0000664000175000017500000000231512701442366027331 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main() { NSLog(@"Hello world."); print_address("addr=", 1, &global); barrier_init(&barrier, 2); dispatch_queue_t q1 = dispatch_queue_create("my.queue1", DISPATCH_QUEUE_CONCURRENT); dispatch_queue_t q2 = dispatch_queue_create("my.queue2", DISPATCH_QUEUE_CONCURRENT); global = 42; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_sync(q1, ^{ global = 43; barrier_wait(&barrier); }); }); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_sync(q2, ^{ barrier_wait(&barrier); global = 44; dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); }); CFRunLoopRun(); NSLog(@"Done."); } // CHECK: Hello world. // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'global' {{(of size 8 )?}}at [[ADDR]] (gcd-sync-race.mm.tmp+0x{{[0-9,a-f]+}}) // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-io.mm0000664000175000017500000000611212740740776026064 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import dispatch_queue_t queue; dispatch_data_t data; dispatch_semaphore_t sem; const char *path; long my_global = 0; void test_dispatch_io_write() { dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); dispatch_io_set_high_water(channel, 1); my_global++; dispatch_io_write(channel, 0, data, queue, ^(bool done, dispatch_data_t remainingData, int error) { if (error) abort(); my_global++; dispatch_async(queue, ^{ my_global++; if (done) { dispatch_semaphore_signal(sem); } }); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; dispatch_io_close(channel, 0); } void test_dispatch_write() { dispatch_fd_t fd = open(path, O_CREAT | O_WRONLY, 0666); if (fd == -1) abort(); my_global++; dispatch_write(fd, data, queue, ^(dispatch_data_t data, int error) { if (error) abort(); my_global++; dispatch_async(queue, ^{ my_global++; dispatch_semaphore_signal(sem); }); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; close(fd); } void test_dispatch_io_read() { dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_RDONLY, 0, queue, ^(int error) { }); dispatch_io_set_high_water(channel, 1); my_global++; dispatch_io_read(channel, 0, SIZE_MAX, queue, ^(bool done, dispatch_data_t remainingData, int error) { if (error) abort(); my_global++; dispatch_async(queue, ^{ my_global++; if (done) { dispatch_semaphore_signal(sem); } }); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; dispatch_io_close(channel, 0); } void test_dispatch_read() { dispatch_fd_t fd = open(path, O_RDONLY, 0); if (fd == -1) abort(); my_global++; dispatch_read(fd, SIZE_MAX, queue, ^(dispatch_data_t data, int error) { if (error) abort(); my_global++; dispatch_async(queue, ^{ my_global++; dispatch_semaphore_signal(sem); }); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; close(fd); } int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL); sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; NSData *ns_data = [NSMutableData dataWithLength:1000]; data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); test_dispatch_io_write(); test_dispatch_write(); test_dispatch_io_read(); test_dispatch_read(); fprintf(stderr, "Done.\n"); return 0; } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-once.mm0000664000175000017500000000206512701442366026373 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import "../test.h" static const long kNumThreads = 4; long global; long global2; static dispatch_once_t once_token; static dispatch_once_t once_token2; void f(void *) { global2 = 42; usleep(100000); } void *Thread(void *a) { barrier_wait(&barrier); dispatch_once(&once_token, ^{ global = 42; usleep(100000); }); long x = global; dispatch_once_f(&once_token2, NULL, f); long x2 = global2; fprintf(stderr, "global = %ld\n", x); fprintf(stderr, "global2 = %ld\n", x2); return 0; } int main() { fprintf(stderr, "Hello world.\n"); barrier_init(&barrier, kNumThreads); pthread_t t[kNumThreads]; for (int i = 0; i < kNumThreads; i++) { pthread_create(&t[i], 0, Thread, 0); } for (int i = 0; i < kNumThreads; i++) { pthread_join(t[i], 0); } fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/objc-race.mm0000664000175000017500000000224212701442366026536 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %deflake %run %t 2>&1 | FileCheck %s #import #import "../test.h" @interface MyClass : NSObject { long instance_variable; } - (void)method:(long)value; @end @implementation MyClass - (void)method:(long)value { self->instance_variable = value; } @end int main() { NSLog(@"Hello world."); barrier_init(&barrier, 2); MyClass *my_object = [MyClass new]; [my_object method:42]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [my_object method:43]; barrier_wait(&barrier); }); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ barrier_wait(&barrier); [my_object method:44]; dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); NSLog(@"Done."); return 0; } // CHECK: Hello world. // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 8 // CHECK: #0 -[MyClass method:] // CHECK: Previous write of size 8 // CHECK: #0 -[MyClass method:] // CHECK: Location is heap block // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-async-race.mm0000664000175000017500000000172012701442366027471 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s #import #import "../test.h" long global; int main() { NSLog(@"Hello world."); print_address("addr=", 1, &global); barrier_init(&barrier, 2); global = 42; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ global = 43; barrier_wait(&barrier); }); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ barrier_wait(&barrier); global = 44; dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); }); CFRunLoopRun(); NSLog(@"Done."); } // CHECK: Hello world. // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'global' {{(of size 8 )?}}at [[ADDR]] (gcd-async-race.mm.tmp+0x{{[0-9,a-f]+}}) // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-source-cancel2.mm0000664000175000017500000000157112701443315030250 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long global; void handler(void *arg) { fprintf(stderr, "global = %ld\n", global); dispatch_sync(dispatch_get_main_queue(), ^{ CFRunLoopStop(CFRunLoopGetCurrent()); }); } int main(int argc, const char *argv[]) { dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); dispatch_source_set_timer(source, dispatch_walltime(NULL, 0), 1e9, 5); global = 42; dispatch_source_set_cancel_handler_f(source, &handler); dispatch_resume(source); dispatch_cancel(source); CFRunLoopRun(); return 0; } // CHECK: global = 42 // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-io-barrier-race.mm0000664000175000017500000000340112740740776030416 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1 | FileCheck %s #import #import "../test.h" dispatch_queue_t queue; dispatch_data_t data; dispatch_semaphore_t sem; const char *path; long my_global = 0; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); print_address("addr=", 1, &my_global); barrier_init(&barrier, 2); queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; NSData *ns_data = [NSMutableData dataWithLength:1000]; data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); dispatch_io_set_high_water(channel, 1); dispatch_io_write(channel, 0, data, queue, ^(bool done, dispatch_data_t remainingData, int error) { if (error) abort(); my_global = 42; barrier_wait(&barrier); }); dispatch_io_barrier(channel, ^{ barrier_wait(&barrier); my_global = 43; dispatch_semaphore_signal(sem); }); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); dispatch_io_close(channel, 0); fprintf(stderr, "Done.\n"); return 0; } // CHECK: Hello world. // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'my_global' {{(of size 8 )?}}at [[ADDR]] (gcd-io-barrier-race.mm.tmp+0x{{[0-9,a-f]+}}) // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/realloc-zero.cc0000664000175000017500000000054012750126224027256 0ustar mwhudsonmwhudson// Test that realloc(nullptr, 0) return a non-NULL pointer. // RUN: %clang_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include int main() { void *p = realloc(nullptr, 0); if (!p) { abort(); } fprintf(stderr, "Okay.\n"); return 0; } // CHECK: Okay. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/libcxx-shared-ptr-stress.mm0000664000175000017500000000435312740264474031604 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import #import #import _Atomic(long) shared_call_counter = 0; _Atomic(long) weak_call_counter = 0; _Atomic(long) destructor_counter = 0; _Atomic(long) weak_destroyed_counter = 0; struct MyStruct { _Atomic(long) self_counter = 0; virtual void shared_call() { atomic_fetch_add_explicit(&self_counter, 1, memory_order_relaxed); atomic_fetch_add_explicit(&shared_call_counter, 1, memory_order_relaxed); } virtual void weak_call() { atomic_fetch_add_explicit(&weak_call_counter, 1, memory_order_relaxed); } virtual ~MyStruct() { long n = self_counter; assert(n == 1000); atomic_fetch_add_explicit(&destructor_counter, 1, memory_order_relaxed); } }; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_group_t g = dispatch_group_create(); for (int i = 0; i < 1000; i++) { std::shared_ptr shared(new MyStruct()); std::weak_ptr weak(shared); dispatch_group_async(g, q, ^{ for (int j = 0; j < 1000; j++) { std::shared_ptr shared_copy(shared); shared_copy->shared_call(); } }); dispatch_group_async(g, q, ^{ for (int j = 0; j < 1000; j++) { std::shared_ptr weak_copy = weak.lock(); if (weak_copy) { weak_copy->weak_call(); } else { atomic_fetch_add_explicit(&weak_destroyed_counter, 1, memory_order_relaxed); break; } } }); } dispatch_group_wait(g, DISPATCH_TIME_FOREVER); fprintf(stderr, "shared_call_counter = %ld\n", shared_call_counter); fprintf(stderr, "weak_call_counter = %ld\n", weak_call_counter); fprintf(stderr, "destructor_counter = %ld\n", destructor_counter); fprintf(stderr, "weak_destroyed_counter = %ld\n", weak_destroyed_counter); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: shared_call_counter = 1000000 // CHECK: destructor_counter = 1000 // CHECK: Done. // CHECK-NOT: WARNING: ThreadSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/dlopen.cc0000664000175000017500000000267412672466305026165 0ustar mwhudsonmwhudson// Checks that on OS X 10.11+ (where we do not re-exec anymore, because // interceptors work automatically), dlopen'ing a TSanified library from a // non-instrumented program exits with a user-friendly message. // REQUIRES: osx-autointerception // RUN: %clangxx_tsan %s -o %t.so -shared -DSHARED_LIB // RUN: %clangxx_tsan -fno-sanitize=thread %s -o %t // RUN: TSAN_DYLIB_PATH=`%clangxx_tsan %s -### 2>&1 \ // RUN: | grep "libclang_rt.tsan_osx_dynamic.dylib" \ // RUN: | sed -e 's/.*"\(.*libclang_rt.tsan_osx_dynamic.dylib\)".*/\1/'` // Launching a non-instrumented binary that dlopen's an instrumented library should fail. // RUN: not %run %t %t.so 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL // Launching a non-instrumented binary with an explicit DYLD_INSERT_LIBRARIES should work. // RUN: DYLD_INSERT_LIBRARIES=$TSAN_DYLIB_PATH %run %t %t.so 2>&1 | FileCheck %s #include #include #include #if defined(SHARED_LIB) extern "C" void foo() { fprintf(stderr, "Hello world.\n"); } #else // defined(SHARED_LIB) int main(int argc, char *argv[]) { void *handle = dlopen(argv[1], RTLD_NOW); fprintf(stderr, "handle = %p\n", handle); void (*foo)() = (void (*)())dlsym(handle, "foo"); fprintf(stderr, "foo = %p\n", foo); foo(); } #endif // defined(SHARED_LIB) // CHECK: Hello world. // CHECK-NOT: ERROR: Interceptors are not working. // CHECK-FAIL-NOT: Hello world. // CHECK-FAIL: ERROR: Interceptors are not working. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-groups-destructor.mm0000664000175000017500000000201512740264474031162 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import #import #import _Atomic(long) destructor_counter = 0; struct MyStruct { virtual ~MyStruct() { usleep(10000); atomic_fetch_add_explicit(&destructor_counter, 1, memory_order_relaxed); } }; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_group_t g = dispatch_group_create(); for (int i = 0; i < 100; i++) { std::shared_ptr shared(new MyStruct()); dispatch_group_async(g, q, ^{ shared.get(); // just to make sure the object is captured by the block }); } dispatch_group_wait(g, DISPATCH_TIME_FOREVER); if (destructor_counter != 100) { abort(); } fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/Darwin/gcd-io-cleanup.mm0000664000175000017500000000355712740740776027523 0ustar mwhudsonmwhudson// RUN: %clang_tsan %s -o %t -framework Foundation // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s #import long my_global = 0; int main(int argc, const char *argv[]) { fprintf(stderr, "Hello world.\n"); dispatch_queue_t queue = dispatch_queue_create("my.queue", DISPATCH_QUEUE_CONCURRENT); dispatch_semaphore_t sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; const char *path = ns_path.fileSystemRepresentation; dispatch_io_t channel; dispatch_fd_t fd = open(path, O_CREAT | O_WRONLY, 0666); my_global++; channel = dispatch_io_create(DISPATCH_IO_STREAM, fd, queue, ^(int error) { my_global++; dispatch_semaphore_signal(sem); }); if (! channel) abort(); my_global++; dispatch_io_close(channel, 0); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { my_global++; dispatch_semaphore_signal(sem); }); if (! channel) abort(); my_global++; dispatch_io_close(channel, 0); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); my_global++; dispatch_io_t other_channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); channel = dispatch_io_create_with_io(DISPATCH_IO_STREAM, other_channel, queue, ^(int error) { my_global++; dispatch_semaphore_signal(sem); }); if (! channel) abort(); my_global++; dispatch_io_close(channel, 0); dispatch_io_close(other_channel, 0); dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); fprintf(stderr, "Done.\n"); return 0; } // CHECK: Hello world. // CHECK-NOT: WARNING: ThreadSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/thread_leak5.c0000664000175000017500000000101712457727212025631 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" void *Thread(void *x) { barrier_wait(&barrier); return 0; } int main() { volatile int N = 5; // prevent loop unrolling barrier_init(&barrier, N + 1); for (int i = 0; i < N; i++) { pthread_t t; pthread_create(&t, 0, Thread, 0); } barrier_wait(&barrier); sleep(1); // wait for the threads to finish and exit return 0; } // CHECK: WARNING: ThreadSanitizer: thread leak // CHECK: And 4 more similar thread leaks golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/atomic_stack.cc0000664000175000017500000000123012457727212026102 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; void *Thread1(void *x) { barrier_wait(&barrier); __atomic_fetch_add(&Global, 1, __ATOMIC_RELAXED); return NULL; } void *Thread2(void *x) { Global++; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Atomic write of size 4 // CHECK: #0 __tsan_atomic32_fetch_add // CHECK: #1 Thread1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib2.cc0000664000175000017500000000200012623403316025617 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib2_0.so // RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib2_1.so // RUN: %clangxx_tsan -O1 %s -o %t // RUN: %env_tsan_opts=suppressions='%s.supp' %deflake %run %t | FileCheck %s // Tests that called_from_lib suppression matched against 2 libraries // causes program crash (this is not supported). #ifndef LIB #include #include #include #include int main(int argc, char **argv) { std::string lib0 = std::string(dirname(argv[0])) + "/libignore_lib2_0.so"; std::string lib1 = std::string(dirname(argv[0])) + "/libignore_lib2_1.so"; dlopen(lib0.c_str(), RTLD_GLOBAL | RTLD_NOW); dlopen(lib1.c_str(), RTLD_GLOBAL | RTLD_NOW); fprintf(stderr, "OK\n"); } #else // #ifdef LIB extern "C" void libfunc() { } #endif // #ifdef LIB // CHECK: ThreadSanitizer: called_from_lib suppression 'ignore_lib2' is matched against 2 libraries // CHECK-NOT: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mutex_cycle2.c0000664000175000017500000000221512623403316025674 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_tsan_opts=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_tsan_opts=detect_deadlocks=0 %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: echo "deadlock:main" > %t.supp // RUN: %env_tsan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: echo "deadlock:zzzz" > %t.supp // RUN: %env_tsan_opts=suppressions='%t.supp' not %run %t 2>&1 | FileCheck %s #include #include int main() { pthread_mutex_t mu1, mu2; pthread_mutex_init(&mu1, NULL); pthread_mutex_init(&mu2, NULL); // mu1 => mu2 pthread_mutex_lock(&mu1); pthread_mutex_lock(&mu2); pthread_mutex_unlock(&mu2); pthread_mutex_unlock(&mu1); // mu2 => mu1 pthread_mutex_lock(&mu2); pthread_mutex_lock(&mu1); // CHECK: ThreadSanitizer: lock-order-inversion (potential deadlock) // DISABLED-NOT: ThreadSanitizer // DISABLED: PASS pthread_mutex_unlock(&mu1); pthread_mutex_unlock(&mu2); pthread_mutex_destroy(&mu1); pthread_mutex_destroy(&mu2); fprintf(stderr, "PASS\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib1.cc.supp0000664000175000017500000000004512223271415026612 0ustar mwhudsonmwhudsoncalled_from_lib:/libignore_lib1.so$ golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_race_pc.cc0000664000175000017500000000177612666222414026051 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // This test fails on powerpc64 big endian. // The Tsan report is returning wrong information about // the location of the race. // XFAIL: powerpc64-unknown-linux-gnu #include "java.h" void foobar() { } void barbaz() { } void *Thread(void *p) { barrier_wait(&barrier); __tsan_read1_pc((jptr)p, (jptr)foobar + kPCInc); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); pthread_t th; pthread_create(&th, 0, Thread, (void*)jheap); __tsan_write1_pc((jptr)jheap, (jptr)barbaz + kPCInc); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: #0 foobar // CHECK: #0 barbaz // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_acquire_release.cc0000664000175000017500000000057412623335072027735 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" int x; void thread(int tid) { for (int i = 0; i < bench_niter; i++) __atomic_fetch_add(&x, 1, __ATOMIC_ACQ_REL); } void bench() { start_thread_group(bench_nthread, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_rwmutex.cc0000664000175000017500000000107612623335072026315 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" pthread_rwlock_t mtx; void thread(int tid) { for (int i = 0; i < bench_niter; i++) { pthread_rwlock_rdlock(&mtx); pthread_rwlock_unlock(&mtx); } } void bench() { pthread_rwlock_init(&mtx, 0); pthread_rwlock_wrlock(&mtx); pthread_rwlock_unlock(&mtx); pthread_rwlock_rdlock(&mtx); pthread_rwlock_unlock(&mtx); start_thread_group(bench_nthread, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/barrier.cc0000664000175000017500000000200012623335072025055 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // CHECK-NOT: ThreadSanitizer: data race // CHECK: DONE // pthread barriers are not available on OS X // UNSUPPORTED: darwin #include #include #include #include const int kSize = 4; volatile int kIter = 10; // prevent unwinding int data[2][kSize]; pthread_barrier_t barrier; void *thr(void *p) { int idx = (int)(long)p; for (int i = 0; i < kIter; i++) { int *prev = data[i % 2]; int *curr = data[(i + 1) % 2]; int left = idx - 1 >= 0 ? prev[idx - 1] : 0; int right = idx + 1 < kSize ? prev[idx + 1] : 0; curr[idx] = (left + right) / 2; pthread_barrier_wait(&barrier); } return 0; } int main() { pthread_barrier_init(&barrier, 0, kSize); pthread_t th[kSize]; for (int i = 0; i < kSize; i++) pthread_create(&th[i], 0, thr, (void*)(long)i); for (int i = 0; i < kSize; i++) pthread_join(th[i], 0); pthread_barrier_destroy(&barrier); fprintf(stderr, "DONE\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib1.cc0000664000175000017500000000236312623403316025632 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib1.so // RUN: %clangxx_tsan -O1 %s -o %t // RUN: echo running w/o suppressions: // RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP // RUN: echo running with suppressions: // RUN: %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP // Tests that interceptors coming from a dynamically loaded library specified // in called_from_lib suppression are ignored. // REQUIRES: stable-runtime #ifndef LIB #include #include #include #include #include #include int main(int argc, char **argv) { std::string lib = std::string(dirname(argv[0])) + "/libignore_lib1.so"; void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW); if (h == 0) exit(printf("failed to load the library (%d)\n", errno)); void (*f)() = (void(*)())dlsym(h, "libfunc"); if (f == 0) exit(printf("failed to find the func (%d)\n", errno)); f(); } #else // #ifdef LIB #include "ignore_lib_lib.h" #endif // #ifdef LIB // CHECK-NOSUPP: WARNING: ThreadSanitizer: data race // CHECK-NOSUPP: OK // CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race // CHECK-WITHSUPP: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/race_on_write.cc0000664000175000017500000000142112457727212026263 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include #include #include int fd; char buf; void *Thread1(void *x) { buf = 1; barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { write(fd, &buf, 1); return NULL; } int main() { barrier_init(&barrier, 2); fd = open("/dev/null", O_WRONLY); if (fd < 0) return 1; pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); barrier_wait(&barrier); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); close(fd); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Read of size 1 // CHECK: #0 write // CHECK: Previous write of size 1 // CHECK: #0 Thread1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/java_symbolization.cc0000664000175000017500000000244612542525314027351 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "java.h" #include extern "C" bool __tsan_symbolize_external(jptr pc, char *func_buf, jptr func_siz, char *file_buf, jptr file_siz, int *line, int *col) { if (pc == (1234 | kExternalPCBit)) { memcpy(func_buf, "MyFunc", sizeof("MyFunc")); memcpy(file_buf, "MyFile.java", sizeof("MyFile.java")); *line = 1234; *col = 56; return true; } return false; } void *Thread(void *p) { barrier_wait(&barrier); __tsan_write1_pc((jptr)p, 1234 | kExternalPCBit); return 0; } int main() { barrier_init(&barrier, 2); int const kHeapSize = 1024 * 1024; jptr jheap = (jptr)malloc(kHeapSize + 8) + 8; __tsan_java_init(jheap, kHeapSize); const int kBlockSize = 16; __tsan_java_alloc(jheap, kBlockSize); pthread_t th; pthread_create(&th, 0, Thread, (void*)jheap); __tsan_write1_pc((jptr)jheap, 1234 | kExternalPCBit); barrier_wait(&barrier); pthread_join(th, 0); __tsan_java_free(jheap, kBlockSize); fprintf(stderr, "DONE\n"); return __tsan_java_fini(); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: #0 MyFunc MyFile.java:1234:56 // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mop1.c0000664000175000017500000000176212517746252024166 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" // We want to establish the following sequence of accesses to X: // - main thread writes X // - thread2 reads X, this read happens-before the write in main thread // - thread1 reads X, this read is concurrent with the write in main thread // Write in main thread and read in thread1 should be detected as a race. // Previously tsan replaced write by main thread with read by thread1, // as the result the race was not detected. volatile long X, Y, Z; void *Thread1(void *x) { barrier_wait(&barrier); barrier_wait(&barrier); Y = X; return NULL; } void *Thread2(void *x) { Z = X; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); X = 42; barrier_wait(&barrier); pthread_create(&t[1], 0, Thread2, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); return 0; } // CHECK: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/tls_race.cc0000664000175000017500000000114012624545615025236 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK #include "test.h" void *Thread(void *a) { barrier_wait(&barrier); *(int*)a = 43; return 0; } int main() { barrier_init(&barrier, 2); static __thread int Var = 42; pthread_t t; pthread_create(&t, 0, Thread, &Var); Var = 43; barrier_wait(&barrier); pthread_join(t, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-Linux: Location is TLS of main thread. // CHECK-FreeBSD: Location is TLS of main thread. // CHECK-Darwin: Location is heap block of size 4 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/inlined_memcpy_race2.cc0000664000175000017500000000146412704157670027522 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include "test.h" #include int y[4], z[4]; void *MemMoveThread(void *a) { memmove((int*)a, z, 16); barrier_wait(&barrier); return NULL; } void *MemSetThread(void *a) { barrier_wait(&barrier); memset((int*)a, 0, 16); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; // Race on y between memmove and memset pthread_create(&t[0], NULL, MemMoveThread, y); pthread_create(&t[1], NULL, MemSetThread, y); pthread_join(t[0], NULL); pthread_join(t[1], NULL); fprintf(stderr, "PASS\n"); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: #0 memset // CHECK: #1 MemSetThread // CHECK: Previous write // CHECK: #0 {{(memcpy|memmove)}} // CHECK: #1 MemMoveThread golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/simple_stack.c0000664000175000017500000000377612461071552025767 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int Global; void __attribute__((noinline)) foo1() { Global = 42; } void __attribute__((noinline)) bar1() { volatile int tmp = 42; (void)tmp; foo1(); } void __attribute__((noinline)) foo2() { volatile int v = Global; (void)v; } void __attribute__((noinline)) bar2() { volatile int tmp = 42; (void)tmp; foo2(); } void *Thread1(void *x) { barrier_wait(&barrier); bar1(); return NULL; } void *Thread2(void *x) { bar2(); barrier_wait(&barrier); return NULL; } void StartThread(pthread_t *t, void *(*f)(void*)) { pthread_create(t, NULL, f, NULL); } int main() { barrier_init(&barrier, 2); pthread_t t[2]; StartThread(&t[0], Thread1); StartThread(&t[1], Thread2); pthread_join(t[0], NULL); pthread_join(t[1], NULL); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NEXT: Write of size 4 at {{.*}} by thread T1: // CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack.c:7{{(:10)?}} ({{.*}}) // CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack.c:12{{(:3)?}} ({{.*}}) // CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack.c:26{{(:3)?}} ({{.*}}) // CHECK: Previous read of size 4 at {{.*}} by thread T2: // CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack.c:16{{(:20)?}} ({{.*}}) // CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack.c:21{{(:3)?}} ({{.*}}) // CHECK-NEXT: #2 Thread2{{.*}} {{.*}}simple_stack.c:31{{(:3)?}} ({{.*}}) // CHECK: Thread T1 (tid={{.*}}, running) created by main thread at: // CHECK-NEXT: #0 pthread_create {{.*}} ({{.*}}) // CHECK-NEXT: #1 StartThread{{.*}} {{.*}}simple_stack.c:37{{(:3)?}} ({{.*}}) // CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack.c:43{{(:3)?}} ({{.*}}) // CHECK: Thread T2 ({{.*}}) created by main thread at: // CHECK-NEXT: #0 pthread_create {{.*}} ({{.*}}) // CHECK-NEXT: #1 StartThread{{.*}} {{.*}}simple_stack.c:37{{(:3)?}} ({{.*}}) // CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack.c:44{{(:3)?}} ({{.*}}) golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/signal_sync2.cc0000664000175000017500000000354212663111752026037 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // UNSUPPORTED: darwin #include #include #include #include #include #include #include #include // Test synchronization in signal handled within IgnoreSync region. extern "C" void AnnotateIgnoreSyncBegin(const char *f, int l); extern "C" void AnnotateIgnoreSyncEnd(const char *f, int l); const int kSignalCount = 500; __thread int process_signals; int signals_handled; int done; int ready[kSignalCount]; long long data[kSignalCount]; static void handler(int sig) { if (!__atomic_load_n(&process_signals, __ATOMIC_RELAXED)) return; int pos = signals_handled++; if (pos >= kSignalCount) return; data[pos] = pos; __atomic_store_n(&ready[pos], 1, __ATOMIC_RELEASE); } static void* thr(void *p) { AnnotateIgnoreSyncBegin(__FILE__, __LINE__); __atomic_store_n(&process_signals, 1, __ATOMIC_RELAXED); while (!__atomic_load_n(&done, __ATOMIC_RELAXED)) { } AnnotateIgnoreSyncEnd(__FILE__, __LINE__); return 0; } int main() { struct sigaction act = {}; act.sa_handler = handler; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); exit(1); } itimerval t; t.it_value.tv_sec = 0; t.it_value.tv_usec = 10; t.it_interval = t.it_value; if (setitimer(ITIMER_PROF, &t, 0)) { perror("setitimer"); exit(1); } pthread_t th; pthread_create(&th, 0, thr, 0); for (int pos = 0; pos < kSignalCount; pos++) { while (__atomic_load_n(&ready[pos], __ATOMIC_ACQUIRE) == 0) { } if (data[pos] != pos) { printf("at pos %d, expect %d, got %lld\n", pos, pos, data[pos]); exit(1); } } __atomic_store_n(&done, 1, __ATOMIC_RELAXED); pthread_join(th, 0); fprintf(stderr, "DONE\n"); return 0; } // CHECK-NOT: WARNING: ThreadSanitizer: // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/ignore_lib3.cc.supp0000664000175000017500000000004012223271415026607 0ustar mwhudsonmwhudsoncalled_from_lib:ignore_lib3.so golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/mmap_stress.cc0000664000175000017500000000333712654414110025775 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" #include #include void *SubWorker(void *arg) { (void)arg; const int kMmapSize = 65536; for (int i = 0; i < 500; i++) { int *ptr = (int*)mmap(0, kMmapSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if (ptr == MAP_FAILED) exit(printf("mmap failed: %d\n", errno)); *ptr = 42; if (munmap(ptr, kMmapSize)) exit(printf("munmap failed: %d\n", errno)); } return 0; } void *Worker1(void *arg) { (void)arg; pthread_t th[4]; for (int i = 0; i < 4; i++) { if (pthread_create(&th[i], 0, SubWorker, 0)) exit(printf("pthread_create failed: %d\n", errno)); } for (int i = 0; i < 4; i++) { if (pthread_join(th[i], 0)) exit(printf("pthread_join failed: %d\n", errno)); } return 0; } void *Worker(void *arg) { (void)arg; pthread_t th[4]; for (int i = 0; i < 4; i++) { if (pthread_create(&th[i], 0, Worker1, 0)) exit(printf("pthread_create failed: %d\n", errno)); } for (int i = 0; i < 4; i++) { if (pthread_join(th[i], 0)) exit(printf("pthread_join failed: %d\n", errno)); } return 0; } int main() { // This test is flaky on several builders: // https://groups.google.com/d/msg/llvm-dev/KUFPdLhBN3Q/L75rwW9xBgAJ // The cause is unknown (lit hides test output on failures). #if 0 pthread_t th[4]; for (int i = 0; i < 4; i++) { if (pthread_create(&th[i], 0, Worker, 0)) exit(printf("pthread_create failed: %d\n", errno)); } for (int i = 0; i < 4; i++) { if (pthread_join(th[i], 0)) exit(printf("pthread_join failed: %d\n", errno)); } #endif fprintf(stderr, "DONE\n"); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/bench_release_only.cc0000664000175000017500000000117412623335072027262 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // bench.h needs pthread barriers which are not available on OS X // UNSUPPORTED: darwin #include "bench.h" int *x; const int kStride = 32; void thread(int tid) { __atomic_load_n(&x[tid * kStride], __ATOMIC_ACQUIRE); for (int i = 0; i < bench_niter; i++) __atomic_store_n(&x[tid * kStride], 0, __ATOMIC_RELEASE); } void bench() { x = (int*)malloc(bench_nthread * kStride * sizeof(x[0])); for (int i = 0; i < bench_nthread; i++) __atomic_store_n(&x[i * kStride], 0, __ATOMIC_RELEASE); start_thread_group(bench_nthread, thread); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_socket_connect_norace.cc0000664000175000017500000000177212704157670030455 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include struct sockaddr_in addr; int X; void *ClientThread(void *x) { int c = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); X = 42; if (connect(c, (struct sockaddr*)&addr, sizeof(addr))) { perror("connect"); exit(1); } close(c); return NULL; } int main() { int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); addr.sin_family = AF_INET; inet_pton(AF_INET, "127.0.0.1", &addr.sin_addr); addr.sin_port = INADDR_ANY; socklen_t len = sizeof(addr); bind(s, (sockaddr*)&addr, len); getsockname(s, (sockaddr*)&addr, &len); listen(s, 10); pthread_t t; pthread_create(&t, 0, ClientThread, 0); int c = accept(s, 0, 0); X = 42; pthread_join(t, 0); close(c); close(s); fprintf(stderr, "OK\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/pthread_key.cc0000664000175000017500000000171712713170772025750 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Extracted from: // https://bugs.chromium.org/p/v8/issues/detail?id=4995 #include "test.h" void* thr(void* arg) { const int N = 32; pthread_key_t keys_[N]; for (size_t i = 0; i < N; ++i) { int err = pthread_key_create(&keys_[i], 0); if (err) { fprintf(stderr, "pthread_key_create failed with %d\n", err); exit(1); } } for (size_t i = 0; i < N; i++) pthread_setspecific(keys_[i], (void*)(long)i); for (size_t i = 0; i < N; i++) pthread_key_delete(keys_[i]); return 0; } int main() { for (int i = 0; i < 10; i++) { pthread_t th; pthread_create(&th, 0, thr, 0); pthread_join(th, 0); } pthread_t th[2]; pthread_create(&th[0], 0, thr, 0); pthread_create(&th[1], 0, thr, 0); pthread_join(th[0], 0); pthread_join(th[1], 0); fprintf(stderr, "DONE\n"); // CHECK: DONE } golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/unaligned_race.cc0000664000175000017500000000710712457727212026412 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" #include #define NOINLINE __attribute__((noinline)) volatile uint64_t objs[8*2*(2 + 4 + 8)][2]; extern "C" { uint16_t __sanitizer_unaligned_load16(volatile void *addr); uint32_t __sanitizer_unaligned_load32(volatile void *addr); uint64_t __sanitizer_unaligned_load64(volatile void *addr); void __sanitizer_unaligned_store16(volatile void *addr, uint16_t v); void __sanitizer_unaligned_store32(volatile void *addr, uint32_t v); void __sanitizer_unaligned_store64(volatile void *addr, uint64_t v); } // All this mess is to generate unique stack for each race, // otherwise tsan will suppress similar stacks. static NOINLINE void access(volatile char *p, int sz, int rw) { if (rw) { switch (sz) { case 0: __sanitizer_unaligned_store16(p, 0); break; case 1: __sanitizer_unaligned_store32(p, 0); break; case 2: __sanitizer_unaligned_store64(p, 0); break; default: exit(1); } } else { switch (sz) { case 0: __sanitizer_unaligned_load16(p); break; case 1: __sanitizer_unaligned_load32(p); break; case 2: __sanitizer_unaligned_load64(p); break; default: exit(1); } } } static int accesssize(int sz) { switch (sz) { case 0: return 2; case 1: return 4; case 2: return 8; } exit(1); } template static NOINLINE void access3(bool main, int sz1, bool rw, volatile char *p) { p += off; if (main) { access(p, sz1, true); } else { p += off2; if (rw) { *p = 42; } else { if (*p == 42) printf("bingo!\n"); } } } template static NOINLINE void access2(bool main, int sz1, int off2, bool rw, volatile char *obj) { if (off2 == 0) access3(main, sz1, rw, obj); else if (off2 == 1) access3(main, sz1, rw, obj); else if (off2 == 2) access3(main, sz1, rw, obj); else if (off2 == 3) access3(main, sz1, rw, obj); else if (off2 == 4) access3(main, sz1, rw, obj); else if (off2 == 5) access3(main, sz1, rw, obj); else if (off2 == 6) access3(main, sz1, rw, obj); else if (off2 == 7) access3(main, sz1, rw, obj); } static NOINLINE void access1(bool main, int off, int sz1, int off2, bool rw, char *obj) { if (off == 0) access2<0>(main, sz1, off2, rw, obj); else if (off == 1) access2<1>(main, sz1, off2, rw, obj); else if (off == 2) access2<2>(main, sz1, off2, rw, obj); else if (off == 3) access2<3>(main, sz1, off2, rw, obj); else if (off == 4) access2<4>(main, sz1, off2, rw, obj); else if (off == 5) access2<5>(main, sz1, off2, rw, obj); else if (off == 6) access2<6>(main, sz1, off2, rw, obj); else if (off == 7) access2<7>(main, sz1, off2, rw, obj); } NOINLINE void Test(bool main) { volatile uint64_t *obj = objs[0]; for (int off = 0; off < 8; off++) { for (int sz1 = 0; sz1 < 3; sz1++) { for (int off2 = 0; off2 < accesssize(sz1); off2++) { for (int rw = 0; rw < 2; rw++) { // printf("thr=%d off=%d sz1=%d off2=%d rw=%d p=%p\n", // main, off, sz1, off2, rw, obj); access1(main, off, sz1, off2, rw, (char*)obj); obj += 2; } } } } } void *Thread(void *p) { (void)p; barrier_wait(&barrier); Test(false); return 0; } int main() { barrier_init(&barrier, 2); pthread_t th; pthread_create(&th, 0, Thread, 0); Test(true); barrier_wait(&barrier); pthread_join(th, 0); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: ThreadSanitizer: reported 224 warnings golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/fd_pipe_race.cc0000664000175000017500000000133312457727212026045 0ustar mwhudsonmwhudson// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" int fds[2]; void *Thread1(void *x) { write(fds[1], "a", 1); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); close(fds[0]); close(fds[1]); return NULL; } int main() { barrier_init(&barrier, 2); pipe(fds); pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 8 // CHECK: #0 close // CHECK: #1 Thread2 // CHECK: Previous read of size 8 // CHECK: #0 write // CHECK: #1 Thread1 golang-1.8-race-detector-runtime_0.0+svn285455/test/tsan/free_race.c0000664000175000017500000000242512623403316025207 0ustar mwhudsonmwhudson// RUN: %clang_tsan -O1 %s -o %t // RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOZUPP // RUN: %env_tsan_opts=suppressions='%s.supp':print_suppressions=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SUPP #include "test.h" int *mem; pthread_mutex_t mtx; void *Thread1(void *x) { pthread_mutex_lock(&mtx); free(mem); pthread_mutex_unlock(&mtx); barrier_wait(&barrier); return NULL; } void *Thread2(void *x) { barrier_wait(&barrier); pthread_mutex_lock(&mtx); mem[0] = 42; pthread_mutex_unlock(&mtx); return NULL; } int main() { barrier_init(&barrier, 2); mem = (int*)malloc(100); pthread_mutex_init(&mtx, 0); pthread_t t; pthread_create(&t, NULL, Thread1, NULL); Thread2(0); pthread_join(t, NULL); pthread_mutex_destroy(&mtx); return 0; } // CHECK-NOZUPP: WARNING: ThreadSanitizer: heap-use-after-free // CHECK-NOZUPP: Write of size 4 at {{.*}} by main thread{{.*}}: // CHECK-NOZUPP: #0 Thread2 // CHECK-NOZUPP: #1 main // CHECK-NOZUPP: Previous write of size 8 at {{.*}} by thread T1{{.*}}: // CHECK-NOZUPP: #0 free // CHECK-NOZUPP: #{{(1|2)}} Thread1 // CHECK-NOZUPP: SUMMARY: ThreadSanitizer: heap-use-after-free{{.*}}Thread2 // CHECK-SUPP: ThreadSanitizer: Matched 1 suppressions // CHECK-SUPP: 1 race:^Thread2$ golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/0000775000175000017500000000000013040224624023250 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/fncall.c0000664000175000017500000000122012475135456024665 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t && %run %t // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t && %run %t // Tests that labels are propagated through function calls. #include #include int f(int x) { int j = 2; dfsan_label j_label = dfsan_create_label("j", 0); dfsan_set_label(j_label, &j, sizeof(j)); return x + j; } int main(void) { int i = 1; dfsan_label i_label = dfsan_create_label("i", 0); dfsan_set_label(i_label, &i, sizeof(i)); dfsan_label ij_label = dfsan_get_label(f(i)); assert(dfsan_has_label(ij_label, i_label)); assert(dfsan_has_label_with_desc(ij_label, "j")); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/dump_labels.c0000664000175000017500000000401412475135456025721 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t // RUN: DFSAN_OPTIONS=dump_labels_at_exit=/dev/stdout %run %t 2>&1 | FileCheck %s // RUN: DFSAN_OPTIONS=dump_labels_at_exit=/dev/stdout not %run %t c 2>&1 | FileCheck %s --check-prefix=CHECK-OOL // RUN: DFSAN_OPTIONS=dump_labels_at_exit=/dev/stdout not %run %t u 2>&1 | FileCheck %s --check-prefix=CHECK-OOL // Tests that labels are properly dumped at program termination. #include #include #include int main(int argc, char** argv) { int i = 1; dfsan_label i_label = dfsan_create_label("i", 0); dfsan_set_label(i_label, &i, sizeof(i)); int j = 2; dfsan_label j_label = dfsan_create_label("j", 0); dfsan_set_label(j_label, &j, sizeof(j)); int k = 3; dfsan_label k_label = dfsan_create_label("k", 0); dfsan_set_label(k_label, &k, sizeof(k)); dfsan_label ij_label = dfsan_get_label(i + j); dfsan_label ijk_label = dfsan_get_label(i + j + k); fprintf(stderr, "i %d j %d k %d ij %d ijk %d\n", i_label, j_label, k_label, ij_label, ijk_label); // CHECK: 1 0 0 i // CHECK: 2 0 0 j // CHECK: 3 0 0 k // CHECK: 4 1 2 // CHECK: 5 3 4 if (argc > 1) { // Exhaust the labels. unsigned long num_labels = 1 << (sizeof(dfsan_label) * 8); for (unsigned long i = ijk_label + 1; i < num_labels - 2; ++i) { dfsan_label l = dfsan_create_label("l", 0); assert(l == i); } // Consume the last available label. dfsan_label l = dfsan_union(5, 6); assert(l == num_labels - 2); // Try to allocate another label (either explicitly or by unioning two // existing labels), but expect a crash. if (argv[1][0] == 'c') { l = dfsan_create_label("l", 0); } else { l = dfsan_union(6, 7); } // CHECK-OOL: FATAL: DataFlowSanitizer: out of labels // CHECK-OOL: 1 0 0 i // CHECK-OOL: 2 0 0 j // CHECK-OOL: 3 0 0 k // CHECK-OOL: 4 1 2 // CHECK-OOL: 5 3 4 // CHECK-OOL: 6 0 0 // CHECK-OOL: 65534 5 6 // CHECK-OOL: 65535 0 0 } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/custom.cc0000664000175000017500000006070312753334564025116 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t && DFSAN_OPTIONS="strict_data_dependencies=0" %run %t // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t && DFSAN_OPTIONS="strict_data_dependencies=0" %run %t // RUN: %clang_dfsan -DSTRICT_DATA_DEPENDENCIES %s -o %t && %run %t // RUN: %clang_dfsan -DSTRICT_DATA_DEPENDENCIES -mllvm -dfsan-args-abi %s -o %t && %run %t // XFAIL: target-is-mips64el // Tests custom implementations of various glibc functions. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include dfsan_label i_label = 0; dfsan_label j_label = 0; dfsan_label k_label = 0; dfsan_label i_j_label = 0; #define ASSERT_ZERO_LABEL(data) \ assert(0 == dfsan_get_label((long) (data))) #define ASSERT_READ_ZERO_LABEL(ptr, size) \ assert(0 == dfsan_read_label(ptr, size)) #define ASSERT_LABEL(data, label) \ assert(label == dfsan_get_label((long) (data))) #define ASSERT_READ_LABEL(ptr, size, label) \ assert(label == dfsan_read_label(ptr, size)) void test_stat() { int i = 1; dfsan_set_label(i_label, &i, sizeof(i)); struct stat s; s.st_dev = i; assert(0 == stat("/", &s)); ASSERT_ZERO_LABEL(s.st_dev); s.st_dev = i; assert(-1 == stat("/nonexistent", &s)); ASSERT_LABEL(s.st_dev, i_label); } void test_fstat() { int i = 1; dfsan_set_label(i_label, &i, sizeof(i)); struct stat s; int fd = open("/dev/zero", O_RDONLY); s.st_dev = i; int rv = fstat(fd, &s); assert(0 == rv); ASSERT_ZERO_LABEL(s.st_dev); } void test_memcmp() { char str1[] = "str1", str2[] = "str2"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str2[3], 1); int rv = memcmp(str1, str2, sizeof(str1)); assert(rv < 0); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, i_j_label); #endif } void test_memcpy() { char str1[] = "str1"; char str2[sizeof(str1)]; dfsan_set_label(i_label, &str1[3], 1); ASSERT_ZERO_LABEL(memcpy(str2, str1, sizeof(str1))); assert(0 == memcmp(str2, str1, sizeof(str1))); ASSERT_ZERO_LABEL(str2[0]); ASSERT_LABEL(str2[3], i_label); } void test_memset() { char buf[8]; int j = 'a'; dfsan_set_label(j_label, &j, sizeof(j)); ASSERT_ZERO_LABEL(memset(&buf, j, sizeof(buf))); for (int i = 0; i < 8; ++i) { ASSERT_LABEL(buf[i], j_label); assert(buf[i] == 'a'); } } void test_strcmp() { char str1[] = "str1", str2[] = "str2"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str2[3], 1); int rv = strcmp(str1, str2); assert(rv < 0); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, i_j_label); #endif } void test_strlen() { char str1[] = "str1"; dfsan_set_label(i_label, &str1[3], 1); int rv = strlen(str1); assert(rv == 4); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, i_label); #endif } void test_strdup() { char str1[] = "str1"; dfsan_set_label(i_label, &str1[3], 1); char *strd = strdup(str1); ASSERT_ZERO_LABEL(strd[0]); ASSERT_LABEL(strd[3], i_label); free(strd); } void test_strncpy() { char str1[] = "str1"; char str2[sizeof(str1)]; dfsan_set_label(i_label, &str1[3], 1); char *strd = strncpy(str2, str1, 5); assert(strd == str2); assert(strcmp(str1, str2) == 0); ASSERT_ZERO_LABEL(strd); ASSERT_ZERO_LABEL(strd[0]); ASSERT_ZERO_LABEL(strd[1]); ASSERT_ZERO_LABEL(strd[2]); ASSERT_LABEL(strd[3], i_label); strd = strncpy(str2, str1, 3); assert(strd == str2); assert(strncmp(str1, str2, 3) == 0); ASSERT_ZERO_LABEL(strd); ASSERT_ZERO_LABEL(strd[0]); ASSERT_ZERO_LABEL(strd[1]); ASSERT_ZERO_LABEL(strd[2]); } void test_strncmp() { char str1[] = "str1", str2[] = "str2"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str2[3], 1); int rv = strncmp(str1, str2, sizeof(str1)); assert(rv < 0); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, dfsan_union(i_label, j_label)); #endif rv = strncmp(str1, str2, 3); assert(rv == 0); ASSERT_ZERO_LABEL(rv); } void test_strcasecmp() { char str1[] = "str1", str2[] = "str2", str3[] = "Str1"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str2[3], 1); dfsan_set_label(j_label, &str3[2], 1); int rv = strcasecmp(str1, str2); assert(rv < 0); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, dfsan_union(i_label, j_label)); #endif rv = strcasecmp(str1, str3); assert(rv == 0); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, dfsan_union(i_label, j_label)); #endif } void test_strncasecmp() { char str1[] = "Str1", str2[] = "str2"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str2[3], 1); int rv = strncasecmp(str1, str2, sizeof(str1)); assert(rv < 0); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, dfsan_union(i_label, j_label)); #endif rv = strncasecmp(str1, str2, 3); assert(rv == 0); ASSERT_ZERO_LABEL(rv); } void test_strchr() { char str1[] = "str1"; dfsan_set_label(i_label, &str1[3], 1); char *crv = strchr(str1, 'r'); assert(crv == &str1[2]); ASSERT_ZERO_LABEL(crv); crv = strchr(str1, '1'); assert(crv == &str1[3]); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(crv); #else ASSERT_LABEL(crv, i_label); #endif crv = strchr(str1, 'x'); assert(!crv); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(crv); #else ASSERT_LABEL(crv, i_label); #endif } void test_calloc() { // With any luck this sequence of calls will cause calloc to return the same // pointer both times. This is probably the best we can do to test this // function. char *crv = (char *) calloc(4096, 1); ASSERT_ZERO_LABEL(crv[0]); dfsan_set_label(i_label, crv, 100); free(crv); crv = (char *) calloc(4096, 1); ASSERT_ZERO_LABEL(crv[0]); free(crv); } void test_read() { char buf[16]; dfsan_set_label(i_label, buf, 1); dfsan_set_label(j_label, buf + 15, 1); ASSERT_LABEL(buf[0], i_label); ASSERT_LABEL(buf[15], j_label); int fd = open("/dev/zero", O_RDONLY); int rv = read(fd, buf, sizeof(buf)); assert(rv == sizeof(buf)); ASSERT_ZERO_LABEL(rv); ASSERT_ZERO_LABEL(buf[0]); ASSERT_ZERO_LABEL(buf[15]); close(fd); } void test_pread() { char buf[16]; dfsan_set_label(i_label, buf, 1); dfsan_set_label(j_label, buf + 15, 1); ASSERT_LABEL(buf[0], i_label); ASSERT_LABEL(buf[15], j_label); int fd = open("/bin/sh", O_RDONLY); int rv = pread(fd, buf, sizeof(buf), 0); assert(rv == sizeof(buf)); ASSERT_ZERO_LABEL(rv); ASSERT_ZERO_LABEL(buf[0]); ASSERT_ZERO_LABEL(buf[15]); close(fd); } void test_dlopen() { void *map = dlopen(NULL, RTLD_NOW); assert(map); ASSERT_ZERO_LABEL(map); dlclose(map); map = dlopen("/nonexistent", RTLD_NOW); assert(!map); ASSERT_ZERO_LABEL(map); } void test_clock_gettime() { struct timespec tp; dfsan_set_label(j_label, ((char *)&tp) + 3, 1); int t = clock_gettime(CLOCK_REALTIME, &tp); assert(t == 0); ASSERT_ZERO_LABEL(t); ASSERT_ZERO_LABEL(((char *)&tp)[3]); } void test_ctime_r() { char *buf = (char*) malloc(64); time_t t = 0; char *ret = ctime_r(&t, buf); ASSERT_ZERO_LABEL(ret); assert(buf == ret); ASSERT_READ_ZERO_LABEL(buf, strlen(buf) + 1); dfsan_set_label(i_label, &t, sizeof(t)); ret = ctime_r(&t, buf); ASSERT_ZERO_LABEL(ret); ASSERT_READ_LABEL(buf, strlen(buf) + 1, i_label); t = 0; dfsan_set_label(j_label, &buf, sizeof(&buf)); ret = ctime_r(&t, buf); ASSERT_LABEL(ret, j_label); ASSERT_READ_ZERO_LABEL(buf, strlen(buf) + 1); } static int write_callback_count = 0; static int last_fd; static const unsigned char *last_buf; static size_t last_count; void write_callback(int fd, const void *buf, size_t count) { write_callback_count++; last_fd = fd; last_buf = (const unsigned char*) buf; last_count = count; } void test_dfsan_set_write_callback() { char buf[] = "Sample chars"; int buf_len = strlen(buf); int fd = open("/dev/null", O_WRONLY); dfsan_set_write_callback(write_callback); write_callback_count = 0; // Callback should be invoked on every call to write(). int res = write(fd, buf, buf_len); assert(write_callback_count == 1); ASSERT_READ_ZERO_LABEL(&res, sizeof(res)); ASSERT_READ_ZERO_LABEL(&last_fd, sizeof(last_fd)); ASSERT_READ_ZERO_LABEL(last_buf, sizeof(last_buf)); ASSERT_READ_ZERO_LABEL(&last_count, sizeof(last_count)); // Add a label to write() arguments. Check that the labels are readable from // the values passed to the callback. dfsan_set_label(i_label, &fd, sizeof(fd)); dfsan_set_label(j_label, &(buf[3]), 1); dfsan_set_label(k_label, &buf_len, sizeof(buf_len)); res = write(fd, buf, buf_len); assert(write_callback_count == 2); ASSERT_READ_ZERO_LABEL(&res, sizeof(res)); ASSERT_READ_LABEL(&last_fd, sizeof(last_fd), i_label); ASSERT_READ_LABEL(&last_buf[3], sizeof(last_buf[3]), j_label); ASSERT_READ_LABEL(last_buf, sizeof(last_buf), j_label); ASSERT_READ_LABEL(&last_count, sizeof(last_count), k_label); dfsan_set_write_callback(NULL); } void test_fgets() { char *buf = (char*) malloc(128); FILE *f = fopen("/etc/passwd", "r"); dfsan_set_label(j_label, buf, 1); char *ret = fgets(buf, sizeof(buf), f); assert(ret == buf); ASSERT_ZERO_LABEL(ret); ASSERT_READ_ZERO_LABEL(buf, 128); dfsan_set_label(j_label, &buf, sizeof(&buf)); ret = fgets(buf, sizeof(buf), f); ASSERT_LABEL(ret, j_label); fclose(f); } void test_getcwd() { char buf[1024]; char *ptr = buf; dfsan_set_label(i_label, buf + 2, 2); char* ret = getcwd(buf, sizeof(buf)); assert(ret == buf); assert(ret[0] == '/'); ASSERT_READ_ZERO_LABEL(buf + 2, 2); dfsan_set_label(i_label, &ptr, sizeof(ptr)); ret = getcwd(ptr, sizeof(buf)); ASSERT_LABEL(ret, i_label); } void test_get_current_dir_name() { char* ret = get_current_dir_name(); assert(ret); assert(ret[0] == '/'); ASSERT_READ_ZERO_LABEL(ret, strlen(ret) + 1); } void test_gethostname() { char buf[1024]; dfsan_set_label(i_label, buf + 2, 2); assert(gethostname(buf, sizeof(buf)) == 0); ASSERT_READ_ZERO_LABEL(buf + 2, 2); } void test_getrlimit() { struct rlimit rlim; dfsan_set_label(i_label, &rlim, sizeof(rlim)); assert(getrlimit(RLIMIT_CPU, &rlim) == 0); ASSERT_READ_ZERO_LABEL(&rlim, sizeof(rlim)); } void test_getrusage() { struct rusage usage; dfsan_set_label(i_label, &usage, sizeof(usage)); assert(getrusage(RUSAGE_SELF, &usage) == 0); ASSERT_READ_ZERO_LABEL(&usage, sizeof(usage)); } void test_strcpy() { char src[] = "hello world"; char dst[sizeof(src) + 2]; dfsan_set_label(0, src, sizeof(src)); dfsan_set_label(0, dst, sizeof(dst)); dfsan_set_label(i_label, src + 2, 1); dfsan_set_label(j_label, src + 3, 1); dfsan_set_label(j_label, dst + 4, 1); dfsan_set_label(i_label, dst + 12, 1); char *ret = strcpy(dst, src); assert(ret == dst); assert(strcmp(src, dst) == 0); for (int i = 0; i < strlen(src) + 1; ++i) { assert(dfsan_get_label(dst[i]) == dfsan_get_label(src[i])); } // Note: if strlen(src) + 1 were used instead to compute the first untouched // byte of dest, the label would be I|J. This is because strlen() might // return a non-zero label, and because by default pointer labels are not // ignored on loads. ASSERT_LABEL(dst[12], i_label); } void test_strtol() { char buf[] = "1234578910"; char *endptr = NULL; dfsan_set_label(i_label, buf + 1, 1); dfsan_set_label(j_label, buf + 10, 1); long int ret = strtol(buf, &endptr, 10); assert(ret == 1234578910); assert(endptr == buf + 10); ASSERT_LABEL(ret, i_j_label); } void test_strtoll() { char buf[] = "1234578910 "; char *endptr = NULL; dfsan_set_label(i_label, buf + 1, 1); dfsan_set_label(j_label, buf + 2, 1); long long int ret = strtoll(buf, &endptr, 10); assert(ret == 1234578910); assert(endptr == buf + 10); ASSERT_LABEL(ret, i_j_label); } void test_strtoul() { char buf[] = "0xffffffffffffaa"; char *endptr = NULL; dfsan_set_label(i_label, buf + 1, 1); dfsan_set_label(j_label, buf + 2, 1); long unsigned int ret = strtol(buf, &endptr, 16); assert(ret == 72057594037927850); assert(endptr == buf + 16); ASSERT_LABEL(ret, i_j_label); } void test_strtoull() { char buf[] = "0xffffffffffffffaa"; char *endptr = NULL; dfsan_set_label(i_label, buf + 1, 1); dfsan_set_label(j_label, buf + 2, 1); long long unsigned int ret = strtoull(buf, &endptr, 16); assert(ret == 0xffffffffffffffaa); assert(endptr == buf + 18); ASSERT_LABEL(ret, i_j_label); } void test_strtod() { char buf[] = "12345.76 foo"; char *endptr = NULL; dfsan_set_label(i_label, buf + 1, 1); dfsan_set_label(j_label, buf + 6, 1); double ret = strtod(buf, &endptr); assert(ret == 12345.76); assert(endptr == buf + 8); ASSERT_LABEL(ret, i_j_label); } void test_time() { time_t t = 0; dfsan_set_label(i_label, &t, 1); time_t ret = time(&t); assert(ret == t); assert(ret > 0); ASSERT_ZERO_LABEL(t); } void test_inet_pton() { char addr4[] = "127.0.0.1"; dfsan_set_label(i_label, addr4 + 3, 1); struct in_addr in4; int ret4 = inet_pton(AF_INET, addr4, &in4); assert(ret4 == 1); ASSERT_READ_LABEL(&in4, sizeof(in4), i_label); assert(in4.s_addr == htonl(0x7f000001)); char addr6[] = "::1"; dfsan_set_label(j_label, addr6 + 3, 1); struct in6_addr in6; int ret6 = inet_pton(AF_INET6, addr6, &in6); assert(ret6 == 1); ASSERT_READ_LABEL(((char *) &in6) + sizeof(in6) - 1, 1, j_label); } void test_localtime_r() { time_t t0 = 1384800998; struct tm t1; dfsan_set_label(i_label, &t0, sizeof(t0)); struct tm* ret = localtime_r(&t0, &t1); assert(ret == &t1); assert(t1.tm_min == 56); ASSERT_LABEL(t1.tm_mon, i_label); } void test_getpwuid_r() { struct passwd pwd; char buf[1024]; struct passwd *result; dfsan_set_label(i_label, &pwd, 4); int ret = getpwuid_r(0, &pwd, buf, sizeof(buf), &result); assert(ret == 0); assert(strcmp(pwd.pw_name, "root") == 0); assert(result == &pwd); ASSERT_READ_ZERO_LABEL(&pwd, 4); } void test_poll() { struct pollfd fd; fd.fd = 0; fd.events = POLLIN; dfsan_set_label(i_label, &fd.revents, sizeof(fd.revents)); int ret = poll(&fd, 1, 1); ASSERT_ZERO_LABEL(fd.revents); assert(ret >= 0); } void test_select() { struct timeval t; fd_set fds; t.tv_sec = 2; FD_SET(0, &fds); dfsan_set_label(i_label, &fds, sizeof(fds)); dfsan_set_label(j_label, &t, sizeof(t)); int ret = select(1, &fds, NULL, NULL, &t); assert(ret >= 0); ASSERT_ZERO_LABEL(t.tv_sec); ASSERT_READ_ZERO_LABEL(&fds, sizeof(fds)); } void test_sched_getaffinity() { cpu_set_t mask; dfsan_set_label(j_label, &mask, 1); int ret = sched_getaffinity(0, sizeof(mask), &mask); assert(ret == 0); ASSERT_READ_ZERO_LABEL(&mask, sizeof(mask)); } void test_sigemptyset() { sigset_t set; dfsan_set_label(j_label, &set, 1); int ret = sigemptyset(&set); assert(ret == 0); ASSERT_READ_ZERO_LABEL(&set, sizeof(set)); } void test_sigaction() { struct sigaction oldact; dfsan_set_label(j_label, &oldact, 1); int ret = sigaction(SIGUSR1, NULL, &oldact); assert(ret == 0); ASSERT_READ_ZERO_LABEL(&oldact, sizeof(oldact)); } void test_gettimeofday() { struct timeval tv; struct timezone tz; dfsan_set_label(i_label, &tv, sizeof(tv)); dfsan_set_label(j_label, &tz, sizeof(tz)); int ret = gettimeofday(&tv, &tz); assert(ret == 0); ASSERT_READ_ZERO_LABEL(&tv, sizeof(tv)); ASSERT_READ_ZERO_LABEL(&tz, sizeof(tz)); } void *pthread_create_test_cb(void *p) { assert(p == (void *)1); ASSERT_ZERO_LABEL(p); return (void *)2; } void test_pthread_create() { pthread_t pt; pthread_create(&pt, 0, pthread_create_test_cb, (void *)1); void *cbrv; pthread_join(pt, &cbrv); assert(cbrv == (void *)2); } int dl_iterate_phdr_test_cb(struct dl_phdr_info *info, size_t size, void *data) { assert(data == (void *)3); ASSERT_ZERO_LABEL(info); ASSERT_ZERO_LABEL(size); ASSERT_ZERO_LABEL(data); return 0; } void test_dl_iterate_phdr() { dl_iterate_phdr(dl_iterate_phdr_test_cb, (void *)3); } void test_strrchr() { char str1[] = "str1str1"; dfsan_set_label(i_label, &str1[7], 1); char *rv = strrchr(str1, 'r'); assert(rv == &str1[6]); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, i_label); #endif } void test_strstr() { char str1[] = "str1str1"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str1[5], 1); char *rv = strstr(str1, "1s"); assert(rv == &str1[3]); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, i_label); #endif rv = strstr(str1, "2s"); assert(rv == NULL); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(rv); #else ASSERT_LABEL(rv, i_j_label); #endif } void test_memchr() { char str1[] = "str1"; dfsan_set_label(i_label, &str1[3], 1); dfsan_set_label(j_label, &str1[4], 1); char *crv = (char *) memchr(str1, 'r', sizeof(str1)); assert(crv == &str1[2]); ASSERT_ZERO_LABEL(crv); crv = (char *) memchr(str1, '1', sizeof(str1)); assert(crv == &str1[3]); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(crv); #else ASSERT_LABEL(crv, i_label); #endif crv = (char *) memchr(str1, 'x', sizeof(str1)); assert(!crv); #ifdef STRICT_DATA_DEPENDENCIES ASSERT_ZERO_LABEL(crv); #else ASSERT_LABEL(crv, i_j_label); #endif } void alarm_handler(int unused) { ; } void test_nanosleep() { struct timespec req, rem; req.tv_sec = 1; req.tv_nsec = 0; dfsan_set_label(i_label, &rem, sizeof(rem)); // non interrupted int rv = nanosleep(&req, &rem); assert(rv == 0); ASSERT_ZERO_LABEL(rv); ASSERT_READ_LABEL(&rem, 1, i_label); // interrupted by an alarm signal(SIGALRM, alarm_handler); req.tv_sec = 3; alarm(1); rv = nanosleep(&req, &rem); assert(rv == -1); ASSERT_ZERO_LABEL(rv); ASSERT_READ_ZERO_LABEL(&rem, sizeof(rem)); } void test_socketpair() { int fd[2]; dfsan_set_label(i_label, fd, sizeof(fd)); int rv = socketpair(PF_LOCAL, SOCK_STREAM, 0, fd); assert(rv == 0); ASSERT_ZERO_LABEL(rv); ASSERT_READ_ZERO_LABEL(fd, sizeof(fd)); } void test_write() { int fd = open("/dev/null", O_WRONLY); char buf[] = "a string"; int len = strlen(buf); // The result of a write always unlabeled. int res = write(fd, buf, len); assert(res > 0); ASSERT_ZERO_LABEL(res); // Label all arguments to write(). dfsan_set_label(i_label, &(buf[3]), 1); dfsan_set_label(j_label, &fd, sizeof(fd)); dfsan_set_label(i_label, &len, sizeof(len)); // The value returned by write() should have no label. res = write(fd, buf, len); ASSERT_ZERO_LABEL(res); close(fd); } template void test_sprintf_chunk(const char* expected, const char* format, T arg) { char buf[512]; memset(buf, 'a', sizeof(buf)); char padded_expected[512]; strcpy(padded_expected, "foo "); strcat(padded_expected, expected); strcat(padded_expected, " bar"); char padded_format[512]; strcpy(padded_format, "foo "); strcat(padded_format, format); strcat(padded_format, " bar"); // Non labelled arg. assert(sprintf(buf, padded_format, arg) == strlen(padded_expected)); assert(strcmp(buf, padded_expected) == 0); ASSERT_READ_LABEL(buf, strlen(padded_expected), 0); memset(buf, 'a', sizeof(buf)); // Labelled arg. dfsan_set_label(i_label, &arg, sizeof(arg)); assert(sprintf(buf, padded_format, arg) == strlen(padded_expected)); assert(strcmp(buf, padded_expected) == 0); ASSERT_READ_LABEL(buf, 4, 0); ASSERT_READ_LABEL(buf + 4, strlen(padded_expected) - 8, i_label); ASSERT_READ_LABEL(buf + (strlen(padded_expected) - 4), 4, 0); } void test_sprintf() { char buf[2048]; memset(buf, 'a', sizeof(buf)); // Test formatting (no conversion specifier). assert(sprintf(buf, "Hello world!") == 12); assert(strcmp(buf, "Hello world!") == 0); ASSERT_READ_LABEL(buf, sizeof(buf), 0); // Test for extra arguments. assert(sprintf(buf, "Hello world!", 42, "hello") == 12); assert(strcmp(buf, "Hello world!") == 0); ASSERT_READ_LABEL(buf, sizeof(buf), 0); // Test formatting & label propagation (multiple conversion specifiers): %s, // %d, %n, %f, and %%. const char* s = "world"; int m = 8; int d = 27; dfsan_set_label(k_label, (void *) (s + 1), 2); dfsan_set_label(i_label, &m, sizeof(m)); dfsan_set_label(j_label, &d, sizeof(d)); int n; int r = sprintf(buf, "hello %s, %-d/%d/%d %f %% %n%d", s, 2014, m, d, 12345.6781234, &n, 1000); assert(r == 42); assert(strcmp(buf, "hello world, 2014/8/27 12345.678123 % 1000") == 0); ASSERT_READ_LABEL(buf, 7, 0); ASSERT_READ_LABEL(buf + 7, 2, k_label); ASSERT_READ_LABEL(buf + 9, 9, 0); ASSERT_READ_LABEL(buf + 18, 1, i_label); ASSERT_READ_LABEL(buf + 19, 1, 0); ASSERT_READ_LABEL(buf + 20, 2, j_label); ASSERT_READ_LABEL(buf + 22, 15, 0); ASSERT_LABEL(r, 0); assert(n == 38); // Test formatting & label propagation (single conversion specifier, with // additional length and precision modifiers). test_sprintf_chunk("-559038737", "%d", 0xdeadbeef); test_sprintf_chunk("3735928559", "%u", 0xdeadbeef); test_sprintf_chunk("12345", "%i", 12345); test_sprintf_chunk("751", "%o", 0751); test_sprintf_chunk("babe", "%x", 0xbabe); test_sprintf_chunk("0000BABE", "%.8X", 0xbabe); test_sprintf_chunk("-17", "%hhd", 0xdeadbeef); test_sprintf_chunk("-16657", "%hd", 0xdeadbeef); test_sprintf_chunk("deadbeefdeadbeef", "%lx", 0xdeadbeefdeadbeef); test_sprintf_chunk("0xdeadbeefdeadbeef", "%p", (void *) 0xdeadbeefdeadbeef); test_sprintf_chunk("18446744073709551615", "%ju", (intmax_t) -1); test_sprintf_chunk("18446744073709551615", "%zu", (size_t) -1); test_sprintf_chunk("18446744073709551615", "%tu", (size_t) -1); test_sprintf_chunk("0x1.f9acffa7eb6bfp-4", "%a", 0.123456); test_sprintf_chunk("0X1.F9ACFFA7EB6BFP-4", "%A", 0.123456); test_sprintf_chunk("0.12346", "%.5f", 0.123456); test_sprintf_chunk("0.123456", "%g", 0.123456); test_sprintf_chunk("1.234560e-01", "%e", 0.123456); test_sprintf_chunk("1.234560E-01", "%E", 0.123456); test_sprintf_chunk("0.1234567891234560", "%.16Lf", (long double) 0.123456789123456); test_sprintf_chunk("z", "%c", 'z'); // %n, %s, %d, %f, and %% already tested // Test formatting with width passed as an argument. r = sprintf(buf, "hi %*d my %*s friend %.*f", 3, 1, 6, "dear", 4, 3.14159265359); assert(r == 30); assert(strcmp(buf, "hi 1 my dear friend 3.1416") == 0); } void test_snprintf() { char buf[2048]; memset(buf, 'a', sizeof(buf)); dfsan_set_label(0, buf, sizeof(buf)); const char* s = "world"; int y = 2014; int m = 8; int d = 27; dfsan_set_label(k_label, (void *) (s + 1), 2); dfsan_set_label(i_label, &y, sizeof(y)); dfsan_set_label(j_label, &m, sizeof(m)); int r = snprintf(buf, 19, "hello %s, %-d/%d/%d %f", s, y, m, d, 12345.6781234); // The return value is the number of bytes that would have been written to // the final string if enough space had been available. assert(r == 35); assert(memcmp(buf, "hello world, 2014/", 19) == 0); ASSERT_READ_LABEL(buf, 7, 0); ASSERT_READ_LABEL(buf + 7, 2, k_label); ASSERT_READ_LABEL(buf + 9, 4, 0); ASSERT_READ_LABEL(buf + 13, 4, i_label); ASSERT_READ_LABEL(buf + 17, 2, 0); ASSERT_LABEL(r, 0); } int main(void) { i_label = dfsan_create_label("i", 0); j_label = dfsan_create_label("j", 0); k_label = dfsan_create_label("k", 0); i_j_label = dfsan_union(i_label, j_label); test_calloc(); test_clock_gettime(); test_ctime_r(); test_dfsan_set_write_callback(); test_dl_iterate_phdr(); test_dlopen(); test_fgets(); test_fstat(); test_get_current_dir_name(); test_getcwd(); test_gethostname(); test_getpwuid_r(); test_getrlimit(); test_getrusage(); test_gettimeofday(); test_inet_pton(); test_localtime_r(); test_memchr(); test_memcmp(); test_memcpy(); test_memset(); test_nanosleep(); test_poll(); test_pread(); test_pthread_create(); test_read(); test_sched_getaffinity(); test_select(); test_sigaction(); test_sigemptyset(); test_snprintf(); test_socketpair(); test_sprintf(); test_stat(); test_strcasecmp(); test_strchr(); test_strcmp(); test_strcpy(); test_strdup(); test_strlen(); test_strncasecmp(); test_strncmp(); test_strncpy(); test_strrchr(); test_strstr(); test_strtod(); test_strtol(); test_strtoll(); test_strtoul(); test_strtoull(); test_time(); test_write(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/basic.c0000664000175000017500000000141712475135456024517 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t && %run %t // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t && %run %t // Tests that labels are propagated through loads and stores. #include #include int main(void) { int i = 1; dfsan_label i_label = dfsan_create_label("i", 0); dfsan_set_label(i_label, &i, sizeof(i)); dfsan_label new_label = dfsan_get_label(i); assert(i_label == new_label); dfsan_label read_label = dfsan_read_label(&i, sizeof(i)); assert(i_label == read_label); dfsan_label j_label = dfsan_create_label("j", 0); dfsan_add_label(j_label, &i, sizeof(i)); read_label = dfsan_read_label(&i, sizeof(i)); assert(dfsan_has_label(read_label, i_label)); assert(dfsan_has_label(read_label, j_label)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/propagate.c0000664000175000017500000000253612475135456025423 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t && %run %t // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t && %run %t // Tests that labels are propagated through computation and that union labels // are properly created. #include #include int main(void) { assert(dfsan_union(0, 0) == 0); int i = 1; dfsan_label i_label = dfsan_create_label("i", 0); dfsan_set_label(i_label, &i, sizeof(i)); int j = 2; dfsan_label j_label = dfsan_create_label("j", 0); dfsan_set_label(j_label, &j, sizeof(j)); int k = 3; dfsan_label k_label = dfsan_create_label("k", 0); dfsan_set_label(k_label, &k, sizeof(k)); int k2 = 4; dfsan_set_label(k_label, &k2, sizeof(k2)); dfsan_label ij_label = dfsan_get_label(i + j); assert(dfsan_has_label(ij_label, i_label)); assert(dfsan_has_label(ij_label, j_label)); assert(!dfsan_has_label(ij_label, k_label)); // Test uniquing. assert(dfsan_union(i_label, j_label) == ij_label); assert(dfsan_union(j_label, i_label) == ij_label); dfsan_label ijk_label = dfsan_get_label(i + j + k); assert(dfsan_has_label(ijk_label, i_label)); assert(dfsan_has_label(ijk_label, j_label)); assert(dfsan_has_label(ijk_label, k_label)); assert(dfsan_get_label(k + k2) == k_label); struct { int i, j; } s = { i, j }; assert(dfsan_read_label(&s, sizeof(s)) == ij_label); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/CMakeLists.txt0000664000175000017500000000262412741012374026020 0ustar mwhudsonmwhudsonset(DFSAN_LIT_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(DFSAN_TESTSUITES) set(DFSAN_TEST_ARCH ${DFSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(DFSAN_SUPPORTED_ARCH DFSAN_TEST_ARCH) endif() foreach(arch ${DFSAN_TEST_ARCH}) set(DFSAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" DFSAN_TEST_CONFIG_SUFFIX) if(ANDROID OR ${arch} MATCHES "arm|aarch64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(DFSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) set(DFSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} DFSAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " DFSAN_TEST_TARGET_CFLAGS "${DFSAN_TEST_TARGET_CFLAGS}") endif() string(TOUPPER ${arch} ARCH_UPPER_CASE) set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND DFSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() set(DFSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND DFSAN_TEST_DEPS dfsan) endif() add_lit_testsuite(check-dfsan "Running the DataFlowSanitizer tests" ${DFSAN_TESTSUITES} DEPENDS ${DFSAN_TEST_DEPS}) set_target_properties(check-dfsan PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/lit.site.cfg.in0000664000175000017500000000072512704361721026103 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.name_suffix = "@DFSAN_TEST_CONFIG_SUFFIX@" config.target_cflags = "@DFSAN_TEST_TARGET_CFLAGS@" config.target_arch = "@DFSAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@DFSAN_LIT_TESTS_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/vararg.c0000664000175000017500000000102312475135456024711 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %run %t foo // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %run %t foo #include int do_nothing(const char *format, ...) { return 0; } int main(int argc, char **argv) { int (*fp)(const char *, ...); if (argc > 1) fp = do_nothing; else fp = printf; // CHECK: FATAL: DataFlowSanitizer: unsupported indirect call to vararg function printf fp("hello %s\n", "world"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/write_callback.c0000664000175000017500000000660312475135456026406 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -o %t && %run %t | FileCheck %s // RUN: %clang_dfsan -mllvm -dfsan-args-abi %s -o %t && %run %t | FileCheck %s // Tests that the custom implementation of write() does writes with or without // a callback set using dfsan_set_write_callback(). #include #include #include #include #include #include // Check write callback arguments by having the callback store them in // the following variables: static int last_callback_arg_fd; static const void *last_callback_arg_buf; static size_t last_callback_arg_count; // Allow tests to check the number of callbacks made by incrementing // this count. When callbacks are verified, the count is reset. static int count_unverified_callbacks = 0; // This callbact will be installed using dfsan_set_write_callback() // in tests below. static void write_callback(int fd, const void *buf, size_t count) { // Do not do anything in this function that might call write(). count_unverified_callbacks++; last_callback_arg_fd = fd; last_callback_arg_buf = buf; last_callback_arg_count = count; } static void write_string_to_stdout(char *string) { char *cur = string; int bytes_left = strlen(string); while (bytes_left > 0) { int res = write(fileno(stdout), cur, bytes_left); assert (res >= 0); cur += res; bytes_left -= res; } } static void test_can_write_without_callback() { dfsan_set_write_callback(NULL); count_unverified_callbacks = 0; char aString[] = "Test that writes work without callback.\n"; // CHECK: Test that writes work without callback. write_string_to_stdout(aString); assert(count_unverified_callbacks == 0); } static void test_can_write_with_callback() { dfsan_set_write_callback(write_callback); count_unverified_callbacks = 0; char stringWithCallback[] = "Test that writes work with callback.\n"; // CHECK: Test that writes work with callback. write_string_to_stdout(stringWithCallback); // Data was written, so at least one call to write() was made. // Because a write may not process all the bytes it is passed, there // may have been several calls to write(). assert(count_unverified_callbacks > 0); count_unverified_callbacks = 0; dfsan_set_write_callback(NULL); char stringWithoutCallback[] = "Writes work after the callback is removed.\n"; // CHECK: Writes work after the callback is removed. write_string_to_stdout(stringWithoutCallback); assert(count_unverified_callbacks == 0); } static void test_failing_write_runs_callback() { // Open /dev/null in read-only mode. Calling write() on fd will fail. int fd = open("/dev/null", O_RDONLY); assert(fd != -1); // Install a callback. dfsan_set_write_callback(write_callback); // Write to the read-only file handle. The write will fail, but the callback // should still be invoked. char aString[] = "This text will fail to be written.\n"; int len = strlen(aString); int write_result = write(fd, aString, len); assert(write_result == -1); assert(count_unverified_callbacks == 1); count_unverified_callbacks = 0; assert(fd == last_callback_arg_fd); assert(aString == last_callback_arg_buf); assert(len == last_callback_arg_count); close(fd); } int main(int argc, char* argv[]) { test_can_write_without_callback(); test_can_write_with_callback(); test_failing_write_runs_callback(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/Inputs/0000775000175000017500000000000013040224624024532 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/Inputs/flags_abilist.txt0000664000175000017500000000030512213475447030110 0ustar mwhudsonmwhudsonfun:f=uninstrumented fun:main=uninstrumented fun:main=discard fun:dfsan_create_label=uninstrumented fun:dfsan_create_label=discard fun:dfsan_set_label=uninstrumented fun:dfsan_set_label=discard golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/flags.c0000664000175000017500000000173512475135456024535 0ustar mwhudsonmwhudson// RUN: %clang_dfsan %s -fsanitize-blacklist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clang_dfsan %s -fsanitize-blacklist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_unimplemented=0 %run %t 2>&1 | count 0 // RUN: %clang_dfsan %s -fsanitize-blacklist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_nonzero_labels=1 %run %t 2>&1 | FileCheck --check-prefix=CHECK-NONZERO %s // Tests that flags work correctly. #include int f(int i) { return i; } int main(void) { int i = 1; dfsan_label i_label = dfsan_create_label("i", 0); dfsan_set_label(i_label, &i, sizeof(i)); // CHECK: WARNING: DataFlowSanitizer: call to uninstrumented function f // CHECK-NOT: WARNING: DataFlowSanitizer: saw nonzero label // CHECK-NONZERO: WARNING: DataFlowSanitizer: saw nonzero label f(i); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/lit.cfg0000664000175000017500000000153112656410725024534 0ustar mwhudsonmwhudson# -*- Python -*- import os # Setup config name. config.name = 'DataFlowSanitizer' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup default compiler flags used with -fsanitize=dataflow option. clang_dfsan_cflags = ["-fsanitize=dataflow", config.target_cflags] clang_dfsan_cxxflags = config.cxx_mode_flags + clang_dfsan_cflags def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " config.substitutions.append( ("%clang_dfsan ", build_invocation(clang_dfsan_cflags)) ) config.substitutions.append( ("%clangxx_dfsan ", build_invocation(clang_dfsan_cxxflags)) ) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] # DataFlowSanitizer tests are currently supported on Linux only. if config.host_os not in ['Linux']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/dfsan/label_count.c0000664000175000017500000000451312475135456025725 0ustar mwhudsonmwhudson// RUN: %clang_dfsan -DLIB -c %s -o %t.lib.o && \ // RUN: %clang_dfsan -c %s -o %t.o && \ // RUN: %clang_dfsan %t.lib.o %t.o -o %t.bin && \ // RUN: %run %t.bin // RUN: %clang_dfsan -mllvm -dfsan-args-abi -DLIB -c %s -o %t.lib.o && \ // RUN: %clang_dfsan -mllvm -dfsan-args-abi -c %s -o %t.o && \ // RUN: %clang_dfsan -mllvm -dfsan-args-abi %t.o %t.lib.o -o %t.bin && \ // RUN: %run %t.bin #include #include #ifdef LIB // Compiling this file with and without LIB defined allows this file to be // built as two separate translation units. This ensures that the code // can not be optimized in a way that removes behavior we wish to test. For // example, computing a value should cause labels to be allocated only if // the computation is actually done. Putting the computation here prevents // the compiler from optimizing away the computation (and labeling) that // tests wish to verify. int add_in_separate_translation_unit(int a, int b) { return a + b; } int multiply_in_separate_translation_unit(int a, int b) { return a * b; } #else int add_in_separate_translation_unit(int i, int j); int multiply_in_separate_translation_unit(int i, int j); int main(void) { size_t label_count; // No labels allocated yet. label_count = dfsan_get_label_count(); assert(0 == label_count); int i = 1; dfsan_label i_label = dfsan_create_label("i", 0); dfsan_set_label(i_label, &i, sizeof(i)); // One label allocated for i. label_count = dfsan_get_label_count(); assert(1u == label_count); int j = 2; dfsan_label j_label = dfsan_create_label("j", 0); dfsan_set_label(j_label, &j, sizeof(j)); // Check that a new label was allocated for j. label_count = dfsan_get_label_count(); assert(2u == label_count); // Create a value that combines i and j. int i_plus_j = add_in_separate_translation_unit(i, j); // Check that a label was created for the union of i and j. label_count = dfsan_get_label_count(); assert(3u == label_count); // Combine i and j in a different way. Check that the existing label is // reused, and a new label is not created. int j_times_i = multiply_in_separate_translation_unit(j, i); label_count = dfsan_get_label_count(); assert(3u == label_count); assert(dfsan_get_label(i_plus_j) == dfsan_get_label(j_times_i)); return 0; } #endif // #ifdef LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/0000775000175000017500000000000013040224621023074 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/Unit/0000775000175000017500000000000013040224621024013 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/Unit/lit.site.cfg.in0000664000175000017500000000172312704361721026650 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ import os # Load common config for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured") def push_ld_library_path(config, new_path): new_ld_library_path = os.path.pathsep.join( (new_path, config.environment.get('LD_LIBRARY_PATH', ''))) config.environment['LD_LIBRARY_PATH'] = new_ld_library_path # Setup config name. config.name = 'AddressSanitizer-Unit' # Setup test source and exec root. For unit tests, we define # it as build directory with ASan unit tests. # FIXME: De-hardcode this path. if @ASAN_TEST_DYNAMIC@: test_dir = "dynamic" else: test_dir = "default" config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@", "lib", "asan", "tests", test_dir) config.test_source_root = config.test_exec_root # Set LD_LIBRARY_PATH to pick dynamic runtime up properly. push_ld_library_path(config, config.compiler_rt_libdir) golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/android_commands/0000775000175000017500000000000013040224621026375 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/android_commands/android_compile.py0000775000175000017500000000136412277360102032114 0ustar mwhudsonmwhudson#!/usr/bin/python import os, sys, subprocess from android_common import * here = os.path.abspath(os.path.dirname(sys.argv[0])) android_run = os.path.join(here, 'android_run.py') output = None output_type = 'executable' args = sys.argv[1:] while args: arg = args.pop(0) if arg == '-shared': output_type = 'shared' elif arg == '-c': output_type = 'object' elif arg == '-o': output = args.pop(0) if output == None: print "No output file name!" sys.exit(1) ret = subprocess.call(sys.argv[1:]) if ret != 0: sys.exit(ret) if output_type in ['executable', 'shared']: push_to_device(output) if output_type == 'executable': os.rename(output, output + '.real') os.symlink(android_run, output) golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/android_commands/android_run.py0000775000175000017500000000310212764601314031264 0ustar mwhudsonmwhudson#!/usr/bin/python import os, signal, sys, subprocess, tempfile from android_common import * ANDROID_TMPDIR = '/data/local/tmp/Output' here = os.path.abspath(os.path.dirname(sys.argv[0])) device_binary = os.path.join(ANDROID_TMPDIR, os.path.basename(sys.argv[0])) def build_env(): args = [] # Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir. args.append('LD_LIBRARY_PATH=%s:%s' % (ANDROID_TMPDIR, os.environ.get('LD_LIBRARY_PATH', ''))) for (key, value) in os.environ.items(): if key in ['ASAN_OPTIONS', 'ASAN_ACTIVATION_OPTIONS']: args.append('%s="%s"' % (key, value)) return ' '.join(args) is_64bit = (subprocess.check_output(['file', sys.argv[0] + '.real']).find('64-bit') != -1) asanwrapper = "" if is_64bit else "asanwrapper " device_env = build_env() device_args = ' '.join(sys.argv[1:]) # FIXME: escape? device_stdout = device_binary + '.stdout' device_stderr = device_binary + '.stderr' device_exitcode = device_binary + '.exitcode' ret = adb(['shell', 'cd %s && %s %s%s %s >%s 2>%s ; echo $? >%s' % (ANDROID_TMPDIR, device_env, asanwrapper, device_binary, device_args, device_stdout, device_stderr, device_exitcode)]) if ret != 0: sys.exit(ret) sys.stdout.write(pull_from_device(device_stdout)) sys.stderr.write(pull_from_device(device_stderr)) retcode = int(pull_from_device(device_exitcode)) # If the device process died with a signal, do abort(). # Not exactly the same, but good enough to fool "not --crash". if retcode > 128: os.kill(os.getpid(), signal.SIGABRT) sys.exit(retcode) golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/android_commands/android_common.py0000664000175000017500000000225112665166523031761 0ustar mwhudsonmwhudsonimport os, subprocess, tempfile import time ANDROID_TMPDIR = '/data/local/tmp/Output' ADB = os.environ.get('ADB', 'adb') verbose = False if os.environ.get('ANDROID_RUN_VERBOSE') == '1': verbose = True def adb(args, attempts = 1): if verbose: print args tmpname = tempfile.mktemp() out = open(tmpname, 'w') ret = 255 while attempts > 0 and ret != 0: attempts -= 1 ret = subprocess.call([ADB] + args, stdout=out, stderr=subprocess.STDOUT) if attempts != 0: ret = 5 if ret != 0: print "adb command failed", args print tmpname out.close() out = open(tmpname, 'r') print out.read() out.close() os.unlink(tmpname) return ret def pull_from_device(path): tmp = tempfile.mktemp() adb(['pull', path, tmp], 5) text = open(tmp, 'r').read() os.unlink(tmp) return text def push_to_device(path): # Workaround for https://code.google.com/p/android/issues/detail?id=65857 dst_path = os.path.join(ANDROID_TMPDIR, os.path.basename(path)) tmp_path = dst_path + '.push' adb(['push', path, tmp_path], 5) adb(['shell', 'cp "%s" "%s" 2>&1' % (tmp_path, dst_path)], 5) golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/CMakeLists.txt0000664000175000017500000001057512766076345025672 0ustar mwhudsonmwhudsonset(ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(ASAN_TESTSUITES) set(ASAN_DYNAMIC_TESTSUITES) # TODO(wwchrome): Re-enable Win64 asan tests when ready. # Disable tests for asan Win64 temporarily. if(OS_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(EXCLUDE_FROM_ALL TRUE) endif() macro(get_bits_for_arch arch bits) if (${arch} MATCHES "i386|i686|arm|mips|mipsel") set(${bits} 32) elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x") set(${bits} 64) else() message(FATAL_ERROR "Unknown target architecture: ${arch}") endif() endmacro() set(ASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND ASAN_TEST_DEPS asan) if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES) list(APPEND ASAN_TEST_DEPS lld ) endif() endif() set(ASAN_DYNAMIC_TEST_DEPS ${ASAN_TEST_DEPS}) set(ASAN_TEST_ARCH ${ASAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH) endif() foreach(arch ${ASAN_TEST_ARCH}) if(ANDROID) set(ASAN_TEST_TARGET_ARCH ${arch}-android) else() set(ASAN_TEST_TARGET_ARCH ${arch}) endif() string(TOLOWER "-${arch}-${OS_NAME}" ASAN_TEST_CONFIG_SUFFIX) get_bits_for_arch(${arch} ASAN_TEST_BITS) if(ANDROID OR ${arch} MATCHES "arm|aarch64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(ASAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) set(ASAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} ASAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " ASAN_TEST_TARGET_CFLAGS "${ASAN_TEST_TARGET_CFLAGS}") endif() if(ANDROID) set(ASAN_TEST_DYNAMIC True) else() set(ASAN_TEST_DYNAMIC False) endif() string(TOUPPER ${arch} ARCH_UPPER_CASE) set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg ) list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) string(TOLOWER "-${arch}-${OS_NAME}-dynamic" ASAN_TEST_CONFIG_SUFFIX) set(ASAN_TEST_DYNAMIC True) set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}DynamicConfig) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND ASAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endif() endforeach() # Add unit tests. if(COMPILER_RT_INCLUDE_TESTS) set(ASAN_TEST_DYNAMIC False) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) set(ASAN_TEST_DYNAMIC True) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic/lit.site.cfg) endif() # FIXME: support unit test in the android test runner if (NOT ANDROID) list(APPEND ASAN_TEST_DEPS AsanUnitTests) list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) list(APPEND ASAN_DYNAMIC_TEST_DEPS AsanDynamicUnitTests) list(APPEND ASAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic) endif() endif() endif() add_lit_testsuite(check-asan "Running the AddressSanitizer tests" ${ASAN_TESTSUITES} DEPENDS ${ASAN_TEST_DEPS}) set_target_properties(check-asan PROPERTIES FOLDER "Compiler-RT Misc") if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) # Add check-dynamic-asan target. It is a part of check-all only on Windows, # where we want to always test both dynamic and static runtime. if(NOT OS_NAME MATCHES "Windows") set(EXCLUDE_FROM_ALL TRUE) endif() add_lit_testsuite(check-asan-dynamic "Running the AddressSanitizer tests with dynamic runtime" ${ASAN_DYNAMIC_TESTSUITES} DEPENDS ${ASAN_DYNAMIC_TEST_DEPS}) set_target_properties(check-asan-dynamic PROPERTIES FOLDER "Compiler-RT Misc") if(NOT OS_NAME MATCHES "Windows") set(EXCLUDE_FROM_ALL FALSE) endif() endif() # TODO(wwchrome): Re-enable the tests for asan Win64 when ready. if(OS_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8) set(EXCLUDE_FROM_ALL FALSE) endif() golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/lit.site.cfg.in0000664000175000017500000000122612704361721025727 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.name_suffix = "@ASAN_TEST_CONFIG_SUFFIX@" config.asan_lit_source_dir = "@ASAN_LIT_SOURCE_DIR@" config.target_cflags = "@ASAN_TEST_TARGET_CFLAGS@" config.clang = "@ASAN_TEST_TARGET_CC@" config.bits = "@ASAN_TEST_BITS@" config.android = "@ANDROID@" config.asan_dynamic = @ASAN_TEST_DYNAMIC@ config.target_arch = "@ASAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@ASAN_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/lit.cfg0000664000175000017500000002231312771264417024367 0ustar mwhudsonmwhudson# -*- Python -*- import os import platform import lit.formats def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: lit_config.fatal( "No attribute %r in test configuration! You may need to run " "tests from your build directory or add this attribute " "to lit.site.cfg " % attr_name) return attr_value def push_dynamic_library_lookup_path(config, new_path): if platform.system() == 'Windows': dynamic_library_lookup_var = 'PATH' elif platform.system() == 'Darwin': dynamic_library_lookup_var = 'DYLD_LIBRARY_PATH' else: dynamic_library_lookup_var = 'LD_LIBRARY_PATH' new_ld_library_path = os.path.pathsep.join( (new_path, config.environment.get(dynamic_library_lookup_var, ''))) config.environment[dynamic_library_lookup_var] = new_ld_library_path # Setup config name. config.name = 'AddressSanitizer' + config.name_suffix # Platform-specific default ASAN_OPTIONS for lit tests. default_asan_opts = '' if config.host_os == 'Darwin': # On Darwin, we default to `abort_on_error=1`, which would make tests run # much slower. Let's override this and run lit tests with 'abort_on_error=0'. # Also, make sure we do not overwhelm the syslog while testing. default_asan_opts = 'abort_on_error=0' default_asan_opts += ':log_to_syslog=0' elif config.android: # The same as on Darwin, we default to "abort_on_error=1" which slows down # testing. Also, all existing tests are using "not" instead of "not --crash" # which does not work for abort()-terminated programs. default_asan_opts = 'abort_on_error=0' if default_asan_opts: config.environment['ASAN_OPTIONS'] = default_asan_opts default_asan_opts += ':' config.substitutions.append(('%env_asan_opts=', 'env ASAN_OPTIONS=' + default_asan_opts)) # Setup source root. config.test_source_root = os.path.dirname(__file__) # There is no libdl on FreeBSD. if config.host_os != 'FreeBSD': libdl_flag = "-ldl" else: libdl_flag = "" # GCC-ASan doesn't link in all the necessary libraries automatically, so # we have to do it ourselves. if config.compiler_id == 'GNU': extra_linkflags = ["-pthread", "-lstdc++", libdl_flag] else: extra_linkflags = [] # BFD linker in 64-bit android toolchains fails to find libm.so, which is a # transitive shared library dependency (via asan runtime). if config.android: extra_linkflags += ["-lm"] # Setup default compiler flags used with -fsanitize=address option. # FIXME: Review the set of required flags and check if it can be reduced. target_cflags = [get_required_attr(config, "target_cflags")] + extra_linkflags target_cxxflags = config.cxx_mode_flags + target_cflags clang_asan_static_cflags = (["-fsanitize=address", "-mno-omit-leaf-frame-pointer", "-fno-omit-frame-pointer", "-fno-optimize-sibling-calls"] + config.debug_info_flags + target_cflags) if config.target_arch == 's390x': clang_asan_static_cflags.append("-mbackchain") clang_asan_static_cxxflags = config.cxx_mode_flags + clang_asan_static_cflags if config.asan_dynamic: clang_asan_cflags = clang_asan_static_cflags + ['-shared-libasan'] clang_asan_cxxflags = clang_asan_static_cxxflags + ['-shared-libasan'] config.available_features.add("asan-dynamic-runtime") else: clang_asan_cflags = clang_asan_static_cflags clang_asan_cxxflags = clang_asan_static_cxxflags config.available_features.add("asan-static-runtime") asan_lit_source_dir = get_required_attr(config, "asan_lit_source_dir") if config.android == "1": config.available_features.add('android') clang_wrapper = os.path.join(asan_lit_source_dir, "android_commands", "android_compile.py") + " " else: config.available_features.add('not-android') clang_wrapper = "" def build_invocation(compile_flags): return " " + " ".join([clang_wrapper, config.clang] + compile_flags) + " " # Clang driver link 'x86' (i686) architecture to 'i386'. target_arch = config.target_arch if (target_arch == "i686"): target_arch = "i386" config.substitutions.append( ("%clang ", build_invocation(target_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) ) config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) ) config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) ) config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % target_arch)) if config.asan_dynamic: config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) ) config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) ) # Windows-specific tests might also use the clang-cl.exe driver. if platform.system() == 'Windows': clang_cl_asan_cxxflags = ["-fsanitize=address", "-Wno-deprecated-declarations", "-WX", "-D_HAS_EXCEPTIONS=0", "-Zi"] + target_cflags if config.asan_dynamic: clang_cl_asan_cxxflags.append("-MD") clang_invocation = build_invocation(clang_cl_asan_cxxflags) clang_cl_invocation = clang_invocation.replace("clang.exe","clang-cl.exe") config.substitutions.append( ("%clang_cl_asan ", clang_cl_invocation) ) base_lib = os.path.join(config.compiler_rt_libdir, "clang_rt.asan%%s-%s.lib" % config.target_arch) config.substitutions.append( ("%asan_lib", base_lib % "") ) config.substitutions.append( ("%asan_cxx_lib", base_lib % "_cxx") ) config.substitutions.append( ("%asan_dll_thunk", base_lib % "_dll_thunk") ) if platform.system() == 'Windows': # Don't use -std=c++11 on Windows, as the driver will detect the appropriate # default needed to use with the STL. config.substitutions.append(("%stdcxx11 ", "")) else: # Some tests uses C++11 features such as lambdas and need to pass -std=c++11. config.substitutions.append(("%stdcxx11 ", "-std=c++11 ")) # FIXME: De-hardcode this path. asan_source_dir = os.path.join( get_required_attr(config, "compiler_rt_src_root"), "lib", "asan") # Setup path to asan_symbolize.py script. asan_symbolize = os.path.join(asan_source_dir, "scripts", "asan_symbolize.py") if not os.path.exists(asan_symbolize): lit_config.fatal("Can't find script on path %r" % asan_symbolize) python_exec = get_required_attr(config, "python_executable") config.substitutions.append( ("%asan_symbolize", python_exec + " " + asan_symbolize + " ") ) # Setup path to sancov.py script. sanitizer_common_source_dir = os.path.join( get_required_attr(config, "compiler_rt_src_root"), "lib", "sanitizer_common") sancov = os.path.join(sanitizer_common_source_dir, "scripts", "sancov.py") if not os.path.exists(sancov): lit_config.fatal("Can't find script on path %r" % sancov) python_exec = get_required_attr(config, "python_executable") config.substitutions.append( ("%sancov ", python_exec + " " + sancov + " ") ) # Determine kernel bitness if config.host_arch.find('64') != -1 and config.android != "1": kernel_bits = '64' else: kernel_bits = '32' config.substitutions.append( ('CHECK-%kernel_bits', ("CHECK-kernel-" + kernel_bits + "-bits"))) config.substitutions.append( ("%libdl", libdl_flag) ) config.available_features.add("asan-" + config.bits + "-bits") if config.host_os == 'Darwin': config.substitutions.append( ("%ld_flags_rpath_exe", '-Wl,-rpath,@executable_path/ %dynamiclib') ) config.substitutions.append( ("%ld_flags_rpath_so", '-install_name @rpath/`basename %dynamiclib`') ) elif config.host_os == 'FreeBSD': config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec") ) config.substitutions.append( ("%ld_flags_rpath_so", '') ) elif config.host_os == 'Linux': config.substitutions.append( ("%ld_flags_rpath_exe", "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec") ) config.substitutions.append( ("%ld_flags_rpath_so", '') ) # Must be defined after the substitutions that use %dynamiclib. config.substitutions.append( ("%dynamiclib", '%T/lib%xdynamiclib_namespec.so') ) config.substitutions.append( ("%xdynamiclib_namespec", '$(basename %t).dynamic') ) # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL # because the test hangs. Adding armhf as we now have two modes. if config.target_arch != 'arm' and config.target_arch != 'armhf' and config.target_arch != 'aarch64': config.available_features.add('stable-runtime') # Turn on leak detection on 64-bit Linux. if config.host_os == 'Linux' and config.target_arch == 'x86_64': config.available_features.add('leak-detection') # Set LD_LIBRARY_PATH to pick dynamic runtime up properly. push_dynamic_library_lookup_path(config, config.compiler_rt_libdir) # GCC-ASan uses dynamic runtime by default. if config.compiler_id == 'GNU': gcc_dir = os.path.dirname(config.clang) libasan_dir = os.path.join(gcc_dir, "..", "lib" + config.bits) push_dynamic_library_lookup_path(config, libasan_dir) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] if config.host_os == 'Darwin': config.suffixes.append('.mm') # Only run the tests on supported OSs. if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/0000775000175000017500000000000013040224621024772 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/debug_stacks.cc0000664000175000017500000000370612744156751027767 0ustar mwhudsonmwhudson// Check that the stack trace debugging API works and returns correct // malloc and free stacks. // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // FIXME: Figure out why allocation/free stack traces may be too short on ARM. // REQUIRES: stable-runtime #if _WIN64 #define PTR "%llx" #else #define PTR "%lx" #endif #include #include #include char *mem; void func1() { mem = (char *)malloc(10); } void func2() { free(mem); } int main() { // Disable stderr buffering. Needed on Windows. setvbuf(stderr, NULL, _IONBF, 0); func1(); func2(); void *trace[100]; size_t num_frames = 100; int thread_id; num_frames = __asan_get_alloc_stack(mem, trace, num_frames, &thread_id); fprintf(stderr, "alloc stack retval %s\n", (num_frames > 0 && num_frames < 10) ? "ok" : ""); // CHECK: alloc stack retval ok fprintf(stderr, "thread id = %d\n", thread_id); // CHECK: thread id = 0 fprintf(stderr, "0x" PTR "\n", trace[0]); // CHECK: [[ALLOC_FRAME_0:0x[0-9a-f]+]] fprintf(stderr, "0x" PTR "\n", trace[1]); // CHECK: [[ALLOC_FRAME_1:0x[0-9a-f]+]] num_frames = 100; num_frames = __asan_get_free_stack(mem, trace, num_frames, &thread_id); fprintf(stderr, "free stack retval %s\n", (num_frames > 0 && num_frames < 10) ? "ok" : ""); // CHECK: free stack retval ok fprintf(stderr, "thread id = %d\n", thread_id); // CHECK: thread id = 0 fprintf(stderr, "0x" PTR "\n", trace[0]); // CHECK: [[FREE_FRAME_0:0x[0-9a-f]+]] fprintf(stderr, "0x" PTR "\n", trace[1]); // CHECK: [[FREE_FRAME_1:0x[0-9a-f]+]] mem[0] = 'A'; // BOOM // CHECK: ERROR: AddressSanitizer: heap-use-after-free // CHECK: WRITE of size 1 at 0x{{.*}} // CHECK: freed by thread T0 here: // CHECK: #0 [[FREE_FRAME_0]] // CHECK: #1 [[FREE_FRAME_1]] // CHECK: previously allocated by thread T0 here: // CHECK: #0 [[ALLOC_FRAME_0]] // CHECK: #1 [[ALLOC_FRAME_1]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/initialization-constexpr.cc0000664000175000017500000000221412562755664032402 0ustar mwhudsonmwhudson// Constexpr: // We need to check that a global variable initialized with a constexpr // constructor can be accessed during dynamic initialization (as a constexpr // constructor implies that it was initialized during constant initialization, // not dynamic initialization). // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 class Integer { private: int value; public: constexpr Integer(int x = 0) : value(x) {} int getValue() {return value;} }; Integer coolestInteger(42); int getCoolestInteger() { return coolestInteger.getValue(); } int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/throw_catch.cc0000664000175000017500000000310612661433216027620 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O %s -o %t && %run %t #include #include #include __attribute__((noinline)) void Throw() { int local; fprintf(stderr, "Throw: %p\n", &local); throw 1; } __attribute__((noinline)) void ThrowAndCatch() { int local; try { Throw(); } catch(...) { fprintf(stderr, "Catch: %p\n", &local); } } void TestThrow() { char x[32]; fprintf(stderr, "Before: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); assert(__asan_address_is_poisoned(x + 32)); ThrowAndCatch(); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); // FIXME: Invert this assertion once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 // This assertion works only w/o UAR. if (!__asan_get_current_fake_stack()) assert(!__asan_address_is_poisoned(x + 32)); } void TestThrowInline() { char x[32]; fprintf(stderr, "Before: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); assert(__asan_address_is_poisoned(x + 32)); try { Throw(); } catch(...) { fprintf(stderr, "Catch\n"); } fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); // FIXME: Invert this assertion once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 // This assertion works only w/o UAR. if (!__asan_get_current_fake_stack()) assert(!__asan_address_is_poisoned(x + 32)); } int main(int argc, char **argv) { TestThrowInline(); TestThrow(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/memcmp_test.cc0000664000175000017500000000113212330266131027616 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: compiler-rt-optimized #include int main(int argc, char **argv) { char a1[] = {argc, 2, 3, 4}; char a2[] = {1, 2*argc, 3, 4}; int res = memcmp(a1, a2, 4 + argc); // BOOM // CHECK: AddressSanitizer: stack-buffer-overflow // CHECK: {{#0.*memcmp}} // CHECK: {{#1.*main}} return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/printf-2.c0000664000175000017500000000205112670450761026613 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // We need replace_str=0, intercept_strlen=0 and replace_intrin=0 to avoid // reporting errors in strlen() and memcpy() called by printf(). // RUN: %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s // RUN: %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: printf is not intercepted on Windows yet. // XFAIL: win32 #include #include #include int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; char *p = strdup((const char *)s); free(p); printf("%c %d %.3f %s\n", c, x, f, p); return 0; // Check that %s is sanitized. // CHECK-ON: heap-use-after-free // CHECK-ON-NOT: 0 12 1.239 34 // CHECK-OFF: 0 12 1.239 } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/malloc_fill.cc0000664000175000017500000000161612562755664027612 0ustar mwhudsonmwhudson// Check that we fill malloc-ed memory correctly. // RUN: %clangxx_asan %s -o %t // RUN: %run %t | FileCheck %s // RUN: %env_asan_opts=max_malloc_fill_size=10:malloc_fill_byte=8 %run %t | FileCheck %s --check-prefix=CHECK-10-8 // RUN: %env_asan_opts=max_malloc_fill_size=20:malloc_fill_byte=171 %run %t | FileCheck %s --check-prefix=CHECK-20-ab #include int main(int argc, char **argv) { // With asan allocator this makes sure we get memory from mmap. static const int kSize = 1 << 25; unsigned char *x = new unsigned char[kSize]; printf("-"); for (int i = 0; i <= 32; i++) { printf("%02x", x[i]); } printf("-\n"); delete [] x; } // CHECK: -bebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebe- // CHECK-10-8: -080808080808080808080000000000000000000000000000000000000000000000- // CHECK-20-ab: -abababababababababababababababababababab00000000000000000000000000- golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_constant_size.cc0000664000175000017500000000216712747456273031534 0ustar mwhudsonmwhudson// Regression test for https://github.com/google/sanitizers/issues/691 // RUN: %clangxx_asan -O0 %s -o %t -fstack-protector // RUN: %run %t 1 2>&1 | FileCheck %s // RUN: %run %t 2 2>&1 | FileCheck %s #include #include // MSVC provides _alloca instead of alloca. #if defined(_MSC_VER) && !defined(alloca) # define alloca _alloca #elif defined(__FreeBSD__) #include #else #include #endif void f1_alloca() { char *dynamic_buffer = (char *)alloca(200); fprintf(stderr, "dynamic_buffer = %p\n", dynamic_buffer); memset(dynamic_buffer, 'y', 200); return; } static const int kDynamicArraySize = 200; void f1_vla() { char dynamic_buffer[kDynamicArraySize]; fprintf(stderr, "dynamic_buffer = %p\n", dynamic_buffer); memset(dynamic_buffer, 'y', kDynamicArraySize); return; } void f2() { char buf[1024]; memset(buf, 'x', 1024); } int main(int argc, const char *argv[]) { if (!strcmp(argv[1], "1")) { f1_alloca(); } else if (!strcmp(argv[1], "2")) { f1_vla(); } f2(); fprintf(stderr, "Done.\n"); return 0; } // CHECK-NOT: ERROR: AddressSanitizer // CHECK: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/null_deref.cc0000664000175000017500000000174212563423744027444 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s __attribute__((noinline)) // FIXME: Static symbols don't show up in PDBs. We can remove this once we start // using DWARF. #ifndef _MSC_VER static #endif void NullDeref(int *ptr) { // CHECK: ERROR: AddressSanitizer: {{SEGV|access-violation}} on unknown address // CHECK: {{0x0*000.. .*pc 0x.*}} ptr[10]++; // BOOM // atos on Mac cannot extract the symbol name correctly. Also, on FreeBSD 9.2 // the demangling function rejects local names with 'L' in front of them. // CHECK: {{ #0 0x.* in .*NullDeref.*null_deref.cc:}}[[@LINE-3]] } int main() { NullDeref((int*)0); // CHECK: {{ #1 0x.* in main.*null_deref.cc:}}[[@LINE-1]] // CHECK: AddressSanitizer can not provide additional info. } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/invalid-free.cc0000664000175000017500000000160612562755664027701 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX // Also works if no malloc context is available. // RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include #include int main(int argc, char **argv) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); int res = x[argc]; free(x + 5); // BOOM // CHECK: AddressSanitizer: attempting free on address{{.*}}in thread T0 // CHECK: invalid-free.cc:[[@LINE-2]] // CHECK: is located 5 bytes inside of 10-byte region // CHECK: allocated by thread T0 here: // MALLOC-CTX: invalid-free.cc:[[@LINE-8]] return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strncpy-overflow.cc0000664000175000017500000000257712415324363030670 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // REQUIRES: compiler-rt-optimized // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include #include int main(int argc, char **argv) { char *hello = (char*)malloc(6); strcpy(hello, "hello"); char *short_buffer = (char*)malloc(9); strncpy(short_buffer, hello, 10); // BOOM // CHECK: {{WRITE of size 10 at 0x.* thread T0}} // CHECK-Linux: {{ #0 0x.* in .*strncpy}} // CHECK-Darwin: {{ #0 0x.* in wrap_strncpy}} // CHECK: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-4]] // CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}} // CHECK: {{allocated by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]] // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}} // CHECK-Darwin: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-13]] return short_buffer[8]; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_vla_interact.cc0000664000175000017500000000253112756110734031304 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: %run %t 2>&1 // // REQUIRES: stable-runtime // This testcase checks correct interaction between VLAs and allocas. #include #include #include #include "sanitizer/asan_interface.h" // MSVC provides _alloca instead of alloca. #if defined(_MSC_VER) && !defined(alloca) # define alloca _alloca #endif #define RZ 32 __attribute__((noinline)) void foo(int len) { char *top, *bot; // This alloca call should live until the end of foo. char *alloca1 = (char *)alloca(len); assert(!(reinterpret_cast(alloca1) & 31L)); // This should be first poisoned address after loop. top = alloca1 - RZ; for (int i = 0; i < 32; ++i) { // Check that previous alloca was unpoisoned at the end of iteration. if (i) assert(!__asan_region_is_poisoned(bot, 96)); // VLA is unpoisoned at the end of iteration. volatile char array[i]; assert(!(reinterpret_cast(array) & 31L)); // Alloca is unpoisoned at the end of iteration, // because dominated by VLA. bot = (char *)alloca(i) - RZ; } // Check that all allocas from loop were unpoisoned correctly. void *q = __asan_region_is_poisoned(bot, (char *)top - (char *)bot + 1); assert(q == top); } int main(int argc, char **argv) { foo(32); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/0000775000175000017500000000000013040224621026424 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/stack_array_right_oob.cc0000664000175000017500000000114212341320165033273 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int subscript = 42; char buffer[42]; buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*stack_array_right_oob.cc}}:[[@LINE-3]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: {{#0 .* main .*stack_array_right_oob.cc}} // CHECK: 'buffer' <== Memory access at offset [[OFFSET]] overflows this variable } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/calloc_uaf.cc0000664000175000017500000000130612341320165031026 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int *buffer = (int*)calloc(42, sizeof(int)); free(buffer); buffer[0] = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*calloc_uaf.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region // CHECK: freed by thread T0 here: // CHECK-NEXT: {{#0 .* free }} // CHECK-NEXT: {{#1 .* main .*calloc_uaf.cc}}:[[@LINE-8]] // CHECK: previously allocated by thread T0 here: // CHECK-NEXT: {{#0 .* calloc }} // CHECK-NEXT: {{#1 .* main .*calloc_uaf.cc}}:[[@LINE-12]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/shadow_conflict_32.cc0000664000175000017500000000216312751151364032422 0ustar mwhudsonmwhudson// Load this DLL at the default 32-bit ASan shadow base, and test how we dump // the process memory layout. // REQUIRES: asan-32-bits // // RUN: %clang_cl_asan -DBUILD_DLL -LD %s -Fe%t_dll.dll -link -base:0x30000000 -fixed -dynamicbase:no // RUN: %clang_cl_asan %s -Fe%t.exe -link %t_dll.lib // RUN: not %run %t.exe 2>&1 | FileCheck %s #ifndef BUILD_DLL #include extern "C" __declspec(dllimport) int test_function(); int main() { fprintf(stderr, "should have failed to initialize, DLL got loaded near 0x%p\n", (void *)&test_function); } #else extern "C" __declspec(dllexport) int test_function() { return 0; } #endif // CHECK: =={{[0-9]+}}==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING. // CHECK: =={{[0-9]+}}==ASan shadow was supposed to be located in the [0x2fff0000-0x3fffffff] range. // CHECK: =={{[0-9]+}}==Dumping process modules // CHECK-DAG: {{0x30000000-0x300.....}} {{.*}}\shadow_conflict_32.cc.tmp_dll.dll // CHECK-DAG: {{0x........-0x........}} {{.*}}\shadow_conflict_32.cc.tmp.exe // CHECK-DAG: {{0x........-0x........}} {{.*}}\ntdll.dll golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_control_c.cc0000664000175000017500000001006212554014103031550 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O2 %s -Fe%t.dll // RUNX: %run %t %t.dll 2>&1 | FileCheck %s // Check that ASan does not CHECK fail when SEH is used around a crash from a // thread injected by control C. #include #include #include static void __declspec(noinline) CrashOnProcessDetach() { printf("CrashOnProcessDetach\n"); fflush(stdout); *static_cast(0) = 0x356; } bool g_is_child = false; BOOL WINAPI DllMain(PVOID h, DWORD reason, PVOID reserved) { if (reason == DLL_PROCESS_DETACH && g_is_child) { printf("in DllMain DLL_PROCESS_DETACH\n"); fflush(stdout); __try { CrashOnProcessDetach(); } __except (1) { printf("caught crash\n"); fflush(stdout); } } return true; } static void run_child() { // Send this process group Ctrl+C. That should only be this process. printf("GenerateConsoleCtrlEvent\n"); fflush(stdout); GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); Sleep(10 * 1000); // Wait 10 seconds, and the process should die. printf("unexpected execution after interrupt\n"); fflush(stdout); exit(0x42); } static int WINAPI ignore_control_c(DWORD ctrl_type) { // Don't interrupt the parent. return ctrl_type == CTRL_C_EVENT; } static int run_parent() { // Set an environment variable to tell the child process to interrupt itself. if (!SetEnvironmentVariableW(L"DO_CONTROL_C", L"1")) { printf("SetEnvironmentVariableW failed (0x%8lx).\n", GetLastError()); fflush(stdout); return 2; } // Launch a new process using the current executable with a new console. // Ctrl-C events are console-wide, so we need a new console. STARTUPINFOW si; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); // Hides the new console window that we are creating. si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; // Ensures that stdout still goes to the parent despite the new console. si.dwFlags |= STARTF_USESTDHANDLES; si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); si.hStdError = GetStdHandle(STD_ERROR_HANDLE); PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); int flags = CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP | CREATE_NEW_CONSOLE; if (!CreateProcessW(nullptr, // No module name (use command line) GetCommandLineW(), // Command line nullptr, // Process handle not inheritable nullptr, // Thread handle not inheritable TRUE, // Set handle inheritance to TRUE flags, // Flags to give the child a console nullptr, // Use parent's environment block nullptr, // Use parent's starting directory &si, &pi)) { printf("CreateProcess failed (0x%08lx).\n", GetLastError()); fflush(stdout); return 2; } // Wait until child process exits. if (WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_FAILED) { printf("WaitForSingleObject failed (0x%08lx).\n", GetLastError()); fflush(stdout); return 2; } // Get the exit code. It should be the one for ctrl-c events. DWORD rc; if (!GetExitCodeProcess(pi.hProcess, &rc)) { printf("GetExitCodeProcess failed (0x%08lx).\n", GetLastError()); fflush(stdout); return 2; } if (rc == STATUS_CONTROL_C_EXIT) printf("child quit with STATUS_CONTROL_C_EXIT\n"); else printf("unexpected exit code: 0x%08lx\n", rc); fflush(stdout); // Close process and thread handles. CloseHandle(pi.hProcess); CloseHandle(pi.hThread); return 0; } // CHECK: in DllMain DLL_PROCESS_DETACH // CHECK: CrashOnProcessDetach // CHECK: caught crash // CHECK: child quit with STATUS_CONTROL_C_EXIT extern "C" int __declspec(dllexport) test_function() { wchar_t buf[260]; int len = GetEnvironmentVariableW(L"DO_CONTROL_C", buf, 260); if (len > 0) { g_is_child = true; run_child(); } else { exit(run_parent()); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/null_deref.cc0000664000175000017500000000101712562415014031057 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // FIXME: merge this with the common null_deref test when we can run common // tests on Windows. __attribute__((noinline)) static void NullDeref(int *ptr) { // CHECK: ERROR: AddressSanitizer: access-violation on unknown address // CHECK: {{0x0*000.. .*pc 0x.*}} ptr[10]++; // BOOM } int main() { NullDeref((int*)0); // CHECK: {{ #1 0x.* in main.*null_deref.cc:}}[[@LINE-1]]:3 // CHECK: AddressSanitizer can not provide additional info. } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/bind_io_completion_callback.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/bind_io_completion_callba0000664000175000017500000000247412750143634033523 0ustar mwhudsonmwhudson// Make sure we can throw exceptions from work items executed via // BindIoCompletionCallback. // // RUN: %clangxx_asan %s -o %t.exe // RUN: %run %t.exe 2>&1 | FileCheck %s #include #include void ThrowAndCatch(); __declspec(noinline) void Throw() { fprintf(stderr, "Throw\n"); // CHECK: Throw throw 1; } void ThrowAndCatch() { int local; try { Throw(); } catch(...) { fprintf(stderr, "Catch\n"); // CHECK: Catch } } char buffer[65536]; HANDLE done; OVERLAPPED ov; void CALLBACK completion_callback(DWORD error, DWORD bytesRead, LPOVERLAPPED pov) { ThrowAndCatch(); SetEvent(done); } int main(int argc, char **argv) { done = CreateEvent(0, false, false, "job is done"); if (!done) return 1; HANDLE file = CreateFile( argv[0], GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, NULL); if (!file) return 2; if (!BindIoCompletionCallback(file, completion_callback, 0)) return 3; if (!ReadFile(file, buffer, sizeof(buffer), NULL, &ov) && GetLastError() != ERROR_IO_PENDING) return 4; if (WAIT_OBJECT_0 != WaitForSingleObject(done, 10 * 1000)) return 5; fprintf(stderr, "Done!\n"); // CHECK: Done! } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/aligned_mallocs.cc0000664000175000017500000000116012341320165032051 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include #define CHECK_ALIGNED(ptr,alignment) \ do { \ if (((uintptr_t)(ptr) % (alignment)) != 0) \ return __LINE__; \ } \ while(0) int main(void) { int *p = (int*)_aligned_malloc(1024 * sizeof(int), 32); CHECK_ALIGNED(p, 32); p[512] = 0; _aligned_free(p); p = (int*)_aligned_malloc(128, 128); CHECK_ALIGNED(p, 128); p = (int*)_aligned_realloc(p, 2048 * sizeof(int), 128); CHECK_ALIGNED(p, 128); p[1024] = 0; if (_aligned_msize(p, 128, 0) != 2048 * sizeof(int)) return __LINE__; _aligned_free(p); return 0; } ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_report_globals_symbol0000664000175000017500000000156512567131651033631 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll // RUN: %clang_cl_asan -O0 -DEXE %s %t.lib -Fe%te.exe // RUN: %env_asan_opts=report_globals=2 %run %te.exe 2>&1 | FileCheck %s // FIXME: Currently, the MT runtime build crashes on startup due to dbghelp.dll // initialization failure. // REQUIRES: asan-dynamic-runtime #include #include extern "C" { #if defined(EXE) __declspec(dllimport) int foo_from_dll(); // CHECK: in DLL(reason=1) int main(int argc, char **argv) { foo_from_dll(); // CHECK: hello! printf("hello!\n"); fflush(0); // CHECK: in DLL(reason=0) } #elif defined(DLL) // This global is registered at startup. int x[42]; __declspec(dllexport) int foo_from_dll() { return x[2]; } BOOL WINAPI DllMain(HMODULE, DWORD reason, LPVOID) { printf("in DLL(reason=%d)\n", (int)reason); fflush(0); return TRUE; } #else # error oops! #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_intercept_memset.cc0000664000175000017500000000203712342071150033140 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s // Test that it works correctly even with ICF enabled. // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll -link /OPT:REF /OPT:ICF // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include #include extern "C" __declspec(dllexport) int test_function() { char buff[5] = "aaaa"; memset(buff, 'b', 5); if (buff[2] != 'b') return 2; printf("Initial test OK\n"); fflush(0); // CHECK: Initial test OK memset(buff, 'c', 6); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 6 at [[ADDR]] thread T0 // CHECK-NEXT: __asan_memset // CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cc:[[@LINE-4]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cc // CHECK: 'buff' <== Memory access at offset {{.*}} overflows this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_simple.cc0000664000175000017500000000103012341320165031550 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include DWORD WINAPI thread_proc(void *) { volatile char stack_buffer[42]; for (int i = 0; i < sizeof(stack_buffer); ++i) stack_buffer[i] = 42; return 0x42; } int main() { DWORD exitcode; HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL); if (thr == 0) return 1; if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) return 2; GetExitCodeThread(thr, &exitcode); if (exitcode != 0x42) return 3; CloseHandle(thr); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/malloc_left_oob.cc0000664000175000017500000000110312341320165032051 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)malloc(42); buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*malloc_left_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* malloc }} // CHECK-NEXT: {{#1 .* main .*malloc_left_oob.cc}}:[[@LINE-8]] free(buffer); } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_stack_array_left_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_stack_array_left_o0000664000175000017500000000155212562224370033545 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include DWORD WINAPI thread_proc(void *) { int subscript = -1; volatile char stack_buffer[42]; stack_buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T1 // CHECK: {{#0 .* thread_proc.*thread_stack_array_left_oob.cc}}:[[@LINE-3]] // CHECK: Address [[ADDR]] is located in stack of thread T1 at offset {{.*}} in frame // CHECK: thread_proc return 0; } int main() { HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL); // CHECK: Thread T1 created by T0 here: // CHECK: {{#[01] .* main .*thread_stack_array_left_oob.cc}}:[[@LINE-2]] // A failure to create a thread should fail the test! if (thr == 0) return 0; WaitForSingleObject(thr, INFINITE); } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/wrong_downcast_on_stack.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/wrong_downcast_on_stack.c0000664000175000017500000000132512341320165033513 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s class Parent { public: int field; }; class Child : public Parent { public: int extra_field; }; int main(void) { Parent p; Child *c = (Child*)&p; // Intentional error here! c->extra_field = 42; // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_stack.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:[0-9]+]] in frame // CHECK-NEXT: {{#0 0x[0-9a-f]* in main }} // CHECK: 'p' <== Memory access at offset [[OFFSET]] overflows this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/calloc_right_oob.cc0000664000175000017500000000112212341320165032223 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int *buffer = (int*)calloc(42, sizeof(int)); buffer[42] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*calloc_right_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes to the right of 168-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* calloc }} // CHECK-NEXT: {{#1 .* main .*calloc_right_oob.cc}}:[[@LINE-8]] free(buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/wrong_downcast_on_heap.cc0000664000175000017500000000122712341320165033467 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s class Parent { public: int field; }; class Child : public Parent { public: int extra_field; }; int main(void) { Parent *p = new Parent; Child *c = (Child*)p; // Intentional error here! c->extra_field = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK: {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_heap.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes to the right of 4-byte region // CHECK: allocated by thread T0 here: // CHECK: #0 {{.*}} operator new return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/bitfield.cc0000664000175000017500000000047712341320165030530 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include typedef struct _S { unsigned int bf1:1; unsigned int bf2:2; unsigned int bf3:3; unsigned int bf4:4; } S; int main(void) { S *s = (S*)malloc(sizeof(S)); s->bf1 = 1; s->bf2 = 2; s->bf3 = 3; s->bf4 = 4; free(s); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/lit.local.cfg0000664000175000017500000000055712334737663031021 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) # We only run a small set of tests on Windows for now. # Override the parent directory's "unsupported" decision until we can handle # all of its tests. if root.host_os in ['Windows']: config.unsupported = False else: config.unsupported = True ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/report_globals_reload_dll.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/report_globals_reload_dll0000664000175000017500000000214012567131651033560 0ustar mwhudsonmwhudson// Make sure we can handle reloading the same DLL multiple times. // RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll // RUN: %clang_cl_asan -O0 -DEXE %s -Fe%te.exe // RUN: %env_asan_opts=report_globals=1 %run %te.exe %t.dll 2>&1 | FileCheck %s #include #include #include extern "C" { #if defined(EXE) int main(int argc, char **argv) { if (argc != 2) { printf("Usage: %s [client].dll\n", argv[0]); return 101; } const char *dll_name = argv[1]; // CHECK: time to load DLL printf("time to load DLL\n"); fflush(0); // CHECK: in DLL(reason=1) // CHECK: in DLL(reason=0) // CHECK: in DLL(reason=1) // CHECK: in DLL(reason=0) // CHECK: in DLL(reason=1) // CHECK: in DLL(reason=0) for (int i = 0; i < 30; ++i) { HMODULE dll = LoadLibrary(dll_name); if (dll == NULL) return 3; if (!FreeLibrary(dll)) return 4; } // CHECK: All OK! printf("All OK!\n"); fflush(0); } #elif defined(DLL) BOOL WINAPI DllMain(HMODULE, DWORD reason, LPVOID) { printf("in DLL(reason=%d)\n", (int)reason); fflush(0); return TRUE; } #else # error oops! #endif } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/null_deref_multiple_dlls.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/null_deref_multiple_dlls.0000664000175000017500000000203612404576272033515 0ustar mwhudsonmwhudson// Make sure everything works even if the main module doesn't have any stack // variables, thus doesn't explicitly reference any symbol exported by the // runtime thunk. // // RUN: %clang_cl_asan -LD -O0 -DDLL1 %s -Fe%t1.dll // RUN: %clang_cl_asan -LD -O0 -DDLL2 %s -Fe%t2.dll // RUN: %clang_cl_asan -O0 -DEXE %s %t1.lib %t2.lib -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include #include extern "C" { #if defined(EXE) __declspec(dllimport) void foo1(); __declspec(dllimport) void foo2(); int main() { foo1(); foo2(); } #elif defined(DLL1) __declspec(dllexport) void foo1() {} #elif defined(DLL2) __attribute__((noinline)) static void NullDeref(int *ptr) { // CHECK: ERROR: AddressSanitizer: access-violation on unknown address // CHECK: {{0x0*000.. .*pc 0x.*}} ptr[10]++; // BOOM } __declspec(dllexport) void foo2() { NullDeref((int*)0); // CHECK: {{ #1 0x.* in foo2.*null_deref_multiple_dlls.cc:}}[[@LINE-1]] // CHECK: AddressSanitizer can not provide additional info. } #else # error oops! #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/seh.cc0000664000175000017500000000277312554001400027520 0ustar mwhudsonmwhudson// Make sure that ASan works with SEH in both Clang and MSVC. MSVC uses a // different EH personality depending on the -GS setting, so test both -GS+ and // -GS-. // // RUN: cl -c %s -Fo%t.obj -DCOMPILE_SEH // RUN: %clangxx_asan -o %t.exe %s %t.obj // RUN: %run %t.exe // // RUN: cl -GS- -c %s -Fo%t.obj -DCOMPILE_SEH // RUN: %clangxx_asan -o %t.exe %s %t.obj // RUN: %run %t.exe // // RUN: %clang_cl_asan %s -DCOMPILE_SEH -Fe%t.exe // RUN: %run %t.exe #include #include #include // Should just "#include " when C++ exceptions are // supported and we don't need to use CL. extern "C" bool __asan_address_is_poisoned(void *p); void ThrowAndCatch(); #if defined(COMPILE_SEH) __declspec(noinline) void Throw() { int local, zero = 0; fprintf(stderr, "Throw: %p\n", &local); local = 5 / zero; } __declspec(noinline) void ThrowAndCatch() { int local; __try { Throw(); } __except(EXCEPTION_EXECUTE_HANDLER) { fprintf(stderr, "__except: %p\n", &local); } } #endif #if defined(__clang__) int main() { char x[32]; fprintf(stderr, "Before: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); assert(__asan_address_is_poisoned(x + 32)); ThrowAndCatch(); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); // FIXME: Invert this assertion once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 assert(!__asan_address_is_poisoned(x + 32)); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/calloc_left_oob.cc0000664000175000017500000000111712341320165032044 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int *buffer = (int*)calloc(42, sizeof(int)); buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*calloc_left_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 4 bytes to the left of 168-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* calloc }} // CHECK-NEXT: {{#1 .* main .*calloc_left_oob.cc}}:[[@LINE-8]] free(buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/bitfield_uaf.cc0000664000175000017500000000157612562224370031372 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include typedef struct _S { unsigned int bf1:1; unsigned int bf2:2; unsigned int bf3:3; unsigned int bf4:4; } S; void make_access(S *s) { s->bf2 = 2; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: READ of size {{[124]}} at [[ADDR]] // CHECK: {{#0 .* make_access.*bitfield_uaf.cc}}:[[@LINE-3]] // CHECK: {{#1 .* main}} } int main(void) { S *s = (S*)malloc(sizeof(S)); free(s); // CHECK: [[ADDR]] is located 0 bytes inside of 4-byte region // CHECK-LABEL: freed by thread T0 here: // CHECK: {{#0 .* free }} // CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-4]] // CHECK-LABEL: previously allocated by thread T0 here: // CHECK: {{#0 .* malloc }} // CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-8]] make_access(s); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_stress.cc0000664000175000017500000000126412341320165031613 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include DWORD WINAPI thread_proc(void *) { volatile char stack_buffer[42]; for (int i = 0; i < sizeof(stack_buffer); ++i) stack_buffer[i] = 42; return 0; } int main(void) { for (int iter = 0; iter < 1024; ++iter) { const int NUM_THREADS = 8; HANDLE thr[NUM_THREADS]; for (int i = 0; i < NUM_THREADS; ++i) { thr[i] = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL); if (thr[i] == 0) return 1; } for (int i = 0; i < NUM_THREADS; ++i) { if (WAIT_OBJECT_0 != WaitForSingleObject(thr[i], INFINITE)) return 2; CloseHandle(thr[i]); } } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/shadow_mapping_failure.cc0000664000175000017500000000110512743710135033450 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-32-bits #include char bigchunk[1 << 30]; int main() { printf("Hello, world!\n"); scanf("%s", bigchunk); // CHECK-NOT: Hello, world! // CHECK: Shadow memory range interleaves with an existing memory mapping. // CHECK: ASan shadow was supposed to be located in the [0x2fff0000-0x{{.*}}ffff] range. // CHECK: Dumping process modules: // CHECK-DAG: 0x{{[0-9a-f]*}}-0x{{[0-9a-f]*}} {{.*}}shadow_mapping_failure // CHECK-DAG: 0x{{[0-9a-f]*}}-0x{{[0-9a-f]*}} {{.*}}ntdll.dll } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/crash_read_write.cc0000664000175000017500000000211512657135163032256 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE #include #include static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; } __attribute__((noinline)) void Write(int *ptr) { *ptr = 0; } int main(int argc, char **argv) { // Writes to shadow are detected as reads from shadow gap (because of how the // shadow mapping works). This is kinda hard to fix. Test a random address in // the application part of the address space. void *volatile p = VirtualAlloc(0, 4096, MEM_COMMIT, PAGE_READONLY); bool ok = VirtualFree(p, 0, MEM_RELEASE); if (!ok) { printf("VirtualFree failed\n"); return 0; } if (argc == 1) Read((int *)p); else Write((int *)p); } // READ: AddressSanitizer: access-violation on unknown address // READ: The signal is caused by a READ memory access. // WRITE: AddressSanitizer: access-violation on unknown address // WRITE: The signal is caused by a WRITE memory access. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_null_deref.cc0000664000175000017500000000106712404576272031730 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s __attribute__((noinline)) static void NullDeref(int *ptr) { // CHECK: ERROR: AddressSanitizer: access-violation on unknown address // CHECK: {{0x0*000.. .*pc 0x.*}} ptr[10]++; // BOOM } extern "C" __declspec(dllexport) int test_function() { NullDeref((int*)0); // CHECK: {{ #1 0x.* in test_function .*\dll_null_deref.cc:}}[[@LINE-1]] // CHECK: AddressSanitizer can not provide additional info. return 0; } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_stack_array_right_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_stack_array_right_0000664000175000017500000000155712562224370033556 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include DWORD WINAPI thread_proc(void *) { int subscript = 42; volatile char stack_buffer[42]; stack_buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T1 // CHECK: {{#0 .* thread_proc.*thread_stack_array_right_oob.cc}}:[[@LINE-3]] // CHECK: Address [[ADDR]] is located in stack of thread T1 at offset {{.*}} in frame // CHECK: thread_proc return 0; } int main(void) { HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL); // CHECK: Thread T1 created by T0 here: // CHECK: {{#[01] .* main .*thread_stack_array_right_oob.cc}}:[[@LINE-2]] // A failure to create a thread should fail the test! if (thr == 0) return 0; WaitForSingleObject(thr, INFINITE); } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_operator_array_new_le0000664000175000017500000000175212373132613033600 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s extern "C" __declspec(dllexport) int test_function() { char *buffer = new char[42]; buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cc:[[@LINE-3]] // CHECK-NEXT: main {{.*}}dll_host.cc // // CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region // CHECK-LABEL: allocated by thread T0 here: // FIXME: Should get rid of the malloc/free frames called from the inside of // operator new/delete in DLLs when using -MT CRT. // FIXME: The 'operator new' frame should have []. // CHECK: operator new // CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cc:[[@LINE-13]] // CHECK-NEXT: main {{.*}}dll_host.cc // CHECK-LABEL: SUMMARY delete [] buffer; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/malloc_right_oob.cc0000664000175000017500000000110612341320165032237 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)malloc(42); buffer[42] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*malloc_right_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* malloc }} // CHECK-NEXT: {{#1 .* main .*malloc_right_oob.cc}}:[[@LINE-8]] free(buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/stack_array_sanity.cc0000664000175000017500000000031012341320165032622 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t | FileCheck %s #include int main() { int subscript = 1; char buffer[42]; buffer[subscript] = 42; printf("OK\n"); // CHECK: OK } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_right_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_right_0000664000175000017500000000121512373132613033613 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = new char[42]; buffer[42] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK: {{#0 .* main .*operator_array_new_right_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region // CHECK: allocated by thread T0 here: // FIXME: The 'operator new' frame should have []. // CHECK: {{#0 .* operator new}} // CHECK: {{#1 .* main .*operator_array_new_right_oob.cc}}:[[@LINE-9]] delete [] buffer; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/allocators_sanity.cc0000664000175000017500000000107112341320165032467 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t | FileCheck %s #include #include int main() { int *p = (int*)malloc(1024 * sizeof(int)); p[512] = 0; free(p); p = (int*)malloc(128); p = (int*)realloc(p, 2048 * sizeof(int)); p[1024] = 0; free(p); p = (int*)calloc(16, sizeof(int)); if (p[8] != 0) return 1; p[15]++; if (16 * sizeof(int) != _msize(p)) return 2; free(p); p = new int; *p = 42; delete p; p = new int[42]; p[15]++; delete [] p; printf("All ok\n"); // CHECK: All ok return 0; } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_thread_stack_array_le0000664000175000017500000000230212562224370033522 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include #include DWORD WINAPI thread_proc(void *context) { int subscript = -1; char stack_buffer[42]; stack_buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T1 // CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cc:[[@LINE-3]] // // CHECK: Address [[ADDR]] is located in stack of thread T1 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cc // // CHECK: 'stack_buffer' <== Memory access at offset [[OFFSET]] underflows this variable return 0; } extern "C" __declspec(dllexport) int test_function() { HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL); // CHECK-LABEL: Thread T1 created by T0 here: // CHECK: test_function{{.*}}dll_thread_stack_array_left_oob.cc:[[@LINE-2]] // CHECK-NEXT: main{{.*}}dll_host.cc // CHECK-LABEL: SUMMARY if (thr == 0) return 1; if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) return 2; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/queue_user_work_item.cc0000664000175000017500000000176112750143634033215 0ustar mwhudsonmwhudson// Make sure we can throw exceptions from work items executed via // QueueUserWorkItem. // // RUN: %clangxx_asan %s -o %t.exe // RUN: %run %t.exe 2>&1 | FileCheck %s #include #include void ThrowAndCatch(); __declspec(noinline) void Throw() { fprintf(stderr, "Throw\n"); // CHECK: Throw throw 1; } void ThrowAndCatch() { int local; try { Throw(); } catch(...) { fprintf(stderr, "Catch\n"); // CHECK: Catch } } HANDLE done; DWORD CALLBACK work_item(LPVOID) { ThrowAndCatch(); SetEvent(done); return 0; } int main(int argc, char **argv) { done = CreateEvent(0, false, false, "job is done"); if (!done) return 1; QueueUserWorkItem(&work_item, nullptr, 0); unsigned wait_result = WaitForSingleObject(done, 10 * 1000); if (wait_result == WAIT_ABANDONED) fprintf(stderr, "Timed out\n"); if (wait_result != WAIT_OBJECT_0) { fprintf(stderr, "Wait for work item failed\n"); return 2; } fprintf(stderr, "Done!\n"); // CHECK: Done! } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/on_error_callback.cc0000664000175000017500000000066312473127712032415 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // FIXME: merge this with the common on_error_callback test when we can run // common tests on Windows. #include #include extern "C" void __asan_on_error() { fprintf(stderr, "__asan_on_error called"); fflush(0); } int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: __asan_on_error called } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/intercept_strlen.cc0000664000175000017500000000147612341320165032332 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include #include int main() { char str[] = "Hello"; if (5 != strlen(str)) return 1; printf("Initial test OK\n"); fflush(0); // CHECK: Initial test OK str[5] = '!'; // Losing '\0' at the end. int len = strlen(str); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // FIXME: Should be READ of size 1, see issue 155. // CHECK: READ of size {{[0-9]+}} at [[ADDR]] thread T0 // CHECK: strlen // CHECK-NEXT: main {{.*}}intercept_strlen.cc:[[@LINE-5]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: main {{.*}}intercept_strlen.cc // CHECK: 'str' <== Memory access at offset {{.*}} overflows this variable return len < 6; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_suspended.cc0000664000175000017500000000107412446563130032270 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include DWORD WINAPI thread_proc(void *) { volatile char stack_buffer[42]; for (int i = 0; i < sizeof(stack_buffer); ++i) stack_buffer[i] = 42; return 0x42; } int main() { DWORD exitcode; HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, CREATE_SUSPENDED, NULL); ResumeThread(thr); if (thr == 0) return 1; if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) return 2; GetExitCodeThread(thr, &exitcode); if (exitcode != 0x42) return 3; CloseHandle(thr); } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/report_globals_vs_freelibrary.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/report_globals_vs_freelib0000664000175000017500000000200312567131651033575 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll // RUN: %clang_cl_asan -O0 -DEXE %s -Fe%te.exe // RUN: %env_asan_opts=report_globals=2 %run %te.exe %t.dll 2>&1 | FileCheck %s #include #include #include extern "C" { #if defined(EXE) int main(int argc, char **argv) { if (argc != 2) { printf("Usage: %s [client].dll\n", argv[0]); return 101; } const char *dll_name = argv[1]; // CHECK: time to load DLL printf("time to load DLL\n"); fflush(0); // On DLL load, the "in DLL\n" string is registered: // CHECK: Added Global{{.*}} size=19 // CHECK: in DLL(reason=1) HMODULE dll = LoadLibrary(dll_name); if (dll == NULL) return 3; // CHECK: in DLL(reason=0) // CHECK-NEXT: Removed Global{{.*}} size=19 if (!FreeLibrary(dll)) return 4; // CHECK: bye! printf("bye!\n"); fflush(0); } #elif defined(DLL) BOOL WINAPI DllMain(HMODULE, DWORD reason, LPVOID) { printf("in DLL(reason=%d)\n", (int)reason); fflush(0); return TRUE; } #else # error oops! #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/unsymbolized.cc0000664000175000017500000000153212744225073031474 0ustar mwhudsonmwhudson// When we link a binary without the -debug flag, ASan should print out VAs // instead of RVAs. The frames for main and do_uaf should be above 0x400000, // which is the default image base of an executable. // RUN: rm -f %t.pdb // RUN: %clangxx_asan -c -O2 %s -o %t.obj // RUN: link /nologo /OUT:%t.exe %t.obj %asan_lib %asan_cxx_lib // RUN: not %run %t.exe 2>&1 | FileCheck %s #include #include int __attribute__((noinline)) do_uaf(void); int main() { int r = do_uaf(); printf("r: %d\n", r); return r; } int do_uaf(void) { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: AddressSanitizer: heap-use-after-free // CHECK: #0 {{0x[a-f0-9]+ \(.*[\\/]unsymbolized.cc.*.exe\+(0x40|0x14000)[a-f0-9]{4}\)}} // CHECK: #1 {{0x[a-f0-9]+ \(.*[\\/]unsymbolized.cc.*.exe\+(0x40|0x14000)[a-f0-9]{4}\)}} } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_stack_use_after_return.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_stack_use_after_retur0000664000175000017500000000146612567131651033611 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s #include char *x; void foo() { char stack_buffer[42]; x = &stack_buffer[13]; } extern "C" __declspec(dllexport) int test_function() { foo(); *x = 42; // CHECK: AddressSanitizer: stack-use-after-return // CHECK: WRITE of size 1 at [[ADDR:.*]] thread T0 // CHECK-NEXT: test_function{{.*}}dll_stack_use_after_return.cc:[[@LINE-3]] // CHECK-NEXT: main // // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: #0 {{.*}} foo{{.*}}dll_stack_use_after_return.cc // CHECK: 'stack_buffer' <== Memory access at offset [[OFFSET]] is inside this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_large_function.cc0000664000175000017500000000077212373131573032606 0ustar mwhudsonmwhudson// Make sure we can link a DLL with large functions which would mean // functions such as __asan_loadN and __asan_storeN will be called // from the DLL. We simulate the large function with // -mllvm -asan-instrumentation-with-call-threshold=0. // RUN: %clang_cl_asan %s -c -Fo%t.obj -mllvm -asan-instrumentation-with-call-threshold=0 // RUN: link /nologo /DLL /OUT:%t.dll %t.obj %asan_dll_thunk // REQUIRES: asan-static-runtime void f(long* foo, long* bar) { // One load and one store *foo = *bar; } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_left_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_left_o0000664000175000017500000000120712373132613033610 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s int main() { char *buffer = new char[42]; buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*operator_array_new_left_oob.cc}}:[[@LINE-3]] // // CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region // CHECK-LABEL: allocated by thread T0 here: // FIXME: The 'operator new' frame should have []. // CHECK-NEXT: {{#0 .* operator new}} // CHECK-NEXT: {{#1 .* main .*operator_array_new_left_oob.cc}}:[[@LINE-10]] delete [] buffer; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_intercept_strlen.cc0000664000175000017500000000161212341320165033155 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include #include extern "C" __declspec(dllexport) int test_function() { char str[] = "Hello!"; if (6 != strlen(str)) return 1; printf("Initial test OK\n"); fflush(0); // CHECK: Initial test OK str[6] = '!'; // Removes '\0' at the end! int len = strlen(str); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // FIXME: Should be READ of size 1, see issue 155. // CHECK: READ of size {{[0-9]+}} at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .*}}strlen // CHECK-NEXT: {{#1 .* test_function .*}}dll_intercept_strlen.cc:[[@LINE-5]] // // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: test_function {{.*}}dll_intercept_strlen.cc: return len > 42; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/realloc_right_oob.cc0000664000175000017500000000111512341320165032411 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)realloc(0, 42); buffer[42] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*realloc_right_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* realloc }} // CHECK-NEXT: {{#1 .* main .*realloc_right_oob.cc}}:[[@LINE-8]] free(buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/windows_h.cc0000664000175000017500000000020412341320165030733 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t // Just make sure we can parse #include int main() {} golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_malloc_left_oob.cc0000664000175000017500000000145612341320165032717 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include extern "C" __declspec(dllexport) int test_function() { char *buffer = (char*)malloc(42); buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cc:[[@LINE-3]] // CHECK-NEXT: main {{.*}}dll_host.cc // // CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region // CHECK-LABEL: allocated by thread T0 here: // CHECK-NEXT: malloc // CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cc:[[@LINE-10]] // CHECK-NEXT: main {{.*}}dll_host.cc // CHECK-LABEL: SUMMARY free(buffer); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/realloc_uaf.cc0000664000175000017500000000130212341320165031206 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)realloc(0, 42); free(buffer); buffer[0] = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*realloc_uaf.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region // CHECK: freed by thread T0 here: // CHECK-NEXT: {{#0 .* free }} // CHECK-NEXT: {{#1 .* main .*realloc_uaf.cc}}:[[@LINE-8]] // CHECK: previously allocated by thread T0 here: // CHECK-NEXT: {{#0 .* realloc }} // CHECK-NEXT: {{#1 .* main .*realloc_uaf.cc}}:[[@LINE-12]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/default_options.cc0000664000175000017500000000065312473127712032152 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // FIXME: merge this with the common default_options test when we can run common // tests on Windows. const char *kAsanDefaultOptions="verbosity=1 help=1"; extern "C" __attribute__((no_sanitize_address)) const char *__asan_default_options() { // CHECK: Available flags for AddressSanitizer: return kAsanDefaultOptions; } int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/beginthreadex.cc0000664000175000017500000000073012341320165031547 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include #include unsigned WINAPI thread_proc(void *) { volatile char stack_buffer[42]; for (int i = 0; i < sizeof(stack_buffer); ++i) stack_buffer[i] = 42; return 0; } int main() { HANDLE thr = (HANDLE)_beginthreadex(NULL, 0, thread_proc, NULL, 0, NULL); if (thr == 0) return 1; if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) return 2; CloseHandle(thr); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_seh.cc0000664000175000017500000000242712742007477030372 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // // Check both -GS and -GS- builds: // RUN: %clang_cl_asan -GS -LD -O0 %s -Fe%t.dll // RUN: %run %t %t.dll // // RUN: %clang_cl_asan -GS- -LD -O0 %s -Fe%t.dll // RUN: %run %t %t.dll #include #include #include // Should just "#include " when C++ exceptions are // supported and we don't need to use CL. extern "C" bool __asan_address_is_poisoned(void *p); void ThrowAndCatch(); __declspec(noinline) void Throw() { int local, zero = 0; fprintf(stderr, "Throw: %p\n", &local); local = 5 / zero; } __declspec(noinline) void ThrowAndCatch() { int local; __try { Throw(); } __except(EXCEPTION_EXECUTE_HANDLER) { fprintf(stderr, "__except: %p\n", &local); } } extern "C" __declspec(dllexport) int test_function() { char x[32]; fprintf(stderr, "Before: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); assert(__asan_address_is_poisoned(x + 32)); ThrowAndCatch(); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); // FIXME: Invert this assertion once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 assert(!__asan_address_is_poisoned(x + 32)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/global_const_string.cc0000664000175000017500000000040712341320165032773 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t | FileCheck %s #include #include int main(void) { static const char *foo = "foobarspam"; printf("Global string is `%s`\n", foo); // CHECK: Global string is `foobarspam` return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/intercept_memcpy.cc0000664000175000017500000000166412744223467032332 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include #include void call_memcpy(void* (*f)(void *, const void *, size_t), void *a, const void *b, size_t c) { f(a, b, c); } int main() { char buff1[6] = "Hello", buff2[5]; call_memcpy(&memcpy, buff2, buff1, 5); if (buff1[2] != buff2[2]) return 2; printf("Initial test OK\n"); fflush(0); // CHECK: Initial test OK call_memcpy(&memcpy, buff2, buff1, 6); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 6 at [[ADDR]] thread T0 // CHECK-NEXT: __asan_{{.*}}mem{{.*}} // CHECK-NEXT: call_mem{{.*}} // CHECK-NEXT: main {{.*}}intercept_memcpy.cc:[[@LINE-5]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: #0 {{.*}} main // CHECK: 'buff2' <== Memory access at offset {{.*}} overflows this variable } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/double_free.cc0000664000175000017500000000127312341320165031214 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int *x = (int*)malloc(42 * sizeof(int)); free(x); free(x); // CHECK: AddressSanitizer: attempting double-free on [[ADDR:0x[0-9a-f]+]] // CHECK-NEXT: {{#0 .* free }} // CHECK-NEXT: {{#1 .* main .*double_free.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region // CHECK-LABEL: freed by thread T0 here: // CHECK-NEXT: {{#0 .* free }} // CHECK-NEXT: {{#1 .* main .*double_free.cc}}:[[@LINE-8]] // CHECK-LABEL: previously allocated by thread T0 here: // CHECK-NEXT: {{#0 .* malloc }} // CHECK-NEXT: {{#1 .* main .*double_free.cc}}:[[@LINE-12]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_and_lib.cc0000664000175000017500000000105112373131573031166 0ustar mwhudsonmwhudson// Just make sure we can link an implib into another DLL // This used to fail between r212699 and r212814. // RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj // RUN: link /nologo /DLL /OUT:%t.1.dll %t.1.obj %asan_dll_thunk // RUN: %clang_cl_asan -DCONFIG=2 %s -c -Fo%t.2.obj // RUN: link /nologo /DLL /OUT:%t.2.dll %t.2.obj %t.1.lib %asan_dll_thunk // REQUIRES: asan-static-runtime #if CONFIG==1 extern "C" __declspec(dllexport) int f1() { int x = 0; return 1; } #else extern "C" __declspec(dllexport) int f2() { int x = 0; return 2; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/intercept_strdup.cc0000664000175000017500000000172512724515063032351 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include #include #include int main() { char *ptr = _strdup("Hello"); int subscript = 1; ptr[subscript] = '3'; printf("%s\n", ptr); fflush(0); // CHECK: H3llo subscript = -1; ptr[subscript] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK: {{#0 .* main .*}}intercept_strdup.cc:[[@LINE-3]] // CHECK: [[ADDR]] is located 1 bytes to the left of 6-byte region // CHECK: allocated by thread T0 here: // // The first frame is our wrapper normally but will be malloc in the dynamic // config. // CHECK: #0 {{.*}} in {{malloc|__asan_wrap_strdup}} // // The local call to _strdup above may be the second or third frame depending // on whether we're using the dynamic config. // CHECK: #{{[12]}} {{.*}} in main {{.*}}intercept_strdup.cc:[[@LINE-21]] free(ptr); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/symbols_path.cc0000664000175000017500000000145312562224370031453 0ustar mwhudsonmwhudson// Make sure symbolization works even if the path to the .exe file changes. // RUN: mkdir %t || true // RUN: %clang_cl_asan -O0 %s -Fe%t/symbols_path.exe // RUN: not %run %t/symbols_path.exe 2>&1 | FileCheck %s // RUN: mkdir %t2 || true // RUN: mv %t/* %t2 // RUN: not %run %t2/symbols_path.exe 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)malloc(42); buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*symbols_path.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* malloc}} // CHECK-NEXT: {{#1 .* main .*symbols_path.cc}}:[[@LINE-8]] free(buffer); } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/global_const_string_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/global_const_string_oob.c0000664000175000017500000000120612356544454033504 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include #include extern "C" const char *foo = "foobarspam"; int main(void) { if (foo[16]) printf("Boo\n"); // CHECK-NOT: Boo // CHECK: AddressSanitizer: global-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: READ of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*global_const_string_oob.cc:}}[[@LINE-5]] // CHECK: [[ADDR]] is located 5 bytes to the right of global variable [[STR:.*]] defined in {{'.*global_const_string_oob.cc:7:.*' .*}} of size 11 // CHECK: [[STR]] is ascii string 'foobarspam' return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/malloc_uaf.cc0000664000175000017500000000127212341320165031042 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)malloc(42); free(buffer); buffer[0] = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*malloc_uaf.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region // CHECK: freed by thread T0 here: // CHECK-NEXT: {{#0 .* free }} // CHECK-NEXT: {{#1 .* main .*malloc_uaf.cc}}:[[@LINE-8]] // CHECK: previously allocated by thread T0 here: // CHECK-NEXT: {{#0 .* malloc }} // CHECK-NEXT: {{#1 .* main .*malloc_uaf.cc}}:[[@LINE-12]] } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_intercept_memcpy_indi0000664000175000017500000000214112773473327033577 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include #include void call_memcpy(void* (*f)(void *, const void *, size_t), void *a, const void *b, size_t c) { f(a, b, c); } extern "C" __declspec(dllexport) int test_function() { char buff1[6] = "Hello", buff2[5]; call_memcpy(&memcpy, buff2, buff1, 5); if (buff1[2] != buff2[2]) return 2; printf("Initial test OK\n"); fflush(0); // CHECK: Initial test OK call_memcpy(&memcpy, buff2, buff1, 6); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 6 at [[ADDR]] thread T0 // CHECK-NEXT: __asan_{{.*}}mem{{.*}} // CHECK-NEXT: call_memcpy // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cc:[[@LINE-5]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cc // CHECK: 'buff2' <== Memory access at offset {{.*}} overflows this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_new_left_oob.cc0000664000175000017500000000110312562224370033314 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = new char; buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK: {{#0 .* main .*operator_new_left_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 1 bytes to the left of 1-byte region // CHECK: allocated by thread T0 here: // CHECK: {{#0 .* operator new}} // CHECK: {{#1 .* main .*operator_new_left_oob.cc}}:[[@LINE-8]] delete buffer; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_aligned_mallocs.cc0000664000175000017500000000143512341320165032711 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: %run %t %t.dll | FileCheck %s #include #include #define CHECK_ALIGNED(ptr,alignment) \ do { \ if (((uintptr_t)(ptr) % (alignment)) != 0) \ return __LINE__; \ } \ while(0) extern "C" __declspec(dllexport) int test_function() { int *p = (int*)_aligned_malloc(1024 * sizeof(int), 32); CHECK_ALIGNED(p, 32); p[512] = 0; _aligned_free(p); p = (int*)_aligned_malloc(128, 128); CHECK_ALIGNED(p, 128); p = (int*)_aligned_realloc(p, 2048 * sizeof(int), 128); CHECK_ALIGNED(p, 128); p[1024] = 0; if (_aligned_msize(p, 128, 0) != 2048 * sizeof(int)) return __LINE__; _aligned_free(p); printf("All ok\n"); // CHECK: All ok return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_cerr.cc0000664000175000017500000000127412343106307030532 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: %run %t %t.dll 2>&1 | FileCheck %s // Test that it works correctly even with ICF enabled. // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll -link /OPT:REF /OPT:ICF // RUN: %run %t %t.dll 2>&1 | FileCheck %s #include extern "C" __declspec(dllexport) int test_function() { // Just make sure we can use cout. std::cout << "All ok\n"; // CHECK: All ok // This line forces a declaration of some global basic_ostream internal object that // calls memcpy() in its constructor. This doesn't work if __asan_init is not // called early enough. std::cout << 42; // CHECK: 42 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/longjmp.cc0000664000175000017500000000141212363455437030421 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O %s -o %t && %run %t // FIXME: merge this with the common longjmp test when we can run common // tests on Windows. #include #include #include #include static jmp_buf buf; int main() { char x[32]; fprintf(stderr, "\nTestLongJmp\n"); fprintf(stderr, "Before: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); assert(__asan_address_is_poisoned(x + 32)); if (0 == setjmp(buf)) longjmp(buf, 1); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); // FIXME: Invert this assertion once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 assert(!__asan_address_is_poisoned(x + 32)); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/demangled_names.cc0000664000175000017500000000204112562224370032044 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s // // This test makes sure ASan symbolizes stack traces the way they are typically // symbolized on Windows. #include namespace foo { // A template function in a namespace. template void bar(char *p) { *p = x; } // A regular function in a namespace. void spam(char *p) { bar<42>(p); } } // A multi-argument template with a bool template parameter. template void baz(T t) { if (U) foo::spam(t); } template struct A { A(T v) { v_ = v; } ~A(); char *v_; }; // A destructor of a template class. template<> A::~A() { baz(v_); } int main() { char *buffer = (char*)malloc(42); free(buffer); A a(buffer); // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: foo::bar<42>{{.*}}demangled_names.cc // CHECK: foo::spam{{.*}}demangled_names.cc // CHECK: baz{{.*}}demangled_names.cc // CHECK: A::~A{{.*}}demangled_names.cc } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/stack_use_after_return.cc0000664000175000017500000000117612567131651033516 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s char *x; void foo() { char stack_buffer[42]; x = &stack_buffer[13]; } int main() { foo(); *x = 42; // CHECK: AddressSanitizer: stack-use-after-return // CHECK: WRITE of size 1 at {{.*}} thread T0 // CHECK-NEXT: {{#0 0x.* in main .*stack_use_after_return.cc}}:[[@LINE-3]] // // CHECK: is located in stack of thread T0 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: {{#0 0x.* in foo.*stack_use_after_return.cc}} // // CHECK: 'stack_buffer' <== Memory access at offset [[OFFSET]] is inside this variable } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/use_after_realloc.cc0000664000175000017500000000151012341320165032411 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)realloc(0, 32), *stale = buffer; buffer = (char*)realloc(buffer, 64); // The 'stale' may now point to a free'd memory. stale[0] = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*use_after_realloc.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 32-byte region // CHECK: freed by thread T0 here: // CHECK-NEXT: {{#0 .* realloc }} // CHECK-NEXT: {{#1 .* main .*use_after_realloc.cc}}:[[@LINE-9]] // CHECK: previously allocated by thread T0 here: // CHECK-NEXT: {{#0 .* realloc }} // CHECK-NEXT: {{#1 .* main .*use_after_realloc.cc}}:[[@LINE-14]] free(buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/double_operator_delete.cc0000664000175000017500000000161312373132613033452 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int *x = new int[42]; delete [] x; delete [] x; // CHECK: AddressSanitizer: attempting double-free on [[ADDR:0x[0-9a-f]+]] // FIXME: The 'operator delete' frame should have []. // CHECK-NEXT: {{#0 .* operator delete}} // CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-4]] // CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region // CHECK-LABEL: freed by thread T0 here: // FIXME: The 'operator delete' frame should have []. // CHECK-NEXT: {{#0 .* operator delete}} // CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-10]] // CHECK-LABEL: previously allocated by thread T0 here: // FIXME: The 'operator new' frame should have []. // CHECK-NEXT: {{#0 .* operator new}} // CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-15]] return 0; } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_with_d0000664000175000017500000000165412744234342033630 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s struct C { int x; ~C() {} }; int main() { C *buffer = new C[42]; buffer[-(1 + sizeof(void*) / 4)].x = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*operator_array_new_with_dtor_left_oob.cc}}:[[@LINE-3]] // // FIXME: Currently it says "4 bytes ... left of 172-byte region", // should be "8 bytes ... left of 168-byte region", see // https://code.google.com/p/address-sanitizer/issues/detail?id=314 // CHECK: [[ADDR]] is located {{.*}} bytes to the left of {{(172|176)}}-byte region // CHECK-LABEL: allocated by thread T0 here: // FIXME: The 'operator new' frame should have []. // CHECK-NEXT: {{#0 .* operator new}} // CHECK-NEXT: {{#1 .* main .*operator_array_new_with_dtor_left_oob.cc}}:[[@LINE-13]] delete [] buffer; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_poison_unpoison.cc0000664000175000017500000000211312562224370033035 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include void should_not_crash(volatile char *c) { *c = 42; } void should_crash(volatile char *c) { *c = 42; } extern "C" __declspec(dllexport) int test_function() { char buffer[256]; should_not_crash(&buffer[0]); __asan_poison_memory_region(buffer, 128); should_not_crash(&buffer[192]); __asan_unpoison_memory_region(buffer, 64); should_not_crash(&buffer[32]); should_crash(&buffer[96]); // CHECK: AddressSanitizer: use-after-poison on address [[ADDR:0x[0-9a-f]+]] // CHECK-NEXT: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: should_crash{{.*}}\dll_poison_unpoison.cc // CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cc:[[@LINE-4]] // CHECK-NEXT: main // // CHECK: [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cc // CHECK: 'buffer' <== Memory access at offset [[OFFSET]] is inside this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_intercept_memchr.cc0000664000175000017500000000210212773473513033133 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s // On windows 64-bit, the memchr function is written in assembly and is not // hookable with the interception library. There is not enough padding before // the function and there is a short jump on the second instruction which // doesn't not allow enough space to encode a 64-bit indirect jump. // UNSUPPORTED: x86_64-windows #include extern "C" __declspec(dllexport) int test_function() { char buff[6] = "Hello"; memchr(buff, 'z', 7); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: READ of size 7 at [[ADDR]] thread T0 // CHECK-NEXT: __asan_wrap_memchr // CHECK-NEXT: memchr // CHECK-NEXT: test_function {{.*}}dll_intercept_memchr.cc:[[@LINE-5]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: test_function {{.*}}dll_intercept_memchr.cc // CHECK: 'buff' <== Memory access at offset {{.*}} overflows this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/oom.cc0000664000175000017500000000036212744234342027541 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-32-bits #include int main() { while (true) { void *ptr = malloc(200 * 1024 * 1024); // 200MB } // CHECK: failed to allocate } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_noreturn.cc0000664000175000017500000000156012562224370031455 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include void noreturn_f() { int subscript = -1; char buffer[42]; buffer[subscript] = 42; _exit(1); // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: noreturn_f{{.*}}dll_noreturn.cc:[[@LINE-4]] // CHECK-NEXT: test_function{{.*}}dll_noreturn.cc // CHECK-NEXT: main{{.*}}dll_host.cc // // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: noreturn_f{{.*}}dll_noreturn.cc // CHECK: 'buffer' <== Memory access at offset [[OFFSET]] underflows this variable // CHECK-LABEL: SUMMARY } extern "C" __declspec(dllexport) int test_function() { noreturn_f(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_array_new_uaf.cc0000664000175000017500000000154012373132613033477 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = new char[42]; delete [] buffer; buffer[0] = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK: {{#0 .* main .*operator_array_new_uaf.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region // CHECK-LABEL: freed by thread T0 here: // FIXME: The 'operator delete' frame should have []. // CHECK: {{#0 .* operator delete}} // CHECK: {{#1 .* main .*operator_array_new_uaf.cc}}:[[@LINE-9]] // CHECK-LABEL: previously allocated by thread T0 here: // FIXME: The 'operator new' frame should have []. // CHECK: {{#0 .* operator new}} // CHECK: {{#1 .* main .*operator_array_new_uaf.cc}}:[[@LINE-14]] return 0; } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/queue_user_work_item_report.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/queue_user_work_item_repo0000664000175000017500000000135112750201023033634 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include HANDLE done; DWORD CALLBACK work_item(LPVOID) { int subscript = -1; volatile char stack_buffer[42]; stack_buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T1 // CHECK: {{#0 .* work_item.*queue_user_work_item_report.cc}}:[[@LINE-3]] SetEvent(done); return 0; } int main(int argc, char **argv) { done = CreateEvent(0, false, false, "job is done"); if (!done) return 1; // CHECK-NOT: Thread T1 created QueueUserWorkItem(&work_item, nullptr, 0); if (WAIT_OBJECT_0 != WaitForSingleObject(done, 10 * 1000)) return 2; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/iostream_sbo.cc0000664000175000017500000000107512466126167031445 0ustar mwhudsonmwhudson// First, check this works with the default blacklist: // RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: echo "42" | %run %t 2>&1 | FileCheck %s // // Then, make sure it still works when a user uses his own blacklist file: // RUN: %clang_cl_asan -O0 %s -fsanitize-blacklist=%p/../Helpers/initialization-blacklist.txt -Fe%t2 // RUN: echo "42" | %run %t2 2>&1 | FileCheck %s #include int main() { int i; std::cout << "Type i: "; std::cin >> i; return 0; // CHECK: Type i: // CHECK-NOT: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_delete_wrong_argument.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_delete_wrong_arg0000664000175000017500000000054012562224370033601 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int *x = new int[42]; delete (x + 1); // CHECK: AddressSanitizer: attempting free on address which was not malloc()-ed // CHECK: {{#0 0x.* operator delete}} // CHECK: {{#1 .* main .*operator_delete_wrong_argument.cc}}:[[@LINE-3]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_malloc_uaf.cc0000664000175000017500000000166012341320165031676 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include extern "C" __declspec(dllexport) int test_function() { int *buffer = (int*)malloc(42); free(buffer); buffer[0] = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cc:[[@LINE-3]] // CHECK-NEXT: main {{.*}}dll_host // // CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region // CHECK-LABEL: freed by thread T0 here: // CHECK-NEXT: free // CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cc:[[@LINE-10]] // CHECK-NEXT: main {{.*}}dll_host // // CHECK-LABEL: previously allocated by thread T0 here: // CHECK-NEXT: malloc // CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cc:[[@LINE-16]] // CHECK-NEXT: main {{.*}}dll_host return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_allocators_sanity.cc0000664000175000017500000000124212341320165033322 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: %run %t %t.dll | FileCheck %s #include #include extern "C" __declspec(dllexport) int test_function() { int *p = (int*)malloc(1024 * sizeof(int)); p[512] = 0; free(p); p = (int*)malloc(128); p = (int*)realloc(p, 2048 * sizeof(int)); p[1024] = 0; free(p); p = (int*)calloc(16, sizeof(int)); if (p[8] != 0) return 1; p[15]++; if (16 * sizeof(int) != _msize(p)) return 2; free(p); p = new int; *p = 42; delete p; p = new int[42]; p[15]++; delete [] p; printf("All ok\n"); // CHECK: All ok return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/stack_array_left_oob.cc0000664000175000017500000000114212474077541033126 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { int subscript = -1; char buffer[42]; buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*stack_array_left_oob.cc}}:[[@LINE-3]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame // CHECK-NEXT: {{#0 .* main .*stack_array_left_oob.cc}} // CHECK: 'buffer' <== Memory access at offset [[OFFSET]] underflows this variable } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_intercept_memcpy.cc0000664000175000017500000000207612442104515033146 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s // Test that it works correctly even with ICF enabled. // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll -link /OPT:REF /OPT:ICF // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include #include extern "C" __declspec(dllexport) int test_function() { char buff1[6] = "Hello", buff2[5]; memcpy(buff2, buff1, 5); if (buff1[2] != buff2[2]) return 2; printf("Initial test OK\n"); fflush(0); // CHECK: Initial test OK memcpy(buff2, buff1, 6); // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 6 at [[ADDR]] thread T0 // CHECK-NEXT: __asan_{{.*}}memcpy // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cc:[[@LINE-4]] // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cc // CHECK: 'buff2' <== Memory access at offset {{.*}} overflows this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_host.cc0000664000175000017500000000561012751204602030552 0ustar mwhudsonmwhudson// This is a host program for DLL tests. // // Just make sure we can compile this. // The actual compile&run sequence is to be done by the DLL tests. // RUN: %clang_cl_asan -O0 %s -Fe%t // // Get the list of ASan wrappers exported by the main module RTL: // note: The mangling decoration (i.e. @4 )is removed because calling convention // differ from 32-bit and 64-bit. // RUN: dumpbin /EXPORTS %t | grep -o "__asan_wrap[^ ]*" | sed -e s/@.*// > %t.exported_wrappers1 // FIXME: we should really check the other __asan exports too. // RUN: dumpbin /EXPORTS %t | grep -o "__sanitizer_[^ ]*" | sed -e s/@.*// > %t.exported_wrappers2 // // Get the list of ASan wrappers imported by the DLL RTL: // [BEWARE: be really careful with the sed commands, as this test can be run // from different environemnts with different shells and seds] // RUN: grep INTERCEPT_LIBRARY_FUNCTION %p/../../../../lib/asan/asan_win_dll_thunk.cc | grep -v define | sed -e s/.*(/__asan_wrap_/ | sed -e s/).*// > %t.dll_imports1 // RUN: grep "^INTERFACE_FUNCTION.*sanitizer" %p/../../../../lib/asan/asan_win_dll_thunk.cc | grep -v define | sed -e s/.*(// | sed -e s/).*// > %t.dll_imports2 // // Add functions interecepted in asan_malloc.win.cc and asan_win.cc. // RUN: grep '[I]MPORT:' %s | sed -e 's/.*[I]MPORT: //' > %t.dll_imports3 // IMPORT: __asan_wrap_HeapAlloc // IMPORT: __asan_wrap_HeapFree // IMPORT: __asan_wrap_HeapReAlloc // IMPORT: __asan_wrap_HeapSize // IMPORT: __asan_wrap_CreateThread // IMPORT: __asan_wrap_RaiseException // IMPORT: __asan_wrap_RtlRaiseException // // The exception handlers differ in 32-bit and 64-bit, so we ignore them: // RUN: grep '[E]XPORT:' %s | sed -e 's/.*[E]XPORT: //' > %t.exported_wrappers3 // EXPORT: __asan_wrap__except_handler3 // EXPORT: __asan_wrap__except_handler4 // EXPORT: __asan_wrap___C_specific_handler // // RUN: cat %t.dll_imports1 %t.dll_imports2 %t.dll_imports3 | sort | uniq > %t.dll_imports-sorted // RUN: cat %t.exported_wrappers1 %t.exported_wrappers2 %t.exported_wrappers3 | sort | uniq > %t.exported_wrappers-sorted // // Now make sure the DLL thunk imports everything: // RUN: echo // RUN: echo "=== NOTE === If you see a mismatch below, please update asan_win_dll_thunk.cc" // RUN: diff %t.dll_imports-sorted %t.exported_wrappers-sorted // REQUIRES: asan-static-runtime #include #include int main(int argc, char **argv) { if (argc != 2) { printf("Usage: %s [client].dll\n", argv[0]); return 101; } const char *dll_name = argv[1]; HMODULE h = LoadLibrary(dll_name); if (!h) { printf("Could not load DLL: %s (code: %lu)!\n", dll_name, GetLastError()); return 102; } typedef int (*test_function)(); test_function gf = (test_function)GetProcAddress(h, "test_function"); if (!gf) { printf("Could not locate test_function in the DLL!\n"); FreeLibrary(h); return 103; } int ret = gf(); FreeLibrary(h); return ret; } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/use_after_return_linkage.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/use_after_return_linkage.0000664000175000017500000000046212377626227033521 0ustar mwhudsonmwhudson// Make sure LIBCMT doesn't accidentally get added to the list of DEFAULTLIB // directives. REQUIRES: asan-dynamic-runtime // RUN: %clang_cl_asan -LD %s | FileCheck %s // CHECK: Creating library // CHECK-NOT: LIBCMT void foo(int *p) { *p = 42; } __declspec(dllexport) void bar() { int x; foo(&x); } ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/dll_operator_array_new_wi0000664000175000017500000000241512744234342033620 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s struct C { int x; ~C() {} }; extern "C" __declspec(dllexport) int test_function() { C *buffer = new C[42]; buffer[-(1 + sizeof(void*) / 4)].x = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 // CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cc:[[@LINE-3]] // CHECK-NEXT: main {{.*}}dll_host.cc // // FIXME: Currently it says "4 bytes ... left of 172-byte region", // should be "8 bytes ... left of 168-byte region", see // https://code.google.com/p/address-sanitizer/issues/detail?id=314 // CHECK: [[ADDR]] is located {{.*}} bytes to the left of {{(172|176)}}-byte region // FIXME: Should get rid of the malloc/free frames called from the inside of // operator new/delete in DLLs when using -MT CRT. // FIXME: The operator new frame should have []. // CHECK-LABEL: allocated by thread T0 here: // CHECK: operator new // CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cc:[[@LINE-16]] // CHECK-NEXT: main {{.*}}dll_host.cc // CHECK-LABEL: SUMMARY delete [] buffer; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/thread_stack_reuse.cc0000664000175000017500000000133212341320165032574 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t #include DWORD WINAPI thread_proc_1(void *) { volatile int x, y, z; x = 1; y = 2; z = 3; return 0; } DWORD WINAPI thread_proc_2(void *) { volatile char stack_buffer[42]; for (int i = 0; i < sizeof(stack_buffer); ++i) stack_buffer[i] = 42; return 0; } int main(void) { HANDLE thr = NULL; thr = CreateThread(NULL, 0, thread_proc_1, NULL, 0, NULL); if (thr == 0) return 1; if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) return 2; thr = CreateThread(NULL, 0, thread_proc_2, NULL, 0, NULL); if (thr == 0) return 3; if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE)) return 4; CloseHandle(thr); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/hello_world.cc0000664000175000017500000000023412341320165031247 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t | FileCheck %s #include int main() { printf("Hello, world!\n"); // CHECK: Hello, world! } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/coverage-basic.cc0000664000175000017500000000107012674106707031623 0ustar mwhudsonmwhudson// RUN: rm -rf %T/coverage-basic // RUN: mkdir %T/coverage-basic && cd %T/coverage-basic // RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe // RUN: %env_asan_opts=coverage=1 %run ./test.exe // // RUN: %sancov print *.sancov | FileCheck %s #include void foo() { fputs("FOO", stderr); } void bar() { fputs("BAR", stderr); } int main(int argc, char **argv) { if (argc == 2) { foo(); bar(); } else { bar(); foo(); } } // CHECK: 0x{{[0-9a-f]*}} // CHECK: 0x{{[0-9a-f]*}} // CHECK: 0x{{[0-9a-f]*}} // CHECK-NOT: 0x{{[0-9a-f]*}} golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/fuse-lld.cc0000664000175000017500000000133012562431211030446 0ustar mwhudsonmwhudson// If we have LLD, see that things more or less work. // // REQUIRES: lld // // FIXME: Use -fuse-ld=lld after the old COFF linker is removed. // FIXME: Test will fail until we add flags for requesting dwarf or cv. // RUNX: %clangxx_asan -O2 %s -o %t.exe -fuse-ld=lld -Wl,-debug // RUN: %clangxx_asan -c -O2 %s -o %t.o -gdwarf // RUN: lld-link %t.o -out:%t.exe -debug -defaultlib:libcmt %asan_lib %asan_cxx_lib // RUN: not %run %t.exe 2>&1 | FileCheck %s #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: heap-use-after-free // CHECK: free // CHECK: main{{.*}}fuse-lld.cc:[[@LINE-4]]:3 // CHECK: malloc // CHECK: main{{.*}}fuse-lld.cc:[[@LINE-7]]:20 } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/report_after_syminitialize.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/report_after_syminitializ0000664000175000017500000000152712744032105033661 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=external_symbolizer_path=asdf not %run %t 2>&1 | FileCheck %s #include #include int main() { // Make sure the RTL recovers from "no options enabled" dbghelp setup. SymSetOptions(0); // Make sure the RTL recovers from "fInvadeProcess=FALSE". if (!SymInitialize(GetCurrentProcess(), 0, FALSE)) return 42; *(volatile int*)0 = 42; // CHECK: ERROR: AddressSanitizer: access-violation on unknown address // CHECK: The signal is caused by a WRITE memory access. // CHECK: Hint: address points to the zero page. // CHECK: {{WARNING: .*DbgHelp}} // CHECK: {{WARNING: Failed to use and restart external symbolizer}} // CHECK: {{#0 0x.* in main.*report_after_syminitialize.cc:}}[[@LINE-6]] // CHECK: AddressSanitizer can not provide additional info. } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_new_right_oob.cc0000664000175000017500000000110512562224370033501 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = new char; buffer[1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK: {{#0 .* main .*operator_new_right_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes to the right of 1-byte region // CHECK: allocated by thread T0 here: // CHECK: {{#0 .* operator new}} // CHECK: {{#1 .* main .*operator_new_right_oob.cc}}:[[@LINE-8]] delete buffer; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/crt_initializers.cc0000664000175000017500000000137312341320165032320 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: %run %t | FileCheck %s // This is a test for http://code.google.com/p/address-sanitizer/issues/detail?id=305 #include typedef void (*FPTR)(); // __xi_a and __xi_z are defined in VC/crt/src/crt0dat.c // and are located in .CRT$XIA and .CRT$XIZ respectively. extern "C" FPTR __xi_a, __xi_z; int main() { unsigned count = 0; // Iterate through CRT initializers. for (FPTR* it = &__xi_a; it < &__xi_z; ++it) { if (*it) count++; } printf("Number of nonzero CRT initializers: %u\n", count); // CHECK: Number of nonzero CRT initializers } void call_me_maybe() {} #pragma data_seg(".CRT$XIB") // Add an initializer that shouldn't get its own redzone. FPTR run_on_startup = call_me_maybe; golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/realloc_left_oob.cc0000664000175000017500000000111212341320165032223 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = (char*)realloc(0, 42); buffer[-1] = 42; // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK-NEXT: {{#0 .* main .*realloc_left_oob.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region // CHECK: allocated by thread T0 here: // CHECK-NEXT: {{#0 .* realloc }} // CHECK-NEXT: {{#1 .* main .*realloc_left_oob.cc}}:[[@LINE-8]] free(buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/operator_new_uaf.cc0000664000175000017500000000133312562224370032303 0ustar mwhudsonmwhudson// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *buffer = new char; delete buffer; *buffer = 42; // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 // CHECK: {{#0 .* main .*operator_new_uaf.cc}}:[[@LINE-3]] // CHECK: [[ADDR]] is located 0 bytes inside of 1-byte region // CHECK-LABEL: freed by thread T0 here: // CHECK: {{#0 .* operator delete}} // CHECK: {{#1 .* main .*operator_new_uaf.cc}}:[[@LINE-8]] // CHECK-LABEL: previously allocated by thread T0 here: // CHECK: {{#0 .* operator new}} // CHECK: {{#1 .* main .*operator_new_uaf.cc}}:[[@LINE-12]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Windows/free_hook_realloc.cc0000664000175000017500000000147412473127712032417 0ustar mwhudsonmwhudson// Check that free hook doesn't conflict with Realloc. // RUN: %clangxx_asan -O2 %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // FIXME: merge this with the common free_hook_realloc test when we can run // common tests on Windows. #include #include #include static void *glob_ptr; extern "C" { void __sanitizer_free_hook(const volatile void *ptr) { if (ptr == glob_ptr) { *(int*)ptr = 0; write(1, "FreeHook\n", sizeof("FreeHook\n")); } } } int main() { int *x = (int*)malloc(100); x[0] = 42; glob_ptr = x; int *y = (int*)realloc(x, 200); // Verify that free hook was called and didn't spoil the memory. if (y[0] != 42) { _exit(1); } write(1, "Passed\n", sizeof("Passed\n")); free(y); // CHECK: FreeHook // CHECK: Passed return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/heavy_uar_test.cc0000664000175000017500000000401312563431554030337 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi,win32 // FIXME: Fix this test under GCC. // REQUIRES: Clang #include #include #include __attribute__((noinline)) char *pretend_to_do_something(char *x) { __asm__ __volatile__("" : : "r" (x) : "memory"); return x; } __attribute__((noinline)) char *LeakStack() { char x[1024]; memset(x, 0, sizeof(x)); return pretend_to_do_something(x); } template __attribute__((noinline)) void RecursiveFunctionWithStackFrame(int depth) { if (depth <= 0) return; char x[kFrameSize]; x[0] = depth; pretend_to_do_something(x); RecursiveFunctionWithStackFrame(depth - 1); } int main(int argc, char **argv) { #ifdef _MSC_VER // FIXME: This test crashes on Windows and raises a dialog. Avoid running it // in addition to XFAILing it. return 42; #endif int n_iter = argc >= 2 ? atoi(argv[1]) : 1000; int depth = argc >= 3 ? atoi(argv[2]) : 500; for (int i = 0; i < n_iter; i++) { RecursiveFunctionWithStackFrame<10>(depth); RecursiveFunctionWithStackFrame<100>(depth); RecursiveFunctionWithStackFrame<500>(depth); RecursiveFunctionWithStackFrame<1024>(depth); RecursiveFunctionWithStackFrame<2000>(depth); // The stack size is tight for the main thread in multithread // environment on FreeBSD. #if !defined(__FreeBSD__) RecursiveFunctionWithStackFrame<5000>(depth); RecursiveFunctionWithStackFrame<10000>(depth); #endif } char *stale_stack = LeakStack(); RecursiveFunctionWithStackFrame<1024>(10); stale_stack[100]++; // CHECK: ERROR: AddressSanitizer: stack-use-after-return on address // CHECK: is located in stack of thread T0 at offset {{116|132}} in frame // CHECK: in LeakStack{{.*}}heavy_uar_test.cc: // CHECK: [{{16|32}}, {{1040|1056}}) 'x' return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope.cc0000664000175000017500000000075612761067013030324 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s volatile int *p = 0; int main() { { int x = 0; p = &x; } *p = 5; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope.cc:[[@LINE-2]] // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x' return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/describe_address.cc0000664000175000017500000000112212363303472030573 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s #include int global; int main(int argc, char *argv[]) { int stack; int *heap = new int[100]; __asan_describe_address(heap); // CHECK: {{.*}} is located 0 bytes inside of 400-byte region // CHECK: allocated by thread T{{.*}} here __asan_describe_address(&stack); // CHECK: Address {{.*}} is located in stack of thread T{{.*}} at offset {{.*}} __asan_describe_address(&global); // CHECK: {{.*}} is located 0 bytes inside of global variable 'global' delete[] heap; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-levels.cc0000664000175000017500000000353212701315240030370 0ustar mwhudsonmwhudson// Test various levels of coverage // // RUN: %clangxx_asan -O1 -fsanitize-coverage=func %s -o %t // RUN: %env_asan_opts=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %clangxx_asan -O1 -fsanitize-coverage=bb %s -o %t // RUN: %env_asan_opts=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge %s -o %t // RUN: %env_asan_opts=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge -mllvm -sanitizer-coverage-block-threshold=0 %s -o %t // RUN: %env_asan_opts=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge,8bit-counters %s -o %t // RUN: %env_asan_opts=coverage=1:coverage_counters=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK_COUNTERS // RUN: %env_asan_opts=coverage=1:coverage_bitset=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET // RUN: %env_asan_opts=coverage=1:coverage_pcs=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOPCS // // REQUIRES: asan-64-bits // UNSUPPORTED: android volatile int sink; int main(int argc, char **argv) { if (argc == 0) sink = 0; } // CHECK1: CovDump: bitset of 1 bits written for '{{.*}}', 1 bits are set // CHECK1: 1 PCs written // CHECK2: CovDump: bitset of 2 bits written for '{{.*}}', 1 bits are set // CHECK2: 1 PCs written // CHECK3: CovDump: bitset of 3 bits written for '{{.*}}', 2 bits are set // CHECK3: 2 PCs written // CHECK3_NOBITSET-NOT: bitset of // CHECK3_NOPCS-NOT: PCs written // CHECK_COUNTERS: CovDump: 3 counters written for golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/heap-overflow.cc0000664000175000017500000000156112562755664030112 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=print_stats=1 not %run %t 2>&1 | FileCheck %s // FIXME: Fix this test under GCC. // REQUIRES: Clang #include #include int main(int argc, char **argv) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); int res = x[argc * 10]; // BOOOM // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main .*heap-overflow.cc:}}[[@LINE-2]] // CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}} // CHECK: {{allocated by thread T0 here:}} // CHECK: {{ #0 0x.* in .*malloc}} free(x); return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/huge_negative_hea_oob.cc0000664000175000017500000000067112330266131031576 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O %s -o %t && not %run %t 2>&1 | FileCheck %s // Check that we can find huge buffer overflows to the left. #include #include int main(int argc, char **argv) { char *x = (char*)malloc(1 << 20); memset(x, 0, 10); int res = x[-argc * 4000]; // BOOOM // CHECK: is located 4000 bytes to the left of free(x); return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strpbrk-2.c0000664000175000017500000000114312612115020026757 0ustar mwhudsonmwhudson// Test stopset overflow in strpbrk function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strpbrk asan option // RUN: %env_asan_opts=intercept_strpbrk=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { char *r; char s1[] = "c"; char s2[4] = "bca"; __asan_poison_memory_region ((char *)&s2[2], 2); r = strpbrk(s1, s2); // CHECK:'s2' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == s1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/global-demangle.cc0000664000175000017500000000070212360715262030324 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s namespace XXX { class YYY { public: static char ZZZ[]; }; char YYY::ZZZ[] = "abc"; } int main(int argc, char **argv) { return (int)XXX::YYY::ZZZ[argc + 5]; // BOOM // CHECK: {{READ of size 1 at 0x.*}} // CHECK: {{0x.* is located 2 bytes to the right of global variable}} // CHECK: 'XXX::YYY::ZZZ' {{.*}} of size 4 // CHECK: 'XXX::YYY::ZZZ' is ascii string 'abc' } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_safe_access.cc0000664000175000017500000000057412756110734031075 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: %run %t 2>&1 // #include __attribute__((noinline)) void foo(int index, int len) { volatile char str[len] __attribute__((aligned(32))); assert(!(reinterpret_cast(str) & 31L)); str[index] = '1'; } int main(int argc, char **argv) { foo(4, 5); foo(39, 40); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/vla_condition_overflow.cc0000664000175000017500000000112212756110734032064 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // // REQUIRES: stable-runtime #include #include __attribute__((noinline)) void foo(int index, int len) { if (index > len) { char str[len]; //NOLINT assert(!(reinterpret_cast(str) & 31L)); str[index] = '1'; // BOOM // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } } int main(int argc, char **argv) { foo(33, 10); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/0000775000175000017500000000000013040224617026401 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/lit.local.cfg0000664000175000017500000000021512021613066030737 0ustar mwhudsonmwhudson# Sources in this directory are helper files for tests which test functionality # involving multiple translation units. config.suffixes = [] ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-nobug-extra.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-nobug-extr0000664000175000017500000000040212127501225033435 0ustar mwhudsonmwhudson// Linker initialized: int getAB(); static int ab = getAB(); // Function local statics: int countCalls(); static int one = countCalls(); // Trivial constructor, non-trivial destructor: int getStructWithDtorValue(); static int val = getStructWithDtorValue(); ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-blacklist-extra.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-blacklist-0000664000175000017500000000055012050200624033366 0ustar mwhudsonmwhudsonint zero_init() { return 0; } int badGlobal = zero_init(); int readBadGlobal() { return badGlobal; } namespace badNamespace { class BadClass { public: BadClass() { value = 0; } int value; }; // Global object with non-trivial constructor. BadClass bad_object; } // namespace badNamespace int accessBadObject() { return badNamespace::bad_object.value; } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/init-order-atexit-extra.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/init-order-atexit-extra.c0000664000175000017500000000026012147651460033243 0ustar mwhudsonmwhudson#include class C { public: C() { value = 42; } ~C() { } int value; }; C c; void AccessC() { printf("C value: %d\n", c.value); } int main() { return 0; } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-constexpr-extra.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-constexpr-0000664000175000017500000000013112127501225033444 0ustar mwhudsonmwhudson// Constexpr: int getCoolestInteger(); static int coolest_integer = getCoolestInteger(); golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/echo-env.cc0000664000175000017500000000071212155363417030424 0ustar mwhudsonmwhudson// Helper binary for // lit_tests/TestCases/Darwin/unset-insert-libraries-on-exec.cc // Prints the environment variable with the given name. #include #include int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s ENVNAME\n", argv[0]); exit(1); } const char *value = getenv(argv[1]); if (value) { printf("%s = %s\n", argv[1], value); } else { printf("%s not set.\n", argv[1]); } return 0; } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-blacklist-extra2.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-blacklist-0000664000175000017500000000014212131534345033375 0ustar mwhudsonmwhudsonint zero_init(); int badSrcGlobal = zero_init(); int readBadSrcGlobal() { return badSrcGlobal; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/blacklist-extra.cc0000664000175000017500000000022612021613066031777 0ustar mwhudsonmwhudson// This function is broken, but this file is blacklisted int externalBrokenFunction(int argc) { char x[10] = {0}; return x[argc * 10]; // BOOM } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-bug-extra.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-bug-extra.0000664000175000017500000000017412021613066033325 0ustar mwhudsonmwhudson// This file simply declares a dynamically initialized var by the name of 'y'. int initY() { return 5; } int y = initY(); ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-blacklist.txtgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-blacklist.0000664000175000017500000000015012167104354033377 0ustar mwhudsonmwhudsonglobal:*badGlobal*=init type:*badNamespace::BadClass*=init src:*initialization-blacklist-extra2.cc=init ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-bug-extra2.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Helpers/initialization-bug-extra20000664000175000017500000000022512022336515033330 0ustar mwhudsonmwhudson// 'z' is dynamically initialized global from different TU. extern int z; int __attribute__((noinline)) initY() { return z + 1; } int y = initY(); golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/blacklist.cc0000664000175000017500000000243412330266131027257 0ustar mwhudsonmwhudson// Test the blacklist functionality of ASan // RUN: echo "fun:*brokenFunction*" > %tmp // RUN: echo "global:*badGlobal*" >> %tmp // RUN: echo "src:*blacklist-extra.cc" >> %tmp // RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O0 %s -o %t \ // RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1 // RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O1 %s -o %t \ // RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1 // RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O2 %s -o %t \ // RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1 // RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O3 %s -o %t \ // RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1 // badGlobal is accessed improperly, but we blacklisted it. Align // it to make sure memory past the end of badGlobal will be in // the same page. __attribute__((aligned(16))) int badGlobal; int readBadGlobal() { return (&badGlobal)[1]; } // A function which is broken, but excluded in the blacklist. int brokenFunction(int argc) { char x[10] = {0}; return x[argc * 10]; // BOOM } // This function is defined in Helpers/blacklist-extra.cc, a source file which // is blacklisted by name int externalBrokenFunction(int x); int main(int argc, char **argv) { brokenFunction(argc); int x = readBadGlobal(); externalBrokenFunction(argc); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strspn-1.c0000664000175000017500000000114212612115020026617 0ustar mwhudsonmwhudson// Test string s1 overflow in strspn function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strspn asan option // RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { size_t r; char s2[] = "ab"; char s1[4] = "acb"; __asan_poison_memory_region ((char *)&s1[2], 2); r = strspn(s1, s2); // CHECK:'s1' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strchr_strict.c0000664000175000017500000000116312562755664030064 0ustar mwhudsonmwhudson// Test strict_string_checks option in strchr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s = (char*)malloc(size); memset(s, fill, size); char c = 'o'; char* r = strchr(s, c); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == s); free(s); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/printf-5.c0000664000175000017500000000160112562755664026630 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // We need replace_intrin=0 to avoid reporting errors in memcpy. // RUN: %env_asan_opts=replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: %env_asan_opts=replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s // RUN: %env_asan_opts=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: printf is not intercepted on Windows yet. // XFAIL: win32 #include #include int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile char fmt[2]; memcpy((char *)fmt, "%c %d %f %s\n", sizeof(fmt)); printf((char *)fmt, c, x, f, s); return 0; // Check that format string is sanitized. // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 // CHECK-OFF: 0 } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-types.cc0000664000175000017500000000343112761174433031464 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %stdcxx11 -O0 -fsanitize-address-use-after-scope %s -o %t // RUN: not %run %t 0 2>&1 | FileCheck %s // RUN: not %run %t 1 2>&1 | FileCheck %s // RUN: not %run %t 2 2>&1 | FileCheck %s // RUN: not %run %t 3 2>&1 | FileCheck %s // RUN: not %run %t 4 2>&1 | FileCheck %s // RUN: not %run %t 5 2>&1 | FileCheck %s // RUN: not %run %t 6 2>&1 | FileCheck %s // RUN: not %run %t 7 2>&1 | FileCheck %s // RUN: not %run %t 8 2>&1 | FileCheck %s // RUN: not %run %t 9 2>&1 | FileCheck %s // RUN: not %run %t 10 2>&1 | FileCheck %s // Temporarily disable to fix the bot. // UNSUPPORTED: darwin #include #include #include template struct Ptr { void Store(T *ptr) { t = ptr; } void Access() { *t = {}; } T *t; }; template struct Ptr { using Type = T[N]; void Store(Type *ptr) { t = *ptr; } void Access() { *t = {}; } T *t; }; template __attribute__((noinline)) void test() { Ptr ptr; { T x; ptr.Store(&x); } ptr.Access(); // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #{{[0-9]+}} 0x{{.*}} in {{(void )?test.*\((void)?\) .*}}use-after-scope-types.cc // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x' } int main(int argc, char **argv) { using Tests = void (*)(); Tests tests[] = { &test, &test, &test, &test, &test, &test, &test>, &test, &test, &test, &test, }; int n = atoi(argv[1]); if (n == sizeof(tests) / sizeof(tests[0])) { for (auto te : tests) te(); } else { tests[n](); } return 0; } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/suppressions-exec-relative-location.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/suppressions-exec-relative-locati0000664000175000017500000000331112567131651033511 0ustar mwhudsonmwhudson// Check that without suppressions, we catch the issue. // RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // If the executable is started from a different location, we should still // find the suppression file located relative to the location of the executable. // RUN: rm -rf %T/suppressions-exec-relative-location // RUN: mkdir -p %T/suppressions-exec-relative-location // RUN: %clangxx_asan -O0 %s -o %T/suppressions-exec-relative-location/exec // RUN: echo "interceptor_via_fun:crash_function" > \ // RUN: %T/suppressions-exec-relative-location/supp.txt // RUN: %env_asan_opts=suppressions='"supp.txt"' \ // RUN: %run %T/suppressions-exec-relative-location/exec 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-IGNORE %s // RUN: rm -rf %T/suppressions-exec-relative-location // If the wrong absolute path is given, we don't try to construct // a relative path with it. // RUN: %env_asan_opts=suppressions='"/absolute/path"' not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-WRONG-FILE-NAME %s // Test that we reject directory as filename. // RUN: %env_asan_opts=suppressions='"folder/only/"' not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-WRONG-FILE-NAME %s // XFAIL: android // XFAIL: win32 #include #include #include void crash_function() { char *a = (char *)malloc(6); free(a); size_t len = strlen(a); // BOOM fprintf(stderr, "strlen ignored, len = %zu\n", len); } int main() { crash_function(); } // CHECK-CRASH: AddressSanitizer: heap-use-after-free // CHECK-IGNORE-NOT: AddressSanitizer: heap-buffer-overflow // CHECK-IGNORE: ignored // CHECK-WRONG-FILE-NAME: failed to read suppressions file golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-temp.cc0000664000175000017500000000073712746507477031306 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s struct IntHolder { int val; }; const IntHolder *saved; void save(const IntHolder &holder) { saved = &holder; } int main(int argc, char *argv[]) { save({argc}); int x = saved->val; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]] return x; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/ill.cc0000664000175000017500000000215212751233026026070 0ustar mwhudsonmwhudson// Test the handle_sigill option. // // RUN: %clangxx_asan %s -o %t && %env_asan_opts=handle_sigill=0 not --crash %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 // RUN: %clangxx_asan %s -o %t && %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 // REQUIRES: x86-target-arch // UNSUPPORTED: darwin #ifdef _WIN32 #include #endif int main(int argc, char **argv) { #ifdef _WIN32 // Sometimes on Windows this test generates a WER fault dialog. Suppress that. UINT new_flags = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; // Preserve existing error mode, as discussed at // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx UINT existing_flags = SetErrorMode(new_flags); SetErrorMode(existing_flags | new_flags); #endif if (argc) __builtin_trap(); // Unreachable code to avoid confusing the Windows unwinder. #ifdef _WIN32 SetErrorMode(0); #endif } // CHECK0-NOT: ERROR: AddressSanitizer // CHECK1: ERROR: AddressSanitizer: {{ILL|illegal-instruction}} on unknown address {{0x0*}} golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strtoll_strict.c0000664000175000017500000001050612563423744030253 0ustar mwhudsonmwhudson// Test strict_string_checks option in strtoll function // RUN: %clang_asan %s -o %t // RUN: %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: %run %t test4 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test4 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4 // RUN: %run %t test5 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test5 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5 // RUN: %run %t test6 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test6 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6 // RUN: %run %t test7 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test7 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7 // FIXME: Enable strtoll interceptor. // XFAIL: win32 #include #include #include #include void test1(char *array, char *endptr) { // Buffer overflow if there is no terminating null (depends on base) long long r = strtoll(array, &endptr, 3); assert(array + 2 == endptr); assert(r == 5); } void test2(char *array, char *endptr) { // Buffer overflow if there is no terminating null (depends on base) array[2] = 'z'; long long r = strtoll(array, &endptr, 35); assert(array + 2 == endptr); assert(r == 37); } void test3(char *array, char *endptr) { // Buffer overflow if base is invalid. memset(array, 0, 8); ASAN_POISON_MEMORY_REGION(array, 8); long long r = strtoll(array + 1, NULL, -1); assert(r == 0); ASAN_UNPOISON_MEMORY_REGION(array, 8); } void test4(char *array, char *endptr) { // Buffer overflow if base is invalid. long long r = strtoll(array + 3, NULL, 1); assert(r == 0); } void test5(char *array, char *endptr) { // Overflow if no digits are found. array[0] = ' '; array[1] = '+'; array[2] = '-'; long long r = strtoll(array, NULL, 0); assert(r == 0); } void test6(char *array, char *endptr) { // Overflow if no digits are found. array[0] = ' '; array[1] = array[2] = 'z'; long long r = strtoll(array, &endptr, 0); assert(array == endptr); assert(r == 0); } void test7(char *array, char *endptr) { // Overflow if no digits are found. array[2] = 'z'; long long r = strtoll(array + 2, NULL, 0); assert(r == 0); } int main(int argc, char **argv) { char *array0 = (char*)malloc(11); char* array = array0 + 8; char *endptr = NULL; array[0] = '1'; array[1] = '2'; array[2] = '3'; if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(array, endptr); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1: READ of size 4 if (!strcmp(argv[1], "test2")) test2(array, endptr); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2: READ of size 4 if (!strcmp(argv[1], "test3")) test3(array0, endptr); // CHECK3: {{.*ERROR: AddressSanitizer: use-after-poison on address}} // CHECK3: READ of size 1 if (!strcmp(argv[1], "test4")) test4(array, endptr); // CHECK4: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK4: READ of size 1 if (!strcmp(argv[1], "test5")) test5(array, endptr); // CHECK5: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK5: READ of size 4 if (!strcmp(argv[1], "test6")) test6(array, endptr); // CHECK6: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK6: READ of size 4 if (!strcmp(argv[1], "test7")) test7(array, endptr); // CHECK7: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK7: READ of size 2 free(array0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcat_strict.c0000664000175000017500000000356412562755664030066 0ustar mwhudsonmwhudson// Test strict_string_checks option in strcat function // RUN: %clang_asan %s -o %t // RUN: not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1 // RUN: %env_asan_opts=strict_string_checks=false not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-STRICT --check-prefix=CHECK1 // RUN: not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2 // RUN: %env_asan_opts=strict_string_checks=false not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2 #include #include #include void test1(char *to, int to_size, char *from) { // One of arguments points to not allocated memory. char* r = strcat(to + to_size, from); } void test2(char *to, int to_size, char *from) { // "to" is not zero-terminated. memset(to, 'z', to_size); char* r = strcat(to, from); } int main(int argc, char **argv) { size_t to_size = 100; char *to = (char*)malloc(to_size); size_t from_size = 20; char *from = (char*)malloc(from_size); memset(from, 'z', from_size); from[from_size - 1] = '\0'; if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(to, to_size, from); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1-STRICT: READ of size 1 // CHECK1-NONSTRICT: WRITE of size 20 if (!strcmp(argv[1], "test2")) test2(to, to_size, from); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2-STRICT: READ of size 101 // CHECK2-NONSTRICT: WRITE of size 20 free(to); free(from); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/intra-object-overflow.cc0000664000175000017500000000161612744161125031540 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -fsanitize-address-field-padding=1 %s -o %t // RUN: not %run %t 11 2>&1 | FileCheck %s // RUN: %run %t 10 // // FIXME: fix 32-bits. // REQUIRES: asan-64-bits // FIXME: Implement ASan intra-object padding in Clang's MS record layout // UNSUPPORTED: win32 #include #include class Foo { public: Foo() : pre1(1), pre2(2), post1(3), post2(4) { } virtual ~Foo() { } void set(int i, int val) { a[i] = val; } // CHECK: ERROR: AddressSanitizer: intra-object-overflow // CHECK: #0 {{.*}}Foo::set{{.*}}intra-object-overflow.cc:[[@LINE-2]] private: int pre1, pre2; int a[11]; int post1, post2; }; int main(int argc, char **argv) { int idx = argc == 2 ? atoi(argv[1]) : 0; Foo *foo = new Foo; foo->set(idx, 42); // CHECK: #1 {{.*}}main{{.*}}intra-object-overflow.cc:[[@LINE-1]] // CHECK: is located 84 bytes inside of 128-byte region delete foo; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/double-free.cc0000664000175000017500000000254512654055610027512 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t 2>&1 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=MALLOC-CTX // Also works if no malloc context is available. // RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 -fsanitize-recover=address %s -o %t 2>&1 // RUN: %env_asan_opts=halt_on_error=false %run %t 2>&1 | FileCheck %s --check-prefix CHECK-RECOVER // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include #include int main(int argc, char **argv) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); int res = x[argc]; free(x); free(x + argc - 1); // BOOM // CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0 // CHECK: #0 0x{{.*}} in {{.*}}free // CHECK: #1 0x{{.*}} in main {{.*}}double-free.cc:[[@LINE-3]] // CHECK: freed by thread T0 here: // MALLOC-CTX: #0 0x{{.*}} in {{.*}}free // MALLOC-CTX: #1 0x{{.*}} in main {{.*}}double-free.cc:[[@LINE-7]] // CHECK: allocated by thread T0 here: // MALLOC-CTX: double-free.cc:[[@LINE-12]] // CHECK-RECOVER: AddressSanitizer: attempting double-free{{.*}}in thread T0 // CHECK-RECOVER-NOT: AddressSanitizer CHECK failed: return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/speculative_load2.cc0000664000175000017500000000103312623170501030706 0ustar mwhudsonmwhudson// Verifies that speculative loads from unions do not happen under asan. // RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 // RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 typedef union { short q; struct { short x; short y; int for_alignment; } w; } U; int main() { char *buf = new char[2]; buf[0] = buf[1] = 0x0; U *u = (U *)buf; short result = u->q == 0 ? 0 : u->w.y; delete[] buf; return result; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcasestr-1.c0000664000175000017500000000145012612115020027465 0ustar mwhudsonmwhudson// Test haystack overflow in strcasestr function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strstr asan option // Disable other interceptors because strlen may be called inside strcasestr // RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1 // There's no interceptor for strcasestr on Windows // XFAIL: win32 #define _GNU_SOURCE #include #include #include int main(int argc, char **argv) { char *r = 0; char s2[] = "c"; char s1[4] = "abC"; __asan_poison_memory_region ((char *)&s1[2], 2); r = strcasestr(s1, s2); // CHECK:'s1' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == s1 + 2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/0000775000175000017500000000000013040224620026070 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_dlopen_test.cc0000664000175000017500000000055712341357633031746 0ustar mwhudsonmwhudson// Test that dlopen of dynamic runtime is prohibited. // // RUN: %clangxx %s -DRT=\"%shared_libasan\" -o %t -ldl // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // XFAIL: android #include int main(int argc, char **argv) { dlopen(RT, RTLD_LAZY); return 0; } // CHECK: ASan runtime does not come first in initial library list golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/globals-gc-sections.cc0000664000175000017500000000053312272735056032257 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -ffunction-sections -mllvm -asan-globals=0 // RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -ffunction-sections -mllvm -asan-globals=1 // https://code.google.com/p/address-sanitizer/issues/detail?id=260 // XFAIL: * int undefined(); int (*unused)() = undefined; int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/release_to_os_test.cc0000664000175000017500000000240312766010140032264 0ustar mwhudsonmwhudson// Tests ASAN_OPTIONS=allocator_release_to_os=1 // // RUN: %clangxx_asan -std=c++11 %s -o %t // RUN: %env_asan_opts=allocator_release_to_os=1 %run %t 2>&1 | FileCheck %s --check-prefix=RELEASE // RUN: %env_asan_opts=allocator_release_to_os=0 %run %t 2>&1 | FileCheck %s --check-prefix=NO_RELEASE // // REQUIRES: x86_64-target-arch #include #include #include #include #include #include void MallocReleaseStress() { const size_t kNumChunks = 10000; const size_t kAllocSize = 100; const size_t kNumIter = 100; uintptr_t *chunks[kNumChunks] = {0}; for (size_t iter = 0; iter < kNumIter; iter++) { std::random_shuffle(chunks, chunks + kNumChunks); size_t to_replace = rand() % kNumChunks; for (size_t i = 0; i < kNumChunks; i++) { if (chunks[i]) assert(chunks[i][0] == (uintptr_t)chunks[i]); if (i < to_replace) { delete [] chunks[i]; chunks[i] = new uintptr_t[kAllocSize]; chunks[i][0] = (uintptr_t)chunks[i]; } } } for (auto p : chunks) delete[] p; } int main() { MallocReleaseStress(); __asan_print_accumulated_stats(); } // RELEASE: mapped:{{.*}}releases: {{[1-9]}} // NO_RELEASE: mapped:{{.*}}releases: 0 golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/calloc-preload.c0000664000175000017500000000137112627263341031134 0ustar mwhudsonmwhudson// Test that initially callocked memory is properly freed // (see https://github.com/google/sanitizers/issues/626). // // RUN: %clang %s -o %t // RUN: env LD_PRELOAD=%shared_libasan %run %t // // REQUIRES: asan-dynamic-runtime // // This way of setting LD_PRELOAD does not work with Android test runner. // REQUIRES: not-android #include #include static void *ptr; // This constructor will run before __asan_init // so calloc will allocate memory from special pool. static void init() { ptr = calloc(10, 1); } __attribute__((section(".preinit_array"), used)) void *dummy = init; void free_memory() { // This used to abort because // Asan's free didn't recognize ptr. free(ptr); } int main() { free_memory(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/nohugepage_test.cc0000664000175000017500000000572212662736340031606 0ustar mwhudsonmwhudson// Regression test for // https://code.google.com/p/chromium/issues/detail?id=446692 // where asan consumed too much RAM due to transparent hugetables. // // RUN: %clangxx_asan -g %s -o %t // RUN: %env_asan_opts=no_huge_pages_for_shadow=1 %run %t 2>&1 | FileCheck %s // RUN: %run %t 2>&1 | FileCheck %s // // Would be great to run the test with no_huge_pages_for_shadow=0, but // the result will depend on the OS version and settings... // // REQUIRES: x86_64-target-arch // // WARNING: this test is very subtle and may nto work on some systems. // If this is the case we'll need to futher improve it or disable it. #include #include #include #include #include #include #include #include #include #include #include char FileContents[1 << 16]; void FileToString(const char *path) { FileContents[0] = 0; int fd = open(path, 0); if (fd < 0) return; char *p = FileContents; ssize_t size = sizeof(FileContents) - 1; ssize_t res = 0; do { ssize_t got = read (fd, p, size); if (got == 0) break; else if (got > 0) { p += got; res += got; size -= got; } else if (errno != EINTR) break; } while (size > 0 && res < sizeof(FileContents)); if (res >= 0) FileContents[res] = 0; } long ReadShadowRss() { const char *path = "/proc/self/smaps"; FileToString(path); char *s = strstr(FileContents, "2008fff7000-10007fff8000"); if (!s) return 0; s = strstr(s, "Rss:"); if (!s) return 0; s = s + 4; return atol(s); } const int kAllocSize = 1 << 28; // 256Mb const int kTwoMb = 1 << 21; const int kAsanShadowGranularity = 8; char *x; __attribute__((no_sanitize_address)) void TouchNoAsan(size_t i) { x[i] = 0; } int main() { long rss[5]; rss[0] = ReadShadowRss(); // use mmap directly to avoid asan touching the shadow. x = (char *)mmap(0, kAllocSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, 0, 0); fprintf(stderr, "X: %p-%p\n", x, x + kAllocSize); rss[1] = ReadShadowRss(); // Touch the allocated region, but not the shadow. for (size_t i = 0; i < kAllocSize; i += kTwoMb * kAsanShadowGranularity) TouchNoAsan(i); rss[2] = ReadShadowRss(); // Touch the shadow just a bit, in 2Mb*Granularity steps. for (size_t i = 0; i < kAllocSize; i += kTwoMb * kAsanShadowGranularity) __asan_poison_memory_region(x + i, kAsanShadowGranularity); rss[3] = ReadShadowRss(); // Touch all the shadow. __asan_poison_memory_region(x, kAllocSize); rss[4] = ReadShadowRss(); // Print the differences. for (int i = 0; i < 4; i++) { assert(rss[i] > 0); assert(rss[i+1] >= rss[i]); long diff = rss[i+1] / rss[i]; fprintf(stderr, "RSS CHANGE IS %d => %d: %s (%ld vs %ld)\n", i, i + 1, diff < 10 ? "SMALL" : "LARGE", rss[i], rss[i + 1]); } } // CHECK: RSS CHANGE IS 2 => 3: SMALL // CHECK: RSS CHANGE IS 3 => 4: LARGE golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/segv_read_write.c0000664000175000017500000000200212710527050031405 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE // UNSUPPORTED: powerpc64,mips,s390 #include static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; } __attribute__((noinline)) void Write(int *ptr) { *ptr = 0; } int main(int argc, char **argv) { // Writes to shadow are detected as reads from shadow gap (because of how the // shadow mapping works). This is kinda hard to fix. Test a random address in // the application part of the address space. void *volatile p = mmap(nullptr, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); munmap(p, 4096); if (argc == 1) Read((int *)p); else Write((int *)p); } // READ: AddressSanitizer: SEGV on unknown address // READ: The signal is caused by a READ memory access. // WRITE: AddressSanitizer: SEGV on unknown address // WRITE: The signal is caused by a WRITE memory access. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/abort_on_error.cc0000664000175000017500000000122312764601314031424 0ustar mwhudsonmwhudson// Check that with empty ASAN_OPTIONS, ASan reports on Linux don't crash // the process (abort_on_error=0). See also Darwin/abort_on_error.cc. // RUN: %clangxx_asan %s -o %t // Intentionally don't inherit the default ASAN_OPTIONS. // RUN: env ASAN_OPTIONS="" not %run %t 2>&1 | FileCheck %s // When we use lit's default ASAN_OPTIONS, we shouldn't crash either. On Linux // lit doesn't set ASAN_OPTIONS anyway. // RUN: not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: android #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/unpoison_tls.cc0000664000175000017500000000134412662736340031155 0ustar mwhudsonmwhudson// Test that TLS is unpoisoned on thread death. // REQUIRES: x86-target-arch // RUN: %clangxx_asan -O1 %s -pthread -o %t && %run %t 2>&1 #include #include #include #include __thread int64_t tls_var[2]; volatile int64_t *p_tls_var; void *first(void *arg) { ASAN_POISON_MEMORY_REGION(&tls_var, sizeof(tls_var)); p_tls_var = tls_var; return 0; } void *second(void *arg) { assert(tls_var == p_tls_var); *p_tls_var = 1; return 0; } int main(int argc, char *argv[]) { pthread_t p; assert(0 == pthread_create(&p, 0, first, 0)); assert(0 == pthread_join(p, 0)); assert(0 == pthread_create(&p, 0, second, 0)); assert(0 == pthread_join(p, 0)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/interface_symbols_linux.c0000664000175000017500000000602212662736340033203 0ustar mwhudsonmwhudson// Check the presence of interface symbols in compiled file. // RUN: %clang_asan -O2 %s -o %t.exe // RUN: nm -D %t.exe | grep " T " | sed "s/.* T //" \ // RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \ // RUN: | sed -E "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ // RUN: | grep -v "__asan_default_options" \ // RUN: | grep -v "__asan_stack_" \ // RUN: | grep -v "__asan_on_error" > %t.symbols // RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \ // RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \ // RUN: | grep -v "OPTIONAL" \ // RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \ // RUN: > %t.interface // RUN: echo __asan_report_load1 >> %t.interface // RUN: echo __asan_report_load2 >> %t.interface // RUN: echo __asan_report_load4 >> %t.interface // RUN: echo __asan_report_load8 >> %t.interface // RUN: echo __asan_report_load16 >> %t.interface // RUN: echo __asan_report_store1 >> %t.interface // RUN: echo __asan_report_store2 >> %t.interface // RUN: echo __asan_report_store4 >> %t.interface // RUN: echo __asan_report_store8 >> %t.interface // RUN: echo __asan_report_store16 >> %t.interface // RUN: echo __asan_report_load_n >> %t.interface // RUN: echo __asan_report_store_n >> %t.interface // RUN: echo __asan_report_load1_noabort >> %t.interface // RUN: echo __asan_report_load2_noabort >> %t.interface // RUN: echo __asan_report_load4_noabort >> %t.interface // RUN: echo __asan_report_load8_noabort >> %t.interface // RUN: echo __asan_report_load16_noabort >> %t.interface // RUN: echo __asan_report_store1_noabort >> %t.interface // RUN: echo __asan_report_store2_noabort >> %t.interface // RUN: echo __asan_report_store4_noabort >> %t.interface // RUN: echo __asan_report_store8_noabort >> %t.interface // RUN: echo __asan_report_store16_noabort >> %t.interface // RUN: echo __asan_report_load_n_noabort >> %t.interface // RUN: echo __asan_report_store_n_noabort >> %t.interface // RUN: echo __asan_report_exp_load1 >> %t.interface // RUN: echo __asan_report_exp_load2 >> %t.interface // RUN: echo __asan_report_exp_load4 >> %t.interface // RUN: echo __asan_report_exp_load8 >> %t.interface // RUN: echo __asan_report_exp_load16 >> %t.interface // RUN: echo __asan_report_exp_store1 >> %t.interface // RUN: echo __asan_report_exp_store2 >> %t.interface // RUN: echo __asan_report_exp_store4 >> %t.interface // RUN: echo __asan_report_exp_store8 >> %t.interface // RUN: echo __asan_report_exp_store16 >> %t.interface // RUN: echo __asan_report_exp_load_n >> %t.interface // RUN: echo __asan_report_exp_store_n >> %t.interface // RUN: echo __asan_get_current_fake_stack >> %t.interface // RUN: echo __asan_addr_is_in_fake_stack >> %t.interface // RUN: echo __asan_alloca_poison >> %t.interface // RUN: echo __asan_allocas_unpoison >> %t.interface // RUN: cat %t.interface | sort -u | diff %t.symbols - // FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing // in "initialized data section". // REQUIRES: x86-target-arch,asan-static-runtime int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/recvfrom.cc0000664000175000017500000000550612732027237030244 0ustar mwhudsonmwhudson// Test that ASan detects buffer overflow on read from socket via recvfrom. // // RUN: %clangxx_asan %s -DRECVFROM -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RECVFROM // RUN: %clangxx_asan %s -DSENDTO -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SENDTO // RUN: %clangxx_asan %s -DSENDTO -o %t && %env_asan_opts=intercept_send=0 %run %t 2>&1 // // UNSUPPORTED: android #include #include #include #include #include #include #include #include #define CHECK_ERROR(p, m) \ do { \ if (p) { \ fprintf(stderr, "ERROR " m "\n"); \ exit(1); \ } \ } while (0) const int kBufSize = 10; int sockfd; static void *client_thread_udp(void *data) { #ifdef SENDTO const char buf[kBufSize / 2] = {0, }; #else const char buf[kBufSize] = {0, }; #endif struct sockaddr_in serveraddr; socklen_t addrlen = sizeof(serveraddr); int succeeded = getsockname(sockfd, (struct sockaddr *)&serveraddr, &addrlen); CHECK_ERROR(succeeded < 0, "in getsockname"); succeeded = sendto(sockfd, buf, kBufSize, 0, (struct sockaddr *)&serveraddr, sizeof(serveraddr)); // CHECK-SENDTO: {{READ of size 10 at 0x.* thread T1}} // CHECK-SENDTO: {{ #1 0x.* in client_thread_udp.*recvfrom.cc:}}[[@LINE-3]] CHECK_ERROR(succeeded < 0, "in sending message"); return NULL; } int main() { #ifdef RECVFROM char buf[kBufSize / 2]; #else char buf[kBufSize]; #endif pthread_t client_thread; struct sockaddr_in serveraddr; sockfd = socket(AF_INET, SOCK_DGRAM, 0); CHECK_ERROR(sockfd < 0, "opening socket"); memset(&serveraddr, 0, sizeof(serveraddr)); serveraddr.sin_family = AF_INET; serveraddr.sin_addr.s_addr = htonl(INADDR_ANY); serveraddr.sin_port = 0; int bound = bind(sockfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr)); CHECK_ERROR(bound < 0, "on binding"); int succeeded = pthread_create(&client_thread, NULL, client_thread_udp, &serveraddr); CHECK_ERROR(succeeded, "creating thread"); recvfrom(sockfd, buf, kBufSize, 0, NULL, NULL); // BOOM // CHECK-RECVFROM: {{WRITE of size 10 at 0x.* thread T0}} // CHECK-RECVFROM: {{ #1 0x.* in main.*recvfrom.cc:}}[[@LINE-2]] // CHECK-RECVFROM: {{Address 0x.* is located in stack of thread T0 at offset}} // CHECK-RECVFROM-NEXT: in{{.*}}main{{.*}}recvfrom.cc succeeded = pthread_join(client_thread, NULL); CHECK_ERROR(succeeded, "joining thread"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/sized_delete_test.cc0000664000175000017500000000536112567131651032121 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -fsized-deallocation -O0 %s -o %t // RUN: not %run %t scalar 2>&1 | FileCheck %s -check-prefix=SCALAR // RUN: %env_asan_opts=new_delete_type_mismatch=1 not %run %t scalar 2>&1 | FileCheck %s -check-prefix=SCALAR // RUN: not %run %t array 2>&1 | FileCheck %s -check-prefix=ARRAY // RUN: %env_asan_opts=new_delete_type_mismatch=1 not %run %t array 2>&1 | FileCheck %s -check-prefix=ARRAY // RUN: %env_asan_opts=new_delete_type_mismatch=0 %run %t scalar // RUN: %env_asan_opts=new_delete_type_mismatch=0 %run %t array #include #include #include inline void break_optimization(void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } struct S12 { int a, b, c; }; struct S20 { int a, b, c, d, e; }; struct D1 { int a, b, c; ~D1() { fprintf(stderr, "D1::~D1\n"); } }; struct D2 { int a, b, c, d, e; ~D2() { fprintf(stderr, "D2::~D2\n"); } }; void Del12(S12 *x) { break_optimization(x); delete x; } void Del12NoThrow(S12 *x) { break_optimization(x); operator delete(x, std::nothrow); } void Del12Ar(S12 *x) { break_optimization(x); delete [] x; } void Del12ArNoThrow(S12 *x) { break_optimization(x); operator delete[](x, std::nothrow); } int main(int argc, char **argv) { if (argc != 2) return 1; std::string flag = argv[1]; // These are correct. Del12(new S12); Del12NoThrow(new S12); Del12Ar(new S12[100]); Del12ArNoThrow(new S12[100]); // Here we pass wrong type of pointer to delete, // but [] and nothrow variants of delete are not sized. Del12Ar(reinterpret_cast(new S20[100])); Del12NoThrow(reinterpret_cast(new S20)); Del12ArNoThrow(reinterpret_cast(new S20[100])); fprintf(stderr, "OK SO FAR\n"); // SCALAR: OK SO FAR // ARRAY: OK SO FAR if (flag == "scalar") { // Here asan should bark as we are passing a wrong type of pointer // to sized delete. Del12(reinterpret_cast(new S20)); // SCALAR: AddressSanitizer: new-delete-type-mismatch // SCALAR: object passed to delete has wrong type: // SCALAR: size of the allocated type: 20 bytes; // SCALAR: size of the deallocated type: 12 bytes. // SCALAR: is located 0 bytes inside of 20-byte region // SCALAR: SUMMARY: AddressSanitizer: new-delete-type-mismatch } else if (flag == "array") { D1 *d1 = reinterpret_cast(new D2[10]); break_optimization(d1); delete [] d1; // ARRAY-NOT: D2::~D2 // ARRAY: D1::~D1 // ARRAY: AddressSanitizer: new-delete-type-mismatch // ARRAY: size of the allocated type: 20{{4|8}} bytes; // ARRAY: size of the deallocated type: 12{{4|8}} bytes. } } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/clone_test.cc0000664000175000017500000000256712700531024030551 0ustar mwhudsonmwhudson// Regression test for: // http://code.google.com/p/address-sanitizer/issues/detail?id=37 // RUN: %clangxx_asan -O0 %s -o %t && %run %t | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && %run %t | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %run %t | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t | FileCheck %s // XFAIL: arm-linux-gnueabi #include #include #include #include #include #include int Child(void *arg) { char x[32] = {0}; // Stack gets poisoned. printf("Child: %p\n", x); _exit(1); // NoReturn, stack will remain unpoisoned unless we do something. } int main(int argc, char **argv) { const int kStackSize = 1 << 20; char __attribute__((aligned(16))) child_stack[kStackSize + 1]; char *sp = child_stack + kStackSize; // Stack grows down. printf("Parent: %p\n", sp); pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL); int status; pid_t wait_result = waitpid(clone_pid, &status, __WCLONE); if (wait_result < 0) { perror("waitpid"); return 0; } if (wait_result == clone_pid && WIFEXITED(status)) { // Make sure the child stack was indeed unpoisoned. for (int i = 0; i < kStackSize; i++) child_stack[i] = i; int ret = child_stack[argc - 1]; printf("PASSED\n"); // CHECK: PASSED return ret; } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/read_binary_name_regtest.c0000664000175000017500000000302412560424035033257 0ustar mwhudsonmwhudson// Regression test for https://crbug.com/502974, where ASan was unable to read // the binary name because of sandbox restrictions. // This test uses seccomp-BPF to restrict the readlink() system call and makes // sure ASan is still able to // RUN: not ls /usr/include/linux/seccomp.h || ( %clang_asan %s -o %t && not %run %t 2>&1 | FileCheck %s ) // UNSUPPORTED: android #include #include #include #include #include #include #include #include #ifndef __NR_readlink # define __NR_readlink __NR_readlinkat #endif #define syscall_nr (offsetof(struct seccomp_data, nr)) void corrupt() { void *p = malloc(10); free(p); free(p); } int main() { prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); struct sock_filter filter[] = { /* Grab the system call number */ BPF_STMT(BPF_LD + BPF_W + BPF_ABS, syscall_nr), // If this is __NR_readlink, BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, __NR_readlink, 0, 1), // return with EPERM, BPF_STMT(BPF_RET + BPF_K, SECCOMP_RET_ERRNO | EPERM), // otherwise allow the syscall. BPF_STMT(BPF_RET + BPF_K, SECCOMP_RET_ALLOW) }; struct sock_fprog prog; prog.len = (unsigned short)(sizeof(filter)/sizeof(filter[0])); prog.filter = filter; int res = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog, 0, 0); if (res != 0) { fprintf(stderr, "PR_SET_SECCOMP unsupported!\n"); } corrupt(); // CHECK: AddressSanitizer // CHECK-NOT: reading executable name failed return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/lit.local.cfg0000664000175000017500000000026612012450462030441 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Linux']: config.unsupported = True ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/stack-overflow-recovery-mode.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/stack-overflow-recovery-mod0000664000175000017500000000167512713041442033410 0ustar mwhudsonmwhudson// Test that ASan doesn't hang on stack overflow in recovery mode. // // RUN: %clang_asan -O0 -fsanitize-recover=address %s -o %t // RUN: %env_asan_opts=halt_on_error=false not %run %t 2>&1 | FileCheck %s #include #include #include #include static volatile int *recurse(volatile int n, volatile int *p) { // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* bp 0x.* sp 0x.* T.*\)}} if (n >= 0) *recurse(n + 1, p) += n; return p; } void LimitStackAndReexec(int argc, char **argv) { struct rlimit rlim; int res = getrlimit(RLIMIT_STACK, &rlim); assert(res == 0); if (rlim.rlim_cur == RLIM_INFINITY) { rlim.rlim_cur = 256 * 1024; res = setrlimit(RLIMIT_STACK, &rlim); assert(res == 0); execv(argv[0], argv); assert(0 && "unreachable"); } } int main(int argc, char **argv) { LimitStackAndReexec(argc, argv); volatile int res; return *recurse(argc + 1, &res); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/interception_malloc_test.cc0000664000175000017500000000136212330266131033476 0ustar mwhudsonmwhudson// ASan interceptor can be accessed with __interceptor_ prefix. // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include extern "C" void *__interceptor_malloc(size_t size); extern "C" void *malloc(size_t size) { write(2, "malloc call\n", sizeof("malloc call\n") - 1); return __interceptor_malloc(size); } int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return (int)strtol(x, 0, 10); // CHECK: malloc call // CHECK: heap-use-after-free } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/static_tls.cc0000664000175000017500000000134612717622455030576 0ustar mwhudsonmwhudson// REQUIRES: asan-64-bits // Regression test: __tls_get_addr interceptor must recognize static TLS. // // RUN: %clangxx_asan -DSHARED %s -shared -o %t-so.so -fPIC // RUN: %clangxx_asan %s -ldl -pthread -o %t %t-so.so // RUN: %env_asan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s // CHECK: before // CHECK: __tls_get_addr: static tls // CHECK: after // XFAIL: aarch64 // binutils 2.26 has a change that causes this test to fail on powerpc64. // UNSUPPORTED: powerpc64 #ifndef SHARED #include unsigned *f(); int main(int argc, char *argv[]) { fprintf(stderr, "before\n"); f(); fprintf(stderr, "after\n"); return 0; } #else // SHARED static __thread unsigned ThreadLocal; unsigned *f() { return &ThreadLocal; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/rlimit_mmap_test.cc0000664000175000017500000000066712330266131031765 0ustar mwhudsonmwhudson// Check that we properly report mmap failure. // RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include #include static volatile void *x; int main(int argc, char **argv) { struct rlimit mmap_resource_limit = { 0, 0 }; assert(0 == setrlimit(RLIMIT_AS, &mmap_resource_limit)); x = malloc(10000000); // CHECK: ERROR: Failed to mmap return 0; } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/function-sections-are-bad.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/function-sections-are-bad.c0000664000175000017500000000166612330266131033214 0ustar mwhudsonmwhudson// Check that --gc-sections does not throw away (or localize) parts of sanitizer // interface. // RUN: %clang_asan %s -Wl,--gc-sections -ldl -o %t // RUN: %clang_asan %s -DBUILD_SO -fPIC -o %t-so.so -shared // RUN: %run %t 2>&1 // REQUIRES: asan-64-bits #ifndef BUILD_SO #include #include #include #include int main(int argc, char *argv[]) { char path[4096]; snprintf(path, sizeof(path), "%s-so.so", argv[0]); void *handle = dlopen(path, RTLD_LAZY); if (!handle) fprintf(stderr, "%s\n", dlerror()); assert(handle != 0); typedef void (*F)(); F f = (F)dlsym(handle, "call_rtl_from_dso"); printf("%s\n", dlerror()); assert(dlerror() == 0); f(); dlclose(handle); return 0; } #else // BUILD_SO #include extern "C" void call_rtl_from_dso() { volatile int32_t x; volatile int32_t y = __sanitizer_unaligned_load32((void *)&x); } #endif // BUILD_SO golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/new_delete_mismatch.cc0000664000175000017500000000106512766076350032424 0ustar mwhudsonmwhudson// Check that we report new[] vs delete as alloc-dealloc-mismatch and not as // new-delete-type-mismatch when -fsized-deallocation is enabled. // RUN: %clangxx_asan -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t |& FileCheck %s // RUN: %clangxx_asan -fsized-deallocation -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t |& FileCheck %s #include static volatile char *x; int main() { x = new char[10]; delete x; } // CHECK: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_default_suppressions.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_default_suppressions.c0000664000175000017500000000044012473377725033545 0ustar mwhudsonmwhudson// Test that we use the suppressions from __asan_default_suppressions. // RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s extern "C" { const char *__asan_default_suppressions() { return "FooBar"; } } // CHECK: AddressSanitizer: failed to parse suppressions int main() {} golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/activation-options.cc0000664000175000017500000000435012567131651032251 0ustar mwhudsonmwhudson// Test for ASAN_OPTIONS=start_deactivated=1 mode. // Main executable is uninstrumented, but linked to ASan runtime. The shared // library is instrumented. // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx -O0 %s -c -o %t.o // RUN: %clangxx_asan -O0 %t.o %libdl -o %t // RUN: rm -f %t.asan.options.activation-options.cc.tmp // RUN: rm -f %t.asan.options.ABCDE // RUN: echo "help=1" >%t.asan.options.activation-options.cc.tmp // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-HELP --check-prefix=CHECK-FOUND // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-NO-HELP --check-prefix=CHECK-MISSING // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b not %run %t --fix-name 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-NO-HELP --check-prefix=CHECK-MISSING // RUN: echo "help=1" >%t.asan.options.ABCDE // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b %run %t --fix-name 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-HELP --check-prefix=CHECK-FOUND // XFAIL: arm-linux-gnueabi // XFAIL: android #if !defined(SHARED_LIB) #include #include #include #include #include #include #include #include "sanitizer/asan_interface.h" typedef void (*Fn)(); int main(int argc, char *argv[]) { std::string path = std::string(argv[0]) + "-so.so"; if (argc > 1 && strcmp(argv[1], "--fix-name") == 0) { assert(strlen(argv[0]) > 5); strcpy(argv[0], "ABCDE"); } void *dso = dlopen(path.c_str(), RTLD_NOW); if (!dso) { fprintf(stderr, "dlopen failed: %s\n", dlerror()); return 1; } return 0; } #else // SHARED_LIB // Empty: all we need is an ASan shared library constructor. #endif // SHARED_LIB // CHECK-HELP: Available flags for {{.*}}Sanitizer: // CHECK-NO-HELP-NOT: Available flags for {{.*}}Sanitizer: // CHECK-FOUND-NOT: Failed to read options // CHECK-MISSING: Failed to read options golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc0000664000175000017500000000245612662736340033225 0ustar mwhudsonmwhudson// Check that a stack unwinding algorithm works corretly even with the assembly // instrumentation. // REQUIRES: x86_64-target-arch // RUN: %clangxx_asan -g -O1 %s -fno-inline-functions -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mllvm -asan-instrument-assembly -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -g -O1 %s -fno-inline-functions -fomit-frame-pointer -momit-leaf-frame-pointer -mllvm -asan-instrument-assembly -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -g0 -O1 %s -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions -fno-inline-functions -fomit-frame-pointer -momit-leaf-frame-pointer -mllvm -asan-instrument-assembly -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-nounwind #include // CHECK: READ of size 4 // CHECK-NEXT: {{#0 0x[0-9a-fA-F]+ in foo}} // CHECK-NEXT: {{#1 0x[0-9a-fA-F]+ in main}} // CHECK-nounwind: READ of size 4 // CHECK-nounwind-NEXT: {{#0 0x[0-9a-fA-F]+ in foo}} __attribute__((noinline)) int foo(size_t n, int *buffer) { int r; __asm__("movl (%[buffer], %[n], 4), %[r] \n\t" : [r] "=r"(r) : [buffer] "r"(buffer), [n] "r"(n) : "memory"); return r; } int main() { const size_t n = 16; int *buffer = new int[n]; foo(n, buffer); delete[] buffer; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/leak.cc0000664000175000017500000000067612567131651027342 0ustar mwhudsonmwhudson// Minimal test for LeakSanitizer+AddressSanitizer. // REQUIRES: leak-detection // // RUN: %clangxx_asan %s -o %t // RUN: %env_asan_opts=detect_leaks=1 not %run %t 2>&1 | FileCheck %s // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=detect_leaks=0 %run %t #include int *t; int main(int argc, char **argv) { t = new int[argc - 1]; printf("t: %p\n", t); t = 0; } // CHECK: LeakSanitizer: detected memory leaks golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/malloc-in-qsort.cc0000664000175000017500000000306612662736340031445 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t // RUN: %env_asan_opts=fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST // RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW // Test how well we unwind in presence of qsort in the stack // (i.e. if we can unwind through a function compiled w/o frame pointers). // https://code.google.com/p/address-sanitizer/issues/detail?id=137 // Fast unwinder is only available on x86_64 and i386. // REQUIRES: x86-target-arch // REQUIRES: compiler-rt-optimized #include #include int *GlobalPtr; extern "C" { int QsortCallback(const void *a, const void *b) { char *x = (char*)a; char *y = (char*)b; printf("Calling QsortCallback\n"); GlobalPtr = new int[10]; return (int)*x - (int)*y; } __attribute__((noinline)) void MyQsort(char *a, size_t size) { printf("Calling qsort\n"); qsort(a, size, sizeof(char), QsortCallback); printf("Done\n"); // Avoid tail call. } } // extern "C" int main() { char a[2] = {1, 2}; MyQsort(a, 2); return GlobalPtr[10]; } // Fast unwind may not unwind through qsort. // CHECK-FAST: ERROR: AddressSanitizer: heap-buffer-overflow // CHECK-FAST: is located 0 bytes to the right // CHECK-FAST: #0{{.*}}operator new // CHECK-FAST-NEXT: #1{{.*}}QsortCallback // CHECK-SLOW: ERROR: AddressSanitizer: heap-buffer-overflow // CHECK-SLOW: is located 0 bytes to the right // CHECK-SLOW: #0{{.*}}operator new // CHECK-SLOW-NEXT: #1{{.*}}QsortCallback // CHECK-SLOW: #{{.*}}MyQsort // CHECK-SLOW-NEXT: #{{.*}}main golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/coverage-missing.cc0000664000175000017500000000522412662736340031664 0ustar mwhudsonmwhudson// Test for "sancov.py missing ...". // First case: coverage from executable. main() is called on every code path. // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -DFOOBAR -DMAIN // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing // RUN: cd %T/coverage-missing // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t // RUN: %sancov print *.sancov > main.txt // RUN: rm *.sancov // RUN: [ $(cat main.txt | wc -l) == 1 ] // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x // RUN: %sancov print *.sancov > foo.txt // RUN: rm *.sancov // RUN: [ $(cat foo.txt | wc -l) == 3 ] // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x x // RUN: %sancov print *.sancov > bar.txt // RUN: rm *.sancov // RUN: [ $(cat bar.txt | wc -l) == 4 ] // RUN: %sancov missing %t < foo.txt > foo-missing.txt // RUN: sort main.txt foo-missing.txt -o foo-missing-with-main.txt // The "missing from foo" set may contain a few bogus PCs from the sanitizer // runtime, but it must include the entire "bar" code path as a subset. Sorted // lists can be tested for set inclusion with diff + grep. // RUN: ( diff bar.txt foo-missing-with-main.txt || true ) | not grep "^<" // Second case: coverage from DSO. // cd %T // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %dynamiclib -DFOOBAR -shared -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func %s %dynamiclib -o %t -DMAIN // RUN: export LIBNAME=`basename %dynamiclib` // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing // RUN: cd %T/coverage-missing // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x // RUN: %sancov print $LIBNAME.*.sancov > foo.txt // RUN: rm *.sancov // RUN: [ $(cat foo.txt | wc -l) == 2 ] // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-missing %run %t x x // RUN: %sancov print $LIBNAME.*.sancov > bar.txt // RUN: rm *.sancov // RUN: [ $(cat bar.txt | wc -l) == 3 ] // RUN: %sancov missing %dynamiclib < foo.txt > foo-missing.txt // RUN: ( diff bar.txt foo-missing.txt || true ) | not grep "^<" // REQUIRES: x86-target-arch // XFAIL: android #include void foo1(); void foo2(); void bar1(); void bar2(); void bar3(); #if defined(FOOBAR) void foo1() { fprintf(stderr, "foo1\n"); } void foo2() { fprintf(stderr, "foo2\n"); } void bar1() { fprintf(stderr, "bar1\n"); } void bar2() { fprintf(stderr, "bar2\n"); } void bar3() { fprintf(stderr, "bar3\n"); } #endif #if defined(MAIN) int main(int argc, char **argv) { switch (argc) { case 1: break; case 2: foo1(); foo2(); break; case 3: bar1(); bar2(); bar3(); break; } } #endif ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/interception_readdir_r_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/interception_readdir_r_test0000664000175000017500000000507212341364156033610 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx_asan -O0 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // // RUN: %clangxx_asan -O0 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -D_FILE_OFFSET_BITS=64 -DTEMP_DIR='"'"%T"'"' -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include int main() { // Ensure the readdir_r interceptor doesn't erroneously mark the entire dirent // as written when the end of the directory pointer is reached. fputs("test1: reading the " TEMP_DIR " directory...\n", stderr); DIR *d = opendir(TEMP_DIR); struct dirent *result = (struct dirent *)(0xfeedbeef); // We assume the temp dir for this test doesn't have crazy long file names. char entry_buffer[4096]; memset(entry_buffer, 0xab, sizeof(entry_buffer)); unsigned count = 0; do { // Stamp the entry struct to try to trick the interceptor. ((struct dirent *)entry_buffer)->d_reclen = 9999; if (readdir_r(d, (struct dirent *)entry_buffer, &result) != 0) abort(); ++count; } while (result != NULL); fprintf(stderr, "read %d entries\n", count); closedir(d); // CHECK: test1: reading the {{.*}} directory... // CHECK-NOT: stack-buffer-overflow // CHECK: read {{.*}} entries // Ensure the readdir64_r interceptor doesn't have the bug either. fputs("test2: reading the " TEMP_DIR " directory...\n", stderr); d = opendir(TEMP_DIR); struct dirent64 *result64; memset(entry_buffer, 0xab, sizeof(entry_buffer)); count = 0; do { // Stamp the entry struct to try to trick the interceptor. ((struct dirent64 *)entry_buffer)->d_reclen = 9999; if (readdir64_r(d, (struct dirent64 *)entry_buffer, &result64) != 0) abort(); ++count; } while (result64 != NULL); fprintf(stderr, "read %d entries\n", count); closedir(d); // CHECK: test2: reading the {{.*}} directory... // CHECK-NOT: stack-buffer-overflow // CHECK: read {{.*}} entries } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/shmctl.cc0000664000175000017500000000133112341364156027703 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 // Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=250 #include #include #include #include int main() { int id = shmget(IPC_PRIVATE, 4096, 0644 | IPC_CREAT); assert(id > -1); struct shmid_ds ds; int res = shmctl(id, IPC_STAT, &ds); assert(res > -1); printf("shm_segsz: %zd\n", ds.shm_segsz); assert(ds.shm_segsz == 4096); assert(-1 != shmctl(id, IPC_RMID, 0)); struct shm_info shmInfo; res = shmctl(0, SHM_INFO, (struct shmid_ds *)&shmInfo); assert(res > -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/local_alias.cc0000664000175000017500000000244412753334564030671 0ustar mwhudsonmwhudson// Test that mixing instrumented and non-instrumented code doesn't lead to crash. // Build two modules (one is instrumented, another is not) that have globals // with same names. Check, that ASan doesn't crash with CHECK failure or // false positive global-buffer-overflow due to sanitized library poisons // globals from non-sanitized one. // // FIXME: https://github.com/google/sanitizers/issues/316 // XFAIL: android // // This test requires the integrated assembler to be the default. // XFAIL: target-is-mips64 // XFAIL: target-is-mips64el // // RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-INSTRUMENTED-SO.so // RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %t-UNINSTRUMENTED-SO.so // RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o // RUN: %clangxx_asan %t.o %t-UNINSTRUMENTED-SO.so %t-INSTRUMENTED-SO.so -o %t-EXE // RUN: %env_asan_opts=use_odr_indicator=true %run %t-EXE #if defined (BUILD_INSTRUMENTED_DSO) long h = 15; long f = 4; long foo(long *p) { return *p; } #elif defined (BUILD_UNINSTRUMENTED_DSO) long foo(long *); long h = 12; long i = 13; long f = 5; int bar() { if (foo(&f) != 5 || foo(&h) != 12 || foo(&i) != 13) return 1; return 0; } #else extern int bar(); int main() { return bar(); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/memmem_test.cc0000664000175000017500000000140312743717746030742 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=A1 // RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=A2 // RUN: %env_asan_opts=intercept_memmem=0 %run %t #include int main(int argc, char **argv) { char a1[] = {1, 2, 3, 4, 5, 6, 7, 8}; char a2[] = {3, 4, 5}; void *res; if (argc == 1) res = memmem(a1, sizeof(a1) + 1, a2, sizeof(a2)); // BOOM else res = memmem(a1, sizeof(a1), a2, sizeof(a2) + 1); // BOOM // A1: AddressSanitizer: stack-buffer-overflow // A1: {{#0.*memmem}} // A1-NEXT: {{#1.*main}} // A1: 'a1' <== Memory access at offset // // A2: AddressSanitizer: stack-buffer-overflow // A2: {{#0.*memmem}} // A2: 'a2' <== Memory access at offset return res == NULL; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/swapcontext_annotation.cc0000664000175000017500000001524012772733540033233 0ustar mwhudsonmwhudson// Check that ASan plays well with annotated makecontext/swapcontext. // RUN: %clangxx_asan -std=c++11 -lpthread -O0 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -std=c++11 -lpthread -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -std=c++11 -lpthread -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -std=c++11 -lpthread -O3 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -std=c++11 -lpthread -O0 %s -o %t && %run %t 2>&1 | FileCheck <( seq 60 | xargs -i -- grep LOOPCHECK %s ) --check-prefix LOOPCHECK // RUN: %clangxx_asan -std=c++11 -lpthread -O1 %s -o %t && %run %t 2>&1 | FileCheck <( seq 60 | xargs -i -- grep LOOPCHECK %s ) --check-prefix LOOPCHECK // RUN: %clangxx_asan -std=c++11 -lpthread -O2 %s -o %t && %run %t 2>&1 | FileCheck <( seq 60 | xargs -i -- grep LOOPCHECK %s ) --check-prefix LOOPCHECK // RUN: %clangxx_asan -std=c++11 -lpthread -O3 %s -o %t && %run %t 2>&1 | FileCheck <( seq 60 | xargs -i -- grep LOOPCHECK %s ) --check-prefix LOOPCHECK // // This test is too subtle to try on non-x86 arch for now. // REQUIRES: x86-target-arch #include #include #include #include #include #include #include ucontext_t orig_context; ucontext_t child_context; ucontext_t next_child_context; char *next_child_stack; const int kStackSize = 1 << 20; const void *main_thread_stack; size_t main_thread_stacksize; const void *from_stack; size_t from_stacksize; __attribute__((noinline, noreturn)) void LongJump(jmp_buf env) { longjmp(env, 1); _exit(1); } // Simulate __asan_handle_no_return(). __attribute__((noinline)) void CallNoReturn() { jmp_buf env; if (setjmp(env) != 0) return; LongJump(env); _exit(1); } void NextChild() { CallNoReturn(); __sanitizer_finish_switch_fiber(nullptr, &from_stack, &from_stacksize); printf("NextChild from: %p %zu\n", from_stack, from_stacksize); char x[32] = {0}; // Stack gets poisoned. printf("NextChild: %p\n", x); CallNoReturn(); __sanitizer_start_switch_fiber(nullptr, main_thread_stack, main_thread_stacksize); CallNoReturn(); if (swapcontext(&next_child_context, &orig_context) < 0) { perror("swapcontext"); _exit(1); } } void Child(int mode) { CallNoReturn(); __sanitizer_finish_switch_fiber(nullptr, &main_thread_stack, &main_thread_stacksize); char x[32] = {0}; // Stack gets poisoned. printf("Child: %p\n", x); CallNoReturn(); // (a) Do nothing, just return to parent function. // (b) Jump into the original function. Stack remains poisoned unless we do // something. // (c) Jump to another function which will then jump back to the main function if (mode == 0) { __sanitizer_start_switch_fiber(nullptr, main_thread_stack, main_thread_stacksize); CallNoReturn(); } else if (mode == 1) { __sanitizer_start_switch_fiber(nullptr, main_thread_stack, main_thread_stacksize); CallNoReturn(); if (swapcontext(&child_context, &orig_context) < 0) { perror("swapcontext"); _exit(1); } } else if (mode == 2) { printf("NextChild stack: %p\n", next_child_stack); getcontext(&next_child_context); next_child_context.uc_stack.ss_sp = next_child_stack; next_child_context.uc_stack.ss_size = kStackSize / 2; makecontext(&next_child_context, (void (*)())NextChild, 0); __sanitizer_start_switch_fiber(nullptr, next_child_context.uc_stack.ss_sp, next_child_context.uc_stack.ss_size); CallNoReturn(); if (swapcontext(&child_context, &next_child_context) < 0) { perror("swapcontext"); _exit(1); } } } int Run(int arg, int mode, char *child_stack) { printf("Child stack: %p\n", child_stack); // Setup child context. getcontext(&child_context); child_context.uc_stack.ss_sp = child_stack; child_context.uc_stack.ss_size = kStackSize / 2; if (mode == 0) { child_context.uc_link = &orig_context; } makecontext(&child_context, (void (*)())Child, 1, mode); CallNoReturn(); void* fake_stack_save; __sanitizer_start_switch_fiber(&fake_stack_save, child_context.uc_stack.ss_sp, child_context.uc_stack.ss_size); CallNoReturn(); if (swapcontext(&orig_context, &child_context) < 0) { perror("swapcontext"); _exit(1); } CallNoReturn(); __sanitizer_finish_switch_fiber(fake_stack_save, &from_stack, &from_stacksize); CallNoReturn(); printf("Main context from: %p %zu\n", from_stack, from_stacksize); // Touch childs's stack to make sure it's unpoisoned. for (int i = 0; i < kStackSize; i++) { child_stack[i] = i; } return child_stack[arg]; } void handler(int sig) { CallNoReturn(); } int main(int argc, char **argv) { // set up a signal that will spam and trigger __asan_handle_no_return at // tricky moments struct sigaction act = {}; act.sa_handler = &handler; if (sigaction(SIGPROF, &act, 0)) { perror("sigaction"); _exit(1); } itimerval t; t.it_interval.tv_sec = 0; t.it_interval.tv_usec = 10; t.it_value = t.it_interval; if (setitimer(ITIMER_PROF, &t, 0)) { perror("setitimer"); _exit(1); } char *heap = new char[kStackSize + 1]; next_child_stack = new char[kStackSize + 1]; char stack[kStackSize + 1]; // CHECK: WARNING: ASan doesn't fully support makecontext/swapcontext int ret = 0; // CHECK-NOT: ASan is ignoring requested __asan_handle_no_return for (unsigned int i = 0; i < 30; ++i) { ret += Run(argc - 1, 0, stack); // LOOPCHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]] // LOOPCHECK: Main context from: [[CHILD_STACK]] 524288 ret += Run(argc - 1, 1, stack); // LOOPCHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]] // LOOPCHECK: Main context from: [[CHILD_STACK]] 524288 ret += Run(argc - 1, 2, stack); // LOOPCHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]] // LOOPCHECK: NextChild stack: [[NEXT_CHILD_STACK:0x[0-9a-f]*]] // LOOPCHECK: NextChild from: [[CHILD_STACK]] 524288 // LOOPCHECK: Main context from: [[NEXT_CHILD_STACK]] 524288 ret += Run(argc - 1, 0, heap); ret += Run(argc - 1, 1, heap); ret += Run(argc - 1, 2, heap); printf("Iteration %d passed\n", i); } // CHECK: Test passed printf("Test passed\n"); delete[] heap; delete[] next_child_stack; return ret; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc0000664000175000017500000000061612537634376032762 0ustar mwhudsonmwhudson// Test that preloading dynamic runtime to statically sanitized // executable is prohibited. // // RUN: %clangxx_asan_static %s -o %t // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // XFAIL: android #include int main(int argc, char **argv) { return 0; } // CHECK: Your application is linked against incompatible ASan runtimes golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/auto_memory_profile_test.cc0000664000175000017500000000131412766344232033535 0ustar mwhudsonmwhudson// Tests heap_profile=1. // Printing memory profiling only works in the configuration where we can // detect leaks. // REQUIRES: leak-detection // // RUN: %clangxx_asan %s -o %t // RUN: %env_asan_opts=heap_profile=1 %run %t 2>&1 | FileCheck %s #include #include #include #include char *sink[1000]; int main() { for (int i = 0; i < 3; i++) { const size_t kSize = 13000000; char *x = new char[kSize]; memset(x, 0, kSize); sink[i] = x; sleep(1); } } // CHECK: HEAP PROFILE at RSS // CHECK: 13000000 byte(s) // CHECK: HEAP PROFILE at RSS // CHECK: 26000000 byte(s) // CHECK: HEAP PROFILE at RSS // CHECK: 39000000 byte(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_rt_confict_test-2.cc0000664000175000017500000000115112341357633032745 0ustar mwhudsonmwhudson// Test that mixed static/dynamic sanitization of program objects // is prohibited. // // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so // RUN: %clangxx_asan_static %s %t.so -o %t // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // XFAIL: android #if BUILD_SO char dummy; void do_access(const void *p) { dummy = ((const char *)p)[1]; } #else #include extern void do_access(const void *p); int main(int argc, char **argv) { void *p = malloc(1); do_access(p); free(p); return 0; } #endif // CHECK: Your application is linked against incompatible ASan runtimes golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_prelink_test.cc0000664000175000017500000000166112662736340032130 0ustar mwhudsonmwhudson// Test if asan works with prelink. // It does not actually use prelink, but relies on ld's flag -Ttext-segment // or gold's flag -Ttext (we try the first flag first, if that fails we // try the second flag). // // RUN: %clangxx_asan -c %s -o %t.o // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -Wl,-Ttext-segment=0x3600000000 ||\ // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -Wl,-Ttext=0x3600000000 // RUN: %clangxx_asan %t.o %t.so -Wl,-R. -o %t // RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s // GNU driver doesn't handle .so files properly. // REQUIRES: x86_64-target-arch, Clang #if BUILD_SO int G; int *getG() { return &G; } #else #include extern int *getG(); int main(int argc, char **argv) { long p = (long)getG(); printf("SO mapped at %lx\n", p & ~0xffffffffUL); *getG() = 0; } #endif // CHECK: 0x003000000000, 0x004fffffffff{{.*}} MidMem // CHECK: SO mapped at 3600000000 golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/syscalls.cc0000664000175000017500000000140512341364156030250 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include /* Test the presence of __sanitizer_syscall_ in the tool runtime, and general sanity of their behaviour. */ int main(int argc, char *argv[]) { char buf[1000]; __sanitizer_syscall_pre_recvmsg(0, buf - 1, 0); // CHECK: AddressSanitizer: stack-buffer-{{.*}}erflow // CHECK: READ of size {{.*}} at {{.*}} thread T0 // CHECK: #0 {{.*}} in __sanitizer_syscall{{.*}}recvmsg return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/kernel-area.cc0000664000175000017500000000177612662736340030620 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // Test that kernel area is not sanitized on 32-bit machines. // // RUN: %clangxx_asan %s -o %t // RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits // RUN: %env_asan_opts=verbosity=1:full_address_space=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%kernel_bits // RUN: %env_asan_opts=verbosity=1:full_address_space=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-kernel-64-bits // // CHECK-kernel-32-bits: || `[0x38{{0+}}, 0xb{{f+}}]` || HighMem || // CHECK-kernel-32-bits: || `[0x27{{0+}}, 0x37{{f+}}]` || HighShadow || // CHECK-kernel-32-bits: || `[0x24{{0+}}, 0x26{{f+}}]` || ShadowGap || // // CHECK-kernel-64-bits: || `[0x4{{0+}}, 0x{{f+}}]` || HighMem || // CHECK-kernel-64-bits: || `[0x28{{0+}}, 0x3{{f+}}]` || HighShadow || // CHECK-kernel-64-bits: || `[0x24{{0+}}, 0x27{{f+}}]` || ShadowGap || // // REQUIRES: i386-target-arch int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/odr-violation.cc0000664000175000017500000000623512753334564031216 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // This test requires the integrated assembler to be the default. // XFAIL: target-is-mips64 // XFAIL: target-is-mips64el // // We use fast_unwind_on_malloc=0 to have full unwinding even w/o frame // pointers. This setting is not on by default because it's too expensive. // // Different size: detect a bug if detect_odr_violation>=1 // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-ODR-SO.so // RUN: %clangxx_asan %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 not %run %t-ODR-EXE 2>&1 | FileCheck %s // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s // // Same size: report a bug only if detect_odr_violation>=2. // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-ODR-SO.so -DSZ=100 // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=1 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %run %t-ODR-EXE 2>&1 | FileCheck %s // RUN: %env_asan_opts=fast_unwind_on_malloc=0 not %run %t-ODR-EXE 2>&1 | FileCheck %s // RUN: echo "odr_violation:foo::ZZZ" > %t.supp // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.supp not %run %t-ODR-EXE 2>&1 | FileCheck %s // RUN: echo "odr_violation:foo::G" > %t.supp // RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2:suppressions=%t.supp %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: rm -f %t.supp // // Use private aliases for global variables: use indicator symbol to detect ODR violation. // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-ODR-SO.so -DSZ=100 // RUN: %clangxx_asan -mllvm -asan-use-private-alias %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE // RUN: %env_asan_opts=fast_unwind_on_malloc=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=false %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=true not %run %t-ODR-EXE 2>&1 | FileCheck %s // GNU driver doesn't handle .so files properly. // REQUIRES: Clang #ifndef SZ # define SZ 4 #endif #if BUILD_SO namespace foo { char G[SZ]; } #else #include namespace foo { char G[100]; } // CHECK: ERROR: AddressSanitizer: odr-violation // CHECK: size=100 'foo::G' {{.*}}odr-violation.cc:[[@LINE-2]]:22 // CHECK: size={{4|100}} 'foo::G' int main(int argc, char **argv) { printf("PASS: %p\n", &foo::G); } #endif // CHECK: These globals were registered at these points: // CHECK: ODR-EXE // CHECK: ODR-SO // CHECK: SUMMARY: AddressSanitizer: odr-violation: global 'foo::G' at {{.*}}odr-violation.cc // DISABLED: PASS golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/malloc_delete_mismatch.cc0000664000175000017500000000233312567131651033074 0ustar mwhudsonmwhudson// Check that we detect malloc/delete mismatch only if the approptiate flag // is set. // RUN: %clangxx_asan -g %s -o %t 2>&1 // Find error and provide malloc context. // RUN: %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=ALLOC-STACK // No error here. // RUN: %env_asan_opts=alloc_dealloc_mismatch=0 %run %t // Also works if no malloc context is available. // RUN: %env_asan_opts=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=alloc_dealloc_mismatch=1:malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include static volatile char *x; int main() { x = (char*)malloc(10); x[0] = 0; delete x; } // CHECK: ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x // CHECK-NEXT: #0{{.*}}operator delete // CHECK: #{{.*}}main // CHECK: is located 0 bytes inside of 10-byte region // CHECK-NEXT: allocated by thread T0 here: // ALLOC-STACK-NEXT: #0{{.*}}malloc // ALLOC-STACK: #{{.*}}main // CHECK: HINT: {{.*}} you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0 ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/print_memory_profile_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/print_memory_profile_test.c0000664000175000017500000000172612773010034033551 0ustar mwhudsonmwhudson// Printing memory profiling only works in the configuration where we can // detect leaks. // REQUIRES: leak-detection // // RUN: %clangxx_asan %s -o %t // RUN: %run %t 100 2>&1 | FileCheck %s --check-prefix=CHECK-100 // RUN: %run %t 50 2>&1 | FileCheck %s --check-prefix=CHECK-50 #include #include #include char *sink[1000]; int main(int argc, char **argv) { if (argc < 2) return 1; int idx = 0; for (int i = 0; i < 17; i++) sink[idx++] = new char[131000]; for (int i = 0; i < 28; i++) sink[idx++] = new char[24000]; __sanitizer_print_memory_profile(atoi(argv[1])); } // CHECK-100: Live Heap Allocations: {{.*}}; showing top 100% // CHECK-100: 2227000 byte(s) ({{.*}}%) in 17 allocation(s) // CHECK-100: 672000 byte(s) ({{.*}}%) in 28 allocation(s) // CHECK-50: Live Heap Allocations: {{.*}}; showing top 50% // CHECK-50: 2227000 byte(s) ({{.*}}%) in 17 allocation(s) // CHECK-50-NOT: allocation golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/swapcontext_test.cc0000664000175000017500000000454712662736340032047 0ustar mwhudsonmwhudson// Check that ASan plays well with easy cases of makecontext/swapcontext. // RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s // // This test is too sublte to try on non-x86 arch for now. // REQUIRES: x86-target-arch #include #include #include ucontext_t orig_context; ucontext_t child_context; const int kStackSize = 1 << 20; __attribute__((noinline)) void Throw() { throw 1; } __attribute__((noinline)) void ThrowAndCatch() { try { Throw(); } catch(int a) { printf("ThrowAndCatch: %d\n", a); } } void Child(int mode) { char x[32] = {0}; // Stack gets poisoned. printf("Child: %p\n", x); ThrowAndCatch(); // Simulate __asan_handle_no_return(). // (a) Do nothing, just return to parent function. // (b) Jump into the original function. Stack remains poisoned unless we do // something. if (mode == 1) { if (swapcontext(&child_context, &orig_context) < 0) { perror("swapcontext"); _exit(0); } } } int Run(int arg, int mode, char *child_stack) { printf("Child stack: %p\n", child_stack); // Setup child context. getcontext(&child_context); child_context.uc_stack.ss_sp = child_stack; child_context.uc_stack.ss_size = kStackSize / 2; if (mode == 0) { child_context.uc_link = &orig_context; } makecontext(&child_context, (void (*)())Child, 1, mode); if (swapcontext(&orig_context, &child_context) < 0) { perror("swapcontext"); return 0; } // Touch childs's stack to make sure it's unpoisoned. for (int i = 0; i < kStackSize; i++) { child_stack[i] = i; } return child_stack[arg]; } int main(int argc, char **argv) { char stack[kStackSize + 1]; // CHECK: WARNING: ASan doesn't fully support makecontext/swapcontext int ret = 0; ret += Run(argc - 1, 0, stack); printf("Test1 passed\n"); // CHECK: Test1 passed ret += Run(argc - 1, 1, stack); printf("Test2 passed\n"); // CHECK: Test2 passed char *heap = new char[kStackSize + 1]; ret += Run(argc - 1, 0, heap); printf("Test3 passed\n"); // CHECK: Test3 passed ret += Run(argc - 1, 1, heap); printf("Test4 passed\n"); // CHECK: Test4 passed delete [] heap; return ret; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_preload_test-1.cc0000664000175000017500000000140212537634376032250 0ustar mwhudsonmwhudson// Test that non-sanitized executables work with sanitized shared libs // and preloaded runtime. // // RUN: %clangxx -DBUILD_SO=1 -fPIC -shared %s -o %t.so // RUN: %clangxx %s %t.so -o %t // // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // This way of setting LD_PRELOAD does not work with Android test runner. // REQUIRES: not-android #if BUILD_SO char dummy; void do_access(const void *p) { // CHECK: AddressSanitizer: heap-buffer-overflow dummy = ((const char *)p)[1]; } #else #include extern void do_access(const void *p); int main(int argc, char **argv) { void *p = malloc(1); do_access(p); free(p); return 0; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/quarantine_size_mb.cc0000664000175000017500000000224712567131651032301 0ustar mwhudsonmwhudson// Test quarantine_size_mb (and the deprecated quarantine_size) // RUN: %clangxx_asan %s -o %t // RUN: %env_asan_opts=quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 // RUN: %env_asan_opts=quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50 %run %t 2>&1 | FileCheck %s --check-prefix=Q10 // RUN: %env_asan_opts=quarantine_size_mb=10:quarantine_size=20:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=BOTH // RUN: %env_asan_opts=quarantine_size_mb=1000:hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT // RUN: %env_asan_opts=hard_rss_limit_mb=50 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT #include char *g; static const int kNumAllocs = 1 << 11; static const int kAllocSize = 1 << 20; int main() { for (int i = 0; i < kNumAllocs; i++) { g = new char[kAllocSize]; memset(g, -1, kAllocSize); delete [] (g); } } // Q10: quarantine_size_mb=10M // BOTH: please use either 'quarantine_size' (deprecated) or quarantine_size_mb, but not both // RSS_LIMIT: AddressSanitizer: hard rss limit exhausted golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/pthread_create_version.cc0000664000175000017500000000130712604470203033124 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -std=c++11 -pthread %s -o %t && %run %t 2>&1 // Regression test for the versioned pthread_create interceptor on linux/i386. // pthread_attr_init is not intercepted and binds to the new abi // pthread_create is intercepted; dlsym always returns the oldest version. // This results in a crash inside pthread_create in libc. #include #include void *ThreadFunc(void *) { return nullptr; } int main() { pthread_t t; const size_t sz = 1024 * 1024; void *p = malloc(sz); pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstack(&attr, p, sz); pthread_create(&t, &attr, ThreadFunc, nullptr); pthread_join(t, nullptr); free(p); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/interception_test.cc0000664000175000017500000000144412330266131032150 0ustar mwhudsonmwhudson// ASan interceptor can be accessed with __interceptor_ prefix. // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include extern "C" long __interceptor_strtol(const char *nptr, char **endptr, int base); extern "C" long strtol(const char *nptr, char **endptr, int base) { fprintf(stderr, "my_strtol_interceptor\n"); return __interceptor_strtol(nptr, endptr, base); } int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return (int)strtol(x, 0, 10); // CHECK: my_strtol_interceptor // CHECK: heap-use-after-free } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/ptrace.cc0000664000175000017500000001014512707642732027677 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // XFAIL: mips // // RUN: %clangxx_asan -O0 %s -o %t && %run %t // RUN: %clangxx_asan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include // for iovec #include // for NT_PRSTATUS #ifdef __aarch64__ # include #endif #if defined(__i386__) || defined(__x86_64__) typedef user_regs_struct regs_struct; typedef user_fpregs_struct fpregs_struct; #if defined(__i386__) #define REG_IP eip #else #define REG_IP rip #endif #define PRINT_REG_PC(__regs) printf ("%lx\n", (unsigned long) (__regs.REG_IP)) #define PRINT_REG_FP(__fpregs) printf ("%lx\n", (unsigned long) (__fpregs.cwd)) #define __PTRACE_FPREQUEST PTRACE_GETFPREGS #elif defined(__aarch64__) typedef struct user_pt_regs regs_struct; typedef struct user_fpsimd_state fpregs_struct; #define PRINT_REG_PC(__regs) printf ("%x\n", (unsigned) (__regs.pc)) #define PRINT_REG_FP(__fpregs) printf ("%x\n", (unsigned) (__fpregs.fpsr)) #define ARCH_IOVEC_FOR_GETREGSET #elif defined(__powerpc64__) typedef struct pt_regs regs_struct; typedef elf_fpregset_t fpregs_struct; #define PRINT_REG_PC(__regs) printf ("%lx\n", (unsigned long) (__regs.nip)) #define PRINT_REG_FP(__fpregs) printf ("%lx\n", (elf_greg_t)fpregs[32]) #define ARCH_IOVEC_FOR_GETREGSET #elif defined(__mips__) typedef struct pt_regs regs_struct; typedef elf_fpregset_t fpregs_struct; #define PRINT_REG_PC(__regs) printf ("%lx\n", (unsigned long) (__regs.cp0_epc)) #define PRINT_REG_FP(__fpregs) printf ("%lx\n", (elf_greg_t) (__fpregs[32])) #define __PTRACE_FPREQUEST PTRACE_GETFPREGS #elif defined(__arm__) # include # include typedef struct pt_regs regs_struct; typedef char fpregs_struct[ARM_VFPREGS_SIZE]; #define PRINT_REG_PC(__regs) printf ("%x\n", (unsigned) (__regs.ARM_pc)) #define PRINT_REG_FP(__fpregs) printf ("%x\n", (unsigned) (__fpregs + 32 * 8)) #define __PTRACE_FPREQUEST PTRACE_GETVFPREGS #elif defined(__s390__) typedef _user_regs_struct regs_struct; typedef _user_fpregs_struct fpregs_struct; #define PRINT_REG_PC(__regs) printf ("%lx\n", (unsigned long) (__regs.psw.addr)) #define PRINT_REG_FP(__fpregs) printf ("%lx\n", (unsigned long) (__fpregs.fpc)) #define ARCH_IOVEC_FOR_GETREGSET #endif int main(void) { pid_t pid; pid = fork(); if (pid == 0) { // child ptrace(PTRACE_TRACEME, 0, NULL, NULL); execl("/bin/true", "true", NULL); } else { wait(NULL); regs_struct regs; regs_struct* volatile pregs = ®s; #ifdef ARCH_IOVEC_FOR_GETREGSET struct iovec regset_io; #endif int res; #ifdef POSITIVE ++pregs; #endif #ifdef ARCH_IOVEC_FOR_GETREGSET # define __PTRACE_REQUEST PTRACE_GETREGSET # define __PTRACE_ARGS (void*)NT_PRSTATUS, (void*)®set_io regset_io.iov_base = pregs; regset_io.iov_len = sizeof(regs_struct); #else # define __PTRACE_REQUEST PTRACE_GETREGS # define __PTRACE_ARGS NULL, pregs #endif res = ptrace((enum __ptrace_request)__PTRACE_REQUEST, pid, __PTRACE_ARGS); // CHECK: AddressSanitizer: stack-buffer-overflow // CHECK: {{.*ptrace.cc:}}[[@LINE-2]] assert(!res); PRINT_REG_PC(regs); fpregs_struct fpregs; #ifdef ARCH_IOVEC_FOR_GETREGSET # define __PTRACE_FPREQUEST PTRACE_GETREGSET # define __PTRACE_FPARGS (void*)NT_PRSTATUS, (void*)®set_io regset_io.iov_base = &fpregs; regset_io.iov_len = sizeof(fpregs_struct); res = ptrace((enum __ptrace_request)PTRACE_GETREGSET, pid, (void*)NT_FPREGSET, (void*)®set_io); #else # define __PTRACE_FPARGS NULL, &fpregs #endif res = ptrace((enum __ptrace_request)__PTRACE_FPREQUEST, pid, __PTRACE_FPARGS); assert(!res); PRINT_REG_FP(fpregs); #ifdef __i386__ user_fpxregs_struct fpxregs; res = ptrace(PTRACE_GETFPXREGS, pid, NULL, &fpxregs); assert(!res); printf("%lx\n", (unsigned long)fpxregs.mxcsr); #endif ptrace(PTRACE_CONT, pid, NULL, NULL); wait(NULL); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/uar_signals.cc0000664000175000017500000000320412341742017030715 0ustar mwhudsonmwhudson// This test checks that the implementation of use-after-return // is async-signal-safe. // RUN: %clangxx_asan -O1 %s -o %t -pthread && %run %t // REQUIRES: stable-runtime #include #include #include #include #include int *g; int n_signals; typedef void (*Sigaction)(int, siginfo_t *, void *); void SignalHandler(int, siginfo_t*, void*) { int local; g = &local; n_signals++; // printf("s: %p\n", &local); } static void EnableSigprof(Sigaction SignalHandler) { struct sigaction sa; sa.sa_sigaction = SignalHandler; sa.sa_flags = SA_RESTART | SA_SIGINFO; sigemptyset(&sa.sa_mask); if (sigaction(SIGPROF, &sa, NULL) != 0) { perror("sigaction"); abort(); } struct itimerval timer; timer.it_interval.tv_sec = 0; timer.it_interval.tv_usec = 1; timer.it_value = timer.it_interval; if (setitimer(ITIMER_PROF, &timer, 0) != 0) { perror("setitimer"); abort(); } } void RecursiveFunction(int depth) { if (depth == 0) return; int local; g = &local; // printf("r: %p\n", &local); // printf("[%2d] n_signals: %d\n", depth, n_signals); RecursiveFunction(depth - 1); RecursiveFunction(depth - 1); } void *Thread(void *) { RecursiveFunction(18); return NULL; } int main(int argc, char **argv) { EnableSigprof(SignalHandler); for (int i = 0; i < 4; i++) { fprintf(stderr, "."); const int kNumThread = sizeof(void*) == 8 ? 16 : 8; pthread_t t[kNumThread]; for (int i = 0; i < kNumThread; i++) pthread_create(&t[i], 0, Thread, 0); for (int i = 0; i < kNumThread; i++) pthread_join(t[i], 0); } fprintf(stderr, "\n"); } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/initialization-bug-any-order.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/initialization-bug-any-orde0000664000175000017500000000262212567131651033351 0ustar mwhudsonmwhudson// Test to make sure basic initialization order errors are caught. // Check that on Linux initialization order bugs are caught // independently on order in which we list source files (if we specify // strict init-order checking). // RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cc -o %t // RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %p/../Helpers/initialization-bug-extra.cc %s -o %t // RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s // Do not test with optimization -- the error may be optimized away. #include // 'y' is a dynamically initialized global residing in a different TU. This // dynamic initializer will read the value of 'y' before main starts. The // result is undefined behavior, which should be caught by initialization order // checking. extern int y; int __attribute__((noinline)) initX() { return y + 1; // CHECK: {{AddressSanitizer: initialization-order-fiasco}} // CHECK: {{READ of size .* at 0x.* thread T0}} // CHECK: {{#0 0x.* in .*initX.* .*initialization-bug-any-order.cc:}}[[@LINE-3]] // CHECK: {{0x.* is located 0 bytes inside of global variable .*y.*}} } // This initializer begins our initialization order problems. static int x = initX(); int main() { // ASan should have caused an exit before main runs. printf("PASS\n"); // CHECK-NOT: PASS return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/leak_check_segv.cc0000664000175000017500000000137012657437243031521 0ustar mwhudsonmwhudson// Test that SIGSEGV during leak checking does not crash the process. // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: leak-detection #include #include #include #include char data[10 * 1024 * 1024]; int main() { void *p = malloc(10 * 1024 * 1024); // surprise-surprise! mprotect((void*)(((unsigned long)p + 4095) & ~4095), 16 * 1024, PROT_NONE); mprotect((void*)(((unsigned long)data + 4095) & ~4095), 16 * 1024, PROT_NONE); __lsan_do_leak_check(); fprintf(stderr, "DONE\n"); } // CHECK: Tracer caught signal 11 // CHECK: LeakSanitizer has encountered a fatal error // CHECK: HINT: For debugging, try setting {{.*}} LSAN_OPTIONS // CHECK-NOT: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/asan_preload_test-2.cc0000664000175000017500000000107712537634376032261 0ustar mwhudsonmwhudson// Test that preloaded runtime works with unsanitized executables. // // RUN: %clangxx %s -o %t // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-dynamic-runtime // This way of setting LD_PRELOAD does not work with Android test runner. // REQUIRES: not-android #include extern "C" ssize_t write(int fd, const void *buf, size_t count); void do_access(void *p) { // CHECK: AddressSanitizer: heap-buffer-overflow write(1, p, 2); } int main(int argc, char **argv) { void *p = malloc(1); do_access(p); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/odr_c_test.c0000664000175000017500000000156512666154703030411 0ustar mwhudsonmwhudson// Test that we can properly report an ODR violation // between an instrumented global and a non-instrumented global. // RUN: %clang_asan %s -fPIC -shared -o %t-1.so -DFILE1 // RUN: %clang_asan %s -fPIC -shared -o %t-2.so -DFILE2 // RUN: %clang_asan %s -fPIE %t-1.so %t-2.so -Wl,-R`pwd` -o %t // RUN: not %run %t 2>&1 | FileCheck %s // // REQUIRES: x86_64-target-arch // // CHECK: The following global variable is not properly aligned. // CHECK: ERROR: AddressSanitizer: odr-violation #if defined(FILE1) __attribute__((aligned(8))) int x; __attribute__((aligned(1))) char y; // The gold linker puts ZZZ at the start of bss (where it is aligned) // unless we have a large alternative like Displace: __attribute__((aligned(1))) char Displace[105]; __attribute__((aligned(1))) char ZZZ[100]; #elif defined(FILE2) int ZZZ = 1; #else extern int ZZZ; int main() { return ZZZ; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/mincore.cc0000664000175000017500000000152312636077227030057 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t && %run %t #include #include #include int main(void) { unsigned char vec[20]; int res; size_t PS = sysconf(_SC_PAGESIZE); void *addr = mmap(nullptr, 20 * PS, PROT_READ | PROT_WRITE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); res = mincore(addr, 10 * PS, vec); assert(res == 0); for (int i = 0; i < 10; ++i) assert((vec[i] & 1) == 0); for (int i = 0; i < 5; ++i) ((char *)addr)[i * PS] = 1; res = mincore(addr, 10 * PS, vec); assert(res == 0); for (int i = 0; i < 10; ++i) assert((vec[i] & 1) == (i < 5)); for (int i = 5; i < 10; ++i) ((char *)addr)[i * PS] = 1; res = mincore(addr, 10 * PS, vec); assert(res == 0); for (int i = 0; i < 10; ++i) assert((vec[i] & 1) == 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/stack-trace-dlclose.cc0000664000175000017500000000200412567131651032235 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx_asan -DSHARED %s -shared -o %T/stack_trace_dlclose.so -fPIC // RUN: %clangxx_asan -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: %env_asan_opts=exitcode=0 %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include #include #include #include #include #include #ifdef SHARED extern "C" { void *foo() { return malloc(1); } } #else void *handle; int main(int argc, char **argv) { void *handle = dlopen(SO_DIR "/stack_trace_dlclose.so", RTLD_LAZY); assert(handle); void *(*foo)() = (void *(*)())dlsym(handle, "foo"); assert(foo); void *p = foo(); assert(p); dlclose(handle); free(p); free(p); // double-free return 0; } #endif // CHECK: {{ #0 0x.* in (__interceptor_)?malloc}} // CHECK: {{ #1 0x.* \(\)}} // CHECK: {{ #2 0x.* in main}} ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/signal_during_stop_the_world.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/signal_during_stop_the_worl0000664000175000017500000000300712476065050033624 0ustar mwhudsonmwhudson// Test StopTheWorld behavior during signal storm. // Historically StopTheWorld crashed because did not handle EINTR properly. // The test is somewhat convoluted, but that's what caused crashes previously. // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include #include #include static void handler(int signo); static void *thr(void *arg); int main() { struct sigaction act = {}; act.sa_handler = handler; sigaction(SIGPROF, &act, 0); pid_t pid = fork(); if (pid < 0) { fprintf(stderr, "failed to fork\n"); exit(1); } if (pid == 0) { // Child constantly sends signals to parent to cause spurious return from // waitpid in StopTheWorld. prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0); pid_t parent = getppid(); for (;;) { // There is no strong reason for these two particular signals, // but at least one of them ought to unblock waitpid. kill(parent, SIGCHLD); kill(parent, SIGPROF); } } usleep(10000); // Let the child start. __lsan_do_leak_check(); // Kill and join the child. kill(pid, SIGTERM); waitpid(pid, 0, 0); sleep(1); // If the tracer thread still runs, give it time to crash. fprintf(stderr, "DONE\n"); // CHECK: DONE } static void handler(int signo) { } static void *thr(void *arg) { for (;;) sleep(1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/cuda_test.cc0000664000175000017500000000254112775036716030401 0ustar mwhudsonmwhudson// Emulate the behavior of the NVIDIA CUDA driver // that mmaps memory inside the asan's shadow gap. // // REQUIRES: x86_64-target-arch // // RUN: %clangxx_asan %s -o %t // RUN: not %env_asan_opts=protect_shadow_gap=1 %t 2>&1 | FileCheck %s --check-prefix=CHECK-PROTECT1 // RUN: not %t 2>&1 | FileCheck %s --check-prefix=CHECK-PROTECT1 // RUN: not %env_asan_opts=protect_shadow_gap=0 %t 2>&1 | FileCheck %s --check-prefix=CHECK-PROTECT0 #include #include #include #include #include "sanitizer/asan_interface.h" int main(void) { uintptr_t Base = 0x200000000; uintptr_t Size = 0x1100000000; void *addr = mmap((void *)Base, Size, PROT_READ | PROT_WRITE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, 0, 0); assert(addr == (void*)Base); // Make sure we can access memory in shadow gap. // W/o protect_shadow_gap=0 we should fail here. for (uintptr_t Addr = Base; Addr < Base + Size; Addr += Size / 100) *(char*)Addr = 1; // CHECK-PROTECT1: AddressSanitizer: SEGV on unknown address 0x0000bfff8000 // Poison a part of gap's shadow: __asan_poison_memory_region((void*)Base, 4096); // Now we should fail with use-after-poison. *(char*)(Base + 1234) = 1; // CHECK-PROTECT0: AddressSanitizer: use-after-poison on address 0x0002000004d2 } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/clang_gcc_abi.cc0000664000175000017500000000263112662736340031134 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: arm-target-arch // XFAIL: armv7l-unknown-linux-gnueabihf #include __attribute__((noinline)) int boom() { volatile int three = 3; char * volatile s = (char *)malloc(three); // CHECK: #1 0x{{.*}} in boom {{.*}}clang_gcc_abi.cc:[[@LINE-1]] return s[three]; //BOOM } __attribute__((naked, noinline)) void gcc_abi() { // CHECK: #2 0x{{.*}} in gcc_abi {{.*}}clang_gcc_abi.cc:[[@LINE+1]] asm volatile("str fp, [sp, #-8]!\n\t" "str lr, [sp, #4]\n\t" "add fp, sp, #4\n\t" "bl boom\n\t" "sub sp, fp, #4\n\t" "ldr fp, [sp]\n\t" "add sp, sp, #4\n\t" "ldr pc, [sp], #4\n\t" ); } __attribute__((naked, noinline)) void clang_abi() { // CHECK: #3 0x{{.*}} in clang_abi {{.*}}clang_gcc_abi.cc:[[@LINE+1]] asm volatile("push {r11, lr}\n\t" "mov r11, sp\n\t" "bl gcc_abi\n\t" "add r0, r0, #1\n\t" "pop {r11, pc}\n\t" ); } int main() { clang_abi(); // CHECK: #4 0x{{.*}} in main {{.*}}clang_gcc_abi.cc:[[@LINE-1]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/stack-overflow-sigbus.cc0000664000175000017500000000331712567131651032661 0ustar mwhudsonmwhudson// Test ASan detection of stack-overflow condition when Linux sends SIGBUS. // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include const int BS = 1024; volatile char x; volatile int y = 1; void recursive_func(char *p) { char buf[BS]; buf[rand() % BS] = 1; buf[rand() % BS] = 2; x = buf[rand() % BS]; if (y) recursive_func(buf); x = 1; // prevent tail call optimization // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* bp 0x.* sp 0x.* T.*\)}} } void LimitStackAndReexec(int argc, char **argv) { struct rlimit rlim; int res = getrlimit(RLIMIT_STACK, &rlim); assert(res == 0); if (rlim.rlim_cur == RLIM_INFINITY) { rlim.rlim_cur = 256 * 1024; res = setrlimit(RLIMIT_STACK, &rlim); assert(res == 0); execv(argv[0], argv); assert(0 && "unreachable"); } } int main(int argc, char **argv) { LimitStackAndReexec(argc, argv); // Map some memory just before the start of the current stack vma. // When the stack grows down and crashes into it, Linux can send // SIGBUS instead of SIGSEGV. See: // http://lkml.iu.edu/hypermail/linux/kernel/1008.1/02299.html const long pagesize = sysconf(_SC_PAGESIZE); FILE *f = fopen("/proc/self/maps", "r"); char a[1000]; void *p = 0; while (fgets(a, sizeof a, f)) { if (strstr(a, "[stack]")) { unsigned long addr; if (sscanf(a, "%lx", &addr) == 1) p = mmap((void *)(addr - 4 * pagesize), pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); } } assert(p); recursive_func(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/stress_dtls.c0000664000175000017500000000617312613523406030625 0ustar mwhudsonmwhudson// REQUIRES: asan-64-bits // UNSUPPORTED: android // Stress test dynamic TLS + dlopen + threads. // // Note that glibc 2.15 seems utterly broken on this test, // it fails with ~17 DSOs dlopen-ed. // glibc 2.19 seems fine. // // // RUN: %clangxx_asan -x c -DSO_NAME=f0 %s -shared -o %t-f0.so -fPIC // RUN: %clangxx_asan -x c -DSO_NAME=f1 %s -shared -o %t-f1.so -fPIC // RUN: %clangxx_asan -x c -DSO_NAME=f2 %s -shared -o %t-f2.so -fPIC // RUN: %clangxx_asan %s -ldl -pthread -o %t // RUN: %run %t 0 3 // RUN: %run %t 2 3 // RUN: %env_asan_opts=verbosity=2 %run %t 10 2 2>&1 | FileCheck %s // RUN: %env_asan_opts=verbosity=2:intercept_tls_get_addr=1 %run %t 10 2 2>&1 | FileCheck %s // RUN: %env_asan_opts=verbosity=2:intercept_tls_get_addr=0 %run %t 10 2 2>&1 | FileCheck %s --check-prefix=CHECK0 // CHECK: __tls_get_addr // CHECK: Creating thread 0 // CHECK: __tls_get_addr // CHECK: Creating thread 1 // CHECK: __tls_get_addr // CHECK: Creating thread 2 // CHECK: __tls_get_addr // CHECK: Creating thread 3 // CHECK: __tls_get_addr // Make sure that TLS slots don't leak // CHECK-NOT: num_live_dtls 5 // // CHECK0-NOT: __tls_get_addr /* cc=your-compiler $cc stress_dtls.c -pthread -ldl for((i=0;i<100;i++)); do $cc -fPIC -shared -DSO_NAME=f$i -o a.out-f$i.so stress_dtls.c; done ./a.out 2 4 # <<<<<< 2 threads, 4 libs ./a.out 3 50 # <<<<<< 3 threads, 50 libs */ #ifndef SO_NAME #define _GNU_SOURCE #include #include #include #include #include #include typedef void **(*f_t)(); __thread int my_tls; #define MAX_N_FUNCTIONS 1000 f_t Functions[MAX_N_FUNCTIONS]; void *PrintStuff(void *unused) { uintptr_t stack; // fprintf(stderr, "STACK: %p TLS: %p SELF: %p\n", &stack, &my_tls, // (void *)pthread_self()); int i; for (i = 0; i < MAX_N_FUNCTIONS; i++) { if (!Functions[i]) break; uintptr_t dtls = (uintptr_t)Functions[i](); fprintf(stderr, " dtls[%03d]: %lx\n", i, dtls); *(long*)dtls = 42; // check that this is writable. } return NULL; } int main(int argc, char *argv[]) { int num_threads = 1; int num_libs = 1; if (argc >= 2) num_threads = atoi(argv[1]); if (argc >= 3) num_libs = atoi(argv[2]); assert(num_libs <= MAX_N_FUNCTIONS); int lib; for (lib = 0; lib < num_libs; lib++) { char buf[4096]; snprintf(buf, sizeof(buf), "%s-f%d.so", argv[0], lib); void *handle = dlopen(buf, RTLD_LAZY); if (!handle) { fprintf(stderr, "%s\n", dlerror()); exit(1); } snprintf(buf, sizeof(buf), "f%d", lib); Functions[lib] = (f_t)dlsym(handle, buf); if (!Functions[lib]) { fprintf(stderr, "%s\n", dlerror()); exit(1); } fprintf(stderr, "LIB[%03d] %s: %p\n", lib, buf, Functions[lib]); PrintStuff(0); int i; for (i = 0; i < num_threads; i++) { pthread_t t; fprintf(stderr, "Creating thread %d\n", i); pthread_create(&t, 0, PrintStuff, 0); pthread_join(t, 0); } } return 0; } #else // SO_NAME #ifndef DTLS_SIZE # define DTLS_SIZE (1 << 17) #endif __thread void *huge_thread_local_array[DTLS_SIZE]; void **SO_NAME() { return &huge_thread_local_array[0]; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/preinit_test.cc0000664000175000017500000000203412341364156031123 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx -DFUNC=zzzz %s -shared -o %t.so -fPIC // RUN: %clangxx_asan -DFUNC=main %s -o %t -Wl,-R. %t.so // RUN: %run %t // GNU driver doesn't handle .so files properly. // REQUIRES: Clang // This test ensures that we call __asan_init early enough. // We build a shared library w/o asan instrumentation // and the binary with asan instrumentation. // Both files include the same header (emulated by -DFUNC here) // with C++ template magic which runs global initializer at library load time. // The function get() is instrumented with asan, but called // before the usual constructors are run. // So, we must make sure that __asan_init is executed even earlier. // // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56393 struct A { int foo() const { return 0; } }; A get () { return A(); } template struct O { static A const e; }; template A const O ::e = get(); int FUNC() { return O::e.foo(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/overflow-in-qsort.cc0000664000175000017500000000303712662736340032037 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t // RUN: %env_asan_opts=fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-FAST // RUN: %env_asan_opts=fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SLOW // Test how well we unwind in presence of qsort in the stack // (i.e. if we can unwind through a function compiled w/o frame pointers). // https://code.google.com/p/address-sanitizer/issues/detail?id=137 // Fast unwinder is only available on x86_64 and i386. // REQUIRES: x86-target-arch #include #include int global_array[10]; volatile int one = 1; extern "C" { int QsortCallback(const void *a, const void *b) { char *x = (char*)a; char *y = (char*)b; printf("Calling QsortCallback\n"); global_array[one * 10] = 0; // BOOM return (int)*x - (int)*y; } __attribute__((noinline)) void MyQsort(char *a, size_t size) { printf("Calling qsort\n"); qsort(a, size, sizeof(char), QsortCallback); printf("Done\n"); // Avoid tail call. } } // extern "C" int main() { char a[2] = {1, 2}; MyQsort(a, 2); } // Fast unwind may not unwind through qsort. // CHECK-FAST: ERROR: AddressSanitizer: global-buffer-overflow // CHECK-FAST: #0{{.*}} in QsortCallback // CHECK-FAST: is located 0 bytes to the right of global variable 'global_array // CHECK-SLOW: ERROR: AddressSanitizer: global-buffer-overflow // CHECK-SLOW: #0{{.*}} in QsortCallback // CHECK-SLOW: #{{.*}} in MyQsort // CHECK-SLOW: #{{.*}} in main // CHECK-SLOW: is located 0 bytes to the right of global variable 'global_array ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/pthread_create_from_constructor.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/pthread_create_from_constru0000664000175000017500000000225213004617456033603 0ustar mwhudsonmwhudson// Test that ASan doesn't deadlock in __interceptor_pthread_create called // from dlopened shared library constructor. The deadlock happens only in shared // ASan runtime with recent Glibc (2.23 fits) when __interceptor_pthread_create // grabs global Glibc's GL(dl_load_lock) and waits for tls_get_addr_tail that // also tries to acquire it. // // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t-so.so // RUN: %clangxx_asan %s -o %t // RUN: %run %t 2>&1 // dlopen() can not be intercepted on Android // UNSUPPORTED: android // REQUIRES: x86-target-arch #ifdef BUILD_SO #include #include #include void *threadFn(void *) { fprintf(stderr, "thread started\n"); while (true) { usleep(100000); } return 0; } void __attribute__((constructor)) startPolling() { fprintf(stderr, "initializing library\n"); pthread_t t; pthread_create(&t, 0, &threadFn, 0); fprintf(stderr, "done\n"); } #else #include #include #include int main(int argc, char **argv) { std::string path = std::string(argv[0]) + "-so.so"; void *handle = dlopen(path.c_str(), RTLD_LAZY); if (!handle) abort(); return 0; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/init_fini_sections.cc0000664000175000017500000000063512576122151032273 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t && %run %t | FileCheck %s #include static void foo() { printf("foo\n"); } int main() { return 0; } __attribute__((section(".preinit_array"))) void (*call_foo)(void) = &foo; __attribute__((section(".init_array"))) void (*call_foo_2)(void) = &foo; __attribute__((section(".fini_array"))) void (*call_foo_3)(void) = &foo; // CHECK: foo // CHECK: foo // CHECK: foo golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Linux/init-order-dlopen.cc0000664000175000017500000000211012567131651031742 0ustar mwhudsonmwhudson// Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=178 // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -Wl,--export-dynamic -o %t // RUN: %env_asan_opts=strict_init_order=true %run %t 2>&1 // dlopen() can not be intercepted on Android, making strict_init_order nearly // useless there. // UNSUPPORTED: android #if defined(SHARED_LIB) #include struct Bar { Bar(int val) : val(val) { printf("Bar::Bar(%d)\n", val); } int val; }; int get_foo_val(); Bar global_bar(get_foo_val()); #else // SHARED LIB #include #include #include struct Foo { Foo() : val(42) { printf("Foo::Foo()\n"); } int val; }; Foo global_foo; int get_foo_val() { return global_foo.val; } int main(int argc, char *argv[]) { std::string path = std::string(argv[0]) + "-so.so"; void *handle = dlopen(path.c_str(), RTLD_NOW); if (!handle) { printf("error in dlopen(): %s\n", dlerror()); return 1; } printf("%d\n", get_foo_val()); return 0; } #endif // SHARED_LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/zero_page_pc.cc0000664000175000017500000000132112563423744027753 0ustar mwhudsonmwhudson// Check that ASan correctly detects SEGV on the zero page. // RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s typedef void void_f(); int main() { void_f *func = (void_f *)0x4; func(); // x86 reports the SEGV with both address=4 and pc=4. // On PowerPC64 ELFv1, the pointer is taken to be a function-descriptor // pointer out of which three 64-bit quantities are read. This will SEGV, but // the compiler is free to choose the order. As a result, the address is // either 0x4, 0xc or 0x14. The pc is still in main() because it has not // actually made the call when the faulting access occurs. // CHECK: {{AddressSanitizer: (SEGV|access-violation).*(address|pc) 0x0*[4c]}} return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strncmp_strict.c0000664000175000017500000000134613002525072030222 0ustar mwhudsonmwhudson// Test strict_string_checks option in strncmp function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s1 = (char*)malloc(size); memset(s1, fill, size); char *s2 = (char*)malloc(size); memset(s2, fill, size); s1[size - 1] = 'z'; s2[size - 1] = 'x'; int r = strncmp(s1, s2, size + 1); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == 1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/allocator_returns_null.cc0000664000175000017500000000711012563423744032114 0ustar mwhudsonmwhudson// Test the behavior of malloc/calloc/realloc when the allocation size is huge. // By default (allocator_may_return_null=0) the process should crash. // With allocator_may_return_null=1 the allocator should return 0. // // RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH // RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH // RUN: %env_asan_opts=allocator_may_return_null=1 %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL // RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH // RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL // RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH // RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL // RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH // RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL // RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH // RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL #include #include #include #include #include #include int main(int argc, char **argv) { // Disable stderr buffering. Needed on Windows. setvbuf(stderr, NULL, _IONBF, 0); volatile size_t size = std::numeric_limits::max() - 10000; assert(argc == 2); void *x = 0; if (!strcmp(argv[1], "malloc")) { fprintf(stderr, "malloc:\n"); x = malloc(size); } if (!strcmp(argv[1], "calloc")) { fprintf(stderr, "calloc:\n"); x = calloc(size / 4, 4); } if (!strcmp(argv[1], "calloc-overflow")) { fprintf(stderr, "calloc-overflow:\n"); volatile size_t kMaxSizeT = std::numeric_limits::max(); size_t kArraySize = 4096; volatile size_t kArraySize2 = kMaxSizeT / kArraySize + 10; x = calloc(kArraySize, kArraySize2); } if (!strcmp(argv[1], "realloc")) { fprintf(stderr, "realloc:\n"); x = realloc(0, size); } if (!strcmp(argv[1], "realloc-after-malloc")) { fprintf(stderr, "realloc-after-malloc:\n"); char *t = (char*)malloc(100); *t = 42; x = realloc(t, size); assert(*t == 42); free(t); } // The NULL pointer is printed differently on different systems, while (long)0 // is always the same. fprintf(stderr, "x: %lx\n", (long)x); free(x); return x != 0; } // CHECK-mCRASH: malloc: // CHECK-mCRASH: AddressSanitizer's allocator is terminating the process // CHECK-cCRASH: calloc: // CHECK-cCRASH: AddressSanitizer's allocator is terminating the process // CHECK-coCRASH: calloc-overflow: // CHECK-coCRASH: AddressSanitizer's allocator is terminating the process // CHECK-rCRASH: realloc: // CHECK-rCRASH: AddressSanitizer's allocator is terminating the process // CHECK-mrCRASH: realloc-after-malloc: // CHECK-mrCRASH: AddressSanitizer's allocator is terminating the process // CHECK-mNULL: malloc: // CHECK-mNULL: x: 0 // CHECK-cNULL: calloc: // CHECK-cNULL: x: 0 // CHECK-coNULL: calloc-overflow: // CHECK-coNULL: x: 0 // CHECK-rNULL: realloc: // CHECK-rNULL: x: 0 // CHECK-mrNULL: realloc-after-malloc: // CHECK-mrNULL: x: 0 golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/speculative_load.cc0000664000175000017500000000202112611475467030642 0ustar mwhudsonmwhudson// Verifies that speculative loads from unions do not happen under asan. // RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 // RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 #include struct S { struct _long { void* _pad; const char* _ptr; }; struct _short { unsigned char _size; char _ch[23]; }; union { _short _s; _long _l; } _data; S() { _data._s._size = 0; __asan_poison_memory_region(_data._s._ch, 23); } bool is_long() const { return _data._s._size & 1; } const char* get_pointer() const { return is_long() ? _data._l._ptr : _data._s._ch; } }; inline void side_effect(const void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } int main(int argc, char **argv) { S s; side_effect(&s); // optimizer is too smart otherwise const char *ptr = s.get_pointer(); side_effect(ptr); // force use ptr return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/atoi_strict.c0000664000175000017500000000335512562755664027520 0ustar mwhudsonmwhudson// Test strict_string_checks option in atoi function // RUN: %clang_asan %s -o %t // RUN: %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 #include #include #include void test1(char *array) { // Last symbol is non-digit memset(array, '1', 10); array[9] = 'a'; int r = atoi(array); assert(r == 111111111); } void test2(char *array) { // Single non-digit symbol array[9] = 'a'; int r = atoi(array + 9); assert(r == 0); } void test3(char *array) { // Incorrect number format memset(array, ' ', 10); array[9] = '-'; array[8] = '-'; int r = atoi(array); assert(r == 0); } int main(int argc, char **argv) { char *array = (char*)malloc(10); if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(array); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1: READ of size 11 if (!strcmp(argv[1], "test2")) test2(array); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2: READ of size 2 if (!strcmp(argv[1], "test3")) test3(array); // CHECK3: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK3: READ of size 11 free(array); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-capture.cc0000664000175000017500000000065412744464322031767 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { std::function f; { int x = 0; f = [&x]() { return x; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cc:[[@LINE-2]] }; } return f(); // BOOM } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strncat_strict.c0000664000175000017500000000357312562755664030244 0ustar mwhudsonmwhudson// Test strict_string_checks option in strncat function // RUN: %clang_asan %s -o %t // RUN: not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1 // RUN: %env_asan_opts=strict_string_checks=false not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-NONSTRICT --check-prefix=CHECK1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1-STRICT --check-prefix=CHECK1 // RUN: not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2 // RUN: %env_asan_opts=strict_string_checks=false not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-NONSTRICT --check-prefix=CHECK2 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2-STRICT --check-prefix=CHECK2 #include #include #include void test1(char *to, int to_size, char *from) { // One of arguments points to not allocated memory. char* r = strncat(to + to_size, from, 2); } void test2(char *to, int to_size, char *from) { // "to" is not zero-terminated. memset(to, 'z', to_size); char* r = strncat(to, from, 1); } int main(int argc, char **argv) { size_t to_size = 100; char *to = (char*)malloc(to_size); size_t from_size = 20; char *from = (char*)malloc(from_size); memset(from, 'z', from_size); from[from_size - 1] = '\0'; if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(to, to_size, from); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1-STRICT: READ of size 1 // CHECK1-NONSTRICT: WRITE of size 3 if (!strcmp(argv[1], "test2")) test2(to, to_size, from); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2-STRICT: READ of size 101 // CHECK2-NONSTRICT: WRITE of size 2 free(to); free(from); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-order-pcs.cc0000664000175000017500000000300412744161125030776 0ustar mwhudsonmwhudson// Test coverage_order_pcs=1 flag which orders the PCs by their appearance. // RUN: DIR=%T/coverage-order-pcs // RUN: rm -rf $DIR // RUN: mkdir $DIR // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t // RUN: mv $DIR/*sancov $DIR/A // RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t 1 // RUN: mv $DIR/*sancov $DIR/B // RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t // RUN: mv $DIR/*sancov $DIR/C // RUN: %env_asan_opts=coverage_dir=$DIR:coverage=1:coverage_order_pcs=1 %run %t 1 // RUN: mv $DIR/*sancov $DIR/D // // RUN: (%sancov print $DIR/A; %sancov print $DIR/B; %sancov print $DIR/C; %sancov print $DIR/D) | FileCheck %s // // RUN: rm -rf $DIR // Ordering works only in 64-bit mode for now. // REQUIRES: asan-64-bits, shell // UNSUPPORTED: android #include void foo() { fprintf(stderr, "FOO\n"); } void bar() { fprintf(stderr, "BAR\n"); } int main(int argc, char **argv) { if (argc == 2) { foo(); bar(); } else { bar(); foo(); } } // Run A: no ordering // CHECK: [[FOO:0x[0-9a-f]*]] // CHECK-NEXT: [[BAR:0x[0-9a-f]*]] // CHECK-NEXT: [[MAIN:0x[0-9a-f]*]] // // Run B: still no ordering // CHECK-NEXT: [[FOO]] // CHECK-NEXT: [[BAR]] // CHECK-NEXT: [[MAIN]] // // Run C: MAIN, BAR, FOO // CHECK-NEXT: [[MAIN]] // CHECK-NEXT: [[BAR]] // CHECK-NEXT: [[FOO]] // // Run D: MAIN, FOO, BAR // CHECK-NEXT: [[MAIN]] // CHECK-NEXT: [[FOO]] // CHECK-NEXT: [[BAR]] golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strpbrk_strict.c0000664000175000017500000000126412562755664030250 0ustar mwhudsonmwhudson// Test strict_string_checks option in strpbrk function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s1 = (char*)malloc(size); char *s2 = (char*)malloc(2); memset(s1, fill, size); s2[0] = fill; s2[1]='\0'; char* r = strpbrk(s1, s2); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == s1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strstr_strict.c0000664000175000017500000000131613003455757030107 0ustar mwhudsonmwhudson// Test strict_string_checks option in strstr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s1 = (char*)malloc(size); char *s2 = (char*)malloc(size); memset(s1, fill, size); memset(s2, fill, size); s2[size - 1]='\0'; char* r = strstr(s1, s2); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size {{101|100}} assert(r == s1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-nobug.cc0000664000175000017500000000043512742000616031421 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && %run %t #include #include int *p[3]; int main() { // Variable goes in and out of scope. for (int i = 0; i < 3; i++) { int x; p[i] = &x; } printf("PASSED\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/set_shadow_test.c0000664000175000017500000000366712755670211030365 0ustar mwhudsonmwhudson// RUN: %clang_asan -O0 %s -o %t // RUN: %run %t 0x00 2>&1 | FileCheck %s -check-prefix=X00 // RUN: not %run %t 0xf1 2>&1 | FileCheck %s -check-prefix=XF1 // RUN: not %run %t 0xf2 2>&1 | FileCheck %s -check-prefix=XF2 // RUN: not %run %t 0xf3 2>&1 | FileCheck %s -check-prefix=XF3 // RUN: not %run %t 0xf5 2>&1 | FileCheck %s -check-prefix=XF5 // RUN: not %run %t 0xf8 2>&1 | FileCheck %s -check-prefix=XF8 // XFAIL: win32 #include #include #include #include #include void __asan_set_shadow_00(size_t addr, size_t size); void __asan_set_shadow_f1(size_t addr, size_t size); void __asan_set_shadow_f2(size_t addr, size_t size); void __asan_set_shadow_f3(size_t addr, size_t size); void __asan_set_shadow_f5(size_t addr, size_t size); void __asan_set_shadow_f8(size_t addr, size_t size); char a __attribute__((aligned(8))); void f(long arg) { size_t shadow_offset; size_t shadow_scale; __asan_get_shadow_mapping(&shadow_scale, &shadow_offset); size_t addr = (((size_t)&a) >> shadow_scale) + shadow_offset; switch (arg) { // X00-NOT: AddressSanitizer // X00: PASS case 0x00: return __asan_set_shadow_00(addr, 1); // XF1: AddressSanitizer: stack-buffer-underflow // XF1: [f1] case 0xf1: return __asan_set_shadow_f1(addr, 1); // XF2: AddressSanitizer: stack-buffer-overflow // XF2: [f2] case 0xf2: return __asan_set_shadow_f2(addr, 1); // XF3: AddressSanitizer: stack-buffer-overflow // XF3: [f3] case 0xf3: return __asan_set_shadow_f3(addr, 1); // XF5: AddressSanitizer: stack-use-after-return // XF5: [f5] case 0xf5: return __asan_set_shadow_f5(addr, 1); // XF8: AddressSanitizer: stack-use-after-scope // XF8: [f8] case 0xf8: return __asan_set_shadow_f8(addr, 1); } assert(0); } int main(int argc, char **argv) { assert(argc > 1); long arg = strtol(argv[1], 0, 16); f(arg); a = 1; printf("PASS\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-delete.cc0000664000175000017500000000265712415324363030457 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include int main() { char * volatile x = new char[10]; delete[] x; return x[5]; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main .*use-after-delete.cc:}}[[@LINE-4]] // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}} // CHECK: {{freed by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in operator delete\[\]}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-10]] // CHECK: {{previously allocated by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in operator new\[\]}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-16]] // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes): // CHECK: Global redzone: // CHECK: ASan internal: } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/force_inline_opt0.cc0000664000175000017500000000046012330266131030702 0ustar mwhudsonmwhudson// This test checks that we are no instrumenting a memory access twice // (before and after inlining) // RUN: %clangxx_asan -O1 %s -o %t && %run %t // RUN: %clangxx_asan -O0 %s -o %t && %run %t __attribute__((always_inline)) void foo(int *x) { *x = 0; } int main() { int x; foo(&x); return x; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/asan_options-help.cc0000664000175000017500000000034112562755664030752 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=help=1 %run %t 2>&1 | FileCheck %s int main() { } // CHECK: Available flags for AddressSanitizer: // CHECK-DAG: handle_segv // CHECK-DAG: check_initialization_order golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strtol_strict.c0000664000175000017500000001176112563423744030103 0ustar mwhudsonmwhudson// Test strict_string_checks option in strtol function // RUN: %clang_asan -D_CRT_SECURE_NO_WARNINGS -DTEST1 %s -o %t // RUN: %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: %run %t test4 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test4 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test4 2>&1 | FileCheck %s --check-prefix=CHECK4 // RUN: %run %t test5 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test5 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5 // RUN: %run %t test6 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test6 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test6 2>&1 | FileCheck %s --check-prefix=CHECK6 // RUN: %run %t test7 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test7 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test7 2>&1 | FileCheck %s --check-prefix=CHECK7 #include #include #include #include #include void test1(char *array, char *endptr) { // Buffer overflow if there is no terminating null (depends on base) long r = strtol(array, &endptr, 3); assert(array + 2 == endptr); assert(r == 5); } void test2(char *array, char *endptr) { // Buffer overflow if there is no terminating null (depends on base) array[2] = 'z'; long r = strtol(array, &endptr, 35); assert(array + 2 == endptr); assert(r == 37); } void test3(char *array, char *endptr) { #ifdef _MSC_VER // Using -1 for a strtol base causes MSVC to abort. Print the expected lines // to make the test pass. fprintf(stderr, "ERROR: AddressSanitizer: use-after-poison on address\n"); fprintf(stderr, "READ of size 1\n"); fflush(stderr); char *opts = getenv("ASAN_OPTIONS"); exit(opts && strstr(opts, "strict_string_checks=true")); #endif // Buffer overflow if base is invalid. memset(array, 0, 8); ASAN_POISON_MEMORY_REGION(array, 8); long r = strtol(array + 1, NULL, -1); assert(r == 0); ASAN_UNPOISON_MEMORY_REGION(array, 8); } void test4(char *array, char *endptr) { #ifdef _MSC_VER // Using -1 for a strtol base causes MSVC to abort. Print the expected lines // to make the test pass. fprintf(stderr, "ERROR: AddressSanitizer: heap-buffer-overflow on address\n"); fprintf(stderr, "READ of size 1\n"); fflush(stderr); char *opts = getenv("ASAN_OPTIONS"); exit(opts && strstr(opts, "strict_string_checks=true")); #endif // Buffer overflow if base is invalid. long r = strtol(array + 3, NULL, 1); assert(r == 0); } void test5(char *array, char *endptr) { // Overflow if no digits are found. array[0] = ' '; array[1] = '+'; array[2] = '-'; long r = strtol(array, NULL, 0); assert(r == 0); } void test6(char *array, char *endptr) { // Overflow if no digits are found. array[0] = ' '; array[1] = array[2] = 'z'; long r = strtol(array, &endptr, 0); assert(array == endptr); assert(r == 0); } void test7(char *array, char *endptr) { // Overflow if no digits are found. array[2] = 'z'; long r = strtol(array + 2, NULL, 0); assert(r == 0); } int main(int argc, char **argv) { char *array0 = (char*)malloc(11); char* array = array0 + 8; char *endptr = NULL; array[0] = '1'; array[1] = '2'; array[2] = '3'; if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(array, endptr); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1: READ of size 4 if (!strcmp(argv[1], "test2")) test2(array, endptr); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2: READ of size 4 if (!strcmp(argv[1], "test3")) test3(array0, endptr); // CHECK3: {{.*ERROR: AddressSanitizer: use-after-poison on address}} // CHECK3: READ of size 1 if (!strcmp(argv[1], "test4")) test4(array, endptr); // CHECK4: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK4: READ of size 1 if (!strcmp(argv[1], "test5")) test5(array, endptr); // CHECK5: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK5: READ of size 4 if (!strcmp(argv[1], "test6")) test6(array, endptr); // CHECK6: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK6: READ of size 4 if (!strcmp(argv[1], "test7")) test7(array, endptr); // CHECK7: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK7: READ of size 2 free(array0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/stack-oob-frames.cc0000664000175000017500000000340512710165353030451 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 %s -o %t // RUN: not %run %t 0 2>&1 | FileCheck %s --check-prefix=CHECK0 // RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: not %run %t 2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: not %run %t 3 2>&1 | FileCheck %s --check-prefix=CHECK3 #define NOINLINE __attribute__((noinline)) inline void break_optimization(void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } NOINLINE static void Frame0(int frame, char *a, char *b, char *c) { char s[4] = {0}; char *d = s; break_optimization(&d); switch (frame) { case 3: a[5]++; break; case 2: b[5]++; break; case 1: c[5]++; break; case 0: d[5]++; break; } } NOINLINE static void Frame1(int frame, char *a, char *b) { char c[4] = {0}; Frame0(frame, a, b, c); break_optimization(0); } NOINLINE static void Frame2(int frame, char *a) { char b[4] = {0}; Frame1(frame, a, b); break_optimization(0); } NOINLINE static void Frame3(int frame) { char a[4] = {0}; Frame2(frame, a); break_optimization(0); } int main(int argc, char **argv) { if (argc != 2) return 1; Frame3(argv[1][0] - '0'); } // CHECK0: AddressSanitizer: stack-buffer-overflow // CHECK0: #0{{.*}}Frame0 // CHECK0: #1{{.*}}Frame1 // CHECK0: #2{{.*}}Frame2 // CHECK0: #3{{.*}}Frame3 // CHECK0: is located in stack of thread T0 at offset // CHECK0-NEXT: #0{{.*}}Frame0 // // CHECK1: AddressSanitizer: stack-buffer-overflow // CHECK1: is located in stack of thread T0 at offset // CHECK1-NEXT: #0{{.*}}Frame1 // // CHECK2: AddressSanitizer: stack-buffer-overflow // CHECK2: is located in stack of thread T0 at offset // CHECK2-NEXT: #0{{.*}}Frame2 // // CHECK3: AddressSanitizer: stack-buffer-overflow // CHECK3: is located in stack of thread T0 at offset // CHECK3-NEXT: #0{{.*}}Frame3 golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/memset_test.cc0000664000175000017500000000553312330266131027643 0ustar mwhudsonmwhudson// Test that large memset/memcpy/memmove check the entire range. // RUN: %clangxx_asan -O0 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMSET // RUN: %clangxx_asan -O1 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMSET // RUN: %clangxx_asan -O2 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMSET // RUN: %clangxx_asan -O3 -DTEST_MEMSET %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMSET // RUN: %clangxx_asan -O0 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMCPY // RUN: %clangxx_asan -O1 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMCPY // RUN: %clangxx_asan -O2 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMCPY // RUN: %clangxx_asan -O3 -DTEST_MEMCPY %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMCPY // RUN: %clangxx_asan -O0 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE // RUN: %clangxx_asan -O1 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE // RUN: %clangxx_asan -O2 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE // RUN: %clangxx_asan -O3 -DTEST_MEMMOVE %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMMOVE // RUN: %clangxx_asan -O2 -DTEST_MEMCPY_SIZE_OVERFLOW %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK-MEMCPY_SIZE_OVERFLOW #include #include #include #include #include typedef void *(*memcpy_t)(void *, const void *, size_t); int main(int argc, char **argv) { char * volatile p = (char *)malloc(3000); __asan_poison_memory_region(p + 512, 16); #if defined(TEST_MEMSET) memset(p, 0, 3000); assert(p[1] == 0); // CHECK-MEMSET: AddressSanitizer: use-after-poison on address // CHECK-MEMSET: in {{.*}}memset #else char * volatile q = (char *)malloc(3000); #if defined(TEST_MEMCPY) memcpy(q, p, 3000); // CHECK-MEMCPY: AddressSanitizer: use-after-poison on address // On Mac, memmove and memcpy are the same. Accept either one. // CHECK-MEMCPY: in {{.*(memmove|memcpy)}} #elif defined(TEST_MEMMOVE) memmove(q, p, 3000); // CHECK-MEMMOVE: AddressSanitizer: use-after-poison on address // CHECK-MEMMOVE: in {{.*(memmove|memcpy)}} #elif defined(TEST_MEMCPY_SIZE_OVERFLOW) volatile memcpy_t my_memcpy = &memcpy; my_memcpy(p, q, -argc); // CHECK-MEMCPY_SIZE_OVERFLOW: AddressSanitizer: negative-size-param: (size=-1) #endif assert(q[1] == 0); free(q); #endif free(p); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-if.cc0000664000175000017500000000052112742000616030701 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s int *p; bool b = true; int main() { if (b) { int x[5]; p = x+1; } return *p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}.cc:[[@LINE-2]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_detect_custom_size_.cc0000664000175000017500000000111412756110734032660 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // #include struct A { char a[3]; int b[3]; }; __attribute__((noinline)) void foo(int index, int len) { volatile struct A str[len] __attribute__((aligned(32))); assert(!(reinterpret_cast(str) & 31L)); str[index].a[0] = '1'; // BOOM // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } int main(int argc, char **argv) { foo(10, 10); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/interface_test.cc0000664000175000017500000000044212543361607030315 0ustar mwhudsonmwhudson// Check that user may include ASan interface header. // RUN: %clang_asan %s -o %t && %run %t // RUN: %clang_asan -x c %s -o %t && %run %t // RUN: %clang %s -pie -o %t && %run %t // RUN: %clang -x c %s -pie -o %t && %run %t #include int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/suppressions-library.cc0000664000175000017500000000211012563423744031532 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so // RUN: %clangxx_asan -O0 %s -o %t %ld_flags_rpath_exe // Check that without suppressions, we catch the issue. // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // FIXME: Remove usage of backticks around basename below. // REQUIRES: shell // RUN: echo "interceptor_via_lib:"`basename %dynamiclib` > %t.supp // RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // XFAIL: android #include #include #include #if !defined(SHARED_LIB) void crash_function(); int main(int argc, char *argv[]) { crash_function(); return 0; } #else // SHARED_LIB void crash_function() { char *a = (char *)malloc(6); free(a); size_t len = strlen(a); // BOOM fprintf(stderr, "strlen ignored, %zu\n", len); } #endif // SHARED_LIB // CHECK-CRASH: AddressSanitizer: heap-use-after-free // CHECK-CRASH-NOT: strlen ignored // CHECK-IGNORE-NOT: AddressSanitizer: heap-use-after-free // CHECK-IGNORE: strlen ignored golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/on_error_callback.cc0000664000175000017500000000052112563423744030760 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include extern "C" void __asan_on_error() { fprintf(stderr, "__asan_on_error called\n"); fflush(stderr); } int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: __asan_on_error called } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/deep_stack_uaf.cc0000664000175000017500000000176212562755664030274 0ustar mwhudsonmwhudson// Check that we can store lots of stack frames if asked to. // RUN: %clangxx_asan -O0 %s -o %t 2>&1 // RUN: %env_asan_opts=malloc_context_size=120:redzone=512 not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include #include template struct DeepFree { static void free(char *x) { DeepFree::free(x); } }; template<> struct DeepFree<0> { static void free(char *x) { ::free(x); } }; int main() { char *x = (char*)malloc(10); // deep_free(x); DeepFree<200>::free(x); return x[5]; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // The libcxxrt demangling procedure on FreeBSD 9.2 incorrectly appends // extra 'E' characters to the end of template arguments; see: // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192115 // CHECK: {{DeepFree<36>|DeepFree<36E>}} // CHECK: {{DeepFree<98>|DeepFree<98E>}} // CHECK: {{DeepFree<115>|DeepFree<115E>}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/unaligned_loads_and_stores.cc0000664000175000017500000000470512330266131032663 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t A 2>&1 | FileCheck --check-prefix=CHECK-A %s // RUN: not %run %t B 2>&1 | FileCheck --check-prefix=CHECK-B %s // RUN: not %run %t C 2>&1 | FileCheck --check-prefix=CHECK-C %s // RUN: not %run %t D 2>&1 | FileCheck --check-prefix=CHECK-D %s // RUN: not %run %t E 2>&1 | FileCheck --check-prefix=CHECK-E %s // RUN: not %run %t K 2>&1 | FileCheck --check-prefix=CHECK-K %s // RUN: not %run %t L 2>&1 | FileCheck --check-prefix=CHECK-L %s // RUN: not %run %t M 2>&1 | FileCheck --check-prefix=CHECK-M %s // RUN: not %run %t N 2>&1 | FileCheck --check-prefix=CHECK-N %s // RUN: not %run %t O 2>&1 | FileCheck --check-prefix=CHECK-O %s #include #include #include int main(int argc, char **argv) { if (argc != 2) return 1; char *x = new char[16]; memset(x, 0xab, 16); int res = 1; switch (argv[1][0]) { case 'A': res = __sanitizer_unaligned_load16(x + 15); break; // CHECK-A ERROR: AddressSanitizer: heap-buffer-overflow on address // CHECK-A: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-2]] // CHECK-A: is located 0 bytes to the right of 16-byte region case 'B': res = __sanitizer_unaligned_load32(x + 14); break; // CHECK-B: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'C': res = __sanitizer_unaligned_load32(x + 13); break; // CHECK-C: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'D': res = __sanitizer_unaligned_load64(x + 15); break; // CHECK-D: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'E': res = __sanitizer_unaligned_load64(x + 9); break; // CHECK-E: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'K': __sanitizer_unaligned_store16(x + 15, 0); break; // CHECK-K ERROR: AddressSanitizer: heap-buffer-overflow on address // CHECK-K: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-2]] // CHECK-K: is located 0 bytes to the right of 16-byte region case 'L': __sanitizer_unaligned_store32(x + 15, 0); break; // CHECK-L: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'M': __sanitizer_unaligned_store32(x + 13, 0); break; // CHECK-M: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'N': __sanitizer_unaligned_store64(x + 10, 0); break; // CHECK-N: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] case 'O': __sanitizer_unaligned_store64(x + 14, 0); break; // CHECK-O: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]] } delete x; return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/suppressions-interceptor.cc0000664000175000017500000000131712567131651032431 0ustar mwhudsonmwhudson// Check that without suppressions, we catch the issue. // RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // RUN: echo "interceptor_name:strlen" > %t.supp // RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // XFAIL: android #include #include #include int main() { char *a = (char *)malloc(6); free(a); size_t len = strlen(a); // BOOM fprintf(stderr, "strlen ignored, len = %zu\n", len); } // CHECK-CRASH: AddressSanitizer: heap-use-after-free // CHECK-CRASH-NOT: strlen ignored // CHECK-IGNORE-NOT: AddressSanitizer: heap-use-after-free // CHECK-IGNORE: strlen ignored golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-reset.cc0000664000175000017500000000344712674106707030244 0ustar mwhudsonmwhudson// Test __sanitizer_reset_coverage(). // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // RUN: %env_asan_opts=coverage=1 %run %t // https://github.com/google/sanitizers/issues/618 // UNSUPPORTED: android #include #include #include static volatile int sink; __attribute__((noinline)) void bar() { sink = 2; } __attribute__((noinline)) void foo() { sink = 1; } // In MSVC 2015, printf is an inline function, which causes this test to fail as // it introduces an extra coverage point. Define away printf on that platform to // avoid the issue. #if _MSC_VER >= 1900 # define printf(arg, ...) #endif #define GET_AND_PRINT_COVERAGE() \ bitset = 0; \ for (size_t i = 0; i < n_guards; i++) \ if (guards[i]) bitset |= 1U << i; \ printf("line %d: bitset %zd total: %zd\n", __LINE__, bitset, \ __sanitizer_get_total_unique_coverage()); #define IS_POWER_OF_TWO(a) ((a & ((a) - 1)) == 0) int main() { size_t *guards = 0; size_t bitset; size_t n_guards = __sanitizer_get_coverage_guards(&guards); GET_AND_PRINT_COVERAGE(); size_t main_bit = bitset; assert(IS_POWER_OF_TWO(main_bit)); foo(); GET_AND_PRINT_COVERAGE(); size_t foo_bit = bitset & ~main_bit; assert(IS_POWER_OF_TWO(foo_bit)); bar(); GET_AND_PRINT_COVERAGE(); size_t bar_bit = bitset & ~(main_bit | foo_bit); assert(IS_POWER_OF_TWO(bar_bit)); __sanitizer_reset_coverage(); assert(__sanitizer_get_total_unique_coverage() == 0); GET_AND_PRINT_COVERAGE(); assert(bitset == 0); foo(); GET_AND_PRINT_COVERAGE(); assert(bitset == foo_bit); bar(); GET_AND_PRINT_COVERAGE(); assert(bitset == (foo_bit | bar_bit)); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_underflow_left.cc0000664000175000017500000000103312756110734031644 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // #include __attribute__((noinline)) void foo(int index, int len) { volatile char str[len] __attribute__((aligned(32))); assert(!(reinterpret_cast(str) & 31L)); str[index] = '1'; // BOOM // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } int main(int argc, char **argv) { foo(-1, 10); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/inline.cc0000664000175000017500000000062712330266131026567 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O3 %s -o %t && %run %t // Test that no_sanitize_address attribute applies even when the function would // be normally inlined. #include __attribute__((no_sanitize_address)) int f(int *p) { return *p; // BOOOM?? Nope! } int main(int argc, char **argv) { int * volatile x = (int*)malloc(2*sizeof(int) + 2); int res = f(x + 2); if (res) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcspn_strict.c0000664000175000017500000000132712562755664030255 0ustar mwhudsonmwhudson// Test strict_string_checks option in strcspn function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s1 = (char*)malloc(size); char *s2 = (char*)malloc(size); memset(s1, fill, size); s1[0] = 'z'; memset(s2, fill, size); s2[size-1] = '\0'; size_t r = strcspn(s1, s2); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == 1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_big_alignment.cc0000664000175000017500000000103512756110734031426 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // #include __attribute__((noinline)) void foo(int index, int len) { volatile char str[len] __attribute__((aligned(128))); assert(!(reinterpret_cast(str) & 127L)); str[index] = '1'; // BOOM // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } int main(int argc, char **argv) { foo(10, 10); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/init-order-atexit.cc0000664000175000017500000000122312562755664030677 0ustar mwhudsonmwhudson// Test for the following situation: // (1) global A is constructed. // (2) exit() is called during construction of global B. // (3) destructor of A reads uninitialized global C from another module. // We do *not* want to report init-order bug in this case. // RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cc -o %t // RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s #include #include void AccessC(); class A { public: A() { } ~A() { AccessC(); printf("PASSED\n"); } // CHECK-NOT: AddressSanitizer // CHECK: PASSED }; A a; class B { public: B() { exit(1); } ~B() { } }; B b; golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_loop_unpoisoning.cc0000664000175000017500000000161212756110734032231 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: %run %t 2>&1 // // REQUIRES: stable-runtime // This testcase checks that allocas and VLAs inside loop are correctly unpoisoned. #include #include #include #include "sanitizer/asan_interface.h" // MSVC provides _alloca instead of alloca. #if defined(_MSC_VER) && !defined(alloca) # define alloca _alloca #endif void *top, *bot; __attribute__((noinline)) void foo(int len) { char x; top = &x; char array[len]; // NOLINT assert(!(reinterpret_cast(array) & 31L)); alloca(len); for (int i = 0; i < 32; ++i) { char array[i]; // NOLINT bot = alloca(i); assert(!(reinterpret_cast(bot) & 31L)); } } int main(int argc, char **argv) { foo(32); void *q = __asan_region_is_poisoned(bot, (char *)top - (char *)bot); assert(!q); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcmp_strict.c0000664000175000017500000000133212562755664030065 0ustar mwhudsonmwhudson// Test strict_string_checks option in strcmp function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s1 = (char*)malloc(size); memset(s1, fill, size); char *s2 = (char*)malloc(size); memset(s2, fill, size); s1[size - 1] = 'z'; s2[size - 1] = 'x'; int r = strcmp(s1, s2); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == 1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-free.cc0000664000175000017500000000323012415324363030122 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main .*use-after-free.cc:}}[[@LINE-4]] // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}} // CHECK: {{freed by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in .*free}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-10]] // CHECK-Darwin: {{ #0 0x.* in wrap_free}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-13]] // CHECK: {{previously allocated by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-19]] // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-22]] // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes): // CHECK: Global redzone: // CHECK: ASan internal: } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/throw_call_test.cc0000664000175000017500000000236512661407226030520 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t && %run %t // http://code.google.com/p/address-sanitizer/issues/detail?id=147 (not fixed). // BROKEN: %clangxx_asan %s -o %t -static-libstdc++ && %run %t // // Android builds with static libstdc++ by default. // XFAIL: android #include static volatile int zero = 0; inline void pretend_to_do_something(void *x) { __asm__ __volatile__("" : : "r" (x) : "memory"); } __attribute__((noinline, no_sanitize_address)) void ReallyThrow() { fprintf(stderr, "ReallyThrow\n"); if (zero == 0) throw 42; } __attribute__((noinline)) void Throw() { int a, b, c, d, e, f, g, h; pretend_to_do_something(&a); pretend_to_do_something(&b); pretend_to_do_something(&c); pretend_to_do_something(&d); pretend_to_do_something(&e); pretend_to_do_something(&f); pretend_to_do_something(&g); pretend_to_do_something(&h); fprintf(stderr, "Throw stack = %p\n", &a); ReallyThrow(); } __attribute__((noinline)) void CheckStack() { int ar[100]; pretend_to_do_something(ar); fprintf(stderr, "CheckStack stack = %p, %p\n", ar, ar + 100); for (int i = 0; i < 100; i++) ar[i] = i; } int main(int argc, char** argv) { try { Throw(); } catch(int a) { fprintf(stderr, "a = %d\n", a); } CheckStack(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/debug_mapping.cc0000664000175000017500000000127312744156751030127 0ustar mwhudsonmwhudson// Checks that the debugging API returns correct shadow scale and offset. // RUN: %clangxx_asan -O %s -o %t // RUN: %env_asan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s #include #include #include #if _WIN64 #define PTR "%llx" #else #define PTR "%lx" #endif // printed because of verbosity=1 // CHECK: SHADOW_SCALE: [[SCALE:[0-9]+]] // CHECK: SHADOW_OFFSET: [[OFFSET:0x[0-9a-f]+]] int main() { size_t scale, offset; __asan_get_shadow_mapping(&scale, &offset); fprintf(stderr, "scale: %d\n", (int)scale); fprintf(stderr, "offset: 0x" PTR "\n", (void*)offset); // CHECK: scale: [[SCALE]] // CHECK: offset: [[OFFSET]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strpbrk-1.c0000664000175000017500000000115212612115020026756 0ustar mwhudsonmwhudson// Test string s1 overflow in strpbrk function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strpbrk asan option // RUN: %env_asan_opts=intercept_strpbrk=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { char *r; char s2[] = "ab"; char s1[4] = "cab"; __asan_poison_memory_region ((char *)&s1[2], 2); r = strpbrk(s1, s2); // CHECK:'s1' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == s1 + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-trace-pc.cc0000664000175000017500000000144612661163563030614 0ustar mwhudsonmwhudson// Test -fsanitize-coverage=edge,indirect-call,trace-pc // RUN: %clangxx_asan -O0 -DTRACE_RT %s -o %t-rt.o -c // RUN: %clangxx_asan -O0 -fsanitize-coverage=edge,trace-pc,indirect-calls %s -o %t %t-rt.o // RUN: %run %t #ifdef TRACE_RT int pc_count; void *last_callee; extern "C" void __sanitizer_cov_trace_pc() { pc_count++; } extern "C" void __sanitizer_cov_trace_pc_indir(void *callee) { last_callee = callee; } #else #include #include extern int pc_count; extern void *last_callee; __attribute__((noinline)) void foo() { printf("foo\n"); } __attribute__((noinline)) void bar() { printf("bar\n"); } int main(int argc, char **argv) { void (*f)(void) = argc ? foo : bar; int c1 = pc_count; f(); int c2 = pc_count; assert(c1 < c2); assert(last_callee == foo); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/print_summary.cc0000664000175000017500000000135012562755664030241 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=SOURCE // RUN: %env_asan_opts=symbolize=false not %run %t 2>&1 | FileCheck %s --check-prefix=MODULE // RUN: %env_asan_opts=print_summary=false not %run %t 2>&1 | FileCheck %s --check-prefix=MISSING int main() { char *x = new char[20]; delete[] x; return x[0]; // SOURCE: ERROR: AddressSanitizer: heap-use-after-free // SOURCE: SUMMARY: AddressSanitizer: heap-use-after-free {{.*}}print_summary.cc:[[@LINE-2]]{{.*}} main // MODULE: ERROR: AddressSanitizer: heap-use-after-free // MODULE: SUMMARY: AddressSanitizer: heap-use-after-free ({{.*}}+0x{{.*}}) // MISSING: ERROR: AddressSanitizer: heap-use-after-free // MISSING-NOT: SUMMARY } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-loop.cc0000664000175000017500000000053112742000616031255 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s int *p[3]; int main() { for (int i = 0; i < 3; i++) { int x; p[i] = &x; } return **p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}.cc:[[@LINE-2]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/default_blacklist.cc0000664000175000017500000000041712341364156030772 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // Test that ASan uses the default blacklist from resource directory. // RUN: %clangxx_asan -### %s 2>&1 | FileCheck %s // CHECK: fsanitize-blacklist={{.*}}asan_blacklist.txt golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/sanity_check_pure_c.c0000664000175000017500000000112712415324363031151 0ustar mwhudsonmwhudson// Sanity checking a test in pure C. // RUN: %clang_asan -O2 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // Sanity checking a test in pure C with -pie. // RUN: %clang_asan -O2 %s -pie -fPIE -o %t // RUN: not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: heap-use-after-free // CHECK: free // CHECK: main{{.*}}sanity_check_pure_c.c:[[@LINE-4]] // CHECK: malloc // CHECK: main{{.*}}sanity_check_pure_c.c:[[@LINE-7]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/atexit_stats.cc0000664000175000017500000000103612764601314030027 0ustar mwhudsonmwhudson// Make sure we report atexit stats. // RUN: %clangxx_asan -O3 %s -o %t // RUN: %env_asan_opts=atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s // // No atexit output in older versions of Android due to // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // UNSUPPORTED: android #include #if !defined(__APPLE__) && !defined(__FreeBSD__) #include #endif int *p1 = (int*)malloc(900); int *p2 = (int*)malloc(90000); int *p3 = (int*)malloc(9000000); int main() { } // CHECK: AddressSanitizer exit stats: golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/malloc_context_size.cc0000664000175000017500000000221712562755664031400 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=malloc_context_size=0:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=malloc_context_size=1:fast_unwind_on_malloc=0 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=malloc_context_size=1:fast_unwind_on_malloc=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=malloc_context_size=2 not %run %t 2>&1 | FileCheck %s --check-prefix=TWO int main() { char *x = new char[20]; delete[] x; return x[0]; // CHECK: freed by thread T{{.*}} here: // CHECK-NEXT: #0 0x{{.*}} in {{operator delete( )?\[\]|wrap__ZdaPv}} // CHECK-NOT: #1 0x{{.*}} // CHECK: previously allocated by thread T{{.*}} here: // CHECK-NEXT: #0 0x{{.*}} in {{operator new( )?\[\]|wrap__Znam}} // CHECK-NOT: #1 0x{{.*}} // CHECK: SUMMARY: AddressSanitizer: heap-use-after-free // TWO: previously allocated by thread T{{.*}} here: // TWO-NEXT: #0 0x{{.*}} // TWO-NEXT: #1 0x{{.*}} in main {{.*}}malloc_context_size.cc // TWO: SUMMARY: AddressSanitizer: heap-use-after-free } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-goto.cc0000664000175000017500000000155213004465550031264 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -fsanitize-address-use-after-scope %s -o %t && %run %t // Function jumps over variable initialization making lifetime analysis // ambiguous. Asan should ignore such variable and program must not fail. #include int *ptr; void f1(int cond) { if (cond) goto label; int tmp; label: ptr = &tmp; *ptr = 5; } void f2(int cond) { switch (cond) { case 1: { ++cond; int tmp; ptr = &tmp; exit(0); case 2: ptr = &tmp; *ptr = 5; exit(0); } } } void f3(int cond) { { int tmp; goto l2; l1: ptr = &tmp; *ptr = 5; exit(0); } l2: goto l1; } void use(int *x) { static int c = 10; if (--c == 0) exit(0); (*x)++; } void f4() { { int x; l2: use(&x); goto l1; } l1: goto l2; } int main() { f1(1); f2(1); f3(1); f4(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/debug_report.cc0000664000175000017500000000400112563423744027775 0ustar mwhudsonmwhudson// Checks that the ASan debugging API for getting report information // returns correct values. // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include int main() { // Disable stderr buffering. Needed on Windows. setvbuf(stderr, NULL, _IONBF, 0); char *heap_ptr = (char *)malloc(10); free(heap_ptr); int present = __asan_report_present(); fprintf(stderr, "%s\n", (present == 0) ? "no report" : ""); // CHECK: no report heap_ptr[0] = 'A'; // BOOM return 0; } // If we use %p with MSVC, it comes out all upper case. Use %08x to get // lowercase hex. #ifdef _MSC_VER # ifdef _WIN64 # define PTR_FMT "0x%08llx" # else # define PTR_FMT "0x%08x" # endif #else # define PTR_FMT "%p" #endif void __asan_on_error() { int present = __asan_report_present(); void *pc = __asan_get_report_pc(); void *bp = __asan_get_report_bp(); void *sp = __asan_get_report_sp(); void *addr = __asan_get_report_address(); int is_write = __asan_get_report_access_type(); size_t access_size = __asan_get_report_access_size(); const char *description = __asan_get_report_description(); fprintf(stderr, "%s\n", (present == 1) ? "report" : ""); // CHECK: report fprintf(stderr, "pc: " PTR_FMT "\n", pc); // CHECK: pc: 0x[[PC:[0-9a-f]+]] fprintf(stderr, "bp: " PTR_FMT "\n", bp); // CHECK: bp: 0x[[BP:[0-9a-f]+]] fprintf(stderr, "sp: " PTR_FMT "\n", sp); // CHECK: sp: 0x[[SP:[0-9a-f]+]] fprintf(stderr, "addr: " PTR_FMT "\n", addr); // CHECK: addr: 0x[[ADDR:[0-9a-f]+]] fprintf(stderr, "type: %s\n", (is_write ? "write" : "read")); // CHECK: type: write fprintf(stderr, "access_size: %ld\n", access_size); // CHECK: access_size: 1 fprintf(stderr, "description: %s\n", description); // CHECK: description: heap-use-after-free } // CHECK: AddressSanitizer: heap-use-after-free on address {{0x0*}}[[ADDR]] at pc {{0x0*}}[[PC]] bp {{0x0*}}[[BP]] sp {{0x0*}}[[SP]] // CHECK: WRITE of size 1 at {{0x0*}}[[ADDR]] thread T0 golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/uar_and_exceptions.cc0000664000175000017500000000127312661407226031172 0ustar mwhudsonmwhudson// Test that use-after-return works with exceptions. // RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t #include volatile char *g; #ifndef FRAME_SIZE # define FRAME_SIZE 100 #endif #ifndef NUM_ITER # define NUM_ITER 4000 #endif #ifndef DO_THROW # define DO_THROW 1 #endif void Func(int depth) { char frame[FRAME_SIZE]; g = &frame[0]; if (depth) Func(depth - 1); else if (DO_THROW) throw 1; } int main(int argc, char **argv) { for (int i = 0; i < NUM_ITER; i++) { try { Func(argc * 100); } catch(...) { } if ((i % (NUM_ITER / 10)) == 0) fprintf(stderr, "done [%d]\n", i); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcspn-2.c0000664000175000017500000000114312612115020026764 0ustar mwhudsonmwhudson// Test stopset overflow in strcspn function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strcspn asan option // RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { size_t r; char s1[] = "ab"; char s2[4] = "abc"; __asan_poison_memory_region ((char *)&s2[2], 2); r = strcspn(s1, s2); // CHECK:'s2' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/atoll_strict.c0000664000175000017500000000347112563423744027666 0ustar mwhudsonmwhudson// Test strict_string_checks option in atoll function // RUN: %clang_asan %s -o %t // RUN: %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 // FIXME: Needs Windows interceptor. // XFAIL: win32 #include #include #include void test1(char *array) { // Last symbol is non-digit memset(array, '1', 10); array[9] = 'a'; long long r = atoll(array); assert(r == 111111111); } void test2(char *array) { // Single non-digit symbol array[9] = 'a'; long long r = atoll(array + 9); assert(r == 0); } void test3(char *array) { // Incorrect number format memset(array, ' ', 10); array[9] = '-'; array[8] = '-'; long long r = atoll(array); assert(r == 0); } int main(int argc, char **argv) { char *array = (char*)malloc(10); if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(array); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1: READ of size 11 if (!strcmp(argv[1], "test2")) test2(array); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2: READ of size 2 if (!strcmp(argv[1], "test3")) test3(array); // CHECK3: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK3: READ of size 11 free(array); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/asan_and_llvm_coverage_test.cc0000664000175000017500000000053612657151161033030 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -coverage -O0 %s -o %t // RUN: %env_asan_opts=check_initialization_order=1 %run %t 2>&1 | FileCheck %s // XFAIL: android // We don't really support running tests using profile runtime on Windows. // UNSUPPORTED: win32 #include int foo() { return 1; } int XXX = foo(); int main() { printf("PASS\n"); // CHECK: PASS } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/deep_tail_call.cc0000664000175000017500000000141012330266131030221 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // CHECK: AddressSanitizer: global-buffer-overflow int global[10]; // CHECK: {{#0.*call4}} void __attribute__((noinline)) call4(int i) { global[i+10]++; } // CHECK: {{#1.*call3}} void __attribute__((noinline)) call3(int i) { call4(i); } // CHECK: {{#2.*call2}} void __attribute__((noinline)) call2(int i) { call3(i); } // CHECK: {{#3.*call1}} void __attribute__((noinline)) call1(int i) { call2(i); } // CHECK: {{#4.*main}} int main(int argc, char **argv) { call1(argc); return global[0]; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/default_options.cc0000664000175000017500000000050412473127712030513 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t // RUN: %run %t 2>&1 | FileCheck %s const char *kAsanDefaultOptions="verbosity=1 help=1"; extern "C" __attribute__((no_sanitize_address)) const char *__asan_default_options() { // CHECK: Available flags for AddressSanitizer: return kAsanDefaultOptions; } int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/frexp_interceptor.cc0000664000175000017500000000052012350255614031051 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // Test the frexp() interceptor. #include #include #include int main() { double x = 3.14; int *exp = (int*)malloc(sizeof(int)); free(exp); double y = frexp(x, exp); // CHECK: use-after-free // CHECK: SUMMARY return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/invalid-pointer-pairs.cc0000664000175000017500000000306712732575205031545 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-detect-invalid-pointer-pair // RUN: %env_asan_opts=detect_invalid_pointer_pairs=1 %run %t k 2>&1 | FileCheck %s -check-prefix=OK -allow-empty // RUN: %env_asan_opts=detect_invalid_pointer_pairs=1 not %run %t g 2>&1 | FileCheck %s -check-prefix=CMP -check-prefix=ALL-ERRORS // RUN: %env_asan_opts=detect_invalid_pointer_pairs=1 not %run %t s 2>&1 | FileCheck %s -check-prefix=SUB -check-prefix=ALL-ERRORS // RUN: %env_asan_opts=detect_invalid_pointer_pairs=1 not %run %t f 2>&1 | FileCheck %s -check-prefix=FREE -check-prefix=ALL-ERRORS #include #include int f(char c, char *p, char *q) { // ALL-ERRORS: ERROR: AddressSanitizer: invalid-pointer-pair // [[PTR1:0x[0-9a-f]+]] [[PTR2:0x[0-9a-f]+]] switch (c) { case 'g': // CMP: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cc:[[@LINE+1]]:14 return p > q; case 's': // SUB: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cc:[[@LINE+1]]:14 return p - q; case 'k': { // OK-NOT: ERROR char *p2 = p + 20; return p > p2; } case 'f': { char *p3 = p + 20; free(p); // FREE: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cc:[[@LINE+2]]:14 // FREE: freed by thread return p < p3; } } assert(0); } int main(int argc, char **argv) { char *p = (char *)malloc(42); char *q = (char *)malloc(42); assert(argc >= 2); f(argv[1][0], p, q); free(p); free(q); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcasestr-2.c0000664000175000017500000000147112670450761027513 0ustar mwhudsonmwhudson// Test needle overflow in strcasestr function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strstr asan option // Disable other interceptors because strlen may be called inside strcasestr // RUN: %env_asan_opts=intercept_strstr=false:replace_str=false:intercept_strlen=false %run %t 2>&1 // There's no interceptor for strcasestr on Windows // XFAIL: win32 #define _GNU_SOURCE #include #include #include int main(int argc, char **argv) { char *r = 0; char s1[] = "ab"; char s2[4] = "cba"; __asan_poison_memory_region ((char *)&s2[2], 2); r = strcasestr(s1, s2); assert(r == 0); // CHECK:'s2' <== Memory access at offset {{[0-9]+}} partially overflows this variable return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/large_func_test.cc0000664000175000017500000000336512665162217030472 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf #include __attribute__((noinline)) static void LargeFunction(int *x, int zero) { x[0]++; x[1]++; x[2]++; x[3]++; x[4]++; x[5]++; x[6]++; x[7]++; x[8]++; x[9]++; // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK: {{READ of size 4 at 0x.* thread T0}} x[zero + 103]++; // we should report this exact line // atos incorrectly extracts the symbol name for the static functions on // Darwin. // CHECK-Linux: {{#0 0x.* in LargeFunction.*large_func_test.cc:}}[[@LINE-3]] // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cc}}:[[@LINE-4]] x[10]++; x[11]++; x[12]++; x[13]++; x[14]++; x[15]++; x[16]++; x[17]++; x[18]++; x[19]++; } int main(int argc, char **argv) { int *x = new int[100]; LargeFunction(x, argc - 1); // CHECK: {{ #1 0x.* in main .*large_func_test.cc:}}[[@LINE-1]] // CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}} // CHECK: {{allocated by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in operator new.*}} // CHECK-Darwin: {{ #0 0x.* in .*_Zna.*}} // CHECK: {{ #1 0x.* in main .*large_func_test.cc:}}[[@LINE-7]] delete[] x; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/vla_chrome_testcase.cc0000664000175000017500000000131512756110734031327 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // // This is reduced testcase based on Chromium code. // See http://reviews.llvm.org/D6055?vs=on&id=15616&whitespace=ignore-all#toc. #include #include int a = 7; int b; int c; int *p; __attribute__((noinline)) void fn3(int *first, int second) { } int main() { int d = b && c; int e[a]; // NOLINT assert(!(reinterpret_cast(e) & 31L)); int f; if (d) fn3(&f, sizeof 0 * (&c - e)); e[a] = 0; // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 4 at [[ADDR]] thread T0 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/initialization-blacklist.cc0000664000175000017500000000235312562755664032331 0ustar mwhudsonmwhudson// Test for blacklist functionality of initialization-order checker. // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-blacklist-extra.cc\ // RUN: %p/Helpers/initialization-blacklist-extra2.cc \ // RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-blacklist-extra.cc\ // RUN: %p/Helpers/initialization-blacklist-extra2.cc \ // RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-blacklist-extra.cc\ // RUN: %p/Helpers/initialization-blacklist-extra2.cc \ // RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // Function is defined in another TU. int readBadGlobal(); int x = readBadGlobal(); // init-order bug. // Function is defined in another TU. int accessBadObject(); int y = accessBadObject(); // init-order bug. int readBadSrcGlobal(); int z = readBadSrcGlobal(); // init-order bug. int main(int argc, char **argv) { return argc + x + y + z - 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-poison.cc0000664000175000017500000000110212562755664030523 0ustar mwhudsonmwhudson// Check that __asan_poison_memory_region works. // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // // Check that we can disable it // RUN: %env_asan_opts=allow_user_poisoning=0 %run %t #include extern "C" void __asan_poison_memory_region(void *, size_t); int main(int argc, char **argv) { char *x = new char[16]; x[10] = 0; __asan_poison_memory_region(x, 16); int res = x[argc * 10]; // BOOOM // CHECK: ERROR: AddressSanitizer: use-after-poison // CHECK: main{{.*}}use-after-poison.cc:[[@LINE-2]] delete [] x; return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strspn-2.c0000664000175000017500000000114212612115020026620 0ustar mwhudsonmwhudson// Test stopset overflow in strspn function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strspn asan option // RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { size_t r; char s1[] = "bbc"; char s2[5] = "abcd"; __asan_poison_memory_region ((char *)&s2[3], 2); r = strspn(s1, s2); // CHECK:'s2' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r >= 2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-tracing.cc0000664000175000017500000000513012744161125030531 0ustar mwhudsonmwhudson// Test -fsanitize-coverage=trace-bb // // RUN: %clangxx_asan -O1 -fsanitize-coverage=func,trace-bb %s -o %t // RUN: rm -rf %T/coverage-tracing // RUN: mkdir %T/coverage-tracing // RUN: cd %T/coverage-tracing // RUN: A=x; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK1; mv trace-points.*.sancov $A.points // RUN: A=f; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points // RUN: A=b; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK2; mv trace-points.*.sancov $A.points // RUN: A=bf; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points // RUN: A=fb; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK3; mv trace-points.*.sancov $A.points // RUN: A=ffb; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points // RUN: A=fff; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK4; mv trace-points.*.sancov $A.points // RUN: A=bbf; %env_asan_opts=coverage=1:verbosity=1 %run %t $A 100 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK301; mv trace-points.*.sancov $A.points // RUN: diff f.points fff.points // RUN: diff bf.points fb.points // RUN: diff bf.points ffb.points // RUN: diff bf.points bbf.points // RUN: not diff x.points f.points // RUN: not diff x.points b.points // RUN: not diff x.points bf.points // RUN: not diff f.points b.points // RUN: not diff f.points bf.points // RUN: not diff b.points bf.points // RUN: rm -rf %T/coverage-tracing // // REQUIRES: asan-64-bits, shell // UNSUPPORTED: android #include volatile int sink; __attribute__((noinline)) void foo() { sink++; } __attribute__((noinline)) void bar() { sink++; } int main(int argc, char **argv) { if (argc != 3) return 0; int n = strtol(argv[2], 0, 10); while (n-- > 0) { for (int i = 0; argv[1][i]; i++) { if (argv[1][i] == 'f') foo(); else if (argv[1][i] == 'b') bar(); } } } // CHECK: CovDump: Trace: 3 PCs written // CHECK1: CovDump: Trace: 1 Events written // CHECK2: CovDump: Trace: 2 Events written // CHECK3: CovDump: Trace: 3 Events written // CHECK4: CovDump: Trace: 4 Events written // CHECK301: CovDump: Trace: 301 Events written golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/memcmp_strict_test.cc0000664000175000017500000000101612562755664031234 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=strict_memcmp=0 %run %t // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=strict_memcmp=1 not %run %t 2>&1 | FileCheck %s // Default to strict_memcmp=1. // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include int main() { char kFoo[] = "foo"; char kFubar[] = "fubar"; int res = memcmp(kFoo, kFubar, strlen(kFubar)); printf("res: %d\n", res); // CHECK: AddressSanitizer: stack-buffer-overflow return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/time_interceptor.cc0000664000175000017500000000102312350255614030662 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // Test the time() interceptor. // There's no interceptor for time() on Windows yet. // XFAIL: win32 #include #include #include int main() { time_t *tm = (time_t*)malloc(sizeof(time_t)); free(tm); time_t t = time(tm); printf("Time: %s\n", ctime(&t)); // NOLINT // CHECK: use-after-free // Regression check for // https://code.google.com/p/address-sanitizer/issues/detail?id=321 // CHECK: SUMMARY return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/global-overflow.cc0000664000175000017500000000141712330266131030410 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include int main(int argc, char **argv) { static char XXX[10]; static char YYY[10]; static char ZZZ[10]; memset(XXX, 0, 10); memset(YYY, 0, 10); memset(ZZZ, 0, 10); int res = YYY[argc * 10]; // BOOOM // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main .*global-overflow.cc:}}[[@LINE-2]] // CHECK: {{0x.* is located 0 bytes to the right of global variable}} // CHECK: {{.*YYY.* of size 10}} res += XXX[argc] + ZZZ[argc]; return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcspn-1.c0000664000175000017500000000114412612115020026764 0ustar mwhudsonmwhudson// Test string s1 overflow in strcspn function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strspn asan option // RUN: %env_asan_opts=intercept_strspn=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { size_t r; char s2[] = "ab"; char s1[4] = "caB"; __asan_poison_memory_region ((char *)&s1[2], 2); r = strcspn(s1, s2); // CHECK:'s1' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/longjmp.cc0000664000175000017500000000137512437452211026764 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O %s -o %t && %run %t #include #include #include #include static jmp_buf buf; int main() { char x[32]; fprintf(stderr, "\nTestLongJmp\n"); fprintf(stderr, "Before: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); assert(__asan_address_is_poisoned(x + 32)); if (0 == setjmp(buf)) longjmp(buf, 1); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); // FIXME: Invert this assertion once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 // This assertion works only w/o UAR. if (!__asan_get_current_fake_stack()) assert(!__asan_address_is_poisoned(x + 32)); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/heap-overflow-large.cc0000664000175000017500000000111112503601532031144 0ustar mwhudsonmwhudson// Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=183 // RUN: %clangxx_asan -O2 %s -o %t // RUN: not %run %t 12 2>&1 | FileCheck %s // RUN: not %run %t 100 2>&1 | FileCheck %s // RUN: not %run %t 10000 2>&1 | FileCheck %s #include #include #include int main(int argc, char *argv[]) { fprintf(stderr, "main\n"); int *x = new int[5]; memset(x, 0, sizeof(x[0]) * 5); int index = atoi(argv[1]); unsigned res = x[index]; // CHECK: main // CHECK-NOT: CHECK failed delete[] x; return (res % 10) + 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/contiguous_container_crash.cc0000664000175000017500000000370312647762270032750 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O %s -o %t // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s // RUN: not %run %t bad-alignment 2>&1 | FileCheck --check-prefix=CHECK-BAD-ALIGNMENT %s // RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash // // Test crash due to __sanitizer_annotate_contiguous_container. #include #include extern "C" { void __sanitizer_annotate_contiguous_container(const void *beg, const void *end, const void *old_mid, const void *new_mid); } // extern "C" static volatile int one = 1; int TestCrash() { long t[100]; t[60] = 0; __sanitizer_annotate_contiguous_container(&t[0], &t[0] + 100, &t[0] + 100, &t[0] + 50); // CHECK-CRASH: AddressSanitizer: container-overflow // CHECK-CRASH: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0 return (int)t[60 * one]; // Touches the poisoned memory. } void BadBounds() { long t[100]; // CHECK-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container __sanitizer_annotate_contiguous_container(&t[0], &t[0] + 100, &t[0] + 101, &t[0] + 50); } void BadAlignment() { int t[100]; // CHECK-BAD-ALIGNMENT: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container // CHECK-BAD-ALIGNMENT: ERROR: beg is not aligned by 8 __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[1] + 10, &t[0] + 50); } int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "crash")) return TestCrash(); else if (!strcmp(argv[1], "bad-bounds")) BadBounds(); else if (!strcmp(argv[1], "bad-alignment")) BadAlignment(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/global-location.cc0000664000175000017500000000302112360715262030355 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t // RUN: not %run %t g 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=GLOB // RUN: not %run %t c 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CLASS_STATIC // RUN: not %run %t f 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=FUNC_STATIC // RUN: not %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=LITERAL // CHECK: AddressSanitizer: global-buffer-overflow #include struct C { static int array[10]; }; int global[10]; // GLOB: 0x{{.*}} is located 4 bytes to the right of global variable 'global' defined in '{{.*}}global-location.cc:[[@LINE-1]]:5' {{.*}} of size 40 int C::array[10]; // CLASS_STATIC: 0x{{.*}} is located 4 bytes to the right of global variable 'C::array' defined in '{{.*}}global-location.cc:[[@LINE-1]]:8' {{.*}} of size 40 int main(int argc, char **argv) { int one = argc - 1; switch (argv[1][0]) { case 'g': return global[one * 11]; case 'c': return C::array[one * 11]; case 'f': static int array[10]; // FUNC_STATIC: 0x{{.*}} is located 4 bytes to the right of global variable 'array' defined in '{{.*}}global-location.cc:[[@LINE-1]]:16' {{.*}} of size 40 memset(array, 0, 10); return array[one * 11]; case 'l': const char *str = "0123456789"; // LITERAL: 0x{{.*}} is located 0 bytes to the right of global variable {{.*}} defined in '{{.*}}global-location.cc:[[@LINE-1]]:23' {{.*}} of size 11 return str[one * 11]; } return 0; } // CHECK: SUMMARY: AddressSanitizer: global-buffer-overflow golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/log-path_test.cc0000664000175000017500000000256712563423744030105 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // The for loop in the backticks below requires bash. // REQUIRES: shell // // RUN: %clangxx_asan %s -o %t // Regular run. // RUN: not %run %t 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.out // Good log_path. // RUN: rm -f %t.log.* // RUN: %env_asan_opts=log_path=%t.log not %run %t 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.* // Invalid log_path. // RUN: %env_asan_opts=log_path=/dev/null/INVALID not %run %t 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-INVALID < %t.out // Too long log_path. // RUN: %env_asan_opts=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` \ // RUN: not %run %t 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-LONG < %t.out // Run w/o errors should not produce any log. // RUN: rm -f %t.log.* // RUN: %env_asan_opts=log_path=%t.log %run %t ARG ARG ARG // RUN: not cat %t.log.* // FIXME: log_path is not supported on Windows yet. // XFAIL: win32 #include #include int main(int argc, char **argv) { if (argc > 2) return 0; char *x = (char*)malloc(10); memset(x, 0, 10); int res = x[argc * 10]; // BOOOM free(x); return res; } // CHECK-ERROR: ERROR: AddressSanitizer // CHECK-INVALID: ERROR: Can't open file: /dev/null/INVALID // CHECK-LONG: ERROR: Path is too long: 01234 golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/contiguous_container.cc0000664000175000017500000000515112616461323031556 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -fexceptions -O %s -o %t && %run %t // // Test __sanitizer_annotate_contiguous_container. #include #include #include #include #include void TestContainer(size_t capacity) { char *beg = new char[capacity]; char *end = beg + capacity; char *mid = beg + capacity; char *old_mid = 0; for (int i = 0; i < 10000; i++) { size_t size = rand() % (capacity + 1); assert(size <= capacity); old_mid = mid; mid = beg + size; __sanitizer_annotate_contiguous_container(beg, end, old_mid, mid); for (size_t idx = 0; idx < size; idx++) assert(!__asan_address_is_poisoned(beg + idx)); for (size_t idx = size; idx < capacity; idx++) assert(__asan_address_is_poisoned(beg + idx)); assert(__sanitizer_verify_contiguous_container(beg, mid, end)); assert(NULL == __sanitizer_contiguous_container_find_bad_address(beg, mid, end)); if (mid != beg) { assert(!__sanitizer_verify_contiguous_container(beg, mid - 1, end)); assert(mid - 1 == __sanitizer_contiguous_container_find_bad_address( beg, mid - 1, end)); } if (mid != end) { assert(!__sanitizer_verify_contiguous_container(beg, mid + 1, end)); assert(mid == __sanitizer_contiguous_container_find_bad_address( beg, mid + 1, end)); } } // Don't forget to unpoison the whole thing before destroing/reallocating. __sanitizer_annotate_contiguous_container(beg, end, mid, end); for (size_t idx = 0; idx < capacity; idx++) assert(!__asan_address_is_poisoned(beg + idx)); delete[] beg; } __attribute__((noinline)) void Throw() { throw 1; } __attribute__((noinline)) void ThrowAndCatch() { try { Throw(); } catch(...) { } } void TestThrow() { char x[32]; __sanitizer_annotate_contiguous_container(x, x + 32, x + 32, x + 14); assert(!__asan_address_is_poisoned(x + 13)); assert(__asan_address_is_poisoned(x + 14)); ThrowAndCatch(); assert(!__asan_address_is_poisoned(x + 13)); // FIXME: invert the assertion below once we fix // https://code.google.com/p/address-sanitizer/issues/detail?id=258 // This assertion works only w/o UAR. if (!__asan_get_current_fake_stack()) assert(!__asan_address_is_poisoned(x + 14)); __sanitizer_annotate_contiguous_container(x, x + 32, x + 14, x + 32); assert(!__asan_address_is_poisoned(x + 13)); assert(!__asan_address_is_poisoned(x + 14)); } int main(int argc, char **argv) { int n = argc == 1 ? 128 : atoi(argv[1]); for (int i = 0; i <= n; i++) TestContainer(i); TestThrow(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/initialization-bug.cc0000664000175000017500000000326112737026123031116 0ustar mwhudsonmwhudson// Test to make sure basic initialization order errors are caught. // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t-INIT-ORDER-EXE // RUN: %env_asan_opts=check_initialization_order=true not %run %t-INIT-ORDER-EXE 2>&1 | FileCheck %s // Do not test with optimization -- the error may be optimized away. // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=186 // XFAIL: darwin,win32 // The test is expected to fail on OS X Yosemite and older // UNSUPPORTED: osx-no-ld64-live_support #include // The structure of the test is: // "x", "y", "z" are dynamically initialized globals. // Value of "x" depends on "y", value of "y" depends on "z". // "x" and "z" are defined in this TU, "y" is defined in another one. // Thus we shoud stably report initialization order fiasco independently of // the translation unit order. int initZ() { return 5; } int z = initZ(); // 'y' is a dynamically initialized global residing in a different TU. This // dynamic initializer will read the value of 'y' before main starts. The // result is undefined behavior, which should be caught by initialization order // checking. extern int y; int __attribute__((noinline)) initX() { return y + 1; // CHECK: {{AddressSanitizer: initialization-order-fiasco}} // CHECK: {{READ of size .* at 0x.* thread T0}} // CHECK: {{0x.* is located 0 bytes inside of global variable .*(y|z).*}} // CHECK: registered at: // CHECK: 0x{{.*}} in __asan_register_globals } // This initializer begins our initialization order problems. static int x = initX(); int main() { // ASan should have caused an exit before main runs. printf("PASS\n"); // CHECK-NOT: PASS return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/throw_invoke_test.cc0000664000175000017500000000207712661407226031100 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t && %run %t // RUN: %clangxx_asan %s -o %t -stdlib=libstdc++ -static-libstdc++ && %run %t #include static volatile int zero = 0; inline void pretend_to_do_something(void *x) { __asm__ __volatile__("" : : "r" (x) : "memory"); } __attribute__((noinline)) void ReallyThrow() { fprintf(stderr, "ReallyThrow\n"); try { if (zero == 0) throw 42; else if (zero == 1) throw 1.; } catch(double x) { } } __attribute__((noinline)) void Throw() { int a, b, c, d, e; pretend_to_do_something(&a); pretend_to_do_something(&b); pretend_to_do_something(&c); pretend_to_do_something(&d); pretend_to_do_something(&e); fprintf(stderr, "Throw stack = %p\n", &a); ReallyThrow(); } __attribute__((noinline)) void CheckStack() { int ar[100]; pretend_to_do_something(ar); for (int i = 0; i < 100; i++) ar[i] = i; fprintf(stderr, "CheckStack stack = %p, %p\n", ar, ar + 100); } int main(int argc, char** argv) { try { Throw(); } catch(int a) { fprintf(stderr, "a = %d\n", a); } CheckStack(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-loop-removed.cc0000664000175000017500000000102212746507477032735 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s #include int *p; int main() { for (int i = 0; i < 3; i++) { int x; p = &x; } return *p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-removed.cc:[[@LINE-2]] // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x' } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/atol_strict.c0000664000175000017500000000336012562755664027517 0ustar mwhudsonmwhudson// Test strict_string_checks option in atol function // RUN: %clang_asan %s -o %t // RUN: %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test1 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test2 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t test3 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3 #include #include #include void test1(char *array) { // Last symbol is non-digit memset(array, '1', 10); array[9] = 'a'; long r = atol(array); assert(r == 111111111); } void test2(char *array) { // Single non-digit symbol array[9] = 'a'; long r = atol(array + 9); assert(r == 0); } void test3(char *array) { // Incorrect number format memset(array, ' ', 10); array[9] = '-'; array[8] = '-'; long r = atol(array); assert(r == 0); } int main(int argc, char **argv) { char *array = (char*)malloc(10); if (argc != 2) return 1; if (!strcmp(argv[1], "test1")) test1(array); // CHECK1: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK1: READ of size 11 if (!strcmp(argv[1], "test2")) test2(array); // CHECK2: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK2: READ of size 2 if (!strcmp(argv[1], "test3")) test3(array); // CHECK3: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK3: READ of size 11 free(array); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-free-right.cc0000664000175000017500000000323112415324363031236 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf // Test use-after-free report in the case when access is at the right border of // the allocation. #include int main() { volatile char *x = (char*)malloc(sizeof(char)); free((void*)x); *x = 42; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK: {{WRITE of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main .*use-after-free-right.cc:}}[[@LINE-4]] // CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}} // CHECK: {{freed by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in .*free}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-10]] // CHECK-Darwin: {{ #0 0x.* in wrap_free}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-13]] // CHECK: {{previously allocated by thread T0 here:}} // CHECK-Linux: {{ #0 0x.* in .*malloc}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-19]] // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-22]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/suppressions-function.cc0000664000175000017500000000175612563423744031732 0ustar mwhudsonmwhudson// Check that without suppressions, we catch the issue. // RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // RUN: echo "interceptor_via_fun:crash_function" > %t.supp // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // RUN: %clangxx_asan -O3 %s -o %t && %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // FIXME: Windows symbolizer needs work to make this pass. // XFAIL: android,win32 #include #include #include void crash_function() { char *a = (char *)malloc(6); free(a); size_t len = strlen(a); // BOOM fprintf(stderr, "strlen ignored, len = %zu\n", len); } int main() { crash_function(); } // CHECK-CRASH: AddressSanitizer: heap-use-after-free // CHECK-CRASH-NOT: strlen ignored // CHECK-IGNORE-NOT: AddressSanitizer: heap-use-after-free // CHECK-IGNORE: strlen ignored golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/global-address.cpp0000664000175000017500000000070312770316416030376 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -o %t %s // RUN: not %run %t 2>&1 | FileCheck %s #include int g_i = 42; int main() { // CHECK: AddressSanitizer: attempting to call __sanitizer_get_allocated_size() for pointer which is not owned // CHECK-NOT: ASAN:DEADLYSIGNAL // CHECK: SUMMARY: AddressSanitizer: bad-__sanitizer_get_allocated_size // CHECK-NOT: ASAN:DEADLYSIGNAL return (int)__sanitizer_get_allocated_size(&g_i); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/poison_partial.cc0000664000175000017500000000070312562755664030354 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: not %run %t heap 2>&1 | FileCheck %s // RUN: %env_asan_opts=poison_partial=0 %run %t // RUN: %env_asan_opts=poison_partial=0 %run %t heap #include char g[21]; char *x; int main(int argc, char **argv) { if (argc >= 2) x = new char[21]; else x = &g[0]; memset(x, 0, 21); int *y = (int*)x; return y[5]; } // CHECK: 0 bytes to the right golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strdup_oob_test.cc0000664000175000017500000000201512706214541030526 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // When built as C on Linux, strdup is transformed to __strdup. // RUN: %clangxx_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s // Unwind problem on arm: "main" is missing from the allocation stack trace. // UNSUPPORTED: armv7l-unknown-linux-gnueabihf #include char kString[] = "foo"; int main(int argc, char **argv) { char *copy = strdup(kString); int x = copy[4 + argc]; // BOOM // CHECK: AddressSanitizer: heap-buffer-overflow // CHECK: #0 {{.*}}main {{.*}}strdup_oob_test.cc:[[@LINE-2]] // CHECK-LABEL: allocated by thread T{{.*}} here: // CHECK: #{{[01]}} {{.*}}strdup // CHECK: #{{.*}}main {{.*}}strdup_oob_test.cc:[[@LINE-6]] // CHECK-LABEL: SUMMARY // CHECK: strdup_oob_test.cc:[[@LINE-7]] return x; } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/stack-buffer-overflow-with-position.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/stack-buffer-overflow-with-positi0000664000175000017500000000402212330266131033411 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O2 %s -o %t // RUN: not %run %t -2 2>&1 | FileCheck --check-prefix=CHECK-m2 %s // RUN: not %run %t -1 2>&1 | FileCheck --check-prefix=CHECK-m1 %s // RUN: %run %t 0 // RUN: %run %t 8 // RUN: not %run %t 9 2>&1 | FileCheck --check-prefix=CHECK-9 %s // RUN: not %run %t 10 2>&1 | FileCheck --check-prefix=CHECK-10 %s // RUN: not %run %t 30 2>&1 | FileCheck --check-prefix=CHECK-30 %s // RUN: not %run %t 31 2>&1 | FileCheck --check-prefix=CHECK-31 %s // RUN: not %run %t 41 2>&1 | FileCheck --check-prefix=CHECK-41 %s // RUN: not %run %t 42 2>&1 | FileCheck --check-prefix=CHECK-42 %s // RUN: not %run %t 62 2>&1 | FileCheck --check-prefix=CHECK-62 %s // RUN: not %run %t 63 2>&1 | FileCheck --check-prefix=CHECK-63 %s // RUN: not %run %t 73 2>&1 | FileCheck --check-prefix=CHECK-73 %s // RUN: not %run %t 74 2>&1 | FileCheck --check-prefix=CHECK-74 %s #include #include #include #include int main(int argc, char **argv) { assert(argc >= 2); int idx = atoi(argv[1]); char AAA[10], BBB[10], CCC[10]; memset(AAA, 0, sizeof(AAA)); memset(BBB, 0, sizeof(BBB)); memset(CCC, 0, sizeof(CCC)); int res = 0; char *p = AAA + idx; printf("AAA: %p\ny: %p\nz: %p\np: %p\n", AAA, BBB, CCC, p); // make sure BBB and CCC are not removed; return *(short*)(p) + BBB[argc % 2] + CCC[argc % 2]; } // CHECK-m2: 'AAA' <== {{.*}}underflows this variable // CHECK-m1: 'AAA' <== {{.*}}partially underflows this variable // CHECK-9: 'AAA' <== {{.*}}partially overflows this variable // CHECK-10: 'AAA' <== {{.*}}overflows this variable // CHECK-30: 'BBB' <== {{.*}}underflows this variable // CHECK-31: 'BBB' <== {{.*}}partially underflows this variable // CHECK-41: 'BBB' <== {{.*}}partially overflows this variable // CHECK-42: 'BBB' <== {{.*}}overflows this variable // CHECK-62: 'CCC' <== {{.*}}underflows this variable // CHECK-63: 'CCC' <== {{.*}}partially underflows this variable // CHECK-73: 'CCC' <== {{.*}}partially overflows this variable // CHECK-74: 'CCC' <== {{.*}}overflows this variable golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/sleep_before_dying.c0000664000175000017500000000037312563423744031005 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=sleep_before_dying=1 not %run %t 2>&1 | FileCheck %s #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: Sleeping for 1 second } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_overflow_right.cc0000664000175000017500000000103312756110734031665 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // #include __attribute__((noinline)) void foo(int index, int len) { volatile char str[len] __attribute__((aligned(32))); assert(!(reinterpret_cast(str) & 31L)); str[index] = '1'; // BOOM // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } int main(int argc, char **argv) { foo(33, 10); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/printf-1.c0000664000175000017500000000121512562755664026625 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck %s // RUN: %run %t 2>&1 | FileCheck %s #include #if defined(_WIN32) # define snprintf _snprintf #endif int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; // Check that printf works fine under Asan. printf("%c %d %.3f %s\n", c, x, f, s); // CHECK: 0 12 1.239 34 // Check that snprintf works fine under Asan. char buf[4]; snprintf(buf, 1000, "qwe"); printf("%s\n", buf); // CHECK: qwe return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Android/0000775000175000017500000000000013040224621026352 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Android/lit.local.cfg0000664000175000017500000000036212445000216030715 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.android != "1": config.unsupported = True config.substitutions.append( ("%device", "/data/local/tmp/Output") ) golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Android/coverage-android.cc0000664000175000017500000001301712747743012032111 0ustar mwhudsonmwhudson// Test for direct coverage writing with dlopen. // Test normal exit, coverage level 1. // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSO_DIR=\"%device\" %s -o %t // RUN: adb shell rm -rf %device/coverage-android // RUN: rm -rf %T/coverage-android // RUN: adb shell mkdir -p %device/coverage-android/direct // RUN: mkdir -p %T/coverage-android/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t // RUN: adb pull %device/coverage-android/direct %T/coverage-android/direct // RUN: ls; pwd // RUN: cd %T/coverage-android/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov |& FileCheck --check-prefix=CHECK1 %s // Test sudden death, coverage level 1. // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSO_DIR=\"%device\" %s -o %t // RUN: adb shell rm -rf %device/coverage-android-kill // RUN: rm -rf %T/coverage-android-kill // RUN: adb shell mkdir -p %device/coverage-android-kill/direct // RUN: mkdir -p %T/coverage-android-kill/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t // RUN: adb pull %device/coverage-android-kill/direct %T/coverage-android-kill/direct // RUN: ls; pwd // RUN: cd %T/coverage-android-kill/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov |& FileCheck --check-prefix=CHECK1 %s // Test normal exit, coverage level 2. // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=bb -DSO_DIR=\"%device\" %s -o %t // RUN: adb shell rm -rf %device/coverage-android // RUN: rm -rf %T/coverage-android // RUN: adb shell mkdir -p %device/coverage-android/direct // RUN: mkdir -p %T/coverage-android/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t // RUN: adb pull %device/coverage-android/direct %T/coverage-android/direct // RUN: ls; pwd // RUN: cd %T/coverage-android/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov |& FileCheck --check-prefix=CHECK2 %s // Test sudden death, coverage level 2. // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=bb -DSO_DIR=\"%device\" %s -o %t // RUN: adb shell rm -rf %device/coverage-android-kill // RUN: rm -rf %T/coverage-android-kill // RUN: adb shell mkdir -p %device/coverage-android-kill/direct // RUN: mkdir -p %T/coverage-android-kill/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t // RUN: adb pull %device/coverage-android-kill/direct %T/coverage-android-kill/direct // RUN: ls; pwd // RUN: cd %T/coverage-android-kill/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov |& FileCheck --check-prefix=CHECK2 %s // Test normal exit, coverage level 3. // RUN: %clangxx_asan -fsanitize-coverage=edge -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=edge -DSO_DIR=\"%device\" %s -o %t // RUN: adb shell rm -rf %device/coverage-android // RUN: rm -rf %T/coverage-android // RUN: adb shell mkdir -p %device/coverage-android/direct // RUN: mkdir -p %T/coverage-android/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android/direct:verbosity=1 %run %t // RUN: adb pull %device/coverage-android/direct %T/coverage-android/direct // RUN: ls; pwd // RUN: cd %T/coverage-android/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov |& FileCheck --check-prefix=CHECK3 %s // Test sudden death, coverage level 3. // RUN: %clangxx_asan -fsanitize-coverage=edge -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=edge -DSO_DIR=\"%device\" %s -o %t // RUN: adb shell rm -rf %device/coverage-android-kill // RUN: rm -rf %T/coverage-android-kill // RUN: adb shell mkdir -p %device/coverage-android-kill/direct // RUN: mkdir -p %T/coverage-android-kill/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%device/coverage-android-kill/direct:verbosity=1 not %run %t // RUN: adb pull %device/coverage-android-kill/direct %T/coverage-android-kill/direct // RUN: ls; pwd // RUN: cd %T/coverage-android-kill/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov |& FileCheck --check-prefix=CHECK3 %s // PC counts in CHECK lines are platform dependent and match arm32 at the moment. // sancov tool does not support Android well enough to match function names // REQUIRES: arm #include #include #include #include #include #include #ifdef SHARED extern "C" { void bar() { printf("bar\n"); #ifdef KILL kill(getpid(), SIGKILL); #endif } } #else volatile int sink; int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); void *handle1 = dlopen(SO_DIR "/libcoverage_android_test_1.so", RTLD_LAZY); assert(handle1); if (argc == 0) sink = 0; void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); bar1(); return 0; } #endif // CHECK1: 2 PCs total // CHECK2: 4 PCs total // CHECK3: 5 PCs total ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_instruments_all_paddings.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_instruments_all_paddings.c0000664000175000017500000000120012756110734033552 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: %clangxx_asan -O3 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: %run %t 2>&1 // #include "sanitizer/asan_interface.h" #include __attribute__((noinline)) void foo(int index, int len) { volatile char str[len] __attribute__((aligned(32))); assert(!(reinterpret_cast(str) & 31L)); char *q = (char *)__asan_region_is_poisoned((char *)str, 64); assert(q && ((q - str) == index)); } int main(int argc, char **argv) { for (int i = 1; i < 33; ++i) foo(i, i); for (int i = 1; i < 33; ++i) foo(i, i); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/0000775000175000017500000000000013040224621026074 5ustar mwhudsonmwhudson././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/assign_large_valloc_to_global.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/assign_large_valloc_to_glob0000664000175000017500000000030712571720276033541 0ustar mwhudsonmwhudson// Make sure we don't report a leak nor hang. // RUN: %clangxx_asan -O3 %s -o %t && %run %t #include #include int *p; int main() { posix_memalign((void **)&p, 4096, 1 << 20); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/asprintf.cc0000664000175000017500000000066112377351502030247 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include int main(int argc, char **argv) { char *p; int res = asprintf(&p, "%d", argc); fprintf(stderr, "x%d %sx\n", res, p); // CHECK: x1 1x free(p); fprintf(stderr, "DONE\n"); // CHECK: DONE return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/no_asan_gen_globals.c0000664000175000017500000000056512744161125032231 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // FIXME: http://llvm.org/bugs/show_bug.cgi?id=22682 // REQUIRES: asan-64-bits // Make sure __asan_gen_* strings do not end up in the symbol table. // RUN: %clang_asan %s -o %t.exe // RUN: nm %t.exe | FileCheck %s int x, y, z; int main() { return 0; } // CHECK-NOT: __asan_gen_ golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/deep_call_stack.cc0000664000175000017500000000136112567131651031516 0ustar mwhudsonmwhudson// Check that UAR mode can handle very deep recusrion. // RUN: %clangxx_asan -O2 %s -o %t && \ // RUN: (ulimit -s 4096; %env_asan_opts=detect_stack_use_after_return=1 %run %t) 2>&1 | FileCheck %s // Also check that use_sigaltstack+verbosity doesn't crash. // RUN: %env_asan_opts=verbosity=1:use_sigaltstack=1:detect_stack_use_after_return=1 %run %t | FileCheck %s #include __attribute__((noinline)) void RecursiveFunc(int depth, int *ptr) { if ((depth % 1000) == 0) printf("[%05d] ptr: %p\n", depth, ptr); if (depth == 0) return; int local; RecursiveFunc(depth - 1, &local); } int main(int argc, char **argv) { RecursiveFunc(15000, 0); return 0; } // CHECK: [15000] ptr: // CHECK: [07000] ptr: // CHECK: [00000] ptr: ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/init-order-pthread-create.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/init-order-pthread-create.c0000664000175000017500000000222712562755664033235 0ustar mwhudsonmwhudson// Check that init-order checking is properly disabled if pthread_create is // called. // RUN: %clangxx_asan -c -DCONFIG1 %s -o %t1.o // RUN: %clangxx_asan -c %s -o %t2.o // RUN: %clangxx_asan -pthread %t1.o %t2.o -o %t // RUN: %env_asan_opts=strict_init_order=true %run %t #ifdef CONFIG1 #include #include #include void *bar(void *input, bool sleep_before_init) { if (sleep_before_init) usleep(500000); return input; } void *glob = bar((void*)0x1234, false); extern void *glob2; void *poll(void *arg) { void **glob = (void**)arg; while (true) { usleep(100000); printf("glob is now: %p\n", *glob); } } struct GlobalPollerStarter { GlobalPollerStarter() { pthread_t p; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); pthread_create(&p, 0, poll, &glob); pthread_attr_destroy(&attr); printf("glob poller is started"); } } global_poller; int main() { printf("%p %p\n", glob, glob2); return 0; } #else // CONFIG1 void *bar(void *input, bool sleep_before_init); void *glob2 = bar((void*)0x2345, true); #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-direct-large.cc0000664000175000017500000000440312567131651032554 0ustar mwhudsonmwhudson// Test for direct coverage writing with lots of data. // Current implementation maps output file in chunks of 64K. This test overflows // 1 chunk. // RUN: %clangxx_asan -fsanitize-coverage=func -O0 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -O0 %s %libdl -o %t // RUN: rm -rf %T/coverage-direct-large // RUN: mkdir -p %T/coverage-direct-large/normal && cd %T/coverage-direct-large/normal // RUN: %env_asan_opts=coverage=1:coverage_direct=0:verbosity=1 %run %t %dynamiclib // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: mkdir -p %T/coverage-direct-large/direct && cd %T/coverage-direct-large/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:verbosity=1 %run %t %dynamiclib // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: diff -u coverage-direct-large/normal/out.txt coverage-direct-large/direct/out.txt // // XFAIL: android #define F0(Q, x) Q(x) #define F1(Q, x) \ F0(Q, x##0) F0(Q, x##1) F0(Q, x##2) F0(Q, x##3) F0(Q, x##4) F0(Q, x##5) \ F0(Q, x##6) F0(Q, x##7) F0(Q, x##8) F0(Q, x##9) #define F2(Q, x) \ F1(Q, x##0) F1(Q, x##1) F1(Q, x##2) F1(Q, x##3) F1(Q, x##4) F1(Q, x##5) \ F1(Q, x##6) F1(Q, x##7) F1(Q, x##8) F1(Q, x##9) #define F3(Q, x) \ F2(Q, x##0) F2(Q, x##1) F2(Q, x##2) F2(Q, x##3) F2(Q, x##4) F2(Q, x##5) \ F2(Q, x##6) F2(Q, x##7) F2(Q, x##8) F2(Q, x##9) #define F4(Q, x) \ F3(Q, x##0) F3(Q, x##1) F3(Q, x##2) F3(Q, x##3) F3(Q, x##4) F3(Q, x##5) \ F3(Q, x##6) F3(Q, x##7) F3(Q, x##8) F3(Q, x##9) #define DECL(x) __attribute__((noinline)) static void x() {} #define CALL(x) x(); F4(DECL, f) #ifdef SHARED extern "C" void so_entry() { F4(CALL, f) } #else #include #include #include int main(int argc, char **argv) { F4(CALL, f) assert(argc > 1); void *handle1 = dlopen(argv[1], RTLD_LAZY); // %dynamiclib assert(handle1); void (*so_entry)() = (void (*)())dlsym(handle1, "so_entry"); assert(so_entry); so_entry(); return 0; } #endif // SHARED golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/print_cmdline.cc0000664000175000017500000000106012647115140031236 0ustar mwhudsonmwhudson// Check that ASan can print reproducer cmdline for failed binary if desired. // // RUN: %clang_asan %s -o %t-exe // // RUN: env not %run %t-exe 2>&1 | FileCheck %s // RUN: %env_asan_opts=print_cmdline=false not %run %t-exe 2>&1 | FileCheck %s // RUN: %env_asan_opts=print_cmdline=true not %run %t-exe first second/third [fourth] 2>&1 | FileCheck %s --check-prefix CHECK-PRINT volatile int ten = 10; int main() { char x[10]; // CHECK-NOT: Command: // CHECK-PRINT: {{Command: .*-exe first second/third \[fourth\]}} x[ten] = 1; // BOOM return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/waitid.cc0000664000175000017500000000136212362206342027674 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include #include int main(int argc, char **argv) { pid_t pid = fork(); if (pid) { // parent int x[3]; int *status = x + argc * 3; int res; siginfo_t *si = (siginfo_t*)(x + argc * 3); res = waitid(P_ALL, 0, si, WEXITED | WNOHANG); // CHECK: stack-buffer-overflow // CHECK: {{WRITE of size .* at 0x.* thread T0}} // CHECK: {{in .*waitid}} // CHECK: {{in main .*waitid.cc:}} // CHECK: is located in stack of thread T0 at offset // CHECK: {{in main}} return res != -1; } // child return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/global-registration.c0000664000175000017500000000365112734136517032234 0ustar mwhudsonmwhudson// Test that globals from different shared objects all get registered. // This source file is compiled into three different source object files. Each // object file declares a global buffer. The first two are linked together, and // the third is loaded at runtime. We make sure that out-of-bounds accesses // are caught for all three buffers. // RUN: %clang_asan -c -o %t-one.o -DMAIN_FILE %s // RUN: %clang_asan -c -o %t-two.o -DSECONDARY_FILE %s // RUN: %clang_asan -o %t %t-one.o %t-two.o %libdl // RUN: %clang_asan -o %t-dynamic.so -shared -fPIC -DSHARED_LIBRARY_FILE %s // RUN: not %run %t 1 2>&1 | FileCheck --check-prefix ASAN-CHECK-1 %s // RUN: not %run %t 2 2>&1 | FileCheck --check-prefix ASAN-CHECK-2 %s // RUN: not %run %t 3 2>&1 | FileCheck --check-prefix ASAN-CHECK-3 %s #if MAIN_FILE #include #include #include #include extern char buffer1[1]; extern char buffer2[1]; char buffer1[1] = { 0 }; int main(int argc, char *argv[]) { int n = atoi(argv[1]); if (n == 1) { buffer1[argc] = 0; // ASAN-CHECK-1: {{0x.* is located 1 bytes .* 'buffer1'}} } else if (n == 2) { buffer2[argc] = 0; // ASAN-CHECK-2: {{0x.* is located 1 bytes .* 'buffer2'}} } else if (n == 3) { char *libsuffix = "-dynamic.so"; char *libpath = malloc(strlen(argv[0]) + strlen(libsuffix) + 1); sprintf(libpath, "%s%s", argv[0], libsuffix); void *handle = dlopen(libpath, RTLD_NOW); if (!handle) { fprintf(stderr, "dlopen: %s\n", dlerror()); return 1; } char *buffer = (char *)dlsym(handle, "buffer3"); if (!buffer) { fprintf(stderr, "dlsym: %s\n", dlerror()); return 1; } buffer[argc] = 0; // ASAN-CHECK-3: {{0x.* is located 1 bytes .* 'buffer3'}} } return 0; } #elif SECONDARY_FILE extern char buffer2[1]; char buffer2[1] = { 0 }; #elif SHARED_LIBRARY_FILE extern char buffer3[1]; char buffer3[1] = { 0 }; #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/lit.local.cfg0000664000175000017500000000026412334674662030463 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os in ['Windows']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-caller-callee.cc0000664000175000017500000000713412613523406032676 0ustar mwhudsonmwhudson// Test caller-callee coverage with large number of threads // and various numbers of callers and callees. // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 10 1 2>&1 | FileCheck %s --check-prefix=CHECK-10-1 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 9 2 2>&1 | FileCheck %s --check-prefix=CHECK-9-2 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 7 3 2>&1 | FileCheck %s --check-prefix=CHECK-7-3 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 17 1 2>&1 | FileCheck %s --check-prefix=CHECK-17-1 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 15 2 2>&1 | FileCheck %s --check-prefix=CHECK-15-2 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 18 3 2>&1 | FileCheck %s --check-prefix=CHECK-18-3 // RUN: rm -f caller-callee*.sancov // // REQUIRES: asan-64-bits // UNSUPPORTED: android // // CHECK-10-1: CovDump: 10 caller-callee pairs written // CHECK-9-2: CovDump: 18 caller-callee pairs written // CHECK-7-3: CovDump: 21 caller-callee pairs written // CHECK-17-1: CovDump: 14 caller-callee pairs written // CHECK-15-2: CovDump: 28 caller-callee pairs written // CHECK-18-3: CovDump: 42 caller-callee pairs written #include #include #include int P = 0; struct Foo {virtual void f() {if (P) printf("Foo::f()\n");}}; struct Foo1 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo2 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo3 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo4 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo5 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo6 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo7 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo8 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo9 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo10 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo11 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo12 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo13 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo14 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo15 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo16 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo17 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo18 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo19 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; Foo *foo[20] = { new Foo, new Foo1, new Foo2, new Foo3, new Foo4, new Foo5, new Foo6, new Foo7, new Foo8, new Foo9, new Foo10, new Foo11, new Foo12, new Foo13, new Foo14, new Foo15, new Foo16, new Foo17, new Foo18, new Foo19, }; int n_functions = 10; int n_callers = 2; void *Thread(void *arg) { if (n_callers >= 1) for (int i = 0; i < 2000; i++) foo[i % n_functions]->f(); if (n_callers >= 2) for (int i = 0; i < 2000; i++) foo[i % n_functions]->f(); if (n_callers >= 3) for (int i = 0; i < 2000; i++) foo[i % n_functions]->f(); return arg; } int main(int argc, char **argv) { if (argc >= 2) n_functions = atoi(argv[1]); if (argc >= 3) n_callers = atoi(argv[2]); const int kNumThreads = 16; pthread_t t[kNumThreads]; for (int i = 0; i < kNumThreads; i++) pthread_create(&t[i], 0, Thread, 0); for (int i = 0; i < kNumThreads; i++) pthread_join(t[i], 0); } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/new_array_cookie_with_new_f0000664000175000017500000000162612572170260033565 0ustar mwhudsonmwhudson// Test that we do not poison the array cookie if the operator new is defined // inside the class. // RUN: %clangxx_asan %s -o %t && %run %t // // XFAIL: arm #include #include #include #include #include struct Foo { void *operator new(size_t s) { return Allocate(s); } void *operator new[] (size_t s) { return Allocate(s); } ~Foo(); static void *allocated; static void *Allocate(size_t s) { assert(!allocated); return allocated = ::new char[s]; } }; Foo::~Foo() {} void *Foo::allocated; Foo *getFoo(size_t n) { return new Foo[n]; } int main() { Foo *foo = getFoo(10); fprintf(stderr, "foo : %p\n", foo); fprintf(stderr, "alloc: %p\n", Foo::allocated); assert(reinterpret_cast(foo) == reinterpret_cast(Foo::allocated) + sizeof(void*)); *reinterpret_cast(Foo::allocated) = 42; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/halt_on_error-signals.c0000664000175000017500000000556312747574464032576 0ustar mwhudsonmwhudson// Test interaction of Asan recovery mode with asynch signals. // // RUN: %clang_asan -fsanitize-recover=address -pthread %s -o %t // // RUN: rm -f %t.log // RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 100 >>%t.log 2>&1 || true // Collision will almost always get triggered but we still need to check the unlikely case: // RUN: FileCheck --check-prefix=CHECK-COLLISION %s < %t.log || FileCheck --check-prefix=CHECK-NO-COLLISION %s < %t.log #define _SVID_SOURCE 1 // SA_NODEFER #include #include #include #include #include #include #include void random_delay(unsigned *seed) { *seed = 1664525 * *seed + 1013904223; struct timespec delay = { 0, (*seed % 1000) * 1000 }; nanosleep(&delay, 0); } volatile char bad[2] = {1, }; void error() { // CHECK-COLLISION: AddressSanitizer: nested bug in the same thread, aborting // CHECK-NO-COLLISION: AddressSanitizer: use-after-poison volatile int idx = 0; bad[idx] = 0; } #define CHECK_CALL(e, msg) do { \ if (0 != (e)) { \ fprintf(stderr, "Failed to " msg "\n"); \ exit(1); \ } \ } while (0) size_t niter = 10; pthread_t sender_tid, receiver_tid; pthread_mutex_t keep_alive_mu = PTHREAD_MUTEX_INITIALIZER; void *sender(void *arg) { unsigned seed = 0; for (size_t i = 0; i < niter; ++i) { random_delay(&seed); CHECK_CALL(pthread_kill(receiver_tid, SIGUSR1), "send signal"); } return 0; } void handler(int sig) { // Expect error collisions here error(); } void *receiver(void *arg) { unsigned seed = 1; for (size_t i = 0; i < niter; ++i) { random_delay(&seed); // And here error(); } // Parent will release this when it's ok to terminate CHECK_CALL(pthread_mutex_lock(&keep_alive_mu), "unlock mutex"); return 0; } int main(int argc, char **argv) { if (argc != 2) { fprintf(stderr, "Syntax: %s niter\n", argv[0]); exit(1); } niter = (size_t)strtoul(argv[1], 0, 0); struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = handler; sa.sa_flags = SA_NODEFER; // Enable nested handlers to add more stress CHECK_CALL(sigaction(SIGUSR1, &sa, 0), "set sighandler"); __asan_poison_memory_region(&bad, sizeof(bad)); CHECK_CALL(pthread_mutex_lock(&keep_alive_mu), "lock mutex"); CHECK_CALL(pthread_create(&receiver_tid, 0, receiver, 0), "start thread"); CHECK_CALL(pthread_create(&sender_tid, 0, sender, 0), "start thread"); CHECK_CALL(pthread_join(sender_tid, 0), "join thread"); // Now allow receiver to die CHECK_CALL(pthread_mutex_unlock(&keep_alive_mu), "unlock mutex"); CHECK_CALL(pthread_join(receiver_tid, 0), "join thread"); // CHECK-NO-COLLISION: All threads terminated printf("All threads terminated\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-sandboxing.cc0000664000175000017500000000555712701315240032345 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t %ld_flags_rpath_exe // RUN: rm -rf %T/coverage_sandboxing_test // RUN: mkdir %T/coverage_sandboxing_test && cd %T/coverage_sandboxing_test // RUN: mkdir vanilla && cd vanilla // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-vanilla // RUN: mkdir ../sandbox1 && cd ../sandbox1 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t a 2>&1 | FileCheck %s --check-prefix=CHECK-sandbox // RUN: %sancov unpack coverage_sandboxing_test.sancov.packed // RUN: mkdir ../sandbox2 && cd ../sandbox2 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t a b 2>&1 | FileCheck %s --check-prefix=CHECK-sandbox // RUN: %sancov unpack coverage_sandboxing_test.sancov.packed // RUN: cd .. // RUN: %sancov print vanilla/`basename %dynamiclib`*.sancov > vanilla.txt // RUN: %sancov print sandbox1/`basename %dynamiclib`*.sancov > sandbox1.txt // RUN: %sancov print sandbox2/`basename %dynamiclib`*.sancov > sandbox2.txt // RUN: diff vanilla.txt sandbox1.txt // RUN: diff vanilla.txt sandbox2.txt // RUN: rm -r %T/coverage_sandboxing_test // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android #include #include #include #include #include #include #define bb0(n) \ case n: \ fprintf(stderr, "foo: %d\n", n); \ break; #define bb1(n) bb0(n) bb0(n + 1) #define bb2(n) bb1(n) bb1(n + 2) #define bb3(n) bb2(n) bb2(n + 4) #define bb4(n) bb3(n) bb3(n + 8) #define bb5(n) bb4(n) bb4(n + 16) #define bb6(n) bb5(n) bb5(n + 32) #define bb7(n) bb6(n) bb6(n + 64) #define bb8(n) bb7(n) bb7(n + 128) #ifdef SHARED void foo(int i) { switch(i) { // 256 basic blocks bb8(0) } } #else extern void foo(int i); int main(int argc, char **argv) { assert(argc <= 3); for (int i = 0; i < 256; i++) foo(i); fprintf(stderr, "PID: %d\n", getpid()); if (argc == 1) { // Vanilla mode, dump to individual files. return 0; } // Dump to packed file. int fd = creat("coverage_sandboxing_test.sancov.packed", 0660); __sanitizer_sandbox_arguments args = {0}; args.coverage_sandboxed = 1; args.coverage_fd = fd; if (argc == 2) // Write to packed file, do not split into blocks. args.coverage_max_block_size = 0; else if (argc == 3) // Write to packed file, split into blocks (as if writing to a socket). args.coverage_max_block_size = 100; __sanitizer_sandbox_on_notify(&args); return 0; } #endif // CHECK-vanilla: PID: [[PID:[0-9]+]] // CHECK-vanilla: .so.[[PID]].sancov: 257 PCs written // CHECK-vanilla: [[PID]].sancov: 1 PCs written // CHECK-sandbox: PID: [[PID:[0-9]+]] // CHECK-sandbox: 257 PCs written to packed file golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/current_allocated_bytes.cc0000664000175000017500000000225712562747660033336 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -pthread -o %t && %run %t // RUN: %clangxx_asan -O2 %s -pthread -o %t && %run %t // REQUIRES: stable-runtime #include #include #include #include #include const size_t kLargeAlloc = 1UL << 20; void* allocate(void *arg) { volatile void *ptr = malloc(kLargeAlloc); free((void*)ptr); return 0; } void* check_stats(void *arg) { assert(__sanitizer_get_current_allocated_bytes() > 0); return 0; } int main() { size_t used_mem = __sanitizer_get_current_allocated_bytes(); printf("Before: %zu\n", used_mem); const int kNumIterations = 1000; for (int iter = 0; iter < kNumIterations; iter++) { pthread_t thr[4]; for (int j = 0; j < 4; j++) { assert(0 == pthread_create(&thr[j], 0, (j < 2) ? allocate : check_stats, 0)); } for (int j = 0; j < 4; j++) assert(0 == pthread_join(thr[j], 0)); used_mem = __sanitizer_get_current_allocated_bytes(); if (used_mem > kLargeAlloc) { printf("After iteration %d: %zu\n", iter, used_mem); return 1; } } printf("Success after %d iterations\n", kNumIterations); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/closed-fds.cc0000664000175000017500000000212012670257737030447 0ustar mwhudsonmwhudson// Check that when the program closed its std(in|out|err), running the external // symbolizer still works. // RUN: rm -f %t.log.* // RUN: %clangxx_asan -O0 %s -o %t 2>&1 && %env_asan_opts=log_path='"%t.log"':verbosity=2 not %run %t 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-FILE < %t.log.* // FIXME: copy %t.log back from the device and re-enable on Android. // UNSUPPORTED: android #include #include #include #include #include int main(int argc, char **argv) { int result = fprintf(stderr, "Closing streams.\n"); assert(result > 0); close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); result = fprintf(stderr, "Can you hear me now?\n"); assert(result < 0); char *x = (char *)malloc(10 * sizeof(char)); free(x); x[argc] = 'X'; // BOOM // CHECK-FILE: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK-FILE: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} // CHECK-FILE: {{WRITE of size 1 at 0x.* thread T0}} // CHECK-FILE: {{ #0 0x.* in main .*closed-fds.cc:}}[[@LINE-4]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/allow_user_segv.cc0000664000175000017500000000352112567131651031621 0ustar mwhudsonmwhudson// Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=180 // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s #include #include #include struct sigaction original_sigaction_sigbus; struct sigaction original_sigaction_sigsegv; void User_OnSIGSEGV(int signum, siginfo_t *siginfo, void *context) { fprintf(stderr, "User sigaction called\n"); struct sigaction original_sigaction; if (signum == SIGBUS) original_sigaction = original_sigaction_sigbus; else if (signum == SIGSEGV) original_sigaction = original_sigaction_sigsegv; else { printf("Invalid signum"); exit(1); } if (original_sigaction.sa_flags | SA_SIGINFO) original_sigaction.sa_sigaction(signum, siginfo, context); else original_sigaction.sa_handler(signum); } int DoSEGV() { volatile int *x = 0; return *x; } int InstallHandler(int signum, struct sigaction *original_sigaction) { struct sigaction user_sigaction; user_sigaction.sa_sigaction = User_OnSIGSEGV; user_sigaction.sa_flags = SA_SIGINFO; if (sigaction(signum, &user_sigaction, original_sigaction)) { perror("sigaction"); return 1; } return 0; } int main() { // Let's install handlers for both SIGSEGV and SIGBUS, since pre-Yosemite // 32-bit Darwin triggers SIGBUS instead. if (InstallHandler(SIGSEGV, &original_sigaction_sigsegv)) return 1; if (InstallHandler(SIGBUS, &original_sigaction_sigbus)) return 1; fprintf(stderr, "User sigaction installed\n"); return DoSEGV(); } // CHECK: User sigaction installed // CHECK-NEXT: User sigaction called // CHECK-NEXT: ASAN:DEADLYSIGNAL // CHECK: AddressSanitizer: SEGV on unknown address golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-direct.cc0000664000175000017500000000570112567131651031466 0ustar mwhudsonmwhudson// Test for direct coverage writing with dlopen at coverage level 1 to 3. // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func %s %libdl -o %t // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal // RUN: %env_asan_opts=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct/normal/*.sancov >%T/coverage-direct/normal/out.txt // RUN: mkdir -p %T/coverage-direct/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib // RUN: cd %T/coverage-direct/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=bb -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal // RUN: %env_asan_opts=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct/normal/*.sancov >%T/coverage-direct/normal/out.txt // RUN: mkdir -p %T/coverage-direct/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib // RUN: cd %T/coverage-direct/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt // RUN: %clangxx_asan -fsanitize-coverage=edge -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=edge -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: rm -rf %T/coverage-direct // RUN: mkdir -p %T/coverage-direct/normal // RUN: %env_asan_opts=coverage=1:coverage_direct=0:coverage_dir=%T/coverage-direct/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct/normal/*.sancov >%T/coverage-direct/normal/out.txt // RUN: mkdir -p %T/coverage-direct/direct // RUN: %env_asan_opts=coverage=1:coverage_direct=1:coverage_dir=%T/coverage-direct/direct:verbosity=1 %run %t %dynamiclib // RUN: cd %T/coverage-direct/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt // XFAIL: android #include #include #include #include #ifdef SHARED extern "C" { void bar() { printf("bar\n"); } } #else int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); assert(argc > 1); void *handle1 = dlopen(argv[1], RTLD_LAZY); assert(handle1); void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); bar1(); return 0; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/stack-overflow.cc0000664000175000017500000000720112562755664031401 0ustar mwhudsonmwhudson// Test ASan detection of stack-overflow condition. // RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %s -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %s -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -DTHREAD -pthread -o %t && %env_asan_opts=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: stable-runtime #include #include #include #include #include #include #include const int BS = 1024; volatile char x; volatile int y = 1; volatile int z0, z1, z2, z3, z4, z5, z6, z7, z8, z9, z10, z11, z12, z13; void recursive_func(char *p) { #if defined(SMALL_FRAME) char *buf = 0; #elif defined(SAVE_ALL_THE_REGISTERS) char *buf = 0; int t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13; t0 = z0; t1 = z1; t2 = z2; t3 = z3; t4 = z4; t5 = z5; t6 = z6; t7 = z7; t8 = z8; t9 = z9; t10 = z10; t11 = z11; t12 = z12; t13 = z13; z0 = t0; z1 = t1; z2 = t2; z3 = t3; z4 = t4; z5 = t5; z6 = t6; z7 = t7; z8 = t8; z9 = t9; z10 = t10; z11 = t11; z12 = t12; z13 = t13; #else char buf[BS]; // Check that the stack grows in the righ direction, unless we use fake stack. if (p && !__asan_get_current_fake_stack()) assert(p - buf >= BS); buf[rand() % BS] = 1; buf[rand() % BS] = 2; x = buf[rand() % BS]; #endif if (y) recursive_func(buf); x = 1; // prevent tail call optimization // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* bp 0x.* sp 0x.* T.*\)}} // If stack overflow happens during function prologue, stack trace may be // corrupted. Unwind tables are not always 100% exact there. // For this reason, we don't do any further checks. } void *ThreadFn(void* unused) { recursive_func(0); return 0; } void LimitStackAndReexec(int argc, char **argv) { struct rlimit rlim; int res = getrlimit(RLIMIT_STACK, &rlim); assert(res == 0); if (rlim.rlim_cur == RLIM_INFINITY) { rlim.rlim_cur = 256 * 1024; res = setrlimit(RLIMIT_STACK, &rlim); assert(res == 0); execv(argv[0], argv); assert(0 && "unreachable"); } } int main(int argc, char **argv) { LimitStackAndReexec(argc, argv); #ifdef THREAD pthread_t t; pthread_create(&t, 0, ThreadFn, 0); pthread_join(t, 0); #else recursive_func(0); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/mmap_limit_mb.cc0000664000175000017500000000216412656765714031245 0ustar mwhudsonmwhudson// Test the mmap_limit_mb flag. // // RUN: %clangxx_asan -O2 %s -o %t // RUN: %run %t 20 16 // RUN: %run %t 30 1000000 // RUN: %env_asan_opts=mmap_limit_mb=300 %run %t 20 16 // RUN: %env_asan_opts=mmap_limit_mb=300 %run %t 20 1000000 // RUN: %env_asan_opts=mmap_limit_mb=300 not %run %t 500 16 2>&1 | FileCheck %s // RUN: %env_asan_opts=mmap_limit_mb=300 not %run %t 500 1000000 2>&1 | FileCheck %s // // FIXME: Windows doesn't implement mmap_limit_mb. // XFAIL: arm-linux-gnueabi,win32 #include #include #include #include #include int main(int argc, char **argv) { assert(argc == 3); long total_mb = atoi(argv[1]); long allocation_size = atoi(argv[2]); fprintf(stderr, "total_mb: %zd allocation_size: %zd\n", total_mb, allocation_size); std::vector v; for (long total = total_mb << 20; total > 0; total -= allocation_size) v.push_back(new char[allocation_size]); for (std::vector::const_iterator it = v.begin(); it != v.end(); ++it) delete[](*it); fprintf(stderr, "PASS\n"); // CHECK: total_mmaped{{.*}}mmap_limit_mb return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/start-deactivated.cc0000664000175000017500000000755712766043660032051 0ustar mwhudsonmwhudson// Test for ASAN_OPTIONS=start_deactivated=1 mode. // Main executable is uninstrumented, but linked to ASan runtime. The shared // library is instrumented. Memory errors before dlopen are not detected. // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -std=c++11 -fPIC -shared -o %t-so.so // RUN: %clangxx -O0 %s -std=c++11 -c -o %t.o // RUN: %clangxx_asan -O0 %t.o %libdl -o %t // RUN: %env_asan_opts=start_deactivated=1,allocator_may_return_null=0 \ // RUN: ASAN_ACTIVATION_OPTIONS=allocator_may_return_null=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-HELP // RUN: %env_asan_opts=start_deactivated=1,verbosity=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED-V0 // Check that verbosity=1 in activation flags affects reporting of unrecognized activation flags. // RUN: %env_asan_opts=start_deactivated=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0,verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED // XFAIL: arm-linux-gnueabi #if !defined(SHARED_LIB) #include #include #include #include #include #include #include #include "sanitizer/asan_interface.h" constexpr unsigned nPtrs = 200; char *ptrs[nPtrs]; void test_malloc_shadow(char *p, size_t sz, bool expect_redzones) { assert((char *)__asan_region_is_poisoned(p - 1, sz + 1) == (expect_redzones ? p - 1 : nullptr)); assert((char *)__asan_region_is_poisoned(p, sz) == nullptr); assert((char *)__asan_region_is_poisoned(p, sz + 1) == (expect_redzones ? p + sz : nullptr)); } typedef void (*Fn)(); int main(int argc, char *argv[]) { // Before activation: no redzones. for (size_t sz = 1; sz < nPtrs; ++sz) { ptrs[sz] = (char *)malloc(sz); test_malloc_shadow(ptrs[sz], sz, false); } std::string path = std::string(argv[0]) + "-so.so"; void *dso = dlopen(path.c_str(), RTLD_NOW); if (!dso) { fprintf(stderr, "dlopen failed: %s\n", dlerror()); return 1; } // After this line ASan is activated and starts detecting errors. void *fn = dlsym(dso, "do_another_bad_thing"); if (!fn) { fprintf(stderr, "dlsym failed: %s\n", dlerror()); return 1; } // After activation: redzones. { char *p = (char *)malloc(100); test_malloc_shadow(p, 100, true); free(p); } // Pre-existing allocations got redzones, too. for (size_t sz = 1; sz < nPtrs; ++sz) { test_malloc_shadow(ptrs[sz], sz, true); free(ptrs[sz]); } // Test that ASAN_ACTIVATION_OPTIONS=allocator_may_return_null=1 has effect. void *p = malloc((unsigned long)-2); assert(!p); // CHECK: WARNING: AddressSanitizer failed to allocate 0xfff{{.*}} bytes ((Fn)fn)(); // CHECK: AddressSanitizer: heap-buffer-overflow // CHECK: READ of size 1 // CHECK: {{#0 .* in do_another_bad_thing}} // CHECK: is located 5 bytes to the right of 100-byte region // CHECK: in do_another_bad_thing return 0; } #else // SHARED_LIB #include #include extern "C" void do_another_bad_thing() { char *volatile p = (char *)malloc(100); printf("%hhx\n", p[105]); } #endif // SHARED_LIB // help=1 in activation flags lists only flags are are supported at activation // CHECK-HELP: Available flags for {{.*}}Sanitizer: // CHECK-HELP-NOT: handle_segv // CHECK-HELP: max_redzone // CHECK-HELP-NOT: handle_segv // unsupported activation flags produce a warning ... // CHECK-UNSUPPORTED: WARNING: found 1 unrecognized // CHECK-UNSUPPORTED: handle_segv // ... but not at verbosity=0 // CHECK-UNSUPPORTED-V0-NOT: WARNING: found {{.*}} unrecognized golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/wait4.cc0000664000175000017500000000242112405531140027433 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -DWAIT4 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT4 -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT4_RUSAGE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT4_RUSAGE -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // XFAIL: android #include #include #include int main(int argc, char **argv) { // This test passes on some versions of Android NDK and fails on other. // https://code.google.com/p/memory-sanitizer/issues/detail?id=64 // Make it fail unconditionally on Android. #ifdef __ANDROID__ return 0; #endif pid_t pid = fork(); if (pid) { // parent int x[3]; int *status = x + argc * 3; int res; #if defined(WAIT4) res = wait4(pid, status, WNOHANG, NULL); #elif defined(WAIT4_RUSAGE) struct rusage *ru = (struct rusage*)(x + argc * 3); int good_status; res = wait4(pid, &good_status, WNOHANG, ru); #endif // CHECK: stack-buffer-overflow // CHECK: {{WRITE of size .* at 0x.* thread T0}} // CHECK: {{in .*wait}} // CHECK: {{in main .*wait4.cc:}} // CHECK: is located in stack of thread T0 at offset // CHECK: {{in main}} return res == -1 ? 1 : 0; } // child return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-fork.cc0000664000175000017500000000165112567131651031155 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // RUN: rm -rf %T/coverage-fork // RUN: mkdir -p %T/coverage-fork && cd %T/coverage-fork // RUN: %env_asan_opts=coverage=1:coverage_direct=0:verbosity=1 %run %t 2>&1 | FileCheck %s // // XFAIL: android #include #include #include __attribute__((noinline)) void foo() { printf("foo\n"); } __attribute__((noinline)) void bar() { printf("bar\n"); } __attribute__((noinline)) void baz() { printf("baz\n"); } int main(int argc, char **argv) { pid_t child_pid = fork(); if (child_pid == 0) { fprintf(stderr, "Child PID: %d\n", getpid()); baz(); } else { fprintf(stderr, "Parent PID: %d\n", getpid()); foo(); bar(); } return 0; } // CHECK-DAG: Child PID: [[ChildPID:[0-9]+]] // CHECK-DAG: [[ChildPID]].sancov: 1 PCs written // CHECK-DAG: Parent PID: [[ParentPID:[0-9]+]] // CHECK-DAG: [[ParentPID]].sancov: 3 PCs written golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/dlclose-test.cc0000664000175000017500000000620612662736340031030 0ustar mwhudsonmwhudson// Regression test for // http://code.google.com/p/address-sanitizer/issues/detail?id=19 // Bug description: // 1. application dlopens foo.so // 2. asan registers all globals from foo.so // 3. application dlcloses foo.so // 4. application mmaps some memory to the location where foo.so was before // 5. application starts using this mmaped memory, but asan still thinks there // are globals. // 6. BOOM // This sublte test assumes that after a foo.so is dlclose-d // we can mmap the region of memory that has been occupied by the library. // It works on x86 Linux, but not necessary anywhere else. // REQUIRES: x86-target-arch // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O1 %s %libdl -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O2 %s %libdl -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O3 %s %libdl -o %t && %run %t 2>&1 | FileCheck %s #if !defined(SHARED_LIB) #include #include #include #include #include #include #include #if defined(__FreeBSD__) // The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before // that, it was never implemented. So just define it to zero. #undef MAP_NORESERVE #define MAP_NORESERVE 0 #endif using std::string; typedef int *(fun_t)(); int main(int argc, char *argv[]) { string path = string(argv[0]) + "-so.so"; size_t PageSize = sysconf(_SC_PAGESIZE); printf("opening %s ... \n", path.c_str()); void *lib = dlopen(path.c_str(), RTLD_NOW); if (!lib) { printf("error in dlopen(): %s\n", dlerror()); return 1; } fun_t *get = (fun_t*)dlsym(lib, "get_address_of_static_var"); if (!get) { printf("failed dlsym\n"); return 1; } int *addr = get(); assert(((size_t)addr % 32) == 0); // should be 32-byte aligned. printf("addr: %p\n", addr); addr[0] = 1; // make sure we can write there. // Now dlclose the shared library. printf("attempting to dlclose\n"); if (dlclose(lib)) { printf("failed to dlclose\n"); return 1; } // Now, the page where 'addr' is unmapped. Map it. size_t page_beg = ((size_t)addr) & ~(PageSize - 1); void *res = mmap((void*)(page_beg), PageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED | MAP_NORESERVE, -1, 0); if (res == (char*)-1L) { printf("failed to mmap\n"); return 1; } addr[1] = 2; // BOOM (if the bug is not fixed). printf("PASS\n"); // CHECK: PASS return 0; } #else // SHARED_LIB #include static int pad1; static int static_var; static int pad2; extern "C" int *get_address_of_static_var() { return &static_var; } __attribute__((constructor)) void at_dlopen() { printf("%s: I am being dlopened\n", __FILE__); } __attribute__((destructor)) void at_dlclose() { printf("%s: I am being dlclosed\n", __FILE__); } #endif // SHARED_LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/ioctl.cc0000664000175000017500000000133712567131651027536 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -g %s -o %t && %env_asan_opts=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 -g %s -o %t && %env_asan_opts=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 -g %s -o %t && %run %t // RUN: %clangxx_asan -O3 -g %s -o %t && %run %t #include #include #include #include #include int main(int argc, char **argv) { int fd = socket(AF_INET, SOCK_DGRAM, 0); int nonblock; int res = ioctl(fd, FIONBIO, &nonblock + 1); // CHECK: AddressSanitizer: stack-buffer-overflow // CHECK: READ of size 4 at // CHECK: {{#.* in main .*ioctl.cc:}}[[@LINE-3]] assert(res == 0); close(fd); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/stack-use-after-return.cc0000664000175000017500000000562212567131651032740 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t // Regression test for a CHECK failure with small stack size and large frame. // RUN: %clangxx_asan -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s // // Test that we can find UAR in a thread other than main: // RUN: %clangxx_asan -DUseThread -O2 %s -pthread -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s // // Test the max_uar_stack_size_log/min_uar_stack_size_log flag. // // RUN: %env_asan_opts=detect_stack_use_after_return=1:max_uar_stack_size_log=20:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-20 %s // RUN: %env_asan_opts=detect_stack_use_after_return=1:min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s #include #include #ifndef kSize # define kSize 1 #endif #ifndef UseThread # define UseThread 0 #endif #ifndef kStackSize # define kStackSize 0 #endif __attribute__((noinline)) char *Ident(char *x) { fprintf(stderr, "1: %p\n", x); return x; } __attribute__((noinline)) char *Func1() { char local[kSize]; return Ident(local); } __attribute__((noinline)) void Func2(char *x) { fprintf(stderr, "2: %p\n", x); *x = 1; // CHECK: WRITE of size 1 {{.*}} thread T0 // CHECK: #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-2]] // CHECK: is located in stack of thread T0 at offset // CHECK: 'local' <== Memory access at offset {{16|32}} is inside this variable // THREAD: WRITE of size 1 {{.*}} thread T{{[1-9]}} // THREAD: #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-6]] // THREAD: is located in stack of thread T{{[1-9]}} at offset // THREAD: 'local' <== Memory access at offset {{16|32}} is inside this variable // CHECK-20: T0: FakeStack created:{{.*}} stack_size_log: 20 // CHECK-24: T0: FakeStack created:{{.*}} stack_size_log: 24 } void *Thread(void *unused) { Func2(Func1()); return NULL; } int main(int argc, char **argv) { #if UseThread pthread_attr_t attr; pthread_attr_init(&attr); if (kStackSize > 0) pthread_attr_setstacksize(&attr, kStackSize); pthread_t t; pthread_create(&t, &attr, Thread, 0); pthread_attr_destroy(&attr); pthread_join(t, 0); #else Func2(Func1()); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/gc-test.cc0000664000175000017500000000350612562755664030005 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -pthread -o %t // RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 // RUN: %clangxx_asan -O3 %s -pthread -o %t // RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 // REQUIRES: stable-runtime #include #include #include #include static const int kNumThreads = 2; static const int kLeftRedzoneSize = sizeof(void *) * 4; void *Thread(void *unused) { void *fake_stack = __asan_get_current_fake_stack(); char var[15]; if (fake_stack) { fprintf(stderr, "fake stack found: %p; var: %p\n", fake_stack, var); // CHECK1: fake stack found // CHECK1: fake stack found void *beg, *end; void *real_stack = __asan_addr_is_in_fake_stack(fake_stack, &var[0], &beg, &end); assert(real_stack); assert((char*)beg <= (char*)&var[0]); assert((char*)end > (char*)&var[0]); for (int i = -kLeftRedzoneSize; i < 15; i++) { void *beg1, *end1; char *ptr = &var[0] + i; void *real_stack1 = __asan_addr_is_in_fake_stack(fake_stack, ptr, &beg1, &end1); assert(real_stack == real_stack1); assert(beg == beg1); assert(end == end1); } } else { fprintf(stderr, "no fake stack\n"); // CHECK0: no fake stack // CHECK0: no fake stack } return NULL; } int main(int argc, char **argv) { pthread_t t[kNumThreads]; for (int i = 0; i < kNumThreads; i++) pthread_create(&t[i], 0, Thread, 0); for (int i = 0; i < kNumThreads; i++) pthread_join(t[i], 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/new_array_cookie_test.cc0000664000175000017500000000133512567131651033001 0ustar mwhudsonmwhudson// REQUIRES: asan-64-bits // RUN: %clangxx_asan -O3 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE #include #include struct C { int x; ~C() { fprintf(stderr, "ZZZZZZZZ\n"); exit(1); } }; int main(int argc, char **argv) { C *buffer = new C[argc]; buffer[-2].x = 10; // CHECK: AddressSanitizer: heap-buffer-overflow // CHECK: in main {{.*}}new_array_cookie_test.cc:[[@LINE-2]] // CHECK: is located 0 bytes inside of 12-byte region // NO_COOKIE: ZZZZZZZZ delete [] buffer; } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/large_allocator_unpoisons_o0000664000175000017500000000175212567131651033626 0ustar mwhudsonmwhudson// Test that LargeAllocator unpoisons memory before releasing it to the OS. // RUN: %clangxx_asan %s -o %t // The memory is released only when the deallocated chunk leaves the quarantine, // otherwise the mmap(p, ...) call overwrites the malloc header. // RUN: %env_asan_opts=quarantine_size_mb=0 %run %t #include #include #include #include #include #ifdef __ANDROID__ #include void *my_memalign(size_t boundary, size_t size) { return memalign(boundary, size); } #else void *my_memalign(size_t boundary, size_t size) { void *p; posix_memalign(&p, boundary, size); return p; } #endif int main() { const long kPageSize = sysconf(_SC_PAGESIZE); void *p = my_memalign(kPageSize, 1024 * 1024); free(p); char *q = (char *)mmap(p, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0); assert(q == p); memset(q, 42, kPageSize); munmap(q, kPageSize); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/halt_on_error-torture.cc0000664000175000017500000000467612747574464033011 0ustar mwhudsonmwhudson// Stress test recovery mode with many threads. // // RUN: %clangxx_asan -fsanitize-recover=address -pthread %s -o %t // // RUN: rm -f 1.txt // RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 1 10 >>1.txt 2>&1 // RUN: FileCheck %s < 1.txt // RUN: [ $(grep -c 'ERROR: AddressSanitizer: use-after-poison' 1.txt) -eq 10 ] // RUN: FileCheck --check-prefix=CHECK-NO-COLLISION %s < 1.txt // // Collisions are unlikely but still possible so we need the ||. // RUN: rm -f 10.txt // RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 10 20 >>10.txt 2>&1 || true // RUN: FileCheck --check-prefix=CHECK-COLLISION %s < 10.txt || FileCheck --check-prefix=CHECK-NO-COLLISION %s < 10.txt // // Collisions are unlikely but still possible so we need the ||. // RUN: rm -f 20.txt // RUN: %env_asan_opts=halt_on_error=false %run %t 10 20 >>20.txt 2>&1 || true // RUN: FileCheck --check-prefix=CHECK-COLLISION %s < 20.txt || FileCheck --check-prefix=CHECK-NO-COLLISION %s < 20.txt #include #include #include #include #include size_t nthreads = 10; size_t niter = 10; void random_delay(unsigned *seed) { *seed = 1664525 * *seed + 1013904223; struct timespec delay = { 0, (*seed % 1000) * 1000 }; nanosleep(&delay, 0); } void *run(void *arg) { unsigned seed = (unsigned)(size_t)arg; volatile char tmp[2]; __asan_poison_memory_region(&tmp, sizeof(tmp)); for (size_t i = 0; i < niter; ++i) { random_delay(&seed); // Expect error collisions here // CHECK: ERROR: AddressSanitizer: use-after-poison volatile int idx = 0; tmp[idx] = 0; } return 0; } int main(int argc, char **argv) { if (argc != 3) { fprintf(stderr, "Syntax: %s nthreads niter\n", argv[0]); exit(1); } nthreads = (size_t)strtoul(argv[1], 0, 0); niter = (size_t)strtoul(argv[2], 0, 0); pthread_t *tids = new pthread_t[nthreads]; for (size_t i = 0; i < nthreads; ++i) { if (0 != pthread_create(&tids[i], 0, run, (void *)i)) { fprintf(stderr, "Failed to create thread\n"); exit(1); } } for (size_t i = 0; i < nthreads; ++i) { if (0 != pthread_join(tids[i], 0)) { fprintf(stderr, "Failed to join thread\n"); exit(1); } } // CHECK-COLLISION: AddressSanitizer: nested bug in the same thread, aborting // CHECK-NO-COLLISION: All threads terminated printf("All threads terminated\n"); delete [] tids; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/wait.cc0000664000175000017500000000163712571720706027373 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -DWAIT -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAITPID -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAITPID -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { pid_t pid = fork(); if (pid) { // parent int x[3]; int *status = x + argc * 3; int res; #if defined(WAIT) res = wait(status); #elif defined(WAITPID) res = waitpid(pid, status, WNOHANG); #endif // CHECK: stack-buffer-overflow // CHECK: {{WRITE of size .* at 0x.* thread T0}} // CHECK: {{in .*wait}} // CHECK: {{in main .*wait.cc:}} // CHECK: is located in stack of thread T0 at offset // CHECK: {{in main}} return res == -1 ? 1 : 0; } // child return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-fork-direct.cc0000664000175000017500000000200412567131651032416 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // RUN: rm -rf %T/coverage-fork-direct // RUN: mkdir -p %T/coverage-fork-direct && cd %T/coverage-fork-direct // RUN: (%env_asan_opts=coverage=1:coverage_direct=1:verbosity=1 %run %t; \ // RUN: %sancov rawunpack *.sancov.raw; %sancov print *.sancov) 2>&1 // // XFAIL: android #include #include #include __attribute__((noinline)) void foo() { printf("foo\n"); } __attribute__((noinline)) void bar() { printf("bar\n"); } __attribute__((noinline)) void baz() { printf("baz\n"); } int main(int argc, char **argv) { pid_t child_pid = fork(); if (child_pid == 0) { fprintf(stderr, "Child PID: %d\n", getpid()); baz(); } else { fprintf(stderr, "Parent PID: %d\n", getpid()); foo(); bar(); } return 0; } // CHECK-DAG: Child PID: [[ChildPID:[0-9]+]] // CHECK-DAG: Parent PID: [[ParentPID:[0-9]+]] // CHECK-DAG: read 3 PCs from {{.*}}.[[ParentPID]].sancov // CHECK-DAG: read 1 PCs from {{.*}}.[[ChildPID]].sancov golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/readv.cc0000664000175000017500000000125712334674662027534 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %run %t // RUN: %clangxx_asan -O0 %s -DPOSITIVE -o %t && not %run %t 2>&1 | FileCheck %s // Test the readv() interceptor. #include #include #include #include #include #include #include int main() { char buf[2011]; struct iovec iov[2]; #ifdef POSITIVE char * volatile buf_ = buf; iov[0].iov_base = buf_ - 1; #else iov[0].iov_base = buf + 1; #endif iov[0].iov_len = 5; iov[1].iov_base = buf + 10; iov[1].iov_len = 2000; int fd = open("/etc/hosts", O_RDONLY); assert(fd > 0); readv(fd, iov, 2); // CHECK: WRITE of size 5 at close(fd); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/strerror_r_test.cc0000664000175000017500000000041112334674662031664 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %run %t // Regression test for PR17138. #include #include #include int main() { char buf[1024]; char *res = (char *)strerror_r(300, buf, sizeof(buf)); printf("%p\n", res); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/wait3.cc0000664000175000017500000000205212571720706027446 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -DWAIT3 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT3 -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT3_RUSAGE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -DWAIT3_RUSAGE -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s // UNSUPPORTED: android #include #include #include int main(int argc, char **argv) { pid_t pid = fork(); if (pid) { // parent int x[3]; int *status = x + argc * 3; int res; #if defined(WAIT3) res = wait3(status, WNOHANG, NULL); #elif defined(WAIT3_RUSAGE) struct rusage *ru = (struct rusage*)(x + argc * 3); int good_status; res = wait3(&good_status, WNOHANG, ru); #endif // CHECK: stack-buffer-overflow // CHECK: {{WRITE of size .* at 0x.* thread T0}} // CHECK: {{in .*wait}} // CHECK: {{in main .*wait3.cc:}} // CHECK: is located in stack of thread T0 at offset // CHECK: {{in main}} return res == -1 ? 1 : 0; } // child return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-module-unloaded.cc0000664000175000017500000000360112567131651033267 0ustar mwhudsonmwhudson// Check that unloading a module doesn't break coverage dumping for remaining // modules. // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib1 -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib2 -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func %s %libdl -o %t // RUN: mkdir -p %T/coverage-module-unloaded && cd %T/coverage-module-unloaded // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s // RUN: rm -r %T/coverage-module-unloaded // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android #include #include #include #include #ifdef SHARED extern "C" { void bar() { printf("bar\n"); } } #else int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); assert(argc > 2); void *handle1 = dlopen(argv[1], RTLD_LAZY); // %dynamiclib1 assert(handle1); void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); bar1(); void *handle2 = dlopen(argv[2], RTLD_LAZY); // %dynamiclib2 assert(handle2); void (*bar2)() = (void (*)())dlsym(handle2, "bar"); assert(bar2); bar2(); // It matters whether the unloaded module has a higher or lower address range // than the remaining one. Make sure to test both cases. if (argc < 2) dlclose(bar1 < bar2 ? handle1 : handle2); else dlclose(bar1 < bar2 ? handle2 : handle1); return 0; } #endif // CHECK: PID: [[PID:[0-9]+]] // CHECK: [[PID]].sancov: 1 PCs written // CHECK: coverage-module-unloaded{{.*}}1.[[PID]] // CHECK: coverage-module-unloaded{{.*}}2.[[PID]] // Even though we've unloaded one of the libs we still dump the coverage file // for that lib (although the data will be inaccurate, if at all useful) ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/interception-in-shared-lib-test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/interception-in-shared-lib-0000664000175000017500000000137012506760317033231 0ustar mwhudsonmwhudson// Check that memset() call from a shared library gets intercepted. // RUN: %clangxx_asan -O0 %s -DSHARED_LIB \ // RUN: -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -O0 %s -o %t %ld_flags_rpath_exe && \ // RUN: not %run %t 2>&1 | FileCheck %s #include #include #if defined(SHARED_LIB) extern "C" void my_memset(void *p, size_t sz) { memset(p, 0, sz); } #else extern "C" void my_memset(void *p, size_t sz); int main(int argc, char *argv[]) { char buf[10]; my_memset(buf, 11); // CHECK: {{.*ERROR: AddressSanitizer: stack-buffer-overflow}} // CHECK: {{WRITE of size 11 at 0x.* thread T0}} // CHECK: {{0x.* in my_memset .*interception-in-shared-lib-test.cc:}}[[@LINE-10]] return 0; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/glob_test_root/0000775000175000017500000000000013040224621031121 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/glob_test_root/ab0000664000175000017500000000000012130776361031430 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/glob_test_root/ba0000664000175000017500000000000012130776361031430 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/glob_test_root/aa0000664000175000017500000000000012130776361031427 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/dump_instruction_bytes.cc0000664000175000017500000000121012662755715033237 0ustar mwhudsonmwhudson// Check that ASan prints the faulting instruction bytes on // dump_instruction_bytes=1 // RUN: %clangxx_asan %s -o %t // RUN: %env_asan_opts=dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP // // REQUIRES: x86-target-arch int main() { #if defined(__x86_64__) asm("movq $0, %rax"); asm("movl $0xcafebabe, 0x0(%rax)"); #elif defined(i386) asm("movl $0, %eax"); asm("movl $0xcafebabe, 0x0(%eax)"); #endif // CHECK-DUMP: First 16 instruction bytes at pc: c7 00 be ba fe ca // CHECK-NODUMP-NOT: First 16 instruction bytes return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-maybe-open-file.cc0000664000175000017500000000173512562755664033203 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // RUN: rm -rf %T/coverage-maybe-open-file // RUN: mkdir -p %T/coverage-maybe-open-file && cd %T/coverage-maybe-open-file // RUN: %env_asan_opts=coverage=1 %run %t | FileCheck %s --check-prefix=CHECK-success // RUN: %env_asan_opts=coverage=0 %run %t | FileCheck %s --check-prefix=CHECK-fail // RUN: [ "$(cat test.sancov.packed)" == "test" ] // RUN: cd .. && rm -rf %T/coverage-maybe-open-file #include #include #include #include // FIXME: the code below might not work on Windows. int main(int argc, char **argv) { int fd = __sanitizer_maybe_open_cov_file("test"); if (fd > 0) { printf("SUCCESS\n"); const char s[] = "test\n"; write(fd, s, strlen(s)); close(fd); } else { printf("FAIL\n"); } } // CHECK-success: SUCCESS // CHECK-fail: FAIL golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage.cc0000664000175000017500000000631212567131651030215 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -fsanitize-coverage=func %s %ld_flags_rpath_exe -o %t // RUN: rm -rf %T/coverage && mkdir -p %T/coverage && cd %T/coverage // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main // RUN: %sancov print `ls coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-foo // RUN: %sancov print `ls coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t bar 2>&1 | FileCheck %s --check-prefix=CHECK-bar // RUN: %sancov print `ls *coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t foo bar 2>&1 | FileCheck %s --check-prefix=CHECK-foo-bar // RUN: %sancov print `ls *coverage.*sancov | grep -v '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: %sancov print `ls *coverage.*sancov | grep '.so'` 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 // RUN: %sancov merge `ls *coverage.*sancov | grep -v '.so'` > merged-cov // RUN: %sancov print merged-cov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV2 // RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t foo bar 4 2>&1 | FileCheck %s --check-prefix=CHECK-report // RUN: %env_asan_opts=coverage=1:verbosity=1 not %run %t foo bar 4 5 2>&1 | FileCheck %s --check-prefix=CHECK-segv // RUN: rm -r %T/coverage // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android #include #include #include #include #include #ifdef SHARED void bar() { printf("bar\n"); } #else __attribute__((noinline)) void foo() { printf("foo\n"); } extern void bar(); int G[4]; int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "foo")) { uintptr_t old_coverage = __sanitizer_get_total_unique_coverage(); foo(); uintptr_t new_coverage = __sanitizer_get_total_unique_coverage(); assert(new_coverage > old_coverage); } if (!strcmp(argv[i], "bar")) bar(); } if (argc == 5) { static volatile char *zero = 0; *zero = 0; // SEGV if argc == 5. } return G[argc]; // Buffer overflow if argc >= 4. } #endif // CHECK-main: PID: [[PID:[0-9]+]] // CHECK-main: [[PID]].sancov: 1 PCs written // CHECK-main-NOT: .so.[[PID]] // // CHECK-foo: PID: [[PID:[0-9]+]] // CHECK-foo: [[PID]].sancov: 2 PCs written // CHECK-foo-NOT: .so.[[PID]] // // CHECK-bar: PID: [[PID:[0-9]+]] // CHECK-bar: .so.[[PID]].sancov: 1 PCs written // CHECK-bar: [[PID]].sancov: 1 PCs written // // CHECK-foo-bar: PID: [[PID:[0-9]+]] // CHECK-foo-bar: so.[[PID]].sancov: 1 PCs written // CHECK-foo-bar: [[PID]].sancov: 2 PCs written // // CHECK-report: AddressSanitizer: global-buffer-overflow // CHECK-report: PCs written // // CHECK-segv: AddressSanitizer: SEGV // CHECK-segv: PCs written // // CHECK-SANCOV1: 1 PCs total // CHECK-SANCOV2: 2 PCs total golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/glob.cc0000664000175000017500000000155712433502627027350 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // RUN: %clangxx_asan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi #include #include #include #include #include #include int main(int argc, char *argv[]) { std::string path = argv[1]; std::string pattern = path + "/glob_test_root/*a"; printf("pattern: %s\n", pattern.c_str()); glob_t globbuf; int res = glob(pattern.c_str(), 0, 0, &globbuf); printf("%d %s\n", errno, strerror(errno)); assert(res == 0); assert(globbuf.gl_pathc == 2); printf("%zu\n", strlen(globbuf.gl_pathv[0])); printf("%zu\n", strlen(globbuf.gl_pathv[1])); globfree(&globbuf); printf("PASS\n"); // CHECK: PASS return 0; } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/asan-symbolize-sanity-test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/asan-symbolize-sanity-test.0000664000175000017500000000336512760335214033334 0ustar mwhudsonmwhudson// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // // Check that asan_symbolize.py script works (for binaries, ASan RTL and // shared object files. // RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -o %t // RUN: %env_asan_opts=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s // XFAIL: arm-linux-gnueabi // XFAIL: armv7l-unknown-linux-gnueabihf // UNSUPPORTED: x86_64h-darwin,x86_64-darwin #if !defined(SHARED_LIB) #include #include #include #include using std::string; typedef void (fun_t)(int*, int); int main(int argc, char *argv[]) { string path = string(argv[0]) + "-so.so"; printf("opening %s ... \n", path.c_str()); void *lib = dlopen(path.c_str(), RTLD_NOW); if (!lib) { printf("error in dlopen(): %s\n", dlerror()); return 1; } fun_t *inc2 = (fun_t*)dlsym(lib, "inc2"); if (!inc2) return 1; printf("ok\n"); int *array = (int*)malloc(40); inc2(array, 1); inc2(array, -1); // BOOM // CHECK: ERROR: AddressSanitizer: heap-buffer-overflow // CHECK: READ of size 4 at 0x{{.*}} // CHECK: #0 {{.*}} in inc2 {{.*}}asan-symbolize-sanity-test.cc:[[@LINE+21]] // CHECK: #1 {{.*}} in main {{.*}}asan-symbolize-sanity-test.cc:[[@LINE-4]] // CHECK: allocated by thread T{{.*}} here: // CHECK: #{{.*}} in {{(wrap_|__interceptor_)?}}malloc // CHECK: #{{.*}} in main {{.*}}asan-symbolize-sanity-test.cc:[[@LINE-9]] return 0; } #else // SHARED_LIBS #include #include int pad[10]; int GLOB[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; extern "C" void inc(int index) { GLOB[index]++; } extern "C" void inc2(int *a, int index) { a[index]++; } #endif // SHARED_LIBS ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/log_path_fork_test.cc.disabledgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/log_path_fork_test.cc.disab0000664000175000017500000000114612567131651033360 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %t // RUN: rm -f %t.log.* // Set verbosity to 1 so that the log files are opened prior to fork(). // RUN: %env_asan_opts=log_path='"%t.log"':verbosity=1 not %run %t 2> %t.out // RUN: for f in %t.log.* ; do FileCheck %s < $f; done // RUN: [ `ls %t.log.* | wc -l` == 2 ] #include #include #include int main(int argc, char **argv) { void *x = malloc(10); free(x); if (fork() == -1) return 1; // There are two processes at this point, thus there should be two distinct // error logs. free(x); return 0; } // CHECK: ERROR: AddressSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/deep_thread_stack.cc0000664000175000017500000000330212562747660032057 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: stable-runtime #include int *x; void *AllocThread(void *arg) { x = new int; *x = 42; return NULL; } void *FreeThread(void *arg) { delete x; return NULL; } void *AccessThread(void *arg) { *x = 43; // BOOM return NULL; } typedef void* (*callback_type)(void* arg); void *RunnerThread(void *function) { pthread_t thread; pthread_create(&thread, NULL, (callback_type)function, NULL); pthread_join(thread, NULL); return NULL; } void RunThread(callback_type function) { pthread_t runner; pthread_create(&runner, NULL, RunnerThread, (void*)function); pthread_join(runner, NULL); } int main(int argc, char *argv[]) { RunThread(AllocThread); RunThread(FreeThread); RunThread(AccessThread); return (x != 0); } // CHECK: AddressSanitizer: heap-use-after-free // CHECK: WRITE of size 4 at 0x{{.*}} thread T[[ACCESS_THREAD:[0-9]+]] // CHECK: freed by thread T[[FREE_THREAD:[0-9]+]] here: // CHECK: previously allocated by thread T[[ALLOC_THREAD:[0-9]+]] here: // CHECK: Thread T[[ACCESS_THREAD]] created by T[[ACCESS_RUNNER:[0-9]+]] here: // CHECK: Thread T[[ACCESS_RUNNER]] created by T0 here: // CHECK: Thread T[[FREE_THREAD]] created by T[[FREE_RUNNER:[0-9]+]] here: // CHECK: Thread T[[FREE_RUNNER]] created by T0 here: // CHECK: Thread T[[ALLOC_THREAD]] created by T[[ALLOC_RUNNER:[0-9]+]] here: // CHECK: Thread T[[ALLOC_RUNNER]] created by T0 here: golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/asan-symbolize-bad-path.cc0000664000175000017500000000030112603066623033022 0ustar mwhudsonmwhudson// Test that asan_symbolize does not hang when provided with an non-existing // path. // RUN: echo '#0 0xabcdabcd (%T/bad/path+0x1234)' | %asan_symbolize | FileCheck %s // CHECK: #0 0xabcdabcd golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/handle_abort_on_error.cc0000664000175000017500000000045012764122605032744 0ustar mwhudsonmwhudson// Regression test: this used to abort() in SIGABRT handler in an infinite loop. // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=handle_abort=1,abort_on_error=1 not --crash %run %t 2>&1 | FileCheck %s #include int main() { abort(); // CHECK: ERROR: AddressSanitizer: ABRT } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-direct-activation.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/coverage-direct-activation.0000664000175000017500000000406512567131651033321 0ustar mwhudsonmwhudson// Test for direct coverage writing enabled at activation time. // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx -c -DSO_DIR=\"%T\" %s -o %t.o // RUN: %clangxx_asan -fsanitize-coverage=func %t.o %libdl -o %t // RUN: rm -rf %T/coverage-direct-activation // RUN: mkdir -p %T/coverage-direct-activation/normal // RUN: %env_asan_opts=coverage=1,coverage_direct=0,coverage_dir=%T/coverage-direct-activation/normal:verbosity=1 %run %t %dynamiclib // RUN: %sancov print %T/coverage-direct-activation/normal/*.sancov >%T/coverage-direct-activation/normal/out.txt // RUN: mkdir -p %T/coverage-direct-activation/direct // RUN: %env_asan_opts=start_deactivated=1,coverage_direct=1,verbosity=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=coverage=1,coverage_dir=%T/coverage-direct-activation/direct %run %t %dynamiclib // RUN: cd %T/coverage-direct-activation/direct // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // Test start_deactivated=1,coverage=1 in ASAN_OPTIONS. // RUN: diff -u coverage-direct-activation/normal/out.txt coverage-direct-activation/direct/out.txt // RUN: mkdir -p %T/coverage-direct-activation/direct2 // RUN: %env_asan_opts=start_deactivated=1,coverage=1,coverage_direct=1,verbosity=1 \ // RUN: ASAN_ACTIVATION_OPTIONS=coverage_dir=%T/coverage-direct-activation/direct2 %run %t %dynamiclib // RUN: cd %T/coverage-direct-activation/direct2 // RUN: %sancov rawunpack *.sancov.raw // RUN: %sancov print *.sancov >out.txt // RUN: cd ../.. // RUN: diff -u coverage-direct-activation/normal/out.txt coverage-direct-activation/direct2/out.txt // XFAIL: android #include #include #include #include #ifdef SHARED extern "C" { void bar() { printf("bar\n"); } } #else int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); assert(argc > 1); void *handle1 = dlopen(argv[1], RTLD_LAZY); // %dynamiclib assert(handle1); void (*bar1)() = (void (*)())dlsym(handle1, "bar"); assert(bar1); bar1(); return 0; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/shared-lib-test.cc0000664000175000017500000000310712444412751031405 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O0 %s %libdl -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O1 %s %libdl -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O2 %s %libdl -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_asan -O3 %s %libdl -o %t && not %run %t 2>&1 | FileCheck %s // XFAIL: arm-linux-gnueabi #if !defined(SHARED_LIB) #include #include #include #include using std::string; typedef void (fun_t)(int x); int main(int argc, char *argv[]) { string path = string(argv[0]) + "-so.so"; printf("opening %s ... \n", path.c_str()); void *lib = dlopen(path.c_str(), RTLD_NOW); if (!lib) { printf("error in dlopen(): %s\n", dlerror()); return 1; } fun_t *inc = (fun_t*)dlsym(lib, "inc"); if (!inc) return 1; printf("ok\n"); inc(1); inc(-1); // BOOM // CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}} // CHECK: {{READ of size 4 at 0x.* thread T0}} // CHECK: {{ #0 0x.*}} // CHECK: {{ #1 0x.* in main .*shared-lib-test.cc:}}[[@LINE-4]] return 0; } #else // SHARED_LIB #include #include int pad[10]; int GLOB[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; extern "C" void inc(int index) { GLOB[index]++; } extern "C" void inc2(int *a, int index) { a[index]++; } #endif // SHARED_LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/freopen.cc0000664000175000017500000000045512571045623030060 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && %run %t // This fails on i386 Linux due to a glibc versioned symbols mixup. // REQUIRES: asan-64-bits #include #include int main() { FILE *fp = fopen("/dev/null", "w"); assert(fp); freopen(NULL, "a", fp); fclose(fp); return 0; } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/new_array_cookie_uaf_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/new_array_cookie_uaf_test.c0000664000175000017500000000213712567131651033472 0ustar mwhudsonmwhudson// REQUIRES: asan-64-bits // RUN: %clangxx_asan -O3 %s -o %t // RUN: %env_asan_opts=poison_array_cookie=1 not %run %t 2>&1 | FileCheck %s --check-prefix=COOKIE // RUN: %env_asan_opts=poison_array_cookie=0 not %run %t 2>&1 | FileCheck %s --check-prefix=NO_COOKIE #include #include #include int dtor_counter; struct C { int x; ~C() { dtor_counter++; fprintf(stderr, "DTOR %d\n", dtor_counter); } }; __attribute__((noinline)) void Delete(C *c) { delete[] c; } __attribute__((no_sanitize_address)) void Write42ToCookie(C *c) { long *p = reinterpret_cast(c); p[-1] = 42; } int main(int argc, char **argv) { C *buffer = new C[argc]; delete [] buffer; Write42ToCookie(buffer); delete [] buffer; // COOKIE: DTOR 1 // COOKIE-NOT: DTOR 2 // COOKIE: AddressSanitizer: loaded array cookie from free-d memory // COOKIE: AddressSanitizer: attempting double-free // NO_COOKIE: DTOR 1 // NO_COOKIE: DTOR 43 // NO_COOKIE-NOT: DTOR 44 // NO_COOKIE-NOT: AddressSanitizer: loaded array cookie from free-d memory // NO_COOKIE: AddressSanitizer: attempting double-free } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/halt_on_error_suppress_equal_pcs.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/halt_on_error_suppress_equa0000664000175000017500000000366412747574464033676 0ustar mwhudsonmwhudson// Test reports dedupication for recovery mode. // // RUN: %clang_asan -fsanitize-recover=address %s -o %t // // Check for reports dedupication. // RUN: %env_asan_opts=halt_on_error=false %run %t 2>&1 | FileCheck %s // // Check that we die after reaching different reports number threshold. // RUN: rm -f %t1.log // RUN: %env_asan_opts=halt_on_error=false not %run %t 1 >> %t1.log 2>&1 // RUN: [ $(grep -c 'ERROR: AddressSanitizer: stack-buffer-overflow' %t1.log) -eq 25 ] // // Check suppress_equal_pcs=true behavior is equal to default one. // RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=true %run %t 2>&1 | FileCheck %s // // Check suppress_equal_pcs=false behavior isn't equal to default one. // RUN: rm -f %t2.log // RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t >> %t2.log 2>&1 // RUN: [ $(grep -c 'ERROR: AddressSanitizer: stack-buffer-overflow' %t2.log) -eq 30 ] #define ACCESS_ARRAY_FIVE_ELEMENTS(array, i) \ array[i] = i; \ array[i + 1] = i + 1; \ array[i + 2] = i + 2; \ array[i + 3] = i + 3; \ array[i + 4] = i + 4; \ volatile int ten = 10; unsigned kNumIterations = 10; int main(int argc, char **argv) { char a[10]; char b[10]; if (argc == 1) { for (int i = 0; i < kNumIterations; ++i) { // CHECK: READ of size 1 volatile int res = a[ten + i]; // CHECK: WRITE of size 1 a[i + ten] = res + 3; // CHECK: READ of size 1 res = a[ten + i]; // CHECK-NOT: ERROR } } else { for (int i = 0; i < kNumIterations; ++i) { ACCESS_ARRAY_FIVE_ELEMENTS(a, ten); ACCESS_ARRAY_FIVE_ELEMENTS(a, ten + 5); ACCESS_ARRAY_FIVE_ELEMENTS(a, ten + 10); ACCESS_ARRAY_FIVE_ELEMENTS(b, ten); ACCESS_ARRAY_FIVE_ELEMENTS(b, ten + 5); ACCESS_ARRAY_FIVE_ELEMENTS(b, ten + 10); } } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/tsd_dtor_leak.cc0000664000175000017500000000211312567131651031233 0ustar mwhudsonmwhudson// Regression test for a leak in tsd: // https://code.google.com/p/address-sanitizer/issues/detail?id=233 // RUN: %clangxx_asan -O1 %s -pthread -o %t // RUN: %env_asan_opts=quarantine_size_mb=0 %run %t #include #include #include #include #include static pthread_key_t tsd_key; void *Thread(void *) { pthread_setspecific(tsd_key, malloc(10)); return 0; } static volatile void *v; void Dtor(void *tsd) { v = malloc(10000); free(tsd); free((void*)v); // The bug was that this was leaking. } int main() { assert(0 == pthread_key_create(&tsd_key, Dtor)); pthread_t t; for (int i = 0; i < 3; i++) { pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); } size_t old_heap_size = __sanitizer_get_heap_size(); for (int i = 0; i < 10; i++) { pthread_create(&t, 0, Thread, 0); pthread_join(t, 0); size_t new_heap_size = __sanitizer_get_heap_size(); fprintf(stderr, "heap size: new: %zd old: %zd\n", new_heap_size, old_heap_size); assert(old_heap_size == new_heap_size); } } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Posix/free_hook_realloc.cc0000664000175000017500000000132712562747660032075 0ustar mwhudsonmwhudson// Check that free hook doesn't conflict with Realloc. // RUN: %clangxx_asan -O2 %s -o %t // RUN: %run %t 2>&1 | FileCheck %s #include #include #include static void *glob_ptr; extern "C" { void __sanitizer_free_hook(const volatile void *ptr) { if (ptr == glob_ptr) { *(int*)ptr = 0; write(1, "FreeHook\n", sizeof("FreeHook\n")); } } } int main() { int *x = (int*)malloc(100); x[0] = 42; glob_ptr = x; int *y = (int*)realloc(x, 200); // Verify that free hook was called and didn't spoil the memory. if (y[0] != 42) { _exit(1); } write(1, "Passed\n", sizeof("Passed\n")); free(y); // CHECK: FreeHook // CHECK: Passed return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/printf-4.c0000664000175000017500000000141712670631644026623 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: sprintf is not intercepted on Windows yet. // XFAIL: win32 #include int main() { volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile char buf[2]; fputs("before sprintf\n", stderr); sprintf((char *)buf, "%c %d %.3f %s\n", c, x, f, s); fputs("after sprintf", stderr); fputs((const char *)buf, stderr); return 0; // Check that size of output buffer is sanitized. // CHECK-ON: before sprintf // CHECK-ON-NOT: after sprintf // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/lsan_annotations.cc0000664000175000017500000000052512412507777030677 0ustar mwhudsonmwhudson// Check that LSan annotations work fine. // RUN: %clangxx_asan -O0 %s -o %t && %run %t // RUN: %clangxx_asan -O3 %s -o %t && %run %t #include #include int main() { int *x = new int; __lsan_ignore_object(x); { __lsan::ScopedDisabler disabler; double *y = new double; } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strip_path_prefix.c0000664000175000017500000000060212563423744030706 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=strip_path_prefix='"%S/"' not %run %t 2>&1 | FileCheck %s #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // Check that paths in error report don't start with slash. // CHECK: heap-use-after-free // CHECK: #0 0x{{.*}} in main {{.*}}strip_path_prefix.c:[[@LINE-3]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strspn_strict.c0000664000175000017500000000127412562755664030113 0ustar mwhudsonmwhudson// Test strict_str`ing_checks option in strspn function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char **argv) { size_t size = 100; char fill = 'o'; char *s1 = (char*)malloc(size); char *s2 = (char*)malloc(2); memset(s1, fill, size); s1[0] = s2[0] = 'z'; s2[1] = '\0'; size_t r = strspn(s1, s2); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == 1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/stack-frame-demangle.cc0000664000175000017500000000100612330266131031250 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s #include namespace XXX { struct YYY { static int ZZZ(int x) { char array[10]; memset(array, 0, 10); return array[x]; // BOOOM // CHECK: ERROR: AddressSanitizer: stack-buffer-overflow // CHECK: READ of size 1 at // CHECK: is located in stack of thread T0 at offset // CHECK: XXX::YYY::ZZZ } }; } // namespace XXX int main(int argc, char **argv) { int res = XXX::YYY::ZZZ(argc + 10); return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-dtor-order.cc0000664000175000017500000000131612742000616032367 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s #include struct IntHolder { explicit IntHolder(int *val = 0) : val_(val) { } ~IntHolder() { printf("Value: %d\n", *val_); // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in IntHolder::~IntHolder{{.*}}.cc:[[@LINE-2]] } void set(int *val) { val_ = val; } int *get() { return val_; } int *val_; }; int main(int argc, char *argv[]) { // It is incorrect to use "x" int IntHolder destructor, because "x" is // "destroyed" earlier as it's declared later. IntHolder holder; int x = argc; holder.set(&x); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/initialization-nobug.cc0000664000175000017500000000301612562755664031470 0ustar mwhudsonmwhudson// A collection of various initializers which shouldn't trip up initialization // order checking. If successful, this will just return 0. // RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-nobug-extra.cc -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-nobug-extra.cc -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-nobug-extra.cc -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-nobug-extra.cc -o %t // RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1 // Simple access: // Make sure that accessing a global in the same TU is safe bool condition = true; int initializeSameTU() { return condition ? 0x2a : 052; } int sameTU = initializeSameTU(); // Linker initialized: // Check that access to linker initialized globals originating from a different // TU's initializer is safe. int A = (1 << 1) + (1 << 3) + (1 << 5), B; int getAB() { return A * B; } // Function local statics: // Check that access to function local statics originating from a different // TU's initializer is safe. int countCalls() { static int calls; return ++calls; } // Trivial constructor, non-trivial destructor. struct StructWithDtor { ~StructWithDtor() { } int value; }; StructWithDtor struct_with_dtor; int getStructWithDtorValue() { return struct_with_dtor.value; } int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-and-lsan.cc0000664000175000017500000000105312562755664030616 0ustar mwhudsonmwhudson// Make sure coverage is dumped even if there are reported leaks. // // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // // RUN: rm -rf %T/coverage-and-lsan // // RUN: mkdir -p %T/coverage-and-lsan/normal // RUN: %env_asan_opts=coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s // RUN: %sancov print %T/coverage-and-lsan/*.sancov 2>&1 // // REQUIRES: leak-detection int *g = new int; int main(int argc, char **argv) { g = 0; return 0; } // CHECK: LeakSanitizer: detected memory leaks // CHECK: CovDump: golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strstr-2.c0000664000175000017500000000132412670450761026654 0ustar mwhudsonmwhudson// Test needle overflow in strstr function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strstr asan option // Disable other interceptors because strlen may be called inside strstr // RUN: %env_asan_opts=intercept_strstr=false:replace_str=false:intercept_strlen=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { char *r = 0; char s1[] = "ab"; char s2[4] = "cab"; __asan_poison_memory_region ((char *)&s2[2], 2); r = strstr(s1, s2); // CHECK:'s2' <== Memory access at offset {{[0-9]+}} partially overflows this variable assert(r == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-inlined.cc0000664000175000017500000000162313001530177031730 0ustar mwhudsonmwhudson// Test with "-O2" only to make sure inlining (leading to use-after-scope) // happens. "always_inline" is not enough, as Clang doesn't emit // llvm.lifetime intrinsics at -O0. // // RUN: %clangxx_asan -O2 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s int *arr; __attribute__((always_inline)) void inlined(int arg) { int x[5]; for (int i = 0; i < arg; i++) x[i] = i; arr = x; } int main(int argc, char *argv[]) { inlined(argc); return arr[argc - 1]; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: READ of size 4 at 0x{{.*}} thread T0 // CHECK: #0 0x{{.*}} in main // CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]] // CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset // CHECK: [[OFFSET:[^ ]*]] in frame // CHECK: main // CHECK: {{\[}}[[OFFSET]], {{.*}}) 'x.i:[[@LINE-15]]' } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/max_redzone.cc0000664000175000017500000000151012562755664027641 0ustar mwhudsonmwhudson// Test max_redzone runtime option. // RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=max_redzone=16 %run %t 0 2>&1 // RUN: %clangxx_asan -O0 %s -o %t && %run %t 1 2>&1 // RUN: %clangxx_asan -O3 %s -o %t && %env_asan_opts=max_redzone=16 %run %t 0 2>&1 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 1 2>&1 #include #include #include #include int main(int argc, char **argv) { if (argc < 2) return 1; bool large_redzone = atoi(argv[1]); size_t before = __sanitizer_get_heap_size(); void *pp[10000]; for (int i = 0; i < 10000; ++i) pp[i] = malloc(4096 - 64); size_t after = __sanitizer_get_heap_size(); for (int i = 0; i < 10000; ++i) free(pp[i]); size_t diff = after - before; return !(large_redzone ? diff > 46000000 : diff < 46000000); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/0000775000175000017500000000000013040224621026216 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/objc-odr.mm0000664000175000017500000000105712700500015030247 0ustar mwhudsonmwhudson// Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=360. // RUN: %clang_asan %s -o %t -framework Foundation // RUN: %run %t 2>&1 | FileCheck %s #import void f() { int y = 7; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ dispatch_sync(dispatch_get_main_queue(), ^{ printf("num = %d\n", y); }); }); } int main() { fprintf(stderr,"Hello world"); } // CHECK-NOT: AddressSanitizer: odr-violation // CHECK: Hello world golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/atos-symbolizer.cc0000664000175000017500000000152712715134211031700 0ustar mwhudsonmwhudson// Check that the `atos` symbolizer works. // RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s #include #include int main(int argc, char **argv) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); int res = x[argc]; free(x); free(x + argc - 1); // BOOM // CHECK: Using atos at user-specified path: // CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0 // CHECK: #0 0x{{.*}} in {{.*}}free // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cc:[[@LINE-4]] // CHECK: freed by thread T0 here: // CHECK: #0 0x{{.*}} in {{.*}}free // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cc:[[@LINE-8]] // CHECK: allocated by thread T0 here: // CHECK: atos-symbolizer.cc:[[@LINE-13]] return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/linked-only.cc0000664000175000017500000000142112460520417030757 0ustar mwhudsonmwhudson// Main executable is uninstrumented, but linked to ASan runtime. // Regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=357. // RUN: %clangxx -g -O0 %s -c -o %t.o // RUN: %clangxx_asan -g -O0 %t.o -o %t // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include "sanitizer/asan_interface.h" void test_shadow(char *p, size_t size) { fprintf(stderr, "p = %p\n", p); char *q = (char *)__asan_region_is_poisoned(p, size); fprintf(stderr, "=%zd=\n", q ? q - p : -1); } int main(int argc, char *argv[]) { char *p = (char *)malloc(10000); test_shadow(p, 100); free(p); // CHECK: =-1= test_shadow((char *)&main, 1); // CHECK: =-1= test_shadow((char *)&p, 1); // CHECK: =-1= return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/segv_read_write.c0000664000175000017500000000176612710446363031561 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE // REQUIRES: x86-target-arch #include static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; } __attribute__((noinline)) void Write(int *ptr) { *ptr = 0; } int main(int argc, char **argv) { // Writes to shadow are detected as reads from shadow gap (because of how the // shadow mapping works). This is kinda hard to fix. Test a random address in // the application part of the address space. void *volatile p = mmap(nullptr, 4096, PROT_READ, MAP_PRIVATE | MAP_ANON, 0, 0); munmap(p, 4096); if (argc == 1) Read((int *)p); else Write((int *)p); } // READ: AddressSanitizer: SEGV on unknown address // READ: The signal is caused by a READ memory access. // WRITE: AddressSanitizer: SEGV on unknown address // WRITE: The signal is caused by a WRITE memory access. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/abort_on_error.cc0000664000175000017500000000111312661162470031550 0ustar mwhudsonmwhudson// Check that with empty ASAN_OPTIONS, ASan reports on OS X actually crash // the process (abort_on_error=1). See also Linux/abort_on_error.cc. // RUN: %clangxx_asan %s -o %t // Intentionally don't inherit the default ASAN_OPTIONS. // RUN: env ASAN_OPTIONS="" not --crash %run %t 2>&1 | FileCheck %s // When we use lit's default ASAN_OPTIONS, we shouldn't crash. // RUN: not %run %t 2>&1 | FileCheck %s #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/dladdr-demangling.cc0000664000175000017500000000222412715134211032065 0ustar mwhudsonmwhudson// In a non-forking sandbox, we fallback to dladdr(). Test that we provide // properly demangled C++ names in that case. // RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=verbosity=2 not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-DLADDR #include class MyClass { public: int my_function(int n) { char *x = (char*)malloc(n * sizeof(char)); free(x); return x[5]; // CHECK-DLADDR: Using dladdr symbolizer // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK-DLADDR: failed to fork // CHECK: {{ #0 0x.* in MyClass::my_function\(int\)}} // CHECK: {{freed by thread T0 here:}} // CHECK: {{ #0 0x.* in wrap_free}} // CHECK: {{ #1 0x.* in MyClass::my_function\(int\)}} // CHECK: {{previously allocated by thread T0 here:}} // CHECK: {{ #0 0x.* in wrap_malloc}} // CHECK: {{ #1 0x.* in MyClass::my_function\(int\)}} } }; int main() { MyClass o; return o.my_function(10); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/sandbox-symbolizer.cc0000664000175000017500000000311012537634376032401 0ustar mwhudsonmwhudson// In a non-forking sandbox, we can't spawn an external symbolizer, but dladdr() // should still work and provide function names. No line numbers though. // Second, `atos` symbolizer can't inspect a process that has an inaccessible // task port, in which case we should again fallback to dladdr gracefully. // RUN: %clangxx_asan -O0 %s -o %t // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s // RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s // RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s // RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s #include int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main}} // CHECK: {{freed by thread T0 here:}} // CHECK: {{ #0 0x.* in wrap_free}} // CHECK: {{ #1 0x.* in main}} // CHECK: {{previously allocated by thread T0 here:}} // CHECK: {{ #0 0x.* in wrap_malloc}} // CHECK: {{ #1 0x.* in main}} } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/unset-insert-libraries-on-exec.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/unset-insert-libraries-on-0000664000175000017500000000152712537634376033275 0ustar mwhudsonmwhudson// Make sure ASan removes the runtime library from DYLD_INSERT_LIBRARIES before // executing other programs. // RUN: %clangxx_asan %s -o %t // RUN: %clangxx %p/../Helpers/echo-env.cc -o %T/echo-env // RUN: %clangxx -DSHARED_LIB %s \ // RUN: -dynamiclib -o %t-darwin-dummy-shared-lib-so.dylib // Make sure DYLD_INSERT_LIBRARIES doesn't contain the runtime library before // execl(). // RUN: %run %t %T/echo-env >/dev/null 2>&1 // RUN: env DYLD_INSERT_LIBRARIES=%t-darwin-dummy-shared-lib-so.dylib \ // RUN: %run %t %T/echo-env 2>&1 | FileCheck %s || exit 1 #if !defined(SHARED_LIB) #include int main(int argc, char *argv[]) { execl(argv[1], argv[1], "DYLD_INSERT_LIBRARIES", NULL); // CHECK: {{DYLD_INSERT_LIBRARIES = .*darwin-dummy-shared-lib-so.dylib.*}} return 0; } #else // SHARED_LIB void foo() {} #endif // SHARED_LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/lit.local.cfg0000664000175000017500000000026712077454216030603 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Darwin']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/empty-section.cc0000664000175000017500000000047312546534022031342 0ustar mwhudsonmwhudson// Regression test with an empty (length = 0) custom section. // RUN: %clangxx_asan -g -O0 %s -c -o %t.o // RUN: %clangxx_asan -g -O0 %t.o -o %t -sectcreate mysegment mysection /dev/null // RUN: %run %t 2>&1 | FileCheck %s #include int main() { printf("Hello, world!\n"); // CHECK: Hello, world! } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/reexec-insert-libraries-env.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/reexec-insert-libraries-en0000664000175000017500000000147412537634376033324 0ustar mwhudsonmwhudson// Make sure ASan doesn't hang in an exec loop if DYLD_INSERT_LIBRARIES is set. // This is a regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=159 // RUN: %clangxx_asan %s -o %t // RUN: %clangxx -DSHARED_LIB %s \ // RUN: -dynamiclib -o darwin-dummy-shared-lib-so.dylib // FIXME: the following command line may hang in the case of a regression. // RUN: env DYLD_INSERT_LIBRARIES=darwin-dummy-shared-lib-so.dylib \ // RUN: %run %t 2>&1 | FileCheck %s || exit 1 #if !defined(SHARED_LIB) #include #include int main() { const char kEnvName[] = "DYLD_INSERT_LIBRARIES"; printf("%s=%s\n", kEnvName, getenv(kEnvName)); // CHECK: {{DYLD_INSERT_LIBRARIES=.*darwin-dummy-shared-lib-so.dylib.*}} return 0; } #else // SHARED_LIB void foo() {} #endif // SHARED_LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/malloc_size_crash.mm0000664000175000017500000000057112711670325032247 0ustar mwhudsonmwhudson// RUN: %clang_asan %s -o %t -framework Foundation // RUN: %run %t 2>&1 | FileCheck %s #import #include int main(int argc, char *argv[]) { id obj = @0; fprintf(stderr, "obj = %p\n", obj); size_t size = malloc_size(obj); fprintf(stderr, "size = 0x%zx\n", size); fprintf(stderr, "Done.\n"); // CHECK: Done. return 0; } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/dyld_insert_libraries_reex0000664000175000017500000000344512630024270033550 0ustar mwhudsonmwhudson// When DYLD-inserting the ASan dylib from a different location than the // original, make sure we don't try to reexec. // RUN: mkdir -p %T/dyld_insert_libraries_reexec // RUN: cp `%clang_asan %s -fsanitize=address -### 2>&1 \ // RUN: | grep "libclang_rt.asan_osx_dynamic.dylib" \ // RUN: | sed -e 's/.*"\(.*libclang_rt.asan_osx_dynamic.dylib\)".*/\1/'` \ // RUN: %T/dyld_insert_libraries_reexec/libclang_rt.asan_osx_dynamic.dylib // RUN: %clangxx_asan %s -o %T/dyld_insert_libraries_reexec/a.out // RUN: %env_asan_opts=verbosity=1 \ // RUN: DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib \ // RUN: %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ // RUN: | FileCheck %s // RUN: IS_OSX_10_11_OR_HIGHER=$([ `sw_vers -productVersion | cut -d'.' -f2` -lt 11 ]; echo $?) // On OS X 10.10 and lower, if the dylib is not DYLD-inserted, ASan will re-exec. // RUN: if [ $IS_OSX_10_11_OR_HIGHER == 0 ]; then \ // RUN: %env_asan_opts=verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NOINSERT %s; \ // RUN: fi // On OS X 10.11 and higher, we don't need to DYLD-insert anymore, and the interceptors // still installed correctly. Let's just check that things work and we don't try to re-exec. // RUN: if [ $IS_OSX_10_11_OR_HIGHER == 1 ]; then \ // RUN: %env_asan_opts=verbosity=1 %run %T/dyld_insert_libraries_reexec/a.out 2>&1 \ // RUN: | FileCheck %s; \ // RUN: fi #include int main() { printf("Passed\n"); return 0; } // CHECK-NOINSERT: exec()-ing the program with // CHECK-NOINSERT: DYLD_INSERT_LIBRARIES // CHECK-NOINSERT: to enable wrappers. // CHECK-NOINSERT: Passed // CHECK-NOT: exec()-ing the program with // CHECK-NOT: DYLD_INSERT_LIBRARIES // CHECK-NOT: to enable wrappers. // CHECK: Passed ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/dyld_insert_libraries_remo0000664000175000017500000000315112465127201033545 0ustar mwhudsonmwhudson// Check that when launching with DYLD_INSERT_LIBRARIES, we properly remove // the ASan dylib from the environment variable (both when using an absolute // or relative path) and also that the other dylibs are left untouched. // RUN: mkdir -p %T/dyld_insert_libraries_remove // RUN: cp `%clang_asan %s -fsanitize=address -### 2>&1 \ // RUN: | grep "libclang_rt.asan_osx_dynamic.dylib" \ // RUN: | sed -e 's/.*"\(.*libclang_rt.asan_osx_dynamic.dylib\)".*/\1/'` \ // RUN: %T/dyld_insert_libraries_remove/libclang_rt.asan_osx_dynamic.dylib // RUN: %clangxx_asan %s -o %T/dyld_insert_libraries_remove/a.out // RUN: %clangxx -DSHARED_LIB %s \ // RUN: -dynamiclib -o %T/dyld_insert_libraries_remove/dummy-so.dylib // RUN: ( cd %T/dyld_insert_libraries_remove && \ // RUN: DYLD_INSERT_LIBRARIES=@executable_path/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \ // RUN: %run ./a.out 2>&1 ) | FileCheck %s || exit 1 // RUN: ( cd %T/dyld_insert_libraries_remove && \ // RUN: DYLD_INSERT_LIBRARIES=libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \ // RUN: %run ./a.out 2>&1 ) | FileCheck %s || exit 1 // RUN: ( cd %T/dyld_insert_libraries_remove && \ // RUN: DYLD_INSERT_LIBRARIES=%T/dyld_insert_libraries_remove/libclang_rt.asan_osx_dynamic.dylib:dummy-so.dylib \ // RUN: %run ./a.out 2>&1 ) | FileCheck %s || exit 1 #if !defined(SHARED_LIB) #include #include int main() { const char kEnvName[] = "DYLD_INSERT_LIBRARIES"; printf("%s=%s\n", kEnvName, getenv(kEnvName)); // CHECK: {{DYLD_INSERT_LIBRARIES=dummy-so.dylib}} return 0; } #else // SHARED_LIB void foo() {} #endif // SHARED_LIB golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/suppressions-sandbox.cc0000664000175000017500000000176012567131651032757 0ustar mwhudsonmwhudson// Check that without suppressions, we catch the issue. // RUN: %clangxx_asan -O0 %s -o %t -framework Foundation // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // Check that suppressing a function name works within a no-fork sandbox // RUN: echo "interceptor_via_fun:CFStringCreateWithBytes" > %t.supp // RUN: %env_asan_opts=suppressions='"%t.supp"' \ // RUN: sandbox-exec -p '(version 1)(allow default)(deny process-fork)' \ // RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s #include int main() { char *a = (char *)malloc(6); strcpy(a, "hello"); CFStringRef str = CFStringCreateWithBytes(kCFAllocatorDefault, (unsigned char *)a, 10, kCFStringEncodingUTF8, FALSE); // BOOM fprintf(stderr, "Ignored.\n"); free(a); } // CHECK-CRASH: AddressSanitizer: heap-buffer-overflow // CHECK-CRASH-NOT: Ignored. // CHECK-IGNORE-NOT: AddressSanitizer: heap-buffer-overflow // CHECK-IGNORE: Ignored. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/crashlog-stacktraces.c0000664000175000017500000000223112623722332032477 0ustar mwhudsonmwhudson// RUN: %clang_asan -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // Since ASan is built with -fomit-frame-pointer, backtrace is not able to // symbolicate the trace past ASan runtime on i386. (This is fixed in // latest OS X.) // REQUIRES: asan-64-bits #include #include #include #include void death_function() { fprintf(stderr, "DEATH CALLBACK\n"); void* callstack[128]; int i, frames = backtrace(callstack, 128); char** strs = backtrace_symbols(callstack, frames); for (i = 0; i < frames; ++i) { fprintf(stderr, "%s\n", strs[i]); } free(strs); fprintf(stderr, "END OF BACKTRACE\n"); } int fault_function() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return x[5]; // BOOM } int main() { __sanitizer_set_death_callback(death_function); fault_function(); return 0; } // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in fault_function}} // CHECK: DEATH CALLBACK // CHECK: death_function // CHECK: fault_function // CHECK: main // CHECK: END OF BACKTRACE golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/suppressions-darwin.cc0000664000175000017500000000301612700500015032560 0ustar mwhudsonmwhudson// Check that without suppressions, we catch the issue. // RUN: %clangxx_asan -O0 %s -o %t -framework Foundation // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s // Check that suppressing the interceptor by name works. // RUN: echo "interceptor_name:memmove" > %t.supp // RUN: echo "interceptor_name:memcpy" >> %t.supp // RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // Check that suppressing by interceptor name works even without the symbolizer // RUN: %env_asan_opts=suppressions='"%t.supp"':symbolize=false %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // Check that suppressing all reports from a library works. // RUN: echo "interceptor_via_lib:CoreFoundation" > %t.supp // RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // Check that suppressing library works even without the symbolizer. // RUN: %env_asan_opts=suppressions='"%t.supp"':symbolize=false %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s #include int main() { char *a = (char *)malloc(6); strcpy(a, "hello"); CFStringRef str = CFStringCreateWithBytes(kCFAllocatorDefault, (unsigned char *)a, 10, kCFStringEncodingUTF8, FALSE); // BOOM fprintf(stderr, "Ignored.\n"); free(a); } // CHECK-CRASH: AddressSanitizer: heap-buffer-overflow // CHECK-CRASH-NOT: Ignored. // CHECK-IGNORE-NOT: AddressSanitizer: heap-buffer-overflow // CHECK-IGNORE: Ignored. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/malloc_zone-protected.cc0000664000175000017500000000071112330266131033020 0ustar mwhudsonmwhudson// Make sure the zones created by malloc_create_zone() are write-protected. #include #include // RUN: %clangxx_asan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s void *pwn(malloc_zone_t *unused_zone, size_t unused_size) { printf("PWNED\n"); return NULL; } int main() { malloc_zone_t *zone = malloc_create_zone(0, 0); zone->malloc = pwn; void *v = malloc_zone_malloc(zone, 1); // CHECK-NOT: PWNED return 0; } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/cstring_literals_regtest.mmgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/cstring_literals_regtest.m0000664000175000017500000000125712330266131033511 0ustar mwhudsonmwhudson// Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=274. // RUN: %clang_asan %s -framework Foundation -o %t // RUN: %run %t 2>&1 | FileCheck %s #import #include int main() { NSString* version_file = @"MAJOR=35\n"; int major = 0, minor = 0, build = 0, patch = 0; NSScanner* scanner = [NSScanner scannerWithString:version_file]; NSString *res = nil; if ([scanner scanString:@"MAJOR=" intoString:nil] && [scanner scanInt:&major]) { res = [NSString stringWithFormat:@"%d.%d.%d.%d", major, minor, build, patch]; } printf("%s\n", [res UTF8String]); // CHECK: 35.0.0.0 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/odr-lto.cc0000664000175000017500000000206512766255016030130 0ustar mwhudsonmwhudson// Check that -asan-use-private-alias and use_odr_indicator=1 silence the false // positive ODR violation on Darwin with LTO. // REQUIRES: lto // RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto // RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto // RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-ODR // RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-private-alias // RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-private-alias // RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto // RUN: %env_asan_opts=use_odr_indicator=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ODR #include #include void putstest(); #if PART == 1 int main() { fputs("test\n", stderr); putstest(); fprintf(stderr, "Done.\n"); return 0; } #else // PART == 1 void putstest() { fputs("test\n", stderr); } #endif // PART == 1 // CHECK-ODR: ERROR: AddressSanitizer: odr-violation // CHECK-NO-ODR-NOT: ERROR: AddressSanitizer: odr-violation // CHECK-NO-ODR: Done. golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/address-range-limit.mm0000664000175000017500000000222412740264474032424 0ustar mwhudsonmwhudson// Regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=368. // RUN: %clangxx_asan %s -Wno-deprecated-declarations -flat_namespace -bundle -undefined suppress -o %t.bundle // RUN: %clangxx_asan %s -Wno-deprecated-declarations -o %t -framework Foundation && not %run %t 2>&1 | FileCheck %s #import #import #include int main(int argc, char *argv[]) { for (int i = 0; i < 10; i++) { NSObjectFileImage im; std::string path = std::string(argv[0]) + ".bundle"; NSObjectFileImageReturnCode rc = NSCreateObjectFileImageFromFile(path.c_str(), &im); if (rc != NSObjectFileImageSuccess) { fprintf(stderr, "Could not load bundle.\n"); exit(-1); } NSModule handle = NSLinkModule(im, "a.bundle", 0); if (handle == 0) { fprintf(stderr, "Could not load bundle.\n"); exit(-1); } printf("h: %p\n", handle); } char *ptr = (char *)malloc(10); ptr[10] = 'x'; // BOOM } // CHECK: AddressSanitizer: heap-buffer-overflow // CHECK: WRITE of size 1 // CHECK: {{#0 .* in main}} // CHECK: is located 0 bytes to the right of 10-byte region golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/asan_gen_prefixes.cc0000664000175000017500000000065612256611726032232 0ustar mwhudsonmwhudson// Make sure __asan_gen_* strings have the correct prefixes on Darwin // ("L" in __TEXT,__cstring, "l" in __TEXT,__const // RUN: %clang_asan %s -S -o %t.s // RUN: cat %t.s | FileCheck %s || exit 1 int x, y, z; int main() { return 0; } // CHECK: .section{{.*}}__TEXT,__const // CHECK: l___asan_gen_ // CHECK: .section{{.*}}__TEXT,__cstring,cstring_literals // CHECK: L___asan_gen_ // CHECK: L___asan_gen_ // CHECK: L___asan_gen_ ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-0000664000175000017500000000202412715134211033275 0ustar mwhudsonmwhudson// Check that when having a DYLD_ROOT_PATH set, the symbolizer still works. // RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=verbosity=2 DYLD_ROOT_PATH="/" ASAN_SYMBOLIZER_PATH=$(which atos) \ // RUN: not %run %t 2>&1 | FileCheck %s // // Due to a bug in atos, this only works on x86_64. // REQUIRES: asan-64-bits #include #include int main(int argc, char **argv) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); int res = x[argc]; free(x); free(x + argc - 1); // BOOM // CHECK: Using atos at user-specified path: // CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0 // CHECK: #0 0x{{.*}} in {{.*}}free // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer-dyld-root-path.cc:[[@LINE-4]] // CHECK: freed by thread T0 here: // CHECK: #0 0x{{.*}} in {{.*}}free // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer-dyld-root-path.cc:[[@LINE-8]] // CHECK: allocated by thread T0 here: // CHECK: atos-symbolizer-dyld-root-path.cc:[[@LINE-13]] return res; } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/malloc_set_zone_name-mprotect.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/malloc_set_zone_name-mprot0000664000175000017500000000326212330266131033463 0ustar mwhudsonmwhudson// Regression test for a bug in malloc_create_zone() // (https://code.google.com/p/address-sanitizer/issues/detail?id=203) // The old implementation of malloc_create_zone() didn't always return a // page-aligned address, so we can only test on a best-effort basis. // RUN: %clangxx_asan %s -o %t // RUN: %run %t 2>&1 #include #include #include #include const int kNumIter = 4096; const int kNumZones = 100; int main() { char *mem[kNumIter * 2]; // Allocate memory chunks from different size classes up to 1 page. // (For the case malloc() returns memory chunks in descending order) for (int i = 0; i < kNumIter; i++) { mem[i] = (char*)malloc(8 * i); } // Try to allocate a page-aligned malloc zone. Otherwise the mprotect() call // in malloc_set_zone_name() will silently fail. malloc_zone_t *zone = NULL; bool aligned = false; for (int i = 0; i < kNumZones; i++) { zone = malloc_create_zone(0, 0); if (((uintptr_t)zone & (~0xfff)) == (uintptr_t)zone) { aligned = true; break; } } if (!aligned) { printf("Warning: couldn't allocate a page-aligned zone."); return 0; } // malloc_set_zone_name() calls mprotect(zone, 4096, PROT_READ | PROT_WRITE), // modifies the zone contents and then calls mprotect(zone, 4096, PROT_READ). malloc_set_zone_name(zone, "foobar"); // Allocate memory chunks from different size classes again. for (int i = 0; i < kNumIter; i++) { mem[i + kNumIter] = (char*)malloc(8 * i); } // Access the allocated memory chunks and free them. for (int i = 0; i < kNumIter * 2; i++) { memset(mem[i], 'a', 8 * (i % kNumIter)); free(mem[i]); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/dead-strip.c0000664000175000017500000000147212737026123030433 0ustar mwhudsonmwhudson// Test that AddressSanitizer does not re-animate dead globals when dead // stripping is turned on. // // This test verifies that an out-of-bounds access on a global variable is // detected after dead stripping has been performed. This proves that the // runtime is able to register globals in the __DATA,__asan_globals section. // REQUIRES: osx-ld64-live_support // RUN: %clang_asan -mllvm -asan-globals-live-support -Xlinker -dead_strip -o %t %s // RUN: llvm-nm -format=posix %t | FileCheck --check-prefix NM-CHECK %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix ASAN-CHECK %s int alive[1] = {}; int dead[1] = {}; // NM-CHECK: {{^_alive }} // NM-CHECK-NOT: {{^_dead }} int main(int argc, char *argv[]) { alive[argc] = 0; // ASAN-CHECK: {{0x.* is located 0 bytes to the right of global variable}} return 0; } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/mixing-global-constructors.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/mixing-global-constructors0000664000175000017500000000152112460520417033446 0ustar mwhudsonmwhudson// A global constructor from a non-instrumented part calls a function // in an instrumented part. // Regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=363. // RUN: %clangxx -DINSTRUMENTED_PART=0 -c %s -o %t-uninst.o // RUN: %clangxx_asan -DINSTRUMENTED_PART=1 -c %s -o %t-inst.o // RUN: %clangxx_asan %t-uninst.o %t-inst.o -o %t // RUN: %run %t 2>&1 | FileCheck %s #include #include #include void func(char *ptr); #if INSTRUMENTED_PART == 1 void func(char *ptr) { *ptr = 'X'; } #else // INSTRUMENTED_PART == 1 struct C1 { C1() { printf("Hello "); char buffer[10] = "world"; func(buffer); printf("%s\n", buffer); } }; C1 *obj = new C1(); int main(int argc, const char *argv[]) { return 0; } #endif // INSTRUMENTED_PART == 1 // CHECK: Hello Xorld golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/Darwin/interface_symbols_darwin.c0000664000175000017500000000627312620626652033463 0ustar mwhudsonmwhudson// Check the presence of interface symbols in the ASan runtime dylib. // If you're changing this file, please also change // ../Linux/interface_symbols.c // RUN: %clang_asan -dead_strip -O2 %s -o %t.exe // RUN: rm -f %t.symbols %t.interface // RUN: nm -g `%clang_asan %s -fsanitize=address -### 2>&1 | grep "libclang_rt.asan_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.asan_osx_dynamic.dylib\)".*/\1/'` \ // RUN: | grep " T " | sed "s/.* T //" \ // RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \ // RUN: | sed -E "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \ // RUN: | grep -v "__asan_default_options" \ // RUN: | grep -v "__asan_on_error" > %t.symbols // RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \ // RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \ // RUN: | grep -v "OPTIONAL" \ // RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \ // RUN: > %t.interface // RUN: echo __asan_report_load1 >> %t.interface // RUN: echo __asan_report_load2 >> %t.interface // RUN: echo __asan_report_load4 >> %t.interface // RUN: echo __asan_report_load8 >> %t.interface // RUN: echo __asan_report_load16 >> %t.interface // RUN: echo __asan_report_store1 >> %t.interface // RUN: echo __asan_report_store2 >> %t.interface // RUN: echo __asan_report_store4 >> %t.interface // RUN: echo __asan_report_store8 >> %t.interface // RUN: echo __asan_report_store16 >> %t.interface // RUN: echo __asan_report_load_n >> %t.interface // RUN: echo __asan_report_store_n >> %t.interface // RUN: echo __asan_report_load1_noabort >> %t.interface // RUN: echo __asan_report_load2_noabort >> %t.interface // RUN: echo __asan_report_load4_noabort >> %t.interface // RUN: echo __asan_report_load8_noabort >> %t.interface // RUN: echo __asan_report_load16_noabort >> %t.interface // RUN: echo __asan_report_store1_noabort >> %t.interface // RUN: echo __asan_report_store2_noabort >> %t.interface // RUN: echo __asan_report_store4_noabort >> %t.interface // RUN: echo __asan_report_store8_noabort >> %t.interface // RUN: echo __asan_report_store16_noabort >> %t.interface // RUN: echo __asan_report_load_n_noabort >> %t.interface // RUN: echo __asan_report_store_n_noabort >> %t.interface // RUN: echo __asan_report_exp_load1 >> %t.interface // RUN: echo __asan_report_exp_load2 >> %t.interface // RUN: echo __asan_report_exp_load4 >> %t.interface // RUN: echo __asan_report_exp_load8 >> %t.interface // RUN: echo __asan_report_exp_load16 >> %t.interface // RUN: echo __asan_report_exp_store1 >> %t.interface // RUN: echo __asan_report_exp_store2 >> %t.interface // RUN: echo __asan_report_exp_store4 >> %t.interface // RUN: echo __asan_report_exp_store8 >> %t.interface // RUN: echo __asan_report_exp_store16 >> %t.interface // RUN: echo __asan_report_exp_load_n >> %t.interface // RUN: echo __asan_report_exp_store_n >> %t.interface // RUN: echo __asan_get_current_fake_stack >> %t.interface // RUN: echo __asan_addr_is_in_fake_stack >> %t.interface // RUN: for i in `jot - 0 10`; do echo __asan_stack_malloc_$i >> %t.interface; done // RUN: for i in `jot - 0 10`; do echo __asan_stack_free_$i >> %t.interface; done // RUN: cat %t.interface | sort -u | diff %t.symbols - int main() { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/scariness_score_test.cc0000664000175000017500000001557612764542256031566 0ustar mwhudsonmwhudson// Test how we produce the scariness score. // RUN: %clangxx_asan -O0 %s -o %t // On OSX and Windows, alloc_dealloc_mismatch=1 isn't 100% reliable, so it's // off by default. It's safe for these tests, though, so we turn it on. // RUN: export %env_asan_opts=detect_stack_use_after_return=1:handle_abort=1:print_scariness=1:alloc_dealloc_mismatch=1 // Make sure the stack is limited (may not be the default under GNU make) // RUN: ulimit -s 4096 // RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: not %run %t 2 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: not %run %t 3 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: not %run %t 4 2>&1 | FileCheck %s --check-prefix=CHECK4 // RUN: not %run %t 5 2>&1 | FileCheck %s --check-prefix=CHECK5 // RUN: not %run %t 6 2>&1 | FileCheck %s --check-prefix=CHECK6 // RUN: not %run %t 7 2>&1 | FileCheck %s --check-prefix=CHECK7 // RUN: not %run %t 8 2>&1 | FileCheck %s --check-prefix=CHECK8 // RUN: not %run %t 9 2>&1 | FileCheck %s --check-prefix=CHECK9 // RUN: not %run %t 10 2>&1 | FileCheck %s --check-prefix=CHECK10 // RUN: not %run %t 11 2>&1 | FileCheck %s --check-prefix=CHECK11 // RUN: not %run %t 12 2>&1 | FileCheck %s --check-prefix=CHECK12 // RUN: not %run %t 13 2>&1 | FileCheck %s --check-prefix=CHECK13 // RUN: not %run %t 14 2>&1 | FileCheck %s --check-prefix=CHECK14 // RUN: not %run %t 15 2>&1 | FileCheck %s --check-prefix=CHECK15 // RUN: not %run %t 16 2>&1 | FileCheck %s --check-prefix=CHECK16 // RUN: not %run %t 17 2>&1 | FileCheck %s --check-prefix=CHECK17 // RUN: not %run %t 18 2>&1 | FileCheck %s --check-prefix=CHECK18 // RUN: not %run %t 19 2>&1 | FileCheck %s --check-prefix=CHECK19 // RUN: not %run %t 20 2>&1 | FileCheck %s --check-prefix=CHECK20 // RUN: not %run %t 21 2>&1 | FileCheck %s --check-prefix=CHECK21 // RUN: not %run %t 22 2>&1 | FileCheck %s --check-prefix=CHECK22 // RUN: not %run %t 23 2>&1 | FileCheck %s --check-prefix=CHECK23 // RUN: not %run %t 24 2>&1 | FileCheck %s --check-prefix=CHECK24 // RUN: not %run %t 25 2>&1 | FileCheck %s --check-prefix=CHECK25 // RUN: not %run %t 26 2>&1 | FileCheck %s --check-prefix=CHECK26 // RUN: not %run %t 27 2>&1 | FileCheck %s --check-prefix=CHECK27 // Parts of the test are too platform-specific: // REQUIRES: x86_64-target-arch // REQUIRES: shell #include #include #include #include enum ReadOrWrite { Read = 0, Write = 1 }; struct S32 { char x[32]; }; template void HeapBuferOverflow(int Idx, ReadOrWrite w) { T *t = new T[100]; static T sink; if (w) t[100 + Idx] = T(); else sink = t[100 + Idx]; delete [] t; } template void HeapUseAfterFree(int Idx, ReadOrWrite w) { T *t = new T[100]; static T sink; sink = t[0]; delete [] t; if (w) t[Idx] = T(); else sink = t[Idx]; } template void StackBufferOverflow(int Idx, ReadOrWrite w) { T t[100]; static T sink; sink = t[Idx]; if (w) t[100 + Idx] = T(); else sink = t[100 + Idx]; } template T *LeakStack() { T t[100]; static volatile T *x; x = &t[0]; return (T*)x; } template void StackUseAfterReturn(int Idx, ReadOrWrite w) { static T sink; T *t = LeakStack(); if (w) t[100 + Idx] = T(); else sink = t[100 + Idx]; } char g1[100]; short g2[100]; int g4[100]; int64_t g8[100]; S32 gm[100]; void DoubleFree() { int *x = new int; static volatile int two = 2; for (int i = 0; i < two; i++) delete x; } void StackOverflow(int Idx) { int some_stack[10000]; static volatile int *x; x = &some_stack[0]; if (Idx > 0) StackOverflow(Idx - 1); } void UseAfterPoison() { int buf[100]; __asan_poison_memory_region(buf, sizeof(buf)); static volatile int sink; sink = buf[42]; } int main(int argc, char **argv) { char arr[100]; static volatile int zero = 0; static volatile int *zero_ptr = 0; static volatile int *wild_addr = (int*)0x10000000; // System-dependent. if (argc != 2) return 1; int kind = atoi(argv[1]); switch (kind) { case 1: HeapBuferOverflow(0, Read); break; case 2: HeapBuferOverflow(0, Read); break; case 3: HeapBuferOverflow(0, Write); break; case 4: HeapBuferOverflow(2, Write); break; case 5: HeapBuferOverflow(4, Write); break; case 6: HeapUseAfterFree(0, Read); break; case 7: HeapUseAfterFree(0, Write); break; case 8: HeapUseAfterFree(0, Read); break; case 9: HeapUseAfterFree(0, Write); break; case 10: StackBufferOverflow(0, Write); break; case 11: StackBufferOverflow(0, Read); break; case 12: StackBufferOverflow(4, Write); break; case 13: StackUseAfterReturn(0, Read); break; case 14: StackUseAfterReturn(0, Write); break; case 15: g1[zero + 100] = 0; break; case 16: gm[0] = gm[zero + 100 + 1]; break; case 17: DoubleFree(); break; case 18: StackOverflow(1000000); break; case 19: *zero_ptr = 0; break; case 20: *wild_addr = 0; break; case 21: zero = *wild_addr; break; case 22: ((void (*)(void))wild_addr)(); break; case 23: delete (new int[10]); break; case 24: free((char*)malloc(100) + 10); break; case 25: memcpy(arr, arr+10, 20); break; case 26: UseAfterPoison(); break; case 27: abort(); // CHECK1: SCARINESS: 12 (1-byte-read-heap-buffer-overflow) // CHECK2: SCARINESS: 17 (4-byte-read-heap-buffer-overflow) // CHECK3: SCARINESS: 33 (2-byte-write-heap-buffer-overflow) // CHECK4: SCARINESS: 52 (8-byte-write-heap-buffer-overflow-far-from-bounds) // CHECK5: SCARINESS: 55 (multi-byte-write-heap-buffer-overflow-far-from-bounds) // CHECK6: SCARINESS: 40 (1-byte-read-heap-use-after-free) // CHECK7: SCARINESS: 46 (4-byte-write-heap-use-after-free) // CHECK8: SCARINESS: 51 (8-byte-read-heap-use-after-free) // CHECK9: SCARINESS: 55 (multi-byte-write-heap-use-after-free) // CHECK10: SCARINESS: 46 (1-byte-write-stack-buffer-overflow) // CHECK11: SCARINESS: 38 (8-byte-read-stack-buffer-overflow) // CHECK12: SCARINESS: 61 (4-byte-write-stack-buffer-overflow-far-from-bounds) // CHECK13: SCARINESS: 50 (1-byte-read-stack-use-after-return) // CHECK14: SCARINESS: 65 (multi-byte-write-stack-use-after-return) // CHECK15: SCARINESS: 31 (1-byte-write-global-buffer-overflow) // CHECK16: SCARINESS: 36 (multi-byte-read-global-buffer-overflow-far-from-bounds) // CHECK17: SCARINESS: 42 (double-free) // CHECK18: SCARINESS: 10 (stack-overflow) // CHECK19: SCARINESS: 10 (null-deref) // CHECK20: SCARINESS: 30 (wild-addr-write) // CHECK21: SCARINESS: 20 (wild-addr-read) // CHECK22: SCARINESS: 60 (wild-jump) // CHECK23: SCARINESS: 10 (alloc-dealloc-mismatch) // CHECK24: SCARINESS: 40 (bad-free) // CHECK25: SCARINESS: 10 (memcpy-param-overlap) // CHECK26: SCARINESS: 27 (4-byte-read-use-after-poison) // CHECK27: SCARINESS: 10 (signal) } } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/alloca_overflow_partial.cc0000664000175000017500000000103312756110734032204 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // #include __attribute__((noinline)) void foo(int index, int len) { volatile char str[len] __attribute__((aligned(32))); assert(!(reinterpret_cast(str) & 31L)); str[index] = '1'; // BOOM // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } int main(int argc, char **argv) { foo(10, 10); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/stack-buffer-overflow.cc0000664000175000017500000000124512330266131031523 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include int main(int argc, char **argv) { char x[10]; memset(x, 0, 10); int res = x[argc * 10]; // BOOOM // CHECK: {{READ of size 1 at 0x.* thread T0}} // CHECK: {{ #0 0x.* in main .*stack-buffer-overflow.cc:}}[[@LINE-2]] // CHECK: {{Address 0x.* is located in stack of thread T0 at offset}} // CHECK-NEXT: in{{.*}}main{{.*}}stack-buffer-overflow.cc return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strcasestr_strict.c0000664000175000017500000000142212562755664030752 0ustar mwhudsonmwhudson// Test strict_string_checks option in strcasestr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // There's no interceptor for strcasestr on Windows // XFAIL: win32 #define _GNU_SOURCE #include #include #include int main(int argc, char **argv) { size_t size = 100; char *s1 = (char*)malloc(size); char *s2 = (char*)malloc(size); memset(s1, 'o', size); memset(s2, 'O', size); s2[size - 1]='\0'; char* r = strcasestr(s1, s2); // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} // CHECK: READ of size 101 assert(r == s1); free(s1); free(s2); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/halt_on_error-1.c0000664000175000017500000000134712621205604030142 0ustar mwhudsonmwhudson// Test recovery mode. // // RUN: %clang_asan -fsanitize-recover=address %s -o %t // // RUN: env not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=halt_on_error=true not %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=halt_on_error=false %run %t 2>&1 | FileCheck %s --check-prefix CHECK-RECOVER #include volatile int ten = 10; int main() { char x[10]; // CHECK: WRITE of size 11 // CHECK-RECOVER: WRITE of size 11 memset(x, 0, 11); // CHECK-NOT: READ of size 1 // CHECK-RECOVER: READ of size 1 volatile int res = x[ten]; // CHECK-NOT: WRITE of size 1 // CHECK-RECOVER: WRITE of size 1 x[ten] = res + 3; // CHECK-NOT: READ of size 1 // CHECK-RECOVER: READ of size 1 res = x[ten]; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/interception_failure_test.cc0000664000175000017500000000141112563423744032567 0ustar mwhudsonmwhudson// If user provides his own libc functions, ASan doesn't // intercept these functions. // RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s // On Windows, defining strtoll results in linker errors. // XFAIL: freebsd,win32 #include #include extern "C" long strtol(const char *nptr, char **endptr, int base) { fprintf(stderr, "my_strtol_interceptor\n"); return 0; } int main() { char *x = (char*)malloc(10 * sizeof(char)); free(x); return (int)strtol(x, 0, 10); // CHECK: my_strtol_interceptor // CHECK-NOT: heap-use-after-free } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/printf-3.c0000664000175000017500000000144412563423744026623 0ustar mwhudsonmwhudson// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: printf is not intercepted on Windows yet. // XFAIL: win32 #include int main() { #ifdef _MSC_VER // FIXME: The test raises a dialog even though it's XFAILd. return 42; #endif volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile int n[1]; printf("%c %d %.3f %s%n\n", c, x, f, s, &n[1]); return 0; // Check that %n is sanitized. // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 // CHECK-OFF: 0 12 1.239 34 } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-disabled.cc0000664000175000017500000000125612563423744030665 0ustar mwhudsonmwhudson// Test that no data is collected without a runtime flag. // // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t // // RUN: rm -rf %T/coverage-disabled // // RUN: mkdir -p %T/coverage-disabled/normal // RUN: %env_asan_opts=coverage_direct=0:coverage_dir='"%T/coverage-disabled/normal"':verbosity=1 %run %t // RUN: not %sancov print %T/coverage-disabled/normal/*.sancov 2>&1 // // RUN: mkdir -p %T/coverage-disabled/direct // RUN: %env_asan_opts=coverage_direct=1:coverage_dir='"%T/coverage-disabled/direct"':verbosity=1 %run %t // RUN: cd %T/coverage-disabled/direct // RUN: not %sancov rawunpack *.sancov // // UNSUPPORTED: android int main(int argc, char **argv) { return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/vla_loop_overfow.cc0000664000175000017500000000110512756110734030674 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // // REQUIRES: stable-runtime #include #include void foo(int index, int len) { for (int i = 1; i < len; ++i) { char array[len]; // NOLINT assert(!(reinterpret_cast(array) & 31L)); array[index + i] = 0; // CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]] // CHECK: WRITE of size 1 at [[ADDR]] thread T0 } } int main(int argc, char **argv) { foo(9, 21); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/strstr-1.c0000664000175000017500000000133713003455757026660 0ustar mwhudsonmwhudson// Test haystack overflow in strstr function // RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s // Test intercept_strstr asan option // Disable other interceptors because strlen may be called inside strstr // RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1 #include #include #include int main(int argc, char **argv) { char *r = 0; char s2[] = "c"; char s1[4] = "acb"; __asan_poison_memory_region ((char *)&s1[2], 2); r = strstr(s1, s2); // CHECK:'s1' <== Memory access at offset {{[0-9]+}} {{partially overflows this variable|is inside this variable}} assert(r == s1 + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/verbose-log-path_test.cc0000664000175000017500000000130012563423744031530 0ustar mwhudsonmwhudson// RUN: %clangxx_asan %s -o %T/verbose-log-path_test-binary // The glob below requires bash. // REQUIRES: shell // Good log_path. // RUN: rm -f %T/asan.log.* // RUN: %env_asan_opts=log_path=%T/asan.log:log_exe_name=1 not %run %T/verbose-log-path_test-binary 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %T/asan.log.verbose-log-path_test-binary.* // FIXME: only FreeBSD and Linux have verbose log paths now. // XFAIL: win32,android #include #include int main(int argc, char **argv) { if (argc > 2) return 0; char *x = (char*)malloc(10); memset(x, 0, 10); int res = x[argc * 10]; // BOOOM free(x); return res; } // CHECK-ERROR: ERROR: AddressSanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/debug_locate.cc0000664000175000017500000000533412411335524027731 0ustar mwhudsonmwhudson// Checks the ASan memory address type debugging API, makes sure it returns // the correct memory type for heap, stack, global and shadow addresses and // that it correctly finds out which region (and name and size) the address // belongs to. // RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 #include #include #include #include #include int global_var; int main() { int local_var; char *heap_ptr = (char *)malloc(10); char name[100]; void *region_address; size_t region_size; const char *type; type = __asan_locate_address(&global_var, name, 100, ®ion_address, ®ion_size); assert(0 == strcmp(name, "global_var")); assert(0 == strcmp(type, "global")); assert(region_address == &global_var); assert(region_size == sizeof(global_var)); type = __asan_locate_address((char *)(&global_var)+1, name, 100, ®ion_address, ®ion_size); assert(0 == strcmp(name, "global_var")); assert(0 == strcmp(type, "global")); assert(region_address == &global_var); assert(region_size == sizeof(global_var)); type = __asan_locate_address(&local_var, name, 100, ®ion_address, ®ion_size); assert(0 == strcmp(name, "local_var")); assert(0 == strcmp(type, "stack")); assert(region_address == &local_var); assert(region_size == sizeof(local_var)); type = __asan_locate_address((char *)(&local_var)+1, name, 100, ®ion_address, ®ion_size); assert(0 == strcmp(name, "local_var")); assert(0 == strcmp(type, "stack")); assert(region_address == &local_var); assert(region_size == sizeof(local_var)); type = __asan_locate_address(heap_ptr, name, 100, ®ion_address, ®ion_size); assert(0 == strcmp(type, "heap")); assert(region_address == heap_ptr); assert(10 == region_size); type = __asan_locate_address(heap_ptr+1, name, 100, ®ion_address, ®ion_size); assert(0 == strcmp(type, "heap")); assert(region_address == heap_ptr); assert(10 == region_size); size_t shadow_scale; size_t shadow_offset; __asan_get_shadow_mapping(&shadow_scale, &shadow_offset); uintptr_t shadow_ptr = (((uintptr_t)heap_ptr) >> shadow_scale) + shadow_offset; type = __asan_locate_address((void *)shadow_ptr, NULL, 0, NULL, NULL); assert((0 == strcmp(type, "high shadow")) || 0 == strcmp(type, "low shadow")); uintptr_t shadow_gap = (shadow_ptr >> shadow_scale) + shadow_offset; type = __asan_locate_address((void *)shadow_gap, NULL, 0, NULL, NULL); assert(0 == strcmp(type, "shadow gap")); free(heap_ptr); return 0; } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-caller-callee-total-count.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/coverage-caller-callee-total-coun0000664000175000017500000000306412612256761033277 0ustar mwhudsonmwhudson// Test __sanitizer_get_total_unique_coverage for caller-callee coverage // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t // RUN: %env_asan_opts=coverage=1 %run %t // RUN: rm -f caller-callee*.sancov // // REQUIRES: asan-64-bits #include #include #include int P = 0; struct Foo {virtual void f() {if (P) printf("Foo::f()\n");}}; struct Foo1 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; struct Foo2 : Foo {virtual void f() {if (P) printf("%d\n", __LINE__);}}; Foo *foo[3] = {new Foo, new Foo1, new Foo2}; uintptr_t CheckNewTotalUniqueCoverageIsLargerAndReturnIt(uintptr_t old_total) { uintptr_t new_total = __sanitizer_get_total_unique_caller_callee_pairs(); fprintf(stderr, "Caller-Callee: old %zd new %zd\n", old_total, new_total); assert(new_total > old_total); return new_total; } int main(int argc, char **argv) { uintptr_t total = __sanitizer_get_total_unique_caller_callee_pairs(); foo[0]->f(); total = CheckNewTotalUniqueCoverageIsLargerAndReturnIt(total); foo[1]->f(); total = CheckNewTotalUniqueCoverageIsLargerAndReturnIt(total); foo[2]->f(); total = CheckNewTotalUniqueCoverageIsLargerAndReturnIt(total); // Ok, called every function once. // Now call them again from another call site. Should get new coverage. foo[0]->f(); total = CheckNewTotalUniqueCoverageIsLargerAndReturnIt(total); foo[1]->f(); total = CheckNewTotalUniqueCoverageIsLargerAndReturnIt(total); foo[2]->f(); total = CheckNewTotalUniqueCoverageIsLargerAndReturnIt(total); } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/use-after-scope-loop-bug.cc0000664000175000017500000000106312746507477032056 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s int *p; int main() { // Variable goes in and out of scope. for (int i = 0; i < 3; ++i) { int x[3] = {i, i, i}; p = x + i; } return *p; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-bug.cc:[[@LINE-2]] // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x' } golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/debug_ppc64_mapping.cc0000664000175000017500000000274512662736340031145 0ustar mwhudsonmwhudson// RUN: %clang_asan -O0 %s -o %t // RUN: %env_asan_opts=verbosity=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64-V0 // RUN: %env_asan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-PPC64 // REQUIRES: powerpc64-target-arch #include int main() { // CHECK-PPC64: || `[{{0x0a0|0x040}}000000000, {{0x3ff|0x0ff}}fffffffff]` || HighMem || // CHECK-PPC64: || `[{{0x034|0x028}}000000000, {{0x09f|0x03f}}fffffffff]` || HighShadow || // CHECK-PPC64: || `[{{0x024|0x024}}000000000, {{0x033|0x027}}fffffffff]` || ShadowGap || // CHECK-PPC64: || `[0x020000000000, 0x023fffffffff]` || LowShadow || // CHECK-PPC64: || `[0x000000000000, 0x01ffffffffff]` || LowMem || // printf("ppc64 eyecatcher \n"); // CHECK-PPC64-V0: ppc64 eyecatcher return 0; } /* * Two different signatures noted at the time of writing. Newish kernel: (64TB address range support, starting with kernel version 3.7) || `[0x0a0000000000, 0x3fffffffffff]` || HighMem || || `[0x034000000000, 0x09ffffffffff]` || HighShadow || || `[0x024000000000, 0x033fffffffff]` || ShadowGap || || `[0x020000000000, 0x023fffffffff]` || LowShadow || || `[0x000000000000, 0x01ffffffffff]` || LowMem || Oldish kernel: || `[0x040000000000, 0x0fffffffffff]` || HighMem || || `[0x028000000000, 0x03ffffffffff]` || HighShadow || || `[0x024000000000, 0x027fffffffff]` || ShadowGap || || `[0x020000000000, 0x023fffffffff]` || LowShadow || || `[0x000000000000, 0x01ffffffffff]` || LowMem || */ golang-1.8-race-detector-runtime_0.0+svn285455/test/asan/TestCases/partial_right.cc0000664000175000017500000000112412330266131030133 0ustar mwhudsonmwhudson// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s #include int main(int argc, char **argv) { volatile int *x = (int*)malloc(2*sizeof(int) + 2); int res = x[2]; // BOOOM // CHECK: {{READ of size 4 at 0x.* thread T0}} // CHECK: [[ADDR:0x[01-9a-fa-f]+]] is located 0 bytes to the right of {{.*}}-byte region [{{.*}},{{.*}}[[ADDR]]) return res; } golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/0000775000175000017500000000000013040224625023273 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/random_shuffle.cpp0000664000175000017500000000137512757703753027023 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: rm -rf %T/random_shuffle_tmp_dir // RUN: mkdir %T/random_shuffle_tmp_dir // RUN: %run %t 100 > %T/random_shuffle_tmp_dir/out1 // RUN: %run %t 100 > %T/random_shuffle_tmp_dir/out2 // RUN: %run %t 10000 > %T/random_shuffle_tmp_dir/out1 // RUN: %run %t 10000 > %T/random_shuffle_tmp_dir/out2 // RUN: not diff %T/random_shuffle_tmp_dir/out? // RUN: rm -rf %T/random_shuffle_tmp_dir // Tests that the allocator shuffles the chunks before returning to the user. #include #include int main(int argc, char **argv) { int alloc_size = argc == 2 ? atoi(argv[1]) : 100; char *base = new char[alloc_size]; for (int i = 0; i < 20; i++) { char *p = new char[alloc_size]; printf("%zd\n", base - p); } } golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/sizes.cpp0000664000175000017500000000334512725420532025145 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: SCUDO_OPTIONS=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=allocator_may_return_null=1 %run %t malloc 2>&1 // RUN: SCUDO_OPTIONS=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=allocator_may_return_null=1 %run %t calloc 2>&1 // RUN: %run %t usable 2>&1 // Tests for various edge cases related to sizes, notably the maximum size the // allocator can allocate. Tests that an integer overflow in the parameters of // calloc is caught. #include #include #include #include #include int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "malloc")) { // Currently the maximum size the allocator can allocate is 1ULL<<40 bytes. size_t size = std::numeric_limits::max(); void *p = malloc(size); if (p) return 1; size = (1ULL << 40) - 16; p = malloc(size); if (p) return 1; } if (!strcmp(argv[1], "calloc")) { // Trigger an overflow in calloc. size_t size = std::numeric_limits::max(); void *p = calloc((size / 0x1000) + 1, 0x1000); if (p) return 1; } if (!strcmp(argv[1], "usable")) { // Playing with the actual usable size of a chunk. void *p = malloc(1007); if (!p) return 1; size_t size = malloc_usable_size(p); if (size < 1007) return 1; memset(p, 'A', size); p = realloc(p, 2014); if (!p) return 1; size = malloc_usable_size(p); if (size < 2014) return 1; memset(p, 'B', size); free(p); } return 0; } // CHECK: allocator is terminating the process golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/mismatch.cpp0000664000175000017500000000231512725420532025611 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=1 not %run %t mallocdel 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=0 %run %t mallocdel 2>&1 // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=1 not %run %t newfree 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=0 %run %t newfree 2>&1 // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=1 not %run %t memaligndel 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=0 %run %t memaligndel 2>&1 // Tests that type mismatches between allocation and deallocation functions are // caught when the related option is set. #include #include #include #include int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "mallocdel")) { int *p = (int *)malloc(16); if (!p) return 1; delete p; } if (!strcmp(argv[1], "newfree")) { int *p = new int; if (!p) return 1; free((void *)p); } if (!strcmp(argv[1], "memaligndel")) { int *p = (int *)memalign(0x10, 0x10); if (!p) return 1; delete p; } return 0; } // CHECK: ERROR: allocation type mismatch on address golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/quarantine.cpp0000664000175000017500000000165412725420532026160 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: SCUDO_OPTIONS=QuarantineSizeMb=1 %run %t 2>&1 // Tests that the quarantine prevents a chunk from being reused right away. // Also tests that a chunk will eventually become available again for // allocation when the recycling criteria has been met. #include #include #include int main(int argc, char **argv) { void *p, *old_p; size_t size = 1U << 16; // The delayed freelist will prevent a chunk from being available right away p = malloc(size); if (!p) return 1; old_p = p; free(p); p = malloc(size); if (!p) return 1; if (old_p == p) return 1; free(p); // Eventually the chunk should become available again bool found = false; for (int i = 0; i < 0x100 && found == false; i++) { p = malloc(size); if (!p) return 1; found = (p == old_p); free(p); } if (found == false) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/overflow.cpp0000664000175000017500000000174012725420532025650 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: not %run %t malloc 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=QuarantineSizeMb=1 not %run %t quarantine 2>&1 | FileCheck %s // Tests that header corruption of an allocated or quarantined chunk is caught. #include #include #include int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "malloc")) { // Simulate a header corruption of an allocated chunk (1-bit) void *p = malloc(1U << 4); if (!p) return 1; ((char *)p)[-1] ^= 1; free(p); } if (!strcmp(argv[1], "quarantine")) { void *p = malloc(1U << 4); if (!p) return 1; free(p); // Simulate a header corruption of a quarantined chunk ((char *)p)[-2] ^= 1; // Trigger the quarantine recycle for (int i = 0; i < 0x100; i++) { p = malloc(1U << 16); free(p); } } return 0; } // CHECK: ERROR: corrupted chunk header at address golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/double-free.cpp0000664000175000017500000000202512725420532026173 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: not %run %t malloc 2>&1 | FileCheck %s // RUN: not %run %t new 2>&1 | FileCheck %s // RUN: not %run %t newarray 2>&1 | FileCheck %s // RUN: not %run %t memalign 2>&1 | FileCheck %s // Tests double-free error on pointers allocated with different allocation // functions. #include #include #include int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "malloc")) { void *p = malloc(sizeof(int)); if (!p) return 1; free(p); free(p); } if (!strcmp(argv[1], "new")) { int *p = new int; if (!p) return 1; delete p; delete p; } if (!strcmp(argv[1], "newarray")) { int *p = new int[8]; if (!p) return 1; delete[] p; delete[] p; } if (!strcmp(argv[1], "memalign")) { void *p = nullptr; posix_memalign(&p, 0x100, sizeof(int)); if (!p) return 1; free(p); free(p); } return 0; } // CHECK: ERROR: invalid chunk state when deallocating address golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/alignment.cpp0000664000175000017500000000112212725420532025755 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: not %run %t pointers 2>&1 | FileCheck %s // Tests that a non-16-byte aligned pointer will trigger the associated error // on deallocation. #include #include #include #include #include int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "pointers")) { void *p = malloc(1U << 16); if (!p) return 1; free(reinterpret_cast(reinterpret_cast(p) | 8)); } return 0; } // CHECK: ERROR: attempted to deallocate a chunk not properly aligned golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/memalign.cpp0000664000175000017500000000242213004153372025570 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: %run %t valid 2>&1 // RUN: not %run %t invalid 2>&1 | FileCheck %s // Tests that the various aligned allocation functions work as intended. Also // tests for the condition where the alignment is not a power of 2. #include #include #include #include // Sometimes the headers may not have this... extern "C" void *aligned_alloc (size_t alignment, size_t size); int main(int argc, char **argv) { void *p = nullptr; size_t alignment = 1U << 12; size_t size = 1U << 12; assert(argc == 2); if (!strcmp(argv[1], "valid")) { posix_memalign(&p, alignment, size); if (!p) return 1; free(p); p = aligned_alloc(alignment, size); if (!p) return 1; free(p); // Tests various combinations of alignment and sizes for (int i = 4; i < 20; i++) { alignment = 1U << i; for (int j = 1; j < 33; j++) { size = 0x800 * j; for (int k = 0; k < 3; k++) { p = memalign(alignment, size - (16 * k)); if (!p) return 1; free(p); } } } } if (!strcmp(argv[1], "invalid")) { p = memalign(alignment - 1, size); free(p); } return 0; } // CHECK: ERROR: alignment is not a power of 2 golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/secondary.cpp0000664000175000017500000000257212770052233025777 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: %run %t after 2>&1 | FileCheck %s // RUN: %run %t before 2>&1 | FileCheck %s // Test that we hit a guard page when writing past the end of a chunk // allocated by the Secondary allocator, or writing too far in front of it. #include #include #include #include #include #include void handler(int signo, siginfo_t *info, void *uctx) { if (info->si_code == SEGV_ACCERR) { fprintf(stderr, "SCUDO SIGSEGV\n"); exit(0); } exit(1); } int main(int argc, char **argv) { // The size must be large enough to be serviced by the secondary allocator. long page_size = sysconf(_SC_PAGESIZE); size_t size = (1U << 17) + page_size; struct sigaction a; assert(argc == 2); memset(&a, 0, sizeof(a)); a.sa_sigaction = handler; a.sa_flags = SA_SIGINFO; char *p = (char *)malloc(size); if (!p) return 1; memset(p, 'A', size); // This should not trigger anything. // Set up the SIGSEGV handler now, as the rest should trigger an AV. sigaction(SIGSEGV, &a, nullptr); if (!strcmp(argv[1], "after")) { for (int i = 0; i < page_size; i++) p[size + i] = 'A'; } if (!strcmp(argv[1], "before")) { for (int i = 1; i < page_size; i++) p[-i] = 'A'; } free(p); return 1; // A successful test means we shouldn't reach this. } // CHECK: SCUDO SIGSEGV golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/CMakeLists.txt0000664000175000017500000000170212741012374026036 0ustar mwhudsonmwhudsonset(SCUDO_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SCUDO_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(SCUDO_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SCUDO_TEST_DEPS scudo) endif() configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg ) if(CMAKE_SYSTEM_NAME MATCHES "Linux") EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) STRING(REGEX REPLACE "^.*(sse4_2).*$" "\\1" SSE_THERE ${CPUINFO}) STRING(COMPARE EQUAL "sse4_2" "${SSE_THERE}" SSE42_TRUE) endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if (SSE42_TRUE AND CMAKE_SIZEOF_VOID_P EQUAL 8) add_lit_testsuite(check-scudo "Running the Scudo Hardened Allocator tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${SCUDO_TEST_DEPS}) set_target_properties(check-scudo PROPERTIES FOLDER "Compiler-RT Misc") endif(SSE42_TRUE AND CMAKE_SIZEOF_VOID_P EQUAL 8) golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/preinit.cpp0000664000175000017500000000130612725420532025455 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: %run %t 2>&1 // Verifies that calling malloc in a preinit_array function succeeds, and that // the resulting pointer can be freed at program termination. #include #include #include static void *global_p = nullptr; void __init(void) { global_p = malloc(1); if (!global_p) exit(1); } void __fini(void) { if (global_p) free(global_p); } int main(int argc, char **argv) { void *p = malloc(1); if (!p) return 1; free(p); return 0; } __attribute__((section(".preinit_array"), used)) void (*__local_preinit)(void) = __init; __attribute__((section(".fini_array"), used)) void (*__local_fini)(void) = __fini; golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/lit.site.cfg.in0000664000175000017500000000043712725420532026124 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@SCUDO_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/sized-delete.cpp0000664000175000017500000000243212725420532026362 0ustar mwhudsonmwhudson// RUN: %clang_scudo -fsized-deallocation %s -o %t // RUN: SCUDO_OPTIONS=DeleteSizeMismatch=1 %run %t gooddel 2>&1 // RUN: SCUDO_OPTIONS=DeleteSizeMismatch=1 not %run %t baddel 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=DeleteSizeMismatch=0 %run %t baddel 2>&1 // RUN: SCUDO_OPTIONS=DeleteSizeMismatch=1 %run %t gooddelarr 2>&1 // RUN: SCUDO_OPTIONS=DeleteSizeMismatch=1 not %run %t baddelarr 2>&1 | FileCheck %s // RUN: SCUDO_OPTIONS=DeleteSizeMismatch=0 %run %t baddelarr 2>&1 // Ensures that the sized delete operator errors out when the appropriate // option is passed and the sizes do not match between allocation and // deallocation functions. #include #include #include #include int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "gooddel")) { long long *p = new long long; operator delete(p, sizeof(long long)); } if (!strcmp(argv[1], "baddel")) { long long *p = new long long; operator delete(p, 2); } if (!strcmp(argv[1], "gooddelarr")) { char *p = new char[64]; operator delete[](p, 64); } if (!strcmp(argv[1], "baddelarr")) { char *p = new char[63]; operator delete[](p, 64); } return 0; } // CHECK: ERROR: invalid sized delete on chunk at address golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/lit.cfg0000664000175000017500000000212112725420532024544 0ustar mwhudsonmwhudson# -*- Python -*- import os # Setup config name. config.name = 'Scudo' # Setup source root. config.test_source_root = os.path.dirname(__file__) # Path to the static library base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.scudo-%s.a" % config.target_arch) whole_archive = "-Wl,-whole-archive %s -Wl,-no-whole-archive " % base_lib # Test suffixes. config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test'] # C flags. c_flags = ["-std=c++11", "-lstdc++", "-ldl", "-lrt", "-pthread", "-latomic", "-fPIE", "-pie", "-O0"] def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " # Add clang substitutions. config.substitutions.append( ("%clang_scudo ", build_invocation(c_flags) + whole_archive) ) # Hardened Allocator tests are currently supported on Linux only. if config.host_os not in ['Linux']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/malloc.cpp0000664000175000017500000000110112773541641025253 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: %run %t 2>&1 // Tests that a regular workflow of allocation, memory fill and free works as // intended. Also tests that a zero-sized allocation succeeds. #include #include #include #include int main(int argc, char **argv) { void *p; std::vector sizes{1, 1 << 5, 1 << 10, 1 << 15, 1 << 20}; p = malloc(0); if (!p) return 1; free(p); for (size_t size : sizes) { p = malloc(size); if (!p) return 1; memset(p, 'A', size); free(p); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/realloc.cpp0000664000175000017500000000431712773541641025441 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: %run %t pointers 2>&1 // RUN: %run %t contents 2>&1 // RUN: not %run %t memalign 2>&1 | FileCheck %s // Tests that our reallocation function returns the same pointer when the // requested size can fit into the previously allocated chunk. Also tests that // a new chunk is returned if the size is greater, and that the contents of the // chunk are left unchanged. // As a final test, make sure that a chunk allocated by memalign cannot be // reallocated. #include #include #include #include int main(int argc, char **argv) { void *p, *old_p; // Those sizes will exercise both allocators (Primary & Secondary). std::vector sizes{1, 1 << 5, 1 << 10, 1 << 15, 1 << 20}; assert(argc == 2); for (size_t size : sizes) { if (!strcmp(argv[1], "pointers")) { old_p = p = realloc(nullptr, size); if (!p) return 1; size = malloc_usable_size(p); // Our realloc implementation will return the same pointer if the size // requested is lower than or equal to the usable size of the associated // chunk. p = realloc(p, size - 1); if (p != old_p) return 1; p = realloc(p, size); if (p != old_p) return 1; // And a new one if the size is greater. p = realloc(p, size + 1); if (p == old_p) return 1; // A size of 0 will free the chunk and return nullptr. p = realloc(p, 0); if (p) return 1; old_p = nullptr; } if (!strcmp(argv[1], "contents")) { p = realloc(nullptr, size); if (!p) return 1; for (int i = 0; i < size; i++) reinterpret_cast(p)[i] = 'A'; p = realloc(p, size + 1); // The contents of the reallocated chunk must match the original one. for (int i = 0; i < size; i++) if (reinterpret_cast(p)[i] != 'A') return 1; } if (!strcmp(argv[1], "memalign")) { // A chunk coming from memalign cannot be reallocated. p = memalign(16, size); if (!p) return 1; p = realloc(p, size); free(p); } } return 0; } // CHECK: ERROR: invalid chunk type when reallocating address golang-1.8-race-detector-runtime_0.0+svn285455/test/scudo/options.cpp0000664000175000017500000000131612750216742025503 0ustar mwhudsonmwhudson// RUN: %clang_scudo %s -o %t // RUN: %run %t 2>&1 // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=0 %run %t 2>&1 // RUN: SCUDO_OPTIONS=DeallocationTypeMismatch=1 not %run %t 2>&1 | FileCheck %s // Tests that the options can be passed using getScudoDefaultOptions, and that // the environment ones take precedence over them. #include #include extern "C" const char* __scudo_default_options() { return "DeallocationTypeMismatch=0"; // Defaults to true in scudo_flags.inc. } int main(int argc, char **argv) { int *p = (int *)malloc(16); if (!p) return 1; delete p; return 0; } // CHECK: ERROR: allocation type mismatch on address golang-1.8-race-detector-runtime_0.0+svn285455/test/CMakeLists.txt0000664000175000017500000000603412762071353024731 0ustar mwhudsonmwhudson# Needed for lit support include(AddLLVM) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured) # BlocksRuntime and builtins testsuites are not yet ported to lit. # add_subdirectory(BlocksRuntime) # add_subdirectory(builtins) set(SANITIZER_COMMON_LIT_TEST_DEPS) if(COMPILER_RT_STANDALONE_BUILD) add_executable(FileCheck IMPORTED GLOBAL) set_property(TARGET FileCheck PROPERTY IMPORTED_LOCATION ${LLVM_TOOLS_BINARY_DIR}/FileCheck) list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS FileCheck) endif() # When ANDROID, we build tests with the host compiler (i.e. CMAKE_C_COMPILER), # and run tests with tools from the host toolchain. if(NOT ANDROID) if(NOT COMPILER_RT_STANDALONE_BUILD) # Use LLVM utils and Clang from the same build tree. list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS clang clang-headers FileCheck count not llvm-config llvm-nm llvm-objdump llvm-symbolizer compiler-rt-headers sancov) if (COMPILER_RT_HAS_PROFILE) list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile) endif() if (WIN32) list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS KillTheDoctor) endif() endif() if(CMAKE_HOST_UNIX) list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck) endif() endif() # Run sanitizer tests only if we're sure that clang would produce # working binaries. if(COMPILER_RT_CAN_EXECUTE_TESTS) if(COMPILER_RT_HAS_ASAN) add_subdirectory(asan) endif() if(COMPILER_RT_HAS_DFSAN) add_subdirectory(dfsan) endif() if (COMPILER_RT_HAS_INTERCEPTION) add_subdirectory(interception) endif() if(COMPILER_RT_HAS_LSAN) add_subdirectory(lsan) endif() if(COMPILER_RT_HAS_MSAN) add_subdirectory(msan) endif() if(COMPILER_RT_HAS_PROFILE) add_subdirectory(profile) endif() if(COMPILER_RT_HAS_SANITIZER_COMMON) add_subdirectory(sanitizer_common) endif() if(COMPILER_RT_HAS_TSAN) add_subdirectory(tsan) endif() if(COMPILER_RT_HAS_UBSAN) add_subdirectory(ubsan) endif() # CFI tests require diagnostic mode, which is implemented in UBSan. if(COMPILER_RT_HAS_UBSAN) add_subdirectory(cfi) endif() if(COMPILER_RT_HAS_SAFESTACK) add_subdirectory(safestack) endif() if(COMPILER_RT_HAS_ESAN) add_subdirectory(esan) endif() if(COMPILER_RT_HAS_SCUDO) add_subdirectory(scudo) endif() if(COMPILER_RT_HAS_XRAY) add_subdirectory(xray) endif() endif() if(COMPILER_RT_STANDALONE_BUILD) # Now that we've traversed all the directories and know all the lit testsuites, # introduce a rule to run to run all of them. get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) add_lit_target(check-compiler-rt "Running all regression tests" ${LLVM_LIT_TESTSUITES} DEPENDS ${LLVM_LIT_DEPENDS}) if(NOT TARGET check-all) add_custom_target(check-all) endif() add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_LIT_DEPENDS}) add_dependencies(check-all check-compiler-rt) endif() golang-1.8-race-detector-runtime_0.0+svn285455/test/xray/0000775000175000017500000000000013040224621023135 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/xray/CMakeLists.txt0000664000175000017500000000272012757725715025726 0ustar mwhudsonmwhudsonset(XRAY_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(XRAY_TESTSUITES) set(XRAY_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_BUILD_XRAY AND COMPILER_RT_HAS_XRAY) list(APPEND XRAY_TEST_DEPS xray) endif() set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH}) if (COMPILER_RT_BUILD_XRAY AND COMPILER_RT_HAS_XRAY) foreach(arch ${XRAY_TEST_ARCH}) set(XRAY_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}-${OS_NAME}" XRAY_TEST_CONFIG_SUFFIX) if(ANDROID OR ${arch} MATCHES "arm|aarch64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(XRAY_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) set(XRAY_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} XRAY_TEST_TARGET_CFLAGS) string(REPLACE ";" " " XRAY_TEST_TARGET_CFLAGS "${XRAY_TEST_TARGET_CFLAGS}") endif() string(TOUPPER ${arch} ARCH_UPPER_CASE) set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND XRAY_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() endif() add_lit_testsuite(check-xray "Running the XRay tests" ${XRAY_TESTSUITES} DEPENDS ${XRAY_TEST_DEPS}) set_target_properties(check-xray PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/xray/lit.site.cfg.in0000664000175000017500000000100612751774036025775 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.name_suffix = "@XRAY_TEST_CONFIG_SUFFIX@" config.xray_lit_source_dir = "@XRAY_LIT_SOURCE_DIR@" config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@" config.target_arch = "@XRAY_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@XRAY_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/xray/lit.cfg0000664000175000017500000000202212751774036024424 0ustar mwhudsonmwhudson# -*- Python -*- import os # Setup config name. config.name = 'XRay' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup default compiler flags use with -fxray-instrument option. clang_xray_cflags = (['-fxray-instrument', config.target_cflags]) clang_xray_cxxflags = config.cxx_mode_flags + clang_xray_cflags def build_invocation(compile_flags): return ' ' + ' '.join([config.clang] + compile_flags) + ' ' # Setup substitutions. config.substitutions.append( ('%clang ', build_invocation([config.target_cflags]))) config.substitutions.append( ('%clangxx ', build_invocation(config.cxx_mode_flags + [config.target_cflags]))) config.substitutions.append( ('%clang_xray ', build_invocation(clang_xray_cflags))) config.substitutions.append( ('%clangxx_xray', build_invocation(clang_xray_cxxflags))) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] if config.host_os not in ['Linux'] or config.host_arch.find('64') == -1: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/xray/TestCases/0000775000175000017500000000000013040224621025033 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/xray/TestCases/Linux/0000775000175000017500000000000013040224621026132 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/xray/TestCases/Linux/patching-unpatching.cc0000664000175000017500000000273212751774036032422 0ustar mwhudsonmwhudson// Check that we can patch and un-patch on demand, and that logging gets invoked // appropriately. // // RUN: %clangxx_xray -fxray-instrument -std=c++11 %s -o %t // RUN: XRAY_OPTIONS="patch_premain=false" %run %t 2>&1 | FileCheck %s #include "xray/xray_interface.h" #include bool called = false; void test_handler(int32_t fid, XRayEntryType type) { printf("called: %d, type=%d\n", fid, static_cast(type)); called = true; } [[clang::xray_always_instrument]] void always_instrument() { printf("always instrumented called\n"); } int main() { __xray_set_handler(test_handler); always_instrument(); // CHECK: always instrumented called auto status = __xray_patch(); printf("patching status: %d\n", static_cast(status)); // CHECK-NEXT: patching status: 1 always_instrument(); // CHECK-NEXT: called: {{.*}}, type=0 // CHECK-NEXT: always instrumented called // CHECK-NEXT: called: {{.*}}, type=1 status = __xray_unpatch(); printf("patching status: %d\n", static_cast(status)); // CHECK-NEXT: patching status: 1 always_instrument(); // CHECK-NEXT: always instrumented called status = __xray_patch(); printf("patching status: %d\n", static_cast(status)); // CHECK-NEXT: patching status: 1 __xray_remove_handler(); always_instrument(); // CHECK-NEXT: always instrumented called status = __xray_unpatch(); printf("patching status: %d\n", static_cast(status)); // CHECK-NEXT: patching status: 1 } golang-1.8-race-detector-runtime_0.0+svn285455/test/xray/TestCases/Linux/fixedsize-logging.cc0000664000175000017500000000102212757762045032077 0ustar mwhudsonmwhudson// Check to make sure that we have a log file with a fixed-size. // RUN: %clangxx_xray -std=c++11 %s -o %t // RUN: XRAY_OPTIONS="verbosity=1 xray_logfile_base=fixedsize-logging-" %run %t 2>&1 | FileCheck %s // // After all that, clean up the output xray log. // // RUN: rm fixedsize-logging-* #include [[clang::xray_always_instrument]] void foo() { printf("foo() is always instrumented!"); } int main() { // CHECK: XRay: Log file in 'fixedsize-logging-{{.*}}' foo(); // CHECK: foo() is always instrumented! } golang-1.8-race-detector-runtime_0.0+svn285455/test/xray/TestCases/Linux/optional-inmemory-log.cc0000664000175000017500000000120212757762045032722 0ustar mwhudsonmwhudson// Make sure that we don't get the inmemory logging implementation enabled when // we turn it off via options. // RUN: %clangxx_xray -std=c++11 %s -o %t // RUN: XRAY_OPTIONS="verbosity=1 xray_naive_log=false xray_logfile_base=optional-inmemory-log.xray-" %run %t 2>&1 | FileCheck %s // // Make sure we clean out the logs in case there was a bug. // // RUN: rm -f optional-inmemory-log.xray-* #include [[clang::xray_always_instrument]] void foo() { printf("foo() is always instrumented!"); } int main() { // CHECK-NOT: XRay: Log file in 'optional-inmemory-log.xray-{{.*}}' foo(); // CHECK: foo() is always instrumented! } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/0000775000175000017500000000000013040224625022717 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/0000775000175000017500000000000013040224625024633 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/dlopen.cpp0000664000175000017500000001043112652466737026643 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -DSHARED_LIB %s -fPIC -shared -o %t1-so.so // RUN: %clangxx_cfi_dso %s -o %t1 // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t1 cast 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %expect_crash %t1 dlclose 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_dso -DB32 -DSHARED_LIB %s -fPIC -shared -o %t2-so.so // RUN: %clangxx_cfi_dso -DB32 %s -o %t2 // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t2 cast 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %expect_crash %t2 dlclose 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_dso -DB64 -DSHARED_LIB %s -fPIC -shared -o %t3-so.so // RUN: %clangxx_cfi_dso -DB64 %s -o %t3 // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t3 cast 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %expect_crash %t3 dlclose 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_dso -DBM -DSHARED_LIB %s -fPIC -shared -o %t4-so.so // RUN: %clangxx_cfi_dso -DBM %s -o %t4 // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t4 cast 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %expect_crash %t4 dlclose 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -g -DBM -DSHARED_LIB -DNOCFI %s -fPIC -shared -o %t5-so.so // RUN: %clangxx -g -DBM -DNOCFI %s -ldl -o %t5 // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t5 cast 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t5 dlclose 2>&1 | FileCheck --check-prefix=NCFI %s // Test that calls to uninstrumented library are unchecked. // RUN: %clangxx -DBM -DSHARED_LIB %s -fPIC -shared -o %t6-so.so // RUN: %clangxx_cfi_dso -DBM %s -o %t6 // RUN: %t6 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t6 cast 2>&1 | FileCheck --check-prefix=NCFI %s // Call-after-dlclose is checked on the caller side. // RUN: %expect_crash %t6 dlclose 2>&1 | FileCheck --check-prefix=CFI %s // Tests calls into dlopen-ed library. // REQUIRES: cxxabi #include #include #include #include #include #include #include struct A { virtual void f(); }; #ifdef SHARED_LIB #include "../utils.h" struct B { virtual void f(); }; void B::f() {} extern "C" void *create_B() { create_derivers(); return (void *)(new B()); } extern "C" __attribute__((aligned(4096))) void do_nothing() {} #else void A::f() {} static const int kCodeAlign = 4096; static const int kCodeSize = 4096; static char saved_code[kCodeSize]; static char *real_start; static void save_code(char *p) { real_start = (char *)(((uintptr_t)p) & ~(kCodeAlign - 1)); memcpy(saved_code, real_start, kCodeSize); } static void restore_code() { char *code = (char *)mmap(real_start, kCodeSize, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, 0, 0); assert(code == real_start); memcpy(code, saved_code, kCodeSize); } int main(int argc, char *argv[]) { const bool test_cast = argc > 1 && strcmp(argv[1], "cast") == 0; const bool test_dlclose = argc > 1 && strcmp(argv[1], "dlclose") == 0; std::string name = std::string(argv[0]) + "-so.so"; void *handle = dlopen(name.c_str(), RTLD_NOW); assert(handle); void *(*create_B)() = (void *(*)())dlsym(handle, "create_B"); assert(create_B); void *p = create_B(); A *a; // CFI: =0= // CFI-CAST: =0= // NCFI: =0= fprintf(stderr, "=0=\n"); if (test_cast) { // Test cast. BOOM. a = (A*)p; } else { // Invisible to CFI. Test virtual call later. memcpy(&a, &p, sizeof(a)); } // CFI: =1= // CFI-CAST-NOT: =1= // NCFI: =1= fprintf(stderr, "=1=\n"); if (test_dlclose) { // Imitate an attacker sneaking in an executable page where a dlclose()d // library was loaded. This needs to pass w/o CFI, so for the testing // purpose, we just copy the bytes of a "void f() {}" function back and // forth. void (*do_nothing)() = (void (*)())dlsym(handle, "do_nothing"); assert(do_nothing); save_code((char *)do_nothing); int res = dlclose(handle); assert(res == 0); restore_code(); do_nothing(); // UB here } else { a->f(); // UB here } // CFI-NOT: =2= // CFI-CAST-NOT: =2= // NCFI: =2= fprintf(stderr, "=2=\n"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/lit.local.cfg0000664000175000017500000000026612634127462027212 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Linux']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/target_out_of_bounds.cpp0000664000175000017500000000520112654476330031564 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso_diag -std=c++11 %s -o %t // RUN: %t zero 2>&1 | FileCheck --check-prefix=CHECK-ZERO %s // RUN: %t unaddressable 2>&1 | FileCheck --check-prefix=CHECK-UNADDR %s // RUN: %t 2>&1 | FileCheck --check-prefix=CHECK-TYPEINFO %s // RUN: %clangxx_cfi_diag -std=c++11 %s -o %t2 // RUN: %t2 zero 2>&1 | FileCheck --check-prefix=CHECK-ZERO %s // RUN: %t2 unaddressable 2>&1 | FileCheck --check-prefix=CHECK-UNADDR %s // RUN: %t2 2>&1 | FileCheck --check-prefix=CHECK-TYPEINFO %s // REQUIRES: cxxabi #include #include #include #include #include struct A { virtual void f(); }; void A::f() {} int main(int argc, char *argv[]) { char *volatile p = reinterpret_cast(new A()); if (argc > 1 && strcmp(argv[1], "unaddressable") == 0) { void *vtable = mmap(nullptr, 4096, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); // Create an object with a vtable in an unaddressable memory region. *(uintptr_t *)p = (uintptr_t)vtable + 64; // CHECK-UNADDR: runtime error: control flow integrity check for type 'A' failed during cast // CHECK-UNADDR: note: invalid vtable // CHECK-UNADDR: // CHECK-UNADDR: runtime error: control flow integrity check for type 'A' failed during cast // CHECK-UNADDR: note: invalid vtable // CHECK-UNADDR: } else if (argc > 1 && strcmp(argv[1], "zero") == 0) { // Create an object with a vtable outside of any known DSO, but still in an // addressable area. void *vtable = calloc(1, 128); *(uintptr_t *)p = (uintptr_t)vtable + 64; // CHECK-ZERO: runtime error: control flow integrity check for type 'A' failed during cast // CHECK-ZERO: note: invalid vtable // CHECK-ZERO: 00 00 00 00 00 00 00 00 // CHECK-ZERO: runtime error: control flow integrity check for type 'A' failed during cast // CHECK-ZERO: note: invalid vtable // CHECK-ZERO: 00 00 00 00 00 00 00 00 } else { // Create an object with a seemingly fine vtable, but with an unaddressable // typeinfo pointer. void *vtable = calloc(1, 128); memset(vtable, 0xFE, 128); *(uintptr_t *)p = (uintptr_t)vtable + 64; // CHECK-TYPEINFO: runtime error: control flow integrity check for type 'A' failed during cast // CHECK-TYPEINFO: note: invalid vtable // CHECK-TYPEINFO: fe fe fe fe fe fe fe fe // CHECK-TYPEINFO: runtime error: control flow integrity check for type 'A' failed during cast // CHECK-TYPEINFO: note: invalid vtable // CHECK-TYPEINFO: fe fe fe fe fe fe fe fe } A *volatile pa = reinterpret_cast(p); pa = reinterpret_cast(p); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/simple-pass.cpp0000664000175000017500000000313712634115621027603 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -DSHARED_LIB %s -fPIC -shared -o %t1-so.so // RUN: %clangxx_cfi_dso %s -o %t1 %t1-so.so // RUN: %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_dso -DB32 -DSHARED_LIB %s -fPIC -shared -o %t2-so.so // RUN: %clangxx_cfi_dso -DB32 %s -o %t2 %t2-so.so // RUN: %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_dso -DB64 -DSHARED_LIB %s -fPIC -shared -o %t3-so.so // RUN: %clangxx_cfi_dso -DB64 %s -o %t3 %t3-so.so // RUN: %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_dso -DBM -DSHARED_LIB %s -fPIC -shared -o %t4-so.so // RUN: %clangxx_cfi_dso -DBM %s -o %t4 %t4-so.so // RUN: %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -DBM -DSHARED_LIB %s -fPIC -shared -o %t5-so.so // RUN: %clangxx -DBM %s -o %t5 %t5-so.so // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t5 x 2>&1 | FileCheck --check-prefix=NCFI %s // Tests that the CFI mechanism crashes the program when making a virtual call // to an object of the wrong class but with a compatible vtable, by casting a // pointer to such an object and attempting to make a call through it. // REQUIRES: cxxabi #include #include struct A { virtual void f(); }; A *create_B(); #ifdef SHARED_LIB #include "../utils.h" struct B : public A { virtual void f(); }; void B::f() {} A *create_B() { create_derivers(); return new B(); } #else void A::f() {} int main(int argc, char *argv[]) { A *a = create_B(); // CFI: =1= // NCFI: =1= fprintf(stderr, "=1=\n"); a->f(); // OK // CFI: =2= // NCFI: =2= fprintf(stderr, "=2=\n"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/stats.cpp0000664000175000017500000000246612646307541026517 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -DSHARED_LIB -fPIC -g -fsanitize-stats -shared -o %t.so %s // RUN: %clangxx_cfi_dso -g -fsanitize-stats -o %t %s %t.so // RUN: env SANITIZER_STATS_PATH=%t.stats %t // RUN: sanstats %t.stats | FileCheck %s struct ABase {}; struct A : ABase { virtual void vf() {} void nvf() {} }; extern "C" void vcall(A *a); extern "C" void nvcall(A *a); #ifdef SHARED_LIB extern "C" __attribute__((noinline)) void vcall(A *a) { // CHECK: stats.cpp:[[@LINE+1]] vcall cfi-vcall 37 a->vf(); } extern "C" __attribute__((noinline)) void nvcall(A *a) { // CHECK: stats.cpp:[[@LINE+1]] nvcall cfi-nvcall 51 a->nvf(); } #else extern "C" __attribute__((noinline)) A *dcast(A *a) { // CHECK: stats.cpp:[[@LINE+1]] dcast cfi-derived-cast 24 return (A *)(ABase *)a; } extern "C" __attribute__((noinline)) A *ucast(A *a) { // CHECK: stats.cpp:[[@LINE+1]] ucast cfi-unrelated-cast 81 return (A *)(char *)a; } extern "C" __attribute__((noinline)) void unreachable(A *a) { // CHECK-NOT: unreachable a->vf(); } int main() { A a; for (unsigned i = 0; i != 37; ++i) vcall(&a); for (unsigned i = 0; i != 51; ++i) nvcall(&a); for (unsigned i = 0; i != 24; ++i) dcast(&a); for (unsigned i = 0; i != 81; ++i) ucast(&a); for (unsigned i = 0; i != 0; ++i) unreachable(&a); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/simple-fail.cpp0000664000175000017500000000612312651530416027550 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -DSHARED_LIB %s -fPIC -shared -o %t1-so.so // RUN: %clangxx_cfi_dso %s -o %t1 %t1-so.so // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t1 x 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %clangxx_cfi_dso -DB32 -DSHARED_LIB %s -fPIC -shared -o %t2-so.so // RUN: %clangxx_cfi_dso -DB32 %s -o %t2 %t2-so.so // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t2 x 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %clangxx_cfi_dso -DB64 -DSHARED_LIB %s -fPIC -shared -o %t3-so.so // RUN: %clangxx_cfi_dso -DB64 %s -o %t3 %t3-so.so // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t3 x 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %clangxx_cfi_dso -DBM -DSHARED_LIB %s -fPIC -shared -o %t4-so.so // RUN: %clangxx_cfi_dso -DBM %s -o %t4 %t4-so.so // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t4 x 2>&1 | FileCheck --check-prefix=CFI-CAST %s // RUN: %clangxx -DBM -DSHARED_LIB %s -fPIC -shared -o %t5-so.so // RUN: %clangxx -DBM %s -o %t5 %t5-so.so // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t5 x 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx -DBM -DSHARED_LIB %s -fPIC -shared -o %t6-so.so // RUN: %clangxx_cfi_dso -DBM %s -o %t6 %t6-so.so // RUN: %t6 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t6 x 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi_dso_diag -DSHARED_LIB %s -fPIC -shared -o %t7-so.so // RUN: %clangxx_cfi_dso_diag %s -o %t7 %t7-so.so // RUN: %t7 2>&1 | FileCheck --check-prefix=CFI-DIAG-CALL %s // RUN: %t7 x 2>&1 | FileCheck --check-prefix=CFI-DIAG-CALL --check-prefix=CFI-DIAG-CAST %s // Tests that the CFI mechanism crashes the program when making a virtual call // to an object of the wrong class but with a compatible vtable, by casting a // pointer to such an object and attempting to make a call through it. // REQUIRES: cxxabi #include #include struct A { virtual void f(); }; void *create_B(); #ifdef SHARED_LIB #include "../utils.h" struct B { virtual void f(); }; void B::f() {} void *create_B() { create_derivers(); return (void *)(new B()); } #else void A::f() {} int main(int argc, char *argv[]) { void *p = create_B(); A *a; // CFI: =0= // CFI-CAST: =0= // NCFI: =0= fprintf(stderr, "=0=\n"); if (argc > 1 && argv[1][0] == 'x') { // Test cast. BOOM. // CFI-DIAG-CAST: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type // CFI-DIAG-CAST-NEXT: note: vtable is of type '{{(struct )?}}B' a = (A*)p; } else { // Invisible to CFI. Test virtual call later. memcpy(&a, &p, sizeof(a)); } // CFI: =1= // CFI-CAST-NOT: =1= // NCFI: =1= fprintf(stderr, "=1=\n"); // CFI-DIAG-CALL: runtime error: control flow integrity check for type 'A' failed during virtual call // CFI-DIAG-CALL-NEXT: note: vtable is of type '{{(struct )?}}B' a->f(); // UB here // CFI-NOT: =2= // CFI-CAST-NOT: =2= // NCFI: =2= fprintf(stderr, "=2=\n"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/shadow_is_read_only.cpp0000664000175000017500000000430212651757722031372 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -std=c++11 -g -DSHARED_LIB %s -fPIC -shared -o %t-cfi-so.so // RUN: %clangxx -std=c++11 -g -DSHARED_LIB %s -fPIC -shared -o %t-nocfi-so.so // RUN: %clangxx_cfi_dso -std=c++11 -g %s -o %t // RUN: %expect_crash %t start 2>&1 | FileCheck %s // RUN: %expect_crash %t mmap 2>&1 | FileCheck %s // RUN: %expect_crash %t dlopen %t-cfi-so.so 2>&1 | FileCheck %s // RUN: %expect_crash %t dlclose %t-cfi-so.so 2>&1 | FileCheck %s // RUN: %expect_crash %t dlopen %t-nocfi-so.so 2>&1 | FileCheck %s // RUN: %expect_crash %t dlclose %t-nocfi-so.so 2>&1 | FileCheck %s // Tests that shadow is read-only most of the time. // REQUIRES: cxxabi #include #include #include #include #include #include #include struct A { virtual void f(); }; #ifdef SHARED_LIB void A::f() {} extern "C" A *create_A() { return new A(); } #else constexpr unsigned kShadowGranularity = 12; namespace __cfi { uintptr_t GetShadow(); } void write_shadow(void *ptr) { uintptr_t base = __cfi::GetShadow(); uint16_t *s = (uint16_t *)(base + (((uintptr_t)ptr >> kShadowGranularity) << 1)); fprintf(stderr, "going to crash\n"); // CHECK: going to crash *s = 42; fprintf(stderr, "did not crash\n"); // CHECK-NOT: did not crash exit(1); } int main(int argc, char *argv[]) { assert(argc > 1); const bool test_mmap = strcmp(argv[1], "mmap") == 0; const bool test_start = strcmp(argv[1], "start") == 0; const bool test_dlopen = strcmp(argv[1], "dlopen") == 0; const bool test_dlclose = strcmp(argv[1], "dlclose") == 0; const char *lib = argc > 2 ? argv[2] : nullptr; if (test_start) write_shadow((void *)&main); if (test_mmap) { void *p = mmap(nullptr, 1 << 20, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); assert(p != MAP_FAILED); write_shadow((char *)p + 100); } else { void *handle = dlopen(lib, RTLD_NOW); assert(handle); void *create_A = dlsym(handle, "create_A"); assert(create_A); if (test_dlopen) write_shadow(create_A); int res = dlclose(handle); assert(res == 0); if (test_dlclose) write_shadow(create_A); } } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/icall/0000775000175000017500000000000013040224625025717 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/icall/lit.local.cfg0000664000175000017500000000022412634115621030262 0ustar mwhudsonmwhudson# The cfi-icall checker is only supported on x86 and x86_64 for now. if config.root.host_arch not in ['x86', 'x86_64']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/icall/icall-from-dso.cpp0000664000175000017500000000155212651530416031243 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_cfi_dso %s -o %t %t-so.so && %expect_crash %t 2>&1 | FileCheck %s // RUN: %clangxx_cfi_dso_diag -g -DSHARED_LIB %s -fPIC -shared -o %t2-so.so // RUN: %clangxx_cfi_dso_diag -g %s -o %t2 %t2-so.so && %t2 2>&1 | FileCheck %s --check-prefix=CFI-DIAG #include #ifdef SHARED_LIB void g(); void f() { // CHECK-DIAG: =1= // CHECK: =1= fprintf(stderr, "=1=\n"); ((void (*)(void))g)(); // CHECK-DIAG: =2= // CHECK: =2= fprintf(stderr, "=2=\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'void (int)' failed during indirect function call // CFI-DIAG-NEXT: note: g() defined here ((void (*)(int))g)(42); // UB here // CHECK-DIAG: =3= // CHECK-NOT: =3= fprintf(stderr, "=3=\n"); } #else void f(); void g() { } int main() { f(); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/icall/icall.cpp0000664000175000017500000000151312651530416027514 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_dso -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_cfi_dso %s -o %t %t-so.so && %expect_crash %t 2>&1 | FileCheck %s // RUN: %clangxx_cfi_dso_diag -g -DSHARED_LIB %s -fPIC -shared -o %t2-so.so // RUN: %clangxx_cfi_dso_diag -g %s -o %t2 %t2-so.so && %t2 2>&1 | FileCheck %s --check-prefix=CFI-DIAG #include #ifdef SHARED_LIB void f() { } #else void f(); int main() { // CHECK-DIAG: =1= // CHECK: =1= fprintf(stderr, "=1=\n"); ((void (*)(void))f)(); // CHECK-DIAG: =2= // CHECK: =2= fprintf(stderr, "=2=\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'void (int)' failed during indirect function call // CFI-DIAG-NEXT: note: f() defined here ((void (*)(int))f)(42); // UB here // CHECK-DIAG: =3= // CHECK-NOT: =3= fprintf(stderr, "=3=\n"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/cross-dso/icall/diag.cpp0000664000175000017500000001360612652231536027344 0ustar mwhudsonmwhudson// Cross-DSO diagnostics. // The rules are: // * If the library needs diagnostics, the main executable must request at // least some diagnostics as well (to link the diagnostic runtime). // * -fsanitize-trap on the caller side overrides everything. // * otherwise, the callee decides between trap/recover/norecover. // Full-recover. // RUN: %clangxx_cfi_dso_diag -g -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_cfi_dso_diag -g %s -o %t %t-so.so // RUN: %t icv 2>&1 | FileCheck %s --check-prefix=ICALL-DIAG --check-prefix=CAST-DIAG \ // RUN: --check-prefix=VCALL-DIAG --check-prefix=ALL-RECOVER // RUN: %t i_v 2>&1 | FileCheck %s --check-prefix=ICALL-DIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-DIAG --check-prefix=ALL-RECOVER // RUN: %t _cv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-DIAG \ // RUN: --check-prefix=VCALL-DIAG --check-prefix=ALL-RECOVER // RUN: %t ic_ 2>&1 | FileCheck %s --check-prefix=ICALL-DIAG --check-prefix=CAST-DIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=ALL-RECOVER // Trap on icall, no-recover on cast. // RUN: %clangxx_cfi_dso_diag -fsanitize-trap=cfi-icall -fno-sanitize-recover=cfi-unrelated-cast \ // RUN: -g -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_cfi_dso_diag -fsanitize-trap=cfi-icall -fno-sanitize-recover=cfi-unrelated-cast \ // RUN: -g %s -o %t %t-so.so // RUN: %expect_crash %t icv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=ICALL-FATAL // RUN: not %t _cv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-DIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=CAST-FATAL // RUN: %t __v 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-DIAG // Callee: trap on icall, no-recover on cast. // Caller: recover on everything. // The same as in the previous case, behaviour is decided by the callee. // RUN: %clangxx_cfi_dso_diag -fsanitize-trap=cfi-icall -fno-sanitize-recover=cfi-unrelated-cast \ // RUN: -g -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_cfi_dso_diag \ // RUN: -g %s -o %t %t-so.so // RUN: %expect_crash %t icv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=ICALL-FATAL // RUN: not %t _cv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-DIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=CAST-FATAL // RUN: %t __v 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-DIAG // Caller in trapping mode, callee with full diagnostic+recover. // Caller wins. // cfi-nvcall is non-trapping in the main executable to link the diagnostic runtime library. // RUN: %clangxx_cfi_dso_diag \ // RUN: -g -DSHARED_LIB %s -fPIC -shared -o %t-so.so // RUN: %clangxx_cfi_dso -fno-sanitize-trap=cfi-nvcall \ // RUN: -g %s -o %t %t-so.so // RUN: %expect_crash %t icv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=ICALL-FATAL // RUN: %expect_crash %t _cv 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=CAST-FATAL // RUN: %expect_crash %t __v 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \ // RUN: --check-prefix=VCALL-NODIAG --check-prefix=VCALL-FATAL // REQUIRES: cxxabi #include #include #include struct A { virtual void f(); }; void *create_B(); #ifdef SHARED_LIB #include "../../utils.h" struct B { virtual void f(); }; void B::f() {} void *create_B() { create_derivers(); return (void *)(new B()); } #else void A::f() {} int main(int argc, char *argv[]) { assert(argc == 2); assert(strlen(argv[1]) == 3); // ICALL-FATAL: =0= // CAST-FATAL: =0= // VCALL-FATAL: =0= // ALL-RECOVER: =0= fprintf(stderr, "=0=\n"); void *p; if (argv[1][0] == 'i') { // ICALL-DIAG: runtime error: control flow integrity check for type 'void *(int)' failed during indirect function call // ICALL-DIAG-NEXT: note: create_B() defined here // ICALL-NODIAG-NOT: runtime error: control flow integrity check {{.*}} during indirect function call p = ((void *(*)(int))create_B)(42); } else { p = create_B(); } // ICALL-FATAL-NOT: =1= // CAST-FATAL: =1= // VCALL-FATAL: =1= // ALL-RECOVER: =1= fprintf(stderr, "=1=\n"); A *a; if (argv[1][1] == 'c') { // CAST-DIAG: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type // CAST-DIAG-NEXT: note: vtable is of type '{{(struct )?}}B' // CAST-NODIAG-NOT: runtime error: control flow integrity check {{.*}} during cast to unrelated type a = (A*)p; } else { // Invisible to CFI. memcpy(&a, &p, sizeof(a)); } // ICALL-FATAL-NOT: =2= // CAST-FATAL-NOT: =2= // VCALL-FATAL: =2= // ALL-RECOVER: =2= fprintf(stderr, "=2=\n"); // VCALL-DIAG: runtime error: control flow integrity check for type 'A' failed during virtual call // VCALL-DIAG-NEXT: note: vtable is of type '{{(struct )?}}B' // VCALL-NODIAG-NOT: runtime error: control flow integrity check {{.*}} during virtual call if (argv[1][2] == 'v') { a->f(); // UB here } // ICALL-FATAL-NOT: =3= // CAST-FATAL-NOT: =3= // VCALL-FATAL-NOT: =3= // ALL-RECOVER: =3= fprintf(stderr, "=3=\n"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/utils.h0000664000175000017500000000346512556213635024252 0ustar mwhudsonmwhudson#ifndef UTILS_H #define UTILS_H inline void break_optimization(void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } // Tests will instantiate this class to pad out bit sets to test out the // various ways we can represent the bit set (32-bit inline, 64-bit inline, // memory). Instantiating this class will trigger the instantiation of I // templates with I virtual tables for classes deriving from T, I-2 of which // will be of size sizeof(void*) * 5, 1 of which will be of size sizeof(void*) // * 3, and 1 of which will be of size sizeof(void*) * 9. (Under the MS ABI // each virtual table will be sizeof(void*) bytes smaller). Each category // of virtual tables is aligned to a different power of 2, precluding the // all-ones optimization. As a result, the bit vector for the base class will // need to contain at least I*2 entries to accommodate all the derived virtual // tables. template struct Deriver : T { Deriver() { break_optimization(new Deriver); } virtual void f() {} virtual void g() {} virtual void h() {} }; template struct Deriver : T { virtual void f() {} void g() {} }; template struct Deriver : T { Deriver() { break_optimization(new Deriver); } virtual void f() {} virtual void g() {} virtual void h() {} virtual void i() {} virtual void j() {} virtual void k() {} virtual void l() {} }; // Instantiate enough classes to force CFI checks for type T to use bit // vectors of size 32 (if B32 defined), 64 (if B64 defined) or >64 (if BM // defined). template void create_derivers() { #ifdef B32 break_optimization(new Deriver); #endif #ifdef B64 break_optimization(new Deriver); #endif #ifdef BM break_optimization(new Deriver); #endif } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/README.txt0000664000175000017500000000051212507107140024412 0ustar mwhudsonmwhudsonThe tests in this directory use a common convention for exercising the functionality associated with bit sets of different sizes. When certain macros are defined the tests instantiate classes that force the bit sets to be of certain sizes. - B32 forces 32-bit bit sets. - B64 forces 64-bit bit sets. - BM forces memory bit sets. golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/simple-pass.cpp0000664000175000017500000000306212751002603025657 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t %s // RUN: %t // Tests that the CFI mechanism does not crash the program when making various // kinds of valid calls involving classes with various different linkages and // types of inheritance, and both virtual and non-virtual member functions. #include "utils.h" struct A { virtual void f(); void g(); }; void A::f() {} void A::g() {} struct A2 : A { virtual void f(); void g(); }; void A2::f() {} void A2::g() {} struct B { virtual void f() {} void g() {} }; struct B2 : B { virtual void f() {} void g() {} }; namespace { struct C { virtual void f(); void g(); }; void C::f() {} void C::g() {} struct C2 : C { virtual void f(); void g(); }; void C2::f() {} void C2::g() {} struct D { virtual void f() {} void g() {} }; struct D2 : D { virtual void f() {} void g() {} }; } struct E { virtual void f() {} void g() {} }; struct E2 : virtual E { virtual void f() {} void g() {} }; int main() { A *a = new A; break_optimization(a); a->f(); a->g(); a = new A2; break_optimization(a); a->f(); a->g(); B *b = new B; break_optimization(b); b->f(); b->g(); b = new B2; break_optimization(b); b->f(); b->g(); C *c = new C; break_optimization(c); c->f(); c->g(); c = new C2; break_optimization(c); c->f(); c->g(); D *d = new D; break_optimization(d); d->f(); d->g(); d = new D2; break_optimization(d); d->f(); d->g(); E *e = new E; break_optimization(e); e->f(); e->g(); e = new E2; break_optimization(e); e->f(); e->g(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/target_uninstrumented.cpp0000664000175000017500000000171312654476330030073 0ustar mwhudsonmwhudson// RUN: %clangxx -g -DSHARED_LIB %s -fPIC -shared -o %T/target_uninstrumented-so.so // RUN: %clangxx_cfi_diag -g %s -o %t %T/target_uninstrumented-so.so // RUN: %t 2>&1 | FileCheck %s // REQUIRES: cxxabi #include #include struct A { virtual void f(); }; void *create_B(); #ifdef SHARED_LIB struct B { virtual void f(); }; void B::f() {} void *create_B() { return (void *)(new B()); } #else void A::f() {} int main(int argc, char *argv[]) { void *p = create_B(); // CHECK: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type // CHECK: invalid vtable in module {{.*}}target_uninstrumented-so.so A *a = (A *)p; memset(p, 0, sizeof(A)); // CHECK: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type // CHECK-NOT: invalid vtable in module // CHECK: invalid vtable a = (A *)p; // CHECK: done fprintf(stderr, "done %p\n", a); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/overwrite.cpp0000664000175000017500000000317412733347466025477 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash_unless_devirt %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -o %t5 %s // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi_diag -o %t6 %s // RUN: %t6 2>&1 | FileCheck --check-prefix=CFI-DIAG %s // Tests that the CFI mechanism crashes the program when a virtual table is // replaced with a compatible table of function pointers that does not belong to // any class, by manually overwriting the virtual table of an object and // attempting to make a call through it. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual void f(); }; void A::f() {} void foo() { fprintf(stderr, "foo\n"); } void *fake_vtable[] = { 0, 0, (void *)&foo }; int main() { create_derivers(); A *a = new A; *((void **)a) = fake_vtable + 2; // UB here break_optimization(a); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-NOT: foo // NCFI: foo // CFI-DIAG: runtime error: control flow integrity check for type 'A' failed during virtual call // CFI-DIAG-NEXT: note: invalid vtable a->f(); // We don't check for the absence of a 2 here because under devirtualization // our virtual call may be devirtualized and we will proceed with execution // rather than crashing. // NCFI: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/stats.cpp0000664000175000017500000000236312770543057024601 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -g -fsanitize-stats -o %t %s // RUN: env SANITIZER_STATS_PATH=%t.stats %t // RUN: sanstats %t.stats | FileCheck %s // FIXME: We currently emit the wrong debug info under devirtualization. // UNSUPPORTED: devirt struct ABase {}; struct A : ABase { virtual void vf() {} void nvf() {} }; extern "C" __attribute__((noinline)) void vcall(A *a) { // CHECK: stats.cpp:[[@LINE+1]] {{_?}}vcall cfi-vcall 37 a->vf(); } extern "C" __attribute__((noinline)) void nvcall(A *a) { // CHECK: stats.cpp:[[@LINE+1]] {{_?}}nvcall cfi-nvcall 51 a->nvf(); } extern "C" __attribute__((noinline)) A *dcast(A *a) { // CHECK: stats.cpp:[[@LINE+1]] {{_?}}dcast cfi-derived-cast 24 return (A *)(ABase *)a; } extern "C" __attribute__((noinline)) A *ucast(A *a) { // CHECK: stats.cpp:[[@LINE+1]] {{_?}}ucast cfi-unrelated-cast 81 return (A *)(char *)a; } extern "C" __attribute__((noinline)) void unreachable(A *a) { // CHECK-NOT: unreachable a->vf(); } int main() { A a; for (unsigned i = 0; i != 37; ++i) vcall(&a); for (unsigned i = 0; i != 51; ++i) nvcall(&a); for (unsigned i = 0; i != 24; ++i) dcast(&a); for (unsigned i = 0; i != 81; ++i) ucast(&a); for (unsigned i = 0; i != 0; ++i) unreachable(&a); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/multiple-inheritance.cpp0000664000175000017500000000377112751002603027553 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t1 x 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t2 x 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t3 x 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %expect_crash %t4 x 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -o %t5 %s // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %t5 x 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi_diag -o %t6 %s // RUN: %t6 2>&1 | FileCheck --check-prefix=CFI-DIAG2 %s // RUN: %t6 x 2>&1 | FileCheck --check-prefix=CFI-DIAG1 %s // Tests that the CFI mechanism is sensitive to multiple inheritance and only // permits calls via virtual tables for the correct base class. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual void f() = 0; }; struct B { virtual void g() = 0; }; struct C : A, B { virtual void f(), g(); }; void C::f() {} void C::g() {} int main(int argc, char **argv) { create_derivers(); create_derivers(); C *c = new C; break_optimization(c); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); if (argc > 1) { A *a = c; // CFI-DIAG1: runtime error: control flow integrity check for type 'B' failed during cast to unrelated type // CFI-DIAG1-NEXT: note: vtable is of type '{{(struct )?}}C' ((B *)a)->g(); // UB here } else { // CFI-DIAG2: runtime error: control flow integrity check for type 'A' failed during cast to unrelated type // CFI-DIAG2-NEXT: note: vtable is of type '{{(struct )?}}C' B *b = c; ((A *)b)->f(); // UB here } // CFI-NOT: {{^2$}} // NCFI: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/bad-cast.cpp0000664000175000017500000001143512556213635025117 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 a 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t1 b 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t1 c 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t1 d 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t1 e 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t1 f 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %expect_crash %t1 g 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t1 h 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 a 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t2 b 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t2 c 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t2 d 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t2 e 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t2 f 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %expect_crash %t2 g 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t2 h 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 a 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t3 b 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t3 c 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t3 d 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t3 e 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t3 f 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %expect_crash %t3 g 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t3 h 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 a 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t4 b 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t4 c 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t4 d 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t4 e 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t4 f 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %expect_crash %t4 g 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %t4 h 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %clangxx_cfi -fsanitize=cfi-cast-strict -o %t5 %s // RUN: %expect_crash %t5 a 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 b 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 c 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 d 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 e 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 f 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 g 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %expect_crash %t5 h 2>&1 | FileCheck --check-prefix=FAIL %s // RUN: %clangxx -o %t6 %s // RUN: %t6 a 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 b 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 c 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 d 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 e 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 f 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 g 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %t6 h 2>&1 | FileCheck --check-prefix=PASS %s // RUN: %clangxx_cfi_diag -o %t7 %s // RUN: %t7 a 2>&1 | FileCheck --check-prefix=CFI-DIAG-D %s // RUN: %t7 b 2>&1 | FileCheck --check-prefix=CFI-DIAG-D %s // RUN: %t7 c 2>&1 | FileCheck --check-prefix=CFI-DIAG-D %s // RUN: %t7 g 2>&1 | FileCheck --check-prefix=CFI-DIAG-U %s // Tests that the CFI enforcement detects bad casts. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual void f(); }; void A::f() {} struct B : A { virtual void f(); }; void B::f() {} struct C : A { }; int main(int argc, char **argv) { create_derivers(); B *b = new B; break_optimization(b); // FAIL: 1 // PASS: 1 fprintf(stderr, "1\n"); A a; // CFI-DIAG-D: runtime error: control flow integrity check for type 'B' failed during base-to-derived cast // CFI-DIAG-D-NEXT: note: vtable is of type '{{(struct )?}}A' // CFI-DIAG-U: runtime error: control flow integrity check for type 'B' failed during cast to unrelated type // CFI-DIAG-U-NEXT: note: vtable is of type '{{(struct )?}}A' switch (argv[1][0]) { case 'a': static_cast(&a); // UB break; case 'b': static_cast(a); // UB break; case 'c': static_cast(a); // UB break; case 'd': static_cast(&a); // UB, strict only break; case 'e': static_cast(a); // UB, strict only break; case 'f': static_cast(a); // UB, strict only break; case 'g': static_cast(static_cast(&a)); // Non-UB bad cast break; case 'h': static_cast(static_cast(&a)); // Non-UB bad cast, strict only break; } // FAIL-NOT: {{^2$}} // PASS: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/create-derivers.test0000664000175000017500000000152312733322172026711 0ustar mwhudsonmwhudsonREQUIRES: asserts RUN: %clangxx_cfi -c -o %t1.o %S/simple-fail.cpp RUN: opt -lowertypetests -debug-only=lowertypetests -o /dev/null %t1.o 2>&1 | FileCheck --check-prefix=B0 %s B0: {{1B|B@@}}: {{.*}} size 1 RUN: %clangxx_cfi -DB32 -c -o %t2.o %S/simple-fail.cpp RUN: opt -lowertypetests -debug-only=lowertypetests -o /dev/null %t2.o 2>&1 | FileCheck --check-prefix=B32 %s B32: {{1B|B@@}}: {{.*}} size 24 B32-NOT: all-ones RUN: %clangxx_cfi -DB64 -c -o %t3.o %S/simple-fail.cpp RUN: opt -lowertypetests -debug-only=lowertypetests -o /dev/null %t3.o 2>&1 | FileCheck --check-prefix=B64 %s B64: {{1B|B@@}}: {{.*}} size 54 B64-NOT: all-ones RUN: %clangxx_cfi -DBM -c -o %t4.o %S/simple-fail.cpp RUN: opt -lowertypetests -debug-only=lowertypetests -o /dev/null %t4.o 2>&1 | FileCheck --check-prefix=BM %s BM: {{1B|B@@}}: {{.*}} size 84 BM-NOT: all-ones golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/CMakeLists.txt0000664000175000017500000000255412771042144025471 0ustar mwhudsonmwhudsonset(CFI_LIT_TEST_MODE Standalone) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Standalone/lit.site.cfg ) set(CFI_LIT_TEST_MODE Devirt) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Devirt/lit.site.cfg ) set(CFI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) list(APPEND CFI_TEST_DEPS ubsan stats ) if(COMPILER_RT_HAS_CFI) list(APPEND CFI_TEST_DEPS cfi) endif() if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND CFI_TEST_DEPS opt sanstats ) if(LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR) list(APPEND CFI_TEST_DEPS LLVMgold ) endif() if(APPLE) list(APPEND CFI_TEST_DEPS LTO ) endif() if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES) list(APPEND CFI_TEST_DEPS lld ) endif() endif() add_lit_testsuite(check-cfi "Running the cfi regression tests" ${CMAKE_CURRENT_BINARY_DIR}/Standalone ${CMAKE_CURRENT_BINARY_DIR}/Devirt DEPENDS ${CFI_TEST_DEPS}) add_lit_target(check-cfi-and-supported "Running the cfi regression tests" ${CMAKE_CURRENT_BINARY_DIR}/Standalone ${CMAKE_CURRENT_BINARY_DIR}/Devirt PARAMS check_supported=1 DEPENDS ${CFI_TEST_DEPS}) set_target_properties(check-cfi PROPERTIES FOLDER "Compiler-RT Misc") set_target_properties(check-cfi-and-supported PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/lit.site.cfg.in0000664000175000017500000000034712733347466025565 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ config.cfi_lit_test_mode = "@CFI_LIT_TEST_MODE@" lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/base-derived-destructor.cpp0000664000175000017500000000516512620126304030156 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -o %t5 %s // RUN: %expect_crash %t5 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -DB32 -o %t6 %s // RUN: %expect_crash %t6 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -DB64 -o %t7 %s // RUN: %expect_crash %t7 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -DBM -o %t8 %s // RUN: %expect_crash %t8 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -o %t9 %s // RUN: %expect_crash %t9 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -DB32 -o %t10 %s // RUN: %expect_crash %t10 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -DB64 -o %t11 %s // RUN: %expect_crash %t11 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -DBM -o %t12 %s // RUN: %expect_crash %t12 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -o %t13 %s // RUN: %expect_crash %t13 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -DB32 -o %t14 %s // RUN: %expect_crash %t14 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -DB64 -o %t15 %s // RUN: %expect_crash %t15 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -DBM -o %t16 %s // RUN: %expect_crash %t16 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_diag -o %t17 %s // RUN: %t17 2>&1 | FileCheck --check-prefix=CFI-DIAG %s // RUN: %clangxx -o %t18 %s // RUN: %t18 2>&1 | FileCheck --check-prefix=NCFI %s // Tests that the CFI mechanism crashes the program when making a // base-to-derived cast from a destructor of the base class, // where both types have virtual tables. // REQUIRES: cxxabi #include #include "utils.h" template class A { public: T* context() { return static_cast(this); } virtual ~A() { break_optimization(context()); } }; class B : public A { public: virtual ~B() { } }; int main() { // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'B' failed during base-to-derived cast // CFI-DIAG-NEXT: note: vtable is of type '{{(class )?}}A<{{(class )?}}B>' B* b = new B; break_optimization(b); delete b; // UB here // CFI-NOT: {{^2$}} // NCFI: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/two-vcalls.cpp0000664000175000017500000000233212750767722025537 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi_diag -o %t %s // RUN: %t 2>&1 | FileCheck %s // This test checks that we don't generate two type checks, // if two virtual calls are in the same function. // UNSUPPORTED: win32 // REQUIRES: cxxabi // TODO(krasin): implement the optimization to not emit two type checks. // XFAIL: * #include class Base { public: virtual void Foo() { fprintf(stderr, "Base::Foo\n"); } virtual void Bar() { fprintf(stderr, "Base::Bar\n"); } }; class Derived : public Base { public: void Foo() override { fprintf(stderr, "Derived::Foo\n"); } void Bar() override { printf("Derived::Bar\n"); } }; __attribute__((noinline)) void print(Base* ptr) { ptr->Foo(); // Corrupt the vtable pointer. We expect that the optimization will // check vtable before the first vcall then store it in a local // variable, and reuse it for the second vcall. With no optimization, // CFI will complain about the virtual table being corrupted. *reinterpret_cast(ptr) = 0; ptr->Bar(); } int main() { Base b; Derived d; // CHECK: Base::Foo // CHECK: Base::Bar print(&b); // CHECK: Derived::Foo // CHECK-NOT: runtime error // CHECK: Derived::Bar print(&d); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/simple-fail.cpp0000664000175000017500000000567012753403315025642 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -o %t5 %s // RUN: %expect_crash %t5 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -DB32 -o %t6 %s // RUN: %expect_crash %t6 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -DB64 -o %t7 %s // RUN: %expect_crash %t7 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O1 -DBM -o %t8 %s // RUN: %expect_crash %t8 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -o %t9 %s // RUN: %expect_crash %t9 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -DB32 -o %t10 %s // RUN: %expect_crash %t10 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -DB64 -o %t11 %s // RUN: %expect_crash %t11 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O2 -DBM -o %t12 %s // RUN: %expect_crash %t12 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -o %t13 %s // RUN: %expect_crash %t13 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -DB32 -o %t14 %s // RUN: %expect_crash %t14 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -DB64 -o %t15 %s // RUN: %expect_crash %t15 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -O3 -DBM -o %t16 %s // RUN: %expect_crash %t16 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi_diag -o %t17 %s // RUN: %t17 2>&1 | FileCheck --check-prefix=CFI-DIAG %s // RUN: %clangxx -o %t18 %s // RUN: %t18 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi -DCHECK_NO_SANITIZE_CFI -o %t19 %s // RUN: %t19 2>&1 | FileCheck --check-prefix=NCFI %s // Tests that the CFI mechanism crashes the program when making a virtual call // to an object of the wrong class but with a compatible vtable, by casting a // pointer to such an object and attempting to make a call through it. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual void f(); }; void A::f() {} struct B { virtual void f(); }; void B::f() {} #if defined(CHECK_NO_SANITIZE_CFI) __attribute__((no_sanitize("cfi"))) #endif int main() { create_derivers(); A *a = new A; break_optimization(a); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'B' failed during cast to unrelated type // CFI-DIAG-NEXT: note: vtable is of type '{{(struct )?}}A' // CFI-DIAG: runtime error: control flow integrity check for type 'B' failed during virtual call // CFI-DIAG-NEXT: note: vtable is of type '{{(struct )?}}A' ((B *)a)->f(); // UB here // CFI-NOT: {{^2$}} // NCFI: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/anon-namespace.cpp0000664000175000017500000000532112556213635026323 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -c -DTU1 -o %t1.o %s // RUN: %clangxx_cfi -c -DTU2 -o %t2.o %S/../cfi/anon-namespace.cpp // RUN: %clangxx_cfi -o %t1 %t1.o %t2.o // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -c -DTU1 -DB32 -o %t1.o %s // RUN: %clangxx_cfi -c -DTU2 -DB32 -o %t2.o %S/../cfi/anon-namespace.cpp // RUN: %clangxx_cfi -o %t2 %t1.o %t2.o // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -c -DTU1 -DB64 -o %t1.o %s // RUN: %clangxx_cfi -c -DTU2 -DB64 -o %t2.o %S/../cfi/anon-namespace.cpp // RUN: %clangxx_cfi -o %t3 %t1.o %t2.o // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -c -DTU1 -DBM -o %t1.o %s // RUN: %clangxx_cfi -c -DTU2 -DBM -o %t2.o %S/../cfi/anon-namespace.cpp // RUN: %clangxx_cfi -o %t4 %t1.o %t2.o // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -c -DTU1 -o %t1.o %s // RUN: %clangxx -c -DTU2 -o %t2.o %S/../cfi/anon-namespace.cpp // RUN: %clangxx -o %t5 %t1.o %t2.o // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi_diag -c -DTU1 -o %t1.o %s // RUN: %clangxx_cfi_diag -c -DTU2 -o %t2.o %S/../cfi/anon-namespace.cpp // RUN: %clangxx_cfi_diag -o %t6 %t1.o %t2.o // RUN: %t6 2>&1 | FileCheck --check-prefix=CFI-DIAG %s // Tests that the CFI mechanism treats classes in the anonymous namespace in // different translation units as having distinct identities. This is done by // compiling two translation units TU1 and TU2 containing a class named B in an // anonymous namespace, and testing that the program crashes if TU2 attempts to // use a TU1 B as a TU2 B. // FIXME: This test should not require that the paths supplied to the compiler // are different. It currently does so because bitset names have global scope // so we have to mangle the file path into the bitset name. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual void f() = 0; }; namespace { struct B : A { virtual void f() {} }; } A *mkb(); #ifdef TU1 A *mkb() { return new B; } #endif // TU1 #ifdef TU2 int main() { create_derivers(); A *a = mkb(); break_optimization(a); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-DIAG: runtime error: control flow integrity check for type '(anonymous namespace)::B' failed during base-to-derived cast // CFI-DIAG-NEXT: note: vtable is of type '{{.*}}anonymous namespace{{.*}}::B' // CFI-DIAG: runtime error: control flow integrity check for type '(anonymous namespace)::B' failed during virtual call // CFI-DIAG-NEXT: note: vtable is of type '{{.*}}anonymous namespace{{.*}}::B' ((B *)a)->f(); // UB here // CFI-NOT: {{^2$}} // NCFI: {{^2$}} fprintf(stderr, "2\n"); } #endif // TU2 golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/sibling.cpp0000664000175000017500000000174412556213635025072 0ustar mwhudsonmwhudson// XFAIL: * // RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -o %t5 %s // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // Tests that the CFI enforcement distinguishes betwen non-overriding siblings. // XFAILed as not implemented yet. #include #include "utils.h" struct A { virtual void f(); }; void A::f() {} struct B : A { virtual void f(); }; void B::f() {} struct C : A { }; int main() { create_derivers(); B *b = new B; break_optimization(b); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); ((C *)b)->f(); // UB here // CFI-NOT: 2 // NCFI: 2 fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/lit.cfg0000664000175000017500000000307712733347466024220 0ustar mwhudsonmwhudsonimport lit.formats import os config.name = 'cfi' config.suffixes = ['.c', '.cpp', '.test'] config.test_source_root = os.path.dirname(__file__) clangxx = ' '.join([config.clang] + config.cxx_mode_flags) config.substitutions.append((r"%clang ", ' '.join([config.clang]) + ' ')) config.substitutions.append((r"%clangxx ", clangxx + ' ')) if config.lto_supported: clang_cfi = ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-flto -fsanitize=cfi ']) if config.cfi_lit_test_mode == "Devirt": config.available_features.add('devirt') clang_cfi += '-fwhole-program-vtables ' config.substitutions.append((r"%expect_crash_unless_devirt ", "")) else: config.substitutions.append((r"%expect_crash_unless_devirt ", config.expect_crash)) cxx = ' '.join(config.cxx_mode_flags) + ' ' diag = '-fno-sanitize-trap=cfi -fsanitize-recover=cfi ' non_dso = '-fvisibility=hidden ' dso = '-fsanitize-cfi-cross-dso -fvisibility=default ' config.substitutions.append((r"%clang_cfi ", clang_cfi + non_dso)) config.substitutions.append((r"%clangxx_cfi ", clang_cfi + cxx + non_dso)) config.substitutions.append((r"%clang_cfi_diag ", clang_cfi + non_dso + diag)) config.substitutions.append((r"%clangxx_cfi_diag ", clang_cfi + cxx + non_dso + diag)) config.substitutions.append((r"%clangxx_cfi_dso ", clang_cfi + cxx + dso)) config.substitutions.append((r"%clangxx_cfi_dso_diag ", clang_cfi + cxx + dso + diag)) else: config.unsupported = True if lit_config.params.get('check_supported', None) and config.unsupported: raise BaseException("Tests unsupported") golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/nvcall.cpp0000664000175000017500000000252612556213635024721 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -o %t5 %s // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi_diag -o %t6 %s // RUN: %t6 2>&1 | FileCheck --check-prefix=CFI-DIAG %s // Tests that the CFI mechanism crashes the program when making a non-virtual // call to an object of the wrong class, by casting a pointer to such an object // and attempting to make a call through it. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual void v(); }; void A::v() {} struct B { void f(); virtual void g(); }; void B::f() {} void B::g() {} int main() { create_derivers(); A *a = new A; break_optimization(a); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'B' failed during non-virtual call // CFI-DIAG-NEXT: note: vtable is of type '{{(struct )?}}A' ((B *)a)->f(); // UB here // CFI-NOT: {{^2$}} // NCFI: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/vdtor.cpp0000664000175000017500000000227512556213635024601 0ustar mwhudsonmwhudson// RUN: %clangxx_cfi -o %t1 %s // RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB32 -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DB64 -o %t3 %s // RUN: %expect_crash %t3 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx_cfi -DBM -o %t4 %s // RUN: %expect_crash %t4 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clangxx -o %t5 %s // RUN: %t5 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clangxx_cfi_diag -o %t6 %s // RUN: %t6 2>&1 | FileCheck --check-prefix=CFI-DIAG %s // Tests that the CFI enforcement also applies to virtual destructor calls made // via 'delete'. // REQUIRES: cxxabi #include #include "utils.h" struct A { virtual ~A(); }; A::~A() {} struct B { virtual ~B(); }; B::~B() {} int main() { create_derivers(); A *a = new A; break_optimization(a); // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'B' failed during virtual call // CFI-DIAG-NEXT: note: vtable is of type '{{(struct )?}}A' delete (B *)a; // UB here // CFI-NOT: {{^2$}} // NCFI: {{^2$}} fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/icall/0000775000175000017500000000000013040224625024003 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/icall/lit.local.cfg0000664000175000017500000000022412574353560026357 0ustar mwhudsonmwhudson# The cfi-icall checker is only supported on x86 and x86_64 for now. if config.root.host_arch not in ['x86', 'x86_64']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/icall/bad-signature.c0000664000175000017500000000114112663173171026702 0ustar mwhudsonmwhudson// RUN: %clang -o %t1 %s // RUN: %t1 2>&1 | FileCheck --check-prefix=NCFI %s // RUN: %clang_cfi -o %t2 %s // RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %clang_cfi_diag -g -o %t3 %s // RUN: %t3 2>&1 | FileCheck --check-prefix=CFI-DIAG %s #include void f() { } int main() { // CFI: 1 // NCFI: 1 fprintf(stderr, "1\n"); // CFI-DIAG: runtime error: control flow integrity check for type 'void (int)' failed during indirect function call // CFI-DIAG: f defined here ((void (*)(int))f)(42); // UB here // CFI-NOT: 2 // NCFI: 2 fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/cfi/icall/external-call.c0000664000175000017500000000111312663173171026707 0ustar mwhudsonmwhudson// RUN: %clang_cfi -lm -o %t1 %s // RUN: %t1 c 1 2>&1 | FileCheck --check-prefix=CFI %s // RUN: %t1 s 2 2>&1 | FileCheck --check-prefix=CFI %s // This test uses jump tables containing PC-relative references to external // symbols, which the Mach-O object writer does not currently support. // XFAIL: darwin #include #include #include int main(int argc, char **argv) { // CFI: 1 fprintf(stderr, "1\n"); double (*fn)(double); if (argv[1][0] == 's') fn = sin; else fn = cos; fn(atof(argv[2])); // CFI: 2 fprintf(stderr, "2\n"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/0000775000175000017500000000000013040224621023100 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/esan/Unit/0000775000175000017500000000000013040224621024017 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/esan/Unit/hashtable.cpp0000664000175000017500000001225612752141517026477 0ustar mwhudsonmwhudson// RUN: %clangxx_unit -esan-instrument-loads-and-stores=0 -O0 %s -o %t 2>&1 // RUN: %env_esan_opts="record_snapshots=0" %run %t 2>&1 | FileCheck %s #include "esan/esan_hashtable.h" #include #include #include #include class MyData { public: MyData(const char *Str) : RefCount(0) { Buf = strdup(Str); } ~MyData() { fprintf(stderr, " Destructor: %s.\n", Buf); free(Buf); } bool operator==(MyData &Cmp) { return strcmp(Buf, Cmp.Buf) == 0; } operator size_t() const { size_t Res = 0; for (int i = 0; i < strlen(Buf); ++i) Res ^= Buf[i]; return Res; } char *Buf; int RefCount; }; // We use a smart pointer wrapper to free the payload on hashtable removal. struct MyDataPayload { MyDataPayload() : Data(nullptr) {} explicit MyDataPayload(MyData *Data) : Data(Data) { ++Data->RefCount; } ~MyDataPayload() { if (Data && --Data->RefCount == 0) { fprintf(stderr, "Deleting %s.\n", Data->Buf); delete Data; } } MyDataPayload(const MyDataPayload &Copy) { Data = Copy.Data; ++Data->RefCount; } MyDataPayload & operator=(const MyDataPayload &Copy) { if (this != &Copy) { this->~MyDataPayload(); Data = Copy.Data; ++Data->RefCount; } return *this; } bool operator==(MyDataPayload &Cmp) { return *Data == *Cmp.Data; } operator size_t() const { return (size_t)*Data; } MyData *Data; }; int main() { __esan::HashTable IntTable; assert(IntTable.size() == 0); // Test iteration on an empty table. int Count = 0; for (auto Iter = IntTable.begin(); Iter != IntTable.end(); ++Iter, ++Count) { // Empty. } assert(Count == 0); bool Added = IntTable.add(4, 42); assert(Added); assert(!IntTable.add(4, 42)); assert(IntTable.size() == 1); int Value; bool Found = IntTable.lookup(4, Value); assert(Found && Value == 42); // Test iterator. IntTable.lock(); for (auto Iter = IntTable.begin(); Iter != IntTable.end(); ++Iter, ++Count) { assert((*Iter).Key == 4); assert((*Iter).Data == 42); } IntTable.unlock(); assert(Count == 1); assert(Count == IntTable.size()); assert(!IntTable.remove(5)); assert(IntTable.remove(4)); // Test a more complex payload. __esan::HashTable DataTable(4); MyDataPayload NewData(new MyData("mystring")); Added = DataTable.add(4, NewData); assert(Added); MyDataPayload FoundData; Found = DataTable.lookup(4, FoundData); assert(Found && strcmp(FoundData.Data->Buf, "mystring") == 0); assert(!DataTable.remove(5)); assert(DataTable.remove(4)); // Test resize. for (int i = 0; i < 4; ++i) { MyDataPayload MoreData(new MyData("delete-at-end")); Added = DataTable.add(i+1, MoreData); assert(Added); assert(!DataTable.add(i+1, MoreData)); } for (int i = 0; i < 4; ++i) { Found = DataTable.lookup(i+1, FoundData); assert(Found && strcmp(FoundData.Data->Buf, "delete-at-end") == 0); } DataTable.lock(); Count = 0; for (auto Iter = DataTable.begin(); Iter != DataTable.end(); ++Iter, ++Count) { int Key = (*Iter).Key; FoundData = (*Iter).Data; assert(Key >= 1 && Key <= 4); assert(strcmp(FoundData.Data->Buf, "delete-at-end") == 0); } DataTable.unlock(); assert(Count == 4); assert(Count == DataTable.size()); // Ensure the iterator supports a range-based for loop. DataTable.lock(); Count = 0; for (auto Pair : DataTable) { assert(Pair.Key >= 1 && Pair.Key <= 4); assert(strcmp(Pair.Data.Data->Buf, "delete-at-end") == 0); ++Count; } DataTable.unlock(); assert(Count == 4); assert(Count == DataTable.size()); // Test payload freeing via smart pointer wrapper. __esan::HashTable DataKeyTable; MyDataPayload DataA(new MyData("string AB")); DataKeyTable.lock(); Added = DataKeyTable.add(DataA, DataA); assert(Added); Found = DataKeyTable.lookup(DataA, FoundData); assert(Found && strcmp(FoundData.Data->Buf, "string AB") == 0); MyDataPayload DataB(new MyData("string AB")); Added = DataKeyTable.add(DataB, DataB); assert(!Added); DataKeyTable.remove(DataB); // Should free the DataA payload. DataKeyTable.unlock(); // Test custom functors. struct CustomHash { size_t operator()(int Key) const { return Key % 4; } }; struct CustomEqual { bool operator()(int Key1, int Key2) const { return Key1 %4 == Key2 % 4; } }; __esan::HashTable ModTable; Added = ModTable.add(2, 42); assert(Added); Added = ModTable.add(6, 42); assert(!Added); fprintf(stderr, "All checks passed.\n"); return 0; } // CHECK: Deleting mystring. // CHECK-NEXT: Destructor: mystring. // CHECK-NEXT: All checks passed. // CHECK-NEXT: Deleting string AB. // CHECK-NEXT: Destructor: string AB. // CHECK-NEXT: Deleting string AB. // CHECK-NEXT: Destructor: string AB. // CHECK-NEXT: Deleting delete-at-end. // CHECK-NEXT: Destructor: delete-at-end. // CHECK-NEXT: Deleting delete-at-end. // CHECK-NEXT: Destructor: delete-at-end. // CHECK-NEXT: Deleting delete-at-end. // CHECK-NEXT: Destructor: delete-at-end. // CHECK-NEXT: Deleting delete-at-end. // CHECK-NEXT: Destructor: delete-at-end. golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/Unit/circular_buffer.cpp0000664000175000017500000000264612724326317027705 0ustar mwhudsonmwhudson// RUN: %clangxx_unit -O0 %s -o %t 2>&1 // RUN: %env_esan_opts="record_snapshots=0" %run %t 2>&1 | FileCheck %s #include "esan/esan_circular_buffer.h" #include "sanitizer_common/sanitizer_placement_new.h" #include #include static const int TestBufCapacity = 4; // The buffer should have a capacity of TestBufCapacity. void testBuffer(__esan::CircularBuffer *Buf) { assert(Buf->size() == 0); assert(Buf->empty()); Buf->push_back(1); assert(Buf->back() == 1); assert((*Buf)[0] == 1); assert(Buf->size() == 1); assert(!Buf->empty()); Buf->push_back(2); Buf->push_back(3); Buf->push_back(4); Buf->push_back(5); assert((*Buf)[0] == 2); assert(Buf->size() == 4); Buf->pop_back(); assert((*Buf)[0] == 2); assert(Buf->size() == 3); Buf->pop_back(); Buf->pop_back(); assert((*Buf)[0] == 2); assert(Buf->size() == 1); assert(!Buf->empty()); Buf->pop_back(); assert(Buf->empty()); } int main() { // Test initialize/free. __esan::CircularBuffer GlobalBuf; GlobalBuf.initialize(TestBufCapacity); testBuffer(&GlobalBuf); GlobalBuf.free(); // Test constructor/free. __esan::CircularBuffer *LocalBuf; static char placeholder[sizeof(*LocalBuf)]; LocalBuf = new(placeholder) __esan::CircularBuffer(TestBufCapacity); testBuffer(LocalBuf); LocalBuf->free(); fprintf(stderr, "All checks passed.\n"); // CHECK: All checks passed. return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/CMakeLists.txt0000664000175000017500000000204112741012374025644 0ustar mwhudsonmwhudsonset(ESAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND ESAN_TEST_DEPS esan) endif() set(ESAN_TESTSUITES) set(ESAN_TEST_ARCH ${ESAN_SUPPORTED_ARCH}) set(ESAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) foreach(arch ${ESAN_TEST_ARCH}) set(ESAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" ESAN_TEST_CONFIG_SUFFIX) get_target_flags_for_arch(${arch} ESAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " ESAN_TEST_TARGET_CFLAGS "${ESAN_TEST_TARGET_CFLAGS}") string(TOUPPER ${arch} ARCH_UPPER_CASE) set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND ESAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() # TODO(bruening): add Unit/ tests as well add_lit_testsuite(check-esan "Running EfficiencySanitizer tests" ${ESAN_TESTSUITES} DEPENDS ${ESAN_TEST_DEPS}) set_target_properties(check-esan PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/lit.site.cfg.in0000664000175000017500000000105312706243351025731 0ustar mwhudsonmwhudson## Autogenerated by LLVM/Clang configuration. # Do not edit! # Tool-specific config options. config.name_suffix = "@ESAN_TEST_CONFIG_SUFFIX@" config.esan_lit_source_dir = "@ESAN_LIT_SOURCE_DIR@" config.target_cflags = "@ESAN_TEST_TARGET_CFLAGS@" config.target_arch = "@ESAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@ESAN_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/lit.cfg0000664000175000017500000000333412775420063024370 0ustar mwhudsonmwhudson# -*- Python -*- import os # Setup config name. config.name = 'EfficiencySanitizer' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup default compiler flags used with -fsanitize=efficiency option. base_cflags = ([config.target_cflags] + config.debug_info_flags) base_cxxflags = config.cxx_mode_flags + base_cflags frag_cflags = (["-fsanitize=efficiency-cache-frag"] + base_cflags) wset_cflags = (["-fsanitize=efficiency-working-set"] + base_cflags) esan_incdir = config.test_source_root + "/../../lib" unit_cxxflags = (["-I%s" % esan_incdir, "-std=c++11", # We need to link with the esan runtime. # Tests should pass %env_esan_opts="record_snapshots=0". "-fsanitize=efficiency-working-set"] + base_cxxflags) def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " config.substitutions.append( ("%clang ", build_invocation(base_cflags)) ) config.substitutions.append( ("%clang_esan_frag ", build_invocation(frag_cflags)) ) config.substitutions.append( ("%clang_esan_wset ", build_invocation(wset_cflags)) ) config.substitutions.append( ("%clangxx_unit", build_invocation(unit_cxxflags)) ) default_esan_opts = '' config.substitutions.append(('%env_esan_opts=', 'env ESAN_OPTIONS=' + default_esan_opts)) # Default test suffixes. config.suffixes = ['.c', '.cpp'] # EfficiencySanitizer tests are currently supported on Linux x86-64 only. if config.host_os not in ['Linux'] or config.target_arch not in ['x86_64', 'mips64'] : config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/0000775000175000017500000000000013040224621024776 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/large-stack-linux.c0000664000175000017500000000514512724335721030515 0ustar mwhudsonmwhudson// RUN: %clang_esan_wset -O0 %s -o %t 2>&1 // RUN: %env_esan_opts="verbosity=1 record_snapshots=0" %run %t %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include static void testChildStackLimit(rlim_t StackLimit, char *ToRun) { int Res; struct rlimit Limit; Limit.rlim_cur = RLIM_INFINITY; Limit.rlim_max = RLIM_INFINITY; Res = setrlimit(RLIMIT_STACK, &Limit); if (Res != 0) { // Probably our environment had a large limit and we ourselves got // re-execed and can no longer raise our limit. // We have to bail and emulate the regular test. // We'd prefer to have branches in our FileCheck output to ensure the // initial program was re-execed but this is the best we can do for now. fprintf(stderr, "in esan::initializeLibrary\n"); fprintf(stderr, "==1234==The stack size limit is beyond the maximum supported.\n"); fprintf(stderr, "Re-execing with a stack size below 1TB.\n"); fprintf(stderr, "in esan::initializeLibrary\n"); fprintf(stderr, "done\n"); fprintf(stderr, "in esan::finalizeLibrary\n"); return; } pid_t Child = fork(); assert(Child >= 0); if (Child > 0) { pid_t WaitRes = waitpid(Child, NULL, 0); assert(WaitRes == Child); } else { char *Args[2]; Args[0] = ToRun; Args[1] = NULL; Res = execv(ToRun, Args); assert(0); // Should not be reached. } } int main(int argc, char *argv[]) { // The path to the program to exec must be passed in the first time. if (argc == 2) { fprintf(stderr, "Testing child with infinite stack\n"); testChildStackLimit(RLIM_INFINITY, argv[1]); fprintf(stderr, "Testing child with 1TB stack\n"); testChildStackLimit(1ULL << 40, argv[1]); } fprintf(stderr, "done\n"); // CHECK: in esan::initializeLibrary // CHECK: Testing child with infinite stack // CHECK-NEXT: in esan::initializeLibrary // CHECK-NEXT: =={{[0-9]+}}==The stack size limit is beyond the maximum supported. // CHECK-NEXT: Re-execing with a stack size below 1TB. // CHECK-NEXT: in esan::initializeLibrary // CHECK: done // CHECK: in esan::finalizeLibrary // CHECK: Testing child with 1TB stack // CHECK-NEXT: in esan::initializeLibrary // CHECK-NEXT: =={{[0-9]+}}==The stack size limit is beyond the maximum supported. // CHECK-NEXT: Re-execing with a stack size below 1TB. // CHECK-NEXT: in esan::initializeLibrary // CHECK: done // CHECK-NEXT: in esan::finalizeLibrary // CHECK: done // CHECK-NEXT: in esan::finalizeLibrary return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/verbose-simple.c0000664000175000017500000000162612775420063030117 0ustar mwhudsonmwhudson// RUN: %clang_esan_frag -O0 %s -o %t 2>&1 // RUN: %env_esan_opts="verbosity=1 log_exe_name=1" %run %t 2>&1 | FileCheck --check-prefix=%arch --check-prefix=CHECK %s int main(int argc, char **argv) { // CHECK: in esan::initializeLibrary // (There can be a re-exec for stack limit here.) // x86_64: Shadow scale=2 offset=0x440000000000 // x86_64-NEXT: Shadow #0: [110000000000-114000000000) (256GB) // x86_64-NEXT: Shadow #1: [124000000000-12c000000000) (512GB) // x86_64-NEXT: Shadow #2: [148000000000-150000000000) (512GB) // mips64: Shadow scale=2 offset=0x4400000000 // mips64-NEXT: Shadow #0: [1140000000-1180000000) (1GB) // mips64-NEXT: Shadow #1: [1380000000-13c0000000) (1GB) // mips64-NEXT: Shadow #2: [14c0000000-1500000000) (1GB) // CHECK: in esan::finalizeLibrary // CHECK: ==verbose-simple{{.*}}EfficiencySanitizer: total struct field access count = 0 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/workingset-memset.cpp0000664000175000017500000000116612723312163031200 0ustar mwhudsonmwhudson// RUN: %clang_esan_wset -O0 %s -o %t 2>&1 // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include #include int main(int argc, char **argv) { const int size = 128*1024*1024; char *p = (char *)mmap(0, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); // Test the slowpath at different cache line boundaries. for (int i = 0; i < 630; i++) memset((char *)p + 63*i, i, 63*i); munmap(p, size); return 0; // CHECK: {{.*}} EfficiencySanitizer: the total working set size: 77 KB (12{{[0-9]+}} cache lines) } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/workingset-signal-posix.cpp0000664000175000017500000000427612737271160032336 0ustar mwhudsonmwhudson// RUN: %clang_esan_wset -O0 %s -o %t 2>&1 // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include sigjmp_buf mark; static void SignalHandler(int Sig) { if (Sig == SIGSEGV) { fprintf(stderr, "Handling SIGSEGV for signal\n"); siglongjmp(mark, 1); } exit(1); } static void SigactionHandler(int Sig, siginfo_t *Info, void *Ctx) { if (Sig == SIGSEGV) { fprintf(stderr, "Handling SIGSEGV for sigaction\n"); siglongjmp(mark, 1); } exit(1); } int main(int argc, char **argv) { __sighandler_t Prior = signal(SIGSEGV, SignalHandler); assert(Prior == SIG_DFL); if (sigsetjmp(mark, 1) == 0) *((volatile int *)(ssize_t)argc) = 42; // Raise SIGSEGV fprintf(stderr, "Past longjmp for signal\n"); Prior = signal(SIGSEGV, SIG_DFL); assert(Prior == SignalHandler); struct sigaction SigAct; SigAct.sa_sigaction = SigactionHandler; int Res = sigfillset(&SigAct.sa_mask); assert(Res == 0); SigAct.sa_flags = SA_SIGINFO; Res = sigaction(SIGSEGV, &SigAct, NULL); assert(Res == 0); if (sigsetjmp(mark, 1) == 0) *((volatile int *)(ssize_t)argc) = 42; // Raise SIGSEGV fprintf(stderr, "Past longjmp for sigaction\n"); Res = sigaction(SIGSEGV, NULL, &SigAct); assert(Res == 0); assert(SigAct.sa_sigaction == SigactionHandler); // Test blocking SIGSEGV and raising a shadow fault. sigset_t Set; sigemptyset(&Set); sigaddset(&Set, SIGSEGV); Res = sigprocmask(SIG_BLOCK, &Set, NULL); // Make a large enough mapping that its start point will be before any // prior library-region shadow access. char *buf = (char *)mmap(0, 640*1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); buf[0] = 4; munmap(buf, 640*1024); fprintf(stderr, "Past blocked-SIGSEGV shadow fault\n"); return 0; } // CHECK: Handling SIGSEGV for signal // CHECK-NEXT: Past longjmp for signal // CHECK-NEXT: Handling SIGSEGV for sigaction // CHECK-NEXT: Past longjmp for sigaction // CHECK-NEXT: Past blocked-SIGSEGV shadow fault // CHECK: {{.*}} EfficiencySanitizer: the total working set size: {{[0-9]+}} Bytes ({{[0-9][0-9]}} cache lines) golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/workingset-samples.cpp0000664000175000017500000000375112743332550031360 0ustar mwhudsonmwhudson// RUN: %clang_esan_wset -O0 %s -o %t 2>&1 // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include #include const int size = 0x1 << 25; // 523288 cache lines const int iters = 6; int main(int argc, char **argv) { char *buf = (char *)mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); // To avoid flakiness stemming from whether the sideline thread // is scheduled enough on a loaded test machine, we coordinate // with esan itself: if (__esan_get_sample_count) { while (__esan_get_sample_count() < 4) { for (int i = 0; i < size; ++i) buf[i] = i; sched_yield(); } } munmap(buf, size); // We only check for a few samples here to reduce the chance of flakiness. // CHECK: =={{[0-9]+}}== Total number of samples: {{[0-9]+}} // CHECK-NEXT: =={{[0-9]+}}== Samples array #0 at period 20 ms // CHECK-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-NEXT: =={{[0-9]+}}==# 1: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-NEXT: =={{[0-9]+}}==# 2: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-NEXT: =={{[0-9]+}}==# 3: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK: =={{[0-9]+}}== Samples array #1 at period 80 ms // CHECK-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK: =={{[0-9]+}}== Samples array #2 at period 320 ms // CHECK: =={{[0-9]+}}== Samples array #3 at period 1280 ms // CHECK: =={{[0-9]+}}== Samples array #4 at period 5120 ms // CHECK: =={{[0-9]+}}== Samples array #5 at period 20 sec // CHECK: =={{[0-9]+}}== Samples array #6 at period 81 sec // CHECK: =={{[0-9]+}}== Samples array #7 at period 327 sec // CHECK: {{.*}} EfficiencySanitizer: the total working set size: 32 MB (5242{{[0-9][0-9]}} cache lines) return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/workingset-simple.cpp0000664000175000017500000000201512723312163031171 0ustar mwhudsonmwhudson// RUN: %clang_esan_wset -O0 %s -o %t 2>&1 // RUN: %run %t 2>&1 | FileCheck %s #include #include #include #include const int size = 0x1 << 25; // 523288 cache lines const int line_size = 64; int main(int argc, char **argv) { char *bufA = (char *)malloc(sizeof(char) * line_size); char bufB[64]; char *bufC = (char *)mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); bufA[0] = 0; // This additional access to the same line should not increase the line // count: but it's difficult to make a non-flaky test that measures the // lines down to the ones digit so right now we're not really testing that. // If we add a heap-only mode we may be able to be more precise. bufA[1] = 0; bufB[33] = 1; for (int i = 0; i < size; i += line_size) bufC[i] = 0; free(bufA); munmap(bufC, 0x4000); // CHECK: {{.*}} EfficiencySanitizer: the total working set size: 32 MB (524{{[0-9][0-9][0-9]}} cache lines) return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/workingset-midreport.cpp0000664000175000017500000000721712743332550031722 0ustar mwhudsonmwhudson// RUN: %clang_esan_wset -O0 %s -o %t 2>&1 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN // RUN: %clang -O0 %s -o %t 2>&1 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ESAN #include #include #include #include #include #include const int size = 0x1 << 25; // 523288 cache lines const int iters = 6; int main(int argc, char **argv) { char *buf = (char *)mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); // To avoid flakiness stemming from whether the sideline thread // is scheduled enough on a loaded test machine, we coordinate // with esan itself: if (__esan_get_sample_count) { while (__esan_get_sample_count() < 4) { for (int i = 0; i < size; ++i) buf[i] = i; sched_yield(); } } // Ensure a non-esan build works without ifdefs: if (__esan_report) { // We should get 2 roughly identical reports: __esan_report(); } munmap(buf, size); fprintf(stderr, "all done\n"); // CHECK-NO-ESAN: all done // We only check for a few samples here to reduce the chance of flakiness: // CHECK-ESAN: =={{[0-9]+}}== Total number of samples: {{[0-9]+}} // CHECK-ESAN-NEXT: =={{[0-9]+}}== Samples array #0 at period 20 ms // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 1: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 2: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 3: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN: =={{[0-9]+}}== Samples array #1 at period 80 ms // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN: =={{[0-9]+}}== Samples array #2 at period 320 ms // CHECK-ESAN: =={{[0-9]+}}== Samples array #3 at period 1280 ms // CHECK-ESAN: =={{[0-9]+}}== Samples array #4 at period 5120 ms // CHECK-ESAN: =={{[0-9]+}}== Samples array #5 at period 20 sec // CHECK-ESAN: =={{[0-9]+}}== Samples array #6 at period 81 sec // CHECK-ESAN: =={{[0-9]+}}== Samples array #7 at period 327 sec // CHECK-ESAN: {{.*}} EfficiencySanitizer: the total working set size: 32 MB (5242{{[0-9][0-9]}} cache lines) // CHECK-ESAN-NEXT: all done // CHECK-ESAN-NEXT: =={{[0-9]+}}== Total number of samples: {{[0-9]+}} // CHECK-ESAN-NEXT: =={{[0-9]+}}== Samples array #0 at period 20 ms // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 1: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 2: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 3: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN: =={{[0-9]+}}== Samples array #1 at period 80 ms // CHECK-ESAN-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} {{KB|MB|Bytes}} ({{[ 0-9]+}} cache lines) // CHECK-ESAN: =={{[0-9]+}}== Samples array #2 at period 320 ms // CHECK-ESAN: =={{[0-9]+}}== Samples array #3 at period 1280 ms // CHECK-ESAN: =={{[0-9]+}}== Samples array #4 at period 5120 ms // CHECK-ESAN: =={{[0-9]+}}== Samples array #5 at period 20 sec // CHECK-ESAN: =={{[0-9]+}}== Samples array #6 at period 81 sec // CHECK-ESAN: =={{[0-9]+}}== Samples array #7 at period 327 sec // CHECK-ESAN: {{.*}} EfficiencySanitizer: the total working set size: 32 MB (5242{{[0-9][0-9]}} cache lines) return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/workingset-early-fault.c0000664000175000017500000000164612730017632031577 0ustar mwhudsonmwhudson// Test shadow faults during esan initialization as well as // faults during dlsym's calloc during interceptor init. // // RUN: %clang_esan_wset %s -o %t // RUN: %run %t 2>&1 | FileCheck %s #include #include #include // Our goal is to emulate an instrumented allocator, whose calloc // invoked from dlsym will trigger shadow faults, to test an // early shadow fault during esan interceptor init. // We do this by replacing calloc: void *calloc(size_t size, size_t n) { // Unfortunately we can't print anything to make the test // ensure we got here b/c the sanitizer interceptors can't // handle that during interceptor init. // Ensure we trigger a shadow write fault: int x[16]; x[0] = size; // Now just emulate calloc. void *res = malloc(size*n); memset(res, 0, size*n); return res; } int main(int argc, char **argv) { printf("all done\n"); return 0; } // CHECK: all done golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/mmap-shadow-conflict.c0000664000175000017500000000326112775420063031174 0ustar mwhudsonmwhudson// RUN: %clang_esan_frag -O0 %s -o %t 2>&1 // RUN: %env_esan_opts=verbosity=1 %run %t 2>&1 | FileCheck --check-prefix=%arch --check-prefix=CHECK %s #include #include #include int main(int argc, char **argv) { #if defined(__mips64) void *Map = mmap((void *)0x0000001600000000ULL, 0x1000, PROT_READ, MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, 0); #else void *Map = mmap((void *)0x0000016000000000ULL, 0x1000, PROT_READ, MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, 0); #endif if (Map == (void *)-1) fprintf(stderr, "map failed\n"); else fprintf(stderr, "mapped %p\n", Map); #if defined(__mips64) Map = mmap((void *)0x0000001600000000ULL, 0x1000, PROT_READ, MAP_ANON|MAP_PRIVATE, -1, 0); #else Map = mmap((void *)0x0000016000000000ULL, 0x1000, PROT_READ, MAP_ANON|MAP_PRIVATE, -1, 0); #endif fprintf(stderr, "mapped %p\n", Map); // CHECK: in esan::initializeLibrary // (There can be a re-exec for stack limit here.) // x86_64: Shadow scale=2 offset=0x440000000000 // x86_64-NEXT: Shadow #0: [110000000000-114000000000) (256GB) // x86_64-NEXT: Shadow #1: [124000000000-12c000000000) (512GB) // x86_64-NEXT: Shadow #2: [148000000000-150000000000) (512GB) // mips64: Shadow scale=2 offset=0x4400000000 // mips64-NEXT: Shadow #0: [1140000000-1180000000) (1GB) // mips64-NEXT: Shadow #1: [1380000000-13c0000000) (1GB) // mips64-NEXT: Shadow #2: [14c0000000-1500000000) (1GB) // CHECK-NEXT: mmap conflict: {{.*}} // CHECK-NEXT: map failed // CHECK-NEXT: mmap conflict: {{.*}} // CHECK-NEXT: mapped {{.*}} // CHECK-NEXT: in esan::finalizeLibrary return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/struct-simple.cpp0000664000175000017500000001527612770714046030346 0ustar mwhudsonmwhudson// RUN: %clang_esan_frag -O0 %s -DPART1 -mllvm -esan-aux-field-info=0 -c -o %t-part1.o 2>&1 // RUN: %clang_esan_frag -O0 %s -DPART2 -c -o %t-part2.o 2>&1 // RUN: %clang_esan_frag -O0 %s -DMAIN -c -o %t-main.o 2>&1 // RUN: %clang_esan_frag -O0 %t-part1.o %t-part2.o %t-main.o -o %t 2>&1 // RUN: %env_esan_opts=verbosity=2 %run %t 2>&1 | FileCheck %s // We generate two different object files from this file with different // macros, and then link them together. We do this to test how we handle // separate compilation with multiple compilation units. #include extern "C" { void part1(); void part2(); } //===-- compilation unit part1 without main function ----------------------===// #ifdef PART1 struct A { int x; int y; }; struct B { float m; double n; }; union U { float f; double d; }; // Same struct in both main and part1. struct S { int s1; int s2; }; // Different structs with the same name in main and part1. struct D { int d1; int d2; struct { int x; int y; int z; } ds[10]; }; void part1() { struct A a; struct B b; union U u; struct S s; struct D d; for (int i = 0; i < (1 << 11); i++) a.x = 0; a.y = 1; b.m = 2.0; for (int i = 0; i < (1 << 21); i++) { b.n = 3.0; d.ds[3].y = 0; } u.f = 0.0; u.d = 1.0; s.s1 = 0; d.d1 = 0; } #endif // PART1 //===-- compilation unit part2 without main function ----------------------===// #ifdef PART2 // No struct in this part. void part2() { // do nothing } #endif // PART2 //===-- compilation unit with main function -------------------------------===// #ifdef MAIN class C { public: struct { int x; int y; } cs; union { float f; double d; } cu; char c[10]; }; // Same struct in both main and part1. struct S { int s1; int s2; }; // Different structs with the same name in main and part1. struct D { int d1; int d2; int d3; }; int main(int argc, char **argv) { // CHECK: in esan::initializeLibrary // CHECK: in esan::initializeCacheFrag // CHECK-NEXT: in esan::processCompilationUnitInit // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit: {{.*}}struct-simple.cpp with 6 class(es)/struct(s) // CHECK-NEXT: Register struct.A$2$11$11: 2 fields // CHECK-NEXT: Register struct.B$2$3$2: 2 fields // CHECK-NEXT: Register union.U$1$3: 1 fields // CHECK-NEXT: Register struct.S$2$11$11: 2 fields // CHECK-NEXT: Register struct.D$3$14$11$11: 3 fields // CHECK-NEXT: Register struct.anon$3$11$11$11: 3 fields // CHECK-NEXT: in esan::processCompilationUnitInit // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit: {{.*}}struct-simple.cpp with 0 class(es)/struct(s) // CHECK-NEXT: in esan::processCompilationUnitInit // CHECK-NEXT: in esan::processCacheFragCompilationUnitInit: {{.*}}struct-simple.cpp with 5 class(es)/struct(s) // CHECK-NEXT: Register class.C$3$14$13$13: 3 fields // CHECK-NEXT: Register struct.anon$2$11$11: 2 fields // CHECK-NEXT: Register union.anon$1$3: 1 fields // CHECK-NEXT: Duplicated struct.S$2$11$11: 2 fields // CHECK-NEXT: Register struct.D$3$11$11$11: 3 fields struct C c[2]; struct S s; struct D d; c[0].cs.x = 0; c[1].cs.y = 1; c[0].cu.f = 0.0; c[1].cu.d = 1.0; c[0].c[2] = 0; s.s1 = 0; d.d1 = 0; d.d2 = 0; part1(); part2(); return 0; // CHECK: in esan::finalizeLibrary // CHECK-NEXT: in esan::finalizeCacheFrag // CHECK-NEXT: in esan::processCompilationUnitExit // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp with 5 class(es)/struct(s) // CHECK-NEXT: Unregister class.C$3$14$13$13: 3 fields // CHECK-NEXT: {{.*}} class C // CHECK-NEXT: {{.*}} size = 32, count = 5, ratio = 3, array access = 5 // CHECK-NEXT: {{.*}} # 0: offset = 0, size = 8, count = 2, type = %struct.anon = type { i32, i32 } // CHECK-NEXT: {{.*}} # 1: offset = 8, size = 8, count = 2, type = %union.anon = type { double } // CHECK-NEXT: {{.*}} # 2: offset = 16, size = 10, count = 1, type = [10 x i8] // CHECK-NEXT: Unregister struct.anon$2$11$11: 2 fields // CHECK-NEXT: {{.*}} struct anon // CHECK-NEXT: {{.*}} size = 8, count = 2, ratio = 1, array access = 0 // CHECK-NEXT: {{.*}} # 0: offset = 0, size = 4, count = 1, type = i32 // CHECK-NEXT: {{.*}} # 1: offset = 4, size = 4, count = 1, type = i32 // CHECK-NEXT: Unregister union.anon$1$3: 1 fields // CHECK-NEXT: Unregister struct.S$2$11$11: 2 fields // CHECK-NEXT: {{.*}} struct S // CHECK-NEXT: {{.*}} size = 8, count = 2, ratio = 2, array access = 0 // CHECK-NEXT: {{.*}} # 0: count = 2 // CHECK-NEXT: {{.*}} # 1: count = 0 // CHECK-NEXT: Unregister struct.D$3$11$11$11: 3 fields // CHECK-NEXT: {{.*}} struct D // CHECK-NEXT: {{.*}} size = 12, count = 2, ratio = 2, array access = 0 // CHECK-NEXT: {{.*}} # 0: offset = 0, size = 4, count = 1, type = i32 // CHECK-NEXT: {{.*}} # 1: offset = 4, size = 4, count = 1, type = i32 // CHECK-NEXT: {{.*}} # 2: offset = 8, size = 4, count = 0, type = i32 // CHECK-NEXT: in esan::processCompilationUnitExit // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp with 0 class(es)/struct(s) // CHECK-NEXT: in esan::processCompilationUnitExit // CHECK-NEXT: in esan::processCacheFragCompilationUnitExit: {{.*}}struct-simple.cpp with 6 class(es)/struct(s) // CHECK-NEXT: Unregister struct.A$2$11$11: 2 fields // CHECK-NEXT: {{.*}} struct A // CHECK-NEXT: {{.*}} size = 8, count = 2049, ratio = 2048, array access = 0 // CHECK-NEXT: {{.*}} # 0: count = 2048 // CHECK-NEXT: {{.*}} # 1: count = 1 // CHECK-NEXT: Unregister struct.B$2$3$2: 2 fields // CHECK-NEXT: {{.*}} struct B // CHECK-NEXT: {{.*}} size = 16, count = 2097153, ratio = 2097152, array access = 0 // CHECK-NEXT: {{.*}} # 0: count = 1 // CHECK-NEXT: {{.*}} # 1: count = 2097152 // CHECK-NEXT: Unregister union.U$1$3: 1 fields // CHECK-NEXT: Duplicated struct.S$2$11$11: 2 fields // CHECK-NEXT: Unregister struct.D$3$14$11$11: 3 fields // CHECK-NEXT: {{.*}} struct D // CHECK-NEXT: {{.*}} size = 128, count = 2097153, ratio = 2097153, array access = 0 // CHECK-NEXT: {{.*}} # 0: count = 1 // CHECK-NEXT: {{.*}} # 1: count = 0 // CHECK-NEXT: {{.*}} # 2: count = 2097152 // CHECK-NEXT: Unregister struct.anon$3$11$11$11: 3 fields // CHECK-NEXT: {{.*}} struct anon // CHECK-NEXT: {{.*}} size = 12, count = 2097152, ratio = 4194304, array access = 2097152 // CHECK-NEXT: {{.*}} # 0: count = 0 // CHECK-NEXT: {{.*}} # 1: count = 2097152 // CHECK-NEXT: {{.*}} # 2: count = 0 // CHECK-NEXT: {{.*}}EfficiencySanitizer: total struct field access count = 6293518 } #endif // MAIN golang-1.8-race-detector-runtime_0.0+svn285455/test/esan/TestCases/libc-intercept.c0000664000175000017500000000134512706722664030073 0ustar mwhudsonmwhudson// RUN: %clang_esan_frag -O0 %s -o %t 2>&1 // RUN: %env_esan_opts=verbosity=3 %run %t 2>&1 | FileCheck %s #include int main(int argc, char **argv) { char Buf[2048]; const char Str[] = "TestStringOfParticularLength"; // 29 chars. strcpy(Buf, Str); strncpy(Buf, Str, 17); return strncmp(Buf, Str, 17); // CHECK: in esan::initializeLibrary // CHECK: in esan::processRangeAccess {{.*}} 29 // CHECK: in esan::processRangeAccess {{.*}} 29 // CHECK: in esan::processRangeAccess {{.*}} 17 // CHECK: in esan::processRangeAccess {{.*}} 17 // CHECK: in esan::processRangeAccess {{.*}} 17 // CHECK: in esan::processRangeAccess {{.*}} 17 // CHECK: in esan::finalizeLibrary } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/0000775000175000017500000000000013040224617025537 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/Unit/0000775000175000017500000000000013040224617026456 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/Unit/lit.site.cfg.in0000664000175000017500000000106712704361721031307 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Load common config for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured") # Setup config name. config.name = 'SanitizerCommon-Unit' # Setup test source and exec root. For unit tests, we define # it as build directory with sanitizer_common tests. # FIXME: De-hardcode this path. config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@", "lib", "sanitizer_common", "tests") config.test_source_root = config.test_exec_root golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/CMakeLists.txt0000664000175000017500000000441712744452167030322 0ustar mwhudsonmwhudsonset(SANITIZER_COMMON_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SANITIZER_COMMON_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) set(SANITIZER_COMMON_TESTSUITES) set(SUPPORTED_TOOLS) if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD" AND NOT ANDROID) list(APPEND SUPPORTED_TOOLS asan) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID) list(APPEND SUPPORTED_TOOLS tsan) list(APPEND SUPPORTED_TOOLS msan) list(APPEND SUPPORTED_TOOLS lsan) endif() # Create a separate config for each tool we support. foreach(tool ${SUPPORTED_TOOLS}) string(TOUPPER ${tool} tool_toupper) if(${tool_toupper}_SUPPORTED_ARCH AND NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SANITIZER_COMMON_TEST_DEPS ${tool}) endif() set(TEST_ARCH ${${tool_toupper}_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(${tool_toupper}_SUPPORTED_ARCH TEST_ARCH) endif() foreach(arch ${TEST_ARCH}) set(SANITIZER_COMMON_LIT_TEST_MODE ${tool}) set(SANITIZER_COMMON_TEST_TARGET_ARCH ${arch}) if(${arch} MATCHES "arm|aarch64") # This is only true if we're cross-compiling. set(SANITIZER_COMMON_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CFLAGS) string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS "${SANITIZER_COMMON_TEST_TARGET_CFLAGS}") endif() set(CONFIG_NAME ${tool}-${arch}-${OS_NAME}) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND SANITIZER_COMMON_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() endforeach() # Unit tests. if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) list(APPEND SANITIZER_COMMON_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) list(APPEND SANITIZER_COMMON_TEST_DEPS SanitizerUnitTests) endif() if(SANITIZER_COMMON_TESTSUITES) add_lit_testsuite(check-sanitizer "Running sanitizer_common tests" ${SANITIZER_COMMON_TESTSUITES} DEPENDS ${SANITIZER_COMMON_TEST_DEPS}) set_target_properties(check-sanitizer PROPERTIES FOLDER "Compiler-RT Misc") endif() golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/lit.site.cfg.in0000664000175000017500000000105012704361721030360 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.name_suffix = "@CONFIG_NAME@" config.tool_name = "@SANITIZER_COMMON_LIT_TEST_MODE@" config.target_cflags = "@SANITIZER_COMMON_TEST_TARGET_CFLAGS@" config.target_arch = "@SANITIZER_COMMON_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@SANITIZER_COMMON_LIT_SOURCE_DIR@/lit.common.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/lit.common.cfg0000664000175000017500000000377312670340377030323 0ustar mwhudsonmwhudson# -*- Python -*- # Setup source root. config.test_source_root = os.path.join(os.path.dirname(__file__), "TestCases") config.name = "SanitizerCommon-" + config.name_suffix default_tool_options = [] if config.tool_name == "asan": tool_cflags = ["-fsanitize=address"] tool_options = "ASAN_OPTIONS" elif config.tool_name == "tsan": tool_cflags = ["-fsanitize=thread"] tool_options = "TSAN_OPTIONS" elif config.tool_name == "msan": tool_cflags = ["-fsanitize=memory"] tool_options = "MSAN_OPTIONS" elif config.tool_name == "lsan": tool_cflags = ["-fsanitize=leak"] tool_options = "LSAN_OPTIONS" else: lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name) config.available_features.add(config.tool_name) if config.target_arch not in ['arm', 'armhf', 'aarch64']: config.available_features.add('stable-runtime') if config.host_os == 'Darwin': # On Darwin, we default to `abort_on_error=1`, which would make tests run # much slower. Let's override this and run lit tests with 'abort_on_error=0'. default_tool_options += ['abort_on_error=0'] default_tool_options_str = ':'.join(default_tool_options) if default_tool_options_str: config.environment[tool_options] = default_tool_options_str default_tool_options_str += ':' clang_cflags = config.debug_info_flags + tool_cflags + [config.target_cflags] clang_cxxflags = config.cxx_mode_flags + clang_cflags def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) ) config.substitutions.append( ("%tool_name", config.tool_name) ) config.substitutions.append( ("%tool_options", tool_options) ) config.substitutions.append( ('%env_tool_opts=', 'env ' + tool_options + '=' + default_tool_options_str)) config.suffixes = ['.c', '.cc', '.cpp'] if config.host_os not in ['Linux', 'Darwin']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/0000775000175000017500000000000013040224617027435 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/print-stack-trace.cc0000664000175000017500000000200612667302664033312 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s // RUN: %clangxx -O3 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s // RUN: %env_tool_opts=stack_trace_format='"frame:%n lineno:%l"' %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM // RUN: %env_tool_opts=symbolize_inline_frames=false:stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s --check-prefix=NOINLINE #include static inline void FooBarBaz() { __sanitizer_print_stack_trace(); } int main() { FooBarBaz(); return 0; } // CHECK: {{ #0 0x.* in __sanitizer_print_stack_trace}} // CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*}}print-stack-trace.cc:[[@LINE-8]] // CHECK: {{ #2 0x.* in main.*}}print-stack-trace.cc:[[@LINE-5]] // CUSTOM: frame:1 lineno:[[@LINE-11]] // CUSTOM: frame:2 lineno:[[@LINE-8]] // NOINLINE: #0 0x{{.*}} in __sanitizer_print_stack_trace // NOINLINE: #1 0x{{.*}} in main{{.*}}print-stack-trace.cc:[[@LINE-15]] golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/strpbrk.c0000664000175000017500000000035012531557321031273 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t 2>&1 #include #include int main(int argc, char **argv) { char *r = 0; char s1[] = "ad"; char s2[] = "cd"; r = strpbrk(s1, s2); assert(r == s1 + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/corelimit.cc0000664000175000017500000000044312373462517031747 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t && %run %t // XFAIL: lsan #include #include #include int main() { struct rlimit lim_core; getrlimit(RLIMIT_CORE, &lim_core); void *p; if (sizeof(p) == 8) { assert(0 == lim_core.rlim_max); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/options-invalid.cc0000664000175000017500000000074712567411603033101 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t // RUN: %env_tool_opts=invalid_option_name=10,verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-V1 // RUN: %env_tool_opts=invalid_option_name=10 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-V0 #include int main() { fprintf(stderr, "done\n"); } // CHECK-V1: WARNING: found 1 unrecognized // CHECK-V1: invalid_option_name // CHECK-V0-NOT: WARNING: found 1 unrecognized // CHECK-V0-NOT: invalid_option_name // CHECK: done ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/pthread_mutexattr_get.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/pthread_mutexattr_get0000664000175000017500000000067012352327123033767 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t && %run %t #include #include int main(void) { pthread_mutexattr_t ma; int res = pthread_mutexattr_init(&ma); assert(res == 0); res = pthread_mutexattr_setpshared(&ma, 1); assert(res == 0); int pshared; res = pthread_mutexattr_getpshared(&ma, &pshared); assert(res == 0); assert(pshared == 1); res = pthread_mutexattr_destroy(&ma); assert(res == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/strcasestr.c0000664000175000017500000000050112531557321031777 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t 2>&1 // There's no interceptor for strcasestr on Windows // XFAIL: win32 #define _GNU_SOURCE #include #include int main(int argc, char **argv) { char *r = 0; char s1[] = "aB"; char s2[] = "b"; r = strcasestr(s1, s2); assert(r == s1 + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/0000775000175000017500000000000013040224617030534 5ustar mwhudsonmwhudson././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/sem_init_glibc.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/sem_init_glibc.0000664000175000017500000000370112775124046033516 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 -g %s -lutil -o %t && %run %t // This test depends on the glibc layout of struct sem_t and checks that we // don't leave sem_t::private uninitialized. // UNSUPPORTED: android #include #include #include #include #include // This condition needs to correspond to __HAVE_64B_ATOMICS macro in glibc. #if (defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) || \ defined(__s390x__) || defined(__sparc64__) || defined(__alpha__) || \ defined(__ia64__) || defined(__m68k__)) && __GLIBC_PREREQ(2, 21) typedef uint64_t semval_t; #else typedef unsigned semval_t; #endif // glibc 2.21 has introduced some changes in the way the semaphore value is // handled for 32-bit platforms, but since these changes are not ABI-breaking // they are not versioned. On newer platforms such as ARM, there is only one // version of the symbol, so it's enough to check the glibc version. However, // for old platforms such as i386, glibc contains two or even three versions of // the sem_init symbol, and the sanitizers always pick the oldest one. // Therefore, it is not enough to rely on the __GLIBC_PREREQ macro - we should // instead check the platform as well to make sure we only expect the new // behavior on platforms where the older symbols do not exist. #if defined(__arm__) && __GLIBC_PREREQ(2, 21) #define GET_SEM_VALUE(V) ((V) >> 1) #else #define GET_SEM_VALUE(V) (V) #endif void my_sem_init(bool priv, int value, semval_t *a, unsigned char *b) { sem_t sem; memset(&sem, 0xAB, sizeof(sem)); sem_init(&sem, priv, value); char *p = (char *)&sem; memcpy(a, p, sizeof(semval_t)); memcpy(b, p + sizeof(semval_t), sizeof(char)); sem_destroy(&sem); } int main() { semval_t a; unsigned char b; my_sem_init(false, 42, &a, &b); assert(GET_SEM_VALUE(a) == 42); assert(b != 0xAB); my_sem_init(true, 43, &a, &b); assert(GET_SEM_VALUE(a) == 43); assert(b != 0xAB); } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/clock_gettime.c0000664000175000017500000000037712374475002033525 0ustar mwhudsonmwhudson// RUN: %clang %s -Wl,-as-needed -o %t && %run %t // Regression test for PR15823 // (http://llvm.org/bugs/show_bug.cgi?id=15823). #include #include int main() { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); return 0; } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/abort_on_error.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/abort_on_error.0000664000175000017500000000072712661157602033566 0ustar mwhudsonmwhudson// Check that sanitizers call _exit() on Linux by default (i.e. // abort_on_error=0). See also Darwin/abort_on_error.cc. // RUN: %clangxx %s -o %t // Intentionally don't inherit the default options. // RUN: env %tool_options='' not %run %t 2>&1 // When we use lit's default options, we shouldn't crash either. On Linux // lit doesn't set options anyway. // RUN: not %run %t 2>&1 namespace __sanitizer { void Die(); } int main() { __sanitizer::Die(); return 0; } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/sched_getparam.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/sched_getparam.0000664000175000017500000000041412460214232033477 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t && %run %t #include #include #include int main(void) { struct sched_param param; int res = sched_getparam(0, ¶m); assert(res == 0); if (param.sched_priority == 42) printf(".\n"); return 0; } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/getpwnam_r_inva0000664000175000017500000000074412516270061033645 0ustar mwhudsonmwhudson// Regression test for a crash in getpwnam_r and similar interceptors. // RUN: %clangxx -O0 -g %s -o %t && %run %t #include #include #include #include #include #include #include int main(void) { struct passwd pwd; struct passwd *pwdres; char buf[10000]; int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres); assert(res == 0 || res == ENOENT); assert(pwdres == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/lit.local.cfg0000664000175000017500000000026612334260412033100 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Linux']: config.unsupported = True ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/recv_msg_trunc.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/recv_msg_trunc.0000664000175000017500000000167612716545163033602 0ustar mwhudsonmwhudson// Test that ASan doesn't raise false alarm when MSG_TRUNC is present. // // RUN: %clangxx %s -o %t && %run %t 2>&1 // // UNSUPPORTED: android #include #include #include #include #include #include int main() { int fd_0 = socket(AF_INET, SOCK_DGRAM, 0); int fd_1 = socket(AF_INET, SOCK_DGRAM, 0); struct sockaddr_in sin; socklen_t len = sizeof(sin); char *buf = (char *)malloc(1); sin.sin_family = AF_INET; // Choose a random port to bind. sin.sin_port = 0; sin.sin_addr.s_addr = INADDR_ANY; assert(bind(fd_1, (struct sockaddr *)&sin, sizeof(sin)) == 0); // Get the address and port binded. assert(getsockname(fd_1, (struct sockaddr *)&sin, &len) == 0); assert(sendto(fd_0, "hello", strlen("hello"), MSG_DONTWAIT, (struct sockaddr *)&sin, sizeof(sin)) != -1); assert(recv(fd_1, buf, 1, MSG_TRUNC) != -1); free(buf); return 0; } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/soft_rss_limit_0000664000175000017500000000512412567411603033666 0ustar mwhudsonmwhudson// Check soft_rss_limit_mb. Not all sanitizers implement it yet. // RUN: %clangxx -O2 %s -o %t // // Run with limit should fail: // RUN: %env_tool_opts=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_1 // RUN: %env_tool_opts=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0 // This run uses getrusage. We can only test getrusage when allocator_may_return_null=0 // because getrusage gives us max-rss, not current-rss. // RUN: %env_tool_opts=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=0:can_use_proc_maps_statm=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0 // FIXME: make it work for other sanitizers. // XFAIL: lsan // XFAIL: tsan // XFAIL: msan #include #include #include #include static const int kMaxNumAllocs = 1 << 9; static const int kAllocSize = 1 << 20; // Large enough to go via mmap. static char *allocs[kMaxNumAllocs]; int main() { int num_allocs = kMaxNumAllocs / 4; for (int i = 0; i < 3; i++, num_allocs *= 2) { fprintf(stderr, "[%d] allocating %d times\n", i, num_allocs); int zero_results = 0; for (int j = 0; j < num_allocs; j++) { if ((j % (num_allocs / 8)) == 0) { usleep(100000); fprintf(stderr, " [%d]\n", j); } allocs[j] = (char*)malloc(kAllocSize); if (allocs[j]) memset(allocs[j], -1, kAllocSize); else zero_results++; } if (zero_results) fprintf(stderr, "Some of the malloc calls returned null: %d\n", zero_results); if (zero_results != num_allocs) fprintf(stderr, "Some of the malloc calls returned non-null: %d\n", num_allocs - zero_results); for (int j = 0; j < num_allocs; j++) { free(allocs[j]); } } } // CHECK_MAY_RETURN_1: allocating 128 times // CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: 128 // CHECK_MAY_RETURN_1: allocating 256 times // CHECK_MAY_RETURN_1: Some of the malloc calls returned null: // CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: // CHECK_MAY_RETURN_1: allocating 512 times // CHECK_MAY_RETURN_1: Some of the malloc calls returned null: // CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: // CHECK_MAY_RETURN_0: allocating 128 times // CHECK_MAY_RETURN_0: Some of the malloc calls returned non-null: 128 // CHECK_MAY_RETURN_0: allocating 256 times // CHECK_MAY_RETURN_0: allocator is terminating the process instead of returning golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/closedir.c0000664000175000017500000000022212644036263032507 0ustar mwhudsonmwhudson// Check that closedir(NULL) is ok. // RUN: %clang -O2 %s -o %t && %run %t #include #include int main() { closedir(0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/ill.cc0000664000175000017500000000152212662736340031635 0ustar mwhudsonmwhudson// Test the handle_sigill option. // RUN: %clang %s -o %t -O1 // RUN: not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s // RUN: %env_tool_opts=handle_sigill=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s // RUN: %env_tool_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s // FIXME: implement in other sanitizers, not just asan. // XFAIL: msan // XFAIL: lsan // XFAIL: tsan // // FIXME: seems to fail on ARM // REQUIRES: x86_64-target-arch #include #include #include void death() { fprintf(stderr, "DEATH CALLBACK\n"); } int main(int argc, char **argv) { __sanitizer_set_death_callback(death); __builtin_trap(); } // CHECK1: ERROR: {{.*}}Sanitizer: // CHECK1: DEATH CALLBACK // CHECK0-NOT: Sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/mlock_test.cc0000664000175000017500000000041712376721527033226 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t // XFAIL: lsan #include #include int main() { assert(0 == mlockall(MCL_CURRENT)); assert(0 == mlock((void *)0x12345, 0x5678)); assert(0 == munlockall()); assert(0 == munlock((void *)0x987, 0x654)); } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/signal_segv_handler.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/signal_segv_han0000664000175000017500000000317112553015121033604 0ustar mwhudsonmwhudson// RUN: %clangxx -O1 %s -o %t && TSAN_OPTIONS="flush_memory_ms=1 memory_limit_mb=1" ASAN_OPTIONS="handle_segv=0 allow_user_segv_handler=1" %run %t 2>&1 | FileCheck %s // JVM uses SEGV to preempt threads. All threads do a load from a known address // periodically. When runtime needs to preempt threads, it unmaps the page. // Threads start triggering SEGV one by one. The signal handler blocks // threads while runtime does its thing. Then runtime maps the page again // and resumes the threads. // Previously this pattern conflicted with stop-the-world machinery, // because it briefly reset SEGV handler to SIG_DFL. // As the consequence JVM just silently died. // This test sets memory flushing rate to maximum, then does series of // "benign" SEGVs that are handled by signal handler, and ensures that // the process survive. #include #include #include #include #include #include unsigned long page_size; void *guard; void handler(int signo, siginfo_t *info, void *uctx) { mprotect(guard, page_size, PROT_READ | PROT_WRITE); } int main() { page_size = sysconf(_SC_PAGESIZE); struct sigaction a, old; memset(&a, 0, sizeof(a)); memset(&old, 0, sizeof(old)); a.sa_sigaction = handler; a.sa_flags = SA_SIGINFO; sigaction(SIGSEGV, &a, &old); guard = mmap(0, 3 * page_size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); guard = (char*)guard + page_size; // work around a kernel bug for (int i = 0; i < 1000000; i++) { mprotect(guard, page_size, PROT_NONE); *(int*)guard = 1; } sigaction(SIGSEGV, &old, 0); fprintf(stderr, "DONE\n"); } // CHECK: DONE golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/assert.cc0000664000175000017500000000141212567411603032350 0ustar mwhudsonmwhudson// Test the handle_abort option. // RUN: %clang %s -o %t // RUN: not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s // RUN: %env_tool_opts=handle_abort=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s // RUN: %env_tool_opts=handle_abort=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s // FIXME: implement in other sanitizers, not just asan. // XFAIL: msan // XFAIL: lsan // XFAIL: tsan #include #include #include void death() { fprintf(stderr, "DEATH CALLBACK\n"); } int main(int argc, char **argv) { __sanitizer_set_death_callback(death); assert(argc == 100); } // CHECK1: ERROR: {{.*}}Sanitizer: // CHECK1: DEATH CALLBACK // CHECK0-NOT: Sanitizer ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/decorate_proc_m0000664000175000017500000000311212670340377033613 0ustar mwhudsonmwhudson// RUN: %clangxx -g %s -o %t // RUN: %env_tool_opts=decorate_proc_maps=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%tool_name // REQUIRES: stable-runtime #include #include #include #include #include #include #include bool CopyFdToFd(int in_fd, int out_fd) { const size_t kBufSize = 0x10000; static char buf[kBufSize]; while (true) { ssize_t got = read(in_fd, buf, kBufSize); if (got > 0) { write(out_fd, buf, got); } else if (got == 0) { break; } else if (errno != EAGAIN || errno != EWOULDBLOCK || errno != EINTR) { fprintf(stderr, "error reading file, errno %d\n", errno); return false; } } return true; } void *ThreadFn(void *arg) { (void)arg; int fd = open("/proc/self/maps", O_RDONLY); bool res = CopyFdToFd(fd, 2); close(fd); return (void *)!res; } int main(void) { pthread_t t; void *res; pthread_create(&t, 0, ThreadFn, 0); pthread_join(t, &res); return (int)(size_t)res; } // CHECK-asan: rw-p {{.*}} [low shadow] // CHECK-asan: ---p {{.*}} [shadow gap] // CHECK-asan: rw-p {{.*}} [high shadow] // CHECK-msan: ---p {{.*}} [invalid] // CHECK-msan: rw-p {{.*}} [shadow{{.*}}] // CHECK-msan: ---p {{.*}} [origin{{.*}}] // CHECK-tsan: rw-p {{.*}} [shadow] // CHECK-tsan: rw-p {{.*}} [meta shadow] // CHECK-tsan: rw-p {{.*}} [trace 0] // CHECK-tsan: rw-p {{.*}} [trace header 0] // CHECK-tsan: rw-p {{.*}} [trace 1] // CHECK-tsan: rw-p {{.*}} [trace header 1] // Nothing interesting with standalone LSan. // CHECK-lsan: decorate_proc_maps ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/open_memstream.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/open_memstream.0000664000175000017500000000324612662736340033567 0ustar mwhudsonmwhudson// RUN: %clangxx -m64 -O0 -g -xc++ %s -o %t && %run %t // RUN: %clangxx -m64 -O3 -g -xc++ %s -o %t && %run %t // REQUIRES: x86_64-target-arch #include #include #include #include #ifndef __has_feature #define __has_feature(x) 0 #endif #if __has_feature(memory_sanitizer) #include static void check_mem_is_good(void *p, size_t s) { __msan_check_mem_is_initialized(p, s); } #elif __has_feature(address_sanitizer) #include static void check_mem_is_good(void *p, size_t s) { assert(__asan_region_is_poisoned(p, s) == 0); } #else static void check_mem_is_good(void *p, size_t s) {} #endif static void run(bool flush) { char *buf; size_t buf_len; fprintf(stderr, " &buf %p, &buf_len %p\n", &buf, &buf_len); FILE *fp = open_memstream(&buf, &buf_len); fprintf(fp, "hello"); if (flush) { fflush(fp); check_mem_is_good(&buf, sizeof(buf)); check_mem_is_good(&buf_len, sizeof(buf_len)); check_mem_is_good(buf, buf_len); } char *p = new char[1024]; memset(p, 'a', 1023); p[1023] = 0; for (int i = 0; i < 100; ++i) fprintf(fp, "%s", p); delete[] p; if (flush) { fflush(fp); fprintf(stderr, " %p addr %p, len %zu\n", &buf, buf, buf_len); check_mem_is_good(&buf, sizeof(buf)); check_mem_is_good(&buf_len, sizeof(buf_len)); check_mem_is_good(buf, buf_len);\ } fclose(fp); check_mem_is_good(&buf, sizeof(buf)); check_mem_is_good(&buf_len, sizeof(buf_len)); check_mem_is_good(buf, buf_len); free(buf); } int main(void) { for (int i = 0; i < 100; ++i) run(false); for (int i = 0; i < 100; ++i) run(true); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/aligned_alloc.c0000664000175000017500000000033412355454032033461 0ustar mwhudsonmwhudson// RUN: %clang -std=c11 -O0 %s -o %t && %run %t #include extern void *aligned_alloc (size_t alignment, size_t size); int main() { volatile void *p = aligned_alloc(128, 1024); free((void*)p); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/ptrace.cc0000664000175000017500000000632512707642732032342 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t && %run %t #include #include #include #include #include #include #include #include #include #include #if __mips64 || __arm__ #include #include #endif #ifdef __aarch64__ // GLIBC 2.20+ sys/user does not include asm/ptrace.h #include #endif int main(void) { pid_t pid; pid = fork(); if (pid == 0) { // child ptrace(PTRACE_TRACEME, 0, NULL, NULL); execl("/bin/true", "true", NULL); } else { wait(NULL); int res; #if __x86_64__ user_regs_struct regs; res = ptrace(PTRACE_GETREGS, pid, NULL, ®s); assert(!res); if (regs.rip) printf("%zx\n", regs.rip); user_fpregs_struct fpregs; res = ptrace(PTRACE_GETFPREGS, pid, NULL, &fpregs); assert(!res); if (fpregs.mxcsr) printf("%x\n", fpregs.mxcsr); #endif // __x86_64__ #if (__powerpc64__ || __mips64 || __arm__) struct pt_regs regs; res = ptrace((enum __ptrace_request)PTRACE_GETREGS, pid, NULL, ®s); assert(!res); #if (__powerpc64__) if (regs.nip) printf("%lx\n", regs.nip); #elif (__mips64) if (regs.cp0_epc) printf("%lx\n", regs.cp0_epc); #elif (__arm__) if (regs.ARM_pc) printf("%lx\n", regs.ARM_pc); #endif #if (__powerpc64 || __mips64) elf_fpregset_t fpregs; res = ptrace((enum __ptrace_request)PTRACE_GETFPREGS, pid, NULL, &fpregs); assert(!res); if ((elf_greg_t)fpregs[32]) // fpscr printf("%lx\n", (elf_greg_t)fpregs[32]); #elif (__arm__) char regbuf[ARM_VFPREGS_SIZE]; res = ptrace((enum __ptrace_request)PTRACE_GETVFPREGS, pid, 0, regbuf); assert(!res); unsigned fpscr = *(unsigned*)(regbuf + (32 * 8)); printf ("%x\n", fpscr); #endif #endif // (__powerpc64__ || __mips64 || __arm__) #if (__aarch64__) struct iovec regset_io; struct user_pt_regs regs; regset_io.iov_base = ®s; regset_io.iov_len = sizeof(regs); res = ptrace(PTRACE_GETREGSET, pid, (void*)NT_PRSTATUS, (void*)®set_io); assert(!res); if (regs.pc) printf("%llx\n", regs.pc); struct user_fpsimd_state fpregs; regset_io.iov_base = &fpregs; regset_io.iov_len = sizeof(fpregs); res = ptrace(PTRACE_GETREGSET, pid, (void*)NT_FPREGSET, (void*)®set_io); assert(!res); if (fpregs.fpsr) printf("%x\n", fpregs.fpsr); #endif // (__aarch64__) #if (__s390__) struct iovec regset_io; struct _user_regs_struct regs; regset_io.iov_base = ®s; regset_io.iov_len = sizeof(regs); res = ptrace(PTRACE_GETREGSET, pid, (void*)NT_PRSTATUS, (void*)®set_io); assert(!res); if (regs.psw.addr) printf("%lx\n", regs.psw.addr); struct _user_fpregs_struct fpregs; regset_io.iov_base = &fpregs; regset_io.iov_len = sizeof(fpregs); res = ptrace(PTRACE_GETREGSET, pid, (void*)NT_FPREGSET, (void*)®set_io); assert(!res); if (fpregs.fpc) printf("%x\n", fpregs.fpc); #endif // (__s390__) siginfo_t siginfo; res = ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo); assert(!res); assert(siginfo.si_pid == pid); ptrace(PTRACE_CONT, pid, NULL, NULL); wait(NULL); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/fpe.cc0000664000175000017500000000162412662736340031632 0ustar mwhudsonmwhudson// Test the handle_sigfpe option. // RUN: %clang %s -o %t // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s // RUN: %env_tool_opts=handle_sigfpe=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s // RUN: %env_tool_opts=handle_sigfpe=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s // FIXME: implement in other sanitizers, not just asan. // XFAIL: msan // XFAIL: lsan // XFAIL: tsan // // FIXME: seems to fail on ARM // REQUIRES: x86_64-target-arch #include #include #include void death() { fprintf(stderr, "DEATH CALLBACK\n"); } int main(int argc, char **argv) { __sanitizer_set_death_callback(death); volatile int one = 1; volatile int zero = 0; volatile int sink; sink = one / zero; } // CHECK1: ERROR: {{.*}}Sanitizer: // CHECK1: DEATH CALLBACK // CHECK0-NOT: Sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/timerfd.cc0000664000175000017500000000255312370705566032516 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 -g %s -o %t && %run %t | FileCheck %s #include #include #include #include #include #include int main (int argc, char** argv) { int fd = timerfd_create(CLOCK_REALTIME, 0); assert(fd >= 0); struct itimerspec its; its.it_value.tv_sec = 0; its.it_value.tv_nsec = 1000000; its.it_interval.tv_sec = its.it_value.tv_sec; its.it_interval.tv_nsec = its.it_value.tv_nsec; int res = timerfd_settime(fd, 0, &its, NULL); assert(res != -1); struct itimerspec its2; res = timerfd_settime(fd, 0, &its, &its2); assert(res != -1); assert(its2.it_interval.tv_sec == its.it_interval.tv_sec); assert(its2.it_interval.tv_nsec == its.it_interval.tv_nsec); assert(its2.it_value.tv_sec <= its.it_value.tv_sec); assert(its2.it_value.tv_nsec <= its.it_value.tv_nsec); struct itimerspec its3; res = timerfd_gettime(fd, &its3); assert(res != -1); assert(its3.it_interval.tv_sec == its.it_interval.tv_sec); assert(its3.it_interval.tv_nsec == its.it_interval.tv_nsec); assert(its3.it_value.tv_sec <= its.it_value.tv_sec); assert(its3.it_value.tv_nsec <= its.it_value.tv_nsec); unsigned long long buf; res = read(fd, &buf, sizeof(buf)); assert(res == 8); assert(buf >= 1); res = close(fd); assert(res != -1); printf("DONE\n"); // CHECK: DONE return 0; } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/hard_rss_limit_0000664000175000017500000000210512567411603033625 0ustar mwhudsonmwhudson// Check hard_rss_limit_mb. Not all sanitizers implement it yet. // RUN: %clangxx -O2 %s -o %t // // Run with limit should fail: // RUN: %env_tool_opts=hard_rss_limit_mb=100 not %run %t 2>&1 | FileCheck %s // This run uses getrusage: // RUN: %env_tool_opts=hard_rss_limit_mb=100:can_use_proc_maps_statm=0 not %run %t 2>&1 | FileCheck %s // // Run w/o limit or with a large enough limit should pass: // RUN: %env_tool_opts=hard_rss_limit_mb=1000 %run %t // RUN: %run %t // // FIXME: make it work for other sanitizers. // XFAIL: lsan // XFAIL: tsan // XFAIL: msan #include #include #include const int kNumAllocs = 200 * 1000; const int kAllocSize = 1000; volatile char *sink[kNumAllocs]; int main(int argc, char **argv) { for (int i = 0; i < kNumAllocs; i++) { if ((i % 1000) == 0) { fprintf(stderr, "[%d]\n", i); } char *x = new char[kAllocSize]; memset(x, 0, kAllocSize); sink[i] = x; } sleep(1); // Make sure the background thread has time to kill the process. // CHECK: hard rss limit exhausted } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/weak_hook_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Linux/weak_hook_test.0000664000175000017500000000444212742252632033555 0ustar mwhudsonmwhudson// Test the weak hooks. // RUN: %clangxx %s -o %t // RUN: %run %t // Hooks are not implemented for lsan. // XFAIL: lsan #include #include bool seen_memcmp, seen_strncmp, seen_strncasecmp, seen_strcmp, seen_strcasecmp, seen_strstr, seen_strcasestr, seen_memmem; extern "C" { void __sanitizer_weak_hook_memcmp(void *called_pc, const void *s1, const void *s2, size_t n, int result) { seen_memcmp = true; } void __sanitizer_weak_hook_strncmp(void *called_pc, const char *s1, const char *s2, size_t n, int result) { seen_strncmp = true; } void __sanitizer_weak_hook_strncasecmp(void *called_pc, const char *s1, const char *s2, size_t n, int result){ seen_strncasecmp = true; } void __sanitizer_weak_hook_strcmp(void *called_pc, const char *s1, const char *s2, int result){ seen_strcmp = true; } void __sanitizer_weak_hook_strcasecmp(void *called_pc, const char *s1, const char *s2, int result){ seen_strcasecmp = true; } void __sanitizer_weak_hook_strstr(void *called_pc, const char *s1, const char *s2, char *result){ seen_strstr = true; } void __sanitizer_weak_hook_strcasestr(void *called_pc, const char *s1, const char *s2, char *result){ seen_strcasestr = true; } void __sanitizer_weak_hook_memmem(void *called_pc, const void *s1, size_t len1, const void *s2, size_t len2, void *result){ seen_memmem = true; } } // extern "C" char s1[] = "ABCDEF"; char s2[] = "CDE"; static volatile int int_sink; static volatile void *ptr_sink; int main() { assert(sizeof(s2) < sizeof(s1)); int_sink = memcmp(s1, s2, sizeof(s2)); assert(seen_memcmp); int_sink = strncmp(s1, s2, sizeof(s2)); assert(seen_strncmp); int_sink = strncasecmp(s1, s2, sizeof(s2)); assert(seen_strncasecmp); int_sink = strcmp(s1, s2); assert(seen_strcmp); int_sink = strcasecmp(s1, s2); assert(seen_strcasecmp); ptr_sink = strstr(s1, s2); assert(seen_strstr); ptr_sink = strcasestr(s1, s2); assert(seen_strcasestr); ptr_sink = memmem(s1, sizeof(s1), s2, sizeof(s2)); assert(seen_memmem); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/options-include.cc0000664000175000017500000000405312661157602033071 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t // Recursive include: options1 includes options2 // RUN: echo "symbolize=1" > %t.options1.txt // RUN: echo "include='%t.options2.txt'" >>%t.options1.txt // RUN: echo "help=1" >%t.options2.txt // RUN: echo "help=1" >%t.options.options-include.cc.tmp // RUN: cat %t.options1.txt // RUN: cat %t.options2.txt // RUN: %env_tool_opts=help=0:include='"%t.options1.txt"' %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND <%t.out // RUN: %env_tool_opts=include='"%t.options1.txt"',help=0 %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-FOUND <%t.out // RUN: %env_tool_opts=include='"%t.options-not-found.txt"',help=1 not %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out // include_if_exists does not fail when the file is missing // RUN: %env_tool_opts=include_if_exists='"%t.options-not-found.txt"',help=1 %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out // %b (binary basename substitution) // RUN: %env_tool_opts=include='"%t.options.%b"' %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out // RUN: %env_tool_opts=include='"%t.options-not-found.%b"' not %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-NOT-FOUND < %t.out // RUN: %env_tool_opts=include_if_exists='"%t.options.%b"' %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out // RUN: %env_tool_opts=include_if_exists='"%t.options-not-found.%b"' %run %t 2>&1 | tee %t.out // RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-FOUND < %t.out #include int main() { fprintf(stderr, "done\n"); } // CHECK-WITH-HELP: Available flags for // CHECK-WITHOUT-HELP-NOT: Available flags for // CHECK-FOUND-NOT: Failed to read options from // CHECK-NOT-FOUND: Failed to read options from golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/strcspn.c0000664000175000017500000000033712531557321031305 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t 2>&1 #include #include int main(int argc, char **argv) { size_t r; char s1[] = "ad"; char s2[] = "cd"; r = strcspn(s1, s2); assert(r == 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/strspn.c0000664000175000017500000000033612531557321031141 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t 2>&1 #include #include int main(int argc, char **argv) { size_t r; char s1[] = "ab"; char s2[] = "ac"; r = strspn(s1, s2); assert(r == 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/malloc_hook.cc0000664000175000017500000000331212730603256032237 0ustar mwhudsonmwhudson// RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // Malloc/free hooks are not supported on Windows. // XFAIL: win32 #include #include #include extern "C" { const volatile void *global_ptr; #define WRITE(s) write(1, s, sizeof(s)) // Note: avoid calling functions that allocate memory in malloc/free // to avoid infinite recursion. void __sanitizer_malloc_hook(const volatile void *ptr, size_t sz) { if (__sanitizer_get_ownership(ptr) && sz == 4) { WRITE("MallocHook\n"); global_ptr = ptr; } } void __sanitizer_free_hook(const volatile void *ptr) { if (__sanitizer_get_ownership(ptr) && ptr == global_ptr) WRITE("FreeHook\n"); } } // extern "C" volatile int *x; void MallocHook1(const volatile void *ptr, size_t sz) { WRITE("MH1\n"); } void MallocHook2(const volatile void *ptr, size_t sz) { WRITE("MH2\n"); } void FreeHook1(const volatile void *ptr) { WRITE("FH1\n"); } void FreeHook2(const volatile void *ptr) { WRITE("FH2\n"); } // Call this function with uninitialized arguments to poison // TLS shadow for function parameters before calling operator // new and, eventually, user-provided hook. __attribute__((noinline)) void allocate(int *unused1, int *unused2) { x = new int; } int main() { __sanitizer_install_malloc_and_free_hooks(MallocHook1, FreeHook1); __sanitizer_install_malloc_and_free_hooks(MallocHook2, FreeHook2); int *undef1, *undef2; allocate(undef1, undef2); // CHECK: MallocHook // CHECK: MH1 // CHECK: MH2 // Check that malloc hook was called with correct argument. if (global_ptr != (void*)x) { _exit(1); } *x = 0; delete x; // CHECK: FreeHook // CHECK: FH1 // CHECK: FH2 return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/options-help.cc0000664000175000017500000000025612567411603032376 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t // RUN: %env_tool_opts=help=1 %run %t 2>&1 | FileCheck %s int main() { } // CHECK: Available flags for {{.*}}Sanitizer: // CHECK: handle_segv golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/symbolize_pc.cc0000664000175000017500000000276212767771650032475 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 %s -o %t // RUN: %env_tool_opts=strip_path_prefix=/TestCases/ %run %t 2>&1 | FileCheck %s // UNSUPPORTED: i386-darwin // // Tests __sanitizer_symbolize_pc. #include #include int GLOBAL_VAR_ABC; void SymbolizeCaller() { char data[100]; __sanitizer_symbolize_pc(__builtin_return_address(0), "%p %F %L", data, sizeof(data)); printf("FIRST_FORMAT %s\n", data); __sanitizer_symbolize_pc(__builtin_return_address(0), "FUNC:%f LINE:%l FILE:%s", data, sizeof(data)); printf("SECOND_FORMAT %s\n", data); __sanitizer_symbolize_pc(__builtin_return_address(0), "LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO" "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO" "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO" "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO" "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG" "FUNC:%f LINE:%l FILE:%s", data, sizeof(data)); printf("LONG_FORMAT %s\n", data); } void SymbolizeData() { char data[100]; __sanitizer_symbolize_global(&GLOBAL_VAR_ABC, "%g %s:%l", data, sizeof(data)); printf("GLOBAL: %s\n", data); } // CHECK: FIRST_FORMAT 0x{{.*}} in main symbolize_pc.cc:[[@LINE+3]] // CHECK: SECOND_FORMAT FUNC:main LINE:[[@LINE+2]] FILE:symbolize_pc.cc int main() { SymbolizeCaller(); SymbolizeData(); } // CHECK: GLOBAL: GLOBAL_VAR_ABC golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/fopen_nullptr.c0000664000175000017500000000024312636050562032475 0ustar mwhudsonmwhudson// Check that fopen(NULL, "r") is ok. // RUN: %clang -O2 %s -o %t && %run %t #include const char *fn = NULL; FILE *f; int main() { f = fopen(fn, "r"); } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/0000775000175000017500000000000013040224617030537 5ustar mwhudsonmwhudson././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/sanitizer_set_r0000664000175000017500000000166712722135271033703 0ustar mwhudsonmwhudson// Test __sanitizer_set_report_fd: // RUN: %clangxx -O2 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: not %run %t stdout | FileCheck %s // RUN: not %run %t %t-out && FileCheck < %t-out %s // REQUIRES: stable-runtime // FIXME: implement SEGV handler in other sanitizers, not just asan. // XFAIL: msan // XFAIL: lsan // XFAIL: tsan #include #include #include #include #include #include #include #include volatile int *null = 0; int main(int argc, char **argv) { if (argc == 2) { if (!strcmp(argv[1], "stdout")) { __sanitizer_set_report_fd(reinterpret_cast(1)); } else { int fd = open(argv[1], O_CREAT | O_WRONLY | O_TRUNC, S_IRWXU); assert(fd > 0); __sanitizer_set_report_fd(reinterpret_cast(fd)); } } *null = 0; } // CHECK: ERROR: {{.*}} SEGV on unknown address golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/lit.local.cfg0000664000175000017500000000026412670340377033115 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os in ['Windows']: config.unsupported = True ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/sanitizer_set_d0000664000175000017500000000150212670041705033651 0ustar mwhudsonmwhudson// RUN: %clangxx -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: stable-runtime #include #include volatile char *zero = 0; void Death() { fprintf(stderr, "DEATH CALLBACK EXECUTED\n"); } // CHECK: DEATH CALLBACK EXECUTED char global; volatile char *sink; __attribute__((noinline)) void MaybeInit(int *uninitialized) { if (zero) *uninitialized = 1; } __attribute__((noinline)) void Leak() { sink = new char[100]; // trigger lsan report. } int main(int argc, char **argv) { int uninitialized; __sanitizer_set_death_callback(Death); MaybeInit(&uninitialized); if (uninitialized) // trigger msan report. global = 77; sink = new char[100]; delete[] sink; global = sink[0]; // use-after-free: trigger asan/tsan report. Leak(); sink = 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/getpass.cc0000664000175000017500000000147412670041677032535 0ustar mwhudsonmwhudson// RUN: %clangxx -O0 -g %s -lutil -o %t && %run %t | FileCheck %s // REQUIRES: stable-runtime #include #include #include #include #if __linux__ #include #else #include #endif int main (int argc, char** argv) { int master; int pid = forkpty(&master, NULL, NULL, NULL); if(pid == -1) { fprintf(stderr, "forkpty failed\n"); return 1; } else if (pid > 0) { char buf[1024]; int res = read(master, buf, sizeof(buf)); write(1, buf, res); write(master, "password\n", 9); while ((res = read(master, buf, sizeof(buf))) > 0) write(1, buf, res); } else { char *s = getpass("prompt"); assert(strcmp(s, "password") == 0); write(1, "done\n", 5); } return 0; } // CHECK: prompt // CHECK: done ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Posix/dedup_token_len0000664000175000017500000000237112723367624033641 0ustar mwhudsonmwhudson// Test dedup_token_length // RUN: %clangxx -O0 %s -o %t // RUN: env %tool_options='abort_on_error=0' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 // RUN: env %tool_options='abort_on_error=0, dedup_token_length=0' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 // RUN: env %tool_options='abort_on_error=0, dedup_token_length=1' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: env %tool_options='abort_on_error=0, dedup_token_length=2' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: env %tool_options='abort_on_error=0, dedup_token_length=3' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 // REQUIRES: stable-runtime // FIXME: implement SEGV handler in other sanitizers, not just asan. // XFAIL: msan // XFAIL: lsan // XFAIL: tsan volatile int *null = 0; namespace Xyz { template void Abc() { *null = 0; } } extern "C" void bar() { Xyz::Abc(); } void FOO() { bar(); } int main(int argc, char **argv) { FOO(); } // CHECK0-NOT: DEDUP_TOKEN: // CHECK1: DEDUP_TOKEN: void Xyz::Abc() // CHECK1-NOT: bar // CHECK2: DEDUP_TOKEN: void Xyz::Abc()--bar // CHECK2-NOT: FOO // CHECK3: DEDUP_TOKEN: void Xyz::Abc()--bar--FOO() golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/strnlen.c0000664000175000017500000000045112674604614031301 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t 2>&1 #include #include int main(int argc, char **argv) { const char *s = "mytest"; assert(strnlen(s, 0) == 0UL); assert(strnlen(s, 1) == 1UL); assert(strnlen(s, 6) == strlen(s)); assert(strnlen(s, 7) == strlen(s)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Darwin/0000775000175000017500000000000013040224617030661 5ustar mwhudsonmwhudson././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Darwin/abort_on_error.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Darwin/abort_on_error0000664000175000017500000000075212661157602033633 0ustar mwhudsonmwhudson// Check that sanitizers on OS X crash the process by default (i.e. // abort_on_error=1). See also Linux/abort_on_error.cc. // RUN: %clangxx %s -o %t // Intentionally don't inherit the default options. // RUN: env %tool_options='' not --crash %run %t 2>&1 // When we use lit's default options, we shouldn't crash. // RUN: not %run %t 2>&1 int global; int main() { volatile int *a = new int[100]; delete[] a; global = a[0]; // use-after-free: triggers ASan report. return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/Darwin/lit.local.cfg0000664000175000017500000000026712567672670033253 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Darwin']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/sanitizer_common/TestCases/strstr.c0000664000175000017500000000034412531557321031150 0ustar mwhudsonmwhudson// RUN: %clang %s -o %t && %run %t 2>&1 #include #include int main(int argc, char **argv) { char *r = 0; char s1[] = "ab"; char s2[] = "b"; r = strstr(s1, s2); assert(r == s1 + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/0000775000175000017500000000000013040224624023112 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/CMakeLists.txt0000664000175000017500000000333212741012374025657 0ustar mwhudsonmwhudsonset(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(LSAN_TESTSUITES) set(LSAN_TEST_ARCH ${LSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(LSAN_SUPPORTED_ARCH LSAN_TEST_ARCH) endif() foreach(arch ${LSAN_TEST_ARCH}) set(LSAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" LSAN_TEST_CONFIG_SUFFIX) if(ANDROID OR ${arch} MATCHES "arm|aarch64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(LSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) set(LSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} LSAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " LSAN_TEST_TARGET_CFLAGS "${LSAN_TEST_TARGET_CFLAGS}") endif() string(TOUPPER ${arch} ARCH_UPPER_CASE) set(LSAN_LIT_TEST_MODE "Standalone") set(CONFIG_NAME ${ARCH_UPPER_CASE}LsanConfig) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) set(CONFIG_NAME ${ARCH_UPPER_CASE}AsanConfig) set(LSAN_LIT_TEST_MODE "AddressSanitizer") configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND LSAN_TEST_DEPS lsan asan) endif() add_lit_testsuite(check-lsan "Running the LeakSanitizer tests" ${LSAN_TESTSUITES} DEPENDS ${LSAN_TEST_DEPS}) set_target_properties(check-lsan PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/lit.site.cfg.in0000664000175000017500000000101412704361721025735 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.name_suffix = "@LSAN_TEST_CONFIG_SUFFIX@" config.target_cflags = "@LSAN_TEST_TARGET_CFLAGS@" config.lsan_lit_test_mode = "@LSAN_LIT_TEST_MODE@" config.target_arch = "@LSAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@LSAN_LIT_SOURCE_DIR@/lit.common.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/lit.common.cfg0000664000175000017500000000371012656411117025662 0ustar mwhudsonmwhudson# -*- Python -*- # Common configuration for running leak detection tests under LSan/ASan. import os def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: lit_config.fatal( "No attribute %r in test configuration! You may need to run " "tests from your build directory or add this attribute " "to lit.site.cfg " % attr_name) return attr_value # Setup source root. config.test_source_root = os.path.dirname(__file__) # Choose between standalone and LSan+ASan modes. lsan_lit_test_mode = get_required_attr(config, 'lsan_lit_test_mode') if lsan_lit_test_mode == "Standalone": config.name = "LeakSanitizer-Standalone" lsan_cflags = ["-fsanitize=leak"] elif lsan_lit_test_mode == "AddressSanitizer": config.name = "LeakSanitizer-AddressSanitizer" lsan_cflags = ["-fsanitize=address"] config.available_features.add('asan') else: lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode) config.name += config.name_suffix clang_cflags = ["-O0", config.target_cflags] + config.debug_info_flags clang_cxxflags = config.cxx_mode_flags + clang_cflags clang_lsan_cflags = clang_cflags + lsan_cflags clang_lsan_cxxflags = clang_cxxflags + lsan_cflags config.clang_cflags = clang_cflags config.clang_cxxflags = clang_cxxflags def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) ) config.substitutions.append( ("%clang_lsan ", build_invocation(clang_lsan_cflags)) ) config.substitutions.append( ("%clangxx_lsan ", build_invocation(clang_lsan_cxxflags)) ) # LeakSanitizer tests are currently supported on x86-64 Linux and mips64 Linux only. if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64', 'mips64']: config.unsupported = True config.suffixes = ['.c', '.cc', '.cpp'] golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/0000775000175000017500000000000013040224624025010 5ustar mwhudsonmwhudson././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/leak_check_before_thread_started.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/leak_check_before_thread_started.0000664000175000017500000000203112657155355033476 0ustar mwhudsonmwhudson// Regression test for http://llvm.org/bugs/show_bug.cgi?id=21621 // This test relies on timing between threads, so any failures will be flaky. // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS="log_pointers=1:log_threads=1" %run %t #include #include #include #include pthread_cond_t cond = PTHREAD_COND_INITIALIZER; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; bool flag = false; void *func(void *arg) { // This mutex will never be grabbed. fprintf(stderr, "entered func()\n"); pthread_mutex_lock(&mutex); free(arg); pthread_mutex_unlock(&mutex); return 0; } void create_detached_thread() { pthread_t thread_id; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); void *arg = malloc(1337); assert(arg); // This mutex is never unlocked by the main thread. pthread_mutex_lock(&mutex); int res = pthread_create(&thread_id, &attr, func, arg); assert(res == 0); } int main() { create_detached_thread(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_stacks_threaded.cc0000664000175000017500000000211713002133725031323 0ustar mwhudsonmwhudson// Test that stacks of non-main threads are included in the root set. // RUN: LSAN_BASE="report_objects=1:use_registers=0" // RUN: %clangxx_lsan -pthread %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_stacks=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include #include #include #include "../../tsan/test.h" extern "C" void *stacks_thread_func(void *arg) { int *sync = reinterpret_cast(arg); void *p = malloc(1337); print_address("Test alloc: ", 1, p); fflush(stderr); __sync_fetch_and_xor(sync, 1); while (true) sched_yield(); } int main() { int sync = 0; pthread_t thread_id; int res = pthread_create(&thread_id, 0, stacks_thread_func, &sync); assert(res == 0); while (!__sync_fetch_and_xor(&sync, 0)) sched_yield(); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/fork_threaded.cc0000664000175000017500000000175212330266131030125 0ustar mwhudsonmwhudson// Test that thread local data is handled correctly after forking without // exec(). In this test leak checking is initiated from a non-main thread. // RUN: %clangxx_lsan %s -o %t // RUN: %run %t 2>&1 #include #include #include #include #include #include __thread void *thread_local_var; void *exit_thread_func(void *arg) { exit(0); } void ExitFromThread() { pthread_t tid; int res; res = pthread_create(&tid, 0, exit_thread_func, 0); assert(res == 0); pthread_join(tid, 0); } int main() { int status = 0; thread_local_var = malloc(1337); pid_t pid = fork(); assert(pid >= 0); if (pid > 0) { waitpid(pid, &status, 0); assert(WIFEXITED(status)); return WEXITSTATUS(status); } else { // Spawn a thread and call exit() from there, to check that we track main // thread's pid correctly even if leak checking is initiated from another // thread. ExitFromThread(); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/suppressions_file.cc0000664000175000017500000000174712552312260031105 0ustar mwhudsonmwhudson// RUN: LSAN_BASE="use_registers=0:use_stacks=0" // RUN: %clangxx_lsan %s -o %t // RUN: rm -f %t.supp // RUN: touch %t.supp // RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp'" not %run %t 2>&1 | FileCheck %s --check-prefix=NOSUPP // RUN: echo "leak:*LSanTestLeakingFunc*" > %t.supp // RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp'" not %run %t 2>&1 | FileCheck %s // RUN: echo "leak:%t" > %t.supp // RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp':symbolize=false" %run %t #include #include void LSanTestLeakingFunc() { void *p = malloc(666); fprintf(stderr, "Test alloc: %p.\n", p); } int main() { LSanTestLeakingFunc(); void *q = malloc(1337); fprintf(stderr, "Test alloc: %p.\n", q); return 0; } // CHECK: Suppressions used: // CHECK: 1 666 *LSanTestLeakingFunc* // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) // NOSUPP: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s). golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_registers.cc0000664000175000017500000000276313002133725030211 0ustar mwhudsonmwhudson// Test that registers of running threads are included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0" // RUN: %clangxx_lsan -pthread %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_registers=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_registers=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include #include #include #include "../../tsan/test.h" extern "C" void *registers_thread_func(void *arg) { int *sync = reinterpret_cast(arg); void *p = malloc(1337); // To store the pointer, choose a register which is unlikely to be reused by // a function call. #if defined(__i386__) asm ( "mov %0, %%esi" : : "r" (p) ); #elif defined(__x86_64__) asm ( "mov %0, %%r15" : : "r" (p) ); #elif defined(__mips__) asm ( "move $16, %0" : : "r" (p) ); #else #error "Test is not supported on this architecture." #endif print_address("Test alloc: ", 1, p); fflush(stderr); __sync_fetch_and_xor(sync, 1); while (true) sched_yield(); } int main() { int sync = 0; pthread_t thread_id; int res = pthread_create(&thread_id, 0, registers_thread_func, &sync); assert(res == 0); while (!__sync_fetch_and_xor(&sync, 0)) sched_yield(); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/print_suppressions.cc0000664000175000017500000000220012374507303031311 0ustar mwhudsonmwhudson// Print matched suppressions only if print_suppressions=1 AND at least one is // matched. Default is print_suppressions=true. // RUN: LSAN_BASE="use_registers=0:use_stacks=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:print_suppressions=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print // RUN: LSAN_OPTIONS=$LSAN_BASE:print_suppressions=0 %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-dont-print // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-print #include #include #include "sanitizer/lsan_interface.h" extern "C" const char *__lsan_default_suppressions() { return "leak:*LSanTestLeakingFunc*"; } void LSanTestLeakingFunc() { void *p = malloc(666); fprintf(stderr, "Test alloc: %p.\n", p); } int main(int argc, char **argv) { printf("print for nonempty output\n"); if (argc > 1) LSanTestLeakingFunc(); return 0; } // CHECK-print: Suppressions used: // CHECK-print: 1 666 *LSanTestLeakingFunc* // CHECK-dont-print-NOT: Suppressions used: ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_tls_pthread_specific_dynamic.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_tls_pthread_specific_dynamic.0000664000175000017500000000241213002133725033545 0ustar mwhudsonmwhudson// Test that dynamically allocated thread-specific storage is included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include #include #include "../../tsan/test.h" // From glibc: this many keys are stored in the thread descriptor directly. const unsigned PTHREAD_KEY_2NDLEVEL_SIZE = 32; int main() { static const unsigned kDummyKeysCount = PTHREAD_KEY_2NDLEVEL_SIZE; int res; pthread_key_t dummy_keys[kDummyKeysCount]; for (unsigned i = 0; i < kDummyKeysCount; i++) { res = pthread_key_create(&dummy_keys[i], NULL); assert(res == 0); } pthread_key_t key; res = pthread_key_create(&key, NULL); assert(key >= PTHREAD_KEY_2NDLEVEL_SIZE); assert(res == 0); void *p = malloc(1337); res = pthread_setspecific(key, p); assert(res == 0); print_address("Test alloc: ", 1, p); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/disabler.cc0000664000175000017500000000111512623402112027076 0ustar mwhudsonmwhudson// Test for ScopedDisabler. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include #include #include "sanitizer/lsan_interface.h" int main() { void **p; { __lsan::ScopedDisabler d; p = new void *; fprintf(stderr, "Test alloc p: %p.\n", p); } *p = malloc(666); void *q = malloc(1337); fprintf(stderr, "Test alloc q: %p.\n", q); return 0; } // CHECK: Test alloc p: [[ADDR:.*]]. // CHECK-NOT: [[ADDR]] golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_globals_uninitialized.cc0000664000175000017500000000126713002133725032553 0ustar mwhudsonmwhudson// Test that uninitialized globals are included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_globals=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_globals=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include "../../tsan/test.h" void *bss_var; int main() { bss_var = malloc(1337); print_address("Test alloc: ", 1, bss_var); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_tls_static.cc0000664000175000017500000000130013002133725030335 0ustar mwhudsonmwhudson// Test that statically allocated TLS space is included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include "../../tsan/test.h" __thread void *tls_var; int main() { tls_var = malloc(1337); print_address("Test alloc: ", 1, tls_var); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/high_allocator_contention.cc0000664000175000017500000000267312646312565032563 0ustar mwhudsonmwhudson// A benchmark that executes malloc/free pairs in parallel. // Usage: ./a.out number_of_threads total_number_of_allocations // RUN: LSAN_BASE="use_ld_allocations=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 5 1000000 2>&1 #include #include #include #include int num_threads; int total_num_alloc; const int kMaxNumThreads = 5000; pthread_t tid[kMaxNumThreads]; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; bool go = false; void *thread_fun(void *arg) { pthread_mutex_lock(&mutex); while (!go) pthread_cond_wait(&cond, &mutex); pthread_mutex_unlock(&mutex); for (int i = 0; i < total_num_alloc / num_threads; i++) { void *p = malloc(10); __asm__ __volatile__("" : : "r"(p) : "memory"); free((void *)p); } return 0; } int main(int argc, char** argv) { assert(argc == 3); num_threads = atoi(argv[1]); assert(num_threads > 0); assert(num_threads <= kMaxNumThreads); total_num_alloc = atoi(argv[2]); assert(total_num_alloc > 0); printf("%d threads, %d allocations in each\n", num_threads, total_num_alloc / num_threads); for (int i = 0; i < num_threads; i++) pthread_create(&tid[i], 0, thread_fun, 0); pthread_mutex_lock(&mutex); go = true; pthread_cond_broadcast(&cond); pthread_mutex_unlock(&mutex); for (int i = 0; i < num_threads; i++) pthread_join(tid[i], 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/stale_stack_leak.cc0000664000175000017500000000266713002133725030622 0ustar mwhudsonmwhudson// Test that out-of-scope local variables are ignored by LSan. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=1" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE":exitcode=0" %run %t 2>&1 | FileCheck --check-prefix=CHECK-sanity %s #include #include #include "../../tsan/test.h" void **pp; // Put pointer far enough on the stack that LSan has space to run in without // overwriting it. // Hopefully the argument p will be passed on a register, saving us from false // negatives. __attribute__((noinline)) void *PutPointerOnStaleStack(void *p) { void *locals[2048]; locals[0] = p; pp = &locals[0]; print_address("Test alloc: ", 1, locals[0]); return 0; } int main() { PutPointerOnStaleStack(malloc(1337)); return 0; } // This must run after LSan, to ensure LSan didn't overwrite the pointer before // it had a chance to see it. If LSan is invoked with atexit(), this works. // Otherwise, we need a different method. __attribute__((destructor)) __attribute__((no_sanitize_address)) void ConfirmPointerHasSurvived() { print_address("Value after LSan: ", 1, *pp); } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK-sanity: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: // CHECK-sanity: Value after LSan: [[ADDR]] golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_tls_dynamic.cc0000664000175000017500000000342513002133725030504 0ustar mwhudsonmwhudson// Test that dynamically allocated TLS space is included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0:use_ld_allocations=0" // RUN: %clangxx %s -DBUILD_DSO -fPIC -shared -o %t-so.so // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #ifndef BUILD_DSO #include #include #include #include #include #include "../../tsan/test.h" int main(int argc, char *argv[]) { std::string path = std::string(argv[0]) + "-so.so"; void *handle = dlopen(path.c_str(), RTLD_LAZY); assert(handle != 0); typedef void **(* store_t)(void *p); store_t StoreToTLS = (store_t)dlsym(handle, "StoreToTLS"); assert(dlerror() == 0); void *p = malloc(1337); // If we don't know about dynamic TLS, we will return a false leak above. void **p_in_tls = StoreToTLS(p); assert(*p_in_tls == p); print_address("Test alloc: ", 1, p); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: #else // BUILD_DSO // A loadable module with a large thread local section, which would require // allocation of a new TLS storage chunk when loaded with dlopen(). We use it // to test the reachability of such chunks in LSan tests. // This must be large enough that it doesn't fit into preallocated static TLS // space (see STATIC_TLS_SURPLUS in glibc). __thread void *huge_thread_local_array[(1 << 20) / sizeof(void *)]; // NOLINT extern "C" void **StoreToTLS(void *p) { huge_thread_local_array[0] = p; return &huge_thread_local_array[0]; } #endif // BUILD_DSO golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/link_turned_off.cc0000664000175000017500000000105112330266131030464 0ustar mwhudsonmwhudson// Test for disabling LSan at link-time. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s #include int argc_copy; extern "C" { int __lsan_is_turned_off() { return (argc_copy == 1); } } int main(int argc, char *argv[]) { volatile int *x = new int; *x = 42; argc_copy = argc; return 0; } // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/ignore_object.c0000664000175000017500000000127512623402112027766 0ustar mwhudsonmwhudson// Test for __lsan_ignore_object(). // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0" // RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include #include #include "sanitizer/lsan_interface.h" int main() { // Explicitly ignored object. void **p = malloc(sizeof(void *)); // Transitively ignored object. *p = malloc(666); // Non-ignored object. volatile void *q = malloc(1337); fprintf(stderr, "Test alloc: %p.\n", p); __lsan_ignore_object(p); return 0; } // CHECK: Test alloc: [[ADDR:.*]]. // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/cleanup_in_tsd_destructor.c0000664000175000017500000000253213002133725032422 0ustar mwhudsonmwhudson// Regression test for thread lifetime tracking. Thread data should be // considered live during the thread's termination, at least until the // user-installed TSD destructors have finished running (since they may contain // additional cleanup tasks). LSan doesn't actually meet that goal 100%, but it // makes its best effort. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0" // RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:use_tls=1 %run %t // RUN: LSAN_OPTIONS=$LSAN_BASE:use_tls=0 not %run %t 2>&1 | FileCheck %s #include #include #include #include #include "sanitizer/lsan_interface.h" #include "../../tsan/test.h" pthread_key_t key; __thread void *p; void key_destructor(void *arg) { // Generally this may happen on a different thread. __lsan_do_leak_check(); } void *thread_func(void *arg) { p = malloc(1337); print_address("Test alloc: ", 1, p); int res = pthread_setspecific(key, (void*)1); assert(res == 0); return 0; } int main() { int res = pthread_key_create(&key, &key_destructor); assert(res == 0); pthread_t thread_id; res = pthread_create(&thread_id, 0, thread_func, 0); assert(res == 0); res = pthread_join(thread_id, 0); assert(res == 0); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: [[ADDR]] (1337 bytes) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/disabler_in_tsd_destructor.c0000664000175000017500000000167312646312565032603 0ustar mwhudsonmwhudson// Regression test. Disabler should not depend on TSD validity. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=1:use_ld_allocations=0" // RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t #include #include #include #include #include "sanitizer/lsan_interface.h" pthread_key_t key; void key_destructor(void *arg) { __lsan_disable(); void *p = malloc(1337); // Break optimization. fprintf(stderr, "Test alloc: %p.\n", p); pthread_setspecific(key, 0); __lsan_enable(); } void *thread_func(void *arg) { int res = pthread_setspecific(key, (void*)1); assert(res == 0); return 0; } int main() { int res = pthread_key_create(&key, &key_destructor); assert(res == 0); pthread_t thread_id; res = pthread_create(&thread_id, 0, thread_func, 0); assert(res == 0); res = pthread_join(thread_id, 0); assert(res == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/sanity_check_pure_c.c0000664000175000017500000000035412205422314031155 0ustar mwhudsonmwhudson// Check that we can build C code. // RUN: %clang_lsan %s -o %t #ifdef __cplusplus #error "This test must be built in C mode" #endif int main() { // FIXME: ideally this should somehow check that we don't have libstdc++ return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_globals_initialized.cc0000664000175000017500000000130413002133725032200 0ustar mwhudsonmwhudson// Test that initialized globals are included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_globals=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_globals=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include "../../tsan/test.h" void *data_var = (void *)1; int main() { data_var = malloc(1337); print_address("Test alloc: ", 1, data_var); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/large_allocation_leak.cc0000664000175000017500000000125413002133725031613 0ustar mwhudsonmwhudson// Test that LargeMmapAllocator's chunks aren't reachable via some internal data structure. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include #include #include "../../tsan/test.h" int main() { // maxsize in primary allocator is always less than this (1 << 25). void *large_alloc = malloc(33554432); print_address("Test alloc: ", 1, large_alloc); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (33554432 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/disabler.c0000664000175000017500000000117212623402112026736 0ustar mwhudsonmwhudson// Test for __lsan_disable() / __lsan_enable(). // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0" // RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include #include #include "sanitizer/lsan_interface.h" int main() { void **p; { __lsan_disable(); p = malloc(sizeof(void *)); __lsan_enable(); } *p = malloc(666); void *q = malloc(1337); // Break optimization. fprintf(stderr, "Test alloc: %p.\n", q); return 0; } // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_poisoned_asan.cc0000664000175000017500000000141113002133725031011 0ustar mwhudsonmwhudson// ASan-poisoned memory should be ignored if use_poisoned is false. // REQUIRES: asan // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_poisoned=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_poisoned=1" %run %t 2>&1 #include #include #include #include #include "../../tsan/test.h" void **p; int main() { p = new void *; *p = malloc(1337); print_address("Test alloc: ", 1, *p); __asan_poison_memory_region(p, sizeof(*p)); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: AddressSanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/swapcontext.cc0000664000175000017500000000247012363213415027704 0ustar mwhudsonmwhudson// We can't unwind stack if we're running coroutines on heap-allocated // memory. Make sure we don't report these leaks. // RUN: %clangxx_lsan %s -o %t // RUN: %run %t 2>&1 // RUN: not %run %t foo 2>&1 | FileCheck %s #include #if defined(__APPLE__) // Note: ucontext.h is deprecated on OSX, so this test may stop working // someday. We define _XOPEN_SOURCE to keep using ucontext.h for now. #define _XOPEN_SOURCE 1 #endif #include #include const int kStackSize = 1 << 20; void Child() { int child_stack; printf("Child: %p\n", &child_stack); int *leaked = new int[666]; } int main(int argc, char *argv[]) { char stack_memory[kStackSize + 1]; char *heap_memory = new char[kStackSize + 1]; char *child_stack = (argc > 1) ? stack_memory : heap_memory; printf("Child stack: %p\n", child_stack); ucontext_t orig_context; ucontext_t child_context; getcontext(&child_context); child_context.uc_stack.ss_sp = child_stack; child_context.uc_stack.ss_size = kStackSize / 2; child_context.uc_link = &orig_context; makecontext(&child_context, Child, 0); if (swapcontext(&orig_context, &child_context) < 0) { perror("swapcontext"); return 1; } delete[] heap_memory; return 0; } // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_after_return.cc0000664000175000017500000000210613002133725030671 0ustar mwhudsonmwhudson// Test that fake stack (introduced by ASan's use-after-return mode) is included // in the root set. // RUN: LSAN_BASE="report_objects=1:use_registers=0" // RUN: %clangxx_lsan %s -O2 -o %t // RUN: ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 LSAN_OPTIONS=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s // RUN: ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 LSAN_OPTIONS=$LSAN_BASE:"use_stacks=1" %run %t 2>&1 // RUN: ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 LSAN_OPTIONS="" %run %t 2>&1 #include #include #include "../../tsan/test.h" int main() { void *stack_var = malloc(1337); print_address("Test alloc: ", 1, stack_var); // Take pointer to variable, to ensure it's not optimized into a register. print_address("Stack var at: ", 1, &stack_var); // Do not return from main to prevent the pointer from going out of scope. exit(0); } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/do_leak_check_override.cc0000664000175000017500000000222112330266131031746 0ustar mwhudsonmwhudson// Test for __lsan_do_leak_check(). We test it by making the leak check run // before global destructors, which also tests compatibility with HeapChecker's // "normal" mode (LSan runs in "strict" mode by default). // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck --check-prefix=CHECK-strict %s // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 | FileCheck --check-prefix=CHECK-normal %s #include #include #include struct LeakyGlobal { LeakyGlobal() { p = malloc(1337); } ~LeakyGlobal() { p = 0; } void *p; }; LeakyGlobal leaky_global; int main(int argc, char *argv[]) { // Register leak check to run before global destructors. if (argc > 1) atexit(&__lsan_do_leak_check); void *p = malloc(666); printf("Test alloc: %p\n", p); printf("Test alloc in leaky global: %p\n", leaky_global.p); return 0; } // CHECK-strict: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s) // CHECK-normal: SUMMARY: {{(Leak|Address)}}Sanitizer: 666 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/ignore_object_errors.cc0000664000175000017500000000074412455754447031555 0ustar mwhudsonmwhudson// Test for incorrect use of __lsan_ignore_object(). // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 2>&1 | FileCheck %s #include #include #include "sanitizer/lsan_interface.h" int main() { void *p = malloc(1337); fprintf(stderr, "Test alloc: %p.\n", p); __lsan_ignore_object(p); __lsan_ignore_object(p); free(p); __lsan_ignore_object(p); return 0; } // CHECK: Test alloc: [[ADDR:.*]]. // CHECK-NOT: SUMMARY: {{.*}} leaked golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_unaligned.cc0000664000175000017500000000134113002133725030137 0ustar mwhudsonmwhudson// Test that unaligned pointers are detected correctly. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_unaligned=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_unaligned=1" %run %t 2>&1 #include #include #include #include "../../tsan/test.h" void *arr[2]; int main() { void *p = malloc(1337); print_address("Test alloc: ", 1, p); char *char_arr = (char *)arr; memcpy(char_arr + 1, &p, sizeof(p)); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/pointer_to_self.cc0000664000175000017500000000122613002133725030512 0ustar mwhudsonmwhudson// Regression test: pointers to self should not confuse LSan into thinking the // object is indirectly leaked. Only external pointers count. // RUN: LSAN_BASE="report_objects=1:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s #include #include #include "../../tsan/test.h" int main() { void *p = malloc(1337); *reinterpret_cast(p) = p; print_address("Test alloc: ", 1, p); } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/leak_check_at_exit.cc0000664000175000017500000000153412455753041031121 0ustar mwhudsonmwhudson// Test for the leak_check_at_exit flag. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-do // RUN: LSAN_OPTIONS=$LSAN_BASE:"leak_check_at_exit=0" not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do // RUN: LSAN_OPTIONS=$LSAN_BASE:"leak_check_at_exit=0" %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont #include #include #include int main(int argc, char *argv[]) { fprintf(stderr, "Test alloc: %p.\n", malloc(1337)); if (argc > 1) __lsan_do_leak_check(); return 0; } // CHECK-do: SUMMARY: {{(Leak|Address)}}Sanitizer: // CHECK-dont-NOT: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/new_array_with_dtor_0.cc0000664000175000017500000000047012330266131031611 0ustar mwhudsonmwhudson// Regression test: // https://code.google.com/p/address-sanitizer/issues/detail?id=257 // RUN: %clangxx_lsan %s -o %t && %run %t 2>&1 | FileCheck %s #include struct T { ~T() { printf("~T\n"); } }; T *t; int main(int argc, char **argv) { t = new T[argc - 1]; printf("OK\n"); } // CHECK: OK golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/strace_test.cc0000664000175000017500000000061313000005745027634 0ustar mwhudsonmwhudson// Test that lsan reports a proper error when running under strace. // RUN: %clangxx_lsan %s -o %t // RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s #include #include static volatile void *sink; int main() { sink = malloc(42); } // CHECK: LeakSanitizer has encountered a fatal error // CHECK: HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/fork.cc0000664000175000017500000000077312330266131026267 0ustar mwhudsonmwhudson// Test that thread local data is handled correctly after forking without exec(). // RUN: %clangxx_lsan %s -o %t // RUN: %run %t 2>&1 #include #include #include #include #include __thread void *thread_local_var; int main() { int status = 0; thread_local_var = malloc(1337); pid_t pid = fork(); assert(pid >= 0); if (pid > 0) { waitpid(pid, &status, 0); assert(WIFEXITED(status)); return WEXITSTATUS(status); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/suppressions_default.cc0000664000175000017500000000127012330266131031600 0ustar mwhudsonmwhudson// RUN: LSAN_BASE="use_registers=0:use_stacks=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include #include #include "sanitizer/lsan_interface.h" extern "C" const char *__lsan_default_suppressions() { return "leak:*LSanTestLeakingFunc*"; } void LSanTestLeakingFunc() { void *p = malloc(666); fprintf(stderr, "Test alloc: %p.\n", p); } int main() { LSanTestLeakingFunc(); void *q = malloc(1337); fprintf(stderr, "Test alloc: %p.\n", q); return 0; } // CHECK: Suppressions used: // CHECK: 1 666 *LSanTestLeakingFunc* // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_stacks.cc0000664000175000017500000000135413002133725027465 0ustar mwhudsonmwhudson// Test that stack of main thread is included in the root set. // RUN: LSAN_BASE="report_objects=1:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_stacks=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_stacks=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include "../../tsan/test.h" int main() { void *stack_var = malloc(1337); print_address("Test alloc: ", 1, stack_var); // Do not return from main to prevent the pointer from going out of scope. exit(0); } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/guard-page.c0000664000175000017500000000264212757641032027206 0ustar mwhudsonmwhudson// Check that if LSan finds that SP doesn't point into thread stack (e.g. // if swapcontext is used), LSan will not hit the guard page. // RUN: %clang_lsan %s -o %t && %run %t #include #include #include #include #include #include pthread_cond_t cond = PTHREAD_COND_INITIALIZER; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int ctxfunc_started = 0; static void die(const char* msg, int err) { if (err == 0) err = errno; fprintf(stderr, "%s: %s\n", msg, strerror(err)); exit(EXIT_FAILURE); } static void ctxfunc() { pthread_mutex_lock(&mutex); ctxfunc_started = 1; // printf("ctxfunc\n"); pthread_cond_signal(&cond); pthread_mutex_unlock(&mutex); // Leave this context alive when the program exits. for (;;); } static void* thread(void* arg) { (void)arg; ucontext_t ctx; void* stack; if (getcontext(&ctx) < 0) die("getcontext", 0); stack = malloc(1 << 11); if (stack == NULL) die("malloc", 0); ctx.uc_stack.ss_sp = stack; ctx.uc_stack.ss_size = 1 << 11; makecontext(&ctx, ctxfunc, 0); setcontext(&ctx); die("setcontext", 0); return NULL; } int main() { pthread_t tid; int i; pthread_mutex_lock(&mutex); i = pthread_create(&tid, NULL, thread, NULL); if (i != 0) die("pthread_create", i); while (!ctxfunc_started) pthread_cond_wait(&cond, &mutex); pthread_mutex_unlock(&mutex); return 0; } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_tls_pthread_specific_static.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/use_tls_pthread_specific_static.c0000664000175000017500000000202413002133725033552 0ustar mwhudsonmwhudson// Test that statically allocated thread-specific storage is included in the root set. // RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=1" %run %t 2>&1 // RUN: LSAN_OPTIONS="" %run %t 2>&1 #include #include #include #include #include "../../tsan/test.h" // From glibc: this many keys are stored in the thread descriptor directly. const unsigned PTHREAD_KEY_2NDLEVEL_SIZE = 32; int main() { pthread_key_t key; int res; res = pthread_key_create(&key, NULL); assert(res == 0); assert(key < PTHREAD_KEY_2NDLEVEL_SIZE); void *p = malloc(1337); res = pthread_setspecific(key, p); assert(res == 0); print_address("Test alloc: ", 1, p); return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/recoverable_leak_check.cc0000664000175000017500000000151212516472373031755 0ustar mwhudsonmwhudson// Test for on-demand leak checking. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t foo 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 2>&1 | FileCheck %s #include #include #include #include #include void *p; int main(int argc, char *argv[]) { p = malloc(23); assert(__lsan_do_recoverable_leak_check() == 0); fprintf(stderr, "Test alloc: %p.\n", malloc(1337)); // CHECK: Test alloc: assert(__lsan_do_recoverable_leak_check() == 1); // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte // Test that we correctly reset chunk tags. p = 0; assert(__lsan_do_recoverable_leak_check() == 1); // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1360 byte _exit(0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/lsan/TestCases/register_root_region.cc0000664000175000017500000000210512364416017031556 0ustar mwhudsonmwhudson// Test for __lsan_(un)register_root_region(). // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s // RUN: LSAN_OPTIONS=$LSAN_BASE:use_root_regions=0 not %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include int main(int argc, char *argv[]) { size_t size = getpagesize() * 2; void *p = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); assert(p); // Make half of the memory inaccessible. LSan must not crash trying to read it. assert(0 == mprotect((char *)p + size / 2, size / 2, PROT_NONE)); __lsan_register_root_region(p, size); *((void **)p) = malloc(1337); fprintf(stderr, "Test alloc: %p.\n", p); if (argc > 1) __lsan_unregister_root_region(p, size); return 0; } // CHECK: Test alloc: [[ADDR:.*]]. // CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/0000775000175000017500000000000013040224617024740 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/copyconstructor.C0000664000175000017500000000315312277363063030340 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include #include // CONFIG C++ rdar://6243400,rdar://6289367 int constructors = 0; int destructors = 0; #define CONST const class TestObject { public: TestObject(CONST TestObject& inObj); TestObject(); ~TestObject(); TestObject& operator=(CONST TestObject& inObj); int version() CONST { return _version; } private: mutable int _version; }; TestObject::TestObject(CONST TestObject& inObj) { ++constructors; _version = inObj._version; //printf("%p (%d) -- TestObject(const TestObject&) called\n", this, _version); } TestObject::TestObject() { _version = ++constructors; //printf("%p (%d) -- TestObject() called\n", this, _version); } TestObject::~TestObject() { //printf("%p -- ~TestObject() called\n", this); ++destructors; } TestObject& TestObject::operator=(CONST TestObject& inObj) { //printf("%p -- operator= called\n", this); _version = inObj._version; return *this; } void testRoutine() { TestObject one; void (^b)(void) = ^{ printf("my const copy of one is %d\n", one.version()); }; } int main(int argc, char *argv[]) { testRoutine(); if (constructors == 0) { printf("No copy constructors!!!\n"); return 1; } if (constructors != destructors) { printf("%d constructors but only %d destructors\n", constructors, destructors); return 1; } printf("%s:success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/returnfunctionptr.c0000664000175000017500000000100312277363063030723 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG rdar://6339747 but wasn't #include int (*funcptr)(long); int (*(^b)(char))(long); int main(int argc, char *argv[]) { // implicit is fine b = ^(char x) { return funcptr; }; // explicit never parses b = ^int (*(char x))(long) { return funcptr; }; printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefaccess.c0000664000175000017500000000121212277363063027403 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // byrefaccess.m // test that byref access to locals is accurate // testObjects // // Created by Blaine Garst on 5/13/08. // // CONFIG #include void callVoidVoid(void (^closure)(void)) { closure(); } int main(int argc, char *argv[]) { __block int i = 10; callVoidVoid(^{ ++i; }); if (i != 11) { printf("*** %s didn't update i\n", argv[0]); return 1; } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/cast.c0000664000175000017500000000131312277363063026046 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * cast.c * testObjects * * Created by Blaine Garst on 2/17/09. * */ // PURPOSE should allow casting of a Block reference to an arbitrary pointer and back // CONFIG open #include int main(int argc, char *argv[]) { void (^aBlock)(void); int *ip; char *cp; double *dp; ip = (int *)aBlock; cp = (char *)aBlock; dp = (double *)aBlock; aBlock = (void (^)(void))ip; aBlock = (void (^)(void))cp; aBlock = (void (^)(void))dp; printf("%s: success", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/localisglobal.c0000664000175000017500000000177012277363063027732 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * localisglobal.c * testObjects * * Created by Blaine Garst on 9/29/08. * * works in all configurations * CONFIG rdar://6230297 */ #include void (^global)(void) = ^{ printf("hello world\n"); }; int aresame(void *first, void *second) { long *f = (long *)first; long *s = (long *)second; return *f == *s; } int main(int argc, char *argv[]) { int i = 10; void (^local)(void) = ^ { printf("hi %d\n", i); }; void (^localisglobal)(void) = ^ { printf("hi\n"); }; if (aresame(local, localisglobal)) { printf("local block could be global, but isn't\n"); return 1; } if (!aresame(global, localisglobal)) { printf("local block is not global, not stack, what is it??\n"); return 1; } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/dispatch_call_Block_with_release.c0000664000175000017500000000142312277363063033555 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include #include // CONFIG void callsomething(const char *format, int argument) { } void dispatch_call_Block_with_release2(void *block) { void (^b)(void) = (void (^)(void))block; b(); Block_release(b); } int main(int argc, char *argv[]) { void (^b1)(void) = ^{ callsomething("argc is %d\n", argc); }; void (^b2)(void) = ^{ callsomething("hellow world\n", 0); }; // global block now dispatch_call_Block_with_release2(Block_copy(b1)); dispatch_call_Block_with_release2(Block_copy(b2)); printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/varargs-bad-assign.c0000664000175000017500000000206412277363063030573 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- // HACK ALERT: gcc and g++ give different errors, referencing the line number to ensure that it checks for the right error; MUST KEEP IN SYNC WITH THE TEST // CONFIG 27: error: #import #import #import #import int main (int argc, const char * argv[]) { int (^sumn)(int n, ...); int six = 0; sumn = ^(int a, int b, int n, ...){ int result = 0; va_list numbers; int i; va_start(numbers, n); for (i = 0 ; i < n ; i++) { result += va_arg(numbers, int); } va_end(numbers); return result; }; six = sumn(3, 1, 2, 3); if ( six != 6 ) { printf("%s: Expected 6 but got %d\n", argv[0], six); exit(1); } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/modglobal.c0000664000175000017500000000054412277363063027061 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include // CONFIG int AGlobal; int main(int argc, char *argv[]) { void (^f)(void) = ^ { AGlobal++; }; printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefcopyint.c0000664000175000017500000000222612277363063027635 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * byrefcopyint.c * testObjects * * Created by Blaine Garst on 12/1/08. * */ // // byrefcopyid.m // testObjects // // Created by Blaine Garst on 5/13/08. // // Tests copying of blocks with byref ints // CONFIG rdar://6414583 -C99 #include #include #include #include typedef void (^voidVoid)(void); voidVoid dummy; void callVoidVoid(voidVoid closure) { closure(); } voidVoid testRoutine(const char *whoami) { __block int dumbo = strlen(whoami); dummy = ^{ //printf("incring dumbo from %d\n", dumbo); ++dumbo; }; voidVoid copy = Block_copy(dummy); return copy; } int main(int argc, char *argv[]) { voidVoid array[100]; for (int i = 0; i < 100; ++i) { array[i] = testRoutine(argv[0]); array[i](); } for (int i = 0; i < 100; ++i) { Block_release(array[i]); } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/copynull.c0000664000175000017500000000142412277363063026764 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * copynull.c * testObjects * * Created by Blaine Garst on 10/15/08. * */ #import #import #import // CONFIG rdar://6295848 int main(int argc, char *argv[]) { void (^block)(void) = (void (^)(void))0; void (^blockcopy)(void) = Block_copy(block); if (blockcopy != (void (^)(void))0) { printf("whoops, somehow we copied NULL!\n"); return 1; } // make sure we can also Block_release(blockcopy); // and more secretly //_Block_destroy(blockcopy); printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/recursive-block.c0000664000175000017500000000217012277363063030215 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include #include #include #include // CONFIG int cumulation = 0; int doSomething(int i) { cumulation += i; return cumulation; } void dirtyStack() { int i = random(); int j = doSomething(i); int k = doSomething(j); doSomething(i + j + k); } typedef void (^voidVoid)(void); voidVoid testFunction() { int i = random(); __block voidVoid inner = ^{ doSomething(i); }; //printf("inner, on stack, is %p\n", (void*)inner); /*__block*/ voidVoid outer = ^{ //printf("will call inner block %p\n", (void *)inner); inner(); }; //printf("outer looks like: %s\n", _Block_dump(outer)); voidVoid result = Block_copy(outer); //Block_release(inner); return result; } int main(int argc, char **argv) { voidVoid block = testFunction(); dirtyStack(); block(); Block_release(block); printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/goto.c0000664000175000017500000000114312277363063026065 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * goto.c * testObjects * * Created by Blaine Garst on 10/17/08. * */ // CONFIG rdar://6289031 #include int main(int argc, char *argv[]) { __block int val = 0; ^{ val = 1; }(); if (val == 0) { goto out_bad; // error: local byref variable val is in the scope of this goto } printf("%s: Success!\n", argv[0]); return 0; out_bad: printf("%s: val not updated!\n", argv[0]); return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/makefile0000664000175000017500000000477712277363063026471 0ustar mwhudsonmwhudson# # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. CCDIR=/usr/bin #CCDIR=/Volumes/Keep/gcc/usr/bin all: std clean: rm -fr *.dSYM *.o *-bin testfilerunner TFR = ~public/bin/testfilerunner testfilerunner: testfilerunner.h testfilerunner.m gcc -fobjc-gc-only -g -arch x86_64 -arch i386 -std=gnu99 testfilerunner.m -o testfilerunner -framework Foundation tests: grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) -- open: grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) -open -- fast: grep CONFIG *.[cmCM] | $(TFR) -fast $(CCDIR) -- std: grep CONFIG *.[cmCM] | $(TFR) -- clang: grep CONFIG *.[cmCM] | $(TFR) -clang -fast -- fastd: grep CONFIG *.[cmCM] | $(TFR) -fast -- # Hack Alert: arguably most of the following belongs in libclosure's Makefile; sticking it here until I get around to grokking what goes on in that file. sudid: @echo Enabling sudo: # Hack Alert: enable sudo first thing so we don't hang at the password prompt later @sudo echo Thanks RootsDirectory ?= /tmp/ # Note: the libsystem project (built by the libsystemroot target below) uses the ALTUSRLOCALLIBSYSTEM variable, so we use it here to maintain parity ALTUSRLOCALLIBSYSTEM ?= $(RootsDirectory)/alt-usr-local-lib-system/ altusrlocallibsystem: ditto /usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM) # FIXME: conditionalize this copy # ER: option to not require extra privileges (-nosudo or somesuch) Buildit ?= ~rc/bin/buildit -rootsDirectory $(RootsDirectory) -arch i386 -arch ppc -arch x86_64 blocksroot: sudid clean altusrlocallibsystem sudo $(Buildit) .. ditto $(RootsDirectory)/libclosure.roots/libclosure~dst/usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM) LibsystemVersion ?= 121 LibsystemPath ?= ~rc/Software/SnowLeopard/Projects/Libsystem/Libsystem-$(LibsystemVersion) LibsystemTmpPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion) libsystemroot: blocksroot ditto $(LibsystemPath) $(LibsystemTmpPath) # FIXME: conditionalize this copy sudo ALTUSRLOCALLIBSYSTEM=$(ALTUSRLOCALLIBSYSTEM) $(Buildit) $(LibsystemTmpPath) # Defaults to product of the libsystemroot target but does not automatically rebuild that, make both targets if you want a fresh root LibsystemRootPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion).roots/Libsystem-$(LibsystemVersion)~dst/usr/lib/ roottests: grep CONFIG *.[cmCM] | $(TFR) -dyld $(LibsystemRootPath) -- # FIXME: figure out if I can "call" the std target instead of duplicating it golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/fail.c0000664000175000017500000000574412277363063026043 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * fail.c * testObjects * * Created by Blaine Garst on 9/16/08. * */ #include #include #include #include #include #include bool readfile(char *buffer, const char *from) { int fd = open(from, 0); if (fd < 0) return false; int count = read(fd, buffer, 512); if (count < 0) return false; buffer[count] = 0; // zap newline return true; } // basic idea, take compiler args, run compiler, and verify that expected failure matches any existing one int main(int argc, char *argv[]) { if (argc == 1) return 0; char *copy[argc+1]; // make a copy // find and strip off -e "errorfile" char *errorfile = NULL; int counter = 0, i = 0; for (i = 1; i < argc; ++i) { // skip 0 arg which is "fail" if (!strncmp(argv[i], "-e", 2)) { errorfile = argv[++i]; } else { copy[counter++] = argv[i]; } } copy[counter] = NULL; pid_t child = fork(); char buffer[512]; if (child == 0) { // in child sprintf(buffer, "/tmp/errorfile_%d", getpid()); close(1); int fd = creat(buffer, 0777); if (fd != 1) { fprintf(stderr, "didn't open custom error file %s as 1, got %d\n", buffer, fd); exit(1); } close(2); dup(1); int result = execv(copy[0], copy); exit(10); } if (child < 0) { printf("fork failed\n"); exit(1); } int status = 0; pid_t deadchild = wait(&status); if (deadchild != child) { printf("wait got %d instead of %d\n", deadchild, child); exit(1); } if (WEXITSTATUS(status) == 0) { printf("compiler exited normally, not good under these circumstances\n"); exit(1); } //printf("exit status of child %d was %d\n", child, WEXITSTATUS(status)); sprintf(buffer, "/tmp/errorfile_%d", child); if (errorfile) { //printf("ignoring error file: %s\n", errorfile); char desired[512]; char got[512]; bool gotErrorFile = readfile(desired, errorfile); bool gotOutput = readfile(got, buffer); if (!gotErrorFile && gotOutput) { printf("didn't read errorfile %s, it should have something from\n*****\n%s\n*****\nin it.\n", errorfile, got); exit(1); } else if (gotErrorFile && gotOutput) { char *where = strstr(got, desired); if (!where) { printf("didn't find contents of %s in %s\n", errorfile, buffer); exit(1); } } else { printf("errorfile %s and output %s inconsistent\n", errorfile, buffer); exit(1); } } unlink(buffer); printf("success\n"); exit(0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/objectRRGC.c0000664000175000017500000000426112277363063027045 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * objectRRGC.c * testObjects * * Created by Blaine Garst on 10/31/08. * * Test that the runtime honors the new callouts properly for retain/release and GC * CON FIG C rdar://6175959 */ #include #include int AssignCalled = 0; int DisposeCalled = 0; // local copy instead of libSystem.B.dylib copy void _Block_object_assign(void *destAddr, const void *object, const int isWeak) { //printf("_Block_object_assign(%p, %p, %d) called\n", destAddr, object, isWeak); AssignCalled = 1; } void _Block_object_dispose(const void *object, const int isWeak) { //printf("_Block_object_dispose(%p, %d) called\n", object, isWeak); DisposeCalled = 1; } struct MyStruct { long isa; long field; }; typedef struct MyStruct *__attribute__((NSObject)) MyStruct_t; int main(int argc, char *argv[]) { // create a block struct MyStruct X; MyStruct_t xp = (MyStruct_t)&X; xp->field = 10; void (^myBlock)(void) = ^{ printf("field is %ld\n", xp->field); }; // should be a copy helper generated with a calls to above routines // Lets find out! struct Block_layout *bl = (struct Block_layout *)(void *)myBlock; if ((bl->flags & BLOCK_HAS_DESCRIPTOR) != BLOCK_HAS_DESCRIPTOR) { printf("using old runtime layout!\n"); return 1; } if ((bl->flags & BLOCK_HAS_COPY_DISPOSE) != BLOCK_HAS_COPY_DISPOSE) { printf("no copy dispose!!!!\n"); return 1; } // call helper routines directly. These will, in turn, we hope, call the stubs above long destBuffer[256]; //printf("destbuffer is at %p, block at %p\n", destBuffer, (void *)bl); //printf("dump is %s\n", _Block_dump(myBlock)); bl->descriptor->copy(destBuffer, bl); bl->descriptor->dispose(bl); if (AssignCalled == 0) { printf("did not call assign helper!\n"); return 1; } if (DisposeCalled == 0) { printf("did not call dispose helper\n"); return 1; } printf("%s: Success!\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/varargs.c0000664000175000017500000000154612277363063026571 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- // CONFIG #import #import #import #import int main (int argc, const char * argv[]) { int (^sumn)(int n, ...) = ^(int n, ...){ int result = 0; va_list numbers; int i; va_start(numbers, n); for (i = 0 ; i < n ; i++) { result += va_arg(numbers, int); } va_end(numbers); return result; }; int six = sumn(3, 1, 2, 3); if ( six != 6 ) { printf("%s: Expected 6 but got %d\n", argv[0], six); exit(1); } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefcopyinner.c0000664000175000017500000000134512277363063030157 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include #include // CONFIG rdar://6225809 // fixed in 5623 int main(int argc, char *argv[]) { __block int a = 42; int* ap = &a; // just to keep the address on the stack. void (^b)(void) = ^{ //a; // workaround, a should be implicitly imported Block_copy(^{ a = 2; }); }; Block_copy(b); if(&a == ap) { printf("**** __block heap storage should have been created at this point\n"); return 1; } printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefsanity.c0000664000175000017500000000331312277363063027455 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG #include #include #include #include int main(int argc, char *argv[]) { __block int var = 0; void (^b)(void) = ^{ var++; }; //sanity(b); b(); printf("%s: success!\n", argv[0]); return 0; } #if 1 /* replicated internal data structures: BEWARE, MAY CHANGE!!! */ enum { BLOCK_REFCOUNT_MASK = (0xffff), BLOCK_NEEDS_FREE = (1 << 24), BLOCK_HAS_COPY_DISPOSE = (1 << 25), BLOCK_NO_COPY = (1 << 26), // interim byref: no copies allowed BLOCK_IS_GC = (1 << 27), BLOCK_IS_GLOBAL = (1 << 28), }; struct byref_id { struct byref_id *forwarding; int flags;//refcount; int size; void (*byref_keep)(struct byref_id *dst, struct byref_id *src); void (*byref_destroy)(struct byref_id *); int var; }; struct Block_basic2 { void *isa; int Block_flags; // int32_t int Block_size; // XXX should be packed into Block_flags void (*Block_invoke)(void *); void (*Block_copy)(void *dst, void *src); void (*Block_dispose)(void *); struct byref_id *ref; }; void sanity(void *arg) { struct Block_basic2 *bb = (struct Block_basic2 *)arg; if ( ! (bb->Block_flags & BLOCK_HAS_COPY_DISPOSE)) { printf("missing copy/dispose helpers for byref data\n"); exit(1); } struct byref_id *ref = bb->ref; if (ref->forwarding != ref) { printf("forwarding pointer should be %p but is %p\n", ref, ref->forwarding); exit(1); } } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/small-struct.c0000664000175000017500000000210012277363063027541 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- // CONFIG #import #import #import typedef struct { int a; int b; } MiniStruct; int main (int argc, const char * argv[]) { MiniStruct inny; MiniStruct outty; MiniStruct (^copyStruct)(MiniStruct); memset(&inny, 0xA5, sizeof(inny)); memset(&outty, 0x2A, sizeof(outty)); inny.a = 12; inny.b = 42; copyStruct = ^(MiniStruct aTinyStruct){ return aTinyStruct; }; // pass-by-value intrinsically copies the argument outty = copyStruct(inny); if ( &inny == &outty ) { printf("%s: struct wasn't copied.", argv[0]); exit(1); } if ( (inny.a != outty.a) || (inny.b != outty.b) ) { printf("%s: struct contents did not match.", argv[0]); exit(1); } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/rettypepromotion.c0000664000175000017500000000153012277363063030560 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * rettypepromotion.c * testObjects * * Created by Blaine Garst on 11/3/08. * */ // CONFIG error: // C++ and C give different errors so we don't check for an exact match. // The error is that enum's are defined to be ints, always, even if defined with explicit long values #include #include enum { LESS = -1, EQUAL, GREATER }; void sortWithBlock(long (^comp)(void *arg1, void *arg2)) { } int main(int argc, char *argv[]) { sortWithBlock(^(void *arg1, void *arg2) { if (random()) return LESS; if (random()) return EQUAL; if (random()) return GREATER; }); printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/large-struct.c0000664000175000017500000000236512277363063027540 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- // CONFIG #import #import #import typedef struct { unsigned long ps[30]; int qs[30]; } BobTheStruct; int main (int argc, const char * argv[]) { BobTheStruct inny; BobTheStruct outty; BobTheStruct (^copyStruct)(BobTheStruct); int i; memset(&inny, 0xA5, sizeof(inny)); memset(&outty, 0x2A, sizeof(outty)); for(i=0; i<30; i++) { inny.ps[i] = i * i * i; inny.qs[i] = -i * i * i; } copyStruct = ^(BobTheStruct aBigStruct){ return aBigStruct; }; // pass-by-value intrinsically copies the argument outty = copyStruct(inny); if ( &inny == &outty ) { printf("%s: struct wasn't copied.", argv[0]); exit(1); } for(i=0; i<30; i++) { if ( (inny.ps[i] != outty.ps[i]) || (inny.qs[i] != outty.qs[i]) ) { printf("%s: struct contents did not match.", argv[0]); exit(1); } } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/c99.c0000664000175000017500000000062712277363063025527 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // c99.m // // CONFIG C99 rdar://problem/6399225 #import #import int main(int argc, char *argv[]) { void (^blockA)(void) = ^ { ; }; blockA(); printf("%s: success\n", argv[0]); exit(0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/testfilerunner.h0000664000175000017500000000645112277363063030202 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // testfilerunner.h // testObjects // // Created by Blaine Garst on 9/24/08. // #import /* variations: four source types: C, ObjC, C++, ObjC++, and for ObjC or ObjC++ we have RR and GC capabilities we assume C++ friendly includes for C/ObjC even if C++ isn't used four compilers: C, ObjC, C++, ObjC++ and for ObjC or ObjC++ we can compile RR, RR+GC, GC+RR, GC although to test RR+GC we need to build a shell "main" in both modes and/or run with GC disabled if possible. To maximize coverage we mark files with capabilities and then ask them to be compiled with each variation of compiler and option. If the file doesn't have the capability it politely refuses. */ enum options { Do64 = (1 << 0), DoCPP = (1 << 1), DoOBJC = (1 << 3), DoGC = (1 << 4), DoRR = (1 << 5), DoRRGC = (1 << 6), // -fobjc-gc but main w/o so it runs in RR mode DoGCRR = (1 << 7), // -fobjc-gc & run GC mode //DoDashG = (1 << 8), DoDashO = (1 << 9), DoDashOs = (1 << 10), DoDashO2 = (1 << 11), DoC99 = (1 << 12), // -std=c99 }; @class TestFileExeGenerator; // this class will actually compile and/or run a target binary // XXX we don't track which dynamic libraries requested/used nor set them up @interface TestFileExe : NSObject { NSPointerArray *compileLine; int options; bool shouldFail; TestFileExeGenerator *generator; __strong char *binaryName; __strong char *sourceName; __strong char *libraryPath; __strong char *frameworkPath; } @property int options; @property(assign) NSPointerArray *compileLine; @property(assign) TestFileExeGenerator *generator; @property bool shouldFail; @property __strong char *binaryName; @property __strong char *sourceName; @property __strong char *libraryPath; @property __strong char *frameworkPath; - (bool) compileUnlessExists:(bool)skip; - (bool) run; @property(readonly) __strong char *radar; @end // this class generates an appropriate set of configurations to compile // we don't track which gcc we use but we should XXX @interface TestFileExeGenerator : NSObject { bool hasObjC; bool hasRR; bool hasGC; bool hasCPlusPlus; bool wantsC99; bool wants64; bool wants32; bool supposedToNotCompile; bool open; // this problem is still open - e.g. unresolved __strong char *radar; // for things already known to go wrong __strong char *filename; __strong char *compilerPath; __strong char *errorString; __strong char *warningString; NSPointerArray *extraLibraries; } @property bool hasObjC, hasRR, hasGC, hasCPlusPlus, wantsC99, supposedToNotCompile, open, wants32, wants64; @property(assign) __strong char *radar; @property __strong char *filename; @property __strong char *compilerPath; @property __strong char *errorString; @property __strong char *warningString; - (TestFileExe *)lineForOptions:(int)options; // nil if no can do + (NSArray *)generatorsFromFILE:(FILE *)fd; + (NSArray *)generatorsFromPath:(NSString *)path; @end golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/constassign.c0000664000175000017500000000127012277363063027451 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // constassign.c // bocktest // // Created by Blaine Garst on 3/21/08. // // shouldn't be able to assign to a const pointer // CONFIG error: assignment of read-only #import void foo(void) { printf("I'm in foo\n"); } void bar(void) { printf("I'm in bar\n"); } int main(int argc, char *argv[]) { void (*const fptr)(void) = foo; void (^const blockA)(void) = ^ { printf("hello\n"); }; blockA = ^ { printf("world\n"); } ; fptr = bar; printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/shorthandexpression.c0000664000175000017500000000072212277363063031231 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * shorthandexpression.c * testObjects * * Created by Blaine Garst on 9/16/08. * * CONFIG error: */ void foo() { void (^b)(void) = ^(void)printf("hello world\n"); } int main(int argc, char *argv[]) { printf("%s: this shouldn't compile\n", argv[0]); return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/macro.c0000664000175000017500000000046612277363063026225 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG open rdar://6718399 #include void foo() { void (^bbb)(void) = Block_copy(^ { int j, cnt; }); } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/structmember.c0000664000175000017500000000214412277363063027633 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * structmember.c * testObjects * * Created by Blaine Garst on 9/30/08. * CONFIG */ #include #include #include // CONFIG int main(int argc, char *argv[]) { struct stuff { long int a; long int b; long int c; } localStuff = { 10, 20, 30 }; int d; void (^a)(void) = ^ { printf("d is %d", d); }; void (^b)(void) = ^ { printf("d is %d, localStuff.a is %lu", d, localStuff.a); }; unsigned nominalsize = Block_size(b) - Block_size(a); #if __cplusplus__ // need copy+dispose helper for C++ structures nominalsize += 2*sizeof(void*); #endif if ((Block_size(b) - Block_size(a)) != nominalsize) { printf("sizeof a is %ld, sizeof b is %ld, expected %d\n", Block_size(a), Block_size(b), nominalsize); printf("dump of b is %s\n", _Block_dump(b)); return 1; } printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/block-static.c0000664000175000017500000000076112277363063027501 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // testfilerunner CONFIG #include int main(int argc, char **argv) { static int numberOfSquesals = 5; ^{ numberOfSquesals = 6; }(); if (numberOfSquesals == 6) { printf("%s: success\n", argv[0]); return 0; } printf("**** did not update static local, rdar://6177162\n"); return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/sizeof.c0000664000175000017500000000077512277363063026426 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * sizeof.c * testObjects * * Created by Blaine Garst on 2/17/09. * */ #include // CONFIG error: int main(int argc, char *argv[]) { void (^aBlock)(void) = ^{ printf("hellow world\n"); }; printf("the size of a block is %ld\n", sizeof(*aBlock)); printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/flagsisa.c0000664000175000017500000000062012277363063026705 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include /* CONFIG rdar://6310599 */ int main(int argc, char *argv[]) { __block int flags; __block void *isa; ^{ flags=1; isa = (void *)isa; }; printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/blockimport.c0000664000175000017500000000212312277363063027441 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * blockimport.c * testObjects * * Created by Blaine Garst on 10/13/08. * */ // // pure C nothing more needed // CONFIG rdar://6289344 #include #include #include int main(int argc, char *argv[]) { int i = 1; int (^intblock)(void) = ^{ return i*10; }; void (^vv)(void) = ^{ if (argc > 0) { printf("intblock returns %d\n", intblock()); } }; #if 0 //printf("Block dump %s\n", _Block_dump(vv)); { struct Block_layout *layout = (struct Block_layout *)(void *)vv; printf("isa %p\n", layout->isa); printf("flags %x\n", layout->flags); printf("descriptor %p\n", layout->descriptor); printf("descriptor->size %d\n", layout->descriptor->size); } #endif void (^vvcopy)(void) = Block_copy(vv); Block_release(vvcopy); printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/nullblockisa.c0000664000175000017500000000161612277363063027604 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // nullblockisa.m // testObjects // // Created by Blaine Garst on 9/24/08. // // CONFIG rdar://6244520 #include #include #include void check(void (^b)(void)) { struct _custom { struct Block_layout layout; struct Block_byref *innerp; } *custom = (struct _custom *)(void *)(b); //printf("block is at %p, size is %lx, inner is %p\n", (void *)b, Block_size(b), innerp); if (custom->innerp->isa != (void *)NULL) { printf("not a NULL __block isa\n"); exit(1); } return; } int main(int argc, char *argv[]) { __block int i; check(^{ printf("%d\n", ++i); }); printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/orbars.c0000664000175000017500000000100512277363063026402 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * orbars.c * testObjects * * Created by Blaine Garst on 9/17/08. * * CONFIG rdar://6276695 error: before ‘|’ token */ #include int main(int argc, char *argv[]) { int i = 10; void (^b)(void) = ^(void){ | i | printf("hello world, %d\n", ++i); }; printf("%s: success :-(\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/dispatch_async.c0000664000175000017500000000251012277363063030110 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #include #include #include //#import #include // CONFIG rdar://problem/6371811 const char *whoami = "nobody"; void EnqueueStuff(dispatch_queue_t q) { __block CFIndex counter; // above call has a side effect: it works around: // __block variables not implicitly imported into intermediate scopes dispatch_async(q, ^{ counter = 0; }); dispatch_async(q, ^{ //printf("outer block.\n"); counter++; dispatch_async(q, ^{ //printf("inner block.\n"); counter--; if(counter == 0) { printf("%s: success\n", whoami); exit(0); } }); if(counter == 0) { printf("already done? inconceivable!\n"); exit(1); } }); } int main (int argc, const char * argv[]) { dispatch_queue_t q = dispatch_queue_create("queue", NULL); whoami = argv[0]; EnqueueStuff(q); dispatch_main(); printf("shouldn't get here\n"); return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/recursive-test.c0000664000175000017500000000405612277363063030107 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG open rdar://6416474 // was rdar://5847976 // was rdar://6348320 #include #include int verbose = 0; int main(int argc, char* argv[]) { if (argc > 1) verbose = 1; __block void (^recursive_local_block)(int); if (verbose) printf("recursive_local_block is a local recursive block\n"); recursive_local_block = ^(int i) { if (verbose) printf("%d\n", i); if (i > 0) { recursive_local_block(i - 1); } }; if (verbose) printf("recursive_local_block's address is %p, running it:\n", (void*)recursive_local_block); recursive_local_block(5); if (verbose) printf("Creating other_local_block: a local block that calls recursive_local_block\n"); void (^other_local_block)(int) = ^(int i) { if (verbose) printf("other_local_block running\n"); recursive_local_block(i); }; if (verbose) printf("other_local_block's address is %p, running it:\n", (void*)other_local_block); other_local_block(5); #if __APPLE_CC__ >= 5627 if (verbose) printf("Creating other_copied_block: a Block_copy of a block that will call recursive_local_block\n"); void (^other_copied_block)(int) = Block_copy(^(int i) { if (verbose) printf("other_copied_block running\n"); recursive_local_block(i); }); if (verbose) printf("other_copied_block's address is %p, running it:\n", (void*)other_copied_block); other_copied_block(5); #endif __block void (^recursive_copy_block)(int); if (verbose) printf("Creating recursive_copy_block: a Block_copy of a block that will call recursive_copy_block recursively\n"); recursive_copy_block = Block_copy(^(int i) { if (verbose) printf("%d\n", i); if (i > 0) { recursive_copy_block(i - 1); } }); if (verbose) printf("recursive_copy_block's address is %p, running it:\n", (void*)recursive_copy_block); recursive_copy_block(5); printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/nestedimport.c0000664000175000017500000000142512277363063027635 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // nestedimport.m // testObjects // // Created by Blaine Garst on 6/24/08. // // pure C nothing more needed // CONFIG #include #include int Global = 0; void callVoidVoid(void (^closure)(void)) { closure(); } int main(int argc, char *argv[]) { int i = 1; void (^vv)(void) = ^{ if (argc > 0) { callVoidVoid(^{ Global = i; }); } }; i = 2; vv(); if (Global != 1) { printf("%s: error, Global not set to captured value\n", argv[0]); exit(1); } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/hasdescriptor.c0000664000175000017500000000132412277363063027770 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG C #include #include int main(int argc, char *argv[]) { void (^inner)(void) = ^ { printf("argc was %d\n", argc); }; void (^outer)(void) = ^{ inner(); inner(); }; //printf("size of inner is %ld\n", Block_size(inner)); //printf("size of outer is %ld\n", Block_size(outer)); if (Block_size(inner) != Block_size(outer)) { printf("not the same size, using old compiler??\n"); return 1; } printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefcopycopy.c0000664000175000017500000000204612277363063030015 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG rdar://6255170 #include #include #include #include #include #include int main(int argc, char *argv[]) { __block int var = 0; int shouldbe = 0; void (^b)(void) = ^{ var++; /*printf("var is at %p with value %d\n", &var, var);*/ }; __typeof(b) _b; //printf("before copy...\n"); b(); ++shouldbe; size_t i; for (i = 0; i < 10; i++) { _b = Block_copy(b); // make a new copy each time assert(_b); ++shouldbe; _b(); // should still update the stack Block_release(_b); } //printf("after...\n"); b(); ++shouldbe; if (var != shouldbe) { printf("Hmm, var is %d but should be %d\n", var, shouldbe); return 1; } printf("%s: Success!!\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefstruct.c0000664000175000017500000000263212277363063027475 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- // CONFIG #import #import #import typedef struct { unsigned long ps[30]; int qs[30]; } BobTheStruct; int main (int argc, const char * argv[]) { __block BobTheStruct fiddly; BobTheStruct copy; void (^incrementFiddly)() = ^{ int i; for(i=0; i<30; i++) { fiddly.ps[i]++; fiddly.qs[i]++; } }; memset(&fiddly, 0xA5, sizeof(fiddly)); memset(©, 0x2A, sizeof(copy)); int i; for(i=0; i<30; i++) { fiddly.ps[i] = i * i * i; fiddly.qs[i] = -i * i * i; } copy = fiddly; incrementFiddly(); if ( © == &fiddly ) { printf("%s: struct wasn't copied.", argv[0]); exit(1); } for(i=0; i<30; i++) { //printf("[%d]: fiddly.ps: %lu, copy.ps: %lu, fiddly.qs: %d, copy.qs: %d\n", i, fiddly.ps[i], copy.ps[i], fiddly.qs[i], copy.qs[i]); if ( (fiddly.ps[i] != copy.ps[i] + 1) || (fiddly.qs[i] != copy.qs[i] + 1) ) { printf("%s: struct contents were not incremented.", argv[0]); exit(1); } } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/voidarg.c0000664000175000017500000000111312277363063026545 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * voidarg.c * testObjects * * Created by Blaine Garst on 2/17/09. * */ // PURPOSE should complain about missing 'void' but both GCC and clang are supporting K&R instead // CONFIG open error: #include int Global; void (^globalBlock)() = ^{ ++Global; }; // should be void (^gb)(void) = ... int main(int argc, char *argv[]) { printf("%s: success", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/reference.C0000664000175000017500000000316712277363063027023 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. #import #import #import // CONFIG C++ int recovered = 0; int constructors = 0; int destructors = 0; #define CONST const class TestObject { public: TestObject(CONST TestObject& inObj); TestObject(); ~TestObject(); TestObject& operator=(CONST TestObject& inObj); void test(void); int version() CONST { return _version; } private: mutable int _version; }; TestObject::TestObject(CONST TestObject& inObj) { ++constructors; _version = inObj._version; //printf("%p (%d) -- TestObject(const TestObject&) called", this, _version); } TestObject::TestObject() { _version = ++constructors; //printf("%p (%d) -- TestObject() called\n", this, _version); } TestObject::~TestObject() { //printf("%p -- ~TestObject() called\n", this); ++destructors; } #if 1 TestObject& TestObject::operator=(CONST TestObject& inObj) { //printf("%p -- operator= called", this); _version = inObj._version; return *this; } #endif void TestObject::test(void) { void (^b)(void) = ^{ recovered = _version; }; void (^b2)(void) = Block_copy(b); b2(); Block_release(b2); } void testRoutine() { TestObject one; one.test(); } int main(int argc, char *argv[]) { testRoutine(); if (recovered == 1) { printf("%s: success\n", argv[0]); exit(0); } printf("%s: *** didn't recover byref block variable\n", argv[0]); exit(1); } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/rdar6414583.c0000664000175000017500000000123712277363063026630 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG rdar://6414583 // a smaller case of byrefcopyint #include #include #include int main(int argc, char *argv[]) { __block int c = 1; //printf("&c = %p - c = %i\n", &c, c); int i; for(i =0; i < 2; i++) { dispatch_block_t block = Block_copy(^{ c = i; }); block(); // printf("%i: &c = %p - c = %i\n", i, &c, c); Block_release(block); } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/k-and-r.c0000664000175000017500000000171512277363063026353 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- // CONFIG error: incompatible block pointer types assigning #import #import int main(int argc, char *argv[]) { #ifndef __cplusplus char (^rot13)(); rot13 = ^(char c) { return (char)(((c - 'a' + 13) % 26) + 'a'); }; char n = rot13('a'); char c = rot13('p'); if ( n != 'n' || c != 'c' ) { printf("%s: rot13('a') returned %c, rot13('p') returns %c\n", argv[0], n, c); exit(1); } #else // yield characteristic error message for C++ #error incompatible block pointer types assigning #endif #ifndef __clang__ // yield characteristic error message for C++ #error incompatible block pointer types assigning #endif printf("%s: success\n", argv[0]); exit(0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/globalexpression.c0000664000175000017500000000200512277363063030473 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // testfilerunner CONFIG #import #import int global; void (^gblock)(int) = ^(int x){ global = x; }; int main(int argc, char *argv[]) { gblock(1); if (global != 1) { printf("%s: *** did not set global to 1\n", argv[0]); return 1; } void (^gblockcopy)(int) = Block_copy(gblock); if (gblockcopy != gblock) { printf("global copy %p not a no-op %p\n", (void *)gblockcopy, (void *)gblock); return 1; } Block_release(gblockcopy); gblock(3); if (global != 3) { printf("%s: *** did not set global to 3\n", argv[0]); return 1; } gblockcopy = Block_copy(gblock); gblockcopy(5); if (global != 5) { printf("%s: *** did not set global to 5\n", argv[0]); return 1; } printf("%s: Success!\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/objectassign.c0000664000175000017500000000423412277363063027574 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * objectassign.c * testObjects * * Created by Blaine Garst on 10/28/08. * * This just tests that the compiler is issuing the proper helper routines * CONFIG C rdar://6175959 */ #include #include int AssignCalled = 0; int DisposeCalled = 0; // local copy instead of libSystem.B.dylib copy void _Block_object_assign(void *destAddr, const void *object, const int isWeak) { //printf("_Block_object_assign(%p, %p, %d) called\n", destAddr, object, isWeak); AssignCalled = 1; } void _Block_object_dispose(const void *object, const int isWeak) { //printf("_Block_object_dispose(%p, %d) called\n", object, isWeak); DisposeCalled = 1; } struct MyStruct { long isa; long field; }; typedef struct MyStruct *__attribute__((NSObject)) MyStruct_t; int main(int argc, char *argv[]) { if (__APPLE_CC__ < 5627) { printf("need compiler version %d, have %d\n", 5627, __APPLE_CC__); return 0; } // create a block struct MyStruct X; MyStruct_t xp = (MyStruct_t)&X; xp->field = 10; void (^myBlock)(void) = ^{ printf("field is %ld\n", xp->field); }; // should be a copy helper generated with a calls to above routines // Lets find out! struct Block_layout *bl = (struct Block_layout *)(void *)myBlock; if ((bl->flags & BLOCK_HAS_COPY_DISPOSE) != BLOCK_HAS_COPY_DISPOSE) { printf("no copy dispose!!!!\n"); return 1; } // call helper routines directly. These will, in turn, we hope, call the stubs above long destBuffer[256]; //printf("destbuffer is at %p, block at %p\n", destBuffer, (void *)bl); //printf("dump is %s\n", _Block_dump(myBlock)); bl->descriptor->copy(destBuffer, bl); bl->descriptor->dispose(bl); if (AssignCalled == 0) { printf("did not call assign helper!\n"); return 1; } if (DisposeCalled == 0) { printf("did not call dispose helper\n"); return 1; } printf("%s: Success!\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefcopystack.c0000664000175000017500000000134012277363063030144 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // byrefcopystack.m // testObjects // // Created by Blaine Garst on 5/13/08. // #include #include // CONFIG rdar://6255170 void (^bumpi)(void); int (^geti)(void); void setClosures() { int __block i = 10; bumpi = Block_copy(^{ ++i; }); geti = Block_copy(^{ return i; }); } int main(int argc, char *argv[]) { setClosures(); bumpi(); int i = geti(); if (i != 11) { printf("*** %s didn't update i\n", argv[0]); return 1; } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/rdar6396238.c0000664000175000017500000000113112277363063026627 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG rdar://6396238 #include #include static int count = 0; void (^mkblock(void))(void) { count++; return ^{ count++; }; } int main (int argc, const char * argv[]) { mkblock()(); if (count != 2) { printf("%s: failure, 2 != %d\n", argv[0], count); exit(1); } else { printf("%s: success\n", argv[0]); exit(0); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/recursiveassign.c0000664000175000017500000000166212277363063030337 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * recursiveassign.c * testObjects * * Created by Blaine Garst on 12/3/08. * */ // CONFIG rdar://6639533 // The compiler is prefetching x->forwarding before evaluting code that recomputes forwarding and so the value goes to a place that is never seen again. #include #include #include int main(int argc, char* argv[]) { __block void (^recursive_copy_block)(int) = ^(int arg) { printf("got wrong Block\n"); exit(1); }; recursive_copy_block = Block_copy(^(int i) { if (i > 0) { recursive_copy_block(i - 1); } else { printf("done!\n"); } }); recursive_copy_block(5); printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/variadic.c0000664000175000017500000000316212277363063026702 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. /* * variadic.c * testObjects * * Created by Blaine Garst on 2/17/09. * */ // PURPOSE Test that variadic arguments compile and work for Blocks // CONFIG #include #include int main(int argc, char *argv[]) { long (^addthem)(const char *, ...) = ^long (const char *format, ...){ va_list argp; const char *p; int i; char c; double d; long result = 0; va_start(argp, format); //printf("starting...\n"); for (p = format; *p; p++) switch (*p) { case 'i': i = va_arg(argp, int); //printf("i: %d\n", i); result += i; break; case 'd': d = va_arg(argp, double); //printf("d: %g\n", d); result += (int)d; break; case 'c': c = va_arg(argp, int); //printf("c: '%c'\n", c); result += c; break; } //printf("...done\n\n"); return result; }; long testresult = addthem("ii", 10, 20); if (testresult != 30) { printf("got wrong result: %ld\n", testresult); return 1; } testresult = addthem("idc", 30, 40.0, 'a'); if (testresult != (70+'a')) { printf("got different wrong result: %ld\n", testresult); return 1; } printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/byrefcopy.c0000664000175000017500000000170012277363063027116 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // byrefcopy.m // testObjects // // Created by Blaine Garst on 5/13/08. // #include #include #include // CONFIG void callVoidVoid(void (^closure)(void)) { closure(); } int main(int argc, char *argv[]) { int __block i = 10; void (^block)(void) = ^{ ++i; }; //printf("original (old style) is %s\n", _Block_dump_old(block)); //printf("original (new style) is %s\n", _Block_dump(block)); void (^blockcopy)(void) = Block_copy(block); //printf("copy is %s\n", _Block_dump(blockcopy)); // use a copy & see that it updates i callVoidVoid(block); if (i != 11) { printf("*** %s didn't update i\n", argv[0]); return 1; } printf("%s: success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/rdar6405500.c0000664000175000017500000000140312277363063026610 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG rdar://6405500 #include #include #import #import int main (int argc, const char * argv[]) { __block void (^blockFu)(size_t t); blockFu = ^(size_t t){ if (t == 20) { printf("%s: success\n", argv[0]); exit(0); } else dispatch_async(dispatch_get_main_queue(), ^{ blockFu(20); }); }; dispatch_apply(10, dispatch_get_concurrent_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT), blockFu); dispatch_main(); printf("shouldn't get here\n"); return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/copy-block-literal-rdar6439600.c0000664000175000017500000000123112277363063032311 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG open rdar://6439600 #import #import #define NUMBER_OF_BLOCKS 100 int main (int argc, const char * argv[]) { int (^x[NUMBER_OF_BLOCKS])(); int i; for(i=0; i #include #include #include #include #include #include bool Everything = false; // do it also with 3 levels of optimization bool DoClang = false; static bool isDirectory(char *path); static bool isExecutable(char *path); static bool isYounger(char *source, char *binary); static bool readErrorFile(char *buffer, const char *from); __strong char *gcstrcpy2(__strong const char *arg, char *endp) { unsigned size = endp - arg + 1; __strong char *result = NSAllocateCollectable(size, 0); strncpy(result, arg, size); result[size-1] = 0; return result; } __strong char *gcstrcpy1(__strong char *arg) { unsigned size = strlen(arg) + 1; __strong char *result = NSAllocateCollectable(size, 0); strncpy(result, arg, size); result[size-1] = 0; return result; } @implementation TestFileExe @synthesize options, compileLine, shouldFail, binaryName, sourceName; @synthesize generator; @synthesize libraryPath, frameworkPath; - (NSString *)description { NSMutableString *result = [NSMutableString new]; if (shouldFail) [result appendString:@"fail"]; for (id x in compileLine) { [result appendString:[NSString stringWithFormat:@" %s", (char *)x]]; } return result; } - (__strong char *)radar { return generator.radar; } - (bool) compileUnlessExists:(bool)skip { if (shouldFail) { printf("don't use this to compile anymore!\n"); return false; } if (skip && isExecutable(binaryName) && !isYounger(sourceName, binaryName)) return true; int argc = [compileLine count]; char *argv[argc+1]; for (int i = 0; i < argc; ++i) argv[i] = (char *)[compileLine pointerAtIndex:i]; argv[argc] = NULL; pid_t child = fork(); if (child == 0) { execv(argv[0], argv); exit(10); // shouldn't happen } if (child < 0) { printf("fork failed\n"); return false; } int status = 0; pid_t deadchild = wait(&status); if (deadchild != child) { printf("wait got %d instead of %d\n", deadchild, child); exit(1); } if (WEXITSTATUS(status) == 0) { return true; } printf("run failed\n"); return false; } bool lookforIn(char *lookfor, const char *format, pid_t child) { char buffer[512]; char got[512]; sprintf(buffer, format, child); bool gotOutput = readErrorFile(got, buffer); if (!gotOutput) { printf("**** didn't get an output file %s to analyze!!??\n", buffer); return false; } char *where = strstr(got, lookfor); if (!where) { printf("didn't find '%s' in output file %s\n", lookfor, buffer); return false; } unlink(buffer); return true; } - (bool) compileWithExpectedFailure { if (!shouldFail) { printf("Why am I being called?\n"); return false; } int argc = [compileLine count]; char *argv[argc+1]; for (int i = 0; i < argc; ++i) argv[i] = (char *)[compileLine pointerAtIndex:i]; argv[argc] = NULL; pid_t child = fork(); char buffer[512]; if (child == 0) { // in child sprintf(buffer, "/tmp/errorfile_%d", getpid()); close(1); int fd = creat(buffer, 0777); if (fd != 1) { fprintf(stderr, "didn't open custom error file %s as 1, got %d\n", buffer, fd); exit(1); } close(2); dup(1); int result = execv(argv[0], argv); exit(10); } if (child < 0) { printf("fork failed\n"); return false; } int status = 0; pid_t deadchild = wait(&status); if (deadchild != child) { printf("wait got %d instead of %d\n", deadchild, child); exit(11); } if (WIFEXITED(status)) { if (WEXITSTATUS(status) == 0) { return false; } } else { printf("***** compiler borked/ICEd/died unexpectedly (status %x)\n", status); return false; } char *error = generator.errorString; if (!error) return true; #if 0 char got[512]; sprintf(buffer, "/tmp/errorfile_%d", child); bool gotOutput = readErrorFile(got, buffer); if (!gotOutput) { printf("**** didn't get an error file %s to analyze!!??\n", buffer); return false; } char *where = strstr(got, error); if (!where) { printf("didn't find '%s' in error file %s\n", error, buffer); return false; } unlink(buffer); #else if (!lookforIn(error, "/tmp/errorfile_%d", child)) return false; #endif return true; } - (bool) run { if (shouldFail) return true; if (sizeof(long) == 4 && options & Do64) { return true; // skip 64-bit tests } int argc = 1; char *argv[argc+1]; argv[0] = binaryName; argv[argc] = NULL; pid_t child = fork(); if (child == 0) { // set up environment char lpath[1024]; char fpath[1024]; char *myenv[3]; int counter = 0; if (libraryPath) { sprintf(lpath, "DYLD_LIBRARY_PATH=%s", libraryPath); myenv[counter++] = lpath; } if (frameworkPath) { sprintf(fpath, "DYLD_FRAMEWORK_PATH=%s", frameworkPath); myenv[counter++] = fpath; } myenv[counter] = NULL; if (generator.warningString) { // set up stdout/stderr char outfile[1024]; sprintf(outfile, "/tmp/stdout_%d", getpid()); close(2); close(1); creat(outfile, 0700); dup(1); } execve(argv[0], argv, myenv); exit(10); // shouldn't happen } if (child < 0) { printf("fork failed\n"); return false; } int status = 0; pid_t deadchild = wait(&status); if (deadchild != child) { printf("wait got %d instead of %d\n", deadchild, child); exit(1); } if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { if (generator.warningString) { if (!lookforIn(generator.warningString, "/tmp/stdout_%d", child)) return false; } return true; } printf("**** run failed for %s\n", binaryName); return false; } @end @implementation TestFileExeGenerator @synthesize filename, compilerPath, errorString; @synthesize hasObjC, hasRR, hasGC, hasCPlusPlus, wantsC99, supposedToNotCompile, open, wants32, wants64; @synthesize radar; @synthesize warningString; - (void)setFilename:(__strong char *)name { filename = gcstrcpy1(name); } - (void)setCompilerPath:(__strong char *)name { compilerPath = gcstrcpy1(name); } - (void)forMostThings:(NSMutableArray *)lines options:(int)options { TestFileExe *item = nil; item = [self lineForOptions:options]; if (item) [lines addObject:item]; item = [self lineForOptions:options|Do64]; if (item) [lines addObject:item]; item = [self lineForOptions:options|DoCPP]; if (item) [lines addObject:item]; item = [self lineForOptions:options|Do64|DoCPP]; if (item) [lines addObject:item]; } /* DoDashG = (1 << 8), DoDashO = (1 << 9), DoDashOs = (1 << 10), DoDashO2 = (1 << 11), */ - (void)forAllThings:(NSMutableArray *)lines options:(int)options { [self forMostThings:lines options:options]; if (!Everything) { return; } // now do it with three explicit optimization flags [self forMostThings:lines options:options | DoDashO]; [self forMostThings:lines options:options | DoDashOs]; [self forMostThings:lines options:options | DoDashO2]; } - (NSArray *)allLines { NSMutableArray *result = [NSMutableArray new]; TestFileExe *item = nil; int options = 0; [self forAllThings:result options:0]; [self forAllThings:result options:DoOBJC | DoRR]; [self forAllThings:result options:DoOBJC | DoGC]; [self forAllThings:result options:DoOBJC | DoGCRR]; //[self forAllThings:result options:DoOBJC | DoRRGC]; return result; } - (void)addLibrary:(const char *)dashLSomething { if (!extraLibraries) { extraLibraries = [NSPointerArray pointerArrayWithOptions: NSPointerFunctionsStrongMemory | NSPointerFunctionsCStringPersonality]; } [extraLibraries addPointer:(void *)dashLSomething]; } - (TestFileExe *)lineForOptions:(int)options { // nil if no can do if (hasObjC && !(options & DoOBJC)) return nil; if (hasCPlusPlus && !(options & DoCPP)) return nil; if (hasObjC) { if (!hasGC && (options & (DoGC|DoGCRR))) return nil; // not smart enough if (!hasRR && (options & (DoRR|DoRRGC))) return nil; } NSPointerArray *pa = [NSPointerArray pointerArrayWithOptions: NSPointerFunctionsStrongMemory | NSPointerFunctionsCStringPersonality]; // construct path char path[512]; path[0] = 0; if (!compilerPath) compilerPath = "/usr/bin"; if (compilerPath) { strcat(path, compilerPath); strcat(path, "/"); } if (options & DoCPP) { strcat(path, DoClang ? "clang++" : "g++-4.2"); } else { strcat(path, DoClang ? "clang" : "gcc-4.2"); } [pa addPointer:gcstrcpy1(path)]; if (options & DoOBJC) { if (options & DoCPP) { [pa addPointer:"-ObjC++"]; } else { [pa addPointer:"-ObjC"]; } } [pa addPointer:"-g"]; if (options & DoDashO) [pa addPointer:"-O"]; else if (options & DoDashO2) [pa addPointer:"-O2"]; else if (options & DoDashOs) [pa addPointer:"-Os"]; if (wantsC99 && (! (options & DoCPP))) { [pa addPointer:"-std=c99"]; [pa addPointer:"-fblocks"]; } [pa addPointer:"-arch"]; [pa addPointer: (options & Do64) ? "x86_64" : "i386"]; if (options & DoOBJC) { switch (options & (DoRR|DoGC|DoGCRR|DoRRGC)) { case DoRR: break; case DoGC: [pa addPointer:"-fobjc-gc-only"]; break; case DoGCRR: [pa addPointer:"-fobjc-gc"]; break; case DoRRGC: printf("DoRRGC unsupported right now\n"); [pa addPointer:"-c"]; return nil; } [pa addPointer:"-framework"]; [pa addPointer:"Foundation"]; } [pa addPointer:gcstrcpy1(filename)]; [pa addPointer:"-o"]; path[0] = 0; strcat(path, filename); strcat(path, "."); strcat(path, (options & Do64) ? "64" : "32"); if (options & DoOBJC) { switch (options & (DoRR|DoGC|DoGCRR|DoRRGC)) { case DoRR: strcat(path, "-rr"); break; case DoGC: strcat(path, "-gconly"); break; case DoGCRR: strcat(path, "-gcrr"); break; case DoRRGC: strcat(path, "-rrgc"); break; } } if (options & DoCPP) strcat(path, "++"); if (options & DoDashO) strcat(path, "-O"); else if (options & DoDashO2) strcat(path, "-O2"); else if (options & DoDashOs) strcat(path, "-Os"); if (wantsC99) strcat(path, "-C99"); strcat(path, DoClang ? "-clang" : "-gcc"); strcat(path, "-bin"); TestFileExe *result = [TestFileExe new]; result.binaryName = gcstrcpy1(path); // could snarf copy in pa [pa addPointer:result.binaryName]; for (id cString in extraLibraries) { [pa addPointer:cString]; } result.sourceName = gcstrcpy1(filename); // could snarf copy in pa result.compileLine = pa; result.options = options; result.shouldFail = supposedToNotCompile; result.generator = self; return result; } + (NSArray *)generatorsFromPath:(NSString *)path { FILE *fp = fopen([path fileSystemRepresentation], "r"); if (fp == NULL) return nil; NSArray *result = [self generatorsFromFILE:fp]; fclose(fp); return result; } #define LOOKFOR "CON" "FIG" char *__strong parseRadar(char *line) { line = strstr(line, "rdar:"); // returns beginning char *endp = line + strlen("rdar:"); while (*endp && *endp != ' ' && *endp != '\n') ++endp; return gcstrcpy2(line, endp); } - (void)parseLibraries:(const char *)line { start: line = strstr(line, "-l"); char *endp = (char *)line + 2; while (*endp && *endp != ' ' && *endp != '\n') ++endp; [self addLibrary:gcstrcpy2(line, endp)]; if (strstr(endp, "-l")) { line = endp; goto start; } } + (TestFileExeGenerator *)generatorFromLine:(char *)line filename:(char *)filename { TestFileExeGenerator *item = [TestFileExeGenerator new]; item.filename = gcstrcpy1(filename); if (strstr(line, "GC")) item.hasGC = true; if (strstr(line, "RR")) item.hasRR = true; if (strstr(line, "C++")) item.hasCPlusPlus = true; if (strstr(line, "-C99")) { item.wantsC99 = true; } if (strstr(line, "64")) item.wants64 = true; if (strstr(line, "32")) item.wants32 = true; if (strstr(line, "-l")) [item parseLibraries:line]; if (strstr(line, "open")) item.open = true; if (strstr(line, "FAIL")) item.supposedToNotCompile = true; // old // compile time error if (strstr(line, "error:")) { item.supposedToNotCompile = true; // zap newline char *error = strstr(line, "error:") + strlen("error:"); // make sure we have something before the newline char *newline = strstr(error, "\n"); if (newline && ((newline-error) > 1)) { *newline = 0; item.errorString = gcstrcpy1(strstr(line, "error:") + strlen("error: ")); } } // run time warning if (strstr(line, "runtime:")) { // zap newline char *error = strstr(line, "runtime:") + strlen("runtime:"); // make sure we have something before the newline char *newline = strstr(error, "\n"); if (newline && ((newline-error) > 1)) { *newline = 0; item.warningString = gcstrcpy1(strstr(line, "runtime:") + strlen("runtime:")); } } if (strstr(line, "rdar:")) item.radar = parseRadar(line); if (item.hasGC || item.hasRR) item.hasObjC = true; if (!item.wants32 && !item.wants64) { // give them both if they ask for neither item.wants32 = item.wants64 = true; } return item; } + (NSArray *)generatorsFromFILE:(FILE *)fp { NSMutableArray *result = [NSMutableArray new]; // pretend this is a grep LOOKFOR *.[cmCM][cmCM] input // look for // filename: ... LOOKFOR [GC] [RR] [C++] [FAIL ...] char buf[512]; while (fgets(buf, 512, fp)) { char *config = strstr(buf, LOOKFOR); if (!config) continue; char *filename = buf; char *end = strchr(buf, ':'); *end = 0; [result addObject:[self generatorFromLine:config filename:filename]]; } return result; } + (TestFileExeGenerator *)generatorFromFilename:(char *)filename { FILE *fp = fopen(filename, "r"); if (!fp) { printf("didn't open %s!!\n", filename); return nil; } char buf[512]; while (fgets(buf, 512, fp)) { char *config = strstr(buf, LOOKFOR); if (!config) continue; fclose(fp); return [self generatorFromLine:config filename:filename]; } fclose(fp); // guess from filename char *ext = strrchr(filename, '.'); if (!ext) return nil; TestFileExeGenerator *result = [TestFileExeGenerator new]; result.filename = gcstrcpy1(filename); if (!strncmp(ext, ".m", 2)) { result.hasObjC = true; result.hasRR = true; result.hasGC = true; } else if (!strcmp(ext, ".c")) { ; } else if (!strcmp(ext, ".M") || !strcmp(ext, ".mm")) { result.hasObjC = true; result.hasRR = true; result.hasGC = true; result.hasCPlusPlus = true; } else if (!strcmp(ext, ".cc") || !strcmp(ext, ".cp") || !strcmp(ext, ".cxx") || !strcmp(ext, ".cpp") || !strcmp(ext, ".CPP") || !strcmp(ext, ".c++") || !strcmp(ext, ".C")) { result.hasCPlusPlus = true; } else { printf("unknown extension, file %s ignored\n", filename); result = nil; } return result; } - (NSString *)description { return [NSString stringWithFormat:@"%s: %s%s%s%s%s%s", filename, LOOKFOR, hasGC ? " GC" : "", hasRR ? " RR" : "", hasCPlusPlus ? " C++" : "", wantsC99 ? "C99" : "", supposedToNotCompile ? " FAIL" : ""]; } @end void printDetails(NSArray *failures, const char *whatAreThey) { if ([failures count]) { NSMutableString *output = [NSMutableString new]; printf("%s:\n", whatAreThey); for (TestFileExe *line in failures) { printf("%s", line.binaryName); char *radar = line.generator.radar; if (radar) printf(" (due to %s?),", radar); printf(" recompile via:\n%s\n\n", line.description.UTF8String); } printf("\n"); } } void help(const char *whoami) { printf("Usage: %s [-fast] [-e] [-dyld librarypath] [gcc4.2dir] [-- | source1 ...]\n", whoami); printf(" -fast don't recompile if binary younger than source\n"); printf(" -open only run tests that are thought to still be unresolved\n"); printf(" -clang use the clang and clang++ compilers\n"); printf(" -e compile all variations also with -Os, -O2, -O3\n"); printf(" -dyld p override DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH to p when running tests\n"); printf(" directory containing gcc-4.2 (or clang) that you wish to use to compile the tests\n"); printf(" -- assume stdin is a grep CON" "FIG across the test sources\n"); printf(" otherwise treat each remaining argument as a single test file source\n"); printf("%s will compile and run individual test files under a variety of compilers, c, obj-c, c++, and objc++\n", whoami); printf(" .c files are compiled with all four compilers\n"); printf(" .m files are compiled with objc and objc++ compilers\n"); printf(" .C files are compiled with c++ and objc++ compilers\n"); printf(" .M files are compiled only with the objc++ compiler\n"); printf("(actually all forms of extensions recognized by the compilers are honored, .cc, .c++ etc.)\n"); printf("\nTest files should run to completion with no output and exit (return) 0 on success.\n"); printf("Further they should be able to be compiled and run with GC on or off and by the C++ compilers\n"); printf("A line containing the string CON" "FIG within the source enables restrictions to the above assumptions\n"); printf("and other options.\n"); printf("Following CON" "FIG the string\n"); printf(" C++ restricts the test to only be run by c++ and objc++ compilers\n"); printf(" GC restricts the test to only be compiled and run with GC on\n"); printf(" RR (retain/release) restricts the test to only be compiled and run with GC off\n"); printf("Additionally,\n"); printf(" -C99 restricts the C versions of the test to -fstd=c99 -fblocks\n"); printf(" -O adds the -O optimization level\n"); printf(" -O2 adds the -O2 optimization level\n"); printf(" -Os adds the -Os optimization level\n"); printf("Files that are known to exhibit unresolved problems can provide the term \"open\" and this can"); printf("in turn allow highlighting of fixes that have regressed as well as identify that fixes are now available.\n"); printf("Files that exhibit known bugs may provide\n"); printf(" rdar://whatever such that if they fail the rdar will get cited\n"); printf("Files that are expected to fail to compile should provide, as their last token sequence,\n"); printf(" error:\n"); printf(" or error: substring to match.\n"); printf("Files that are expected to produce a runtime error message should provide, as their last token sequence,\n"); printf(" warning: string to match\n"); printf("\n%s will compile and run all configurations of the test files and report a summary at the end. Good luck.\n", whoami); printf(" Blaine Garst blaine@apple.com\n"); } int main(int argc, char *argv[]) { printf("running on %s-bit architecture\n", sizeof(long) == 4 ? "32" : "64"); char *compilerDir = "/usr/bin"; NSMutableArray *generators = [NSMutableArray new]; bool doFast = false; bool doStdin = false; bool onlyOpen = false; char *libraryPath = getenv("DYLD_LIBRARY_PATH"); char *frameworkPath = getenv("DYLD_FRAMEWORK_PATH"); // process options while (argc > 1) { if (!strcmp(argv[1], "-fast")) { doFast = true; --argc; ++argv; } else if (!strcmp(argv[1], "-dyld")) { doFast = true; --argc; ++argv; frameworkPath = argv[1]; libraryPath = argv[1]; --argc; ++argv; } else if (!strcmp(argv[1], "-open")) { onlyOpen = true; --argc; ++argv; } else if (!strcmp(argv[1], "-clang")) { DoClang = true; --argc; ++argv; } else if (!strcmp(argv[1], "-e")) { Everything = true; --argc; ++argv; } else if (!strcmp(argv[1], "--")) { doStdin = true; --argc; ++argv; } else if (!strcmp(argv[1], "-")) { help(argv[0]); return 1; } else if (argc > 1 && isDirectory(argv[1])) { compilerDir = argv[1]; ++argv; --argc; } else break; } // process remaining arguments, or stdin if (argc == 1) { if (doStdin) generators = (NSMutableArray *)[TestFileExeGenerator generatorsFromFILE:stdin]; else { help(argv[0]); return 1; } } else while (argc > 1) { TestFileExeGenerator *generator = [TestFileExeGenerator generatorFromFilename:argv[1]]; if (generator) [generators addObject:generator]; ++argv; --argc; } // see if we can generate all possibilities NSMutableArray *failureToCompile = [NSMutableArray new]; NSMutableArray *failureToFailToCompile = [NSMutableArray new]; NSMutableArray *failureToRun = [NSMutableArray new]; NSMutableArray *successes = [NSMutableArray new]; for (TestFileExeGenerator *generator in generators) { //NSLog(@"got %@", generator); if (onlyOpen && !generator.open) { //printf("skipping resolved test %s\n", generator.filename); continue; // skip closed if onlyOpen } if (!onlyOpen && generator.open) { //printf("skipping open test %s\n", generator.filename); continue; // skip open if not asked for onlyOpen } generator.compilerPath = compilerDir; NSArray *tests = [generator allLines]; for (TestFileExe *line in tests) { line.frameworkPath = frameworkPath; // tell generators about it instead XXX line.libraryPath = libraryPath; // tell generators about it instead XXX if ([line shouldFail]) { if (doFast) continue; // don't recompile & don't count as success if ([line compileWithExpectedFailure]) { [successes addObject:line]; } else [failureToFailToCompile addObject:line]; } else if ([line compileUnlessExists:doFast]) { if ([line run]) { printf("%s ran successfully\n", line.binaryName); [successes addObject:line]; } else { [failureToRun addObject:line]; } } else { [failureToCompile addObject:line]; } } } printf("\n--- results ---\n\n%lu successes\n%lu unexpected compile failures\n%lu failure to fail to compile errors\n%lu run failures\n", [successes count], [failureToCompile count], [failureToFailToCompile count], [failureToRun count]); printDetails(failureToCompile, "unexpected compile failures"); printDetails(failureToFailToCompile, "should have failed to compile but didn't failures"); printDetails(failureToRun, "run failures"); if (onlyOpen && [successes count]) { NSMutableSet *radars = [NSMutableSet new]; printf("The following tests ran successfully suggesting that they are now resolved:\n"); for (TestFileExe *line in successes) { printf("%s\n", line.binaryName); if (line.radar) [radars addObject:line.generator]; } if ([radars count]) { printf("The following radars may be resolved:\n"); for (TestFileExeGenerator *line in radars) { printf("%s\n", line.radar); } } } return [failureToCompile count] + [failureToRun count]; } #include static bool isDirectory(char *path) { struct stat statb; int retval = stat(path, &statb); if (retval != 0) return false; if (statb.st_mode & S_IFDIR) return true; return false; } static bool isExecutable(char *path) { struct stat statb; int retval = stat(path, &statb); if (retval != 0) return false; if (!(statb.st_mode & S_IFREG)) return false; if (statb.st_mode & S_IXUSR) return true; return false; } static bool isYounger(char *source, char *binary) { struct stat statb; int retval = stat(binary, &statb); if (retval != 0) return true; // if doesn't exit, lie struct stat stata; retval = stat(source, &stata); if (retval != 0) return true; // we're hosed // the greater the timeval the younger it is if (stata.st_mtimespec.tv_sec > statb.st_mtimespec.tv_sec) return true; if (stata.st_mtimespec.tv_nsec > statb.st_mtimespec.tv_nsec) return true; return false; } static bool readErrorFile(char *buffer, const char *from) { int fd = open(from, 0); if (fd < 0) { printf("didn't open %s, (might not have been created?)\n", buffer); return false; } int count = read(fd, buffer, 512); if (count < 1) { printf("read error on %s\n", buffer); return false; } buffer[count-1] = 0; // zap newline return true; } golang-1.8-race-detector-runtime_0.0+svn285455/test/BlocksRuntime/josh.C0000664000175000017500000000111612277363063026020 0ustar mwhudsonmwhudson// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // CONFIG C++ GC RR open rdar://6347910 struct MyStruct { int something; }; struct TestObject { void test(void){ { MyStruct first; // works } void (^b)(void) = ^{ MyStruct inner; // fails to compile! }; } }; int main(int argc, char *argv[]) { printf("%s: Success\n", argv[0]); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/0000775000175000017500000000000013040224624023113 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/memcmp_test.cc0000664000175000017500000000075312663332236025755 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: MSAN_OPTIONS=intercept_memcmp=0 %run %t #include #include int main(int argc, char **argv) { char a1[4]; char a2[4]; for (int i = 0; i < argc * 3; i++) a2[i] = a1[i] = i; int res = memcmp(a1, a2, 4); if (!res) printf("equals"); return 0; // CHECK: Uninitialized bytes in __interceptor_memcmp at offset 3 // CHECK: MemorySanitizer: use-of-uninitialized-value } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/mmap.cc0000664000175000017500000000510112757622564024374 0ustar mwhudsonmwhudson// Test that mmap (without MAP_FIXED) always returns valid application addresses. // RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -O0 -fsanitize-memory-track-origins %s -o %t && %run %t #include #include #include #include #include #include #include "test.h" bool AddrIsApp(void *p) { uintptr_t addr = (uintptr_t)p; #if defined(__FreeBSD__) && defined(__x86_64__) return addr < 0x010000000000ULL || addr >= 0x600000000000ULL; #elif defined(__x86_64__) return (addr >= 0x000000000000ULL && addr < 0x010000000000ULL) || (addr >= 0x510000000000ULL && addr < 0x600000000000ULL) || (addr >= 0x700000000000ULL && addr < 0x800000000000ULL); #elif defined(__mips64) return (addr >= 0x0000000000ULL && addr <= 0x0200000000ULL) || (addr >= 0xa200000000ULL && addr <= 0xc000000000ULL) || addr >= 0xe200000000ULL; #elif defined(__powerpc64__) return addr < 0x000100000000ULL || addr >= 0x300000000000ULL; #elif defined(__aarch64__) struct AddrMapping { uintptr_t start; uintptr_t end; } mappings[] = { {0x05000000000ULL, 0x06000000000ULL}, {0x07000000000ULL, 0x08000000000ULL}, {0x0F000000000ULL, 0x10000000000ULL}, {0x11000000000ULL, 0x12000000000ULL}, {0x20000000000ULL, 0x21000000000ULL}, {0x2A000000000ULL, 0x2B000000000ULL}, {0x2E000000000ULL, 0x2F000000000ULL}, {0x3B000000000ULL, 0x3C000000000ULL}, {0x3F000000000ULL, 0x40000000000ULL}, {0x0041000000000ULL, 0x0042000000000ULL}, {0x0050000000000ULL, 0x0051000000000ULL}, {0x0058000000000ULL, 0x0059000000000ULL}, {0x0061000000000ULL, 0x0062000000000ULL}, {0x0AAAAA0000000ULL, 0x0AAAB00000000ULL}, {0x0FFFF00000000ULL, 0x1000000000000ULL}, }; const size_t mappingsSize = sizeof (mappings) / sizeof (mappings[0]); for (int i=0; i= mappings[i].start && addr < mappings[i].end) return true; return false; #endif } int main() { // Large enough to quickly exhaust the entire address space. #if defined(__mips64) || defined(__aarch64__) const size_t kMapSize = 0x100000000ULL; #else const size_t kMapSize = 0x1000000000ULL; #endif int success_count = 0; while (true) { void *p = mmap(0, kMapSize, PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); printf("%p\n", p); if (p == MAP_FAILED) { assert(errno == ENOMEM); break; } assert(AddrIsApp(p)); success_count++; } printf("successful mappings: %d\n", success_count); assert(success_count > 5); } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/chained_origin_limits.cc0000664000175000017500000001460112755311406027756 0ustar mwhudsonmwhudson// This test program creates a very large number of unique histories. // Heap origin. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t // RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // Stack origin. // RUN: %clangxx_msan -DSTACK -fsanitize-memory-track-origins=2 -O3 %s -o %t // RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // Heap origin, with calls. // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t // RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // Stack origin, with calls. // RUN: %clangxx_msan -DSTACK -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t // RUN: MSAN_OPTIONS=origin_history_size=7 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out // RUN: MSAN_OPTIONS=origin_history_size=2 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK2 < %t.out // RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out // RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK7 < %t.out #include #include #include #include static char *buf, *cur, *end; void init() { buf = new char[1000]; #ifdef STACK char stackbuf[1000]; char *volatile p = stackbuf; memcpy(buf, p, 1000); #endif cur = buf; end = buf + 1000; } void line_flush() { char *p; for (p = cur - 1; p >= buf; --p) if (*p == '\n') break; if (p >= buf) { size_t write_sz = p - buf + 1; // write(2, buf, write_sz); memmove(buf, p + 1, end - p - 1); cur -= write_sz; } } void buffered_write(const char *p, size_t sz) { while (sz > 0) { size_t copy_sz = end - cur; if (sz < copy_sz) copy_sz = sz; memcpy(cur, p, copy_sz); cur += copy_sz; sz -= copy_sz; line_flush(); } } void fn1() { buffered_write("a\n", 2); } void fn2() { buffered_write("a\n", 2); } void fn3() { buffered_write("a\n", 2); } int main(void) { init(); for (int i = 0; i < 2000; ++i) { fn1(); fn2(); fn3(); } return buf[50]; } // CHECK7: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was stored to memory at // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was stored to memory at // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was stored to memory at // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was stored to memory at // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was stored to memory at // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was stored to memory at // CHECK7-NOT: Uninitialized value was stored to memory at // CHECK7: Uninitialized value was created // CHECK2: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK2-NOT: Uninitialized value was stored to memory at // CHECK2: Uninitialized value was stored to memory at // CHECK2-NOT: Uninitialized value was stored to memory at // CHECK2: Uninitialized value was created // CHECK-PER-STACK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-PER-STACK: Uninitialized value was stored to memory at // CHECK-PER-STACK: in fn3 // CHECK-PER-STACK: Uninitialized value was stored to memory at // CHECK-PER-STACK: in fn2 // CHECK-PER-STACK: Uninitialized value was stored to memory at // CHECK-PER-STACK: in fn1 // CHECK-PER-STACK: Uninitialized value was created // CHECK-UNLIMITED: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was stored to memory at // CHECK-UNLIMITED: Uninitialized value was created golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/keep-going.cc0000664000175000017500000000301612475135503025457 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=1 not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=halt_on_error=0 not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // Test behaviour of -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going. // -mllvm -msan-keep-going provides the default value of keep_going flag; value // of 1 can be overwritten by MSAN_OPTIONS, value of 0 can not. #include #include int main(int argc, char **argv) { char *volatile x = (char*)malloc(5 * sizeof(char)); if (x[0]) exit(0); fprintf(stderr, "Done\n"); // CHECK-NOT: Done // CHECK-KEEP-GOING: Done return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/msan_print_shadow.cc0000664000175000017500000001344612475135503027161 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NO-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ORIGINS --check-prefix=CHECK-ORIGINS-2 < %t.out #include int main(void) { char volatile x; char *p = new char[320]; p[2] = p[5] = 1; p[8] = p[9] = p[10] = p[11] = p[12] = 2; __msan_allocated_memory(p + 4*3, 4); __msan_allocated_memory(p + 4*4, 4); __msan_allocated_memory(p + 4*5, 4); __msan_allocated_memory(p + 4*6, 4); __msan_allocated_memory(p + 4*7, 4); __msan_allocated_memory(p + 4*8, 4); __msan_allocated_memory(p + 4*9, 4); __msan_allocated_memory(p + 4*10, 4); __msan_allocated_memory(p + 4*11, 4); __msan_allocated_memory(p + 4*12, 4); __msan_allocated_memory(p + 4*13, 4); __msan_allocated_memory(p + 4*14, 4); __msan_allocated_memory(p + 4*15, 4); __msan_allocated_memory(p + 4*16, 4); __msan_allocated_memory(p + 4*17, 4); __msan_allocated_memory(p + 4*18, 4); __msan_allocated_memory(p + 4*19, 4); __msan_allocated_memory(p + 4*20, 4); __msan_allocated_memory(p + 4*21, 4); __msan_allocated_memory(p + 4*22, 4); __msan_allocated_memory(p + 4*23, 4); __msan_allocated_memory(p + 4*24, 4); __msan_allocated_memory(p + 4*25, 4); __msan_allocated_memory(p + 4*26, 4); __msan_allocated_memory(p + 4*27, 4); __msan_allocated_memory(p + 4*28, 4); __msan_allocated_memory(p + 4*29, 4); __msan_allocated_memory(p + 4*30, 4); __msan_allocated_memory(p + 4*31, 4); p[19] = x; __msan_print_shadow(p+5, 297); delete[] p; return 0; } // CHECK: Shadow map of [{{.*}}), 297 bytes: // CHECK-NO-ORIGINS: 0x{{.*}}: ..00ffff 00000000 ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff // CHECK-NO-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffff.... ........ // CHECK-ORIGINS: 0x{{.*}}: ..00ffff 00000000 ffffffff ffffffff |A . B C| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |D E F G| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |H I J K| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |L M N O| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |P Q R S| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |T U V W| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |X Y Z *| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |* * * A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffffffff ffffffff |A A A A| // CHECK-ORIGINS: 0x{{.*}}: ffffffff ffffffff ffff.... ........ |A A A .| // CHECK-ORIGINS: Origin A (origin_id {{.*}}): // CHECK-ORIGINS: Uninitialized value was created by a heap allocation // CHECK-ORIGINS: #1 {{.*}} in main{{.*}}msan_print_shadow.cc:14 // CHECK-ORIGINS: Origin B (origin_id {{.*}}): // CHECK-ORIGINS: Memory was marked as uninitialized // CHECK-ORIGINS: #0 {{.*}} in __msan_allocated_memory // CHECK-ORIGINS: #1 {{.*}} in main{{.*}}msan_print_shadow.cc:18 // CHECK-ORIGINS: Origin C (origin_id {{.*}}): // CHECK-ORIGINS-2: Uninitialized value was stored to memory at // CHECK-ORIGINS-2: #0 {{.*}} in main{{.*}}msan_print_shadow.cc:48 // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' // CHECK-ORIGINS: #0 {{.*}} in main{{.*}}msan_print_shadow.cc:12 // CHECK-ORIGINS: Origin D (origin_id {{.*}}): // CHECK-ORIGINS: Memory was marked as uninitialized // CHECK-ORIGINS: #0 {{.*}} in __msan_allocated_memory // CHECK-ORIGINS: #1 {{.*}} in main{{.*}}msan_print_shadow.cc:20 // ... // CHECK-ORIGINS: Origin Z (origin_id {{.*}}): // CHECK-ORIGINS: Memory was marked as uninitialized // CHECK-ORIGINS: #0 {{.*}} in __msan_allocated_memory // CHECK-ORIGINS: #1 {{.*}} in main{{.*}}msan_print_shadow.cc:42 golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/signal_stress_test.cc0000664000175000017500000000302512633547404027354 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t // // Test that va_arg shadow from a signal handler does not leak outside. #include #include #include #include #include #include const int kSigCnt = 200; void f(bool poisoned, int n, ...) { va_list vl; va_start(vl, n); for (int i = 0; i < n; ++i) { void *p = va_arg(vl, void *); if (!poisoned) assert(__msan_test_shadow(&p, sizeof(p)) == -1); } va_end(vl); } int sigcnt; void SignalHandler(int signo) { assert(signo == SIGPROF); void *p; void **volatile q = &p; f(true, 10, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q); ++sigcnt; } int main() { signal(SIGPROF, SignalHandler); itimerval itv; itv.it_interval.tv_sec = 0; itv.it_interval.tv_usec = 100; itv.it_value.tv_sec = 0; itv.it_value.tv_usec = 100; setitimer(ITIMER_PROF, &itv, NULL); void *p; void **volatile q = &p; do { f(false, 20, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); f(true, 20, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q, *q); } while (sigcnt < kSigCnt); itv.it_interval.tv_sec = 0; itv.it_interval.tv_usec = 0; itv.it_value.tv_sec = 0; itv.it_value.tv_usec = 0; setitimer(ITIMER_PROF, &itv, NULL); signal(SIGPROF, SIG_DFL); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/pthread_getattr_np_deadlock.cc0000664000175000017500000000072212475135503031137 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && %run %t // Regression test for a deadlock in pthread_getattr_np #include #include void *ThreadFn(void *) { pthread_attr_t attr; int res = pthread_getattr_np(pthread_self(), &attr); assert(!res); return 0; } int main(void) { pthread_t t; int res = pthread_create(&t, 0, ThreadFn, 0); assert(!res); res = pthread_join(t, 0); assert(!res); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/chained_origin_with_signals.cc0000664000175000017500000000164712755311406031156 0ustar mwhudsonmwhudson// Check that stores in signal handlers are not recorded in origin history. // This is, in fact, undesired behavior caused by our chained origins // implementation being not async-signal-safe. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include #include #include #include volatile int x, y; void SignalHandler(int signo) { y = x; } int main(int argc, char *argv[]) { int volatile z; x = z; signal(SIGHUP, SignalHandler); kill(getpid(), SIGHUP); signal(SIGHUP, SIG_DFL); return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-NOT: in SignalHandler golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/chained_origin.cc0000664000175000017500000000405112755311406026373 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-STACK < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DHEAP=1 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-HEAP < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-STACK < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DHEAP=1 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-HEAP < %t.out #include volatile int x, y; __attribute__((noinline)) void fn_g(int a) { x = a; } __attribute__((noinline)) void fn_f(int a) { fn_g(a); } __attribute__((noinline)) void fn_h() { y = x; } int main(int argc, char *argv[]) { #ifdef HEAP int * volatile zz = new int; int z = *zz; #else int volatile z; #endif fn_f(z); fn_h(); return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 .* in main.*chained_origin.cc:}}[[@LINE-4]] // CHECK: Uninitialized value was stored to memory at // CHECK: {{#0 .* in fn_h.*chained_origin.cc:}}[[@LINE-19]] // CHECK: {{#1 .* in main.*chained_origin.cc:}}[[@LINE-9]] // CHECK: Uninitialized value was stored to memory at // CHECK: {{#0 .* in fn_g.*chained_origin.cc:}}[[@LINE-33]] // CHECK: {{#1 .* in fn_f.*chained_origin.cc:}}[[@LINE-29]] // CHECK: {{#2 .* in main.*chained_origin.cc:}}[[@LINE-15]] // CHECK-STACK: Uninitialized value was created by an allocation of 'z' in the stack frame of function 'main' // CHECK-STACK: {{#0 .* in main.*chained_origin.cc:}}[[@LINE-25]] // CHECK-HEAP: Uninitialized value was created by a heap allocation // CHECK-HEAP: {{#1 .* in main.*chained_origin.cc:}}[[@LINE-26]] golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/pthread_setcancelstate.cc0000664000175000017500000000075612611272775030160 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include int main(void) { int oldstate; int oldtype; int res = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate); assert(res == 0); __msan_check_mem_is_initialized(&oldstate, sizeof(oldstate)); res = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); assert(res == 0); __msan_check_mem_is_initialized(&oldtype, sizeof(oldtype)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/setlocale.cc0000664000175000017500000000034412475135503025406 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include int main(void) { char *locale = setlocale (LC_ALL, ""); assert(locale); if (locale[0]) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/no_sanitize_memory.cc0000664000175000017500000000170312475135503027345 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O1 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O2 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O0 %s -o %t -DCHECK_IN_F && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O1 %s -o %t -DCHECK_IN_F && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O2 %s -o %t -DCHECK_IN_F && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O3 %s -o %t -DCHECK_IN_F && %run %t >%t.out 2>&1 // Test that (no_sanitize_memory) functions // * don't check shadow values (-DCHECK_IN_F) // * treat all values loaded from memory as fully initialized (-UCHECK_IN_F) #include #include __attribute__((noinline)) __attribute__((no_sanitize_memory)) int f(void) { int x; int * volatile p = &x; #ifdef CHECK_IN_F if (*p) exit(0); #endif return *p; } int main(void) { if (f()) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/coverage-levels.cc0000664000175000017500000000240512755311406026515 0ustar mwhudsonmwhudson// Test various levels of coverage // // RUN: %clangxx_msan -DINIT_VAR=1 -O1 -fsanitize-coverage=func %s -o %t // RUN: mkdir -p %T/coverage-levels // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // RUN: %clangxx_msan -O1 -fsanitize-coverage=func %s -o %t // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN // RUN: %clangxx_msan -O1 -fsanitize-coverage=bb %s -o %t // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN // RUN: %clangxx_msan -O1 -fsanitize-coverage=edge %s -o %t // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN volatile int sink; int main(int argc, char **argv) { int var; #if INIT_VAR var = 0; #endif if (argc == 0) sink = 0; return *(volatile int*)&var; } // CHECK_WARN: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK_NOWARN-NOT: ERROR // CHECK1: 1 PCs written // CHECK2: 1 PCs written // CHECK3: 2 PCs written golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/insertvalue_origin.cc0000664000175000017500000000161212645214322027336 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // Test origin propagation through insertvalue IR instruction. #include #include struct mypair { int64_t x; int y; }; mypair my_make_pair(int64_t x, int y) { mypair p; p.x = x; p.y = y; return p; } int main() { int64_t * volatile p = new int64_t; mypair z = my_make_pair(*p, 0); if (z.x) printf("zzz\n"); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: {{in main .*insertvalue_origin.cc:}}[[@LINE-3]] // CHECK: Uninitialized value was created by a heap allocation // CHECK: {{in main .*insertvalue_origin.cc:}}[[@LINE-8]] delete p; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/death-callback.cc0000664000175000017500000000212412755311406026247 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -DERROR %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCB // RUN: %clangxx_msan -DERROR -DMSANCB_SET %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CB // RUN: %clangxx_msan -DERROR -DMSANCB_SET -DMSANCB_CLEAR %s -o %t && not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCB // RUN: %clangxx_msan -DMSANCB_SET %s -o %t && %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCB #include #include #include void cb(void) { fprintf(stderr, "msan-death-callback\n"); } int main(int argc, char **argv) { int *volatile p = (int *)malloc(sizeof(int)); *p = 42; free(p); #ifdef MSANCB_SET __msan_set_death_callback(cb); #endif #ifdef MSANCB_CLEAR __msan_set_death_callback(0); #endif #ifdef ERROR if (*p) exit(0); #endif // CHECK-CB: msan-death-callback // CHECK-NOCB-NOT: msan-death-callback fprintf(stderr, "done\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/mmap_below_shadow.cc0000664000175000017500000000264212576303331027123 0ustar mwhudsonmwhudson// Test mmap behavior when map address is below shadow range. // With MAP_FIXED, we return EINVAL. // Without MAP_FIXED, we ignore the address hint and map somewhere in // application range. // RUN: %clangxx_msan -O0 -DFIXED=0 %s -o %t && %run %t // RUN: %clangxx_msan -O0 -DFIXED=1 %s -o %t && %run %t // RUN: %clangxx_msan -O0 -DFIXED=0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t // RUN: %clangxx_msan -O0 -DFIXED=1 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t #include #include #include #include int main(void) { // Hint address just below shadow. #if defined(__FreeBSD__) && defined(__x86_64__) uintptr_t hint = 0x0f0000000000ULL; const uintptr_t app_start = 0x000000000000ULL; #elif defined(__x86_64__) uintptr_t hint = 0x4f0000000000ULL; const uintptr_t app_start = 0x600000000000ULL; #elif defined (__mips64) uintptr_t hint = 0x4f00000000ULL; const uintptr_t app_start = 0x6000000000ULL; #elif defined (__powerpc64__) uintptr_t hint = 0x2f0000000000ULL; const uintptr_t app_start = 0x300000000000ULL; #elif defined (__aarch64__) uintptr_t hint = 0x4f0000000ULL; const uintptr_t app_start = 0x7000000000ULL; #endif uintptr_t p = (uintptr_t)mmap( (void *)hint, 4096, PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | (FIXED ? MAP_FIXED : 0), -1, 0); if (FIXED) assert(p == (uintptr_t)-1 && errno == EINVAL); else assert(p >= app_start); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/c-strdup.c0000664000175000017500000000076712755311406025041 0ustar mwhudsonmwhudson// RUN: %clang_msan -O0 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clang_msan -O1 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clang_msan -O2 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clang_msan -O3 %s -o %t && %run %t >%t.out 2>&1 // Test that strdup in C programs is intercepted. // GLibC headers translate strdup to __strdup at -O1 and higher. #include #include int main(int argc, char **argv) { char buf[] = "abc"; char *p = strdup(buf); if (*p) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-trivial-class-members.cc0000664000175000017500000000347212572151145030611 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 #include #include #include template class Vector { public: int size; ~Vector() { printf("~V %p %lu\n", &size, sizeof(size)); assert(__msan_test_shadow(&this->size, sizeof(this->size)) == -1); } }; struct Derived { int derived_a; Vector derived_v1; Vector derived_v2; double derived_b; double derived_c; Derived() { derived_a = 5; derived_v1.size = 1; derived_v2.size = 1; derived_b = 7; derived_c = 10; } ~Derived() { printf("~D %p %p %p %lu\n", &derived_a, &derived_v1, &derived_c, sizeof(*this)); assert(__msan_test_shadow(&derived_a, sizeof(derived_a)) == -1); assert(__msan_test_shadow(&derived_v1, sizeof(derived_v1)) == -1); assert(__msan_test_shadow(&derived_v2, sizeof(derived_v2)) == -1); assert(__msan_test_shadow(&derived_b, sizeof(derived_b)) == -1); assert(__msan_test_shadow(&derived_c, sizeof(derived_c)) == -1); } }; int main() { Derived *d = new Derived(); d->~Derived(); assert(__msan_test_shadow(&d->derived_a, sizeof(d->derived_a)) != -1); assert(__msan_test_shadow(&d->derived_v1, sizeof(d->derived_v1)) != -1); assert(__msan_test_shadow(&d->derived_v2, sizeof(d->derived_v2)) != -1); assert(__msan_test_shadow(&d->derived_b, sizeof(d->derived_b)) != -1); assert(__msan_test_shadow(&d->derived_c, sizeof(d->derived_c)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/ftime.cc0000664000175000017500000000051412516373276024545 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // ftime() is deprecated on FreeBSD. // XFAIL: freebsd #include #include #include int main(void) { struct timeb tb; int res = ftime(&tb); assert(!res); assert(__msan_test_shadow(&tb, sizeof(tb)) == -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/allocator_mapping.cc0000664000175000017500000000215612754356100027127 0ustar mwhudsonmwhudson// Test that a module constructor can not map memory over the MSan heap // (without MAP_FIXED, of course). Current implementation ensures this by // mapping the heap early, in __msan_init. // // RUN: %clangxx_msan -O0 %s -o %t_1 // RUN: %clangxx_msan -O0 -DHEAP_ADDRESS=$(%run %t_1) %s -o %t_2 && %run %t_2 // // This test only makes sense for the 64-bit allocator. The 32-bit allocator // does not have a fixed mapping. Exclude platforms that use the 32-bit // allocator. // UNSUPPORTED: target-is-mips64,target-is-mips64el,aarch64 #include #include #include #include #ifdef HEAP_ADDRESS struct A { A() { void *const hint = reinterpret_cast(HEAP_ADDRESS); void *p = mmap(hint, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); // This address must be already mapped. Check that mmap() succeeds, but at a // different address. assert(p != reinterpret_cast(-1)); assert(p != hint); } } a; #endif int main() { void *p = malloc(10); printf("0x%zx\n", reinterpret_cast(p) & (~0xfff)); free(p); } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/chained_origin_memcpy.cc0000664000175000017500000000403512755311406027747 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 < %t.out #include #include int xx[10000]; int yy[10000]; volatile int idx = 30; __attribute__((noinline)) void fn_g(int a, int b) { xx[idx] = a; xx[idx + 10] = b; } __attribute__((noinline)) void fn_f(int a, int b) { fn_g(a, b); } __attribute__((noinline)) void fn_h() { memcpy(&yy, &xx, sizeof(xx)); } int main(int argc, char *argv[]) { int volatile z1; int volatile z2; fn_f(z1, z2); fn_h(); return yy[idx + OFFSET]; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 .* in main .*chained_origin_memcpy.cc:}}[[@LINE-4]] // CHECK: Uninitialized value was stored to memory at // CHECK: {{#1 .* in fn_h.*chained_origin_memcpy.cc:}}[[@LINE-15]] // CHECK: Uninitialized value was stored to memory at // CHECK: {{#0 .* in fn_g.*chained_origin_memcpy.cc:}}[[@LINE-28]] // CHECK: {{#1 .* in fn_f.*chained_origin_memcpy.cc:}}[[@LINE-24]] // CHECK-Z1: Uninitialized value was created by an allocation of 'z1' in the stack frame of function 'main' // CHECK-Z2: Uninitialized value was created by an allocation of 'z2' in the stack frame of function 'main' // CHECK: {{#0 .* in main.*chained_origin_memcpy.cc:}}[[@LINE-20]] golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/no_sanitize_memory_prop.cc0000664000175000017500000000103712475135503030405 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O1 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O2 %s -o %t && %run %t >%t.out 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t >%t.out 2>&1 // Test that (no_sanitize_memory) functions DO NOT propagate shadow. #include #include __attribute__((noinline)) __attribute__((no_sanitize_memory)) int f(int x) { return x; } int main(void) { int x; int * volatile p = &x; int y = f(*p); if (y) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-multiple-inheritance.cc0000664000175000017500000000575512576135270030541 0ustar mwhudsonmwhudson// Defines diamond multiple inheritance structure // A // / \ // B C // \ / // Derived // RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 #include #include int *temp_x; int *temp_y; int *temp_z; int *temp_w; class A { public: int x; A() { x = 5; } virtual ~A() { assert(__msan_test_shadow(&this->x, sizeof(this->x) == -1)); // Memory owned by subclasses is poisoned. assert(__msan_test_shadow(temp_y, sizeof(*temp_y)) != -1); assert(__msan_test_shadow(temp_z, sizeof(*temp_z)) != -1); assert(__msan_test_shadow(temp_w, sizeof(*temp_w)) != -1); } }; struct B : virtual public A { public: int y; B() { y = 10; } virtual ~B() { assert(__msan_test_shadow(&this->y, sizeof(this->y)) == -1); // Memory accessible via vtable still reachable. assert(__msan_test_shadow(&this->x, sizeof(this->x)) == -1); // Memory in sibling and subclass is poisoned. assert(__msan_test_shadow(temp_z, sizeof(*temp_z)) != -1); assert(__msan_test_shadow(temp_w, sizeof(*temp_w)) != -1); } }; struct C : virtual public A { public: int z; C() { z = 15; } virtual ~C() { assert(__msan_test_shadow(&this->z, sizeof(this->z)) == -1); // Memory accessible via vtable still reachable. assert(__msan_test_shadow(&this->x, sizeof(this->x)) == -1); // Sibling class is unpoisoned. assert(__msan_test_shadow(temp_y, sizeof(*temp_y)) == -1); // Memory in subclasses is poisoned. assert(__msan_test_shadow(temp_w, sizeof(*temp_w)) != -1); } }; class Derived : public B, public C { public: int w; Derived() { w = 10; } ~Derived() { assert(__msan_test_shadow(&this->x, sizeof(this->x)) == -1); // Members accessed through the vtable are still accessible. assert(__msan_test_shadow(&this->y, sizeof(this->y)) == -1); assert(__msan_test_shadow(&this->z, sizeof(this->z)) == -1); assert(__msan_test_shadow(&this->w, sizeof(this->w)) == -1); } }; int main() { Derived *d = new Derived(); // Keep track of members inherited from virtual bases, // since the virtual base table is inaccessible after destruction. temp_x = &d->x; temp_y = &d->y; temp_z = &d->z; temp_w = &d->w; // Order of destruction: Derived, C, B, A d->~Derived(); // Verify that local pointer is unpoisoned, and that the object's // members are. assert(__msan_test_shadow(&d, sizeof(d)) == -1); assert(__msan_test_shadow(temp_x, sizeof(*temp_x)) != -1); assert(__msan_test_shadow(temp_y, sizeof(*temp_y)) != -1); assert(__msan_test_shadow(temp_z, sizeof(*temp_z)) != -1); assert(__msan_test_shadow(temp_w, sizeof(*temp_w)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/ioctl_custom.cc0000664000175000017500000000211012475135503026130 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O3 -g %s -o %t && %run %t // RUN: %clangxx_msan -DPOSITIVE -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_msan -DPOSITIVE -O3 -g %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int fd = socket(AF_INET, SOCK_STREAM, 0); struct ifreq ifreqs[20]; struct ifconf ifc; ifc.ifc_ifcu.ifcu_req = ifreqs; #ifndef POSITIVE ifc.ifc_len = sizeof(ifreqs); #endif int res = ioctl(fd, SIOCGIFCONF, (void *)&ifc); // CHECK: Uninitialized bytes in ioctl{{.*}} at offset 0 inside [0x{{.*}}, 4) // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: #{{.*}} in main {{.*}}ioctl_custom.cc:[[@LINE-3]] assert(res == 0); for (int i = 0; i < ifc.ifc_len / sizeof(*ifc.ifc_ifcu.ifcu_req); ++i) printf("%d %zu %s\n", i, strlen(ifreqs[i].ifr_name), ifreqs[i].ifr_name); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/mktime.cc0000664000175000017500000000114312475135503024717 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O0 -g -DUNINIT %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include int main(void) { struct tm tm; tm.tm_year = 2014; tm.tm_mon = 3; tm.tm_mday = 28; #ifndef UNINIT tm.tm_hour = 13; #endif tm.tm_min = 4; tm.tm_sec = 42; tm.tm_isdst = -1; time_t t = mktime(&tm); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: in main{{.*}}mktime.cc:[[@LINE-2]] assert(t != -1); assert(__msan_test_shadow(&tm, sizeof(tm)) == -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/unaligned_read_origin.cc0000664000175000017500000000137412475135503027747 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out #include int main(int argc, char **argv) { int x; int *volatile p = &x; return __sanitizer_unaligned_load32(p); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*unaligned_read_origin.cc:}}[[@LINE-2]] // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' // CHECK: {{#0 0x.* in main .*unaligned_read_origin.cc:}}[[@LINE-7]] } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-multiple-inheritance-nontrivial-class-members.ccgolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-multiple-inheritance-nontrivial-class-0000664000175000017500000001256512573662056033521 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 #include #include template class Vector { public: int size; ~Vector() { assert(__msan_test_shadow(&this->size, sizeof(this->size)) == -1); } }; struct VirtualBase { public: Vector virtual_v; int virtual_a; // Pointer to subclass member int *intermediate_a_ptr; VirtualBase() { virtual_v.size = 1; virtual_a = 9; } void set_ptr(int *intermediate_a) { this->intermediate_a_ptr = intermediate_a; } virtual ~VirtualBase() { assert(__msan_test_shadow(&virtual_v, sizeof(virtual_v)) == -1); assert(__msan_test_shadow(&virtual_a, sizeof(virtual_a)) == -1); // Derived class member is poisoned assert(__msan_test_shadow(intermediate_a_ptr, sizeof(*intermediate_a_ptr)) != -1); } }; struct Intermediate : virtual public VirtualBase { public: int intermediate_a; Intermediate() { intermediate_a = 5; } virtual ~Intermediate() { assert(__msan_test_shadow(&this->intermediate_a, sizeof(this->intermediate_a)) == -1); // Members inherited from VirtualBase unpoisoned assert(__msan_test_shadow(&virtual_v, sizeof(virtual_v)) == -1); assert(__msan_test_shadow(&virtual_a, sizeof(virtual_a)) == -1); assert(__msan_test_shadow(intermediate_a_ptr, sizeof(*intermediate_a_ptr)) == -1); } }; struct Base { int base_a; Vector base_v; double base_b; // Pointers to subclass members int *derived_a_ptr; Vector *derived_v1_ptr; Vector *derived_v2_ptr; double *derived_b_ptr; double *derived_c_ptr; Base(int *derived_a, Vector *derived_v1, Vector *derived_v2, double *derived_b, double *derived_c) { base_a = 2; base_v.size = 1; base_b = 13.2324; derived_a_ptr = derived_a; derived_v1_ptr = derived_v1; derived_v2_ptr = derived_v2; derived_b_ptr = derived_b; derived_c_ptr = derived_c; } virtual ~Base() { assert(__msan_test_shadow(&base_a, sizeof(base_a)) == -1); assert(__msan_test_shadow(&base_v, sizeof(base_v)) == -1); assert(__msan_test_shadow(&base_b, sizeof(base_b)) == -1); // Derived class members are poisoned assert(__msan_test_shadow(derived_a_ptr, sizeof(*derived_a_ptr)) != -1); assert(__msan_test_shadow(derived_v1_ptr, sizeof(*derived_v1_ptr)) != -1); assert(__msan_test_shadow(derived_v2_ptr, sizeof(*derived_v2_ptr)) != -1); assert(__msan_test_shadow(derived_b_ptr, sizeof(*derived_b_ptr)) != -1); assert(__msan_test_shadow(derived_c_ptr, sizeof(*derived_c_ptr)) != -1); } }; struct Derived : public Base, public Intermediate { int derived_a; Vector derived_v1; Vector derived_v2; double derived_b; double derived_c; Derived() : Base(&derived_a, &derived_v1, &derived_v2, &derived_b, &derived_c) { derived_a = 5; derived_v1.size = 1; derived_v2.size = 1; derived_b = 7; derived_c = 10; } ~Derived() { assert(__msan_test_shadow(&derived_a, sizeof(derived_a)) == -1); assert(__msan_test_shadow(&derived_v1, sizeof(derived_v1)) == -1); assert(__msan_test_shadow(&derived_v2, sizeof(derived_v2)) == -1); assert(__msan_test_shadow(&derived_b, sizeof(derived_b)) == -1); assert(__msan_test_shadow(&derived_c, sizeof(derived_c)) == -1); } }; int main() { Derived *d = new Derived(); d->set_ptr(&d->intermediate_a); // Keep track of members of VirtualBase, since the virtual base table // is inaccessible after destruction Vector *temp_virtual_v = &d->virtual_v; int *temp_virtual_a = &d->virtual_a; int **temp_intermediate_a_ptr = &d->intermediate_a_ptr; d->~Derived(); assert(__msan_test_shadow(&d->derived_a, sizeof(d->derived_a)) != -1); assert(__msan_test_shadow(&d->derived_v1, sizeof(d->derived_v1)) != -1); assert(__msan_test_shadow(&d->derived_v2, sizeof(d->derived_v2)) != -1); assert(__msan_test_shadow(&d->derived_b, sizeof(d->derived_b)) != -1); assert(__msan_test_shadow(&d->derived_c, sizeof(d->derived_c)) != -1); // Inherited from base assert(__msan_test_shadow(&d->base_a, sizeof(d->base_a)) != -1); assert(__msan_test_shadow(&d->base_v, sizeof(d->base_v)) != -1); assert(__msan_test_shadow(&d->base_b, sizeof(d->base_b)) != -1); assert(__msan_test_shadow(&d->derived_a_ptr, sizeof(d->derived_a_ptr)) != -1); assert(__msan_test_shadow(&d->derived_v1_ptr, sizeof(d->derived_v1_ptr)) != -1); assert(__msan_test_shadow(&d->derived_v2_ptr, sizeof(d->derived_v2_ptr)) != -1); assert(__msan_test_shadow(&d->derived_b_ptr, sizeof(d->derived_b_ptr)) != -1); assert(__msan_test_shadow(&d->derived_c_ptr, sizeof(d->derived_c_ptr)) != -1); // Inherited from intermediate assert(__msan_test_shadow(temp_virtual_v, sizeof(*temp_virtual_v)) != -1); assert(__msan_test_shadow(temp_virtual_a, sizeof(*temp_virtual_a)) != -1); assert(__msan_test_shadow(temp_intermediate_a_ptr, sizeof(*temp_intermediate_a_ptr)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/scandir_null.cc0000664000175000017500000000157312475135503026115 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "scandir_test_root/"); struct dirent **d; int res = scandir(buf, &d, NULL, NULL); assert(res >= 3); assert(__msan_test_shadow(&d, sizeof(*d)) == (size_t)-1); for (int i = 0; i < res; ++i) { assert(__msan_test_shadow(&d[i], sizeof(d[i])) == (size_t)-1); assert(__msan_test_shadow(d[i], d[i]->d_reclen) == (size_t)-1); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/msan_dump_shadow.cc0000664000175000017500000000110512475135503026757 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include int main(void) { char *p = new char[16]; __msan_dump_shadow(p, 5); delete[] p; const char *q = "abc"; __msan_dump_shadow(q, 3); return 0; } // CHECK: ff ff ff ff ff // CHECK: 00 00 00 golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dlopen_executable.cc0000664000175000017500000000072512623217021027107 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include static int my_global; int main(void) { int *uninit = (int*)malloc(sizeof(int)); my_global = *uninit; void *p = dlopen(0, RTLD_NOW); assert(p && "failed to get handle to executable"); return my_global; // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 {{.*}} in main{{.*}}dlopen_executable.cc:[[@LINE-2]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-member.cc0000664000175000017500000000312212552307602025642 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan %s -fsanitize=memory -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-NO-FLAG < %t.out // RUN: %clangxx_msan -fsanitize=memory -fsanitize-memory-use-after-dtor %s -o %t && MSAN_OPTIONS=poison_in_dtor=0 %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-NO-FLAG < %t.out #include #include #include #include struct Simple { int x_; Simple() { x_ = 5; } ~Simple() { } }; int main() { unsigned long buf[1]; assert(sizeof(Simple) <= sizeof(buf)); // The placement new operator forces the object to be constructed in the // memory location &buf. Since objects made in this way must be explicitly // destroyed, there are no implicit calls inserted that would interfere with // test behavior. Simple *s = new(&buf) Simple(); s->~Simple(); if (__msan_test_shadow(s, sizeof(*s)) != -1) printf("s is poisoned\n"); else printf("s is not poisoned\n"); // CHECK: s is poisoned // CHECK-NO-FLAG: s is not poisoned return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/0000775000175000017500000000000013040224624024212 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/fopencookie.cc0000664000175000017500000000326112755311406027033 0ustar mwhudsonmwhudson// Test fopencookie interceptor. // RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t // RUN: %clangxx_msan -std=c++11 -fsanitize-memory-track-origins -O0 %s -o %t && %run %t #include #include #include #include #include #include #include constexpr uintptr_t kMagicCookie = 0x12345678; static ssize_t cookie_read(void *cookie, char *buf, size_t size) { assert((uintptr_t)cookie == kMagicCookie); memset(buf, 0, size); return 0; } static ssize_t cookie_write(void *cookie, const char *buf, size_t size) { assert((uintptr_t)cookie == kMagicCookie); __msan_check_mem_is_initialized(buf, size); return 0; } static int cookie_seek(void *cookie, off64_t *offset, int whence) { assert((uintptr_t)cookie == kMagicCookie); __msan_check_mem_is_initialized(offset, sizeof(*offset)); return 0; } static int cookie_close(void *cookie) { assert((uintptr_t)cookie == kMagicCookie); return 0; } void PoisonStack() { char a[8192]; } void TestPoisonStack() { // Verify that PoisonStack has poisoned the stack - otherwise this test is not // testing anything. char a; assert(__msan_test_shadow(&a - 1000, 1) == 0); } int main() { void *cookie = (void *)kMagicCookie; FILE *f = fopencookie(cookie, "rw", {cookie_read, cookie_write, cookie_seek, cookie_close}); PoisonStack(); TestPoisonStack(); fseek(f, 100, SEEK_SET); char buf[50]; fread(buf, 50, 1, f); fwrite(buf, 50, 1, f); fclose(f); f = fopencookie(cookie, "rw", {nullptr, nullptr, nullptr, nullptr}); fseek(f, 100, SEEK_SET); fread(buf, 50, 1, f); fwrite(buf, 50, 1, f); fclose(f); } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/sunrpc.cc0000664000175000017500000000242412755311406026044 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -g -O0 -DTYPE=int -DFN=xdr_int %s -o %t && \ // RUN: %run %t 2>&1 // RUN: %clangxx_msan -g -O0 -DTYPE=int -DFN=xdr_int -DUNINIT=1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_msan -g -O0 -DTYPE=double -DFN=xdr_double %s -o %t && \ // RUN: %run %t 2>&1 // RUN: %clangxx_msan -g -O0 -DTYPE=double -DFN=xdr_double -DUNINIT=1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_msan -g -O0 -DTYPE=u_quad_t -DFN=xdr_u_longlong_t %s -o %t && \ // RUN: %run %t 2>&1 // RUN: %clangxx_msan -g -O0 -DTYPE=u_quad_t -DFN=xdr_u_longlong_t -DUNINIT=1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s #include #include #include int main(int argc, char *argv[]) { XDR xdrs; char buf[100]; xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE); TYPE x; #ifndef UNINIT x = 42; #endif bool_t res = FN(&xdrs, &x); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: {{in main.*sunrpc.cc:}}[[@LINE-2]] assert(res == TRUE); xdr_destroy(&xdrs); xdrmem_create(&xdrs, buf, sizeof(buf), XDR_DECODE); TYPE y; res = FN(&xdrs, &y); assert(res == TRUE); assert(__msan_test_shadow(&y, sizeof(y)) == -1); xdr_destroy(&xdrs); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/tcgetattr.cc0000664000175000017500000000055312755311406026534 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p #include #include #include #include #include #include int main(int argc, char *argv[]) { int fd = getpt(); assert(fd >= 0); struct termios t; int res = tcgetattr(fd, &t); assert(!res); if (t.c_iflag == 0) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/syscalls_sigaction.cc0000664000175000017500000000252512755311406030431 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -DPRE1 -O0 %s -o %t && not %run %t 2>&1 // RUN: %clangxx_msan -DPRE2 -O0 %s -o %t && not %run %t 2>&1 // RUN: %clangxx_msan -DPRE3 -O0 %s -o %t && not %run %t 2>&1 // RUN: %clangxx_msan -O0 %s -o %t && %run %t 2>&1 #include #include #include #include #include struct my_kernel_sigaction { long handler, flags, restorer; uint64_t mask[20]; // larger than any known platform }; int main() { my_kernel_sigaction act = {}, oldact = {}; #if defined(PRE1) __msan_poison(&act.handler, sizeof(act.handler)); __sanitizer_syscall_pre_rt_sigaction(SIGUSR1, &act, &oldact, 20 * 8); #elif defined(PRE2) __msan_poison(&act.flags, sizeof(act.flags)); __sanitizer_syscall_pre_rt_sigaction(SIGUSR1, &act, &oldact, 20 * 8); #elif defined(PRE3) __msan_poison(&act.mask, 1); __sanitizer_syscall_pre_rt_sigaction(SIGUSR1, &act, &oldact, 20 * 8); #else // Uninit past the end of the mask is ignored. __msan_poison(((char *)&act.mask) + 5, 1); __sanitizer_syscall_pre_rt_sigaction(SIGUSR1, &act, &oldact, 5); memset(&act, 0, sizeof(act)); __msan_poison(&oldact, sizeof(oldact)); __sanitizer_syscall_post_rt_sigaction(0, SIGUSR1, &act, &oldact, 5); assert(__msan_test_shadow(&oldact, sizeof(oldact)) == sizeof(long)*3 + 5); #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/lit.local.cfg0000664000175000017500000000026612130776361026571 0ustar mwhudsonmwhudsondef getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) if root.host_os not in ['Linux']: config.unsupported = True golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/ioctl_sound.cc0000664000175000017500000000135212755311406027053 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O3 -g %s -o %t && %run %t #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int fd = open("/dev/snd/controlC0", O_RDONLY); if (fd < 0) { printf("Unable to open sound device."); return 0; } const unsigned sz = sizeof(snd_ctl_card_info); void *info = malloc(sz + 1); assert(__msan_test_shadow(info, sz) == 0); assert(ioctl(fd, SNDRV_CTL_IOCTL_CARD_INFO, info) >= 0); assert(__msan_test_shadow(info, sz + 1) == sz); close(fd); free(info); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/sendmsg.cc0000664000175000017500000000540612755311406026175 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -DSEND -DPOISON -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SEND // RUN: %clangxx_msan %s -DSENDTO -DPOISON -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDTO // RUN: %clangxx_msan %s -DSENDMSG -DPOISON -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -DSEND -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // RUN: %clangxx_msan %s -DSENDTO -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // RUN: %clangxx_msan %s -DSENDMSG -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // RUN: %clangxx_msan %s -DSEND -DPOISON -o %t && \ // RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // RUN: %clangxx_msan %s -DSENDTO -DPOISON -o %t && \ // RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // RUN: %clangxx_msan %s -DSENDMSG -DPOISON -o %t && \ // RUN: MSAN_OPTIONS=intercept_send=0 %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // UNSUPPORTED: android #include #include #include #include #include #include #include #include #include const int kBufSize = 10; int sockfd; int main() { int ret; char buf[kBufSize] = {0}; pthread_t client_thread; struct sockaddr_in serveraddr; sockfd = socket(AF_INET, SOCK_DGRAM, 0); memset(&serveraddr, 0, sizeof(serveraddr)); serveraddr.sin_family = AF_INET; serveraddr.sin_addr.s_addr = htonl(INADDR_ANY); serveraddr.sin_port = 0; bind(sockfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr)); socklen_t addrlen = sizeof(serveraddr); getsockname(sockfd, (struct sockaddr *)&serveraddr, &addrlen); #if defined(POISON) __msan_poison(buf + 7, 1); #endif #if defined(SENDMSG) struct iovec iov[2] = {{buf, 5}, {buf + 5, 5}}; struct msghdr msg; msg.msg_name = &serveraddr; msg.msg_namelen = addrlen; msg.msg_iov = iov; msg.msg_iovlen = 2; msg.msg_control = 0; msg.msg_controllen = 0; msg.msg_flags = 0; #endif #if defined(SEND) ret = connect(sockfd, (struct sockaddr *)&serveraddr, addrlen); assert(ret == 0); ret = send(sockfd, buf, kBufSize, 0); // SEND: Uninitialized bytes in __interceptor_send at offset 7 inside [{{.*}}, 10) assert(ret > 0); #elif defined(SENDTO) ret = sendto(sockfd, buf, kBufSize, 0, (struct sockaddr *)&serveraddr, addrlen); // SENDTO: Uninitialized bytes in __interceptor_sendto at offset 7 inside [{{.*}}, 10) assert(ret > 0); #elif defined(SENDMSG) ret = sendmsg(sockfd, &msg, 0); // SENDMSG: Uninitialized bytes in {{.*}} at offset 2 inside [{{.*}}, 5) assert(ret > 0); #endif fprintf(stderr, "== done\n"); // NEGATIVE: == done return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/xattr_test_root/0000775000175000017500000000000013040224624027456 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/xattr_test_root/a0000664000175000017500000000000012272441670027617 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/sunrpc_bytes.cc0000664000175000017500000000166712755311406027262 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -g -O0 %s -o %t && \ // RUN: %run %t 2>&1 // RUN: %clangxx_msan -g -O0 -DUNINIT=1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s #include #include #include #include int main(int argc, char *argv[]) { XDR xdrs; char buf[100]; xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE); char s[20]; #ifndef UNINIT strcpy(s, "hello"); #endif char *sp = s; unsigned sz = 6; bool_t res = xdr_bytes(&xdrs, &sp, &sz, sizeof(s)); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: {{in main.*sunrpc_bytes.cc:}}[[@LINE-2]] assert(res == TRUE); xdr_destroy(&xdrs); xdrmem_create(&xdrs, buf, sizeof(buf), XDR_DECODE); char s2[20]; char *sp2 = s2; unsigned sz2; res = xdr_bytes(&xdrs, &sp2, &sz2, sizeof(s2)); assert(res == TRUE); assert(sz == sz2); assert(strcmp(s, s2) == 0); xdr_destroy(&xdrs); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/sunrpc_string.cc0000664000175000017500000000156712755311406027441 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -g -O0 %s -o %t && \ // RUN: %run %t 2>&1 // RUN: %clangxx_msan -g -O0 -DUNINIT=1 %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s #include #include #include #include int main(int argc, char *argv[]) { XDR xdrs; char buf[100]; xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE); char s[20]; #ifndef UNINIT strcpy(s, "hello"); #endif char *sp = s; bool_t res = xdr_string(&xdrs, &sp, sizeof(s)); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: {{in main.*sunrpc_string.cc:}}[[@LINE-2]] assert(res == TRUE); xdr_destroy(&xdrs); xdrmem_create(&xdrs, buf, sizeof(buf), XDR_DECODE); char s2[20]; char *sp2 = s2; res = xdr_string(&xdrs, &sp2, sizeof(s2)); assert(res == TRUE); assert(strcmp(s, s2) == 0); xdr_destroy(&xdrs); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/syscalls.cc0000664000175000017500000001107212755311406026366 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t 2>&1 #include #include #include #include #include #include #include #include #include #include #include /* Test the presence of __sanitizer_syscall_ in the tool runtime, and general sanity of their behaviour. */ int main(int argc, char *argv[]) { char buf[1000] __attribute__((aligned(8))); const int kTen = 10; const int kFortyTwo = 42; memset(buf, 0, sizeof(buf)); __msan_unpoison(buf, sizeof(buf)); __sanitizer_syscall_pre_recvmsg(0, buf, 0); __sanitizer_syscall_pre_rt_sigpending(buf, kTen); __sanitizer_syscall_pre_getdents(0, buf, kTen); __sanitizer_syscall_pre_getdents64(0, buf, kTen); __msan_unpoison(buf, sizeof(buf)); __sanitizer_syscall_post_recvmsg(0, 0, buf, 0); __sanitizer_syscall_post_rt_sigpending(-1, buf, kTen); __sanitizer_syscall_post_getdents(0, 0, buf, kTen); __sanitizer_syscall_post_getdents64(0, 0, buf, kTen); assert(__msan_test_shadow(buf, sizeof(buf)) == -1); __msan_unpoison(buf, sizeof(buf)); __sanitizer_syscall_post_recvmsg(kTen, 0, buf, 0); // Tell the kernel that the output struct size is 10 bytes, verify that those // bytes are unpoisoned, and the next byte is not. __msan_poison(buf, kTen + 1); __sanitizer_syscall_post_rt_sigpending(0, buf, kTen); assert(__msan_test_shadow(buf, sizeof(buf)) == kTen); __msan_poison(buf, kTen + 1); __sanitizer_syscall_post_getdents(kTen, 0, buf, kTen); assert(__msan_test_shadow(buf, sizeof(buf)) == kTen); __msan_poison(buf, kTen + 1); __sanitizer_syscall_post_getdents64(kTen, 0, buf, kTen); assert(__msan_test_shadow(buf, sizeof(buf)) == kTen); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_clock_getres(0, 0, buf); assert(__msan_test_shadow(buf, sizeof(buf)) == sizeof(long) * 2); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_clock_gettime(0, 0, buf); assert(__msan_test_shadow(buf, sizeof(buf)) == sizeof(long) * 2); // Failed syscall does not write to the buffer. __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_clock_gettime(-1, 0, buf); assert(__msan_test_shadow(buf, sizeof(buf)) == 0); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_read(5, 42, buf, 10); assert(__msan_test_shadow(buf, sizeof(buf)) == 5); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_newfstatat(0, 5, "/path/to/file", buf, 0); assert(__msan_test_shadow(buf, sizeof(buf)) == sizeof(struct stat)); __msan_poison(buf, sizeof(buf)); int prio = 0; __sanitizer_syscall_post_mq_timedreceive(kFortyTwo, 5, buf, sizeof(buf), &prio, 0); assert(__msan_test_shadow(buf, sizeof(buf)) == kFortyTwo); assert(__msan_test_shadow(&prio, sizeof(prio)) == -1); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_ptrace(0, PTRACE_PEEKUSER, kFortyTwo, 0xABCD, buf); assert(__msan_test_shadow(buf, sizeof(buf)) == sizeof(void *)); __msan_poison(buf, sizeof(buf)); struct iocb iocb[3]; struct iocb *iocbp[3] = { &iocb[0], &iocb[1], &iocb[2] }; memset(iocb, 0, sizeof(iocb)); iocb[0].aio_lio_opcode = IOCB_CMD_PREAD; iocb[0].aio_buf = (__u64)buf; iocb[0].aio_nbytes = 10; iocb[1].aio_lio_opcode = IOCB_CMD_PREAD; iocb[1].aio_buf = (__u64)(&buf[20]); iocb[1].aio_nbytes = 15; struct iovec vec[2] = { {&buf[40], 3}, {&buf[50], 20} }; iocb[2].aio_lio_opcode = IOCB_CMD_PREADV; iocb[2].aio_buf = (__u64)(&vec); iocb[2].aio_nbytes = 2; __sanitizer_syscall_pre_io_submit(0, 3, &iocbp); assert(__msan_test_shadow(buf, sizeof(buf)) == 10); assert(__msan_test_shadow(buf + 20, sizeof(buf) - 20) == 15); assert(__msan_test_shadow(buf + 40, sizeof(buf) - 40) == 3); assert(__msan_test_shadow(buf + 50, sizeof(buf) - 50) == 20); __msan_poison(buf, sizeof(buf)); char *p = buf; __msan_poison(&p, sizeof(p)); __sanitizer_syscall_post_io_setup(0, 1, &p); assert(__msan_test_shadow(&p, sizeof(p)) == -1); assert(__msan_test_shadow(buf, sizeof(buf)) >= 32); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_pipe(0, (int *)buf); assert(__msan_test_shadow(buf, sizeof(buf)) == 2 * sizeof(int)); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_pipe2(0, (int *)buf, 0); assert(__msan_test_shadow(buf, sizeof(buf)) == 2 * sizeof(int)); __msan_poison(buf, sizeof(buf)); __sanitizer_syscall_post_socketpair(0, 0, 0, 0, (int *)buf); assert(__msan_test_shadow(buf, sizeof(buf)) == 2 * sizeof(int)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/mallinfo.cc0000664000175000017500000000042512755311406026332 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // REQUIRES: stable-runtime #include #include #include int main(void) { struct mallinfo mi = mallinfo(); assert(__msan_test_shadow(&mi, sizeof(mi)) == -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/cmsghdr.cc0000664000175000017500000000663112755311406026165 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONFD -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONCRED -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONLEN -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONLEVEL -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONTYPE -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONLEN2 -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONLEVEL2 -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -DPOISONTYPE2 -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=SENDMSG // RUN: %clangxx_msan %s -std=c++11 -DSENDMSG -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=NEGATIVE // UNSUPPORTED: android #include #include #include #include #include #include #include #include #include #include #include const int kBufSize = 10; int main() { int ret; char buf[kBufSize] = {0}; pthread_t client_thread; struct sockaddr_un serveraddr; int sock[2]; ret = socketpair(AF_UNIX, SOCK_STREAM, 0, sock); assert(ret == 0); int sockfd = sock[0]; struct iovec iov[] = {{buf, 10}}; struct msghdr msg = {0}; msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_flags = 0; static const int kNumFds = 3; char controlbuf[CMSG_SPACE(kNumFds * sizeof(int)) + CMSG_SPACE(sizeof(struct ucred))]; msg.msg_control = &controlbuf; msg.msg_controllen = sizeof(controlbuf); struct cmsghdr *cmsg = (struct cmsghdr *)&controlbuf; assert(cmsg); int myfds[kNumFds]; for (int &fd : myfds) fd = sockfd; #ifdef POISONFD __msan_poison(&myfds[1], sizeof(int)); #endif cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(kNumFds * sizeof(int)); memcpy(CMSG_DATA(cmsg), myfds, kNumFds * sizeof(int)); #ifdef POISONLEVEL __msan_poison(&cmsg->cmsg_level, sizeof(cmsg->cmsg_level)); #endif #ifdef POISONTYPE __msan_poison(&cmsg->cmsg_type, sizeof(cmsg->cmsg_type)); #endif #ifdef POISONLEN __msan_poison(&cmsg->cmsg_len, sizeof(cmsg->cmsg_len)); #endif cmsg = (struct cmsghdr *)(&controlbuf[CMSG_SPACE(kNumFds * sizeof(int))]); assert(cmsg); struct ucred cred = {getpid(), getuid(), getgid()}; #ifdef POISONCRED __msan_poison(&cred.uid, sizeof(cred.uid)); #endif cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); memcpy(CMSG_DATA(cmsg), &cred, sizeof(struct ucred)); #ifdef POISONLEVEL2 __msan_poison(&cmsg->cmsg_level, sizeof(cmsg->cmsg_level)); #endif #ifdef POISONTYPE2 __msan_poison(&cmsg->cmsg_type, sizeof(cmsg->cmsg_type)); #endif #ifdef POISONLEN2 __msan_poison(&cmsg->cmsg_len, sizeof(cmsg->cmsg_len)); #endif ret = sendmsg(sockfd, &msg, 0); // SENDMSG: MemorySanitizer: use-of-uninitialized-value if (ret == -1) printf("%d: %s\n", errno, strerror(errno)); assert(ret > 0); fprintf(stderr, "== done\n"); // NEGATIVE: == done return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob_test_root/0000775000175000017500000000000013040224624027237 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob_test_root/ab0000664000175000017500000000000012130776361027543 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob_test_root/ba0000664000175000017500000000000012130776361027543 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob_test_root/aa0000664000175000017500000000000012130776361027542 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/xattr.cc0000664000175000017500000001050412755311406025672 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p 2>&1 // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p 2>&1 #include #include #include #include #include #include #include #include #include // Do not depend on libattr headers. #ifndef ENOATTR #define ENOATTR ENODATA #endif extern "C" { ssize_t listxattr(const char *path, char *list, size_t size); ssize_t llistxattr(const char *path, char *list, size_t size); ssize_t flistxattr(int fd, char *list, size_t size); ssize_t getxattr(const char *path, const char *name, void *value, size_t size); ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); ssize_t fgetxattr(int fd, const char *name, void *value, size_t size); } char g_path[1024]; int g_fd; // Life before closures... ssize_t listxattr_wrapper(char *buf, size_t size) { return listxattr(g_path, buf, size); } ssize_t llistxattr_wrapper(char *buf, size_t size) { return llistxattr(g_path, buf, size); } ssize_t flistxattr_wrapper(char *buf, size_t size) { return flistxattr(g_fd, buf, size); } ssize_t getxattr_wrapper(const char *name, char *buf, size_t size) { return getxattr(g_path, name, buf, size); } ssize_t lgetxattr_wrapper(const char *name, char *buf, size_t size) { return lgetxattr(g_path, name, buf, size); } ssize_t fgetxattr_wrapper(const char *name, char *buf, size_t size) { return fgetxattr(g_fd, name, buf, size); } size_t test_list(ssize_t fun(char*, size_t), char **buf) { int buf_size = 1024; while (true) { *buf = (char *)malloc(buf_size); assert(__msan_test_shadow(*buf, buf_size) != -1); ssize_t res = fun(*buf, buf_size); if (res >= 0) { assert(__msan_test_shadow(*buf, buf_size) == res); return res; } if (errno == ENOTSUP) { printf("Extended attributes are disabled. *xattr test is a no-op.\n"); exit(0); } assert(errno == ERANGE); free(*buf); buf_size *= 2; } } // True means success. False means result inconclusive because we don't have // access to this attribute. bool test_get_single_attr(ssize_t fun(const char *, char *, size_t), const char *attr_name) { char *buf; int buf_size = 1024; while (true) { buf = (char *)malloc(buf_size); assert(__msan_test_shadow(buf, buf_size) != -1); ssize_t res = fun(attr_name, buf, buf_size); if (res >= 0) { assert(__msan_test_shadow(buf, buf_size) == res); free(buf); return true; } if (errno == ENOTSUP) { printf("Extended attributes are disabled. *xattr test is a no-op.\n"); exit(0); } if (errno == ENOATTR) return false; assert(errno == ERANGE); free(buf); buf_size *= 2; } } void test_get(ssize_t fun(const char *, char *, size_t), const char *attr_list, size_t attr_list_size) { // Try every attribute, until we see one we can access. Attribute names are // null-separated strings in attr_list. size_t attr_list_len = argz_count(attr_list, attr_list_size); size_t argv_size = (attr_list_len + 1) * sizeof(char *); char **attrs = (char **)malloc(argv_size); argz_extract(attr_list, attr_list_size, attrs); // TODO(smatveev): we need proper argz_* interceptors __msan_unpoison(attrs, argv_size); for (size_t i = 0; (i < attr_list_len) && attrs[i]; i++) { if (test_get_single_attr(fun, attrs[i])) return; } printf("*xattr test could not access any attributes.\n"); } // TODO: set some attributes before trying to retrieve them with *getxattr. // Currently the list is empty, so *getxattr is not tested. int main(int argc, char *argv[]) { assert(argc == 2); snprintf(g_path, sizeof(g_path), "%s/%s", argv[1], "xattr_test_root/a"); g_fd = open(g_path, O_RDONLY); assert(g_fd); char *attr_list; size_t attr_list_size; attr_list_size = test_list(listxattr_wrapper, &attr_list); free(attr_list); attr_list_size = test_list(llistxattr_wrapper, &attr_list); free(attr_list); attr_list_size = test_list(flistxattr_wrapper, &attr_list); test_get(getxattr_wrapper, attr_list, attr_list_size); test_get(lgetxattr_wrapper, attr_list, attr_list_size); test_get(fgetxattr_wrapper, attr_list, attr_list_size); free(attr_list); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/forkpty.cc0000664000175000017500000000121212764640456026234 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -lutil -o %t && %run %t #include #include #include #include #include int main (int argc, char** argv) { int master, slave; openpty(&master, &slave, NULL, NULL, NULL); assert(__msan_test_shadow(&master, sizeof(master)) == -1); assert(__msan_test_shadow(&slave, sizeof(slave)) == -1); char ttyname[255]; ttyname_r(master, ttyname, sizeof(ttyname)); assert(__msan_test_shadow(ttyname, strlen(ttyname) + 1) == -1); int master2; forkpty(&master2, NULL, NULL, NULL); assert(__msan_test_shadow(&master2, sizeof(master2)) == -1); } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/getresid.cc0000664000175000017500000000147412755311406026344 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p 2>&1 // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p 2>&1 #include #include #include int main(int argc, char *argv[]) { uid_t uids[6]; assert(0 == __msan_test_shadow(uids, 6 * sizeof(uid_t))); assert(0 == getresuid(&uids[0], &uids[2], &uids[4])); for (int i = 0; i < 3; i++) assert(sizeof(uid_t) == __msan_test_shadow(uids + 2 * i, 2 * sizeof(uid_t))); gid_t gids[6]; assert(0 == __msan_test_shadow(gids, 6 * sizeof(gid_t))); assert(0 == getresgid(&gids[0], &gids[2], &gids[4])); for (int i = 0; i < 3; i++) assert(sizeof(gid_t) == __msan_test_shadow(gids + 2 * i, 2 * sizeof(gid_t))); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob.cc0000664000175000017500000000140712755311406025455 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p 2>&1 | FileCheck %s // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s #include #include #include #include #include int main(int argc, char *argv[]) { assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*a"); glob_t globbuf; int res = glob(buf, 0, 0, &globbuf); printf("%d %s\n", errno, strerror(errno)); assert(res == 0); assert(globbuf.gl_pathc == 2); printf("%zu\n", strlen(globbuf.gl_pathv[0])); printf("%zu\n", strlen(globbuf.gl_pathv[1])); printf("PASS\n"); // CHECK: PASS return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/obstack.cc0000664000175000017500000000176012755311406026162 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O0 -g -DPOSITIVE %s -o %t && not %run %t |& FileCheck %s #include #include #include static void *obstack_chunk_alloc(size_t sz) { return malloc(sz); } static void obstack_chunk_free(void *p) { free(p); } int main(void) { obstack obs; obstack_init(&obs); for (size_t sz = 16; sz < 0xFFFF; sz *= 2) { void *p = obstack_alloc(&obs, sz); int data[10] = {0}; obstack_grow(&obs, &data, sizeof(data)); obstack_blank(&obs, sz); obstack_grow(&obs, &data, sizeof(data)); obstack_int_grow(&obs, 13); p = obstack_finish(&obs); #ifdef POSITIVE if (sz == 4096) { __msan_check_mem_is_initialized(p, sizeof(data)); __msan_check_mem_is_initialized(p, sizeof(data) + 1); } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 0x{{.*}} in main{{.*}}obstack.cc:[[@LINE-3]] #endif } obstack_free(&obs, 0); } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/eventfd.cc0000664000175000017500000000055312755311406026166 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t 2>&1 #include #include #include int main(int argc, char *argv[]) { int efd = eventfd(42, 0); assert(efd >= 0); eventfd_t v; int ret = eventfd_read(efd, &v); assert(ret == 0); __msan_check_mem_is_initialized(&v, sizeof(v)); assert(v == 42); } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/mincore.cc0000664000175000017500000000172012755311406026164 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t #include #include #include #include int main(void) { unsigned char vec[20]; int res; size_t PS = sysconf(_SC_PAGESIZE); void *addr = mmap(nullptr, 20 * PS, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); __msan_poison(&vec, sizeof(vec)); res = mincore(addr, 10 * PS, vec); assert(res == 0); assert(__msan_test_shadow(vec, sizeof(vec)) == 10); __msan_poison(&vec, sizeof(vec)); res = mincore(addr, 10 * PS + 42, vec); assert(res == 0); assert(__msan_test_shadow(vec, sizeof(vec)) == 11); __msan_poison(&vec, sizeof(vec)); res = mincore(addr, 10 * PS - 1, vec); assert(res == 0); assert(__msan_test_shadow(vec, sizeof(vec)) == 10); __msan_poison(&vec, sizeof(vec)); res = mincore(addr, 1, vec); assert(res == 0); assert(__msan_test_shadow(vec, sizeof(vec)) == 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/process_vm_readv.cc0000664000175000017500000000441512755311406030075 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t // RUN: %clangxx_msan -std=c++11 -O0 %s -o %t -DPOSITIVE && not %run %t |& FileCheck %s #include #include #include #include #include #include #include #include #include typedef ssize_t (*process_vm_readwritev_fn)(pid_t, const iovec *, unsigned long, const iovec *, unsigned long, unsigned long); // Exit with success, emulating the expected output. int exit_dummy() { #ifdef POSITIVE printf("process_vm_readv not found or not implemented!\n"); printf( "WARNING: MemorySanitizer: use-of-uninitialized-value (not really)\n"); return 1; #else return 0; #endif } int main(void) { // This requires glibc 2.15. process_vm_readwritev_fn libc_process_vm_readv = (process_vm_readwritev_fn)dlsym(RTLD_NEXT, "process_vm_readv"); if (!libc_process_vm_readv) return exit_dummy(); process_vm_readwritev_fn process_vm_readv = (process_vm_readwritev_fn)dlsym(RTLD_DEFAULT, "process_vm_readv"); process_vm_readwritev_fn process_vm_writev = (process_vm_readwritev_fn)dlsym(RTLD_DEFAULT, "process_vm_writev"); char a[100]; memset(a, 0xab, 100); char b[100]; iovec iov_a[] = {{(void *)a, 20}, (void *)(a + 50), 10}; iovec iov_b[] = {{(void *)(b + 10), 10}, (void *)(b + 30), 20}; __msan_poison(&b, sizeof(b)); ssize_t res = process_vm_readv(getpid(), iov_b, 2, iov_a, 2, 0); if (errno == ENOSYS) // Function not implemented return exit_dummy(); assert(res == 30); __msan_check_mem_is_initialized(b + 10, 10); __msan_check_mem_is_initialized(b + 30, 20); assert(__msan_test_shadow(b + 9, 1) == 0); assert(__msan_test_shadow(b + 20, 1) == 0); assert(__msan_test_shadow(b + 29, 1) == 0); assert(__msan_test_shadow(b + 50, 1) == 0); #ifdef POSITIVE __msan_unpoison(&b, sizeof(b)); __msan_poison(b + 32, 1); res = process_vm_writev(getpid(), iov_b, 2, iov_a, 2, 0); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value #else __msan_unpoison(&b, sizeof(b)); res = process_vm_writev(getpid(), iov_b, 2, iov_a, 2, 0); assert(res == 30); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob_altdirfunc.cc0000664000175000017500000000405012755311406027665 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p 2>&1 | FileCheck %s // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s #include #include #include #include #include #include #include #include #include #include #include static void my_gl_closedir(void *dir) { if (!dir) exit(1); closedir((DIR *)dir); } static struct dirent *my_gl_readdir(void *dir) { if (!dir) exit(1); struct dirent *d = readdir((DIR *)dir); if (d) __msan_poison(d, d->d_reclen); // hehe return d; } static void *my_gl_opendir(const char *s) { assert(__msan_test_shadow(s, strlen(s) + 1) == (size_t)-1); return opendir(s); } static int my_gl_lstat(const char *s, struct stat *st) { assert(__msan_test_shadow(s, strlen(s) + 1) == (size_t)-1); if (!st) exit(1); return lstat(s, st); } static int my_gl_stat(const char *s, struct stat *st) { assert(__msan_test_shadow(s, strlen(s) + 1) == (size_t)-1); if (!st) exit(1); return lstat(s, st); } int main(int argc, char *argv[]) { assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*a"); glob_t globbuf; globbuf.gl_closedir = my_gl_closedir; globbuf.gl_readdir = my_gl_readdir; globbuf.gl_opendir = my_gl_opendir; globbuf.gl_lstat = my_gl_lstat; globbuf.gl_stat = my_gl_stat; for (int i = 0; i < 10000; ++i) { int res = glob(buf, GLOB_ALTDIRFUNC | GLOB_MARK, 0, &globbuf); assert(res == 0); printf("%d %s\n", errno, strerror(errno)); assert(globbuf.gl_pathc == 2); printf("%zu\n", strlen(globbuf.gl_pathv[0])); printf("%zu\n", strlen(globbuf.gl_pathv[1])); __msan_poison(globbuf.gl_pathv[0], strlen(globbuf.gl_pathv[0]) + 1); __msan_poison(globbuf.gl_pathv[1], strlen(globbuf.gl_pathv[1]) + 1); globfree(&globbuf); } printf("PASS\n"); // CHECK: PASS return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Linux/glob_nomatch.cc0000664000175000017500000000076212755311406027171 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p #include #include #include #include int main(int argc, char *argv[]) { assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*c"); glob_t globbuf; int res = glob(buf, 0, 0, &globbuf); assert(res == GLOB_NOMATCH); assert(globbuf.gl_pathc == 0); if (globbuf.gl_pathv == 0) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/backtrace.cc0000664000175000017500000000077513002505216025347 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include #include #include __attribute__((noinline)) void f() { void *buf[10]; int sz = backtrace(buf, sizeof(buf) / sizeof(*buf)); assert(sz > 0); for (int i = 0; i < sz; ++i) if (!buf[i]) exit(1); char **s = backtrace_symbols(buf, sz); assert(s != 0); for (int i = 0; i < sz; ++i) printf("%d\n", (int)strlen(s[i])); } int main(void) { f(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/chained_origin_empty_stack.cc0000664000175000017500000000140512755311406030776 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: MSAN_OPTIONS=store_context_size=1 not %run %t 2>&1 | FileCheck %s // Test that stack trace for the intermediate store is not empty. // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 {{.*}} in main // CHECK: Uninitialized value was stored to memory at // CHECK: #0 {{.*}} in fn_g // CHECK-NOT: #1 // CHECK: Uninitialized value was created by an allocation of 'z' in the stack frame of function 'main' // CHECK: #0 {{.*}} in main #include volatile int x; __attribute__((noinline)) void fn_g(int a) { x = a; } __attribute__((noinline)) void fn_f(int a) { fn_g(a); } int main(int argc, char *argv[]) { int volatile z; fn_f(z); return x; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-vtable-multiple-inheritance.cc0000664000175000017500000000313412576135270032001 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -DCVPTR=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // RUN: %clangxx_msan %s -DEAVPTR=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // RUN: %clangxx_msan %s -DEDVPTR=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // Expected to quit due to invalid access when invoking // function using vtable. class A { public: int x; virtual ~A() { // Should succeed this->A_Foo(); } virtual void A_Foo() {} }; class B : public virtual A { public: int y; virtual ~B() {} virtual void A_Foo() {} }; class C : public B { public: int z; ~C() {} }; class D { public: int w; ~D() {} virtual void D_Foo() {} }; class E : public virtual A, public virtual D { public: int u; ~E() {} void A_Foo() {} }; int main() { // Simple linear inheritance C *c = new C(); c->~C(); // This fails #ifdef CVPTR c->A_Foo(); #endif // Multiple inheritance, so has multiple vtables E *e = new E(); e->~E(); // Both of these fail #ifdef EAVPTR e->A_Foo(); #endif #ifdef EDVPTR e->D_Foo(); #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/readdir64.cc0000664000175000017500000000136212475135503025220 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -O1 %s -o %t && %run %t // RUN: %clangxx_msan -O2 %s -o %t && %run %t // RUN: %clangxx_msan -O3 %s -o %t && %run %t // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t // RUN: %clangxx_msan -O1 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t // RUN: %clangxx_msan -O2 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t // RUN: %clangxx_msan -O3 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t // Test that readdir64 is intercepted as well as readdir. #include #include #include int main(void) { DIR *dir = opendir("."); struct dirent *d = readdir(dir); if (d->d_name[0]) { closedir(dir); exit(0); } closedir(dir); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/allocator_returns_null.cc0000664000175000017500000000674312755311406030237 0ustar mwhudsonmwhudson// Test the behavior of malloc/calloc/realloc when the allocation size is huge. // By default (allocator_may_return_null=0) the process should crash. // With allocator_may_return_null=1 the allocator should return 0. // // RUN: %clangxx_msan -O0 %s -o %t // RUN: not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH // RUN: MSAN_OPTIONS=allocator_may_return_null=0 not %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mCRASH // RUN: MSAN_OPTIONS=allocator_may_return_null=1 %run %t malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mNULL // RUN: MSAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cCRASH // RUN: MSAN_OPTIONS=allocator_may_return_null=1 %run %t calloc 2>&1 | FileCheck %s --check-prefix=CHECK-cNULL // RUN: MSAN_OPTIONS=allocator_may_return_null=0 not %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coCRASH // RUN: MSAN_OPTIONS=allocator_may_return_null=1 %run %t calloc-overflow 2>&1 | FileCheck %s --check-prefix=CHECK-coNULL // RUN: MSAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rCRASH // RUN: MSAN_OPTIONS=allocator_may_return_null=1 %run %t realloc 2>&1 | FileCheck %s --check-prefix=CHECK-rNULL // RUN: MSAN_OPTIONS=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrCRASH // RUN: MSAN_OPTIONS=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 | FileCheck %s --check-prefix=CHECK-mrNULL #include #include #include #include #include #include int main(int argc, char **argv) { volatile size_t size = std::numeric_limits::max() - 10000; assert(argc == 2); char *x = 0; if (!strcmp(argv[1], "malloc")) { fprintf(stderr, "malloc:\n"); x = (char*)malloc(size); } if (!strcmp(argv[1], "calloc")) { fprintf(stderr, "calloc:\n"); x = (char*)calloc(size / 4, 4); } if (!strcmp(argv[1], "calloc-overflow")) { fprintf(stderr, "calloc-overflow:\n"); volatile size_t kMaxSizeT = std::numeric_limits::max(); size_t kArraySize = 4096; volatile size_t kArraySize2 = kMaxSizeT / kArraySize + 10; x = (char*)calloc(kArraySize, kArraySize2); } if (!strcmp(argv[1], "realloc")) { fprintf(stderr, "realloc:\n"); x = (char*)realloc(0, size); } if (!strcmp(argv[1], "realloc-after-malloc")) { fprintf(stderr, "realloc-after-malloc:\n"); char *t = (char*)malloc(100); *t = 42; x = (char*)realloc(t, size); assert(*t == 42); } // The NULL pointer is printed differently on different systems, while (long)0 // is always the same. fprintf(stderr, "x: %lx\n", (long)x); return x != 0; } // CHECK-mCRASH: malloc: // CHECK-mCRASH: MemorySanitizer's allocator is terminating the process // CHECK-cCRASH: calloc: // CHECK-cCRASH: MemorySanitizer's allocator is terminating the process // CHECK-coCRASH: calloc-overflow: // CHECK-coCRASH: MemorySanitizer's allocator is terminating the process // CHECK-rCRASH: realloc: // CHECK-rCRASH: MemorySanitizer's allocator is terminating the process // CHECK-mrCRASH: realloc-after-malloc: // CHECK-mrCRASH: MemorySanitizer's allocator is terminating the process // CHECK-mNULL: malloc: // CHECK-mNULL: x: 0 // CHECK-cNULL: calloc: // CHECK-cNULL: x: 0 // CHECK-coNULL: calloc-overflow: // CHECK-coNULL: x: 0 // CHECK-rNULL: realloc: // CHECK-rNULL: x: 0 // CHECK-mrNULL: realloc-after-malloc: // CHECK-mrNULL: x: 0 golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/select_origin.cc0000664000175000017500000000132412330266131026250 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s // Test condition origin propagation through "select" IR instruction. #include #include __attribute__((noinline)) int *max_by_ptr(int *a, int *b) { return *a < *b ? b : a; } int main(void) { int x; int *volatile px = &x; int y = 43; int *p = max_by_ptr(px, &y); // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' return *p; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/origin-store-long.cc0000664000175000017500000000143512475135503027013 0ustar mwhudsonmwhudson// Check that 8-byte store updates origin for the full store range. // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out #include int main() { uint64_t *volatile p = new uint64_t; uint64_t *volatile q = new uint64_t; *p = *q; char *z = (char *)p; return z[6]; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: in main {{.*}}origin-store-long.cc:[[@LINE-2]] // CHECK: Uninitialized value was created by a heap allocation // CHECK: in main {{.*}}origin-store-long.cc:[[@LINE-8]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/test.h0000664000175000017500000000056612576303331024260 0ustar mwhudsonmwhudson#if __LP64__ # define SANITIZER_WORDSIZE 64 #else # define SANITIZER_WORDSIZE 32 #endif // This is a simplified version of GetMaxVirtualAddress function. unsigned long SystemVMA () { #if SANITIZER_WORDSIZE == 64 unsigned long vma = (unsigned long)__builtin_frame_address(0); return SANITIZER_WORDSIZE - __builtin_clzll(vma); #else return SANITIZER_WORDSIZE; #endif } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dso-origin.cc0000664000175000017500000000237512475135503025513 0ustar mwhudsonmwhudson// Build a library with origin tracking and an executable w/o origin tracking. // Test that origin tracking is enabled at runtime. // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -DBUILD_SO -fPIC -shared -o %t-so.so // RUN: %clangxx_msan -O0 %s %t-so.so -o %t && not %run %t 2>&1 | FileCheck %s #ifdef BUILD_SO #include extern "C" { void my_access(int *p) { volatile int tmp; // Force initialize-ness check. if (*p) tmp = 1; } void *my_alloc(unsigned sz) { return malloc(sz); } } // extern "C" #else // BUILD_SO #include extern "C" { void my_access(int *p); void *my_alloc(unsigned sz); } int main(int argc, char **argv) { int *x = (int *)my_alloc(sizeof(int)); my_access(x); delete x; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in my_access .*dso-origin.cc:}} // CHECK: {{#1 0x.* in main .*dso-origin.cc:}}[[@LINE-5]] // CHECK: Uninitialized value was created by a heap allocation // CHECK: {{#0 0x.* in .*malloc}} // CHECK: {{#1 0x.* in my_alloc .*dso-origin.cc:}} // CHECK: {{#2 0x.* in main .*dso-origin.cc:}}[[@LINE-10]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*dso-origin.cc:.* my_access}} return 0; } #endif // BUILD_SO golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Unit/0000775000175000017500000000000013040224624024032 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/Unit/lit.site.cfg.in0000664000175000017500000000077612704361721026673 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Load common config for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured") # Setup config name. config.name = 'MemorySanitizer-Unit' # Setup test source and exec root. For unit tests, we define # it as build directory with MSan unit tests. # FIXME: Don't use hardcoded path to MSan unit tests. config.test_exec_root = "@COMPILER_RT_BINARY_DIR@/lib/msan/tests" config.test_source_root = config.test_exec_root golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/msan_print_shadow2.cc0000664000175000017500000000401112475135503027227 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NO-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ORIGINS < %t.out #include int main(void) { char *p = new char[16]; __msan_print_shadow(p, 1); __msan_print_shadow(p+1, 1); __msan_print_shadow(p+3, 1); __msan_print_shadow(p+15, 1); __msan_print_shadow(p, 0); delete[] p; int x = 0; __msan_print_shadow(&x, 3); return 0; } // CHECK: Shadow map of [0x{{.*}}, 0x{{.*}}), 1 bytes: // CHECK-NO-ORIGINS: 0x{{.*}}: ff...... ........ ........ ........ // CHECK-ORIGINS: 0x{{.*}}: ff...... ........ ........ ........ |A . . .| // CHECK-ORIGINS: Origin A (origin_id {{.*}}): // CHECK: Shadow map of [0x{{.*}}, 0x{{.*}}), 1 bytes: // CHECK-NO-ORIGINS: 0x{{.*}}: ..ff.... ........ ........ ........ // CHECK-ORIGINS: 0x{{.*}}: ..ff.... ........ ........ ........ |A . . .| // CHECK-ORIGINS: Origin A (origin_id {{.*}}): // CHECK: Shadow map of [0x{{.*}}, 0x{{.*}}), 1 bytes: // CHECK-NO-ORIGINS: 0x{{.*}}: ......ff ........ ........ ........ // CHECK-ORIGINS: 0x{{.*}}: ......ff ........ ........ ........ |A . . .| // CHECK-ORIGINS: Origin A (origin_id {{.*}}): // CHECK: Shadow map of [0x{{.*}}, 0x{{.*}}), 1 bytes: // CHECK-NO-ORIGINS: 0x{{.*}}: ......ff ........ ........ ........ // CHECK-ORIGINS: 0x{{.*}}: ......ff ........ ........ ........ |A . . .| // CHECK-ORIGINS: Origin A (origin_id {{.*}}): // CHECK: Shadow map of [0x{{.*}}, 0x{{.*}}), 0 bytes: // CHECK: Shadow map of [0x{{.*}}, 0x{{.*}}), 3 bytes: // CHECK-NO-ORIGINS: 0x{{.*}}: 000000.. ........ ........ ........ // CHECK-ORIGINS: 0x{{.*}}: 000000.. ........ ........ ........ |. . . .| golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/textdomain.cc0000664000175000017500000000031612475135503025606 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t #include #include int main() { const char *td = textdomain("abcd"); if (td[0] == 0) { printf("Try read"); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/sigwait.cc0000664000175000017500000000107712330266131025076 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t && %run %t #include #include #include #include #include void test_sigwait() { sigset_t s; sigemptyset(&s); sigaddset(&s, SIGUSR1); sigprocmask(SIG_BLOCK, &s, 0); if (pid_t pid = fork()) { kill(pid, SIGUSR1); _exit(0); } else { int sig; int res = sigwait(&s, &sig); assert(!res); // The following checks that sig is initialized. assert(sig == SIGUSR1); } } int main(void) { test_sigwait(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/inline.cc0000664000175000017500000000057312330266131024705 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O3 %s -o %t && %run %t // Test that no_sanitize_memory attribute applies even when the function would // be normally inlined. #include __attribute__((no_sanitize_memory)) int f(int *p) { if (*p) // BOOOM?? Nope! exit(0); return 0; } int main(int argc, char **argv) { int x; int * volatile p = &x; int res = f(p); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/ioctl.cc0000664000175000017500000000063212475135503024545 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O3 -g %s -o %t && %run %t #include #include #include #include #include int main(int argc, char **argv) { int fd = socket(AF_INET, SOCK_DGRAM, 0); unsigned int z; int res = ioctl(fd, FIOGETOWN, &z); assert(res == 0); close(fd); if (z) exit(0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/errno.cc0000664000175000017500000000044312475135503024560 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include #include int main() { int x; int *volatile p = &x; errno = *p; int res = read(-1, 0, 0); assert(res == -1); if (errno) printf("errno %d\n", errno); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dlerror.cc0000664000175000017500000000042712755311406025105 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include #include int main(void) { void *p = dlopen("/bad/file/name", RTLD_NOW); assert(!p); char *s = dlerror(); printf("%s, %zu\n", s, strlen(s)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/getaddrinfo-positive.cc0000664000175000017500000000133312475135503027560 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include #include #include #include volatile int z; int main(void) { struct addrinfo *ai; struct addrinfo hint; int res = getaddrinfo("localhost", NULL, NULL, &ai); if (ai) z = 1; // OK res = getaddrinfo("localhost", NULL, &hint, &ai); // CHECK: Uninitialized bytes in __interceptor_getaddrinfo at offset 0 inside [0x{{.*}}, 48) // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 {{.*}} in main {{.*}}getaddrinfo-positive.cc:[[@LINE-3]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/check_mem_is_initialized.cc0000664000175000017500000000314312755311406030425 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out #include #include int main(int argc, char **argv) { int *volatile p = (int *)malloc(sizeof(int)); __msan_check_mem_is_initialized(p, sizeof(*p)); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*check_mem_is_initialized.cc:}}[[@LINE-2]] // CHECK-ORIGINS: Uninitialized value was created by a heap allocation // CHECK-ORIGINS: {{#0 0x.* in .*malloc}} // CHECK-ORIGINS: {{#1 0x.* in main .*check_mem_is_initialized.cc:}}[[@LINE-8]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/poison_in_free.cc0000664000175000017500000000076012330266131026423 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=poison_in_free=0 %run %t >%t.out 2>&1 #include #include #include int main(int argc, char **argv) { char *volatile x = (char*)malloc(50 * sizeof(char)); memset(x, 0, 50); free(x); return x[25]; // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 {{.*}} in main{{.*}}poison_in_free.cc:[[@LINE-2]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/use-after-dtor.cc0000664000175000017500000000266612556470372026313 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -fsanitize-memory-track-origins -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out #include #include #include #include struct Simple { int x_; Simple() { x_ = 5; } ~Simple() { x_ += 1; } }; int main() { unsigned long buf[1]; assert(sizeof(Simple) <= sizeof(buf)); Simple *s = new(&buf) Simple(); s->~Simple(); return s->x_; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main.*use-after-dtor.cc:}}[[@LINE-3]] // CHECK-ORIGINS: Memory was marked as uninitialized // CHECK-ORIGINS: {{#0 0x.* in __sanitizer_dtor_callback}} // CHECK-ORIGINS: {{#1 0x.* in Simple::~Simple}} // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*main}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/use-after-free.cc0000664000175000017500000000304312475135503026244 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out #include int main(int argc, char **argv) { int *volatile p = (int *)malloc(sizeof(int)); *p = 42; free(p); if (*p) exit(0); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*use-after-free.cc:}}[[@LINE-3]] // CHECK-ORIGINS: Uninitialized value was created by a heap deallocation // CHECK-ORIGINS: {{#0 0x.* in .*free}} // CHECK-ORIGINS: {{#1 0x.* in main .*use-after-free.cc:}}[[@LINE-9]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/tsearch.cc0000664000175000017500000000114012330266131025047 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t #include #include #include int compare(const void *pa, const void *pb) { int a = *(const int *)pa; int b = *(const int *)pb; if (a < b) return -1; else if (a > b) return 1; else return 0; } void myfreenode(void *p) { delete (int *)p; } int main(void) { void *root = NULL; for (int i = 0; i < 5; ++i) { int *p = new int(i); void *q = tsearch(p, &root, compare); if (q == NULL) exit(1); if (*(int **)q != p) delete p; } tdestroy(root, myfreenode); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/msan_print_shadow3.cc0000664000175000017500000000072212663772072027244 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include #include int main(void) { unsigned long long x = 0; // For 8-byte alignment. char x_s[4] = {0x87, 0x65, 0x43, 0x21}; __msan_partial_poison(&x, &x_s, sizeof(x_s)); __msan_print_shadow(&x, sizeof(x_s)); return 0; } // CHECK: Shadow map of [{{.*}}), 4 bytes: // CHECK: 0x{{.*}}: 87654321 ........ ........ ........ golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/realloc-origin.cc0000664000175000017500000000141212475135503026336 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // This test relies on realloc from 100 to 101 being done in-place. #include int main(int argc, char **argv) { char *p = (char *)malloc(100); p = (char *)realloc(p, 101); char x = p[100]; free(p); return x; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*realloc-origin.cc:}}[[@LINE-2]] // CHECK: Uninitialized value was created by a heap allocation // CHECK: {{#0 0x.* in .*realloc}} // CHECK: {{#1 0x.* in main .*realloc-origin.cc:}}[[@LINE-9]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/strerror_r-non-gnu.c0000664000175000017500000000067112330266131027045 0ustar mwhudsonmwhudson// RUN: %clang_msan -std=c99 -O0 -g %s -o %t && %run %t // strerror_r under a weird set of circumstances can be redirected to // __xpg_strerror_r. Test that MSan handles this correctly. #define _POSIX_C_SOURCE 200112 #include #include #include #include int main() { char buf[1000]; int res = strerror_r(EINVAL, buf, sizeof(buf)); assert(!res); volatile int z = strlen(buf); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/default_blacklist.cc0000664000175000017500000000025712146676354027123 0ustar mwhudsonmwhudson// Test that MSan uses the default blacklist from resource directory. // RUN: %clangxx_msan -### %s 2>&1 | FileCheck %s // CHECK: fsanitize-blacklist={{.*}}msan_blacklist.txt golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/vector_cvt.cc0000664000175000017500000000103612662736340025614 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: x86_64-target-arch #include int to_int(double v) { __m128d t = _mm_set_sd(v); int x = _mm_cvtsd_si32(t); return x; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: #{{.*}} in to_int{{.*}}vector_cvt.cc:[[@LINE-3]] } int main() { #ifdef POSITIVE double v; #else double v = 1.1; #endif double* volatile p = &v; int x = to_int(*p); return !x; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/CMakeLists.txt0000664000175000017500000000326712741012374025667 0ustar mwhudsonmwhudsonset(MSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(MSAN_TESTSUITES) set(MSAN_TEST_ARCH ${MSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(MSAN_SUPPORTED_ARCH MSAN_TEST_ARCH) endif() foreach(arch ${MSAN_TEST_ARCH}) set(MSAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" MSAN_TEST_CONFIG_SUFFIX) if(ANDROID OR ${arch} MATCHES "arm|aarch64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(MSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) set(MSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} MSAN_TEST_TARGET_CFLAGS) string(REPLACE ";" " " MSAN_TEST_TARGET_CFLAGS "${MSAN_TEST_TARGET_CFLAGS}") endif() string(TOUPPER ${arch} ARCH_UPPER_CASE) set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) list(APPEND MSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND MSAN_TEST_DEPS msan) endif() if(COMPILER_RT_INCLUDE_TESTS AND COMPILER_RT_HAS_LIBCXX_SOURCES) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) list(APPEND MSAN_TEST_DEPS MsanUnitTests) list(APPEND MSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) endif() add_lit_testsuite(check-msan "Running the MemorySanitizer tests" ${MSAN_TESTSUITES} DEPENDS ${MSAN_TEST_DEPS} ) set_target_properties(check-msan PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/if_indextoname.cc0000664000175000017500000000122312524140270026411 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t 2>&1 // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t 2>&1 #include #include #include #include #include #include int main(int argc, char *argv[]) { char ifname[IF_NAMESIZE + 1]; assert(0 == __msan_test_shadow(ifname, sizeof(ifname))); if (!if_indextoname(1, ifname)) { assert(errno == ENXIO); printf("No network interfaces found.\n"); return 0; } assert(strlen(ifname) + 1 <= __msan_test_shadow(ifname, sizeof(ifname))); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/msan_copy_shadow.cc0000664000175000017500000000242612607040070026762 0ustar mwhudsonmwhudson// Test that __msan_copy_shadow copies shadow, updates origin and does not touch // the application memory. // RUN: %clangxx_msan -fsanitize-memory-track-origins=0 -O0 %s -o %t && not %run %t 2>&1 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include int main() { char *a = new char[4]; char *b = new char[4]; a[1] = 1; a[3] = 2; memset(b, 42, 4); // Test that __msan_copy_shadow does not touch the contents of b[]. __msan_copy_shadow(b, a, 4); __msan_unpoison(b, 4); assert(b[0] == 42 && b[1] == 42 && b[2] == 42 && b[3] == 42); // Test that __msan_copy_shadow correctly updates shadow and origin of b[]. __msan_copy_shadow(b, a, 4); assert(__msan_test_shadow(b, 4) == 0); assert(__msan_test_shadow(b + 1, 3) == 1); assert(__msan_test_shadow(b + 3, 1) == -1); __msan_check_mem_is_initialized(b, 4); // CHECK: use-of-uninitialized-value // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-2]] // CHECK: Uninitialized value was stored to memory at // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-8]] // CHECK: Uninitialized value was created by a heap allocation // CHECK: {{in main.*msan_copy_shadow.cc:}}[[@LINE-22]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/heap-origin.cc0000664000175000017500000000312512475135503025635 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out #include int main(int argc, char **argv) { char *volatile x = (char*)malloc(5 * sizeof(char)); return *x; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*heap-origin.cc:}}[[@LINE-2]] // CHECK-ORIGINS: Uninitialized value was created by a heap allocation // CHECK-ORIGINS: {{#0 0x.* in .*malloc}} // CHECK-ORIGINS: {{#1 0x.* in main .*heap-origin.cc:}}[[@LINE-7]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*heap-origin.cc:.* main}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtls_test.c0000664000175000017500000000261012664777737025320 0ustar mwhudsonmwhudson/* RUN: %clang_msan -g %s -o %t RUN: %clang_msan -g %s -DBUILD_SO -fPIC -o %t-so.so -shared RUN: %run %t 2>&1 Regression test for a bug in msan/glibc integration, see https://sourceware.org/bugzilla/show_bug.cgi?id=16291 and https://github.com/google/sanitizers/issues/547 */ #ifndef BUILD_SO #include #include #include #include #include typedef long *(* get_t)(); get_t GetTls; void *Thread1(void *unused) { long uninitialized; long *x = GetTls(); if (*x) fprintf(stderr, "bar\n"); *x = uninitialized; fprintf(stderr, "stack: %p dtls: %p\n", &x, x); return 0; } void *Thread2(void *unused) { long *x = GetTls(); fprintf(stderr, "stack: %p dtls: %p\n", &x, x); if (*x) fprintf(stderr, "foo\n"); // False negative here. return 0; } int main(int argc, char *argv[]) { char path[4096]; snprintf(path, sizeof(path), "%s-so.so", argv[0]); int i; void *handle = dlopen(path, RTLD_LAZY); if (!handle) fprintf(stderr, "%s\n", dlerror()); assert(handle != 0); GetTls = (get_t)dlsym(handle, "GetTls"); assert(dlerror() == 0); pthread_t t; pthread_create(&t, 0, Thread1, 0); pthread_join(t, 0); pthread_create(&t, 0, Thread2, 0); pthread_join(t, 0); return 0; } #else // BUILD_SO __thread long huge_thread_local_array[1 << 17]; long *GetTls() { return &huge_thread_local_array[0]; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/getc_unlocked.c0000664000175000017500000000160212475135503026074 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -DGETC -O0 -g -xc++ %s -o %t && %run %t // RUN: %clangxx_msan -DGETC -O3 -g -xc++ %s -o %t && %run %t // RUN: %clang_msan -DGETC -O0 -g %s -o %t && %run %t // RUN: %clang_msan -DGETC -O3 -g %s -o %t && %run %t // RUN: %clangxx_msan -DGETCHAR -O0 -g -xc++ %s -o %t && %run %t // RUN: %clangxx_msan -DGETCHAR -O3 -g -xc++ %s -o %t && %run %t // RUN: %clang_msan -DGETCHAR -O0 -g %s -o %t && %run %t // RUN: %clang_msan -DGETCHAR -O3 -g %s -o %t && %run %t #include #include #include int main() { FILE *stream = fopen("/dev/zero", "r"); flockfile (stream); int c; #if defined(GETCHAR) int res = dup2(fileno(stream), 0); assert(res == 0); c = getchar_unlocked(); #elif defined(GETC) c = getc_unlocked (stream); #endif funlockfile (stream); if (c == EOF) return 1; printf("%c\n", (char)c); fclose(stream); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/lit.site.cfg.in0000664000175000017500000000072212704361721025743 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. config.name_suffix = "@MSAN_TEST_CONFIG_SUFFIX@" config.target_cflags = "@MSAN_TEST_TARGET_CFLAGS@" config.target_arch = "@MSAN_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") # Load tool-specific config that would do the real work. lit_config.load_config(config, "@MSAN_LIT_SOURCE_DIR@/lit.cfg") golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/strxfrm.cc0000664000175000017500000000051312475135503025136 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t #include #include #include #include int main(void) { const char *p = "abcdef"; char q[10]; size_t n = strxfrm(q, p, sizeof(q)); assert(n < sizeof(q)); __msan_check_mem_is_initialized(q, n + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/select.cc0000664000175000017500000000133112475135503024707 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include int main(int argc, char **argv) { int x; int *volatile p = &x; int z = *p ? 1 : 0; if (z) exit(0); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*select.cc:}}[[@LINE-3]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*select.cc:.* main}} return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-bit-fields.cc0000664000175000017500000000325012572151145026420 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t #include #include // TODO: remove empty dtors when msan use-after-dtor poisons // for trivial classes with undeclared dtors // 24 bytes total struct Packed { // Packed into 4 bytes unsigned int a : 1; unsigned int b : 1; // Force alignment to next 4 bytes unsigned int : 0; unsigned int c : 1; // Force alignment, 8 more bytes double d = 5.0; // 4 bytes unsigned int e : 1; ~Packed() {} }; // 1 byte total struct Empty { unsigned int : 0; ~Empty() {} }; // 4 byte total struct Simple { unsigned int a : 1; ~Simple() {} }; struct Anon { unsigned int a : 1; unsigned int b : 2; unsigned int : 0; unsigned int c : 1; ~Anon() {} }; int main() { Packed *p = new Packed(); p->~Packed(); for (int i = 0; i < 4; i++) assert(__msan_test_shadow(((char*)p) + i, sizeof(char)) != -1); assert(__msan_test_shadow(&p->d, sizeof(double)) != -1); assert(__msan_test_shadow(((char*)(&p->d)) + sizeof(double), sizeof(char)) != -1); Empty *e = new Empty(); e->~Empty(); assert(__msan_test_shadow(e, sizeof(*e)) != -1); Simple *s = new Simple(); s->~Simple(); assert(__msan_test_shadow(s, sizeof(*s)) != -1); Anon *a = new Anon(); a->~Anon(); assert(__msan_test_shadow(a, sizeof(*a)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/stack-origin.cc0000664000175000017500000000310012475135503026016 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out #include int main(int argc, char **argv) { int x; int *volatile p = &x; return *p; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-2]] // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' // CHECK-ORIGINS: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-8]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin.cc:.* main}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/realloc-large-origin.cc0000664000175000017500000000204512475135503027431 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // This is a regression test: there used to be broken "stored to memory at" // stacks with // in __msan_memcpy // in __msan::MsanReallocate // and nothing below that. #include int main(int argc, char **argv) { char *p = (char *)malloc(100); p = (char *)realloc(p, 10000); char x = p[50]; free(p); return x; // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-3]] // CHECK: Uninitialized value was stored to memory at // CHECK: {{#0 0x.* in .*realloc}} // CHECK: {{#1 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-10]] // CHECK: Uninitialized value was created by a heap allocation // CHECK: {{#0 0x.* in .*malloc}} // CHECK: {{#1 0x.* in main .*realloc-large-origin.cc:}}[[@LINE-15]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/getline.cc0000664000175000017500000000177212517657670025103 0ustar mwhudsonmwhudson// RUN: echo "abcde" > %t-testdata // RUN: echo "12345" >> %t-testdata // RUN: %clangxx_msan -O0 %s -o %t && %run %t %t-testdata // RUN: %clangxx_msan -O2 %s -o %t && %run %t %t-testdata // RUN: %clang_msan -O0 -xc %s -o %t && %run %t %t-testdata // RUN: %clang_msan -O2 -xc %s -o %t && %run %t %t-testdata // RUN: %clang_msan -O0 -xc -D_GNU_SOURCE=1 %s -o %t && %run %t %t-testdata // RUN: %clang_msan -O2 -xc -D_GNU_SOURCE=1 %s -o %t && %run %t %t-testdata #if defined(__FreeBSD__) #define _WITH_GETLINE // To declare getline(). #endif #include #include #include #include int main(int argc, char **argv) { assert(argc == 2); printf("%s\n", argv[1]); FILE *fp = fopen(argv[1], "r"); assert(fp); char *line = 0; size_t len = 0; int n = getline(&line, &len, fp); assert(n == 6); assert(strcmp(line, "abcde\n") == 0); n = getline(&line, &len, fp); assert(n == 6); assert(strcmp(line, "12345\n") == 0); free(line); fclose(fp); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/strlen_of_shadow.cc0000664000175000017500000000164112754605762027005 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t // Check that strlen() and similar intercepted functions can be called on shadow // memory. #include #include #include #include #include #include "test.h" const char *mem_to_shadow(const char *p) { #if defined(__x86_64__) return (char *)((uintptr_t)p ^ 0x500000000000ULL); #elif defined (__mips64) return (char *)((uintptr_t)p ^ 0x8000000000ULL); #elif defined(__powerpc64__) #define LINEARIZE_MEM(mem) \ (((uintptr_t)(mem) & ~0x200000000000ULL) ^ 0x100000000000ULL) return (char *)(LINEARIZE_MEM(p) + 0x080000000000ULL); #elif defined(__aarch64__) return (char *)((uintptr_t)p ^ 0x6000000000ULL); #endif } int main(void) { const char *s = "abcdef"; assert(strlen(s) == 6); assert(strlen(mem_to_shadow(s)) == 0); char *t = new char[42]; t[41] = 0; assert(strlen(mem_to_shadow(t)) == 41); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-vtable.cc0000664000175000017500000000313112576135270025656 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t // RUN: %clangxx_msan %s -DVPTRA=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // RUN: %clangxx_msan %s -DVPTRCA=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // RUN: %clangxx_msan %s -DVPTRCB=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // RUN: %clangxx_msan %s -DVPTRC=1 -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 not %run %t // Expected to quit due to invalid access when invoking // function using vtable. #include #include #include class A { public: int x; ~A() {} virtual void A_Foo() {} }; class B { public: int y; ~B() {} virtual void B_Foo() {} }; class C : public A, public B { public: int z; ~C() {} virtual void C_Foo() {} }; int main() { A *a = new A(); a->~A(); // Shouldn't be allowed to invoke function via vtable. #ifdef VPTRA a->A_Foo(); #endif C *c = new C(); c->~C(); #ifdef VPTRCA c->A_Foo(); #endif #ifdef VPTRCB c->B_Foo(); #endif #ifdef VPTRC c->C_Foo(); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/icmp_slt_allones.cc0000664000175000017500000000042112567165037026765 0ustar mwhudsonmwhudson// PR24561 // RUN: %clangxx_msan -O2 -g %s -o %t && %run %t #include struct A { int c1 : 7; int c8 : 1; int c9 : 1; A(); }; __attribute__((noinline)) A::A() : c8(1) {} int main() { A* a = new A(); if (a->c8 == 0) printf("zz\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/times.cc0000664000175000017500000000057212475135503024557 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t #include #include #include #include int main(void) { struct tms t; clock_t res = times(&t); assert(res != (clock_t)-1); if (t.tms_utime) printf("1\n"); if (t.tms_stime) printf("2\n"); if (t.tms_cutime) printf("3\n"); if (t.tms_cstime) printf("4\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/iconv.cc0000664000175000017500000000235312516672531024556 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O0 -g -DPOSITIVE %s -o %t && not %run %t |& FileCheck %s #include #include #include #include #include #include int main(void) { iconv_t cd = iconv_open("ASCII", "ASCII"); assert(cd != (iconv_t)-1); char inbuf_[100]; strcpy(inbuf_, "sample text"); char outbuf_[100]; #if defined(__FreeBSD__) // FreeBSD's iconv() expects the 2nd argument be of type 'const char**'. const char *inbuf = inbuf_; #else char *inbuf = inbuf_; #endif char *outbuf = outbuf_; size_t inbytesleft = strlen(inbuf_); size_t outbytesleft = sizeof(outbuf_); #ifdef POSITIVE { char u; char *volatile p = &u; inbuf_[5] = *p; } #endif size_t res; res = iconv(cd, 0, 0, 0, 0); assert(res != (size_t)-1); res = iconv(cd, 0, 0, &outbuf, &outbytesleft); assert(res != (size_t)-1); res = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 {{.*}} in main {{.*}}iconv.cc:[[@LINE-2]] assert(res != (size_t)-1); assert(inbytesleft == 0); assert(memcmp(inbuf_, outbuf_, strlen(inbuf_)) == 0); iconv_close(cd); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/print_stats.cc0000664000175000017500000000332412475135503026006 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g %s -o %t // RUN: %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s // RUN: MSAN_OPTIONS=print_stats=1 %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s // RUN: MSAN_OPTIONS=print_stats=1,atexit=1 %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS %s // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 %s -o %t // RUN: not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS %s // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -g -DPOSITIVE=1 -mllvm -msan-keep-going=1 %s -o %t // RUN: not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS --check-prefix=CHECK-KEEPGOING %s // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS --check-prefix=CHECK-KEEPGOING %s #include int main(int argc, char **argv) { int x; int *volatile p = &x; fprintf(stderr, "TEST\n"); #ifdef POSITIVE return *p; #else return 0; #endif } // CHECK: TEST // CHECK-STATS: Unique heap origins: // CHECK-STATS: Stack depot allocated bytes: // CHECK-STATS: Unique origin histories: // CHECK-STATS: History depot allocated bytes: // CHECK-NOSTATS-NOT: Unique heap origins: // CHECK-NOSTATS-NOT: Stack depot allocated bytes: // CHECK-NOSTATS-NOT: Unique origin histories: // CHECK-NOSTATS-NOT: History depot allocated bytes: // CHECK-KEEPGOING: MemorySanitizer: 1 warnings reported. golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/vector_select.cc0000664000175000017500000000074312546163270026300 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -c -o %t // RUN: %clangxx_msan -O3 %s -c -o %t // Regression test for MemorySanitizer instrumentation of a select instruction // with vector arguments. #if defined(__x86_64__) #include __m128d select(bool b, __m128d c, __m128d d) { return b ? c : d; } #elif defined (__mips64) || defined (__powerpc64__) typedef double __w64d __attribute__ ((vector_size(16))); __w64d select(bool b, __w64d c, __w64d d) { return b ? c : d; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/rand_r.cc0000664000175000017500000000065312475135503024703 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t // RUN: %clangxx_msan -O0 -g -DUNINIT %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include #include int main(void) { unsigned seed; #ifndef UNINIT seed = 42; #endif int v = rand_r(&seed); // CHECK: MemorySanitizer: use-of-uninitialized-value // CHECK: in main{{.*}}rand_r.cc:[[@LINE-2]] if (v) printf(".\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/scandir.cc0000664000175000017500000000332112475135503025054 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p #include #include #include #include #include #include #include #include #include #include #include static int my_filter(const struct dirent *a) { assert(__msan_test_shadow(&a, sizeof(a)) == (size_t)-1); printf("%s\n", a->d_name); __msan_print_shadow(a, a->d_reclen); assert(__msan_test_shadow(a, a->d_reclen) == (size_t)-1); printf("%s\n", a->d_name); return strlen(a->d_name) == 3 && a->d_name[2] == 'b'; } static int my_compar(const struct dirent **a, const struct dirent **b) { assert(__msan_test_shadow(a, sizeof(*a)) == (size_t)-1); assert(__msan_test_shadow(*a, (*a)->d_reclen) == (size_t)-1); assert(__msan_test_shadow(b, sizeof(*b)) == (size_t)-1); assert(__msan_test_shadow(*b, (*b)->d_reclen) == (size_t)-1); if ((*a)->d_name[1] == (*b)->d_name[1]) return 0; return ((*a)->d_name[1] < (*b)->d_name[1]) ? 1 : -1; } int main(int argc, char *argv[]) { assert(argc == 2); char buf[1024]; snprintf(buf, sizeof(buf), "%s/%s", argv[1], "scandir_test_root/"); struct dirent **d; int res = scandir(buf, &d, my_filter, my_compar); assert(res == 2); assert(__msan_test_shadow(&d, sizeof(*d)) == (size_t)-1); for (int i = 0; i < res; ++i) { assert(__msan_test_shadow(&d[i], sizeof(d[i])) == (size_t)-1); assert(__msan_test_shadow(d[i], d[i]->d_reclen) == (size_t)-1); } assert(strcmp(d[0]->d_name, "bbb") == 0); assert(strcmp(d[1]->d_name, "aab") == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/select_float_origin.cc0000664000175000017500000000146612460176034027452 0ustar mwhudsonmwhudson// Regression test for origin propagation in "select i1, float, float". // https://code.google.com/p/memory-sanitizer/issues/detail?id=78 // RUN: %clangxx_msan -O2 -fsanitize-memory-track-origins %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 -fsanitize-memory-track-origins=2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include #include int main() { volatile bool b = true; float x, y; __msan_allocated_memory(&x, sizeof(x)); __msan_allocated_memory(&y, sizeof(y)); float z = b ? x : y; if (z > 0) printf(".\n"); // CHECK: Memory was marked as uninitialized // CHECK: {{#0 0x.* in .*__msan_allocated_memory}} // CHECK: {{#1 0x.* in main .*select_float_origin.cc:}}[[@LINE-6]] return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/ctermid.cc0000664000175000017500000000043012755311406025055 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t #include #include #include int main(void) { unsigned char s[L_ctermid + 1]; char *res = ctermid((char *)s); if (res) printf("%zd\n", strlen(res)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/mul_by_const.cc0000664000175000017500000000116712475135503026134 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O2 %s -o %t && %run %t #include struct S { S(int a0) : a(a0) {} int a; int b; }; // Here S is passed to FooRun as a 64-bit integer. // This triggers an optimization where 10000 * s.a is transformed into // ((*(uint64_t *)&s) * (10000 * 2**32)) >> 32 // Test that MSan understands that this kills the uninitialized high half of S // (i.e. S::b). void FooRun(S s) { int64_t x = 10000 * s.a; __msan_check_mem_is_initialized(&x, sizeof(x)); } int main(void) { S z(1); // Take &z to ensure that it is built on stack. S *volatile p = &z; FooRun(z); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/param_tls_limit.cc0000664000175000017500000000406312665227132026616 0ustar mwhudsonmwhudson// ParamTLS has limited size. Everything that does not fit is considered fully // initialized. // RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && %run %t // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && %run %t // // AArch64 fails with: // void f801(S<801>): Assertion `__msan_test_shadow(&s, sizeof(s)) == -1' failed // XFAIL: aarch64 #include #include // This test assumes that ParamTLS size is 800 bytes. // This test passes poisoned values through function argument list. // In case of overflow, argument is unpoisoned. #define OVERFLOW(x) assert(__msan_test_shadow(&x, sizeof(x)) == -1) // In case of no overflow, it is still poisoned. #define NO_OVERFLOW(x) assert(__msan_test_shadow(&x, sizeof(x)) == 0) #if defined(__x86_64__) // In x86_64, if argument is partially outside tls, it is considered completly // unpoisoned #define PARTIAL_OVERFLOW(x) OVERFLOW(x) #else // In other archs, bigger arguments are splitted in multiple IR arguments, so // they are considered poisoned till tls limit. Checking last byte of such arg: #define PARTIAL_OVERFLOW(x) assert(__msan_test_shadow((char *)(&(x) + 1) - 1, 1) == -1) #endif template struct S { char x[N]; }; void f100(S<100> s) { NO_OVERFLOW(s); } void f800(S<800> s) { NO_OVERFLOW(s); } void f801(S<801> s) { PARTIAL_OVERFLOW(s); } void f1000(S<1000> s) { PARTIAL_OVERFLOW(s); } void f_many(int a, double b, S<800> s, int c, double d) { NO_OVERFLOW(a); NO_OVERFLOW(b); PARTIAL_OVERFLOW(s); OVERFLOW(c); OVERFLOW(d); } // -8 bytes for "int a", aligned by 8 // -2 to make "int c" a partial fit void f_many2(int a, S<800 - 8 - 2> s, int c, double d) { NO_OVERFLOW(a); NO_OVERFLOW(s); PARTIAL_OVERFLOW(c); OVERFLOW(d); } int main(void) { S<100> s100; S<800> s800; S<801> s801; S<1000> s1000; f100(s100); f800(s800); f801(s801); f1000(s1000); int i; double d; f_many(i, d, s800, i, d); S<800 - 8 - 2> s788; f_many2(i, s788, i, d); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/sync_lock_set_and_test.cc0000664000175000017500000000017212475135503030152 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t int main(void) { int i; __sync_lock_test_and_set(&i, 0); return i; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/sigwaitinfo.cc0000664000175000017500000000123012330266131025741 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t && %run %t #include #include #include #include #include void test_sigwaitinfo() { sigset_t s; sigemptyset(&s); sigaddset(&s, SIGUSR1); sigprocmask(SIG_BLOCK, &s, 0); if (pid_t pid = fork()) { kill(pid, SIGUSR1); _exit(0); } else { siginfo_t info; int res = sigwaitinfo(&s, &info); assert(!res); // The following checks that sig is initialized. assert(info.si_signo == SIGUSR1); assert(-1 == __msan_test_shadow(&info, sizeof(info))); } } int main(void) { test_sigwaitinfo(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/unpoison_string.cc0000664000175000017500000000067712475135503026704 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t // RUN: %run %t // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t // RUN: %run %t #include #include #include int main(int argc, char **argv) { char s[20] = "string"; __msan_poison(s, sizeof(s)); __msan_unpoison_string(s); assert(__msan_test_shadow(s, sizeof(s)) == strlen("string") + 1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/fork.cc0000664000175000017500000000504312771336670024404 0ustar mwhudsonmwhudson// Test that chained origins are fork-safe. // Run a number of threads that create new chained origins, then fork // and verify that origin reads do not deadlock in the child process. // RUN: %clangxx_msan -std=c++11 -fsanitize-memory-track-origins=2 -g -O3 %s -o %t // RUN: MSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t |& FileCheck %s // Fun fact: if test output is redirected to a file (as opposed to // being piped directly to FileCheck), we may lose some "done"s due to // a kernel bug: // https://lkml.org/lkml/2014/2/17/324 // Flaky on PPC64. // UNSUPPORTED: powerpc64-target-arch // UNSUPPORTED: powerpc64le-target-arch #include #include #include #include #include #include #include #include #include #include int done; void copy_uninit_thread2() { volatile int x; volatile int v; while (true) { v = x; x = v; if (__atomic_load_n(&done, __ATOMIC_RELAXED)) return; } } void copy_uninit_thread1(int level) { if (!level) copy_uninit_thread2(); else copy_uninit_thread1(level - 1); } void *copy_uninit_thread(void *id) { copy_uninit_thread1((long)id); return 0; } // Run through stackdepot in the child process. // If any of the hash table cells are locked, this may deadlock. void child() { volatile int x; volatile int v; for (int i = 0; i < 10000; ++i) { v = x; x = v; } write(2, "done\n", 5); } void test() { const int kThreads = 10; pthread_t t[kThreads]; for (int i = 0; i < kThreads; ++i) pthread_create(&t[i], NULL, copy_uninit_thread, (void*)(long)i); usleep(100000); pid_t pid = fork(); if (pid) { // parent __atomic_store_n(&done, 1, __ATOMIC_RELAXED); pid_t p; while ((p = wait(NULL)) == -1) { } } else { // child child(); } } int main() { const int kChildren = 20; for (int i = 0; i < kChildren; ++i) { pid_t pid = fork(); if (pid) { // parent } else { test(); exit(0); } } for (int i = 0; i < kChildren; ++i) { pid_t p; while ((p = wait(NULL)) == -1) { } } return 0; } // Expect 20 (== kChildren) "done" messages. // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done // CHECK: done golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/stack-origin2.cc0000664000175000017500000000333712475135503026114 0ustar mwhudsonmwhudson// Test that on the second entry to a function the origins are still right. // RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out #include extern "C" int f(int depth) { if (depth) return f(depth - 1); int x; int *volatile p = &x; return *p; } int main(int argc, char **argv) { return f(1); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*stack-origin2.cc:}}[[@LINE-2]] // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'f' // CHECK-ORIGINS: {{#0 0x.* in f .*stack-origin2.cc:}}[[@LINE-14]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin2.cc:.* main}} } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/ifaddrs.cc0000664000175000017500000000317512522356662025060 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p 2>&1 // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p 2>&1 // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p 2>&1 #include #include #include #include #include #include #if defined(__FreeBSD__) #include // To define 'struct sockaddr'. #endif #include #define CHECK_AND_PUSH(addr, size) \ if (addr) { \ assert(-1 == __msan_test_shadow(addr, sizeof(size))); \ ranges.push_back(std::make_pair((void *)addr, (size_t)size)); \ } int main(int argc, char *argv[]) { struct ifaddrs *ifas; assert(0 == __msan_test_shadow(&ifas, sizeof(ifaddrs *))); int res = getifaddrs(&ifas); if (res == -1) { assert(errno == ENOSYS); printf("getifaddrs() is not implemented\n"); return 0; } assert(res == 0); assert(-1 == __msan_test_shadow(&ifas, sizeof(ifaddrs *))); std::vector > ranges; ifaddrs *p = ifas; while (p) { CHECK_AND_PUSH(p, sizeof(ifaddrs)); CHECK_AND_PUSH(p->ifa_name, strlen(p->ifa_name) + 1); CHECK_AND_PUSH(p->ifa_addr, sizeof(*p->ifa_addr)); CHECK_AND_PUSH(p->ifa_netmask, sizeof(*p->ifa_netmask)); CHECK_AND_PUSH(p->ifa_broadaddr, sizeof(*p->ifa_broadaddr)); CHECK_AND_PUSH(p->ifa_dstaddr, sizeof(*p->ifa_dstaddr)); p = p->ifa_next; } freeifaddrs(ifas); for (int i = 0; i < ranges.size(); i++) assert(0 == __msan_test_shadow(ranges[i].first, ranges[i].second)); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/lit.cfg0000664000175000017500000000246312670340377024405 0ustar mwhudsonmwhudson# -*- Python -*- import os # Setup config name. config.name = 'MemorySanitizer' + getattr(config, 'name_suffix', 'default') # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup default compiler flags used with -fsanitize=memory option. clang_msan_cflags = (["-fsanitize=memory", "-mno-omit-leaf-frame-pointer", "-fno-omit-frame-pointer", "-fno-optimize-sibling-calls"] + [config.target_cflags] + config.debug_info_flags) # Some Msan tests leverage backtrace() which requires libexecinfo on FreeBSD. if config.host_os == 'FreeBSD': clang_msan_cflags += ["-lexecinfo"] clang_msan_cxxflags = config.cxx_mode_flags + clang_msan_cflags def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " config.substitutions.append( ("%clang_msan ", build_invocation(clang_msan_cflags)) ) config.substitutions.append( ("%clangxx_msan ", build_invocation(clang_msan_cxxflags)) ) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] # MemorySanitizer tests are currently supported on Linux only. if config.host_os not in ['Linux']: config.unsupported = True if config.target_arch != 'aarch64': config.available_features.add('stable-runtime') golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/sem_getvalue.cc0000664000175000017500000000063312567656046026130 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t #include #include #include int main(void) { sem_t sem; int res = sem_init(&sem, 0, 42); assert(res == 0); int v; res = sem_getvalue(&sem, &v); assert(res == 0); __msan_check_mem_is_initialized(&v, sizeof(v)); assert(v == 42); res = sem_destroy(&sem); assert(res == 0); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/report-demangling.cc0000664000175000017500000000124312523123706027044 0ustar mwhudsonmwhudson// Test that function name is mangled in the "created by an allocation" line, // and demangled in the single-frame "stack trace" that follows. // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out __attribute__((noinline)) int f() { int x; int *volatile p = &x; return *p; } int main(int argc, char **argv) { return f(); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function '_Z1fv' // CHECK: #0 {{.*}} in f{{.*}} {{.*}}report-demangling.cc:[[@LINE-10]] } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-base-access.cc0000664000175000017500000000254612563201755026561 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 #include #include class Base { public: int *x_ptr; Base(int *y_ptr) { // store value of subclass member x_ptr = y_ptr; } virtual ~Base(); }; class Derived : public Base { public: int y; Derived():Base(&y) { y = 10; } ~Derived(); }; Base::~Base() { // ok access its own member assert(__msan_test_shadow(&this->x_ptr, sizeof(this->x_ptr)) == -1); // bad access subclass member assert(__msan_test_shadow(this->x_ptr, sizeof(*this->x_ptr)) != -1); } Derived::~Derived() { // ok to access its own members assert(__msan_test_shadow(&this->y, sizeof(this->y)) == -1); // ok access base class members assert(__msan_test_shadow(&this->x_ptr, sizeof(this->x_ptr)) == -1); } int main() { Derived *d = new Derived(); assert(__msan_test_shadow(&d->x_ptr, sizeof(d->x_ptr)) == -1); d->~Derived(); assert(__msan_test_shadow(&d->x_ptr, sizeof(d->x_ptr)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/tzset.cc0000664000175000017500000000044712475135503024610 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include extern char *tzname[2]; int main(void) { if (!strlen(tzname[0]) || !strlen(tzname[1])) exit(1); tzset(); if (!strlen(tzname[0]) || !strlen(tzname[1])) exit(1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-trivial.cpp0000664000175000017500000000173512576135270026260 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // TODO Success pending on resolution of // https://github.com/google/sanitizers/issues/596 // XFAIL: * #include #include template class Vector { public: int size; ~Vector() {} }; struct NonTrivial { int a; Vector v; }; struct Trivial { int a; int b; }; int main() { NonTrivial *nt = new NonTrivial(); nt->~NonTrivial(); assert(__msan_test_shadow(nt, sizeof(*nt)) != -1); Trivial *t = new Trivial(); t->~Trivial(); assert(__msan_test_shadow(t, sizeof(*t)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/tls_reuse.cc0000664000175000017500000000070012475135503025434 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t // Check that when TLS block is reused between threads, its shadow is cleaned. #include #include int __thread x; void *ThreadFn(void *) { if (!x) printf("zzz\n"); int y; int * volatile p = &y; x = *p; return 0; } int main(void) { pthread_t t; for (int i = 0; i < 100; ++i) { pthread_create(&t, 0, ThreadFn, 0); pthread_join(t, 0); } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/scandir_test_root/0000775000175000017500000000000013040224624026640 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/scandir_test_root/aaa0000664000175000017500000000000012200721673027276 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/scandir_test_root/bbb0000664000175000017500000000000012200721673027301 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/scandir_test_root/aab0000664000175000017500000000000012200721673027277 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/msan/msan_check_mem_is_initialized.cc0000664000175000017500000000174013003005160031424 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 -g -DPOSITIVE %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s // RUN: MSAN_OPTIONS=verbosity=1 not %run %t 2>&1 | \ // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-VERBOSE // RUN: %clangxx_msan -O0 -g %s -o %t && %run %t #include int main(void) { char p[32] = {}; __msan_poison(p + 10, 2); __msan_check_mem_is_initialized(p, 10); __msan_check_mem_is_initialized(p + 12, 30); #ifdef POSITIVE __msan_check_mem_is_initialized(p + 5, 20); // CHECK: Uninitialized bytes in __msan_check_mem_is_initialized at offset 5 inside [0x{{.*}}, 20) // CHECK-VERBOSE: Shadow map of [0x{{.*}}, 0x{{.*}}), 20 bytes: // CHECK-VERBOSE: 0x{{.*}}: ..000000 0000ffff 00000000 00000000 // CHECK-VERBOSE: 0x{{.*}}: 00000000 00...... ........ ........ // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: #0 0x{{.*}}in main{{.*}}msan_check_mem_is_initialized.cc:[[@LINE-7]] #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/getaddrinfo.cc0000664000175000017500000000116612475135503025724 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include #include void poison_stack_ahead() { char buf[100000]; // With -O0 this poisons a large chunk of stack. } int main(void) { poison_stack_ahead(); struct addrinfo *ai; // This should trigger loading of libnss_dns and friends. // Those libraries are typically uninstrumented.They will call strlen() on a // stack-allocated buffer, which is very likely to be poisoned. Test that we // don't report this as an UMR. int res = getaddrinfo("not-in-etc-hosts", NULL, NULL, &ai); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/initgroups.cc0000664000175000017500000000051312522357113025630 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include #include // FreeBSD declares initgroups() here. int main(void) { initgroups("root", 0); // The above fails unless you are root. Does not matter, MSan false positive // (which we are testing for) happens anyway. return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/keep-going-dso.cc0000664000175000017500000000247512475135503026252 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=0 not %run %t >%t.out 2>&1 // FileCheck %s <%t.out // RUN: %clangxx_msan -mllvm -msan-keep-going=1 -O0 %s -o %t && MSAN_OPTIONS=keep_going=1 not %run %t >%t.out 2>&1 // FileCheck --check-prefix=CHECK-KEEP-GOING %s <%t.out // Test how -mllvm -msan-keep-going and MSAN_OPTIONS=keep_going affect reports // from interceptors. // -mllvm -msan-keep-going provides the default value of keep_going flag, but is // always overwritten by MSAN_OPTIONS #include #include #include int main(int argc, char **argv) { char *volatile x = (char*)malloc(5 * sizeof(char)); x[4] = 0; if (strlen(x) < 3) exit(0); fprintf(stderr, "Done\n"); // CHECK-NOT: Done // CHECK-KEEP-GOING: Done return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/cxa_atexit.cc0000664000175000017500000000074612755311406025571 0ustar mwhudsonmwhudson// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p // PR17377: C++ module destructors get stale argument shadow. #include #include class A { public: // This destructor get stale argument shadow left from the call to f(). ~A() { if (this) exit(0); } }; A a; __attribute__((noinline)) void f(long x) { } int main(void) { long x; long * volatile p = &x; // This call poisons TLS shadow for the first function argument. f(*p); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/msan/dtor-derived-class.cc0000664000175000017500000000225512572151145027127 0ustar mwhudsonmwhudson// RUN: %clangxx_msan %s -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 // RUN: %clangxx_msan %s -O2 -fsanitize=memory -fsanitize-memory-use-after-dtor -o %t && MSAN_OPTIONS=poison_in_dtor=1 %run %t >%t.out 2>&1 #include #include struct Base { int x; Base() { x = 5; } virtual ~Base() {} }; struct Derived : public Base { int y; Derived() { y = 10; } ~Derived() {} }; int main() { Derived *d = new Derived(); d->~Derived(); // Verify that local pointer is unpoisoned, and that the object's // members are. assert(__msan_test_shadow(&d, sizeof(d)) == -1); assert(__msan_test_shadow(&d->x, sizeof(d->x)) != -1); assert(__msan_test_shadow(&d->y, sizeof(d->y)) != -1); Base *b = new Derived(); b->~Base(); // Verify that local pointer is unpoisoned, and that the object's // members are. assert(__msan_test_shadow(&b, sizeof(b)) == -1); assert(__msan_test_shadow(&b->x, sizeof(b->x)) != -1); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/interception/0000775000175000017500000000000013040224625024661 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/interception/Unit/0000775000175000017500000000000013040224625025600 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/interception/Unit/lit.site.cfg.in0000664000175000017500000000105412746151555030436 0ustar mwhudsonmwhudson@LIT_SITE_CFG_IN_HEADER@ # Load common config for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured") # Setup config name. config.name = 'Interception-Unit' # Setup test source and exec root. For unit tests, we define # it as build directory with interception tests. # FIXME: De-hardcode this path. config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@", "lib", "interception", "tests") config.test_source_root = config.test_exec_root golang-1.8-race-detector-runtime_0.0+svn285455/test/interception/CMakeLists.txt0000664000175000017500000000134012750544257027434 0ustar mwhudsonmwhudsonset(INTERCEPTION_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) set(INTERCEPTION_TESTSUITES) # Unit tests. There are currently no unit tests capable to running on Apple or # Android targets. if(COMPILER_RT_INCLUDE_TESTS AND NOT ANDROID AND NOT APPLE) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) list(APPEND INTERCEPTION_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) list(APPEND INTERCEPTION_TEST_DEPS InterceptionUnitTests) endif() add_lit_testsuite(check-interception "Running the Interception tests" ${INTERCEPTION_TESTSUITES} DEPENDS ${INTERCEPTION_TEST_DEPS}) set_target_properties(check-interception PROPERTIES FOLDER "Compiler-RT Misc") golang-1.8-race-detector-runtime_0.0+svn285455/test/lit.common.cfg0000664000175000017500000001724612775420063024740 0ustar mwhudsonmwhudson# -*- Python -*- # Configuration file for 'lit' test runner. # This file contains common rules for various compiler-rt testsuites. # It is mostly copied from lit.cfg used by Clang. import os import platform import re import subprocess import lit.formats import lit.util # Setup test format. Use bash on Unix and the lit shell on Windows. execute_external = (not sys.platform in ['win32']) config.test_format = lit.formats.ShTest(execute_external) if execute_external: config.available_features.add('shell') # Setup clang binary. compiler_path = getattr(config, 'clang', None) if (not compiler_path) or (not os.path.exists(compiler_path)): lit_config.fatal("Can't find compiler on path %r" % compiler_path) compiler_id = getattr(config, 'compiler_id', None) if compiler_id == "Clang": if platform.system() != 'Windows': config.cxx_mode_flags = ["--driver-mode=g++"] else: config.cxx_mode_flags = [] # We assume that sanitizers should provide good enough error # reports and stack traces even with minimal debug info. config.debug_info_flags = ["-gline-tables-only"] if platform.system() == 'Windows': config.debug_info_flags.append("-gcodeview") elif compiler_id == 'GNU': config.cxx_mode_flags = ["-x c++"] config.debug_info_flags = ["-g"] else: lit_config.fatal("Unsupported compiler id: %r" % compiler_id) # Add compiler ID to the list of available features. config.available_features.add(compiler_id) # Clear some environment variables that might affect Clang. possibly_dangerous_env_vars = ['ASAN_OPTIONS', 'DFSAN_OPTIONS', 'LSAN_OPTIONS', 'MSAN_OPTIONS', 'UBSAN_OPTIONS', 'COMPILER_PATH', 'RC_DEBUG_OPTIONS', 'CINDEXTEST_PREAMBLE_FILE', 'LIBRARY_PATH', 'CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH', 'OBJC_INCLUDE_PATH', 'OBJCPLUS_INCLUDE_PATH', 'LIBCLANG_TIMING', 'LIBCLANG_OBJTRACKING', 'LIBCLANG_LOGGING', 'LIBCLANG_BGPRIO_INDEX', 'LIBCLANG_BGPRIO_EDIT', 'LIBCLANG_NOTHREADS', 'LIBCLANG_RESOURCE_USAGE', 'LIBCLANG_CODE_COMPLETION_LOGGING', 'XRAY_OPTIONS'] # Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it. if platform.system() != 'Windows': possibly_dangerous_env_vars.append('INCLUDE') for name in possibly_dangerous_env_vars: if name in config.environment: del config.environment[name] # Tweak PATH to include llvm tools dir. llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path # Help MSVS link.exe find the standard libraries. # Make sure we only try to use it when targetting Windows. if platform.system() == 'Windows' and '-win' in config.target_triple: config.environment['LIB'] = os.environ['LIB'] if re.match(r'^x86_64.*-linux', config.target_triple): config.available_features.add("x86_64-linux") # Use ugly construction to explicitly prohibit "clang", "clang++" etc. # in RUN lines. config.substitutions.append( (' clang', """\n\n*** Do not use 'clangXXX' in tests, instead define '%clangXXX' substitution in lit config. ***\n\n""") ) # Allow tests to be executed on a simulator or remotely. config.substitutions.append( ('%run', config.emulator) ) # Define CHECK-%os to check for OS-dependent output. config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os))) # Define %arch to check for architecture-dependent output. config.substitutions.append( ('%arch', (config.host_arch))) if config.host_os == 'Windows': # FIXME: This isn't quite right. Specifically, it will succeed if the program # does not crash but exits with a non-zero exit code. We ought to merge # KillTheDoctor and not --crash to make the latter more useful and remove the # need for this substitution. config.expect_crash = "not KillTheDoctor " else: config.expect_crash = "not --crash " config.substitutions.append( ("%expect_crash ", config.expect_crash) ) target_arch = getattr(config, 'target_arch', None) if target_arch: config.available_features.add(target_arch + '-target-arch') if target_arch in ['x86_64', 'i386', 'i686']: config.available_features.add('x86-target-arch') config.available_features.add(target_arch + '-' + config.host_os.lower()) compiler_rt_debug = getattr(config, 'compiler_rt_debug', False) if not compiler_rt_debug: config.available_features.add('compiler-rt-optimized') sanitizer_can_use_cxxabi = getattr(config, 'sanitizer_can_use_cxxabi', True) if sanitizer_can_use_cxxabi: config.available_features.add('cxxabi') if config.has_lld: config.available_features.add('lld') if config.can_symbolize: config.available_features.add('can-symbolize') lit.util.usePlatformSdkOnDarwin(config, lit_config) if config.host_os == 'Darwin': try: osx_version = subprocess.check_output(["sw_vers", "-productVersion"]) osx_version = tuple(int(x) for x in osx_version.split('.')) if osx_version >= (10, 11): config.available_features.add('osx-autointerception') config.available_features.add('osx-ld64-live_support') else: # The ASAN initialization-bug.cc test should XFAIL on OS X systems # older than El Capitan. By marking the test as being unsupported with # this "feature", we can pass the test on newer OS X versions and other # platforms. config.available_features.add('osx-no-ld64-live_support') except: pass sancovcc_path = os.path.join(llvm_tools_dir, "sancov") if os.path.exists(sancovcc_path): config.available_features.add("has_sancovcc") config.substitutions.append( ("%sancovcc ", sancovcc_path) ) def is_darwin_lto_supported(): return os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO.dylib')) def is_linux_lto_supported(): if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')): return False ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE) ld_out = ld_cmd.stdout.read().decode() ld_cmd.wait() if not '-plugin' in ld_out: return False return True def is_windows_lto_supported(): return os.path.exists(os.path.join(config.llvm_tools_dir, 'lld-link.exe')) if config.host_os == 'Darwin' and is_darwin_lto_supported(): config.lto_supported = True config.lto_launch = ["env", "DYLD_LIBRARY_PATH=" + config.llvm_shlib_dir] config.lto_flags = [] elif config.host_os == 'Linux' and is_linux_lto_supported(): config.lto_supported = True config.lto_launch = [] config.lto_flags = ["-fuse-ld=gold"] elif config.host_os == 'Windows' and is_windows_lto_supported(): config.lto_supported = True config.lto_launch = [] config.lto_flags = ["-fuse-ld=lld"] else: config.lto_supported = False if config.lto_supported: config.available_features.add('lto') # Ask llvm-config about assertion mode. try: llvm_config_cmd = subprocess.Popen( [os.path.join(config.llvm_tools_dir, 'llvm-config'), '--assertion-mode'], stdout = subprocess.PIPE, env=config.environment) except OSError: print("Could not find llvm-config in " + llvm_tools_dir) exit(42) if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')): config.available_features.add('asserts') llvm_config_cmd.wait() # Sanitizer tests tend to be flaky on Windows due to PR24554, so add some # retries. We don't do this on otther platforms because it's slower. if platform.system() == 'Windows': config.test_retry_attempts = 2 golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/0000775000175000017500000000000013040224624024006 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/0000775000175000017500000000000013040224624024725 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunstfti_test.c0000664000175000017500000000602512616720672030352 0ustar mwhudsonmwhudson//===-- fixunstfti_test.c - Test __fixunstfti -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunstfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" #include "int_lib.h" // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: long double is a 128 bit floating point type // tu_int is a 128 bit integral type // value in long double is representable in tu_int or is negative // (no range checking performed) COMPILER_RT_ABI tu_int __fixunstfti(long double a); int test__fixunstfti(long double a, tu_int expected) { tu_int x = __fixunstfti(a); if (x != expected) { twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __fixunstfti(%.20Lf) = 0x%.16llX%.16llX, " "expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(tu_int) == 4*sizeof(su_int)] = {0}; char assumption_2[sizeof(tu_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__fixunstfti(makeInf128(), make_ti(0xffffffffffffffffLL, 0xffffffffffffffffLL))) return 1; if (test__fixunstfti(0.0, 0)) return 1; if (test__fixunstfti(0.5, 0)) return 1; if (test__fixunstfti(0.99, 0)) return 1; if (test__fixunstfti(1.0, 1)) return 1; if (test__fixunstfti(1.5, 1)) return 1; if (test__fixunstfti(1.99, 1)) return 1; if (test__fixunstfti(2.0, 2)) return 1; if (test__fixunstfti(2.01, 2)) return 1; if (test__fixunstfti(-0.01, 0)) return 1; if (test__fixunstfti(-0.99, 0)) return 1; if (test__fixunstfti(0x1.p+128, make_ti(0xffffffffffffffffLL, 0xffffffffffffffffLL))) return 1; if (test__fixunstfti(0x1.FFFFFEp+126, make_ti(0x7fffff8000000000LL, 0x0))) return 1; if (test__fixunstfti(0x1.FFFFFEp+127, make_ti(0xffffff0000000000LL, 0x0))) return 1; if (test__fixunstfti(0x1.FFFFFEp+128, make_ti(0xffffffffffffffffLL, 0xffffffffffffffffLL))) return 1; if (test__fixunstfti(0x1.FFFFFEp+129, make_ti(0xffffffffffffffffLL, 0xffffffffffffffffLL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixtfsi_test.c0000664000175000017500000000320312616720672027616 0ustar mwhudsonmwhudson//===--------------- fixtfsi_test.c - Test __fixtfsi ----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixtfsi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __fixtfsi(long double a); int test__fixtfsi(long double a, int expected) { int x = __fixtfsi(a); int ret = (x != expected); if (ret){ printf("error in test__fixtfsi(%.20Lf) = %d, " "expected %d\n", a, x, expected); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__fixtfsi(makeInf128(), 0x7fffffff)) return 1; if (test__fixtfsi(0, 0x0)) return 1; if (test__fixtfsi(0x1.23456789abcdefp+5, 0x24)) return 1; if (test__fixtfsi(0x1.23456789abcdefp-3, 0x0)) return 1; if (test__fixtfsi(0x1.23456789abcdefp+20, 0x123456)) return 1; if (test__fixtfsi(0x1.23456789abcdefp+40, 0x7fffffff)) return 1; if (test__fixtfsi(0x1.23456789abcdefp+256, 0x7fffffff)) return 1; if (test__fixtfsi(-0x1.23456789abcdefp+20, 0xffedcbaa)) return 1; if (test__fixtfsi(-0x1.23456789abcdefp+40, 0x80000000)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/bswapsi2_test.c0000664000175000017500000000213211570537001027662 0ustar mwhudsonmwhudson//===-- bswapsi2_test.c - Test __bswapsi2 ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __bswapsi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern uint32_t __bswapsi2(uint32_t); #if __arm__ int test__bswapsi2(uint32_t a, uint32_t expected) { uint32_t actual = __bswapsi2(a); if (actual != expected) printf("error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__bswapsi2(0x12345678, 0x78563412)) return 1; if (test__bswapsi2(0x00000001, 0x01000000)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negsf2vfp_test.c0000664000175000017500000000224612516462465030052 0ustar mwhudsonmwhudson//===-- negsf2vfp_test.c - Test __negsf2vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negsf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __negsf2vfp(float a); #if __arm__ int test__negsf2vfp(float a) { float actual = __negsf2vfp(a); float expected = -a; if (actual != expected) printf("error in test__negsf2vfp(%f) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__negsf2vfp(1.0)) return 1; if (test__negsf2vfp(HUGE_VALF)) return 1; if (test__negsf2vfp(0.0)) return 1; if (test__negsf2vfp(-1.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/udivmoddi4_test.c0000664000175000017500000730717412516462465030241 0ustar mwhudsonmwhudson//===-- udivmoddi4_test.c - Test __udivmoddi4 -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __udivmoddi4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Effects: if rem != 0, *rem = a % b // Returns: a / b COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem); int test__udivmoddi4(du_int a, du_int b, du_int expected_q, du_int expected_r) { du_int r; du_int q = __udivmoddi4(a, b, &r); if (q != expected_q || r != expected_r) printf("error in __udivmoddi4: %llX / %llX = %llX, R = %llX, expected %llX, %llX\n", a, b, q, r, expected_q, expected_r); return !(q == expected_q && r == expected_r); } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; du_int tests[][4] = { {0x0000000000000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000000uLL}, {0x0000000000000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000000000001uLL, 0x0000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000001uLL}, {0x0000000000000002uLL, 0x0000000000000001uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x0000000000000002uLL, 0x0000000000000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000000000002uLL, 0x0000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000002uLL}, {0x0000000000000003uLL, 0x0000000000000001uLL, 0x0000000000000003uLL, 0x0000000000000000uLL}, {0x0000000000000003uLL, 0x0000000000000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000000000003uLL, 0x0000000000000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000000000003uLL, 0x0000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000003uLL}, {0x0000000000000010uLL, 0x0000000000000001uLL, 0x0000000000000010uLL, 0x0000000000000000uLL}, {0x0000000000000010uLL, 0x0000000000000002uLL, 0x0000000000000008uLL, 0x0000000000000000uLL}, {0x0000000000000010uLL, 0x0000000000000003uLL, 0x0000000000000005uLL, 0x0000000000000001uLL}, {0x0000000000000010uLL, 0x0000000000000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000000000010uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x0000000000000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000000000010uLL}, {0x00000000078644FAuLL, 0x0000000000000001uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL}, {0x00000000078644FAuLL, 0x0000000000000002uLL, 0x0000000003C3227DuLL, 0x0000000000000000uLL}, {0x00000000078644FAuLL, 0x0000000000000003uLL, 0x00000000028216FEuLL, 0x0000000000000000uLL}, {0x00000000078644FAuLL, 0x0000000000000010uLL, 0x000000000078644FuLL, 0x000000000000000AuLL}, {0x00000000078644FAuLL, 0x00000000078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000000078644FAuLL, 0x000000000747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x00000000078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x00000000078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000078644FAuLL}, {0x000000000747AE14uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL}, {0x000000000747AE14uLL, 0x0000000000000002uLL, 0x0000000003A3D70AuLL, 0x0000000000000000uLL}, {0x000000000747AE14uLL, 0x0000000000000003uLL, 0x00000000026D3A06uLL, 0x0000000000000002uLL}, {0x000000000747AE14uLL, 0x0000000000000010uLL, 0x0000000000747AE1uLL, 0x0000000000000004uLL}, {0x000000000747AE14uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000000747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000000747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000000747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000000747AE14uLL}, {0x000000007FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x000000003FFFFFFFuLL, 0x0000000000000001uLL}, {0x000000007FFFFFFFuLL, 0x0000000000000003uLL, 0x000000002AAAAAAAuLL, 0x0000000000000001uLL}, {0x000000007FFFFFFFuLL, 0x0000000000000010uLL, 0x0000000007FFFFFFuLL, 0x000000000000000FuLL}, {0x000000007FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000011uLL, 0x0000000000156B65uLL}, {0x000000007FFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000011uLL, 0x00000000043D70ABuLL}, {0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000007FFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x000000007FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000007FFFFFFFuLL}, {0x0000000080000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x0000000080000000uLL, 0x0000000000000002uLL, 0x0000000040000000uLL, 0x0000000000000000uLL}, {0x0000000080000000uLL, 0x0000000000000003uLL, 0x000000002AAAAAAAuLL, 0x0000000000000002uLL}, {0x0000000080000000uLL, 0x0000000000000010uLL, 0x0000000008000000uLL, 0x0000000000000000uLL}, {0x0000000080000000uLL, 0x00000000078644FAuLL, 0x0000000000000011uLL, 0x0000000000156B66uLL}, {0x0000000080000000uLL, 0x000000000747AE14uLL, 0x0000000000000011uLL, 0x00000000043D70ACuLL}, {0x0000000080000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000080000000uLL, 0x0000000080000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000080000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x0000000080000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000080000000uLL}, {0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000001uLL}, {0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000055555554uLL, 0x0000000000000001uLL}, {0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000000FFFFFFFuLL, 0x000000000000000DuLL}, {0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6C9uLL}, {0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333341uLL}, {0x00000000FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFDuLL}, {0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000055555554uLL, 0x0000000000000002uLL}, {0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000000FFFFFFFuLL, 0x000000000000000EuLL}, {0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6CAuLL}, {0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333342uLL}, {0x00000000FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFEuLL}, {0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000055555555uLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000000FFFFFFFuLL, 0x000000000000000FuLL}, {0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6CBuLL}, {0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333343uLL}, {0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x00000000FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000000FFFFFFFFuLL}, {0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000055555555uLL, 0x0000000000000001uLL}, {0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000010000000uLL, 0x0000000000000000uLL}, {0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6CCuLL}, {0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333344uLL}, {0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000100000000uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000100000000uLL, 0x0000000100000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000000uLL}, {0x0000000100000001uLL, 0x0000000000000001uLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x0000000100000001uLL, 0x0000000000000002uLL, 0x0000000080000000uLL, 0x0000000000000001uLL}, {0x0000000100000001uLL, 0x0000000000000003uLL, 0x0000000055555555uLL, 0x0000000000000002uLL}, {0x0000000100000001uLL, 0x0000000000000010uLL, 0x0000000010000000uLL, 0x0000000000000001uLL}, {0x0000000100000001uLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6CDuLL}, {0x0000000100000001uLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333345uLL}, {0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x0000000100000001uLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000100000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000100000001uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000100000001uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000100000001uLL, 0x0000000100000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000001uLL}, {0x0000000100000002uLL, 0x0000000000000001uLL, 0x0000000100000002uLL, 0x0000000000000000uLL}, {0x0000000100000002uLL, 0x0000000000000002uLL, 0x0000000080000001uLL, 0x0000000000000000uLL}, {0x0000000100000002uLL, 0x0000000000000003uLL, 0x0000000055555556uLL, 0x0000000000000000uLL}, {0x0000000100000002uLL, 0x0000000000000010uLL, 0x0000000010000000uLL, 0x0000000000000002uLL}, {0x0000000100000002uLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6CEuLL}, {0x0000000100000002uLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333346uLL}, {0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0x0000000100000002uLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x0000000100000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000100000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000100000002uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000100000002uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000100000002uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000100000002uLL, 0x0000000100000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000002uLL}, {0x0000000100000003uLL, 0x0000000000000001uLL, 0x0000000100000003uLL, 0x0000000000000000uLL}, {0x0000000100000003uLL, 0x0000000000000002uLL, 0x0000000080000001uLL, 0x0000000000000001uLL}, {0x0000000100000003uLL, 0x0000000000000003uLL, 0x0000000055555556uLL, 0x0000000000000001uLL}, {0x0000000100000003uLL, 0x0000000000000010uLL, 0x0000000010000000uLL, 0x0000000000000003uLL}, {0x0000000100000003uLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6CFuLL}, {0x0000000100000003uLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333347uLL}, {0x0000000100000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0x0000000100000003uLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x0000000100000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000006uLL}, {0x0000000100000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x0000000100000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000100000003uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000100000003uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000100000003uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000100000003uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000100000003uLL, 0x0000000100000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000003uLL}, {0x0000000100000010uLL, 0x0000000000000001uLL, 0x0000000100000010uLL, 0x0000000000000000uLL}, {0x0000000100000010uLL, 0x0000000000000002uLL, 0x0000000080000008uLL, 0x0000000000000000uLL}, {0x0000000100000010uLL, 0x0000000000000003uLL, 0x000000005555555AuLL, 0x0000000000000002uLL}, {0x0000000100000010uLL, 0x0000000000000010uLL, 0x0000000010000001uLL, 0x0000000000000000uLL}, {0x0000000100000010uLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000002AD6DCuLL}, {0x0000000100000010uLL, 0x000000000747AE14uLL, 0x0000000000000023uLL, 0x0000000001333354uLL}, {0x0000000100000010uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000012uLL}, {0x0000000100000010uLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x0000000000000010uLL}, {0x0000000100000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000013uLL}, {0x0000000100000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000012uLL}, {0x0000000100000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000011uLL}, {0x0000000100000010uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x0000000100000010uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x0000000100000010uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x0000000100000010uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x0000000100000010uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000100000010uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x0000000100000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000100000010uLL}, {0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL}, {0x00000001078644FAuLL, 0x0000000000000002uLL, 0x0000000083C3227DuLL, 0x0000000000000000uLL}, {0x00000001078644FAuLL, 0x0000000000000003uLL, 0x0000000057D76C53uLL, 0x0000000000000001uLL}, {0x00000001078644FAuLL, 0x0000000000000010uLL, 0x000000001078644FuLL, 0x000000000000000AuLL}, {0x00000001078644FAuLL, 0x00000000078644FAuLL, 0x0000000000000023uLL, 0x00000000002AD6CCuLL}, {0x00000001078644FAuLL, 0x000000000747AE14uLL, 0x0000000000000024uLL, 0x000000000171CA2AuLL}, {0x00000001078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x00000000078644FCuLL}, {0x00000001078644FAuLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x00000000078644FAuLL}, {0x00000001078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000078644FDuLL}, {0x00000001078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000078644FCuLL}, {0x00000001078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000078644FBuLL}, {0x00000001078644FAuLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x00000001078644FAuLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x00000001078644FAuLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x00000001078644FAuLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x00000001078644FAuLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x00000001078644FAuLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000001078644FAuLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x00000001078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x00000001078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001078644FAuLL}, {0x000000010747AE14uLL, 0x0000000000000001uLL, 0x000000010747AE14uLL, 0x0000000000000000uLL}, {0x000000010747AE14uLL, 0x0000000000000002uLL, 0x0000000083A3D70AuLL, 0x0000000000000000uLL}, {0x000000010747AE14uLL, 0x0000000000000003uLL, 0x0000000057C28F5CuLL, 0x0000000000000000uLL}, {0x000000010747AE14uLL, 0x0000000000000010uLL, 0x0000000010747AE1uLL, 0x0000000000000004uLL}, {0x000000010747AE14uLL, 0x00000000078644FAuLL, 0x0000000000000022uLL, 0x00000000077284E0uLL}, {0x000000010747AE14uLL, 0x000000000747AE14uLL, 0x0000000000000024uLL, 0x0000000001333344uLL}, {0x000000010747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL, 0x000000000747AE16uLL}, {0x000000010747AE14uLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x000000000747AE14uLL}, {0x000000010747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x000000000747AE17uLL}, {0x000000010747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x000000000747AE16uLL}, {0x000000010747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x000000000747AE15uLL}, {0x000000010747AE14uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x000000010747AE14uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x000000010747AE14uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x000000010747AE14uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x000000010747AE14uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x000000010747AE14uLL, 0x00000001078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000010747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000010747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000010747AE14uLL}, {0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL}, {0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x00000000BFFFFFFFuLL, 0x0000000000000001uLL}, {0x000000017FFFFFFFuLL, 0x0000000000000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0x000000017FFFFFFFuLL, 0x0000000000000010uLL, 0x0000000017FFFFFFuLL, 0x000000000000000FuLL}, {0x000000017FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000033uLL, 0x0000000000404231uLL}, {0x000000017FFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000034uLL, 0x000000000570A3EFuLL}, {0x000000017FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000002uLL}, {0x000000017FFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x000000017FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x000000017FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x000000017FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x000000017FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x000000017FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x000000017FFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x000000017FFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x000000017FFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x000000017FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000017FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x000000017FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000017FFFFFFFuLL}, {0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000180000000uLL, 0x0000000000000000uLL}, {0x0000000180000000uLL, 0x0000000000000002uLL, 0x00000000C0000000uLL, 0x0000000000000000uLL}, {0x0000000180000000uLL, 0x0000000000000003uLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x0000000180000000uLL, 0x0000000000000010uLL, 0x0000000018000000uLL, 0x0000000000000000uLL}, {0x0000000180000000uLL, 0x00000000078644FAuLL, 0x0000000000000033uLL, 0x0000000000404232uLL}, {0x0000000180000000uLL, 0x000000000747AE14uLL, 0x0000000000000034uLL, 0x000000000570A3F0uLL}, {0x0000000180000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000003uLL}, {0x0000000180000000uLL, 0x0000000080000000uLL, 0x0000000000000003uLL, 0x0000000000000000uLL}, {0x0000000180000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000180000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000180000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000180000000uLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0000000180000000uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0000000180000000uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0000000180000000uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0000000180000000uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x0000000180000000uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x0000000180000000uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x0000000180000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000180000000uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000180000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x0000000180000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000180000000uLL}, {0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFDuLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFDuLL, 0x0000000000000003uLL, 0x00000000AAAAAAA9uLL, 0x0000000000000002uLL}, {0x00000001FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000001FFFFFFFuLL, 0x000000000000000DuLL}, {0x00000001FFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD95uLL}, {0x00000001FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x0000000002666685uLL}, {0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000000000003uLL, 0x000000007FFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x00000001FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000001FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000001FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000001FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x00000001FFFFFFFDuLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x00000001FFFFFFFDuLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x00000001FFFFFFFDuLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x00000001FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000001FFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFDuLL}, {0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFEuLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFEuLL, 0x0000000000000003uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000001FFFFFFFuLL, 0x000000000000000EuLL}, {0x00000001FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD96uLL}, {0x00000001FFFFFFFEuLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x0000000002666686uLL}, {0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000002uLL}, {0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000003uLL, 0x000000007FFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0x00000001FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x00000001FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000001FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000001FFFFFFFEuLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000001FFFFFFFEuLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x00000001FFFFFFFEuLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x00000001FFFFFFFEuLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x00000001FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000001FFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFEuLL}, {0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFFuLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFFuLL, 0x0000000000000003uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000001FFFFFFFuLL, 0x000000000000000FuLL}, {0x00000001FFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD97uLL}, {0x00000001FFFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x0000000002666687uLL}, {0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000003uLL}, {0x00000001FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000003uLL, 0x000000007FFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0x00000001FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x00000001FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000001FFFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000001FFFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000001FFFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x00000001FFFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x00000001FFFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x00000001FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x00000001FFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x00000001FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000001FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000001FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x00000001FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000001FFFFFFFFuLL}, {0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000200000000uLL, 0x0000000000000000uLL}, {0x0000000200000000uLL, 0x0000000000000002uLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x0000000200000000uLL, 0x0000000000000003uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000002uLL}, {0x0000000200000000uLL, 0x0000000000000010uLL, 0x0000000020000000uLL, 0x0000000000000000uLL}, {0x0000000200000000uLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD98uLL}, {0x0000000200000000uLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x0000000002666688uLL}, {0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000004uLL}, {0x0000000200000000uLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x0000000000000000uLL}, {0x0000000200000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000006uLL}, {0x0000000200000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0x0000000200000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x0000000200000000uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x0000000200000000uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0000000200000000uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x0000000200000000uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x0000000200000000uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF0uLL}, {0x0000000200000000uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB06uLL}, {0x0000000200000000uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851ECuLL}, {0x0000000200000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000200000000uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0000000200000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000200000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000200000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000200000000uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000200000000uLL, 0x0000000200000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000000uLL}, {0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000200000001uLL, 0x0000000000000000uLL}, {0x0000000200000001uLL, 0x0000000000000002uLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x0000000200000001uLL, 0x0000000000000003uLL, 0x00000000AAAAAAABuLL, 0x0000000000000000uLL}, {0x0000000200000001uLL, 0x0000000000000010uLL, 0x0000000020000000uLL, 0x0000000000000001uLL}, {0x0000000200000001uLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD99uLL}, {0x0000000200000001uLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x0000000002666689uLL}, {0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000005uLL}, {0x0000000200000001uLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x0000000000000001uLL}, {0x0000000200000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000007uLL}, {0x0000000200000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0x0000000200000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x0000000200000001uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x0000000200000001uLL, 0x0000000100000001uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000200000001uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0000000200000001uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x0000000200000001uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF1uLL}, {0x0000000200000001uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB07uLL}, {0x0000000200000001uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EDuLL}, {0x0000000200000001uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000200000001uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000200000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000200000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000200000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000200000001uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000200000001uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000200000001uLL, 0x0000000200000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000001uLL}, {0x0000000200000002uLL, 0x0000000000000001uLL, 0x0000000200000002uLL, 0x0000000000000000uLL}, {0x0000000200000002uLL, 0x0000000000000002uLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x0000000200000002uLL, 0x0000000000000003uLL, 0x00000000AAAAAAABuLL, 0x0000000000000001uLL}, {0x0000000200000002uLL, 0x0000000000000010uLL, 0x0000000020000000uLL, 0x0000000000000002uLL}, {0x0000000200000002uLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD9AuLL}, {0x0000000200000002uLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x000000000266668AuLL}, {0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000006uLL}, {0x0000000200000002uLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x0000000000000002uLL}, {0x0000000200000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000008uLL}, {0x0000000200000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000006uLL}, {0x0000000200000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0x0000000200000002uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x0000000200000002uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x0000000200000002uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000200000002uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0000000200000002uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF2uLL}, {0x0000000200000002uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB08uLL}, {0x0000000200000002uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EEuLL}, {0x0000000200000002uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000200000002uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000200000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x0000000200000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000200000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000200000002uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000200000002uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000200000002uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000200000002uLL, 0x0000000200000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000002uLL}, {0x0000000200000003uLL, 0x0000000000000001uLL, 0x0000000200000003uLL, 0x0000000000000000uLL}, {0x0000000200000003uLL, 0x0000000000000002uLL, 0x0000000100000001uLL, 0x0000000000000001uLL}, {0x0000000200000003uLL, 0x0000000000000003uLL, 0x00000000AAAAAAABuLL, 0x0000000000000002uLL}, {0x0000000200000003uLL, 0x0000000000000010uLL, 0x0000000020000000uLL, 0x0000000000000003uLL}, {0x0000000200000003uLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055AD9BuLL}, {0x0000000200000003uLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x000000000266668BuLL}, {0x0000000200000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000007uLL}, {0x0000000200000003uLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x0000000000000003uLL}, {0x0000000200000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000009uLL}, {0x0000000200000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000007uLL}, {0x0000000200000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0x0000000200000003uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x0000000200000003uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x0000000200000003uLL, 0x0000000100000002uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000200000003uLL, 0x0000000100000003uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000200000003uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF3uLL}, {0x0000000200000003uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB09uLL}, {0x0000000200000003uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EFuLL}, {0x0000000200000003uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000004uLL}, {0x0000000200000003uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000200000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000006uLL}, {0x0000000200000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x0000000200000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000200000003uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000200000003uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000200000003uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000200000003uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000200000003uLL, 0x0000000200000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000003uLL}, {0x0000000200000010uLL, 0x0000000000000001uLL, 0x0000000200000010uLL, 0x0000000000000000uLL}, {0x0000000200000010uLL, 0x0000000000000002uLL, 0x0000000100000008uLL, 0x0000000000000000uLL}, {0x0000000200000010uLL, 0x0000000000000003uLL, 0x00000000AAAAAAB0uLL, 0x0000000000000000uLL}, {0x0000000200000010uLL, 0x0000000000000010uLL, 0x0000000020000001uLL, 0x0000000000000000uLL}, {0x0000000200000010uLL, 0x00000000078644FAuLL, 0x0000000000000044uLL, 0x000000000055ADA8uLL}, {0x0000000200000010uLL, 0x000000000747AE14uLL, 0x0000000000000046uLL, 0x0000000002666698uLL}, {0x0000000200000010uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000014uLL}, {0x0000000200000010uLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x0000000000000010uLL}, {0x0000000200000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000016uLL}, {0x0000000200000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000014uLL}, {0x0000000200000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000012uLL}, {0x0000000200000010uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000000000010uLL}, {0x0000000200000010uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x000000000000000EuLL}, {0x0000000200000010uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x000000000000000CuLL}, {0x0000000200000010uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x000000000000000AuLL}, {0x0000000200000010uLL, 0x0000000100000010uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000200000010uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB16uLL}, {0x0000000200000010uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851FCuLL}, {0x0000000200000010uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000011uLL}, {0x0000000200000010uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000080000010uLL}, {0x0000000200000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000013uLL}, {0x0000000200000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000012uLL}, {0x0000000200000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000011uLL}, {0x0000000200000010uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x0000000200000010uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x0000000200000010uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x0000000200000010uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x0000000200000010uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000200000010uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x0000000200000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000200000010uLL}, {0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL}, {0x00000002078644FAuLL, 0x0000000000000002uLL, 0x0000000103C3227DuLL, 0x0000000000000000uLL}, {0x00000002078644FAuLL, 0x0000000000000003uLL, 0x00000000AD2CC1A8uLL, 0x0000000000000002uLL}, {0x00000002078644FAuLL, 0x0000000000000010uLL, 0x000000002078644FuLL, 0x000000000000000AuLL}, {0x00000002078644FAuLL, 0x00000000078644FAuLL, 0x0000000000000045uLL, 0x000000000055AD98uLL}, {0x00000002078644FAuLL, 0x000000000747AE14uLL, 0x0000000000000047uLL, 0x0000000002A4FD6EuLL}, {0x00000002078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x00000000078644FEuLL}, {0x00000002078644FAuLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x00000000078644FAuLL}, {0x00000002078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000007864500uLL}, {0x00000002078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x00000000078644FEuLL}, {0x00000002078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x00000000078644FCuLL}, {0x00000002078644FAuLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x00000000078644FAuLL}, {0x00000002078644FAuLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x00000000078644F8uLL}, {0x00000002078644FAuLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000078644F6uLL}, {0x00000002078644FAuLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000078644F4uLL}, {0x00000002078644FAuLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000078644DAuLL}, {0x00000002078644FAuLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000002078644FAuLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x00000001003E96E6uLL}, {0x00000002078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x00000000878644FBuLL}, {0x00000002078644FAuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x00000000878644FAuLL}, {0x00000002078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000078644FDuLL}, {0x00000002078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000078644FCuLL}, {0x00000002078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000078644FBuLL}, {0x00000002078644FAuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x00000002078644FAuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x00000002078644FAuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x00000002078644FAuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x00000002078644FAuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x00000002078644FAuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000002078644FAuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x00000002078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x00000002078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002078644FAuLL}, {0x000000020747AE14uLL, 0x0000000000000001uLL, 0x000000020747AE14uLL, 0x0000000000000000uLL}, {0x000000020747AE14uLL, 0x0000000000000002uLL, 0x0000000103A3D70AuLL, 0x0000000000000000uLL}, {0x000000020747AE14uLL, 0x0000000000000003uLL, 0x00000000AD17E4B1uLL, 0x0000000000000001uLL}, {0x000000020747AE14uLL, 0x0000000000000010uLL, 0x0000000020747AE1uLL, 0x0000000000000004uLL}, {0x000000020747AE14uLL, 0x00000000078644FAuLL, 0x0000000000000045uLL, 0x00000000001716B2uLL}, {0x000000020747AE14uLL, 0x000000000747AE14uLL, 0x0000000000000047uLL, 0x0000000002666688uLL}, {0x000000020747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL, 0x000000000747AE18uLL}, {0x000000020747AE14uLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x000000000747AE14uLL}, {0x000000020747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x000000000747AE1AuLL}, {0x000000020747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x000000000747AE18uLL}, {0x000000020747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x000000000747AE16uLL}, {0x000000020747AE14uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x000000000747AE14uLL}, {0x000000020747AE14uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x000000000747AE12uLL}, {0x000000020747AE14uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x000000000747AE10uLL}, {0x000000020747AE14uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x000000000747AE0EuLL}, {0x000000020747AE14uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x000000000747ADF4uLL}, {0x000000020747AE14uLL, 0x00000001078644FAuLL, 0x0000000000000001uLL, 0x00000000FFC1691AuLL}, {0x000000020747AE14uLL, 0x000000010747AE14uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x000000020747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x000000008747AE15uLL}, {0x000000020747AE14uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000008747AE14uLL}, {0x000000020747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x000000000747AE17uLL}, {0x000000020747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x000000000747AE16uLL}, {0x000000020747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x000000000747AE15uLL}, {0x000000020747AE14uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x000000020747AE14uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x000000020747AE14uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x000000020747AE14uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x000000020747AE14uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x000000020747AE14uLL, 0x00000002078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000020747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000020747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000020747AE14uLL}, {0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x000000027FFFFFFFuLL, 0x0000000000000000uLL}, {0x000000027FFFFFFFuLL, 0x0000000000000002uLL, 0x000000013FFFFFFFuLL, 0x0000000000000001uLL}, {0x000000027FFFFFFFuLL, 0x0000000000000003uLL, 0x00000000D5555555uLL, 0x0000000000000000uLL}, {0x000000027FFFFFFFuLL, 0x0000000000000010uLL, 0x0000000027FFFFFFuLL, 0x000000000000000FuLL}, {0x000000027FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000055uLL, 0x00000000006B18FDuLL}, {0x000000027FFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000057uLL, 0x0000000006A3D733uLL}, {0x000000027FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000005uLL, 0x0000000000000004uLL}, {0x000000027FFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000004uLL, 0x000000007FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000080000005uLL}, {0x000000027FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000080000003uLL}, {0x000000027FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000080000001uLL}, {0x000000027FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x000000007FFFFFFDuLL}, {0x000000027FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x000000007FFFFFFBuLL}, {0x000000027FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x000000007FFFFFF9uLL}, {0x000000027FFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x000000007FFFFFDFuLL}, {0x000000027FFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x0000000070F3760BuLL}, {0x000000027FFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x000000007170A3D7uLL}, {0x000000027FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x000000027FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x000000027FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x000000027FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x000000027FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x000000027FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x000000027FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x000000027FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x000000027FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x000000027FFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x000000027FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000027FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x000000027FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000027FFFFFFFuLL}, {0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000280000000uLL, 0x0000000000000000uLL}, {0x0000000280000000uLL, 0x0000000000000002uLL, 0x0000000140000000uLL, 0x0000000000000000uLL}, {0x0000000280000000uLL, 0x0000000000000003uLL, 0x00000000D5555555uLL, 0x0000000000000001uLL}, {0x0000000280000000uLL, 0x0000000000000010uLL, 0x0000000028000000uLL, 0x0000000000000000uLL}, {0x0000000280000000uLL, 0x00000000078644FAuLL, 0x0000000000000055uLL, 0x00000000006B18FEuLL}, {0x0000000280000000uLL, 0x000000000747AE14uLL, 0x0000000000000057uLL, 0x0000000006A3D734uLL}, {0x0000000280000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000005uLL, 0x0000000000000005uLL}, {0x0000000280000000uLL, 0x0000000080000000uLL, 0x0000000000000005uLL, 0x0000000000000000uLL}, {0x0000000280000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000080000006uLL}, {0x0000000280000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000080000004uLL}, {0x0000000280000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000080000002uLL}, {0x0000000280000000uLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x0000000080000000uLL}, {0x0000000280000000uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x000000007FFFFFFEuLL}, {0x0000000280000000uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x000000007FFFFFFCuLL}, {0x0000000280000000uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x000000007FFFFFFAuLL}, {0x0000000280000000uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x000000007FFFFFE0uLL}, {0x0000000280000000uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x0000000070F3760CuLL}, {0x0000000280000000uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x000000007170A3D8uLL}, {0x0000000280000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000280000000uLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000280000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000280000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000280000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000280000000uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0000000280000000uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0000000280000000uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0000000280000000uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0000000280000000uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x0000000280000000uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x0000000280000000uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x0000000280000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000280000000uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000280000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x0000000280000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000280000000uLL}, {0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFDuLL, 0x0000000000000002uLL, 0x000000017FFFFFFEuLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFDuLL, 0x0000000000000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000002FFFFFFFuLL, 0x000000000000000DuLL}, {0x00000002FFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808461uLL}, {0x00000002FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999C9uLL}, {0x00000002FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000003uLL}, {0x00000002FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000000000005uLL, 0x000000007FFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000000000006uLL}, {0x00000002FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000003uLL}, {0x00000002FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFBuLL}, {0x00000002FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF9uLL}, {0x00000002FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF7uLL}, {0x00000002FFFFFFFDuLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFDDuLL}, {0x00000002FFFFFFFDuLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F37609uLL}, {0x00000002FFFFFFFDuLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D5uLL}, {0x00000002FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x00000002FFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000002FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000002FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000002FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000002FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000002FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x00000002FFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x00000002FFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x00000002FFFFFFFDuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x00000002FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000002FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFDuLL}, {0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFEuLL, 0x0000000000000002uLL, 0x000000017FFFFFFFuLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFEuLL, 0x0000000000000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000002FFFFFFFuLL, 0x000000000000000EuLL}, {0x00000002FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808462uLL}, {0x00000002FFFFFFFEuLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999CAuLL}, {0x00000002FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000004uLL}, {0x00000002FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000005uLL, 0x000000007FFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000000000007uLL}, {0x00000002FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000004uLL}, {0x00000002FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFCuLL}, {0x00000002FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFAuLL}, {0x00000002FFFFFFFEuLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF8uLL}, {0x00000002FFFFFFFEuLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFDEuLL}, {0x00000002FFFFFFFEuLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760AuLL}, {0x00000002FFFFFFFEuLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D6uLL}, {0x00000002FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x00000002FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000002FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000002FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000002FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000002FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000002FFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x00000002FFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x00000002FFFFFFFEuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x00000002FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000002FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFEuLL}, {0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFFuLL, 0x0000000000000002uLL, 0x000000017FFFFFFFuLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFFuLL, 0x0000000000000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL}, {0x00000002FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000002FFFFFFFuLL, 0x000000000000000FuLL}, {0x00000002FFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808463uLL}, {0x00000002FFFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999CBuLL}, {0x00000002FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000005uLL}, {0x00000002FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000005uLL, 0x000000007FFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000000000008uLL}, {0x00000002FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000005uLL}, {0x00000002FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000002uLL}, {0x00000002FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0x00000002FFFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFBuLL}, {0x00000002FFFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF9uLL}, {0x00000002FFFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFDFuLL}, {0x00000002FFFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760BuLL}, {0x00000002FFFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D7uLL}, {0x00000002FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x00000002FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x00000002FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000002FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000002FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000002FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000002FFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x00000002FFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x00000002FFFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x00000002FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x00000002FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x00000002FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000002FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000002FFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x00000002FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000002FFFFFFFFuLL}, {0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000300000000uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x0000000000000002uLL, 0x0000000180000000uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x0000000000000003uLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x0000000000000010uLL, 0x0000000030000000uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808464uLL}, {0x0000000300000000uLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999CCuLL}, {0x0000000300000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000006uLL}, {0x0000000300000000uLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000000000009uLL}, {0x0000000300000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000006uLL}, {0x0000000300000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000003uLL}, {0x0000000300000000uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0x0000000300000000uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFCuLL}, {0x0000000300000000uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFAuLL}, {0x0000000300000000uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE0uLL}, {0x0000000300000000uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760CuLL}, {0x0000000300000000uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D8uLL}, {0x0000000300000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x0000000300000000uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0x0000000300000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x0000000300000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000300000000uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000300000000uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0000000300000000uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x0000000300000000uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x0000000300000000uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF0uLL}, {0x0000000300000000uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB06uLL}, {0x0000000300000000uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851ECuLL}, {0x0000000300000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000300000000uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0000000300000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000300000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000300000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000300000000uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000300000000uLL, 0x0000000300000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000000uLL}, {0x0000000300000001uLL, 0x0000000000000001uLL, 0x0000000300000001uLL, 0x0000000000000000uLL}, {0x0000000300000001uLL, 0x0000000000000002uLL, 0x0000000180000000uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x0000000000000003uLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x0000000000000010uLL, 0x0000000030000000uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808465uLL}, {0x0000000300000001uLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999CDuLL}, {0x0000000300000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000007uLL}, {0x0000000300000001uLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x000000000000000AuLL}, {0x0000000300000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000007uLL}, {0x0000000300000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000004uLL}, {0x0000000300000001uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0x0000000300000001uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0x0000000300000001uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFBuLL}, {0x0000000300000001uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE1uLL}, {0x0000000300000001uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760DuLL}, {0x0000000300000001uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D9uLL}, {0x0000000300000001uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x0000000300000001uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000004uLL}, {0x0000000300000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0x0000000300000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x0000000300000001uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000300000001uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000300000001uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0000000300000001uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x0000000300000001uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF1uLL}, {0x0000000300000001uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB07uLL}, {0x0000000300000001uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EDuLL}, {0x0000000300000001uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000300000001uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000300000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000300000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000300000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000300000001uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000300000001uLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000300000001uLL, 0x0000000300000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000001uLL}, {0x0000000300000002uLL, 0x0000000000000001uLL, 0x0000000300000002uLL, 0x0000000000000000uLL}, {0x0000000300000002uLL, 0x0000000000000002uLL, 0x0000000180000001uLL, 0x0000000000000000uLL}, {0x0000000300000002uLL, 0x0000000000000003uLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0x0000000300000002uLL, 0x0000000000000010uLL, 0x0000000030000000uLL, 0x0000000000000002uLL}, {0x0000000300000002uLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808466uLL}, {0x0000000300000002uLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999CEuLL}, {0x0000000300000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000008uLL}, {0x0000000300000002uLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x0000000000000002uLL}, {0x0000000300000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x000000000000000BuLL}, {0x0000000300000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000008uLL}, {0x0000000300000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000005uLL}, {0x0000000300000002uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000000000002uLL}, {0x0000000300000002uLL, 0x0000000100000001uLL, 0x0000000000000002uLL, 0x0000000100000000uLL}, {0x0000000300000002uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0x0000000300000002uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFCuLL}, {0x0000000300000002uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE2uLL}, {0x0000000300000002uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760EuLL}, {0x0000000300000002uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3DAuLL}, {0x0000000300000002uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0x0000000300000002uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x0000000300000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000005uLL}, {0x0000000300000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000004uLL}, {0x0000000300000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0x0000000300000002uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x0000000300000002uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000300000002uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000300000002uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0000000300000002uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF2uLL}, {0x0000000300000002uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB08uLL}, {0x0000000300000002uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EEuLL}, {0x0000000300000002uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000300000002uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000300000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x0000000300000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000300000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000300000002uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000300000002uLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000300000002uLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000300000002uLL, 0x0000000300000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000002uLL}, {0x0000000300000003uLL, 0x0000000000000001uLL, 0x0000000300000003uLL, 0x0000000000000000uLL}, {0x0000000300000003uLL, 0x0000000000000002uLL, 0x0000000180000001uLL, 0x0000000000000001uLL}, {0x0000000300000003uLL, 0x0000000000000003uLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x0000000300000003uLL, 0x0000000000000010uLL, 0x0000000030000000uLL, 0x0000000000000003uLL}, {0x0000000300000003uLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808467uLL}, {0x0000000300000003uLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999CFuLL}, {0x0000000300000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000009uLL}, {0x0000000300000003uLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x0000000000000003uLL}, {0x0000000300000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x000000000000000CuLL}, {0x0000000300000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000009uLL}, {0x0000000300000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000006uLL}, {0x0000000300000003uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000000000003uLL}, {0x0000000300000003uLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x0000000000000000uLL}, {0x0000000300000003uLL, 0x0000000100000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0x0000000300000003uLL, 0x0000000100000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0x0000000300000003uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE3uLL}, {0x0000000300000003uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760FuLL}, {0x0000000300000003uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3DBuLL}, {0x0000000300000003uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0x0000000300000003uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x0000000300000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000006uLL}, {0x0000000300000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000005uLL}, {0x0000000300000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000004uLL}, {0x0000000300000003uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0x0000000300000003uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x0000000300000003uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000300000003uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000300000003uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF3uLL}, {0x0000000300000003uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB09uLL}, {0x0000000300000003uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EFuLL}, {0x0000000300000003uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000004uLL}, {0x0000000300000003uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000300000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000006uLL}, {0x0000000300000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x0000000300000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x0000000300000003uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000000300000003uLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000000300000003uLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000300000003uLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000300000003uLL, 0x0000000300000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000003uLL}, {0x0000000300000010uLL, 0x0000000000000001uLL, 0x0000000300000010uLL, 0x0000000000000000uLL}, {0x0000000300000010uLL, 0x0000000000000002uLL, 0x0000000180000008uLL, 0x0000000000000000uLL}, {0x0000000300000010uLL, 0x0000000000000003uLL, 0x0000000100000005uLL, 0x0000000000000001uLL}, {0x0000000300000010uLL, 0x0000000000000010uLL, 0x0000000030000001uLL, 0x0000000000000000uLL}, {0x0000000300000010uLL, 0x00000000078644FAuLL, 0x0000000000000066uLL, 0x0000000000808474uLL}, {0x0000000300000010uLL, 0x000000000747AE14uLL, 0x0000000000000069uLL, 0x00000000039999DCuLL}, {0x0000000300000010uLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000000000016uLL}, {0x0000000300000010uLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x0000000000000010uLL}, {0x0000000300000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000000000019uLL}, {0x0000000300000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000000000016uLL}, {0x0000000300000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000000000013uLL}, {0x0000000300000010uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000000000010uLL}, {0x0000000300000010uLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x000000000000000DuLL}, {0x0000000300000010uLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x000000000000000AuLL}, {0x0000000300000010uLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x0000000000000007uLL}, {0x0000000300000010uLL, 0x0000000100000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF0uLL}, {0x0000000300000010uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3761CuLL}, {0x0000000300000010uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3E8uLL}, {0x0000000300000010uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000012uLL}, {0x0000000300000010uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x0000000000000010uLL}, {0x0000000300000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000013uLL}, {0x0000000300000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000012uLL}, {0x0000000300000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000011uLL}, {0x0000000300000010uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000100000010uLL}, {0x0000000300000010uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000010000000FuLL}, {0x0000000300000010uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000010000000EuLL}, {0x0000000300000010uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000010000000DuLL}, {0x0000000300000010uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000300000010uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB16uLL}, {0x0000000300000010uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851FCuLL}, {0x0000000300000010uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000011uLL}, {0x0000000300000010uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000080000010uLL}, {0x0000000300000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000013uLL}, {0x0000000300000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000012uLL}, {0x0000000300000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000011uLL}, {0x0000000300000010uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x0000000300000010uLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x0000000300000010uLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x0000000300000010uLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x0000000300000010uLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000300000010uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x0000000300000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000300000010uLL}, {0x00000003078644FAuLL, 0x0000000000000001uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL}, {0x00000003078644FAuLL, 0x0000000000000002uLL, 0x0000000183C3227DuLL, 0x0000000000000000uLL}, {0x00000003078644FAuLL, 0x0000000000000003uLL, 0x00000001028216FEuLL, 0x0000000000000000uLL}, {0x00000003078644FAuLL, 0x0000000000000010uLL, 0x000000003078644FuLL, 0x000000000000000AuLL}, {0x00000003078644FAuLL, 0x00000000078644FAuLL, 0x0000000000000067uLL, 0x0000000000808464uLL}, {0x00000003078644FAuLL, 0x000000000747AE14uLL, 0x000000000000006AuLL, 0x0000000003D830B2uLL}, {0x00000003078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000007864500uLL}, {0x00000003078644FAuLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x00000000078644FAuLL}, {0x00000003078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000007864503uLL}, {0x00000003078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000007864500uLL}, {0x00000003078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x00000000078644FDuLL}, {0x00000003078644FAuLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x00000000078644FAuLL}, {0x00000003078644FAuLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x00000000078644F7uLL}, {0x00000003078644FAuLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x00000000078644F4uLL}, {0x00000003078644FAuLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x00000000078644F1uLL}, {0x00000003078644FAuLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x00000000078644CAuLL}, {0x00000003078644FAuLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F879BB06uLL}, {0x00000003078644FAuLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F8F6E8D2uLL}, {0x00000003078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x00000000078644FCuLL}, {0x00000003078644FAuLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x00000000078644FAuLL}, {0x00000003078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000001078644FDuLL}, {0x00000003078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000001078644FCuLL}, {0x00000003078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000001078644FBuLL}, {0x00000003078644FAuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000001078644FAuLL}, {0x00000003078644FAuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000001078644F9uLL}, {0x00000003078644FAuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000001078644F8uLL}, {0x00000003078644FAuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000001078644F7uLL}, {0x00000003078644FAuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000001078644EAuLL}, {0x00000003078644FAuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000003078644FAuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000001003E96E6uLL}, {0x00000003078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x00000000878644FBuLL}, {0x00000003078644FAuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x00000000878644FAuLL}, {0x00000003078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000078644FDuLL}, {0x00000003078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000078644FCuLL}, {0x00000003078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000078644FBuLL}, {0x00000003078644FAuLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x00000003078644FAuLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x00000003078644FAuLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x00000003078644FAuLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x00000003078644FAuLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x00000003078644FAuLL, 0x00000003078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000003078644FAuLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x00000003078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x00000003078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003078644FAuLL}, {0x000000030747AE14uLL, 0x0000000000000001uLL, 0x000000030747AE14uLL, 0x0000000000000000uLL}, {0x000000030747AE14uLL, 0x0000000000000002uLL, 0x0000000183A3D70AuLL, 0x0000000000000000uLL}, {0x000000030747AE14uLL, 0x0000000000000003uLL, 0x00000001026D3A06uLL, 0x0000000000000002uLL}, {0x000000030747AE14uLL, 0x0000000000000010uLL, 0x0000000030747AE1uLL, 0x0000000000000004uLL}, {0x000000030747AE14uLL, 0x00000000078644FAuLL, 0x0000000000000067uLL, 0x000000000041ED7EuLL}, {0x000000030747AE14uLL, 0x000000000747AE14uLL, 0x000000000000006AuLL, 0x00000000039999CCuLL}, {0x000000030747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000000000006uLL, 0x000000000747AE1AuLL}, {0x000000030747AE14uLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x000000000747AE14uLL}, {0x000000030747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x000000000747AE1DuLL}, {0x000000030747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x000000000747AE1AuLL}, {0x000000030747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x000000000747AE17uLL}, {0x000000030747AE14uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x000000000747AE14uLL}, {0x000000030747AE14uLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x000000000747AE11uLL}, {0x000000030747AE14uLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x000000000747AE0EuLL}, {0x000000030747AE14uLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x000000000747AE0BuLL}, {0x000000030747AE14uLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x000000000747ADE4uLL}, {0x000000030747AE14uLL, 0x00000001078644FAuLL, 0x0000000000000002uLL, 0x00000000F83B2420uLL}, {0x000000030747AE14uLL, 0x000000010747AE14uLL, 0x0000000000000002uLL, 0x00000000F8B851ECuLL}, {0x000000030747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x000000000747AE16uLL}, {0x000000030747AE14uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x000000000747AE14uLL}, {0x000000030747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x000000010747AE17uLL}, {0x000000030747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x000000010747AE16uLL}, {0x000000030747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x000000010747AE15uLL}, {0x000000030747AE14uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x000000010747AE14uLL}, {0x000000030747AE14uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000010747AE13uLL}, {0x000000030747AE14uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000010747AE12uLL}, {0x000000030747AE14uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000010747AE11uLL}, {0x000000030747AE14uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x000000010747AE04uLL}, {0x000000030747AE14uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000000FFC1691AuLL}, {0x000000030747AE14uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x000000030747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x000000008747AE15uLL}, {0x000000030747AE14uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000008747AE14uLL}, {0x000000030747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x000000000747AE17uLL}, {0x000000030747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x000000000747AE16uLL}, {0x000000030747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x000000000747AE15uLL}, {0x000000030747AE14uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x000000030747AE14uLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x000000030747AE14uLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x000000030747AE14uLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x000000030747AE14uLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x000000030747AE14uLL, 0x00000003078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000030747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000030747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000030747AE14uLL}, {0x000000037FFFFFFFuLL, 0x0000000000000001uLL, 0x000000037FFFFFFFuLL, 0x0000000000000000uLL}, {0x000000037FFFFFFFuLL, 0x0000000000000002uLL, 0x00000001BFFFFFFFuLL, 0x0000000000000001uLL}, {0x000000037FFFFFFFuLL, 0x0000000000000003uLL, 0x000000012AAAAAAAuLL, 0x0000000000000001uLL}, {0x000000037FFFFFFFuLL, 0x0000000000000010uLL, 0x0000000037FFFFFFuLL, 0x000000000000000FuLL}, {0x000000037FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000077uLL, 0x000000000095EFC9uLL}, {0x000000037FFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000000007BuLL, 0x00000000008F5C63uLL}, {0x000000037FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000007uLL, 0x0000000000000006uLL}, {0x000000037FFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000006uLL, 0x000000007FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000080000008uLL}, {0x000000037FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000080000005uLL}, {0x000000037FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000080000002uLL}, {0x000000037FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x000000007FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x000000007FFFFFFCuLL}, {0x000000037FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x000000007FFFFFF9uLL}, {0x000000037FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x000000007FFFFFF6uLL}, {0x000000037FFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x000000007FFFFFCFuLL}, {0x000000037FFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000003uLL, 0x00000000696D3111uLL}, {0x000000037FFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000003uLL, 0x000000006A28F5C3uLL}, {0x000000037FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000080000001uLL}, {0x000000037FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000180000002uLL}, {0x000000037FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000180000001uLL}, {0x000000037FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0x000000037FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x000000037FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x000000037FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFCuLL}, {0x000000037FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFEFuLL}, {0x000000037FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB05uLL}, {0x000000037FFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851EBuLL}, {0x000000037FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x000000037FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x000000037FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x000000037FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x000000037FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x000000037FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x000000037FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x000000037FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x000000037FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x000000037FFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x000000037FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000037FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x000000037FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000037FFFFFFFuLL}, {0x0000000380000000uLL, 0x0000000000000001uLL, 0x0000000380000000uLL, 0x0000000000000000uLL}, {0x0000000380000000uLL, 0x0000000000000002uLL, 0x00000001C0000000uLL, 0x0000000000000000uLL}, {0x0000000380000000uLL, 0x0000000000000003uLL, 0x000000012AAAAAAAuLL, 0x0000000000000002uLL}, {0x0000000380000000uLL, 0x0000000000000010uLL, 0x0000000038000000uLL, 0x0000000000000000uLL}, {0x0000000380000000uLL, 0x00000000078644FAuLL, 0x0000000000000077uLL, 0x000000000095EFCAuLL}, {0x0000000380000000uLL, 0x000000000747AE14uLL, 0x000000000000007BuLL, 0x00000000008F5C64uLL}, {0x0000000380000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000007uLL, 0x0000000000000007uLL}, {0x0000000380000000uLL, 0x0000000080000000uLL, 0x0000000000000007uLL, 0x0000000000000000uLL}, {0x0000000380000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000080000009uLL}, {0x0000000380000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000080000006uLL}, {0x0000000380000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000080000003uLL}, {0x0000000380000000uLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x0000000080000000uLL}, {0x0000000380000000uLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x000000007FFFFFFDuLL}, {0x0000000380000000uLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x000000007FFFFFFAuLL}, {0x0000000380000000uLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x000000007FFFFFF7uLL}, {0x0000000380000000uLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x000000007FFFFFD0uLL}, {0x0000000380000000uLL, 0x00000001078644FAuLL, 0x0000000000000003uLL, 0x00000000696D3112uLL}, {0x0000000380000000uLL, 0x000000010747AE14uLL, 0x0000000000000003uLL, 0x000000006A28F5C4uLL}, {0x0000000380000000uLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000080000002uLL}, {0x0000000380000000uLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x0000000080000000uLL}, {0x0000000380000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000180000003uLL}, {0x0000000380000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000180000002uLL}, {0x0000000380000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000001uLL}, {0x0000000380000000uLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0x0000000380000000uLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x0000000380000000uLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x0000000380000000uLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x0000000380000000uLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFF0uLL}, {0x0000000380000000uLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB06uLL}, {0x0000000380000000uLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851ECuLL}, {0x0000000380000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x0000000380000000uLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x0000000380000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x0000000380000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x0000000380000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x0000000380000000uLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0000000380000000uLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0000000380000000uLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0000000380000000uLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0000000380000000uLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x0000000380000000uLL, 0x00000003078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x0000000380000000uLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x0000000380000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000000380000000uLL, 0x0000000380000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000000380000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x0000000380000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000000380000000uLL}, {0x00000003FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFDuLL, 0x0000000000000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFDuLL, 0x0000000000000003uLL, 0x0000000155555554uLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000003FFFFFFFuLL, 0x000000000000000DuLL}, {0x00000003FFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000000000000088uLL, 0x0000000000AB5B2DuLL}, {0x00000003FFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000000000008CuLL, 0x0000000004CCCD0DuLL}, {0x00000003FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000000000008uLL, 0x0000000000000005uLL}, {0x00000003FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000000000007uLL, 0x000000007FFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000004uLL, 0x0000000000000009uLL}, {0x00000003FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000000000005uLL}, {0x00000003FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x00000000FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x00000000FFFFFFFAuLL}, {0x00000003FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x00000000FFFFFFF7uLL}, {0x00000003FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x00000000FFFFFFF4uLL}, {0x00000003FFFFFFFDuLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x00000000FFFFFFCDuLL}, {0x00000003FFFFFFFDuLL, 0x00000001078644FAuLL, 0x0000000000000003uLL, 0x00000000E96D310FuLL}, {0x00000003FFFFFFFDuLL, 0x000000010747AE14uLL, 0x0000000000000003uLL, 0x00000000EA28F5C1uLL}, {0x00000003FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0x00000003FFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x00000003FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0x00000003FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0x00000003FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0x00000003FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFAuLL}, {0x00000003FFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEDuLL}, {0x00000003FFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB03uLL}, {0x00000003FFFFFFFDuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851E9uLL}, {0x00000003FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x00000003FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000003FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000003FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000003FFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000003FFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000003FFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x00000003FFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x00000003FFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x00000003FFFFFFFDuLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x00000003FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000003FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFDuLL}, {0x00000003FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFEuLL, 0x0000000000000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFEuLL, 0x0000000000000003uLL, 0x0000000155555554uLL, 0x0000000000000002uLL}, {0x00000003FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000003FFFFFFFuLL, 0x000000000000000EuLL}, {0x00000003FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000000000088uLL, 0x0000000000AB5B2EuLL}, {0x00000003FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000000000008CuLL, 0x0000000004CCCD0EuLL}, {0x00000003FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000008uLL, 0x0000000000000006uLL}, {0x00000003FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000007uLL, 0x000000007FFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000000AuLL}, {0x00000003FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000000000006uLL}, {0x00000003FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000002uLL}, {0x00000003FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x00000000FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x00000000FFFFFFFBuLL}, {0x00000003FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x00000000FFFFFFF8uLL}, {0x00000003FFFFFFFEuLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x00000000FFFFFFF5uLL}, {0x00000003FFFFFFFEuLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x00000000FFFFFFCEuLL}, {0x00000003FFFFFFFEuLL, 0x00000001078644FAuLL, 0x0000000000000003uLL, 0x00000000E96D3110uLL}, {0x00000003FFFFFFFEuLL, 0x000000010747AE14uLL, 0x0000000000000003uLL, 0x00000000EA28F5C2uLL}, {0x00000003FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000100000000uLL}, {0x00000003FFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0x00000003FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0x00000003FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0x00000003FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0x00000003FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0x00000003FFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEEuLL}, {0x00000003FFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB04uLL}, {0x00000003FFFFFFFEuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EAuLL}, {0x00000003FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x00000003FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x00000003FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000003FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000003FFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000003FFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000003FFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000003FFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x00000003FFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x00000003FFFFFFFEuLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x00000003FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000003FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFEuLL}, {0x00000003FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFFuLL, 0x0000000000000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFFuLL, 0x0000000000000003uLL, 0x0000000155555555uLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000003FFFFFFFuLL, 0x000000000000000FuLL}, {0x00000003FFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000088uLL, 0x0000000000AB5B2FuLL}, {0x00000003FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000000008CuLL, 0x0000000004CCCD0FuLL}, {0x00000003FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000008uLL, 0x0000000000000007uLL}, {0x00000003FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000007uLL, 0x000000007FFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000000BuLL}, {0x00000003FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000000000007uLL}, {0x00000003FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000003uLL}, {0x00000003FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000003uLL, 0x00000000FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000003uLL, 0x00000000FFFFFFFCuLL}, {0x00000003FFFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000003uLL, 0x00000000FFFFFFF9uLL}, {0x00000003FFFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000003uLL, 0x00000000FFFFFFF6uLL}, {0x00000003FFFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000003uLL, 0x00000000FFFFFFCFuLL}, {0x00000003FFFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000003uLL, 0x00000000E96D3111uLL}, {0x00000003FFFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000003uLL, 0x00000000EA28F5C3uLL}, {0x00000003FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000100000001uLL}, {0x00000003FFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0x00000003FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0x00000003FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0x00000003FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0x00000003FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0x00000003FFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEFuLL}, {0x00000003FFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB05uLL}, {0x00000003FFFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EBuLL}, {0x00000003FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0x00000003FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x00000003FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x00000003FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x00000003FFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000003FFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000003FFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000003FFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x00000003FFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x00000003FFFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x00000003FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x00000003FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x00000003FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000003FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000003FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x00000003FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000003FFFFFFFFuLL}, {0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000001000000000uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x0000000000000002uLL, 0x0000000800000000uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x0000000000000003uLL, 0x0000000555555555uLL, 0x0000000000000001uLL}, {0x0000001000000000uLL, 0x0000000000000010uLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x00000000078644FAuLL, 0x0000000000000220uLL, 0x0000000002AD6CC0uLL}, {0x0000001000000000uLL, 0x000000000747AE14uLL, 0x0000000000000232uLL, 0x0000000004A3D818uLL}, {0x0000001000000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x0000000000000020uLL}, {0x0000001000000000uLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x0000000000000030uLL}, {0x0000001000000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x0000000000000020uLL}, {0x0000001000000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x0000000000000010uLL}, {0x0000001000000000uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x0000000100000001uLL, 0x000000000000000FuLL, 0x00000000FFFFFFF1uLL}, {0x0000001000000000uLL, 0x0000000100000002uLL, 0x000000000000000FuLL, 0x00000000FFFFFFE2uLL}, {0x0000001000000000uLL, 0x0000000100000003uLL, 0x000000000000000FuLL, 0x00000000FFFFFFD3uLL}, {0x0000001000000000uLL, 0x0000000100000010uLL, 0x000000000000000FuLL, 0x00000000FFFFFF10uLL}, {0x0000001000000000uLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x000000008F21F55AuLL}, {0x0000001000000000uLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x0000000092CCCCD4uLL}, {0x0000001000000000uLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x000000010000000AuLL}, {0x0000001000000000uLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x0000000100000000uLL}, {0x0000001000000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000000000018uLL}, {0x0000001000000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x0000000000000010uLL}, {0x0000001000000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000000000008uLL}, {0x0000001000000000uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x0000000200000001uLL, 0x0000000000000007uLL, 0x00000001FFFFFFF9uLL}, {0x0000001000000000uLL, 0x0000000200000002uLL, 0x0000000000000007uLL, 0x00000001FFFFFFF2uLL}, {0x0000001000000000uLL, 0x0000000200000003uLL, 0x0000000000000007uLL, 0x00000001FFFFFFEBuLL}, {0x0000001000000000uLL, 0x0000000200000010uLL, 0x0000000000000007uLL, 0x00000001FFFFFF90uLL}, {0x0000001000000000uLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001CB541D2AuLL}, {0x0000001000000000uLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001CD0A3D74uLL}, {0x0000001000000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000100000006uLL}, {0x0000001000000000uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x0000000100000000uLL}, {0x0000001000000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000010000000FuLL}, {0x0000001000000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000010000000AuLL}, {0x0000001000000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000100000005uLL}, {0x0000001000000000uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x0000000100000000uLL}, {0x0000001000000000uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000000FFFFFFFBuLL}, {0x0000001000000000uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF6uLL}, {0x0000001000000000uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF1uLL}, {0x0000001000000000uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000000FFFFFFB0uLL}, {0x0000001000000000uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000DA60A71EuLL}, {0x0000001000000000uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000DB99999CuLL}, {0x0000001000000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000200000004uLL}, {0x0000001000000000uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x0000000200000000uLL}, {0x0000001000000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000000CuLL}, {0x0000001000000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000000000008uLL}, {0x0000001000000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000004uLL}, {0x0000001000000000uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000001000000000uLL, 0x0000001000000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000000uLL}, {0x0000001000000001uLL, 0x0000000000000001uLL, 0x0000001000000001uLL, 0x0000000000000000uLL}, {0x0000001000000001uLL, 0x0000000000000002uLL, 0x0000000800000000uLL, 0x0000000000000001uLL}, {0x0000001000000001uLL, 0x0000000000000003uLL, 0x0000000555555555uLL, 0x0000000000000002uLL}, {0x0000001000000001uLL, 0x0000000000000010uLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x0000001000000001uLL, 0x00000000078644FAuLL, 0x0000000000000220uLL, 0x0000000002AD6CC1uLL}, {0x0000001000000001uLL, 0x000000000747AE14uLL, 0x0000000000000232uLL, 0x0000000004A3D819uLL}, {0x0000001000000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x0000000000000021uLL}, {0x0000001000000001uLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x0000000000000001uLL}, {0x0000001000000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x0000000000000031uLL}, {0x0000001000000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x0000000000000021uLL}, {0x0000001000000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x0000000000000011uLL}, {0x0000001000000001uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000000000001uLL}, {0x0000001000000001uLL, 0x0000000100000001uLL, 0x000000000000000FuLL, 0x00000000FFFFFFF2uLL}, {0x0000001000000001uLL, 0x0000000100000002uLL, 0x000000000000000FuLL, 0x00000000FFFFFFE3uLL}, {0x0000001000000001uLL, 0x0000000100000003uLL, 0x000000000000000FuLL, 0x00000000FFFFFFD4uLL}, {0x0000001000000001uLL, 0x0000000100000010uLL, 0x000000000000000FuLL, 0x00000000FFFFFF11uLL}, {0x0000001000000001uLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x000000008F21F55BuLL}, {0x0000001000000001uLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x0000000092CCCCD5uLL}, {0x0000001000000001uLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x000000010000000BuLL}, {0x0000001000000001uLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x0000000100000001uLL}, {0x0000001000000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000000000019uLL}, {0x0000001000000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x0000000000000011uLL}, {0x0000001000000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000000000009uLL}, {0x0000001000000001uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x0000000000000001uLL}, {0x0000001000000001uLL, 0x0000000200000001uLL, 0x0000000000000007uLL, 0x00000001FFFFFFFAuLL}, {0x0000001000000001uLL, 0x0000000200000002uLL, 0x0000000000000007uLL, 0x00000001FFFFFFF3uLL}, {0x0000001000000001uLL, 0x0000000200000003uLL, 0x0000000000000007uLL, 0x00000001FFFFFFECuLL}, {0x0000001000000001uLL, 0x0000000200000010uLL, 0x0000000000000007uLL, 0x00000001FFFFFF91uLL}, {0x0000001000000001uLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001CB541D2BuLL}, {0x0000001000000001uLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001CD0A3D75uLL}, {0x0000001000000001uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000100000007uLL}, {0x0000001000000001uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x0000000100000001uLL}, {0x0000001000000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x0000000100000010uLL}, {0x0000001000000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000010000000BuLL}, {0x0000001000000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000100000006uLL}, {0x0000001000000001uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x0000000100000001uLL}, {0x0000001000000001uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000000FFFFFFFCuLL}, {0x0000001000000001uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF7uLL}, {0x0000001000000001uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF2uLL}, {0x0000001000000001uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000000FFFFFFB1uLL}, {0x0000001000000001uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000DA60A71FuLL}, {0x0000001000000001uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000DB99999DuLL}, {0x0000001000000001uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000200000005uLL}, {0x0000001000000001uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x0000000200000001uLL}, {0x0000001000000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000000DuLL}, {0x0000001000000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000000000009uLL}, {0x0000001000000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000005uLL}, {0x0000001000000001uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000001000000001uLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000001000000001uLL, 0x0000001000000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000001uLL}, {0x0000001000000002uLL, 0x0000000000000001uLL, 0x0000001000000002uLL, 0x0000000000000000uLL}, {0x0000001000000002uLL, 0x0000000000000002uLL, 0x0000000800000001uLL, 0x0000000000000000uLL}, {0x0000001000000002uLL, 0x0000000000000003uLL, 0x0000000555555556uLL, 0x0000000000000000uLL}, {0x0000001000000002uLL, 0x0000000000000010uLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0x0000001000000002uLL, 0x00000000078644FAuLL, 0x0000000000000220uLL, 0x0000000002AD6CC2uLL}, {0x0000001000000002uLL, 0x000000000747AE14uLL, 0x0000000000000232uLL, 0x0000000004A3D81AuLL}, {0x0000001000000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x0000000000000022uLL}, {0x0000001000000002uLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x0000000000000002uLL}, {0x0000001000000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x0000000000000032uLL}, {0x0000001000000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x0000000000000022uLL}, {0x0000001000000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x0000000000000012uLL}, {0x0000001000000002uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000000000002uLL}, {0x0000001000000002uLL, 0x0000000100000001uLL, 0x000000000000000FuLL, 0x00000000FFFFFFF3uLL}, {0x0000001000000002uLL, 0x0000000100000002uLL, 0x000000000000000FuLL, 0x00000000FFFFFFE4uLL}, {0x0000001000000002uLL, 0x0000000100000003uLL, 0x000000000000000FuLL, 0x00000000FFFFFFD5uLL}, {0x0000001000000002uLL, 0x0000000100000010uLL, 0x000000000000000FuLL, 0x00000000FFFFFF12uLL}, {0x0000001000000002uLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x000000008F21F55CuLL}, {0x0000001000000002uLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x0000000092CCCCD6uLL}, {0x0000001000000002uLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x000000010000000CuLL}, {0x0000001000000002uLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x0000000100000002uLL}, {0x0000001000000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x000000000000001AuLL}, {0x0000001000000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x0000000000000012uLL}, {0x0000001000000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x000000000000000AuLL}, {0x0000001000000002uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x0000000000000002uLL}, {0x0000001000000002uLL, 0x0000000200000001uLL, 0x0000000000000007uLL, 0x00000001FFFFFFFBuLL}, {0x0000001000000002uLL, 0x0000000200000002uLL, 0x0000000000000007uLL, 0x00000001FFFFFFF4uLL}, {0x0000001000000002uLL, 0x0000000200000003uLL, 0x0000000000000007uLL, 0x00000001FFFFFFEDuLL}, {0x0000001000000002uLL, 0x0000000200000010uLL, 0x0000000000000007uLL, 0x00000001FFFFFF92uLL}, {0x0000001000000002uLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001CB541D2CuLL}, {0x0000001000000002uLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001CD0A3D76uLL}, {0x0000001000000002uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000100000008uLL}, {0x0000001000000002uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x0000000100000002uLL}, {0x0000001000000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x0000000100000011uLL}, {0x0000001000000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000010000000CuLL}, {0x0000001000000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000100000007uLL}, {0x0000001000000002uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x0000000100000002uLL}, {0x0000001000000002uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000000FFFFFFFDuLL}, {0x0000001000000002uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF8uLL}, {0x0000001000000002uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF3uLL}, {0x0000001000000002uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000000FFFFFFB2uLL}, {0x0000001000000002uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000DA60A720uLL}, {0x0000001000000002uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000DB99999EuLL}, {0x0000001000000002uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000200000006uLL}, {0x0000001000000002uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x0000000200000002uLL}, {0x0000001000000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000000EuLL}, {0x0000001000000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x000000000000000AuLL}, {0x0000001000000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000006uLL}, {0x0000001000000002uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000001000000002uLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000001000000002uLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000001000000002uLL, 0x0000001000000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000002uLL}, {0x0000001000000003uLL, 0x0000000000000001uLL, 0x0000001000000003uLL, 0x0000000000000000uLL}, {0x0000001000000003uLL, 0x0000000000000002uLL, 0x0000000800000001uLL, 0x0000000000000001uLL}, {0x0000001000000003uLL, 0x0000000000000003uLL, 0x0000000555555556uLL, 0x0000000000000001uLL}, {0x0000001000000003uLL, 0x0000000000000010uLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0x0000001000000003uLL, 0x00000000078644FAuLL, 0x0000000000000220uLL, 0x0000000002AD6CC3uLL}, {0x0000001000000003uLL, 0x000000000747AE14uLL, 0x0000000000000232uLL, 0x0000000004A3D81BuLL}, {0x0000001000000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x0000000000000023uLL}, {0x0000001000000003uLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x0000000000000003uLL}, {0x0000001000000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x0000000000000033uLL}, {0x0000001000000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x0000000000000023uLL}, {0x0000001000000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x0000000000000013uLL}, {0x0000001000000003uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000000000003uLL}, {0x0000001000000003uLL, 0x0000000100000001uLL, 0x000000000000000FuLL, 0x00000000FFFFFFF4uLL}, {0x0000001000000003uLL, 0x0000000100000002uLL, 0x000000000000000FuLL, 0x00000000FFFFFFE5uLL}, {0x0000001000000003uLL, 0x0000000100000003uLL, 0x000000000000000FuLL, 0x00000000FFFFFFD6uLL}, {0x0000001000000003uLL, 0x0000000100000010uLL, 0x000000000000000FuLL, 0x00000000FFFFFF13uLL}, {0x0000001000000003uLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x000000008F21F55DuLL}, {0x0000001000000003uLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x0000000092CCCCD7uLL}, {0x0000001000000003uLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x000000010000000DuLL}, {0x0000001000000003uLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x0000000100000003uLL}, {0x0000001000000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x000000000000001BuLL}, {0x0000001000000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x0000000000000013uLL}, {0x0000001000000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x000000000000000BuLL}, {0x0000001000000003uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x0000000000000003uLL}, {0x0000001000000003uLL, 0x0000000200000001uLL, 0x0000000000000007uLL, 0x00000001FFFFFFFCuLL}, {0x0000001000000003uLL, 0x0000000200000002uLL, 0x0000000000000007uLL, 0x00000001FFFFFFF5uLL}, {0x0000001000000003uLL, 0x0000000200000003uLL, 0x0000000000000007uLL, 0x00000001FFFFFFEEuLL}, {0x0000001000000003uLL, 0x0000000200000010uLL, 0x0000000000000007uLL, 0x00000001FFFFFF93uLL}, {0x0000001000000003uLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001CB541D2DuLL}, {0x0000001000000003uLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001CD0A3D77uLL}, {0x0000001000000003uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000100000009uLL}, {0x0000001000000003uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x0000000100000003uLL}, {0x0000001000000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x0000000100000012uLL}, {0x0000001000000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000010000000DuLL}, {0x0000001000000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000100000008uLL}, {0x0000001000000003uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x0000000100000003uLL}, {0x0000001000000003uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000000FFFFFFFEuLL}, {0x0000001000000003uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF9uLL}, {0x0000001000000003uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000000FFFFFFF4uLL}, {0x0000001000000003uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000000FFFFFFB3uLL}, {0x0000001000000003uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000DA60A721uLL}, {0x0000001000000003uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000DB99999FuLL}, {0x0000001000000003uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000200000007uLL}, {0x0000001000000003uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x0000000200000003uLL}, {0x0000001000000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000000FuLL}, {0x0000001000000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x000000000000000BuLL}, {0x0000001000000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000007uLL}, {0x0000001000000003uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0000001000000003uLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0000001000000003uLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000001000000003uLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000001000000003uLL, 0x0000001000000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000003uLL}, {0x0000001000000010uLL, 0x0000000000000001uLL, 0x0000001000000010uLL, 0x0000000000000000uLL}, {0x0000001000000010uLL, 0x0000000000000002uLL, 0x0000000800000008uLL, 0x0000000000000000uLL}, {0x0000001000000010uLL, 0x0000000000000003uLL, 0x000000055555555AuLL, 0x0000000000000002uLL}, {0x0000001000000010uLL, 0x0000000000000010uLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x0000001000000010uLL, 0x00000000078644FAuLL, 0x0000000000000220uLL, 0x0000000002AD6CD0uLL}, {0x0000001000000010uLL, 0x000000000747AE14uLL, 0x0000000000000232uLL, 0x0000000004A3D828uLL}, {0x0000001000000010uLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x0000000000000030uLL}, {0x0000001000000010uLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x0000000000000010uLL}, {0x0000001000000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x0000000000000040uLL}, {0x0000001000000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x0000000000000030uLL}, {0x0000001000000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x0000000000000020uLL}, {0x0000001000000010uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000000000010uLL}, {0x0000001000000010uLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x0000000000000000uLL}, {0x0000001000000010uLL, 0x0000000100000002uLL, 0x000000000000000FuLL, 0x00000000FFFFFFF2uLL}, {0x0000001000000010uLL, 0x0000000100000003uLL, 0x000000000000000FuLL, 0x00000000FFFFFFE3uLL}, {0x0000001000000010uLL, 0x0000000100000010uLL, 0x000000000000000FuLL, 0x00000000FFFFFF20uLL}, {0x0000001000000010uLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x000000008F21F56AuLL}, {0x0000001000000010uLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x0000000092CCCCE4uLL}, {0x0000001000000010uLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x000000010000001AuLL}, {0x0000001000000010uLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x0000000100000010uLL}, {0x0000001000000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000000000028uLL}, {0x0000001000000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x0000000000000020uLL}, {0x0000001000000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000000000018uLL}, {0x0000001000000010uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x0000000000000010uLL}, {0x0000001000000010uLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x0000000000000008uLL}, {0x0000001000000010uLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x0000000000000000uLL}, {0x0000001000000010uLL, 0x0000000200000003uLL, 0x0000000000000007uLL, 0x00000001FFFFFFFBuLL}, {0x0000001000000010uLL, 0x0000000200000010uLL, 0x0000000000000007uLL, 0x00000001FFFFFFA0uLL}, {0x0000001000000010uLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001CB541D3AuLL}, {0x0000001000000010uLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001CD0A3D84uLL}, {0x0000001000000010uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000100000016uLL}, {0x0000001000000010uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x0000000100000010uLL}, {0x0000001000000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000010000001FuLL}, {0x0000001000000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000010000001AuLL}, {0x0000001000000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000100000015uLL}, {0x0000001000000010uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x0000000100000010uLL}, {0x0000001000000010uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x000000010000000BuLL}, {0x0000001000000010uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x0000000100000006uLL}, {0x0000001000000010uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x0000000100000001uLL}, {0x0000001000000010uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000000FFFFFFC0uLL}, {0x0000001000000010uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000DA60A72EuLL}, {0x0000001000000010uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000DB9999ACuLL}, {0x0000001000000010uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000200000014uLL}, {0x0000001000000010uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x0000000200000010uLL}, {0x0000001000000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000000001CuLL}, {0x0000001000000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000000000018uLL}, {0x0000001000000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000000000014uLL}, {0x0000001000000010uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x0000001000000010uLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x0000001000000010uLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x0000001000000010uLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x0000001000000010uLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000001000000010uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x0000001000000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001000000010uLL}, {0x00000010078644FAuLL, 0x0000000000000001uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL}, {0x00000010078644FAuLL, 0x0000000000000002uLL, 0x0000000803C3227DuLL, 0x0000000000000000uLL}, {0x00000010078644FAuLL, 0x0000000000000003uLL, 0x0000000557D76C53uLL, 0x0000000000000001uLL}, {0x00000010078644FAuLL, 0x0000000000000010uLL, 0x000000010078644FuLL, 0x000000000000000AuLL}, {0x00000010078644FAuLL, 0x00000000078644FAuLL, 0x0000000000000221uLL, 0x0000000002AD6CC0uLL}, {0x00000010078644FAuLL, 0x000000000747AE14uLL, 0x0000000000000233uLL, 0x0000000004E26EFEuLL}, {0x00000010078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x000000000786451AuLL}, {0x00000010078644FAuLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x00000000078644FAuLL}, {0x00000010078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000000786452AuLL}, {0x00000010078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000000786451AuLL}, {0x00000010078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000000786450AuLL}, {0x00000010078644FAuLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x00000000078644FAuLL}, {0x00000010078644FAuLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x00000000078644EAuLL}, {0x00000010078644FAuLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x00000000078644DAuLL}, {0x00000010078644FAuLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x00000000078644CAuLL}, {0x00000010078644FAuLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x00000000078643FAuLL}, {0x00000010078644FAuLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x0000000096A83A54uLL}, {0x00000010078644FAuLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x000000009A5311CEuLL}, {0x00000010078644FAuLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x0000000107864504uLL}, {0x00000010078644FAuLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x00000001078644FAuLL}, {0x00000010078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000007864512uLL}, {0x00000010078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x000000000786450AuLL}, {0x00000010078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000007864502uLL}, {0x00000010078644FAuLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x00000000078644FAuLL}, {0x00000010078644FAuLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x00000000078644F2uLL}, {0x00000010078644FAuLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x00000000078644EAuLL}, {0x00000010078644FAuLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x00000000078644E2uLL}, {0x00000010078644FAuLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x000000000786447AuLL}, {0x00000010078644FAuLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001D2DA6224uLL}, {0x00000010078644FAuLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001D490826EuLL}, {0x00000010078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000107864500uLL}, {0x00000010078644FAuLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x00000001078644FAuLL}, {0x00000010078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x0000000107864509uLL}, {0x00000010078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x0000000107864504uLL}, {0x00000010078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x00000001078644FFuLL}, {0x00000010078644FAuLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x00000001078644FAuLL}, {0x00000010078644FAuLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000001078644F5uLL}, {0x00000010078644FAuLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000001078644F0uLL}, {0x00000010078644FAuLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000001078644EBuLL}, {0x00000010078644FAuLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000001078644AAuLL}, {0x00000010078644FAuLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000E1E6EC18uLL}, {0x00000010078644FAuLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000E31FDE96uLL}, {0x00000010078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x00000002078644FEuLL}, {0x00000010078644FAuLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x00000002078644FAuLL}, {0x00000010078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x0000000007864506uLL}, {0x00000010078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000007864502uLL}, {0x00000010078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x00000000078644FEuLL}, {0x00000010078644FAuLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x00000010078644FAuLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x00000010078644FAuLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x00000010078644FAuLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x00000010078644FAuLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x00000010078644FAuLL, 0x00000010078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000010078644FAuLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x00000010078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x00000010078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010078644FAuLL}, {0x000000100747AE14uLL, 0x0000000000000001uLL, 0x000000100747AE14uLL, 0x0000000000000000uLL}, {0x000000100747AE14uLL, 0x0000000000000002uLL, 0x0000000803A3D70AuLL, 0x0000000000000000uLL}, {0x000000100747AE14uLL, 0x0000000000000003uLL, 0x0000000557C28F5CuLL, 0x0000000000000000uLL}, {0x000000100747AE14uLL, 0x0000000000000010uLL, 0x0000000100747AE1uLL, 0x0000000000000004uLL}, {0x000000100747AE14uLL, 0x00000000078644FAuLL, 0x0000000000000221uLL, 0x00000000026ED5DAuLL}, {0x000000100747AE14uLL, 0x000000000747AE14uLL, 0x0000000000000233uLL, 0x0000000004A3D818uLL}, {0x000000100747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000000000020uLL, 0x000000000747AE34uLL}, {0x000000100747AE14uLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x000000000747AE14uLL}, {0x000000100747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000000747AE44uLL}, {0x000000100747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000000747AE34uLL}, {0x000000100747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000000747AE24uLL}, {0x000000100747AE14uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x000000000747AE14uLL}, {0x000000100747AE14uLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x000000000747AE04uLL}, {0x000000100747AE14uLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x000000000747ADF4uLL}, {0x000000100747AE14uLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x000000000747ADE4uLL}, {0x000000100747AE14uLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x000000000747AD14uLL}, {0x000000100747AE14uLL, 0x00000001078644FAuLL, 0x000000000000000FuLL, 0x000000009669A36EuLL}, {0x000000100747AE14uLL, 0x000000010747AE14uLL, 0x000000000000000FuLL, 0x000000009A147AE8uLL}, {0x000000100747AE14uLL, 0x000000017FFFFFFFuLL, 0x000000000000000AuLL, 0x000000010747AE1EuLL}, {0x000000100747AE14uLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x000000010747AE14uLL}, {0x000000100747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x000000000747AE2CuLL}, {0x000000100747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x000000000747AE24uLL}, {0x000000100747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x000000000747AE1CuLL}, {0x000000100747AE14uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x000000000747AE14uLL}, {0x000000100747AE14uLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x000000000747AE0CuLL}, {0x000000100747AE14uLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x000000000747AE04uLL}, {0x000000100747AE14uLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x000000000747ADFCuLL}, {0x000000100747AE14uLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x000000000747AD94uLL}, {0x000000100747AE14uLL, 0x00000002078644FAuLL, 0x0000000000000007uLL, 0x00000001D29BCB3EuLL}, {0x000000100747AE14uLL, 0x000000020747AE14uLL, 0x0000000000000007uLL, 0x00000001D451EB88uLL}, {0x000000100747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x000000010747AE1AuLL}, {0x000000100747AE14uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x000000010747AE14uLL}, {0x000000100747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000010747AE23uLL}, {0x000000100747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000010747AE1EuLL}, {0x000000100747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x000000010747AE19uLL}, {0x000000100747AE14uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x000000010747AE14uLL}, {0x000000100747AE14uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x000000010747AE0FuLL}, {0x000000100747AE14uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x000000010747AE0AuLL}, {0x000000100747AE14uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x000000010747AE05uLL}, {0x000000100747AE14uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x000000010747ADC4uLL}, {0x000000100747AE14uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000000E1A85532uLL}, {0x000000100747AE14uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000000E2E147B0uLL}, {0x000000100747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x000000020747AE18uLL}, {0x000000100747AE14uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x000000020747AE14uLL}, {0x000000100747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000000747AE20uLL}, {0x000000100747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x000000000747AE1CuLL}, {0x000000100747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x000000000747AE18uLL}, {0x000000100747AE14uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x000000100747AE14uLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x000000100747AE14uLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x000000100747AE14uLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x000000100747AE14uLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x000000100747AE14uLL, 0x00000010078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000100747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000100747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000100747AE14uLL}, {0x000000107FFFFFFFuLL, 0x0000000000000001uLL, 0x000000107FFFFFFFuLL, 0x0000000000000000uLL}, {0x000000107FFFFFFFuLL, 0x0000000000000002uLL, 0x000000083FFFFFFFuLL, 0x0000000000000001uLL}, {0x000000107FFFFFFFuLL, 0x0000000000000003uLL, 0x000000057FFFFFFFuLL, 0x0000000000000002uLL}, {0x000000107FFFFFFFuLL, 0x0000000000000010uLL, 0x0000000107FFFFFFuLL, 0x000000000000000FuLL}, {0x000000107FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000231uLL, 0x0000000002C2D825uLL}, {0x000000107FFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000244uLL, 0x0000000001999AAFuLL}, {0x000000107FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000021uLL, 0x0000000000000020uLL}, {0x000000107FFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000020uLL, 0x000000007FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000008000002FuLL}, {0x000000107FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000008000001FuLL}, {0x000000107FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000008000000FuLL}, {0x000000107FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x000000007FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x000000007FFFFFEFuLL}, {0x000000107FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x000000007FFFFFDFuLL}, {0x000000107FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x000000007FFFFFCFuLL}, {0x000000107FFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x000000007FFFFEFFuLL}, {0x000000107FFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000010uLL, 0x00000000079BB05FuLL}, {0x000000107FFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000010uLL, 0x000000000B851EBFuLL}, {0x000000107FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x000000000000000BuLL, 0x000000000000000AuLL}, {0x000000107FFFFFFFuLL, 0x0000000180000000uLL, 0x000000000000000AuLL, 0x000000017FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000080000017uLL}, {0x000000107FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x000000008000000FuLL}, {0x000000107FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000080000007uLL}, {0x000000107FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x000000007FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x000000007FFFFFF7uLL}, {0x000000107FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x000000007FFFFFEFuLL}, {0x000000107FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x000000007FFFFFE7uLL}, {0x000000107FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x000000007FFFFF7FuLL}, {0x000000107FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000008uLL, 0x0000000043CDD82FuLL}, {0x000000107FFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000008uLL, 0x0000000045C28F5FuLL}, {0x000000107FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000180000005uLL}, {0x000000107FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x000000017FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000018000000EuLL}, {0x000000107FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x0000000180000009uLL}, {0x000000107FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000180000004uLL}, {0x000000107FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x000000017FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x000000017FFFFFFAuLL}, {0x000000107FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x000000017FFFFFF5uLL}, {0x000000107FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x000000017FFFFFF0uLL}, {0x000000107FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x000000017FFFFFAFuLL}, {0x000000107FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x000000015A60A71DuLL}, {0x000000107FFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x000000015B99999BuLL}, {0x000000107FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000280000003uLL}, {0x000000107FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x000000027FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000008000000BuLL}, {0x000000107FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000080000007uLL}, {0x000000107FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000080000003uLL}, {0x000000107FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x000000107FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x000000107FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x000000107FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x000000107FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x000000107FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x000000107FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x000000107FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x000000107FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x000000107FFFFFFFuLL}, {0x0000001080000000uLL, 0x0000000000000001uLL, 0x0000001080000000uLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x0000000000000002uLL, 0x0000000840000000uLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x0000000000000003uLL, 0x0000000580000000uLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x0000000000000010uLL, 0x0000000108000000uLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x00000000078644FAuLL, 0x0000000000000231uLL, 0x0000000002C2D826uLL}, {0x0000001080000000uLL, 0x000000000747AE14uLL, 0x0000000000000244uLL, 0x0000000001999AB0uLL}, {0x0000001080000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000021uLL, 0x0000000000000021uLL}, {0x0000001080000000uLL, 0x0000000080000000uLL, 0x0000000000000021uLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x0000000080000030uLL}, {0x0000001080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x0000000080000020uLL}, {0x0000001080000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x0000000080000010uLL}, {0x0000001080000000uLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x0000000080000000uLL}, {0x0000001080000000uLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x000000007FFFFFF0uLL}, {0x0000001080000000uLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x000000007FFFFFE0uLL}, {0x0000001080000000uLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x000000007FFFFFD0uLL}, {0x0000001080000000uLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x000000007FFFFF00uLL}, {0x0000001080000000uLL, 0x00000001078644FAuLL, 0x0000000000000010uLL, 0x00000000079BB060uLL}, {0x0000001080000000uLL, 0x000000010747AE14uLL, 0x0000000000000010uLL, 0x000000000B851EC0uLL}, {0x0000001080000000uLL, 0x000000017FFFFFFFuLL, 0x000000000000000BuLL, 0x000000000000000BuLL}, {0x0000001080000000uLL, 0x0000000180000000uLL, 0x000000000000000BuLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000080000018uLL}, {0x0000001080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x0000000080000010uLL}, {0x0000001080000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000080000008uLL}, {0x0000001080000000uLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x0000000080000000uLL}, {0x0000001080000000uLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x000000007FFFFFF8uLL}, {0x0000001080000000uLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x000000007FFFFFF0uLL}, {0x0000001080000000uLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x000000007FFFFFE8uLL}, {0x0000001080000000uLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x000000007FFFFF80uLL}, {0x0000001080000000uLL, 0x00000002078644FAuLL, 0x0000000000000008uLL, 0x0000000043CDD830uLL}, {0x0000001080000000uLL, 0x000000020747AE14uLL, 0x0000000000000008uLL, 0x0000000045C28F60uLL}, {0x0000001080000000uLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000180000006uLL}, {0x0000001080000000uLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x0000000180000000uLL}, {0x0000001080000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000018000000FuLL}, {0x0000001080000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x000000018000000AuLL}, {0x0000001080000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000180000005uLL}, {0x0000001080000000uLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x0000000180000000uLL}, {0x0000001080000000uLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x000000017FFFFFFBuLL}, {0x0000001080000000uLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x000000017FFFFFF6uLL}, {0x0000001080000000uLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x000000017FFFFFF1uLL}, {0x0000001080000000uLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x000000017FFFFFB0uLL}, {0x0000001080000000uLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x000000015A60A71EuLL}, {0x0000001080000000uLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x000000015B99999CuLL}, {0x0000001080000000uLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000280000004uLL}, {0x0000001080000000uLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x0000000280000000uLL}, {0x0000001080000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000008000000CuLL}, {0x0000001080000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000080000008uLL}, {0x0000001080000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000080000004uLL}, {0x0000001080000000uLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0000001080000000uLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0000001080000000uLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0000001080000000uLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0000001080000000uLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x0000001080000000uLL, 0x00000010078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x0000001080000000uLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x0000001080000000uLL, 0x000000107FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0000001080000000uLL, 0x0000001080000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0000001080000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x0000001080000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0000001080000000uLL}, {0x00000010FFFFFFFDuLL, 0x0000000000000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFDuLL, 0x0000000000000002uLL, 0x000000087FFFFFFEuLL, 0x0000000000000001uLL}, {0x00000010FFFFFFFDuLL, 0x0000000000000003uLL, 0x00000005AAAAAAA9uLL, 0x0000000000000002uLL}, {0x00000010FFFFFFFDuLL, 0x0000000000000010uLL, 0x000000010FFFFFFFuLL, 0x000000000000000DuLL}, {0x00000010FFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000000000000242uLL, 0x0000000002D84389uLL}, {0x00000010FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000000000255uLL, 0x0000000005D70B59uLL}, {0x00000010FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000000000022uLL, 0x000000000000001FuLL}, {0x00000010FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000000000021uLL, 0x000000007FFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000011uLL, 0x0000000000000030uLL}, {0x00000010FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000011uLL, 0x000000000000001FuLL}, {0x00000010FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000011uLL, 0x000000000000000EuLL}, {0x00000010FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x00000000FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x00000000FFFFFFEDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x00000000FFFFFFDDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x00000000FFFFFFCDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x00000000FFFFFEFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000001078644FAuLL, 0x0000000000000010uLL, 0x00000000879BB05DuLL}, {0x00000010FFFFFFFDuLL, 0x000000010747AE14uLL, 0x0000000000000010uLL, 0x000000008B851EBDuLL}, {0x00000010FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x000000000000000BuLL, 0x0000000080000008uLL}, {0x00000010FFFFFFFDuLL, 0x0000000180000000uLL, 0x000000000000000BuLL, 0x000000007FFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000100000015uLL}, {0x00000010FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x000000010000000DuLL}, {0x00000010FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000100000005uLL}, {0x00000010FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x00000000FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x00000000FFFFFFF5uLL}, {0x00000010FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x00000000FFFFFFEDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x00000000FFFFFFE5uLL}, {0x00000010FFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x00000000FFFFFF7DuLL}, {0x00000010FFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000000000008uLL, 0x00000000C3CDD82DuLL}, {0x00000010FFFFFFFDuLL, 0x000000020747AE14uLL, 0x0000000000000008uLL, 0x00000000C5C28F5DuLL}, {0x00000010FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000200000003uLL}, {0x00000010FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x00000001FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000020000000CuLL}, {0x00000010FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x0000000200000007uLL}, {0x00000010FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000200000002uLL}, {0x00000010FFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x00000001FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000001FFFFFFF8uLL}, {0x00000010FFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000001FFFFFFF3uLL}, {0x00000010FFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000001FFFFFFEEuLL}, {0x00000010FFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000001FFFFFFADuLL}, {0x00000010FFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000001DA60A71BuLL}, {0x00000010FFFFFFFDuLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000001DB999999uLL}, {0x00000010FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000300000001uLL}, {0x00000010FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x00000002FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x0000000100000009uLL}, {0x00000010FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000100000005uLL}, {0x00000010FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000100000001uLL}, {0x00000010FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000010FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000010FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x00000010FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x00000010FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x00000010FFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x00000010FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000010FFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFDuLL}, {0x00000010FFFFFFFEuLL, 0x0000000000000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFEuLL, 0x0000000000000002uLL, 0x000000087FFFFFFFuLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFEuLL, 0x0000000000000003uLL, 0x00000005AAAAAAAAuLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFEuLL, 0x0000000000000010uLL, 0x000000010FFFFFFFuLL, 0x000000000000000EuLL}, {0x00000010FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000000000242uLL, 0x0000000002D8438AuLL}, {0x00000010FFFFFFFEuLL, 0x000000000747AE14uLL, 0x0000000000000255uLL, 0x0000000005D70B5AuLL}, {0x00000010FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000022uLL, 0x0000000000000020uLL}, {0x00000010FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000021uLL, 0x000000007FFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000011uLL, 0x0000000000000031uLL}, {0x00000010FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000011uLL, 0x0000000000000020uLL}, {0x00000010FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000011uLL, 0x000000000000000FuLL}, {0x00000010FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x00000000FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x00000000FFFFFFEEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x00000000FFFFFFDEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x00000000FFFFFFCEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x00000000FFFFFEFEuLL}, {0x00000010FFFFFFFEuLL, 0x00000001078644FAuLL, 0x0000000000000010uLL, 0x00000000879BB05EuLL}, {0x00000010FFFFFFFEuLL, 0x000000010747AE14uLL, 0x0000000000000010uLL, 0x000000008B851EBEuLL}, {0x00000010FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x000000000000000BuLL, 0x0000000080000009uLL}, {0x00000010FFFFFFFEuLL, 0x0000000180000000uLL, 0x000000000000000BuLL, 0x000000007FFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000100000016uLL}, {0x00000010FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x000000010000000EuLL}, {0x00000010FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000100000006uLL}, {0x00000010FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x00000000FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x00000000FFFFFFF6uLL}, {0x00000010FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x00000000FFFFFFEEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x00000000FFFFFFE6uLL}, {0x00000010FFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x00000000FFFFFF7EuLL}, {0x00000010FFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000000000008uLL, 0x00000000C3CDD82EuLL}, {0x00000010FFFFFFFEuLL, 0x000000020747AE14uLL, 0x0000000000000008uLL, 0x00000000C5C28F5EuLL}, {0x00000010FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000200000004uLL}, {0x00000010FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x00000001FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000020000000DuLL}, {0x00000010FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x0000000200000008uLL}, {0x00000010FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000200000003uLL}, {0x00000010FFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x00000001FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000001FFFFFFF9uLL}, {0x00000010FFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000001FFFFFFF4uLL}, {0x00000010FFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000001FFFFFFEFuLL}, {0x00000010FFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000001FFFFFFAEuLL}, {0x00000010FFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000001DA60A71CuLL}, {0x00000010FFFFFFFEuLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000001DB99999AuLL}, {0x00000010FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000300000002uLL}, {0x00000010FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x00000002FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000010000000AuLL}, {0x00000010FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000100000006uLL}, {0x00000010FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000100000002uLL}, {0x00000010FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000010FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000010FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x00000010FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x00000010FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x00000010FFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x00000010FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000010FFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000010FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFEuLL}, {0x00000010FFFFFFFFuLL, 0x0000000000000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFFuLL, 0x0000000000000002uLL, 0x000000087FFFFFFFuLL, 0x0000000000000001uLL}, {0x00000010FFFFFFFFuLL, 0x0000000000000003uLL, 0x00000005AAAAAAAAuLL, 0x0000000000000001uLL}, {0x00000010FFFFFFFFuLL, 0x0000000000000010uLL, 0x000000010FFFFFFFuLL, 0x000000000000000FuLL}, {0x00000010FFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000000000242uLL, 0x0000000002D8438BuLL}, {0x00000010FFFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000000000255uLL, 0x0000000005D70B5BuLL}, {0x00000010FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000000000022uLL, 0x0000000000000021uLL}, {0x00000010FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000021uLL, 0x000000007FFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000000000011uLL, 0x0000000000000032uLL}, {0x00000010FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000011uLL, 0x0000000000000021uLL}, {0x00000010FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000011uLL, 0x0000000000000010uLL}, {0x00000010FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000010uLL, 0x00000000FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000010uLL, 0x00000000FFFFFFEFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000010uLL, 0x00000000FFFFFFDFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000010uLL, 0x00000000FFFFFFCFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000100000010uLL, 0x0000000000000010uLL, 0x00000000FFFFFEFFuLL}, {0x00000010FFFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000000000010uLL, 0x00000000879BB05FuLL}, {0x00000010FFFFFFFFuLL, 0x000000010747AE14uLL, 0x0000000000000010uLL, 0x000000008B851EBFuLL}, {0x00000010FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x000000000000000BuLL, 0x000000008000000AuLL}, {0x00000010FFFFFFFFuLL, 0x0000000180000000uLL, 0x000000000000000BuLL, 0x000000007FFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000000000008uLL, 0x0000000100000017uLL}, {0x00000010FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000008uLL, 0x000000010000000FuLL}, {0x00000010FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000000000008uLL, 0x0000000100000007uLL}, {0x00000010FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000008uLL, 0x00000000FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000008uLL, 0x00000000FFFFFFF7uLL}, {0x00000010FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000008uLL, 0x00000000FFFFFFEFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000008uLL, 0x00000000FFFFFFE7uLL}, {0x00000010FFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000000000008uLL, 0x00000000FFFFFF7FuLL}, {0x00000010FFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000000000008uLL, 0x00000000C3CDD82FuLL}, {0x00000010FFFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000000000008uLL, 0x00000000C5C28F5FuLL}, {0x00000010FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000000000006uLL, 0x0000000200000005uLL}, {0x00000010FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000000000006uLL, 0x00000001FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000000000005uLL, 0x000000020000000EuLL}, {0x00000010FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000000000005uLL, 0x0000000200000009uLL}, {0x00000010FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000000000005uLL, 0x0000000200000004uLL}, {0x00000010FFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000000000005uLL, 0x00000001FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000000000005uLL, 0x00000001FFFFFFFAuLL}, {0x00000010FFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000000000005uLL, 0x00000001FFFFFFF5uLL}, {0x00000010FFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000000000005uLL, 0x00000001FFFFFFF0uLL}, {0x00000010FFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000000000005uLL, 0x00000001FFFFFFAFuLL}, {0x00000010FFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000000000005uLL, 0x00000001DA60A71DuLL}, {0x00000010FFFFFFFFuLL, 0x000000030747AE14uLL, 0x0000000000000005uLL, 0x00000001DB99999BuLL}, {0x00000010FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000000000004uLL, 0x0000000300000003uLL}, {0x00000010FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000000000004uLL, 0x00000002FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000000000004uLL, 0x000000010000000BuLL}, {0x00000010FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000000000004uLL, 0x0000000100000007uLL}, {0x00000010FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000000000004uLL, 0x0000000100000003uLL}, {0x00000010FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x00000010FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x00000010FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x00000010FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x00000010FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x00000010FFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x00000010FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x00000010FFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x00000010FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x00000010FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x00000010FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x00000010FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x00000010FFFFFFFFuLL}, {0x078644FA00000000uLL, 0x0000000000000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x0000000000000002uLL, 0x03C3227D00000000uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x0000000000000003uLL, 0x028216FE00000000uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x0000000000000010uLL, 0x0078644FA0000000uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x00000000078644FAuLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x000000000747AE14uLL, 0x000000010898F295uLL, 0x0000000004D8C65CuLL}, {0x078644FA00000000uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x000000000F0C89F4uLL}, {0x078644FA00000000uLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001692CEEEuLL}, {0x078644FA00000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000000F0C89F4uLL}, {0x078644FA00000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000078644FAuLL}, {0x078644FA00000000uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x0000000100000001uLL, 0x00000000078644F9uLL, 0x00000000F879BB07uLL}, {0x078644FA00000000uLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F0F3760EuLL}, {0x078644FA00000000uLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000E96D3115uLL}, {0x078644FA00000000uLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x00000000879BB070uLL}, {0x078644FA00000000uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x000000006C09ACD2uLL}, {0x078644FA00000000uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000082B63E28uLL}, {0x078644FA00000000uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000005042DFCuLL}, {0x078644FA00000000uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000000B496777uLL}, {0x078644FA00000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000000078644FAuLL}, {0x078644FA00000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000003C3227DuLL}, {0x078644FA00000000uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x0000000200000001uLL, 0x0000000003C3227CuLL, 0x00000001FC3CDD84uLL}, {0x078644FA00000000uLL, 0x0000000200000002uLL, 0x0000000003C3227CuLL, 0x00000001F879BB08uLL}, {0x078644FA00000000uLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001F4B6988CuLL}, {0x078644FA00000000uLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001C3CDD840uLL}, {0x078644FA00000000uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000181754582uLL}, {0x078644FA00000000uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x000000019B4CF184uLL}, {0x078644FA00000000uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x00000001830281FDuLL}, {0x078644FA00000000uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x0000000180000000uLL}, {0x078644FA00000000uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000000078644FAuLL}, {0x078644FA00000000uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000005042DFCuLL}, {0x078644FA00000000uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000000028216FEuLL}, {0x078644FA00000000uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x0000000300000001uLL, 0x00000000028216FDuLL, 0x00000002FD7DE903uLL}, {0x078644FA00000000uLL, 0x0000000300000002uLL, 0x00000000028216FDuLL, 0x00000002FAFBD206uLL}, {0x078644FA00000000uLL, 0x0000000300000003uLL, 0x00000000028216FDuLL, 0x00000002F879BB09uLL}, {0x078644FA00000000uLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002D7DE9030uLL}, {0x078644FA00000000uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x0000000266ACEAE4uLL}, {0x078644FA00000000uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000CC648250uLL}, {0x078644FA00000000uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000282265CD9uLL}, {0x078644FA00000000uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x0000000280000000uLL}, {0x078644FA00000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000205A4B3BAuLL}, {0x078644FA00000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000203C3227CuLL}, {0x078644FA00000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000201E1913EuLL}, {0x078644FA00000000uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A00000000uLL}, {0x078644FA00000000uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x00000009FF879BB1uLL}, {0x078644FA00000000uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x00000009FF0F3762uLL}, {0x078644FA00000000uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x00000009FE96D313uLL}, {0x078644FA00000000uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x00000009F879BB10uLL}, {0x078644FA00000000uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000001E3B0AC8uLL}, {0x078644FA00000000uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000438F2016CuLL}, {0x078644FA00000000uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C0074BE5CuLL}, {0x078644FA00000000uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C00000000uLL}, {0x078644FA00000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000000153EE0EuLL}, {0x078644FA00000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000000E29EB4uLL}, {0x078644FA00000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000000714F5AuLL}, {0x078644FA00000000uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA00000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA00000000uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFFuLL}, {0x078644FA00000000uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFEuLL}, {0x078644FA00000000uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFDuLL}, {0x078644FA00000000uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFF0uLL}, {0x078644FA00000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E5F879BB06uLL}, {0x078644FA00000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E5F8B851ECuLL}, {0x078644FA00000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000001uLL}, {0x078644FA00000000uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E580000000uLL}, {0x078644FA00000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E500000003uLL}, {0x078644FA00000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E500000002uLL}, {0x078644FA00000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E500000001uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000000uLL}, {0x078644FA00000001uLL, 0x0000000000000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL}, {0x078644FA00000001uLL, 0x0000000000000002uLL, 0x03C3227D00000000uLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x0000000000000003uLL, 0x028216FE00000000uLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x0000000000000010uLL, 0x0078644FA0000000uLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x00000000078644FAuLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x000000000747AE14uLL, 0x000000010898F295uLL, 0x0000000004D8C65DuLL}, {0x078644FA00000001uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x000000000F0C89F5uLL}, {0x078644FA00000001uLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001692CEEFuLL}, {0x078644FA00000001uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000000F0C89F5uLL}, {0x078644FA00000001uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000078644FBuLL}, {0x078644FA00000001uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x0000000100000001uLL, 0x00000000078644F9uLL, 0x00000000F879BB08uLL}, {0x078644FA00000001uLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F0F3760FuLL}, {0x078644FA00000001uLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000E96D3116uLL}, {0x078644FA00000001uLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x00000000879BB071uLL}, {0x078644FA00000001uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x000000006C09ACD3uLL}, {0x078644FA00000001uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000082B63E29uLL}, {0x078644FA00000001uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000005042DFDuLL}, {0x078644FA00000001uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000000B496778uLL}, {0x078644FA00000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000000078644FBuLL}, {0x078644FA00000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000003C3227EuLL}, {0x078644FA00000001uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x0000000200000001uLL, 0x0000000003C3227CuLL, 0x00000001FC3CDD85uLL}, {0x078644FA00000001uLL, 0x0000000200000002uLL, 0x0000000003C3227CuLL, 0x00000001F879BB09uLL}, {0x078644FA00000001uLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001F4B6988DuLL}, {0x078644FA00000001uLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001C3CDD841uLL}, {0x078644FA00000001uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000181754583uLL}, {0x078644FA00000001uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x000000019B4CF185uLL}, {0x078644FA00000001uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x00000001830281FEuLL}, {0x078644FA00000001uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x0000000180000001uLL}, {0x078644FA00000001uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000000078644FBuLL}, {0x078644FA00000001uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000005042DFDuLL}, {0x078644FA00000001uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000000028216FFuLL}, {0x078644FA00000001uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x0000000300000001uLL, 0x00000000028216FDuLL, 0x00000002FD7DE904uLL}, {0x078644FA00000001uLL, 0x0000000300000002uLL, 0x00000000028216FDuLL, 0x00000002FAFBD207uLL}, {0x078644FA00000001uLL, 0x0000000300000003uLL, 0x00000000028216FDuLL, 0x00000002F879BB0AuLL}, {0x078644FA00000001uLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002D7DE9031uLL}, {0x078644FA00000001uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x0000000266ACEAE5uLL}, {0x078644FA00000001uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000CC648251uLL}, {0x078644FA00000001uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000282265CDAuLL}, {0x078644FA00000001uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x0000000280000001uLL}, {0x078644FA00000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000205A4B3BBuLL}, {0x078644FA00000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000203C3227DuLL}, {0x078644FA00000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000201E1913FuLL}, {0x078644FA00000001uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A00000001uLL}, {0x078644FA00000001uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x00000009FF879BB2uLL}, {0x078644FA00000001uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x00000009FF0F3763uLL}, {0x078644FA00000001uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x00000009FE96D314uLL}, {0x078644FA00000001uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x00000009F879BB11uLL}, {0x078644FA00000001uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000001E3B0AC9uLL}, {0x078644FA00000001uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000438F2016DuLL}, {0x078644FA00000001uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C0074BE5DuLL}, {0x078644FA00000001uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C00000001uLL}, {0x078644FA00000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000000153EE0FuLL}, {0x078644FA00000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000000E29EB5uLL}, {0x078644FA00000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000000714F5BuLL}, {0x078644FA00000001uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x078644FA00000001uLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA00000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E600000001uLL}, {0x078644FA00000001uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA00000001uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFFuLL}, {0x078644FA00000001uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFEuLL}, {0x078644FA00000001uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFF1uLL}, {0x078644FA00000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E5F879BB07uLL}, {0x078644FA00000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E5F8B851EDuLL}, {0x078644FA00000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000002uLL}, {0x078644FA00000001uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E580000001uLL}, {0x078644FA00000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E500000004uLL}, {0x078644FA00000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E500000003uLL}, {0x078644FA00000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E500000002uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000001uLL}, {0x078644FA00000002uLL, 0x0000000000000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL}, {0x078644FA00000002uLL, 0x0000000000000002uLL, 0x03C3227D00000001uLL, 0x0000000000000000uLL}, {0x078644FA00000002uLL, 0x0000000000000003uLL, 0x028216FE00000000uLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x0000000000000010uLL, 0x0078644FA0000000uLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x00000000078644FAuLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x000000000747AE14uLL, 0x000000010898F295uLL, 0x0000000004D8C65EuLL}, {0x078644FA00000002uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x000000000F0C89F6uLL}, {0x078644FA00000002uLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001692CEF0uLL}, {0x078644FA00000002uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000000F0C89F6uLL}, {0x078644FA00000002uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000078644FCuLL}, {0x078644FA00000002uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x0000000100000001uLL, 0x00000000078644F9uLL, 0x00000000F879BB09uLL}, {0x078644FA00000002uLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F0F37610uLL}, {0x078644FA00000002uLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000E96D3117uLL}, {0x078644FA00000002uLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x00000000879BB072uLL}, {0x078644FA00000002uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x000000006C09ACD4uLL}, {0x078644FA00000002uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000082B63E2AuLL}, {0x078644FA00000002uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000005042DFEuLL}, {0x078644FA00000002uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000000B496779uLL}, {0x078644FA00000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000000078644FCuLL}, {0x078644FA00000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000003C3227FuLL}, {0x078644FA00000002uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x0000000200000001uLL, 0x0000000003C3227CuLL, 0x00000001FC3CDD86uLL}, {0x078644FA00000002uLL, 0x0000000200000002uLL, 0x0000000003C3227CuLL, 0x00000001F879BB0AuLL}, {0x078644FA00000002uLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001F4B6988EuLL}, {0x078644FA00000002uLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001C3CDD842uLL}, {0x078644FA00000002uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000181754584uLL}, {0x078644FA00000002uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x000000019B4CF186uLL}, {0x078644FA00000002uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x00000001830281FFuLL}, {0x078644FA00000002uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x0000000180000002uLL}, {0x078644FA00000002uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000000078644FCuLL}, {0x078644FA00000002uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000005042DFEuLL}, {0x078644FA00000002uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x0000000002821700uLL}, {0x078644FA00000002uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x0000000300000001uLL, 0x00000000028216FDuLL, 0x00000002FD7DE905uLL}, {0x078644FA00000002uLL, 0x0000000300000002uLL, 0x00000000028216FDuLL, 0x00000002FAFBD208uLL}, {0x078644FA00000002uLL, 0x0000000300000003uLL, 0x00000000028216FDuLL, 0x00000002F879BB0BuLL}, {0x078644FA00000002uLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002D7DE9032uLL}, {0x078644FA00000002uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x0000000266ACEAE6uLL}, {0x078644FA00000002uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000CC648252uLL}, {0x078644FA00000002uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000282265CDBuLL}, {0x078644FA00000002uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x0000000280000002uLL}, {0x078644FA00000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000205A4B3BCuLL}, {0x078644FA00000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000203C3227EuLL}, {0x078644FA00000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000201E19140uLL}, {0x078644FA00000002uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A00000002uLL}, {0x078644FA00000002uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x00000009FF879BB3uLL}, {0x078644FA00000002uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x00000009FF0F3764uLL}, {0x078644FA00000002uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x00000009FE96D315uLL}, {0x078644FA00000002uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x00000009F879BB12uLL}, {0x078644FA00000002uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000001E3B0ACAuLL}, {0x078644FA00000002uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000438F2016EuLL}, {0x078644FA00000002uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C0074BE5EuLL}, {0x078644FA00000002uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C00000002uLL}, {0x078644FA00000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000000153EE10uLL}, {0x078644FA00000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000000E29EB6uLL}, {0x078644FA00000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000000714F5CuLL}, {0x078644FA00000002uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x078644FA00000002uLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x078644FA00000002uLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA00000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E600000002uLL}, {0x078644FA00000002uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E600000001uLL}, {0x078644FA00000002uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA00000002uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFFuLL}, {0x078644FA00000002uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFF2uLL}, {0x078644FA00000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E5F879BB08uLL}, {0x078644FA00000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E5F8B851EEuLL}, {0x078644FA00000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000003uLL}, {0x078644FA00000002uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E580000002uLL}, {0x078644FA00000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E500000005uLL}, {0x078644FA00000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E500000004uLL}, {0x078644FA00000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E500000003uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000002uLL}, {0x078644FA00000003uLL, 0x0000000000000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL}, {0x078644FA00000003uLL, 0x0000000000000002uLL, 0x03C3227D00000001uLL, 0x0000000000000001uLL}, {0x078644FA00000003uLL, 0x0000000000000003uLL, 0x028216FE00000001uLL, 0x0000000000000000uLL}, {0x078644FA00000003uLL, 0x0000000000000010uLL, 0x0078644FA0000000uLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x00000000078644FAuLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x000000000747AE14uLL, 0x000000010898F295uLL, 0x0000000004D8C65FuLL}, {0x078644FA00000003uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x000000000F0C89F7uLL}, {0x078644FA00000003uLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001692CEF1uLL}, {0x078644FA00000003uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000000F0C89F7uLL}, {0x078644FA00000003uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000078644FDuLL}, {0x078644FA00000003uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x0000000100000001uLL, 0x00000000078644F9uLL, 0x00000000F879BB0AuLL}, {0x078644FA00000003uLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F0F37611uLL}, {0x078644FA00000003uLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000E96D3118uLL}, {0x078644FA00000003uLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x00000000879BB073uLL}, {0x078644FA00000003uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x000000006C09ACD5uLL}, {0x078644FA00000003uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000082B63E2BuLL}, {0x078644FA00000003uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000005042DFFuLL}, {0x078644FA00000003uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000000B49677AuLL}, {0x078644FA00000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000000078644FDuLL}, {0x078644FA00000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000003C32280uLL}, {0x078644FA00000003uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x0000000200000001uLL, 0x0000000003C3227CuLL, 0x00000001FC3CDD87uLL}, {0x078644FA00000003uLL, 0x0000000200000002uLL, 0x0000000003C3227CuLL, 0x00000001F879BB0BuLL}, {0x078644FA00000003uLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001F4B6988FuLL}, {0x078644FA00000003uLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001C3CDD843uLL}, {0x078644FA00000003uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000181754585uLL}, {0x078644FA00000003uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x000000019B4CF187uLL}, {0x078644FA00000003uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x0000000183028200uLL}, {0x078644FA00000003uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x0000000180000003uLL}, {0x078644FA00000003uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000000078644FDuLL}, {0x078644FA00000003uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000005042DFFuLL}, {0x078644FA00000003uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x0000000002821701uLL}, {0x078644FA00000003uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x0000000300000001uLL, 0x00000000028216FDuLL, 0x00000002FD7DE906uLL}, {0x078644FA00000003uLL, 0x0000000300000002uLL, 0x00000000028216FDuLL, 0x00000002FAFBD209uLL}, {0x078644FA00000003uLL, 0x0000000300000003uLL, 0x00000000028216FDuLL, 0x00000002F879BB0CuLL}, {0x078644FA00000003uLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002D7DE9033uLL}, {0x078644FA00000003uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x0000000266ACEAE7uLL}, {0x078644FA00000003uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000CC648253uLL}, {0x078644FA00000003uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000282265CDCuLL}, {0x078644FA00000003uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x0000000280000003uLL}, {0x078644FA00000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000205A4B3BDuLL}, {0x078644FA00000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000203C3227FuLL}, {0x078644FA00000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000201E19141uLL}, {0x078644FA00000003uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A00000003uLL}, {0x078644FA00000003uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x00000009FF879BB4uLL}, {0x078644FA00000003uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x00000009FF0F3765uLL}, {0x078644FA00000003uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x00000009FE96D316uLL}, {0x078644FA00000003uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x00000009F879BB13uLL}, {0x078644FA00000003uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000001E3B0ACBuLL}, {0x078644FA00000003uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000438F2016FuLL}, {0x078644FA00000003uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C0074BE5FuLL}, {0x078644FA00000003uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C00000003uLL}, {0x078644FA00000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000000153EE11uLL}, {0x078644FA00000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000000E29EB7uLL}, {0x078644FA00000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000000714F5DuLL}, {0x078644FA00000003uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x078644FA00000003uLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x078644FA00000003uLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x078644FA00000003uLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA00000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E600000003uLL}, {0x078644FA00000003uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E600000002uLL}, {0x078644FA00000003uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E600000001uLL}, {0x078644FA00000003uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA00000003uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFF3uLL}, {0x078644FA00000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E5F879BB09uLL}, {0x078644FA00000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E5F8B851EFuLL}, {0x078644FA00000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000004uLL}, {0x078644FA00000003uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E580000003uLL}, {0x078644FA00000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E500000006uLL}, {0x078644FA00000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E500000005uLL}, {0x078644FA00000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E500000004uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000003uLL}, {0x078644FA00000010uLL, 0x0000000000000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL}, {0x078644FA00000010uLL, 0x0000000000000002uLL, 0x03C3227D00000008uLL, 0x0000000000000000uLL}, {0x078644FA00000010uLL, 0x0000000000000003uLL, 0x028216FE00000005uLL, 0x0000000000000001uLL}, {0x078644FA00000010uLL, 0x0000000000000010uLL, 0x0078644FA0000001uLL, 0x0000000000000000uLL}, {0x078644FA00000010uLL, 0x00000000078644FAuLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x000000000747AE14uLL, 0x000000010898F295uLL, 0x0000000004D8C66CuLL}, {0x078644FA00000010uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x000000000F0C8A04uLL}, {0x078644FA00000010uLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001692CEFEuLL}, {0x078644FA00000010uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000000F0C8A04uLL}, {0x078644FA00000010uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x000000000786450AuLL}, {0x078644FA00000010uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x0000000100000001uLL, 0x00000000078644F9uLL, 0x00000000F879BB17uLL}, {0x078644FA00000010uLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F0F3761EuLL}, {0x078644FA00000010uLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000E96D3125uLL}, {0x078644FA00000010uLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x00000000879BB080uLL}, {0x078644FA00000010uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x000000006C09ACE2uLL}, {0x078644FA00000010uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000082B63E38uLL}, {0x078644FA00000010uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000005042E0CuLL}, {0x078644FA00000010uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000000B496787uLL}, {0x078644FA00000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x000000000786450AuLL}, {0x078644FA00000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000003C3228DuLL}, {0x078644FA00000010uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x0000000200000001uLL, 0x0000000003C3227CuLL, 0x00000001FC3CDD94uLL}, {0x078644FA00000010uLL, 0x0000000200000002uLL, 0x0000000003C3227CuLL, 0x00000001F879BB18uLL}, {0x078644FA00000010uLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001F4B6989CuLL}, {0x078644FA00000010uLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001C3CDD850uLL}, {0x078644FA00000010uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000181754592uLL}, {0x078644FA00000010uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x000000019B4CF194uLL}, {0x078644FA00000010uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x000000018302820DuLL}, {0x078644FA00000010uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x0000000180000010uLL}, {0x078644FA00000010uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x000000000786450AuLL}, {0x078644FA00000010uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000005042E0CuLL}, {0x078644FA00000010uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x000000000282170EuLL}, {0x078644FA00000010uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x0000000300000001uLL, 0x00000000028216FDuLL, 0x00000002FD7DE913uLL}, {0x078644FA00000010uLL, 0x0000000300000002uLL, 0x00000000028216FDuLL, 0x00000002FAFBD216uLL}, {0x078644FA00000010uLL, 0x0000000300000003uLL, 0x00000000028216FDuLL, 0x00000002F879BB19uLL}, {0x078644FA00000010uLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002D7DE9040uLL}, {0x078644FA00000010uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x0000000266ACEAF4uLL}, {0x078644FA00000010uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000CC648260uLL}, {0x078644FA00000010uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000282265CE9uLL}, {0x078644FA00000010uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x0000000280000010uLL}, {0x078644FA00000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000205A4B3CAuLL}, {0x078644FA00000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000203C3228CuLL}, {0x078644FA00000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000201E1914EuLL}, {0x078644FA00000010uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A00000010uLL}, {0x078644FA00000010uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x00000009FF879BC1uLL}, {0x078644FA00000010uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x00000009FF0F3772uLL}, {0x078644FA00000010uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x00000009FE96D323uLL}, {0x078644FA00000010uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x00000009F879BB20uLL}, {0x078644FA00000010uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000001E3B0AD8uLL}, {0x078644FA00000010uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000438F2017CuLL}, {0x078644FA00000010uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C0074BE6CuLL}, {0x078644FA00000010uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C00000010uLL}, {0x078644FA00000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000000153EE1EuLL}, {0x078644FA00000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000000E29EC4uLL}, {0x078644FA00000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000000714F6AuLL}, {0x078644FA00000010uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x078644FA00000010uLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x078644FA00000010uLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x078644FA00000010uLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x078644FA00000010uLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA00000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E600000010uLL}, {0x078644FA00000010uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E60000000FuLL}, {0x078644FA00000010uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E60000000EuLL}, {0x078644FA00000010uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E60000000DuLL}, {0x078644FA00000010uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA00000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E5F879BB16uLL}, {0x078644FA00000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E5F8B851FCuLL}, {0x078644FA00000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000011uLL}, {0x078644FA00000010uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E580000010uLL}, {0x078644FA00000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E500000013uLL}, {0x078644FA00000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E500000012uLL}, {0x078644FA00000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E500000011uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA00000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA00000010uLL}, {0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x0000000000000002uLL, 0x03C3227D03C3227DuLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x0000000000000003uLL, 0x028216FE028216FEuLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x0000000000000010uLL, 0x0078644FA078644FuLL, 0x000000000000000AuLL}, {0x078644FA078644FAuLL, 0x00000000078644FAuLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x000000000747AE14uLL, 0x000000010898F296uLL, 0x0000000005175D42uLL}, {0x078644FA078644FAuLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x000000001692CEEEuLL}, {0x078644FA078644FAuLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x00000000078644FAuLL}, {0x078644FA078644FAuLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001E1913E8uLL}, {0x078644FA078644FAuLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000001692CEEEuLL}, {0x078644FA078644FAuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x000000000F0C89F4uLL}, {0x078644FA078644FAuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x00000000078644FAuLL}, {0x078644FA078644FAuLL, 0x0000000100000001uLL, 0x00000000078644FAuLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F879BB08uLL}, {0x078644FA078644FAuLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000F0F3760FuLL}, {0x078644FA078644FAuLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x000000008F21F56AuLL}, {0x078644FA078644FAuLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x00000000738FF1CCuLL}, {0x078644FA078644FAuLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x000000008A3C8322uLL}, {0x078644FA078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x000000000C8A72F6uLL}, {0x078644FA078644FAuLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x00000000078644FAuLL}, {0x078644FA078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x0000000012CFAC71uLL}, {0x078644FA078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x000000000F0C89F4uLL}, {0x078644FA078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x000000000B496777uLL}, {0x078644FA078644FAuLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x00000000078644FAuLL}, {0x078644FA078644FAuLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x0000000003C3227DuLL}, {0x078644FA078644FAuLL, 0x0000000200000002uLL, 0x0000000003C3227DuLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001FC3CDD86uLL}, {0x078644FA078644FAuLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001CB541D3AuLL}, {0x078644FA078644FAuLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000188FB8A7CuLL}, {0x078644FA078644FAuLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x00000001A2D3367EuLL}, {0x078644FA078644FAuLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x000000018A88C6F7uLL}, {0x078644FA078644FAuLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x00000001878644FAuLL}, {0x078644FA078644FAuLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x000000000F0C89F4uLL}, {0x078644FA078644FAuLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x000000000C8A72F6uLL}, {0x078644FA078644FAuLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x000000000A085BF8uLL}, {0x078644FA078644FAuLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x00000000078644FAuLL}, {0x078644FA078644FAuLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x0000000005042DFCuLL}, {0x078644FA078644FAuLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x00000000028216FEuLL}, {0x078644FA078644FAuLL, 0x0000000300000003uLL, 0x00000000028216FEuLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002DF64D52AuLL}, {0x078644FA078644FAuLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x000000026E332FDEuLL}, {0x078644FA078644FAuLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000D3EAC74AuLL}, {0x078644FA078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000289ACA1D3uLL}, {0x078644FA078644FAuLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x00000002878644FAuLL}, {0x078644FA078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x000000020D2AF8B4uLL}, {0x078644FA078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x000000020B496776uLL}, {0x078644FA078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x000000020967D638uLL}, {0x078644FA078644FAuLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A078644FAuLL}, {0x078644FA078644FAuLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000A070DE0ABuLL}, {0x078644FA078644FAuLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000A06957C5CuLL}, {0x078644FA078644FAuLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000A061D180DuLL}, {0x078644FA078644FAuLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x0000000A0000000AuLL}, {0x078644FA078644FAuLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x0000000025C14FC2uLL}, {0x078644FA078644FAuLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000440784666uLL}, {0x078644FA078644FAuLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C07FB0356uLL}, {0x078644FA078644FAuLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C078644FAuLL}, {0x078644FA078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x0000000008DA3308uLL}, {0x078644FA078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x000000000868E3AEuLL}, {0x078644FA078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000007F79454uLL}, {0x078644FA078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x078644FA078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x078644FA078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x078644FA078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x078644FA078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x078644FA078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x078644FA078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E6078644FAuLL}, {0x078644FA078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E6078644F9uLL}, {0x078644FA078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E6078644F8uLL}, {0x078644FA078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E6078644F7uLL}, {0x078644FA078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E6078644EAuLL}, {0x078644FA078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E6003E96E6uLL}, {0x078644FA078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E5878644FBuLL}, {0x078644FA078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E5878644FAuLL}, {0x078644FA078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E5078644FDuLL}, {0x078644FA078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E5078644FCuLL}, {0x078644FA078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E5078644FBuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA078644FAuLL}, {0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL}, {0x078644FA0747AE14uLL, 0x0000000000000002uLL, 0x03C3227D03A3D70AuLL, 0x0000000000000000uLL}, {0x078644FA0747AE14uLL, 0x0000000000000003uLL, 0x028216FE026D3A06uLL, 0x0000000000000002uLL}, {0x078644FA0747AE14uLL, 0x0000000000000010uLL, 0x0078644FA0747AE1uLL, 0x0000000000000004uLL}, {0x078644FA0747AE14uLL, 0x00000000078644FAuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x000000000747AE14uLL, 0x000000010898F296uLL, 0x0000000004D8C65CuLL}, {0x078644FA0747AE14uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F4uLL, 0x0000000016543808uLL}, {0x078644FA0747AE14uLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000001DDA7D02uLL}, {0x078644FA0747AE14uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000016543808uLL}, {0x078644FA0747AE14uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x000000000ECDF30EuLL}, {0x078644FA0747AE14uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x0000000100000001uLL, 0x00000000078644F9uLL, 0x00000000FFC1691BuLL}, {0x078644FA0747AE14uLL, 0x0000000100000002uLL, 0x00000000078644F9uLL, 0x00000000F83B2422uLL}, {0x078644FA0747AE14uLL, 0x0000000100000003uLL, 0x00000000078644F9uLL, 0x00000000F0B4DF29uLL}, {0x078644FA0747AE14uLL, 0x0000000100000010uLL, 0x00000000078644F9uLL, 0x000000008EE35E84uLL}, {0x078644FA0747AE14uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x0000000073515AE6uLL}, {0x078644FA0747AE14uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000089FDEC3CuLL}, {0x078644FA0747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x000000000C4BDC10uLL}, {0x078644FA0747AE14uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000001291158BuLL}, {0x078644FA0747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x000000000ECDF30EuLL}, {0x078644FA0747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x000000000B0AD091uLL}, {0x078644FA0747AE14uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x0000000003848B97uLL}, {0x078644FA0747AE14uLL, 0x0000000200000002uLL, 0x0000000003C3227CuLL, 0x00000001FFC1691CuLL}, {0x078644FA0747AE14uLL, 0x0000000200000003uLL, 0x0000000003C3227CuLL, 0x00000001FBFE46A0uLL}, {0x078644FA0747AE14uLL, 0x0000000200000010uLL, 0x0000000003C3227CuLL, 0x00000001CB158654uLL}, {0x078644FA0747AE14uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000188BCF396uLL}, {0x078644FA0747AE14uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D3uLL, 0x00000001A2949F98uLL}, {0x078644FA0747AE14uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x000000018A4A3011uLL}, {0x078644FA0747AE14uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x000000018747AE14uLL}, {0x078644FA0747AE14uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x000000000ECDF30EuLL}, {0x078644FA0747AE14uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x000000000C4BDC10uLL}, {0x078644FA0747AE14uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x0000000009C9C512uLL}, {0x078644FA0747AE14uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x0000000004C59716uLL}, {0x078644FA0747AE14uLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x0000000002438018uLL}, {0x078644FA0747AE14uLL, 0x0000000300000003uLL, 0x00000000028216FDuLL, 0x00000002FFC1691DuLL}, {0x078644FA0747AE14uLL, 0x0000000300000010uLL, 0x00000000028216FDuLL, 0x00000002DF263E44uLL}, {0x078644FA0747AE14uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x000000026DF498F8uLL}, {0x078644FA0747AE14uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000000D3AC3064uLL}, {0x078644FA0747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x00000002896E0AEDuLL}, {0x078644FA0747AE14uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x000000028747AE14uLL}, {0x078644FA0747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x000000020CEC61CEuLL}, {0x078644FA0747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x000000020B0AD090uLL}, {0x078644FA0747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000209293F52uLL}, {0x078644FA0747AE14uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A0747AE14uLL}, {0x078644FA0747AE14uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000A06CF49C5uLL}, {0x078644FA0747AE14uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000A0656E576uLL}, {0x078644FA0747AE14uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000A05DE8127uLL}, {0x078644FA0747AE14uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x00000009FFC16924uLL}, {0x078644FA0747AE14uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000002582B8DCuLL}, {0x078644FA0747AE14uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x000000044039AF80uLL}, {0x078644FA0747AE14uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C07BC6C70uLL}, {0x078644FA0747AE14uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C0747AE14uLL}, {0x078644FA0747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x00000000089B9C22uLL}, {0x078644FA0747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x00000000082A4CC8uLL}, {0x078644FA0747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000007B8FD6EuLL}, {0x078644FA0747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x078644FA0747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x078644FA0747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x078644FA0747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x078644FA0747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x078644FA0747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA0747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E60747AE14uLL}, {0x078644FA0747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E60747AE13uLL}, {0x078644FA0747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E60747AE12uLL}, {0x078644FA0747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E60747AE11uLL}, {0x078644FA0747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E60747AE04uLL}, {0x078644FA0747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E5FFC1691AuLL}, {0x078644FA0747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA0747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E58747AE15uLL}, {0x078644FA0747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E58747AE14uLL}, {0x078644FA0747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E50747AE17uLL}, {0x078644FA0747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E50747AE16uLL}, {0x078644FA0747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E50747AE15uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA0747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA0747AE14uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000000000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000000000002uLL, 0x03C3227D3FFFFFFFuLL, 0x0000000000000001uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000000000003uLL, 0x028216FE2AAAAAAAuLL, 0x0000000000000001uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000000000010uLL, 0x0078644FA7FFFFFFuLL, 0x000000000000000FuLL}, {0x078644FA7FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000100000011uLL, 0x0000000000156B65uLL}, {0x078644FA7FFFFFFFuLL, 0x000000000747AE14uLL, 0x000000010898F2A7uLL, 0x0000000001CE88F3uLL}, {0x078644FA7FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F5uLL, 0x000000000F0C89F4uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000080000000uLL, 0x000000000F0C89F4uLL, 0x000000007FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000009692CEEDuLL}, {0x078644FA7FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000008F0C89F3uLL}, {0x078644FA7FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000878644F9uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x000000007FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000100000001uLL, 0x00000000078644FAuLL, 0x000000007879BB05uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000100000002uLL, 0x00000000078644FAuLL, 0x0000000070F3760BuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000100000003uLL, 0x00000000078644FAuLL, 0x00000000696D3111uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000100000010uLL, 0x00000000078644FAuLL, 0x00000000079BB05FuLL}, {0x078644FA7FFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x00000000EC09ACD1uLL}, {0x078644FA7FFFFFFFuLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000102B63E27uLL}, {0x078644FA7FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000085042DFBuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x000000007FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000008B496776uLL}, {0x078644FA7FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000000878644F9uLL}, {0x078644FA7FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000083C3227CuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x000000007FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x000000007C3CDD82uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000003C3227DuLL, 0x000000007879BB05uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000003C3227DuLL, 0x0000000074B69888uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000003C3227DuLL, 0x0000000043CDD82FuLL}, {0x078644FA7FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000201754581uLL}, {0x078644FA7FFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000003B5A1D4uLL, 0x000000001405436FuLL}, {0x078644FA7FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x00000002030281FCuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x00000001FFFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000000878644F9uLL}, {0x078644FA7FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000085042DFBuLL}, {0x078644FA7FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000000828216FDuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x000000007FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x000000007D7DE901uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x000000007AFBD203uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000300000003uLL, 0x00000000028216FEuLL, 0x000000007879BB05uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000300000010uLL, 0x00000000028216FEuLL, 0x0000000057DE901FuLL}, {0x078644FA7FFFFFFFuLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x00000002E6ACEAE3uLL}, {0x078644FA7FFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x000000014C64824FuLL}, {0x078644FA7FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000302265CD8uLL}, {0x078644FA7FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x00000002FFFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000285A4B3B9uLL}, {0x078644FA7FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000283C3227BuLL}, {0x078644FA7FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000281E1913DuLL}, {0x078644FA7FFFFFFFuLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000A7F879BB0uLL}, {0x078644FA7FFFFFFFuLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000A7F0F3761uLL}, {0x078644FA7FFFFFFFuLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000A7E96D312uLL}, {0x078644FA7FFFFFFFuLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x0000000A7879BB0FuLL}, {0x078644FA7FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000009E3B0AC7uLL}, {0x078644FA7FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x00000004B8F2016BuLL}, {0x078644FA7FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C8074BE5BuLL}, {0x078644FA7FFFFFFFuLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000008153EE0DuLL}, {0x078644FA7FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000080E29EB3uLL}, {0x078644FA7FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000080714F59uLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA7FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFEuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFDuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFCuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFEFuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E67879BB05uLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E678B851EBuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E580000002uLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E580000001uLL}, {0x078644FA7FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000000uLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA7FFFFFFFuLL}, {0x078644FA80000000uLL, 0x0000000000000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL}, {0x078644FA80000000uLL, 0x0000000000000002uLL, 0x03C3227D40000000uLL, 0x0000000000000000uLL}, {0x078644FA80000000uLL, 0x0000000000000003uLL, 0x028216FE2AAAAAAAuLL, 0x0000000000000002uLL}, {0x078644FA80000000uLL, 0x0000000000000010uLL, 0x0078644FA8000000uLL, 0x0000000000000000uLL}, {0x078644FA80000000uLL, 0x00000000078644FAuLL, 0x0000000100000011uLL, 0x0000000000156B66uLL}, {0x078644FA80000000uLL, 0x000000000747AE14uLL, 0x000000010898F2A7uLL, 0x0000000001CE88F4uLL}, {0x078644FA80000000uLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F5uLL, 0x000000000F0C89F5uLL}, {0x078644FA80000000uLL, 0x0000000080000000uLL, 0x000000000F0C89F5uLL, 0x0000000000000000uLL}, {0x078644FA80000000uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x000000009692CEEEuLL}, {0x078644FA80000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x000000008F0C89F4uLL}, {0x078644FA80000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000878644FAuLL}, {0x078644FA80000000uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x0000000080000000uLL}, {0x078644FA80000000uLL, 0x0000000100000001uLL, 0x00000000078644FAuLL, 0x000000007879BB06uLL}, {0x078644FA80000000uLL, 0x0000000100000002uLL, 0x00000000078644FAuLL, 0x0000000070F3760CuLL}, {0x078644FA80000000uLL, 0x0000000100000003uLL, 0x00000000078644FAuLL, 0x00000000696D3112uLL}, {0x078644FA80000000uLL, 0x0000000100000010uLL, 0x00000000078644FAuLL, 0x00000000079BB060uLL}, {0x078644FA80000000uLL, 0x00000001078644FAuLL, 0x00000000074F44A3uLL, 0x00000000EC09ACD2uLL}, {0x078644FA80000000uLL, 0x000000010747AE14uLL, 0x000000000751017EuLL, 0x0000000102B63E28uLL}, {0x078644FA80000000uLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000085042DFCuLL}, {0x078644FA80000000uLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x0000000080000000uLL}, {0x078644FA80000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000008B496777uLL}, {0x078644FA80000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000000878644FAuLL}, {0x078644FA80000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000083C3227DuLL}, {0x078644FA80000000uLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x0000000080000000uLL}, {0x078644FA80000000uLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x000000007C3CDD83uLL}, {0x078644FA80000000uLL, 0x0000000200000002uLL, 0x0000000003C3227DuLL, 0x000000007879BB06uLL}, {0x078644FA80000000uLL, 0x0000000200000003uLL, 0x0000000003C3227DuLL, 0x0000000074B69889uLL}, {0x078644FA80000000uLL, 0x0000000200000010uLL, 0x0000000003C3227DuLL, 0x0000000043CDD830uLL}, {0x078644FA80000000uLL, 0x00000002078644FAuLL, 0x0000000003B52F6BuLL, 0x0000000201754582uLL}, {0x078644FA80000000uLL, 0x000000020747AE14uLL, 0x0000000003B5A1D4uLL, 0x0000000014054370uLL}, {0x078644FA80000000uLL, 0x000000027FFFFFFFuLL, 0x00000000030281FDuLL, 0x00000002030281FDuLL}, {0x078644FA80000000uLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x0000000200000000uLL}, {0x078644FA80000000uLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000000878644FAuLL}, {0x078644FA80000000uLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000085042DFCuLL}, {0x078644FA80000000uLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000000828216FEuLL}, {0x078644FA80000000uLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x0000000080000000uLL}, {0x078644FA80000000uLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x000000007D7DE902uLL}, {0x078644FA80000000uLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x000000007AFBD204uLL}, {0x078644FA80000000uLL, 0x0000000300000003uLL, 0x00000000028216FEuLL, 0x000000007879BB06uLL}, {0x078644FA80000000uLL, 0x0000000300000010uLL, 0x00000000028216FEuLL, 0x0000000057DE9020uLL}, {0x078644FA80000000uLL, 0x00000003078644FAuLL, 0x00000000027BDC26uLL, 0x00000002E6ACEAE4uLL}, {0x078644FA80000000uLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x000000014C648250uLL}, {0x078644FA80000000uLL, 0x000000037FFFFFFFuLL, 0x0000000002265CD9uLL, 0x0000000302265CD9uLL}, {0x078644FA80000000uLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x0000000300000000uLL}, {0x078644FA80000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000285A4B3BAuLL}, {0x078644FA80000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000283C3227CuLL}, {0x078644FA80000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000281E1913EuLL}, {0x078644FA80000000uLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000A80000000uLL}, {0x078644FA80000000uLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000A7F879BB1uLL}, {0x078644FA80000000uLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000A7F0F3762uLL}, {0x078644FA80000000uLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000A7E96D313uLL}, {0x078644FA80000000uLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x0000000A7879BB10uLL}, {0x078644FA80000000uLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000009E3B0AC8uLL}, {0x078644FA80000000uLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x00000004B8F2016CuLL}, {0x078644FA80000000uLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000C8074BE5CuLL}, {0x078644FA80000000uLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000C80000000uLL}, {0x078644FA80000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000008153EE0EuLL}, {0x078644FA80000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000080E29EB4uLL}, {0x078644FA80000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000080714F5AuLL}, {0x078644FA80000000uLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x078644FA80000000uLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x078644FA80000000uLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x078644FA80000000uLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x078644FA80000000uLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x078644FA80000000uLL, 0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x078644FA80000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x078644FA80000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x078644FA80000000uLL, 0x078644FA80000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FA80000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E680000000uLL}, {0x078644FA80000000uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFFuLL}, {0x078644FA80000000uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFEuLL}, {0x078644FA80000000uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFDuLL}, {0x078644FA80000000uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFF0uLL}, {0x078644FA80000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E67879BB06uLL}, {0x078644FA80000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E678B851ECuLL}, {0x078644FA80000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E600000001uLL}, {0x078644FA80000000uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FA80000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E580000003uLL}, {0x078644FA80000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E580000002uLL}, {0x078644FA80000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E580000001uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FA80000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FA80000000uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000000000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000000000002uLL, 0x03C3227D7FFFFFFEuLL, 0x0000000000000001uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000000000003uLL, 0x028216FE55555554uLL, 0x0000000000000001uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000000000010uLL, 0x0078644FAFFFFFFFuLL, 0x000000000000000DuLL}, {0x078644FAFFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000000100000022uLL, 0x00000000002AD6C9uLL}, {0x078644FAFFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000010898F2B8uLL, 0x00000000060BF99DuLL}, {0x078644FAFFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F6uLL, 0x000000000F0C89F3uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000080000000uLL, 0x000000000F0C89F5uLL, 0x000000007FFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FBuLL, 0x000000001692CEEEuLL}, {0x078644FAFFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FBuLL, 0x000000000F0C89F3uLL}, {0x078644FAFFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FBuLL, 0x00000000078644F8uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000100000001uLL, 0x00000000078644FAuLL, 0x00000000F879BB03uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000100000002uLL, 0x00000000078644FAuLL, 0x00000000F0F37609uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000100000003uLL, 0x00000000078644FAuLL, 0x00000000E96D310FuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000100000010uLL, 0x00000000078644FAuLL, 0x00000000879BB05DuLL}, {0x078644FAFFFFFFFDuLL, 0x00000001078644FAuLL, 0x00000000074F44A4uLL, 0x00000000648367D5uLL}, {0x078644FAFFFFFFFDuLL, 0x000000010747AE14uLL, 0x000000000751017FuLL, 0x000000007B6E9011uLL}, {0x078644FAFFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000105042DF9uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000010B496774uLL}, {0x078644FAFFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000001078644F7uLL}, {0x078644FAFFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000103C3227AuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x00000000FC3CDD80uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000003C3227DuLL, 0x00000000F879BB03uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000003C3227DuLL, 0x00000000F4B69886uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000003C3227DuLL, 0x00000000C3CDD82DuLL}, {0x078644FAFFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000003B52F6CuLL, 0x0000000079EF0085uLL}, {0x078644FAFFFFFFFDuLL, 0x000000020747AE14uLL, 0x0000000003B5A1D4uLL, 0x000000009405436DuLL}, {0x078644FAFFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x00000000030281FEuLL, 0x00000000030281FBuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x000000027FFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000001078644F7uLL}, {0x078644FAFFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000105042DF9uLL}, {0x078644FAFFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000001028216FBuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x00000000FD7DE8FFuLL}, {0x078644FAFFFFFFFDuLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x00000000FAFBD201uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000300000003uLL, 0x00000000028216FEuLL, 0x00000000F879BB03uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000300000010uLL, 0x00000000028216FEuLL, 0x00000000D7DE901DuLL}, {0x078644FAFFFFFFFDuLL, 0x00000003078644FAuLL, 0x00000000027BDC27uLL, 0x000000005F26A5E7uLL}, {0x078644FAFFFFFFFDuLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000001CC64824DuLL}, {0x078644FAFFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000002265CDAuLL, 0x0000000002265CD7uLL}, {0x078644FAFFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x000000037FFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000305A4B3B7uLL}, {0x078644FAFFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000303C32279uLL}, {0x078644FAFFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000301E1913BuLL}, {0x078644FAFFFFFFFDuLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000AFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000AFF879BAEuLL}, {0x078644FAFFFFFFFDuLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000AFF0F375FuLL}, {0x078644FAFFFFFFFDuLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000AFE96D310uLL}, {0x078644FAFFFFFFFDuLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x0000000AF879BB0DuLL}, {0x078644FAFFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000011E3B0AC5uLL}, {0x078644FAFFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000538F20169uLL}, {0x078644FAFFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000D0074BE59uLL}, {0x078644FAFFFFFFFDuLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000CFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000010153EE0BuLL}, {0x078644FAFFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000100E29EB1uLL}, {0x078644FAFFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000100714F57uLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFCuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFBuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFAuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFEDuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E6F879BB03uLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E6F8B851E9uLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFEuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFFuLL}, {0x078644FAFFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFEuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFDuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000000000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000000000002uLL, 0x03C3227D7FFFFFFFuLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000000000003uLL, 0x028216FE55555554uLL, 0x0000000000000002uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000000000010uLL, 0x0078644FAFFFFFFFuLL, 0x000000000000000EuLL}, {0x078644FAFFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000000100000022uLL, 0x00000000002AD6CAuLL}, {0x078644FAFFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000010898F2B8uLL, 0x00000000060BF99EuLL}, {0x078644FAFFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F6uLL, 0x000000000F0C89F4uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000080000000uLL, 0x000000000F0C89F5uLL, 0x000000007FFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FBuLL, 0x000000001692CEEFuLL}, {0x078644FAFFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FBuLL, 0x000000000F0C89F4uLL}, {0x078644FAFFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FBuLL, 0x00000000078644F9uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x00000000FFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000100000001uLL, 0x00000000078644FAuLL, 0x00000000F879BB04uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000100000002uLL, 0x00000000078644FAuLL, 0x00000000F0F3760AuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000100000003uLL, 0x00000000078644FAuLL, 0x00000000E96D3110uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000100000010uLL, 0x00000000078644FAuLL, 0x00000000879BB05EuLL}, {0x078644FAFFFFFFFEuLL, 0x00000001078644FAuLL, 0x00000000074F44A4uLL, 0x00000000648367D6uLL}, {0x078644FAFFFFFFFEuLL, 0x000000010747AE14uLL, 0x000000000751017FuLL, 0x000000007B6E9012uLL}, {0x078644FAFFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000105042DFAuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x00000000FFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000010B496775uLL}, {0x078644FAFFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000001078644F8uLL}, {0x078644FAFFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000103C3227BuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x00000000FFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x00000000FC3CDD81uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000003C3227DuLL, 0x00000000F879BB04uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000003C3227DuLL, 0x00000000F4B69887uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000003C3227DuLL, 0x00000000C3CDD82EuLL}, {0x078644FAFFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000003B52F6CuLL, 0x0000000079EF0086uLL}, {0x078644FAFFFFFFFEuLL, 0x000000020747AE14uLL, 0x0000000003B5A1D4uLL, 0x000000009405436EuLL}, {0x078644FAFFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x00000000030281FEuLL, 0x00000000030281FCuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x000000027FFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000001078644F8uLL}, {0x078644FAFFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000105042DFAuLL}, {0x078644FAFFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000001028216FCuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x00000000FFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x00000000FD7DE900uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x00000000FAFBD202uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000300000003uLL, 0x00000000028216FEuLL, 0x00000000F879BB04uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000300000010uLL, 0x00000000028216FEuLL, 0x00000000D7DE901EuLL}, {0x078644FAFFFFFFFEuLL, 0x00000003078644FAuLL, 0x00000000027BDC27uLL, 0x000000005F26A5E8uLL}, {0x078644FAFFFFFFFEuLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000001CC64824EuLL}, {0x078644FAFFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000002265CDAuLL, 0x0000000002265CD8uLL}, {0x078644FAFFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x000000037FFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000305A4B3B8uLL}, {0x078644FAFFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000303C3227AuLL}, {0x078644FAFFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000301E1913CuLL}, {0x078644FAFFFFFFFEuLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000AFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000AFF879BAFuLL}, {0x078644FAFFFFFFFEuLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000AFF0F3760uLL}, {0x078644FAFFFFFFFEuLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000AFE96D311uLL}, {0x078644FAFFFFFFFEuLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x0000000AF879BB0EuLL}, {0x078644FAFFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000011E3B0AC6uLL}, {0x078644FAFFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000538F2016AuLL}, {0x078644FAFFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000D0074BE5AuLL}, {0x078644FAFFFFFFFEuLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000CFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000010153EE0CuLL}, {0x078644FAFFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000100E29EB2uLL}, {0x078644FAFFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000100714F58uLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x078644FAFFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFDuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFCuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFBuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFEEuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E6F879BB04uLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E6F8B851EAuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFFuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E600000001uLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FAFFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E5FFFFFFFFuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFEuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000000000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000000000002uLL, 0x03C3227D7FFFFFFFuLL, 0x0000000000000001uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000000000003uLL, 0x028216FE55555555uLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000000000010uLL, 0x0078644FAFFFFFFFuLL, 0x000000000000000FuLL}, {0x078644FAFFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000000100000022uLL, 0x00000000002AD6CBuLL}, {0x078644FAFFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000010898F2B8uLL, 0x00000000060BF99FuLL}, {0x078644FAFFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000000F0C89F6uLL, 0x000000000F0C89F5uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000080000000uLL, 0x000000000F0C89F5uLL, 0x000000007FFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FBuLL, 0x000000001692CEF0uLL}, {0x078644FAFFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FBuLL, 0x000000000F0C89F5uLL}, {0x078644FAFFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FBuLL, 0x00000000078644FAuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL, 0x00000000FFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000100000001uLL, 0x00000000078644FAuLL, 0x00000000F879BB05uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000100000002uLL, 0x00000000078644FAuLL, 0x00000000F0F3760BuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000100000003uLL, 0x00000000078644FAuLL, 0x00000000E96D3111uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000100000010uLL, 0x00000000078644FAuLL, 0x00000000879BB05FuLL}, {0x078644FAFFFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000074F44A4uLL, 0x00000000648367D7uLL}, {0x078644FAFFFFFFFFuLL, 0x000000010747AE14uLL, 0x000000000751017FuLL, 0x000000007B6E9013uLL}, {0x078644FAFFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000005042DFCuLL, 0x0000000105042DFBuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000005042DFCuLL, 0x00000000FFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000003C3227DuLL, 0x000000010B496776uLL}, {0x078644FAFFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000003C3227DuLL, 0x00000001078644F9uLL}, {0x078644FAFFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000003C3227DuLL, 0x0000000103C3227CuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000003C3227DuLL, 0x00000000FFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000003C3227DuLL, 0x00000000FC3CDD82uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000003C3227DuLL, 0x00000000F879BB05uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000003C3227DuLL, 0x00000000F4B69888uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000003C3227DuLL, 0x00000000C3CDD82FuLL}, {0x078644FAFFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000003B52F6CuLL, 0x0000000079EF0087uLL}, {0x078644FAFFFFFFFFuLL, 0x000000020747AE14uLL, 0x0000000003B5A1D4uLL, 0x000000009405436FuLL}, {0x078644FAFFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x00000000030281FEuLL, 0x00000000030281FDuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000280000000uLL, 0x00000000030281FDuLL, 0x000000027FFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x00000000028216FEuLL, 0x00000001078644F9uLL}, {0x078644FAFFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x00000000028216FEuLL, 0x0000000105042DFBuLL}, {0x078644FAFFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x00000000028216FEuLL, 0x00000001028216FDuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000300000000uLL, 0x00000000028216FEuLL, 0x00000000FFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x0000000300000001uLL, 0x00000000028216FEuLL, 0x00000000FD7DE901uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000300000002uLL, 0x00000000028216FEuLL, 0x00000000FAFBD203uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000300000003uLL, 0x00000000028216FEuLL, 0x00000000F879BB05uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000300000010uLL, 0x00000000028216FEuLL, 0x00000000D7DE901FuLL}, {0x078644FAFFFFFFFFuLL, 0x00000003078644FAuLL, 0x00000000027BDC27uLL, 0x000000005F26A5E9uLL}, {0x078644FAFFFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000027C0F7CuLL, 0x00000001CC64824FuLL}, {0x078644FAFFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000002265CDAuLL, 0x0000000002265CD9uLL}, {0x078644FAFFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000002265CD9uLL, 0x000000037FFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000001E1913EuLL, 0x0000000305A4B3B9uLL}, {0x078644FAFFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000001E1913EuLL, 0x0000000303C3227BuLL}, {0x078644FAFFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000001E1913EuLL, 0x0000000301E1913DuLL}, {0x078644FAFFFFFFFFuLL, 0x0000001000000000uLL, 0x000000000078644FuLL, 0x0000000AFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x0000001000000001uLL, 0x000000000078644FuLL, 0x0000000AFF879BB0uLL}, {0x078644FAFFFFFFFFuLL, 0x0000001000000002uLL, 0x000000000078644FuLL, 0x0000000AFF0F3761uLL}, {0x078644FAFFFFFFFFuLL, 0x0000001000000003uLL, 0x000000000078644FuLL, 0x0000000AFE96D312uLL}, {0x078644FAFFFFFFFFuLL, 0x0000001000000010uLL, 0x000000000078644FuLL, 0x0000000AF879BB0FuLL}, {0x078644FAFFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000782BCCuLL, 0x000000011E3B0AC7uLL}, {0x078644FAFFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000000782DA1uLL, 0x0000000538F2016BuLL}, {0x078644FAFFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000074BE5CuLL, 0x0000000D0074BE5BuLL}, {0x078644FAFFFFFFFFuLL, 0x0000001080000000uLL, 0x000000000074BE5CuLL, 0x0000000CFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000000714F5AuLL, 0x000000010153EE0DuLL}, {0x078644FAFFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000000714F5AuLL, 0x0000000100E29EB3uLL}, {0x078644FAFFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000000714F5AuLL, 0x0000000100714F59uLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x078644FAFFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x078644FAFFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x078644FAFFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFEuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFDuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFFCuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x003E96E6FFFFFFEFuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x003E96E6F879BB05uLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x003E96E6F8B851EBuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E680000000uLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x003E96E67FFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x003E96E600000002uLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x003E96E600000001uLL}, {0x078644FAFFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x003E96E600000000uLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x078644FAFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x078644FAFFFFFFFFuLL}, {0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0747AE1400000000uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x0000000000000002uLL, 0x03A3D70A00000000uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x0000000000000003uLL, 0x026D3A06AAAAAAAAuLL, 0x0000000000000002uLL}, {0x0747AE1400000000uLL, 0x0000000000000010uLL, 0x00747AE140000000uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x00000000078644FAuLL, 0x00000000F7AE911DuLL, 0x0000000000CC95AEuLL}, {0x0747AE1400000000uLL, 0x000000000747AE14uLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x000000000E8F5C28uLL}, {0x0747AE1400000000uLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000015D70A3CuLL}, {0x0747AE1400000000uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000000E8F5C28uLL}, {0x0747AE1400000000uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000747AE14uLL}, {0x0747AE1400000000uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x0000000100000001uLL, 0x000000000747AE13uLL, 0x00000000F8B851EDuLL}, {0x0747AE1400000000uLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F170A3DAuLL}, {0x0747AE1400000000uLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000EA28F5C7uLL}, {0x0747AE1400000000uLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x000000008B851ED0uLL}, {0x0747AE1400000000uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000000C50D07AuLL}, {0x0747AE1400000000uLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000CD13E91CuLL}, {0x0747AE1400000000uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000084DA740DuLL}, {0x0747AE1400000000uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x0000000080000000uLL}, {0x0747AE1400000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000000AEB851EuLL}, {0x0747AE1400000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000747AE14uLL}, {0x0747AE1400000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000003A3D70AuLL}, {0x0747AE1400000000uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x0000000200000001uLL, 0x0000000003A3D709uLL, 0x00000001FC5C28F7uLL}, {0x0747AE1400000000uLL, 0x0000000200000002uLL, 0x0000000003A3D709uLL, 0x00000001F8B851EEuLL}, {0x0747AE1400000000uLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001F5147AE5uLL}, {0x0747AE1400000000uLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001C5C28F70uLL}, {0x0747AE1400000000uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007847CB06uLL}, {0x0747AE1400000000uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x000000014B152C2CuLL}, {0x0747AE1400000000uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x0000000202E978D4uLL}, {0x0747AE1400000000uLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x0000000200000000uLL}, {0x0747AE1400000000uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020747AE12uLL}, {0x0747AE1400000000uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000204DA740CuLL}, {0x0747AE1400000000uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002026D3A06uLL}, {0x0747AE1400000000uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x0000000200000000uLL}, {0x0747AE1400000000uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000001FD92C5FAuLL}, {0x0747AE1400000000uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000001FB258BF4uLL}, {0x0747AE1400000000uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000001F8B851EEuLL}, {0x0747AE1400000000uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001D92C5FA0uLL}, {0x0747AE1400000000uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018425ED06uLL}, {0x0747AE1400000000uLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F112E8A4uLL}, {0x0747AE1400000000uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000082147AE1uLL}, {0x0747AE1400000000uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x0000000080000000uLL}, {0x0747AE1400000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000575C28FuLL}, {0x0747AE1400000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000003A3D70AuLL}, {0x0747AE1400000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000001D1EB85uLL}, {0x0747AE1400000000uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x0000000400000000uLL}, {0x0747AE1400000000uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000003FF8B851FuLL}, {0x0747AE1400000000uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000003FF170A3EuLL}, {0x0747AE1400000000uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000003FEA28F5DuLL}, {0x0747AE1400000000uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000003F8B851F0uLL}, {0x0747AE1400000000uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B94A5DA32uLL}, {0x0747AE1400000000uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BB84C4A8CuLL}, {0x0747AE1400000000uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000008070F347uLL}, {0x0747AE1400000000uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x0000000080000000uLL}, {0x0747AE1400000000uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000000148E27CuLL}, {0x0747AE1400000000uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000000DB41A8uLL}, {0x0747AE1400000000uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000006DA0D4uLL}, {0x0747AE1400000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000000uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000000uLL}, {0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x0747AE1400000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000001uLL, 0x0000000000000002uLL, 0x03A3D70A00000000uLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x0000000000000003uLL, 0x026D3A06AAAAAAABuLL, 0x0000000000000000uLL}, {0x0747AE1400000001uLL, 0x0000000000000010uLL, 0x00747AE140000000uLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x00000000078644FAuLL, 0x00000000F7AE911DuLL, 0x0000000000CC95AFuLL}, {0x0747AE1400000001uLL, 0x000000000747AE14uLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x000000000E8F5C29uLL}, {0x0747AE1400000001uLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000015D70A3DuLL}, {0x0747AE1400000001uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000000E8F5C29uLL}, {0x0747AE1400000001uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000747AE15uLL}, {0x0747AE1400000001uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x0000000100000001uLL, 0x000000000747AE13uLL, 0x00000000F8B851EEuLL}, {0x0747AE1400000001uLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F170A3DBuLL}, {0x0747AE1400000001uLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000EA28F5C8uLL}, {0x0747AE1400000001uLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x000000008B851ED1uLL}, {0x0747AE1400000001uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000000C50D07BuLL}, {0x0747AE1400000001uLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000CD13E91DuLL}, {0x0747AE1400000001uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000084DA740EuLL}, {0x0747AE1400000001uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x0000000080000001uLL}, {0x0747AE1400000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000000AEB851FuLL}, {0x0747AE1400000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000747AE15uLL}, {0x0747AE1400000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000003A3D70BuLL}, {0x0747AE1400000001uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x0000000200000001uLL, 0x0000000003A3D709uLL, 0x00000001FC5C28F8uLL}, {0x0747AE1400000001uLL, 0x0000000200000002uLL, 0x0000000003A3D709uLL, 0x00000001F8B851EFuLL}, {0x0747AE1400000001uLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001F5147AE6uLL}, {0x0747AE1400000001uLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001C5C28F71uLL}, {0x0747AE1400000001uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007847CB07uLL}, {0x0747AE1400000001uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x000000014B152C2DuLL}, {0x0747AE1400000001uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x0000000202E978D5uLL}, {0x0747AE1400000001uLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x0000000200000001uLL}, {0x0747AE1400000001uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020747AE13uLL}, {0x0747AE1400000001uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000204DA740DuLL}, {0x0747AE1400000001uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002026D3A07uLL}, {0x0747AE1400000001uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x0000000200000001uLL}, {0x0747AE1400000001uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000001FD92C5FBuLL}, {0x0747AE1400000001uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000001FB258BF5uLL}, {0x0747AE1400000001uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000001F8B851EFuLL}, {0x0747AE1400000001uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001D92C5FA1uLL}, {0x0747AE1400000001uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018425ED07uLL}, {0x0747AE1400000001uLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F112E8A5uLL}, {0x0747AE1400000001uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000082147AE2uLL}, {0x0747AE1400000001uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x0000000080000001uLL}, {0x0747AE1400000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000575C290uLL}, {0x0747AE1400000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000003A3D70BuLL}, {0x0747AE1400000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000001D1EB86uLL}, {0x0747AE1400000001uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x0000000400000001uLL}, {0x0747AE1400000001uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000003FF8B8520uLL}, {0x0747AE1400000001uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000003FF170A3FuLL}, {0x0747AE1400000001uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000003FEA28F5EuLL}, {0x0747AE1400000001uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000003F8B851F1uLL}, {0x0747AE1400000001uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B94A5DA33uLL}, {0x0747AE1400000001uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BB84C4A8DuLL}, {0x0747AE1400000001uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000008070F348uLL}, {0x0747AE1400000001uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x0000000080000001uLL}, {0x0747AE1400000001uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000000148E27DuLL}, {0x0747AE1400000001uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000000DB41A9uLL}, {0x0747AE1400000001uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000006DA0D5uLL}, {0x0747AE1400000001uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0747AE1400000001uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000001uLL}, {0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x0747AE1400000002uLL, 0x0000000000000000uLL}, {0x0747AE1400000002uLL, 0x0000000000000002uLL, 0x03A3D70A00000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000002uLL, 0x0000000000000003uLL, 0x026D3A06AAAAAAABuLL, 0x0000000000000001uLL}, {0x0747AE1400000002uLL, 0x0000000000000010uLL, 0x00747AE140000000uLL, 0x0000000000000002uLL}, {0x0747AE1400000002uLL, 0x00000000078644FAuLL, 0x00000000F7AE911DuLL, 0x0000000000CC95B0uLL}, {0x0747AE1400000002uLL, 0x000000000747AE14uLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0x0747AE1400000002uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x000000000E8F5C2AuLL}, {0x0747AE1400000002uLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x0000000000000002uLL}, {0x0747AE1400000002uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000015D70A3EuLL}, {0x0747AE1400000002uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000000E8F5C2AuLL}, {0x0747AE1400000002uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000747AE16uLL}, {0x0747AE1400000002uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000000000002uLL}, {0x0747AE1400000002uLL, 0x0000000100000001uLL, 0x000000000747AE13uLL, 0x00000000F8B851EFuLL}, {0x0747AE1400000002uLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F170A3DCuLL}, {0x0747AE1400000002uLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000EA28F5C9uLL}, {0x0747AE1400000002uLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x000000008B851ED2uLL}, {0x0747AE1400000002uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000000C50D07CuLL}, {0x0747AE1400000002uLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000CD13E91EuLL}, {0x0747AE1400000002uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000084DA740FuLL}, {0x0747AE1400000002uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x0000000080000002uLL}, {0x0747AE1400000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000000AEB8520uLL}, {0x0747AE1400000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000747AE16uLL}, {0x0747AE1400000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000003A3D70CuLL}, {0x0747AE1400000002uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x0000000000000002uLL}, {0x0747AE1400000002uLL, 0x0000000200000001uLL, 0x0000000003A3D709uLL, 0x00000001FC5C28F9uLL}, {0x0747AE1400000002uLL, 0x0000000200000002uLL, 0x0000000003A3D709uLL, 0x00000001F8B851F0uLL}, {0x0747AE1400000002uLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001F5147AE7uLL}, {0x0747AE1400000002uLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001C5C28F72uLL}, {0x0747AE1400000002uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007847CB08uLL}, {0x0747AE1400000002uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x000000014B152C2EuLL}, {0x0747AE1400000002uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x0000000202E978D6uLL}, {0x0747AE1400000002uLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x0000000200000002uLL}, {0x0747AE1400000002uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020747AE14uLL}, {0x0747AE1400000002uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000204DA740EuLL}, {0x0747AE1400000002uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002026D3A08uLL}, {0x0747AE1400000002uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x0000000200000002uLL}, {0x0747AE1400000002uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000001FD92C5FCuLL}, {0x0747AE1400000002uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000001FB258BF6uLL}, {0x0747AE1400000002uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000001F8B851F0uLL}, {0x0747AE1400000002uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001D92C5FA2uLL}, {0x0747AE1400000002uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018425ED08uLL}, {0x0747AE1400000002uLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F112E8A6uLL}, {0x0747AE1400000002uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000082147AE3uLL}, {0x0747AE1400000002uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x0000000080000002uLL}, {0x0747AE1400000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000575C291uLL}, {0x0747AE1400000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000003A3D70CuLL}, {0x0747AE1400000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000001D1EB87uLL}, {0x0747AE1400000002uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x0000000400000002uLL}, {0x0747AE1400000002uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000003FF8B8521uLL}, {0x0747AE1400000002uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000003FF170A40uLL}, {0x0747AE1400000002uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000003FEA28F5FuLL}, {0x0747AE1400000002uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000003F8B851F2uLL}, {0x0747AE1400000002uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B94A5DA34uLL}, {0x0747AE1400000002uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BB84C4A8EuLL}, {0x0747AE1400000002uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000008070F349uLL}, {0x0747AE1400000002uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x0000000080000002uLL}, {0x0747AE1400000002uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000000148E27EuLL}, {0x0747AE1400000002uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000000DB41AAuLL}, {0x0747AE1400000002uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000006DA0D6uLL}, {0x0747AE1400000002uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0747AE1400000002uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0747AE1400000002uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000002uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000002uLL}, {0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x0747AE1400000003uLL, 0x0000000000000000uLL}, {0x0747AE1400000003uLL, 0x0000000000000002uLL, 0x03A3D70A00000001uLL, 0x0000000000000001uLL}, {0x0747AE1400000003uLL, 0x0000000000000003uLL, 0x026D3A06AAAAAAABuLL, 0x0000000000000002uLL}, {0x0747AE1400000003uLL, 0x0000000000000010uLL, 0x00747AE140000000uLL, 0x0000000000000003uLL}, {0x0747AE1400000003uLL, 0x00000000078644FAuLL, 0x00000000F7AE911DuLL, 0x0000000000CC95B1uLL}, {0x0747AE1400000003uLL, 0x000000000747AE14uLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0x0747AE1400000003uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x000000000E8F5C2BuLL}, {0x0747AE1400000003uLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x0000000000000003uLL}, {0x0747AE1400000003uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000015D70A3FuLL}, {0x0747AE1400000003uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000000E8F5C2BuLL}, {0x0747AE1400000003uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000747AE17uLL}, {0x0747AE1400000003uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000000000003uLL}, {0x0747AE1400000003uLL, 0x0000000100000001uLL, 0x000000000747AE13uLL, 0x00000000F8B851F0uLL}, {0x0747AE1400000003uLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F170A3DDuLL}, {0x0747AE1400000003uLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000EA28F5CAuLL}, {0x0747AE1400000003uLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x000000008B851ED3uLL}, {0x0747AE1400000003uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000000C50D07DuLL}, {0x0747AE1400000003uLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000CD13E91FuLL}, {0x0747AE1400000003uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000084DA7410uLL}, {0x0747AE1400000003uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x0000000080000003uLL}, {0x0747AE1400000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000000AEB8521uLL}, {0x0747AE1400000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000747AE17uLL}, {0x0747AE1400000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000003A3D70DuLL}, {0x0747AE1400000003uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x0000000000000003uLL}, {0x0747AE1400000003uLL, 0x0000000200000001uLL, 0x0000000003A3D709uLL, 0x00000001FC5C28FAuLL}, {0x0747AE1400000003uLL, 0x0000000200000002uLL, 0x0000000003A3D709uLL, 0x00000001F8B851F1uLL}, {0x0747AE1400000003uLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001F5147AE8uLL}, {0x0747AE1400000003uLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001C5C28F73uLL}, {0x0747AE1400000003uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007847CB09uLL}, {0x0747AE1400000003uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x000000014B152C2FuLL}, {0x0747AE1400000003uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x0000000202E978D7uLL}, {0x0747AE1400000003uLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x0000000200000003uLL}, {0x0747AE1400000003uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020747AE15uLL}, {0x0747AE1400000003uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000204DA740FuLL}, {0x0747AE1400000003uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002026D3A09uLL}, {0x0747AE1400000003uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x0000000200000003uLL}, {0x0747AE1400000003uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000001FD92C5FDuLL}, {0x0747AE1400000003uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000001FB258BF7uLL}, {0x0747AE1400000003uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000001F8B851F1uLL}, {0x0747AE1400000003uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001D92C5FA3uLL}, {0x0747AE1400000003uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018425ED09uLL}, {0x0747AE1400000003uLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F112E8A7uLL}, {0x0747AE1400000003uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000082147AE4uLL}, {0x0747AE1400000003uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x0000000080000003uLL}, {0x0747AE1400000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000575C292uLL}, {0x0747AE1400000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000003A3D70DuLL}, {0x0747AE1400000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000001D1EB88uLL}, {0x0747AE1400000003uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x0000000400000003uLL}, {0x0747AE1400000003uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000003FF8B8522uLL}, {0x0747AE1400000003uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000003FF170A41uLL}, {0x0747AE1400000003uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000003FEA28F60uLL}, {0x0747AE1400000003uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000003F8B851F3uLL}, {0x0747AE1400000003uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B94A5DA35uLL}, {0x0747AE1400000003uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BB84C4A8FuLL}, {0x0747AE1400000003uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000008070F34AuLL}, {0x0747AE1400000003uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x0000000080000003uLL}, {0x0747AE1400000003uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000000148E27FuLL}, {0x0747AE1400000003uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000000DB41ABuLL}, {0x0747AE1400000003uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000006DA0D7uLL}, {0x0747AE1400000003uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x0747AE1400000003uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0747AE1400000003uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0747AE1400000003uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000003uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000003uLL}, {0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x0747AE1400000010uLL, 0x0000000000000000uLL}, {0x0747AE1400000010uLL, 0x0000000000000002uLL, 0x03A3D70A00000008uLL, 0x0000000000000000uLL}, {0x0747AE1400000010uLL, 0x0000000000000003uLL, 0x026D3A06AAAAAAB0uLL, 0x0000000000000000uLL}, {0x0747AE1400000010uLL, 0x0000000000000010uLL, 0x00747AE140000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000010uLL, 0x00000000078644FAuLL, 0x00000000F7AE911DuLL, 0x0000000000CC95BEuLL}, {0x0747AE1400000010uLL, 0x000000000747AE14uLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0x0747AE1400000010uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x000000000E8F5C38uLL}, {0x0747AE1400000010uLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x0000000000000010uLL}, {0x0747AE1400000010uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000015D70A4CuLL}, {0x0747AE1400000010uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000000E8F5C38uLL}, {0x0747AE1400000010uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000747AE24uLL}, {0x0747AE1400000010uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000000000010uLL}, {0x0747AE1400000010uLL, 0x0000000100000001uLL, 0x000000000747AE13uLL, 0x00000000F8B851FDuLL}, {0x0747AE1400000010uLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F170A3EAuLL}, {0x0747AE1400000010uLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000EA28F5D7uLL}, {0x0747AE1400000010uLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x000000008B851EE0uLL}, {0x0747AE1400000010uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000000C50D08AuLL}, {0x0747AE1400000010uLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000CD13E92CuLL}, {0x0747AE1400000010uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000084DA741DuLL}, {0x0747AE1400000010uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x0000000080000010uLL}, {0x0747AE1400000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000000AEB852EuLL}, {0x0747AE1400000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000747AE24uLL}, {0x0747AE1400000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000003A3D71AuLL}, {0x0747AE1400000010uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x0000000000000010uLL}, {0x0747AE1400000010uLL, 0x0000000200000001uLL, 0x0000000003A3D709uLL, 0x00000001FC5C2907uLL}, {0x0747AE1400000010uLL, 0x0000000200000002uLL, 0x0000000003A3D709uLL, 0x00000001F8B851FEuLL}, {0x0747AE1400000010uLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001F5147AF5uLL}, {0x0747AE1400000010uLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001C5C28F80uLL}, {0x0747AE1400000010uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007847CB16uLL}, {0x0747AE1400000010uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x000000014B152C3CuLL}, {0x0747AE1400000010uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x0000000202E978E4uLL}, {0x0747AE1400000010uLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x0000000200000010uLL}, {0x0747AE1400000010uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020747AE22uLL}, {0x0747AE1400000010uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000204DA741CuLL}, {0x0747AE1400000010uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002026D3A16uLL}, {0x0747AE1400000010uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x0000000200000010uLL}, {0x0747AE1400000010uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000001FD92C60AuLL}, {0x0747AE1400000010uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000001FB258C04uLL}, {0x0747AE1400000010uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000001F8B851FEuLL}, {0x0747AE1400000010uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001D92C5FB0uLL}, {0x0747AE1400000010uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018425ED16uLL}, {0x0747AE1400000010uLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F112E8B4uLL}, {0x0747AE1400000010uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000082147AF1uLL}, {0x0747AE1400000010uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x0000000080000010uLL}, {0x0747AE1400000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000575C29FuLL}, {0x0747AE1400000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000003A3D71AuLL}, {0x0747AE1400000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000001D1EB95uLL}, {0x0747AE1400000010uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x0000000400000010uLL}, {0x0747AE1400000010uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000003FF8B852FuLL}, {0x0747AE1400000010uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000003FF170A4EuLL}, {0x0747AE1400000010uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000003FEA28F6DuLL}, {0x0747AE1400000010uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000003F8B85200uLL}, {0x0747AE1400000010uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B94A5DA42uLL}, {0x0747AE1400000010uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BB84C4A9CuLL}, {0x0747AE1400000010uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000008070F357uLL}, {0x0747AE1400000010uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x0000000080000010uLL}, {0x0747AE1400000010uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000000148E28CuLL}, {0x0747AE1400000010uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000000DB41B8uLL}, {0x0747AE1400000010uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000006DA0E4uLL}, {0x0747AE1400000010uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x0747AE1400000010uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x0747AE1400000010uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x0747AE1400000010uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x0747AE1400000010uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE1400000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE1400000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1400000010uLL}, {0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL}, {0x0747AE14078644FAuLL, 0x0000000000000002uLL, 0x03A3D70A03C3227DuLL, 0x0000000000000000uLL}, {0x0747AE14078644FAuLL, 0x0000000000000003uLL, 0x026D3A06AD2CC1A8uLL, 0x0000000000000002uLL}, {0x0747AE14078644FAuLL, 0x0000000000000010uLL, 0x00747AE14078644FuLL, 0x000000000000000AuLL}, {0x0747AE14078644FAuLL, 0x00000000078644FAuLL, 0x00000000F7AE911EuLL, 0x0000000000CC95AEuLL}, {0x0747AE14078644FAuLL, 0x000000000747AE14uLL, 0x0000000100000001uLL, 0x00000000003E96E6uLL}, {0x0747AE14078644FAuLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x000000001615A122uLL}, {0x0747AE14078644FAuLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x00000000078644FAuLL}, {0x0747AE14078644FAuLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000001D5D4F36uLL}, {0x0747AE14078644FAuLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000001615A122uLL}, {0x0747AE14078644FAuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000ECDF30EuLL}, {0x0747AE14078644FAuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x00000000078644FAuLL}, {0x0747AE14078644FAuLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x00000000003E96E6uLL}, {0x0747AE14078644FAuLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F8F6E8D4uLL}, {0x0747AE14078644FAuLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000F1AF3AC1uLL}, {0x0747AE14078644FAuLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x00000000930B63CAuLL}, {0x0747AE14078644FAuLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x0000000013D71574uLL}, {0x0747AE14078644FAuLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000D49A2E16uLL}, {0x0747AE14078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x000000008C60B907uLL}, {0x0747AE14078644FAuLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x00000000878644FAuLL}, {0x0747AE14078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000001271CA18uLL}, {0x0747AE14078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000ECDF30EuLL}, {0x0747AE14078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x000000000B2A1C04uLL}, {0x0747AE14078644FAuLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x00000000078644FAuLL}, {0x0747AE14078644FAuLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x0000000003E26DF0uLL}, {0x0747AE14078644FAuLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x00000000003E96E6uLL}, {0x0747AE14078644FAuLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001FC9ABFDFuLL}, {0x0747AE14078644FAuLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001CD48D46AuLL}, {0x0747AE14078644FAuLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007FCE1000uLL}, {0x0747AE14078644FAuLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x00000001529B7126uLL}, {0x0747AE14078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x000000020A6FBDCEuLL}, {0x0747AE14078644FAuLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x00000002078644FAuLL}, {0x0747AE14078644FAuLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020ECDF30CuLL}, {0x0747AE14078644FAuLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x000000020C60B906uLL}, {0x0747AE14078644FAuLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x0000000209F37F00uLL}, {0x0747AE14078644FAuLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x00000002078644FAuLL}, {0x0747AE14078644FAuLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x0000000205190AF4uLL}, {0x0747AE14078644FAuLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x0000000202ABD0EEuLL}, {0x0747AE14078644FAuLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000002003E96E8uLL}, {0x0747AE14078644FAuLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001E0B2A49AuLL}, {0x0747AE14078644FAuLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018BAC3200uLL}, {0x0747AE14078644FAuLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F8992D9EuLL}, {0x0747AE14078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x00000000899ABFDBuLL}, {0x0747AE14078644FAuLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x00000000878644FAuLL}, {0x0747AE14078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000CFC0789uLL}, {0x0747AE14078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x000000000B2A1C04uLL}, {0x0747AE14078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x000000000958307FuLL}, {0x0747AE14078644FAuLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x00000004078644FAuLL}, {0x0747AE14078644FAuLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x000000040711CA19uLL}, {0x0747AE14078644FAuLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000004069D4F38uLL}, {0x0747AE14078644FAuLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x000000040628D457uLL}, {0x0747AE14078644FAuLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000004003E96EAuLL}, {0x0747AE14078644FAuLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B9C2C1F2CuLL}, {0x0747AE14078644FAuLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BBFD28F86uLL}, {0x0747AE14078644FAuLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x0000000087F73841uLL}, {0x0747AE14078644FAuLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x00000000878644FAuLL}, {0x0747AE14078644FAuLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x0000000008CF2776uLL}, {0x0747AE14078644FAuLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x00000000086186A2uLL}, {0x0747AE14078644FAuLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x0000000007F3E5CEuLL}, {0x0747AE14078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x0747AE14078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x0747AE14078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x0747AE14078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x0747AE14078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x0747AE14078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE14078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x0747AE14078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE14078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14078644FAuLL}, {0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000000uLL}, {0x0747AE140747AE14uLL, 0x0000000000000002uLL, 0x03A3D70A03A3D70AuLL, 0x0000000000000000uLL}, {0x0747AE140747AE14uLL, 0x0000000000000003uLL, 0x026D3A06AD17E4B1uLL, 0x0000000000000001uLL}, {0x0747AE140747AE14uLL, 0x0000000000000010uLL, 0x00747AE140747AE1uLL, 0x0000000000000004uLL}, {0x0747AE140747AE14uLL, 0x00000000078644FAuLL, 0x00000000F7AE911EuLL, 0x00000000008DFEC8uLL}, {0x0747AE140747AE14uLL, 0x000000000747AE14uLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x0747AE140747AE14uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C28uLL, 0x0000000015D70A3CuLL}, {0x0747AE140747AE14uLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x000000000747AE14uLL}, {0x0747AE140747AE14uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000001D1EB850uLL}, {0x0747AE140747AE14uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x0000000015D70A3CuLL}, {0x0747AE140747AE14uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000000E8F5C28uLL}, {0x0747AE140747AE14uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x000000000747AE14uLL}, {0x0747AE140747AE14uLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x0000000000000000uLL}, {0x0747AE140747AE14uLL, 0x0000000100000002uLL, 0x000000000747AE13uLL, 0x00000000F8B851EEuLL}, {0x0747AE140747AE14uLL, 0x0000000100000003uLL, 0x000000000747AE13uLL, 0x00000000F170A3DBuLL}, {0x0747AE140747AE14uLL, 0x0000000100000010uLL, 0x000000000747AE13uLL, 0x0000000092CCCCE4uLL}, {0x0747AE140747AE14uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x0000000013987E8EuLL}, {0x0747AE140747AE14uLL, 0x000000010747AE14uLL, 0x00000000071425A5uLL, 0x00000000D45B9730uLL}, {0x0747AE140747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x000000008C222221uLL}, {0x0747AE140747AE14uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x000000008747AE14uLL}, {0x0747AE140747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x0000000012333332uLL}, {0x0747AE140747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000000E8F5C28uLL}, {0x0747AE140747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x000000000AEB851EuLL}, {0x0747AE140747AE14uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x000000000747AE14uLL}, {0x0747AE140747AE14uLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x0000000003A3D70AuLL}, {0x0747AE140747AE14uLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x0000000000000000uLL}, {0x0747AE140747AE14uLL, 0x0000000200000003uLL, 0x0000000003A3D709uLL, 0x00000001FC5C28F9uLL}, {0x0747AE140747AE14uLL, 0x0000000200000010uLL, 0x0000000003A3D709uLL, 0x00000001CD0A3D84uLL}, {0x0747AE140747AE14uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000007F8F791AuLL}, {0x0747AE140747AE14uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x00000001525CDA40uLL}, {0x0747AE140747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D4uLL, 0x000000020A3126E8uLL}, {0x0747AE140747AE14uLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x000000020747AE14uLL}, {0x0747AE140747AE14uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000020E8F5C26uLL}, {0x0747AE140747AE14uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x000000020C222220uLL}, {0x0747AE140747AE14uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x0000000209B4E81AuLL}, {0x0747AE140747AE14uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x000000020747AE14uLL}, {0x0747AE140747AE14uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x0000000204DA740EuLL}, {0x0747AE140747AE14uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000002026D3A08uLL}, {0x0747AE140747AE14uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x0000000200000002uLL}, {0x0747AE140747AE14uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000001E0740DB4uLL}, {0x0747AE140747AE14uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000018B6D9B1AuLL}, {0x0747AE140747AE14uLL, 0x000000030747AE14uLL, 0x00000000026764ABuLL, 0x00000002F85A96B8uLL}, {0x0747AE140747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x00000000895C28F5uLL}, {0x0747AE140747AE14uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x000000008747AE14uLL}, {0x0747AE140747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000000CBD70A3uLL}, {0x0747AE140747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x000000000AEB851EuLL}, {0x0747AE140747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000009199999uLL}, {0x0747AE140747AE14uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x000000040747AE14uLL}, {0x0747AE140747AE14uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x0000000406D33333uLL}, {0x0747AE140747AE14uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000004065EB852uLL}, {0x0747AE140747AE14uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x0000000405EA3D71uLL}, {0x0747AE140747AE14uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x0000000400000004uLL}, {0x0747AE140747AE14uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000B9BED8846uLL}, {0x0747AE140747AE14uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000BBF93F8A0uLL}, {0x0747AE140747AE14uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x0000000087B8A15BuLL}, {0x0747AE140747AE14uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x000000008747AE14uLL}, {0x0747AE140747AE14uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x0000000008909090uLL}, {0x0747AE140747AE14uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x000000000822EFBCuLL}, {0x0747AE140747AE14uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x0000000007B54EE8uLL}, {0x0747AE140747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x0747AE140747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x0747AE140747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x0747AE140747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x0747AE140747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE140747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE140747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE140747AE14uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000000uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000000000002uLL, 0x03A3D70A3FFFFFFFuLL, 0x0000000000000001uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000000000003uLL, 0x026D3A06D5555555uLL, 0x0000000000000000uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000000000010uLL, 0x00747AE147FFFFFFuLL, 0x000000000000000FuLL}, {0x0747AE147FFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000F7AE912EuLL, 0x0000000000E20113uLL}, {0x0747AE147FFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000100000011uLL, 0x00000000043D70ABuLL}, {0x0747AE147FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C29uLL, 0x000000000E8F5C28uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000080000000uLL, 0x000000000E8F5C28uLL, 0x000000007FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000095D70A3BuLL}, {0x0747AE147FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000008E8F5C27uLL}, {0x0747AE147FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000008747AE13uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x000000007FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x0000000078B851EBuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000100000002uLL, 0x000000000747AE14uLL, 0x000000007170A3D7uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000100000003uLL, 0x000000000747AE14uLL, 0x000000006A28F5C3uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000100000010uLL, 0x000000000747AE14uLL, 0x000000000B851EBFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000008C50D079uLL}, {0x0747AE147FFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000071425A6uLL, 0x0000000045CC3B07uLL}, {0x0747AE147FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000104DA740CuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x00000000FFFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000008AEB851DuLL}, {0x0747AE147FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000008747AE13uLL}, {0x0747AE147FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000083A3D709uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x000000007FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x000000007C5C28F5uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x0000000078B851EBuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000003A3D70AuLL, 0x0000000075147AE1uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000200000010uLL, 0x0000000003A3D70AuLL, 0x0000000045C28F5FuLL}, {0x0747AE147FFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x00000000F847CB05uLL}, {0x0747AE147FFFFFFFuLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x00000001CB152C2BuLL}, {0x0747AE147FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D5uLL, 0x0000000002E978D4uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000002E978D4uLL, 0x000000027FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000028747AE11uLL}, {0x0747AE147FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000284DA740BuLL}, {0x0747AE147FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002826D3A05uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x000000027FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x000000027D92C5F9uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x000000027B258BF3uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x0000000278B851EDuLL}, {0x0747AE147FFFFFFFuLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000002592C5F9FuLL}, {0x0747AE147FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000020425ED05uLL}, {0x0747AE147FFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000026764ACuLL, 0x0000000069CB3A8FuLL}, {0x0747AE147FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000102147AE0uLL}, {0x0747AE147FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x00000000FFFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000008575C28EuLL}, {0x0747AE147FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000083A3D709uLL}, {0x0747AE147FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000081D1EB84uLL}, {0x0747AE147FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x000000047FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x000000047F8B851EuLL}, {0x0747AE147FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x000000047F170A3DuLL}, {0x0747AE147FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x000000047EA28F5CuLL}, {0x0747AE147FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x0000000478B851EFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000C14A5DA31uLL}, {0x0747AE147FFFFFFFuLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000C384C4A8BuLL}, {0x0747AE147FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000010070F346uLL}, {0x0747AE147FFFFFFFuLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x00000000FFFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000008148E27BuLL}, {0x0747AE147FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000080DB41A7uLL}, {0x0747AE147FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000806DA0D3uLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE147FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE147FFFFFFFuLL}, {0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x0747AE1480000000uLL, 0x0000000000000000uLL}, {0x0747AE1480000000uLL, 0x0000000000000002uLL, 0x03A3D70A40000000uLL, 0x0000000000000000uLL}, {0x0747AE1480000000uLL, 0x0000000000000003uLL, 0x026D3A06D5555555uLL, 0x0000000000000001uLL}, {0x0747AE1480000000uLL, 0x0000000000000010uLL, 0x00747AE148000000uLL, 0x0000000000000000uLL}, {0x0747AE1480000000uLL, 0x00000000078644FAuLL, 0x00000000F7AE912EuLL, 0x0000000000E20114uLL}, {0x0747AE1480000000uLL, 0x000000000747AE14uLL, 0x0000000100000011uLL, 0x00000000043D70ACuLL}, {0x0747AE1480000000uLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C29uLL, 0x000000000E8F5C29uLL}, {0x0747AE1480000000uLL, 0x0000000080000000uLL, 0x000000000E8F5C29uLL, 0x0000000000000000uLL}, {0x0747AE1480000000uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000095D70A3CuLL}, {0x0747AE1480000000uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000008E8F5C28uLL}, {0x0747AE1480000000uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000008747AE14uLL}, {0x0747AE1480000000uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x0000000080000000uLL}, {0x0747AE1480000000uLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x0000000078B851ECuLL}, {0x0747AE1480000000uLL, 0x0000000100000002uLL, 0x000000000747AE14uLL, 0x000000007170A3D8uLL}, {0x0747AE1480000000uLL, 0x0000000100000003uLL, 0x000000000747AE14uLL, 0x000000006A28F5C4uLL}, {0x0747AE1480000000uLL, 0x0000000100000010uLL, 0x000000000747AE14uLL, 0x000000000B851EC0uLL}, {0x0747AE1480000000uLL, 0x00000001078644FAuLL, 0x000000000712773FuLL, 0x000000008C50D07AuLL}, {0x0747AE1480000000uLL, 0x000000010747AE14uLL, 0x00000000071425A6uLL, 0x0000000045CC3B08uLL}, {0x0747AE1480000000uLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740DuLL, 0x0000000104DA740DuLL}, {0x0747AE1480000000uLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x0000000100000000uLL}, {0x0747AE1480000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000008AEB851EuLL}, {0x0747AE1480000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000008747AE14uLL}, {0x0747AE1480000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000083A3D70AuLL}, {0x0747AE1480000000uLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x0000000080000000uLL}, {0x0747AE1480000000uLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x000000007C5C28F6uLL}, {0x0747AE1480000000uLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x0000000078B851ECuLL}, {0x0747AE1480000000uLL, 0x0000000200000003uLL, 0x0000000003A3D70AuLL, 0x0000000075147AE2uLL}, {0x0747AE1480000000uLL, 0x0000000200000010uLL, 0x0000000003A3D70AuLL, 0x0000000045C28F60uLL}, {0x0747AE1480000000uLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x00000000F847CB06uLL}, {0x0747AE1480000000uLL, 0x000000020747AE14uLL, 0x000000000396C6B1uLL, 0x00000001CB152C2CuLL}, {0x0747AE1480000000uLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D5uLL, 0x0000000002E978D5uLL}, {0x0747AE1480000000uLL, 0x0000000280000000uLL, 0x0000000002E978D5uLL, 0x0000000000000000uLL}, {0x0747AE1480000000uLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A06uLL, 0x000000028747AE12uLL}, {0x0747AE1480000000uLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A06uLL, 0x0000000284DA740CuLL}, {0x0747AE1480000000uLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A06uLL, 0x00000002826D3A06uLL}, {0x0747AE1480000000uLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x0000000280000000uLL}, {0x0747AE1480000000uLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x000000027D92C5FAuLL}, {0x0747AE1480000000uLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x000000027B258BF4uLL}, {0x0747AE1480000000uLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x0000000278B851EEuLL}, {0x0747AE1480000000uLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000002592C5FA0uLL}, {0x0747AE1480000000uLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000020425ED06uLL}, {0x0747AE1480000000uLL, 0x000000030747AE14uLL, 0x00000000026764ACuLL, 0x0000000069CB3A90uLL}, {0x0747AE1480000000uLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000102147AE1uLL}, {0x0747AE1480000000uLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x0000000100000000uLL}, {0x0747AE1480000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000008575C28FuLL}, {0x0747AE1480000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000083A3D70AuLL}, {0x0747AE1480000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000081D1EB85uLL}, {0x0747AE1480000000uLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x0000000480000000uLL}, {0x0747AE1480000000uLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x000000047F8B851FuLL}, {0x0747AE1480000000uLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x000000047F170A3EuLL}, {0x0747AE1480000000uLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x000000047EA28F5DuLL}, {0x0747AE1480000000uLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x0000000478B851F0uLL}, {0x0747AE1480000000uLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000C14A5DA32uLL}, {0x0747AE1480000000uLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000C384C4A8CuLL}, {0x0747AE1480000000uLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000010070F347uLL}, {0x0747AE1480000000uLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x0000000100000000uLL}, {0x0747AE1480000000uLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000008148E27CuLL}, {0x0747AE1480000000uLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000080DB41A8uLL}, {0x0747AE1480000000uLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000000806DA0D4uLL}, {0x0747AE1480000000uLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0747AE1480000000uLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0747AE1480000000uLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0747AE1480000000uLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0747AE1480000000uLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x0747AE1480000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x0747AE1480000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x0747AE1480000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0747AE1480000000uLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE1480000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE1480000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE1480000000uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000000000002uLL, 0x03A3D70A7FFFFFFEuLL, 0x0000000000000001uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000000000003uLL, 0x026D3A06FFFFFFFFuLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000000000010uLL, 0x00747AE14FFFFFFFuLL, 0x000000000000000DuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000000078644FAuLL, 0x00000000F7AE913FuLL, 0x0000000000F76C77uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000000747AE14uLL, 0x0000000100000023uLL, 0x0000000001333341uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C2AuLL, 0x000000000E8F5C27uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000000E8F5C29uLL, 0x000000007FFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE15uLL, 0x0000000015D70A3CuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE15uLL, 0x000000000E8F5C27uLL}, {0x0747AE14FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE15uLL, 0x000000000747AE12uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x00000000FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x00000000F8B851E9uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000100000002uLL, 0x000000000747AE14uLL, 0x00000000F170A3D5uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000100000003uLL, 0x000000000747AE14uLL, 0x00000000EA28F5C1uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000100000010uLL, 0x000000000747AE14uLL, 0x000000008B851EBDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000001078644FAuLL, 0x0000000007127740uLL, 0x0000000004CA8B7DuLL}, {0x0747AE14FFFFFFFDuLL, 0x000000010747AE14uLL, 0x00000000071425A6uLL, 0x00000000C5CC3B05uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740EuLL, 0x0000000004DA740BuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x000000017FFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000010AEB851BuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000010747AE11uLL}, {0x0747AE14FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000103A3D707uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x00000000FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x00000000FC5C28F3uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x00000000F8B851E9uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000003A3D70AuLL, 0x00000000F5147ADFuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000200000010uLL, 0x0000000003A3D70AuLL, 0x00000000C5C28F5DuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000017847CB03uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000020747AE14uLL, 0x000000000396C6B2uLL, 0x0000000043CD7E15uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D5uLL, 0x0000000082E978D2uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000002E978D5uLL, 0x000000007FFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A07uLL, 0x000000000747AE12uLL}, {0x0747AE14FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A07uLL, 0x0000000004DA740BuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A07uLL, 0x00000000026D3A04uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x00000002FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000002FD92C5F7uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000002FB258BF1uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000002F8B851EBuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000002D92C5F9DuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000028425ED03uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000030747AE14uLL, 0x00000000026764ACuLL, 0x00000000E9CB3A8DuLL}, {0x0747AE14FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000182147ADEuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x000000017FFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000010575C28CuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000103A3D707uLL}, {0x0747AE14FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000101D1EB82uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x00000004FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000004FF8B851CuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000004FF170A3BuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000004FEA28F5AuLL}, {0x0747AE14FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000004F8B851EDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000C94A5DA2FuLL}, {0x0747AE14FFFFFFFDuLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000CB84C4A89uLL}, {0x0747AE14FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000018070F344uLL}, {0x0747AE14FFFFFFFDuLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x000000017FFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000010148E279uLL}, {0x0747AE14FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000100DB41A5uLL}, {0x0747AE14FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000001006DA0D1uLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFDuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000000000002uLL, 0x03A3D70A7FFFFFFFuLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000000000003uLL, 0x026D3A06FFFFFFFFuLL, 0x0000000000000001uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000000000010uLL, 0x00747AE14FFFFFFFuLL, 0x000000000000000EuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000000078644FAuLL, 0x00000000F7AE913FuLL, 0x0000000000F76C78uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000000747AE14uLL, 0x0000000100000023uLL, 0x0000000001333342uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C2AuLL, 0x000000000E8F5C28uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000080000000uLL, 0x000000000E8F5C29uLL, 0x000000007FFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE15uLL, 0x0000000015D70A3DuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE15uLL, 0x000000000E8F5C28uLL}, {0x0747AE14FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE15uLL, 0x000000000747AE13uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x00000000FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x00000000F8B851EAuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000100000002uLL, 0x000000000747AE14uLL, 0x00000000F170A3D6uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000100000003uLL, 0x000000000747AE14uLL, 0x00000000EA28F5C2uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000100000010uLL, 0x000000000747AE14uLL, 0x000000008B851EBEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000001078644FAuLL, 0x0000000007127740uLL, 0x0000000004CA8B7EuLL}, {0x0747AE14FFFFFFFEuLL, 0x000000010747AE14uLL, 0x00000000071425A6uLL, 0x00000000C5CC3B06uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740EuLL, 0x0000000004DA740CuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x000000017FFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000010AEB851CuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000010747AE12uLL}, {0x0747AE14FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000103A3D708uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x00000000FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x00000000FC5C28F4uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x00000000F8B851EAuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000003A3D70AuLL, 0x00000000F5147AE0uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000200000010uLL, 0x0000000003A3D70AuLL, 0x00000000C5C28F5EuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000017847CB04uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000020747AE14uLL, 0x000000000396C6B2uLL, 0x0000000043CD7E16uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D5uLL, 0x0000000082E978D3uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000002E978D5uLL, 0x000000007FFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A07uLL, 0x000000000747AE13uLL}, {0x0747AE14FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A07uLL, 0x0000000004DA740CuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A07uLL, 0x00000000026D3A05uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x00000002FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000002FD92C5F8uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000002FB258BF2uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000002F8B851ECuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000002D92C5F9EuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000028425ED04uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000030747AE14uLL, 0x00000000026764ACuLL, 0x00000000E9CB3A8EuLL}, {0x0747AE14FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000182147ADFuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x000000017FFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000010575C28DuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000103A3D708uLL}, {0x0747AE14FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000101D1EB83uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x00000004FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000004FF8B851DuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000004FF170A3CuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000004FEA28F5BuLL}, {0x0747AE14FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000004F8B851EEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000C94A5DA30uLL}, {0x0747AE14FFFFFFFEuLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000CB84C4A8AuLL}, {0x0747AE14FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000018070F345uLL}, {0x0747AE14FFFFFFFEuLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x000000017FFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000010148E27AuLL}, {0x0747AE14FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000100DB41A6uLL}, {0x0747AE14FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000001006DA0D2uLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFEuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000000000002uLL, 0x03A3D70A7FFFFFFFuLL, 0x0000000000000001uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000000000003uLL, 0x026D3A06FFFFFFFFuLL, 0x0000000000000002uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000000000010uLL, 0x00747AE14FFFFFFFuLL, 0x000000000000000FuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000000078644FAuLL, 0x00000000F7AE913FuLL, 0x0000000000F76C79uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000000747AE14uLL, 0x0000000100000023uLL, 0x0000000001333343uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000000E8F5C2AuLL, 0x000000000E8F5C29uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000000E8F5C29uLL, 0x000000007FFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE15uLL, 0x0000000015D70A3EuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE15uLL, 0x000000000E8F5C29uLL}, {0x0747AE14FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE15uLL, 0x000000000747AE14uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL, 0x00000000FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000100000001uLL, 0x000000000747AE14uLL, 0x00000000F8B851EBuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000100000002uLL, 0x000000000747AE14uLL, 0x00000000F170A3D7uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000100000003uLL, 0x000000000747AE14uLL, 0x00000000EA28F5C3uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000100000010uLL, 0x000000000747AE14uLL, 0x000000008B851EBFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000001078644FAuLL, 0x0000000007127740uLL, 0x0000000004CA8B7FuLL}, {0x0747AE14FFFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000071425A6uLL, 0x00000000C5CC3B07uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000004DA740EuLL, 0x0000000004DA740DuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000004DA740DuLL, 0x000000017FFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000003A3D70AuLL, 0x000000010AEB851DuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000003A3D70AuLL, 0x000000010747AE13uLL}, {0x0747AE14FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000003A3D70AuLL, 0x0000000103A3D709uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000003A3D70AuLL, 0x00000000FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000003A3D70AuLL, 0x00000000FC5C28F5uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000003A3D70AuLL, 0x00000000F8B851EBuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000003A3D70AuLL, 0x00000000F5147AE1uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000200000010uLL, 0x0000000003A3D70AuLL, 0x00000000C5C28F5FuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000002078644FAuLL, 0x0000000003965801uLL, 0x000000017847CB05uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000020747AE14uLL, 0x000000000396C6B2uLL, 0x0000000043CD7E17uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000002E978D5uLL, 0x0000000082E978D4uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000002E978D5uLL, 0x000000007FFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x00000000026D3A07uLL, 0x000000000747AE14uLL}, {0x0747AE14FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x00000000026D3A07uLL, 0x0000000004DA740DuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x00000000026D3A07uLL, 0x00000000026D3A06uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000300000000uLL, 0x00000000026D3A06uLL, 0x00000002FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000300000001uLL, 0x00000000026D3A06uLL, 0x00000002FD92C5F9uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000300000002uLL, 0x00000000026D3A06uLL, 0x00000002FB258BF3uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000300000003uLL, 0x00000000026D3A06uLL, 0x00000002F8B851EDuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000300000010uLL, 0x00000000026D3A06uLL, 0x00000002D92C5F9FuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000002673301uLL, 0x000000028425ED05uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000026764ACuLL, 0x00000000E9CB3A8FuLL}, {0x0747AE14FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000002147AE1uLL, 0x0000000182147AE0uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000002147AE1uLL, 0x000000017FFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000001D1EB85uLL, 0x000000010575C28EuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000001D1EB85uLL, 0x0000000103A3D709uLL}, {0x0747AE14FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000001D1EB85uLL, 0x0000000101D1EB84uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000000747AE1uLL, 0x00000004FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000000747AE1uLL, 0x00000004FF8B851EuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000000747AE1uLL, 0x00000004FF170A3DuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000000747AE1uLL, 0x00000004FEA28F5CuLL}, {0x0747AE14FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000000747AE1uLL, 0x00000004F8B851EFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000000744433uLL, 0x0000000C94A5DA31uLL}, {0x0747AE14FFFFFFFFuLL, 0x000000100747AE14uLL, 0x00000000007445F9uLL, 0x0000000CB84C4A8BuLL}, {0x0747AE14FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000070F347uLL, 0x000000018070F346uLL}, {0x0747AE14FFFFFFFFuLL, 0x0000001080000000uLL, 0x000000000070F347uLL, 0x000000017FFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x00000000006DA0D4uLL, 0x000000010148E27BuLL}, {0x0747AE14FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x00000000006DA0D4uLL, 0x0000000100DB41A7uLL}, {0x0747AE14FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x00000000006DA0D4uLL, 0x00000001006DA0D3uLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x0747AE14FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x0747AE14FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x0747AE14FFFFFFFFuLL}, {0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x3FFFFFFF80000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000000000000003uLL, 0x2AAAAAAA55555555uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000000uLL, 0x0000000000000010uLL, 0x07FFFFFFF0000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000000078644FAuLL, 0x0000001102D8BD5CuLL, 0x0000000003E2A428uLL}, {0x7FFFFFFF00000000uLL, 0x000000000747AE14uLL, 0x000000119519529AuLL, 0x00000000052ADFF8uLL}, {0x7FFFFFFF00000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFF00000000uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000002uLL}, {0x7FFFFFFF00000000uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000004uLL}, {0x7FFFFFFF00000000uLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x0000000080000009uLL}, {0x7FFFFFFF00000000uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x0000000000000090uLL}, {0x7FFFFFFF00000000uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x000000005544910EuLL}, {0x7FFFFFFF00000000uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x0000000024619090uLL}, {0x7FFFFFFF00000000uLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555554uLL}, {0x7FFFFFFF00000000uLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x0000000100000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFDuLL}, {0x7FFFFFFF00000000uLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000017FFFFFFEuLL}, {0x7FFFFFFF00000000uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000013FFFFFFFuLL}, {0x7FFFFFFF00000000uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x0000000100000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000001uLL}, {0x7FFFFFFF00000000uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000080000002uLL}, {0x7FFFFFFF00000000uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000040000003uLL}, {0x7FFFFFFF00000000uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x0000000100000030uLL}, {0x7FFFFFFF00000000uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001290A84D8uLL}, {0x7FFFFFFF00000000uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000032B07784uLL}, {0x7FFFFFFF00000000uLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x0000000233333332uLL}, {0x7FFFFFFF00000000uLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x0000000200000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000017FFFFFFEuLL}, {0x7FFFFFFF00000000uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000155555554uLL}, {0x7FFFFFFF00000000uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAAAAuLL}, {0x7FFFFFFF00000000uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000100000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000D5555556uLL}, {0x7FFFFFFF00000000uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000AAAAAAACuLL}, {0x7FFFFFFF00000000uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000080000002uLL}, {0x7FFFFFFF00000000uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000155555570uLL}, {0x7FFFFFFF00000000uLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002A39634D2uLL}, {0x7FFFFFFF00000000uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000620B044uLL}, {0x7FFFFFFF00000000uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000124924924uLL}, {0x7FFFFFFF00000000uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000100000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x000000035FFFFFFDuLL}, {0x7FFFFFFF00000000uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x000000033FFFFFFEuLL}, {0x7FFFFFFF00000000uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x000000031FFFFFFFuLL}, {0x7FFFFFFF00000000uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F00000000uLL}, {0x7FFFFFFF00000000uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EF8000001uLL}, {0x7FFFFFFF00000000uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF0000002uLL}, {0x7FFFFFFF00000000uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EE8000003uLL}, {0x7FFFFFFF00000000uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E80000010uLL}, {0x7FFFFFFF00000000uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000903C212C6uLL}, {0x7FFFFFFF00000000uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000223D54BC0uLL}, {0x7FFFFFFF00000000uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000107C1F07CuLL}, {0x7FFFFFFF00000000uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000100000000uLL}, {0x7FFFFFFF00000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000816969695uLL}, {0x7FFFFFFF00000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000080F0F0F0EuLL}, {0x7FFFFFFF00000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000807878787uLL}, {0x7FFFFFFF00000000uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6500000000uLL}, {0x7FFFFFFF00000000uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFEFuLL}, {0x7FFFFFFF00000000uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFDEuLL}, {0x7FFFFFFF00000000uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFCDuLL}, {0x7FFFFFFF00000000uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B64FFFFFEF0uLL}, {0x7FFFFFFF00000000uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6480156B66uLL}, {0x7FFFFFFF00000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B64843D70ACuLL}, {0x7FFFFFFF00000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C80000011uLL}, {0x7FFFFFFF00000000uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C80000000uLL}, {0x7FFFFFFF00000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5400000033uLL}, {0x7FFFFFFF00000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5400000022uLL}, {0x7FFFFFFF00000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5400000011uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB00000000uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFEFuLL}, {0x7FFFFFFF00000000uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFDEuLL}, {0x7FFFFFFF00000000uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFCDuLL}, {0x7FFFFFFF00000000uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFEF0uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA80156B66uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA843D70ACuLL}, {0x7FFFFFFF00000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A280000011uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A280000000uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A00000033uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A00000022uLL}, {0x7FFFFFFF00000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A00000011uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000000uLL}, {0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x3FFFFFFF80000000uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x0000000000000003uLL, 0x2AAAAAAA55555555uLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000001uLL, 0x0000000000000010uLL, 0x07FFFFFFF0000000uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000000078644FAuLL, 0x0000001102D8BD5CuLL, 0x0000000003E2A429uLL}, {0x7FFFFFFF00000001uLL, 0x000000000747AE14uLL, 0x000000119519529AuLL, 0x00000000052ADFF9uLL}, {0x7FFFFFFF00000001uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0x7FFFFFFF00000001uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000003uLL}, {0x7FFFFFFF00000001uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000005uLL}, {0x7FFFFFFF00000001uLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x000000008000000AuLL}, {0x7FFFFFFF00000001uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x0000000000000091uLL}, {0x7FFFFFFF00000001uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x000000005544910FuLL}, {0x7FFFFFFF00000001uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x0000000024619091uLL}, {0x7FFFFFFF00000001uLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555555uLL}, {0x7FFFFFFF00000001uLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x0000000100000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFEuLL}, {0x7FFFFFFF00000001uLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF00000001uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000140000000uLL}, {0x7FFFFFFF00000001uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x0000000100000001uLL}, {0x7FFFFFFF00000001uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000002uLL}, {0x7FFFFFFF00000001uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000080000003uLL}, {0x7FFFFFFF00000001uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000040000004uLL}, {0x7FFFFFFF00000001uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x0000000100000031uLL}, {0x7FFFFFFF00000001uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001290A84D9uLL}, {0x7FFFFFFF00000001uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000032B07785uLL}, {0x7FFFFFFF00000001uLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x0000000233333333uLL}, {0x7FFFFFFF00000001uLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x0000000200000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF00000001uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000155555555uLL}, {0x7FFFFFFF00000001uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAAABuLL}, {0x7FFFFFFF00000001uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000100000001uLL}, {0x7FFFFFFF00000001uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000D5555557uLL}, {0x7FFFFFFF00000001uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000AAAAAAADuLL}, {0x7FFFFFFF00000001uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000080000003uLL}, {0x7FFFFFFF00000001uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000155555571uLL}, {0x7FFFFFFF00000001uLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002A39634D3uLL}, {0x7FFFFFFF00000001uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000620B045uLL}, {0x7FFFFFFF00000001uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000124924925uLL}, {0x7FFFFFFF00000001uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000100000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x000000035FFFFFFEuLL}, {0x7FFFFFFF00000001uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x000000033FFFFFFFuLL}, {0x7FFFFFFF00000001uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x0000000320000000uLL}, {0x7FFFFFFF00000001uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F00000001uLL}, {0x7FFFFFFF00000001uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EF8000002uLL}, {0x7FFFFFFF00000001uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF0000003uLL}, {0x7FFFFFFF00000001uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EE8000004uLL}, {0x7FFFFFFF00000001uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E80000011uLL}, {0x7FFFFFFF00000001uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000903C212C7uLL}, {0x7FFFFFFF00000001uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000223D54BC1uLL}, {0x7FFFFFFF00000001uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000107C1F07DuLL}, {0x7FFFFFFF00000001uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000100000001uLL}, {0x7FFFFFFF00000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000816969696uLL}, {0x7FFFFFFF00000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000080F0F0F0FuLL}, {0x7FFFFFFF00000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000807878788uLL}, {0x7FFFFFFF00000001uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6500000001uLL}, {0x7FFFFFFF00000001uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFF0uLL}, {0x7FFFFFFF00000001uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFDFuLL}, {0x7FFFFFFF00000001uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFCEuLL}, {0x7FFFFFFF00000001uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B64FFFFFEF1uLL}, {0x7FFFFFFF00000001uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6480156B67uLL}, {0x7FFFFFFF00000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B64843D70ADuLL}, {0x7FFFFFFF00000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C80000012uLL}, {0x7FFFFFFF00000001uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C80000001uLL}, {0x7FFFFFFF00000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5400000034uLL}, {0x7FFFFFFF00000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5400000023uLL}, {0x7FFFFFFF00000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5400000012uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB00000001uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFF0uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFDFuLL}, {0x7FFFFFFF00000001uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFCEuLL}, {0x7FFFFFFF00000001uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFEF1uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA80156B67uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA843D70ADuLL}, {0x7FFFFFFF00000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A280000012uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A280000001uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A00000034uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A00000023uLL}, {0x7FFFFFFF00000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A00000012uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000001uLL}, {0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x3FFFFFFF80000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000002uLL, 0x0000000000000003uLL, 0x2AAAAAAA55555556uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000002uLL, 0x0000000000000010uLL, 0x07FFFFFFF0000000uLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000000078644FAuLL, 0x0000001102D8BD5CuLL, 0x0000000003E2A42AuLL}, {0x7FFFFFFF00000002uLL, 0x000000000747AE14uLL, 0x000000119519529AuLL, 0x00000000052ADFFAuLL}, {0x7FFFFFFF00000002uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000002uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0x7FFFFFFF00000002uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000002uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000004uLL}, {0x7FFFFFFF00000002uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000006uLL}, {0x7FFFFFFF00000002uLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x000000008000000BuLL}, {0x7FFFFFFF00000002uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x0000000000000092uLL}, {0x7FFFFFFF00000002uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x0000000055449110uLL}, {0x7FFFFFFF00000002uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x0000000024619092uLL}, {0x7FFFFFFF00000002uLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555556uLL}, {0x7FFFFFFF00000002uLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x0000000100000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFFuLL}, {0x7FFFFFFF00000002uLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000180000000uLL}, {0x7FFFFFFF00000002uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000140000001uLL}, {0x7FFFFFFF00000002uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x0000000100000002uLL}, {0x7FFFFFFF00000002uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000003uLL}, {0x7FFFFFFF00000002uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000080000004uLL}, {0x7FFFFFFF00000002uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000040000005uLL}, {0x7FFFFFFF00000002uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x0000000100000032uLL}, {0x7FFFFFFF00000002uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001290A84DAuLL}, {0x7FFFFFFF00000002uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000032B07786uLL}, {0x7FFFFFFF00000002uLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x0000000233333334uLL}, {0x7FFFFFFF00000002uLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x0000000200000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x0000000180000000uLL}, {0x7FFFFFFF00000002uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000155555556uLL}, {0x7FFFFFFF00000002uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAAACuLL}, {0x7FFFFFFF00000002uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000100000002uLL}, {0x7FFFFFFF00000002uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000D5555558uLL}, {0x7FFFFFFF00000002uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000AAAAAAAEuLL}, {0x7FFFFFFF00000002uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000080000004uLL}, {0x7FFFFFFF00000002uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000155555572uLL}, {0x7FFFFFFF00000002uLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002A39634D4uLL}, {0x7FFFFFFF00000002uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000620B046uLL}, {0x7FFFFFFF00000002uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000124924926uLL}, {0x7FFFFFFF00000002uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000100000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x000000035FFFFFFFuLL}, {0x7FFFFFFF00000002uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x0000000340000000uLL}, {0x7FFFFFFF00000002uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x0000000320000001uLL}, {0x7FFFFFFF00000002uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F00000002uLL}, {0x7FFFFFFF00000002uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EF8000003uLL}, {0x7FFFFFFF00000002uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF0000004uLL}, {0x7FFFFFFF00000002uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EE8000005uLL}, {0x7FFFFFFF00000002uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E80000012uLL}, {0x7FFFFFFF00000002uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000903C212C8uLL}, {0x7FFFFFFF00000002uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000223D54BC2uLL}, {0x7FFFFFFF00000002uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000107C1F07EuLL}, {0x7FFFFFFF00000002uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000100000002uLL}, {0x7FFFFFFF00000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000816969697uLL}, {0x7FFFFFFF00000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000080F0F0F10uLL}, {0x7FFFFFFF00000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000807878789uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6500000002uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFF1uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFE0uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFCFuLL}, {0x7FFFFFFF00000002uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B64FFFFFEF2uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6480156B68uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B64843D70AEuLL}, {0x7FFFFFFF00000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C80000013uLL}, {0x7FFFFFFF00000002uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C80000002uLL}, {0x7FFFFFFF00000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5400000035uLL}, {0x7FFFFFFF00000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5400000024uLL}, {0x7FFFFFFF00000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5400000013uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB00000002uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFF1uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFE0uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFCFuLL}, {0x7FFFFFFF00000002uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFEF2uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA80156B68uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA843D70AEuLL}, {0x7FFFFFFF00000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A280000013uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A280000002uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A00000035uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A00000024uLL}, {0x7FFFFFFF00000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A00000013uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000002uLL}, {0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x3FFFFFFF80000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000003uLL, 0x0000000000000003uLL, 0x2AAAAAAA55555556uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000003uLL, 0x0000000000000010uLL, 0x07FFFFFFF0000000uLL, 0x0000000000000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000000078644FAuLL, 0x0000001102D8BD5CuLL, 0x0000000003E2A42BuLL}, {0x7FFFFFFF00000003uLL, 0x000000000747AE14uLL, 0x000000119519529AuLL, 0x00000000052ADFFBuLL}, {0x7FFFFFFF00000003uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0x7FFFFFFF00000003uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0x7FFFFFFF00000003uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL}, {0x7FFFFFFF00000003uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000005uLL}, {0x7FFFFFFF00000003uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000007uLL}, {0x7FFFFFFF00000003uLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x000000008000000CuLL}, {0x7FFFFFFF00000003uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x0000000000000093uLL}, {0x7FFFFFFF00000003uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x0000000055449111uLL}, {0x7FFFFFFF00000003uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x0000000024619093uLL}, {0x7FFFFFFF00000003uLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555557uLL}, {0x7FFFFFFF00000003uLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x0000000100000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C0000000uLL}, {0x7FFFFFFF00000003uLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000180000001uLL}, {0x7FFFFFFF00000003uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000140000002uLL}, {0x7FFFFFFF00000003uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x0000000100000003uLL}, {0x7FFFFFFF00000003uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000004uLL}, {0x7FFFFFFF00000003uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000080000005uLL}, {0x7FFFFFFF00000003uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000040000006uLL}, {0x7FFFFFFF00000003uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x0000000100000033uLL}, {0x7FFFFFFF00000003uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001290A84DBuLL}, {0x7FFFFFFF00000003uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000032B07787uLL}, {0x7FFFFFFF00000003uLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x0000000233333335uLL}, {0x7FFFFFFF00000003uLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x0000000200000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x0000000180000001uLL}, {0x7FFFFFFF00000003uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000155555557uLL}, {0x7FFFFFFF00000003uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAAADuLL}, {0x7FFFFFFF00000003uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000100000003uLL}, {0x7FFFFFFF00000003uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000D5555559uLL}, {0x7FFFFFFF00000003uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000AAAAAAAFuLL}, {0x7FFFFFFF00000003uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000080000005uLL}, {0x7FFFFFFF00000003uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000155555573uLL}, {0x7FFFFFFF00000003uLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002A39634D5uLL}, {0x7FFFFFFF00000003uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000620B047uLL}, {0x7FFFFFFF00000003uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000124924927uLL}, {0x7FFFFFFF00000003uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000100000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x0000000360000000uLL}, {0x7FFFFFFF00000003uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x0000000340000001uLL}, {0x7FFFFFFF00000003uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x0000000320000002uLL}, {0x7FFFFFFF00000003uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F00000003uLL}, {0x7FFFFFFF00000003uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EF8000004uLL}, {0x7FFFFFFF00000003uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF0000005uLL}, {0x7FFFFFFF00000003uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EE8000006uLL}, {0x7FFFFFFF00000003uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E80000013uLL}, {0x7FFFFFFF00000003uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000903C212C9uLL}, {0x7FFFFFFF00000003uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000223D54BC3uLL}, {0x7FFFFFFF00000003uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000107C1F07FuLL}, {0x7FFFFFFF00000003uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000100000003uLL}, {0x7FFFFFFF00000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000816969698uLL}, {0x7FFFFFFF00000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000080F0F0F11uLL}, {0x7FFFFFFF00000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x000000080787878AuLL}, {0x7FFFFFFF00000003uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6500000003uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFF2uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFE1uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFD0uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B64FFFFFEF3uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6480156B69uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B64843D70AFuLL}, {0x7FFFFFFF00000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C80000014uLL}, {0x7FFFFFFF00000003uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C80000003uLL}, {0x7FFFFFFF00000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5400000036uLL}, {0x7FFFFFFF00000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5400000025uLL}, {0x7FFFFFFF00000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5400000014uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB00000003uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFF2uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFE1uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFD0uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFEF3uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA80156B69uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA843D70AFuLL}, {0x7FFFFFFF00000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A280000014uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A280000003uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A00000036uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A00000025uLL}, {0x7FFFFFFF00000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A00000014uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000003uLL}, {0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x3FFFFFFF80000008uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000010uLL, 0x0000000000000003uLL, 0x2AAAAAAA5555555AuLL, 0x0000000000000002uLL}, {0x7FFFFFFF00000010uLL, 0x0000000000000010uLL, 0x07FFFFFFF0000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000010uLL, 0x00000000078644FAuLL, 0x0000001102D8BD5CuLL, 0x0000000003E2A438uLL}, {0x7FFFFFFF00000010uLL, 0x000000000747AE14uLL, 0x000000119519529AuLL, 0x00000000052AE008uLL}, {0x7FFFFFFF00000010uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0x7FFFFFFF00000010uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000008000000FuLL}, {0x7FFFFFFF00000010uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000010uLL}, {0x7FFFFFFF00000010uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000012uLL}, {0x7FFFFFFF00000010uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000014uLL}, {0x7FFFFFFF00000010uLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x0000000080000019uLL}, {0x7FFFFFFF00000010uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x00000000000000A0uLL}, {0x7FFFFFFF00000010uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x000000005544911EuLL}, {0x7FFFFFFF00000010uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x00000000246190A0uLL}, {0x7FFFFFFF00000010uLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555564uLL}, {0x7FFFFFFF00000010uLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x0000000100000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C000000DuLL}, {0x7FFFFFFF00000010uLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000018000000EuLL}, {0x7FFFFFFF00000010uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000014000000FuLL}, {0x7FFFFFFF00000010uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x0000000100000010uLL}, {0x7FFFFFFF00000010uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000011uLL}, {0x7FFFFFFF00000010uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000080000012uLL}, {0x7FFFFFFF00000010uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000040000013uLL}, {0x7FFFFFFF00000010uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x0000000100000040uLL}, {0x7FFFFFFF00000010uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001290A84E8uLL}, {0x7FFFFFFF00000010uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000032B07794uLL}, {0x7FFFFFFF00000010uLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x0000000233333342uLL}, {0x7FFFFFFF00000010uLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x0000000200000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000018000000EuLL}, {0x7FFFFFFF00000010uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000155555564uLL}, {0x7FFFFFFF00000010uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAABAuLL}, {0x7FFFFFFF00000010uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000100000010uLL}, {0x7FFFFFFF00000010uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000D5555566uLL}, {0x7FFFFFFF00000010uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000AAAAAABCuLL}, {0x7FFFFFFF00000010uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000080000012uLL}, {0x7FFFFFFF00000010uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000155555580uLL}, {0x7FFFFFFF00000010uLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002A39634E2uLL}, {0x7FFFFFFF00000010uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000620B054uLL}, {0x7FFFFFFF00000010uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000124924934uLL}, {0x7FFFFFFF00000010uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000100000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x000000036000000DuLL}, {0x7FFFFFFF00000010uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x000000034000000EuLL}, {0x7FFFFFFF00000010uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x000000032000000FuLL}, {0x7FFFFFFF00000010uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F00000010uLL}, {0x7FFFFFFF00000010uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EF8000011uLL}, {0x7FFFFFFF00000010uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF0000012uLL}, {0x7FFFFFFF00000010uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EE8000013uLL}, {0x7FFFFFFF00000010uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E80000020uLL}, {0x7FFFFFFF00000010uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000903C212D6uLL}, {0x7FFFFFFF00000010uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000223D54BD0uLL}, {0x7FFFFFFF00000010uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000107C1F08CuLL}, {0x7FFFFFFF00000010uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000100000010uLL}, {0x7FFFFFFF00000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x00000008169696A5uLL}, {0x7FFFFFFF00000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000080F0F0F1EuLL}, {0x7FFFFFFF00000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000807878797uLL}, {0x7FFFFFFF00000010uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6500000010uLL}, {0x7FFFFFFF00000010uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFFFuLL}, {0x7FFFFFFF00000010uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFEEuLL}, {0x7FFFFFFF00000010uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B64FFFFFFDDuLL}, {0x7FFFFFFF00000010uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B64FFFFFF00uLL}, {0x7FFFFFFF00000010uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6480156B76uLL}, {0x7FFFFFFF00000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B64843D70BCuLL}, {0x7FFFFFFF00000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C80000021uLL}, {0x7FFFFFFF00000010uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C80000010uLL}, {0x7FFFFFFF00000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5400000043uLL}, {0x7FFFFFFF00000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5400000032uLL}, {0x7FFFFFFF00000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5400000021uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB00000010uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFFFuLL}, {0x7FFFFFFF00000010uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFEEuLL}, {0x7FFFFFFF00000010uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFFDDuLL}, {0x7FFFFFFF00000010uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AAFFFFFF00uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA80156B76uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA843D70BCuLL}, {0x7FFFFFFF00000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A280000021uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A280000010uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A00000043uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A00000032uLL}, {0x7FFFFFFF00000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A00000021uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF00000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF00000010uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x3FFFFFFF83C3227DuLL, 0x0000000000000000uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000000000003uLL, 0x2AAAAAAA57D76C53uLL, 0x0000000000000001uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000000000010uLL, 0x07FFFFFFF078644FuLL, 0x000000000000000AuLL}, {0x7FFFFFFF078644FAuLL, 0x00000000078644FAuLL, 0x0000001102D8BD5DuLL, 0x0000000003E2A428uLL}, {0x7FFFFFFF078644FAuLL, 0x000000000747AE14uLL, 0x000000119519529BuLL, 0x00000000056976DEuLL}, {0x7FFFFFFF078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x00000000878644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000000878644F9uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x00000000078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x00000000878644FCuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x00000000078644FEuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x0000000087864503uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x000000000786458AuLL}, {0x7FFFFFFF078644FAuLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x000000005CCAD608uLL}, {0x7FFFFFFF078644FAuLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x000000002BE7D58AuLL}, {0x7FFFFFFF078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x000000015CDB9A4EuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x00000001078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C78644F7uLL}, {0x7FFFFFFF078644FAuLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000001878644F8uLL}, {0x7FFFFFFF078644FAuLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000001478644F9uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x00000001078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C78644FBuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x00000000878644FCuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x00000000478644FDuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x000000010786452AuLL}, {0x7FFFFFFF078644FAuLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x000000013090C9D2uLL}, {0x7FFFFFFF078644FAuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x000000003A36BC7EuLL}, {0x7FFFFFFF078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x000000023AB9782CuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x00000002078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x00000001878644F8uLL}, {0x7FFFFFFF078644FAuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x000000015CDB9A4EuLL}, {0x7FFFFFFF078644FAuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000013230EFA4uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000001078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000DCDB9A50uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000B230EFA6uLL}, {0x7FFFFFFF078644FAuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x00000000878644FCuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000015CDB9A6AuLL}, {0x7FFFFFFF078644FAuLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002AB1C79CCuLL}, {0x7FFFFFFF078644FAuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000DA6F53EuLL}, {0x7FFFFFFF078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x000000012C188E1EuLL}, {0x7FFFFFFF078644FAuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000001078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x00000003678644F7uLL}, {0x7FFFFFFF078644FAuLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x00000003478644F8uLL}, {0x7FFFFFFF078644FAuLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x00000003278644F9uLL}, {0x7FFFFFFF078644FAuLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EFF8644FBuLL}, {0x7FFFFFFF078644FAuLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF78644FCuLL}, {0x7FFFFFFF078644FAuLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EEF8644FDuLL}, {0x7FFFFFFF078644FAuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E8786450AuLL}, {0x7FFFFFFF078644FAuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x000000090B4857C0uLL}, {0x7FFFFFFF078644FAuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x000000022B5B90BAuLL}, {0x7FFFFFFF078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x000000010F483576uLL}, {0x7FFFFFFF078644FAuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000001078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x000000081E1CDB8FuLL}, {0x7FFFFFFF078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x0000000816955408uLL}, {0x7FFFFFFF078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x000000080F0DCC81uLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B65078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65078644E9uLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65078644D8uLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65078644C7uLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65078643EAuLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B64879BB060uLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B648BC3B5A6uLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C8786450BuLL}, {0x7FFFFFFF078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C878644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B540786452DuLL}, {0x7FFFFFFF078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B540786451CuLL}, {0x7FFFFFFF078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B540786450BuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AB078644E9uLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AB078644D8uLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AB078644C7uLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AB078643EAuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA879BB060uLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA8BC3B5A6uLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A28786450BuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A2878644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A0786452DuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A0786451CuLL}, {0x7FFFFFFF078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A0786450BuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF078644FAuLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000000uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x3FFFFFFF83A3D70AuLL, 0x0000000000000000uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000000000003uLL, 0x2AAAAAAA57C28F5CuLL, 0x0000000000000000uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000000000010uLL, 0x07FFFFFFF0747AE1uLL, 0x0000000000000004uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000000078644FAuLL, 0x0000001102D8BD5DuLL, 0x0000000003A40D42uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000000747AE14uLL, 0x000000119519529BuLL, 0x00000000052ADFF8uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000008747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x000000000747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000008747AE13uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x000000000747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL, 0x000000008747AE16uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x000000000747AE18uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000100000003uLL, 0x000000007FFFFFFDuLL, 0x000000008747AE1DuLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x000000000747AEA4uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x000000005C8C3F22uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x000000002BA93EA4uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000055555554uLL, 0x000000015C9D0368uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x000000010747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000001FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C747AE11uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000018747AE12uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000014747AE13uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x000000010747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000000C747AE15uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x000000008747AE16uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x000000004747AE17uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x000000010747AE44uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001305232ECuLL}, {0x7FFFFFFF0747AE14uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000039F82598uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000033333332uLL, 0x000000023A7AE146uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x000000020747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000018747AE12uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x000000015C9D0368uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x0000000131F258BEuLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x000000010747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000000DC9D036AuLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000000B1F258C0uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x000000008747AE16uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000015C9D0384uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000003078644FAuLL, 0x000000002A40B0A3uLL, 0x00000002AADDE2E6uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000000D685E58uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x000000012BD9F738uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x000000010747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x000000036747AE11uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x000000034747AE12uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x000000032747AE13uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000EFF47AE15uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000EF747AE16uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000EEF47AE17uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000E8747AE24uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x000000090B09C0DAuLL}, {0x7FFFFFFF0747AE14uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x000000022B1CF9D4uLL}, {0x7FFFFFFF0747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x000000010F099E90uLL}, {0x7FFFFFFF0747AE14uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x000000010747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x000000081DDE44A9uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000081656BD22uLL}, {0x7FFFFFFF0747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x000000080ECF359BuLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B650747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B650747AE03uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B650747ADF2uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B650747ADE1uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B650747AD04uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B64875D197AuLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B648B851EC0uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5C8747AE25uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5C8747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B540747AE47uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B540747AE36uLL}, {0x7FFFFFFF0747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B540747AE25uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AB0747AE03uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AB0747ADF2uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AB0747ADE1uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AB0747AD04uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AA875D197AuLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AA8B851EC0uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A28747AE25uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A28747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A0747AE47uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A0747AE36uLL}, {0x7FFFFFFF0747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A0747AE25uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF0747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF0747AE14uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x3FFFFFFFBFFFFFFFuLL, 0x0000000000000001uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000003uLL, 0x2AAAAAAA7FFFFFFFuLL, 0x0000000000000002uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000010uLL, 0x07FFFFFFF7FFFFFFuLL, 0x000000000000000FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000001102D8BD6DuLL, 0x0000000003F80F8DuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000000747AE14uLL, 0x00000011951952ACuLL, 0x000000000220A28FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000000000002uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000080000003uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000000000005uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x000000008000008FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x00000000D544910DuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x00000000A461908FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555554uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000055555554uLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x000000003FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000001FFFFFFFDuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFEuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x0000000140000000uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000100000001uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000002uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x000000018000002FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001A90A84D7uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x00000000B2B07783uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x0000000033333332uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000033333332uLL, 0x000000027FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x00000001FFFFFFFDuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x00000001D5555553uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAA9uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x0000000155555555uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAAABuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000100000001uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x00000001D555556FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000001C0FEFD7uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000008620B043uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x00000001A4924923uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x00000003DFFFFFFCuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x00000003BFFFFFFDuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x000000039FFFFFFEuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000F78000000uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000F70000001uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000F68000002uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F0000000FuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000983C212C5uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x00000002A3D54BBFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000187C1F07BuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000896969694uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000088F0F0F0DuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000887878786uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B657FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B657FFFFFEEuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B657FFFFFDDuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B657FFFFFCCuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B657FFFFEEFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6500156B65uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65043D70ABuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D00000010uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5CFFFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5480000032uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5480000021uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5480000010uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFEEuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFDDuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFCCuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFEEFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB00156B65uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB043D70ABuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A300000010uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A2FFFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A80000032uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A80000021uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A80000010uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x3FFFFFFFC0000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000000000003uLL, 0x2AAAAAAA80000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000000000010uLL, 0x07FFFFFFF8000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000000078644FAuLL, 0x0000001102D8BD6DuLL, 0x0000000003F80F8EuLL}, {0x7FFFFFFF80000000uLL, 0x000000000747AE14uLL, 0x00000011951952ACuLL, 0x000000000220A290uLL}, {0x7FFFFFFF80000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFF80000000uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000000000003uLL}, {0x7FFFFFFF80000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000080000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0x7FFFFFFF80000000uLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000080000004uLL}, {0x7FFFFFFF80000000uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000000000006uLL}, {0x7FFFFFFF80000000uLL, 0x0000000100000010uLL, 0x000000007FFFFFF7uLL, 0x0000000080000090uLL}, {0x7FFFFFFF80000000uLL, 0x00000001078644FAuLL, 0x000000007C585DADuLL, 0x00000000D544910EuLL}, {0x7FFFFFFF80000000uLL, 0x000000010747AE14uLL, 0x000000007C75ED2CuLL, 0x00000000A4619090uLL}, {0x7FFFFFFF80000000uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555555uLL}, {0x7FFFFFFF80000000uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x0000000040000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000001FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFFuLL}, {0x7FFFFFFF80000000uLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x0000000180000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x0000000140000001uLL}, {0x7FFFFFFF80000000uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000100000002uLL}, {0x7FFFFFFF80000000uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x00000000C0000003uLL}, {0x7FFFFFFF80000000uLL, 0x0000000200000010uLL, 0x000000003FFFFFFDuLL, 0x0000000180000030uLL}, {0x7FFFFFFF80000000uLL, 0x00000002078644FAuLL, 0x000000003F12B424uLL, 0x00000001A90A84D8uLL}, {0x7FFFFFFF80000000uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x00000000B2B07784uLL}, {0x7FFFFFFF80000000uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x0000000033333333uLL}, {0x7FFFFFFF80000000uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x00000001FFFFFFFEuLL}, {0x7FFFFFFF80000000uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x00000001D5555554uLL}, {0x7FFFFFFF80000000uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAAAuLL}, {0x7FFFFFFF80000000uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000180000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x0000000155555556uLL}, {0x7FFFFFFF80000000uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x000000012AAAAAACuLL}, {0x7FFFFFFF80000000uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000100000002uLL}, {0x7FFFFFFF80000000uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x00000001D5555570uLL}, {0x7FFFFFFF80000000uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000001C0FEFD8uLL}, {0x7FFFFFFF80000000uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000008620B044uLL}, {0x7FFFFFFF80000000uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x00000001A4924924uLL}, {0x7FFFFFFF80000000uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000180000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000003FFFFFFFDuLL, 0x000000001FFFFFFFuLL, 0x00000003DFFFFFFDuLL}, {0x7FFFFFFF80000000uLL, 0x00000003FFFFFFFEuLL, 0x000000001FFFFFFFuLL, 0x00000003BFFFFFFEuLL}, {0x7FFFFFFF80000000uLL, 0x00000003FFFFFFFFuLL, 0x000000001FFFFFFFuLL, 0x000000039FFFFFFFuLL}, {0x7FFFFFFF80000000uLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000F80000000uLL}, {0x7FFFFFFF80000000uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000F78000001uLL}, {0x7FFFFFFF80000000uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000F70000002uLL}, {0x7FFFFFFF80000000uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000F68000003uLL}, {0x7FFFFFFF80000000uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F00000010uLL}, {0x7FFFFFFF80000000uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000983C212C6uLL}, {0x7FFFFFFF80000000uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x00000002A3D54BC0uLL}, {0x7FFFFFFF80000000uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000187C1F07CuLL}, {0x7FFFFFFF80000000uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000180000000uLL}, {0x7FFFFFFF80000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000896969695uLL}, {0x7FFFFFFF80000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000088F0F0F0EuLL}, {0x7FFFFFFF80000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000887878787uLL}, {0x7FFFFFFF80000000uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6580000000uLL}, {0x7FFFFFFF80000000uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B657FFFFFEFuLL}, {0x7FFFFFFF80000000uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B657FFFFFDEuLL}, {0x7FFFFFFF80000000uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B657FFFFFCDuLL}, {0x7FFFFFFF80000000uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B657FFFFEF0uLL}, {0x7FFFFFFF80000000uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6500156B66uLL}, {0x7FFFFFFF80000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65043D70ACuLL}, {0x7FFFFFFF80000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D00000011uLL}, {0x7FFFFFFF80000000uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D00000000uLL}, {0x7FFFFFFF80000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5480000033uLL}, {0x7FFFFFFF80000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5480000022uLL}, {0x7FFFFFFF80000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5480000011uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AB80000000uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFEFuLL}, {0x7FFFFFFF80000000uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFDEuLL}, {0x7FFFFFFF80000000uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFFCDuLL}, {0x7FFFFFFF80000000uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AB7FFFFEF0uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB00156B66uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB043D70ACuLL}, {0x7FFFFFFF80000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A300000011uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A300000000uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709A80000033uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709A80000022uLL}, {0x7FFFFFFF80000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709A80000011uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFF80000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFF80000000uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000002uLL, 0x3FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAA9uLL, 0x0000000000000002uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000010uLL, 0x07FFFFFFFFFFFFFFuLL, 0x000000000000000DuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF1uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E1339uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000000uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000100000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000001uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000003uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x000000000000007DuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C11uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E279uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555552uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000003FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x00000001FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000000uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000000000001DuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FDBuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07781uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333330uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFBuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555551uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAA7uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000001FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555553uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAA9uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x000000017FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000025555556DuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFD5uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B041uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924921uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000001FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000005FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000003FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000001FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000FFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF7FFFFFEuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FEFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000000uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F8000000DuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C3uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BBDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F079uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000001FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969692uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F0BuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878784uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFECuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFDBuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFCAuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEEDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B63uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70A9uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D8000000EuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D7FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000030uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B550000001FuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B550000000EuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFECuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFDBuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFCAuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEEDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B63uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70A9uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A38000000EuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A37FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000030uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B0000001FuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B0000000EuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000002uLL, 0x3FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAAAuLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000010uLL, 0x07FFFFFFFFFFFFFFuLL, 0x000000000000000EuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF2uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E133AuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000001uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000004uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x000000000000007EuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C12uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E27AuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555553uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000003FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x00000001FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000001uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000000000001EuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FDCuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07782uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333331uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFCuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555552uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAA8uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000001FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555554uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAAAuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000025555556EuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFD6uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B042uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924922uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000001FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000005FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000003FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000001FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000FFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF7FFFFFFuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000001uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F8000000EuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C4uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BBEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F07AuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000001FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969693uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F0CuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878785uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFEDuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFDCuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFCBuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEEEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B64uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70AAuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D8000000FuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D7FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000031uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000020uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B550000000FuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFEDuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFDCuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFCBuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEEEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B64uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70AAuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A38000000FuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A37FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000031uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000020uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B0000000FuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000002uLL, 0x3FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAAAuLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000010uLL, 0x07FFFFFFFFFFFFFFuLL, 0x000000000000000FuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF3uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E133BuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000002uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000005uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x000000000000007FuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C13uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E27BuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555554uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000003FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000200000000uLL, 0x000000003FFFFFFFuLL, 0x00000001FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000000uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000002uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000000000001FuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FDDuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07783uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333332uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFDuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555553uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAA9uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000001FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555555uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAABuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000025555556FuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFD7uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B043uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924923uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000001FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000005FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000003FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000001FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000007FFFFFFuLL, 0x0000000FFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF8000000uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000002uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F8000000FuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C5uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BBFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F07BuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000001FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969694uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F0DuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878786uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFEEuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFDDuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFCCuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEEFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B65uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70ABuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D80000010uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D7FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000032uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000021uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5500000010uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFEEuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFDDuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFCCuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEEFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B65uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70ABuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A380000010uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A37FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000032uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000021uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B00000010uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0x8000000000000000uLL, 0x0000000000000001uLL, 0x8000000000000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x0000000000000002uLL, 0x4000000000000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAAAuLL, 0x0000000000000002uLL}, {0x8000000000000000uLL, 0x0000000000000010uLL, 0x0800000000000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF4uLL}, {0x8000000000000000uLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E133CuLL}, {0x8000000000000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000002uLL}, {0x8000000000000000uLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000003uLL}, {0x8000000000000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000002uLL}, {0x8000000000000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000080000000uLL}, {0x8000000000000000uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0x8000000000000000uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0x8000000000000000uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000006uLL}, {0x8000000000000000uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x0000000000000080uLL}, {0x8000000000000000uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C14uLL}, {0x8000000000000000uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E27CuLL}, {0x8000000000000000uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555555uLL}, {0x8000000000000000uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000080000000uLL}, {0x8000000000000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C0000000uLL}, {0x8000000000000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000080000000uLL}, {0x8000000000000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x0000000040000000uLL}, {0x8000000000000000uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000001uLL}, {0x8000000000000000uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000002uLL}, {0x8000000000000000uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000003uLL}, {0x8000000000000000uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x0000000000000020uLL}, {0x8000000000000000uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FDEuLL}, {0x8000000000000000uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07784uLL}, {0x8000000000000000uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333333uLL}, {0x8000000000000000uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000080000000uLL}, {0x8000000000000000uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFEuLL}, {0x8000000000000000uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555554uLL}, {0x8000000000000000uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAAAuLL}, {0x8000000000000000uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000200000000uLL}, {0x8000000000000000uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555556uLL}, {0x8000000000000000uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAACuLL}, {0x8000000000000000uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000002uLL}, {0x8000000000000000uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000255555570uLL}, {0x8000000000000000uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFD8uLL}, {0x8000000000000000uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B044uLL}, {0x8000000000000000uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924924uLL}, {0x8000000000000000uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000200000000uLL}, {0x8000000000000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x0000000060000000uLL}, {0x8000000000000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x0000000040000000uLL}, {0x8000000000000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x0000000020000000uLL}, {0x8000000000000000uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF8000001uLL}, {0x8000000000000000uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000002uLL}, {0x8000000000000000uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000003uLL}, {0x8000000000000000uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F80000010uLL}, {0x8000000000000000uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C6uLL}, {0x8000000000000000uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BC0uLL}, {0x8000000000000000uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F07CuLL}, {0x8000000000000000uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000200000000uLL}, {0x8000000000000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969695uLL}, {0x8000000000000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F0EuLL}, {0x8000000000000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878787uLL}, {0x8000000000000000uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6600000000uLL}, {0x8000000000000000uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFEFuLL}, {0x8000000000000000uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFDEuLL}, {0x8000000000000000uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFCDuLL}, {0x8000000000000000uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEF0uLL}, {0x8000000000000000uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B66uLL}, {0x8000000000000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70ACuLL}, {0x8000000000000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D80000011uLL}, {0x8000000000000000uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D80000000uLL}, {0x8000000000000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000033uLL}, {0x8000000000000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000022uLL}, {0x8000000000000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5500000011uLL}, {0x8000000000000000uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC00000000uLL}, {0x8000000000000000uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFEFuLL}, {0x8000000000000000uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFDEuLL}, {0x8000000000000000uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFCDuLL}, {0x8000000000000000uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEF0uLL}, {0x8000000000000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B66uLL}, {0x8000000000000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70ACuLL}, {0x8000000000000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A380000011uLL}, {0x8000000000000000uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A380000000uLL}, {0x8000000000000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000033uLL}, {0x8000000000000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000022uLL}, {0x8000000000000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B00000011uLL}, {0x8000000000000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x8000000000000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x8000000000000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x8000000000000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x8000000000000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF0uLL}, {0x8000000000000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB06uLL}, {0x8000000000000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851ECuLL}, {0x8000000000000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x8000000000000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x8000000000000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x8000000000000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x8000000000000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x8000000000000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000000uLL, 0x8000000000000001uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000000uLL}, {0x8000000000000001uLL, 0x0000000000000001uLL, 0x8000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000001uLL, 0x0000000000000002uLL, 0x4000000000000000uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAABuLL, 0x0000000000000000uLL}, {0x8000000000000001uLL, 0x0000000000000010uLL, 0x0800000000000000uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF5uLL}, {0x8000000000000001uLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E133DuLL}, {0x8000000000000001uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000003uLL}, {0x8000000000000001uLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000004uLL}, {0x8000000000000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000003uLL}, {0x8000000000000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000080000001uLL}, {0x8000000000000001uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0x8000000000000001uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL}, {0x8000000000000001uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000007uLL}, {0x8000000000000001uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x0000000000000081uLL}, {0x8000000000000001uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C15uLL}, {0x8000000000000001uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E27DuLL}, {0x8000000000000001uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555556uLL}, {0x8000000000000001uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000080000001uLL}, {0x8000000000000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C0000001uLL}, {0x8000000000000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000080000001uLL}, {0x8000000000000001uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x0000000040000001uLL}, {0x8000000000000001uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000002uLL}, {0x8000000000000001uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000003uLL}, {0x8000000000000001uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000004uLL}, {0x8000000000000001uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x0000000000000021uLL}, {0x8000000000000001uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FDFuLL}, {0x8000000000000001uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07785uLL}, {0x8000000000000001uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333334uLL}, {0x8000000000000001uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000080000001uLL}, {0x8000000000000001uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFFuLL}, {0x8000000000000001uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555555uLL}, {0x8000000000000001uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAABuLL}, {0x8000000000000001uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000200000001uLL}, {0x8000000000000001uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555557uLL}, {0x8000000000000001uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAADuLL}, {0x8000000000000001uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000003uLL}, {0x8000000000000001uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000255555571uLL}, {0x8000000000000001uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFD9uLL}, {0x8000000000000001uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B045uLL}, {0x8000000000000001uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924925uLL}, {0x8000000000000001uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000200000001uLL}, {0x8000000000000001uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x0000000060000001uLL}, {0x8000000000000001uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x0000000040000001uLL}, {0x8000000000000001uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x0000000020000001uLL}, {0x8000000000000001uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF8000002uLL}, {0x8000000000000001uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000003uLL}, {0x8000000000000001uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000004uLL}, {0x8000000000000001uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F80000011uLL}, {0x8000000000000001uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C7uLL}, {0x8000000000000001uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BC1uLL}, {0x8000000000000001uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F07DuLL}, {0x8000000000000001uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000200000001uLL}, {0x8000000000000001uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969696uLL}, {0x8000000000000001uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F0FuLL}, {0x8000000000000001uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878788uLL}, {0x8000000000000001uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6600000001uLL}, {0x8000000000000001uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFF0uLL}, {0x8000000000000001uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFDFuLL}, {0x8000000000000001uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFCEuLL}, {0x8000000000000001uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEF1uLL}, {0x8000000000000001uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B67uLL}, {0x8000000000000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70ADuLL}, {0x8000000000000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D80000012uLL}, {0x8000000000000001uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D80000001uLL}, {0x8000000000000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000034uLL}, {0x8000000000000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000023uLL}, {0x8000000000000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5500000012uLL}, {0x8000000000000001uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC00000001uLL}, {0x8000000000000001uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFF0uLL}, {0x8000000000000001uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFDFuLL}, {0x8000000000000001uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFCEuLL}, {0x8000000000000001uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEF1uLL}, {0x8000000000000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B67uLL}, {0x8000000000000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70ADuLL}, {0x8000000000000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A380000012uLL}, {0x8000000000000001uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A380000001uLL}, {0x8000000000000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000034uLL}, {0x8000000000000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000023uLL}, {0x8000000000000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B00000012uLL}, {0x8000000000000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x8000000000000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x8000000000000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x8000000000000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x8000000000000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF1uLL}, {0x8000000000000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB07uLL}, {0x8000000000000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EDuLL}, {0x8000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x8000000000000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x8000000000000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x8000000000000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x8000000000000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x8000000000000001uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x8000000000000001uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000001uLL}, {0x8000000000000002uLL, 0x0000000000000001uLL, 0x8000000000000002uLL, 0x0000000000000000uLL}, {0x8000000000000002uLL, 0x0000000000000002uLL, 0x4000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000002uLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAABuLL, 0x0000000000000001uLL}, {0x8000000000000002uLL, 0x0000000000000010uLL, 0x0800000000000000uLL, 0x0000000000000002uLL}, {0x8000000000000002uLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF6uLL}, {0x8000000000000002uLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E133EuLL}, {0x8000000000000002uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000004uLL}, {0x8000000000000002uLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0x8000000000000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000005uLL}, {0x8000000000000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000004uLL}, {0x8000000000000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000080000002uLL}, {0x8000000000000002uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000000000002uLL}, {0x8000000000000002uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000003uLL}, {0x8000000000000002uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL}, {0x8000000000000002uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000008uLL}, {0x8000000000000002uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x0000000000000082uLL}, {0x8000000000000002uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C16uLL}, {0x8000000000000002uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E27EuLL}, {0x8000000000000002uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555557uLL}, {0x8000000000000002uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000080000002uLL}, {0x8000000000000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C0000002uLL}, {0x8000000000000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000080000002uLL}, {0x8000000000000002uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x0000000040000002uLL}, {0x8000000000000002uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x0000000000000002uLL}, {0x8000000000000002uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000003uLL}, {0x8000000000000002uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000004uLL}, {0x8000000000000002uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000005uLL}, {0x8000000000000002uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x0000000000000022uLL}, {0x8000000000000002uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FE0uLL}, {0x8000000000000002uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07786uLL}, {0x8000000000000002uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333335uLL}, {0x8000000000000002uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000080000002uLL}, {0x8000000000000002uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x0000000280000000uLL}, {0x8000000000000002uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555556uLL}, {0x8000000000000002uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAACuLL}, {0x8000000000000002uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000200000002uLL}, {0x8000000000000002uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555558uLL}, {0x8000000000000002uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAAEuLL}, {0x8000000000000002uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000004uLL}, {0x8000000000000002uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000255555572uLL}, {0x8000000000000002uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFDAuLL}, {0x8000000000000002uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B046uLL}, {0x8000000000000002uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924926uLL}, {0x8000000000000002uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000200000002uLL}, {0x8000000000000002uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x0000000060000002uLL}, {0x8000000000000002uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x0000000040000002uLL}, {0x8000000000000002uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x0000000020000002uLL}, {0x8000000000000002uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x0000000000000002uLL}, {0x8000000000000002uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF8000003uLL}, {0x8000000000000002uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000004uLL}, {0x8000000000000002uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000005uLL}, {0x8000000000000002uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F80000012uLL}, {0x8000000000000002uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C8uLL}, {0x8000000000000002uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BC2uLL}, {0x8000000000000002uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F07EuLL}, {0x8000000000000002uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000200000002uLL}, {0x8000000000000002uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969697uLL}, {0x8000000000000002uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F10uLL}, {0x8000000000000002uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878789uLL}, {0x8000000000000002uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6600000002uLL}, {0x8000000000000002uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFF1uLL}, {0x8000000000000002uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFE0uLL}, {0x8000000000000002uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFCFuLL}, {0x8000000000000002uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEF2uLL}, {0x8000000000000002uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B68uLL}, {0x8000000000000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70AEuLL}, {0x8000000000000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D80000013uLL}, {0x8000000000000002uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D80000002uLL}, {0x8000000000000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000035uLL}, {0x8000000000000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000024uLL}, {0x8000000000000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5500000013uLL}, {0x8000000000000002uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC00000002uLL}, {0x8000000000000002uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFF1uLL}, {0x8000000000000002uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFE0uLL}, {0x8000000000000002uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFCFuLL}, {0x8000000000000002uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEF2uLL}, {0x8000000000000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B68uLL}, {0x8000000000000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70AEuLL}, {0x8000000000000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A380000013uLL}, {0x8000000000000002uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A380000002uLL}, {0x8000000000000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000035uLL}, {0x8000000000000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000024uLL}, {0x8000000000000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B00000013uLL}, {0x8000000000000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x8000000000000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x8000000000000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x8000000000000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x8000000000000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF2uLL}, {0x8000000000000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB08uLL}, {0x8000000000000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EEuLL}, {0x8000000000000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x8000000000000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x8000000000000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x8000000000000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x8000000000000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x8000000000000002uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x8000000000000002uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x8000000000000002uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000002uLL, 0x8000000000000003uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000002uLL}, {0x8000000000000003uLL, 0x0000000000000001uLL, 0x8000000000000003uLL, 0x0000000000000000uLL}, {0x8000000000000003uLL, 0x0000000000000002uLL, 0x4000000000000001uLL, 0x0000000000000001uLL}, {0x8000000000000003uLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAABuLL, 0x0000000000000002uLL}, {0x8000000000000003uLL, 0x0000000000000010uLL, 0x0800000000000000uLL, 0x0000000000000003uLL}, {0x8000000000000003uLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7AF7uLL}, {0x8000000000000003uLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E133FuLL}, {0x8000000000000003uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000005uLL}, {0x8000000000000003uLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0x8000000000000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000006uLL}, {0x8000000000000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000005uLL}, {0x8000000000000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000080000003uLL}, {0x8000000000000003uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000000000003uLL}, {0x8000000000000003uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000004uLL}, {0x8000000000000003uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000005uLL}, {0x8000000000000003uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000009uLL}, {0x8000000000000003uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x0000000000000083uLL}, {0x8000000000000003uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C17uLL}, {0x8000000000000003uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E27FuLL}, {0x8000000000000003uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555558uLL}, {0x8000000000000003uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000080000003uLL}, {0x8000000000000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C0000003uLL}, {0x8000000000000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000080000003uLL}, {0x8000000000000003uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x0000000040000003uLL}, {0x8000000000000003uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x0000000000000003uLL}, {0x8000000000000003uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000004uLL}, {0x8000000000000003uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000005uLL}, {0x8000000000000003uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000006uLL}, {0x8000000000000003uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x0000000000000023uLL}, {0x8000000000000003uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FE1uLL}, {0x8000000000000003uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07787uLL}, {0x8000000000000003uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333336uLL}, {0x8000000000000003uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000080000003uLL}, {0x8000000000000003uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x0000000280000001uLL}, {0x8000000000000003uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555557uLL}, {0x8000000000000003uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAADuLL}, {0x8000000000000003uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000200000003uLL}, {0x8000000000000003uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555559uLL}, {0x8000000000000003uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAAAFuLL}, {0x8000000000000003uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000005uLL}, {0x8000000000000003uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000255555573uLL}, {0x8000000000000003uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFDBuLL}, {0x8000000000000003uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B047uLL}, {0x8000000000000003uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924927uLL}, {0x8000000000000003uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000200000003uLL}, {0x8000000000000003uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x0000000060000003uLL}, {0x8000000000000003uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x0000000040000003uLL}, {0x8000000000000003uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x0000000020000003uLL}, {0x8000000000000003uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x0000000000000003uLL}, {0x8000000000000003uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF8000004uLL}, {0x8000000000000003uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000005uLL}, {0x8000000000000003uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000006uLL}, {0x8000000000000003uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F80000013uLL}, {0x8000000000000003uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212C9uLL}, {0x8000000000000003uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BC3uLL}, {0x8000000000000003uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F07FuLL}, {0x8000000000000003uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000200000003uLL}, {0x8000000000000003uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000916969698uLL}, {0x8000000000000003uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F11uLL}, {0x8000000000000003uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x000000090787878AuLL}, {0x8000000000000003uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6600000003uLL}, {0x8000000000000003uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFF2uLL}, {0x8000000000000003uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFE1uLL}, {0x8000000000000003uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFD0uLL}, {0x8000000000000003uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFEF3uLL}, {0x8000000000000003uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B69uLL}, {0x8000000000000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70AFuLL}, {0x8000000000000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D80000014uLL}, {0x8000000000000003uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D80000003uLL}, {0x8000000000000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000036uLL}, {0x8000000000000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000025uLL}, {0x8000000000000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5500000014uLL}, {0x8000000000000003uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC00000003uLL}, {0x8000000000000003uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFF2uLL}, {0x8000000000000003uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFE1uLL}, {0x8000000000000003uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFD0uLL}, {0x8000000000000003uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFEF3uLL}, {0x8000000000000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B69uLL}, {0x8000000000000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70AFuLL}, {0x8000000000000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A380000014uLL}, {0x8000000000000003uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A380000003uLL}, {0x8000000000000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000036uLL}, {0x8000000000000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000025uLL}, {0x8000000000000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B00000014uLL}, {0x8000000000000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0x8000000000000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x8000000000000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x8000000000000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x8000000000000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF3uLL}, {0x8000000000000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB09uLL}, {0x8000000000000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EFuLL}, {0x8000000000000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000004uLL}, {0x8000000000000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x8000000000000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000006uLL}, {0x8000000000000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0x8000000000000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0x8000000000000003uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0x8000000000000003uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x8000000000000003uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x8000000000000003uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000003uLL, 0x8000000000000010uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000003uLL}, {0x8000000000000010uLL, 0x0000000000000001uLL, 0x8000000000000010uLL, 0x0000000000000000uLL}, {0x8000000000000010uLL, 0x0000000000000002uLL, 0x4000000000000008uLL, 0x0000000000000000uLL}, {0x8000000000000010uLL, 0x0000000000000003uLL, 0x2AAAAAAAAAAAAAB0uLL, 0x0000000000000000uLL}, {0x8000000000000010uLL, 0x0000000000000010uLL, 0x0800000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000010uLL, 0x00000000078644FAuLL, 0x0000001102D8BD7EuLL, 0x00000000040D7B04uLL}, {0x8000000000000010uLL, 0x000000000747AE14uLL, 0x00000011951952BDuLL, 0x00000000065E134CuLL}, {0x8000000000000010uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x0000000000000012uLL}, {0x8000000000000010uLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0x8000000000000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x0000000080000013uLL}, {0x8000000000000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000000000012uLL}, {0x8000000000000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000080000010uLL}, {0x8000000000000010uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000000000010uLL}, {0x8000000000000010uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000011uLL}, {0x8000000000000010uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000012uLL}, {0x8000000000000010uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000016uLL}, {0x8000000000000010uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x0000000000000090uLL}, {0x8000000000000010uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000004DBE4C24uLL}, {0x8000000000000010uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000001D19E28CuLL}, {0x8000000000000010uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555565uLL}, {0x8000000000000010uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000080000010uLL}, {0x8000000000000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C0000010uLL}, {0x8000000000000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000080000010uLL}, {0x8000000000000010uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x0000000040000010uLL}, {0x8000000000000010uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x0000000000000010uLL}, {0x8000000000000010uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000011uLL}, {0x8000000000000010uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000180000012uLL}, {0x8000000000000010uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x0000000140000013uLL}, {0x8000000000000010uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x0000000000000030uLL}, {0x8000000000000010uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000021843FEEuLL}, {0x8000000000000010uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000132B07794uLL}, {0x8000000000000010uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000B3333343uLL}, {0x8000000000000010uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000080000010uLL}, {0x8000000000000010uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000028000000EuLL}, {0x8000000000000010uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x0000000255555564uLL}, {0x8000000000000010uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAABAuLL}, {0x8000000000000010uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000200000010uLL}, {0x8000000000000010uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001D5555566uLL}, {0x8000000000000010uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001AAAAAABCuLL}, {0x8000000000000010uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000180000012uLL}, {0x8000000000000010uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x0000000255555580uLL}, {0x8000000000000010uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000009C0FEFE8uLL}, {0x8000000000000010uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010620B054uLL}, {0x8000000000000010uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000224924934uLL}, {0x8000000000000010uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000200000010uLL}, {0x8000000000000010uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x0000000060000010uLL}, {0x8000000000000010uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x0000000040000010uLL}, {0x8000000000000010uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x0000000020000010uLL}, {0x8000000000000010uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x0000000000000010uLL}, {0x8000000000000010uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FF8000011uLL}, {0x8000000000000010uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF0000012uLL}, {0x8000000000000010uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FE8000013uLL}, {0x8000000000000010uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F80000020uLL}, {0x8000000000000010uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A03C212D6uLL}, {0x8000000000000010uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000323D54BD0uLL}, {0x8000000000000010uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000207C1F08CuLL}, {0x8000000000000010uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000200000010uLL}, {0x8000000000000010uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x00000009169696A5uLL}, {0x8000000000000010uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000090F0F0F1EuLL}, {0x8000000000000010uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000907878797uLL}, {0x8000000000000010uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6600000010uLL}, {0x8000000000000010uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFFFuLL}, {0x8000000000000010uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFEEuLL}, {0x8000000000000010uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B65FFFFFFDDuLL}, {0x8000000000000010uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B65FFFFFF00uLL}, {0x8000000000000010uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6580156B76uLL}, {0x8000000000000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B65843D70BCuLL}, {0x8000000000000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D80000021uLL}, {0x8000000000000010uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D80000010uLL}, {0x8000000000000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5500000043uLL}, {0x8000000000000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5500000032uLL}, {0x8000000000000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5500000021uLL}, {0x8000000000000010uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC00000010uLL}, {0x8000000000000010uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFFFuLL}, {0x8000000000000010uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFEEuLL}, {0x8000000000000010uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFFDDuLL}, {0x8000000000000010uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ABFFFFFF00uLL}, {0x8000000000000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB80156B76uLL}, {0x8000000000000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB843D70BCuLL}, {0x8000000000000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A380000021uLL}, {0x8000000000000010uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A380000010uLL}, {0x8000000000000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B00000043uLL}, {0x8000000000000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B00000032uLL}, {0x8000000000000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B00000021uLL}, {0x8000000000000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000100000010uLL}, {0x8000000000000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000010000000FuLL}, {0x8000000000000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000010000000EuLL}, {0x8000000000000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000010000000DuLL}, {0x8000000000000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x8000000000000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB16uLL}, {0x8000000000000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851FCuLL}, {0x8000000000000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000011uLL}, {0x8000000000000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000080000010uLL}, {0x8000000000000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000013uLL}, {0x8000000000000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000012uLL}, {0x8000000000000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000011uLL}, {0x8000000000000010uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0x8000000000000010uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0x8000000000000010uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0x8000000000000010uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0x8000000000000010uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x8000000000000010uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x8000000000000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000000000010uLL}, {0x80000000078644FAuLL, 0x0000000000000001uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL}, {0x80000000078644FAuLL, 0x0000000000000002uLL, 0x4000000003C3227DuLL, 0x0000000000000000uLL}, {0x80000000078644FAuLL, 0x0000000000000003uLL, 0x2AAAAAAAAD2CC1A8uLL, 0x0000000000000002uLL}, {0x80000000078644FAuLL, 0x0000000000000010uLL, 0x080000000078644FuLL, 0x000000000000000AuLL}, {0x80000000078644FAuLL, 0x00000000078644FAuLL, 0x0000001102D8BD7FuLL, 0x00000000040D7AF4uLL}, {0x80000000078644FAuLL, 0x000000000747AE14uLL, 0x00000011951952BEuLL, 0x00000000069CAA22uLL}, {0x80000000078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x00000000078644FCuLL}, {0x80000000078644FAuLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x00000000078644FAuLL}, {0x80000000078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x00000000878644FDuLL}, {0x80000000078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x00000000078644FCuLL}, {0x80000000078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x00000000878644FAuLL}, {0x80000000078644FAuLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x00000000078644FAuLL}, {0x80000000078644FAuLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x00000000878644FBuLL}, {0x80000000078644FAuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x00000000078644FCuLL}, {0x80000000078644FAuLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x0000000087864500uLL}, {0x80000000078644FAuLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x000000000786457AuLL}, {0x80000000078644FAuLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000005544910EuLL}, {0x80000000078644FAuLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x0000000024A02776uLL}, {0x80000000078644FAuLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000DCDB9A4FuLL}, {0x80000000078644FAuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x00000000878644FAuLL}, {0x80000000078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C78644FAuLL}, {0x80000000078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x00000000878644FAuLL}, {0x80000000078644FAuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x00000000478644FAuLL}, {0x80000000078644FAuLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x00000000078644FAuLL}, {0x80000000078644FAuLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C78644FBuLL}, {0x80000000078644FAuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x00000001878644FCuLL}, {0x80000000078644FAuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x00000001478644FDuLL}, {0x80000000078644FAuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000000786451AuLL}, {0x80000000078644FAuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x00000000290A84D8uLL}, {0x80000000078644FAuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x000000013A36BC7EuLL}, {0x80000000078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000BAB9782DuLL}, {0x80000000078644FAuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x00000000878644FAuLL}, {0x80000000078644FAuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x00000002878644F8uLL}, {0x80000000078644FAuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x000000025CDB9A4EuLL}, {0x80000000078644FAuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x000000023230EFA4uLL}, {0x80000000078644FAuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000002078644FAuLL}, {0x80000000078644FAuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001DCDB9A50uLL}, {0x80000000078644FAuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001B230EFA6uLL}, {0x80000000078644FAuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x00000001878644FCuLL}, {0x80000000078644FAuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000025CDB9A6AuLL}, {0x80000000078644FAuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x00000000A39634D2uLL}, {0x80000000078644FAuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010DA6F53EuLL}, {0x80000000078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x000000022C188E1EuLL}, {0x80000000078644FAuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000002078644FAuLL}, {0x80000000078644FAuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x00000000678644FAuLL}, {0x80000000078644FAuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x00000000478644FAuLL}, {0x80000000078644FAuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x00000000278644FAuLL}, {0x80000000078644FAuLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x00000000078644FAuLL}, {0x80000000078644FAuLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FFF8644FBuLL}, {0x80000000078644FAuLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF78644FCuLL}, {0x80000000078644FAuLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FEF8644FDuLL}, {0x80000000078644FAuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F8786450AuLL}, {0x80000000078644FAuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A0B4857C0uLL}, {0x80000000078644FAuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x000000032B5B90BAuLL}, {0x80000000078644FAuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x000000020F483576uLL}, {0x80000000078644FAuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000002078644FAuLL}, {0x80000000078644FAuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x000000091E1CDB8FuLL}, {0x80000000078644FAuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x0000000916955408uLL}, {0x80000000078644FAuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x000000090F0DCC81uLL}, {0x80000000078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B66078644FAuLL}, {0x80000000078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B66078644E9uLL}, {0x80000000078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B66078644D8uLL}, {0x80000000078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B66078644C7uLL}, {0x80000000078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B66078643EAuLL}, {0x80000000078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B65879BB060uLL}, {0x80000000078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B658BC3B5A6uLL}, {0x80000000078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D8786450BuLL}, {0x80000000078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D878644FAuLL}, {0x80000000078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B550786452DuLL}, {0x80000000078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B550786451CuLL}, {0x80000000078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B550786450BuLL}, {0x80000000078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC078644FAuLL}, {0x80000000078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AC078644E9uLL}, {0x80000000078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AC078644D8uLL}, {0x80000000078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AC078644C7uLL}, {0x80000000078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AC078643EAuLL}, {0x80000000078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB879BB060uLL}, {0x80000000078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB8BC3B5A6uLL}, {0x80000000078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A38786450BuLL}, {0x80000000078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A3878644FAuLL}, {0x80000000078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B0786452DuLL}, {0x80000000078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B0786451CuLL}, {0x80000000078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B0786450BuLL}, {0x80000000078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000001078644FAuLL}, {0x80000000078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000001078644F9uLL}, {0x80000000078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000001078644F8uLL}, {0x80000000078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000001078644F7uLL}, {0x80000000078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000001078644EAuLL}, {0x80000000078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x80000000078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000001003E96E6uLL}, {0x80000000078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x00000000878644FBuLL}, {0x80000000078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x00000000878644FAuLL}, {0x80000000078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000078644FDuLL}, {0x80000000078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000078644FCuLL}, {0x80000000078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000078644FBuLL}, {0x80000000078644FAuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0x80000000078644FAuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0x80000000078644FAuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0x80000000078644FAuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0x80000000078644FAuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0x80000000078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x80000000078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0x80000000078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x80000000078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000078644FAuLL}, {0x800000000747AE14uLL, 0x0000000000000001uLL, 0x800000000747AE14uLL, 0x0000000000000000uLL}, {0x800000000747AE14uLL, 0x0000000000000002uLL, 0x4000000003A3D70AuLL, 0x0000000000000000uLL}, {0x800000000747AE14uLL, 0x0000000000000003uLL, 0x2AAAAAAAAD17E4B1uLL, 0x0000000000000001uLL}, {0x800000000747AE14uLL, 0x0000000000000010uLL, 0x0800000000747AE1uLL, 0x0000000000000004uLL}, {0x800000000747AE14uLL, 0x00000000078644FAuLL, 0x0000001102D8BD7FuLL, 0x0000000003CEE40EuLL}, {0x800000000747AE14uLL, 0x000000000747AE14uLL, 0x00000011951952BEuLL, 0x00000000065E133CuLL}, {0x800000000747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL, 0x000000000747AE16uLL}, {0x800000000747AE14uLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x000000000747AE14uLL}, {0x800000000747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000001uLL, 0x000000008747AE17uLL}, {0x800000000747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x000000000747AE16uLL}, {0x800000000747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000008747AE14uLL}, {0x800000000747AE14uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x000000000747AE14uLL}, {0x800000000747AE14uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x000000008747AE15uLL}, {0x800000000747AE14uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x000000000747AE16uLL}, {0x800000000747AE14uLL, 0x0000000100000003uLL, 0x000000007FFFFFFEuLL, 0x000000008747AE1AuLL}, {0x800000000747AE14uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x000000000747AE94uLL}, {0x800000000747AE14uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x000000005505FA28uLL}, {0x800000000747AE14uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x0000000024619090uLL}, {0x800000000747AE14uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x00000000DC9D0369uLL}, {0x800000000747AE14uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000008747AE14uLL}, {0x800000000747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000C747AE14uLL}, {0x800000000747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000008747AE14uLL}, {0x800000000747AE14uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000004747AE14uLL}, {0x800000000747AE14uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x000000000747AE14uLL}, {0x800000000747AE14uLL, 0x0000000200000001uLL, 0x000000003FFFFFFFuLL, 0x00000001C747AE15uLL}, {0x800000000747AE14uLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x000000018747AE16uLL}, {0x800000000747AE14uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x000000014747AE17uLL}, {0x800000000747AE14uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000000747AE34uLL}, {0x800000000747AE14uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000028CBEDF2uLL}, {0x800000000747AE14uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x0000000139F82598uLL}, {0x800000000747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000000BA7AE147uLL}, {0x800000000747AE14uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000008747AE14uLL}, {0x800000000747AE14uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAAAuLL, 0x000000028747AE12uLL}, {0x800000000747AE14uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x000000025C9D0368uLL}, {0x800000000747AE14uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x0000000231F258BEuLL}, {0x800000000747AE14uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x000000020747AE14uLL}, {0x800000000747AE14uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000001DC9D036AuLL}, {0x800000000747AE14uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000001B1F258C0uLL}, {0x800000000747AE14uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x000000018747AE16uLL}, {0x800000000747AE14uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x000000025C9D0384uLL}, {0x800000000747AE14uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x00000000A3579DECuLL}, {0x800000000747AE14uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000010D685E58uLL}, {0x800000000747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x000000022BD9F738uLL}, {0x800000000747AE14uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x000000020747AE14uLL}, {0x800000000747AE14uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000006747AE14uLL}, {0x800000000747AE14uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000004747AE14uLL}, {0x800000000747AE14uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000002747AE14uLL}, {0x800000000747AE14uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x000000000747AE14uLL}, {0x800000000747AE14uLL, 0x0000001000000001uLL, 0x0000000007FFFFFFuLL, 0x0000000FFF47AE15uLL}, {0x800000000747AE14uLL, 0x0000001000000002uLL, 0x0000000007FFFFFFuLL, 0x0000000FF747AE16uLL}, {0x800000000747AE14uLL, 0x0000001000000003uLL, 0x0000000007FFFFFFuLL, 0x0000000FEF47AE17uLL}, {0x800000000747AE14uLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x0000000F8747AE24uLL}, {0x800000000747AE14uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A0B09C0DAuLL}, {0x800000000747AE14uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x000000032B1CF9D4uLL}, {0x800000000747AE14uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x000000020F099E90uLL}, {0x800000000747AE14uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x000000020747AE14uLL}, {0x800000000747AE14uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x000000091DDE44A9uLL}, {0x800000000747AE14uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000091656BD22uLL}, {0x800000000747AE14uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x000000090ECF359BuLL}, {0x800000000747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B660747AE14uLL}, {0x800000000747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B660747AE03uLL}, {0x800000000747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B660747ADF2uLL}, {0x800000000747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B660747ADE1uLL}, {0x800000000747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B660747AD04uLL}, {0x800000000747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B65875D197AuLL}, {0x800000000747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B658B851EC0uLL}, {0x800000000747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5D8747AE25uLL}, {0x800000000747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5D8747AE14uLL}, {0x800000000747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B550747AE47uLL}, {0x800000000747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B550747AE36uLL}, {0x800000000747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B550747AE25uLL}, {0x800000000747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC0747AE14uLL}, {0x800000000747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AC0747AE03uLL}, {0x800000000747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AC0747ADF2uLL}, {0x800000000747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AC0747ADE1uLL}, {0x800000000747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AC0747AD04uLL}, {0x800000000747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AB875D197AuLL}, {0x800000000747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AB8B851EC0uLL}, {0x800000000747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A38747AE25uLL}, {0x800000000747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A38747AE14uLL}, {0x800000000747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B0747AE47uLL}, {0x800000000747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B0747AE36uLL}, {0x800000000747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B0747AE25uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x000000010747AE14uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000010747AE13uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000010747AE12uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000010747AE11uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000010747AE04uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000FFC1691AuLL}, {0x800000000747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000008747AE15uLL}, {0x800000000747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000008747AE14uLL}, {0x800000000747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x000000000747AE17uLL}, {0x800000000747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x000000000747AE16uLL}, {0x800000000747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x000000000747AE15uLL}, {0x800000000747AE14uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0x800000000747AE14uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0x800000000747AE14uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0x800000000747AE14uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0x800000000747AE14uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0x800000000747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x800000000747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000000747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x800000000747AE14uLL}, {0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x800000007FFFFFFFuLL, 0x0000000000000002uLL, 0x400000003FFFFFFFuLL, 0x0000000000000001uLL}, {0x800000007FFFFFFFuLL, 0x0000000000000003uLL, 0x2AAAAAAAD5555555uLL, 0x0000000000000000uLL}, {0x800000007FFFFFFFuLL, 0x0000000000000010uLL, 0x0800000007FFFFFFuLL, 0x000000000000000FuLL}, {0x800000007FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000001102D8BD8FuLL, 0x000000000422E659uLL}, {0x800000007FFFFFFFuLL, 0x000000000747AE14uLL, 0x00000011951952CFuLL, 0x000000000353D5D3uLL}, {0x800000007FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000002uLL}, {0x800000007FFFFFFFuLL, 0x0000000080000000uLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000002uLL, 0x0000000000000005uLL}, {0x800000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000080000001uLL}, {0x800000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000001uLL, 0x0000000000000000uLL}, {0x800000007FFFFFFFuLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL}, {0x800000007FFFFFFFuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0x800000007FFFFFFFuLL, 0x0000000100000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0x800000007FFFFFFFuLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x000000008000007FuLL}, {0x800000007FFFFFFFuLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x00000000CDBE4C13uLL}, {0x800000007FFFFFFFuLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000009D19E27BuLL}, {0x800000007FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x0000000155555554uLL}, {0x800000007FFFFFFFuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x00000000FFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x000000013FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x00000000FFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x000000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000040000000uLL, 0x000000003FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000000200000002uLL, 0x000000003FFFFFFFuLL, 0x0000000200000001uLL}, {0x800000007FFFFFFFuLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000002uLL}, {0x800000007FFFFFFFuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000008000001FuLL}, {0x800000007FFFFFFFuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x00000000A1843FDDuLL}, {0x800000007FFFFFFFuLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x00000001B2B07783uLL}, {0x800000007FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x0000000133333332uLL}, {0x800000007FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x00000000FFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAABuLL, 0x0000000000000000uLL}, {0x800000007FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x00000002D5555553uLL}, {0x800000007FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x00000002AAAAAAA9uLL}, {0x800000007FFFFFFFuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x0000000255555555uLL}, {0x800000007FFFFFFFuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAABuLL}, {0x800000007FFFFFFFuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000200000001uLL}, {0x800000007FFFFFFFuLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x00000002D555556FuLL}, {0x800000007FFFFFFFuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000011C0FEFD7uLL}, {0x800000007FFFFFFFuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000018620B043uLL}, {0x800000007FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x00000002A4924923uLL}, {0x800000007FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x000000027FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x00000000DFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x00000000BFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000009FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x000000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000001000000001uLL, 0x0000000008000000uLL, 0x0000000077FFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000001000000002uLL, 0x0000000008000000uLL, 0x000000006FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000001000000003uLL, 0x0000000008000000uLL, 0x0000000067FFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0000001000000010uLL, 0x0000000007FFFFFFuLL, 0x000000100000000FuLL}, {0x800000007FFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A83C212C5uLL}, {0x800000007FFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x00000003A3D54BBFuLL}, {0x800000007FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000287C1F07BuLL}, {0x800000007FFFFFFFuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x000000027FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000996969694uLL}, {0x800000007FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000098F0F0F0DuLL}, {0x800000007FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000987878786uLL}, {0x800000007FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B667FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B667FFFFFEEuLL}, {0x800000007FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B667FFFFFDDuLL}, {0x800000007FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B667FFFFFCCuLL}, {0x800000007FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B667FFFFEEFuLL}, {0x800000007FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6600156B65uLL}, {0x800000007FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B66043D70ABuLL}, {0x800000007FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5E00000010uLL}, {0x800000007FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5DFFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5580000032uLL}, {0x800000007FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5580000021uLL}, {0x800000007FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5580000010uLL}, {0x800000007FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFEEuLL}, {0x800000007FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFDDuLL}, {0x800000007FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFCCuLL}, {0x800000007FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFEEFuLL}, {0x800000007FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AC00156B65uLL}, {0x800000007FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AC043D70ABuLL}, {0x800000007FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A400000010uLL}, {0x800000007FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A3FFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B80000032uLL}, {0x800000007FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B80000021uLL}, {0x800000007FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B80000010uLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFCuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFEFuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB05uLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851EBuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x800000007FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x800000007FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x800000007FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x800000007FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0x800000007FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0x800000007FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0x800000007FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0x800000007FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x800000007FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x800000007FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x800000007FFFFFFFuLL}, {0x8000000080000000uLL, 0x0000000000000001uLL, 0x8000000080000000uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x0000000000000002uLL, 0x4000000040000000uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x0000000000000003uLL, 0x2AAAAAAAD5555555uLL, 0x0000000000000001uLL}, {0x8000000080000000uLL, 0x0000000000000010uLL, 0x0800000008000000uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x00000000078644FAuLL, 0x0000001102D8BD8FuLL, 0x000000000422E65AuLL}, {0x8000000080000000uLL, 0x000000000747AE14uLL, 0x00000011951952CFuLL, 0x000000000353D5D4uLL}, {0x8000000080000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000003uLL, 0x0000000000000003uLL}, {0x8000000080000000uLL, 0x0000000080000000uLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000002uLL, 0x0000000000000006uLL}, {0x8000000080000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL, 0x0000000080000002uLL}, {0x8000000080000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000001uLL, 0x0000000000000001uLL}, {0x8000000080000000uLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x0000000080000000uLL}, {0x8000000080000000uLL, 0x0000000100000001uLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0x8000000080000000uLL, 0x0000000100000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL}, {0x8000000080000000uLL, 0x0000000100000010uLL, 0x000000007FFFFFF8uLL, 0x0000000080000080uLL}, {0x8000000080000000uLL, 0x00000001078644FAuLL, 0x000000007C585DAEuLL, 0x00000000CDBE4C14uLL}, {0x8000000080000000uLL, 0x000000010747AE14uLL, 0x000000007C75ED2DuLL, 0x000000009D19E27CuLL}, {0x8000000080000000uLL, 0x000000017FFFFFFFuLL, 0x0000000055555555uLL, 0x0000000155555555uLL}, {0x8000000080000000uLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x0000000100000000uLL}, {0x8000000080000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x0000000140000000uLL}, {0x8000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000100000000uLL}, {0x8000000080000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x00000000C0000000uLL}, {0x8000000080000000uLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x0000000080000000uLL}, {0x8000000080000000uLL, 0x0000000200000001uLL, 0x0000000040000000uLL, 0x0000000040000000uLL}, {0x8000000080000000uLL, 0x0000000200000002uLL, 0x0000000040000000uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x0000000200000003uLL, 0x000000003FFFFFFFuLL, 0x00000001C0000003uLL}, {0x8000000080000000uLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x0000000080000020uLL}, {0x8000000080000000uLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x00000000A1843FDEuLL}, {0x8000000080000000uLL, 0x000000020747AE14uLL, 0x000000003F1A4E53uLL, 0x00000001B2B07784uLL}, {0x8000000080000000uLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x0000000133333333uLL}, {0x8000000080000000uLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x0000000100000000uLL}, {0x8000000080000000uLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAABuLL, 0x0000000000000001uLL}, {0x8000000080000000uLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAAAuLL, 0x00000002D5555554uLL}, {0x8000000080000000uLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAAAuLL, 0x00000002AAAAAAAAuLL}, {0x8000000080000000uLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x0000000280000000uLL}, {0x8000000080000000uLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x0000000255555556uLL}, {0x8000000080000000uLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x000000022AAAAAACuLL}, {0x8000000080000000uLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000200000002uLL}, {0x8000000080000000uLL, 0x0000000300000010uLL, 0x000000002AAAAAA9uLL, 0x00000002D5555570uLL}, {0x8000000080000000uLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000011C0FEFD8uLL}, {0x8000000080000000uLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000018620B044uLL}, {0x8000000080000000uLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x00000002A4924924uLL}, {0x8000000080000000uLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x0000000280000000uLL}, {0x8000000080000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x00000000E0000000uLL}, {0x8000000080000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x00000000C0000000uLL}, {0x8000000080000000uLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x00000000A0000000uLL}, {0x8000000080000000uLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x0000000080000000uLL}, {0x8000000080000000uLL, 0x0000001000000001uLL, 0x0000000008000000uLL, 0x0000000078000000uLL}, {0x8000000080000000uLL, 0x0000001000000002uLL, 0x0000000008000000uLL, 0x0000000070000000uLL}, {0x8000000080000000uLL, 0x0000001000000003uLL, 0x0000000008000000uLL, 0x0000000068000000uLL}, {0x8000000080000000uLL, 0x0000001000000010uLL, 0x0000000008000000uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000A83C212C6uLL}, {0x8000000080000000uLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x00000003A3D54BC0uLL}, {0x8000000080000000uLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000287C1F07CuLL}, {0x8000000080000000uLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x0000000280000000uLL}, {0x8000000080000000uLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000996969695uLL}, {0x8000000080000000uLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x000000098F0F0F0EuLL}, {0x8000000080000000uLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000987878787uLL}, {0x8000000080000000uLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B6680000000uLL}, {0x8000000080000000uLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B667FFFFFEFuLL}, {0x8000000080000000uLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B667FFFFFDEuLL}, {0x8000000080000000uLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B667FFFFFCDuLL}, {0x8000000080000000uLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B667FFFFEF0uLL}, {0x8000000080000000uLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6600156B66uLL}, {0x8000000080000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B66043D70ACuLL}, {0x8000000080000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5E00000011uLL}, {0x8000000080000000uLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5E00000000uLL}, {0x8000000080000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5580000033uLL}, {0x8000000080000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5580000022uLL}, {0x8000000080000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5580000011uLL}, {0x8000000080000000uLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70AC80000000uLL}, {0x8000000080000000uLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFEFuLL}, {0x8000000080000000uLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFDEuLL}, {0x8000000080000000uLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFFCDuLL}, {0x8000000080000000uLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70AC7FFFFEF0uLL}, {0x8000000080000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AC00156B66uLL}, {0x8000000080000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AC043D70ACuLL}, {0x8000000080000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A400000011uLL}, {0x8000000080000000uLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A400000000uLL}, {0x8000000080000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709B80000033uLL}, {0x8000000080000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709B80000022uLL}, {0x8000000080000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709B80000011uLL}, {0x8000000080000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0x8000000080000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x8000000080000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x8000000080000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x8000000080000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFF0uLL}, {0x8000000080000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB06uLL}, {0x8000000080000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851ECuLL}, {0x8000000080000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x8000000080000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x8000000080000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0x8000000080000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0x8000000080000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0x8000000080000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x8000000080000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x8000000080000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x8000000080000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x8000000080000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0x8000000080000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0x8000000080000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0x8000000080000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x8000000080000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x8000000080000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x8000000080000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x8000000080000000uLL}, {0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFDuLL, 0x0000000000000002uLL, 0x400000007FFFFFFEuLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFDuLL, 0x0000000000000003uLL, 0x2AAAAAAAFFFFFFFFuLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFDuLL, 0x0000000000000010uLL, 0x080000000FFFFFFFuLL, 0x000000000000000DuLL}, {0x80000000FFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000001102D8BDA0uLL, 0x00000000043851BDuLL}, {0x80000000FFFFFFFDuLL, 0x000000000747AE14uLL, 0x00000011951952E1uLL, 0x0000000000499869uLL}, {0x80000000FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000100000004uLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000100000001uLL, 0x000000007FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000002uLL, 0x0000000080000003uLL}, {0x80000000FFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000002uLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000001uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000080000000uLL, 0x000000007FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFDuLL, 0x0000000100000003uLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0x80000000FFFFFFFDuLL, 0x0000000100000010uLL, 0x000000007FFFFFF9uLL, 0x000000000000006DuLL}, {0x80000000FFFFFFFDuLL, 0x00000001078644FAuLL, 0x000000007C585DAFuLL, 0x0000000046380717uLL}, {0x80000000FFFFFFFDuLL, 0x000000010747AE14uLL, 0x000000007C75ED2EuLL, 0x0000000015D23465uLL}, {0x80000000FFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x0000000055555556uLL, 0x0000000055555553uLL}, {0x80000000FFFFFFFDuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000017FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000001BFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000017FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000013FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x00000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000200000001uLL, 0x0000000040000000uLL, 0x00000000BFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000200000002uLL, 0x0000000040000000uLL, 0x000000007FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000200000003uLL, 0x0000000040000000uLL, 0x000000003FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000010000001DuLL}, {0x80000000FFFFFFFDuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000121843FDBuLL}, {0x80000000FFFFFFFDuLL, 0x000000020747AE14uLL, 0x000000003F1A4E54uLL, 0x000000002B68C96DuLL}, {0x80000000FFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000001B3333330uLL}, {0x80000000FFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000017FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAABuLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAABuLL, 0x0000000055555553uLL}, {0x80000000FFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAABuLL, 0x000000002AAAAAA8uLL}, {0x80000000FFFFFFFDuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000002FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000002D5555553uLL}, {0x80000000FFFFFFFDuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000002AAAAAAA9uLL}, {0x80000000FFFFFFFDuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x000000027FFFFFFFuLL}, {0x80000000FFFFFFFDuLL, 0x0000000300000010uLL, 0x000000002AAAAAAAuLL, 0x000000005555555DuLL}, {0x80000000FFFFFFFDuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000019C0FEFD5uLL}, {0x80000000FFFFFFFDuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000020620B041uLL}, {0x80000000FFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000324924921uLL}, {0x80000000FFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000002FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000015FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000013FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000011FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x00000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000001000000001uLL, 0x0000000008000000uLL, 0x00000000F7FFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000001000000002uLL, 0x0000000008000000uLL, 0x00000000EFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000001000000003uLL, 0x0000000008000000uLL, 0x00000000E7FFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0000001000000010uLL, 0x0000000008000000uLL, 0x000000007FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000B03C212C3uLL}, {0x80000000FFFFFFFDuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000423D54BBDuLL}, {0x80000000FFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000307C1F079uLL}, {0x80000000FFFFFFFDuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000002FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000A16969692uLL}, {0x80000000FFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x0000000A0F0F0F0BuLL}, {0x80000000FFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000A07878784uLL}, {0x80000000FFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFECuLL}, {0x80000000FFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFDBuLL}, {0x80000000FFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFCAuLL}, {0x80000000FFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B66FFFFFEEDuLL}, {0x80000000FFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6680156B63uLL}, {0x80000000FFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B66843D70A9uLL}, {0x80000000FFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5E8000000EuLL}, {0x80000000FFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5E7FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5600000030uLL}, {0x80000000FFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B560000001FuLL}, {0x80000000FFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B560000000EuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFECuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFDBuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFCAuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFEEDuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AC80156B63uLL}, {0x80000000FFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AC843D70A9uLL}, {0x80000000FFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A48000000EuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A47FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709C00000030uLL}, {0x80000000FFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709C0000001FuLL}, {0x80000000FFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709C0000000EuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFAuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEDuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB03uLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851E9uLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x80000000FFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x80000000FFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x80000000FFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0x80000000FFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0x80000000FFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0x80000000FFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0x80000000FFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFDuLL}, {0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFEuLL, 0x0000000000000002uLL, 0x400000007FFFFFFFuLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFEuLL, 0x0000000000000003uLL, 0x2AAAAAAAFFFFFFFFuLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFEuLL, 0x0000000000000010uLL, 0x080000000FFFFFFFuLL, 0x000000000000000EuLL}, {0x80000000FFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000001102D8BDA0uLL, 0x00000000043851BEuLL}, {0x80000000FFFFFFFEuLL, 0x000000000747AE14uLL, 0x00000011951952E1uLL, 0x000000000049986AuLL}, {0x80000000FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000100000004uLL, 0x0000000000000002uLL}, {0x80000000FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000100000001uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000002uLL, 0x0000000080000004uLL}, {0x80000000FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000002uLL, 0x0000000000000002uLL}, {0x80000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000001uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000080000000uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL}, {0x80000000FFFFFFFEuLL, 0x0000000100000003uLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0x80000000FFFFFFFEuLL, 0x0000000100000010uLL, 0x000000007FFFFFF9uLL, 0x000000000000006EuLL}, {0x80000000FFFFFFFEuLL, 0x00000001078644FAuLL, 0x000000007C585DAFuLL, 0x0000000046380718uLL}, {0x80000000FFFFFFFEuLL, 0x000000010747AE14uLL, 0x000000007C75ED2EuLL, 0x0000000015D23466uLL}, {0x80000000FFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x0000000055555556uLL, 0x0000000055555554uLL}, {0x80000000FFFFFFFEuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000017FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000001BFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000017FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000013FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x00000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000200000001uLL, 0x0000000040000000uLL, 0x00000000BFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000200000002uLL, 0x0000000040000000uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000200000003uLL, 0x0000000040000000uLL, 0x000000003FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000010000001EuLL}, {0x80000000FFFFFFFEuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000121843FDCuLL}, {0x80000000FFFFFFFEuLL, 0x000000020747AE14uLL, 0x000000003F1A4E54uLL, 0x000000002B68C96EuLL}, {0x80000000FFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000001B3333331uLL}, {0x80000000FFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000017FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAABuLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAABuLL, 0x0000000055555554uLL}, {0x80000000FFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAABuLL, 0x000000002AAAAAA9uLL}, {0x80000000FFFFFFFEuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000002FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000002D5555554uLL}, {0x80000000FFFFFFFEuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000002AAAAAAAAuLL}, {0x80000000FFFFFFFEuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000280000000uLL}, {0x80000000FFFFFFFEuLL, 0x0000000300000010uLL, 0x000000002AAAAAAAuLL, 0x000000005555555EuLL}, {0x80000000FFFFFFFEuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000019C0FEFD6uLL}, {0x80000000FFFFFFFEuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000020620B042uLL}, {0x80000000FFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000324924922uLL}, {0x80000000FFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000002FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000015FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000013FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000011FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x00000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000001000000001uLL, 0x0000000008000000uLL, 0x00000000F7FFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000001000000002uLL, 0x0000000008000000uLL, 0x00000000EFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000001000000003uLL, 0x0000000008000000uLL, 0x00000000E7FFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0000001000000010uLL, 0x0000000008000000uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000B03C212C4uLL}, {0x80000000FFFFFFFEuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000423D54BBEuLL}, {0x80000000FFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000307C1F07AuLL}, {0x80000000FFFFFFFEuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000002FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000A16969693uLL}, {0x80000000FFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x0000000A0F0F0F0CuLL}, {0x80000000FFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000A07878785uLL}, {0x80000000FFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFEDuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFDCuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFCBuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B66FFFFFEEEuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6680156B64uLL}, {0x80000000FFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B66843D70AAuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5E8000000FuLL}, {0x80000000FFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5E7FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5600000031uLL}, {0x80000000FFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5600000020uLL}, {0x80000000FFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B560000000FuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFEDuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFDCuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFCBuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFEEEuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AC80156B64uLL}, {0x80000000FFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AC843D70AAuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A48000000FuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A47FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709C00000031uLL}, {0x80000000FFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709C00000020uLL}, {0x80000000FFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709C0000000FuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEEuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB04uLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EAuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x80000000FFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x80000000FFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x80000000FFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0x80000000FFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0x80000000FFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0x80000000FFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0x80000000FFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFEuLL}, {0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFFuLL, 0x0000000000000002uLL, 0x400000007FFFFFFFuLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFFuLL, 0x0000000000000003uLL, 0x2AAAAAAAFFFFFFFFuLL, 0x0000000000000002uLL}, {0x80000000FFFFFFFFuLL, 0x0000000000000010uLL, 0x080000000FFFFFFFuLL, 0x000000000000000FuLL}, {0x80000000FFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000001102D8BDA0uLL, 0x00000000043851BFuLL}, {0x80000000FFFFFFFFuLL, 0x000000000747AE14uLL, 0x00000011951952E1uLL, 0x000000000049986BuLL}, {0x80000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000100000004uLL, 0x0000000000000003uLL}, {0x80000000FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000100000001uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000080000002uLL, 0x0000000080000005uLL}, {0x80000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000080000002uLL, 0x0000000000000003uLL}, {0x80000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000080000001uLL, 0x0000000080000000uLL}, {0x80000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000100000002uLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL}, {0x80000000FFFFFFFFuLL, 0x0000000100000003uLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0x80000000FFFFFFFFuLL, 0x0000000100000010uLL, 0x000000007FFFFFF9uLL, 0x000000000000006FuLL}, {0x80000000FFFFFFFFuLL, 0x00000001078644FAuLL, 0x000000007C585DAFuLL, 0x0000000046380719uLL}, {0x80000000FFFFFFFFuLL, 0x000000010747AE14uLL, 0x000000007C75ED2EuLL, 0x0000000015D23467uLL}, {0x80000000FFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x0000000055555556uLL, 0x0000000055555555uLL}, {0x80000000FFFFFFFFuLL, 0x0000000180000000uLL, 0x0000000055555555uLL, 0x000000017FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000001BFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000017FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000013FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000200000000uLL, 0x0000000040000000uLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000200000001uLL, 0x0000000040000000uLL, 0x00000000BFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000200000002uLL, 0x0000000040000000uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000200000003uLL, 0x0000000040000000uLL, 0x000000003FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000200000010uLL, 0x000000003FFFFFFEuLL, 0x000000010000001FuLL}, {0x80000000FFFFFFFFuLL, 0x00000002078644FAuLL, 0x000000003F12B425uLL, 0x0000000121843FDDuLL}, {0x80000000FFFFFFFFuLL, 0x000000020747AE14uLL, 0x000000003F1A4E54uLL, 0x000000002B68C96FuLL}, {0x80000000FFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000033333333uLL, 0x00000001B3333332uLL}, {0x80000000FFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000033333333uLL, 0x000000017FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x000000002AAAAAABuLL, 0x0000000080000000uLL}, {0x80000000FFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x000000002AAAAAABuLL, 0x0000000055555555uLL}, {0x80000000FFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x000000002AAAAAABuLL, 0x000000002AAAAAAAuLL}, {0x80000000FFFFFFFFuLL, 0x0000000300000000uLL, 0x000000002AAAAAAAuLL, 0x00000002FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000000300000001uLL, 0x000000002AAAAAAAuLL, 0x00000002D5555555uLL}, {0x80000000FFFFFFFFuLL, 0x0000000300000002uLL, 0x000000002AAAAAAAuLL, 0x00000002AAAAAAABuLL}, {0x80000000FFFFFFFFuLL, 0x0000000300000003uLL, 0x000000002AAAAAAAuLL, 0x0000000280000001uLL}, {0x80000000FFFFFFFFuLL, 0x0000000300000010uLL, 0x000000002AAAAAAAuLL, 0x000000005555555FuLL}, {0x80000000FFFFFFFFuLL, 0x00000003078644FAuLL, 0x000000002A40B0A4uLL, 0x000000019C0FEFD7uLL}, {0x80000000FFFFFFFFuLL, 0x000000030747AE14uLL, 0x000000002A4419E3uLL, 0x000000020620B043uLL}, {0x80000000FFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000024924924uLL, 0x0000000324924923uLL}, {0x80000000FFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000024924924uLL, 0x00000002FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000020000000uLL, 0x000000015FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000020000000uLL, 0x000000013FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000020000000uLL, 0x000000011FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000001000000000uLL, 0x0000000008000000uLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000001000000001uLL, 0x0000000008000000uLL, 0x00000000F7FFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000001000000002uLL, 0x0000000008000000uLL, 0x00000000EFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000001000000003uLL, 0x0000000008000000uLL, 0x00000000E7FFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0000001000000010uLL, 0x0000000008000000uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000010078644FAuLL, 0x0000000007FC3EA1uLL, 0x0000000B03C212C5uLL}, {0x80000000FFFFFFFFuLL, 0x000000100747AE14uLL, 0x0000000007FC5DD0uLL, 0x0000000423D54BBFuLL}, {0x80000000FFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x0000000007C1F07CuLL, 0x0000000307C1F07BuLL}, {0x80000000FFFFFFFFuLL, 0x0000001080000000uLL, 0x0000000007C1F07CuLL, 0x00000002FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x0000000007878787uLL, 0x0000000A16969694uLL}, {0x80000000FFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x0000000007878787uLL, 0x0000000A0F0F0F0DuLL}, {0x80000000FFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x0000000007878787uLL, 0x0000000A07878786uLL}, {0x80000000FFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFEEuLL}, {0x80000000FFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFDDuLL}, {0x80000000FFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000011uLL, 0x00156B66FFFFFFCCuLL}, {0x80000000FFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000011uLL, 0x00156B66FFFFFEEFuLL}, {0x80000000FFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000011uLL, 0x00156B6680156B65uLL}, {0x80000000FFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000011uLL, 0x00156B66843D70ABuLL}, {0x80000000FFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5E80000010uLL}, {0x80000000FFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000011uLL, 0x00156B5E7FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000011uLL, 0x00156B5600000032uLL}, {0x80000000FFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000011uLL, 0x00156B5600000021uLL}, {0x80000000FFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000011uLL, 0x00156B5600000010uLL}, {0x80000000FFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFEEuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFDDuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFFCCuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000011uLL, 0x043D70ACFFFFFEEFuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000011uLL, 0x043D70AC80156B65uLL}, {0x80000000FFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000011uLL, 0x043D70AC843D70ABuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000011uLL, 0x043D70A480000010uLL}, {0x80000000FFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000011uLL, 0x043D70A47FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000011uLL, 0x043D709C00000032uLL}, {0x80000000FFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000011uLL, 0x043D709C00000021uLL}, {0x80000000FFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000011uLL, 0x043D709C00000010uLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEFuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB05uLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EBuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0x80000000FFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0x80000000FFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0x80000000FFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0x80000000FFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0x80000000FFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0x80000000FFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0x80000000FFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0x80000000FFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0x80000000FFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0x80000000FFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0x80000000FFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0x80000000FFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0x80000000FFFFFFFFuLL}, {0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0x0000000000000002uLL, 0x7FFFFFFE80000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0x0000000000000003uLL, 0x5555555455555555uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000000uLL, 0x0000000000000010uLL, 0x0FFFFFFFD0000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000000078644FAuLL, 0x0000002205B17A97uLL, 0x0000000000142C8AuLL}, {0xFFFFFFFD00000000uLL, 0x000000000747AE14uLL, 0x000000232A32A512uLL, 0x0000000001DADE98uLL}, {0xFFFFFFFD00000000uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD00000000uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFD00000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFD00000000uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000004uLL}, {0xFFFFFFFD00000000uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000AuLL}, {0xFFFFFFFD00000000uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000000000012uLL}, {0xFFFFFFFD00000000uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x0000000000000130uLL}, {0xFFFFFFFD00000000uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B20F6716uLL}, {0xFFFFFFFD00000000uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000500ACF34uLL}, {0xFFFFFFFD00000000uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000002AAAAAA9uLL}, {0xFFFFFFFD00000000uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x0000000100000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD00000000uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFD00000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFD00000000uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x0000000100000000uLL}, {0xFFFFFFFD00000000uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000002uLL}, {0xFFFFFFFD00000000uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000004uLL}, {0xFFFFFFFD00000000uLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x0000000180000009uLL}, {0xFFFFFFFD00000000uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x0000000100000060uLL}, {0xFFFFFFFD00000000uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001521509B0uLL}, {0xFFFFFFFD00000000uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x000000016CA89D1CuLL}, {0xFFFFFFFD00000000uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000E6666665uLL}, {0xFFFFFFFD00000000uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000080000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFD00000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001AAAAAAA8uLL}, {0xFFFFFFFD00000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555554uLL}, {0xFFFFFFFD00000000uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000100000000uLL}, {0xFFFFFFFD00000000uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000AAAAAAACuLL}, {0xFFFFFFFD00000000uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000055555558uLL}, {0xFFFFFFFD00000000uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000000000004uLL}, {0xFFFFFFFD00000000uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001AAAAAAE0uLL}, {0xFFFFFFFD00000000uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000013FA624AAuLL}, {0xFFFFFFFD00000000uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000213890E9CuLL}, {0xFFFFFFFD00000000uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000149249248uLL}, {0xFFFFFFFD00000000uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000100000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFDuLL}, {0xFFFFFFFD00000000uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFD00000000uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000013FFFFFFFuLL}, {0xFFFFFFFD00000000uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000000uLL}, {0xFFFFFFFD00000000uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF0000001uLL}, {0xFFFFFFFD00000000uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE0000002uLL}, {0xFFFFFFFD00000000uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD0000003uLL}, {0xFFFFFFFD00000000uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C00000010uLL}, {0xFFFFFFFD00000000uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000000FFFDE092uLL}, {0xFFFFFFFD00000000uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000347AA9780uLL}, {0xFFFFFFFD00000000uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000010F83E0F8uLL}, {0xFFFFFFFD00000000uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000100000000uLL}, {0xFFFFFFFD00000000uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F2D2D2D2AuLL}, {0xFFFFFFFD00000000uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F1E1E1E1CuLL}, {0xFFFFFFFD00000000uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F0F0F0F0EuLL}, {0xFFFFFFFD00000000uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C900000000uLL}, {0xFFFFFFFD00000000uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFDEuLL}, {0xFFFFFFFD00000000uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFBCuLL}, {0xFFFFFFFD00000000uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFF9AuLL}, {0xFFFFFFFD00000000uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFDE0uLL}, {0xFFFFFFFD00000000uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8002AD6CCuLL}, {0xFFFFFFFD00000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8087AE158uLL}, {0xFFFFFFFD00000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B800000022uLL}, {0xFFFFFFFD00000000uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B800000000uLL}, {0xFFFFFFFD00000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A700000066uLL}, {0xFFFFFFFD00000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A700000044uLL}, {0xFFFFFFFD00000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A700000022uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334100000000uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333340FFFFFFDDuLL}, {0xFFFFFFFD00000000uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333340FFFFFFBAuLL}, {0xFFFFFFFD00000000uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333340FFFFFF97uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333340FFFFFDD0uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133333FF8A491D2uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334001333344uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F80000023uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F80000000uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E00000069uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E00000046uLL}, {0xFFFFFFFD00000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E00000023uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFDuLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF0uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB06uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851ECuLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000000uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFD00000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFD00000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFFuLL}, {0xFFFFFFFD00000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFEuLL}, {0xFFFFFFFD00000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFDuLL}, {0xFFFFFFFD00000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFF0uLL}, {0xFFFFFFFD00000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFCF879BB06uLL}, {0xFFFFFFFD00000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFCF8B851ECuLL}, {0xFFFFFFFD00000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000001uLL}, {0xFFFFFFFD00000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC80000000uLL}, {0xFFFFFFFD00000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000003uLL}, {0xFFFFFFFD00000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000002uLL}, {0xFFFFFFFD00000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000001uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000000uLL}, {0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000001uLL, 0x0000000000000002uLL, 0x7FFFFFFE80000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000001uLL, 0x0000000000000003uLL, 0x5555555455555555uLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000001uLL, 0x0000000000000010uLL, 0x0FFFFFFFD0000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000000078644FAuLL, 0x0000002205B17A97uLL, 0x0000000000142C8BuLL}, {0xFFFFFFFD00000001uLL, 0x000000000747AE14uLL, 0x000000232A32A512uLL, 0x0000000001DADE99uLL}, {0xFFFFFFFD00000001uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD00000001uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFD00000001uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFD00000001uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000001uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000005uLL}, {0xFFFFFFFD00000001uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000BuLL}, {0xFFFFFFFD00000001uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000000000013uLL}, {0xFFFFFFFD00000001uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x0000000000000131uLL}, {0xFFFFFFFD00000001uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B20F6717uLL}, {0xFFFFFFFD00000001uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000500ACF35uLL}, {0xFFFFFFFD00000001uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000002AAAAAAAuLL}, {0xFFFFFFFD00000001uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x0000000100000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD00000001uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFD00000001uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD00000001uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x0000000100000001uLL}, {0xFFFFFFFD00000001uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000003uLL}, {0xFFFFFFFD00000001uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000005uLL}, {0xFFFFFFFD00000001uLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x000000018000000AuLL}, {0xFFFFFFFD00000001uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x0000000100000061uLL}, {0xFFFFFFFD00000001uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001521509B1uLL}, {0xFFFFFFFD00000001uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x000000016CA89D1DuLL}, {0xFFFFFFFD00000001uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000E6666666uLL}, {0xFFFFFFFD00000001uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000080000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFD00000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001AAAAAAA9uLL}, {0xFFFFFFFD00000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555555uLL}, {0xFFFFFFFD00000001uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000100000001uLL}, {0xFFFFFFFD00000001uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000AAAAAAADuLL}, {0xFFFFFFFD00000001uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000055555559uLL}, {0xFFFFFFFD00000001uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000000000005uLL}, {0xFFFFFFFD00000001uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001AAAAAAE1uLL}, {0xFFFFFFFD00000001uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000013FA624ABuLL}, {0xFFFFFFFD00000001uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000213890E9DuLL}, {0xFFFFFFFD00000001uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000149249249uLL}, {0xFFFFFFFD00000001uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000100000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFEuLL}, {0xFFFFFFFD00000001uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD00000001uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000140000000uLL}, {0xFFFFFFFD00000001uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000001uLL}, {0xFFFFFFFD00000001uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF0000002uLL}, {0xFFFFFFFD00000001uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE0000003uLL}, {0xFFFFFFFD00000001uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD0000004uLL}, {0xFFFFFFFD00000001uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C00000011uLL}, {0xFFFFFFFD00000001uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000000FFFDE093uLL}, {0xFFFFFFFD00000001uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000347AA9781uLL}, {0xFFFFFFFD00000001uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000010F83E0F9uLL}, {0xFFFFFFFD00000001uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000100000001uLL}, {0xFFFFFFFD00000001uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F2D2D2D2BuLL}, {0xFFFFFFFD00000001uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F1E1E1E1DuLL}, {0xFFFFFFFD00000001uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F0F0F0F0FuLL}, {0xFFFFFFFD00000001uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C900000001uLL}, {0xFFFFFFFD00000001uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFDFuLL}, {0xFFFFFFFD00000001uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFBDuLL}, {0xFFFFFFFD00000001uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFF9BuLL}, {0xFFFFFFFD00000001uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFDE1uLL}, {0xFFFFFFFD00000001uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8002AD6CDuLL}, {0xFFFFFFFD00000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8087AE159uLL}, {0xFFFFFFFD00000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B800000023uLL}, {0xFFFFFFFD00000001uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B800000001uLL}, {0xFFFFFFFD00000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A700000067uLL}, {0xFFFFFFFD00000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A700000045uLL}, {0xFFFFFFFD00000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A700000023uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334100000001uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333340FFFFFFDEuLL}, {0xFFFFFFFD00000001uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333340FFFFFFBBuLL}, {0xFFFFFFFD00000001uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333340FFFFFF98uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333340FFFFFDD1uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133333FF8A491D3uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334001333345uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F80000024uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F80000001uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E0000006AuLL}, {0xFFFFFFFD00000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E00000047uLL}, {0xFFFFFFFD00000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E00000024uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF1uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB07uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EDuLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000004uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFD00000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFD00000001uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD00000001uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFFuLL}, {0xFFFFFFFD00000001uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFEuLL}, {0xFFFFFFFD00000001uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFF1uLL}, {0xFFFFFFFD00000001uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFCF879BB07uLL}, {0xFFFFFFFD00000001uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFCF8B851EDuLL}, {0xFFFFFFFD00000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000002uLL}, {0xFFFFFFFD00000001uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC80000001uLL}, {0xFFFFFFFD00000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000004uLL}, {0xFFFFFFFD00000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000003uLL}, {0xFFFFFFFD00000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000002uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000001uLL}, {0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x0000000000000002uLL, 0x7FFFFFFE80000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x0000000000000003uLL, 0x5555555455555556uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x0000000000000010uLL, 0x0FFFFFFFD0000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000000078644FAuLL, 0x0000002205B17A97uLL, 0x0000000000142C8CuLL}, {0xFFFFFFFD00000002uLL, 0x000000000747AE14uLL, 0x000000232A32A512uLL, 0x0000000001DADE9AuLL}, {0xFFFFFFFD00000002uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000002uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000006uLL}, {0xFFFFFFFD00000002uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000CuLL}, {0xFFFFFFFD00000002uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000000000014uLL}, {0xFFFFFFFD00000002uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x0000000000000132uLL}, {0xFFFFFFFD00000002uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B20F6718uLL}, {0xFFFFFFFD00000002uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000500ACF36uLL}, {0xFFFFFFFD00000002uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000002AAAAAABuLL}, {0xFFFFFFFD00000002uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x0000000100000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFD00000002uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x0000000180000000uLL}, {0xFFFFFFFD00000002uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x0000000100000002uLL}, {0xFFFFFFFD00000002uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000004uLL}, {0xFFFFFFFD00000002uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000006uLL}, {0xFFFFFFFD00000002uLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x000000018000000BuLL}, {0xFFFFFFFD00000002uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x0000000100000062uLL}, {0xFFFFFFFD00000002uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001521509B2uLL}, {0xFFFFFFFD00000002uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x000000016CA89D1EuLL}, {0xFFFFFFFD00000002uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000E6666667uLL}, {0xFFFFFFFD00000002uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000080000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFD00000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001AAAAAAAAuLL}, {0xFFFFFFFD00000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555556uLL}, {0xFFFFFFFD00000002uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000100000002uLL}, {0xFFFFFFFD00000002uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000AAAAAAAEuLL}, {0xFFFFFFFD00000002uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000005555555AuLL}, {0xFFFFFFFD00000002uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000000000006uLL}, {0xFFFFFFFD00000002uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001AAAAAAE2uLL}, {0xFFFFFFFD00000002uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000013FA624ACuLL}, {0xFFFFFFFD00000002uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000213890E9EuLL}, {0xFFFFFFFD00000002uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x000000014924924AuLL}, {0xFFFFFFFD00000002uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000100000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFFuLL}, {0xFFFFFFFD00000002uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000180000000uLL}, {0xFFFFFFFD00000002uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000140000001uLL}, {0xFFFFFFFD00000002uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000002uLL}, {0xFFFFFFFD00000002uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF0000003uLL}, {0xFFFFFFFD00000002uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE0000004uLL}, {0xFFFFFFFD00000002uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD0000005uLL}, {0xFFFFFFFD00000002uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C00000012uLL}, {0xFFFFFFFD00000002uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000000FFFDE094uLL}, {0xFFFFFFFD00000002uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000347AA9782uLL}, {0xFFFFFFFD00000002uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000010F83E0FAuLL}, {0xFFFFFFFD00000002uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000100000002uLL}, {0xFFFFFFFD00000002uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F2D2D2D2CuLL}, {0xFFFFFFFD00000002uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F1E1E1E1EuLL}, {0xFFFFFFFD00000002uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F0F0F0F10uLL}, {0xFFFFFFFD00000002uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C900000002uLL}, {0xFFFFFFFD00000002uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFE0uLL}, {0xFFFFFFFD00000002uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFBEuLL}, {0xFFFFFFFD00000002uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFF9CuLL}, {0xFFFFFFFD00000002uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFDE2uLL}, {0xFFFFFFFD00000002uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8002AD6CEuLL}, {0xFFFFFFFD00000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8087AE15AuLL}, {0xFFFFFFFD00000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B800000024uLL}, {0xFFFFFFFD00000002uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B800000002uLL}, {0xFFFFFFFD00000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A700000068uLL}, {0xFFFFFFFD00000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A700000046uLL}, {0xFFFFFFFD00000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A700000024uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334100000002uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333340FFFFFFDFuLL}, {0xFFFFFFFD00000002uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333340FFFFFFBCuLL}, {0xFFFFFFFD00000002uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333340FFFFFF99uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333340FFFFFDD2uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133333FF8A491D4uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334001333346uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F80000025uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F80000002uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E0000006BuLL}, {0xFFFFFFFD00000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E00000048uLL}, {0xFFFFFFFD00000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E00000025uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF2uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB08uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EEuLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000003uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000005uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000004uLL}, {0xFFFFFFFD00000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFD00000002uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFD00000002uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD00000002uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFFuLL}, {0xFFFFFFFD00000002uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFF2uLL}, {0xFFFFFFFD00000002uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFCF879BB08uLL}, {0xFFFFFFFD00000002uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFCF8B851EEuLL}, {0xFFFFFFFD00000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000003uLL}, {0xFFFFFFFD00000002uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC80000002uLL}, {0xFFFFFFFD00000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000005uLL}, {0xFFFFFFFD00000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000004uLL}, {0xFFFFFFFD00000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000003uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000002uLL}, {0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000003uLL, 0x0000000000000002uLL, 0x7FFFFFFE80000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0x0000000000000003uLL, 0x5555555455555556uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0x0000000000000010uLL, 0x0FFFFFFFD0000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000000078644FAuLL, 0x0000002205B17A97uLL, 0x0000000000142C8DuLL}, {0xFFFFFFFD00000003uLL, 0x000000000747AE14uLL, 0x000000232A32A512uLL, 0x0000000001DADE9BuLL}, {0xFFFFFFFD00000003uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x0000000000000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL}, {0xFFFFFFFD00000003uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000007uLL}, {0xFFFFFFFD00000003uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000DuLL}, {0xFFFFFFFD00000003uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000000000015uLL}, {0xFFFFFFFD00000003uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x0000000000000133uLL}, {0xFFFFFFFD00000003uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B20F6719uLL}, {0xFFFFFFFD00000003uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000500ACF37uLL}, {0xFFFFFFFD00000003uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000002AAAAAACuLL}, {0xFFFFFFFD00000003uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x0000000100000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0xFFFFFFFD00000003uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x0000000180000001uLL}, {0xFFFFFFFD00000003uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x0000000100000003uLL}, {0xFFFFFFFD00000003uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000005uLL}, {0xFFFFFFFD00000003uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000007uLL}, {0xFFFFFFFD00000003uLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x000000018000000CuLL}, {0xFFFFFFFD00000003uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x0000000100000063uLL}, {0xFFFFFFFD00000003uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001521509B3uLL}, {0xFFFFFFFD00000003uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x000000016CA89D1FuLL}, {0xFFFFFFFD00000003uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000E6666668uLL}, {0xFFFFFFFD00000003uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000080000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFD00000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001AAAAAAABuLL}, {0xFFFFFFFD00000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555557uLL}, {0xFFFFFFFD00000003uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000100000003uLL}, {0xFFFFFFFD00000003uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000AAAAAAAFuLL}, {0xFFFFFFFD00000003uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000005555555BuLL}, {0xFFFFFFFD00000003uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000000000007uLL}, {0xFFFFFFFD00000003uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001AAAAAAE3uLL}, {0xFFFFFFFD00000003uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000013FA624ADuLL}, {0xFFFFFFFD00000003uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000213890E9FuLL}, {0xFFFFFFFD00000003uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x000000014924924BuLL}, {0xFFFFFFFD00000003uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000100000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C0000000uLL}, {0xFFFFFFFD00000003uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000180000001uLL}, {0xFFFFFFFD00000003uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000140000002uLL}, {0xFFFFFFFD00000003uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000003uLL}, {0xFFFFFFFD00000003uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF0000004uLL}, {0xFFFFFFFD00000003uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE0000005uLL}, {0xFFFFFFFD00000003uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD0000006uLL}, {0xFFFFFFFD00000003uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C00000013uLL}, {0xFFFFFFFD00000003uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000000FFFDE095uLL}, {0xFFFFFFFD00000003uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000347AA9783uLL}, {0xFFFFFFFD00000003uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000010F83E0FBuLL}, {0xFFFFFFFD00000003uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000100000003uLL}, {0xFFFFFFFD00000003uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F2D2D2D2DuLL}, {0xFFFFFFFD00000003uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F1E1E1E1FuLL}, {0xFFFFFFFD00000003uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F0F0F0F11uLL}, {0xFFFFFFFD00000003uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C900000003uLL}, {0xFFFFFFFD00000003uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFE1uLL}, {0xFFFFFFFD00000003uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFBFuLL}, {0xFFFFFFFD00000003uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFF9DuLL}, {0xFFFFFFFD00000003uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFDE3uLL}, {0xFFFFFFFD00000003uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8002AD6CFuLL}, {0xFFFFFFFD00000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8087AE15BuLL}, {0xFFFFFFFD00000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B800000025uLL}, {0xFFFFFFFD00000003uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B800000003uLL}, {0xFFFFFFFD00000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A700000069uLL}, {0xFFFFFFFD00000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A700000047uLL}, {0xFFFFFFFD00000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A700000025uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334100000003uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333340FFFFFFE0uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333340FFFFFFBDuLL}, {0xFFFFFFFD00000003uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333340FFFFFF9AuLL}, {0xFFFFFFFD00000003uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333340FFFFFDD3uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133333FF8A491D5uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334001333347uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F80000026uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F80000003uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E0000006CuLL}, {0xFFFFFFFD00000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E00000049uLL}, {0xFFFFFFFD00000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E00000026uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF3uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB09uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EFuLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000004uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000003uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000006uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000005uLL}, {0xFFFFFFFD00000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000004uLL}, {0xFFFFFFFD00000003uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFD00000003uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFD00000003uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD00000003uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFF3uLL}, {0xFFFFFFFD00000003uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFCF879BB09uLL}, {0xFFFFFFFD00000003uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFCF8B851EFuLL}, {0xFFFFFFFD00000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000004uLL}, {0xFFFFFFFD00000003uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC80000003uLL}, {0xFFFFFFFD00000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000006uLL}, {0xFFFFFFFD00000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000005uLL}, {0xFFFFFFFD00000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000004uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000003uLL}, {0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000010uLL, 0x0000000000000002uLL, 0x7FFFFFFE80000008uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000010uLL, 0x0000000000000003uLL, 0x555555545555555AuLL, 0x0000000000000002uLL}, {0xFFFFFFFD00000010uLL, 0x0000000000000010uLL, 0x0FFFFFFFD0000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000010uLL, 0x00000000078644FAuLL, 0x0000002205B17A97uLL, 0x0000000000142C9AuLL}, {0xFFFFFFFD00000010uLL, 0x000000000747AE14uLL, 0x000000232A32A512uLL, 0x0000000001DADEA8uLL}, {0xFFFFFFFD00000010uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000000000000EuLL}, {0xFFFFFFFD00000010uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x0000000000000010uLL}, {0xFFFFFFFD00000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0xFFFFFFFD00000010uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x000000000000000EuLL}, {0xFFFFFFFD00000010uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x000000000000000EuLL}, {0xFFFFFFFD00000010uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000010uLL}, {0xFFFFFFFD00000010uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000014uLL}, {0xFFFFFFFD00000010uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000000000001AuLL}, {0xFFFFFFFD00000010uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000000000022uLL}, {0xFFFFFFFD00000010uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x0000000000000140uLL}, {0xFFFFFFFD00000010uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B20F6726uLL}, {0xFFFFFFFD00000010uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000500ACF44uLL}, {0xFFFFFFFD00000010uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000002AAAAAB9uLL}, {0xFFFFFFFD00000010uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x0000000100000010uLL}, {0xFFFFFFFD00000010uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000008000000DuLL}, {0xFFFFFFFD00000010uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000000000000EuLL}, {0xFFFFFFFD00000010uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x000000018000000EuLL}, {0xFFFFFFFD00000010uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x0000000100000010uLL}, {0xFFFFFFFD00000010uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000080000012uLL}, {0xFFFFFFFD00000010uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000000000014uLL}, {0xFFFFFFFD00000010uLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x0000000180000019uLL}, {0xFFFFFFFD00000010uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x0000000100000070uLL}, {0xFFFFFFFD00000010uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001521509C0uLL}, {0xFFFFFFFD00000010uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x000000016CA89D2CuLL}, {0xFFFFFFFD00000010uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000E6666675uLL}, {0xFFFFFFFD00000010uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000080000010uLL}, {0xFFFFFFFD00000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x000000020000000CuLL}, {0xFFFFFFFD00000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001AAAAAAB8uLL}, {0xFFFFFFFD00000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000155555564uLL}, {0xFFFFFFFD00000010uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000100000010uLL}, {0xFFFFFFFD00000010uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000AAAAAABCuLL}, {0xFFFFFFFD00000010uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000055555568uLL}, {0xFFFFFFFD00000010uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000000000014uLL}, {0xFFFFFFFD00000010uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001AAAAAAF0uLL}, {0xFFFFFFFD00000010uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000013FA624BAuLL}, {0xFFFFFFFD00000010uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000213890EACuLL}, {0xFFFFFFFD00000010uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000149249258uLL}, {0xFFFFFFFD00000010uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000100000010uLL}, {0xFFFFFFFD00000010uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C000000DuLL}, {0xFFFFFFFD00000010uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000018000000EuLL}, {0xFFFFFFFD00000010uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000014000000FuLL}, {0xFFFFFFFD00000010uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000010uLL}, {0xFFFFFFFD00000010uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF0000011uLL}, {0xFFFFFFFD00000010uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE0000012uLL}, {0xFFFFFFFD00000010uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD0000013uLL}, {0xFFFFFFFD00000010uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C00000020uLL}, {0xFFFFFFFD00000010uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000000FFFDE0A2uLL}, {0xFFFFFFFD00000010uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000347AA9790uLL}, {0xFFFFFFFD00000010uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000010F83E108uLL}, {0xFFFFFFFD00000010uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000100000010uLL}, {0xFFFFFFFD00000010uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F2D2D2D3AuLL}, {0xFFFFFFFD00000010uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F1E1E1E2CuLL}, {0xFFFFFFFD00000010uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F0F0F0F1EuLL}, {0xFFFFFFFD00000010uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C900000010uLL}, {0xFFFFFFFD00000010uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFEEuLL}, {0xFFFFFFFD00000010uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFCCuLL}, {0xFFFFFFFD00000010uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFFAAuLL}, {0xFFFFFFFD00000010uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C8FFFFFDF0uLL}, {0xFFFFFFFD00000010uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8002AD6DCuLL}, {0xFFFFFFFD00000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8087AE168uLL}, {0xFFFFFFFD00000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B800000032uLL}, {0xFFFFFFFD00000010uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B800000010uLL}, {0xFFFFFFFD00000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A700000076uLL}, {0xFFFFFFFD00000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A700000054uLL}, {0xFFFFFFFD00000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A700000032uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334100000010uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333340FFFFFFEDuLL}, {0xFFFFFFFD00000010uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333340FFFFFFCAuLL}, {0xFFFFFFFD00000010uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333340FFFFFFA7uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333340FFFFFDE0uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133333FF8A491E2uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334001333354uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F80000033uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F80000010uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E00000079uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E00000056uLL}, {0xFFFFFFFD00000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E00000033uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000010uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE0000000FuLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE0000000EuLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE0000000DuLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB16uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851FCuLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000011uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000010uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000013uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000012uLL}, {0xFFFFFFFD00000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000011uLL}, {0xFFFFFFFD00000010uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD0000000FuLL}, {0xFFFFFFFD00000010uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD0000000EuLL}, {0xFFFFFFFD00000010uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFD0000000DuLL}, {0xFFFFFFFD00000010uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD00000010uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFCF879BB16uLL}, {0xFFFFFFFD00000010uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFCF8B851FCuLL}, {0xFFFFFFFD00000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000011uLL}, {0xFFFFFFFD00000010uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC80000010uLL}, {0xFFFFFFFD00000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000013uLL}, {0xFFFFFFFD00000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000012uLL}, {0xFFFFFFFD00000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC00000011uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD00000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD00000010uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000000000002uLL, 0x7FFFFFFE83C3227DuLL, 0x0000000000000000uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000000000003uLL, 0x5555555457D76C53uLL, 0x0000000000000001uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000000000010uLL, 0x0FFFFFFFD078644FuLL, 0x000000000000000AuLL}, {0xFFFFFFFD078644FAuLL, 0x00000000078644FAuLL, 0x0000002205B17A98uLL, 0x0000000000142C8AuLL}, {0xFFFFFFFD078644FAuLL, 0x000000000747AE14uLL, 0x000000232A32A513uLL, 0x000000000219757EuLL}, {0xFFFFFFFD078644FAuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x00000000078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x00000000078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x00000000078644FEuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x0000000007864504uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x000000000786450CuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x000000000786462AuLL}, {0xFFFFFFFD078644FAuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B995AC10uLL}, {0xFFFFFFFD078644FAuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x000000005791142EuLL}, {0xFFFFFFFD078644FAuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000003230EFA3uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x00000001078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x00000000878644F7uLL}, {0xFFFFFFFD078644FAuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000000078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x00000001878644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x00000001078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x00000000878644FCuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x00000000078644FEuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x0000000187864503uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x000000010786455AuLL}, {0xFFFFFFFD078644FAuLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001599B4EAAuLL}, {0xFFFFFFFD078644FAuLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x00000001742EE216uLL}, {0xFFFFFFFD078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000EDECAB5FuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x00000000878644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000002078644F6uLL}, {0xFFFFFFFD078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001B230EFA2uLL}, {0xFFFFFFFD078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x000000015CDB9A4EuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000001078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000B230EFA6uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000005CDB9A52uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x00000000078644FEuLL}, {0xFFFFFFFD078644FAuLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001B230EFDAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x00000001472C69A4uLL}, {0xFFFFFFFD078644FAuLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x000000021B0F5396uLL}, {0xFFFFFFFD078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000150AAD742uLL}, {0xFFFFFFFD078644FAuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000001078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C78644F7uLL}, {0xFFFFFFFD078644FAuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000001878644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000001478644F9uLL}, {0xFFFFFFFD078644FAuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF78644FBuLL}, {0xFFFFFFFD078644FAuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE78644FCuLL}, {0xFFFFFFFD078644FAuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD78644FDuLL}, {0xFFFFFFFD078644FAuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C0786450AuLL}, {0xFFFFFFFD078644FAuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000010784258CuLL}, {0xFFFFFFFD078644FAuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x000000034F30DC7AuLL}, {0xFFFFFFFD078644FAuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x00000001170A25F2uLL}, {0xFFFFFFFD078644FAuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000001078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F34B37224uLL}, {0xFFFFFFFD078644FAuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F25A46316uLL}, {0xFFFFFFFD078644FAuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F16955408uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C9078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9078644D8uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9078644B6uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C907864494uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9078642DAuLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C807B11BC6uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C810012652uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B80786451CuLL}, {0xFFFFFFFD078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B8078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A707864560uLL}, {0xFFFFFFFD078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A70786453EuLL}, {0xFFFFFFFD078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A70786451CuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333341078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341078644D7uLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341078644B4uLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x0133334107864491uLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341078642CAuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340002AD6CCuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334008B9783EuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F8786451DuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F878644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E07864563uLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E07864540uLL}, {0xFFFFFFFD078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E0786451DuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644F9uLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644F7uLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644EAuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE003E96E6uLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD878644FBuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD878644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FDuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FCuLL}, {0xFFFFFFFD078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FBuLL}, {0xFFFFFFFD078644FAuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD078644F9uLL}, {0xFFFFFFFD078644FAuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFD078644F7uLL}, {0xFFFFFFFD078644FAuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFD078644EAuLL}, {0xFFFFFFFD078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFD003E96E6uLL}, {0xFFFFFFFD078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC878644FBuLL}, {0xFFFFFFFD078644FAuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC878644FAuLL}, {0xFFFFFFFD078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC078644FDuLL}, {0xFFFFFFFD078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC078644FCuLL}, {0xFFFFFFFD078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC078644FBuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD078644FAuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000000uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000000000002uLL, 0x7FFFFFFE83A3D70AuLL, 0x0000000000000000uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000000000003uLL, 0x5555555457C28F5CuLL, 0x0000000000000000uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000000000010uLL, 0x0FFFFFFFD0747AE1uLL, 0x0000000000000004uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000000078644FAuLL, 0x0000002205B17A97uLL, 0x00000000075BDA9EuLL}, {0xFFFFFFFD0747AE14uLL, 0x000000000747AE14uLL, 0x000000232A32A513uLL, 0x0000000001DADE98uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000000747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x000000000747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x000000000747AE18uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000000747AE1EuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x000000000747AE26uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x000000000747AF44uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB59uLL, 0x00000000B957152AuLL}, {0xFFFFFFFD0747AE14uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x0000000057527D48uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x0000000031F258BDuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x000000010747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000008747AE11uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000000747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x000000018747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x000000010747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x000000008747AE16uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x000000000747AE18uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000200000003uLL, 0x000000007FFFFFFDuLL, 0x000000018747AE1DuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x000000010747AE74uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001595CB7C4uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x0000000173F04B30uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000000EDAE1479uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000008747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x000000020747AE10uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000001B1F258BCuLL}, {0xFFFFFFFD0747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x000000015C9D0368uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x000000010747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000000B1F258C0uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000005C9D036CuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x000000000747AE18uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000001B1F258F4uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x0000000146EDD2BEuLL}, {0xFFFFFFFD0747AE14uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x000000021AD0BCB0uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000001506C405CuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x000000010747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000001C747AE11uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000018747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000014747AE13uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000CF747AE15uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000CE747AE16uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000CD747AE17uLL}, {0xFFFFFFFD0747AE14uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C0747AE24uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x0000000107458EA6uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x000000034EF24594uLL}, {0xFFFFFFFD0747AE14uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x0000000116CB8F0CuLL}, {0xFFFFFFFD0747AE14uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x000000010747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000F3474DB3EuLL}, {0xFFFFFFFD0747AE14uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F2565CC30uLL}, {0xFFFFFFFD0747AE14uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F1656BD22uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C90747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C90747ADF2uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C90747ADD0uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C90747ADAEuLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C90747ABF4uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8077284E0uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C80FC28F6CuLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B80747AE36uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B80747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A70747AE7AuLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A70747AE58uLL}, {0xFFFFFFFD0747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A70747AE36uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x013333410747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333410747ADF1uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333410747ADCEuLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333410747ADABuLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333410747ABE4uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133333FFFEC3FE6uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x01333340087AE158uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133332F8747AE37uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332F8747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E0747AE7DuLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E0747AE5AuLL}, {0xFFFFFFFD0747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E0747AE37uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE13uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE11uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE04uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFC1691AuLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD8747AE15uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD8747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE17uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE16uLL}, {0xFFFFFFFD0747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE15uLL}, {0xFFFFFFFD0747AE14uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE13uLL}, {0xFFFFFFFD0747AE14uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE11uLL}, {0xFFFFFFFD0747AE14uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE04uLL}, {0xFFFFFFFD0747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFCFFC1691AuLL}, {0xFFFFFFFD0747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD0747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC8747AE15uLL}, {0xFFFFFFFD0747AE14uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFC8747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC0747AE17uLL}, {0xFFFFFFFD0747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC0747AE16uLL}, {0xFFFFFFFD0747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC0747AE15uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD0747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD0747AE14uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000002uLL, 0x7FFFFFFEBFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000003uLL, 0x555555547FFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000010uLL, 0x0FFFFFFFD7FFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000002205B17AA8uLL, 0x00000000002997EFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000000747AE14uLL, 0x000000232A32A523uLL, 0x0000000006184F43uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFAuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000080000003uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x0000000080000009uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000080000011uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x000000008000012FuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x000000002A89221BuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000D00ACF33uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x00000000AAAAAAA8uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA8uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000100000001uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000080000003uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000000000005uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x000000018000005FuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001D21509AFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x00000001ECA89D1BuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x0000000166666664uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x000000027FFFFFFBuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x000000022AAAAAA7uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x00000001D5555553uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x000000012AAAAAABuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x00000000D5555557uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000080000003uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x000000022AAAAADFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x00000001BFA624A9uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000293890E9BuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000001C9249247uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x000000023FFFFFFCuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFEuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000D70000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000D60000001uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000D50000002uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C8000000FuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000017FFDE091uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x00000003C7AA977FuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000018F83E0F7uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000FAD2D2D29uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F9E1E1E1BuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F8F0F0F0DuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFFDDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFFBBuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFF99uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFDDFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8802AD6CBuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8887AE157uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B880000021uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B87FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A780000065uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A780000043uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A780000021uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x013333417FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333417FFFFFDCuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333417FFFFFB9uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333417FFFFF96uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333417FFFFDCFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133334078A491D1uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334081333343uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333000000022uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133332FFFFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E80000068uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E80000045uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E80000022uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFCuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFEFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFE7879BB05uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE78B851EBuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFEuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFCuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFEFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFD7879BB05uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFD78B851EBuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000002uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000001uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000000000000002uLL, 0x7FFFFFFEC0000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000000000000003uLL, 0x5555555480000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000000000000010uLL, 0x0FFFFFFFD8000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000000078644FAuLL, 0x0000002205B17AA8uLL, 0x00000000002997F0uLL}, {0xFFFFFFFD80000000uLL, 0x000000000747AE14uLL, 0x000000232A32A523uLL, 0x0000000006184F44uLL}, {0xFFFFFFFD80000000uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFBuLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL, 0x0000000080000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFCuLL, 0x0000000080000004uLL}, {0xFFFFFFFD80000000uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFBuLL, 0x000000008000000AuLL}, {0xFFFFFFFD80000000uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFAuLL, 0x0000000080000012uLL}, {0xFFFFFFFD80000000uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEDuLL, 0x0000000080000130uLL}, {0xFFFFFFFD80000000uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x000000002A89221CuLL}, {0xFFFFFFFD80000000uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA57uLL, 0x00000000D00ACF34uLL}, {0xFFFFFFFD80000000uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x00000000AAAAAAA9uLL}, {0xFFFFFFFD80000000uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFD80000000uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x0000000180000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000100000002uLL}, {0xFFFFFFFD80000000uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000080000004uLL}, {0xFFFFFFFD80000000uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000000000006uLL}, {0xFFFFFFFD80000000uLL, 0x0000000200000010uLL, 0x000000007FFFFFFAuLL, 0x0000000180000060uLL}, {0xFFFFFFFD80000000uLL, 0x00000002078644FAuLL, 0x000000007E256848uLL, 0x00000001D21509B0uLL}, {0xFFFFFFFD80000000uLL, 0x000000020747AE14uLL, 0x000000007E349CA5uLL, 0x00000001ECA89D1CuLL}, {0xFFFFFFFD80000000uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x0000000166666665uLL}, {0xFFFFFFFD80000000uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000100000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x000000027FFFFFFCuLL}, {0xFFFFFFFD80000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x000000022AAAAAA8uLL}, {0xFFFFFFFD80000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x00000001D5555554uLL}, {0xFFFFFFFD80000000uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000180000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x000000012AAAAAACuLL}, {0xFFFFFFFD80000000uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x00000000D5555558uLL}, {0xFFFFFFFD80000000uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000080000004uLL}, {0xFFFFFFFD80000000uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x000000022AAAAAE0uLL}, {0xFFFFFFFD80000000uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x00000001BFA624AAuLL}, {0xFFFFFFFD80000000uLL, 0x000000030747AE14uLL, 0x00000000548833C5uLL, 0x0000000293890E9CuLL}, {0xFFFFFFFD80000000uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000001C9249248uLL}, {0xFFFFFFFD80000000uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000180000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x000000023FFFFFFDuLL}, {0xFFFFFFFD80000000uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000001BFFFFFFFuLL}, {0xFFFFFFFD80000000uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000D80000000uLL}, {0xFFFFFFFD80000000uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000D70000001uLL}, {0xFFFFFFFD80000000uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000D60000002uLL}, {0xFFFFFFFD80000000uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000D50000003uLL}, {0xFFFFFFFD80000000uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000C80000010uLL}, {0xFFFFFFFD80000000uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000017FFDE092uLL}, {0xFFFFFFFD80000000uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x00000003C7AA9780uLL}, {0xFFFFFFFD80000000uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000018F83E0F8uLL}, {0xFFFFFFFD80000000uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000180000000uLL}, {0xFFFFFFFD80000000uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000000FAD2D2D2AuLL}, {0xFFFFFFFD80000000uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000000F9E1E1E1CuLL}, {0xFFFFFFFD80000000uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000000F8F0F0F0EuLL}, {0xFFFFFFFD80000000uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C980000000uLL}, {0xFFFFFFFD80000000uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFFDEuLL}, {0xFFFFFFFD80000000uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFFBCuLL}, {0xFFFFFFFD80000000uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFF9AuLL}, {0xFFFFFFFD80000000uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C97FFFFDE0uLL}, {0xFFFFFFFD80000000uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C8802AD6CCuLL}, {0xFFFFFFFD80000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C8887AE158uLL}, {0xFFFFFFFD80000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B880000022uLL}, {0xFFFFFFFD80000000uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B880000000uLL}, {0xFFFFFFFD80000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A780000066uLL}, {0xFFFFFFFD80000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A780000044uLL}, {0xFFFFFFFD80000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A780000022uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334180000000uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333417FFFFFDDuLL}, {0xFFFFFFFD80000000uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333417FFFFFBAuLL}, {0xFFFFFFFD80000000uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333417FFFFF97uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333417FFFFDD0uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133334078A491D2uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334081333344uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333000000023uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333000000000uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331E80000069uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331E80000046uLL}, {0xFFFFFFFD80000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331E80000023uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFDuLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFF0uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFE7879BB06uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE78B851ECuLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000003uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFD80000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFD80000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFFuLL}, {0xFFFFFFFD80000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFDuLL}, {0xFFFFFFFD80000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFF0uLL}, {0xFFFFFFFD80000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFD7879BB06uLL}, {0xFFFFFFFD80000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFD78B851ECuLL}, {0xFFFFFFFD80000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFD80000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFD80000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000003uLL}, {0xFFFFFFFD80000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000002uLL}, {0xFFFFFFFD80000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFC80000001uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFD80000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFD80000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000002uLL, 0x7FFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000003uLL, 0x55555554AAAAAAA9uLL, 0x0000000000000002uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000010uLL, 0x0FFFFFFFDFFFFFFFuLL, 0x000000000000000DuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0353uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11D9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFCuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFBuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000005uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000CuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x000000000000011DuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA892219uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C3211DuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAA6uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFAuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFCuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000001uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000003uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000000000004DuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B3uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF05uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666662uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000002FFFFFFF9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAA5uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555551uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAA9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000155555555uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000001uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAADDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624A7uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C416085uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000249249245uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFAuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000027FFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000023FFFFFFCuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000DFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DEFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DDFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D0000000DuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE08FuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA977DuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0F5uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D27uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E19uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F0BuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFDBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFB9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF97uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDDDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6C9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE155uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B90000001FuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B8FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000063uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000041uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A80000001FuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333341FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFDAuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFB7uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF94uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDCDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491CFuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333341uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000020uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333307FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F00000066uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000043uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000020uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFAuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFEDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB03uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851E9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFAuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFEDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB03uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851E9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000002uLL, 0x7FFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000003uLL, 0x55555554AAAAAAAAuLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000010uLL, 0x0FFFFFFFDFFFFFFFuLL, 0x000000000000000EuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0354uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11DAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFBuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000006uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000DuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x000000000000011EuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89221AuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C3211EuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAA7uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFBuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000002uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000004uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000000000004EuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B4uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF06uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666663uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000002FFFFFFFAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAA6uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555552uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAAAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000155555556uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000002uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAADEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624A8uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C416086uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000249249246uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000027FFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000023FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000DFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DEFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000001uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D0000000EuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE090uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA977EuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0F6uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D28uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E1AuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F0CuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFDCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFBAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF98uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDDEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6CAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE156uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000020uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B8FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000064uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000042uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000020uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333341FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFDBuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFB8uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF95uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDCEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491D0uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333342uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000021uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333307FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F00000067uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000044uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000021uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFEEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB04uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFEEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB04uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFCFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000002uLL, 0x7FFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000003uLL, 0x55555554AAAAAAAAuLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000010uLL, 0x0FFFFFFFDFFFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0355uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11DBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFBuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000002uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000007uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000EuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x000000000000011FuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89221BuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C3211FuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAA8uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFCuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000200000000uLL, 0x000000007FFFFFFEuLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000003uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000005uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000000000004FuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B5uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF07uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666664uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000002FFFFFFFBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAA7uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555553uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAABuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000155555557uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000003uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAADFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624A9uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C416087uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000249249247uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000027FFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000023FFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000DFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF0000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000002uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D0000000FuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE091uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA977FuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0F7uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D29uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E1BuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F0DuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFDDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFBBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF99uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDDFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6CBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE157uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000021uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B8FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000065uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000043uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000021uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333341FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFDCuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFB9uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF96uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDCFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491D1uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333343uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000022uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333307FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F00000068uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000045uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000022uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFEFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB05uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFEFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB05uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD7FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFDFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFDFFFFFFFFuLL}, {0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000000000000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000000000000003uLL, 0x55555554AAAAAAAAuLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000000uLL, 0x0000000000000010uLL, 0x0FFFFFFFE0000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0356uLL}, {0xFFFFFFFE00000000uLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11DCuLL}, {0xFFFFFFFE00000000uLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFE00000000uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000000uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000008uLL}, {0xFFFFFFFE00000000uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000000000000FuLL}, {0xFFFFFFFE00000000uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x0000000000000120uLL}, {0xFFFFFFFE00000000uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89221CuLL}, {0xFFFFFFFE00000000uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C32120uLL}, {0xFFFFFFFE00000000uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAA9uLL}, {0xFFFFFFFE00000000uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000080000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFE00000000uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFE00000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE00000000uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000002uLL}, {0xFFFFFFFE00000000uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000004uLL}, {0xFFFFFFFE00000000uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000006uLL}, {0xFFFFFFFE00000000uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000000000050uLL}, {0xFFFFFFFE00000000uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B6uLL}, {0xFFFFFFFE00000000uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF08uLL}, {0xFFFFFFFE00000000uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666665uLL}, {0xFFFFFFFE00000000uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000180000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555554uLL, 0x00000002FFFFFFFCuLL}, {0xFFFFFFFE00000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAA8uLL}, {0xFFFFFFFE00000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555554uLL}, {0xFFFFFFFE00000000uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000200000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAACuLL}, {0xFFFFFFFE00000000uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000155555558uLL}, {0xFFFFFFFE00000000uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000004uLL}, {0xFFFFFFFE00000000uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAAE0uLL}, {0xFFFFFFFE00000000uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624AAuLL}, {0xFFFFFFFE00000000uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C416088uLL}, {0xFFFFFFFE00000000uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000249249248uLL}, {0xFFFFFFFE00000000uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000200000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFDuLL}, {0xFFFFFFFE00000000uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000027FFFFFFEuLL}, {0xFFFFFFFE00000000uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000023FFFFFFFuLL}, {0xFFFFFFFE00000000uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000000uLL}, {0xFFFFFFFE00000000uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF0000001uLL}, {0xFFFFFFFE00000000uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000002uLL}, {0xFFFFFFFE00000000uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000003uLL}, {0xFFFFFFFE00000000uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000010uLL}, {0xFFFFFFFE00000000uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE092uLL}, {0xFFFFFFFE00000000uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA9780uLL}, {0xFFFFFFFE00000000uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0F8uLL}, {0xFFFFFFFE00000000uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000200000000uLL}, {0xFFFFFFFE00000000uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D2AuLL}, {0xFFFFFFFE00000000uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E1CuLL}, {0xFFFFFFFE00000000uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F0EuLL}, {0xFFFFFFFE00000000uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA00000000uLL}, {0xFFFFFFFE00000000uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFDEuLL}, {0xFFFFFFFE00000000uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFBCuLL}, {0xFFFFFFFE00000000uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF9AuLL}, {0xFFFFFFFE00000000uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDE0uLL}, {0xFFFFFFFE00000000uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6CCuLL}, {0xFFFFFFFE00000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE158uLL}, {0xFFFFFFFE00000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000022uLL}, {0xFFFFFFFE00000000uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B900000000uLL}, {0xFFFFFFFE00000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000066uLL}, {0xFFFFFFFE00000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000044uLL}, {0xFFFFFFFE00000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000022uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334200000000uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFDDuLL}, {0xFFFFFFFE00000000uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFBAuLL}, {0xFFFFFFFE00000000uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF97uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDD0uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491D2uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333344uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000023uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333080000000uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F00000069uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000046uLL}, {0xFFFFFFFE00000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000023uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF0uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB06uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851ECuLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFE00000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFE00000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFE00000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFE00000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFDuLL}, {0xFFFFFFFE00000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF0uLL}, {0xFFFFFFFE00000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB06uLL}, {0xFFFFFFFE00000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851ECuLL}, {0xFFFFFFFE00000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFE00000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000000uLL}, {0xFFFFFFFE00000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFE00000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFE00000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000001uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF0uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB06uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851ECuLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000000uLL}, {0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000001uLL, 0x0000000000000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x0000000000000003uLL, 0x55555554AAAAAAABuLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000001uLL, 0x0000000000000010uLL, 0x0FFFFFFFE0000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0357uLL}, {0xFFFFFFFE00000001uLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11DDuLL}, {0xFFFFFFFE00000001uLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFE00000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000001uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000004uLL}, {0xFFFFFFFE00000001uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000009uLL}, {0xFFFFFFFE00000001uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000001uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x0000000000000121uLL}, {0xFFFFFFFE00000001uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89221DuLL}, {0xFFFFFFFE00000001uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C32121uLL}, {0xFFFFFFFE00000001uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAAAuLL}, {0xFFFFFFFE00000001uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000080000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFE00000001uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE00000001uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0xFFFFFFFE00000001uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000003uLL}, {0xFFFFFFFE00000001uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000005uLL}, {0xFFFFFFFE00000001uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000007uLL}, {0xFFFFFFFE00000001uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000000000051uLL}, {0xFFFFFFFE00000001uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B7uLL}, {0xFFFFFFFE00000001uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF09uLL}, {0xFFFFFFFE00000001uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666666uLL}, {0xFFFFFFFE00000001uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000180000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAA9uLL}, {0xFFFFFFFE00000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555555uLL}, {0xFFFFFFFE00000001uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000200000001uLL}, {0xFFFFFFFE00000001uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAADuLL}, {0xFFFFFFFE00000001uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000155555559uLL}, {0xFFFFFFFE00000001uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000005uLL}, {0xFFFFFFFE00000001uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAAE1uLL}, {0xFFFFFFFE00000001uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624ABuLL}, {0xFFFFFFFE00000001uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C416089uLL}, {0xFFFFFFFE00000001uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000249249249uLL}, {0xFFFFFFFE00000001uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000200000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFEuLL}, {0xFFFFFFFE00000001uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFE00000001uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000240000000uLL}, {0xFFFFFFFE00000001uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000001uLL}, {0xFFFFFFFE00000001uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF0000002uLL}, {0xFFFFFFFE00000001uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000003uLL}, {0xFFFFFFFE00000001uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000004uLL}, {0xFFFFFFFE00000001uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000011uLL}, {0xFFFFFFFE00000001uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE093uLL}, {0xFFFFFFFE00000001uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA9781uLL}, {0xFFFFFFFE00000001uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0F9uLL}, {0xFFFFFFFE00000001uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000200000001uLL}, {0xFFFFFFFE00000001uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D2BuLL}, {0xFFFFFFFE00000001uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E1DuLL}, {0xFFFFFFFE00000001uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F0FuLL}, {0xFFFFFFFE00000001uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA00000001uLL}, {0xFFFFFFFE00000001uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFDFuLL}, {0xFFFFFFFE00000001uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFBDuLL}, {0xFFFFFFFE00000001uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF9BuLL}, {0xFFFFFFFE00000001uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDE1uLL}, {0xFFFFFFFE00000001uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6CDuLL}, {0xFFFFFFFE00000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE159uLL}, {0xFFFFFFFE00000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000023uLL}, {0xFFFFFFFE00000001uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B900000001uLL}, {0xFFFFFFFE00000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000067uLL}, {0xFFFFFFFE00000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000045uLL}, {0xFFFFFFFE00000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000023uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334200000001uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFDEuLL}, {0xFFFFFFFE00000001uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFBBuLL}, {0xFFFFFFFE00000001uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF98uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDD1uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491D3uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333345uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000024uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333080000001uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F0000006AuLL}, {0xFFFFFFFE00000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000047uLL}, {0xFFFFFFFE00000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000024uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF1uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB07uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EDuLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000004uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFE00000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFE00000001uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE00000001uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFE00000001uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFE00000001uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF1uLL}, {0xFFFFFFFE00000001uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB07uLL}, {0xFFFFFFFE00000001uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EDuLL}, {0xFFFFFFFE00000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFE00000001uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFE00000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000004uLL}, {0xFFFFFFFE00000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFE00000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000002uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF1uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB07uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EDuLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000001uLL}, {0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000002uLL, 0x0000000000000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000002uLL, 0x0000000000000003uLL, 0x55555554AAAAAAABuLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000002uLL, 0x0000000000000010uLL, 0x0FFFFFFFE0000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0358uLL}, {0xFFFFFFFE00000002uLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11DEuLL}, {0xFFFFFFFE00000002uLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000005uLL}, {0xFFFFFFFE00000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000002uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000005uLL}, {0xFFFFFFFE00000002uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000AuLL}, {0xFFFFFFFE00000002uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x0000000000000011uLL}, {0xFFFFFFFE00000002uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x0000000000000122uLL}, {0xFFFFFFFE00000002uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89221EuLL}, {0xFFFFFFFE00000002uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C32122uLL}, {0xFFFFFFFE00000002uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAABuLL}, {0xFFFFFFFE00000002uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000080000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFE00000002uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL}, {0xFFFFFFFE00000002uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0xFFFFFFFE00000002uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000004uLL}, {0xFFFFFFFE00000002uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000006uLL}, {0xFFFFFFFE00000002uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000008uLL}, {0xFFFFFFFE00000002uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000000000052uLL}, {0xFFFFFFFE00000002uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B8uLL}, {0xFFFFFFFE00000002uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF0AuLL}, {0xFFFFFFFE00000002uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666667uLL}, {0xFFFFFFFE00000002uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000180000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAAAuLL}, {0xFFFFFFFE00000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555556uLL}, {0xFFFFFFFE00000002uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000200000002uLL}, {0xFFFFFFFE00000002uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAAEuLL}, {0xFFFFFFFE00000002uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000015555555AuLL}, {0xFFFFFFFE00000002uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000006uLL}, {0xFFFFFFFE00000002uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAAE2uLL}, {0xFFFFFFFE00000002uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624ACuLL}, {0xFFFFFFFE00000002uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C41608AuLL}, {0xFFFFFFFE00000002uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x000000024924924AuLL}, {0xFFFFFFFE00000002uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000200000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFFuLL}, {0xFFFFFFFE00000002uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000280000000uLL}, {0xFFFFFFFE00000002uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000240000001uLL}, {0xFFFFFFFE00000002uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000002uLL}, {0xFFFFFFFE00000002uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF0000003uLL}, {0xFFFFFFFE00000002uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000004uLL}, {0xFFFFFFFE00000002uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000005uLL}, {0xFFFFFFFE00000002uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000012uLL}, {0xFFFFFFFE00000002uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE094uLL}, {0xFFFFFFFE00000002uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA9782uLL}, {0xFFFFFFFE00000002uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0FAuLL}, {0xFFFFFFFE00000002uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000200000002uLL}, {0xFFFFFFFE00000002uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D2CuLL}, {0xFFFFFFFE00000002uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E1EuLL}, {0xFFFFFFFE00000002uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F10uLL}, {0xFFFFFFFE00000002uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA00000002uLL}, {0xFFFFFFFE00000002uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFE0uLL}, {0xFFFFFFFE00000002uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFBEuLL}, {0xFFFFFFFE00000002uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF9CuLL}, {0xFFFFFFFE00000002uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDE2uLL}, {0xFFFFFFFE00000002uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6CEuLL}, {0xFFFFFFFE00000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE15AuLL}, {0xFFFFFFFE00000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000024uLL}, {0xFFFFFFFE00000002uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B900000002uLL}, {0xFFFFFFFE00000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000068uLL}, {0xFFFFFFFE00000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000046uLL}, {0xFFFFFFFE00000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000024uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334200000002uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFDFuLL}, {0xFFFFFFFE00000002uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFBCuLL}, {0xFFFFFFFE00000002uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF99uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDD2uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491D4uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333346uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000025uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333080000002uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F0000006BuLL}, {0xFFFFFFFE00000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000048uLL}, {0xFFFFFFFE00000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000025uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF2uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB08uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EEuLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000003uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000005uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000004uLL}, {0xFFFFFFFE00000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFE00000002uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFE00000002uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE00000002uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFE00000002uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF2uLL}, {0xFFFFFFFE00000002uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB08uLL}, {0xFFFFFFFE00000002uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EEuLL}, {0xFFFFFFFE00000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000003uLL}, {0xFFFFFFFE00000002uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFE00000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000005uLL}, {0xFFFFFFFE00000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000004uLL}, {0xFFFFFFFE00000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000003uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF2uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB08uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EEuLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000002uLL}, {0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000003uLL, 0x0000000000000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000003uLL, 0x0000000000000003uLL, 0x55555554AAAAAAABuLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000003uLL, 0x0000000000000010uLL, 0x0FFFFFFFE0000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0359uLL}, {0xFFFFFFFE00000003uLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11DFuLL}, {0xFFFFFFFE00000003uLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000006uLL}, {0xFFFFFFFE00000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000003uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000006uLL}, {0xFFFFFFFE00000003uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000BuLL}, {0xFFFFFFFE00000003uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x0000000000000012uLL}, {0xFFFFFFFE00000003uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x0000000000000123uLL}, {0xFFFFFFFE00000003uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89221FuLL}, {0xFFFFFFFE00000003uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C32123uLL}, {0xFFFFFFFE00000003uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAACuLL}, {0xFFFFFFFE00000003uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000080000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000180000000uLL}, {0xFFFFFFFE00000003uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL}, {0xFFFFFFFE00000003uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0xFFFFFFFE00000003uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000005uLL}, {0xFFFFFFFE00000003uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000007uLL}, {0xFFFFFFFE00000003uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000009uLL}, {0xFFFFFFFE00000003uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000000000053uLL}, {0xFFFFFFFE00000003uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4B9uLL}, {0xFFFFFFFE00000003uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF0BuLL}, {0xFFFFFFFE00000003uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666668uLL}, {0xFFFFFFFE00000003uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000180000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAABuLL}, {0xFFFFFFFE00000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555557uLL}, {0xFFFFFFFE00000003uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000200000003uLL}, {0xFFFFFFFE00000003uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAAAFuLL}, {0xFFFFFFFE00000003uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000015555555BuLL}, {0xFFFFFFFE00000003uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000007uLL}, {0xFFFFFFFE00000003uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAAE3uLL}, {0xFFFFFFFE00000003uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624ADuLL}, {0xFFFFFFFE00000003uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C41608BuLL}, {0xFFFFFFFE00000003uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x000000024924924BuLL}, {0xFFFFFFFE00000003uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000200000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002C0000000uLL}, {0xFFFFFFFE00000003uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000280000001uLL}, {0xFFFFFFFE00000003uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000240000002uLL}, {0xFFFFFFFE00000003uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000003uLL}, {0xFFFFFFFE00000003uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF0000004uLL}, {0xFFFFFFFE00000003uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000005uLL}, {0xFFFFFFFE00000003uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000006uLL}, {0xFFFFFFFE00000003uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000013uLL}, {0xFFFFFFFE00000003uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE095uLL}, {0xFFFFFFFE00000003uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA9783uLL}, {0xFFFFFFFE00000003uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E0FBuLL}, {0xFFFFFFFE00000003uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000200000003uLL}, {0xFFFFFFFE00000003uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D2DuLL}, {0xFFFFFFFE00000003uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E1FuLL}, {0xFFFFFFFE00000003uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F11uLL}, {0xFFFFFFFE00000003uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA00000003uLL}, {0xFFFFFFFE00000003uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFE1uLL}, {0xFFFFFFFE00000003uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFBFuLL}, {0xFFFFFFFE00000003uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFF9DuLL}, {0xFFFFFFFE00000003uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDE3uLL}, {0xFFFFFFFE00000003uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6CFuLL}, {0xFFFFFFFE00000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE15BuLL}, {0xFFFFFFFE00000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000025uLL}, {0xFFFFFFFE00000003uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B900000003uLL}, {0xFFFFFFFE00000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000069uLL}, {0xFFFFFFFE00000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000047uLL}, {0xFFFFFFFE00000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000025uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334200000003uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFE0uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFBDuLL}, {0xFFFFFFFE00000003uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFF9AuLL}, {0xFFFFFFFE00000003uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDD3uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491D5uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333347uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000026uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333080000003uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F0000006CuLL}, {0xFFFFFFFE00000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000049uLL}, {0xFFFFFFFE00000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000026uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF3uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB09uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EFuLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000004uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000003uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000006uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000005uLL}, {0xFFFFFFFE00000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000004uLL}, {0xFFFFFFFE00000003uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFE00000003uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFE00000003uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE00000003uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFF3uLL}, {0xFFFFFFFE00000003uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB09uLL}, {0xFFFFFFFE00000003uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851EFuLL}, {0xFFFFFFFE00000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000004uLL}, {0xFFFFFFFE00000003uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000003uLL}, {0xFFFFFFFE00000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000006uLL}, {0xFFFFFFFE00000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000005uLL}, {0xFFFFFFFE00000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000004uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF3uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB09uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EFuLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000004uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000006uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000003uLL}, {0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000010uLL, 0x0000000000000002uLL, 0x7FFFFFFF00000008uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000010uLL, 0x0000000000000003uLL, 0x55555554AAAAAAB0uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000010uLL, 0x0000000000000010uLL, 0x0FFFFFFFE0000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000010uLL, 0x00000000078644FAuLL, 0x0000002205B17AB9uLL, 0x00000000003F0366uLL}, {0xFFFFFFFE00000010uLL, 0x000000000747AE14uLL, 0x000000232A32A535uLL, 0x00000000030E11ECuLL}, {0xFFFFFFFE00000010uLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000000000013uLL}, {0xFFFFFFFE00000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFE00000010uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000013uLL}, {0xFFFFFFFE00000010uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000018uLL}, {0xFFFFFFFE00000010uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000000000001FuLL}, {0xFFFFFFFE00000010uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x0000000000000130uLL}, {0xFFFFFFFE00000010uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000AA89222CuLL}, {0xFFFFFFFE00000010uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x0000000048C32130uLL}, {0xFFFFFFFE00000010uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000012AAAAAB9uLL}, {0xFFFFFFFE00000010uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000080000010uLL}, {0xFFFFFFFE00000010uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000018000000DuLL}, {0xFFFFFFFE00000010uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000010000000EuLL}, {0xFFFFFFFE00000010uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000008000000FuLL}, {0xFFFFFFFE00000010uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x0000000180000012uLL}, {0xFFFFFFFE00000010uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000100000014uLL}, {0xFFFFFFFE00000010uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000080000016uLL}, {0xFFFFFFFE00000010uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000000000060uLL}, {0xFFFFFFFE00000010uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000004A8EC4C6uLL}, {0xFFFFFFFE00000010uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006560EF18uLL}, {0xFFFFFFFE00000010uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001E6666675uLL}, {0xFFFFFFFE00000010uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000180000010uLL}, {0xFFFFFFFE00000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000000000000FuLL}, {0xFFFFFFFE00000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002AAAAAAB8uLL}, {0xFFFFFFFE00000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x0000000255555564uLL}, {0xFFFFFFFE00000010uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000200000010uLL}, {0xFFFFFFFE00000010uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001AAAAAABCuLL}, {0xFFFFFFFE00000010uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000155555568uLL}, {0xFFFFFFFE00000010uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000100000014uLL}, {0xFFFFFFFE00000010uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002AAAAAAF0uLL}, {0xFFFFFFFE00000010uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x000000023FA624BAuLL}, {0xFFFFFFFE00000010uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000000C416098uLL}, {0xFFFFFFFE00000010uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000249249258uLL}, {0xFFFFFFFE00000010uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000200000010uLL}, {0xFFFFFFFE00000010uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002C000000DuLL}, {0xFFFFFFFE00000010uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000028000000EuLL}, {0xFFFFFFFE00000010uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000024000000FuLL}, {0xFFFFFFFE00000010uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000010uLL}, {0xFFFFFFFE00000010uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF0000011uLL}, {0xFFFFFFFE00000010uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE0000012uLL}, {0xFFFFFFFE00000010uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD0000013uLL}, {0xFFFFFFFE00000010uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D00000020uLL}, {0xFFFFFFFE00000010uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000001FFFDE0A2uLL}, {0xFFFFFFFE00000010uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000447AA9790uLL}, {0xFFFFFFFE00000010uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000020F83E108uLL}, {0xFFFFFFFE00000010uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000200000010uLL}, {0xFFFFFFFE00000010uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000102D2D2D3AuLL}, {0xFFFFFFFE00000010uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000101E1E1E2CuLL}, {0xFFFFFFFE00000010uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000100F0F0F1EuLL}, {0xFFFFFFFE00000010uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA00000010uLL}, {0xFFFFFFFE00000010uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFEEuLL}, {0xFFFFFFFE00000010uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFCCuLL}, {0xFFFFFFFE00000010uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFFAAuLL}, {0xFFFFFFFE00000010uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6C9FFFFFDF0uLL}, {0xFFFFFFFE00000010uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9002AD6DCuLL}, {0xFFFFFFFE00000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9087AE168uLL}, {0xFFFFFFFE00000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B900000032uLL}, {0xFFFFFFFE00000010uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B900000010uLL}, {0xFFFFFFFE00000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A800000076uLL}, {0xFFFFFFFE00000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A800000054uLL}, {0xFFFFFFFE00000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A800000032uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334200000010uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333341FFFFFFEDuLL}, {0xFFFFFFFE00000010uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333341FFFFFFCAuLL}, {0xFFFFFFFE00000010uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333341FFFFFFA7uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333341FFFFFDE0uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340F8A491E2uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334101333354uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333080000033uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333080000010uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F00000079uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F00000056uLL}, {0xFFFFFFFE00000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F00000033uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000000000000EuLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000000000000CuLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000000000000AuLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB16uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851FCuLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000011uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000010uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000013uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000012uLL}, {0xFFFFFFFE00000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000011uLL}, {0xFFFFFFFE00000010uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE0000000FuLL}, {0xFFFFFFFE00000010uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE0000000EuLL}, {0xFFFFFFFE00000010uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE0000000DuLL}, {0xFFFFFFFE00000010uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE00000010uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDF879BB16uLL}, {0xFFFFFFFE00000010uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFDF8B851FCuLL}, {0xFFFFFFFE00000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000011uLL}, {0xFFFFFFFE00000010uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD80000010uLL}, {0xFFFFFFFE00000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000013uLL}, {0xFFFFFFFE00000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000012uLL}, {0xFFFFFFFE00000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD00000011uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000100000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000010000000FuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000010000000EuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000010000000DuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB16uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851FCuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000011uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000080000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000013uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000012uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000011uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE00000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE00000010uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000000000002uLL, 0x7FFFFFFF03C3227DuLL, 0x0000000000000000uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000000000003uLL, 0x55555554AD2CC1A8uLL, 0x0000000000000002uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000000000010uLL, 0x0FFFFFFFE078644FuLL, 0x000000000000000AuLL}, {0xFFFFFFFE078644FAuLL, 0x00000000078644FAuLL, 0x0000002205B17ABAuLL, 0x00000000003F0356uLL}, {0xFFFFFFFE078644FAuLL, 0x000000000747AE14uLL, 0x000000232A32A536uLL, 0x00000000034CA8C2uLL}, {0xFFFFFFFE078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x00000000078644FDuLL}, {0xFFFFFFFE078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000078644F9uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x00000000078644FDuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000007864502uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x0000000007864509uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x000000000786461AuLL}, {0xFFFFFFFE078644FAuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000B20F6716uLL}, {0xFFFFFFFE078644FAuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x000000005049661AuLL}, {0xFFFFFFFE078644FAuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x000000013230EFA3uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x00000000878644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x00000001878644F7uLL}, {0xFFFFFFFE078644FAuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000001078644F8uLL}, {0xFFFFFFFE078644FAuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000000878644F9uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x00000001878644FCuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x00000001078644FEuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000087864500uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000000786454AuLL}, {0xFFFFFFFE078644FAuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x00000000521509B0uLL}, {0xFFFFFFFE078644FAuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006CE73402uLL}, {0xFFFFFFFE078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001EDECAB5FuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x00000001878644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000000078644F9uLL}, {0xFFFFFFFE078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002B230EFA2uLL}, {0xFFFFFFFE078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x000000025CDB9A4EuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000002078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001B230EFA6uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000015CDB9A52uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x00000001078644FEuLL}, {0xFFFFFFFE078644FAuLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002B230EFDAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x00000002472C69A4uLL}, {0xFFFFFFFE078644FAuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x0000000013C7A582uLL}, {0xFFFFFFFE078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000250AAD742uLL}, {0xFFFFFFFE078644FAuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000002078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002C78644F7uLL}, {0xFFFFFFFE078644FAuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000002878644F8uLL}, {0xFFFFFFFE078644FAuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000002478644F9uLL}, {0xFFFFFFFE078644FAuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF78644FBuLL}, {0xFFFFFFFE078644FAuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE78644FCuLL}, {0xFFFFFFFE078644FAuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD78644FDuLL}, {0xFFFFFFFE078644FAuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D0786450AuLL}, {0xFFFFFFFE078644FAuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000020784258CuLL}, {0xFFFFFFFE078644FAuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x000000044F30DC7AuLL}, {0xFFFFFFFE078644FAuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x00000002170A25F2uLL}, {0xFFFFFFFE078644FAuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000002078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x0000001034B37224uLL}, {0xFFFFFFFE078644FAuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x0000001025A46316uLL}, {0xFFFFFFFE078644FAuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x0000001016955408uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CA078644D8uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CA078644B6uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CA07864494uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CA078642DAuLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C907B11BC6uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C910012652uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B90786451CuLL}, {0xFFFFFFFE078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B9078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A807864560uLL}, {0xFFFFFFFE078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A80786453EuLL}, {0xFFFFFFFE078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A80786451CuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333342078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342078644D7uLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342078644B4uLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x0133334207864491uLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342078642CAuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341002AD6CCuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334108B9783EuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x013333308786451DuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x01333330878644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F07864563uLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F07864540uLL}, {0xFFFFFFFE078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F0786451DuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000000078644F8uLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000078644F6uLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000078644F4uLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000078644DAuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF003E96E6uLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE878644FBuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE878644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FDuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FCuLL}, {0xFFFFFFFE078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FBuLL}, {0xFFFFFFFE078644FAuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644F9uLL}, {0xFFFFFFFE078644FAuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644F8uLL}, {0xFFFFFFFE078644FAuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644F7uLL}, {0xFFFFFFFE078644FAuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE078644EAuLL}, {0xFFFFFFFE078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE003E96E6uLL}, {0xFFFFFFFE078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD878644FBuLL}, {0xFFFFFFFE078644FAuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD878644FAuLL}, {0xFFFFFFFE078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FDuLL}, {0xFFFFFFFE078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FCuLL}, {0xFFFFFFFE078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD078644FBuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000001078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000001078644F9uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000001078644F8uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001078644F7uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001078644EAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001003E96E6uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x00000000878644FBuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x00000000878644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000078644FDuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000078644FCuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000078644FBuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE078644FAuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000000uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000000000002uLL, 0x7FFFFFFF03A3D70AuLL, 0x0000000000000000uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000000000003uLL, 0x55555554AD17E4B1uLL, 0x0000000000000001uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000000000010uLL, 0x0FFFFFFFE0747AE1uLL, 0x0000000000000004uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000000078644FAuLL, 0x0000002205B17ABAuLL, 0x0000000000006C70uLL}, {0xFFFFFFFE0747AE14uLL, 0x000000000747AE14uLL, 0x000000232A32A536uLL, 0x00000000030E11DCuLL}, {0xFFFFFFFE0747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000200000000uLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x000000000747AE17uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE17uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x000000000747AE1CuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000000747AE23uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x000000000747AF34uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5AuLL, 0x00000000B1D0D030uLL}, {0xFFFFFFFE0747AE14uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x00000000500ACF34uLL}, {0xFFFFFFFE0747AE14uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAA9uLL, 0x0000000131F258BDuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000008747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x000000018747AE11uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000010747AE12uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000008747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL, 0x000000018747AE16uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x000000010747AE18uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x000000008747AE1AuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000000747AE64uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x0000000051D672CAuLL}, {0xFFFFFFFE0747AE14uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000006CA89D1CuLL}, {0xFFFFFFFE0747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x00000001EDAE1479uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000018747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000000747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555554uLL, 0x00000002B1F258BCuLL}, {0xFFFFFFFE0747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x000000025C9D0368uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x000000020747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000001B1F258C0uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000015C9D036CuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x000000010747AE18uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000300000010uLL, 0x0000000055555552uLL, 0x00000002B1F258F4uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x0000000246EDD2BEuLL}, {0xFFFFFFFE0747AE14uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x0000000013890E9CuLL}, {0xFFFFFFFE0747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000002506C405CuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x000000020747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000002C747AE11uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000028747AE12uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000024747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000DF747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000DE747AE16uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000DD747AE17uLL}, {0xFFFFFFFE0747AE14uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D0747AE24uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x0000000207458EA6uLL}, {0xFFFFFFFE0747AE14uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x000000044EF24594uLL}, {0xFFFFFFFE0747AE14uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x0000000216CB8F0CuLL}, {0xFFFFFFFE0747AE14uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x000000020747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x000000103474DB3EuLL}, {0xFFFFFFFE0747AE14uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000102565CC30uLL}, {0xFFFFFFFE0747AE14uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000101656BD22uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CA0747ADF2uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CA0747ADD0uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CA0747ADAEuLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CA0747ABF4uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9077284E0uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C90FC28F6CuLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B90747AE36uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B90747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A80747AE7AuLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A80747AE58uLL}, {0xFFFFFFFE0747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A80747AE36uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x013333420747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333420747ADF1uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333420747ADCEuLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333420747ADABuLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333420747ABE4uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333340FFEC3FE6uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x01333341087AE158uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x013333308747AE37uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333308747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F0747AE7DuLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F0747AE5AuLL}, {0xFFFFFFFE0747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F0747AE37uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000000747AE12uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000000747AE10uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000000747AE0EuLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x000000000747ADF4uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFC1691AuLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE8747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE8747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE17uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE16uLL}, {0xFFFFFFFE0747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE12uLL}, {0xFFFFFFFE0747AE14uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE11uLL}, {0xFFFFFFFE0747AE14uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE04uLL}, {0xFFFFFFFE0747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFC1691AuLL}, {0xFFFFFFFE0747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE0747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD8747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFD8747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE17uLL}, {0xFFFFFFFE0747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE16uLL}, {0xFFFFFFFE0747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD0747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x000000010747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000010747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000010747AE12uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000010747AE11uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000010747AE04uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000000FFC1691AuLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000008747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000008747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x000000000747AE17uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x000000000747AE16uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x000000000747AE15uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE0747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE0747AE14uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000002uLL, 0x7FFFFFFF3FFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000003uLL, 0x55555554D5555555uLL, 0x0000000000000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000010uLL, 0x0FFFFFFFE7FFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000002205B17ACAuLL, 0x0000000000546EBBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000000747AE14uLL, 0x000000232A32A547uLL, 0x000000000003D473uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFCuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000002uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000080000007uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000008000000EuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x000000008000011FuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x000000002302DD21uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x00000000C8C3211FuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x000000002AAAAAA9uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000180000003uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000100000005uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000008000004FuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x00000000CA8EC4B5uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x00000000E560EF07uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x0000000266666664uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x000000002AAAAAA9uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x00000002D5555553uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x000000022AAAAAABuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x00000001D5555557uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000180000003uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x000000002AAAAACFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x00000002BFA624A9uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000008C416087uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000002C9249247uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x000000033FFFFFFCuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000E70000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000E60000001uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000E50000002uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D8000000FuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000027FFDE091uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x00000004C7AA977FuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000028F83E0F7uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x00000010AD2D2D29uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000109E1E1E1BuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000108F0F0F0DuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFFDDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFFBBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFF99uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFDDFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9802AD6CBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9887AE157uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B980000021uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B97FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A880000065uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A880000043uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A880000021uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x013333427FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333427FFFFFDCuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333427FFFFFB9uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333427FFFFF96uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333427FFFFDCFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133334178A491D1uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334181333343uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333100000022uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x01333330FFFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F80000068uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F80000045uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F80000022uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000007FFFFFFBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000007FFFFFF9uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x000000007FFFFFDFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x0000000070F3760BuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x000000007170A3D7uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFCuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFEFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFE7879BB05uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE78B851EBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFCuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFEFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB05uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851EBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE80000000uLL, 0x0000000000000002uLL, 0x7FFFFFFF40000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE80000000uLL, 0x0000000000000003uLL, 0x55555554D5555555uLL, 0x0000000000000001uLL}, {0xFFFFFFFE80000000uLL, 0x0000000000000010uLL, 0x0FFFFFFFE8000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000000078644FAuLL, 0x0000002205B17ACAuLL, 0x0000000000546EBCuLL}, {0xFFFFFFFE80000000uLL, 0x000000000747AE14uLL, 0x000000232A32A547uLL, 0x000000000003D474uLL}, {0xFFFFFFFE80000000uLL, 0x000000007FFFFFFFuLL, 0x0000000200000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE80000000uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000000000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFE80000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x0000000080000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000000uLL}, {0xFFFFFFFE80000000uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000003uLL}, {0xFFFFFFFE80000000uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFCuLL, 0x0000000080000008uLL}, {0xFFFFFFFE80000000uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFBuLL, 0x000000008000000FuLL}, {0xFFFFFFFE80000000uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEEuLL, 0x0000000080000120uLL}, {0xFFFFFFFE80000000uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x000000002302DD22uLL}, {0xFFFFFFFE80000000uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA58uLL, 0x00000000C8C32120uLL}, {0xFFFFFFFE80000000uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x000000002AAAAAAAuLL}, {0xFFFFFFFE80000000uLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x0000000100000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFE80000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0xFFFFFFFE80000000uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFE80000000uLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000180000004uLL}, {0xFFFFFFFE80000000uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000100000006uLL}, {0xFFFFFFFE80000000uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000080000050uLL}, {0xFFFFFFFE80000000uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x00000000CA8EC4B6uLL}, {0xFFFFFFFE80000000uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x00000000E560EF08uLL}, {0xFFFFFFFE80000000uLL, 0x000000027FFFFFFFuLL, 0x0000000066666665uLL, 0x0000000266666665uLL}, {0xFFFFFFFE80000000uLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x0000000200000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x000000002AAAAAAAuLL}, {0xFFFFFFFE80000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555554uLL, 0x00000002D5555554uLL}, {0xFFFFFFFE80000000uLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x0000000280000000uLL}, {0xFFFFFFFE80000000uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x000000022AAAAAACuLL}, {0xFFFFFFFE80000000uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x00000001D5555558uLL}, {0xFFFFFFFE80000000uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000180000004uLL}, {0xFFFFFFFE80000000uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x000000002AAAAAD0uLL}, {0xFFFFFFFE80000000uLL, 0x00000003078644FAuLL, 0x0000000054816147uLL, 0x00000002BFA624AAuLL}, {0xFFFFFFFE80000000uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000008C416088uLL}, {0xFFFFFFFE80000000uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000002C9249248uLL}, {0xFFFFFFFE80000000uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000280000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x000000033FFFFFFDuLL}, {0xFFFFFFFE80000000uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000002FFFFFFFEuLL}, {0xFFFFFFFE80000000uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000002BFFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000E80000000uLL}, {0xFFFFFFFE80000000uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000E70000001uLL}, {0xFFFFFFFE80000000uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000E60000002uLL}, {0xFFFFFFFE80000000uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000E50000003uLL}, {0xFFFFFFFE80000000uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000D80000010uLL}, {0xFFFFFFFE80000000uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000027FFDE092uLL}, {0xFFFFFFFE80000000uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x00000004C7AA9780uLL}, {0xFFFFFFFE80000000uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000028F83E0F8uLL}, {0xFFFFFFFE80000000uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000280000000uLL}, {0xFFFFFFFE80000000uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0EuLL, 0x00000010AD2D2D2AuLL}, {0xFFFFFFFE80000000uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0EuLL, 0x000000109E1E1E1CuLL}, {0xFFFFFFFE80000000uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0EuLL, 0x000000108F0F0F0EuLL}, {0xFFFFFFFE80000000uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CA80000000uLL}, {0xFFFFFFFE80000000uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFFDEuLL}, {0xFFFFFFFE80000000uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFFBCuLL}, {0xFFFFFFFE80000000uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFF9AuLL}, {0xFFFFFFFE80000000uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CA7FFFFDE0uLL}, {0xFFFFFFFE80000000uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6C9802AD6CCuLL}, {0xFFFFFFFE80000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6C9887AE158uLL}, {0xFFFFFFFE80000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6B980000022uLL}, {0xFFFFFFFE80000000uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B980000000uLL}, {0xFFFFFFFE80000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A880000066uLL}, {0xFFFFFFFE80000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A880000044uLL}, {0xFFFFFFFE80000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A880000022uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334280000000uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333427FFFFFDDuLL}, {0xFFFFFFFE80000000uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333427FFFFFBAuLL}, {0xFFFFFFFE80000000uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333427FFFFF97uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333427FFFFDD0uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133334178A491D2uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334181333344uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333100000023uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333100000000uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133331F80000069uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133331F80000046uLL}, {0xFFFFFFFE80000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133331F80000023uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000080000000uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000007FFFFFFCuLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000007FFFFFFAuLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x000000007FFFFFE0uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x0000000070F3760CuLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x000000007170A3D8uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000003uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFE80000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFE80000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFE80000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFDuLL}, {0xFFFFFFFE80000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFF0uLL}, {0xFFFFFFFE80000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFE7879BB06uLL}, {0xFFFFFFFE80000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFE78B851ECuLL}, {0xFFFFFFFE80000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFE80000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFE80000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000003uLL}, {0xFFFFFFFE80000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000002uLL}, {0xFFFFFFFE80000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFD80000001uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFF0uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB06uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851ECuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFE80000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFE80000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000002uLL, 0x7FFFFFFF7FFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000003uLL, 0x55555554FFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000010uLL, 0x0FFFFFFFEFFFFFFFuLL, 0x000000000000000DuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA1FuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x000000000441451DuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000003uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x0000000000000009uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x000000000000010DuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD1FuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B7309uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAA7uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000200000002uLL, 0x000000007FFFFFFEuLL, 0x0000000200000001uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000003uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000010000004DuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B3uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF05uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666663uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000027FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAA7uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555552uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAA9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000255555555uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000001uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAACDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFADuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C416085uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000349249245uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFAuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000037FFFFFFBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000033FFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000EFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EEFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EDFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E0000000DuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE08FuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA977DuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0F5uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D2AuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E1BuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F0CuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFDBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFB9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF97uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDDDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6C9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE155uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA0000001FuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B9FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000063uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000041uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A90000001FuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333342FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFDAuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFB7uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF94uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDCDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491CFuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333341uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000020uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333317FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332000000066uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000043uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000020uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF7uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFDDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F37609uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D5uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFAuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFEDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB03uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851E9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFAuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB03uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851E9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000003uLL, 0x55555554FFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000010uLL, 0x0FFFFFFFEFFFFFFFuLL, 0x000000000000000EuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA20uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x000000000441451EuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000004uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000004uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000AuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x000000000000010EuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD20uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B730AuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAA8uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000004uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000010000004EuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B4uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF06uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666664uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000027FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAA8uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555553uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000002FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAAAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000255555556uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000002uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAACEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFAEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C416086uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000349249246uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000002FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000037FFFFFFCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000033FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000EFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EEFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000001uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E0000000EuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE090uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA977EuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0F6uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000002FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D2BuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E1CuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F0DuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFDCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFBAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF98uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDDEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6CAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE156uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000020uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B9FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000064uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000042uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000020uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333342FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFDBuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFB8uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF95uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDCEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491D0uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333342uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000021uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333317FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332000000067uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000044uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000021uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF8uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFDEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760AuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D6uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFEEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB04uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFDFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB04uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000003uLL, 0x55555554FFFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000010uLL, 0x0FFFFFFFEFFFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA21uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x000000000441451FuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFDuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000005uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000005uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000BuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x000000000000010FuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD21uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B730BuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAA9uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000180000000uLL, 0x00000000AAAAAAA9uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000005uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000010000004FuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B5uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF07uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666665uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000066666665uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAA9uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555554uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000055555554uLL, 0x00000002FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAABuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000255555557uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000003uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAACFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFAFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C416087uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000349249247uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000002FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000037FFFFFFDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000033FFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000EFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF0000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000002uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E0000000FuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE091uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA977FuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0F7uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000002FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D2CuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E1DuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F0EuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFDDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFBBuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF99uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDDFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6CBuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE157uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000021uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6B9FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000065uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000043uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000021uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333342FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFDCuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFB9uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF96uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDCFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491D1uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333343uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000022uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333317FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332000000068uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000045uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000022uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF9uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFDFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760BuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D7uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFEFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB05uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EBuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE7FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB05uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EBuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFEFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFEFFFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000000000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000000000003uLL, 0x5555555500000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000000000010uLL, 0x0FFFFFFFF0000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA22uLL}, {0xFFFFFFFF00000000uLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x0000000004414520uLL}, {0xFFFFFFFF00000000uLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000000uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000006uLL}, {0xFFFFFFFF00000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000000uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000006uLL}, {0xFFFFFFFF00000000uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000CuLL}, {0xFFFFFFFF00000000uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x0000000000000110uLL}, {0xFFFFFFFF00000000uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD22uLL}, {0xFFFFFFFF00000000uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B730CuLL}, {0xFFFFFFFF00000000uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAAAuLL}, {0xFFFFFFFF00000000uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0xFFFFFFFF00000000uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000000uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000006uLL}, {0xFFFFFFFF00000000uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000100000050uLL}, {0xFFFFFFFF00000000uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B6uLL}, {0xFFFFFFFF00000000uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF08uLL}, {0xFFFFFFFF00000000uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666666uLL}, {0xFFFFFFFF00000000uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAAAuLL}, {0xFFFFFFFF00000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555555uLL}, {0xFFFFFFFF00000000uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAACuLL}, {0xFFFFFFFF00000000uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000255555558uLL}, {0xFFFFFFFF00000000uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000004uLL}, {0xFFFFFFFF00000000uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAAD0uLL}, {0xFFFFFFFF00000000uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFB0uLL}, {0xFFFFFFFF00000000uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C416088uLL}, {0xFFFFFFFF00000000uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000349249248uLL}, {0xFFFFFFFF00000000uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000300000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFDuLL}, {0xFFFFFFFF00000000uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000037FFFFFFEuLL}, {0xFFFFFFFF00000000uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000033FFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F00000000uLL}, {0xFFFFFFFF00000000uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF0000001uLL}, {0xFFFFFFFF00000000uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000002uLL}, {0xFFFFFFFF00000000uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000003uLL}, {0xFFFFFFFF00000000uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000010uLL}, {0xFFFFFFFF00000000uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE092uLL}, {0xFFFFFFFF00000000uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA9780uLL}, {0xFFFFFFFF00000000uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0F8uLL}, {0xFFFFFFFF00000000uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000300000000uLL}, {0xFFFFFFFF00000000uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D2DuLL}, {0xFFFFFFFF00000000uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E1EuLL}, {0xFFFFFFFF00000000uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F0FuLL}, {0xFFFFFFFF00000000uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB00000000uLL}, {0xFFFFFFFF00000000uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFDEuLL}, {0xFFFFFFFF00000000uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFBCuLL}, {0xFFFFFFFF00000000uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF9AuLL}, {0xFFFFFFFF00000000uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDE0uLL}, {0xFFFFFFFF00000000uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6CCuLL}, {0xFFFFFFFF00000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE158uLL}, {0xFFFFFFFF00000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000022uLL}, {0xFFFFFFFF00000000uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA00000000uLL}, {0xFFFFFFFF00000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000066uLL}, {0xFFFFFFFF00000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000044uLL}, {0xFFFFFFFF00000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000022uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334300000000uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFDDuLL}, {0xFFFFFFFF00000000uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFBAuLL}, {0xFFFFFFFF00000000uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF97uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDD0uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491D2uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333344uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000023uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333180000000uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332000000069uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000046uLL}, {0xFFFFFFFF00000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000023uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFAuLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE0uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760CuLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D8uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000003uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL}, {0xFFFFFFFF00000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFF00000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFF00000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFDuLL}, {0xFFFFFFFF00000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF0uLL}, {0xFFFFFFFF00000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB06uLL}, {0xFFFFFFFF00000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851ECuLL}, {0xFFFFFFFF00000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFF00000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFF00000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFF00000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFF00000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000001uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFF0uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB06uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851ECuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000001uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF0uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB06uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851ECuLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000000uLL}, {0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000001uLL, 0x0000000000000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000000000000003uLL, 0x5555555500000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000000000000010uLL, 0x0FFFFFFFF0000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA23uLL}, {0xFFFFFFFF00000001uLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x0000000004414521uLL}, {0xFFFFFFFF00000001uLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000001uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000007uLL}, {0xFFFFFFFF00000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000001uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000007uLL}, {0xFFFFFFFF00000001uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000DuLL}, {0xFFFFFFFF00000001uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x0000000000000111uLL}, {0xFFFFFFFF00000001uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD23uLL}, {0xFFFFFFFF00000001uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B730DuLL}, {0xFFFFFFFF00000001uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAABuLL}, {0xFFFFFFFF00000001uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000180000000uLL}, {0xFFFFFFFF00000001uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0xFFFFFFFF00000001uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000001uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000007uLL}, {0xFFFFFFFF00000001uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000100000051uLL}, {0xFFFFFFFF00000001uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B7uLL}, {0xFFFFFFFF00000001uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF09uLL}, {0xFFFFFFFF00000001uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666667uLL}, {0xFFFFFFFF00000001uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000001uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAABuLL}, {0xFFFFFFFF00000001uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555556uLL}, {0xFFFFFFFF00000001uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAADuLL}, {0xFFFFFFFF00000001uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000255555559uLL}, {0xFFFFFFFF00000001uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000005uLL}, {0xFFFFFFFF00000001uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAAD1uLL}, {0xFFFFFFFF00000001uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFB1uLL}, {0xFFFFFFFF00000001uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C416089uLL}, {0xFFFFFFFF00000001uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000349249249uLL}, {0xFFFFFFFF00000001uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000300000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFEuLL}, {0xFFFFFFFF00000001uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000037FFFFFFFuLL}, {0xFFFFFFFF00000001uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000340000000uLL}, {0xFFFFFFFF00000001uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F00000001uLL}, {0xFFFFFFFF00000001uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF0000002uLL}, {0xFFFFFFFF00000001uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000003uLL}, {0xFFFFFFFF00000001uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000004uLL}, {0xFFFFFFFF00000001uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000011uLL}, {0xFFFFFFFF00000001uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE093uLL}, {0xFFFFFFFF00000001uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA9781uLL}, {0xFFFFFFFF00000001uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0F9uLL}, {0xFFFFFFFF00000001uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000300000001uLL}, {0xFFFFFFFF00000001uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D2EuLL}, {0xFFFFFFFF00000001uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E1FuLL}, {0xFFFFFFFF00000001uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F10uLL}, {0xFFFFFFFF00000001uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB00000001uLL}, {0xFFFFFFFF00000001uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFDFuLL}, {0xFFFFFFFF00000001uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFBDuLL}, {0xFFFFFFFF00000001uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF9BuLL}, {0xFFFFFFFF00000001uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDE1uLL}, {0xFFFFFFFF00000001uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6CDuLL}, {0xFFFFFFFF00000001uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE159uLL}, {0xFFFFFFFF00000001uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000023uLL}, {0xFFFFFFFF00000001uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA00000001uLL}, {0xFFFFFFFF00000001uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000067uLL}, {0xFFFFFFFF00000001uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000045uLL}, {0xFFFFFFFF00000001uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000023uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334300000001uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFDEuLL}, {0xFFFFFFFF00000001uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFBBuLL}, {0xFFFFFFFF00000001uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF98uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDD1uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491D3uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333345uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000024uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333180000001uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x013333200000006AuLL}, {0xFFFFFFFF00000001uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000047uLL}, {0xFFFFFFFF00000001uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000024uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE1uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760DuLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3D9uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000004uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000003uLL}, {0xFFFFFFFF00000001uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL}, {0xFFFFFFFF00000001uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF00000001uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFF00000001uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFF00000001uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF1uLL}, {0xFFFFFFFF00000001uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB07uLL}, {0xFFFFFFFF00000001uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EDuLL}, {0xFFFFFFFF00000001uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFF00000001uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFF00000001uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000004uLL}, {0xFFFFFFFF00000001uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFF00000001uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000002uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000200000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFF1uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB07uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EDuLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000002uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000180000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000004uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF1uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB07uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EDuLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000001uLL}, {0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000002uLL, 0x0000000000000002uLL, 0x7FFFFFFF80000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000002uLL, 0x0000000000000003uLL, 0x5555555500000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x0000000000000010uLL, 0x0FFFFFFFF0000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA24uLL}, {0xFFFFFFFF00000002uLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x0000000004414522uLL}, {0xFFFFFFFF00000002uLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000002uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000008uLL}, {0xFFFFFFFF00000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000002uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000002uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000008uLL}, {0xFFFFFFFF00000002uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000EuLL}, {0xFFFFFFFF00000002uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x0000000000000112uLL}, {0xFFFFFFFF00000002uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD24uLL}, {0xFFFFFFFF00000002uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B730EuLL}, {0xFFFFFFFF00000002uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAACuLL}, {0xFFFFFFFF00000002uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000180000001uLL}, {0xFFFFFFFF00000002uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000002uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000003uLL}, {0xFFFFFFFF00000002uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000002uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000008uLL}, {0xFFFFFFFF00000002uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000100000052uLL}, {0xFFFFFFFF00000002uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B8uLL}, {0xFFFFFFFF00000002uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF0AuLL}, {0xFFFFFFFF00000002uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666668uLL}, {0xFFFFFFFF00000002uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000002uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAACuLL}, {0xFFFFFFFF00000002uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555557uLL}, {0xFFFFFFFF00000002uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAAEuLL}, {0xFFFFFFFF00000002uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000025555555AuLL}, {0xFFFFFFFF00000002uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000006uLL}, {0xFFFFFFFF00000002uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAAD2uLL}, {0xFFFFFFFF00000002uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFB2uLL}, {0xFFFFFFFF00000002uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C41608AuLL}, {0xFFFFFFFF00000002uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x000000034924924AuLL}, {0xFFFFFFFF00000002uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000300000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFFuLL}, {0xFFFFFFFF00000002uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000380000000uLL}, {0xFFFFFFFF00000002uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000340000001uLL}, {0xFFFFFFFF00000002uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F00000002uLL}, {0xFFFFFFFF00000002uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF0000003uLL}, {0xFFFFFFFF00000002uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000004uLL}, {0xFFFFFFFF00000002uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000005uLL}, {0xFFFFFFFF00000002uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000012uLL}, {0xFFFFFFFF00000002uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE094uLL}, {0xFFFFFFFF00000002uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA9782uLL}, {0xFFFFFFFF00000002uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0FAuLL}, {0xFFFFFFFF00000002uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000300000002uLL}, {0xFFFFFFFF00000002uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D2FuLL}, {0xFFFFFFFF00000002uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E20uLL}, {0xFFFFFFFF00000002uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F11uLL}, {0xFFFFFFFF00000002uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB00000002uLL}, {0xFFFFFFFF00000002uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFE0uLL}, {0xFFFFFFFF00000002uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFBEuLL}, {0xFFFFFFFF00000002uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF9CuLL}, {0xFFFFFFFF00000002uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDE2uLL}, {0xFFFFFFFF00000002uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6CEuLL}, {0xFFFFFFFF00000002uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE15AuLL}, {0xFFFFFFFF00000002uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000024uLL}, {0xFFFFFFFF00000002uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA00000002uLL}, {0xFFFFFFFF00000002uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000068uLL}, {0xFFFFFFFF00000002uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000046uLL}, {0xFFFFFFFF00000002uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000024uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334300000002uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFDFuLL}, {0xFFFFFFFF00000002uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFBCuLL}, {0xFFFFFFFF00000002uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF99uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDD2uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491D4uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333346uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000025uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333180000002uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x013333200000006BuLL}, {0xFFFFFFFF00000002uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000048uLL}, {0xFFFFFFFF00000002uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000025uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE2uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760EuLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3DAuLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000005uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000004uLL}, {0xFFFFFFFF00000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000003uLL}, {0xFFFFFFFF00000002uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFF00000002uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF00000002uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFF00000002uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF2uLL}, {0xFFFFFFFF00000002uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB08uLL}, {0xFFFFFFFF00000002uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EEuLL}, {0xFFFFFFFF00000002uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000003uLL}, {0xFFFFFFFF00000002uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFF00000002uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000005uLL}, {0xFFFFFFFF00000002uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000004uLL}, {0xFFFFFFFF00000002uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000003uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000200000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000200000001uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFF2uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB08uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EEuLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000003uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000180000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000005uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000004uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF2uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB08uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EEuLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000002uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000002uLL}, {0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000003uLL, 0x0000000000000002uLL, 0x7FFFFFFF80000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000003uLL, 0x0000000000000003uLL, 0x5555555500000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000003uLL, 0x0000000000000010uLL, 0x0FFFFFFFF0000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA25uLL}, {0xFFFFFFFF00000003uLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x0000000004414523uLL}, {0xFFFFFFFF00000003uLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000003uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000009uLL}, {0xFFFFFFFF00000003uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000003uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000003uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000009uLL}, {0xFFFFFFFF00000003uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000000FuLL}, {0xFFFFFFFF00000003uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x0000000000000113uLL}, {0xFFFFFFFF00000003uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD25uLL}, {0xFFFFFFFF00000003uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B730FuLL}, {0xFFFFFFFF00000003uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAAADuLL}, {0xFFFFFFFF00000003uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000180000002uLL}, {0xFFFFFFFF00000003uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000003uLL}, {0xFFFFFFFF00000003uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000004uLL}, {0xFFFFFFFF00000003uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000003uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000009uLL}, {0xFFFFFFFF00000003uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000100000053uLL}, {0xFFFFFFFF00000003uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4B9uLL}, {0xFFFFFFFF00000003uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF0BuLL}, {0xFFFFFFFF00000003uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666669uLL}, {0xFFFFFFFF00000003uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000003uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAAADuLL}, {0xFFFFFFFF00000003uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555558uLL}, {0xFFFFFFFF00000003uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAAAFuLL}, {0xFFFFFFFF00000003uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000025555555BuLL}, {0xFFFFFFFF00000003uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000007uLL}, {0xFFFFFFFF00000003uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAAD3uLL}, {0xFFFFFFFF00000003uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFB3uLL}, {0xFFFFFFFF00000003uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C41608BuLL}, {0xFFFFFFFF00000003uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x000000034924924BuLL}, {0xFFFFFFFF00000003uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000300000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003C0000000uLL}, {0xFFFFFFFF00000003uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x0000000380000001uLL}, {0xFFFFFFFF00000003uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x0000000340000002uLL}, {0xFFFFFFFF00000003uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F00000003uLL}, {0xFFFFFFFF00000003uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF0000004uLL}, {0xFFFFFFFF00000003uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000005uLL}, {0xFFFFFFFF00000003uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000006uLL}, {0xFFFFFFFF00000003uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000013uLL}, {0xFFFFFFFF00000003uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE095uLL}, {0xFFFFFFFF00000003uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA9783uLL}, {0xFFFFFFFF00000003uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E0FBuLL}, {0xFFFFFFFF00000003uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000300000003uLL}, {0xFFFFFFFF00000003uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D30uLL}, {0xFFFFFFFF00000003uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E21uLL}, {0xFFFFFFFF00000003uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F12uLL}, {0xFFFFFFFF00000003uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB00000003uLL}, {0xFFFFFFFF00000003uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFE1uLL}, {0xFFFFFFFF00000003uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFBFuLL}, {0xFFFFFFFF00000003uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFF9DuLL}, {0xFFFFFFFF00000003uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDE3uLL}, {0xFFFFFFFF00000003uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6CFuLL}, {0xFFFFFFFF00000003uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE15BuLL}, {0xFFFFFFFF00000003uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000025uLL}, {0xFFFFFFFF00000003uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA00000003uLL}, {0xFFFFFFFF00000003uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000069uLL}, {0xFFFFFFFF00000003uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000047uLL}, {0xFFFFFFFF00000003uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000025uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334300000003uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFE0uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFBDuLL}, {0xFFFFFFFF00000003uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFF9AuLL}, {0xFFFFFFFF00000003uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDD3uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491D5uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333347uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000026uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333180000003uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x013333200000006CuLL}, {0xFFFFFFFF00000003uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000049uLL}, {0xFFFFFFFF00000003uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000026uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000100000003uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFE3uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3760FuLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3DBuLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000006uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000005uLL}, {0xFFFFFFFF00000003uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000004uLL}, {0xFFFFFFFF00000003uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL}, {0xFFFFFFFF00000003uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFF00000003uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF00000003uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFF3uLL}, {0xFFFFFFFF00000003uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB09uLL}, {0xFFFFFFFF00000003uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851EFuLL}, {0xFFFFFFFF00000003uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000004uLL}, {0xFFFFFFFF00000003uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000003uLL}, {0xFFFFFFFF00000003uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000006uLL}, {0xFFFFFFFF00000003uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000005uLL}, {0xFFFFFFFF00000003uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000004uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000200000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x0000000200000002uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x0000000200000001uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFF3uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB09uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EFuLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000004uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000180000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000006uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000005uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000004uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000100000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFF3uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB09uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EFuLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000004uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000006uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000005uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000004uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000003uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000003uLL}, {0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000010uLL, 0x0000000000000002uLL, 0x7FFFFFFF80000008uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000010uLL, 0x0000000000000003uLL, 0x5555555500000005uLL, 0x0000000000000001uLL}, {0xFFFFFFFF00000010uLL, 0x0000000000000010uLL, 0x0FFFFFFFF0000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000010uLL, 0x00000000078644FAuLL, 0x0000002205B17ADBuLL, 0x000000000069DA32uLL}, {0xFFFFFFFF00000010uLL, 0x000000000747AE14uLL, 0x000000232A32A558uLL, 0x0000000004414530uLL}, {0xFFFFFFFF00000010uLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x0000000000000012uLL}, {0xFFFFFFFF00000010uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000000000016uLL}, {0xFFFFFFFF00000010uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000000000012uLL}, {0xFFFFFFFF00000010uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000012uLL}, {0xFFFFFFFF00000010uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000016uLL}, {0xFFFFFFFF00000010uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000000001CuLL}, {0xFFFFFFFF00000010uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x0000000000000120uLL}, {0xFFFFFFFF00000010uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000A302DD32uLL}, {0xFFFFFFFF00000010uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000417B731CuLL}, {0xFFFFFFFF00000010uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000AAAAAABAuLL}, {0xFFFFFFFF00000010uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000080000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000018000000FuLL}, {0xFFFFFFFF00000010uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000100000010uLL}, {0xFFFFFFFF00000010uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000080000011uLL}, {0xFFFFFFFF00000010uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000000000012uLL}, {0xFFFFFFFF00000010uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000180000016uLL}, {0xFFFFFFFF00000010uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000100000060uLL}, {0xFFFFFFFF00000010uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x000000014A8EC4C6uLL}, {0xFFFFFFFF00000010uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016560EF18uLL}, {0xFFFFFFFF00000010uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000066666676uLL}, {0xFFFFFFFF00000010uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000010000000FuLL}, {0xFFFFFFFF00000010uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000AAAAAABAuLL}, {0xFFFFFFFF00000010uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000055555565uLL}, {0xFFFFFFFF00000010uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002AAAAAABCuLL}, {0xFFFFFFFF00000010uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x0000000255555568uLL}, {0xFFFFFFFF00000010uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000200000014uLL}, {0xFFFFFFFF00000010uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000AAAAAAE0uLL}, {0xFFFFFFFF00000010uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000381FDFC0uLL}, {0xFFFFFFFF00000010uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000010C416098uLL}, {0xFFFFFFFF00000010uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000349249258uLL}, {0xFFFFFFFF00000010uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x0000000300000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003C000000DuLL}, {0xFFFFFFFF00000010uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000038000000EuLL}, {0xFFFFFFFF00000010uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000034000000FuLL}, {0xFFFFFFFF00000010uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F00000010uLL}, {0xFFFFFFFF00000010uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF0000011uLL}, {0xFFFFFFFF00000010uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE0000012uLL}, {0xFFFFFFFF00000010uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED0000013uLL}, {0xFFFFFFFF00000010uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E00000020uLL}, {0xFFFFFFFF00000010uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000002FFFDE0A2uLL}, {0xFFFFFFFF00000010uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000547AA9790uLL}, {0xFFFFFFFF00000010uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000030F83E108uLL}, {0xFFFFFFFF00000010uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000300000010uLL}, {0xFFFFFFFF00000010uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000002D2D2D3DuLL}, {0xFFFFFFFF00000010uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000001E1E1E2EuLL}, {0xFFFFFFFF00000010uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000000F0F0F1FuLL}, {0xFFFFFFFF00000010uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB00000010uLL}, {0xFFFFFFFF00000010uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFEEuLL}, {0xFFFFFFFF00000010uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFCCuLL}, {0xFFFFFFFF00000010uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFFAAuLL}, {0xFFFFFFFF00000010uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CAFFFFFDF0uLL}, {0xFFFFFFFF00000010uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA002AD6DCuLL}, {0xFFFFFFFF00000010uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA087AE168uLL}, {0xFFFFFFFF00000010uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA00000032uLL}, {0xFFFFFFFF00000010uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA00000010uLL}, {0xFFFFFFFF00000010uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A900000076uLL}, {0xFFFFFFFF00000010uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A900000054uLL}, {0xFFFFFFFF00000010uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A900000032uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334300000010uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333342FFFFFFEDuLL}, {0xFFFFFFFF00000010uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333342FFFFFFCAuLL}, {0xFFFFFFFF00000010uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333342FFFFFFA7uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333342FFFFFDE0uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341F8A491E2uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334201333354uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333180000033uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333180000010uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332000000079uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332000000056uLL}, {0xFFFFFFFF00000010uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332000000033uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000100000010uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000010000000EuLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000010000000CuLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000010000000AuLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000000FFFFFFF0uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F0F3761CuLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F170A3E8uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000012uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000013uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000012uLL}, {0xFFFFFFFF00000010uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000011uLL}, {0xFFFFFFFF00000010uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF0000000FuLL}, {0xFFFFFFFF00000010uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF0000000EuLL}, {0xFFFFFFFF00000010uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF0000000DuLL}, {0xFFFFFFFF00000010uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF00000010uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEF879BB16uLL}, {0xFFFFFFFF00000010uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFEF8B851FCuLL}, {0xFFFFFFFF00000010uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000011uLL}, {0xFFFFFFFF00000010uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE80000010uLL}, {0xFFFFFFFF00000010uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000013uLL}, {0xFFFFFFFF00000010uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000012uLL}, {0xFFFFFFFF00000010uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE00000011uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000200000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000020000000FuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000020000000EuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000020000000DuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB16uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851FCuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000011uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000180000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000013uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000012uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000011uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000100000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000010000000FuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000010000000EuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000010000000DuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB16uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851FCuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000011uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000080000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000013uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000012uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000011uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000000000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000000000000FuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000000000000EuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000000000000DuLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF00000010uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF00000010uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x7FFFFFFF83C3227DuLL, 0x0000000000000000uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000000000003uLL, 0x55555555028216FEuLL, 0x0000000000000000uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000000000010uLL, 0x0FFFFFFFF078644FuLL, 0x000000000000000AuLL}, {0xFFFFFFFF078644FAuLL, 0x00000000078644FAuLL, 0x0000002205B17ADCuLL, 0x000000000069DA22uLL}, {0xFFFFFFFF078644FAuLL, 0x000000000747AE14uLL, 0x000000232A32A559uLL, 0x00000000047FDC06uLL}, {0xFFFFFFFF078644FAuLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x00000000078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000007864500uLL}, {0xFFFFFFFF078644FAuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x00000000078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x00000000078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000007864500uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x0000000007864506uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x000000000786460AuLL}, {0xFFFFFFFF078644FAuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000AA89221CuLL}, {0xFFFFFFFF078644FAuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x000000004901B806uLL}, {0xFFFFFFFF078644FAuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000B230EFA4uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x00000000878644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000001878644F9uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000001078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x00000000878644FBuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x00000000078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x0000000187864500uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000010786454AuLL}, {0xFFFFFFFF078644FAuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x00000001521509B0uLL}, {0xFFFFFFFF078644FAuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016CE73402uLL}, {0xFFFFFFFF078644FAuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x000000006DECAB60uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000001078644F9uLL}, {0xFFFFFFFF078644FAuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000B230EFA4uLL}, {0xFFFFFFFF078644FAuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x000000005CDB9A4FuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002B230EFA6uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000025CDB9A52uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x00000002078644FEuLL}, {0xFFFFFFFF078644FAuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000B230EFCAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x000000003FA624AAuLL}, {0xFFFFFFFF078644FAuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x0000000113C7A582uLL}, {0xFFFFFFFF078644FAuLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x0000000350AAD742uLL}, {0xFFFFFFFF078644FAuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x00000003078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003C78644F7uLL}, {0xFFFFFFFF078644FAuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000003878644F8uLL}, {0xFFFFFFFF078644FAuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000003478644F9uLL}, {0xFFFFFFFF078644FAuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF78644FBuLL}, {0xFFFFFFFF078644FAuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE78644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED78644FDuLL}, {0xFFFFFFFF078644FAuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E0786450AuLL}, {0xFFFFFFFF078644FAuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000030784258CuLL}, {0xFFFFFFFF078644FAuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x000000054F30DC7AuLL}, {0xFFFFFFFF078644FAuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x00000003170A25F2uLL}, {0xFFFFFFFF078644FAuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000003078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x0000000034B37227uLL}, {0xFFFFFFFF078644FAuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x0000000025A46318uLL}, {0xFFFFFFFF078644FAuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x0000000016955409uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CB078644D8uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CB078644B6uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CB07864494uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CB078642DAuLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA07B11BC6uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA10012652uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA0786451CuLL}, {0xFFFFFFFF078644FAuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A907864560uLL}, {0xFFFFFFFF078644FAuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A90786453EuLL}, {0xFFFFFFFF078644FAuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A90786451CuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333343078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333343078644D7uLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333343078644B4uLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x0133334307864491uLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333343078642CAuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333342002AD6CCuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334208B9783EuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x013333318786451DuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x01333331878644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332007864563uLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332007864540uLL}, {0xFFFFFFFF078644FAuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x013333200786451DuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000001078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000001078644F8uLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000001078644F6uLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000001078644F4uLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000001078644DAuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F879BB06uLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F8F6E8D2uLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x00000000078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF078644FDuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF078644FBuLL}, {0xFFFFFFFF078644FAuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF078644F9uLL}, {0xFFFFFFFF078644FAuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF078644F8uLL}, {0xFFFFFFFF078644FAuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF078644F7uLL}, {0xFFFFFFFF078644FAuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF078644EAuLL}, {0xFFFFFFFF078644FAuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF078644FAuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF003E96E6uLL}, {0xFFFFFFFF078644FAuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE878644FBuLL}, {0xFFFFFFFF078644FAuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE878644FAuLL}, {0xFFFFFFFF078644FAuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FDuLL}, {0xFFFFFFFF078644FAuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE078644FBuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000002078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000002078644F9uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000002078644F8uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000002078644F7uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000002078644EAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000002003E96E6uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x00000001878644FBuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x00000001878644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x00000001078644FDuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000001078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000001078644FBuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000001078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000001078644F9uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000001078644F8uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000001078644F7uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000001078644EAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000001003E96E6uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x00000000878644FBuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x00000000878644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x00000000078644FDuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000078644FCuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000078644FBuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000078644F9uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000078644F8uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000078644F7uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000078644EAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000003E96E6uLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF078644FAuLL}, {0xFFFFFFFF078644FAuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF078644FAuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000000uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x7FFFFFFF83A3D70AuLL, 0x0000000000000000uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000000000003uLL, 0x55555555026D3A06uLL, 0x0000000000000002uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000000000010uLL, 0x0FFFFFFFF0747AE1uLL, 0x0000000000000004uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000000078644FAuLL, 0x0000002205B17ADCuLL, 0x00000000002B433CuLL}, {0xFFFFFFFF0747AE14uLL, 0x000000000747AE14uLL, 0x000000232A32A559uLL, 0x0000000004414520uLL}, {0xFFFFFFFF0747AE14uLL, 0x000000007FFFFFFFuLL, 0x0000000200000002uLL, 0x000000000747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x000000000747AE1AuLL}, {0xFFFFFFFF0747AE14uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x000000000747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x000000000747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x000000000747AE1AuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000000747AE20uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x000000000747AF24uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5BuLL, 0x00000000AA4A8B36uLL}, {0xFFFFFFFF0747AE14uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x0000000048C32120uLL}, {0xFFFFFFFF0747AE14uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x00000000B1F258BEuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000008747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x000000018747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x000000010747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x000000008747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x000000000747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000200000003uLL, 0x000000007FFFFFFEuLL, 0x000000018747AE1AuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000010747AE64uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x0000000151D672CAuLL}, {0xFFFFFFFF0747AE14uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x000000016CA89D1CuLL}, {0xFFFFFFFF0747AE14uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x000000006DAE147AuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000010747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000000B1F258BEuLL}, {0xFFFFFFFF0747AE14uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x000000005C9D0369uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000300000001uLL, 0x0000000055555554uLL, 0x00000002B1F258C0uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x000000025C9D036CuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x000000020747AE18uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000000B1F258E4uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x000000003F678DC4uLL}, {0xFFFFFFFF0747AE14uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x0000000113890E9CuLL}, {0xFFFFFFFF0747AE14uLL, 0x000000037FFFFFFFuLL, 0x0000000049249248uLL, 0x00000003506C405CuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x000000030747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000003FFFFFFFDuLL, 0x000000003FFFFFFFuLL, 0x00000003C747AE11uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x000000038747AE12uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x000000034747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000EF747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000EE747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000ED747AE17uLL}, {0xFFFFFFFF0747AE14uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E0747AE24uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x0000000307458EA6uLL}, {0xFFFFFFFF0747AE14uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x000000054EF24594uLL}, {0xFFFFFFFF0747AE14uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x0000000316CB8F0CuLL}, {0xFFFFFFFF0747AE14uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x000000030747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000003474DB41uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000002565CC32uLL}, {0xFFFFFFFF0747AE14uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000001656BD23uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CB0747ADF2uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CB0747ADD0uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CB0747ADAEuLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CB0747ABF4uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA077284E0uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA0FC28F6CuLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA0747AE36uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A90747AE7AuLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A90747AE58uLL}, {0xFFFFFFFF0747AE14uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A90747AE36uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x013333430747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333430747ADF1uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333430747ADCEuLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333430747ADABuLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333430747ABE4uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333341FFEC3FE6uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x01333342087AE158uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x013333318747AE37uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333318747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x013333200747AE7DuLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x013333200747AE5AuLL}, {0xFFFFFFFF0747AE14uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x013333200747AE37uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x000000010747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000010747AE12uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000010747AE10uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000010747AE0EuLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x000000010747ADF4uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000000F83B2420uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000000F8B851ECuLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x000000000747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE17uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE12uLL}, {0xFFFFFFFF0747AE14uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE11uLL}, {0xFFFFFFFF0747AE14uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF0747AE04uLL}, {0xFFFFFFFF0747AE14uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFC1691AuLL}, {0xFFFFFFFF0747AE14uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF0747AE14uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE8747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFE8747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE17uLL}, {0xFFFFFFFF0747AE14uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE0747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x000000020747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000020747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000020747AE12uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000020747AE11uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000020747AE04uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000001FFC1691AuLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000018747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000018747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x000000010747AE17uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x000000010747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x000000010747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x000000010747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000010747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000010747AE12uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000010747AE11uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x000000010747AE04uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000000FFC1691AuLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000008747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000008747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x000000000747AE17uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x000000000747AE16uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x000000000747AE15uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x000000000747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000000747AE13uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000000747AE12uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000000747AE11uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000000747AE04uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL}, {0xFFFFFFFF0747AE14uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF0747AE14uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x7FFFFFFFBFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000003uLL, 0x555555552AAAAAAAuLL, 0x0000000000000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000010uLL, 0x0FFFFFFFF7FFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000000078644FAuLL, 0x0000002205B17AECuLL, 0x00000000007F4587uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000000747AE14uLL, 0x000000232A32A56AuLL, 0x00000000013707B7uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFEuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000080000005uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000005uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000008000000BuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x000000008000010FuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5CuLL, 0x000000001B7C9827uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000C17B730BuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x000000012AAAAAA9uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000200000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x000000018000004FuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x00000001CA8EC4B5uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x00000001E560EF07uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x00000000E6666665uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x000000012AAAAAA9uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555554uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000300000001uLL, 0x0000000055555555uLL, 0x000000002AAAAAAAuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x00000002D5555557uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000280000003uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x000000012AAAAACFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000B81FDFAFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000018C416087uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000049249249uLL, 0x0000000049249248uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000000380000000uLL, 0x0000000049249248uLL, 0x000000037FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000040000000uLL, 0x000000003FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x000000003FFFFFFFuLL, 0x00000003FFFFFFFDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000F70000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000F60000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000F50000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E8000000FuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000037FFDE091uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x00000005C7AA977FuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000038F83E0F7uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x000000037FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x00000000AD2D2D2CuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000009E1E1E1DuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000008F0F0F0EuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFFDDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFFBBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFF99uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFDDFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA802AD6CBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA887AE157uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA80000021uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A980000065uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A980000043uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A980000021uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x013333437FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333437FFFFFDCuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333437FFFFFB9uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333437FFFFF96uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333437FFFFDCFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133334278A491D1uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334281333343uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333200000022uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x01333331FFFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332080000068uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332080000045uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332080000022uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000017FFFFFFBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000017FFFFFF9uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x000000017FFFFFDFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x0000000170F3760BuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x000000017170A3D7uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000080000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFCuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFEFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFF7879BB05uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF78B851EBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000027FFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000027FFFFFFDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000027FFFFFFCuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000027FFFFFEFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x000000027879BB05uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000278B851EBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000180000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000180000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFCuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFEFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB05uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851EBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFCuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFEFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB05uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851EBuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL, 0xFFFFFFFF7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF7FFFFFFFuLL}, {0xFFFFFFFF7FFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF7FFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0x0000000000000001uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000000000002uLL, 0x7FFFFFFFC0000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000000000003uLL, 0x555555552AAAAAAAuLL, 0x0000000000000002uLL}, {0xFFFFFFFF80000000uLL, 0x0000000000000010uLL, 0x0FFFFFFFF8000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000000078644FAuLL, 0x0000002205B17AECuLL, 0x00000000007F4588uLL}, {0xFFFFFFFF80000000uLL, 0x000000000747AE14uLL, 0x000000232A32A56AuLL, 0x00000000013707B8uLL}, {0xFFFFFFFF80000000uLL, 0x000000007FFFFFFFuLL, 0x0000000200000003uLL, 0x0000000000000003uLL}, {0xFFFFFFFF80000000uLL, 0x0000000080000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000000FFFFFFFDuLL, 0x0000000100000002uLL, 0x0000000080000006uLL}, {0xFFFFFFFF80000000uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFF80000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000080000002uLL}, {0xFFFFFFFF80000000uLL, 0x0000000100000002uLL, 0x00000000FFFFFFFDuLL, 0x0000000080000006uLL}, {0xFFFFFFFF80000000uLL, 0x0000000100000003uLL, 0x00000000FFFFFFFCuLL, 0x000000008000000CuLL}, {0xFFFFFFFF80000000uLL, 0x0000000100000010uLL, 0x00000000FFFFFFEFuLL, 0x0000000080000110uLL}, {0xFFFFFFFF80000000uLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5CuLL, 0x000000001B7C9828uLL}, {0xFFFFFFFF80000000uLL, 0x000000010747AE14uLL, 0x00000000F8EBDA59uLL, 0x00000000C17B730CuLL}, {0xFFFFFFFF80000000uLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAAAuLL, 0x000000012AAAAAAAuLL}, {0xFFFFFFFF80000000uLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x0000000100000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000001FFFFFFFFuLL, 0x0000000080000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x0000000180000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL}, {0xFFFFFFFF80000000uLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0xFFFFFFFF80000000uLL, 0x0000000200000003uLL, 0x000000007FFFFFFFuLL, 0x0000000000000003uLL}, {0xFFFFFFFF80000000uLL, 0x0000000200000010uLL, 0x000000007FFFFFFBuLL, 0x0000000180000050uLL}, {0xFFFFFFFF80000000uLL, 0x00000002078644FAuLL, 0x000000007E256849uLL, 0x00000001CA8EC4B6uLL}, {0xFFFFFFFF80000000uLL, 0x000000020747AE14uLL, 0x000000007E349CA6uLL, 0x00000001E560EF08uLL}, {0xFFFFFFFF80000000uLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x00000000E6666666uLL}, {0xFFFFFFFF80000000uLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x000000012AAAAAAAuLL}, {0xFFFFFFFF80000000uLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x00000000D5555555uLL}, {0xFFFFFFFF80000000uLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000000300000001uLL, 0x0000000055555555uLL, 0x000000002AAAAAABuLL}, {0xFFFFFFFF80000000uLL, 0x0000000300000002uLL, 0x0000000055555554uLL, 0x00000002D5555558uLL}, {0xFFFFFFFF80000000uLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000280000004uLL}, {0xFFFFFFFF80000000uLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x000000012AAAAAD0uLL}, {0xFFFFFFFF80000000uLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000000B81FDFB0uLL}, {0xFFFFFFFF80000000uLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000018C416088uLL}, {0xFFFFFFFF80000000uLL, 0x000000037FFFFFFFuLL, 0x0000000049249249uLL, 0x0000000049249249uLL}, {0xFFFFFFFF80000000uLL, 0x0000000380000000uLL, 0x0000000049249249uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000003FFFFFFFDuLL, 0x0000000040000000uLL, 0x0000000040000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000003FFFFFFFEuLL, 0x0000000040000000uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000003FFFFFFFFuLL, 0x000000003FFFFFFFuLL, 0x00000003BFFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000F80000000uLL}, {0xFFFFFFFF80000000uLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000F70000001uLL}, {0xFFFFFFFF80000000uLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000F60000002uLL}, {0xFFFFFFFF80000000uLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000F50000003uLL}, {0xFFFFFFFF80000000uLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000E80000010uLL}, {0xFFFFFFFF80000000uLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x000000037FFDE092uLL}, {0xFFFFFFFF80000000uLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x00000005C7AA9780uLL}, {0xFFFFFFFF80000000uLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000038F83E0F8uLL}, {0xFFFFFFFF80000000uLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x0000000380000000uLL}, {0xFFFFFFFF80000000uLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x00000000AD2D2D2DuLL}, {0xFFFFFFFF80000000uLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000009E1E1E1EuLL}, {0xFFFFFFFF80000000uLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000008F0F0F0FuLL}, {0xFFFFFFFF80000000uLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CB80000000uLL}, {0xFFFFFFFF80000000uLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFFDEuLL}, {0xFFFFFFFF80000000uLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFFBCuLL}, {0xFFFFFFFF80000000uLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFF9AuLL}, {0xFFFFFFFF80000000uLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CB7FFFFDE0uLL}, {0xFFFFFFFF80000000uLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CA802AD6CCuLL}, {0xFFFFFFFF80000000uLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CA887AE158uLL}, {0xFFFFFFFF80000000uLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BA80000022uLL}, {0xFFFFFFFF80000000uLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BA80000000uLL}, {0xFFFFFFFF80000000uLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6A980000066uLL}, {0xFFFFFFFF80000000uLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6A980000044uLL}, {0xFFFFFFFF80000000uLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6A980000022uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x0133334380000000uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x013333437FFFFFDDuLL}, {0xFFFFFFFF80000000uLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x013333437FFFFFBAuLL}, {0xFFFFFFFF80000000uLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x013333437FFFFF97uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x013333437FFFFDD0uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x0133334278A491D2uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334281333344uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333200000023uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x0133333200000000uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332080000069uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332080000046uLL}, {0xFFFFFFFF80000000uLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332080000023uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x0000000180000000uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x000000017FFFFFFCuLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x000000017FFFFFFAuLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x000000017FFFFFE0uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x0000000170F3760CuLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x000000017170A3D8uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000080000002uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000003uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000002uLL}, {0xFFFFFFFF80000000uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000001uLL}, {0xFFFFFFFF80000000uLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF80000000uLL}, {0xFFFFFFFF80000000uLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFEuLL}, {0xFFFFFFFF80000000uLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFDuLL}, {0xFFFFFFFF80000000uLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFF0uLL}, {0xFFFFFFFF80000000uLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFF7879BB06uLL}, {0xFFFFFFFF80000000uLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFF78B851ECuLL}, {0xFFFFFFFF80000000uLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFF80000000uLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFF80000000uLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000003uLL}, {0xFFFFFFFF80000000uLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000002uLL}, {0xFFFFFFFF80000000uLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFE80000001uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x0000000280000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x000000027FFFFFFEuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x000000027FFFFFFDuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x000000027FFFFFF0uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x000000027879BB06uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x0000000278B851ECuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000200000001uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000180000003uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000180000002uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000001uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x000000017FFFFFF0uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x000000017879BB06uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x0000000178B851ECuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000080000003uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000080000002uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000001uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x000000007FFFFFF0uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x000000007879BB06uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x0000000078B851ECuLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFF80000000uLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL, 0xFFFFFFFF80000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFF80000000uLL}, {0xFFFFFFFF80000000uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFF80000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000002uLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000003uLL, 0x5555555555555554uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000010uLL, 0x0FFFFFFFFFFFFFFFuLL, 0x000000000000000DuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000000078644FAuLL, 0x0000002205B17AFDuLL, 0x000000000094B0EBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000000747AE14uLL, 0x000000232A32A57BuLL, 0x0000000005747861uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000007FFFFFFFuLL, 0x0000000200000004uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000006uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000006uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000100000010uLL, 0x00000000FFFFFFF0uLL, 0x00000000000000FDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5CuLL, 0x000000009B7C9825uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA5AuLL, 0x000000003A33C4F5uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAABuLL, 0x000000002AAAAAA8uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000001FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000200000003uLL, 0x000000007FFFFFFFuLL, 0x0000000080000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000200000010uLL, 0x000000007FFFFFFCuLL, 0x000000000000003DuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000002078644FAuLL, 0x000000007E25684AuLL, 0x0000000043087FB9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000020747AE14uLL, 0x000000007E349CA7uLL, 0x000000005E1940F1uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000166666663uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000001AAAAAAA7uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000155555552uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000300000001uLL, 0x0000000055555555uLL, 0x00000000AAAAAAA8uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000300000002uLL, 0x0000000055555555uLL, 0x0000000055555553uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000300000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000001AAAAAACDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000001381FDFADuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000020C416085uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000037FFFFFFFuLL, 0x0000000049249249uLL, 0x00000000C9249246uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000000380000000uLL, 0x0000000049249249uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000003FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000003FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000003FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000003FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000FFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000FEFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000FDFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000FD0000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000F0000000DuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000003FFFDE08FuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000647AA977DuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000040F83E0F5uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000003FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000012D2D2D2AuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000011E1E1E1BuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000010F0F0F0CuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFDBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFB9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFF97uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFDDDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CB002AD6C9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CB087AE155uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BB0000001FuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BAFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6AA00000063uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6AA00000041uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6AA0000001FuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333343FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333343FFFFFFDAuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333343FFFFFFB7uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333343FFFFFF94uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333343FFFFFDCDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333342F8A491CFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334301333341uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333280000020uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333327FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332100000066uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332100000043uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332100000020uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000001FFFFFFF9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000001FFFFFFF7uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000001FFFFFFDDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000001F0F37609uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000001F170A3D5uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFAuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFEDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFFF879BB03uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFFF8B851E9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFAuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000002FFFFFFEDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000002F879BB03uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000002F8B851E9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000027FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000027FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFAuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB03uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851E9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFAuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB03uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851E9uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFDuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000003uLL, 0x5555555555555554uLL, 0x0000000000000002uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000010uLL, 0x0FFFFFFFFFFFFFFFuLL, 0x000000000000000EuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000000078644FAuLL, 0x0000002205B17AFDuLL, 0x000000000094B0ECuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000000747AE14uLL, 0x000000232A32A57BuLL, 0x0000000005747862uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000007FFFFFFFuLL, 0x0000000200000004uLL, 0x0000000000000002uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000007uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000002uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000000FFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFEuLL, 0x0000000100000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000002uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000007uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000100000010uLL, 0x00000000FFFFFFF0uLL, 0x00000000000000FEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5CuLL, 0x000000009B7C9826uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA5AuLL, 0x000000003A33C4F6uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAABuLL, 0x000000002AAAAAA9uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000001FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000100000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000200000003uLL, 0x000000007FFFFFFFuLL, 0x0000000080000001uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000200000010uLL, 0x000000007FFFFFFCuLL, 0x000000000000003EuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000002078644FAuLL, 0x000000007E25684AuLL, 0x0000000043087FBAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000020747AE14uLL, 0x000000007E349CA7uLL, 0x000000005E1940F2uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000166666664uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000001AAAAAAA8uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000155555553uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000300000001uLL, 0x0000000055555555uLL, 0x00000000AAAAAAA9uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000300000002uLL, 0x0000000055555555uLL, 0x0000000055555554uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000300000003uLL, 0x0000000055555554uLL, 0x0000000300000002uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000001AAAAAACEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000001381FDFAEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000020C416086uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000037FFFFFFFuLL, 0x0000000049249249uLL, 0x00000000C9249247uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000000380000000uLL, 0x0000000049249249uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000003FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000003FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000003FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000003FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000FFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000FEFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000FE0000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000FD0000001uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000F0000000EuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000003FFFDE090uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000647AA977EuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000040F83E0F6uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000003FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000012D2D2D2BuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000011E1E1E1CuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000010F0F0F0DuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFDCuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFBAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFF98uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFDDEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CB002AD6CAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CB087AE156uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BB00000020uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BAFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6AA00000064uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6AA00000042uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6AA00000020uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333343FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333343FFFFFFDBuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333343FFFFFFB8uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333343FFFFFF95uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333343FFFFFDCEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333342F8A491D0uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334301333342uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333280000021uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333327FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332100000067uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332100000044uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332100000021uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000001FFFFFFF8uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000001FFFFFFDEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000001F0F3760AuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000001F170A3D6uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000100000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000004uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000002uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFEEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFFF879BB04uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFFF8B851EAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFEFFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000002FFFFFFEEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000002F879BB04uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000002F8B851EAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000027FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000200000001uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB04uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB04uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EAuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFEuLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFEuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000002uLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000003uLL, 0x5555555555555555uLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000010uLL, 0x0FFFFFFFFFFFFFFFuLL, 0x000000000000000FuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000000078644FAuLL, 0x0000002205B17AFDuLL, 0x000000000094B0EDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000000747AE14uLL, 0x000000232A32A57BuLL, 0x0000000005747863uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000007FFFFFFFuLL, 0x0000000200000004uLL, 0x0000000000000003uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000080000000uLL, 0x00000001FFFFFFFFuLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000000FFFFFFFDuLL, 0x0000000100000003uLL, 0x0000000000000008uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000000FFFFFFFEuLL, 0x0000000100000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000000FFFFFFFFuLL, 0x0000000100000001uLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000100000000uLL, 0x00000000FFFFFFFFuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000100000001uLL, 0x00000000FFFFFFFFuLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000100000002uLL, 0x00000000FFFFFFFEuLL, 0x0000000000000003uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000100000003uLL, 0x00000000FFFFFFFDuLL, 0x0000000000000008uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000100000010uLL, 0x00000000FFFFFFF0uLL, 0x00000000000000FFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000001078644FAuLL, 0x00000000F8B0BB5CuLL, 0x000000009B7C9827uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000010747AE14uLL, 0x00000000F8EBDA5AuLL, 0x000000003A33C4F7uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000017FFFFFFFuLL, 0x00000000AAAAAAABuLL, 0x000000002AAAAAAAuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000180000000uLL, 0x00000000AAAAAAAAuLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000001FFFFFFFDuLL, 0x0000000080000000uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000001FFFFFFFEuLL, 0x0000000080000000uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000001FFFFFFFFuLL, 0x0000000080000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000200000000uLL, 0x000000007FFFFFFFuLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000200000001uLL, 0x000000007FFFFFFFuLL, 0x0000000180000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000200000002uLL, 0x000000007FFFFFFFuLL, 0x0000000100000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000200000003uLL, 0x000000007FFFFFFFuLL, 0x0000000080000002uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000200000010uLL, 0x000000007FFFFFFCuLL, 0x000000000000003FuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000002078644FAuLL, 0x000000007E25684AuLL, 0x0000000043087FBBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000020747AE14uLL, 0x000000007E349CA7uLL, 0x000000005E1940F3uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000027FFFFFFFuLL, 0x0000000066666666uLL, 0x0000000166666665uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000280000000uLL, 0x0000000066666666uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000002FFFFFFFDuLL, 0x0000000055555555uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000002FFFFFFFEuLL, 0x0000000055555555uLL, 0x00000001AAAAAAA9uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000002FFFFFFFFuLL, 0x0000000055555555uLL, 0x0000000155555554uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000300000000uLL, 0x0000000055555555uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000300000001uLL, 0x0000000055555555uLL, 0x00000000AAAAAAAAuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000300000002uLL, 0x0000000055555555uLL, 0x0000000055555555uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000300000003uLL, 0x0000000055555555uLL, 0x0000000000000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000300000010uLL, 0x0000000055555553uLL, 0x00000001AAAAAACFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000003078644FAuLL, 0x0000000054816148uLL, 0x00000001381FDFAFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000030747AE14uLL, 0x00000000548833C6uLL, 0x000000020C416087uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000037FFFFFFFuLL, 0x0000000049249249uLL, 0x00000000C9249248uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000000380000000uLL, 0x0000000049249249uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000003FFFFFFFDuLL, 0x0000000040000000uLL, 0x00000000BFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000003FFFFFFFEuLL, 0x0000000040000000uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000003FFFFFFFFuLL, 0x0000000040000000uLL, 0x000000003FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000001000000000uLL, 0x000000000FFFFFFFuLL, 0x0000000FFFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000001000000001uLL, 0x000000000FFFFFFFuLL, 0x0000000FF0000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000001000000002uLL, 0x000000000FFFFFFFuLL, 0x0000000FE0000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000001000000003uLL, 0x000000000FFFFFFFuLL, 0x0000000FD0000002uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000001000000010uLL, 0x000000000FFFFFFFuLL, 0x0000000F0000000FuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000010078644FAuLL, 0x000000000FF87D43uLL, 0x00000003FFFDE091uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000100747AE14uLL, 0x000000000FF8BBA0uLL, 0x0000000647AA977FuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x000000107FFFFFFFuLL, 0x000000000F83E0F8uLL, 0x000000040F83E0F7uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0000001080000000uLL, 0x000000000F83E0F8uLL, 0x00000003FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000010FFFFFFFDuLL, 0x000000000F0F0F0FuLL, 0x000000012D2D2D2CuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000010FFFFFFFEuLL, 0x000000000F0F0F0FuLL, 0x000000011E1E1E1DuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x00000010FFFFFFFFuLL, 0x000000000F0F0F0FuLL, 0x000000010F0F0F0EuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA00000000uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA00000001uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFDDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA00000002uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFFBBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA00000003uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFF99uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA00000010uLL, 0x0000000000000022uLL, 0x002AD6CBFFFFFDDFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA078644FAuLL, 0x0000000000000022uLL, 0x002AD6CB002AD6CBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA0747AE14uLL, 0x0000000000000022uLL, 0x002AD6CB087AE157uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA7FFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6BB00000021uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FA80000000uLL, 0x0000000000000022uLL, 0x002AD6BAFFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FAFFFFFFFDuLL, 0x0000000000000022uLL, 0x002AD6AA00000065uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FAFFFFFFFEuLL, 0x0000000000000022uLL, 0x002AD6AA00000043uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x078644FAFFFFFFFFuLL, 0x0000000000000022uLL, 0x002AD6AA00000021uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE1400000000uLL, 0x0000000000000023uLL, 0x01333343FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE1400000001uLL, 0x0000000000000023uLL, 0x01333343FFFFFFDCuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE1400000002uLL, 0x0000000000000023uLL, 0x01333343FFFFFFB9uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE1400000003uLL, 0x0000000000000023uLL, 0x01333343FFFFFF96uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE1400000010uLL, 0x0000000000000023uLL, 0x01333343FFFFFDCFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE14078644FAuLL, 0x0000000000000023uLL, 0x01333342F8A491D1uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE140747AE14uLL, 0x0000000000000023uLL, 0x0133334301333343uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE147FFFFFFFuLL, 0x0000000000000023uLL, 0x0133333280000022uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE1480000000uLL, 0x0000000000000023uLL, 0x013333327FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE14FFFFFFFDuLL, 0x0000000000000023uLL, 0x0133332100000068uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE14FFFFFFFEuLL, 0x0000000000000023uLL, 0x0133332100000045uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x0747AE14FFFFFFFFuLL, 0x0000000000000023uLL, 0x0133332100000022uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000000uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000001uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000002uLL, 0x0000000000000002uLL, 0x00000001FFFFFFFBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000003uLL, 0x0000000000000002uLL, 0x00000001FFFFFFF9uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF00000010uLL, 0x0000000000000002uLL, 0x00000001FFFFFFDFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF078644FAuLL, 0x0000000000000002uLL, 0x00000001F0F3760BuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF0747AE14uLL, 0x0000000000000002uLL, 0x00000001F170A3D7uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF7FFFFFFFuLL, 0x0000000000000002uLL, 0x0000000100000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFF80000000uLL, 0x0000000000000002uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFDuLL, 0x0000000000000002uLL, 0x0000000000000005uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFEuLL, 0x0000000000000002uLL, 0x0000000000000003uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x7FFFFFFFFFFFFFFFuLL, 0x0000000000000002uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x8000000000000000uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x8000000000000001uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x8000000000000002uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x8000000000000003uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x8000000000000010uLL, 0x0000000000000001uLL, 0x7FFFFFFFFFFFFFEFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x80000000078644FAuLL, 0x0000000000000001uLL, 0x7FFFFFFFF879BB05uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x800000000747AE14uLL, 0x0000000000000001uLL, 0x7FFFFFFFF8B851EBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x800000007FFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF80000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x8000000080000000uLL, 0x0000000000000001uLL, 0x7FFFFFFF7FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x80000000FFFFFFFDuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000002uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x80000000FFFFFFFEuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0x80000000FFFFFFFFuLL, 0x0000000000000001uLL, 0x7FFFFFFF00000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000000uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000001uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000002uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000003uLL, 0x0000000000000001uLL, 0x00000002FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD00000010uLL, 0x0000000000000001uLL, 0x00000002FFFFFFEFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD078644FAuLL, 0x0000000000000001uLL, 0x00000002F879BB05uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD0747AE14uLL, 0x0000000000000001uLL, 0x00000002F8B851EBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000280000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFD80000000uLL, 0x0000000000000001uLL, 0x000000027FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000200000002uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000200000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFDFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000200000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000000uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000001uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000002uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000003uLL, 0x0000000000000001uLL, 0x00000001FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE00000010uLL, 0x0000000000000001uLL, 0x00000001FFFFFFEFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE078644FAuLL, 0x0000000000000001uLL, 0x00000001F879BB05uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE0747AE14uLL, 0x0000000000000001uLL, 0x00000001F8B851EBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000180000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFE80000000uLL, 0x0000000000000001uLL, 0x000000017FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000100000002uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000100000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFEFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000100000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000000uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000001uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFEuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000002uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFDuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000003uLL, 0x0000000000000001uLL, 0x00000000FFFFFFFCuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF00000010uLL, 0x0000000000000001uLL, 0x00000000FFFFFFEFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF078644FAuLL, 0x0000000000000001uLL, 0x00000000F879BB05uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF0747AE14uLL, 0x0000000000000001uLL, 0x00000000F8B851EBuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF7FFFFFFFuLL, 0x0000000000000001uLL, 0x0000000080000000uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFF80000000uLL, 0x0000000000000001uLL, 0x000000007FFFFFFFuLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFDuLL, 0x0000000000000001uLL, 0x0000000000000002uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL, 0x0000000000000001uLL, 0x0000000000000001uLL}, {0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL, 0x0000000000000001uLL, 0x0000000000000000uLL} }; int main() { const unsigned N = sizeof(tests) / sizeof(tests[0]); unsigned i; for (i = 0; i < N; ++i) if (test__udivmoddi4(tests[i][0], tests[i][1], tests[i][2], tests[i][3])) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divsi3_test.c0000664000175000017500000000266112516462465027354 0ustar mwhudsonmwhudson//===-- divsi3_test.c - Test __divsi3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divsi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a / b COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b); int test__divsi3(si_int a, si_int b, si_int expected) { si_int x = __divsi3(a, b); if (x != expected) printf("error in __divsi3: %d / %d = %d, expected %d\n", a, b, x, expected); return x != expected; } int main() { if (test__divsi3(0, 1, 0)) return 1; if (test__divsi3(0, -1, 0)) return 1; if (test__divsi3(2, 1, 2)) return 1; if (test__divsi3(2, -1, -2)) return 1; if (test__divsi3(-2, 1, -2)) return 1; if (test__divsi3(-2, -1, 2)) return 1; if (test__divsi3(0x80000000, 1, 0x80000000)) return 1; if (test__divsi3(0x80000000, -1, 0x80000000)) return 1; if (test__divsi3(0x80000000, -2, 0x40000000)) return 1; if (test__divsi3(0x80000000, 2, 0xC0000000)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/extebdsfdf2vfp_test.c0000664000175000017500000000233012516462465031060 0ustar mwhudsonmwhudson//===-- extendsfdf2vfp_test.c - Test __extendsfdf2vfp ---------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __extendsfdf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI double __extendsfdf2vfp(float a); #if __arm__ int test__extendsfdf2vfp(float a) { double actual = __extendsfdf2vfp(a); double expected = a; if (actual != expected) printf("error in test__extendsfdf2vfp(%f) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__extendsfdf2vfp(0.0)) return 1; if (test__extendsfdf2vfp(1.0)) return 1; if (test__extendsfdf2vfp(-1.0)) return 1; if (test__extendsfdf2vfp(3.1415926535)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ctzti2_test.c0000664000175000017500000000431412516462465027367 0ustar mwhudsonmwhudson//===-- ctzti2_test.c - Test __ctzti2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ctzti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: the number of trailing 0-bits // Precondition: a != 0 COMPILER_RT_ABI si_int __ctzti2(ti_int a); int test__ctzti2(ti_int a, si_int expected) { si_int x = __ctzti2(a); if (x != expected) { twords at; at.all = a; printf("error in __ctzti2(0x%llX%.16llX) = %d, expected %d\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__ctzti2(0x00000001, 0)) return 1; if (test__ctzti2(0x00000002, 1)) return 1; if (test__ctzti2(0x00000003, 0)) return 1; if (test__ctzti2(0x00000004, 2)) return 1; if (test__ctzti2(0x00000005, 0)) return 1; if (test__ctzti2(0x0000000A, 1)) return 1; if (test__ctzti2(0x10000000, 28)) return 1; if (test__ctzti2(0x20000000, 29)) return 1; if (test__ctzti2(0x60000000, 29)) return 1; if (test__ctzti2(0x80000000uLL, 31)) return 1; if (test__ctzti2(0x0000050000000000uLL, 40)) return 1; if (test__ctzti2(0x0200080000000000uLL, 43)) return 1; if (test__ctzti2(0x7200000000000000uLL, 57)) return 1; if (test__ctzti2(0x8000000000000000uLL, 63)) return 1; if (test__ctzti2(make_ti(0x00000000A0000000LL, 0x0000000000000000LL), 93)) return 1; if (test__ctzti2(make_ti(0xF000000000000000LL, 0x0000000000000000LL), 124)) return 1; if (test__ctzti2(make_ti(0x8000000000000000LL, 0x0000000000000000LL), 127)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gtsf2vfp_test.c0000664000175000017500000000245511570537001027701 0ustar mwhudsonmwhudson//===-- gtsf2vfp_test.c - Test __gtsf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __gtsf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __gtsf2vfp(float a, float b); #if __arm__ int test__gtsf2vfp(float a, float b) { int actual = __gtsf2vfp(a, b); int expected = (a > b) ? 1 : 0; if (actual != expected) printf("error in __gtsf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__gtsf2vfp(0.0, 0.0)) return 1; if (test__gtsf2vfp(1.0, 0.0)) return 1; if (test__gtsf2vfp(-1.0, -2.0)) return 1; if (test__gtsf2vfp(-2.0, -1.0)) return 1; if (test__gtsf2vfp(HUGE_VALF, 1.0)) return 1; if (test__gtsf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/multc3_test.c0000664000175000017500000001674612564633211027363 0ustar mwhudsonmwhudson//===-- multc3_test.c - Test __multc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __multc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if _ARCH_PPC || __aarch64__ #include "int_lib.h" #include #include // Returns: the product of a + ib and c + id COMPILER_RT_ABI long double _Complex __multc3(long double __a, long double __b, long double __c, long double __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(long double _Complex x) { if (x == 0) return zero; if (isinf(creall(x)) || isinf(cimagl(x))) return inf; if (isnan(creall(x)) && isnan(cimagl(x))) return NaN; if (isnan(creall(x))) { if (cimagl(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimagl(x))) { if (creall(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__multc3(long double a, long double b, long double c, long double d) { long double _Complex r = __multc3(a, b, c, d); // printf("test__multc3(%Lf, %Lf, %Lf, %Lf) = %Lf + I%Lf\n", // a, b, c, d, creall(r), cimagl(r)); long double _Complex dividend; long double _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; if (r != a * c - b * d + _Complex_I*(a * d + b * c)) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != inf) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } long double x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; #endif int main() { #if _ARCH_PPC || __aarch64__ const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__multc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatsidfvfp_test.c0000664000175000017500000000236512516462465030643 0ustar mwhudsonmwhudson//===-- floatsidfvfp_test.c - Test __floatsidfvfp -------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatsidfvfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI double __floatsidfvfp(int a); #if __arm__ int test__floatsidfvfp(int a) { double actual = __floatsidfvfp(a); double expected = a; if (actual != expected) printf("error in test__ floatsidfvfp(%d) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__floatsidfvfp(0)) return 1; if (test__floatsidfvfp(1)) return 1; if (test__floatsidfvfp(-1)) return 1; if (test__floatsidfvfp(0x7FFFFFFF)) return 1; if (test__floatsidfvfp(0x80000000)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fp_test.h0000664000175000017500000001402412542340225026545 0ustar mwhudsonmwhudson//===--------------------------- fp_test.h - ------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines shared functions for the test. // //===----------------------------------------------------------------------===// #include #include #include #include enum EXPECTED_RESULT { LESS_0, LESS_EQUAL_0, EQUAL_0, GREATER_0, GREATER_EQUAL_0, NEQUAL_0 }; static inline uint16_t fromRep16(uint16_t x) { return x; } static inline float fromRep32(uint32_t x) { float ret; memcpy(&ret, &x, 4); return ret; } static inline double fromRep64(uint64_t x) { double ret; memcpy(&ret, &x, 8); return ret; } #if __LDBL_MANT_DIG__ == 113 static inline long double fromRep128(uint64_t hi, uint64_t lo) { __uint128_t x = ((__uint128_t)hi << 64) + lo; long double ret; memcpy(&ret, &x, 16); return ret; } #endif static inline uint16_t toRep16(uint16_t x) { return x; } static inline uint32_t toRep32(float x) { uint32_t ret; memcpy(&ret, &x, 4); return ret; } static inline uint64_t toRep64(double x) { uint64_t ret; memcpy(&ret, &x, 8); return ret; } #if __LDBL_MANT_DIG__ == 113 static inline __uint128_t toRep128(long double x) { __uint128_t ret; memcpy(&ret, &x, 16); return ret; } #endif static inline int compareResultH(uint16_t result, uint16_t expected) { uint16_t rep = toRep16(result); if (rep == expected){ return 0; } // test other posible NaN representation(signal NaN) else if (expected == 0x7e00U){ if ((rep & 0x7c00U) == 0x7c00U && (rep & 0x3ffU) > 0){ return 0; } } return 1; } static inline int compareResultF(float result, uint32_t expected) { uint32_t rep = toRep32(result); if (rep == expected){ return 0; } // test other posible NaN representation(signal NaN) else if (expected == 0x7fc00000U){ if ((rep & 0x7f800000U) == 0x7f800000U && (rep & 0x7fffffU) > 0){ return 0; } } return 1; } static inline int compareResultD(double result, uint64_t expected) { uint64_t rep = toRep64(result); if (rep == expected){ return 0; } // test other posible NaN representation(signal NaN) else if (expected == 0x7ff8000000000000UL){ if ((rep & 0x7ff0000000000000UL) == 0x7ff0000000000000UL && (rep & 0xfffffffffffffUL) > 0){ return 0; } } return 1; } #if __LDBL_MANT_DIG__ == 113 // return 0 if equal // use two 64-bit integers intead of one 128-bit integer // because 128-bit integer constant can't be assigned directly static inline int compareResultLD(long double result, uint64_t expectedHi, uint64_t expectedLo) { __uint128_t rep = toRep128(result); uint64_t hi = rep >> 64; uint64_t lo = rep; if (hi == expectedHi && lo == expectedLo){ return 0; } // test other posible NaN representation(signal NaN) else if (expectedHi == 0x7fff800000000000UL && expectedLo == 0x0UL){ if ((hi & 0x7fff000000000000UL) == 0x7fff000000000000UL && ((hi & 0xffffffffffffUL) > 0 || lo > 0)){ return 0; } } return 1; } #endif static inline int compareResultCMP(int result, enum EXPECTED_RESULT expected) { switch(expected){ case LESS_0: if (result < 0) return 0; break; case LESS_EQUAL_0: if (result <= 0) return 0; break; case EQUAL_0: if (result == 0) return 0; break; case NEQUAL_0: if (result != 0) return 0; break; case GREATER_EQUAL_0: if (result >= 0) return 0; break; case GREATER_0: if (result > 0) return 0; break; default: return 1; } return 1; } static inline char *expectedStr(enum EXPECTED_RESULT expected) { switch(expected){ case LESS_0: return "<0"; case LESS_EQUAL_0: return "<=0"; case EQUAL_0: return "=0"; case NEQUAL_0: return "!=0"; case GREATER_EQUAL_0: return ">=0"; case GREATER_0: return ">0"; default: return ""; } return ""; } static inline uint16_t makeQNaN16() { return fromRep16(0x7e00U); } static inline float makeQNaN32() { return fromRep32(0x7fc00000U); } static inline double makeQNaN64() { return fromRep64(0x7ff8000000000000UL); } #if __LDBL_MANT_DIG__ == 113 static inline long double makeQNaN128() { return fromRep128(0x7fff800000000000UL, 0x0UL); } #endif static inline uint16_t makeNaN16(uint16_t rand) { return fromRep16(0x7c00U | (rand & 0x7fffU)); } static inline float makeNaN32(uint32_t rand) { return fromRep32(0x7f800000U | (rand & 0x7fffffU)); } static inline double makeNaN64(uint64_t rand) { return fromRep64(0x7ff0000000000000UL | (rand & 0xfffffffffffffUL)); } #if __LDBL_MANT_DIG__ == 113 static inline long double makeNaN128(uint64_t rand) { return fromRep128(0x7fff000000000000UL | (rand & 0xffffffffffffUL), 0x0UL); } #endif static inline uint16_t makeInf16() { return fromRep16(0x7c00U); } static inline float makeInf32() { return fromRep32(0x7f800000U); } static inline double makeInf64() { return fromRep64(0x7ff0000000000000UL); } #if __LDBL_MANT_DIG__ == 113 static inline long double makeInf128() { return fromRep128(0x7fff000000000000UL, 0x0UL); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negdf2vfp_test.c0000664000175000017500000000222612516462465030031 0ustar mwhudsonmwhudson//===-- negdf2vfp_test.c - Test __negdf2vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negdf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include extern COMPILER_RT_ABI double __negdf2vfp(double a); #if __arm__ int test__negdf2vfp(double a) { double actual = __negdf2vfp(a); double expected = -a; if (actual != expected) printf("error in test__negdf2vfp(%f) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__negdf2vfp(1.0)) return 1; if (test__negdf2vfp(HUGE_VALF)) return 1; if (test__negdf2vfp(0.0)) return 1; if (test__negdf2vfp(-1.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/parityti2_test.c0000664000175000017500000000302212516462465030072 0ustar mwhudsonmwhudson//===-- parityti2_test.c - Test __parityti2 -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __parityti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: 1 if number of bits is odd else returns 0 COMPILER_RT_ABI si_int __parityti2(ti_int a); int naive_parity(ti_int a) { int r = 0; for (; a; a = a & (a - 1)) r = ~r; return r & 1; } int test__parityti2(ti_int a) { si_int x = __parityti2(a); si_int expected = naive_parity(a); if (x != expected) { twords at; at.all = a; printf("error in __parityti2(0x%.16llX%.16llX) = %d, expected %d\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT int i; for (i = 0; i < 10000; ++i) if (test__parityti2(((ti_int)rand() << 96) + ((ti_int)rand() << 64) + ((ti_int)rand() << 32) + rand())) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/addvti3_test.c0000664000175000017500000000650212516462465027507 0ustar mwhudsonmwhudson//===-- addvti3_test.c - Test __addvti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __addvti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a + b // Effects: aborts if a + b overflows COMPILER_RT_ABI ti_int __addvti3(ti_int a, ti_int b); int test__addvti3(ti_int a, ti_int b) { ti_int x = __addvti3(a, b); ti_int expected = a + b; if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in test__addvti3(0x%llX%.16llX, 0x%llX%.16llX) = " "0x%llX%.16llX, expected 0x%llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } #endif int main() { #ifdef CRT_HAS_128BIT // should abort // test__addvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), // make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL)); // should abort // test__addvti3(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), // make_ti(0x8000000000000000LL, 0x0000000000000000LL)); // should abort // test__addvti3(make_ti(0x0000000000000000LL, 0x0000000000000001LL), // make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL)); // should abort // test__addvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), // make_ti(0x0000000000000000LL, 0x0000000000000001LL)); if (test__addvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x0000000000000000LL, 0x0000000000000001LL))) return 1; if (test__addvti3(make_ti(0x0000000000000000LL, 0x0000000000000001LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; if (test__addvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x0000000000000000LL, 0x0000000000000000LL))) return 1; if (test__addvti3(make_ti(0x0000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; if (test__addvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__addvti3(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__addvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x0000000000000000LL, 0x0000000000000000LL))) return 1; if (test__addvti3(make_ti(0x0000000000000000LL, 0x0000000000000000LL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ucmpdi2_test.c0000664000175000017500000000450512516462465027515 0ustar mwhudsonmwhudson//===-- ucmpdi2_test.c - Test __ucmpdi2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ucmpdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: if (a < b) returns 0 // if (a == b) returns 1 // if (a > b) returns 2 COMPILER_RT_ABI si_int __ucmpdi2(du_int a, du_int b); int test__ucmpdi2(du_int a, du_int b, si_int expected) { si_int x = __ucmpdi2(a, b); if (x != expected) printf("error in __ucmpdi2(0x%llX, 0x%llX) = %d, expected %d\n", a, b, x, expected); return x != expected; } int main() { if (test__ucmpdi2(0, 0, 1)) return 1; if (test__ucmpdi2(1, 1, 1)) return 1; if (test__ucmpdi2(2, 2, 1)) return 1; if (test__ucmpdi2(0x7FFFFFFF, 0x7FFFFFFF, 1)) return 1; if (test__ucmpdi2(0x80000000, 0x80000000, 1)) return 1; if (test__ucmpdi2(0x80000001, 0x80000001, 1)) return 1; if (test__ucmpdi2(0xFFFFFFFF, 0xFFFFFFFF, 1)) return 1; if (test__ucmpdi2(0x000000010000000LL, 0x000000010000000LL, 1)) return 1; if (test__ucmpdi2(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL, 1)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000300000001LL, 0)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000300000002LL, 0)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000300000003LL, 0)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000100000001LL, 2)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000100000002LL, 2)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000100000003LL, 2)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000200000001LL, 2)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000200000002LL, 1)) return 1; if (test__ucmpdi2(0x0000000200000002LL, 0x0000000200000003LL, 0)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatundisf_test.c0000664000175000017500000000566012516462465030473 0ustar mwhudsonmwhudson//===-- floatundisf_test.c - Test __floatundisf ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatundisf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: convert a to a float, rounding toward even. // Assumption: float is a IEEE 32 bit floating point type // du_int is a 64 bit integral type // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI float __floatundisf(du_int a); int test__floatundisf(du_int a, float expected) { float x = __floatundisf(a); if (x != expected) printf("error in __floatundisf(%llX) = %a, expected %a\n", a, x, expected); return x != expected; } char assumption_1[sizeof(du_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(du_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; int main() { if (test__floatundisf(0, 0.0F)) return 1; if (test__floatundisf(1, 1.0F)) return 1; if (test__floatundisf(2, 2.0F)) return 1; if (test__floatundisf(0x7FFFFF8000000000ULL, 0x1.FFFFFEp+62F)) return 1; if (test__floatundisf(0x7FFFFF0000000000ULL, 0x1.FFFFFCp+62F)) return 1; if (test__floatundisf(0x8000008000000000ULL, 0x1p+63F)) return 1; if (test__floatundisf(0x8000010000000000LL, 0x1.000002p+63F)) return 1; if (test__floatundisf(0x8000000000000000LL, 0x1p+63F)) return 1; if (test__floatundisf(0x8000000000000001LL, 0x1p+63F)) return 1; if (test__floatundisf(0xFFFFFFFFFFFFFFFELL, 0x1p+64F)) return 1; if (test__floatundisf(0xFFFFFFFFFFFFFFFFLL, 0x1p+64F)) return 1; if (test__floatundisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72EA000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72EB000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72EC000000LL, 0x1.FEDCBCp+50F)) return 1; if (test__floatundisf(0x0007FB72E8000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72E6000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72E7000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72E7FFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72E4000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatundisf(0x0007FB72E4000000LL, 0x1.FEDCB8p+50F)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulvsi3_test.c0000664000175000017500000001051612516462465027553 0ustar mwhudsonmwhudson//===-- mulvsi3_test.c - Test __mulvsi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulvsi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a * b // Effects: aborts if a * b overflows COMPILER_RT_ABI si_int __mulvsi3(si_int a, si_int b); int test__mulvsi3(si_int a, si_int b, si_int expected) { si_int x = __mulvsi3(a, b); if (x != expected) printf("error in __mulvsi3: %d * %d = %d, expected %d\n", a, b, x, expected); return x != expected; } int main() { if (test__mulvsi3(0, 0, 0)) return 1; if (test__mulvsi3(0, 1, 0)) return 1; if (test__mulvsi3(1, 0, 0)) return 1; if (test__mulvsi3(0, 10, 0)) return 1; if (test__mulvsi3(10, 0, 0)) return 1; if (test__mulvsi3(0, 0x1234567, 0)) return 1; if (test__mulvsi3(0x1234567, 0, 0)) return 1; if (test__mulvsi3(0, -1, 0)) return 1; if (test__mulvsi3(-1, 0, 0)) return 1; if (test__mulvsi3(0, -10, 0)) return 1; if (test__mulvsi3(-10, 0, 0)) return 1; if (test__mulvsi3(0, -0x1234567, 0)) return 1; if (test__mulvsi3(-0x1234567, 0, 0)) return 1; if (test__mulvsi3(1, 1, 1)) return 1; if (test__mulvsi3(1, 10, 10)) return 1; if (test__mulvsi3(10, 1, 10)) return 1; if (test__mulvsi3(1, 0x1234567, 0x1234567)) return 1; if (test__mulvsi3(0x1234567, 1, 0x1234567)) return 1; if (test__mulvsi3(1, -1, -1)) return 1; if (test__mulvsi3(1, -10, -10)) return 1; if (test__mulvsi3(-10, 1, -10)) return 1; if (test__mulvsi3(1, -0x1234567, -0x1234567)) return 1; if (test__mulvsi3(-0x1234567, 1, -0x1234567)) return 1; // if (test__mulvsi3(0x7FFFFFFF, -2, 0x80000001)) // abort // return 1; // if (test__mulvsi3(-2, 0x7FFFFFFF, 0x80000001)) // abort // return 1; if (test__mulvsi3(0x7FFFFFFF, -1, 0x80000001)) return 1; if (test__mulvsi3(-1, 0x7FFFFFFF, 0x80000001)) return 1; if (test__mulvsi3(0x7FFFFFFF, 0, 0)) return 1; if (test__mulvsi3(0, 0x7FFFFFFF, 0)) return 1; if (test__mulvsi3(0x7FFFFFFF, 1, 0x7FFFFFFF)) return 1; if (test__mulvsi3(1, 0x7FFFFFFF, 0x7FFFFFFF)) return 1; // if (test__mulvsi3(0x7FFFFFFF, 2, 0x80000001)) // abort // return 1; // if (test__mulvsi3(2, 0x7FFFFFFF, 0x80000001)) // abort // return 1; // if (test__mulvsi3(0x80000000, -2, 0x80000000)) // abort // return 1; // if (test__mulvsi3(-2, 0x80000000, 0x80000000)) // abort // return 1; // if (test__mulvsi3(0x80000000, -1, 0x80000000)) // abort // return 1; // if (test__mulvsi3(-1, 0x80000000, 0x80000000)) // abort // return 1; if (test__mulvsi3(0x80000000, 0, 0)) return 1; if (test__mulvsi3(0, 0x80000000, 0)) return 1; if (test__mulvsi3(0x80000000, 1, 0x80000000)) return 1; if (test__mulvsi3(1, 0x80000000, 0x80000000)) return 1; // if (test__mulvsi3(0x80000000, 2, 0x80000000)) // abort // return 1; // if (test__mulvsi3(2, 0x80000000, 0x80000000)) // abort // return 1; // if (test__mulvsi3(0x80000001, -2, 0x80000001)) // abort // return 1; // if (test__mulvsi3(-2, 0x80000001, 0x80000001)) // abort // return 1; if (test__mulvsi3(0x80000001, -1, 0x7FFFFFFF)) return 1; if (test__mulvsi3(-1, 0x80000001, 0x7FFFFFFF)) return 1; if (test__mulvsi3(0x80000001, 0, 0)) return 1; if (test__mulvsi3(0, 0x80000001, 0)) return 1; if (test__mulvsi3(0x80000001, 1, 0x80000001)) return 1; if (test__mulvsi3(1, 0x80000001, 0x80000001)) return 1; // if (test__mulvsi3(0x80000001, 2, 0x80000000)) // abort // return 1; // if (test__mulvsi3(2, 0x80000001, 0x80000000)) // abort // return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/popcountsi2_test.c0000664000175000017500000000276612516462465030446 0ustar mwhudsonmwhudson//===-- popcountsi2_test.c - Test __popcountsi2 ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __popcountsi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: count of 1 bits COMPILER_RT_ABI si_int __popcountsi2(si_int a); int naive_popcount(si_int a) { int r = 0; for (; a; a = (su_int)a >> 1) r += a & 1; return r; } int test__popcountsi2(si_int a) { si_int x = __popcountsi2(a); si_int expected = naive_popcount(a); if (x != expected) printf("error in __popcountsi2(0x%X) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_2[sizeof(si_int)*CHAR_BIT == 32] = {0}; int main() { if (test__popcountsi2(0)) return 1; if (test__popcountsi2(1)) return 1; if (test__popcountsi2(2)) return 1; if (test__popcountsi2(0xFFFFFFFD)) return 1; if (test__popcountsi2(0xFFFFFFFE)) return 1; if (test__popcountsi2(0xFFFFFFFF)) return 1; int i; for (i = 0; i < 10000; ++i) if (test__popcountsi2(rand())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/subvdi3_test.c0000664000175000017500000000344312516462465027531 0ustar mwhudsonmwhudson//===-- subvdi3_test.c - Test __subvdi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __subvdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: a - b // Effects: aborts if a - b overflows COMPILER_RT_ABI di_int __subvdi3(di_int a, di_int b); int test__subvdi3(di_int a, di_int b) { di_int x = __subvdi3(a, b); di_int expected = a - b; if (x != expected) printf("error in test__subvsi3(0x%llX, 0x%llX) = %lld, expected %lld\n", a, b, x, expected); return x != expected; } int main() { // test__subvdi3(0x8000000000000000LL, 1); // should abort // test__subvdi3(0, 0x8000000000000000LL); // should abort // test__subvdi3(1, 0x8000000000000000LL); // should abort // test__subvdi3(0x7FFFFFFFFFFFFFFFLL, -1); // should abort // test__subvdi3(-2, 0x7FFFFFFFFFFFFFFFLL); // should abort if (test__subvdi3(0x8000000000000000LL, -1)) return 1; if (test__subvdi3(0x8000000000000000LL, 0)) return 1; if (test__subvdi3(-1, 0x8000000000000000LL)) return 1; if (test__subvdi3(0x7FFFFFFFFFFFFFFLL, 1)) return 1; if (test__subvdi3(0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__subvdi3(1, 0x7FFFFFFFFFFFFFFLL)) return 1; if (test__subvdi3(0, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__subvdi3(-1, 0x7FFFFFFFFFFFFFFFLL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/umodsi3_test.c0000664000175000017500000001376012516462465027540 0ustar mwhudsonmwhudson//===-- umodsi3_test.c - Test __umodsi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __umodsi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a % b COMPILER_RT_ABI su_int __umodsi3(su_int a, su_int b); int test__umodsi3(su_int a, su_int b, su_int expected_r) { su_int r = __umodsi3(a, b); if (r != expected_r) printf("error in __umodsi3: %X %% %X = %X, expected %X\n", a, b, r, expected_r); return r != expected_r; } su_int tests[][4] = { {0x00000000, 0x00000001, 0x00000000}, {0x00000000, 0x00000002, 0x00000000}, {0x00000000, 0x00000003, 0x00000000}, {0x00000000, 0x00000010, 0x00000000}, {0x00000000, 0x078644FA, 0x00000000}, {0x00000000, 0x0747AE14, 0x00000000}, {0x00000000, 0x7FFFFFFF, 0x00000000}, {0x00000000, 0x80000000, 0x00000000}, {0x00000000, 0xFFFFFFFD, 0x00000000}, {0x00000000, 0xFFFFFFFE, 0x00000000}, {0x00000000, 0xFFFFFFFF, 0x00000000}, {0x00000001, 0x00000001, 0x00000000}, {0x00000001, 0x00000002, 0x00000001}, {0x00000001, 0x00000003, 0x00000001}, {0x00000001, 0x00000010, 0x00000001}, {0x00000001, 0x078644FA, 0x00000001}, {0x00000001, 0x0747AE14, 0x00000001}, {0x00000001, 0x7FFFFFFF, 0x00000001}, {0x00000001, 0x80000000, 0x00000001}, {0x00000001, 0xFFFFFFFD, 0x00000001}, {0x00000001, 0xFFFFFFFE, 0x00000001}, {0x00000001, 0xFFFFFFFF, 0x00000001}, {0x00000002, 0x00000001, 0x00000000}, {0x00000002, 0x00000002, 0x00000000}, {0x00000002, 0x00000003, 0x00000002}, {0x00000002, 0x00000010, 0x00000002}, {0x00000002, 0x078644FA, 0x00000002}, {0x00000002, 0x0747AE14, 0x00000002}, {0x00000002, 0x7FFFFFFF, 0x00000002}, {0x00000002, 0x80000000, 0x00000002}, {0x00000002, 0xFFFFFFFD, 0x00000002}, {0x00000002, 0xFFFFFFFE, 0x00000002}, {0x00000002, 0xFFFFFFFF, 0x00000002}, {0x00000003, 0x00000001, 0x00000000}, {0x00000003, 0x00000002, 0x00000001}, {0x00000003, 0x00000003, 0x00000000}, {0x00000003, 0x00000010, 0x00000003}, {0x00000003, 0x078644FA, 0x00000003}, {0x00000003, 0x0747AE14, 0x00000003}, {0x00000003, 0x7FFFFFFF, 0x00000003}, {0x00000003, 0x80000000, 0x00000003}, {0x00000003, 0xFFFFFFFD, 0x00000003}, {0x00000003, 0xFFFFFFFE, 0x00000003}, {0x00000003, 0xFFFFFFFF, 0x00000003}, {0x00000010, 0x00000001, 0x00000000}, {0x00000010, 0x00000002, 0x00000000}, {0x00000010, 0x00000003, 0x00000001}, {0x00000010, 0x00000010, 0x00000000}, {0x00000010, 0x078644FA, 0x00000010}, {0x00000010, 0x0747AE14, 0x00000010}, {0x00000010, 0x7FFFFFFF, 0x00000010}, {0x00000010, 0x80000000, 0x00000010}, {0x00000010, 0xFFFFFFFD, 0x00000010}, {0x00000010, 0xFFFFFFFE, 0x00000010}, {0x00000010, 0xFFFFFFFF, 0x00000010}, {0x078644FA, 0x00000001, 0x00000000}, {0x078644FA, 0x00000002, 0x00000000}, {0x078644FA, 0x00000003, 0x00000000}, {0x078644FA, 0x00000010, 0x0000000A}, {0x078644FA, 0x078644FA, 0x00000000}, {0x078644FA, 0x0747AE14, 0x003E96E6}, {0x078644FA, 0x7FFFFFFF, 0x078644FA}, {0x078644FA, 0x80000000, 0x078644FA}, {0x078644FA, 0xFFFFFFFD, 0x078644FA}, {0x078644FA, 0xFFFFFFFE, 0x078644FA}, {0x078644FA, 0xFFFFFFFF, 0x078644FA}, {0x0747AE14, 0x00000001, 0x00000000}, {0x0747AE14, 0x00000002, 0x00000000}, {0x0747AE14, 0x00000003, 0x00000002}, {0x0747AE14, 0x00000010, 0x00000004}, {0x0747AE14, 0x078644FA, 0x0747AE14}, {0x0747AE14, 0x0747AE14, 0x00000000}, {0x0747AE14, 0x7FFFFFFF, 0x0747AE14}, {0x0747AE14, 0x80000000, 0x0747AE14}, {0x0747AE14, 0xFFFFFFFD, 0x0747AE14}, {0x0747AE14, 0xFFFFFFFE, 0x0747AE14}, {0x0747AE14, 0xFFFFFFFF, 0x0747AE14}, {0x7FFFFFFF, 0x00000001, 0x00000000}, {0x7FFFFFFF, 0x00000002, 0x00000001}, {0x7FFFFFFF, 0x00000003, 0x00000001}, {0x7FFFFFFF, 0x00000010, 0x0000000F}, {0x7FFFFFFF, 0x078644FA, 0x00156B65}, {0x7FFFFFFF, 0x0747AE14, 0x043D70AB}, {0x7FFFFFFF, 0x7FFFFFFF, 0x00000000}, {0x7FFFFFFF, 0x80000000, 0x7FFFFFFF}, {0x7FFFFFFF, 0xFFFFFFFD, 0x7FFFFFFF}, {0x7FFFFFFF, 0xFFFFFFFE, 0x7FFFFFFF}, {0x7FFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF}, {0x80000000, 0x00000001, 0x00000000}, {0x80000000, 0x00000002, 0x00000000}, {0x80000000, 0x00000003, 0x00000002}, {0x80000000, 0x00000010, 0x00000000}, {0x80000000, 0x078644FA, 0x00156B66}, {0x80000000, 0x0747AE14, 0x043D70AC}, {0x80000000, 0x7FFFFFFF, 0x00000001}, {0x80000000, 0x80000000, 0x00000000}, {0x80000000, 0xFFFFFFFD, 0x80000000}, {0x80000000, 0xFFFFFFFE, 0x80000000}, {0x80000000, 0xFFFFFFFF, 0x80000000}, {0xFFFFFFFD, 0x00000001, 0x00000000}, {0xFFFFFFFD, 0x00000002, 0x00000001}, {0xFFFFFFFD, 0x00000003, 0x00000001}, {0xFFFFFFFD, 0x00000010, 0x0000000D}, {0xFFFFFFFD, 0x078644FA, 0x002AD6C9}, {0xFFFFFFFD, 0x0747AE14, 0x01333341}, {0xFFFFFFFD, 0x7FFFFFFF, 0x7FFFFFFE}, {0xFFFFFFFD, 0x80000000, 0x7FFFFFFD}, {0xFFFFFFFD, 0xFFFFFFFD, 0x00000000}, {0xFFFFFFFD, 0xFFFFFFFE, 0xFFFFFFFD}, {0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFD}, {0xFFFFFFFE, 0x00000001, 0x00000000}, {0xFFFFFFFE, 0x00000002, 0x00000000}, {0xFFFFFFFE, 0x00000003, 0x00000002}, {0xFFFFFFFE, 0x00000010, 0x0000000E}, {0xFFFFFFFE, 0x078644FA, 0x002AD6CA}, {0xFFFFFFFE, 0x0747AE14, 0x01333342}, {0xFFFFFFFE, 0x7FFFFFFF, 0x00000000}, {0xFFFFFFFE, 0x80000000, 0x7FFFFFFE}, {0xFFFFFFFE, 0xFFFFFFFD, 0x00000001}, {0xFFFFFFFE, 0xFFFFFFFE, 0x00000000}, {0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFE}, {0xFFFFFFFF, 0x00000001, 0x00000000}, {0xFFFFFFFF, 0x00000002, 0x00000001}, {0xFFFFFFFF, 0x00000003, 0x00000000}, {0xFFFFFFFF, 0x00000010, 0x0000000F}, {0xFFFFFFFF, 0x078644FA, 0x002AD6CB}, {0xFFFFFFFF, 0x0747AE14, 0x01333343}, {0xFFFFFFFF, 0x7FFFFFFF, 0x00000001}, {0xFFFFFFFF, 0x80000000, 0x7FFFFFFF}, {0xFFFFFFFF, 0xFFFFFFFD, 0x00000002}, {0xFFFFFFFF, 0xFFFFFFFE, 0x00000001}, {0xFFFFFFFF, 0xFFFFFFFF, 0x00000000} }; int main() { const unsigned N = sizeof(tests) / sizeof(tests[0]); unsigned i; for (i = 0; i < N; ++i) if (test__umodsi3(tests[i][0], tests[i][1], tests[i][2])) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/addvsi3_test.c0000664000175000017500000000312012516462465027477 0ustar mwhudsonmwhudson//===-- addvsi3_test.c - Test __addvsi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __addvsi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a + b // Effects: aborts if a + b overflows COMPILER_RT_ABI si_int __addvsi3(si_int a, si_int b); int test__addvsi3(si_int a, si_int b) { si_int x = __addvsi3(a, b); si_int expected = a + b; if (x != expected) printf("error in test__addvsi3(0x%X, 0x%X) = %d, expected %d\n", a, b, x, expected); return x != expected; } int main() { // test__addvsi3(0x80000000, -1); // should abort // test__addvsi3(-1, 0x80000000); // should abort // test__addvsi3(1, 0x7FFFFFFF); // should abort // test__addvsi3(0x7FFFFFFF, 1); // should abort if (test__addvsi3(0x80000000, 1)) return 1; if (test__addvsi3(1, 0x80000000)) return 1; if (test__addvsi3(0x80000000, 0)) return 1; if (test__addvsi3(0, 0x80000000)) return 1; if (test__addvsi3(0x7FFFFFFF, -1)) return 1; if (test__addvsi3(-1, 0x7FFFFFFF)) return 1; if (test__addvsi3(0x7FFFFFFF, 0)) return 1; if (test__addvsi3(0, 0x7FFFFFFF)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulvdi3_test.c0000664000175000017500000001411712516462465027535 0ustar mwhudsonmwhudson//===-- mulvdi3_test.c - Test __mulvdi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulvdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a * b // Effects: aborts if a * b overflows COMPILER_RT_ABI di_int __mulvdi3(di_int a, di_int b); int test__mulvdi3(di_int a, di_int b, di_int expected) { di_int x = __mulvdi3(a, b); if (x != expected) printf("error in __mulvdi3: %lld * %lld = %lld, expected %lld\n", a, b, x, expected); return x != expected; } int main() { if (test__mulvdi3(0, 0, 0)) return 1; if (test__mulvdi3(0, 1, 0)) return 1; if (test__mulvdi3(1, 0, 0)) return 1; if (test__mulvdi3(0, 10, 0)) return 1; if (test__mulvdi3(10, 0, 0)) return 1; if (test__mulvdi3(0, 81985529216486895LL, 0)) return 1; if (test__mulvdi3(81985529216486895LL, 0, 0)) return 1; if (test__mulvdi3(0, -1, 0)) return 1; if (test__mulvdi3(-1, 0, 0)) return 1; if (test__mulvdi3(0, -10, 0)) return 1; if (test__mulvdi3(-10, 0, 0)) return 1; if (test__mulvdi3(0, -81985529216486895LL, 0)) return 1; if (test__mulvdi3(-81985529216486895LL, 0, 0)) return 1; if (test__mulvdi3(1, 1, 1)) return 1; if (test__mulvdi3(1, 10, 10)) return 1; if (test__mulvdi3(10, 1, 10)) return 1; if (test__mulvdi3(1, 81985529216486895LL, 81985529216486895LL)) return 1; if (test__mulvdi3(81985529216486895LL, 1, 81985529216486895LL)) return 1; if (test__mulvdi3(1, -1, -1)) return 1; if (test__mulvdi3(1, -10, -10)) return 1; if (test__mulvdi3(-10, 1, -10)) return 1; if (test__mulvdi3(1, -81985529216486895LL, -81985529216486895LL)) return 1; if (test__mulvdi3(-81985529216486895LL, 1, -81985529216486895LL)) return 1; if (test__mulvdi3(3037000499LL, 3037000499LL, 9223372030926249001LL)) return 1; if (test__mulvdi3(-3037000499LL, 3037000499LL, -9223372030926249001LL)) return 1; if (test__mulvdi3(3037000499LL, -3037000499LL, -9223372030926249001LL)) return 1; if (test__mulvdi3(-3037000499LL, -3037000499LL, 9223372030926249001LL)) return 1; if (test__mulvdi3(4398046511103LL, 2097152LL, 9223372036852678656LL)) return 1; if (test__mulvdi3(-4398046511103LL, 2097152LL, -9223372036852678656LL)) return 1; if (test__mulvdi3(4398046511103LL, -2097152LL, -9223372036852678656LL)) return 1; if (test__mulvdi3(-4398046511103LL, -2097152LL, 9223372036852678656LL)) return 1; if (test__mulvdi3(2097152LL, 4398046511103LL, 9223372036852678656LL)) return 1; if (test__mulvdi3(-2097152LL, 4398046511103LL, -9223372036852678656LL)) return 1; if (test__mulvdi3(2097152LL, -4398046511103LL, -9223372036852678656LL)) return 1; if (test__mulvdi3(-2097152LL, -4398046511103LL, 9223372036852678656LL)) return 1; // if (test__mulvdi3(0x7FFFFFFFFFFFFFFFLL, -2, 0x8000000000000001LL)) // abort // return 1; // if (test__mulvdi3(-2, 0x7FFFFFFFFFFFFFFFLL, 0x8000000000000001LL)) // abort // return 1; if (test__mulvdi3(0x7FFFFFFFFFFFFFFFLL, -1, 0x8000000000000001LL)) return 1; if (test__mulvdi3(-1, 0x7FFFFFFFFFFFFFFFLL, 0x8000000000000001LL)) return 1; if (test__mulvdi3(0x7FFFFFFFFFFFFFFFLL, 0, 0)) return 1; if (test__mulvdi3(0, 0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__mulvdi3(0x7FFFFFFFFFFFFFFFLL, 1, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__mulvdi3(1, 0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL)) return 1; // if (test__mulvdi3(0x7FFFFFFFFFFFFFFFLL, 2, 0x8000000000000001LL)) // abort // return 1; // if (test__mulvdi3(2, 0x7FFFFFFFFFFFFFFFLL, 0x8000000000000001LL)) // abort // return 1; // if (test__mulvdi3(0x8000000000000000LL, -2, 0x8000000000000000LL)) // abort // return 1; // if (test__mulvdi3(-2, 0x8000000000000000LL, 0x8000000000000000LL)) // abort // return 1; // if (test__mulvdi3(0x8000000000000000LL, -1, 0x8000000000000000LL)) // abort // return 1; // if (test__mulvdi3(-1, 0x8000000000000000LL, 0x8000000000000000LL)) // abort // return 1; if (test__mulvdi3(0x8000000000000000LL, 0, 0)) return 1; if (test__mulvdi3(0, 0x8000000000000000LL, 0)) return 1; if (test__mulvdi3(0x8000000000000000LL, 1, 0x8000000000000000LL)) return 1; if (test__mulvdi3(1, 0x8000000000000000LL, 0x8000000000000000LL)) return 1; // if (test__mulvdi3(0x8000000000000000LL, 2, 0x8000000000000000LL)) // abort // return 1; // if (test__mulvdi3(2, 0x8000000000000000LL, 0x8000000000000000LL)) // abort // return 1; // if (test__mulvdi3(0x8000000000000001LL, -2, 0x8000000000000001LL)) // abort // return 1; // if (test__mulvdi3(-2, 0x8000000000000001LL, 0x8000000000000001LL)) // abort // return 1; if (test__mulvdi3(0x8000000000000001LL, -1, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__mulvdi3(-1, 0x8000000000000001LL, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__mulvdi3(0x8000000000000001LL, 0, 0)) return 1; if (test__mulvdi3(0, 0x8000000000000001LL, 0)) return 1; if (test__mulvdi3(0x8000000000000001LL, 1, 0x8000000000000001LL)) return 1; if (test__mulvdi3(1, 0x8000000000000001LL, 0x8000000000000001LL)) return 1; // if (test__mulvdi3(0x8000000000000001LL, 2, 0x8000000000000000LL)) // abort // return 1; // if (test__mulvdi3(2, 0x8000000000000001LL, 0x8000000000000000LL)) // abort // return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunssfti_test.c0000664000175000017500000000705612516462465030360 0ustar mwhudsonmwhudson//===-- fixunssfti_test.c - Test __fixunssfti -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunssfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: float is a IEEE 32 bit floating point type // tu_int is a 64 bit integral type // value in float is representable in tu_int or is negative // (no range checking performed) // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI tu_int __fixunssfti(float a); int test__fixunssfti(float a, tu_int expected) { tu_int x = __fixunssfti(a); if (x != expected) { utwords xt; xt.all = x; utwords expectedt; expectedt.all = expected; printf("error in __fixunssfti(%A) = 0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(tu_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__fixunssfti(0.0F, 0)) return 1; if (test__fixunssfti(0.5F, 0)) return 1; if (test__fixunssfti(0.99F, 0)) return 1; if (test__fixunssfti(1.0F, 1)) return 1; if (test__fixunssfti(1.5F, 1)) return 1; if (test__fixunssfti(1.99F, 1)) return 1; if (test__fixunssfti(2.0F, 2)) return 1; if (test__fixunssfti(2.01F, 2)) return 1; if (test__fixunssfti(-0.5F, 0)) return 1; if (test__fixunssfti(-0.99F, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunssfti(-1.0F, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunssfti(-1.5F, 0)) return 1; if (test__fixunssfti(-1.99F, 0)) return 1; if (test__fixunssfti(-2.0F, 0)) return 1; if (test__fixunssfti(-2.01F, 0)) return 1; #endif if (test__fixunssfti(0x1.FFFFFEp+63F, 0xFFFFFF0000000000LL)) return 1; if (test__fixunssfti(0x1.000000p+63F, 0x8000000000000000LL)) return 1; if (test__fixunssfti(0x1.FFFFFEp+62F, 0x7FFFFF8000000000LL)) return 1; if (test__fixunssfti(0x1.FFFFFCp+62F, 0x7FFFFF0000000000LL)) return 1; if (test__fixunssfti(0x1.FFFFFEp+127F, make_ti(0xFFFFFF0000000000LL, 0))) return 1; if (test__fixunssfti(0x1.000000p+127F, make_ti(0x8000000000000000LL, 0))) return 1; if (test__fixunssfti(0x1.FFFFFEp+126F, make_ti(0x7FFFFF8000000000LL, 0))) return 1; if (test__fixunssfti(0x1.FFFFFCp+126F, make_ti(0x7FFFFF0000000000LL, 0))) return 1; #if !TARGET_LIBGCC if (test__fixunssfti(-0x1.FFFFFEp+62F, 0x0000000000000000LL)) return 1; if (test__fixunssfti(-0x1.FFFFFCp+62F, 0x0000000000000000LL)) return 1; if (test__fixunssfti(-0x1.FFFFFEp+126F, 0x0000000000000000LL)) return 1; if (test__fixunssfti(-0x1.FFFFFCp+126F, 0x0000000000000000LL)) return 1; #endif #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divtc3_test.c0000664000175000017500000001710712624411755027344 0ustar mwhudsonmwhudson//===-- divtc3_test.c - Test __divtc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divtc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include "int_lib.h" #include #include // Returns: the quotient of (a + ib) / (c + id) COMPILER_RT_ABI long double _Complex __divtc3(long double __a, long double __b, long double __c, long double __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(long double _Complex x) { if (x == 0) return zero; if (isinf(creall(x)) || isinf(cimagl(x))) return inf; if (isnan(creall(x)) && isnan(cimagl(x))) return NaN; if (isnan(creall(x))) { if (cimagl(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimagl(x))) { if (creall(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__divtc3(long double a, long double b, long double c, long double d) { long double _Complex r = __divtc3(a, b, c, d); // printf("test__divtc3(%Lf, %Lf, %Lf, %Lf) = %Lf + I%Lf\n", // a, b, c, d, creall(r), cimagl(r)); long double _Complex dividend; long double _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; { long double _Complex z = (a * c + b * d) / (c * c + d * d) + (b * c - a * d) / (c * c + d * d) * _Complex_I; if (cabsl((r - z)/r) > 1.e-6) return 1; } break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } long double x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; int main() { const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__divtc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } // printf("No errors found.\n"); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/umodti3_test.c0000664000175000017500000000332512516462465027535 0ustar mwhudsonmwhudson//===-- umodti3_test.c - Test __umodti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __umodti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a % b COMPILER_RT_ABI tu_int __umodti3(tu_int a, tu_int b); int test__umodti3(tu_int a, tu_int b, tu_int expected_r) { tu_int r = __umodti3(a, b); if (r != expected_r) { utwords at; at.all = a; utwords bt; bt.all = b; utwords rt; rt.all = r; utwords expected_rt; expected_rt.all = expected_r; printf("error in __umodti3: 0x%llX%.16llX %% 0x%llX%.16llX = " "0x%llX%.16llX, expected 0x%llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, rt.s.high, rt.s.low, expected_rt.s.high, expected_rt.s.low); } return r != expected_r; } #endif int main() { #ifdef CRT_HAS_128BIT if (test__umodti3(0, 1, 0)) return 1; if (test__umodti3(2, 1, 0)) return 1; if (test__umodti3(make_tu(0x8000000000000000uLL, 0), 1, 0x0uLL)) return 1; if (test__umodti3(make_tu(0x8000000000000000uLL, 0), 2, 0x0uLL)) return 1; if (test__umodti3(make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), 2, 0x1uLL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negvdi2_test.c0000664000175000017500000000303112516462465027501 0ustar mwhudsonmwhudson//===-- negvdi2_test.c - Test __negvdi2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negvdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: -a // Effects: aborts if -a overflows COMPILER_RT_ABI di_int __negvdi2(di_int a); int test__negvdi2(di_int a) { di_int x = __negvdi2(a); di_int expected = -a; if (x != expected) printf("error in __negvdi2(0x%llX) = %lld, expected %lld\n", a, x, expected); return x != expected; } int main() { // if (test__negvdi2(0x8000000000000000LL)) // should abort // return 1; if (test__negvdi2(0x0000000000000000LL)) return 1; if (test__negvdi2(0x0000000000000001LL)) return 1; if (test__negvdi2(0x0000000000000002LL)) return 1; if (test__negvdi2(0x7FFFFFFFFFFFFFFELL)) return 1; if (test__negvdi2(0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__negvdi2(0x8000000000000001LL)) return 1; if (test__negvdi2(0x8000000000000002LL)) return 1; if (test__negvdi2(0xFFFFFFFFFFFFFFFELL)) return 1; if (test__negvdi2(0xFFFFFFFFFFFFFFFFLL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/addvdi3_test.c0000664000175000017500000000331712516462465027470 0ustar mwhudsonmwhudson//===-- addvdi3_test.c - Test __addvdi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __addvdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a + b // Effects: aborts if a + b overflows COMPILER_RT_ABI di_int __addvdi3(di_int a, di_int b); int test__addvdi3(di_int a, di_int b) { di_int x = __addvdi3(a, b); di_int expected = a + b; if (x != expected) printf("error in test__addvdi3(0x%llX, 0x%llX) = %lld, expected %lld\n", a, b, x, expected); return x != expected; } int main() { // test__addvdi3(0x8000000000000000LL, -1); // should abort // test__addvdi3(-1, 0x8000000000000000LL); // should abort // test__addvdi3(1, 0x7FFFFFFFFFFFFFFFLL); // should abort // test__addvdi3(0x7FFFFFFFFFFFFFFFLL, 1); // should abort if (test__addvdi3(0x8000000000000000LL, 1)) return 1; if (test__addvdi3(1, 0x8000000000000000LL)) return 1; if (test__addvdi3(0x8000000000000000LL, 0)) return 1; if (test__addvdi3(0, 0x8000000000000000LL)) return 1; if (test__addvdi3(0x7FFFFFFFFFFFFFFLL, -1)) return 1; if (test__addvdi3(-1, 0x7FFFFFFFFFFFFFFLL)) return 1; if (test__addvdi3(0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__addvdi3(0, 0x7FFFFFFFFFFFFFFFLL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/muldi3_test.c0000664000175000017500000000655312516462465027354 0ustar mwhudsonmwhudson//===-- muldi3_test.c - Test __muldi3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __muldi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include COMPILER_RT_ABI di_int __muldi3(di_int a, di_int b); int test__muldi3(di_int a, di_int b, di_int expected) { di_int x = __muldi3(a, b); if (x != expected) printf("error in __muldi3: %lld * %lld = %lld, expected %lld\n", a, b, __muldi3(a, b), expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__muldi3(0, 0, 0)) return 1; if (test__muldi3(0, 1, 0)) return 1; if (test__muldi3(1, 0, 0)) return 1; if (test__muldi3(0, 10, 0)) return 1; if (test__muldi3(10, 0, 0)) return 1; if (test__muldi3(0, 81985529216486895LL, 0)) return 1; if (test__muldi3(81985529216486895LL, 0, 0)) return 1; if (test__muldi3(0, -1, 0)) return 1; if (test__muldi3(-1, 0, 0)) return 1; if (test__muldi3(0, -10, 0)) return 1; if (test__muldi3(-10, 0, 0)) return 1; if (test__muldi3(0, -81985529216486895LL, 0)) return 1; if (test__muldi3(-81985529216486895LL, 0, 0)) return 1; if (test__muldi3(1, 1, 1)) return 1; if (test__muldi3(1, 10, 10)) return 1; if (test__muldi3(10, 1, 10)) return 1; if (test__muldi3(1, 81985529216486895LL, 81985529216486895LL)) return 1; if (test__muldi3(81985529216486895LL, 1, 81985529216486895LL)) return 1; if (test__muldi3(1, -1, -1)) return 1; if (test__muldi3(1, -10, -10)) return 1; if (test__muldi3(-10, 1, -10)) return 1; if (test__muldi3(1, -81985529216486895LL, -81985529216486895LL)) return 1; if (test__muldi3(-81985529216486895LL, 1, -81985529216486895LL)) return 1; if (test__muldi3(3037000499LL, 3037000499LL, 9223372030926249001LL)) return 1; if (test__muldi3(-3037000499LL, 3037000499LL, -9223372030926249001LL)) return 1; if (test__muldi3(3037000499LL, -3037000499LL, -9223372030926249001LL)) return 1; if (test__muldi3(-3037000499LL, -3037000499LL, 9223372030926249001LL)) return 1; if (test__muldi3(4398046511103LL, 2097152LL, 9223372036852678656LL)) return 1; if (test__muldi3(-4398046511103LL, 2097152LL, -9223372036852678656LL)) return 1; if (test__muldi3(4398046511103LL, -2097152LL, -9223372036852678656LL)) return 1; if (test__muldi3(-4398046511103LL, -2097152LL, 9223372036852678656LL)) return 1; if (test__muldi3(2097152LL, 4398046511103LL, 9223372036852678656LL)) return 1; if (test__muldi3(-2097152LL, 4398046511103LL, -9223372036852678656LL)) return 1; if (test__muldi3(2097152LL, -4398046511103LL, -9223372036852678656LL)) return 1; if (test__muldi3(-2097152LL, -4398046511103LL, 9223372036852678656LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/multf3_test.c0000664000175000017500000000601512616720672027360 0ustar mwhudsonmwhudson//===--------------- multf3_test.c - Test __multf3 ------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __multf3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" // Returns: a * b COMPILER_RT_ABI long double __multf3(long double a, long double b); int test__multf3(long double a, long double b, uint64_t expectedHi, uint64_t expectedLo) { long double x = __multf3(a, b); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret){ printf("error in test__multf3(%.20Lf, %.20Lf) = %.20Lf, " "expected %.20Lf\n", a, b, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN * any = qNaN if (test__multf3(makeQNaN128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // NaN * any = NaN if (test__multf3(makeNaN128(UINT64_C(0x800030000000)), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // inf * any = inf if (test__multf3(makeInf128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // any * any if (test__multf3(0x1.2eab345678439abcdefea56782346p+5L, 0x1.edcb34a235253948765432134674fp-1L, UINT64_C(0x400423e7f9e3c9fc), UINT64_C(0xd906c2c2a85777c4))) return 1; if (test__multf3(0x1.353e45674d89abacc3a2ebf3ff4ffp-50L, 0x1.ed8764648369535adf4be3214567fp-9L, UINT64_C(0x3fc52a163c6223fc), UINT64_C(0xc94c4bf0430768b4))) return 1; if (test__multf3(0x1.234425696abcad34a35eeffefdcbap+456L, 0x451.ed98d76e5d46e5f24323dff21ffp+600L, UINT64_C(0x44293a91de5e0e94), UINT64_C(0xe8ed17cc2cdf64ac))) return 1; if (test__multf3(0x1.4356473c82a9fabf2d22ace345defp-234L, 0x1.eda98765476743ab21da23d45678fp-455L, UINT64_C(0x3d4f37c1a3137cae), UINT64_C(0xfc6807048bc2836a))) return 1; // underflow if (test__multf3(0x1.23456734245345p-10000L, 0x1.edcba524498724p-6497L, UINT64_C(0x0), UINT64_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ucmpti2_test.c0000664000175000017500000000771012516462465027536 0ustar mwhudsonmwhudson//===-- ucmpti2_test.c - Test __ucmpti2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ucmpti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: if (a < b) returns 0 // if (a == b) returns 1 // if (a > b) returns 2 COMPILER_RT_ABI si_int __ucmpti2(tu_int a, tu_int b); int test__ucmpti2(tu_int a, tu_int b, si_int expected) { si_int x = __ucmpti2(a, b); if (x != expected) { utwords at; at.all = a; utwords bt; bt.all = b; printf("error in __ucmpti2(0x%.16llX%.16llX, 0x%.16llX%.16llX) = %d, " "expected %d\n", at.s.high, at.s.low, bt.s.high, bt.s.low, x, expected); } return x != expected; } #endif int main() { #ifdef CRT_HAS_128BIT if (test__ucmpti2(0, 0, 1)) return 1; if (test__ucmpti2(1, 1, 1)) return 1; if (test__ucmpti2(2, 2, 1)) return 1; if (test__ucmpti2(0x7FFFFFFF, 0x7FFFFFFF, 1)) return 1; if (test__ucmpti2(0x80000000, 0x80000000, 1)) return 1; if (test__ucmpti2(0x80000001, 0x80000001, 1)) return 1; if (test__ucmpti2(0xFFFFFFFF, 0xFFFFFFFF, 1)) return 1; if (test__ucmpti2(0x000000010000000LL, 0x000000010000000LL, 1)) return 1; if (test__ucmpti2(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL, 1)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000300000001LL, 0)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000300000002LL, 0)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000300000003LL, 0)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000100000001LL, 2)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000100000002LL, 2)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000100000003LL, 2)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000200000001LL, 2)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000200000002LL, 1)) return 1; if (test__ucmpti2(0x0000000200000002LL, 0x0000000200000003LL, 0)) return 1; if (test__ucmpti2(make_tu(0x0000000000000001uLL, 0x0000000000000000uLL), make_tu(0x0000000000000000uLL, 0xFFFFFFFFFFFFFFFFuLL), 2)) return 1; if (test__ucmpti2(make_tu(0x0000000000000001uLL, 0x0000000000000000uLL), make_tu(0x0000000000000001uLL, 0x0000000000000000uLL), 1)) return 1; if (test__ucmpti2(make_tu(0x0000000000000001uLL, 0x0000000000000000uLL), make_tu(0x0000000000000001uLL, 0x0000000000000001uLL), 0)) return 1; if (test__ucmpti2(make_tu(0x8000000000000000uLL, 0x0000000000000000uLL), make_tu(0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), 2)) return 1; if (test__ucmpti2(make_tu(0x8000000000000000uLL, 0x0000000000000000uLL), make_tu(0x8000000000000000uLL, 0x0000000000000000uLL), 1)) return 1; if (test__ucmpti2(make_tu(0x8000000000000000uLL, 0x0000000000000000uLL), make_tu(0x8000000000000000uLL, 0x0000000000000001uLL), 0)) return 1; if (test__ucmpti2(make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFEuLL), 2)) return 1; if (test__ucmpti2(make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), 1)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/lesf2vfp_test.c0000664000175000017500000000245611570537001027670 0ustar mwhudsonmwhudson//===-- lesf2vfp_test.c - Test __lesf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __lesf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __lesf2vfp(float a, float b); #if __arm__ int test__lesf2vfp(float a, float b) { int actual = __lesf2vfp(a, b); int expected = (a <= b) ? 1 : 0; if (actual != expected) printf("error in __lesf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__lesf2vfp(0.0, 0.0)) return 1; if (test__lesf2vfp(1.0, 1.0)) return 1; if (test__lesf2vfp(-1.0, -2.0)) return 1; if (test__lesf2vfp(-2.0, -1.0)) return 1; if (test__lesf2vfp(HUGE_VALF, 1.0)) return 1; if (test__lesf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/netf2_test.c0000664000175000017500000000475712316541140027163 0ustar mwhudsonmwhudson//===------------ netf2_test.c - Test __netf2------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __netf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __netf2(long double a, long double b); int test__netf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __netf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__netf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__netf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // < // exp if (test__netf2(0x1.234567890abcdef1234567890abcp-3L, 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // mantissa if (test__netf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // sign if (test__netf2(-0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // == if (test__netf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, EQUAL_0)) return 1; // > // exp if (test__netf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, NEQUAL_0)) return 1; // mantissa if (test__netf2(0x1.334567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // sign if (test__netf2(0x1.234567890abcdef1234567890abcp+3L, -0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/powidf2_test.c0000664000175000017500000001377612516462465027536 0ustar mwhudsonmwhudson//===-- powidf2_test.cpp - Test __powidf2 ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __powidf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: a ^ b COMPILER_RT_ABI double __powidf2(double a, si_int b); int test__powidf2(double a, si_int b, double expected) { double x = __powidf2(a, b); int correct = (x == expected) && (signbit(x) == signbit(expected)); if (!correct) printf("error in __powidf2(%f, %d) = %f, expected %f\n", a, b, x, expected); return !correct; } int main() { if (test__powidf2(0, 0, 1)) return 1; if (test__powidf2(1, 0, 1)) return 1; if (test__powidf2(1.5, 0, 1)) return 1; if (test__powidf2(2, 0, 1)) return 1; if (test__powidf2(INFINITY, 0, 1)) return 1; if (test__powidf2(-0., 0, 1)) return 1; if (test__powidf2(-1, 0, 1)) return 1; if (test__powidf2(-1.5, 0, 1)) return 1; if (test__powidf2(-2, 0, 1)) return 1; if (test__powidf2(-INFINITY, 0, 1)) return 1; if (test__powidf2(0, 1, 0)) return 1; if (test__powidf2(0, 2, 0)) return 1; if (test__powidf2(0, 3, 0)) return 1; if (test__powidf2(0, 4, 0)) return 1; if (test__powidf2(0, 0x7FFFFFFE, 0)) return 1; if (test__powidf2(0, 0x7FFFFFFF, 0)) return 1; if (test__powidf2(-0., 1, -0.)) return 1; if (test__powidf2(-0., 2, 0)) return 1; if (test__powidf2(-0., 3, -0.)) return 1; if (test__powidf2(-0., 4, 0)) return 1; if (test__powidf2(-0., 0x7FFFFFFE, 0)) return 1; if (test__powidf2(-0., 0x7FFFFFFF, -0.)) return 1; if (test__powidf2(1, 1, 1)) return 1; if (test__powidf2(1, 2, 1)) return 1; if (test__powidf2(1, 3, 1)) return 1; if (test__powidf2(1, 4, 1)) return 1; if (test__powidf2(1, 0x7FFFFFFE, 1)) return 1; if (test__powidf2(1, 0x7FFFFFFF, 1)) return 1; if (test__powidf2(INFINITY, 1, INFINITY)) return 1; if (test__powidf2(INFINITY, 2, INFINITY)) return 1; if (test__powidf2(INFINITY, 3, INFINITY)) return 1; if (test__powidf2(INFINITY, 4, INFINITY)) return 1; if (test__powidf2(INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powidf2(INFINITY, 0x7FFFFFFF, INFINITY)) return 1; if (test__powidf2(-INFINITY, 1, -INFINITY)) return 1; if (test__powidf2(-INFINITY, 2, INFINITY)) return 1; if (test__powidf2(-INFINITY, 3, -INFINITY)) return 1; if (test__powidf2(-INFINITY, 4, INFINITY)) return 1; if (test__powidf2(-INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powidf2(-INFINITY, 0x7FFFFFFF, -INFINITY)) return 1; if (test__powidf2(0, -1, INFINITY)) return 1; if (test__powidf2(0, -2, INFINITY)) return 1; if (test__powidf2(0, -3, INFINITY)) return 1; if (test__powidf2(0, -4, INFINITY)) return 1; if (test__powidf2(0, 0x80000002, INFINITY)) return 1; if (test__powidf2(0, 0x80000001, INFINITY)) return 1; if (test__powidf2(0, 0x80000000, INFINITY)) return 1; if (test__powidf2(-0., -1, -INFINITY)) return 1; if (test__powidf2(-0., -2, INFINITY)) return 1; if (test__powidf2(-0., -3, -INFINITY)) return 1; if (test__powidf2(-0., -4, INFINITY)) return 1; if (test__powidf2(-0., 0x80000002, INFINITY)) return 1; if (test__powidf2(-0., 0x80000001, -INFINITY)) return 1; if (test__powidf2(-0., 0x80000000, INFINITY)) return 1; if (test__powidf2(1, -1, 1)) return 1; if (test__powidf2(1, -2, 1)) return 1; if (test__powidf2(1, -3, 1)) return 1; if (test__powidf2(1, -4, 1)) return 1; if (test__powidf2(1, 0x80000002, 1)) return 1; if (test__powidf2(1, 0x80000001, 1)) return 1; if (test__powidf2(1, 0x80000000, 1)) return 1; if (test__powidf2(INFINITY, -1, 0)) return 1; if (test__powidf2(INFINITY, -2, 0)) return 1; if (test__powidf2(INFINITY, -3, 0)) return 1; if (test__powidf2(INFINITY, -4, 0)) return 1; if (test__powidf2(INFINITY, 0x80000002, 0)) return 1; if (test__powidf2(INFINITY, 0x80000001, 0)) return 1; if (test__powidf2(INFINITY, 0x80000000, 0)) return 1; if (test__powidf2(-INFINITY, -1, -0.)) return 1; if (test__powidf2(-INFINITY, -2, 0)) return 1; if (test__powidf2(-INFINITY, -3, -0.)) return 1; if (test__powidf2(-INFINITY, -4, 0)) return 1; if (test__powidf2(-INFINITY, 0x80000002, 0)) return 1; if (test__powidf2(-INFINITY, 0x80000001, -0.)) return 1; if (test__powidf2(-INFINITY, 0x80000000, 0)) return 1; if (test__powidf2(2, 10, 1024.)) return 1; if (test__powidf2(-2, 10, 1024.)) return 1; if (test__powidf2(2, -10, 1/1024.)) return 1; if (test__powidf2(-2, -10, 1/1024.)) return 1; if (test__powidf2(2, 19, 524288.)) return 1; if (test__powidf2(-2, 19, -524288.)) return 1; if (test__powidf2(2, -19, 1/524288.)) return 1; if (test__powidf2(-2, -19, -1/524288.)) return 1; if (test__powidf2(2, 31, 2147483648.)) return 1; if (test__powidf2(-2, 31, -2147483648.)) return 1; if (test__powidf2(2, -31, 1/2147483648.)) return 1; if (test__powidf2(-2, -31, -1/2147483648.)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/extendsftf2_test.c0000664000175000017500000000456312516462465030412 0ustar mwhudsonmwhudson//===--------------- extendsftf2_test.c - Test __extendsftf2 --------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __extendsftf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" COMPILER_RT_ABI long double __extendsftf2(float a); int test__extendsftf2(float a, uint64_t expectedHi, uint64_t expectedLo) { long double x = __extendsftf2(a); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret) { printf("error in test__extendsftf2(%f) = %.20Lf, " "expected %.20Lf\n", a, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN if (test__extendsftf2(makeQNaN32(), UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // NaN if (test__extendsftf2(makeNaN32(UINT32_C(0x410000)), UINT64_C(0x7fff820000000000), UINT64_C(0x0))) return 1; // inf if (test__extendsftf2(makeInf32(), UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // zero if (test__extendsftf2(0.0f, UINT64_C(0x0), UINT64_C(0x0))) return 1; if (test__extendsftf2(0x1.23456p+5f, UINT64_C(0x4004234560000000), UINT64_C(0x0))) return 1; if (test__extendsftf2(0x1.edcbap-9f, UINT64_C(0x3ff6edcba0000000), UINT64_C(0x0))) return 1; if (test__extendsftf2(0x1.23456p+45f, UINT64_C(0x402c234560000000), UINT64_C(0x0))) return 1; if (test__extendsftf2(0x1.edcbap-45f, UINT64_C(0x3fd2edcba0000000), UINT64_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixtfdi_test.c0000664000175000017500000000365612616720672027613 0ustar mwhudsonmwhudson//===--------------- fixtfdi_test.c - Test __fixtfdi ----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixtfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" di_int __fixtfdi(long double a); int test__fixtfdi(long double a, di_int expected) { di_int x = __fixtfdi(a); int ret = (x != expected); if (ret) { printf("error in test__fixtfdi(%.20Lf) = %llX, " "expected %llX\n", a, x, expected); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__fixtfdi(makeInf128(), 0x7fffffffffffffffLL)) return 1; if (test__fixtfdi(0, 0x0)) return 1; if (test__fixtfdi(0x1.23456789abcdefp+5L, 0x24LL)) return 1; if (test__fixtfdi(0x1.23456789abcdefp-3L, 0x0LL)) return 1; if (test__fixtfdi(0x1.23456789abcdef12345678p+20L, 0x123456LL)) return 1; if (test__fixtfdi(0x1.23456789abcdef12345678p+40L, 0x123456789abLL)) return 1; if (test__fixtfdi(0x1.23456789abcdef12345678p+60L, 0x123456789abcdef1LL)) return 1; if (test__fixtfdi(0x1.23456789abcdefp+256L, 0x7fffffffffffffffLL)) return 1; if (test__fixtfdi(-0x1.23456789abcdefp+20L, 0xffffffffffedcbaaLL)) return 1; if (test__fixtfdi(-0x1.23456789abcdefp+40L, 0xfffffedcba987655LL)) return 1; if (test__fixtfdi(-0x1.23456789abcdefp+256L, 0x8000000000000000LL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/nedf2vfp_test.c0000664000175000017500000000237211570537001027650 0ustar mwhudsonmwhudson//===-- nedf2vfp_test.c - Test __nedf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __nedf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __nedf2vfp(double a, double b); #if __arm__ int test__nedf2vfp(double a, double b) { int actual = __nedf2vfp(a, b); int expected = (a != b) ? 1 : 0; if (actual != expected) printf("error in __nedf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__nedf2vfp(0.0, 0.0)) return 1; if (test__nedf2vfp(1.0, 1.0)) return 1; if (test__nedf2vfp(-1.0, -1.0)) return 1; if (test__nedf2vfp(HUGE_VAL, 1.0)) return 1; if (test__nedf2vfp(1.0, HUGE_VAL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/paritysi2_test.c0000664000175000017500000000230212516462465030071 0ustar mwhudsonmwhudson//===-- paritysi2_test.c - Test __paritysi2 -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __paritysi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: 1 if number of bits is odd else returns 0 COMPILER_RT_ABI si_int __paritysi2(si_int a); int naive_parity(si_int a) { int r = 0; for (; a; a = a & (a - 1)) r = ~r; return r & 1; } int test__paritysi2(si_int a) { si_int x = __paritysi2(a); si_int expected = naive_parity(a); if (x != expected) printf("error in __paritysi2(0x%X) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_2[sizeof(si_int)*CHAR_BIT == 32] = {0}; int main() { int i; for (i = 0; i < 10000; ++i) if (test__paritysi2(rand())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixdfdi_test.c0000664000175000017500000000532612516462465027571 0ustar mwhudsonmwhudson//===-- fixdfdi_test.c - Test __fixdfdi -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixdfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a signed long long, rounding toward zero. // Assumption: double is a IEEE 64 bit floating point type // su_int is a 32 bit integral type // value in double is representable in di_int (no range checking performed) // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI di_int __fixdfdi(double a); int test__fixdfdi(double a, di_int expected) { di_int x = __fixdfdi(a); if (x != expected) printf("error in __fixdfdi(%A) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; int main() { if (test__fixdfdi(0.0, 0)) return 1; if (test__fixdfdi(0.5, 0)) return 1; if (test__fixdfdi(0.99, 0)) return 1; if (test__fixdfdi(1.0, 1)) return 1; if (test__fixdfdi(1.5, 1)) return 1; if (test__fixdfdi(1.99, 1)) return 1; if (test__fixdfdi(2.0, 2)) return 1; if (test__fixdfdi(2.01, 2)) return 1; if (test__fixdfdi(-0.5, 0)) return 1; if (test__fixdfdi(-0.99, 0)) return 1; if (test__fixdfdi(-1.0, -1)) return 1; if (test__fixdfdi(-1.5, -1)) return 1; if (test__fixdfdi(-1.99, -1)) return 1; if (test__fixdfdi(-2.0, -2)) return 1; if (test__fixdfdi(-2.01, -2)) return 1; if (test__fixdfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixdfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixdfdi(-0x1.FFFFFEp+62, 0x8000008000000000LL)) return 1; if (test__fixdfdi(-0x1.FFFFFCp+62, 0x8000010000000000LL)) return 1; if (test__fixdfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixdfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixdfdi(-0x1.FFFFFFFFFFFFFp+62, 0x8000000000000400LL)) return 1; if (test__fixdfdi(-0x1.FFFFFFFFFFFFEp+62, 0x8000000000000800LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ashlti3_test.c0000664000175000017500000001673112516462465027525 0ustar mwhudsonmwhudson//===-- ashlti3_test.c - Test __ashlti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ashlti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a << b // Precondition: 0 <= b < bits_in_tword COMPILER_RT_ABI ti_int __ashlti3(ti_int a, si_int b); int test__ashlti3(ti_int a, si_int b, ti_int expected) { ti_int x = __ashlti3(a, b); if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __ashlti3: 0x%llX%.16llX << %d = 0x%llX%.16llX," " expected 0x%llX%.16llX\n", at.s.high, at.s.low, b, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 0, make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 1, make_ti(0xFDB97530ECA8642BLL, 0xFDB97530ECA8642ALL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 2, make_ti(0xFB72EA61D950C857LL, 0XFB72EA61D950C854LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 3, make_ti(0xF6E5D4C3B2A190AFLL, 0xF6E5D4C3B2A190A8LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 4, make_ti(0xEDCBA9876543215FLL, 0xEDCBA98765432150LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 28, make_ti(0x876543215FEDCBA9LL, 0x8765432150000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 29, make_ti(0x0ECA8642BFDB9753LL, 0x0ECA8642A0000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 30, make_ti(0x1D950C857FB72EA6LL, 0x1D950C8540000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 31, make_ti(0x3B2A190AFF6E5D4CLL, 0x3B2A190A80000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 32, make_ti(0x76543215FEDCBA98LL, 0x7654321500000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 33, make_ti(0xECA8642BFDB97530LL, 0xECA8642A00000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 34, make_ti(0xD950C857FB72EA61LL, 0xD950C85400000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 35, make_ti(0xB2A190AFF6E5D4C3LL, 0xB2A190A800000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 36, make_ti(0x6543215FEDCBA987LL, 0x6543215000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 60, make_ti(0x5FEDCBA987654321LL, 0x5000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 61, make_ti(0xBFDB97530ECA8642LL, 0xA000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 62, make_ti(0x7FB72EA61D950C85LL, 0x4000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 63, make_ti(0xFF6E5D4C3B2A190ALL, 0x8000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 64, make_ti(0xFEDCBA9876543215LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 65, make_ti(0xFDB97530ECA8642ALL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 66, make_ti(0xFB72EA61D950C854LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 67, make_ti(0xF6E5D4C3B2A190A8LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 68, make_ti(0xEDCBA98765432150LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 92, make_ti(0x8765432150000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 93, make_ti(0x0ECA8642A0000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 94, make_ti(0x1D950C8540000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 95, make_ti(0x3B2A190A80000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 96, make_ti(0x7654321500000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 97, make_ti(0xECA8642A00000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 98, make_ti(0xD950C85400000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 99, make_ti(0xB2A190A800000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 100, make_ti(0x6543215000000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 124, make_ti(0x5000000000000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 125, make_ti(0xA000000000000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 126, make_ti(0x4000000000000000LL, 0x0000000000000000LL))) return 1; if (test__ashlti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 127, make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/enable_execute_stack_test.c0000664000175000017500000000416412452604052032275 0ustar mwhudsonmwhudson//===-- enable_execute_stack_test.c - Test __enable_execute_stack ----------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include #include #include #if defined(_WIN32) #include void __clear_cache(void* start, void* end) { if (!FlushInstructionCache(GetCurrentProcess(), start, end-start)) exit(1); } void __enable_execute_stack(void *addr) { MEMORY_BASIC_INFORMATION b; if (!VirtualQuery(addr, &b, sizeof(b))) exit(1); if (!VirtualProtect(b.BaseAddress, b.RegionSize, PAGE_EXECUTE_READWRITE, &b.Protect)) exit(1); } #else #include extern void __clear_cache(void* start, void* end); extern void __enable_execute_stack(void* addr); #endif typedef int (*pfunc)(void); int func1() { return 1; } int func2() { return 2; } void *__attribute__((noinline)) memcpy_f(void *dst, const void *src, size_t n) { // ARM and MIPS nartually align functions, but use the LSB for ISA selection // (THUMB, MIPS16/uMIPS respectively). Ensure that the ISA bit is ignored in // the memcpy #if defined(__arm__) || defined(__mips__) return (void *)((uintptr_t)memcpy(dst, (void *)((uintptr_t)src & ~1), n) | ((uintptr_t)src & 1)); #else return memcpy(dst, (void *)((uintptr_t)src), n); #endif } int main() { unsigned char execution_buffer[128]; // mark stack page containing execution_buffer to be executable __enable_execute_stack(execution_buffer); // verify you can copy and execute a function pfunc f1 = (pfunc)memcpy_f(execution_buffer, func1, 128); __clear_cache(execution_buffer, &execution_buffer[128]); if ((*f1)() != 1) return 1; // verify you can overwrite a function with another pfunc f2 = (pfunc)memcpy_f(execution_buffer, func2, 128); __clear_cache(execution_buffer, &execution_buffer[128]); if ((*f2)() != 2) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/subsf3vfp_test.c0000664000175000017500000000234312516462465030071 0ustar mwhudsonmwhudson//===-- subsf3vfp_test.c - Test __subsf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __subsf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __subsf3vfp(float a, float b); #if __arm__ int test__subsf3vfp(float a, float b) { float actual = __subsf3vfp(a, b); float expected = a - b; if (actual != expected) printf("error in test__subsf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__subsf3vfp(1.0, 1.0)) return 1; if (test__subsf3vfp(1234.567, 765.4321)) return 1; if (test__subsf3vfp(-123.0, -678.0)) return 1; if (test__subsf3vfp(0.0, -0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatunssidfvfp_test.c0000664000175000017500000000245412516462465031370 0ustar mwhudsonmwhudson//===-- floatunssidfvfp_test.c - Test __floatunssidfvfp -------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatunssidfvfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI double __floatunssidfvfp(unsigned int a); #if __arm__ int test__floatunssidfvfp(unsigned int a) { double actual = __floatunssidfvfp(a); double expected = a; if (actual != expected) printf("error in test__floatunssidfvfp(%u) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__floatunssidfvfp(0)) return 1; if (test__floatunssidfvfp(1)) return 1; if (test__floatunssidfvfp(0x7FFFFFFF)) return 1; if (test__floatunssidfvfp(0x80000000)) return 1; if (test__floatunssidfvfp(0xFFFFFFFF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/getf2_test.c0000664000175000017500000000500412316541140027136 0ustar mwhudsonmwhudson//===------------ getf2_test.c - Test __getf2------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __getf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __getf2(long double a, long double b); int test__getf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __getf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__getf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__getf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, LESS_0)) return 1; // < // exp if (test__getf2(0x1.234567890abcdef1234567890abcp-3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_0)) return 1; // mantissa if (test__getf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, LESS_0)) return 1; // sign if (test__getf2(-0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_0)) return 1; // == if (test__getf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; // > // exp if (test__getf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, GREATER_EQUAL_0)) return 1; // mantissa if (test__getf2(0x1.334567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; // sign if (test__getf2(0x1.234567890abcdef1234567890abcp+3L, -0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/udivdi3_test.c0000664000175000017500000000237312516462465027522 0ustar mwhudsonmwhudson//===-- udivdi3_test.c - Test __udivdi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __udivdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a / b COMPILER_RT_ABI du_int __udivdi3(du_int a, du_int b); int test__udivdi3(du_int a, du_int b, du_int expected_q) { du_int q = __udivdi3(a, b); if (q != expected_q) printf("error in __udivdi3: %lld / %lld = %lld, expected %lld\n", a, b, q, expected_q); return q != expected_q; } int main() { if (test__udivdi3(0, 1, 0)) return 1; if (test__udivdi3(2, 1, 2)) return 1; if (test__udivdi3(0x8000000000000000uLL, 1, 0x8000000000000000uLL)) return 1; if (test__udivdi3(0x8000000000000000uLL, 2, 0x4000000000000000uLL)) return 1; if (test__udivdi3(0xFFFFFFFFFFFFFFFFuLL, 2, 0x7FFFFFFFFFFFFFFFuLL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ctzdi2_test.c0000664000175000017500000000347212516462465027353 0ustar mwhudsonmwhudson//===-- ctzdi2_test.c - Test __ctzdi2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ctzdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: the number of trailing 0-bits // Precondition: a != 0 COMPILER_RT_ABI si_int __ctzdi2(di_int a); int test__ctzdi2(di_int a, si_int expected) { si_int x = __ctzdi2(a); if (x != expected) printf("error in __ctzdi2(0x%llX) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { // if (test__ctzdi2(0x00000000, N)) // undefined // return 1; if (test__ctzdi2(0x00000001, 0)) return 1; if (test__ctzdi2(0x00000002, 1)) return 1; if (test__ctzdi2(0x00000003, 0)) return 1; if (test__ctzdi2(0x00000004, 2)) return 1; if (test__ctzdi2(0x00000005, 0)) return 1; if (test__ctzdi2(0x0000000A, 1)) return 1; if (test__ctzdi2(0x10000000, 28)) return 1; if (test__ctzdi2(0x20000000, 29)) return 1; if (test__ctzdi2(0x60000000, 29)) return 1; if (test__ctzdi2(0x80000000uLL, 31)) return 1; if (test__ctzdi2(0x0000050000000000uLL, 40)) return 1; if (test__ctzdi2(0x0200080000000000uLL, 43)) return 1; if (test__ctzdi2(0x7200000000000000uLL, 57)) return 1; if (test__ctzdi2(0x8000000000000000uLL, 63)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gesf2vfp_test.c0000664000175000017500000000245611570537001027663 0ustar mwhudsonmwhudson//===-- gesf2vfp_test.c - Test __gesf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __gesf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __gesf2vfp(float a, float b); #if __arm__ int test__gesf2vfp(float a, float b) { int actual = __gesf2vfp(a, b); int expected = (a >= b) ? 1 : 0; if (actual != expected) printf("error in __gesf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__gesf2vfp(0.0, 0.0)) return 1; if (test__gesf2vfp(1.1, 1.0)) return 1; if (test__gesf2vfp(-1.0, -2.0)) return 1; if (test__gesf2vfp(-2.0, -1.0)) return 1; if (test__gesf2vfp(HUGE_VALF, 1.0)) return 1; if (test__gesf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/extendhfsf2_test.c0000664000175000017500000000642412524443606030367 0ustar mwhudsonmwhudson//===--------------- extendhfsf2_test.c - Test __extendhfsf2 --------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __extendhfsf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include "fp_test.h" float __extendhfsf2(uint16_t a); int test__extendhfsf2(uint16_t a, float expected) { float x = __extendhfsf2(a); int ret = compareResultH(x, expected); if (ret){ printf("error in test__extendhfsf2(%#.4x) = %f, " "expected %f\n", a, x, expected); } return ret; } char assumption_1[sizeof(__fp16) * CHAR_BIT == 16] = {0}; int main() { // qNaN if (test__extendhfsf2(UINT16_C(0x7e00), makeQNaN32())) return 1; // NaN if (test__extendhfsf2(UINT16_C(0x7e00), makeNaN32(UINT32_C(0x8000)))) return 1; // inf if (test__extendhfsf2(UINT16_C(0x7c00), makeInf32())) return 1; if (test__extendhfsf2(UINT16_C(0xfc00), -makeInf32())) return 1; // zero if (test__extendhfsf2(UINT16_C(0x0), 0.0f)) return 1; if (test__extendhfsf2(UINT16_C(0x8000), -0.0f)) return 1; if (test__extendhfsf2(UINT16_C(0x4248), 3.1415926535f)) return 1; if (test__extendhfsf2(UINT16_C(0xc248), -3.1415926535f)) return 1; if (test__extendhfsf2(UINT16_C(0x7c00), 0x1.987124876876324p+100f)) return 1; if (test__extendhfsf2(UINT16_C(0x6e62), 0x1.988p+12f)) return 1; if (test__extendhfsf2(UINT16_C(0x3c00), 0x1.0p+0f)) return 1; if (test__extendhfsf2(UINT16_C(0x0400), 0x1.0p-14f)) return 1; // denormal if (test__extendhfsf2(UINT16_C(0x0010), 0x1.0p-20f)) return 1; if (test__extendhfsf2(UINT16_C(0x0001), 0x1.0p-24f)) return 1; if (test__extendhfsf2(UINT16_C(0x8001), -0x1.0p-24f)) return 1; if (test__extendhfsf2(UINT16_C(0x0001), 0x1.5p-25f)) return 1; // and back to zero if (test__extendhfsf2(UINT16_C(0x0000), 0x1.0p-25f)) return 1; if (test__extendhfsf2(UINT16_C(0x8000), -0x1.0p-25f)) return 1; // max (precise) if (test__extendhfsf2(UINT16_C(0x7bff), 65504.0f)) return 1; // max (rounded) if (test__extendhfsf2(UINT16_C(0x7bff), 65504.0f)) return 1; // max (to +inf) if (test__extendhfsf2(UINT16_C(0x7c00), makeInf32())) return 1; if (test__extendhfsf2(UINT16_C(0xfc00), -makeInf32())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ashldi3_test.c0000664000175000017500000000506312516462465027501 0ustar mwhudsonmwhudson//===-- ashldi3_test.c - Test __ashldi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ashldi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a << b // Precondition: 0 <= b < bits_in_dword COMPILER_RT_ABI di_int __ashldi3(di_int a, si_int b); int test__ashldi3(di_int a, si_int b, di_int expected) { di_int x = __ashldi3(a, b); if (x != expected) printf("error in __ashldi3: %llX << %d = %llX, expected %llX\n", a, b, __ashldi3(a, b), expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__ashldi3(0x0123456789ABCDEFLL, 0, 0x123456789ABCDEFLL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 1, 0x2468ACF13579BDELL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 2, 0x48D159E26AF37BCLL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 3, 0x91A2B3C4D5E6F78LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 4, 0x123456789ABCDEF0LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 28, 0x789ABCDEF0000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 29, 0xF13579BDE0000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 30, 0xE26AF37BC0000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 31, 0xC4D5E6F780000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 32, 0x89ABCDEF00000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 33, 0x13579BDE00000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 34, 0x26AF37BC00000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 35, 0x4D5E6F7800000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 36, 0x9ABCDEF000000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 60, 0xF000000000000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 61, 0xE000000000000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 62, 0xC000000000000000LL)) return 1; if (test__ashldi3(0x0123456789ABCDEFLL, 63, 0x8000000000000000LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/adddf3vfp_test.c0000664000175000017500000000235112516462465030010 0ustar mwhudsonmwhudson//===-- adddf3vfp_test.c - Test __adddf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __adddf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include #if __arm__ extern COMPILER_RT_ABI double __adddf3vfp(double a, double b); int test__adddf3vfp(double a, double b) { double actual = __adddf3vfp(a, b); double expected = a + b; if (actual != expected) printf("error in test__adddf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__adddf3vfp(1.0, 1.0)) return 1; if (test__adddf3vfp(HUGE_VAL, HUGE_VAL)) return 1; if (test__adddf3vfp(0.0, HUGE_VAL)) return 1; if (test__adddf3vfp(0.0, -0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negvsi2_test.c0000664000175000017500000000264012516462465027525 0ustar mwhudsonmwhudson//===-- negvsi2_test.c - Test __negvsi2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negvsi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: -a // Effects: aborts if -a overflows COMPILER_RT_ABI si_int __negvsi2(si_int a); int test__negvsi2(si_int a) { si_int x = __negvsi2(a); si_int expected = -a; if (x != expected) printf("error in __negvsi2(0x%X) = %d, expected %d\n", a, x, expected); return x != expected; } int main() { // if (test__negvsi2(0x80000000)) // should abort // return 1; if (test__negvsi2(0x00000000)) return 1; if (test__negvsi2(0x00000001)) return 1; if (test__negvsi2(0x00000002)) return 1; if (test__negvsi2(0x7FFFFFFE)) return 1; if (test__negvsi2(0x7FFFFFFF)) return 1; if (test__negvsi2(0x80000001)) return 1; if (test__negvsi2(0x80000002)) return 1; if (test__negvsi2(0xFFFFFFFE)) return 1; if (test__negvsi2(0xFFFFFFFF)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/muldf3vfp_test.c0000664000175000017500000000243412516462465030057 0ustar mwhudsonmwhudson//===-- muldf3vfp_test.c - Test __muldf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __muldf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include #if __arm__ extern COMPILER_RT_ABI double __muldf3vfp(double a, double b); int test__muldf3vfp(double a, double b) { double actual = __muldf3vfp(a, b); double expected = a * b; if (actual != expected) printf("error in test__muldf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__muldf3vfp(0.5, 10.0)) return 1; if (test__muldf3vfp(-0.5, -2.0)) return 1; if (test__muldf3vfp(HUGE_VALF, 0.25)) return 1; if (test__muldf3vfp(-0.125, HUGE_VALF)) return 1; if (test__muldf3vfp(0.0, -0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gedf2vfp_test.c0000664000175000017500000000246011570537001027637 0ustar mwhudsonmwhudson//===-- gedf2vfp_test.c - Test __gedf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __gedf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __gedf2vfp(double a, double b); #if __arm__ int test__gedf2vfp(double a, double b) { int actual = __gedf2vfp(a, b); int expected = (a >= b) ? 1 : 0; if (actual != expected) printf("error in __gedf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__gedf2vfp(0.0, 0.0)) return 1; if (test__gedf2vfp(1.0, 0.0)) return 1; if (test__gedf2vfp(-1.0, -2.0)) return 1; if (test__gedf2vfp(-2.0, -1.0)) return 1; if (test__gedf2vfp(HUGE_VAL, 1.0)) return 1; if (test__gedf2vfp(1.0, HUGE_VAL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsxfdi_test.c0000664000175000017500000000735512516462465030347 0ustar mwhudsonmwhudson//===-- fixunsxfdi_test.c - Test __fixunsxfdi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsxfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #if HAS_80_BIT_LONG_DOUBLE // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: long double is an intel 80 bit floating point type padded with 6 bytes // du_int is a 64 bit integral type // value in long double is representable in du_int or is negative // (no range checking performed) // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI du_int __fixunsxfdi(long double a); int test__fixunsxfdi(long double a, du_int expected) { du_int x = __fixunsxfdi(a); if (x != expected) printf("error in __fixunsxfdi(%LA) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(du_int) == 2*sizeof(su_int)] = {0}; char assumption_2[sizeof(du_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if HAS_80_BIT_LONG_DOUBLE if (test__fixunsxfdi(0.0, 0)) return 1; if (test__fixunsxfdi(0.5, 0)) return 1; if (test__fixunsxfdi(0.99, 0)) return 1; if (test__fixunsxfdi(1.0, 1)) return 1; if (test__fixunsxfdi(1.5, 1)) return 1; if (test__fixunsxfdi(1.99, 1)) return 1; if (test__fixunsxfdi(2.0, 2)) return 1; if (test__fixunsxfdi(2.01, 2)) return 1; if (test__fixunsxfdi(-0.5, 0)) return 1; if (test__fixunsxfdi(-0.99, 0)) return 1; if (test__fixunsxfdi(-1.0, 0)) return 1; if (test__fixunsxfdi(-1.5, 0)) return 1; if (test__fixunsxfdi(-1.99, 0)) return 1; if (test__fixunsxfdi(-2.0, 0)) return 1; if (test__fixunsxfdi(-2.01, 0)) return 1; if (test__fixunsxfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixunsxfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixunsxfdi(-0x1.FFFFFEp+62, 0)) return 1; if (test__fixunsxfdi(-0x1.FFFFFCp+62, 0)) return 1; if (test__fixunsxfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixunsxfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixunsxfdi(-0x1.FFFFFFFFFFFFFp+62, 0)) return 1; if (test__fixunsxfdi(-0x1.FFFFFFFFFFFFEp+62, 0)) return 1; if (test__fixunsxfdi(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL)) return 1; if (test__fixunsxfdi(0x1.0000000000000002p+63L, 0x8000000000000001LL)) return 1; if (test__fixunsxfdi(0x1.0000000000000000p+63L, 0x8000000000000000LL)) return 1; if (test__fixunsxfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__fixunsxfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL)) return 1; if (test__fixunsxfdi(-0x1.0000000000000000p+63L, 0)) return 1; if (test__fixunsxfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0)) return 1; if (test__fixunsxfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/cpu_model_test.c0000664000175000017500000000121012755344253030106 0ustar mwhudsonmwhudson//===-- cpu_model_test.c - Test __builtin_cpu_supports -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __builtin_cpu_supports for the compiler_rt library. // //===----------------------------------------------------------------------===// // REQUIRES: x86-target-arch int main (void) { if(__builtin_cpu_supports("avx2")) return 4; else return 3; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divdc3_test.c0000664000175000017500000001667512516462465027341 0ustar mwhudsonmwhudson//===-- divdc3_test.c - Test __divdc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divdc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include // Returns: the quotient of (a + ib) / (c + id) COMPILER_RT_ABI double _Complex __divdc3(double __a, double __b, double __c, double __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(double _Complex x) { if (x == 0) return zero; if (isinf(creal(x)) || isinf(cimag(x))) return inf; if (isnan(creal(x)) && isnan(cimag(x))) return NaN; if (isnan(creal(x))) { if (cimag(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimag(x))) { if (creal(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__divdc3(double a, double b, double c, double d) { double _Complex r = __divdc3(a, b, c, d); // printf("test__divdc3(%f, %f, %f, %f) = %f + I%f\n", // a, b, c, d, creal(r), cimag(r)); double _Complex dividend; double _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; { double _Complex z = (a * c + b * d) / (c * c + d * d) + (b * c - a * d) / (c * c + d * d) * _Complex_I; if (cabs((r-z)/r) > 1.e-6) return 1; } break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } double x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; int main() { const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__divdc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/truncdfsf2_test.c0000664000175000017500000000171012542340225030211 0ustar mwhudsonmwhudson//===--------------- truncdfsf2_test.c - Test __truncdfsf2 ----------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __truncdfsf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include "fp_test.h" float __truncdfsf2(double a); int test__truncdfsf2(double a) { float actual = __truncdfsf2(a); float expected = a; if (actual != expected) { printf("error in test__truncdfsf2(%lf) = %f, " "expected %f\n", a, actual, expected); return 1; } return 0; } int main() { if (test__truncdfsf2(340282366920938463463374607431768211456.0)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ashrdi3_test.c0000664000175000017500000000773312516462465027515 0ustar mwhudsonmwhudson//===-- ashrdi3_test.c - Test __ashrdi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ashrdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: arithmetic a >> b // Precondition: 0 <= b < bits_in_dword COMPILER_RT_ABI di_int __ashrdi3(di_int a, si_int b); int test__ashrdi3(di_int a, si_int b, di_int expected) { di_int x = __ashrdi3(a, b); if (x != expected) printf("error in __ashrdi3: %llX >> %d = %llX, expected %llX\n", a, b, __ashrdi3(a, b), expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__ashrdi3(0x0123456789ABCDEFLL, 0, 0x123456789ABCDEFLL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 1, 0x91A2B3C4D5E6F7LL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 2, 0x48D159E26AF37BLL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 3, 0x2468ACF13579BDLL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 4, 0x123456789ABCDELL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 28, 0x12345678LL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 29, 0x91A2B3CLL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 30, 0x48D159ELL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 31, 0x2468ACFLL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 32, 0x1234567LL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 33, 0x91A2B3LL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 34, 0x48D159LL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 35, 0x2468ACLL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 36, 0x123456LL)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 60, 0)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 61, 0)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 62, 0)) return 1; if (test__ashrdi3(0x0123456789ABCDEFLL, 63, 0)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 0, 0xFEDCBA9876543210LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 1, 0xFF6E5D4C3B2A1908LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 2, 0xFFB72EA61D950C84LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 3, 0xFFDB97530ECA8642LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 4, 0xFFEDCBA987654321LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 28, 0xFFFFFFFFEDCBA987LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 29, 0xFFFFFFFFF6E5D4C3LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 30, 0xFFFFFFFFFB72EA61LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 31, 0xFFFFFFFFFDB97530LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 32, 0xFFFFFFFFFEDCBA98LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 33, 0xFFFFFFFFFF6E5D4CLL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 34, 0xFFFFFFFFFFB72EA6LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 35, 0xFFFFFFFFFFDB9753LL)) return 1; if (test__ashrdi3(0xFEDCBA9876543210LL, 36, 0xFFFFFFFFFFEDCBA9LL)) return 1; if (test__ashrdi3(0xAEDCBA9876543210LL, 60, 0xFFFFFFFFFFFFFFFALL)) return 1; if (test__ashrdi3(0xAEDCBA9876543210LL, 61, 0xFFFFFFFFFFFFFFFDLL)) return 1; if (test__ashrdi3(0xAEDCBA9876543210LL, 62, 0xFFFFFFFFFFFFFFFELL)) return 1; if (test__ashrdi3(0xAEDCBA9876543210LL, 63, 0xFFFFFFFFFFFFFFFFLL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsdfsi_test.c0000664000175000017500000000567212616720672030340 0ustar mwhudsonmwhudson//===-- fixunsdfsi_test.c - Test __fixunsdfsi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsdfsi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a unsigned int, rounding toward zero. // Negative values all become zero. // Assumption: double is a IEEE 64 bit floating point type // su_int is a 32 bit integral type // value in double is representable in su_int or is negative // (no range checking performed) // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI su_int __fixunsdfsi(double a); int test__fixunsdfsi(double a, su_int expected) { su_int x = __fixunsdfsi(a); if (x != expected) printf("error in __fixunsdfsi(%A) = %X, expected %X\n", a, x, expected); return x != expected; } char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; int main() { if (test__fixunsdfsi(0.0, 0)) return 1; if (test__fixunsdfsi(0.5, 0)) return 1; if (test__fixunsdfsi(0.99, 0)) return 1; if (test__fixunsdfsi(1.0, 1)) return 1; if (test__fixunsdfsi(1.5, 1)) return 1; if (test__fixunsdfsi(1.99, 1)) return 1; if (test__fixunsdfsi(2.0, 2)) return 1; if (test__fixunsdfsi(2.01, 2)) return 1; if (test__fixunsdfsi(-0.5, 0)) return 1; if (test__fixunsdfsi(-0.99, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfsi(-1.0, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunsdfsi(-1.5, 0)) return 1; if (test__fixunsdfsi(-1.99, 0)) return 1; if (test__fixunsdfsi(-2.0, 0)) return 1; if (test__fixunsdfsi(-2.01, 0)) return 1; #endif if (test__fixunsdfsi(0x1.000000p+31, 0x80000000)) return 1; if (test__fixunsdfsi(0x1.000000p+32, 0xFFFFFFFF)) return 1; if (test__fixunsdfsi(0x1.FFFFFEp+31, 0xFFFFFF00)) return 1; if (test__fixunsdfsi(0x1.FFFFFEp+30, 0x7FFFFF80)) return 1; if (test__fixunsdfsi(0x1.FFFFFCp+30, 0x7FFFFF00)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfsi(-0x1.FFFFFEp+30, 0)) return 1; if (test__fixunsdfsi(-0x1.FFFFFCp+30, 0)) return 1; #endif if (test__fixunsdfsi(0x1.FFFFFFFEp+31, 0xFFFFFFFF)) return 1; if (test__fixunsdfsi(0x1.FFFFFFFC00000p+30, 0x7FFFFFFF)) return 1; if (test__fixunsdfsi(0x1.FFFFFFF800000p+30, 0x7FFFFFFE)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/udivsi3_test.c0000664000175000017500000001375712516462465027551 0ustar mwhudsonmwhudson//===-- udivsi3_test.c - Test __udivsi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __udivsi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a / b COMPILER_RT_ABI su_int __udivsi3(su_int a, su_int b); int test__udivsi3(su_int a, su_int b, su_int expected_q) { su_int q = __udivsi3(a, b); if (q != expected_q) printf("error in __udivsi3: %X / %X = %X, expected %X\n", a, b, q, expected_q); return q != expected_q; } su_int tests[][4] = { {0x00000000, 0x00000001, 0x00000000}, {0x00000000, 0x00000002, 0x00000000}, {0x00000000, 0x00000003, 0x00000000}, {0x00000000, 0x00000010, 0x00000000}, {0x00000000, 0x078644FA, 0x00000000}, {0x00000000, 0x0747AE14, 0x00000000}, {0x00000000, 0x7FFFFFFF, 0x00000000}, {0x00000000, 0x80000000, 0x00000000}, {0x00000000, 0xFFFFFFFD, 0x00000000}, {0x00000000, 0xFFFFFFFE, 0x00000000}, {0x00000000, 0xFFFFFFFF, 0x00000000}, {0x00000001, 0x00000001, 0x00000001}, {0x00000001, 0x00000002, 0x00000000}, {0x00000001, 0x00000003, 0x00000000}, {0x00000001, 0x00000010, 0x00000000}, {0x00000001, 0x078644FA, 0x00000000}, {0x00000001, 0x0747AE14, 0x00000000}, {0x00000001, 0x7FFFFFFF, 0x00000000}, {0x00000001, 0x80000000, 0x00000000}, {0x00000001, 0xFFFFFFFD, 0x00000000}, {0x00000001, 0xFFFFFFFE, 0x00000000}, {0x00000001, 0xFFFFFFFF, 0x00000000}, {0x00000002, 0x00000001, 0x00000002}, {0x00000002, 0x00000002, 0x00000001}, {0x00000002, 0x00000003, 0x00000000}, {0x00000002, 0x00000010, 0x00000000}, {0x00000002, 0x078644FA, 0x00000000}, {0x00000002, 0x0747AE14, 0x00000000}, {0x00000002, 0x7FFFFFFF, 0x00000000}, {0x00000002, 0x80000000, 0x00000000}, {0x00000002, 0xFFFFFFFD, 0x00000000}, {0x00000002, 0xFFFFFFFE, 0x00000000}, {0x00000002, 0xFFFFFFFF, 0x00000000}, {0x00000003, 0x00000001, 0x00000003}, {0x00000003, 0x00000002, 0x00000001}, {0x00000003, 0x00000003, 0x00000001}, {0x00000003, 0x00000010, 0x00000000}, {0x00000003, 0x078644FA, 0x00000000}, {0x00000003, 0x0747AE14, 0x00000000}, {0x00000003, 0x7FFFFFFF, 0x00000000}, {0x00000003, 0x80000000, 0x00000000}, {0x00000003, 0xFFFFFFFD, 0x00000000}, {0x00000003, 0xFFFFFFFE, 0x00000000}, {0x00000003, 0xFFFFFFFF, 0x00000000}, {0x00000010, 0x00000001, 0x00000010}, {0x00000010, 0x00000002, 0x00000008}, {0x00000010, 0x00000003, 0x00000005}, {0x00000010, 0x00000010, 0x00000001}, {0x00000010, 0x078644FA, 0x00000000}, {0x00000010, 0x0747AE14, 0x00000000}, {0x00000010, 0x7FFFFFFF, 0x00000000}, {0x00000010, 0x80000000, 0x00000000}, {0x00000010, 0xFFFFFFFD, 0x00000000}, {0x00000010, 0xFFFFFFFE, 0x00000000}, {0x00000010, 0xFFFFFFFF, 0x00000000}, {0x078644FA, 0x00000001, 0x078644FA}, {0x078644FA, 0x00000002, 0x03C3227D}, {0x078644FA, 0x00000003, 0x028216FE}, {0x078644FA, 0x00000010, 0x0078644F}, {0x078644FA, 0x078644FA, 0x00000001}, {0x078644FA, 0x0747AE14, 0x00000001}, {0x078644FA, 0x7FFFFFFF, 0x00000000}, {0x078644FA, 0x80000000, 0x00000000}, {0x078644FA, 0xFFFFFFFD, 0x00000000}, {0x078644FA, 0xFFFFFFFE, 0x00000000}, {0x078644FA, 0xFFFFFFFF, 0x00000000}, {0x0747AE14, 0x00000001, 0x0747AE14}, {0x0747AE14, 0x00000002, 0x03A3D70A}, {0x0747AE14, 0x00000003, 0x026D3A06}, {0x0747AE14, 0x00000010, 0x00747AE1}, {0x0747AE14, 0x078644FA, 0x00000000}, {0x0747AE14, 0x0747AE14, 0x00000001}, {0x0747AE14, 0x7FFFFFFF, 0x00000000}, {0x0747AE14, 0x80000000, 0x00000000}, {0x0747AE14, 0xFFFFFFFD, 0x00000000}, {0x0747AE14, 0xFFFFFFFE, 0x00000000}, {0x0747AE14, 0xFFFFFFFF, 0x00000000}, {0x7FFFFFFF, 0x00000001, 0x7FFFFFFF}, {0x7FFFFFFF, 0x00000002, 0x3FFFFFFF}, {0x7FFFFFFF, 0x00000003, 0x2AAAAAAA}, {0x7FFFFFFF, 0x00000010, 0x07FFFFFF}, {0x7FFFFFFF, 0x078644FA, 0x00000011}, {0x7FFFFFFF, 0x0747AE14, 0x00000011}, {0x7FFFFFFF, 0x7FFFFFFF, 0x00000001}, {0x7FFFFFFF, 0x80000000, 0x00000000}, {0x7FFFFFFF, 0xFFFFFFFD, 0x00000000}, {0x7FFFFFFF, 0xFFFFFFFE, 0x00000000}, {0x7FFFFFFF, 0xFFFFFFFF, 0x00000000}, {0x80000000, 0x00000001, 0x80000000}, {0x80000000, 0x00000002, 0x40000000}, {0x80000000, 0x00000003, 0x2AAAAAAA}, {0x80000000, 0x00000010, 0x08000000}, {0x80000000, 0x078644FA, 0x00000011}, {0x80000000, 0x0747AE14, 0x00000011}, {0x80000000, 0x7FFFFFFF, 0x00000001}, {0x80000000, 0x80000000, 0x00000001}, {0x80000000, 0xFFFFFFFD, 0x00000000}, {0x80000000, 0xFFFFFFFE, 0x00000000}, {0x80000000, 0xFFFFFFFF, 0x00000000}, {0xFFFFFFFD, 0x00000001, 0xFFFFFFFD}, {0xFFFFFFFD, 0x00000002, 0x7FFFFFFE}, {0xFFFFFFFD, 0x00000003, 0x55555554}, {0xFFFFFFFD, 0x00000010, 0x0FFFFFFF}, {0xFFFFFFFD, 0x078644FA, 0x00000022}, {0xFFFFFFFD, 0x0747AE14, 0x00000023}, {0xFFFFFFFD, 0x7FFFFFFF, 0x00000001}, {0xFFFFFFFD, 0x80000000, 0x00000001}, {0xFFFFFFFD, 0xFFFFFFFD, 0x00000001}, {0xFFFFFFFD, 0xFFFFFFFE, 0x00000000}, {0xFFFFFFFD, 0xFFFFFFFF, 0x00000000}, {0xFFFFFFFE, 0x00000001, 0xFFFFFFFE}, {0xFFFFFFFE, 0x00000002, 0x7FFFFFFF}, {0xFFFFFFFE, 0x00000003, 0x55555554}, {0xFFFFFFFE, 0x00000010, 0x0FFFFFFF}, {0xFFFFFFFE, 0x078644FA, 0x00000022}, {0xFFFFFFFE, 0x0747AE14, 0x00000023}, {0xFFFFFFFE, 0x7FFFFFFF, 0x00000002}, {0xFFFFFFFE, 0x80000000, 0x00000001}, {0xFFFFFFFE, 0xFFFFFFFD, 0x00000001}, {0xFFFFFFFE, 0xFFFFFFFE, 0x00000001}, {0xFFFFFFFE, 0xFFFFFFFF, 0x00000000}, {0xFFFFFFFF, 0x00000001, 0xFFFFFFFF}, {0xFFFFFFFF, 0x00000002, 0x7FFFFFFF}, {0xFFFFFFFF, 0x00000003, 0x55555555}, {0xFFFFFFFF, 0x00000010, 0x0FFFFFFF}, {0xFFFFFFFF, 0x078644FA, 0x00000022}, {0xFFFFFFFF, 0x0747AE14, 0x00000023}, {0xFFFFFFFF, 0x7FFFFFFF, 0x00000002}, {0xFFFFFFFF, 0x80000000, 0x00000001}, {0xFFFFFFFF, 0xFFFFFFFD, 0x00000001}, {0xFFFFFFFF, 0xFFFFFFFE, 0x00000001}, {0xFFFFFFFF, 0xFFFFFFFF, 0x00000001} }; int main() { const unsigned N = sizeof(tests) / sizeof(tests[0]); unsigned i; for (i = 0; i < N; ++i) if (test__udivsi3(tests[i][0], tests[i][1], tests[i][2])) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/trunctfsf2_test.c0000664000175000017500000000403412516462465030247 0ustar mwhudsonmwhudson//===--------------- trunctfsf2_test.c - Test __trunctfsf2 ----------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __trunctfsf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" COMPILER_RT_ABI float __trunctfsf2(long double a); int test__trunctfsf2(long double a, uint32_t expected) { float x = __trunctfsf2(a); int ret = compareResultF(x, expected); if (ret){ printf("error in test__trunctfsf2(%.20Lf) = %f, " "expected %f\n", a, x, fromRep32(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN if (test__trunctfsf2(makeQNaN128(), UINT32_C(0x7fc00000))) return 1; // NaN if (test__trunctfsf2(makeNaN128(UINT64_C(0x810000000000)), UINT32_C(0x7fc08000))) return 1; // inf if (test__trunctfsf2(makeInf128(), UINT32_C(0x7f800000))) return 1; // zero if (test__trunctfsf2(0.0L, UINT32_C(0x0))) return 1; if (test__trunctfsf2(0x1.23a2abb4a2ddee355f36789abcdep+5L, UINT32_C(0x4211d156))) return 1; if (test__trunctfsf2(0x1.e3d3c45bd3abfd98b76a54cc321fp-9L, UINT32_C(0x3b71e9e2))) return 1; if (test__trunctfsf2(0x1.234eebb5faa678f4488693abcdefp+4534L, UINT32_C(0x7f800000))) return 1; if (test__trunctfsf2(0x1.edcba9bb8c76a5a43dd21f334634p-435L, UINT32_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/lshrti3_test.c0000664000175000017500000001667212516462465027552 0ustar mwhudsonmwhudson//===-- lshrti3_test.c - Test __lshrti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __lshrti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: logical a >> b // Precondition: 0 <= b < bits_in_dword COMPILER_RT_ABI ti_int __lshrti3(ti_int a, si_int b); int test__lshrti3(ti_int a, si_int b, ti_int expected) { ti_int x = __lshrti3(a, b); if (x != expected) { twords at; at.all = a; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __lshrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX," " expected 0x%llX%.16llX\n", at.s.high, at.s.low, b, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 0, make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 1, make_ti(0x7F6E5D4C3B2A190ALL, 0xFF6E5D4C3B2A190ALL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 2, make_ti(0x3FB72EA61D950C85LL, 0x7FB72EA61D950C85LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 3, make_ti(0x1FDB97530ECA8642LL, 0xBFDB97530ECA8642LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 4, make_ti(0x0FEDCBA987654321LL, 0x5FEDCBA987654321LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 28, make_ti(0x0000000FEDCBA987LL, 0x6543215FEDCBA987LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 29, make_ti(0x00000007F6E5D4C3LL, 0xB2A190AFF6E5D4C3LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 30, make_ti(0x00000003FB72EA61LL, 0xD950C857FB72EA61LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 31, make_ti(0x00000001FDB97530LL, 0xECA8642BFDB97530LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 32, make_ti(0x00000000FEDCBA98LL, 0x76543215FEDCBA98LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 33, make_ti(0x000000007F6E5D4CLL, 0x3B2A190AFF6E5D4CLL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 34, make_ti(0x000000003FB72EA6LL, 0x1D950C857FB72EA6LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 35, make_ti(0x000000001FDB9753LL, 0x0ECA8642BFDB9753LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 36, make_ti(0x000000000FEDCBA9LL, 0x876543215FEDCBA9LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 60, make_ti(0x000000000000000FLL, 0xEDCBA9876543215FLL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 61, make_ti(0x0000000000000007LL, 0xF6E5D4C3B2A190AFLL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 62, make_ti(0x0000000000000003LL, 0xFB72EA61D950C857LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 63, make_ti(0x0000000000000001LL, 0xFDB97530ECA8642BLL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 64, make_ti(0x0000000000000000LL, 0xFEDCBA9876543215LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 65, make_ti(0x0000000000000000LL, 0x7F6E5D4C3B2A190ALL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 66, make_ti(0x0000000000000000LL, 0x3FB72EA61D950C85LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 67, make_ti(0x0000000000000000LL, 0x1FDB97530ECA8642LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 68, make_ti(0x0000000000000000LL, 0x0FEDCBA987654321LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 92, make_ti(0x0000000000000000LL, 0x0000000FEDCBA987LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 93, make_ti(0x0000000000000000LL, 0x00000007F6E5D4C3LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 94, make_ti(0x0000000000000000LL, 0x00000003FB72EA61LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 95, make_ti(0x0000000000000000LL, 0x00000001FDB97530LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 96, make_ti(0x0000000000000000LL, 0x00000000FEDCBA98LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 97, make_ti(0x0000000000000000LL, 0x000000007F6E5D4CLL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 98, make_ti(0x0000000000000000LL, 0x000000003FB72EA6LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 99, make_ti(0x0000000000000000LL, 0x000000001FDB9753LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 100, make_ti(0x0000000000000000LL, 0x000000000FEDCBA9LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 124, make_ti(0x0000000000000000LL, 0x000000000000000FLL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 125, make_ti(0x0000000000000000LL, 0x0000000000000007LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 126, make_ti(0x0000000000000000LL, 0x0000000000000003LL))) return 1; if (test__lshrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 127, make_ti(0x0000000000000000LL, 0x0000000000000001LL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/bswapdi2_test.c0000664000175000017500000000221011570537001027640 0ustar mwhudsonmwhudson//===-- bswapdi2_test.c - Test __bswapdi2 ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __bswapdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern uint64_t __bswapdi2(uint64_t); #if __arm__ int test__bswapdi2(uint64_t a, uint64_t expected) { uint64_t actual = __bswapdi2(a); if (actual != expected) printf("error in test__bswapsi2(0x%0llX) = 0x%0llX, expected 0x%0llX\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__bswapdi2(0x123456789ABCDEF0LL, 0xF0DEBC9A78563412LL)) return 1; if (test__bswapdi2(0x0000000100000002LL, 0x0200000001000000LL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divdf3vfp_test.c0000664000175000017500000000234512516462465030045 0ustar mwhudsonmwhudson//===-- divdf3vfp_test.c - Test __divdf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divdf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include #if __arm__ extern COMPILER_RT_ABI double __divdf3vfp(double a, double b); int test__divdf3vfp(double a, double b) { double actual = __divdf3vfp(a, b); double expected = a / b; if (actual != expected) printf("error in test__divdf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__divdf3vfp(1.0, 1.0)) return 1; if (test__divdf3vfp(12345.678, 1.23)) return 1; if (test__divdf3vfp(-10.0, 0.25)) return 1; if (test__divdf3vfp(10.0, -2.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/nesf2vfp_test.c0000664000175000017500000000237011570537001027665 0ustar mwhudsonmwhudson//===-- nesf2vfp_test.c - Test __nesf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __nesf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __nesf2vfp(float a, float b); #if __arm__ int test__nesf2vfp(float a, float b) { int actual = __nesf2vfp(a, b); int expected = (a != b) ? 1 : 0; if (actual != expected) printf("error in __nesf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__nesf2vfp(0.0, 0.0)) return 1; if (test__nesf2vfp(1.0, 1.0)) return 1; if (test__nesf2vfp(-1.0, -1.0)) return 1; if (test__nesf2vfp(HUGE_VALF, 1.0)) return 1; if (test__nesf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatunssisfvfp_test.c0000664000175000017500000000245012516462465031403 0ustar mwhudsonmwhudson//===-- floatunssisfvfp_test.c - Test __floatunssisfvfp -------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatunssisfvfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include "int_lib.h" extern COMPILER_RT_ABI float __floatunssisfvfp(unsigned int a); #if __arm__ int test__floatunssisfvfp(unsigned int a) { float actual = __floatunssisfvfp(a); float expected = a; if (actual != expected) printf("error in test__floatunssisfvfp(%u) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__floatunssisfvfp(0)) return 1; if (test__floatunssisfvfp(1)) return 1; if (test__floatunssisfvfp(0x7FFFFFFF)) return 1; if (test__floatunssisfvfp(0x80000000)) return 1; if (test__floatunssisfvfp(0xFFFFFFFF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatuntixf_test.c0000664000175000017500000002073312516462465030516 0ustar mwhudsonmwhudson//===-- floatuntixf.c - Test __floatuntixf --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatuntixf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: convert a to a long double, rounding toward even. // Assumption: long double is a IEEE 80 bit floating point type padded to 128 bits // tu_int is a 128 bit integral type // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI long double __floatuntixf(tu_int a); int test__floatuntixf(tu_int a, long double expected) { long double x = __floatuntixf(a); if (x != expected) { utwords at; at.all = a; printf("error in __floatuntixf(0x%.16llX%.16llX) = %LA, expected %LA\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(tu_int) == 2*sizeof(du_int)] = {0}; char assumption_2[sizeof(tu_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__floatuntixf(0, 0.0)) return 1; if (test__floatuntixf(1, 1.0)) return 1; if (test__floatuntixf(2, 2.0)) return 1; if (test__floatuntixf(20, 20.0)) return 1; if (test__floatuntixf(0x7FFFFF8000000000ULL, 0x1.FFFFFEp+62)) return 1; if (test__floatuntixf(0x7FFFFFFFFFFFF800ULL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatuntixf(0x7FFFFF0000000000ULL, 0x1.FFFFFCp+62)) return 1; if (test__floatuntixf(0x7FFFFFFFFFFFF000ULL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatuntixf(0x7FFFFFFFFFFFFFFFULL, 0xF.FFFFFFFFFFFFFFEp+59L)) return 1; if (test__floatuntixf(0xFFFFFFFFFFFFFFFEULL, 0xF.FFFFFFFFFFFFFFEp+60L)) return 1; if (test__floatuntixf(0xFFFFFFFFFFFFFFFFULL, 0xF.FFFFFFFFFFFFFFFp+60L)) return 1; if (test__floatuntixf(0x8000008000000000ULL, 0x8.000008p+60)) return 1; if (test__floatuntixf(0x8000000000000800ULL, 0x8.0000000000008p+60)) return 1; if (test__floatuntixf(0x8000010000000000ULL, 0x8.00001p+60)) return 1; if (test__floatuntixf(0x8000000000001000ULL, 0x8.000000000001p+60)) return 1; if (test__floatuntixf(0x8000000000000000ULL, 0x8p+60)) return 1; if (test__floatuntixf(0x8000000000000001ULL, 0x8.000000000000001p+60L)) return 1; if (test__floatuntixf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floatuntixf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floatuntixf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floatuntixf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floatuntixf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floatuntixf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floatuntixf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floatuntixf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floatuntixf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floatuntixf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floatuntixf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floatuntixf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntixf(0x023479FD0E092DA1LL, 0x1.1A3CFE870496D08p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DB0LL, 0x1.1A3CFE870496D8p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DB8LL, 0x1.1A3CFE870496DCp+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DB6LL, 0x1.1A3CFE870496DBp+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DBFLL, 0x1.1A3CFE870496DF8p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DC1LL, 0x1.1A3CFE870496E08p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DC7LL, 0x1.1A3CFE870496E38p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DC8LL, 0x1.1A3CFE870496E4p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DCFLL, 0x1.1A3CFE870496E78p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DD0LL, 0x1.1A3CFE870496E8p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DD1LL, 0x1.1A3CFE870496E88p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DD8LL, 0x1.1A3CFE870496ECp+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DDFLL, 0x1.1A3CFE870496EF8p+57L)) return 1; if (test__floatuntixf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DC0LL, 0), 0x1.1A3CFE870496Ep+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DA1LL, 1), 0x1.1A3CFE870496D08p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DB0LL, 2), 0x1.1A3CFE870496D8p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DB8LL, 3), 0x1.1A3CFE870496DCp+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DB6LL, 4), 0x1.1A3CFE870496DBp+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DBFLL, 5), 0x1.1A3CFE870496DF8p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DC1LL, 6), 0x1.1A3CFE870496E08p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DC7LL, 7), 0x1.1A3CFE870496E38p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DC8LL, 8), 0x1.1A3CFE870496E4p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DCFLL, 9), 0x1.1A3CFE870496E78p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DD0LL, 0), 0x1.1A3CFE870496E8p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DD1LL, 11), 0x1.1A3CFE870496E88p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DD8LL, 12), 0x1.1A3CFE870496ECp+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DDFLL, 13), 0x1.1A3CFE870496EF8p+121L)) return 1; if (test__floatuntixf(make_ti(0x023479FD0E092DE0LL, 14), 0x1.1A3CFE870496Fp+121L)) return 1; if (test__floatuntixf(make_ti(0, 0xFFFFFFFFFFFFFFFFLL), 0x1.FFFFFFFFFFFFFFFEp+63L)) return 1; if (test__floatuntixf(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x0000000000000000LL), 0x1.FFFFFFFFFFFFFFFEp+127L)) return 1; if (test__floatuntixf(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0x1.0000000000000000p+128L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x3456100000000001LL), 0x1.2345678901234562p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x3456200000000000LL), 0x1.2345678901234562p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x34562FFFFFFFFFFFLL), 0x1.2345678901234562p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x3456300000000000LL), 0x1.2345678901234564p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x3456400000000000LL), 0x1.2345678901234564p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x34564FFFFFFFFFFFLL), 0x1.2345678901234564p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x3456500000000000LL), 0x1.2345678901234564p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x3456500000000001LL), 0x1.2345678901234566p+108L)) return 1; if (test__floatuntixf(make_ti(0x0000123456789012LL, 0x34566FFFFFFFFFFFLL), 0x1.2345678901234566p+108L)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/umoddi3_test.c0000664000175000017500000000231712516462465027515 0ustar mwhudsonmwhudson//===-- umoddi3_test.c - Test __umoddi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __umoddi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a % b COMPILER_RT_ABI du_int __umoddi3(du_int a, du_int b); int test__umoddi3(du_int a, du_int b, du_int expected_r) { du_int r = __umoddi3(a, b); if (r != expected_r) printf("error in __umoddi3: %lld %% %lld = %lld, expected %lld\n", a, b, r, expected_r); return r != expected_r; } int main() { if (test__umoddi3(0, 1, 0)) return 1; if (test__umoddi3(2, 1, 0)) return 1; if (test__umoddi3(0x8000000000000000uLL, 1, 0x0uLL)) return 1; if (test__umoddi3(0x8000000000000000uLL, 2, 0x0uLL)) return 1; if (test__umoddi3(0xFFFFFFFFFFFFFFFFuLL, 2, 0x1uLL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/modti3_test.c0000664000175000017500000000510312516462465027344 0ustar mwhudsonmwhudson//===-- modti3_test.c - Test __modti3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __modti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a % b COMPILER_RT_ABI ti_int __modti3(ti_int a, ti_int b); int test__modti3(ti_int a, ti_int b, ti_int expected) { ti_int x = __modti3(a, b); if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __modti3: 0x%.16llX%.16llX %% 0x%.16llX%.16llX = " "0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__modti3(0, 1, 0)) return 1; if (test__modti3(0, -1, 0)) return 1; if (test__modti3(5, 3, 2)) return 1; if (test__modti3(5, -3, 2)) return 1; if (test__modti3(-5, 3, -2)) return 1; if (test__modti3(-5, -3, -2)) return 1; if (test__modti3(0x8000000000000000LL, 1, 0x0LL)) return 1; if (test__modti3(0x8000000000000000LL, -1, 0x0LL)) return 1; if (test__modti3(0x8000000000000000LL, 2, 0x0LL)) return 1; if (test__modti3(0x8000000000000000LL, -2, 0x0LL)) return 1; if (test__modti3(0x8000000000000000LL, 3, 2)) return 1; if (test__modti3(0x8000000000000000LL, -3, 2)) return 1; if (test__modti3(make_ti(0x8000000000000000LL, 0), 1, 0x0LL)) return 1; if (test__modti3(make_ti(0x8000000000000000LL, 0), -1, 0x0LL)) return 1; if (test__modti3(make_ti(0x8000000000000000LL, 0), 2, 0x0LL)) return 1; if (test__modti3(make_ti(0x8000000000000000LL, 0), -2, 0x0LL)) return 1; if (test__modti3(make_ti(0x8000000000000000LL, 0), 3, -2)) return 1; if (test__modti3(make_ti(0x8000000000000000LL, 0), -3, -2)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixxfdi_test.c0000664000175000017500000000663012516462465027614 0ustar mwhudsonmwhudson//===-- fixxfdi_test.c - Test __fixxfdi -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixxfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if HAS_80_BIT_LONG_DOUBLE // Returns: convert a to a signed long long, rounding toward zero. // Assumption: long double is an intel 80 bit floating point type padded with 6 bytes // su_int is a 32 bit integral type // value in long double is representable in di_int (no range checking performed) // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI di_int __sfixxfdi(long double a); int test__fixxfdi(long double a, di_int expected) { di_int x = __fixxfdi(a); if (x != expected) printf("error in __fixxfdi(%LA) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if HAS_80_BIT_LONG_DOUBLE if (test__fixxfdi(0.0, 0)) return 1; if (test__fixxfdi(0.5, 0)) return 1; if (test__fixxfdi(0.99, 0)) return 1; if (test__fixxfdi(1.0, 1)) return 1; if (test__fixxfdi(1.5, 1)) return 1; if (test__fixxfdi(1.99, 1)) return 1; if (test__fixxfdi(2.0, 2)) return 1; if (test__fixxfdi(2.01, 2)) return 1; if (test__fixxfdi(-0.5, 0)) return 1; if (test__fixxfdi(-0.99, 0)) return 1; if (test__fixxfdi(-1.0, -1)) return 1; if (test__fixxfdi(-1.5, -1)) return 1; if (test__fixxfdi(-1.99, -1)) return 1; if (test__fixxfdi(-2.0, -2)) return 1; if (test__fixxfdi(-2.01, -2)) return 1; if (test__fixxfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixxfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixxfdi(-0x1.FFFFFEp+62, 0x8000008000000000LL)) return 1; if (test__fixxfdi(-0x1.FFFFFCp+62, 0x8000010000000000LL)) return 1; if (test__fixxfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixxfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixxfdi(-0x1.FFFFFFFFFFFFFp+62, 0x8000000000000400LL)) return 1; if (test__fixxfdi(-0x1.FFFFFFFFFFFFEp+62, 0x8000000000000800LL)) return 1; if (test__fixxfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__fixxfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL)) return 1; if (test__fixxfdi(-0x1.0000000000000000p+63L, 0x8000000000000000LL)) return 1; if (test__fixxfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0x8000000000000001LL)) return 1; if (test__fixxfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0x8000000000000002LL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixsfdi_test.c0000664000175000017500000000453612516462465027612 0ustar mwhudsonmwhudson//===-- fixsfdi_test.c - Test __fixsfdi -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixsfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a signed long long, rounding toward zero. // Assumption: float is a IEEE 32 bit floating point type // su_int is a 32 bit integral type // value in float is representable in di_int (no range checking performed) // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI di_int __fixsfdi(float a); int test__fixsfdi(float a, di_int expected) { di_int x = __fixsfdi(a); if (x != expected) printf("error in __fixsfdi(%A) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; int main() { if (test__fixsfdi(0.0F, 0)) return 1; if (test__fixsfdi(0.5F, 0)) return 1; if (test__fixsfdi(0.99F, 0)) return 1; if (test__fixsfdi(1.0F, 1)) return 1; if (test__fixsfdi(1.5F, 1)) return 1; if (test__fixsfdi(1.99F, 1)) return 1; if (test__fixsfdi(2.0F, 2)) return 1; if (test__fixsfdi(2.01F, 2)) return 1; if (test__fixsfdi(-0.5F, 0)) return 1; if (test__fixsfdi(-0.99F, 0)) return 1; if (test__fixsfdi(-1.0F, -1)) return 1; if (test__fixsfdi(-1.5F, -1)) return 1; if (test__fixsfdi(-1.99F, -1)) return 1; if (test__fixsfdi(-2.0F, -2)) return 1; if (test__fixsfdi(-2.01F, -2)) return 1; if (test__fixsfdi(0x1.FFFFFEp+62F, 0x7FFFFF8000000000LL)) return 1; if (test__fixsfdi(0x1.FFFFFCp+62F, 0x7FFFFF0000000000LL)) return 1; if (test__fixsfdi(-0x1.FFFFFEp+62F, 0x8000008000000000LL)) return 1; if (test__fixsfdi(-0x1.FFFFFCp+62F, 0x8000010000000000LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divdi3_test.c0000664000175000017500000000310712516462465027331 0ustar mwhudsonmwhudson//===-- divdi3_test.c - Test __divdi3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a / b COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b); int test__divdi3(di_int a, di_int b, di_int expected) { di_int x = __divdi3(a, b); if (x != expected) printf("error in __divdi3: %lld / %lld = %lld, expected %lld\n", a, b, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__divdi3(0, 1, 0)) return 1; if (test__divdi3(0, -1, 0)) return 1; if (test__divdi3(2, 1, 2)) return 1; if (test__divdi3(2, -1, -2)) return 1; if (test__divdi3(-2, 1, -2)) return 1; if (test__divdi3(-2, -1, 2)) return 1; if (test__divdi3(0x8000000000000000LL, 1, 0x8000000000000000LL)) return 1; if (test__divdi3(0x8000000000000000LL, -1, 0x8000000000000000LL)) return 1; if (test__divdi3(0x8000000000000000LL, -2, 0x4000000000000000LL)) return 1; if (test__divdi3(0x8000000000000000LL, 2, 0xC000000000000000LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/lttf2_test.c0000664000175000017500000000501512316541140027164 0ustar mwhudsonmwhudson//===------------ lttf2_test.c - Test __lttf2------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __lttf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __lttf2(long double a, long double b); int test__lttf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __lttf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__lttf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__lttf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; // < // exp if (test__lttf2(0x1.234567890abcdef1234567890abcp-3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_0)) return 1; // mantissa if (test__lttf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, LESS_0)) return 1; // sign if (test__lttf2(-0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_0)) return 1; // == if (test__lttf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; // > // exp if (test__lttf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, GREATER_EQUAL_0)) return 1; // mantissa if (test__lttf2(0x1.334567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; // sign if (test__lttf2(0x1.234567890abcdef1234567890abcp+3L, -0x1.234567890abcdef1234567890abcp+3L, GREATER_EQUAL_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulxc3_test.c0000664000175000017500000001671212516462465027370 0ustar mwhudsonmwhudson//===-- mulxc3_test.c - Test __mulxc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulxc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #if !_ARCH_PPC #include "int_lib.h" #include #include #include // Returns: the product of a + ib and c + id COMPILER_RT_ABI long double _Complex __mulxc3(long double __a, long double __b, long double __c, long double __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(long double _Complex x) { if (x == 0) return zero; if (isinf(creall(x)) || isinf(cimagl(x))) return inf; if (isnan(creall(x)) && isnan(cimagl(x))) return NaN; if (isnan(creall(x))) { if (cimagl(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimagl(x))) { if (creall(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__mulxc3(long double a, long double b, long double c, long double d) { long double _Complex r = __mulxc3(a, b, c, d); // printf("test__mulxc3(%Lf, %Lf, %Lf, %Lf) = %Lf + I%Lf\n", // a, b, c, d, creall(r), cimagl(r)); long double _Complex dividend; long double _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; if (r != a * c - b * d + _Complex_I*(a * d + b * c)) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != inf) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } long double x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; #endif int main() { #if !_ARCH_PPC const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__mulxc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunssfdi_test.c0000664000175000017500000000554612616720672030340 0ustar mwhudsonmwhudson//===-- fixunssfdi_test.c - Test __fixunssfdi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunssfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: float is a IEEE 32 bit floating point type // du_int is a 64 bit integral type // value in float is representable in du_int or is negative // (no range checking performed) // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI du_int __fixunssfdi(float a); int test__fixunssfdi(float a, du_int expected) { du_int x = __fixunssfdi(a); if (x != expected) printf("error in __fixunssfdi(%A) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(du_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; int main() { if (test__fixunssfdi(0.0F, 0)) return 1; if (test__fixunssfdi(0.5F, 0)) return 1; if (test__fixunssfdi(0.99F, 0)) return 1; if (test__fixunssfdi(1.0F, 1)) return 1; if (test__fixunssfdi(1.5F, 1)) return 1; if (test__fixunssfdi(1.99F, 1)) return 1; if (test__fixunssfdi(2.0F, 2)) return 1; if (test__fixunssfdi(2.01F, 2)) return 1; if (test__fixunssfdi(-0.5F, 0)) return 1; if (test__fixunssfdi(-0.99F, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunssfdi(-1.0F, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunssfdi(-1.5F, 0)) return 1; if (test__fixunssfdi(-1.99F, 0)) return 1; if (test__fixunssfdi(-2.0F, 0)) return 1; if (test__fixunssfdi(-2.01F, 0)) return 1; #endif if (test__fixunssfdi(0x1.FFFFFEp+63F, 0xFFFFFF0000000000LL)) return 1; if (test__fixunssfdi(0x1.000000p+63F, 0x8000000000000000LL)) return 1; if (test__fixunssfdi(0x1.000000p+64F, 0xFFFFFFFFFFFFFFFFLL)) return 1; if (test__fixunssfdi(0x1.FFFFFEp+62F, 0x7FFFFF8000000000LL)) return 1; if (test__fixunssfdi(0x1.FFFFFCp+62F, 0x7FFFFF0000000000LL)) return 1; #if !TARGET_LIBGCC if (test__fixunssfdi(-0x1.FFFFFEp+62F, 0x0000000000000000LL)) return 1; if (test__fixunssfdi(-0x1.FFFFFCp+62F, 0x0000000000000000LL)) return 1; #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/extenddftf2_test.c0000664000175000017500000000472412516462465030372 0ustar mwhudsonmwhudson//===--------------- extenddftf2_test.c - Test __extenddftf2 --------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __extenddftf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" COMPILER_RT_ABI long double __extenddftf2(double a); int test__extenddftf2(double a, uint64_t expectedHi, uint64_t expectedLo) { long double x = __extenddftf2(a); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret){ printf("error in test__extenddftf2(%f) = %.20Lf, " "expected %.20Lf\n", a, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN if (test__extenddftf2(makeQNaN64(), UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // NaN if (test__extenddftf2(makeNaN64(UINT64_C(0x7100000000000)), UINT64_C(0x7fff710000000000), UINT64_C(0x0))) return 1; // inf if (test__extenddftf2(makeInf64(), UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // zero if (test__extenddftf2(0.0, UINT64_C(0x0), UINT64_C(0x0))) return 1; if (test__extenddftf2(0x1.23456789abcdefp+5, UINT64_C(0x400423456789abcd), UINT64_C(0xf000000000000000))) return 1; if (test__extenddftf2(0x1.edcba987654321fp-9, UINT64_C(0x3ff6edcba9876543), UINT64_C(0x2000000000000000))) return 1; if (test__extenddftf2(0x1.23456789abcdefp+45, UINT64_C(0x402c23456789abcd), UINT64_C(0xf000000000000000))) return 1; if (test__extenddftf2(0x1.edcba987654321fp-45, UINT64_C(0x3fd2edcba9876543), UINT64_C(0x2000000000000000))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatuntidf_test.c0000664000175000017500000001453412516462465030474 0ustar mwhudsonmwhudson//===-- floatuntidf.c - Test __floatuntidf --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatuntidf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: convert a to a double, rounding toward even. // Assumption: double is a IEEE 64 bit floating point type // tu_int is a 64 bit integral type // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI double __floatuntidf(tu_int a); int test__floatuntidf(tu_int a, double expected) { double x = __floatuntidf(a); if (x != expected) { utwords at; at.all = a; printf("error in __floatuntidf(0x%.16llX%.16llX) = %a, expected %a\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(ti_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__floatuntidf(0, 0.0)) return 1; if (test__floatuntidf(1, 1.0)) return 1; if (test__floatuntidf(2, 2.0)) return 1; if (test__floatuntidf(20, 20.0)) return 1; if (test__floatuntidf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62)) return 1; if (test__floatuntidf(0x7FFFFFFFFFFFF800LL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatuntidf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62)) return 1; if (test__floatuntidf(0x7FFFFFFFFFFFF000LL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatuntidf(make_ti(0x8000008000000000LL, 0), 0x1.000001p+127)) return 1; if (test__floatuntidf(make_ti(0x8000000000000800LL, 0), 0x1.0000000000001p+127)) return 1; if (test__floatuntidf(make_ti(0x8000010000000000LL, 0), 0x1.000002p+127)) return 1; if (test__floatuntidf(make_ti(0x8000000000001000LL, 0), 0x1.0000000000002p+127)) return 1; if (test__floatuntidf(make_ti(0x8000000000000000LL, 0), 0x1.000000p+127)) return 1; if (test__floatuntidf(make_ti(0x8000000000000001LL, 0), 0x1.0000000000000002p+127)) return 1; if (test__floatuntidf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floatuntidf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floatuntidf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floatuntidf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floatuntidf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floatuntidf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floatuntidf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floatuntidf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floatuntidf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floatuntidf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floatuntidf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floatuntidf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DA1LL, 0x1.1A3CFE870496Dp+57)) return 1; if (test__floatuntidf(0x023479FD0E092DB0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DB8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DB6LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DBFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DC1LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DC7LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DC8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DCFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DD0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatuntidf(0x023479FD0E092DD1LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatuntidf(0x023479FD0E092DD8LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatuntidf(0x023479FD0E092DDFLL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatuntidf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DC0LL, 0), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DA1LL, 1), 0x1.1A3CFE870496Dp+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DB0LL, 2), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DB8LL, 3), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DB6LL, 4), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DBFLL, 5), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DC1LL, 6), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DC7LL, 7), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DC8LL, 8), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DCFLL, 9), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DD0LL, 0), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DD1LL, 11), 0x1.1A3CFE870496Fp+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DD8LL, 12), 0x1.1A3CFE870496Fp+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DDFLL, 13), 0x1.1A3CFE870496Fp+121)) return 1; if (test__floatuntidf(make_ti(0x023479FD0E092DE0LL, 14), 0x1.1A3CFE870496Fp+121)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/letf2_test.c0000664000175000017500000000500412316541140027143 0ustar mwhudsonmwhudson//===------------ letf2_test.c - Test __letf2------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __letf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __letf2(long double a, long double b); int test__letf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __letf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__letf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__letf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, GREATER_0)) return 1; // < // exp if (test__letf2(0x1.234567890abcdef1234567890abcp-3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // mantissa if (test__letf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // sign if (test__letf2(-0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // == if (test__letf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // > // exp if (test__letf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, GREATER_0)) return 1; // mantissa if (test__letf2(0x1.334567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, GREATER_0)) return 1; // sign if (test__letf2(0x1.234567890abcdef1234567890abcp+3L, -0x1.234567890abcdef1234567890abcp+3L, GREATER_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divsc3_test.c0000664000175000017500000001665112516462465027352 0ustar mwhudsonmwhudson//===-- divsc3_test.c - Test __divsc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divsc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include // Returns: the quotient of (a + ib) / (c + id) COMPILER_RT_ABI float _Complex __divsc3(float __a, float __b, float __c, float __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(float _Complex x) { if (x == 0) return zero; if (isinf(crealf(x)) || isinf(cimagf(x))) return inf; if (isnan(crealf(x)) && isnan(cimagf(x))) return NaN; if (isnan(crealf(x))) { if (cimagf(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimagf(x))) { if (crealf(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__divsc3(float a, float b, float c, float d) { float _Complex r = __divsc3(a, b, c, d); // printf("test__divsc3(%f, %f, %f, %f) = %f + I%f\n", // a, b, c, d, crealf(r), cimagf(r)); float _Complex dividend; float _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; { float _Complex z = (a * c + b * d) / (c * c + d * d) + (b * c - a * d) / (c * c + d * d) * _Complex_I; if (r != z) return 1; } break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } float x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; int main() { const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__divsc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulodi4_test.c0000664000175000017500000001442012516462465027524 0ustar mwhudsonmwhudson//===-- mulodi4_test.c - Test __mulodi4 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulodi4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include extern COMPILER_RT_ABI di_int __mulodi4(di_int a, di_int b, int* overflow); int test__mulodi4(di_int a, di_int b, di_int expected, int expected_overflow) { int ov; di_int x = __mulodi4(a, b, &ov); if (ov != expected_overflow) printf("error in __mulodi4: overflow=%d expected=%d\n", ov, expected_overflow); else if (!expected_overflow && x != expected) { printf("error in __mulodi4: 0x%llX * 0x%llX = 0x%llX (overflow=%d), " "expected 0x%llX (overflow=%d)\n", a, b, x, ov, expected, expected_overflow); return 1; } return 0; } int main() { if (test__mulodi4(0, 0, 0, 0)) return 1; if (test__mulodi4(0, 1, 0, 0)) return 1; if (test__mulodi4(1, 0, 0, 0)) return 1; if (test__mulodi4(0, 10, 0, 0)) return 1; if (test__mulodi4(10, 0, 0, 0)) return 1; if (test__mulodi4(0, 81985529216486895LL, 0, 0)) return 1; if (test__mulodi4(81985529216486895LL, 0, 0, 0)) return 1; if (test__mulodi4(0, -1, 0, 0)) return 1; if (test__mulodi4(-1, 0, 0, 0)) return 1; if (test__mulodi4(0, -10, 0, 0)) return 1; if (test__mulodi4(-10, 0, 0, 0)) return 1; if (test__mulodi4(0, -81985529216486895LL, 0, 0)) return 1; if (test__mulodi4(-81985529216486895LL, 0, 0, 0)) return 1; if (test__mulodi4(1, 1, 1, 0)) return 1; if (test__mulodi4(1, 10, 10, 0)) return 1; if (test__mulodi4(10, 1, 10, 0)) return 1; if (test__mulodi4(1, 81985529216486895LL, 81985529216486895LL, 0)) return 1; if (test__mulodi4(81985529216486895LL, 1, 81985529216486895LL, 0)) return 1; if (test__mulodi4(1, -1, -1, 0)) return 1; if (test__mulodi4(1, -10, -10, 0)) return 1; if (test__mulodi4(-10, 1, -10, 0)) return 1; if (test__mulodi4(1, -81985529216486895LL, -81985529216486895LL, 0)) return 1; if (test__mulodi4(-81985529216486895LL, 1, -81985529216486895LL, 0)) return 1; if (test__mulodi4(3037000499LL, 3037000499LL, 9223372030926249001LL, 0)) return 1; if (test__mulodi4(-3037000499LL, 3037000499LL, -9223372030926249001LL, 0)) return 1; if (test__mulodi4(3037000499LL, -3037000499LL, -9223372030926249001LL, 0)) return 1; if (test__mulodi4(-3037000499LL, -3037000499LL, 9223372030926249001LL, 0)) return 1; if (test__mulodi4(4398046511103LL, 2097152LL, 9223372036852678656LL, 0)) return 1; if (test__mulodi4(-4398046511103LL, 2097152LL, -9223372036852678656LL, 0)) return 1; if (test__mulodi4(4398046511103LL, -2097152LL, -9223372036852678656LL, 0)) return 1; if (test__mulodi4(-4398046511103LL, -2097152LL, 9223372036852678656LL, 0)) return 1; if (test__mulodi4(2097152LL, 4398046511103LL, 9223372036852678656LL, 0)) return 1; if (test__mulodi4(-2097152LL, 4398046511103LL, -9223372036852678656LL, 0)) return 1; if (test__mulodi4(2097152LL, -4398046511103LL, -9223372036852678656LL, 0)) return 1; if (test__mulodi4(-2097152LL, -4398046511103LL, 9223372036852678656LL, 0)) return 1; if (test__mulodi4(0x7FFFFFFFFFFFFFFFLL, -2, 2, 1)) return 1; if (test__mulodi4(-2, 0x7FFFFFFFFFFFFFFFLL, 2, 1)) return 1; if (test__mulodi4(0x7FFFFFFFFFFFFFFFLL, -1, 0x8000000000000001LL, 0)) return 1; if (test__mulodi4(-1, 0x7FFFFFFFFFFFFFFFLL, 0x8000000000000001LL, 0)) return 1; if (test__mulodi4(0x7FFFFFFFFFFFFFFFLL, 0, 0, 0)) return 1; if (test__mulodi4(0, 0x7FFFFFFFFFFFFFFFLL, 0, 0)) return 1; if (test__mulodi4(0x7FFFFFFFFFFFFFFFLL, 1, 0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__mulodi4(1, 0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__mulodi4(0x7FFFFFFFFFFFFFFFLL, 2, 0x8000000000000001LL, 1)) return 1; if (test__mulodi4(2, 0x7FFFFFFFFFFFFFFFLL, 0x8000000000000001LL, 1)) return 1; if (test__mulodi4(0x8000000000000000LL, -2, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(-2, 0x8000000000000000LL, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(0x8000000000000000LL, -1, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(-1, 0x8000000000000000LL, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(0x8000000000000000LL, 0, 0, 0)) return 1; if (test__mulodi4(0, 0x8000000000000000LL, 0, 0)) return 1; if (test__mulodi4(0x8000000000000000LL, 1, 0x8000000000000000LL, 0)) return 1; if (test__mulodi4(1, 0x8000000000000000LL, 0x8000000000000000LL, 0)) return 1; if (test__mulodi4(0x8000000000000000LL, 2, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(2, 0x8000000000000000LL, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(0x8000000000000001LL, -2, 0x8000000000000001LL, 1)) return 1; if (test__mulodi4(-2, 0x8000000000000001LL, 0x8000000000000001LL, 1)) return 1; if (test__mulodi4(0x8000000000000001LL, -1, 0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__mulodi4(-1, 0x8000000000000001LL, 0x7FFFFFFFFFFFFFFFLL, 0)) return 1; if (test__mulodi4(0x8000000000000001LL, 0, 0, 0)) return 1; if (test__mulodi4(0, 0x8000000000000001LL, 0, 0)) return 1; if (test__mulodi4(0x8000000000000001LL, 1, 0x8000000000000001LL, 0)) return 1; if (test__mulodi4(1, 0x8000000000000001LL, 0x8000000000000001LL, 0)) return 1; if (test__mulodi4(0x8000000000000001LL, 2, 0x8000000000000000LL, 1)) return 1; if (test__mulodi4(2, 0x8000000000000001LL, 0x8000000000000000LL, 1)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/test0000775000175000017500000000334211325002175025633 0ustar mwhudsonmwhudson#!/usr/bin/env bash ARCHS='' REMOTE=0 if test `uname` = "Darwin"; then if test "$1" = "armv6"; then ARCHS="armv6" LIBS="-lSystem" REMOTE=1 mkdir -p remote else ARCHS="i386 x86_64 ppc" LIBS="-lSystem" fi else LIBS="-lc -lm" fi for ARCH in $ARCHS; do CFLAGS="-Os -nodefaultlibs -I../../lib" if test "$ARCH" != ''; then CFLAGS="-arch $ARCH $CFLAGS" fi for FILE in $(ls *.c); do # Use -nodefaultlibs to avoid using libgcc.a # Use -lSystem to link with libSystem.dylb. # Note -lSystem is *after* libcompiler_rt.Optimized.a so that linker will # prefer our implementation over the ones in libSystem.dylib EXTRA= if test $FILE = gcc_personality_test.c then # the gcc_personality_test.c requires a helper C++ program EXTRA="-fexceptions gcc_personality_test_helper.cxx -lstdc++ /usr/lib/libgcc_s.1.dylib" # the libgcc_s.1.dylib use at the end is a hack until libSystem contains _Unwind_Resume fi if test $FILE = trampoline_setup_test.c then # this test requires an extra compiler option EXTRA="-fnested-functions" fi if test "$REMOTE" = "1" then if gcc $CFLAGS $FILE ../../darwin_fat/Release/libcompiler_rt.a $LIBS $EXTRA -o ./remote/$FILE.exe then echo "Built $FILE.exe for $ARCH" else echo "$FILE failed to compile" fi else if gcc $CFLAGS $FILE ../../darwin_fat/Release/libcompiler_rt.a $LIBS $EXTRA then echo "Testing $FILE for $ARCH" if ./a.out then rm ./a.out else echo "fail" exit 1 fi else echo "$FILE failed to compile" exit 1 fi fi done done echo "pass" exit golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ltsf2vfp_test.c0000664000175000017500000000245611570537001027707 0ustar mwhudsonmwhudson//===-- ltsf2vfp_test.c - Test __ltsf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ltsf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __ltsf2vfp(float a, float b); #if __arm__ int test__ltsf2vfp(float a, float b) { int actual = __ltsf2vfp(a, b); int expected = (a < b) ? 1 : 0; if (actual != expected) printf("error in __ltsf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__ltsf2vfp(0.0, 0.0)) return 1; if (test__ltsf2vfp(-1.0, 1.0)) return 1; if (test__ltsf2vfp(-1.0, -2.0)) return 1; if (test__ltsf2vfp(-2.0, -1.0)) return 1; if (test__ltsf2vfp(HUGE_VALF, 1.0)) return 1; if (test__ltsf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/subtf3_test.c0000664000175000017500000000414212516462465027355 0ustar mwhudsonmwhudson//===--------------- subtf3_test.c - Test __subtf3 ------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __subtf3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" // Returns: a - b COMPILER_RT_ABI long double __subtf3(long double a, long double b); int test__subtf3(long double a, long double b, uint64_t expectedHi, uint64_t expectedLo) { long double x = __subtf3(a, b); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret){ printf("error in test__subtf3(%.20Lf, %.20Lf) = %.20Lf, " "expected %.20Lf\n", a, b, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN - any = qNaN if (test__subtf3(makeQNaN128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // NaN - any = NaN if (test__subtf3(makeNaN128(UINT64_C(0x800030000000)), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // inf - any = inf if (test__subtf3(makeInf128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // any - any if (test__subtf3(0x1.234567829a3bcdef5678ade36734p+5L, 0x1.ee9d7c52354a6936ab8d7654321fp-1L, UINT64_C(0x40041b8af1915166), UINT64_C(0xa44a7bca780a166c))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/lshrdi3_test.c0000664000175000017500000000752612516462465027530 0ustar mwhudsonmwhudson//===-- lshrdi3_test.c - Test __lshrdi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __lshrdi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: logical a >> b // Precondition: 0 <= b < bits_in_dword COMPILER_RT_ABI di_int __lshrdi3(di_int a, si_int b); int test__lshrdi3(di_int a, si_int b, di_int expected) { di_int x = __lshrdi3(a, b); if (x != expected) printf("error in __lshrdi3: %llX >> %d = %llX, expected %llX\n", a, b, __lshrdi3(a, b), expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__lshrdi3(0x0123456789ABCDEFLL, 0, 0x123456789ABCDEFLL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 1, 0x91A2B3C4D5E6F7LL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 2, 0x48D159E26AF37BLL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 3, 0x2468ACF13579BDLL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 4, 0x123456789ABCDELL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 28, 0x12345678LL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 29, 0x91A2B3CLL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 30, 0x48D159ELL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 31, 0x2468ACFLL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 32, 0x1234567LL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 33, 0x91A2B3LL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 34, 0x48D159LL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 35, 0x2468ACLL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 36, 0x123456LL)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 60, 0)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 61, 0)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 62, 0)) return 1; if (test__lshrdi3(0x0123456789ABCDEFLL, 63, 0)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 0, 0xFEDCBA9876543210LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 1, 0x7F6E5D4C3B2A1908LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 2, 0x3FB72EA61D950C84LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 3, 0x1FDB97530ECA8642LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 4, 0xFEDCBA987654321LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 28, 0xFEDCBA987LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 29, 0x7F6E5D4C3LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 30, 0x3FB72EA61LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 31, 0x1FDB97530LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 32, 0xFEDCBA98LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 33, 0x7F6E5D4CLL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 34, 0x3FB72EA6LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 35, 0x1FDB9753LL)) return 1; if (test__lshrdi3(0xFEDCBA9876543210LL, 36, 0xFEDCBA9LL)) return 1; if (test__lshrdi3(0xAEDCBA9876543210LL, 60, 0xALL)) return 1; if (test__lshrdi3(0xAEDCBA9876543210LL, 61, 0x5LL)) return 1; if (test__lshrdi3(0xAEDCBA9876543210LL, 62, 0x2LL)) return 1; if (test__lshrdi3(0xAEDCBA9876543210LL, 63, 0x1LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/powixf2_test.c0000664000175000017500000001414712516462465027553 0ustar mwhudsonmwhudson//===-- powixf2_test.cpp - Test __powixf2 ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __powixf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #if !_ARCH_PPC #include "int_lib.h" #include #include // Returns: a ^ b COMPILER_RT_ABI long double __powixf2(long double a, si_int b); int test__powixf2(long double a, si_int b, long double expected) { long double x = __powixf2(a, b); int correct = (x == expected) && (signbit(x) == signbit(expected)); if (!correct) printf("error in __powixf2(%Lf, %d) = %Lf, expected %Lf\n", a, b, x, expected); return !correct; } #endif int main() { #if !_ARCH_PPC if (test__powixf2(0, 0, 1)) return 1; if (test__powixf2(1, 0, 1)) return 1; if (test__powixf2(1.5, 0, 1)) return 1; if (test__powixf2(2, 0, 1)) return 1; if (test__powixf2(INFINITY, 0, 1)) return 1; if (test__powixf2(-0., 0, 1)) return 1; if (test__powixf2(-1, 0, 1)) return 1; if (test__powixf2(-1.5, 0, 1)) return 1; if (test__powixf2(-2, 0, 1)) return 1; if (test__powixf2(-INFINITY, 0, 1)) return 1; if (test__powixf2(0, 1, 0)) return 1; if (test__powixf2(0, 2, 0)) return 1; if (test__powixf2(0, 3, 0)) return 1; if (test__powixf2(0, 4, 0)) return 1; if (test__powixf2(0, 0x7FFFFFFE, 0)) return 1; if (test__powixf2(0, 0x7FFFFFFF, 0)) return 1; if (test__powixf2(-0., 1, -0.)) return 1; if (test__powixf2(-0., 2, 0)) return 1; if (test__powixf2(-0., 3, -0.)) return 1; if (test__powixf2(-0., 4, 0)) return 1; if (test__powixf2(-0., 0x7FFFFFFE, 0)) return 1; if (test__powixf2(-0., 0x7FFFFFFF, -0.)) return 1; if (test__powixf2(1, 1, 1)) return 1; if (test__powixf2(1, 2, 1)) return 1; if (test__powixf2(1, 3, 1)) return 1; if (test__powixf2(1, 4, 1)) return 1; if (test__powixf2(1, 0x7FFFFFFE, 1)) return 1; if (test__powixf2(1, 0x7FFFFFFF, 1)) return 1; if (test__powixf2(INFINITY, 1, INFINITY)) return 1; if (test__powixf2(INFINITY, 2, INFINITY)) return 1; if (test__powixf2(INFINITY, 3, INFINITY)) return 1; if (test__powixf2(INFINITY, 4, INFINITY)) return 1; if (test__powixf2(INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powixf2(INFINITY, 0x7FFFFFFF, INFINITY)) return 1; if (test__powixf2(-INFINITY, 1, -INFINITY)) return 1; if (test__powixf2(-INFINITY, 2, INFINITY)) return 1; if (test__powixf2(-INFINITY, 3, -INFINITY)) return 1; if (test__powixf2(-INFINITY, 4, INFINITY)) return 1; if (test__powixf2(-INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powixf2(-INFINITY, 0x7FFFFFFF, -INFINITY)) return 1; if (test__powixf2(0, -1, INFINITY)) return 1; if (test__powixf2(0, -2, INFINITY)) return 1; if (test__powixf2(0, -3, INFINITY)) return 1; if (test__powixf2(0, -4, INFINITY)) return 1; if (test__powixf2(0, 0x80000002, INFINITY)) return 1; if (test__powixf2(0, 0x80000001, INFINITY)) return 1; if (test__powixf2(0, 0x80000000, INFINITY)) return 1; if (test__powixf2(-0., -1, -INFINITY)) return 1; if (test__powixf2(-0., -2, INFINITY)) return 1; if (test__powixf2(-0., -3, -INFINITY)) return 1; if (test__powixf2(-0., -4, INFINITY)) return 1; if (test__powixf2(-0., 0x80000002, INFINITY)) return 1; if (test__powixf2(-0., 0x80000001, -INFINITY)) return 1; if (test__powixf2(-0., 0x80000000, INFINITY)) return 1; if (test__powixf2(1, -1, 1)) return 1; if (test__powixf2(1, -2, 1)) return 1; if (test__powixf2(1, -3, 1)) return 1; if (test__powixf2(1, -4, 1)) return 1; if (test__powixf2(1, 0x80000002, 1)) return 1; if (test__powixf2(1, 0x80000001, 1)) return 1; if (test__powixf2(1, 0x80000000, 1)) return 1; if (test__powixf2(INFINITY, -1, 0)) return 1; if (test__powixf2(INFINITY, -2, 0)) return 1; if (test__powixf2(INFINITY, -3, 0)) return 1; if (test__powixf2(INFINITY, -4, 0)) return 1; if (test__powixf2(INFINITY, 0x80000002, 0)) return 1; if (test__powixf2(INFINITY, 0x80000001, 0)) return 1; if (test__powixf2(INFINITY, 0x80000000, 0)) return 1; if (test__powixf2(-INFINITY, -1, -0.)) return 1; if (test__powixf2(-INFINITY, -2, 0)) return 1; if (test__powixf2(-INFINITY, -3, -0.)) return 1; if (test__powixf2(-INFINITY, -4, 0)) return 1; if (test__powixf2(-INFINITY, 0x80000002, 0)) return 1; if (test__powixf2(-INFINITY, 0x80000001, -0.)) return 1; if (test__powixf2(-INFINITY, 0x80000000, 0)) return 1; if (test__powixf2(2, 10, 1024.)) return 1; if (test__powixf2(-2, 10, 1024.)) return 1; if (test__powixf2(2, -10, 1/1024.)) return 1; if (test__powixf2(-2, -10, 1/1024.)) return 1; if (test__powixf2(2, 19, 524288.)) return 1; if (test__powixf2(-2, 19, -524288.)) return 1; if (test__powixf2(2, -19, 1/524288.)) return 1; if (test__powixf2(-2, -19, -1/524288.)) return 1; if (test__powixf2(2, 31, 2147483648.)) return 1; if (test__powixf2(-2, 31, -2147483648.)) return 1; if (test__powixf2(2, -31, 1/2147483648.)) return 1; if (test__powixf2(-2, -31, -1/2147483648.)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatdixf_test.c0000664000175000017500000001162012516462465030126 0ustar mwhudsonmwhudson//===-- floatdixf_test.c - Test __floatdixf -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatdixf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if HAS_80_BIT_LONG_DOUBLE // Returns: convert a to a long double, rounding toward even. // Assumption: long double is a IEEE 80 bit floating point type padded to 128 bits // di_int is a 64 bit integral type // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm long COMPILER_RT_ABI double __floatdixf(di_int a); int test__floatdixf(di_int a, long double expected) { long double x = __floatdixf(a); if (x != expected) printf("error in __floatdixf(%llX) = %LA, expected %LA\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if HAS_80_BIT_LONG_DOUBLE if (test__floatdixf(0, 0.0)) return 1; if (test__floatdixf(1, 1.0)) return 1; if (test__floatdixf(2, 2.0)) return 1; if (test__floatdixf(20, 20.0)) return 1; if (test__floatdixf(-1, -1.0)) return 1; if (test__floatdixf(-2, -2.0)) return 1; if (test__floatdixf(-20, -20.0)) return 1; if (test__floatdixf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62)) return 1; if (test__floatdixf(0x7FFFFFFFFFFFF800LL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatdixf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62)) return 1; if (test__floatdixf(0x7FFFFFFFFFFFF000LL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatdixf(0x8000008000000000LL, -0x1.FFFFFEp+62)) return 1; if (test__floatdixf(0x8000000000000800LL, -0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatdixf(0x8000010000000000LL, -0x1.FFFFFCp+62)) return 1; if (test__floatdixf(0x8000000000001000LL, -0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatdixf(0x8000000000000000LL, -0x1.000000p+63)) return 1; if (test__floatdixf(0x8000000000000001LL, -0x1.FFFFFFFFFFFFFFFCp+62L)) return 1; if (test__floatdixf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floatdixf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floatdixf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floatdixf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floatdixf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floatdixf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floatdixf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floatdixf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floatdixf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floatdixf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floatdixf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floatdixf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdixf(0x023479FD0E092DA1LL, 0x8.D1E7F43824B684p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DB0LL, 0x8.D1E7f43824B6Cp+54L)) return 1; if (test__floatdixf(0x023479FD0E092DB8LL, 0x8.D1E7F43824B6Ep+54L)) return 1; if (test__floatdixf(0x023479FD0E092DB6LL, 0x8.D1E7F43824B6D8p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DBFLL, 0x8.D1E7F43824B6FCp+54L)) return 1; if (test__floatdixf(0x023479FD0E092DC1LL, 0x8.D1E7F43824B704p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DC7LL, 0x8.D1E7F43824B71Cp+54L)) return 1; if (test__floatdixf(0x023479FD0E092DC8LL, 0x8.D1E7F43824B72p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DCFLL, 0x8.D1E7F43824B73Cp+54L)) return 1; if (test__floatdixf(0x023479FD0E092DD0LL, 0x8.D1E7F43824B74p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DD1LL, 0x8.D1E7F43824B744p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DD8LL, 0x8.D1E7F43824B76p+54L)) return 1; if (test__floatdixf(0x023479FD0E092DDFLL, 0x8.D1E7F43824B77Cp+54L)) return 1; if (test__floatdixf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negti2_test.c0000664000175000017500000001151612516462465027342 0ustar mwhudsonmwhudson//===-- negti2_test.c - Test __negti2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: -a COMPILER_RT_ABI ti_int __negti2(ti_int a); int test__negti2(ti_int a, ti_int expected) { ti_int x = __negti2(a); if (x != expected) { twords at; at.all = a; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __negti2: -0x%.16llX%.16llX = 0x%.16llX%.16llX, " "expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__negti2(0, 0)) return 1; if (test__negti2(1, -1)) return 1; if (test__negti2(-1, 1)) return 1; if (test__negti2(2, -2)) return 1; if (test__negti2(-2, 2)) return 1; if (test__negti2(3, -3)) return 1; if (test__negti2(-3, 3)) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x00000000FFFFFFFELL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000002LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000002LL), make_ti(0x0000000000000000LL, 0x00000000FFFFFFFELL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x00000000FFFFFFFFLL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000001LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000001LL), make_ti(0x0000000000000000LL, 0x00000000FFFFFFFFLL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x0000000100000000LL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000000LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000000LL), make_ti(0x0000000000000000LL, 0x0000000100000000LL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x0000000200000000LL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFE00000000LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFE00000000LL), make_ti(0x0000000000000000LL, 0x0000000200000000LL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x0000000300000000LL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFD00000000LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFD00000000LL), make_ti(0x0000000000000000LL, 0x0000000300000000LL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x7FFFFFFFFFFFFFFFLL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000001LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000001LL), make_ti(0x0000000000000000LL, 0x7FFFFFFFFFFFFFFFLL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x7FFFFFFFFFFFFFFFLL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000001LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFE00000000LL), make_ti(0x0000000000000000LL, 0x0000000200000000LL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x0000000200000000LL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFE00000000LL))) return 1; if (test__negti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000000LL), make_ti(0x0000000000000000LL, 0x0000000100000000LL))) return 1; if (test__negti2(make_ti(0x0000000000000000LL, 0x0000000100000000LL), make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000000LL))) return 1; if (test__negti2(make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; if (test__negti2(make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__negti2(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divsf3vfp_test.c0000664000175000017500000000234112516462465030060 0ustar mwhudsonmwhudson//===-- divsf3vfp_test.c - Test __divsf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divsf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __divsf3vfp(float a, float b); #if __arm__ int test__divsf3vfp(float a, float b) { float actual = __divsf3vfp(a, b); float expected = a / b; if (actual != expected) printf("error in test__divsf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__divsf3vfp(1.0, 1.0)) return 1; if (test__divsf3vfp(12345.678, 1.23)) return 1; if (test__divsf3vfp(0.0, HUGE_VALF)) return 1; if (test__divsf3vfp(10.0, -2.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixsfti_test.c0000664000175000017500000000621112516462465027622 0ustar mwhudsonmwhudson//===-- fixsfti_test.c - Test __fixsfti -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixsfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: convert a to a signed long long, rounding toward zero. // Assumption: float is a IEEE 32 bit floating point type // su_int is a 32 bit integral type // value in float is representable in ti_int (no range checking performed) // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI ti_int __fixsfti(float a); int test__fixsfti(float a, ti_int expected) { ti_int x = __fixsfti(a); if (x != expected) { twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __fixsfti(%A) = 0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__fixsfti(0.0F, 0)) return 1; if (test__fixsfti(0.5F, 0)) return 1; if (test__fixsfti(0.99F, 0)) return 1; if (test__fixsfti(1.0F, 1)) return 1; if (test__fixsfti(1.5F, 1)) return 1; if (test__fixsfti(1.99F, 1)) return 1; if (test__fixsfti(2.0F, 2)) return 1; if (test__fixsfti(2.01F, 2)) return 1; if (test__fixsfti(-0.5F, 0)) return 1; if (test__fixsfti(-0.99F, 0)) return 1; if (test__fixsfti(-1.0F, -1)) return 1; if (test__fixsfti(-1.5F, -1)) return 1; if (test__fixsfti(-1.99F, -1)) return 1; if (test__fixsfti(-2.0F, -2)) return 1; if (test__fixsfti(-2.01F, -2)) return 1; if (test__fixsfti(0x1.FFFFFEp+62F, 0x7FFFFF8000000000LL)) return 1; if (test__fixsfti(0x1.FFFFFCp+62F, 0x7FFFFF0000000000LL)) return 1; if (test__fixsfti(-0x1.FFFFFEp+62F, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000008000000000LL))) return 1; if (test__fixsfti(-0x1.FFFFFCp+62F, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000010000000000LL))) return 1; if (test__fixsfti(0x1.FFFFFEp+126F, make_ti(0x7FFFFF8000000000LL, 0))) return 1; if (test__fixsfti(0x1.FFFFFCp+126F, make_ti(0x7FFFFF0000000000LL, 0))) return 1; if (test__fixsfti(-0x1.FFFFFEp+126F, make_ti(0x8000008000000000LL, 0))) return 1; if (test__fixsfti(-0x1.FFFFFCp+126F, make_ti(0x8000010000000000LL, 0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/eqsf2vfp_test.c0000664000175000017500000000237011570537001027670 0ustar mwhudsonmwhudson//===-- eqsf2vfp_test.c - Test __eqsf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __eqsf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __eqsf2vfp(float a, float b); #if __arm__ int test__eqsf2vfp(float a, float b) { int actual = __eqsf2vfp(a, b); int expected = (a == b) ? 1 : 0; if (actual != expected) printf("error in __eqsf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__eqsf2vfp(0.0, 0.0)) return 1; if (test__eqsf2vfp(1.0, 1.0)) return 1; if (test__eqsf2vfp(-1.0, -1.0)) return 1; if (test__eqsf2vfp(HUGE_VALF, 1.0)) return 1; if (test__eqsf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/cmpti2_test.c0000664000175000017500000000634712516462465027356 0ustar mwhudsonmwhudson//===-- cmpti2_test.c - Test __cmpti2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __cmpti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: if (a < b) returns 0 // if (a == b) returns 1 // if (a > b) returns 2 COMPILER_RT_ABI si_int __cmpti2(ti_int a, ti_int b); int test__cmpti2(ti_int a, ti_int b, si_int expected) { si_int x = __cmpti2(a, b); if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; printf("error in __cmpti2(0x%llX%.16llX, 0x%llX%.16llX) = %d, expected %d\n", at.s.high, at.s.low, bt.s.high, bt.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__cmpti2(0, 0, 1)) return 1; if (test__cmpti2(1, 1, 1)) return 1; if (test__cmpti2(2, 2, 1)) return 1; if (test__cmpti2(0x7FFFFFFF, 0x7FFFFFFF, 1)) return 1; if (test__cmpti2(0x80000000, 0x80000000, 1)) return 1; if (test__cmpti2(0x80000001, 0x80000001, 1)) return 1; if (test__cmpti2(0xFFFFFFFF, 0xFFFFFFFF, 1)) return 1; if (test__cmpti2(0x000000010000000LL, 0x000000010000000LL, 1)) return 1; if (test__cmpti2(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL, 1)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000300000001LL, 0)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000300000002LL, 0)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000300000003LL, 0)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000100000001LL, 2)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000100000002LL, 2)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000100000003LL, 2)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000200000001LL, 2)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000200000002LL, 1)) return 1; if (test__cmpti2(0x0000000200000002LL, 0x0000000200000003LL, 0)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(3, 1), 0)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(3, 2), 0)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(3, 3), 0)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(1, 1), 2)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(1, 2), 2)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(1, 3), 2)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(2, 1), 2)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(2, 2), 1)) return 1; if (test__cmpti2(make_ti(2, 2), make_ti(2, 3), 0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/eqdf2vfp_test.c0000664000175000017500000000254311570537001027653 0ustar mwhudsonmwhudson//===-- eqdf2vfp_test.c - Test __eqdf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __eqdf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __eqdf2vfp(double a, double b); #if __arm__ int test__eqdf2vfp(double a, double b) { int actual = __eqdf2vfp(a, b); int expected = (a == b) ? 1 : 0; if (actual != expected) printf("error in __eqdf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__eqdf2vfp(0.0, 0.0)) return 1; if (test__eqdf2vfp(1.0, 1.0)) return 1; if (test__eqdf2vfp(0.0, 1.0)) return 1; if (test__eqdf2vfp(-1.0, -1.0)) return 1; if (test__eqdf2vfp(-1.0, 0.0)) return 1; if (test__eqdf2vfp(HUGE_VAL, 1.0)) return 1; if (test__eqdf2vfp(1.0, HUGE_VAL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/addsf3vfp_test.c0000664000175000017500000000234512516462465030032 0ustar mwhudsonmwhudson//===-- addsf3vfp_test.c - Test __addsf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __addsf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __addsf3vfp(float a, float b); #if __arm__ int test__addsf3vfp(float a, float b) { float actual = __addsf3vfp(a, b); float expected = a + b; if (actual != expected) printf("error in test__addsf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__addsf3vfp(1.0, 1.0)) return 1; if (test__addsf3vfp(HUGE_VALF, HUGE_VALF)) return 1; if (test__addsf3vfp(0.0, HUGE_VALF)) return 1; if (test__addsf3vfp(0.0, -0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/unordtf2_test.c0000664000175000017500000000345512316541140027702 0ustar mwhudsonmwhudson//===------------ unordtf2_test.c - Test __unordtf2------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __unordtf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __unordtf2(long double a, long double b); int test__unordtf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __unordtf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__unordtf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__unordtf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // other if (test__unordtf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, EQUAL_0)) return 1; if (test__unordtf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, EQUAL_0)) return 1; if (test__unordtf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, EQUAL_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/muldc3_test.c0000664000175000017500000001644712516462465027351 0ustar mwhudsonmwhudson//===-- muldc3_test.c - Test __muldc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __muldc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include // Returns: the product of a + ib and c + id COMPILER_RT_ABI double _Complex __muldc3(double __a, double __b, double __c, double __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(double _Complex x) { if (x == 0) return zero; if (isinf(creal(x)) || isinf(cimag(x))) return inf; if (isnan(creal(x)) && isnan(cimag(x))) return NaN; if (isnan(creal(x))) { if (cimag(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimag(x))) { if (creal(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__muldc3(double a, double b, double c, double d) { double _Complex r = __muldc3(a, b, c, d); // printf("test__muldc3(%f, %f, %f, %f) = %f + I%f\n", // a, b, c, d, creal(r), cimag(r)); double _Complex dividend; double _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; if (r != a * c - b * d + _Complex_I*(a * d + b * c)) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != inf) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } double x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; int main() { const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__muldc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/popcountdi2_test.c0000664000175000017500000000315512516462465030420 0ustar mwhudsonmwhudson//===-- popcountdi2_test.c - Test __popcountdi2 ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __popcountdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: count of 1 bits COMPILER_RT_ABI si_int __popcountdi2(di_int a); int naive_popcount(di_int a) { int r = 0; for (; a; a = (du_int)a >> 1) r += a & 1; return r; } int test__popcountdi2(di_int a) { si_int x = __popcountdi2(a); si_int expected = naive_popcount(a); if (x != expected) printf("error in __popcountdi2(0x%llX) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(si_int)*CHAR_BIT == 32] = {0}; int main() { if (test__popcountdi2(0)) return 1; if (test__popcountdi2(1)) return 1; if (test__popcountdi2(2)) return 1; if (test__popcountdi2(0xFFFFFFFFFFFFFFFDLL)) return 1; if (test__popcountdi2(0xFFFFFFFFFFFFFFFELL)) return 1; if (test__popcountdi2(0xFFFFFFFFFFFFFFFFLL)) return 1; int i; for (i = 0; i < 10000; ++i) if (test__popcountdi2(((di_int)rand() << 32) | rand())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/trunctfdf2_test.c0000664000175000017500000000414412516462465030232 0ustar mwhudsonmwhudson//===-------------- trunctfdf2_test.c - Test __trunctfdf2 -----------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __trunctfdf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" COMPILER_RT_ABI double __trunctfdf2(long double a); int test__trunctfdf2(long double a, uint64_t expected) { double x = __trunctfdf2(a); int ret = compareResultD(x, expected); if (ret) { printf("error in test__trunctfdf2(%.20Lf) = %lf, " "expected %lf\n", a, x, fromRep64(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN if (test__trunctfdf2(makeQNaN128(), UINT64_C(0x7ff8000000000000))) return 1; // NaN if (test__trunctfdf2(makeNaN128(UINT64_C(0x810000000000)), UINT64_C(0x7ff8100000000000))) return 1; // inf if (test__trunctfdf2(makeInf128(), UINT64_C(0x7ff0000000000000))) return 1; // zero if (test__trunctfdf2(0.0L, UINT64_C(0x0))) return 1; if (test__trunctfdf2(0x1.af23456789bbaaab347645365cdep+5L, UINT64_C(0x404af23456789bbb))) return 1; if (test__trunctfdf2(0x1.dedafcff354b6ae9758763545432p-9L, UINT64_C(0x3f6dedafcff354b7))) return 1; if (test__trunctfdf2(0x1.2f34dd5f437e849b4baab754cdefp+4534L, UINT64_C(0x7ff0000000000000))) return 1; if (test__trunctfdf2(0x1.edcbff8ad76ab5bf46463233214fp-435L, UINT64_C(0x24cedcbff8ad76ab))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatundixf_test.c0000664000175000017500000001217012516462465030472 0ustar mwhudsonmwhudson//===-- floatundixf_test.c - Test __floatundixf ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatundixf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if HAS_80_BIT_LONG_DOUBLE // Returns: convert a to a long double, rounding toward even. // Assumption: long double is a IEEE 80 bit floating point type padded to 128 bits // du_int is a 64 bit integral type // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI long double __floatundixf(du_int a); int test__floatundixf(du_int a, long double expected) { long double x = __floatundixf(a); if (x != expected) printf("error in __floatundixf(%llX) = %LA, expected %LA\n", a, x, expected); return x != expected; } char assumption_1[sizeof(du_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(du_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if HAS_80_BIT_LONG_DOUBLE if (test__floatundixf(0, 0.0)) return 1; if (test__floatundixf(1, 1.0)) return 1; if (test__floatundixf(2, 2.0)) return 1; if (test__floatundixf(20, 20.0)) return 1; if (test__floatundixf(0x7FFFFF8000000000ULL, 0x1.FFFFFEp+62)) return 1; if (test__floatundixf(0x7FFFFFFFFFFFF800ULL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatundixf(0x7FFFFF0000000000ULL, 0x1.FFFFFCp+62)) return 1; if (test__floatundixf(0x7FFFFFFFFFFFF000ULL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatundixf(0x7FFFFFFFFFFFFFFFULL, 0xF.FFFFFFFFFFFFFFEp+59L)) return 1; if (test__floatundixf(0xFFFFFFFFFFFFFFFEULL, 0xF.FFFFFFFFFFFFFFEp+60L)) return 1; if (test__floatundixf(0xFFFFFFFFFFFFFFFFULL, 0xF.FFFFFFFFFFFFFFFp+60L)) return 1; if (test__floatundixf(0x8000008000000000ULL, 0x8.000008p+60)) return 1; if (test__floatundixf(0x8000000000000800ULL, 0x8.0000000000008p+60)) return 1; if (test__floatundixf(0x8000010000000000ULL, 0x8.00001p+60)) return 1; if (test__floatundixf(0x8000000000001000ULL, 0x8.000000000001p+60)) return 1; if (test__floatundixf(0x8000000000000000ULL, 0x8p+60)) return 1; if (test__floatundixf(0x8000000000000001ULL, 0x8.000000000000001p+60L)) return 1; if (test__floatundixf(0x0007FB72E8000000ULL, 0x1.FEDCBAp+50)) return 1; if (test__floatundixf(0x0007FB72EA000000ULL, 0x1.FEDCBA8p+50)) return 1; if (test__floatundixf(0x0007FB72EB000000ULL, 0x1.FEDCBACp+50)) return 1; if (test__floatundixf(0x0007FB72EBFFFFFFULL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floatundixf(0x0007FB72EC000000ULL, 0x1.FEDCBBp+50)) return 1; if (test__floatundixf(0x0007FB72E8000001ULL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floatundixf(0x0007FB72E6000000ULL, 0x1.FEDCB98p+50)) return 1; if (test__floatundixf(0x0007FB72E7000000ULL, 0x1.FEDCB9Cp+50)) return 1; if (test__floatundixf(0x0007FB72E7FFFFFFULL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floatundixf(0x0007FB72E4000001ULL, 0x1.FEDCB90000004p+50)) return 1; if (test__floatundixf(0x0007FB72E4000000ULL, 0x1.FEDCB9p+50)) return 1; if (test__floatundixf(0x023479FD0E092DC0ULL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundixf(0x023479FD0E092DA1ULL, 0x8.D1E7F43824B684p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DB0ULL, 0x8.D1E7f43824B6Cp+54L)) return 1; if (test__floatundixf(0x023479FD0E092DB8ULL, 0x8.D1E7F43824B6Ep+54L)) return 1; if (test__floatundixf(0x023479FD0E092DB6ULL, 0x8.D1E7F43824B6D8p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DBFULL, 0x8.D1E7F43824B6FCp+54L)) return 1; if (test__floatundixf(0x023479FD0E092DC1ULL, 0x8.D1E7F43824B704p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DC7ULL, 0x8.D1E7F43824B71Cp+54L)) return 1; if (test__floatundixf(0x023479FD0E092DC8ULL, 0x8.D1E7F43824B72p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DCFULL, 0x8.D1E7F43824B73Cp+54L)) return 1; if (test__floatundixf(0x023479FD0E092DD0ULL, 0x8.D1E7F43824B74p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DD1ULL, 0x8.D1E7F43824B744p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DD8ULL, 0x8.D1E7F43824B76p+54L)) return 1; if (test__floatundixf(0x023479FD0E092DDFULL, 0x8.D1E7F43824B77Cp+54L)) return 1; if (test__floatundixf(0x023479FD0E092DE0ULL, 0x1.1A3CFE870496Fp+57)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gtdf2vfp_test.c0000664000175000017500000000246111570537001027657 0ustar mwhudsonmwhudson//===-- gtdf2vfp_test.c - Test __gtdf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __gtdf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __gtdf2vfp(double a, double b); #if __arm__ int test__gtdf2vfp(double a, double b) { int actual = __gtdf2vfp(a, b); int expected = (a > b) ? 1 : 0; if (actual != expected) printf("error in __gtdf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__gtdf2vfp(0.0, 0.0)) return 1; if (test__gtdf2vfp(1.0, 0.0)) return 1; if (test__gtdf2vfp(-1.0, -2.0)) return 1; if (test__gtdf2vfp(-2.0, -1.0)) return 1; if (test__gtdf2vfp(HUGE_VALF, 1.0)) return 1; if (test__gtdf2vfp(1.0, HUGE_VALF)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/eqtf2_test.c0000664000175000017500000000475712316541140027166 0ustar mwhudsonmwhudson//===------------ eqtf2_test.c - Test __eqtf2------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __eqtf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __eqtf2(long double a, long double b); int test__eqtf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __eqtf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__eqtf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__eqtf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // < // exp if (test__eqtf2(0x1.234567890abcdef1234567890abcp-3L, 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // mantissa if (test__eqtf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // sign if (test__eqtf2(-0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // == if (test__eqtf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, EQUAL_0)) return 1; // > // exp if (test__eqtf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, NEQUAL_0)) return 1; // mantissa if (test__eqtf2(0x1.334567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; // sign if (test__eqtf2(0x1.234567890abcdef1234567890abcp+3L, -0x1.234567890abcdef1234567890abcp+3L, NEQUAL_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/clzti2_test.c0000664000175000017500000000473312516462465027364 0ustar mwhudsonmwhudson//===-- clzti2_test.c - Test __clzti2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __clzti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: the number of leading 0-bits // Precondition: a != 0 COMPILER_RT_ABI si_int __clzti2(ti_int a); int test__clzti2(ti_int a, si_int expected) { si_int x = __clzti2(a); if (x != expected) { twords at; at.all = a; printf("error in __clzti2(0x%llX%.16llX) = %d, expected %d\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT const int N = (int)(sizeof(ti_int) * CHAR_BIT); if (test__clzti2(0x00000001, N-1)) return 1; if (test__clzti2(0x00000002, N-2)) return 1; if (test__clzti2(0x00000003, N-2)) return 1; if (test__clzti2(0x00000004, N-3)) return 1; if (test__clzti2(0x00000005, N-3)) return 1; if (test__clzti2(0x0000000A, N-4)) return 1; if (test__clzti2(0x1000000A, N*3/4+3)) return 1; if (test__clzti2(0x2000000A, N*3/4+2)) return 1; if (test__clzti2(0x6000000A, N*3/4+1)) return 1; if (test__clzti2(0x8000000AuLL, N*3/4)) return 1; if (test__clzti2(0x000005008000000AuLL, 85)) return 1; if (test__clzti2(0x020005008000000AuLL, 70)) return 1; if (test__clzti2(0x720005008000000AuLL, 65)) return 1; if (test__clzti2(0x820005008000000AuLL, 64)) return 1; if (test__clzti2(make_ti(0x0000000080000000LL, 0x8000000800000000LL), 32)) return 1; if (test__clzti2(make_ti(0x0000000100000000LL, 0x8000000800000000LL), 31)) return 1; if (test__clzti2(make_ti(0x1000000100000000LL, 0x8000000800000000LL), 3)) return 1; if (test__clzti2(make_ti(0x7000000100000000LL, 0x8000000800000000LL), 1)) return 1; if (test__clzti2(make_ti(0x8000000100000000LL, 0x8000000800000000LL), 0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/addtf3_test.c0000664000175000017500000000451412516462465027317 0ustar mwhudsonmwhudson//===--------------- addtf3_test.c - Test __addtf3 ------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __addtf3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" // Returns: a + b COMPILER_RT_ABI long double __addtf3(long double a, long double b); int test__addtf3(long double a, long double b, uint64_t expectedHi, uint64_t expectedLo) { long double x = __addtf3(a, b); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret){ printf("error in test__addtf3(%.20Lf, %.20Lf) = %.20Lf, " "expected %.20Lf\n", a, b, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN + any = qNaN if (test__addtf3(makeQNaN128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // NaN + any = NaN if (test__addtf3(makeNaN128(UINT64_C(0x800030000000)), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // inf + inf = inf if (test__addtf3(makeInf128(), makeInf128(), UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // inf + any = inf if (test__addtf3(makeInf128(), 0x1.2335653452436234723489432abcdefp+5L, UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // any + any if (test__addtf3(0x1.23456734245345543849abcdefp+5L, 0x1.edcba52449872455634654321fp-1L, UINT64_C(0x40042afc95c8b579), UINT64_C(0x61e58dd6c51eb77c))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/udivti3_test.c0000664000175000017500000000354512516462465027544 0ustar mwhudsonmwhudson//===-- udivti3_test.c - Test __udivti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __udivti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a / b COMPILER_RT_ABI tu_int __udivti3(tu_int a, tu_int b); int test__udivti3(tu_int a, tu_int b, tu_int expected_q) { tu_int q = __udivti3(a, b); if (q != expected_q) { utwords at; at.all = a; utwords bt; bt.all = b; utwords qt; qt.all = q; utwords expected_qt; expected_qt.all = expected_q; printf("error in __udivti3: 0x%llX%.16llX / 0x%llX%.16llX = " "0x%llX%.16llX, expected 0x%llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, qt.s.high, qt.s.low, expected_qt.s.high, expected_qt.s.low); } return q != expected_q; } #endif int main() { #ifdef CRT_HAS_128BIT if (test__udivti3(0, 1, 0)) return 1; if (test__udivti3(2, 1, 2)) return 1; if (test__udivti3(make_tu(0x8000000000000000uLL, 0), 1, make_tu(0x8000000000000000uLL, 0))) return 1; if (test__udivti3(make_tu(0x8000000000000000uLL, 0), 2, make_tu(0x4000000000000000uLL, 0))) return 1; if (test__udivti3(make_tu(0xFFFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL), 2, make_tu(0x7FFFFFFFFFFFFFFFuLL, 0xFFFFFFFFFFFFFFFFuLL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/comparedf2_test.c0000664000175000017500000005304511470601015030157 0ustar mwhudsonmwhudson//===-- cmpdf2_test.c - Test __cmpdf2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests single-precision soft-double comparisons for the compiler-rt // library. // //===----------------------------------------------------------------------===// #include int __eqdf2(double, double); int __gedf2(double, double); int __gtdf2(double, double); int __ledf2(double, double); int __ltdf2(double, double); int __nedf2(double, double); int __unorddf2(double, double); struct TestVector { double a; double b; int eqReference; int geReference; int gtReference; int leReference; int ltReference; int neReference; int unReference; }; int test__cmpdf2(const struct TestVector *vector) { if (__eqdf2(vector->a, vector->b) != vector->eqReference) { printf("error in __eqdf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __eqdf2(vector->a, vector->b), vector->eqReference); return 1; } if (__gedf2(vector->a, vector->b) != vector->geReference) { printf("error in __gedf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __gedf2(vector->a, vector->b), vector->geReference); return 1; } if (__gtdf2(vector->a, vector->b) != vector->gtReference) { printf("error in __gtdf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __gtdf2(vector->a, vector->b), vector->gtReference); return 1; } if (__ledf2(vector->a, vector->b) != vector->leReference) { printf("error in __ledf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __ledf2(vector->a, vector->b), vector->leReference); return 1; } if (__ltdf2(vector->a, vector->b) != vector->ltReference) { printf("error in __ltdf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __ltdf2(vector->a, vector->b), vector->ltReference); return 1; } if (__nedf2(vector->a, vector->b) != vector->neReference) { printf("error in __nedf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __nedf2(vector->a, vector->b), vector->neReference); return 1; } if (__unorddf2(vector->a, vector->b) != vector->unReference) { printf("error in __unorddf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __unorddf2(vector->a, vector->b), vector->unReference); return 1; } return 0; } /* void generateVectors() { const double arguments[] = { __builtin_nan(""), -__builtin_inf(), -0x1.fffffffffffffp1023, -0x1.0000000000001p0 -0x1.0000000000000p0, -0x1.fffffffffffffp-1, -0x1.0000000000000p-1022, -0x0.fffffffffffffp-1022, -0x0.0000000000001p-1022, -0.0, 0.0, 0x0.0000000000001p-1022, 0x0.fffffffffffffp-1022, 0x1.0000000000000p-1022, 0x1.fffffffffffffp-1, 0x1.0000000000000p0, 0x1.0000000000001p0, 0x1.fffffffffffffp1023, __builtin_inf() }; int numArguments = sizeof arguments / sizeof arguments[0]; for (int i=0; i b ? 1 : a == b ? 0 : -1; const int unResult = a != a || b != b ? 1 : 0; printf("{%a,%a,%d,%d,%d,%d,%d,%d,%d},\n", a, b, leResult, geResult, geResult, leResult, leResult, leResult, unResult); } } } */ static const struct TestVector vectors[] = { {__builtin_nan(""),__builtin_nan(""),1,-1,-1,1,1,1,1}, {__builtin_nan(""),-__builtin_inf(),1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x1.fffffffffffffp+1023,1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x1p+1,1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x1.fffffffffffffp-1,1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x1p-1022,1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x1.fffffcp-1023,1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x1p-1074,1,-1,-1,1,1,1,1}, {__builtin_nan(""),-0x0p+0,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x0p+0,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1p-1074,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1.fffffcp-1023,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1p-1022,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1.fffffffffffffp-1,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1p+0,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1.0000000000001p+0,1,-1,-1,1,1,1,1}, {__builtin_nan(""),0x1.fffffffffffffp+1023,1,-1,-1,1,1,1,1}, {__builtin_nan(""),__builtin_inf(),1,-1,-1,1,1,1,1}, {-__builtin_inf(),__builtin_nan(""),1,-1,-1,1,1,1,1}, {-__builtin_inf(),-__builtin_inf(),0,0,0,0,0,0,0}, {-__builtin_inf(),-0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),-0x1p+1,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),-0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),-0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),-0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inf(),__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x1.fffffffffffffp+1023,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x1.fffffffffffffp+1023,-0x1.fffffffffffffp+1023,0,0,0,0,0,0,0}, {-0x1.fffffffffffffp+1023,-0x1p+1,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,-0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,-0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,-0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp+1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x1p+1,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x1p+1,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {-0x1p+1,-0x1p+1,0,0,0,0,0,0,0}, {-0x1p+1,-0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,-0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,-0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p+1,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x1.fffffffffffffp-1,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x1.fffffffffffffp-1,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {-0x1.fffffffffffffp-1,-0x1p+1,1,1,1,1,1,1,0}, {-0x1.fffffffffffffp-1,-0x1.fffffffffffffp-1,0,0,0,0,0,0,0}, {-0x1.fffffffffffffp-1,-0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,-0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffffffffffp-1,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x1p-1022,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x1p-1022,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {-0x1p-1022,-0x1p+1,1,1,1,1,1,1,0}, {-0x1p-1022,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {-0x1p-1022,-0x1p-1022,0,0,0,0,0,0,0}, {-0x1p-1022,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,-0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1022,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x1.fffffcp-1023,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x1.fffffcp-1023,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {-0x1.fffffcp-1023,-0x1p+1,1,1,1,1,1,1,0}, {-0x1.fffffcp-1023,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {-0x1.fffffcp-1023,-0x1p-1022,1,1,1,1,1,1,0}, {-0x1.fffffcp-1023,-0x1.fffffcp-1023,0,0,0,0,0,0,0}, {-0x1.fffffcp-1023,-0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x1p-1074,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x1p-1074,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {-0x1p-1074,-0x1p+1,1,1,1,1,1,1,0}, {-0x1p-1074,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {-0x1p-1074,-0x1p-1022,1,1,1,1,1,1,0}, {-0x1p-1074,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {-0x1p-1074,-0x1p-1074,0,0,0,0,0,0,0}, {-0x1p-1074,-0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x0p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x1p-1074,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,__builtin_nan(""),1,-1,-1,1,1,1,1}, {-0x0p+0,-__builtin_inf(),1,1,1,1,1,1,0}, {-0x0p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {-0x0p+0,-0x1p+1,1,1,1,1,1,1,0}, {-0x0p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {-0x0p+0,-0x1p-1022,1,1,1,1,1,1,0}, {-0x0p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {-0x0p+0,-0x1p-1074,1,1,1,1,1,1,0}, {-0x0p+0,-0x0p+0,0,0,0,0,0,0,0}, {-0x0p+0,0x0p+0,0,0,0,0,0,0,0}, {-0x0p+0,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {-0x0p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x0p+0,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x0p+0,-__builtin_inf(),1,1,1,1,1,1,0}, {0x0p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x0p+0,-0x1p+1,1,1,1,1,1,1,0}, {0x0p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x0p+0,-0x1p-1022,1,1,1,1,1,1,0}, {0x0p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x0p+0,-0x1p-1074,1,1,1,1,1,1,0}, {0x0p+0,-0x0p+0,0,0,0,0,0,0,0}, {0x0p+0,0x0p+0,0,0,0,0,0,0,0}, {0x0p+0,0x1p-1074,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x0p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1p-1074,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1p-1074,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1p-1074,-0x1p+1,1,1,1,1,1,1,0}, {0x1p-1074,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1p-1074,-0x1p-1022,1,1,1,1,1,1,0}, {0x1p-1074,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1p-1074,-0x1p-1074,1,1,1,1,1,1,0}, {0x1p-1074,-0x0p+0,1,1,1,1,1,1,0}, {0x1p-1074,0x0p+0,1,1,1,1,1,1,0}, {0x1p-1074,0x1p-1074,0,0,0,0,0,0,0}, {0x1p-1074,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x1p-1074,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-1023,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1.fffffcp-1023,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x1p+1,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x1p-1022,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x1p-1074,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,-0x0p+0,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,0x0p+0,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,0x1p-1074,1,1,1,1,1,1,0}, {0x1.fffffcp-1023,0x1.fffffcp-1023,0,0,0,0,0,0,0}, {0x1.fffffcp-1023,0x1p-1022,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-1023,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-1023,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-1023,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-1023,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1p-1022,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1p-1022,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1p-1022,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1p-1022,-0x1p+1,1,1,1,1,1,1,0}, {0x1p-1022,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1p-1022,-0x1p-1022,1,1,1,1,1,1,0}, {0x1p-1022,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1p-1022,-0x1p-1074,1,1,1,1,1,1,0}, {0x1p-1022,-0x0p+0,1,1,1,1,1,1,0}, {0x1p-1022,0x0p+0,1,1,1,1,1,1,0}, {0x1p-1022,0x1p-1074,1,1,1,1,1,1,0}, {0x1p-1022,0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1p-1022,0x1p-1022,0,0,0,0,0,0,0}, {0x1p-1022,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0}, {0x1p-1022,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {0x1p-1022,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {0x1p-1022,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x1p-1022,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1.fffffffffffffp-1,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1.fffffffffffffp-1,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x1p+1,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x1p-1022,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x1p-1074,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,-0x0p+0,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,0x0p+0,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,0x1p-1074,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,0x1p-1022,1,1,1,1,1,1,0}, {0x1.fffffffffffffp-1,0x1.fffffffffffffp-1,0,0,0,0,0,0,0}, {0x1.fffffffffffffp-1,0x1p+0,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffffffffffp-1,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffffffffffp-1,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffffffffffp-1,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1p+0,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1p+0,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1p+0,-0x1p+1,1,1,1,1,1,1,0}, {0x1p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1p+0,-0x1p-1022,1,1,1,1,1,1,0}, {0x1p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1p+0,-0x1p-1074,1,1,1,1,1,1,0}, {0x1p+0,-0x0p+0,1,1,1,1,1,1,0}, {0x1p+0,0x0p+0,1,1,1,1,1,1,0}, {0x1p+0,0x1p-1074,1,1,1,1,1,1,0}, {0x1p+0,0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1p+0,0x1p-1022,1,1,1,1,1,1,0}, {0x1p+0,0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1p+0,0x1p+0,0,0,0,0,0,0,0}, {0x1p+0,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0}, {0x1p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x1p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1.0000000000001p+0,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1.0000000000001p+0,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x1p+1,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x1p-1022,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x1p-1074,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,-0x0p+0,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x0p+0,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x1p-1074,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x1p-1022,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x1p+0,1,1,1,1,1,1,0}, {0x1.0000000000001p+0,0x1.0000000000001p+0,0,0,0,0,0,0,0}, {0x1.0000000000001p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0}, {0x1.0000000000001p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {0x1.fffffffffffffp+1023,__builtin_nan(""),1,-1,-1,1,1,1,1}, {0x1.fffffffffffffp+1023,-__builtin_inf(),1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x1p+1,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x1p-1022,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x1p-1074,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,-0x0p+0,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x0p+0,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1p-1074,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1.fffffcp-1023,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1p-1022,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1p+0,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1.0000000000001p+0,1,1,1,1,1,1,0}, {0x1.fffffffffffffp+1023,0x1.fffffffffffffp+1023,0,0,0,0,0,0,0}, {0x1.fffffffffffffp+1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0}, {__builtin_inf(),__builtin_nan(""),1,-1,-1,1,1,1,1}, {__builtin_inf(),-__builtin_inf(),1,1,1,1,1,1,0}, {__builtin_inf(),-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {__builtin_inf(),-0x1p+1,1,1,1,1,1,1,0}, {__builtin_inf(),-0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {__builtin_inf(),-0x1p-1022,1,1,1,1,1,1,0}, {__builtin_inf(),-0x1.fffffcp-1023,1,1,1,1,1,1,0}, {__builtin_inf(),-0x1p-1074,1,1,1,1,1,1,0}, {__builtin_inf(),-0x0p+0,1,1,1,1,1,1,0}, {__builtin_inf(),0x0p+0,1,1,1,1,1,1,0}, {__builtin_inf(),0x1p-1074,1,1,1,1,1,1,0}, {__builtin_inf(),0x1.fffffcp-1023,1,1,1,1,1,1,0}, {__builtin_inf(),0x1p-1022,1,1,1,1,1,1,0}, {__builtin_inf(),0x1.fffffffffffffp-1,1,1,1,1,1,1,0}, {__builtin_inf(),0x1p+0,1,1,1,1,1,1,0}, {__builtin_inf(),0x1.0000000000001p+0,1,1,1,1,1,1,0}, {__builtin_inf(),0x1.fffffffffffffp+1023,1,1,1,1,1,1,0}, {__builtin_inf(),__builtin_inf(),0,0,0,0,0,0,0}, }; int main(int argc, char *argv[]) { const int numVectors = sizeof vectors / sizeof vectors[0]; int i; for (i = 0; i #include #include #include extern int __ledf2vfp(double a, double b); #if __arm__ int test__ledf2vfp(double a, double b) { int actual = __ledf2vfp(a, b); int expected = (a <= b) ? 1 : 0; if (actual != expected) printf("error in __ledf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__ledf2vfp(0.0, 0.0)) return 1; if (test__ledf2vfp(1.0, 1.0)) return 1; if (test__ledf2vfp(-1.0, -2.0)) return 1; if (test__ledf2vfp(-2.0, -1.0)) return 1; if (test__ledf2vfp(HUGE_VAL, 1.0)) return 1; if (test__ledf2vfp(1.0, HUGE_VAL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/endianness.h0000664000175000017500000000520612026532550027233 0ustar mwhudsonmwhudson/* ===-- endianness.h - configuration header for libgcc replacement --------=== * * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file is a configuration header for libgcc replacement. * This file is not part of the interface of this library. * * ===----------------------------------------------------------------------=== */ #ifndef ENDIANNESS_H #define ENDIANNESS_H /* * Known limitations: * Middle endian systems are not handled currently. */ #if defined(__SVR4) && defined(__sun) #include #if _BYTE_ORDER == _BIG_ENDIAN #define _YUGA_LITTLE_ENDIAN 0 #define _YUGA_BIG_ENDIAN 1 #elif _BYTE_ORDER == _LITTLE_ENDIAN #define _YUGA_LITTLE_ENDIAN 1 #define _YUGA_BIG_ENDIAN 0 #endif /* _BYTE_ORDER */ #endif /* Solaris and AuroraUX. */ /* .. */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonflyBSD__) || defined(__minix) #include #if _BYTE_ORDER == _BIG_ENDIAN #define _YUGA_LITTLE_ENDIAN 0 #define _YUGA_BIG_ENDIAN 1 #elif _BYTE_ORDER == _LITTLE_ENDIAN #define _YUGA_LITTLE_ENDIAN 1 #define _YUGA_BIG_ENDIAN 0 #endif /* _BYTE_ORDER */ #endif /* *BSD */ /* .. */ #if defined(__OpenBSD__) || defined(__Bitrig__) #include #if _BYTE_ORDER == _BIG_ENDIAN #define _YUGA_LITTLE_ENDIAN 0 #define _YUGA_BIG_ENDIAN 1 #elif _BYTE_ORDER == _LITTLE_ENDIAN #define _YUGA_LITTLE_ENDIAN 1 #define _YUGA_BIG_ENDIAN 0 #endif /* _BYTE_ORDER */ #endif /* OpenBSD and Bitrig. */ /* .. */ /* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */ #if defined(__APPLE__) && defined(__MACH__) || defined(__ellcc__ ) #ifdef __BIG_ENDIAN__ #if __BIG_ENDIAN__ #define _YUGA_LITTLE_ENDIAN 0 #define _YUGA_BIG_ENDIAN 1 #endif #endif /* __BIG_ENDIAN__ */ #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ #define _YUGA_LITTLE_ENDIAN 1 #define _YUGA_BIG_ENDIAN 0 #endif #endif /* __LITTLE_ENDIAN__ */ #endif /* Mac OSX */ /* .. */ #if defined(__linux__) #include #if __BYTE_ORDER == __BIG_ENDIAN #define _YUGA_LITTLE_ENDIAN 0 #define _YUGA_BIG_ENDIAN 1 #elif __BYTE_ORDER == __LITTLE_ENDIAN #define _YUGA_LITTLE_ENDIAN 1 #define _YUGA_BIG_ENDIAN 0 #endif /* __BYTE_ORDER */ #endif /* GNU/Linux */ /* . */ #if !defined(_YUGA_LITTLE_ENDIAN) || !defined(_YUGA_BIG_ENDIAN) #error Unable to determine endian #endif /* Check we found an endianness correctly. */ #endif /* ENDIANNESS_H */ golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divtf3_test.c0000664000175000017500000000610412516462465027346 0ustar mwhudsonmwhudson//===--------------- divtf3_test.c - Test __divtf3 ------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divtf3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" // Returns: a / b COMPILER_RT_ABI long double __divtf3(long double a, long double b); int test__divtf3(long double a, long double b, uint64_t expectedHi, uint64_t expectedLo) { long double x = __divtf3(a, b); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret){ printf("error in test__divtf3(%.20Lf, %.20Lf) = %.20Lf, " "expected %.20Lf\n", a, b, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 // qNaN / any = qNaN if (test__divtf3(makeQNaN128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // NaN / any = NaN if (test__divtf3(makeNaN128(UINT64_C(0x800030000000)), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff800000000000), UINT64_C(0x0))) return 1; // inf / any = inf if (test__divtf3(makeInf128(), 0x1.23456789abcdefp+5L, UINT64_C(0x7fff000000000000), UINT64_C(0x0))) return 1; // any / any if (test__divtf3(0x1.a23b45362464523375893ab4cdefp+5L, 0x1.eedcbaba3a94546558237654321fp-1L, UINT64_C(0x4004b0b72924d407), UINT64_C(0x0717e84356c6eba2))) return 1; if (test__divtf3(0x1.a2b34c56d745382f9abf2c3dfeffp-50L, 0x1.ed2c3ba15935332532287654321fp-9L, UINT64_C(0x3fd5b2af3f828c9b), UINT64_C(0x40e51f64cde8b1f2))) return 15; if (test__divtf3(0x1.2345f6aaaa786555f42432abcdefp+456L, 0x1.edacbba9874f765463544dd3621fp+6400L, UINT64_C(0x28c62e15dc464466), UINT64_C(0xb5a07586348557ac))) return 1; if (test__divtf3(0x1.2d3456f789ba6322bc665544edefp-234L, 0x1.eddcdba39f3c8b7a36564354321fp-4455L, UINT64_C(0x507b38442b539266), UINT64_C(0x22ce0f1d024e1252))) return 1; if (test__divtf3(0x1.2345f6b77b7a8953365433abcdefp+234L, 0x1.edcba987d6bb3aa467754354321fp-4055L, UINT64_C(0x50bf2e02f0798d36), UINT64_C(0x5e6fcb6b60044078))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulosi4_test.c0000664000175000017500000001104612516462465027544 0ustar mwhudsonmwhudson//===-- mulosi4_test.c - Test __mulosi4 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulosi4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a * b // Effects: aborts if a * b overflows COMPILER_RT_ABI si_int __mulosi4(si_int a, si_int b, int *overflow); int test__mulosi4(si_int a, si_int b, si_int expected, int expected_overflow) { int ov; si_int x = __mulosi4(a, b, &ov); if (ov != expected_overflow) printf("error in __mulosi4: overflow=%d expected=%d\n", ov, expected_overflow); else if (!expected_overflow && x != expected) { printf("error in __mulosi4: 0x%X * 0x%X = 0x%X (overflow=%d), " "expected 0x%X (overflow=%d)\n", a, b, x, ov, expected, expected_overflow); return 1; } return 0; } int main() { if (test__mulosi4(0, 0, 0, 0)) return 1; if (test__mulosi4(0, 1, 0, 0)) return 1; if (test__mulosi4(1, 0, 0, 0)) return 1; if (test__mulosi4(0, 10, 0, 0)) return 1; if (test__mulosi4(10, 0, 0, 0)) return 1; if (test__mulosi4(0, 0x1234567, 0, 0)) return 1; if (test__mulosi4(0x1234567, 0, 0, 0)) return 1; if (test__mulosi4(0, -1, 0, 0)) return 1; if (test__mulosi4(-1, 0, 0, 0)) return 1; if (test__mulosi4(0, -10, 0, 0)) return 1; if (test__mulosi4(-10, 0, 0, 0)) return 1; if (test__mulosi4(0, -0x1234567, 0, 0)) return 1; if (test__mulosi4(-0x1234567, 0, 0, 0)) return 1; if (test__mulosi4(1, 1, 1, 0)) return 1; if (test__mulosi4(1, 10, 10, 0)) return 1; if (test__mulosi4(10, 1, 10, 0)) return 1; if (test__mulosi4(1, 0x1234567, 0x1234567, 0)) return 1; if (test__mulosi4(0x1234567, 1, 0x1234567, 0)) return 1; if (test__mulosi4(1, -1, -1, 0)) return 1; if (test__mulosi4(1, -10, -10, 0)) return 1; if (test__mulosi4(-10, 1, -10, 0)) return 1; if (test__mulosi4(1, -0x1234567, -0x1234567, 0)) return 1; if (test__mulosi4(-0x1234567, 1, -0x1234567, 0)) return 1; if (test__mulosi4(0x7FFFFFFF, -2, 0x80000001, 1)) return 1; if (test__mulosi4(-2, 0x7FFFFFFF, 0x80000001, 1)) return 1; if (test__mulosi4(0x7FFFFFFF, -1, 0x80000001, 0)) return 1; if (test__mulosi4(-1, 0x7FFFFFFF, 0x80000001, 0)) return 1; if (test__mulosi4(0x7FFFFFFF, 0, 0, 0)) return 1; if (test__mulosi4(0, 0x7FFFFFFF, 0, 0)) return 1; if (test__mulosi4(0x7FFFFFFF, 1, 0x7FFFFFFF, 0)) return 1; if (test__mulosi4(1, 0x7FFFFFFF, 0x7FFFFFFF, 0)) return 1; if (test__mulosi4(0x7FFFFFFF, 2, 0x80000001, 1)) return 1; if (test__mulosi4(2, 0x7FFFFFFF, 0x80000001, 1)) return 1; if (test__mulosi4(0x80000000, -2, 0x80000000, 1)) return 1; if (test__mulosi4(-2, 0x80000000, 0x80000000, 1)) return 1; if (test__mulosi4(0x80000000, -1, 0x80000000, 1)) return 1; if (test__mulosi4(-1, 0x80000000, 0x80000000, 1)) return 1; if (test__mulosi4(0x80000000, 0, 0, 0)) return 1; if (test__mulosi4(0, 0x80000000, 0, 0)) return 1; if (test__mulosi4(0x80000000, 1, 0x80000000, 0)) return 1; if (test__mulosi4(1, 0x80000000, 0x80000000, 0)) return 1; if (test__mulosi4(0x80000000, 2, 0x80000000, 1)) return 1; if (test__mulosi4(2, 0x80000000, 0x80000000, 1)) return 1; if (test__mulosi4(0x80000001, -2, 0x80000001, 1)) return 1; if (test__mulosi4(-2, 0x80000001, 0x80000001, 1)) return 1; if (test__mulosi4(0x80000001, -1, 0x7FFFFFFF, 0)) return 1; if (test__mulosi4(-1, 0x80000001, 0x7FFFFFFF, 0)) return 1; if (test__mulosi4(0x80000001, 0, 0, 0)) return 1; if (test__mulosi4(0, 0x80000001, 0, 0)) return 1; if (test__mulosi4(0x80000001, 1, 0x80000001, 0)) return 1; if (test__mulosi4(1, 0x80000001, 0x80000001, 0)) return 1; if (test__mulosi4(0x80000001, 2, 0x80000000, 1)) return 1; if (test__mulosi4(2, 0x80000001, 0x80000000, 1)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunssfsivfp_test.c0000664000175000017500000000236411570537001031054 0ustar mwhudsonmwhudson//===-- fixunssfsivfp_test.c - Test __fixunssfsivfp -----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunssfsivfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include extern unsigned int __fixunssfsivfp(float a); #if __arm__ int test__fixunssfsivfp(float a) { unsigned int actual = __fixunssfsivfp(a); unsigned int expected = a; if (actual != expected) printf("error in test__fixunssfsivfp(%f) = %u, expected %u\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__fixunssfsivfp(0.0)) return 1; if (test__fixunssfsivfp(1.0)) return 1; if (test__fixunssfsivfp(-1.0)) return 1; if (test__fixunssfsivfp(4294967295.0)) return 1; if (test__fixunssfsivfp(65536.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negdi2_test.c0000664000175000017500000000517012516462465027321 0ustar mwhudsonmwhudson//===-- negdi2_test.c - Test __negdi2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: -a COMPILER_RT_ABI di_int __negdi2(di_int a); int test__negdi2(di_int a, di_int expected) { di_int x = __negdi2(a); if (x != expected) printf("error in __negdi2: -0x%llX = 0x%llX, expected 0x%llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__negdi2(0, 0)) return 1; if (test__negdi2(1, -1)) return 1; if (test__negdi2(-1, 1)) return 1; if (test__negdi2(2, -2)) return 1; if (test__negdi2(-2, 2)) return 1; if (test__negdi2(3, -3)) return 1; if (test__negdi2(-3, 3)) return 1; if (test__negdi2(0x00000000FFFFFFFELL, 0xFFFFFFFF00000002LL)) return 1; if (test__negdi2(0xFFFFFFFF00000002LL, 0x00000000FFFFFFFELL)) return 1; if (test__negdi2(0x00000000FFFFFFFFLL, 0xFFFFFFFF00000001LL)) return 1; if (test__negdi2(0xFFFFFFFF00000001LL, 0x00000000FFFFFFFFLL)) return 1; if (test__negdi2(0x0000000100000000LL, 0xFFFFFFFF00000000LL)) return 1; if (test__negdi2(0xFFFFFFFF00000000LL, 0x0000000100000000LL)) return 1; if (test__negdi2(0x0000000200000000LL, 0xFFFFFFFE00000000LL)) return 1; if (test__negdi2(0xFFFFFFFE00000000LL, 0x0000000200000000LL)) return 1; if (test__negdi2(0x0000000300000000LL, 0xFFFFFFFD00000000LL)) return 1; if (test__negdi2(0xFFFFFFFD00000000LL, 0x0000000300000000LL)) return 1; if (test__negdi2(0x8000000000000000LL, 0x8000000000000000LL)) return 1; if (test__negdi2(0x8000000000000001LL, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__negdi2(0x7FFFFFFFFFFFFFFFLL, 0x8000000000000001LL)) return 1; if (test__negdi2(0xFFFFFFFE00000000LL, 0x0000000200000000LL)) return 1; if (test__negdi2(0x0000000200000000LL, 0xFFFFFFFE00000000LL)) return 1; if (test__negdi2(0xFFFFFFFF00000000LL, 0x0000000100000000LL)) return 1; if (test__negdi2(0x0000000100000000LL, 0xFFFFFFFF00000000LL)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ppc/0000775000175000017500000000000013040224624025507 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ppc/qsub_test.c0000664000175000017500000070113211221175607027675 0ustar mwhudsonmwhudson#include #include "DD.h" long double __gcc_qsub(long double x, long double y); double testAccuracy(); int testEdgeCases(); int main(int argc, char *argv[]) { if (testEdgeCases()) return 1; if (testAccuracy() > 1.0) return 1; return 0; } struct testVector { double xhi; double xlo; double yhi; double ylo; double rhi; double rlo; }; #define INFINITY __builtin_inf() #define HUGE 0x1.fffffffffffffp1023 #define QNAN __builtin_nan("") const struct testVector edgeCases[] = { { 0.0, 0.0, -0.0, 0.0, 0.0, 0.0 }, { -0.0, 0.0, -0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { -0.0, 0.0, 0.0, 0.0, -0.0, 0.0 }, { INFINITY, 0.0, -0.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -0.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, 0.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 0.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -1.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -1.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, 1.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 1.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -HUGE, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -HUGE, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, HUGE, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, HUGE, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { 0.0, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { 0.0, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { -0.0, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { -0.0, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { 1.0, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { 1.0, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { -1.0, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { -1.0, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { HUGE, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { HUGE, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { -HUGE, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { -HUGE, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, }; const int numEdgeCases = sizeof(edgeCases) / sizeof(struct testVector); int testEdgeCases() { int i; DD a, b, c, r; for (i=0; i #include #include #ifdef __x86_64__ #define randlength 2 #else #define randlength 4 #endif int main(int argc, char *argv[]) { MPFR_DECL_INIT(a, 106); MPFR_DECL_INIT(b, 106); MPFR_DECL_INIT(c, 106); MPFR_DECL_INIT(tmp, 53); int exponent_range = atoi(argv[1]); int i; for (i=0; i<128; ++i) { mpfr_random2(a, randlength, exponent_range); mpfr_random2(b, randlength, exponent_range); mpfr_add(c, a, b, GMP_RNDN); double ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); double alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); double bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); double blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); double chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); double clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); mpfr_neg(b, b, GMP_RNDN); mpfr_add(c, a, b, GMP_RNDN); ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); mpfr_neg(a, a, GMP_RNDN); mpfr_neg(b, b, GMP_RNDN); mpfr_add(c, a, b, GMP_RNDN); ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); mpfr_neg(b, b, GMP_RNDN); mpfr_add(c, a, b, GMP_RNDN); ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); } return 0; } */ const struct testVector accuracyTests[] = { // Some test cases that cover the whole exponent range: {0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302, 0x1.0003ffffffffcp+140, 0x1.ffffc00000000p+53, 0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302}, {0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302, -0x1.0003ffffffffcp+140, -0x1.ffffc00000000p+53, 0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302}, {-0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302, 0x1.0003ffffffffcp+140, 0x1.ffffc00000000p+53, -0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302}, {-0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302, -0x1.0003ffffffffcp+140, -0x1.ffffc00000000p+53, -0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302}, {0x1.0000100000000p-746, -0x1.0000000000000p-808, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692}, {0x1.0000100000000p-746, -0x1.0000000000000p-808, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692}, {-0x1.0000100000000p-746, 0x1.0000000000000p-808, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692}, {-0x1.0000100000000p-746, 0x1.0000000000000p-808, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692}, {0x1.0000000800000p+426, -0x1.0000000000000p+354, 0x1.000003fffc002p-730, -0x1.0000000000000p-835, 0x1.0000000800000p+426, -0x1.0000000000000p+354}, {0x1.0000000800000p+426, -0x1.0000000000000p+354, -0x1.000003fffc002p-730, 0x1.0000000000000p-835, 0x1.0000000800000p+426, -0x1.0000000000000p+354}, {-0x1.0000000800000p+426, 0x1.0000000000000p+354, 0x1.000003fffc002p-730, -0x1.0000000000000p-835, -0x1.0000000800000p+426, 0x1.0000000000000p+354}, {-0x1.0000000800000p+426, 0x1.0000000000000p+354, -0x1.000003fffc002p-730, 0x1.0000000000000p-835, -0x1.0000000800000p+426, 0x1.0000000000000p+354}, {0x1.0000000000000p-262, 0x1.ffc001ffffe00p-317, 0x1.000003fff8000p-258, 0x1.fffc000fc0000p-329, 0x1.100003fff8000p-258, 0x1.ffe001c000dc0p-317}, {0x1.0000000000000p-262, 0x1.ffc001ffffe00p-317, -0x1.000003fff8000p-258, -0x1.fffc000fc0000p-329, -0x1.e00007fff0000p-259, 0x1.ffa0023ffee40p-317}, {-0x1.0000000000000p-262, -0x1.ffc001ffffe00p-317, 0x1.000003fff8000p-258, 0x1.fffc000fc0000p-329, 0x1.e00007fff0000p-259, -0x1.ffa0023ffee40p-317}, {-0x1.0000000000000p-262, -0x1.ffc001ffffe00p-317, -0x1.000003fff8000p-258, -0x1.fffc000fc0000p-329, -0x1.100003fff8000p-258, -0x1.ffe001c000dc0p-317}, {0x1.0000000000003p+980, 0x1.fc00001fff800p+916, 0x1.0000000000020p+626, -0x1.fc01ffe002000p+562, 0x1.0000000000003p+980, 0x1.fc00001fff800p+916}, {0x1.0000000000003p+980, 0x1.fc00001fff800p+916, -0x1.0000000000020p+626, 0x1.fc01ffe002000p+562, 0x1.0000000000003p+980, 0x1.fc00001fff800p+916}, {-0x1.0000000000003p+980, -0x1.fc00001fff800p+916, 0x1.0000000000020p+626, -0x1.fc01ffe002000p+562, -0x1.0000000000003p+980, -0x1.fc00001fff800p+916}, {-0x1.0000000000003p+980, -0x1.fc00001fff800p+916, -0x1.0000000000020p+626, 0x1.fc01ffe002000p+562, -0x1.0000000000003p+980, -0x1.fc00001fff800p+916}, {0x1.0000000000000p-800, 0x1.fffff00001ffep-854, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410}, {0x1.0000000000000p-800, 0x1.fffff00001ffep-854, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410}, {-0x1.0000000000000p-800, -0x1.fffff00001ffep-854, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410}, {-0x1.0000000000000p-800, -0x1.fffff00001ffep-854, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410}, {0x1.0000000000000p+925, 0x1.ffffffffffc00p+862, 0x1.0000200000000p-454, -0x1.ffc0000080000p-526, 0x1.0000000000000p+925, 0x1.ffffffffffc00p+862}, {0x1.0000000000000p+925, 0x1.ffffffffffc00p+862, -0x1.0000200000000p-454, 0x1.ffc0000080000p-526, 0x1.0000000000000p+925, 0x1.ffffffffffc00p+862}, {-0x1.0000000000000p+925, -0x1.ffffffffffc00p+862, 0x1.0000200000000p-454, -0x1.ffc0000080000p-526, -0x1.0000000000000p+925, -0x1.ffffffffffc00p+862}, {-0x1.0000000000000p+925, -0x1.ffffffffffc00p+862, -0x1.0000200000000p-454, 0x1.ffc0000080000p-526, -0x1.0000000000000p+925, -0x1.ffffffffffc00p+862}, {0x1.0000000000800p+265, -0x1.fffc000000010p+208, 0x1.0000000000008p-204, -0x1.ffe03fffff010p-261, 0x1.0000000000800p+265, -0x1.fffc000000010p+208}, {0x1.0000000000800p+265, -0x1.fffc000000010p+208, -0x1.0000000000008p-204, 0x1.ffe03fffff010p-261, 0x1.0000000000800p+265, -0x1.fffc000000010p+208}, {-0x1.0000000000800p+265, 0x1.fffc000000010p+208, 0x1.0000000000008p-204, -0x1.ffe03fffff010p-261, -0x1.0000000000800p+265, 0x1.fffc000000010p+208}, {-0x1.0000000000800p+265, 0x1.fffc000000010p+208, -0x1.0000000000008p-204, 0x1.ffe03fffff010p-261, -0x1.0000000000800p+265, 0x1.fffc000000010p+208}, {0x1.0000000000000p-690, 0x1.fffef0ffff000p-753, 0x1.0000100000000p+763, -0x1.fff8000000800p+699, 0x1.0000100000000p+763, -0x1.fff8000000800p+699}, {0x1.0000000000000p-690, 0x1.fffef0ffff000p-753, -0x1.0000100000000p+763, 0x1.fff8000000800p+699, -0x1.0000100000000p+763, 0x1.fff8000000800p+699}, {-0x1.0000000000000p-690, -0x1.fffef0ffff000p-753, 0x1.0000100000000p+763, -0x1.fff8000000800p+699, 0x1.0000100000000p+763, -0x1.fff8000000800p+699}, {-0x1.0000000000000p-690, -0x1.fffef0ffff000p-753, -0x1.0000100000000p+763, 0x1.fff8000000800p+699, -0x1.0000100000000p+763, 0x1.fff8000000800p+699}, {0x1.07c00007ffff0p-506, 0x1.fffc00f800000p-582, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373}, {0x1.07c00007ffff0p-506, 0x1.fffc00f800000p-582, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373}, {-0x1.07c00007ffff0p-506, -0x1.fffc00f800000p-582, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373}, {-0x1.07c00007ffff0p-506, -0x1.fffc00f800000p-582, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373}, {0x1.0000000000000p-958, 0x1.ff800fffff800p-1014, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317}, {0x1.0000000000000p-958, 0x1.ff800fffff800p-1014, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317}, {-0x1.0000000000000p-958, -0x1.ff800fffff800p-1014, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317}, {-0x1.0000000000000p-958, -0x1.ff800fffff800p-1014, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317}, {0x1.0000000008000p+114, -0x1.ffff807ffe002p+60, 0x1.0000000800000p-783, -0x1.ffffff8000008p-839, 0x1.0000000008000p+114, -0x1.ffff807ffe002p+60}, {0x1.0000000008000p+114, -0x1.ffff807ffe002p+60, -0x1.0000000800000p-783, 0x1.ffffff8000008p-839, 0x1.0000000008000p+114, -0x1.ffff807ffe002p+60}, {-0x1.0000000008000p+114, 0x1.ffff807ffe002p+60, 0x1.0000000800000p-783, -0x1.ffffff8000008p-839, -0x1.0000000008000p+114, 0x1.ffff807ffe002p+60}, {-0x1.0000000008000p+114, 0x1.ffff807ffe002p+60, -0x1.0000000800000p-783, 0x1.ffffff8000008p-839, -0x1.0000000008000p+114, 0x1.ffff807ffe002p+60}, {0x1.0000000000020p+340, -0x1.0000000000000p+257, 0x1.0000000000000p-442, 0x1.fffff000003c0p-501, 0x1.0000000000020p+340, -0x1.0000000000000p+257}, {0x1.0000000000020p+340, -0x1.0000000000000p+257, -0x1.0000000000000p-442, -0x1.fffff000003c0p-501, 0x1.0000000000020p+340, -0x1.0000000000000p+257}, {-0x1.0000000000020p+340, 0x1.0000000000000p+257, 0x1.0000000000000p-442, 0x1.fffff000003c0p-501, -0x1.0000000000020p+340, 0x1.0000000000000p+257}, {-0x1.0000000000020p+340, 0x1.0000000000000p+257, -0x1.0000000000000p-442, -0x1.fffff000003c0p-501, -0x1.0000000000020p+340, 0x1.0000000000000p+257}, {0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331, 0x1.0000000200000p+69, -0x1.0000000000000p+0, 0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331}, {0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331, -0x1.0000000200000p+69, 0x1.0000000000000p+0, 0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331}, {-0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331, 0x1.0000000200000p+69, -0x1.0000000000000p+0, -0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331}, {-0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331, -0x1.0000000200000p+69, 0x1.0000000000000p+0, -0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331}, {0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198, 0x1.0000000000000p-934, 0x1.8fff01fffff00p-994, 0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198}, {0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198, -0x1.0000000000000p-934, -0x1.8fff01fffff00p-994, 0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198}, {-0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198, 0x1.0000000000000p-934, 0x1.8fff01fffff00p-994, -0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198}, {-0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198, -0x1.0000000000000p-934, -0x1.8fff01fffff00p-994, -0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198}, {0x1.0000000000008p+975, -0x1.ffffc00800000p+902, 0x1.00003ffe00002p-979, -0x1.ffffffc180000p-1039, 0x1.0000000000008p+975, -0x1.ffffc00800000p+902}, {0x1.0000000000008p+975, -0x1.ffffc00800000p+902, -0x1.00003ffe00002p-979, 0x1.ffffffc180000p-1039, 0x1.0000000000008p+975, -0x1.ffffc00800000p+902}, {-0x1.0000000000008p+975, 0x1.ffffc00800000p+902, 0x1.00003ffe00002p-979, -0x1.ffffffc180000p-1039, -0x1.0000000000008p+975, 0x1.ffffc00800000p+902}, {-0x1.0000000000008p+975, 0x1.ffffc00800000p+902, -0x1.00003ffe00002p-979, 0x1.ffffffc180000p-1039, -0x1.0000000000008p+975, 0x1.ffffc00800000p+902}, {0x1.000000ffffff8p+56, 0x1.ffffffc000000p-1, 0x1.0000000000000p-40, 0x1.ffffffe000000p-98, 0x1.000000ffffff8p+56, 0x1.ffffffc002000p-1}, {0x1.000000ffffff8p+56, 0x1.ffffffc000000p-1, -0x1.0000000000000p-40, -0x1.ffffffe000000p-98, 0x1.000000ffffff8p+56, 0x1.ffffffbffe000p-1}, {-0x1.000000ffffff8p+56, -0x1.ffffffc000000p-1, 0x1.0000000000000p-40, 0x1.ffffffe000000p-98, -0x1.000000ffffff8p+56, -0x1.ffffffbffe000p-1}, {-0x1.000000ffffff8p+56, -0x1.ffffffc000000p-1, -0x1.0000000000000p-40, -0x1.ffffffe000000p-98, -0x1.000000ffffff8p+56, -0x1.ffffffc002000p-1}, {0x1.0000000020000p-764, -0x1.0000000000000p-869, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470}, {0x1.0000000020000p-764, -0x1.0000000000000p-869, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470}, {-0x1.0000000020000p-764, 0x1.0000000000000p-869, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470}, {-0x1.0000000020000p-764, 0x1.0000000000000p-869, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470}, {0x1.0000ff8020000p-469, -0x1.fffffa0000000p-531, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80}, {0x1.0000ff8020000p-469, -0x1.fffffa0000000p-531, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80}, {-0x1.0000ff8020000p-469, 0x1.fffffa0000000p-531, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80}, {-0x1.0000ff8020000p-469, 0x1.fffffa0000000p-531, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80}, {0x1.0000020000000p+518, -0x1.0000000000000p+454, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710}, {0x1.0000020000000p+518, -0x1.0000000000000p+454, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710}, {-0x1.0000020000000p+518, 0x1.0000000000000p+454, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710}, {-0x1.0000020000000p+518, 0x1.0000000000000p+454, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710}, {0x1.0007e3ffe0000p-546, 0x1.fe0ffffffe000p-610, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506}, {0x1.0007e3ffe0000p-546, 0x1.fe0ffffffe000p-610, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506}, {-0x1.0007e3ffe0000p-546, -0x1.fe0ffffffe000p-610, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506}, {-0x1.0007e3ffe0000p-546, -0x1.fe0ffffffe000p-610, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506}, {0x1.00000000fe000p-853, 0x1.ff00004000000p-920, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322}, {0x1.00000000fe000p-853, 0x1.ff00004000000p-920, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322}, {-0x1.00000000fe000p-853, -0x1.ff00004000000p-920, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322}, {-0x1.00000000fe000p-853, -0x1.ff00004000000p-920, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322}, {0x1.0000800000000p-529, -0x1.0000000000000p-585, 0x1.0000000000000p-716, 0x1.fffffffc1fc00p-779, 0x1.0000800000000p-529, -0x1.0000000000000p-585}, {0x1.0000800000000p-529, -0x1.0000000000000p-585, -0x1.0000000000000p-716, -0x1.fffffffc1fc00p-779, 0x1.0000800000000p-529, -0x1.0000000000000p-585}, {-0x1.0000800000000p-529, 0x1.0000000000000p-585, 0x1.0000000000000p-716, 0x1.fffffffc1fc00p-779, -0x1.0000800000000p-529, 0x1.0000000000000p-585}, {-0x1.0000800000000p-529, 0x1.0000000000000p-585, -0x1.0000000000000p-716, -0x1.fffffffc1fc00p-779, -0x1.0000800000000p-529, 0x1.0000000000000p-585}, {0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491, 0x1.0000000000000p-565, 0x1.fe0003fffc000p-624, 0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491}, {0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491, -0x1.0000000000000p-565, -0x1.fe0003fffc000p-624, 0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491}, {-0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491, 0x1.0000000000000p-565, 0x1.fe0003fffc000p-624, -0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491}, {-0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491, -0x1.0000000000000p-565, -0x1.fe0003fffc000p-624, -0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491}, {0x1.000000e000010p-739, -0x1.ffffffc020000p-809, 0x1.00000001f0000p+66, 0x1.8000000000000p-38, 0x1.00000001f0000p+66, 0x1.8000000000000p-38}, {0x1.000000e000010p-739, -0x1.ffffffc020000p-809, -0x1.00000001f0000p+66, -0x1.8000000000000p-38, -0x1.00000001f0000p+66, -0x1.8000000000000p-38}, {-0x1.000000e000010p-739, 0x1.ffffffc020000p-809, 0x1.00000001f0000p+66, 0x1.8000000000000p-38, 0x1.00000001f0000p+66, 0x1.8000000000000p-38}, {-0x1.000000e000010p-739, 0x1.ffffffc020000p-809, -0x1.00000001f0000p+66, -0x1.8000000000000p-38, -0x1.00000001f0000p+66, -0x1.8000000000000p-38}, {0x1.000003ff00000p-980, 0x1.8000000000000p-1057, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386}, {0x1.000003ff00000p-980, 0x1.8000000000000p-1057, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386}, {-0x1.000003ff00000p-980, -0x1.8000000000000p-1057, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386}, {-0x1.000003ff00000p-980, -0x1.8000000000000p-1057, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386}, {0x1.0000000000200p+292, -0x1.ffffffffffc08p+236, 0x1.0000000000000p-660, 0x1.ffffffffffffep-714, 0x1.0000000000200p+292, -0x1.ffffffffffc08p+236}, {0x1.0000000000200p+292, -0x1.ffffffffffc08p+236, -0x1.0000000000000p-660, -0x1.ffffffffffffep-714, 0x1.0000000000200p+292, -0x1.ffffffffffc08p+236}, {-0x1.0000000000200p+292, 0x1.ffffffffffc08p+236, 0x1.0000000000000p-660, 0x1.ffffffffffffep-714, -0x1.0000000000200p+292, 0x1.ffffffffffc08p+236}, {-0x1.0000000000200p+292, 0x1.ffffffffffc08p+236, -0x1.0000000000000p-660, -0x1.ffffffffffffep-714, -0x1.0000000000200p+292, 0x1.ffffffffffc08p+236}, {0x1.0000000040000p-475, -0x1.fffff80002000p-541, 0x1.0000000000000p-741, 0x1.ffc01ffff3c00p-804, 0x1.0000000040000p-475, -0x1.fffff80002000p-541}, {0x1.0000000040000p-475, -0x1.fffff80002000p-541, -0x1.0000000000000p-741, -0x1.ffc01ffff3c00p-804, 0x1.0000000040000p-475, -0x1.fffff80002000p-541}, {-0x1.0000000040000p-475, 0x1.fffff80002000p-541, 0x1.0000000000000p-741, 0x1.ffc01ffff3c00p-804, -0x1.0000000040000p-475, 0x1.fffff80002000p-541}, {-0x1.0000000040000p-475, 0x1.fffff80002000p-541, -0x1.0000000000000p-741, -0x1.ffc01ffff3c00p-804, -0x1.0000000040000p-475, 0x1.fffff80002000p-541}, {0x1.0000800000000p+1022, -0x1.0000000000000p+917, 0x1.0000003800001p-290, 0x1.fffffe000003ep-344, 0x1.0000800000000p+1022, -0x1.0000000000000p+917}, {0x1.0000800000000p+1022, -0x1.0000000000000p+917, -0x1.0000003800001p-290, -0x1.fffffe000003ep-344, 0x1.0000800000000p+1022, -0x1.0000000000000p+917}, {-0x1.0000800000000p+1022, 0x1.0000000000000p+917, 0x1.0000003800001p-290, 0x1.fffffe000003ep-344, -0x1.0000800000000p+1022, 0x1.0000000000000p+917}, {-0x1.0000800000000p+1022, 0x1.0000000000000p+917, -0x1.0000003800001p-290, -0x1.fffffe000003ep-344, -0x1.0000800000000p+1022, 0x1.0000000000000p+917}, {0x1.0f00000020000p-425, -0x1.fffe000000100p-479, 0x1.0000000400000p-527, -0x1.ffffffc004000p-594, 0x1.0f00000020000p-425, -0x1.fffe0000000f0p-479}, {0x1.0f00000020000p-425, -0x1.fffe000000100p-479, -0x1.0000000400000p-527, 0x1.ffffffc004000p-594, 0x1.0f00000020000p-425, -0x1.fffe000000110p-479}, {-0x1.0f00000020000p-425, 0x1.fffe000000100p-479, 0x1.0000000400000p-527, -0x1.ffffffc004000p-594, -0x1.0f00000020000p-425, 0x1.fffe000000110p-479}, {-0x1.0f00000020000p-425, 0x1.fffe000000100p-479, -0x1.0000000400000p-527, 0x1.ffffffc004000p-594, -0x1.0f00000020000p-425, 0x1.fffe0000000f0p-479}, {0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652, 0x1.0000000000400p+142, -0x1.ffff800007ffcp+87, 0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652}, {0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652, -0x1.0000000000400p+142, 0x1.ffff800007ffcp+87, 0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652}, {-0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652, 0x1.0000000000400p+142, -0x1.ffff800007ffcp+87, -0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652}, {-0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652, -0x1.0000000000400p+142, 0x1.ffff800007ffcp+87, -0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652}, {0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11, 0x1.0000020000000p-926, -0x1.0000000000000p-1002, 0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11}, {0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11, -0x1.0000020000000p-926, 0x1.0000000000000p-1002, 0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11}, {-0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11, 0x1.0000020000000p-926, -0x1.0000000000000p-1002, -0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11}, {-0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11, -0x1.0000020000000p-926, 0x1.0000000000000p-1002, -0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11}, {0x1.0000000000040p-915, -0x1.8000000800000p-990, 0x1.0000000002000p-454, -0x1.0000000000000p-558, 0x1.0000000002000p-454, -0x1.0000000000000p-558}, {0x1.0000000000040p-915, -0x1.8000000800000p-990, -0x1.0000000002000p-454, 0x1.0000000000000p-558, -0x1.0000000002000p-454, 0x1.0000000000000p-558}, {-0x1.0000000000040p-915, 0x1.8000000800000p-990, 0x1.0000000002000p-454, -0x1.0000000000000p-558, 0x1.0000000002000p-454, -0x1.0000000000000p-558}, {-0x1.0000000000040p-915, 0x1.8000000800000p-990, -0x1.0000000002000p-454, 0x1.0000000000000p-558, -0x1.0000000002000p-454, 0x1.0000000000000p-558}, {0x1.0000000800000p-123, -0x1.ffffc02000000p-201, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488}, {0x1.0000000800000p-123, -0x1.ffffc02000000p-201, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488}, {-0x1.0000000800000p-123, 0x1.ffffc02000000p-201, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488}, {-0x1.0000000800000p-123, 0x1.ffffc02000000p-201, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488}, {0x1.0000400000000p+352, -0x1.0000000000000p+261, 0x1.4000000000000p-216, -0x1.ffffffff00020p-274, 0x1.0000400000000p+352, -0x1.0000000000000p+261}, {0x1.0000400000000p+352, -0x1.0000000000000p+261, -0x1.4000000000000p-216, 0x1.ffffffff00020p-274, 0x1.0000400000000p+352, -0x1.0000000000000p+261}, {-0x1.0000400000000p+352, 0x1.0000000000000p+261, 0x1.4000000000000p-216, -0x1.ffffffff00020p-274, -0x1.0000400000000p+352, 0x1.0000000000000p+261}, {-0x1.0000400000000p+352, 0x1.0000000000000p+261, -0x1.4000000000000p-216, 0x1.ffffffff00020p-274, -0x1.0000400000000p+352, 0x1.0000000000000p+261}, {0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771, 0x1.00001fffc0000p-889, 0x1.f80001f000f80p-949, 0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771}, {0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771, -0x1.00001fffc0000p-889, -0x1.f80001f000f80p-949, 0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771}, {-0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771, 0x1.00001fffc0000p-889, 0x1.f80001f000f80p-949, -0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771}, {-0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771, -0x1.00001fffc0000p-889, -0x1.f80001f000f80p-949, -0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771}, {0x1.03ffffffffffep-517, 0x1.8000000000000p-621, 0x1.0000040000000p-478, -0x1.0000000000000p-583, 0x1.0000040002080p-478, -0x1.0002000000000p-568}, {0x1.03ffffffffffep-517, 0x1.8000000000000p-621, -0x1.0000040000000p-478, 0x1.0000000000000p-583, -0x1.000003fffdf80p-478, -0x1.fffc000000000p-569}, {-0x1.03ffffffffffep-517, -0x1.8000000000000p-621, 0x1.0000040000000p-478, -0x1.0000000000000p-583, 0x1.000003fffdf80p-478, 0x1.fffc000000000p-569}, {-0x1.03ffffffffffep-517, -0x1.8000000000000p-621, -0x1.0000040000000p-478, 0x1.0000000000000p-583, -0x1.0000040002080p-478, 0x1.0002000000000p-568}, {0x1.0007ffffcfffcp-566, 0x1.ff01fffe00000p-640, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66}, {0x1.0007ffffcfffcp-566, 0x1.ff01fffe00000p-640, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66}, {-0x1.0007ffffcfffcp-566, -0x1.ff01fffe00000p-640, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66}, {-0x1.0007ffffcfffcp-566, -0x1.ff01fffe00000p-640, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66}, {0x1.00000000007fep-907, 0x1.ff00003ffff00p-968, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751}, {0x1.00000000007fep-907, 0x1.ff00003ffff00p-968, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751}, {-0x1.00000000007fep-907, -0x1.ff00003ffff00p-968, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751}, {-0x1.00000000007fep-907, -0x1.ff00003ffff00p-968, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751}, {0x1.00000003ff000p-540, 0x1.ffff000000000p-629, 0x1.0000fffff8000p-864, 0x1.f003ffe0003e0p-922, 0x1.00000003ff000p-540, 0x1.ffff000000000p-629}, {0x1.00000003ff000p-540, 0x1.ffff000000000p-629, -0x1.0000fffff8000p-864, -0x1.f003ffe0003e0p-922, 0x1.00000003ff000p-540, 0x1.ffff000000000p-629}, {-0x1.00000003ff000p-540, -0x1.ffff000000000p-629, 0x1.0000fffff8000p-864, 0x1.f003ffe0003e0p-922, -0x1.00000003ff000p-540, -0x1.ffff000000000p-629}, {-0x1.00000003ff000p-540, -0x1.ffff000000000p-629, -0x1.0000fffff8000p-864, -0x1.f003ffe0003e0p-922, -0x1.00000003ff000p-540, -0x1.ffff000000000p-629}, {0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45, 0x1.01fffffe00000p-954, 0x1.ffffffffffc00p-1012, 0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45}, {0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45, -0x1.01fffffe00000p-954, -0x1.ffffffffffc00p-1012, 0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45}, {-0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45, 0x1.01fffffe00000p-954, 0x1.ffffffffffc00p-1012, -0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45}, {-0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45, -0x1.01fffffe00000p-954, -0x1.ffffffffffc00p-1012, -0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45}, {0x1.00003ff808000p-919, -0x1.ffe0000800000p-980, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136}, {0x1.00003ff808000p-919, -0x1.ffe0000800000p-980, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136}, {-0x1.00003ff808000p-919, 0x1.ffe0000800000p-980, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136}, {-0x1.00003ff808000p-919, 0x1.ffe0000800000p-980, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136}, {0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727, 0x1.0000000007f80p-960, 0x1.ff0007f802000p-1024, 0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727}, {0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727, -0x1.0000000007f80p-960, -0x1.ff0007f802000p-1024, 0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727}, {-0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727, 0x1.0000000007f80p-960, 0x1.ff0007f802000p-1024, -0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727}, {-0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727, -0x1.0000000007f80p-960, -0x1.ff0007f802000p-1024, -0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727}, {0x1.0020000000000p+107, -0x1.0000000000000p+30, 0x1.000001ffff802p-529, -0x1.ffffffc000040p-588, 0x1.0020000000000p+107, -0x1.0000000000000p+30}, {0x1.0020000000000p+107, -0x1.0000000000000p+30, -0x1.000001ffff802p-529, 0x1.ffffffc000040p-588, 0x1.0020000000000p+107, -0x1.0000000000000p+30}, {-0x1.0020000000000p+107, 0x1.0000000000000p+30, 0x1.000001ffff802p-529, -0x1.ffffffc000040p-588, -0x1.0020000000000p+107, 0x1.0000000000000p+30}, {-0x1.0020000000000p+107, 0x1.0000000000000p+30, -0x1.000001ffff802p-529, 0x1.ffffffc000040p-588, -0x1.0020000000000p+107, 0x1.0000000000000p+30}, {0x1.0000000000800p+985, -0x1.ffe0000400000p+923, 0x1.0000000000038p+697, 0x1.e100000000000p+623, 0x1.0000000000800p+985, -0x1.ffe0000400000p+923}, {0x1.0000000000800p+985, -0x1.ffe0000400000p+923, -0x1.0000000000038p+697, -0x1.e100000000000p+623, 0x1.0000000000800p+985, -0x1.ffe0000400000p+923}, {-0x1.0000000000800p+985, 0x1.ffe0000400000p+923, 0x1.0000000000038p+697, 0x1.e100000000000p+623, -0x1.0000000000800p+985, 0x1.ffe0000400000p+923}, {-0x1.0000000000800p+985, 0x1.ffe0000400000p+923, -0x1.0000000000038p+697, -0x1.e100000000000p+623, -0x1.0000000000800p+985, 0x1.ffe0000400000p+923}, {0x1.0000000000020p+26, -0x1.8007ffff80c04p-29, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513}, {0x1.0000000000020p+26, -0x1.8007ffff80c04p-29, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513}, {-0x1.0000000000020p+26, 0x1.8007ffff80c04p-29, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513}, {-0x1.0000000000020p+26, 0x1.8007ffff80c04p-29, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513}, {0x1.7fffffff80000p-290, 0x1.f000000000000p-367, 0x1.000007ffffffep-351, 0x1.ffffff8000000p-427, 0x1.7fffffff80000p-290, 0x1.0001f80000000p-351}, {0x1.7fffffff80000p-290, 0x1.f000000000000p-367, -0x1.000007ffffffep-351, -0x1.ffffff8000000p-427, 0x1.7fffffff80000p-290, -0x1.fffc300000000p-352}, {-0x1.7fffffff80000p-290, -0x1.f000000000000p-367, 0x1.000007ffffffep-351, 0x1.ffffff8000000p-427, -0x1.7fffffff80000p-290, 0x1.fffc300000000p-352}, {-0x1.7fffffff80000p-290, -0x1.f000000000000p-367, -0x1.000007ffffffep-351, -0x1.ffffff8000000p-427, -0x1.7fffffff80000p-290, -0x1.0001f80000000p-351}, {0x1.0000000010000p-869, -0x1.0000000000000p-955, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304}, {0x1.0000000010000p-869, -0x1.0000000000000p-955, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304}, {-0x1.0000000010000p-869, 0x1.0000000000000p-955, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304}, {-0x1.0000000010000p-869, 0x1.0000000000000p-955, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304}, {0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297, 0x1.0000000000002p-749, -0x1.0000000000000p-854, 0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297}, {0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297, -0x1.0000000000002p-749, 0x1.0000000000000p-854, 0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297}, {-0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297, 0x1.0000000000002p-749, -0x1.0000000000000p-854, -0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297}, {-0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297, -0x1.0000000000002p-749, 0x1.0000000000000p-854, -0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297}, {0x1.000ffffc00000p+483, 0x1.fffff00000000p+414, 0x1.0000000000040p+210, -0x1.0000000000000p+105, 0x1.000ffffc00000p+483, 0x1.fffff00000000p+414}, {0x1.000ffffc00000p+483, 0x1.fffff00000000p+414, -0x1.0000000000040p+210, 0x1.0000000000000p+105, 0x1.000ffffc00000p+483, 0x1.fffff00000000p+414}, {-0x1.000ffffc00000p+483, -0x1.fffff00000000p+414, 0x1.0000000000040p+210, -0x1.0000000000000p+105, -0x1.000ffffc00000p+483, -0x1.fffff00000000p+414}, {-0x1.000ffffc00000p+483, -0x1.fffff00000000p+414, -0x1.0000000000040p+210, 0x1.0000000000000p+105, -0x1.000ffffc00000p+483, -0x1.fffff00000000p+414}, {0x1.0004000000000p-94, -0x1.0000000000000p-162, 0x1.0000000200000p-175, -0x1.ffbffffff8020p-233, 0x1.0004000000000p-94, -0x1.fff0000000000p-163}, {0x1.0004000000000p-94, -0x1.0000000000000p-162, -0x1.0000000200000p-175, 0x1.ffbffffff8020p-233, 0x1.0004000000000p-94, -0x1.0008000000000p-162}, {-0x1.0004000000000p-94, 0x1.0000000000000p-162, 0x1.0000000200000p-175, -0x1.ffbffffff8020p-233, -0x1.0004000000000p-94, 0x1.0008000000000p-162}, {-0x1.0004000000000p-94, 0x1.0000000000000p-162, -0x1.0000000200000p-175, 0x1.ffbffffff8020p-233, -0x1.0004000000000p-94, 0x1.fff0000000000p-163}, {0x1.0000000000000p-421, 0x1.e0001e7fbff00p-482, 0x1.0000001fffffep-395, 0x0.0000000000000p+0, 0x1.0000005fffffep-395, 0x1.e000000000000p-482}, {0x1.0000000000000p-421, 0x1.e0001e7fbff00p-482, -0x1.0000001fffffep-395, 0x0.0000000000000p+0, -0x1.ffffffbfffffcp-396, 0x1.e000200000000p-482}, {-0x1.0000000000000p-421, -0x1.e0001e7fbff00p-482, 0x1.0000001fffffep-395, 0x0.0000000000000p+0, 0x1.ffffffbfffffcp-396, -0x1.e000200000000p-482}, {-0x1.0000000000000p-421, -0x1.e0001e7fbff00p-482, -0x1.0000001fffffep-395, 0x0.0000000000000p+0, -0x1.0000005fffffep-395, -0x1.e000000000000p-482}, {0x1.0000000000fffp-362, 0x1.fffff3e000000p-435, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813}, {0x1.0000000000fffp-362, 0x1.fffff3e000000p-435, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813}, {-0x1.0000000000fffp-362, -0x1.fffff3e000000p-435, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813}, {-0x1.0000000000fffp-362, -0x1.fffff3e000000p-435, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813}, {0x1.0000080000000p+509, -0x1.0000000000000p+404, 0x1.0000000080000p-689, -0x1.0000000000000p-744, 0x1.0000080000000p+509, -0x1.0000000000000p+404}, {0x1.0000080000000p+509, -0x1.0000000000000p+404, -0x1.0000000080000p-689, 0x1.0000000000000p-744, 0x1.0000080000000p+509, -0x1.0000000000000p+404}, {-0x1.0000080000000p+509, 0x1.0000000000000p+404, 0x1.0000000080000p-689, -0x1.0000000000000p-744, -0x1.0000080000000p+509, 0x1.0000000000000p+404}, {-0x1.0000080000000p+509, 0x1.0000000000000p+404, -0x1.0000000080000p-689, 0x1.0000000000000p-744, -0x1.0000080000000p+509, 0x1.0000000000000p+404}, {0x1.003ffffffffe0p+511, 0x1.ffffe03800000p+435, 0x1.0000000002000p+705, -0x1.0000000000000p+652, 0x1.0000000002000p+705, -0x1.0000000000000p+652}, {0x1.003ffffffffe0p+511, 0x1.ffffe03800000p+435, -0x1.0000000002000p+705, 0x1.0000000000000p+652, -0x1.0000000002000p+705, 0x1.0000000000000p+652}, {-0x1.003ffffffffe0p+511, -0x1.ffffe03800000p+435, 0x1.0000000002000p+705, -0x1.0000000000000p+652, 0x1.0000000002000p+705, -0x1.0000000000000p+652}, {-0x1.003ffffffffe0p+511, -0x1.ffffe03800000p+435, -0x1.0000000002000p+705, 0x1.0000000000000p+652, -0x1.0000000002000p+705, 0x1.0000000000000p+652}, {0x1.0000000000008p-749, -0x1.ff000007ffc00p-809, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786}, {0x1.0000000000008p-749, -0x1.ff000007ffc00p-809, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786}, {-0x1.0000000000008p-749, 0x1.ff000007ffc00p-809, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786}, {-0x1.0000000000008p-749, 0x1.ff000007ffc00p-809, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786}, {0x1.0000000000080p+921, -0x1.0000000000000p+816, 0x1.01ffffff80001p+85, -0x1.ff90000000000p-8, 0x1.0000000000080p+921, -0x1.0000000000000p+816}, {0x1.0000000000080p+921, -0x1.0000000000000p+816, -0x1.01ffffff80001p+85, 0x1.ff90000000000p-8, 0x1.0000000000080p+921, -0x1.0000000000000p+816}, {-0x1.0000000000080p+921, 0x1.0000000000000p+816, 0x1.01ffffff80001p+85, -0x1.ff90000000000p-8, -0x1.0000000000080p+921, 0x1.0000000000000p+816}, {-0x1.0000000000080p+921, 0x1.0000000000000p+816, -0x1.01ffffff80001p+85, 0x1.ff90000000000p-8, -0x1.0000000000080p+921, 0x1.0000000000000p+816}, {0x1.0000000000800p-666, -0x1.fffff80002000p-732, 0x1.0008000000000p-639, -0x1.0000000000000p-718, 0x1.0008002000000p-639, 0x1.ffbffe0000000p-708}, {0x1.0000000000800p-666, -0x1.fffff80002000p-732, -0x1.0008000000000p-639, 0x1.0000000000000p-718, -0x1.0007ffe000000p-639, 0x1.001fff0000000p-707}, {-0x1.0000000000800p-666, 0x1.fffff80002000p-732, 0x1.0008000000000p-639, -0x1.0000000000000p-718, 0x1.0007ffe000000p-639, -0x1.001fff0000000p-707}, {-0x1.0000000000800p-666, 0x1.fffff80002000p-732, -0x1.0008000000000p-639, 0x1.0000000000000p-718, -0x1.0008002000000p-639, -0x1.ffbffe0000000p-708}, {0x1.0000000000002p+14, -0x1.ffffffe200000p-60, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70}, {0x1.0000000000002p+14, -0x1.ffffffe200000p-60, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70}, {-0x1.0000000000002p+14, 0x1.ffffffe200000p-60, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70}, {-0x1.0000000000002p+14, 0x1.ffffffe200000p-60, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70}, {0x1.000003f000000p+120, 0x1.fffffffe00000p+59, 0x1.0000000000ff0p+144, 0x1.c03fff0e00000p+70, 0x1.000001000102fp+144, 0x1.c07fff0e00000p+70}, {0x1.000003f000000p+120, 0x1.fffffffe00000p+59, -0x1.0000000000ff0p+144, -0x1.c03fff0e00000p+70, -0x1.fffffe0001f62p+143, -0x1.bfffff0e00000p+70}, {-0x1.000003f000000p+120, -0x1.fffffffe00000p+59, 0x1.0000000000ff0p+144, 0x1.c03fff0e00000p+70, 0x1.fffffe0001f62p+143, 0x1.bfffff0e00000p+70}, {-0x1.000003f000000p+120, -0x1.fffffffe00000p+59, -0x1.0000000000ff0p+144, -0x1.c03fff0e00000p+70, -0x1.000001000102fp+144, -0x1.c07fff0e00000p+70}, {0x1.0000000018000p+68, 0x1.fffffe0000000p-14, 0x1.0000100000000p+766, -0x1.0000000000000p+661, 0x1.0000100000000p+766, -0x1.0000000000000p+661}, {0x1.0000000018000p+68, 0x1.fffffe0000000p-14, -0x1.0000100000000p+766, 0x1.0000000000000p+661, -0x1.0000100000000p+766, 0x1.0000000000000p+661}, {-0x1.0000000018000p+68, -0x1.fffffe0000000p-14, 0x1.0000100000000p+766, -0x1.0000000000000p+661, 0x1.0000100000000p+766, -0x1.0000000000000p+661}, {-0x1.0000000018000p+68, -0x1.fffffe0000000p-14, -0x1.0000100000000p+766, 0x1.0000000000000p+661, -0x1.0000100000000p+766, 0x1.0000000000000p+661}, {0x1.0000000000001p-191, -0x1.fffffc1000000p-258, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256}, {0x1.0000000000001p-191, -0x1.fffffc1000000p-258, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256}, {-0x1.0000000000001p-191, 0x1.fffffc1000000p-258, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256}, {-0x1.0000000000001p-191, 0x1.fffffc1000000p-258, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256}, {0x1.0000003800000p-790, 0x1.ffe000001fffcp-845, 0x1.0000007fffff0p-815, 0x1.fe1ffffc00000p-877, 0x1.000000b800004p-790, 0x1.ffdfc0021e1fcp-845}, {0x1.0000003800000p-790, 0x1.ffe000001fffcp-845, -0x1.0000007fffff0p-815, -0x1.fe1ffffc00000p-877, 0x1.ffffff6fffff8p-791, 0x1.ffe03ffe21dfcp-845}, {-0x1.0000003800000p-790, -0x1.ffe000001fffcp-845, 0x1.0000007fffff0p-815, 0x1.fe1ffffc00000p-877, -0x1.ffffff6fffff8p-791, -0x1.ffe03ffe21dfcp-845}, {-0x1.0000003800000p-790, -0x1.ffe000001fffcp-845, -0x1.0000007fffff0p-815, -0x1.fe1ffffc00000p-877, -0x1.000000b800004p-790, -0x1.ffdfc0021e1fcp-845}, {0x1.0000001fffc00p-770, 0x1.f00007ffe0000p-834, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932}, {0x1.0000001fffc00p-770, 0x1.f00007ffe0000p-834, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932}, {-0x1.0000001fffc00p-770, -0x1.f00007ffe0000p-834, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932}, {-0x1.0000001fffc00p-770, -0x1.f00007ffe0000p-834, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932}, {0x1.0000000008000p+440, -0x1.c0000007ffe04p+385, 0x1.00000fffffffep-521, 0x1.fc00000000000p-620, 0x1.0000000008000p+440, -0x1.c0000007ffe04p+385}, {0x1.0000000008000p+440, -0x1.c0000007ffe04p+385, -0x1.00000fffffffep-521, -0x1.fc00000000000p-620, 0x1.0000000008000p+440, -0x1.c0000007ffe04p+385}, {-0x1.0000000008000p+440, 0x1.c0000007ffe04p+385, 0x1.00000fffffffep-521, 0x1.fc00000000000p-620, -0x1.0000000008000p+440, 0x1.c0000007ffe04p+385}, {-0x1.0000000008000p+440, 0x1.c0000007ffe04p+385, -0x1.00000fffffffep-521, -0x1.fc00000000000p-620, -0x1.0000000008000p+440, 0x1.c0000007ffe04p+385}, {0x1.0000003e00004p-731, -0x1.fe00040000000p-801, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419}, {0x1.0000003e00004p-731, -0x1.fe00040000000p-801, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419}, {-0x1.0000003e00004p-731, 0x1.fe00040000000p-801, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419}, {-0x1.0000003e00004p-731, 0x1.fe00040000000p-801, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419}, {0x1.03fffffffc000p-192, 0x1.ffffffc000000p-267, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554}, {0x1.03fffffffc000p-192, 0x1.ffffffc000000p-267, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554}, {-0x1.03fffffffc000p-192, -0x1.ffffffc000000p-267, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554}, {-0x1.03fffffffc000p-192, -0x1.ffffffc000000p-267, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554}, {0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230, 0x1.0000000000004p-464, -0x1.fffc000200000p-533, 0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230}, {0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230, -0x1.0000000000004p-464, 0x1.fffc000200000p-533, 0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230}, {-0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230, 0x1.0000000000004p-464, -0x1.fffc000200000p-533, -0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230}, {-0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230, -0x1.0000000000004p-464, 0x1.fffc000200000p-533, -0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230}, {0x1.00003ffffff80p-1007, 0x1.0000000000000p-1068, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {0x1.00003ffffff80p-1007, 0x1.0000000000000p-1068, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {-0x1.00003ffffff80p-1007, -0x1.0000000000000p-1068, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {-0x1.00003ffffff80p-1007, -0x1.0000000000000p-1068, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {0x1.0000010000000p-912, -0x1.0000000000000p-1017, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60}, {0x1.0000010000000p-912, -0x1.0000000000000p-1017, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60}, {-0x1.0000010000000p-912, 0x1.0000000000000p-1017, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60}, {-0x1.0000010000000p-912, 0x1.0000000000000p-1017, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60}, {0x1.0000000000004p+652, -0x1.fff0008000000p+588, 0x1.0000000100000p+402, -0x1.fffffe0004000p+335, 0x1.0000000000004p+652, -0x1.fff0008000000p+588}, {0x1.0000000000004p+652, -0x1.fff0008000000p+588, -0x1.0000000100000p+402, 0x1.fffffe0004000p+335, 0x1.0000000000004p+652, -0x1.fff0008000000p+588}, {-0x1.0000000000004p+652, 0x1.fff0008000000p+588, 0x1.0000000100000p+402, -0x1.fffffe0004000p+335, -0x1.0000000000004p+652, 0x1.fff0008000000p+588}, {-0x1.0000000000004p+652, 0x1.fff0008000000p+588, -0x1.0000000100000p+402, 0x1.fffffe0004000p+335, -0x1.0000000000004p+652, 0x1.fff0008000000p+588}, {0x1.0000000000800p-11, -0x1.0000000000000p-89, 0x1.0000010000000p+68, -0x1.0000000000000p-35, 0x1.0000010000000p+68, 0x1.fffffe0000000p-12}, {0x1.0000000000800p-11, -0x1.0000000000000p-89, -0x1.0000010000000p+68, 0x1.0000000000000p-35, -0x1.0000010000000p+68, 0x1.0000010000000p-11}, {-0x1.0000000000800p-11, 0x1.0000000000000p-89, 0x1.0000010000000p+68, -0x1.0000000000000p-35, 0x1.0000010000000p+68, -0x1.0000010000000p-11}, {-0x1.0000000000800p-11, 0x1.0000000000000p-89, -0x1.0000010000000p+68, 0x1.0000000000000p-35, -0x1.0000010000000p+68, -0x1.fffffe0000000p-12}, {0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842, 0x1.0000007c00000p-1007, 0x0.0000000000000p+0, 0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842}, {0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842, -0x1.0000007c00000p-1007, -0x0.0000000000000p+0, 0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842}, {-0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842, 0x1.0000007c00000p-1007, 0x0.0000000000000p+0, -0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842}, {-0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842, -0x1.0000007c00000p-1007, -0x0.0000000000000p+0, -0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842}, {0x1.fffffffe00000p+397, 0x1.e000001fff800p+333, 0x1.00000001ffffep+347, 0x0.0000000000000p+0, 0x1.fffffffe00004p+397, 0x1.e000801ff7800p+333}, {0x1.fffffffe00000p+397, 0x1.e000001fff800p+333, -0x1.00000001ffffep+347, 0x0.0000000000000p+0, 0x1.fffffffdffffcp+397, 0x1.dfff802007800p+333}, {-0x1.fffffffe00000p+397, -0x1.e000001fff800p+333, 0x1.00000001ffffep+347, 0x0.0000000000000p+0, -0x1.fffffffdffffcp+397, -0x1.dfff802007800p+333}, {-0x1.fffffffe00000p+397, -0x1.e000001fff800p+333, -0x1.00000001ffffep+347, 0x0.0000000000000p+0, -0x1.fffffffe00004p+397, -0x1.e000801ff7800p+333}, {0x1.0000000000008p-231, -0x1.fffff00400000p-303, 0x1.00003ffffe000p-829, 0x1.ffffe00000000p-901, 0x1.0000000000008p-231, -0x1.fffff00400000p-303}, {0x1.0000000000008p-231, -0x1.fffff00400000p-303, -0x1.00003ffffe000p-829, -0x1.ffffe00000000p-901, 0x1.0000000000008p-231, -0x1.fffff00400000p-303}, {-0x1.0000000000008p-231, 0x1.fffff00400000p-303, 0x1.00003ffffe000p-829, 0x1.ffffe00000000p-901, -0x1.0000000000008p-231, 0x1.fffff00400000p-303}, {-0x1.0000000000008p-231, 0x1.fffff00400000p-303, -0x1.00003ffffe000p-829, -0x1.ffffe00000000p-901, -0x1.0000000000008p-231, 0x1.fffff00400000p-303}, {0x1.0000000000000p-479, 0x1.ffffffffffc00p-542, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414}, {0x1.0000000000000p-479, 0x1.ffffffffffc00p-542, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414}, {-0x1.0000000000000p-479, -0x1.ffffffffffc00p-542, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414}, {-0x1.0000000000000p-479, -0x1.ffffffffffc00p-542, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414}, {0x1.0000000000400p-496, -0x1.f800000002000p-557, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116}, {0x1.0000000000400p-496, -0x1.f800000002000p-557, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116}, {-0x1.0000000000400p-496, 0x1.f800000002000p-557, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116}, {-0x1.0000000000400p-496, 0x1.f800000002000p-557, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116}, {0x1.0000000000000p+267, 0x1.fffffffffff00p+211, 0x1.000007c000000p+439, 0x1.fff8000000000p+383, 0x1.000007c000000p+439, 0x1.fff8000000000p+383}, {0x1.0000000000000p+267, 0x1.fffffffffff00p+211, -0x1.000007c000000p+439, -0x1.fff8000000000p+383, -0x1.000007c000000p+439, -0x1.fff8000000000p+383}, {-0x1.0000000000000p+267, -0x1.fffffffffff00p+211, 0x1.000007c000000p+439, 0x1.fff8000000000p+383, 0x1.000007c000000p+439, 0x1.fff8000000000p+383}, {-0x1.0000000000000p+267, -0x1.fffffffffff00p+211, -0x1.000007c000000p+439, -0x1.fff8000000000p+383, -0x1.000007c000000p+439, -0x1.fff8000000000p+383}, {0x1.0000000000400p-383, -0x1.fffc0003fffd0p-440, 0x1.0000000000000p+249, 0x1.fffffff800000p+193, 0x1.0000000000000p+249, 0x1.fffffff800000p+193}, {0x1.0000000000400p-383, -0x1.fffc0003fffd0p-440, -0x1.0000000000000p+249, -0x1.fffffff800000p+193, -0x1.0000000000000p+249, -0x1.fffffff800000p+193}, {-0x1.0000000000400p-383, 0x1.fffc0003fffd0p-440, 0x1.0000000000000p+249, 0x1.fffffff800000p+193, 0x1.0000000000000p+249, 0x1.fffffff800000p+193}, {-0x1.0000000000400p-383, 0x1.fffc0003fffd0p-440, -0x1.0000000000000p+249, -0x1.fffffff800000p+193, -0x1.0000000000000p+249, -0x1.fffffff800000p+193}, {0x1.0000000002000p-673, -0x1.ffff040000000p-744, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862}, {0x1.0000000002000p-673, -0x1.ffff040000000p-744, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862}, {-0x1.0000000002000p-673, 0x1.ffff040000000p-744, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862}, {-0x1.0000000002000p-673, 0x1.ffff040000000p-744, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862}, {0x1.0000008000000p+436, -0x1.ffffff8200000p+379, 0x1.000fff8000000p-8, 0x1.fffffe0000000p-70, 0x1.0000008000000p+436, -0x1.ffffff8200000p+379}, {0x1.0000008000000p+436, -0x1.ffffff8200000p+379, -0x1.000fff8000000p-8, -0x1.fffffe0000000p-70, 0x1.0000008000000p+436, -0x1.ffffff8200000p+379}, {-0x1.0000008000000p+436, 0x1.ffffff8200000p+379, 0x1.000fff8000000p-8, 0x1.fffffe0000000p-70, -0x1.0000008000000p+436, 0x1.ffffff8200000p+379}, {-0x1.0000008000000p+436, 0x1.ffffff8200000p+379, -0x1.000fff8000000p-8, -0x1.fffffe0000000p-70, -0x1.0000008000000p+436, 0x1.ffffff8200000p+379}, {0x1.0000000000000p+138, 0x1.0001f9e000000p+78, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366}, {0x1.0000000000000p+138, 0x1.0001f9e000000p+78, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366}, {-0x1.0000000000000p+138, -0x1.0001f9e000000p+78, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366}, {-0x1.0000000000000p+138, -0x1.0001f9e000000p+78, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366}, {0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888, 0x1.0000010000000p+582, -0x1.ffc007ffffe20p+524, 0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888}, {0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888, -0x1.0000010000000p+582, 0x1.ffc007ffffe20p+524, 0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888}, {-0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888, 0x1.0000010000000p+582, -0x1.ffc007ffffe20p+524, -0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888}, {-0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888, -0x1.0000010000000p+582, 0x1.ffc007ffffe20p+524, -0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888}, {0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694, 0x1.0040000000000p-580, -0x1.c000000400000p-641, 0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694}, {0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694, -0x1.0040000000000p-580, 0x1.c000000400000p-641, 0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694}, {-0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694, 0x1.0040000000000p-580, -0x1.c000000400000p-641, -0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694}, {-0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694, -0x1.0040000000000p-580, 0x1.c000000400000p-641, -0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694}, {0x1.0080000000000p-806, -0x1.0000000000000p-911, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541}, {0x1.0080000000000p-806, -0x1.0000000000000p-911, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541}, {-0x1.0080000000000p-806, 0x1.0000000000000p-911, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541}, {-0x1.0080000000000p-806, 0x1.0000000000000p-911, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541}, {0x1.000000003ff00p-698, 0x0.0000000000000p+0, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362}, {0x1.000000003ff00p-698, 0x0.0000000000000p+0, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362}, {-0x1.000000003ff00p-698, 0x0.0000000000000p+0, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362}, {-0x1.000000003ff00p-698, 0x0.0000000000000p+0, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362}, {0x1.00003fffffe00p-546, 0x1.fffffc0000380p-606, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386}, {0x1.00003fffffe00p-546, 0x1.fffffc0000380p-606, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386}, {-0x1.00003fffffe00p-546, -0x1.fffffc0000380p-606, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386}, {-0x1.00003fffffe00p-546, -0x1.fffffc0000380p-606, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386}, {0x1.0000000080000p-450, -0x1.fffffc0010000p-519, 0x1.3fffff8000000p-829, 0x1.fffff800fe000p-895, 0x1.0000000080000p-450, -0x1.fffffc0010000p-519}, {0x1.0000000080000p-450, -0x1.fffffc0010000p-519, -0x1.3fffff8000000p-829, -0x1.fffff800fe000p-895, 0x1.0000000080000p-450, -0x1.fffffc0010000p-519}, {-0x1.0000000080000p-450, 0x1.fffffc0010000p-519, 0x1.3fffff8000000p-829, 0x1.fffff800fe000p-895, -0x1.0000000080000p-450, 0x1.fffffc0010000p-519}, {-0x1.0000000080000p-450, 0x1.fffffc0010000p-519, -0x1.3fffff8000000p-829, -0x1.fffff800fe000p-895, -0x1.0000000080000p-450, 0x1.fffffc0010000p-519}, {0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794, 0x1.0000000000000p+214, 0x1.fc1fffc0000fep+160, 0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794}, {0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794, -0x1.0000000000000p+214, -0x1.fc1fffc0000fep+160, 0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794}, {-0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794, 0x1.0000000000000p+214, 0x1.fc1fffc0000fep+160, -0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794}, {-0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794, -0x1.0000000000000p+214, -0x1.fc1fffc0000fep+160, -0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794}, {0x1.0000000000000p+702, 0x1.fffffffffffc0p+643, 0x1.0000000000000p-646, 0x1.ffffffffffe00p-708, 0x1.0000000000000p+702, 0x1.fffffffffffc0p+643}, {0x1.0000000000000p+702, 0x1.fffffffffffc0p+643, -0x1.0000000000000p-646, -0x1.ffffffffffe00p-708, 0x1.0000000000000p+702, 0x1.fffffffffffc0p+643}, {-0x1.0000000000000p+702, -0x1.fffffffffffc0p+643, 0x1.0000000000000p-646, 0x1.ffffffffffe00p-708, -0x1.0000000000000p+702, -0x1.fffffffffffc0p+643}, {-0x1.0000000000000p+702, -0x1.fffffffffffc0p+643, -0x1.0000000000000p-646, -0x1.ffffffffffe00p-708, -0x1.0000000000000p+702, -0x1.fffffffffffc0p+643}, {0x1.0000000100000p+167, -0x1.0000000000000p+88, 0x1.0000004000000p+455, -0x1.0000000000000p+375, 0x1.0000004000000p+455, -0x1.0000000000000p+375}, {0x1.0000000100000p+167, -0x1.0000000000000p+88, -0x1.0000004000000p+455, 0x1.0000000000000p+375, -0x1.0000004000000p+455, 0x1.0000000000000p+375}, {-0x1.0000000100000p+167, 0x1.0000000000000p+88, 0x1.0000004000000p+455, -0x1.0000000000000p+375, 0x1.0000004000000p+455, -0x1.0000000000000p+375}, {-0x1.0000000100000p+167, 0x1.0000000000000p+88, -0x1.0000004000000p+455, 0x1.0000000000000p+375, -0x1.0000004000000p+455, 0x1.0000000000000p+375}, {0x1.0000010000000p+394, -0x1.ffffe00001000p+338, 0x1.000ffffff007fp-145, 0x1.ffffc00000000p-226, 0x1.0000010000000p+394, -0x1.ffffe00001000p+338}, {0x1.0000010000000p+394, -0x1.ffffe00001000p+338, -0x1.000ffffff007fp-145, -0x1.ffffc00000000p-226, 0x1.0000010000000p+394, -0x1.ffffe00001000p+338}, {-0x1.0000010000000p+394, 0x1.ffffe00001000p+338, 0x1.000ffffff007fp-145, 0x1.ffffc00000000p-226, -0x1.0000010000000p+394, 0x1.ffffe00001000p+338}, {-0x1.0000010000000p+394, 0x1.ffffe00001000p+338, -0x1.000ffffff007fp-145, -0x1.ffffc00000000p-226, -0x1.0000010000000p+394, 0x1.ffffe00001000p+338}, {0x1.1000fffffc000p+16, 0x1.fffffc003f000p-40, 0x1.0000000001000p+243, -0x1.0000000000000p+138, 0x1.0000000001000p+243, -0x1.0000000000000p+138}, {0x1.1000fffffc000p+16, 0x1.fffffc003f000p-40, -0x1.0000000001000p+243, 0x1.0000000000000p+138, -0x1.0000000001000p+243, 0x1.0000000000000p+138}, {-0x1.1000fffffc000p+16, -0x1.fffffc003f000p-40, 0x1.0000000001000p+243, -0x1.0000000000000p+138, 0x1.0000000001000p+243, -0x1.0000000000000p+138}, {-0x1.1000fffffc000p+16, -0x1.fffffc003f000p-40, -0x1.0000000001000p+243, 0x1.0000000000000p+138, -0x1.0000000001000p+243, 0x1.0000000000000p+138}, {0x1.00000fff80000p+494, 0x1.fffe000000000p+409, 0x1.0000001f00000p-623, 0x1.fffffff000000p-700, 0x1.00000fff80000p+494, 0x1.fffe000000000p+409}, {0x1.00000fff80000p+494, 0x1.fffe000000000p+409, -0x1.0000001f00000p-623, -0x1.fffffff000000p-700, 0x1.00000fff80000p+494, 0x1.fffe000000000p+409}, {-0x1.00000fff80000p+494, -0x1.fffe000000000p+409, 0x1.0000001f00000p-623, 0x1.fffffff000000p-700, -0x1.00000fff80000p+494, -0x1.fffe000000000p+409}, {-0x1.00000fff80000p+494, -0x1.fffe000000000p+409, -0x1.0000001f00000p-623, -0x1.fffffff000000p-700, -0x1.00000fff80000p+494, -0x1.fffe000000000p+409}, {0x1.3fdfffff02000p-533, -0x1.0000000000000p-611, 0x1.0000000000000p-602, 0x1.ffffffffffe00p-663, 0x1.3fdfffff02000p-533, 0x1.ff00000000000p-603}, {0x1.3fdfffff02000p-533, -0x1.0000000000000p-611, -0x1.0000000000000p-602, -0x1.ffffffffffe00p-663, 0x1.3fdfffff02000p-533, -0x1.0080000000000p-602}, {-0x1.3fdfffff02000p-533, 0x1.0000000000000p-611, 0x1.0000000000000p-602, 0x1.ffffffffffe00p-663, -0x1.3fdfffff02000p-533, 0x1.0080000000000p-602}, {-0x1.3fdfffff02000p-533, 0x1.0000000000000p-611, -0x1.0000000000000p-602, -0x1.ffffffffffe00p-663, -0x1.3fdfffff02000p-533, -0x1.ff00000000000p-603}, {0x1.0000000000008p-274, -0x1.e0ffffd002000p-340, 0x1.0000000000400p-229, 0x1.ffffffff03ffep-283, 0x1.0000000000480p-229, 0x1.ffffffff04ffep-283}, {0x1.0000000000008p-274, -0x1.e0ffffd002000p-340, -0x1.0000000000400p-229, -0x1.ffffffff03ffep-283, -0x1.0000000000380p-229, -0x1.ffffffff02ffep-283}, {-0x1.0000000000008p-274, 0x1.e0ffffd002000p-340, 0x1.0000000000400p-229, 0x1.ffffffff03ffep-283, 0x1.0000000000380p-229, 0x1.ffffffff02ffep-283}, {-0x1.0000000000008p-274, 0x1.e0ffffd002000p-340, -0x1.0000000000400p-229, -0x1.ffffffff03ffep-283, -0x1.0000000000480p-229, -0x1.ffffffff04ffep-283}, {0x1.000000fffe020p-113, -0x1.f800100000000p-186, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84}, {0x1.000000fffe020p-113, -0x1.f800100000000p-186, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84}, {-0x1.000000fffe020p-113, 0x1.f800100000000p-186, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84}, {-0x1.000000fffe020p-113, 0x1.f800100000000p-186, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84}, {0x1.4000000000000p+455, -0x1.0000000000000p+350, 0x1.0000000000010p-968, 0x1.e000000000000p-1036, 0x1.4000000000000p+455, -0x1.0000000000000p+350}, {0x1.4000000000000p+455, -0x1.0000000000000p+350, -0x1.0000000000010p-968, -0x1.e000000000000p-1036, 0x1.4000000000000p+455, -0x1.0000000000000p+350}, {-0x1.4000000000000p+455, 0x1.0000000000000p+350, 0x1.0000000000010p-968, 0x1.e000000000000p-1036, -0x1.4000000000000p+455, 0x1.0000000000000p+350}, {-0x1.4000000000000p+455, 0x1.0000000000000p+350, -0x1.0000000000010p-968, -0x1.e000000000000p-1036, -0x1.4000000000000p+455, 0x1.0000000000000p+350}, {0x1.2000000000000p+333, -0x1.fffffff01ff20p+276, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644}, {0x1.2000000000000p+333, -0x1.fffffff01ff20p+276, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644}, {-0x1.2000000000000p+333, 0x1.fffffff01ff20p+276, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644}, {-0x1.2000000000000p+333, 0x1.fffffff01ff20p+276, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644}, {0x1.2000000000000p+275, -0x1.fc08000000000p+183, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681}, {0x1.2000000000000p+275, -0x1.fc08000000000p+183, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681}, {-0x1.2000000000000p+275, 0x1.fc08000000000p+183, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681}, {-0x1.2000000000000p+275, 0x1.fc08000000000p+183, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681}, {0x1.0000000000200p+680, 0x0.0000000000000p+0, 0x1.00001ffff0000p-146, 0x1.ffff80001f000p-203, 0x1.0000000000200p+680, 0x0.0000000000000p+0}, {0x1.0000000000200p+680, 0x0.0000000000000p+0, -0x1.00001ffff0000p-146, -0x1.ffff80001f000p-203, 0x1.0000000000200p+680, 0x0.0000000000000p+0}, {-0x1.0000000000200p+680, 0x0.0000000000000p+0, 0x1.00001ffff0000p-146, 0x1.ffff80001f000p-203, -0x1.0000000000200p+680, 0x0.0000000000000p+0}, {-0x1.0000000000200p+680, 0x0.0000000000000p+0, -0x1.00001ffff0000p-146, -0x1.ffff80001f000p-203, -0x1.0000000000200p+680, 0x0.0000000000000p+0}, {0x1.0000100000000p-400, -0x1.0000000000000p-505, 0x1.0038000800000p-754, -0x1.fffffe0000080p-814, 0x1.0000100000000p-400, -0x1.0000000000000p-505}, {0x1.0000100000000p-400, -0x1.0000000000000p-505, -0x1.0038000800000p-754, 0x1.fffffe0000080p-814, 0x1.0000100000000p-400, -0x1.0000000000000p-505}, {-0x1.0000100000000p-400, 0x1.0000000000000p-505, 0x1.0038000800000p-754, -0x1.fffffe0000080p-814, -0x1.0000100000000p-400, 0x1.0000000000000p-505}, {-0x1.0000100000000p-400, 0x1.0000000000000p-505, -0x1.0038000800000p-754, 0x1.fffffe0000080p-814, -0x1.0000100000000p-400, 0x1.0000000000000p-505}, {0x1.0000000000004p+838, -0x1.ffffe00400000p+765, 0x1.0000000000000p-355, 0x1.ffffffffffff8p-411, 0x1.0000000000004p+838, -0x1.ffffe00400000p+765}, {0x1.0000000000004p+838, -0x1.ffffe00400000p+765, -0x1.0000000000000p-355, -0x1.ffffffffffff8p-411, 0x1.0000000000004p+838, -0x1.ffffe00400000p+765}, {-0x1.0000000000004p+838, 0x1.ffffe00400000p+765, 0x1.0000000000000p-355, 0x1.ffffffffffff8p-411, -0x1.0000000000004p+838, 0x1.ffffe00400000p+765}, {-0x1.0000000000004p+838, 0x1.ffffe00400000p+765, -0x1.0000000000000p-355, -0x1.ffffffffffff8p-411, -0x1.0000000000004p+838, 0x1.ffffe00400000p+765}, {0x1.0000000000100p+877, -0x1.ffffe7e400000p+807, 0x1.1ffe000008000p+922, -0x1.fffc000004000p+855, 0x1.1ffe000008080p+922, -0x1.fffbfc0004000p+855}, {0x1.0000000000100p+877, -0x1.ffffe7e400000p+807, -0x1.1ffe000008000p+922, 0x1.fffc000004000p+855, -0x1.1ffe000007f80p+922, 0x1.fffc040004000p+855}, {-0x1.0000000000100p+877, 0x1.ffffe7e400000p+807, 0x1.1ffe000008000p+922, -0x1.fffc000004000p+855, 0x1.1ffe000007f80p+922, -0x1.fffc040004000p+855}, {-0x1.0000000000100p+877, 0x1.ffffe7e400000p+807, -0x1.1ffe000008000p+922, 0x1.fffc000004000p+855, -0x1.1ffe000008080p+922, 0x1.fffbfc0004000p+855}, {0x1.0000000000004p-490, -0x1.0000000000000p-595, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413}, {0x1.0000000000004p-490, -0x1.0000000000000p-595, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413}, {-0x1.0000000000004p-490, 0x1.0000000000000p-595, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413}, {-0x1.0000000000004p-490, 0x1.0000000000000p-595, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413}, {0x1.0000000000000p-458, 0x1.fffffff000000p-519, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712}, {0x1.0000000000000p-458, 0x1.fffffff000000p-519, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712}, {-0x1.0000000000000p-458, -0x1.fffffff000000p-519, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712}, {-0x1.0000000000000p-458, -0x1.fffffff000000p-519, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712}, {0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803, 0x1.0080000000000p-983, -0x0.0000000000000p+0, 0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803}, {0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803, -0x1.0080000000000p-983, 0x0.0000000000000p+0, 0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803}, {-0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803, 0x1.0080000000000p-983, -0x0.0000000000000p+0, -0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803}, {-0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803, -0x1.0080000000000p-983, 0x0.0000000000000p+0, -0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803}, {0x1.0000000000080p-788, 0x0.0000000000000p+0, 0x1.0000080000000p+973, -0x1.0000000000000p+888, 0x1.0000080000000p+973, -0x1.0000000000000p+888}, {0x1.0000000000080p-788, 0x0.0000000000000p+0, -0x1.0000080000000p+973, 0x1.0000000000000p+888, -0x1.0000080000000p+973, 0x1.0000000000000p+888}, {-0x1.0000000000080p-788, 0x0.0000000000000p+0, 0x1.0000080000000p+973, -0x1.0000000000000p+888, 0x1.0000080000000p+973, -0x1.0000000000000p+888}, {-0x1.0000000000080p-788, 0x0.0000000000000p+0, -0x1.0000080000000p+973, 0x1.0000000000000p+888, -0x1.0000080000000p+973, 0x1.0000000000000p+888}, {0x1.0400000000000p-287, -0x1.0000000000000p-392, 0x1.0000000000400p+736, -0x1.fffff00008000p+680, 0x1.0000000000400p+736, -0x1.fffff00008000p+680}, {0x1.0400000000000p-287, -0x1.0000000000000p-392, -0x1.0000000000400p+736, 0x1.fffff00008000p+680, -0x1.0000000000400p+736, 0x1.fffff00008000p+680}, {-0x1.0400000000000p-287, 0x1.0000000000000p-392, 0x1.0000000000400p+736, -0x1.fffff00008000p+680, 0x1.0000000000400p+736, -0x1.fffff00008000p+680}, {-0x1.0400000000000p-287, 0x1.0000000000000p-392, -0x1.0000000000400p+736, 0x1.fffff00008000p+680, -0x1.0000000000400p+736, 0x1.fffff00008000p+680}, {0x1.0000000000001p+232, -0x1.fc0000c004000p+167, 0x1.0000000000200p+192, -0x1.ffe0000200000p+124, 0x1.0000000001001p+232, -0x1.fbffc0c004000p+167}, {0x1.0000000000001p+232, -0x1.fc0000c004000p+167, -0x1.0000000000200p+192, 0x1.ffe0000200000p+124, 0x1.fffffffffe002p+231, -0x1.fc0040c004000p+167}, {-0x1.0000000000001p+232, 0x1.fc0000c004000p+167, 0x1.0000000000200p+192, -0x1.ffe0000200000p+124, -0x1.fffffffffe002p+231, 0x1.fc0040c004000p+167}, {-0x1.0000000000001p+232, 0x1.fc0000c004000p+167, -0x1.0000000000200p+192, 0x1.ffe0000200000p+124, -0x1.0000000001001p+232, 0x1.fbffc0c004000p+167}, {0x1.00000c0000004p+583, -0x1.ff80000800000p+515, 0x1.18003ffff8000p-786, 0x1.ffffff8000000p-852, 0x1.00000c0000004p+583, -0x1.ff80000800000p+515}, {0x1.00000c0000004p+583, -0x1.ff80000800000p+515, -0x1.18003ffff8000p-786, -0x1.ffffff8000000p-852, 0x1.00000c0000004p+583, -0x1.ff80000800000p+515}, {-0x1.00000c0000004p+583, 0x1.ff80000800000p+515, 0x1.18003ffff8000p-786, 0x1.ffffff8000000p-852, -0x1.00000c0000004p+583, 0x1.ff80000800000p+515}, {-0x1.00000c0000004p+583, 0x1.ff80000800000p+515, -0x1.18003ffff8000p-786, -0x1.ffffff8000000p-852, -0x1.00000c0000004p+583, 0x1.ff80000800000p+515}, {0x1.1ffff80000040p+488, -0x1.0000000000000p+398, 0x1.000000000fe00p-510, 0x1.ffff7e0003ff8p-566, 0x1.1ffff80000040p+488, -0x1.0000000000000p+398}, {0x1.1ffff80000040p+488, -0x1.0000000000000p+398, -0x1.000000000fe00p-510, -0x1.ffff7e0003ff8p-566, 0x1.1ffff80000040p+488, -0x1.0000000000000p+398}, {-0x1.1ffff80000040p+488, 0x1.0000000000000p+398, 0x1.000000000fe00p-510, 0x1.ffff7e0003ff8p-566, -0x1.1ffff80000040p+488, 0x1.0000000000000p+398}, {-0x1.1ffff80000040p+488, 0x1.0000000000000p+398, -0x1.000000000fe00p-510, -0x1.ffff7e0003ff8p-566, -0x1.1ffff80000040p+488, 0x1.0000000000000p+398}, {0x1.3fc0000040000p+871, -0x1.fffffff802000p+815, 0x1.fffffffffff00p-663, 0x0.0000000000000p+0, 0x1.3fc0000040000p+871, -0x1.fffffff802000p+815}, {0x1.3fc0000040000p+871, -0x1.fffffff802000p+815, -0x1.fffffffffff00p-663, 0x0.0000000000000p+0, 0x1.3fc0000040000p+871, -0x1.fffffff802000p+815}, {-0x1.3fc0000040000p+871, 0x1.fffffff802000p+815, 0x1.fffffffffff00p-663, 0x0.0000000000000p+0, -0x1.3fc0000040000p+871, 0x1.fffffff802000p+815}, {-0x1.3fc0000040000p+871, 0x1.fffffff802000p+815, -0x1.fffffffffff00p-663, 0x0.0000000000000p+0, -0x1.3fc0000040000p+871, 0x1.fffffff802000p+815}, {0x1.00000001fffffp-628, 0x1.00001f8000000p-699, 0x1.0000000000200p-312, -0x1.0000000000000p-417, 0x1.0000000000200p-312, -0x1.0000000000000p-417}, {0x1.00000001fffffp-628, 0x1.00001f8000000p-699, -0x1.0000000000200p-312, 0x1.0000000000000p-417, -0x1.0000000000200p-312, 0x1.0000000000000p-417}, {-0x1.00000001fffffp-628, -0x1.00001f8000000p-699, 0x1.0000000000200p-312, -0x1.0000000000000p-417, 0x1.0000000000200p-312, -0x1.0000000000000p-417}, {-0x1.00000001fffffp-628, -0x1.00001f8000000p-699, -0x1.0000000000200p-312, 0x1.0000000000000p-417, -0x1.0000000000200p-312, 0x1.0000000000000p-417}, {0x1.0000000010000p+23, -0x1.0000000000000p-54, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268}, {0x1.0000000010000p+23, -0x1.0000000000000p-54, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268}, {-0x1.0000000010000p+23, 0x1.0000000000000p-54, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268}, {-0x1.0000000010000p+23, 0x1.0000000000000p-54, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268}, {0x1.0000000000002p-4, -0x1.0000000000000p-91, 0x1.0000000000200p+643, -0x1.0000000000000p+558, 0x1.0000000000200p+643, -0x1.0000000000000p+558}, {0x1.0000000000002p-4, -0x1.0000000000000p-91, -0x1.0000000000200p+643, 0x1.0000000000000p+558, -0x1.0000000000200p+643, 0x1.0000000000000p+558}, {-0x1.0000000000002p-4, 0x1.0000000000000p-91, 0x1.0000000000200p+643, -0x1.0000000000000p+558, 0x1.0000000000200p+643, -0x1.0000000000000p+558}, {-0x1.0000000000002p-4, 0x1.0000000000000p-91, -0x1.0000000000200p+643, 0x1.0000000000000p+558, -0x1.0000000000200p+643, 0x1.0000000000000p+558}, {0x1.0000000000002p-252, -0x1.ffff800008000p-319, 0x1.000000003fffep-236, 0x1.f81fc007c0000p-307, 0x1.000100003fffep-236, 0x1.1f7ffc00fc000p-303}, {0x1.0000000000002p-252, -0x1.ffff800008000p-319, -0x1.000000003fffep-236, -0x1.f81fc007c0000p-307, -0x1.fffe00007fffcp-237, 0x1.c0f8080008000p-304}, {-0x1.0000000000002p-252, 0x1.ffff800008000p-319, 0x1.000000003fffep-236, 0x1.f81fc007c0000p-307, 0x1.fffe00007fffcp-237, -0x1.c0f8080008000p-304}, {-0x1.0000000000002p-252, 0x1.ffff800008000p-319, -0x1.000000003fffep-236, -0x1.f81fc007c0000p-307, -0x1.000100003fffep-236, -0x1.1f7ffc00fc000p-303}, {0x1.7ffffffff0000p-1014, 0x0.0000000000000p+0, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957}, {0x1.7ffffffff0000p-1014, 0x0.0000000000000p+0, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957}, {-0x1.7ffffffff0000p-1014, -0x0.0000000000000p+0, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957}, {-0x1.7ffffffff0000p-1014, -0x0.0000000000000p+0, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957}, {0x1.00007fff00080p+981, -0x1.ffffff0001000p+916, 0x1.00000000007c0p-918, 0x1.ffffff8000000p-985, 0x1.00007fff00080p+981, -0x1.ffffff0001000p+916}, {0x1.00007fff00080p+981, -0x1.ffffff0001000p+916, -0x1.00000000007c0p-918, -0x1.ffffff8000000p-985, 0x1.00007fff00080p+981, -0x1.ffffff0001000p+916}, {-0x1.00007fff00080p+981, 0x1.ffffff0001000p+916, 0x1.00000000007c0p-918, 0x1.ffffff8000000p-985, -0x1.00007fff00080p+981, 0x1.ffffff0001000p+916}, {-0x1.00007fff00080p+981, 0x1.ffffff0001000p+916, -0x1.00000000007c0p-918, -0x1.ffffff8000000p-985, -0x1.00007fff00080p+981, 0x1.ffffff0001000p+916}, {0x1.1fff81ff00000p-768, 0x1.e007ffff00000p-825, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292}, {0x1.1fff81ff00000p-768, 0x1.e007ffff00000p-825, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292}, {-0x1.1fff81ff00000p-768, -0x1.e007ffff00000p-825, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292}, {-0x1.1fff81ff00000p-768, -0x1.e007ffff00000p-825, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292}, {0x1.0000000000000p-141, 0x1.fffc03fe00700p-202, 0x1.0000000000001p-845, -0x1.fff8060000f34p-900, 0x1.0000000000000p-141, 0x1.fffc03fe00700p-202}, {0x1.0000000000000p-141, 0x1.fffc03fe00700p-202, -0x1.0000000000001p-845, 0x1.fff8060000f34p-900, 0x1.0000000000000p-141, 0x1.fffc03fe00700p-202}, {-0x1.0000000000000p-141, -0x1.fffc03fe00700p-202, 0x1.0000000000001p-845, -0x1.fff8060000f34p-900, -0x1.0000000000000p-141, -0x1.fffc03fe00700p-202}, {-0x1.0000000000000p-141, -0x1.fffc03fe00700p-202, -0x1.0000000000001p-845, 0x1.fff8060000f34p-900, -0x1.0000000000000p-141, -0x1.fffc03fe00700p-202}, {0x1.001ffffc00080p+872, -0x1.fe00000200000p+811, 0x1.0000000001000p-359, -0x1.fe3ffffff0080p-419, 0x1.001ffffc00080p+872, -0x1.fe00000200000p+811}, {0x1.001ffffc00080p+872, -0x1.fe00000200000p+811, -0x1.0000000001000p-359, 0x1.fe3ffffff0080p-419, 0x1.001ffffc00080p+872, -0x1.fe00000200000p+811}, {-0x1.001ffffc00080p+872, 0x1.fe00000200000p+811, 0x1.0000000001000p-359, -0x1.fe3ffffff0080p-419, -0x1.001ffffc00080p+872, 0x1.fe00000200000p+811}, {-0x1.001ffffc00080p+872, 0x1.fe00000200000p+811, -0x1.0000000001000p-359, 0x1.fe3ffffff0080p-419, -0x1.001ffffc00080p+872, 0x1.fe00000200000p+811}, {0x1.00001fffff800p-894, 0x1.ffffff801ffc0p-953, 0x1.0000000002000p-720, -0x1.0000000000000p-825, 0x1.0000000002000p-720, -0x1.0000000000000p-825}, {0x1.00001fffff800p-894, 0x1.ffffff801ffc0p-953, -0x1.0000000002000p-720, 0x1.0000000000000p-825, -0x1.0000000002000p-720, 0x1.0000000000000p-825}, {-0x1.00001fffff800p-894, -0x1.ffffff801ffc0p-953, 0x1.0000000002000p-720, -0x1.0000000000000p-825, 0x1.0000000002000p-720, -0x1.0000000000000p-825}, {-0x1.00001fffff800p-894, -0x1.ffffff801ffc0p-953, -0x1.0000000002000p-720, 0x1.0000000000000p-825, -0x1.0000000002000p-720, 0x1.0000000000000p-825}, {0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86, 0x1.0000000000000p-240, 0x1.ffffffffe0000p-296, 0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86}, {0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86, -0x1.0000000000000p-240, -0x1.ffffffffe0000p-296, 0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86}, {-0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86, 0x1.0000000000000p-240, 0x1.ffffffffe0000p-296, -0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86}, {-0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86, -0x1.0000000000000p-240, -0x1.ffffffffe0000p-296, -0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86}, {0x1.0000000000000p-874, 0x1.fffe7ff3dff00p-935, 0x1.000007f830000p-977, 0x1.fff0001000000p-1038, 0x1.0000000000000p-874, 0x1.fffe7ff3e0300p-935}, {0x1.0000000000000p-874, 0x1.fffe7ff3dff00p-935, -0x1.000007f830000p-977, -0x1.fff0001000000p-1038, 0x1.0000000000000p-874, 0x1.fffe7ff3dfb00p-935}, {-0x1.0000000000000p-874, -0x1.fffe7ff3dff00p-935, 0x1.000007f830000p-977, 0x1.fff0001000000p-1038, -0x1.0000000000000p-874, -0x1.fffe7ff3dfb00p-935}, {-0x1.0000000000000p-874, -0x1.fffe7ff3dff00p-935, -0x1.000007f830000p-977, -0x1.fff0001000000p-1038, -0x1.0000000000000p-874, -0x1.fffe7ff3e0300p-935}, {0x1.00000ffffe000p-269, 0x1.fffffffffc000p-336, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171}, {0x1.00000ffffe000p-269, 0x1.fffffffffc000p-336, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171}, {-0x1.00000ffffe000p-269, -0x1.fffffffffc000p-336, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171}, {-0x1.00000ffffe000p-269, -0x1.fffffffffc000p-336, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171}, {0x1.0000000000060p+403, 0x1.fffe3fff00000p+340, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726}, {0x1.0000000000060p+403, 0x1.fffe3fff00000p+340, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726}, {-0x1.0000000000060p+403, -0x1.fffe3fff00000p+340, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726}, {-0x1.0000000000060p+403, -0x1.fffe3fff00000p+340, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726}, {0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347, 0x1.07ff000008000p-591, -0x1.e000020000000p-652, 0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347}, {0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347, -0x1.07ff000008000p-591, 0x1.e000020000000p-652, 0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347}, {-0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347, 0x1.07ff000008000p-591, -0x1.e000020000000p-652, -0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347}, {-0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347, -0x1.07ff000008000p-591, 0x1.e000020000000p-652, -0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347}, // Some test cases where a and b are guaranteed to overlap: {0x1.0000000000002p-39, -0x1.ffc0ffff90000p-103, 0x1.0003ffffffffcp-35, 0x1.ffffc00000000p-122, 0x1.1003ffffffffcp-35, 0x1.ffe003f400068p-91}, {0x1.0000000000002p-39, -0x1.ffc0ffff90000p-103, -0x1.0003ffffffffcp-35, -0x1.ffffc00000000p-122, -0x1.e007ffffffff8p-36, 0x1.ffe003ec00078p-91}, {-0x1.0000000000002p-39, 0x1.ffc0ffff90000p-103, 0x1.0003ffffffffcp-35, 0x1.ffffc00000000p-122, 0x1.e007ffffffff8p-36, -0x1.ffe003ec00078p-91}, {-0x1.0000000000002p-39, 0x1.ffc0ffff90000p-103, -0x1.0003ffffffffcp-35, -0x1.ffffc00000000p-122, -0x1.1003ffffffffcp-35, -0x1.ffe003f400068p-91}, {0x1.0000100000000p+23, -0x1.0000000000000p-39, 0x1.0000000004000p-41, -0x1.ffffe00fc0200p-97, 0x1.0000100000000p+23, -0x1.7ffffffffe000p-40}, {0x1.0000100000000p+23, -0x1.0000000000000p-39, -0x1.0000000004000p-41, 0x1.ffffe00fc0200p-97, 0x1.0000100000000p+23, -0x1.4000000001000p-39}, {-0x1.0000100000000p+23, 0x1.0000000000000p-39, 0x1.0000000004000p-41, -0x1.ffffe00fc0200p-97, -0x1.0000100000000p+23, 0x1.4000000001000p-39}, {-0x1.0000100000000p+23, 0x1.0000000000000p-39, -0x1.0000000004000p-41, 0x1.ffffe00fc0200p-97, -0x1.0000100000000p+23, 0x1.7ffffffffe000p-40}, {0x1.0000000800000p-42, -0x1.0000000000000p-114, 0x1.000003fffc002p-41, -0x1.0000000000000p-146, 0x1.80000403fc002p-41, -0x1.0000000100000p-114}, {0x1.0000000800000p-42, -0x1.0000000000000p-114, -0x1.000003fffc002p-41, 0x1.0000000000000p-146, -0x1.000007f7f8004p-42, -0x1.fffffffe00000p-115}, {-0x1.0000000800000p-42, 0x1.0000000000000p-114, 0x1.000003fffc002p-41, -0x1.0000000000000p-146, 0x1.000007f7f8004p-42, 0x1.fffffffe00000p-115}, {-0x1.0000000800000p-42, 0x1.0000000000000p-114, -0x1.000003fffc002p-41, 0x1.0000000000000p-146, -0x1.80000403fc002p-41, 0x1.0000000100000p-114}, {0x1.0000000000000p+46, 0x1.ffc001ffffe00p-9, 0x1.000003fff8000p-19, 0x1.fffc000fc0000p-90, 0x1.0000000000000p+46, 0x1.000001007fef0p-8}, {0x1.0000000000000p+46, 0x1.ffc001ffffe00p-9, -0x1.000003fff8000p-19, -0x1.fffc000fc0000p-90, 0x1.0000000000000p+46, 0x1.ff8001feffe20p-9}, {-0x1.0000000000000p+46, -0x1.ffc001ffffe00p-9, 0x1.000003fff8000p-19, 0x1.fffc000fc0000p-90, -0x1.0000000000000p+46, -0x1.ff8001feffe20p-9}, {-0x1.0000000000000p+46, -0x1.ffc001ffffe00p-9, -0x1.000003fff8000p-19, -0x1.fffc000fc0000p-90, -0x1.0000000000000p+46, -0x1.000001007fef0p-8}, {0x1.0000000000003p+33, 0x1.fc00001fff800p-31, 0x1.0000000000020p+40, -0x1.fc01ffe002000p-24, 0x1.0200000000020p+40, 0x1.781fd80080f80p-18}, {0x1.0000000000003p+33, 0x1.fc00001fff800p-31, -0x1.0000000000020p+40, 0x1.fc01ffe002000p-24, -0x1.fc00000000040p+39, 0x1.87ffe7ff81080p-18}, {-0x1.0000000000003p+33, -0x1.fc00001fff800p-31, 0x1.0000000000020p+40, -0x1.fc01ffe002000p-24, 0x1.fc00000000040p+39, -0x1.87ffe7ff81080p-18}, {-0x1.0000000000003p+33, -0x1.fc00001fff800p-31, -0x1.0000000000020p+40, 0x1.fc01ffe002000p-24, -0x1.0200000000020p+40, -0x1.781fd80080f80p-18}, {0x1.0000000000000p-42, 0x1.fffff00001ffep-96, 0x1.0000000000000p-9, 0x1.ff00000ffff80p-69, 0x1.0000000080000p-9, 0x1.ff00004ffff80p-69}, {0x1.0000000000000p-42, 0x1.fffff00001ffep-96, -0x1.0000000000000p-9, -0x1.ff00000ffff80p-69, -0x1.ffffffff00000p-10, -0x1.feffffcffff80p-69}, {-0x1.0000000000000p-42, -0x1.fffff00001ffep-96, 0x1.0000000000000p-9, 0x1.ff00000ffff80p-69, 0x1.ffffffff00000p-10, 0x1.feffffcffff80p-69}, {-0x1.0000000000000p-42, -0x1.fffff00001ffep-96, -0x1.0000000000000p-9, -0x1.ff00000ffff80p-69, -0x1.0000000080000p-9, -0x1.ff00004ffff80p-69}, {0x1.0000000000000p-46, 0x1.ffffffffffc00p-109, 0x1.0000200000000p+11, -0x1.ffc0000080000p-61, 0x1.0000200000000p+11, 0x1.fff800fffffe0p-47}, {0x1.0000000000000p-46, 0x1.ffffffffffc00p-109, -0x1.0000200000000p+11, 0x1.ffc0000080000p-61, -0x1.0000200000000p+11, 0x1.0003ff8000010p-46}, {-0x1.0000000000000p-46, -0x1.ffffffffffc00p-109, 0x1.0000200000000p+11, -0x1.ffc0000080000p-61, 0x1.0000200000000p+11, -0x1.0003ff8000010p-46}, {-0x1.0000000000000p-46, -0x1.ffffffffffc00p-109, -0x1.0000200000000p+11, 0x1.ffc0000080000p-61, -0x1.0000200000000p+11, -0x1.fff800fffffe0p-47}, {0x1.0000000000800p-4, -0x1.fffc000000010p-61, 0x1.0000000000008p-2, -0x1.ffe03fffff010p-59, 0x1.4000000000208p-2, -0x1.3fef9fffff808p-58}, {0x1.0000000000800p-4, -0x1.fffc000000010p-61, -0x1.0000000000008p-2, 0x1.ffe03fffff010p-59, -0x1.7fffffffffc10p-3, 0x1.7fe13fffff010p-59}, {-0x1.0000000000800p-4, 0x1.fffc000000010p-61, 0x1.0000000000008p-2, -0x1.ffe03fffff010p-59, 0x1.7fffffffffc10p-3, -0x1.7fe13fffff010p-59}, {-0x1.0000000000800p-4, 0x1.fffc000000010p-61, -0x1.0000000000008p-2, 0x1.ffe03fffff010p-59, -0x1.4000000000208p-2, 0x1.3fef9fffff808p-58}, {0x1.0000000000000p-39, 0x1.fffef0ffff000p-102, 0x1.0000100000000p-7, -0x1.fff8000000800p-71, 0x1.0000100100000p-7, -0x1.fff7fffc00800p-71}, {0x1.0000000000000p-39, 0x1.fffef0ffff000p-102, -0x1.0000100000000p-7, 0x1.fff8000000800p-71, -0x1.00000fff00000p-7, 0x1.fff8000400800p-71}, {-0x1.0000000000000p-39, -0x1.fffef0ffff000p-102, 0x1.0000100000000p-7, -0x1.fff8000000800p-71, 0x1.00000fff00000p-7, -0x1.fff8000400800p-71}, {-0x1.0000000000000p-39, -0x1.fffef0ffff000p-102, -0x1.0000100000000p-7, 0x1.fff8000000800p-71, -0x1.0000100100000p-7, 0x1.fff7fffc00800p-71}, {0x1.07c00007ffff0p-15, 0x1.fffc00f800000p-91, 0x1.0000007ffffe0p-11, 0x1.f000000000000p-82, 0x1.107c00807ffdfp-11, 0x1.f0fffe0080000p-82}, {0x1.07c00007ffff0p-15, 0x1.fffc00f800000p-91, -0x1.0000007ffffe0p-11, -0x1.f000000000000p-82, -0x1.df0800fefffc2p-12, -0x1.ef0001ff80000p-82}, {-0x1.07c00007ffff0p-15, -0x1.fffc00f800000p-91, 0x1.0000007ffffe0p-11, 0x1.f000000000000p-82, 0x1.df0800fefffc2p-12, 0x1.ef0001ff80000p-82}, {-0x1.07c00007ffff0p-15, -0x1.fffc00f800000p-91, -0x1.0000007ffffe0p-11, -0x1.f000000000000p-82, -0x1.107c00807ffdfp-11, -0x1.f0fffe0080000p-82}, {0x1.0000000000000p+37, 0x1.ff800fffff800p-19, 0x1.0000000000000p-32, 0x1.fffc0000ffff8p-88, 0x1.0000000000000p+37, 0x1.ff880fffff800p-19}, {0x1.0000000000000p+37, 0x1.ff800fffff800p-19, -0x1.0000000000000p-32, -0x1.fffc0000ffff8p-88, 0x1.0000000000000p+37, 0x1.ff780fffff800p-19}, {-0x1.0000000000000p+37, -0x1.ff800fffff800p-19, 0x1.0000000000000p-32, 0x1.fffc0000ffff8p-88, -0x1.0000000000000p+37, -0x1.ff780fffff800p-19}, {-0x1.0000000000000p+37, -0x1.ff800fffff800p-19, -0x1.0000000000000p-32, -0x1.fffc0000ffff8p-88, -0x1.0000000000000p+37, -0x1.ff880fffff800p-19}, {0x1.0000000008000p+44, -0x1.ffff807ffe002p-10, 0x1.0000000800000p-6, -0x1.ffffff8000008p-62, 0x1.0000000008004p+44, -0x1.ffff7ffffe004p-10}, {0x1.0000000008000p+44, -0x1.ffff807ffe002p-10, -0x1.0000000800000p-6, 0x1.ffffff8000008p-62, 0x1.0000000007ffcp+44, -0x1.ffff80fffe000p-10}, {-0x1.0000000008000p+44, 0x1.ffff807ffe002p-10, 0x1.0000000800000p-6, -0x1.ffffff8000008p-62, -0x1.0000000007ffcp+44, 0x1.ffff80fffe000p-10}, {-0x1.0000000008000p+44, 0x1.ffff807ffe002p-10, -0x1.0000000800000p-6, 0x1.ffffff8000008p-62, -0x1.0000000008004p+44, 0x1.ffff7ffffe004p-10}, {0x1.0000000000020p-53, -0x1.0000000000000p-136, 0x1.0000000000000p+33, 0x1.fffff000003c0p-26, 0x1.0000000000000p+33, 0x1.fffff020003c0p-26}, {0x1.0000000000020p-53, -0x1.0000000000000p-136, -0x1.0000000000000p+33, -0x1.fffff000003c0p-26, -0x1.0000000000000p+33, -0x1.ffffefe0003c0p-26}, {-0x1.0000000000020p-53, 0x1.0000000000000p-136, 0x1.0000000000000p+33, 0x1.fffff000003c0p-26, 0x1.0000000000000p+33, 0x1.ffffefe0003c0p-26}, {-0x1.0000000000020p-53, 0x1.0000000000000p-136, -0x1.0000000000000p+33, -0x1.fffff000003c0p-26, -0x1.0000000000000p+33, -0x1.fffff020003c0p-26}, {0x1.0000001ffff80p-7, 0x1.fffffdfffff8ep-61, 0x1.0000000200000p-27, -0x1.0000000000000p-96, 0x1.0000101ffff82p-7, 0x1.fffffdffdff8ep-61}, {0x1.0000001ffff80p-7, 0x1.fffffdfffff8ep-61, -0x1.0000000200000p-27, 0x1.0000000000000p-96, 0x1.ffffe03fffefdp-8, -0x1.ffe0072000000p-85}, {-0x1.0000001ffff80p-7, -0x1.fffffdfffff8ep-61, 0x1.0000000200000p-27, -0x1.0000000000000p-96, -0x1.ffffe03fffefdp-8, 0x1.ffe0072000000p-85}, {-0x1.0000001ffff80p-7, -0x1.fffffdfffff8ep-61, -0x1.0000000200000p-27, 0x1.0000000000000p-96, -0x1.0000101ffff82p-7, -0x1.fffffdffdff8ep-61}, {0x1.01ffffff80400p-38, -0x1.c7ffffc000100p-96, 0x1.0000000000000p-47, 0x1.8fff01fffff00p-107, 0x1.027fffff80400p-38, -0x1.c7cdffdfc0100p-96}, {0x1.01ffffff80400p-38, -0x1.c7ffffc000100p-96, -0x1.0000000000000p-47, -0x1.8fff01fffff00p-107, 0x1.017fffff80400p-38, -0x1.c831ffa040100p-96}, {-0x1.01ffffff80400p-38, 0x1.c7ffffc000100p-96, 0x1.0000000000000p-47, 0x1.8fff01fffff00p-107, -0x1.017fffff80400p-38, 0x1.c831ffa040100p-96}, {-0x1.01ffffff80400p-38, 0x1.c7ffffc000100p-96, -0x1.0000000000000p-47, -0x1.8fff01fffff00p-107, -0x1.027fffff80400p-38, 0x1.c7cdffdfc0100p-96}, {0x1.0000000000008p-27, -0x1.ffffc00800000p-100, 0x1.00003ffe00002p+16, -0x1.ffffffc180080p-44, 0x1.00003ffe00202p+16, -0x1.ffffffc080080p-44}, {0x1.0000000000008p-27, -0x1.ffffc00800000p-100, -0x1.00003ffe00002p+16, 0x1.ffffffc180080p-44, -0x1.00003ffdffe02p+16, 0x1.ffffffc280080p-44}, {-0x1.0000000000008p-27, 0x1.ffffc00800000p-100, 0x1.00003ffe00002p+16, -0x1.ffffffc180080p-44, 0x1.00003ffdffe02p+16, -0x1.ffffffc280080p-44}, {-0x1.0000000000008p-27, 0x1.ffffc00800000p-100, -0x1.00003ffe00002p+16, 0x1.ffffffc180080p-44, -0x1.00003ffe00202p+16, 0x1.ffffffc080080p-44}, {0x1.000000ffffff8p+16, 0x1.ffffffc000000p-41, 0x1.0000000000000p+8, 0x1.ffffffe000000p-50, 0x1.010000ffffff8p+16, 0x1.007fffdff8000p-40}, {0x1.000000ffffff8p+16, 0x1.ffffffc000000p-41, -0x1.0000000000000p+8, -0x1.ffffffe000000p-50, 0x1.fe0001ffffff0p+15, 0x1.feffffc010000p-41}, {-0x1.000000ffffff8p+16, -0x1.ffffffc000000p-41, 0x1.0000000000000p+8, 0x1.ffffffe000000p-50, -0x1.fe0001ffffff0p+15, -0x1.feffffc010000p-41}, {-0x1.000000ffffff8p+16, -0x1.ffffffc000000p-41, -0x1.0000000000000p+8, -0x1.ffffffe000000p-50, -0x1.010000ffffff8p+16, -0x1.007fffdff8000p-40}, {0x1.0000000020000p-39, -0x1.0000000000000p-144, 0x1.0000000000400p-40, -0x1.ff1ffffff4000p-107, 0x1.8000000020200p-39, -0x1.ff20000000000p-107}, {0x1.0000000020000p-39, -0x1.0000000000000p-144, -0x1.0000000000400p-40, 0x1.ff1ffffff4000p-107, 0x1.000000003fc00p-40, 0x1.ff1fffffec000p-107}, {-0x1.0000000020000p-39, 0x1.0000000000000p-144, 0x1.0000000000400p-40, -0x1.ff1ffffff4000p-107, -0x1.000000003fc00p-40, -0x1.ff1fffffec000p-107}, {-0x1.0000000020000p-39, 0x1.0000000000000p-144, -0x1.0000000000400p-40, 0x1.ff1ffffff4000p-107, -0x1.8000000020200p-39, 0x1.ff20000000000p-107}, {0x1.0000ff8020000p-18, -0x1.fffffa0000000p-80, 0x1.0000000001ff0p+30, 0x1.f700000ffe000p-36, 0x1.0000000002000p+30, 0x1.7d402003ff800p-34}, {0x1.0000ff8020000p-18, -0x1.fffffa0000000p-80, -0x1.0000000001ff0p+30, -0x1.f700000ffe000p-36, -0x1.0000000001fe0p+30, 0x1.03803ff801000p-35}, {-0x1.0000ff8020000p-18, 0x1.fffffa0000000p-80, 0x1.0000000001ff0p+30, 0x1.f700000ffe000p-36, 0x1.0000000001fe0p+30, -0x1.03803ff801000p-35}, {-0x1.0000ff8020000p-18, 0x1.fffffa0000000p-80, -0x1.0000000001ff0p+30, -0x1.f700000ffe000p-36, -0x1.0000000002000p+30, -0x1.7d402003ff800p-34}, {0x1.0000020000000p+8, -0x1.0000000000000p-56, 0x1.003e00001f800p-14, 0x1.ffde000001e00p-76, 0x1.00000600f8000p+8, 0x1.f400007ff7800p-50}, {0x1.0000020000000p+8, -0x1.0000000000000p-56, -0x1.003e00001f800p-14, -0x1.ffde000001e00p-76, 0x1.fffffbfe10000p+7, -0x1.fc00007ff7800p-50}, {-0x1.0000020000000p+8, 0x1.0000000000000p-56, 0x1.003e00001f800p-14, 0x1.ffde000001e00p-76, -0x1.fffffbfe10000p+7, 0x1.fc00007ff7800p-50}, {-0x1.0000020000000p+8, 0x1.0000000000000p-56, -0x1.003e00001f800p-14, -0x1.ffde000001e00p-76, -0x1.00000600f8000p+8, -0x1.f400007ff7800p-50}, {0x1.0007e3ffe0000p-24, 0x1.fe0ffffffe000p-88, 0x1.0000000000000p+0, 0x1.fffffe07fff00p-61, 0x1.0000010007e40p+0, -0x1.000000dc1f080p-60}, {0x1.0007e3ffe0000p-24, 0x1.fe0ffffffe000p-88, -0x1.0000000000000p+0, -0x1.fffffe07fff00p-61, -0x1.fffffdfff0380p-1, -0x1.7fffff720f7c0p-59}, {-0x1.0007e3ffe0000p-24, -0x1.fe0ffffffe000p-88, 0x1.0000000000000p+0, 0x1.fffffe07fff00p-61, 0x1.fffffdfff0380p-1, 0x1.7fffff720f7c0p-59}, {-0x1.0007e3ffe0000p-24, -0x1.fe0ffffffe000p-88, -0x1.0000000000000p+0, -0x1.fffffe07fff00p-61, -0x1.0000010007e40p+0, 0x1.000000dc1f080p-60}, {0x1.00000000fe000p+38, 0x1.ff00004000000p-29, 0x1.000003fffff80p-32, 0x1.fff8400000000p-92, 0x1.00000000fe000p+38, 0x1.0f80006000000p-28}, {0x1.00000000fe000p+38, 0x1.ff00004000000p-29, -0x1.000003fffff80p-32, -0x1.fff8400000000p-92, 0x1.00000000fe000p+38, 0x1.deffffc000000p-29}, {-0x1.00000000fe000p+38, -0x1.ff00004000000p-29, 0x1.000003fffff80p-32, 0x1.fff8400000000p-92, -0x1.00000000fe000p+38, -0x1.deffffc000000p-29}, {-0x1.00000000fe000p+38, -0x1.ff00004000000p-29, -0x1.000003fffff80p-32, -0x1.fff8400000000p-92, -0x1.00000000fe000p+38, -0x1.0f80006000000p-28}, {0x1.0000800000000p-9, -0x1.0000000000000p-65, 0x1.0000000000000p-51, 0x1.fffffffc1fc00p-114, 0x1.0000800000400p-9, -0x1.fffffffffffe0p-66}, {0x1.0000800000000p-9, -0x1.0000000000000p-65, -0x1.0000000000000p-51, -0x1.fffffffc1fc00p-114, 0x1.00007fffffc00p-9, -0x1.0000000000010p-65}, {-0x1.0000800000000p-9, 0x1.0000000000000p-65, 0x1.0000000000000p-51, 0x1.fffffffc1fc00p-114, -0x1.00007fffffc00p-9, 0x1.0000000000010p-65}, {-0x1.0000800000000p-9, 0x1.0000000000000p-65, -0x1.0000000000000p-51, -0x1.fffffffc1fc00p-114, -0x1.0000800000400p-9, 0x1.fffffffffffe0p-66}, {0x1.0000000000000p-40, 0x1.ff000ff3ffe00p-94, 0x1.0000000000000p-18, 0x1.fe0003fffc000p-77, 0x1.0000040000000p-18, 0x1.fe01038003f80p-77}, {0x1.0000000000000p-40, 0x1.ff000ff3ffe00p-94, -0x1.0000000000000p-18, -0x1.fe0003fffc000p-77, -0x1.fffff80000000p-19, -0x1.fdff047ff4060p-77}, {-0x1.0000000000000p-40, -0x1.ff000ff3ffe00p-94, 0x1.0000000000000p-18, 0x1.fe0003fffc000p-77, 0x1.fffff80000000p-19, 0x1.fdff047ff4060p-77}, {-0x1.0000000000000p-40, -0x1.ff000ff3ffe00p-94, -0x1.0000000000000p-18, -0x1.fe0003fffc000p-77, -0x1.0000040000000p-18, -0x1.fe01038003f80p-77}, {0x1.000000e000010p-12, -0x1.ffffffc020000p-82, 0x1.00000001f0000p-4, 0x1.8000000000000p-108, 0x1.01000002d0000p-4, 0x1.fffff00000050p-61}, {0x1.000000e000010p-12, -0x1.ffffffc020000p-82, -0x1.00000001f0000p-4, -0x1.8000000000000p-108, -0x1.fe00000220000p-5, 0x1.ffffefffffff0p-61}, {-0x1.000000e000010p-12, 0x1.ffffffc020000p-82, 0x1.00000001f0000p-4, 0x1.8000000000000p-108, 0x1.fe00000220000p-5, -0x1.ffffefffffff0p-61}, {-0x1.000000e000010p-12, 0x1.ffffffc020000p-82, -0x1.00000001f0000p-4, -0x1.8000000000000p-108, -0x1.01000002d0000p-4, -0x1.fffff00000050p-61}, {0x1.000003ff00000p+23, 0x1.8000000000000p-54, 0x1.0001ffffe0000p-39, 0x1.f800000100000p-112, 0x1.000003ff00000p+23, 0x1.0004ffffe0000p-39}, {0x1.000003ff00000p+23, 0x1.8000000000000p-54, -0x1.0001ffffe0000p-39, -0x1.f800000100000p-112, 0x1.000003ff00000p+23, -0x1.fffdffffc0000p-40}, {-0x1.000003ff00000p+23, -0x1.8000000000000p-54, 0x1.0001ffffe0000p-39, 0x1.f800000100000p-112, -0x1.000003ff00000p+23, 0x1.fffdffffc0000p-40}, {-0x1.000003ff00000p+23, -0x1.8000000000000p-54, -0x1.0001ffffe0000p-39, -0x1.f800000100000p-112, -0x1.000003ff00000p+23, -0x1.0004ffffe0000p-39}, {0x1.0000000000200p+14, -0x1.ffffffffffc08p-42, 0x1.0000000000000p-48, 0x1.ffffffffffffep-102, 0x1.0000000000200p+14, -0x1.fbffffffffc08p-42}, {0x1.0000000000200p+14, -0x1.ffffffffffc08p-42, -0x1.0000000000000p-48, -0x1.ffffffffffffep-102, 0x1.0000000000200p+14, -0x1.01ffffffffe04p-41}, {-0x1.0000000000200p+14, 0x1.ffffffffffc08p-42, 0x1.0000000000000p-48, 0x1.ffffffffffffep-102, -0x1.0000000000200p+14, 0x1.01ffffffffe04p-41}, {-0x1.0000000000200p+14, 0x1.ffffffffffc08p-42, -0x1.0000000000000p-48, -0x1.ffffffffffffep-102, -0x1.0000000000200p+14, 0x1.fbffffffffc08p-42}, {0x1.0000000040000p+37, -0x1.fffff80002000p-29, 0x1.0000000000000p-21, 0x1.ffc01ffff3c00p-84, 0x1.0000000040000p+37, 0x1.fc00000ffffc0p-22}, {0x1.0000000040000p+37, -0x1.fffff80002000p-29, -0x1.0000000000000p-21, -0x1.ffc01ffff3c00p-84, 0x1.0000000040000p+37, -0x1.01fffff800020p-21}, {-0x1.0000000040000p+37, 0x1.fffff80002000p-29, 0x1.0000000000000p-21, 0x1.ffc01ffff3c00p-84, -0x1.0000000040000p+37, 0x1.01fffff800020p-21}, {-0x1.0000000040000p+37, 0x1.fffff80002000p-29, -0x1.0000000000000p-21, -0x1.ffc01ffff3c00p-84, -0x1.0000000040000p+37, -0x1.fc00000ffffc0p-22}, {0x1.0000800000000p+25, -0x1.0000000000000p-80, 0x1.0000003800001p-52, 0x1.fffffe000003ep-106, 0x1.0000800000000p+25, 0x1.0000003000000p-52}, {0x1.0000800000000p+25, -0x1.0000000000000p-80, -0x1.0000003800001p-52, -0x1.fffffe000003ep-106, 0x1.0000800000000p+25, -0x1.0000005000000p-52}, {-0x1.0000800000000p+25, 0x1.0000000000000p-80, 0x1.0000003800001p-52, 0x1.fffffe000003ep-106, -0x1.0000800000000p+25, 0x1.0000005000000p-52}, {-0x1.0000800000000p+25, 0x1.0000000000000p-80, -0x1.0000003800001p-52, -0x1.fffffe000003ep-106, -0x1.0000800000000p+25, -0x1.0000003000000p-52}, {0x1.0f00000020000p-4, -0x1.fffe000000100p-58, 0x1.0000000400000p-7, -0x1.ffffffc004000p-74, 0x1.2f000000a0000p-4, -0x1.ffffffffffd00p-58}, {0x1.0f00000020000p-4, -0x1.fffe000000100p-58, -0x1.0000000400000p-7, 0x1.ffffffc004000p-74, 0x1.ddffffff3ffffp-5, 0x1.ffffffd800000p-73}, {-0x1.0f00000020000p-4, 0x1.fffe000000100p-58, 0x1.0000000400000p-7, -0x1.ffffffc004000p-74, -0x1.ddffffff3ffffp-5, -0x1.ffffffd800000p-73}, {-0x1.0f00000020000p-4, 0x1.fffe000000100p-58, -0x1.0000000400000p-7, 0x1.ffffffc004000p-74, -0x1.2f000000a0000p-4, 0x1.ffffffffffd00p-58}, {0x1.003fe00020000p-13, -0x1.ffffffffe8000p-81, 0x1.0000000000400p-48, -0x1.ffff800007ffcp-103, 0x1.003fe00040000p-13, -0x1.ff8007ffe8000p-81}, {0x1.003fe00020000p-13, -0x1.ffffffffe8000p-81, -0x1.0000000000400p-48, 0x1.ffff800007ffcp-103, 0x1.003fe00000000p-13, -0x1.003ffbfff4000p-80}, {-0x1.003fe00020000p-13, 0x1.ffffffffe8000p-81, 0x1.0000000000400p-48, -0x1.ffff800007ffcp-103, -0x1.003fe00000000p-13, 0x1.003ffbfff4000p-80}, {-0x1.003fe00020000p-13, 0x1.ffffffffe8000p-81, -0x1.0000000000400p-48, 0x1.ffff800007ffcp-103, -0x1.003fe00040000p-13, 0x1.ff8007ffe8000p-81}, {0x1.ffff00fffffc4p-6, -0x1.8080000000000p-88, 0x1.0000020000000p-1, -0x1.0000000000000p-77, 0x1.0ffffa07ffffep-1, 0x1.ffffeffcff000p-57}, {0x1.ffff00fffffc4p-6, -0x1.8080000000000p-88, -0x1.0000020000000p-1, 0x1.0000000000000p-77, -0x1.e00013f000004p-2, 0x1.000007fe7f800p-56}, {-0x1.ffff00fffffc4p-6, 0x1.8080000000000p-88, 0x1.0000020000000p-1, -0x1.0000000000000p-77, 0x1.e00013f000004p-2, -0x1.000007fe7f800p-56}, {-0x1.ffff00fffffc4p-6, 0x1.8080000000000p-88, -0x1.0000020000000p-1, 0x1.0000000000000p-77, -0x1.0ffffa07ffffep-1, -0x1.ffffeffcff000p-57}, {0x1.0000000000040p+36, -0x1.8000000800000p-39, 0x1.0000000002000p+30, -0x1.0000000000000p-74, 0x1.04000000000c0p+36, -0x1.8000000800000p-39}, {0x1.0000000000040p+36, -0x1.8000000800000p-39, -0x1.0000000002000p+30, 0x1.0000000000000p-74, 0x1.f7fffffffff80p+35, -0x1.8000000800000p-39}, {-0x1.0000000000040p+36, 0x1.8000000800000p-39, 0x1.0000000002000p+30, -0x1.0000000000000p-74, -0x1.f7fffffffff80p+35, 0x1.8000000800000p-39}, {-0x1.0000000000040p+36, 0x1.8000000800000p-39, -0x1.0000000002000p+30, 0x1.0000000000000p-74, -0x1.04000000000c0p+36, 0x1.8000000800000p-39}, {0x1.0000000800000p-29, -0x1.ffffc02000000p-107, 0x1.7fffe00800000p-48, -0x1.0000000000000p-153, 0x1.00003007fc010p-29, -0x1.ffffc02000000p-107}, {0x1.0000000800000p-29, -0x1.ffffc02000000p-107, -0x1.7fffe00800000p-48, 0x1.0000000000000p-153, 0x1.ffffa01007fe0p-30, -0x1.ffffc02000000p-107}, {-0x1.0000000800000p-29, 0x1.ffffc02000000p-107, 0x1.7fffe00800000p-48, -0x1.0000000000000p-153, -0x1.ffffa01007fe0p-30, 0x1.ffffc02000000p-107}, {-0x1.0000000800000p-29, 0x1.ffffc02000000p-107, -0x1.7fffe00800000p-48, 0x1.0000000000000p-153, -0x1.00003007fc010p-29, 0x1.ffffc02000000p-107}, {0x1.0000400000000p+11, -0x1.0000000000000p-80, 0x1.4000000000000p+51, -0x1.ffffffff00020p-7, 0x1.4000000001000p+51, -0x1.fffffffe00040p-8}, {0x1.0000400000000p+11, -0x1.0000000000000p-80, -0x1.4000000000000p+51, 0x1.ffffffff00020p-7, -0x1.3fffffffff000p+51, 0x1.7fffffff80010p-6}, {-0x1.0000400000000p+11, 0x1.0000000000000p-80, 0x1.4000000000000p+51, -0x1.ffffffff00020p-7, 0x1.3fffffffff000p+51, -0x1.7fffffff80010p-6}, {-0x1.0000400000000p+11, 0x1.0000000000000p-80, -0x1.4000000000000p+51, 0x1.ffffffff00020p-7, -0x1.4000000001000p+51, 0x1.fffffffe00040p-8}, {0x1.0000000000000p+42, 0x1.03eff7ff3fff0p-15, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, 0x1.0000000000200p+42, 0x1.0befe7ff40070p-15}, {0x1.0000000000000p+42, 0x1.03eff7ff3fff0p-15, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, 0x1.ffffffffffc00p+41, 0x1.f7e00ffe7fee0p-16}, {-0x1.0000000000000p+42, -0x1.03eff7ff3fff0p-15, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, -0x1.ffffffffffc00p+41, -0x1.f7e00ffe7fee0p-16}, {-0x1.0000000000000p+42, -0x1.03eff7ff3fff0p-15, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, -0x1.0000000000200p+42, -0x1.0befe7ff40070p-15}, {0x1.03ffffffffffep-18, 0x1.8000000000000p-122, 0x1.0000040000000p+49, -0x1.0000000000000p-56, 0x1.0000040000000p+49, 0x1.03fffffffc000p-18}, {0x1.03ffffffffffep-18, 0x1.8000000000000p-122, -0x1.0000040000000p+49, 0x1.0000000000000p-56, -0x1.0000040000000p+49, 0x1.0400000004000p-18}, {-0x1.03ffffffffffep-18, -0x1.8000000000000p-122, 0x1.0000040000000p+49, -0x1.0000000000000p-56, 0x1.0000040000000p+49, -0x1.0400000004000p-18}, {-0x1.03ffffffffffep-18, -0x1.8000000000000p-122, -0x1.0000040000000p+49, 0x1.0000000000000p-56, -0x1.0000040000000p+49, -0x1.03fffffffc000p-18}, {0x1.0007ffffcfffcp+9, 0x1.ff01fffe00000p-65, 0x1.01fff08000000p-5, -0x1.fffffe0000020p-59, 0x1.000c07ff91ffcp+9, -0x1.f803f60008000p-59}, {0x1.0007ffffcfffcp+9, 0x1.ff01fffe00000p-65, -0x1.01fff08000000p-5, 0x1.fffffe0000020p-59, 0x1.0003f8000dffcp+9, 0x1.03fe02fffc000p-58}, {-0x1.0007ffffcfffcp+9, -0x1.ff01fffe00000p-65, 0x1.01fff08000000p-5, -0x1.fffffe0000020p-59, -0x1.0003f8000dffcp+9, -0x1.03fe02fffc000p-58}, {-0x1.0007ffffcfffcp+9, -0x1.ff01fffe00000p-65, -0x1.01fff08000000p-5, 0x1.fffffe0000020p-59, -0x1.000c07ff91ffcp+9, 0x1.f803f60008000p-59}, {0x1.00000000007fep-4, 0x1.ff00003ffff00p-65, 0x1.004000e000008p+5, -0x1.ffffe02000000p-73, 0x1.00c000e00000cp+5, -0x1.ff017fffd0100p-56}, {0x1.00000000007fep-4, 0x1.ff00003ffff00p-65, -0x1.004000e000008p+5, 0x1.ffffe02000000p-73, -0x1.ff8001c000008p+4, -0x1.feff7fffeff00p-56}, {-0x1.00000000007fep-4, -0x1.ff00003ffff00p-65, 0x1.004000e000008p+5, -0x1.ffffe02000000p-73, 0x1.ff8001c000008p+4, 0x1.feff7fffeff00p-56}, {-0x1.00000000007fep-4, -0x1.ff00003ffff00p-65, -0x1.004000e000008p+5, 0x1.ffffe02000000p-73, -0x1.00c000e00000cp+5, 0x1.ff017fffd0100p-56}, {0x1.00000003ff000p-41, 0x1.ffff000000000p-130, 0x1.0000fffff8000p-20, 0x1.f003ffe0003e0p-78, 0x1.000107fff8002p-20, 0x1.d003ffe0003e0p-78}, {0x1.00000003ff000p-41, 0x1.ffff000000000p-130, -0x1.0000fffff8000p-20, -0x1.f003ffe0003e0p-78, -0x1.0000f7fff7ffep-20, -0x1.0801fff0001f0p-77}, {-0x1.00000003ff000p-41, -0x1.ffff000000000p-130, 0x1.0000fffff8000p-20, 0x1.f003ffe0003e0p-78, 0x1.0000f7fff7ffep-20, 0x1.0801fff0001f0p-77}, {-0x1.00000003ff000p-41, -0x1.ffff000000000p-130, -0x1.0000fffff8000p-20, -0x1.f003ffe0003e0p-78, -0x1.000107fff8002p-20, -0x1.d003ffe0003e0p-78}, {0x1.0000000000000p-41, 0x1.ffe001c0003c0p-100, 0x1.01fffffe00000p+41, 0x1.ffffffffffc00p-17, 0x1.01fffffe00000p+41, 0x1.0000007fffe00p-16}, {0x1.0000000000000p-41, 0x1.ffe001c0003c0p-100, -0x1.01fffffe00000p+41, -0x1.ffffffffffc00p-17, -0x1.01fffffe00000p+41, -0x1.fffffeffffc00p-17}, {-0x1.0000000000000p-41, -0x1.ffe001c0003c0p-100, 0x1.01fffffe00000p+41, 0x1.ffffffffffc00p-17, 0x1.01fffffe00000p+41, 0x1.fffffeffffc00p-17}, {-0x1.0000000000000p-41, -0x1.ffe001c0003c0p-100, -0x1.01fffffe00000p+41, -0x1.ffffffffffc00p-17, -0x1.01fffffe00000p+41, -0x1.0000007fffe00p-16}, {0x1.00003ff808000p+36, -0x1.ffe0000800000p-25, 0x1.000001ffff000p+41, 0x1.ff80000000000p-33, 0x1.080003ffbf400p+41, -0x1.fde0800800000p-25}, {0x1.00003ff808000p+36, -0x1.ffe0000800000p-25, -0x1.000001ffff000p+41, -0x1.ff80000000000p-33, -0x1.f00000007d800p+40, -0x1.00efc00400000p-24}, {-0x1.00003ff808000p+36, 0x1.ffe0000800000p-25, 0x1.000001ffff000p+41, 0x1.ff80000000000p-33, 0x1.f00000007d800p+40, 0x1.00efc00400000p-24}, {-0x1.00003ff808000p+36, 0x1.ffe0000800000p-25, -0x1.000001ffff000p+41, -0x1.ff80000000000p-33, -0x1.080003ffbf400p+41, 0x1.fde0800800000p-25}, {0x1.0000000000000p+6, 0x1.fc007f0ff0000p-56, 0x1.0000000007f80p-50, 0x1.ff0007f802000p-114, 0x1.0000000000000p+6, 0x1.07f001fc47b80p-50}, {0x1.0000000000000p+6, 0x1.fc007f0ff0000p-56, -0x1.0000000007f80p-50, -0x1.ff0007f802000p-114, 0x1.0000000000000p+6, -0x1.f01ffc0790700p-51}, {-0x1.0000000000000p+6, -0x1.fc007f0ff0000p-56, 0x1.0000000007f80p-50, 0x1.ff0007f802000p-114, -0x1.0000000000000p+6, 0x1.f01ffc0790700p-51}, {-0x1.0000000000000p+6, -0x1.fc007f0ff0000p-56, -0x1.0000000007f80p-50, -0x1.ff0007f802000p-114, -0x1.0000000000000p+6, -0x1.07f001fc47b80p-50}, {0x1.0020000000000p+12, -0x1.0000000000000p-65, 0x1.000001ffff802p-4, -0x1.ffffffc000040p-63, 0x1.0021000002000p+12, -0x1.ff811fffffe00p-46}, {0x1.0020000000000p+12, -0x1.0000000000000p-65, -0x1.000001ffff802p-4, 0x1.ffffffc000040p-63, 0x1.001efffffe000p+12, 0x1.ff80dfffffe00p-46}, {-0x1.0020000000000p+12, 0x1.0000000000000p-65, 0x1.000001ffff802p-4, -0x1.ffffffc000040p-63, -0x1.001efffffe000p+12, -0x1.ff80dfffffe00p-46}, {-0x1.0020000000000p+12, 0x1.0000000000000p-65, -0x1.000001ffff802p-4, 0x1.ffffffc000040p-63, -0x1.0021000002000p+12, 0x1.ff811fffffe00p-46}, {0x1.0000000000800p-45, -0x1.ffe0000400000p-107, 0x1.0000000000038p+25, 0x1.e100000000000p-49, 0x1.0000000000038p+25, 0x1.1e10000000000p-45}, {0x1.0000000000800p-45, -0x1.ffe0000400000p-107, -0x1.0000000000038p+25, -0x1.e100000000000p-49, -0x1.0000000000038p+25, 0x1.c3e0000000000p-46}, {-0x1.0000000000800p-45, 0x1.ffe0000400000p-107, 0x1.0000000000038p+25, 0x1.e100000000000p-49, 0x1.0000000000038p+25, -0x1.c3e0000000000p-46}, {-0x1.0000000000800p-45, 0x1.ffe0000400000p-107, -0x1.0000000000038p+25, -0x1.e100000000000p-49, -0x1.0000000000038p+25, -0x1.1e10000000000p-45}, {0x1.0000000000020p-31, -0x1.8007ffff80c04p-86, 0x1.0000000000000p+50, 0x1.ffffe00000c00p-13, 0x1.0000000000000p+50, 0x1.0000100000600p-12}, {0x1.0000000000020p-31, -0x1.8007ffff80c04p-86, -0x1.0000000000000p+50, -0x1.ffffe00000c00p-13, -0x1.0000000000000p+50, -0x1.ffffa00000c00p-13}, {-0x1.0000000000020p-31, 0x1.8007ffff80c04p-86, 0x1.0000000000000p+50, 0x1.ffffe00000c00p-13, 0x1.0000000000000p+50, 0x1.ffffa00000c00p-13}, {-0x1.0000000000020p-31, 0x1.8007ffff80c04p-86, -0x1.0000000000000p+50, -0x1.ffffe00000c00p-13, -0x1.0000000000000p+50, -0x1.0000100000600p-12}, {0x1.7fffffff80000p+1, 0x1.f000000000000p-76, 0x1.000007ffffffep-41, 0x1.ffffff8000000p-117, 0x1.7fffffff80400p+1, 0x1.0007bffc00000p-62}, {0x1.7fffffff80000p+1, 0x1.f000000000000p-76, -0x1.000007ffffffep-41, -0x1.ffffff8000000p-117, 0x1.7fffffff7fc00p+1, -0x1.fff07ff800000p-63}, {-0x1.7fffffff80000p+1, -0x1.f000000000000p-76, 0x1.000007ffffffep-41, 0x1.ffffff8000000p-117, -0x1.7fffffff7fc00p+1, 0x1.fff07ff800000p-63}, {-0x1.7fffffff80000p+1, -0x1.f000000000000p-76, -0x1.000007ffffffep-41, -0x1.ffffff8000000p-117, -0x1.7fffffff80400p+1, -0x1.0007bffc00000p-62}, {0x1.0000000010000p+45, -0x1.0000000000000p-41, 0x1.0000000000000p+5, 0x1.c000003ffc3fep-49, 0x1.0000000011000p+45, -0x1.fc80000000000p-42}, {0x1.0000000010000p+45, -0x1.0000000000000p-41, -0x1.0000000000000p+5, -0x1.c000003ffc3fep-49, 0x1.000000000f000p+45, -0x1.01c0000000000p-41}, {-0x1.0000000010000p+45, 0x1.0000000000000p-41, 0x1.0000000000000p+5, 0x1.c000003ffc3fep-49, -0x1.000000000f000p+45, 0x1.01c0000000000p-41}, {-0x1.0000000010000p+45, 0x1.0000000000000p-41, -0x1.0000000000000p+5, -0x1.c000003ffc3fep-49, -0x1.0000000011000p+45, 0x1.fc80000000000p-42}, {0x1.00000ffff0800p-14, -0x1.fff80000ffc20p-72, 0x1.0000000000002p-19, -0x1.0000000000000p-124, 0x1.08000ffff0800p-14, 0x1.0003ffff801f0p-71}, {0x1.00000ffff0800p-14, -0x1.fff80000ffc20p-72, -0x1.0000000000002p-19, 0x1.0000000000000p-124, 0x1.f0001fffe1000p-15, -0x1.7ffe00003ff08p-70}, {-0x1.00000ffff0800p-14, 0x1.fff80000ffc20p-72, 0x1.0000000000002p-19, -0x1.0000000000000p-124, -0x1.f0001fffe1000p-15, 0x1.7ffe00003ff08p-70}, {-0x1.00000ffff0800p-14, 0x1.fff80000ffc20p-72, -0x1.0000000000002p-19, 0x1.0000000000000p-124, -0x1.08000ffff0800p-14, -0x1.0003ffff801f0p-71}, {0x1.000ffffc00000p+49, 0x1.fffff00000000p-20, 0x1.0000000000040p+45, -0x1.0000000000000p-60, 0x1.100ffffc00004p+49, 0x1.fffff00000000p-20}, {0x1.000ffffc00000p+49, 0x1.fffff00000000p-20, -0x1.0000000000040p+45, 0x1.0000000000000p-60, 0x1.e01ffff7ffff8p+48, 0x1.fffff00000000p-20}, {-0x1.000ffffc00000p+49, -0x1.fffff00000000p-20, 0x1.0000000000040p+45, -0x1.0000000000000p-60, -0x1.e01ffff7ffff8p+48, -0x1.fffff00000000p-20}, {-0x1.000ffffc00000p+49, -0x1.fffff00000000p-20, -0x1.0000000000040p+45, 0x1.0000000000000p-60, -0x1.100ffffc00004p+49, -0x1.fffff00000000p-20}, {0x1.0004000000000p+14, -0x1.0000000000000p-54, 0x1.0000000200000p-4, -0x1.ffbffffff8020p-62, 0x1.0004400000008p+14, -0x1.01ffc00000000p-54}, {0x1.0004000000000p+14, -0x1.0000000000000p-54, -0x1.0000000200000p-4, 0x1.ffbffffff8020p-62, 0x1.0003bfffffff8p+14, -0x1.fc00800000000p-55}, {-0x1.0004000000000p+14, 0x1.0000000000000p-54, 0x1.0000000200000p-4, -0x1.ffbffffff8020p-62, -0x1.0003bfffffff8p+14, 0x1.fc00800000000p-55}, {-0x1.0004000000000p+14, 0x1.0000000000000p-54, -0x1.0000000200000p-4, 0x1.ffbffffff8020p-62, -0x1.0004400000008p+14, 0x1.01ffc00000000p-54}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, 0x1.0000001fffffep+43, 0x0.0000000000000p+0, 0x1.00000020000fep+43, 0x1.0000000000000p-61}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, -0x1.0000001fffffep+43, 0x0.0000000000000p+0, -0x1.0000001fffefep+43, 0x1.0000000000000p-61}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, 0x1.0000001fffffep+43, 0x0.0000000000000p+0, 0x1.0000001fffefep+43, -0x1.0000000000000p-61}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, -0x1.0000001fffffep+43, 0x0.0000000000000p+0, -0x1.00000020000fep+43, -0x1.0000000000000p-61}, {0x1.0000000000fffp-39, 0x1.fffff3e000000p-112, 0x1.001ffe0000000p-15, 0x1.fffffffffffc0p-74, 0x1.001fff0000000p-15, 0x1.03ffc00003fe0p-73}, {0x1.0000000000fffp-39, 0x1.fffff3e000000p-112, -0x1.001ffe0000000p-15, -0x1.fffffffffffc0p-74, -0x1.001ffd0000000p-15, -0x1.f8007ffff7fc0p-74}, {-0x1.0000000000fffp-39, -0x1.fffff3e000000p-112, 0x1.001ffe0000000p-15, 0x1.fffffffffffc0p-74, 0x1.001ffd0000000p-15, 0x1.f8007ffff7fc0p-74}, {-0x1.0000000000fffp-39, -0x1.fffff3e000000p-112, -0x1.001ffe0000000p-15, -0x1.fffffffffffc0p-74, -0x1.001fff0000000p-15, -0x1.03ffc00003fe0p-73}, {0x1.0000080000000p-27, -0x1.0000000000000p-132, 0x1.0000000080000p-48, -0x1.0000000000000p-103, 0x1.0000100000000p-27, 0x1.fffff7ffffffcp-82}, {0x1.0000080000000p-27, -0x1.0000000000000p-132, -0x1.0000000080000p-48, 0x1.0000000000000p-103, 0x1.0000000000000p-27, -0x1.fffff80000004p-82}, {-0x1.0000080000000p-27, 0x1.0000000000000p-132, 0x1.0000000080000p-48, -0x1.0000000000000p-103, -0x1.0000000000000p-27, 0x1.fffff80000004p-82}, {-0x1.0000080000000p-27, 0x1.0000000000000p-132, -0x1.0000000080000p-48, 0x1.0000000000000p-103, -0x1.0000100000000p-27, -0x1.fffff7ffffffcp-82}, {0x1.003ffffffffe0p-31, 0x1.ffffe03800000p-107, 0x1.0000000002000p-53, -0x1.0000000000000p-106, 0x1.004003fffffe0p-31, 0x1.ffffffff80e00p-93}, {0x1.003ffffffffe0p-31, 0x1.ffffe03800000p-107, -0x1.0000000002000p-53, 0x1.0000000000000p-106, 0x1.003ffbfffffe0p-31, -0x1.fff000007f200p-93}, {-0x1.003ffffffffe0p-31, -0x1.ffffe03800000p-107, 0x1.0000000002000p-53, -0x1.0000000000000p-106, -0x1.003ffbfffffe0p-31, 0x1.fff000007f200p-93}, {-0x1.003ffffffffe0p-31, -0x1.ffffe03800000p-107, -0x1.0000000002000p-53, 0x1.0000000000000p-106, -0x1.004003fffffe0p-31, -0x1.ffffffff80e00p-93}, {0x1.0000000000008p+23, -0x1.ff000007ffc00p-37, 0x1.0000000060000p+36, 0x1.ffffff8000000p-44, 0x1.0008000060000p+36, 0x1.ff813ffffdc00p-27}, {0x1.0000000000008p+23, -0x1.ff000007ffc00p-37, -0x1.0000000060000p+36, -0x1.ffffff8000000p-44, -0x1.fff00000c0000p+35, 0x1.ff7f3ffffe400p-27}, {-0x1.0000000000008p+23, 0x1.ff000007ffc00p-37, 0x1.0000000060000p+36, 0x1.ffffff8000000p-44, 0x1.fff00000c0000p+35, -0x1.ff7f3ffffe400p-27}, {-0x1.0000000000008p+23, 0x1.ff000007ffc00p-37, -0x1.0000000060000p+36, -0x1.ffffff8000000p-44, -0x1.0008000060000p+36, -0x1.ff813ffffdc00p-27}, {0x1.0000000000080p+25, -0x1.0000000000000p-80, 0x1.01ffffff80001p+15, -0x1.ff90000000000p-78, 0x1.00407fffffe80p+25, 0x1.fffffffffdc00p-38}, {0x1.0000000000080p+25, -0x1.0000000000000p-80, -0x1.01ffffff80001p+15, 0x1.ff90000000000p-78, 0x1.ff7f000000500p+24, -0x1.fffffffffe400p-38}, {-0x1.0000000000080p+25, 0x1.0000000000000p-80, 0x1.01ffffff80001p+15, -0x1.ff90000000000p-78, -0x1.ff7f000000500p+24, 0x1.fffffffffe400p-38}, {-0x1.0000000000080p+25, 0x1.0000000000000p-80, -0x1.01ffffff80001p+15, 0x1.ff90000000000p-78, -0x1.00407fffffe80p+25, -0x1.fffffffffdc00p-38}, {0x1.0000000000800p+7, -0x1.fffff80002000p-59, 0x1.0008000000000p+50, -0x1.0000000000000p-29, 0x1.0008000000200p+50, -0x1.f000000000000p-30}, {0x1.0000000000800p+7, -0x1.fffff80002000p-59, -0x1.0008000000000p+50, 0x1.0000000000000p-29, -0x1.0007ffffffe00p+50, 0x1.0800000000000p-29}, {-0x1.0000000000800p+7, 0x1.fffff80002000p-59, 0x1.0008000000000p+50, -0x1.0000000000000p-29, 0x1.0007ffffffe00p+50, -0x1.0800000000000p-29}, {-0x1.0000000000800p+7, 0x1.fffff80002000p-59, -0x1.0008000000000p+50, 0x1.0000000000000p-29, -0x1.0008000000200p+50, 0x1.f000000000000p-30}, {0x1.0000000000002p+26, -0x1.ffffffe200000p-48, 0x1.0003fffffffc0p+27, 0x1.ffffe00000400p-36, 0x1.8003fffffffc1p+27, 0x1.ffdfe00002000p-36}, {0x1.0000000000002p+26, -0x1.ffffffe200000p-48, -0x1.0003fffffffc0p+27, -0x1.ffffe00000400p-36, -0x1.0007fffffff7ep+26, -0x1.000fefffff300p-35}, {-0x1.0000000000002p+26, 0x1.ffffffe200000p-48, 0x1.0003fffffffc0p+27, 0x1.ffffe00000400p-36, 0x1.0007fffffff7ep+26, 0x1.000fefffff300p-35}, {-0x1.0000000000002p+26, 0x1.ffffffe200000p-48, -0x1.0003fffffffc0p+27, -0x1.ffffe00000400p-36, -0x1.8003fffffffc1p+27, -0x1.ffdfe00002000p-36}, {0x1.000003f000000p+13, 0x1.fffffffe00000p-48, 0x1.0000000000ff0p+50, 0x1.c03fff0e00000p-24, 0x1.0000000008ff0p+50, 0x1.f807010004380p-10}, {0x1.000003f000000p+13, 0x1.fffffffe00000p-48, -0x1.0000000000ff0p+50, -0x1.c03fff0e00000p-24, -0x1.fffffffff1fe0p+49, 0x1.f7f8ff000bc80p-10}, {-0x1.000003f000000p+13, -0x1.fffffffe00000p-48, 0x1.0000000000ff0p+50, 0x1.c03fff0e00000p-24, 0x1.fffffffff1fe0p+49, -0x1.f7f8ff000bc80p-10}, {-0x1.000003f000000p+13, -0x1.fffffffe00000p-48, -0x1.0000000000ff0p+50, -0x1.c03fff0e00000p-24, -0x1.0000000008ff0p+50, -0x1.f807010004380p-10}, {0x1.0000000018000p-6, 0x1.fffffe0000000p-88, 0x1.0000100000000p+32, -0x1.0000000000000p-73, 0x1.0000100004000p+32, 0x1.7ffffffe00000p-42}, {0x1.0000000018000p-6, 0x1.fffffe0000000p-88, -0x1.0000100000000p+32, 0x1.0000000000000p-73, -0x1.00000ffffc000p+32, 0x1.8000000200000p-42}, {-0x1.0000000018000p-6, -0x1.fffffe0000000p-88, 0x1.0000100000000p+32, -0x1.0000000000000p-73, 0x1.00000ffffc000p+32, -0x1.8000000200000p-42}, {-0x1.0000000018000p-6, -0x1.fffffe0000000p-88, -0x1.0000100000000p+32, 0x1.0000000000000p-73, -0x1.0000100004000p+32, -0x1.7ffffffe00000p-42}, {0x1.0000000000001p+35, -0x1.fffffc1000000p-32, 0x1.1ffffff01f000p+36, 0x1.ffffc000060fcp-19, 0x1.9ffffff01f001p+36, -0x1.00081fffed382p-18}, {0x1.0000000000001p+35, -0x1.fffffc1000000p-32, -0x1.1ffffff01f000p+36, -0x1.ffffc000060fcp-19, -0x1.3fffffe03e000p+35, 0x1.fff0400019704p-19}, {-0x1.0000000000001p+35, 0x1.fffffc1000000p-32, 0x1.1ffffff01f000p+36, 0x1.ffffc000060fcp-19, 0x1.3fffffe03e000p+35, -0x1.fff0400019704p-19}, {-0x1.0000000000001p+35, 0x1.fffffc1000000p-32, -0x1.1ffffff01f000p+36, -0x1.ffffc000060fcp-19, -0x1.9ffffff01f001p+36, 0x1.00081fffed382p-18}, {0x1.0000003800000p+43, 0x1.ffe000001fffcp-12, 0x1.0000007fffff0p+50, 0x1.fe1ffffc00000p-12, 0x1.020000806fff0p+50, 0x1.fefffffe10000p-11}, {0x1.0000003800000p+43, 0x1.ffe000001fffcp-12, -0x1.0000007fffff0p+50, -0x1.fe1ffffc00000p-12, -0x1.fc0000ff1ffe0p+49, 0x1.c000042000000p-20}, {-0x1.0000003800000p+43, -0x1.ffe000001fffcp-12, 0x1.0000007fffff0p+50, 0x1.fe1ffffc00000p-12, 0x1.fc0000ff1ffe0p+49, -0x1.c000042000000p-20}, {-0x1.0000003800000p+43, -0x1.ffe000001fffcp-12, -0x1.0000007fffff0p+50, -0x1.fe1ffffc00000p-12, -0x1.020000806fff0p+50, -0x1.fefffffe10000p-11}, {0x1.0000001fffc00p+32, 0x1.f00007ffe0000p-32, 0x1.0000000000180p+25, 0x1.fffffe0000800p-39, 0x1.0200001fffc03p+32, 0x1.f40007fbe0000p-32}, {0x1.0000001fffc00p+32, 0x1.f00007ffe0000p-32, -0x1.0000000000180p+25, -0x1.fffffe0000800p-39, 0x1.fc00003fff7fap+31, 0x1.ec000803e0000p-32}, {-0x1.0000001fffc00p+32, -0x1.f00007ffe0000p-32, 0x1.0000000000180p+25, 0x1.fffffe0000800p-39, -0x1.fc00003fff7fap+31, -0x1.ec000803e0000p-32}, {-0x1.0000001fffc00p+32, -0x1.f00007ffe0000p-32, -0x1.0000000000180p+25, -0x1.fffffe0000800p-39, -0x1.0200001fffc03p+32, -0x1.f40007fbe0000p-32}, {0x1.0000000008000p+19, -0x1.c0000007ffe04p-36, 0x1.00000fffffffep-53, 0x1.fc00000000000p-152, 0x1.0000000008000p+19, -0x1.bfff8007f7e04p-36}, {0x1.0000000008000p+19, -0x1.c0000007ffe04p-36, -0x1.00000fffffffep-53, -0x1.fc00000000000p-152, 0x1.0000000008000p+19, -0x1.c000800807e04p-36}, {-0x1.0000000008000p+19, 0x1.c0000007ffe04p-36, 0x1.00000fffffffep-53, 0x1.fc00000000000p-152, -0x1.0000000008000p+19, 0x1.c000800807e04p-36}, {-0x1.0000000008000p+19, 0x1.c0000007ffe04p-36, -0x1.00000fffffffep-53, -0x1.fc00000000000p-152, -0x1.0000000008000p+19, 0x1.bfff8007f7e04p-36}, {0x1.0000003e00004p+43, -0x1.fe00040000000p-27, 0x1.00007c0001e00p+8, 0x1.fffe13ffe0000p-56, 0x1.0000003e20005p+43, -0x1.000f78001f800p-14}, {0x1.0000003e00004p+43, -0x1.fe00040000000p-27, -0x1.00007c0001e00p+8, -0x1.fffe13ffe0000p-56, 0x1.0000003de0003p+43, 0x1.ffdf2fffbf000p-15}, {-0x1.0000003e00004p+43, 0x1.fe00040000000p-27, 0x1.00007c0001e00p+8, 0x1.fffe13ffe0000p-56, -0x1.0000003de0003p+43, -0x1.ffdf2fffbf000p-15}, {-0x1.0000003e00004p+43, 0x1.fe00040000000p-27, -0x1.00007c0001e00p+8, -0x1.fffe13ffe0000p-56, -0x1.0000003e20005p+43, 0x1.000f78001f800p-14}, {0x1.03fffffffc000p+44, 0x1.ffffffc000000p-31, 0x1.0003ffffff000p-28, 0x1.ffc0000000000p-123, 0x1.03fffffffc000p+44, 0x1.4003fff800000p-28}, {0x1.03fffffffc000p+44, 0x1.ffffffc000000p-31, -0x1.0003ffffff000p-28, -0x1.ffc0000000000p-123, 0x1.03fffffffc000p+44, -0x1.8008001000000p-29}, {-0x1.03fffffffc000p+44, -0x1.ffffffc000000p-31, 0x1.0003ffffff000p-28, 0x1.ffc0000000000p-123, -0x1.03fffffffc000p+44, 0x1.8008001000000p-29}, {-0x1.03fffffffc000p+44, -0x1.ffffffc000000p-31, -0x1.0003ffffff000p-28, -0x1.ffc0000000000p-123, -0x1.03fffffffc000p+44, -0x1.4003fff800000p-28}, {0x1.07ffffff80000p+48, 0x1.8007ffffc0000p-23, 0x1.0000000000004p-5, -0x1.fffc000200000p-74, 0x1.07ffffff80001p+48, -0x1.ffff3ffbffffap-6}, {0x1.07ffffff80000p+48, 0x1.8007ffffc0000p-23, -0x1.0000000000004p-5, 0x1.fffc000200000p-74, 0x1.07ffffff80000p+48, -0x1.ffff3ffc0000ap-6}, {-0x1.07ffffff80000p+48, -0x1.8007ffffc0000p-23, 0x1.0000000000004p-5, -0x1.fffc000200000p-74, -0x1.07ffffff80000p+48, 0x1.ffff3ffc0000ap-6}, {-0x1.07ffffff80000p+48, -0x1.8007ffffc0000p-23, -0x1.0000000000004p-5, 0x1.fffc000200000p-74, -0x1.07ffffff80001p+48, 0x1.ffff3ffbffffap-6}, {0x1.00003ffffff80p-25, 0x1.ffff0000ffe00p-87, 0x1.00003fffffff8p-48, 0x0.0000000000000p+0, 0x1.0000420000780p-25, 0x1.ffbf0000ffe00p-87}, {0x1.00003ffffff80p-25, 0x1.ffff0000ffe00p-87, -0x1.00003fffffff8p-48, 0x0.0000000000000p+0, 0x1.00003dffff780p-25, 0x1.001f80007ff00p-86}, {-0x1.00003ffffff80p-25, -0x1.ffff0000ffe00p-87, 0x1.00003fffffff8p-48, 0x0.0000000000000p+0, -0x1.00003dffff780p-25, -0x1.001f80007ff00p-86}, {-0x1.00003ffffff80p-25, -0x1.ffff0000ffe00p-87, -0x1.00003fffffff8p-48, 0x0.0000000000000p+0, -0x1.0000420000780p-25, -0x1.ffbf0000ffe00p-87}, {0x1.0000010000000p+29, -0x1.0000000000000p-76, 0x1.00f81ffffff81p-9, 0x1.fffff03c00000p-71, 0x1.000001000403ep+29, 0x1.ffffff81007e0p-29}, {0x1.0000010000000p+29, -0x1.0000000000000p-76, -0x1.00f81ffffff81p-9, -0x1.fffff03c00000p-71, 0x1.000000fffbfc2p+29, -0x1.ffffff8100820p-29}, {-0x1.0000010000000p+29, 0x1.0000000000000p-76, 0x1.00f81ffffff81p-9, 0x1.fffff03c00000p-71, -0x1.000000fffbfc2p+29, 0x1.ffffff8100820p-29}, {-0x1.0000010000000p+29, 0x1.0000000000000p-76, -0x1.00f81ffffff81p-9, -0x1.fffff03c00000p-71, -0x1.000001000403ep+29, -0x1.ffffff81007e0p-29}, {0x1.0000000000004p+5, -0x1.fff0008000000p-59, 0x1.0000000100000p+48, -0x1.fffffe0004000p-19, 0x1.0000000100200p+48, -0x1.fffffdc004000p-19}, {0x1.0000000000004p+5, -0x1.fff0008000000p-59, -0x1.0000000100000p+48, 0x1.fffffe0004000p-19, -0x1.00000000ffe00p+48, 0x1.fffffe4004000p-19}, {-0x1.0000000000004p+5, 0x1.fff0008000000p-59, 0x1.0000000100000p+48, -0x1.fffffe0004000p-19, 0x1.00000000ffe00p+48, -0x1.fffffe4004000p-19}, {-0x1.0000000000004p+5, 0x1.fff0008000000p-59, -0x1.0000000100000p+48, 0x1.fffffe0004000p-19, -0x1.0000000100200p+48, 0x1.fffffdc004000p-19}, {0x1.0000000000800p+23, -0x1.0000000000000p-55, 0x1.0000010000000p+11, -0x1.0000000000000p-92, 0x1.0010000010800p+23, -0x1.0000000000000p-55}, {0x1.0000000000800p+23, -0x1.0000000000000p-55, -0x1.0000010000000p+11, 0x1.0000000000000p-92, 0x1.ffdfffffe1000p+22, -0x1.0000000000000p-55}, {-0x1.0000000000800p+23, 0x1.0000000000000p-55, 0x1.0000010000000p+11, -0x1.0000000000000p-92, -0x1.ffdfffffe1000p+22, 0x1.0000000000000p-55}, {-0x1.0000000000800p+23, 0x1.0000000000000p-55, -0x1.0000010000000p+11, 0x1.0000000000000p-92, -0x1.0010000010800p+23, 0x1.0000000000000p-55}, {0x1.00000007fff00p-25, 0x1.fffc1ffff87f0p-81, 0x1.0000007c00000p-2, 0x1.fff0000000000p-73, 0x1.0000027c00001p-2, -0x1.bfc2007c00000p-70}, {0x1.00000007fff00p-25, 0x1.fffc1ffff87f0p-81, -0x1.0000007c00000p-2, -0x1.fff0000000000p-73, -0x1.fffffcf7ffffep-3, -0x1.1fdf003e00000p-69}, {-0x1.00000007fff00p-25, -0x1.fffc1ffff87f0p-81, 0x1.0000007c00000p-2, 0x1.fff0000000000p-73, 0x1.fffffcf7ffffep-3, 0x1.1fdf003e00000p-69}, {-0x1.00000007fff00p-25, -0x1.fffc1ffff87f0p-81, -0x1.0000007c00000p-2, -0x1.fff0000000000p-73, -0x1.0000027c00001p-2, 0x1.bfc2007c00000p-70}, {0x1.fffffffe00000p+40, 0x1.e000001fff800p-24, 0x1.00000001ffffep-36, 0x0.0000000000000p+0, 0x1.fffffffe00000p+40, 0x1.e010001fff800p-24}, {0x1.fffffffe00000p+40, 0x1.e000001fff800p-24, -0x1.00000001ffffep-36, 0x0.0000000000000p+0, 0x1.fffffffe00000p+40, 0x1.dff0001fff800p-24}, {-0x1.fffffffe00000p+40, -0x1.e000001fff800p-24, 0x1.00000001ffffep-36, 0x0.0000000000000p+0, -0x1.fffffffe00000p+40, -0x1.dff0001fff800p-24}, {-0x1.fffffffe00000p+40, -0x1.e000001fff800p-24, -0x1.00000001ffffep-36, 0x0.0000000000000p+0, -0x1.fffffffe00000p+40, -0x1.e010001fff800p-24}, {0x1.0000000000008p+12, -0x1.fffff00400000p-60, 0x1.00003ffffe000p-40, 0x1.ffffe00000000p-112, 0x1.0000000000009p+12, 0x1.ffffeffc00000p-60}, {0x1.0000000000008p+12, -0x1.fffff00400000p-60, -0x1.00003ffffe000p-40, -0x1.ffffe00000000p-112, 0x1.0000000000007p+12, -0x1.7ffff40100000p-58}, {-0x1.0000000000008p+12, 0x1.fffff00400000p-60, 0x1.00003ffffe000p-40, 0x1.ffffe00000000p-112, -0x1.0000000000007p+12, 0x1.7ffff40100000p-58}, {-0x1.0000000000008p+12, 0x1.fffff00400000p-60, -0x1.00003ffffe000p-40, -0x1.ffffe00000000p-112, -0x1.0000000000009p+12, -0x1.ffffeffc00000p-60}, {0x1.0000000000000p-26, 0x1.ffffffffffc00p-89, 0x1.000001ffe0000p+32, 0x1.ff87ff9f801c0p-27, 0x1.000001ffe0000p+32, 0x1.ffc3ffcfc00e0p-26}, {0x1.0000000000000p-26, 0x1.ffffffffffc00p-89, -0x1.000001ffe0000p+32, -0x1.ff87ff9f801c0p-27, -0x1.000001ffe0000p+32, 0x1.e00181ff90000p-37}, {-0x1.0000000000000p-26, -0x1.ffffffffffc00p-89, 0x1.000001ffe0000p+32, 0x1.ff87ff9f801c0p-27, 0x1.000001ffe0000p+32, -0x1.e00181ff90000p-37}, {-0x1.0000000000000p-26, -0x1.ffffffffffc00p-89, -0x1.000001ffe0000p+32, -0x1.ff87ff9f801c0p-27, -0x1.000001ffe0000p+32, -0x1.ffc3ffcfc00e0p-26}, {0x1.0000000000400p+5, -0x1.f800000002000p-56, 0x1.03fffffffff00p+2, 0x1.fffe7fffffffep-52, 0x1.20800000003e0p+5, 0x1.e07e7fffffe00p-52}, {0x1.0000000000400p+5, -0x1.f800000002000p-56, -0x1.03fffffffff00p+2, -0x1.fffe7fffffffep-52, 0x1.bf00000000840p+4, -0x1.0fbf400000100p-51}, {-0x1.0000000000400p+5, 0x1.f800000002000p-56, 0x1.03fffffffff00p+2, 0x1.fffe7fffffffep-52, -0x1.bf00000000840p+4, 0x1.0fbf400000100p-51}, {-0x1.0000000000400p+5, 0x1.f800000002000p-56, -0x1.03fffffffff00p+2, -0x1.fffe7fffffffep-52, -0x1.20800000003e0p+5, -0x1.e07e7fffffe00p-52}, {0x1.0000000000000p+13, 0x1.fffffffffff00p-43, 0x1.000007c000000p-28, 0x1.fff8000000000p-84, 0x1.0000000000800p+13, 0x1.01f0000000780p-42}, {0x1.0000000000000p+13, 0x1.fffffffffff00p-43, -0x1.000007c000000p-28, -0x1.fff8000000000p-84, 0x1.ffffffffff000p+12, 0x1.fc1ffffffef00p-43}, {-0x1.0000000000000p+13, -0x1.fffffffffff00p-43, 0x1.000007c000000p-28, 0x1.fff8000000000p-84, -0x1.ffffffffff000p+12, -0x1.fc1ffffffef00p-43}, {-0x1.0000000000000p+13, -0x1.fffffffffff00p-43, -0x1.000007c000000p-28, -0x1.fff8000000000p-84, -0x1.0000000000800p+13, -0x1.01f0000000780p-42}, {0x1.0000000000400p-35, -0x1.fffc0003fffd0p-92, 0x1.0000000000000p+4, 0x1.fffffff800000p-52, 0x1.0000000002000p+4, 0x1.0000003bff000p-51}, {0x1.0000000000400p-35, -0x1.fffc0003fffd0p-92, -0x1.0000000000000p+4, -0x1.fffffff800000p-52, -0x1.fffffffffc000p+3, -0x1.ffffff7802000p-52}, {-0x1.0000000000400p-35, 0x1.fffc0003fffd0p-92, 0x1.0000000000000p+4, 0x1.fffffff800000p-52, 0x1.fffffffffc000p+3, 0x1.ffffff7802000p-52}, {-0x1.0000000000400p-35, 0x1.fffc0003fffd0p-92, -0x1.0000000000000p+4, -0x1.fffffff800000p-52, -0x1.0000000002000p+4, -0x1.0000003bff000p-51}, {0x1.0000000002000p-51, -0x1.ffff040000000p-122, 0x1.03fffff800000p-40, 0x1.fffffe0000000p-108, 0x1.041ffff800004p-40, 0x1.fff7fe03f0000p-108}, {0x1.0000000002000p-51, -0x1.ffff040000000p-122, -0x1.03fffff800000p-40, -0x1.fffffe0000000p-108, -0x1.03dffff7ffffcp-40, -0x1.0003fefe08000p-107}, {-0x1.0000000002000p-51, 0x1.ffff040000000p-122, 0x1.03fffff800000p-40, 0x1.fffffe0000000p-108, 0x1.03dffff7ffffcp-40, 0x1.0003fefe08000p-107}, {-0x1.0000000002000p-51, 0x1.ffff040000000p-122, -0x1.03fffff800000p-40, -0x1.fffffe0000000p-108, -0x1.041ffff800004p-40, -0x1.fff7fe03f0000p-108}, {0x1.0000008000000p-21, -0x1.ffffff8200000p-78, 0x1.000fff8000000p+9, 0x1.fffffe0000000p-53, 0x1.000fff8400000p+9, 0x1.03fffffa00000p-46}, {0x1.0000008000000p-21, -0x1.ffffff8200000p-78, -0x1.000fff8000000p+9, -0x1.fffffe0000000p-53, -0x1.000fff7c00000p+9, 0x1.f800000400000p-47}, {-0x1.0000008000000p-21, 0x1.ffffff8200000p-78, 0x1.000fff8000000p+9, 0x1.fffffe0000000p-53, 0x1.000fff7c00000p+9, -0x1.f800000400000p-47}, {-0x1.0000008000000p-21, 0x1.ffffff8200000p-78, -0x1.000fff8000000p+9, -0x1.fffffe0000000p-53, -0x1.000fff8400000p+9, -0x1.03fffffa00000p-46}, {0x1.0000000000000p-33, 0x1.0001f9e000000p-93, 0x1.0000000000040p+19, -0x1.fffffc0080000p-53, 0x1.0000000000041p+19, -0x1.fffffc0080000p-53}, {0x1.0000000000000p-33, 0x1.0001f9e000000p-93, -0x1.0000000000040p+19, 0x1.fffffc0080000p-53, -0x1.000000000003fp+19, 0x1.fffffc0080000p-53}, {-0x1.0000000000000p-33, -0x1.0001f9e000000p-93, 0x1.0000000000040p+19, -0x1.fffffc0080000p-53, 0x1.000000000003fp+19, -0x1.fffffc0080000p-53}, {-0x1.0000000000000p-33, -0x1.0001f9e000000p-93, -0x1.0000000000040p+19, 0x1.fffffc0080000p-53, -0x1.0000000000041p+19, 0x1.fffffc0080000p-53}, {0x1.0000ff0007e00p-13, 0x1.ffc001ff00000p-80, 0x1.0000010000000p-33, -0x1.ffc007ffffe20p-91, 0x1.00010f0007f00p-13, 0x1.ff8009fe00000p-80}, {0x1.0000ff0007e00p-13, 0x1.ffc001ff00000p-80, -0x1.0000010000000p-33, 0x1.ffc007ffffe20p-91, 0x1.0000ef0007d00p-13, 0x1.fffffa0000000p-80}, {-0x1.0000ff0007e00p-13, -0x1.ffc001ff00000p-80, 0x1.0000010000000p-33, -0x1.ffc007ffffe20p-91, -0x1.0000ef0007d00p-13, -0x1.fffffa0000000p-80}, {-0x1.0000ff0007e00p-13, -0x1.ffc001ff00000p-80, -0x1.0000010000000p-33, 0x1.ffc007ffffe20p-91, -0x1.00010f0007f00p-13, -0x1.ff8009fe00000p-80}, {0x1.07ffffff1fe00p-53, 0x1.fc00000000000p-150, 0x1.0040000000000p-23, -0x1.c000000400000p-84, 0x1.0040000420000p-23, -0x1.1808000200000p-83}, {0x1.07ffffff1fe00p-53, 0x1.fc00000000000p-150, -0x1.0040000000000p-23, 0x1.c000000400000p-84, -0x1.003ffffbe0000p-23, 0x1.4ff0000400000p-84}, {-0x1.07ffffff1fe00p-53, -0x1.fc00000000000p-150, 0x1.0040000000000p-23, -0x1.c000000400000p-84, 0x1.003ffffbe0000p-23, -0x1.4ff0000400000p-84}, {-0x1.07ffffff1fe00p-53, -0x1.fc00000000000p-150, -0x1.0040000000000p-23, 0x1.c000000400000p-84, -0x1.0040000420000p-23, 0x1.1808000200000p-83}, {0x1.0080000000000p+15, -0x1.0000000000000p-90, 0x1.00000001fffc0p-35, 0x1.fffff80f80000p-107, 0x1.0080000000004p+15, 0x1.fffbfe0000000p-67}, {0x1.0080000000000p+15, -0x1.0000000000000p-90, -0x1.00000001fffc0p-35, -0x1.fffff80f80000p-107, 0x1.007fffffffffcp+15, -0x1.fffc020000000p-67}, {-0x1.0080000000000p+15, 0x1.0000000000000p-90, 0x1.00000001fffc0p-35, 0x1.fffff80f80000p-107, -0x1.007fffffffffcp+15, 0x1.fffc020000000p-67}, {-0x1.0080000000000p+15, 0x1.0000000000000p-90, -0x1.00000001fffc0p-35, -0x1.fffff80f80000p-107, -0x1.0080000000004p+15, -0x1.fffbfe0000000p-67}, {0x1.000000003ff00p+2, 0x0.0000000000000p+0, 0x1.0000000000000p+46, 0x1.f83007ffffe00p-14, 0x1.0000000000100p+46, 0x1.f83047efffe00p-14}, {0x1.000000003ff00p+2, 0x0.0000000000000p+0, -0x1.0000000000000p+46, -0x1.f83007ffffe00p-14, -0x1.ffffffffffe00p+45, -0x1.f82fc80fffe00p-14}, {-0x1.000000003ff00p+2, 0x0.0000000000000p+0, 0x1.0000000000000p+46, 0x1.f83007ffffe00p-14, 0x1.ffffffffffe00p+45, 0x1.f82fc80fffe00p-14}, {-0x1.000000003ff00p+2, 0x0.0000000000000p+0, -0x1.0000000000000p+46, -0x1.f83007ffffe00p-14, -0x1.0000000000100p+46, -0x1.f83047efffe00p-14}, {0x1.00003fffffe00p+13, 0x1.fffffc0000380p-47, 0x1.0000010000000p-8, -0x1.ffffff8000008p-64, 0x1.000047ffffe80p+13, 0x1.fffefc0000780p-47}, {0x1.00003fffffe00p+13, 0x1.fffffc0000380p-47, -0x1.0000010000000p-8, 0x1.ffffff8000008p-64, 0x1.000037ffffd80p+13, 0x1.00007dfffffc0p-46}, {-0x1.00003fffffe00p+13, -0x1.fffffc0000380p-47, 0x1.0000010000000p-8, -0x1.ffffff8000008p-64, -0x1.000037ffffd80p+13, -0x1.00007dfffffc0p-46}, {-0x1.00003fffffe00p+13, -0x1.fffffc0000380p-47, -0x1.0000010000000p-8, 0x1.ffffff8000008p-64, -0x1.000047ffffe80p+13, -0x1.fffefc0000780p-47}, {0x1.0000000080000p+13, -0x1.fffffc0010000p-56, 0x1.3fffff8000000p-19, 0x1.fffff800fe000p-85, 0x1.00000001c0000p+13, -0x1.001fffffbf010p-44}, {0x1.0000000080000p+13, -0x1.fffffc0010000p-56, -0x1.3fffff8000000p-19, -0x1.fffff800fe000p-85, 0x1.fffffffe80000p+12, 0x1.ffc000007dfe0p-45}, {-0x1.0000000080000p+13, 0x1.fffffc0010000p-56, 0x1.3fffff8000000p-19, 0x1.fffff800fe000p-85, -0x1.fffffffe80000p+12, -0x1.ffc000007dfe0p-45}, {-0x1.0000000080000p+13, 0x1.fffffc0010000p-56, -0x1.3fffff8000000p-19, -0x1.fffff800fe000p-85, -0x1.00000001c0000p+13, 0x1.001fffffbf010p-44}, {0x1.0003f001fc3f0p-13, 0x1.fffffc0000000p-69, 0x1.0000000000000p+27, 0x1.fc1fffc0000fep-27, 0x1.0000000001001p+27, -0x1.07df81303f702p-27}, {0x1.0003f001fc3f0p-13, 0x1.fffffc0000000p-69, -0x1.0000000000000p+27, -0x1.fc1fffc0000fep-27, -0x1.fffffffffe001p+26, 0x1.ffc0fe9f80e04p-28}, {-0x1.0003f001fc3f0p-13, -0x1.fffffc0000000p-69, 0x1.0000000000000p+27, 0x1.fc1fffc0000fep-27, 0x1.fffffffffe001p+26, -0x1.ffc0fe9f80e04p-28}, {-0x1.0003f001fc3f0p-13, -0x1.fffffc0000000p-69, -0x1.0000000000000p+27, -0x1.fc1fffc0000fep-27, -0x1.0000000001001p+27, 0x1.07df81303f702p-27}, {0x1.0000000000000p+49, 0x1.fffffffffffc0p-10, 0x1.0000000000000p+12, 0x1.ffffffffffe00p-50, 0x1.0000000008000p+49, 0x1.0000000000fe0p-9}, {0x1.0000000000000p+49, 0x1.fffffffffffc0p-10, -0x1.0000000000000p+12, -0x1.ffffffffffe00p-50, 0x1.fffffffff0000p+48, 0x1.fffffffffdfc0p-10}, {-0x1.0000000000000p+49, -0x1.fffffffffffc0p-10, 0x1.0000000000000p+12, 0x1.ffffffffffe00p-50, -0x1.fffffffff0000p+48, -0x1.fffffffffdfc0p-10}, {-0x1.0000000000000p+49, -0x1.fffffffffffc0p-10, -0x1.0000000000000p+12, -0x1.ffffffffffe00p-50, -0x1.0000000008000p+49, -0x1.0000000000fe0p-9}, {0x1.0000000100000p-51, -0x1.0000000000000p-130, 0x1.0000004000000p+23, -0x1.0000000000000p-57, 0x1.0000004000000p+23, 0x1.f800000000000p-52}, {0x1.0000000100000p-51, -0x1.0000000000000p-130, -0x1.0000004000000p+23, 0x1.0000000000000p-57, -0x1.0000004000000p+23, 0x1.0400000000000p-51}, {-0x1.0000000100000p-51, 0x1.0000000000000p-130, 0x1.0000004000000p+23, -0x1.0000000000000p-57, 0x1.0000004000000p+23, -0x1.0400000000000p-51}, {-0x1.0000000100000p-51, 0x1.0000000000000p-130, -0x1.0000004000000p+23, 0x1.0000000000000p-57, -0x1.0000004000000p+23, -0x1.f800000000000p-52}, {0x1.0000010000000p-27, -0x1.ffffe00001000p-83, 0x1.000ffffff007fp-2, 0x1.ffffc00000000p-83, 0x1.0010007ff0087p-2, -0x1.0000000000000p-102}, {0x1.0000010000000p-27, -0x1.ffffe00001000p-83, -0x1.000ffffff007fp-2, -0x1.ffffc00000000p-83, -0x1.000fff7ff0077p-2, -0x1.ffffd00000000p-82}, {-0x1.0000010000000p-27, 0x1.ffffe00001000p-83, 0x1.000ffffff007fp-2, 0x1.ffffc00000000p-83, 0x1.000fff7ff0077p-2, 0x1.ffffd00000000p-82}, {-0x1.0000010000000p-27, 0x1.ffffe00001000p-83, -0x1.000ffffff007fp-2, -0x1.ffffc00000000p-83, -0x1.0010007ff0087p-2, 0x1.0000000000000p-102}, {0x1.1000fffffc000p+50, 0x1.fffffc003f000p-6, 0x1.0000000001000p+30, -0x1.0000000000000p-75, 0x1.10010ffffc000p+50, 0x1.07fffe001f800p-5}, {0x1.1000fffffc000p+50, 0x1.fffffc003f000p-6, -0x1.0000000001000p+30, 0x1.0000000000000p-75, 0x1.1000effffc000p+50, 0x1.effffc003f000p-6}, {-0x1.1000fffffc000p+50, -0x1.fffffc003f000p-6, 0x1.0000000001000p+30, -0x1.0000000000000p-75, -0x1.1000effffc000p+50, -0x1.effffc003f000p-6}, {-0x1.1000fffffc000p+50, -0x1.fffffc003f000p-6, -0x1.0000000001000p+30, 0x1.0000000000000p-75, -0x1.10010ffffc000p+50, -0x1.07fffe001f800p-5}, {0x1.00000fff80000p+32, 0x1.fffe000000000p-53, 0x1.0000001f00000p+41, 0x1.fffffff000000p-36, 0x1.00800026ffc00p+41, 0x1.00007ff800000p-35}, {0x1.00000fff80000p+32, 0x1.fffe000000000p-53, -0x1.0000001f00000p+41, -0x1.fffffff000000p-36, -0x1.ff00002e00800p+40, -0x1.fffefff000000p-36}, {-0x1.00000fff80000p+32, -0x1.fffe000000000p-53, 0x1.0000001f00000p+41, 0x1.fffffff000000p-36, 0x1.ff00002e00800p+40, 0x1.fffefff000000p-36}, {-0x1.00000fff80000p+32, -0x1.fffe000000000p-53, -0x1.0000001f00000p+41, -0x1.fffffff000000p-36, -0x1.00800026ffc00p+41, -0x1.00007ff800000p-35}, {0x1.3fdfffff02000p+34, -0x1.0000000000000p-44, 0x1.0000000000000p+31, 0x1.ffffffffffe00p-30, 0x1.5fdfffff02000p+34, 0x1.fffc000000000p-30}, {0x1.3fdfffff02000p+34, -0x1.0000000000000p-44, -0x1.0000000000000p+31, -0x1.ffffffffffe00p-30, 0x1.1fdfffff02000p+34, -0x1.0002000000000p-29}, {-0x1.3fdfffff02000p+34, 0x1.0000000000000p-44, 0x1.0000000000000p+31, 0x1.ffffffffffe00p-30, -0x1.1fdfffff02000p+34, 0x1.0002000000000p-29}, {-0x1.3fdfffff02000p+34, 0x1.0000000000000p-44, -0x1.0000000000000p+31, -0x1.ffffffffffe00p-30, -0x1.5fdfffff02000p+34, -0x1.fffc000000000p-30}, {0x1.0000000000008p+41, -0x1.e0ffffd002000p-25, 0x1.0000000000400p+36, 0x1.ffffffff03ffep-18, 0x1.0800000000028p+41, 0x1.fc3dffff63fc0p-18}, {0x1.0000000000008p+41, -0x1.e0ffffd002000p-25, -0x1.0000000000400p+36, -0x1.ffffffff03ffep-18, 0x1.effffffffffd0p+40, -0x1.01e0ffff52020p-17}, {-0x1.0000000000008p+41, 0x1.e0ffffd002000p-25, 0x1.0000000000400p+36, 0x1.ffffffff03ffep-18, -0x1.effffffffffd0p+40, 0x1.01e0ffff52020p-17}, {-0x1.0000000000008p+41, 0x1.e0ffffd002000p-25, -0x1.0000000000400p+36, -0x1.ffffffff03ffep-18, -0x1.0800000000028p+41, -0x1.fc3dffff63fc0p-18}, {0x1.000000fffe020p+17, -0x1.f800100000000p-56, 0x1.0001fff80ffc0p+20, 0x1.ff00000000000p-77, 0x1.200200180fbc4p+20, -0x1.f800000800000p-56}, {0x1.000000fffe020p+17, -0x1.f800100000000p-56, -0x1.0001fff80ffc0p+20, -0x1.ff00000000000p-77, -0x1.c003ffb020778p+19, -0x1.f8001ff800000p-56}, {-0x1.000000fffe020p+17, 0x1.f800100000000p-56, 0x1.0001fff80ffc0p+20, 0x1.ff00000000000p-77, 0x1.c003ffb020778p+19, 0x1.f8001ff800000p-56}, {-0x1.000000fffe020p+17, 0x1.f800100000000p-56, -0x1.0001fff80ffc0p+20, -0x1.ff00000000000p-77, -0x1.200200180fbc4p+20, 0x1.f800000800000p-56}, {0x1.4000000000000p+46, -0x1.0000000000000p-59, 0x1.0000000000010p-11, 0x1.e000000000000p-79, 0x1.4000000000000p+46, 0x1.0000000000000p-11}, {0x1.4000000000000p+46, -0x1.0000000000000p-59, -0x1.0000000000010p-11, -0x1.e000000000000p-79, 0x1.4000000000000p+46, -0x1.0000000000020p-11}, {-0x1.4000000000000p+46, 0x1.0000000000000p-59, 0x1.0000000000010p-11, 0x1.e000000000000p-79, -0x1.4000000000000p+46, 0x1.0000000000020p-11}, {-0x1.4000000000000p+46, 0x1.0000000000000p-59, -0x1.0000000000010p-11, -0x1.e000000000000p-79, -0x1.4000000000000p+46, -0x1.0000000000000p-11}, {0x1.2000000000000p+0, -0x1.fffffff01ff20p-57, 0x1.0000000000000p-33, 0x1.fff8003ff0000p-90, 0x1.2000000080000p+0, -0x1.ffffffef1ff60p-57}, {0x1.2000000000000p+0, -0x1.fffffff01ff20p-57, -0x1.0000000000000p-33, -0x1.fff8003ff0000p-90, 0x1.1fffffff80000p+0, -0x1.fffffff11fee0p-57}, {-0x1.2000000000000p+0, 0x1.fffffff01ff20p-57, 0x1.0000000000000p-33, 0x1.fff8003ff0000p-90, -0x1.1fffffff80000p+0, 0x1.fffffff11fee0p-57}, {-0x1.2000000000000p+0, 0x1.fffffff01ff20p-57, -0x1.0000000000000p-33, -0x1.fff8003ff0000p-90, -0x1.2000000080000p+0, 0x1.ffffffef1ff60p-57}, {0x1.2000000000000p+14, -0x1.fc08000000000p-78, 0x1.0000000038004p+6, -0x1.fffffc4000000p-63, 0x1.2100000000380p+14, 0x1.ffff7fff02ec0p-45}, {0x1.2000000000000p+14, -0x1.fc08000000000p-78, -0x1.0000000038004p+6, 0x1.fffffc4000000p-63, 0x1.1effffffffc80p+14, -0x1.ffff8000fef40p-45}, {-0x1.2000000000000p+14, 0x1.fc08000000000p-78, 0x1.0000000038004p+6, -0x1.fffffc4000000p-63, -0x1.1effffffffc80p+14, 0x1.ffff8000fef40p-45}, {-0x1.2000000000000p+14, 0x1.fc08000000000p-78, -0x1.0000000038004p+6, 0x1.fffffc4000000p-63, -0x1.2100000000380p+14, -0x1.ffff7fff02ec0p-45}, {0x1.0000000000200p+30, 0x0.0000000000000p+0, 0x1.00001ffff0000p+10, 0x1.ffff80001f000p-47, 0x1.0000100002200p+30, -0x1.ffffe00008000p-27}, {0x1.0000000000200p+30, 0x0.0000000000000p+0, -0x1.00001ffff0000p+10, -0x1.ffff80001f000p-47, 0x1.ffffdffffc400p+29, 0x1.ffffe00008000p-27}, {-0x1.0000000000200p+30, 0x0.0000000000000p+0, 0x1.00001ffff0000p+10, 0x1.ffff80001f000p-47, -0x1.ffffdffffc400p+29, -0x1.ffffe00008000p-27}, {-0x1.0000000000200p+30, 0x0.0000000000000p+0, -0x1.00001ffff0000p+10, -0x1.ffff80001f000p-47, -0x1.0000100002200p+30, 0x1.ffffe00008000p-27}, {0x1.0000100000000p-17, -0x1.0000000000000p-122, 0x1.0038000800000p+15, -0x1.fffffe0000080p-45, 0x1.0038000900001p+15, -0x1.fffffe0000080p-45}, {0x1.0000100000000p-17, -0x1.0000000000000p-122, -0x1.0038000800000p+15, 0x1.fffffe0000080p-45, -0x1.00380006fffffp+15, 0x1.fffffe0000080p-45}, {-0x1.0000100000000p-17, 0x1.0000000000000p-122, 0x1.0038000800000p+15, -0x1.fffffe0000080p-45, 0x1.00380006fffffp+15, -0x1.fffffe0000080p-45}, {-0x1.0000100000000p-17, 0x1.0000000000000p-122, -0x1.0038000800000p+15, 0x1.fffffe0000080p-45, -0x1.0038000900001p+15, 0x1.fffffe0000080p-45}, {0x1.0000000000004p-11, -0x1.ffffe00400000p-84, 0x1.0000000000000p-12, 0x1.ffffffffffff8p-68, 0x1.8000000000004p-11, 0x1.fffe00001ffc0p-68}, {0x1.0000000000004p-11, -0x1.ffffe00400000p-84, -0x1.0000000000000p-12, -0x1.ffffffffffff8p-68, 0x1.0000000000008p-12, -0x1.0000fffff001cp-67}, {-0x1.0000000000004p-11, 0x1.ffffe00400000p-84, 0x1.0000000000000p-12, 0x1.ffffffffffff8p-68, -0x1.0000000000008p-12, 0x1.0000fffff001cp-67}, {-0x1.0000000000004p-11, 0x1.ffffe00400000p-84, -0x1.0000000000000p-12, -0x1.ffffffffffff8p-68, -0x1.8000000000004p-11, -0x1.fffe00001ffc0p-68}, {0x1.0000000000100p-33, -0x1.ffffe7e400000p-103, 0x1.1ffe000008000p-33, -0x1.fffc000004000p-100, 0x1.0fff000004080p-32, -0x1.1ffdfe7e40000p-99}, {0x1.0000000000100p-33, -0x1.ffffe7e400000p-103, -0x1.1ffe000008000p-33, 0x1.fffc000004000p-100, -0x1.ffe000007f000p-37, 0x1.bffc030384000p-100}, {-0x1.0000000000100p-33, 0x1.ffffe7e400000p-103, 0x1.1ffe000008000p-33, -0x1.fffc000004000p-100, 0x1.ffe000007f000p-37, -0x1.bffc030384000p-100}, {-0x1.0000000000100p-33, 0x1.ffffe7e400000p-103, -0x1.1ffe000008000p-33, 0x1.fffc000004000p-100, -0x1.0fff000004080p-32, 0x1.1ffdfe7e40000p-99}, {0x1.0000000000004p-52, -0x1.0000000000000p-157, 0x1.00000007ffffep-10, 0x1.ffffe000f0000p-71, 0x1.00000008003fep-10, 0x1.ffffe002f0000p-71}, {0x1.0000000000004p-52, -0x1.0000000000000p-157, -0x1.00000007ffffep-10, -0x1.ffffe000f0000p-71, -0x1.00000007ffbfep-10, -0x1.ffffdffef0000p-71}, {-0x1.0000000000004p-52, 0x1.0000000000000p-157, 0x1.00000007ffffep-10, 0x1.ffffe000f0000p-71, 0x1.00000007ffbfep-10, 0x1.ffffdffef0000p-71}, {-0x1.0000000000004p-52, 0x1.0000000000000p-157, -0x1.00000007ffffep-10, -0x1.ffffe000f0000p-71, -0x1.00000008003fep-10, -0x1.ffffe002f0000p-71}, {0x1.0000000000000p+3, 0x1.fffffff000000p-58, 0x1.0001fffc00001p-42, -0x1.0000000000000p-121, 0x1.0000000000080p+3, 0x1.fffdfff808000p-57}, {0x1.0000000000000p+3, 0x1.fffffff000000p-58, -0x1.0001fffc00001p-42, 0x1.0000000000000p-121, 0x1.fffffffffff00p+2, 0x1.fff7f80000000p-73}, {-0x1.0000000000000p+3, -0x1.fffffff000000p-58, 0x1.0001fffc00001p-42, -0x1.0000000000000p-121, -0x1.fffffffffff00p+2, -0x1.fff7f80000000p-73}, {-0x1.0000000000000p+3, -0x1.fffffff000000p-58, -0x1.0001fffc00001p-42, 0x1.0000000000000p-121, -0x1.0000000000080p+3, -0x1.fffdfff808000p-57}, {0x1.00007fdfffff0p+50, 0x1.fff000f803fe0p-8, 0x1.0080000000000p-8, -0x1.0000000000000p-100, 0x1.00007fdfffff0p+50, 0x1.8038007c01ff0p-7}, {0x1.00007fdfffff0p+50, 0x1.fff000f803fe0p-8, -0x1.0080000000000p-8, 0x1.0000000000000p-100, 0x1.00007fdfffff0p+50, 0x1.fee001f007fc0p-9}, {-0x1.00007fdfffff0p+50, -0x1.fff000f803fe0p-8, 0x1.0080000000000p-8, -0x1.0000000000000p-100, -0x1.00007fdfffff0p+50, -0x1.fee001f007fc0p-9}, {-0x1.00007fdfffff0p+50, -0x1.fff000f803fe0p-8, -0x1.0080000000000p-8, 0x1.0000000000000p-100, -0x1.00007fdfffff0p+50, -0x1.8038007c01ff0p-7}, {0x1.0000000000080p+4, 0x0.0000000000000p+0, 0x1.0000080000000p+20, -0x1.0000000000000p-65, 0x1.0001080000000p+20, 0x1.fffffe0000000p-42}, {0x1.0000000000080p+4, 0x0.0000000000000p+0, -0x1.0000080000000p+20, 0x1.0000000000000p-65, -0x1.fffe100000000p+19, 0x1.0000010000000p-41}, {-0x1.0000000000080p+4, 0x0.0000000000000p+0, 0x1.0000080000000p+20, -0x1.0000000000000p-65, 0x1.fffe100000000p+19, -0x1.0000010000000p-41}, {-0x1.0000000000080p+4, 0x0.0000000000000p+0, -0x1.0000080000000p+20, 0x1.0000000000000p-65, -0x1.0001080000000p+20, -0x1.fffffe0000000p-42}, {0x1.0400000000000p+20, -0x1.0000000000000p-85, 0x1.0000000000400p+5, -0x1.fffff00008000p-51, 0x1.0402000000000p+20, 0x1.fff000007ffe0p-38}, {0x1.0400000000000p+20, -0x1.0000000000000p-85, -0x1.0000000000400p+5, 0x1.fffff00008000p-51, 0x1.03fe000000000p+20, -0x1.fff0000080020p-38}, {-0x1.0400000000000p+20, 0x1.0000000000000p-85, 0x1.0000000000400p+5, -0x1.fffff00008000p-51, -0x1.03fe000000000p+20, 0x1.fff0000080020p-38}, {-0x1.0400000000000p+20, 0x1.0000000000000p-85, -0x1.0000000000400p+5, 0x1.fffff00008000p-51, -0x1.0402000000000p+20, -0x1.fff000007ffe0p-38}, {0x1.0000000000001p+43, -0x1.fc0000c004000p-22, 0x1.0000000000200p+29, -0x1.ffe0000200000p-39, 0x1.0004000000001p+43, 0x1.fc07fdfe9ff80p-15}, {0x1.0000000000001p+43, -0x1.fc0000c004000p-22, -0x1.0000000000200p+29, 0x1.ffe0000200000p-39, 0x1.fff8000000002p+42, -0x1.01fbff00d0040p-14}, {-0x1.0000000000001p+43, 0x1.fc0000c004000p-22, 0x1.0000000000200p+29, -0x1.ffe0000200000p-39, -0x1.fff8000000002p+42, 0x1.01fbff00d0040p-14}, {-0x1.0000000000001p+43, 0x1.fc0000c004000p-22, -0x1.0000000000200p+29, 0x1.ffe0000200000p-39, -0x1.0004000000001p+43, -0x1.fc07fdfe9ff80p-15}, {0x1.00000c0000004p+1, -0x1.ff80000800000p-67, 0x1.18003ffff8000p+4, 0x1.ffffff8000000p-62, 0x1.3800417ff8001p+4, -0x1.ffe0ffc008040p-50}, {0x1.00000c0000004p+1, -0x1.ff80000800000p-67, -0x1.18003ffff8000p+4, -0x1.ffffff8000000p-62, -0x1.f0007cffeffffp+3, -0x1.07fdffc020000p-61}, {-0x1.00000c0000004p+1, 0x1.ff80000800000p-67, 0x1.18003ffff8000p+4, 0x1.ffffff8000000p-62, 0x1.f0007cffeffffp+3, 0x1.07fdffc020000p-61}, {-0x1.00000c0000004p+1, 0x1.ff80000800000p-67, -0x1.18003ffff8000p+4, -0x1.ffffff8000000p-62, -0x1.3800417ff8001p+4, 0x1.ffe0ffc008040p-50}, {0x1.1ffff80000040p+31, -0x1.0000000000000p-59, 0x1.000000000fe00p+44, 0x1.ffff7e0003ff8p-12, 0x1.0008ffffcfe00p+44, 0x1.0fffbf0001fecp-11}, {0x1.1ffff80000040p+31, -0x1.0000000000000p-59, -0x1.000000000fe00p+44, -0x1.ffff7e0003ff8p-12, -0x1.ffee00009fc00p+43, -0x1.dfff7e0004018p-12}, {-0x1.1ffff80000040p+31, 0x1.0000000000000p-59, 0x1.000000000fe00p+44, 0x1.ffff7e0003ff8p-12, 0x1.ffee00009fc00p+43, 0x1.dfff7e0004018p-12}, {-0x1.1ffff80000040p+31, 0x1.0000000000000p-59, -0x1.000000000fe00p+44, -0x1.ffff7e0003ff8p-12, -0x1.0008ffffcfe00p+44, -0x1.0fffbf0001fecp-11}, {0x1.3fc0000040000p-13, -0x1.fffffff802000p-69, 0x1.fffffffffff00p+30, 0x0.0000000000000p+0, 0x1.00000000000c0p+31, -0x1.fffffe0000100p-24}, {0x1.3fc0000040000p-13, -0x1.fffffff802000p-69, -0x1.fffffffffff00p+30, 0x0.0000000000000p+0, -0x1.ffffffffffc80p+30, -0x1.fffffe0000100p-24}, {-0x1.3fc0000040000p-13, 0x1.fffffff802000p-69, 0x1.fffffffffff00p+30, 0x0.0000000000000p+0, 0x1.ffffffffffc80p+30, 0x1.fffffe0000100p-24}, {-0x1.3fc0000040000p-13, 0x1.fffffff802000p-69, -0x1.fffffffffff00p+30, 0x0.0000000000000p+0, -0x1.00000000000c0p+31, 0x1.fffffe0000100p-24}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, 0x1.0000000000200p-15, -0x1.0000000000000p-120, 0x1.00040001fffffp-1, 0x1.000400007e000p-58}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, -0x1.0000000000200p-15, 0x1.0000000000000p-120, 0x1.fff80003ffffep-2, -0x1.fff7ffff04000p-59}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, 0x1.0000000000200p-15, -0x1.0000000000000p-120, -0x1.fff80003ffffep-2, 0x1.fff7ffff04000p-59}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, -0x1.0000000000200p-15, 0x1.0000000000000p-120, -0x1.00040001fffffp-1, -0x1.000400007e000p-58}, {0x1.0000000010000p+26, -0x1.0000000000000p-51, 0x1.1fff010000000p-53, 0x1.ff8c0000007fep-107, 0x1.0000000010000p+26, -0x1.70007f8000000p-52}, {0x1.0000000010000p+26, -0x1.0000000000000p-51, -0x1.1fff010000000p-53, -0x1.ff8c0000007fep-107, 0x1.0000000010000p+26, -0x1.47ffc04000000p-51}, {-0x1.0000000010000p+26, 0x1.0000000000000p-51, 0x1.1fff010000000p-53, 0x1.ff8c0000007fep-107, -0x1.0000000010000p+26, 0x1.47ffc04000000p-51}, {-0x1.0000000010000p+26, 0x1.0000000000000p-51, -0x1.1fff010000000p-53, -0x1.ff8c0000007fep-107, -0x1.0000000010000p+26, 0x1.70007f8000000p-52}, {0x1.0000000000002p-44, -0x1.0000000000000p-131, 0x1.0000000000200p+33, -0x1.0000000000000p-52, 0x1.0000000000200p+33, 0x1.fe00000000000p-45}, {0x1.0000000000002p-44, -0x1.0000000000000p-131, -0x1.0000000000200p+33, 0x1.0000000000000p-52, -0x1.0000000000200p+33, 0x1.0100000000000p-44}, {-0x1.0000000000002p-44, 0x1.0000000000000p-131, 0x1.0000000000200p+33, -0x1.0000000000000p-52, 0x1.0000000000200p+33, -0x1.0100000000000p-44}, {-0x1.0000000000002p-44, 0x1.0000000000000p-131, -0x1.0000000000200p+33, 0x1.0000000000000p-52, -0x1.0000000000200p+33, -0x1.fe00000000000p-45}, {0x1.0000000000002p+32, -0x1.ffff800008000p-35, 0x1.000000003fffep-25, 0x1.f81fc007c0000p-96, 0x1.0000000000002p+32, 0x1.ff0000407ffc0p-26}, {0x1.0000000000002p+32, -0x1.ffff800008000p-35, -0x1.000000003fffep-25, -0x1.f81fc007c0000p-96, 0x1.0000000000002p+32, -0x1.007fffe040020p-25}, {-0x1.0000000000002p+32, 0x1.ffff800008000p-35, 0x1.000000003fffep-25, 0x1.f81fc007c0000p-96, -0x1.0000000000002p+32, 0x1.007fffe040020p-25}, {-0x1.0000000000002p+32, 0x1.ffff800008000p-35, -0x1.000000003fffep-25, -0x1.f81fc007c0000p-96, -0x1.0000000000002p+32, -0x1.ff0000407ffc0p-26}, {0x1.7ffffffff0000p+18, 0x1.ffff07fffc000p-46, 0x1.000000000ffe0p-32, 0x1.ff0000003c000p-95, 0x1.7ffffffff0004p+18, 0x1.ffff0bff7c000p-46}, {0x1.7ffffffff0000p+18, 0x1.ffff07fffc000p-46, -0x1.000000000ffe0p-32, -0x1.ff0000003c000p-95, 0x1.7fffffffefffcp+18, 0x1.ffff04007c000p-46}, {-0x1.7ffffffff0000p+18, -0x1.ffff07fffc000p-46, 0x1.000000000ffe0p-32, 0x1.ff0000003c000p-95, -0x1.7fffffffefffcp+18, -0x1.ffff04007c000p-46}, {-0x1.7ffffffff0000p+18, -0x1.ffff07fffc000p-46, -0x1.000000000ffe0p-32, -0x1.ff0000003c000p-95, -0x1.7ffffffff0004p+18, -0x1.ffff0bff7c000p-46}, {0x1.00007fff00080p-52, -0x1.ffffff0001000p-117, 0x1.00000000007c0p+41, 0x1.ffffff8000000p-26, 0x1.00000000007c0p+41, 0x1.ffffffc000000p-26}, {0x1.00007fff00080p-52, -0x1.ffffff0001000p-117, -0x1.00000000007c0p+41, -0x1.ffffff8000000p-26, -0x1.00000000007c0p+41, -0x1.ffffff4000000p-26}, {-0x1.00007fff00080p-52, 0x1.ffffff0001000p-117, 0x1.00000000007c0p+41, 0x1.ffffff8000000p-26, 0x1.00000000007c0p+41, 0x1.ffffff4000000p-26}, {-0x1.00007fff00080p-52, 0x1.ffffff0001000p-117, -0x1.00000000007c0p+41, -0x1.ffffff8000000p-26, -0x1.00000000007c0p+41, -0x1.ffffffc000000p-26}, {0x1.1fff81ff00000p+13, 0x1.e007ffff00000p-44, 0x1.1ffffffff8000p-5, 0x1.fe001ffffffe0p-61, 0x1.1fffc9ff00000p+13, -0x1.0ffb808078000p-43}, {0x1.1fff81ff00000p+13, 0x1.e007ffff00000p-44, -0x1.1ffffffff8000p-5, -0x1.fe001ffffffe0p-61, 0x1.1fff39ff00000p+13, 0x1.7801c03fbc000p-42}, {-0x1.1fff81ff00000p+13, -0x1.e007ffff00000p-44, 0x1.1ffffffff8000p-5, 0x1.fe001ffffffe0p-61, -0x1.1fff39ff00000p+13, -0x1.7801c03fbc000p-42}, {-0x1.1fff81ff00000p+13, -0x1.e007ffff00000p-44, -0x1.1ffffffff8000p-5, -0x1.fe001ffffffe0p-61, -0x1.1fffc9ff00000p+13, 0x1.0ffb808078000p-43}, {0x1.0000000000000p+15, 0x1.fffc03fe00700p-46, 0x1.0000000000001p+24, -0x1.fff8060000f34p-31, 0x1.0080000000001p+24, -0x1.fff40607f8f74p-31}, {0x1.0000000000000p+15, 0x1.fffc03fe00700p-46, -0x1.0000000000001p+24, 0x1.fff8060000f34p-31, -0x1.ff00000000002p+23, 0x1.fffc05f808ef4p-31}, {-0x1.0000000000000p+15, -0x1.fffc03fe00700p-46, 0x1.0000000000001p+24, -0x1.fff8060000f34p-31, 0x1.ff00000000002p+23, -0x1.fffc05f808ef4p-31}, {-0x1.0000000000000p+15, -0x1.fffc03fe00700p-46, -0x1.0000000000001p+24, 0x1.fff8060000f34p-31, -0x1.0080000000001p+24, 0x1.fff40607f8f74p-31}, {0x1.001ffffc00080p+19, -0x1.fe00000200000p-42, 0x1.0000000001000p-24, -0x1.fe3ffffff0080p-84, 0x1.001ffffc00280p+19, -0x1.fdfffc0200800p-42}, {0x1.001ffffc00080p+19, -0x1.fe00000200000p-42, -0x1.0000000001000p-24, 0x1.fe3ffffff0080p-84, 0x1.001ffffbffe80p+19, -0x1.fe000401ff800p-42}, {-0x1.001ffffc00080p+19, 0x1.fe00000200000p-42, 0x1.0000000001000p-24, -0x1.fe3ffffff0080p-84, -0x1.001ffffbffe80p+19, 0x1.fe000401ff800p-42}, {-0x1.001ffffc00080p+19, 0x1.fe00000200000p-42, -0x1.0000000001000p-24, 0x1.fe3ffffff0080p-84, -0x1.001ffffc00280p+19, 0x1.fdfffc0200800p-42}, {0x1.00001fffff800p+37, 0x1.ffffff801ffc0p-22, 0x1.0000000002000p+12, -0x1.0000000000000p-93, 0x1.0000207fff800p+37, 0x1.03ffffc00ffe0p-21}, {0x1.00001fffff800p+37, 0x1.ffffff801ffc0p-22, -0x1.0000000002000p+12, 0x1.0000000000000p-93, 0x1.00001f7fff800p+37, 0x1.f7ffff801ffc0p-22}, {-0x1.00001fffff800p+37, -0x1.ffffff801ffc0p-22, 0x1.0000000002000p+12, -0x1.0000000000000p-93, -0x1.00001f7fff800p+37, -0x1.f7ffff801ffc0p-22}, {-0x1.00001fffff800p+37, -0x1.ffffff801ffc0p-22, -0x1.0000000002000p+12, 0x1.0000000000000p-93, -0x1.0000207fff800p+37, -0x1.03ffffc00ffe0p-21}, {0x1.0000000000000p-40, 0x1.ffff83ffbfff0p-96, 0x1.0000000000000p-34, 0x1.ffffffffe0000p-90, 0x1.0400000000000p-34, 0x1.03ffff07ef800p-89}, {0x1.0000000000000p-40, 0x1.ffff83ffbfff0p-96, -0x1.0000000000000p-34, -0x1.ffffffffe0000p-90, -0x1.f800000000000p-35, -0x1.f80001efe1000p-90}, {-0x1.0000000000000p-40, -0x1.ffff83ffbfff0p-96, 0x1.0000000000000p-34, 0x1.ffffffffe0000p-90, 0x1.f800000000000p-35, 0x1.f80001efe1000p-90}, {-0x1.0000000000000p-40, -0x1.ffff83ffbfff0p-96, -0x1.0000000000000p-34, -0x1.ffffffffe0000p-90, -0x1.0400000000000p-34, -0x1.03ffff07ef800p-89}, {0x1.0000000000000p+39, 0x1.fffe7ff3dff00p-22, 0x1.000007f830000p+13, 0x1.fff0000ffe100p-48, 0x1.0000004000020p+39, -0x1.e4000bfc61208p-17}, {0x1.0000000000000p+39, 0x1.fffe7ff3dff00p-22, -0x1.000007f830000p+13, -0x1.fff0000ffe100p-48, 0x1.ffffff7ffffc0p+38, 0x1.01fff9fdcf8fcp-16}, {-0x1.0000000000000p+39, -0x1.fffe7ff3dff00p-22, 0x1.000007f830000p+13, 0x1.fff0000ffe100p-48, -0x1.ffffff7ffffc0p+38, -0x1.01fff9fdcf8fcp-16}, {-0x1.0000000000000p+39, -0x1.fffe7ff3dff00p-22, -0x1.000007f830000p+13, -0x1.fff0000ffe100p-48, -0x1.0000004000020p+39, 0x1.e4000bfc61208p-17}, {0x1.00000ffffe000p+18, 0x1.fffffffffc000p-49, 0x1.0000000000002p-46, -0x1.fffffe01f8004p-101, 0x1.00000ffffe000p+18, 0x1.3fffffffff800p-46}, {0x1.00000ffffe000p+18, 0x1.fffffffffc000p-49, -0x1.0000000000002p-46, 0x1.fffffe01f8004p-101, 0x1.00000ffffe000p+18, -0x1.8000000001000p-47}, {-0x1.00000ffffe000p+18, -0x1.fffffffffc000p-49, 0x1.0000000000002p-46, -0x1.fffffe01f8004p-101, -0x1.00000ffffe000p+18, 0x1.8000000001000p-47}, {-0x1.00000ffffe000p+18, -0x1.fffffffffc000p-49, -0x1.0000000000002p-46, 0x1.fffffe01f8004p-101, -0x1.00000ffffe000p+18, -0x1.3fffffffff800p-46}, {0x1.0000000000060p+41, 0x1.fffe3fff00000p-22, 0x1.0000000002000p+4, -0x1.ffe0002000000p-53, 0x1.0000000008060p+41, 0x1.00031ffd80200p-21}, {0x1.0000000000060p+41, 0x1.fffe3fff00000p-22, -0x1.0000000002000p+4, 0x1.ffe0002000000p-53, 0x1.fffffffff00c0p+40, 0x1.fff64002ffc00p-22}, {-0x1.0000000000060p+41, -0x1.fffe3fff00000p-22, 0x1.0000000002000p+4, -0x1.ffe0002000000p-53, -0x1.fffffffff00c0p+40, -0x1.fff64002ffc00p-22}, {-0x1.0000000000060p+41, -0x1.fffe3fff00000p-22, -0x1.0000000002000p+4, 0x1.ffe0002000000p-53, -0x1.0000000008060p+41, -0x1.00031ffd80200p-21}, {0x1.0003ffffffff8p-50, 0x1.ffffe07e00000p-124, 0x1.07ff000008000p+19, -0x1.e000020000000p-42, 0x1.07ff000008000p+19, -0x1.defffe0000000p-42}, {0x1.0003ffffffff8p-50, 0x1.ffffe07e00000p-124, -0x1.07ff000008000p+19, 0x1.e000020000000p-42, -0x1.07ff000008000p+19, 0x1.e100060000000p-42}, {-0x1.0003ffffffff8p-50, -0x1.ffffe07e00000p-124, 0x1.07ff000008000p+19, -0x1.e000020000000p-42, 0x1.07ff000008000p+19, -0x1.e100060000000p-42}, {-0x1.0003ffffffff8p-50, -0x1.ffffe07e00000p-124, -0x1.07ff000008000p+19, 0x1.e000020000000p-42, -0x1.07ff000008000p+19, 0x1.defffe0000000p-42}, // Some test cases drawn only from the [0.5,1] binade: {0x1.0000000000002p-1, -0x1.ffc0ffff90000p-65, 0x1.0003ffffffffcp-1, 0x1.ffffc00000000p-88, 0x1.0001fffffffffp+0, -0x1.ffc0fbff90000p-65}, {0x1.0000000000002p-1, -0x1.ffc0ffff90000p-65, -0x1.0003ffffffffcp-1, -0x1.ffffc00000000p-88, -0x1.ffffffffd0010p-16, 0x1.f7e0038400000p-76}, {-0x1.0000000000002p-1, 0x1.ffc0ffff90000p-65, 0x1.0003ffffffffcp-1, 0x1.ffffc00000000p-88, 0x1.ffffffffd0010p-16, -0x1.f7e0038400000p-76}, {-0x1.0000000000002p-1, 0x1.ffc0ffff90000p-65, -0x1.0003ffffffffcp-1, -0x1.ffffc00000000p-88, -0x1.0001fffffffffp+0, 0x1.ffc0fbff90000p-65}, {0x1.0000100000000p-1, -0x1.0000000000000p-63, 0x1.0000000004000p-1, -0x1.ffffe00fc0200p-57, 0x1.0000080002000p+0, -0x1.01fff007e0100p-56}, {0x1.0000100000000p-1, -0x1.0000000000000p-63, -0x1.0000000004000p-1, 0x1.ffffe00fc0200p-57, 0x1.ffff80003f800p-22, -0x1.ff03fe0000000p-77}, {-0x1.0000100000000p-1, 0x1.0000000000000p-63, 0x1.0000000004000p-1, -0x1.ffffe00fc0200p-57, -0x1.ffff80003f800p-22, 0x1.ff03fe0000000p-77}, {-0x1.0000100000000p-1, 0x1.0000000000000p-63, -0x1.0000000004000p-1, 0x1.ffffe00fc0200p-57, -0x1.0000080002000p+0, 0x1.01fff007e0100p-56}, {0x1.0000000800000p-1, -0x1.0000000000000p-73, 0x1.000003fffc002p-1, -0x1.0000000000000p-106, 0x1.00000203fe001p+0, -0x1.0000000000000p-73}, {0x1.0000000800000p-1, -0x1.0000000000000p-73, -0x1.000003fffc002p-1, 0x1.0000000000000p-106, -0x1.fbfe001000008p-24, 0x1.0000000000000p-106}, {-0x1.0000000800000p-1, 0x1.0000000000000p-73, 0x1.000003fffc002p-1, -0x1.0000000000000p-106, 0x1.fbfe001000008p-24, -0x1.0000000000000p-106}, {-0x1.0000000800000p-1, 0x1.0000000000000p-73, -0x1.000003fffc002p-1, 0x1.0000000000000p-106, -0x1.00000203fe001p+0, 0x1.0000000000000p-73}, {0x1.0000000000000p-1, 0x1.ffc001ffffe00p-56, 0x1.000003fff8000p-1, 0x1.fffc000fc0000p-72, 0x1.000001fffc000p+0, 0x1.ffc201fbfff00p-56}, {0x1.0000000000000p-1, 0x1.ffc001ffffe00p-56, -0x1.000003fff8000p-1, -0x1.fffc000fc0000p-72, -0x1.fffbfffe00420p-24, 0x1.01ffe82000000p-79}, {-0x1.0000000000000p-1, -0x1.ffc001ffffe00p-56, 0x1.000003fff8000p-1, 0x1.fffc000fc0000p-72, 0x1.fffbfffe00420p-24, -0x1.01ffe82000000p-79}, {-0x1.0000000000000p-1, -0x1.ffc001ffffe00p-56, -0x1.000003fff8000p-1, -0x1.fffc000fc0000p-72, -0x1.000001fffc000p+0, -0x1.ffc201fbfff00p-56}, {0x1.0000000000003p-1, 0x1.fc00001fff800p-65, 0x1.0000000000020p-1, -0x1.fc01ffe002000p-65, 0x1.0000000000011p+0, 0x1.ffffffc007ffcp-54}, {0x1.0000000000003p-1, 0x1.fc00001fff800p-65, -0x1.0000000000020p-1, 0x1.fc01ffe002000p-65, -0x1.cffc07fe00000p-49, 0x1.8000000000000p-105}, {-0x1.0000000000003p-1, -0x1.fc00001fff800p-65, 0x1.0000000000020p-1, -0x1.fc01ffe002000p-65, 0x1.cffc07fe00000p-49, -0x1.8000000000000p-105}, {-0x1.0000000000003p-1, -0x1.fc00001fff800p-65, -0x1.0000000000020p-1, 0x1.fc01ffe002000p-65, -0x1.0000000000011p+0, -0x1.ffffffc007ffcp-54}, {0x1.0000000000000p-1, 0x1.fffff00001ffep-55, 0x1.0000000000000p-1, 0x1.ff00000ffff80p-61, 0x1.0000000000000p+0, 0x1.03fdf80020ffep-54}, {0x1.0000000000000p-1, 0x1.fffff00001ffep-55, -0x1.0000000000000p-1, -0x1.ff00000ffff80p-61, 0x1.f803efffc2000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffff00001ffep-55, 0x1.0000000000000p-1, 0x1.ff00000ffff80p-61, -0x1.f803efffc2000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffff00001ffep-55, -0x1.0000000000000p-1, -0x1.ff00000ffff80p-61, -0x1.0000000000000p+0, -0x1.03fdf80020ffep-54}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, 0x1.0000200000000p-1, -0x1.ffc0000080000p-73, 0x1.0000100000000p+0, 0x1.ff001fffff800p-64}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, -0x1.0000200000000p-1, 0x1.ffc0000080000p-73, -0x1.ffffffffffbfep-21, -0x1.0000000000000p-83}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, 0x1.0000200000000p-1, -0x1.ffc0000080000p-73, 0x1.ffffffffffbfep-21, 0x1.0000000000000p-83}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, -0x1.0000200000000p-1, 0x1.ffc0000080000p-73, -0x1.0000100000000p+0, -0x1.ff001fffff800p-64}, {0x1.0000000000800p-1, -0x1.fffc000000010p-58, 0x1.0000000000008p-1, -0x1.ffe03fffff010p-58, 0x1.0000000000404p+0, -0x1.ffee1fffff810p-57}, {0x1.0000000000800p-1, -0x1.fffc000000010p-58, -0x1.0000000000008p-1, 0x1.ffe03fffff010p-58, 0x1.fdffffc880000p-43, -0x1.0000000000000p-98}, {-0x1.0000000000800p-1, 0x1.fffc000000010p-58, 0x1.0000000000008p-1, -0x1.ffe03fffff010p-58, -0x1.fdffffc880000p-43, 0x1.0000000000000p-98}, {-0x1.0000000000800p-1, 0x1.fffc000000010p-58, -0x1.0000000000008p-1, 0x1.ffe03fffff010p-58, -0x1.0000000000404p+0, 0x1.ffee1fffff810p-57}, {0x1.0000000000000p-1, 0x1.fffef0ffff000p-64, 0x1.0000100000000p-1, -0x1.fff8000000800p-65, 0x1.0000080000000p+0, 0x1.0002f0ffff000p-64}, {0x1.0000000000000p-1, 0x1.fffef0ffff000p-64, -0x1.0000100000000p-1, 0x1.fff8000000800p-65, -0x1.ffffffffff400p-22, -0x1.43c0003000000p-78}, {-0x1.0000000000000p-1, -0x1.fffef0ffff000p-64, 0x1.0000100000000p-1, -0x1.fff8000000800p-65, 0x1.ffffffffff400p-22, 0x1.43c0003000000p-78}, {-0x1.0000000000000p-1, -0x1.fffef0ffff000p-64, -0x1.0000100000000p-1, 0x1.fff8000000800p-65, -0x1.0000080000000p+0, -0x1.0002f0ffff000p-64}, {0x1.07c00007ffff0p-1, 0x1.fffc00f800000p-77, 0x1.0000007ffffe0p-1, 0x1.f000000000000p-72, 0x1.03e00043fffe8p+0, 0x1.ffffe00800000p-72}, {0x1.07c00007ffff0p-1, 0x1.fffc00f800000p-77, -0x1.0000007ffffe0p-1, -0x1.f000000000000p-72, 0x1.efffe20000400p-7, -0x1.e0001ff840000p-72}, {-0x1.07c00007ffff0p-1, -0x1.fffc00f800000p-77, 0x1.0000007ffffe0p-1, 0x1.f000000000000p-72, -0x1.efffe20000400p-7, 0x1.e0001ff840000p-72}, {-0x1.07c00007ffff0p-1, -0x1.fffc00f800000p-77, -0x1.0000007ffffe0p-1, -0x1.f000000000000p-72, -0x1.03e00043fffe8p+0, -0x1.ffffe00800000p-72}, {0x1.0000000000000p-1, 0x1.ff800fffff800p-57, 0x1.0000000000000p-1, 0x1.fffc0000ffff8p-57, 0x1.0000000000000p+0, 0x1.ffbe08007fc00p-56}, {0x1.0000000000000p-1, 0x1.ff800fffff800p-57, -0x1.0000000000000p-1, -0x1.fffc0000ffff8p-57, -0x1.efc00401fe000p-67, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff800fffff800p-57, 0x1.0000000000000p-1, 0x1.fffc0000ffff8p-57, 0x1.efc00401fe000p-67, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff800fffff800p-57, -0x1.0000000000000p-1, -0x1.fffc0000ffff8p-57, -0x1.0000000000000p+0, -0x1.ffbe08007fc00p-56}, {0x1.0000000008000p-1, -0x1.ffff807ffe002p-55, 0x1.0000000800000p-1, -0x1.ffffff8000008p-57, 0x1.0000000404000p+0, -0x1.3fffc02fff002p-54}, {0x1.0000000008000p-1, -0x1.ffff807ffe002p-55, -0x1.0000000800000p-1, 0x1.ffffff8000008p-57, -0x1.fe00017fff80ap-31, 0x1.0000000000000p-94}, {-0x1.0000000008000p-1, 0x1.ffff807ffe002p-55, 0x1.0000000800000p-1, -0x1.ffffff8000008p-57, 0x1.fe00017fff80ap-31, -0x1.0000000000000p-94}, {-0x1.0000000008000p-1, 0x1.ffff807ffe002p-55, -0x1.0000000800000p-1, 0x1.ffffff8000008p-57, -0x1.0000000404000p+0, 0x1.3fffc02fff002p-54}, {0x1.0000000000020p-1, -0x1.0000000000000p-84, 0x1.0000000000000p-1, 0x1.fffff000003c0p-60, 0x1.0000000000010p+0, 0x1.ffffef0000400p-60}, {0x1.0000000000020p-1, -0x1.0000000000000p-84, -0x1.0000000000000p-1, -0x1.fffff000003c0p-60, 0x1.ffc00001e0000p-49, -0x1.e000000000000p-103}, {-0x1.0000000000020p-1, 0x1.0000000000000p-84, 0x1.0000000000000p-1, 0x1.fffff000003c0p-60, -0x1.ffc00001e0000p-49, 0x1.e000000000000p-103}, {-0x1.0000000000020p-1, 0x1.0000000000000p-84, -0x1.0000000000000p-1, -0x1.fffff000003c0p-60, -0x1.0000000000010p+0, -0x1.ffffef0000400p-60}, {0x1.0000001ffff80p-1, 0x1.fffffdfffff8ep-55, 0x1.0000000200000p-1, -0x1.0000000000000p-70, 0x1.00000010fffc0p+0, 0x1.fffdfdfffff90p-55}, {0x1.0000001ffff80p-1, 0x1.fffffdfffff8ep-55, -0x1.0000000200000p-1, 0x1.0000000000000p-70, 0x1.dfff8080007f8p-29, -0x1.c800000000000p-101}, {-0x1.0000001ffff80p-1, -0x1.fffffdfffff8ep-55, 0x1.0000000200000p-1, -0x1.0000000000000p-70, -0x1.dfff8080007f8p-29, 0x1.c800000000000p-101}, {-0x1.0000001ffff80p-1, -0x1.fffffdfffff8ep-55, -0x1.0000000200000p-1, 0x1.0000000000000p-70, -0x1.00000010fffc0p+0, -0x1.fffdfdfffff90p-55}, {0x1.01ffffff80400p-1, -0x1.c7ffffc000100p-59, 0x1.0000000000000p-1, 0x1.8fff01fffff00p-61, 0x1.00ffffffc0200p+0, -0x1.64003f4000140p-59}, {0x1.01ffffff80400p-1, -0x1.c7ffffc000100p-59, -0x1.0000000000000p-1, -0x1.8fff01fffff00p-61, 0x1.ffffff803fff7p-9, 0x1.4003fbffff400p-63}, {-0x1.01ffffff80400p-1, 0x1.c7ffffc000100p-59, 0x1.0000000000000p-1, 0x1.8fff01fffff00p-61, -0x1.ffffff803fff7p-9, -0x1.4003fbffff400p-63}, {-0x1.01ffffff80400p-1, 0x1.c7ffffc000100p-59, -0x1.0000000000000p-1, -0x1.8fff01fffff00p-61, -0x1.00ffffffc0200p+0, 0x1.64003f4000140p-59}, {0x1.0000000000008p-1, -0x1.ffffc00800000p-74, 0x1.00003ffe00002p-1, -0x1.ffffffc180080p-61, 0x1.00001fff00005p+0, -0x1.0007ffdfc0200p-60}, {0x1.0000000000008p-1, -0x1.ffffc00800000p-74, -0x1.00003ffe00002p-1, 0x1.ffffffc180080p-61, -0x1.ffeffffcff001p-20, 0x1.fff86ff900000p-74}, {-0x1.0000000000008p-1, 0x1.ffffc00800000p-74, 0x1.00003ffe00002p-1, -0x1.ffffffc180080p-61, 0x1.ffeffffcff001p-20, -0x1.fff86ff900000p-74}, {-0x1.0000000000008p-1, 0x1.ffffc00800000p-74, -0x1.00003ffe00002p-1, 0x1.ffffffc180080p-61, -0x1.00001fff00005p+0, 0x1.0007ffdfc0200p-60}, {0x1.000000ffffff8p-1, 0x1.ffffffc000000p-58, 0x1.0000000000000p-1, 0x1.ffffffe000000p-59, 0x1.0000007fffffcp+0, 0x1.7fffffd800000p-57}, {0x1.000000ffffff8p-1, 0x1.ffffffc000000p-58, -0x1.0000000000000p-1, -0x1.ffffffe000000p-59, 0x1.ffffff0100000p-26, -0x1.8000000000000p-85}, {-0x1.000000ffffff8p-1, -0x1.ffffffc000000p-58, 0x1.0000000000000p-1, 0x1.ffffffe000000p-59, -0x1.ffffff0100000p-26, 0x1.8000000000000p-85}, {-0x1.000000ffffff8p-1, -0x1.ffffffc000000p-58, -0x1.0000000000000p-1, -0x1.ffffffe000000p-59, -0x1.0000007fffffcp+0, -0x1.7fffffd800000p-57}, {0x1.0000000020000p-1, -0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.ff1ffffff4000p-68, 0x1.0000000010200p+0, -0x1.ff1ffffff8000p-68}, {0x1.0000000020000p-1, -0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.ff1ffffff4000p-68, 0x1.fc000003fe400p-37, -0x1.0000000000000p-104}, {-0x1.0000000020000p-1, 0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.ff1ffffff4000p-68, -0x1.fc000003fe400p-37, 0x1.0000000000000p-104}, {-0x1.0000000020000p-1, 0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.ff1ffffff4000p-68, -0x1.0000000010200p+0, 0x1.ff1ffffff8000p-68}, {0x1.0000ff8020000p-1, -0x1.fffffa0000000p-63, 0x1.0000000001ff0p-1, 0x1.f700000ffe000p-67, 0x1.00007fc010ff8p+0, -0x1.e08ff9ff00000p-63}, {0x1.0000ff8020000p-1, -0x1.fffffa0000000p-63, -0x1.0000000001ff0p-1, -0x1.f700000ffe000p-67, 0x1.ff003c01ffef0p-18, 0x1.200bfe0040000p-72}, {-0x1.0000ff8020000p-1, 0x1.fffffa0000000p-63, 0x1.0000000001ff0p-1, 0x1.f700000ffe000p-67, -0x1.ff003c01ffef0p-18, -0x1.200bfe0040000p-72}, {-0x1.0000ff8020000p-1, 0x1.fffffa0000000p-63, -0x1.0000000001ff0p-1, -0x1.f700000ffe000p-67, -0x1.00007fc010ff8p+0, 0x1.e08ff9ff00000p-63}, {0x1.0000020000000p-1, -0x1.0000000000000p-65, 0x1.003e00001f800p-1, 0x1.ffde000001e00p-63, 0x1.001f01000fc00p+0, 0x1.bfde000002000p-63}, {0x1.0000020000000p-1, -0x1.0000000000000p-65, -0x1.003e00001f800p-1, -0x1.ffde000001e00p-63, -0x1.eff000fc00004p-12, -0x1.fef000000f000p-66}, {-0x1.0000020000000p-1, 0x1.0000000000000p-65, 0x1.003e00001f800p-1, 0x1.ffde000001e00p-63, 0x1.eff000fc00004p-12, 0x1.fef000000f000p-66}, {-0x1.0000020000000p-1, 0x1.0000000000000p-65, -0x1.003e00001f800p-1, -0x1.ffde000001e00p-63, -0x1.001f01000fc00p+0, -0x1.bfde000002000p-63}, {0x1.0007e3ffe0000p-1, 0x1.fe0ffffffe000p-65, 0x1.0000000000000p-1, 0x1.fffffe07fff00p-62, 0x1.0003f1fff0000p+0, 0x1.1fe0ff03ffe00p-61}, {0x1.0007e3ffe0000p-1, 0x1.fe0ffffffe000p-65, -0x1.0000000000000p-1, -0x1.fffffe07fff00p-62, 0x1.f8fff7fffffc8p-15, -0x1.eff0400180000p-73}, {-0x1.0007e3ffe0000p-1, -0x1.fe0ffffffe000p-65, 0x1.0000000000000p-1, 0x1.fffffe07fff00p-62, -0x1.f8fff7fffffc8p-15, 0x1.eff0400180000p-73}, {-0x1.0007e3ffe0000p-1, -0x1.fe0ffffffe000p-65, -0x1.0000000000000p-1, -0x1.fffffe07fff00p-62, -0x1.0003f1fff0000p+0, -0x1.1fe0ff03ffe00p-61}, {0x1.00000000fe000p-1, 0x1.ff00004000000p-68, 0x1.000003fffff80p-1, 0x1.fff8400000000p-61, 0x1.000002007efc0p+0, 0x1.01fb200040000p-60}, {0x1.00000000fe000p-1, 0x1.ff00004000000p-68, -0x1.000003fffff80p-1, -0x1.fff8400000000p-61, -0x1.ff80fc000fdfdp-24, -0x1.fffc000000000p-80}, {-0x1.00000000fe000p-1, -0x1.ff00004000000p-68, 0x1.000003fffff80p-1, 0x1.fff8400000000p-61, 0x1.ff80fc000fdfdp-24, 0x1.fffc000000000p-80}, {-0x1.00000000fe000p-1, -0x1.ff00004000000p-68, -0x1.000003fffff80p-1, -0x1.fff8400000000p-61, -0x1.000002007efc0p+0, -0x1.01fb200040000p-60}, {0x1.0000800000000p-1, -0x1.0000000000000p-57, 0x1.0000000000000p-1, 0x1.fffffffc1fc00p-64, 0x1.0000400000000p+0, -0x1.f80000000f800p-58}, {0x1.0000800000000p-1, -0x1.0000000000000p-57, -0x1.0000000000000p-1, -0x1.fffffffc1fc00p-64, 0x1.fffffffffbf00p-19, 0x1.f020000000000p-95}, {-0x1.0000800000000p-1, 0x1.0000000000000p-57, 0x1.0000000000000p-1, 0x1.fffffffc1fc00p-64, -0x1.fffffffffbf00p-19, -0x1.f020000000000p-95}, {-0x1.0000800000000p-1, 0x1.0000000000000p-57, -0x1.0000000000000p-1, -0x1.fffffffc1fc00p-64, -0x1.0000400000000p+0, 0x1.f80000000f800p-58}, {0x1.0000000000000p-1, 0x1.ff000ff3ffe00p-55, 0x1.0000000000000p-1, 0x1.fe0003fffc000p-60, 0x1.0000000000000p+0, 0x1.07780809ffe00p-54}, {0x1.0000000000000p-1, 0x1.ff000ff3ffe00p-55, -0x1.0000000000000p-1, -0x1.fe0003fffc000p-60, 0x1.ef100fd400000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff000ff3ffe00p-55, 0x1.0000000000000p-1, 0x1.fe0003fffc000p-60, -0x1.ef100fd400000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff000ff3ffe00p-55, -0x1.0000000000000p-1, -0x1.fe0003fffc000p-60, -0x1.0000000000000p+0, -0x1.07780809ffe00p-54}, {0x1.000000e000010p-1, -0x1.ffffffc020000p-71, 0x1.00000001f0000p-1, 0x1.8000000000000p-105, 0x1.00000070f8008p+0, -0x1.ffffffbfc0000p-71}, {0x1.000000e000010p-1, -0x1.ffffffc020000p-71, -0x1.00000001f0000p-1, -0x1.8000000000000p-105, 0x1.bc2001fffff00p-26, 0x1.fc00000000000p-98}, {-0x1.000000e000010p-1, 0x1.ffffffc020000p-71, 0x1.00000001f0000p-1, 0x1.8000000000000p-105, -0x1.bc2001fffff00p-26, -0x1.fc00000000000p-98}, {-0x1.000000e000010p-1, 0x1.ffffffc020000p-71, -0x1.00000001f0000p-1, -0x1.8000000000000p-105, -0x1.00000070f8008p+0, 0x1.ffffffbfc0000p-71}, {0x1.000003ff00000p-1, 0x1.8000000000000p-78, 0x1.0001ffffe0000p-1, 0x1.f800000100000p-74, 0x1.000101ff70000p+0, 0x1.0800000000000p-73}, {0x1.000003ff00000p-1, 0x1.8000000000000p-78, -0x1.0001ffffe0000p-1, -0x1.f800000100000p-74, -0x1.fc00e00000000p-17, -0x1.e000000100000p-74}, {-0x1.000003ff00000p-1, -0x1.8000000000000p-78, 0x1.0001ffffe0000p-1, 0x1.f800000100000p-74, 0x1.fc00e00000000p-17, 0x1.e000000100000p-74}, {-0x1.000003ff00000p-1, -0x1.8000000000000p-78, -0x1.0001ffffe0000p-1, -0x1.f800000100000p-74, -0x1.000101ff70000p+0, -0x1.0800000000000p-73}, {0x1.0000000000200p-1, -0x1.ffffffffffc08p-57, 0x1.0000000000000p-1, 0x1.ffffffffffffep-55, 0x1.0000000000100p+0, 0x1.80000000000fcp-55}, {0x1.0000000000200p-1, -0x1.ffffffffffc08p-57, -0x1.0000000000000p-1, -0x1.ffffffffffffep-55, 0x1.ff60000000000p-45, 0x1.0000000000000p-99}, {-0x1.0000000000200p-1, 0x1.ffffffffffc08p-57, 0x1.0000000000000p-1, 0x1.ffffffffffffep-55, -0x1.ff60000000000p-45, -0x1.0000000000000p-99}, {-0x1.0000000000200p-1, 0x1.ffffffffffc08p-57, -0x1.0000000000000p-1, -0x1.ffffffffffffep-55, -0x1.0000000000100p+0, -0x1.80000000000fcp-55}, {0x1.0000000040000p-1, -0x1.fffff80002000p-67, 0x1.0000000000000p-1, 0x1.ffc01ffff3c00p-64, 0x1.0000000020000p+0, 0x1.bfc020fff3800p-64}, {0x1.0000000040000p-1, -0x1.fffff80002000p-67, -0x1.0000000000000p-1, -0x1.ffc01ffff3c00p-64, 0x1.ffffffdc03fe1p-36, 0x1.8000000000000p-101}, {-0x1.0000000040000p-1, 0x1.fffff80002000p-67, 0x1.0000000000000p-1, 0x1.ffc01ffff3c00p-64, -0x1.ffffffdc03fe1p-36, -0x1.8000000000000p-101}, {-0x1.0000000040000p-1, 0x1.fffff80002000p-67, -0x1.0000000000000p-1, -0x1.ffc01ffff3c00p-64, -0x1.0000000020000p+0, -0x1.bfc020fff3800p-64}, {0x1.0000800000000p-1, -0x1.0000000000000p-106, 0x1.0000003800001p-1, 0x1.fffffe000003ep-55, 0x1.0000401c00001p+0, -0x1.000000fffffe2p-54}, {0x1.0000800000000p-1, -0x1.0000000000000p-106, -0x1.0000003800001p-1, -0x1.fffffe000003ep-55, 0x1.ff1fffffa0000p-19, 0x1.fffffc0000000p-79}, {-0x1.0000800000000p-1, 0x1.0000000000000p-106, 0x1.0000003800001p-1, 0x1.fffffe000003ep-55, -0x1.ff1fffffa0000p-19, -0x1.fffffc0000000p-79}, {-0x1.0000800000000p-1, 0x1.0000000000000p-106, -0x1.0000003800001p-1, -0x1.fffffe000003ep-55, -0x1.0000401c00001p+0, 0x1.000000fffffe2p-54}, {0x1.0f00000020000p-1, -0x1.fffe000000100p-55, 0x1.0000000400000p-1, -0x1.ffffffc004000p-68, 0x1.0780000210000p+0, -0x1.0006ffffff080p-54}, {0x1.0f00000020000p-1, -0x1.fffe000000100p-55, -0x1.0000000400000p-1, 0x1.ffffffc004000p-68, 0x1.dfffff83ffff0p-6, 0x1.1fffffdf02000p-67}, {-0x1.0f00000020000p-1, 0x1.fffe000000100p-55, 0x1.0000000400000p-1, -0x1.ffffffc004000p-68, -0x1.dfffff83ffff0p-6, -0x1.1fffffdf02000p-67}, {-0x1.0f00000020000p-1, 0x1.fffe000000100p-55, -0x1.0000000400000p-1, 0x1.ffffffc004000p-68, -0x1.0780000210000p+0, 0x1.0006ffffff080p-54}, {0x1.003fe00020000p-1, -0x1.ffffffffe8000p-69, 0x1.0000000000400p-1, -0x1.ffff800007ffcp-56, 0x1.001ff00010200p+0, -0x1.0007c00003ff8p-55}, {0x1.003fe00020000p-1, -0x1.ffffffffe8000p-69, -0x1.0000000000400p-1, 0x1.ffff800007ffcp-56, 0x1.ff0000fe00200p-12, -0x1.07ffff7ff8000p-68}, {-0x1.003fe00020000p-1, 0x1.ffffffffe8000p-69, 0x1.0000000000400p-1, -0x1.ffff800007ffcp-56, -0x1.ff0000fe00200p-12, 0x1.07ffff7ff8000p-68}, {-0x1.003fe00020000p-1, 0x1.ffffffffe8000p-69, -0x1.0000000000400p-1, 0x1.ffff800007ffcp-56, -0x1.001ff00010200p+0, 0x1.0007c00003ff8p-55}, {0x1.ffff00fffffc4p-1, -0x1.8080000000000p-83, 0x1.0000020000000p-1, -0x1.0000000000000p-77, 0x1.7fff817ffffe2p+0, -0x1.0602000000000p-77}, {0x1.ffff00fffffc4p-1, -0x1.8080000000000p-83, -0x1.0000020000000p-1, 0x1.0000000000000p-77, 0x1.fffdfdfffff88p-2, 0x1.f3fc000000000p-78}, {-0x1.ffff00fffffc4p-1, 0x1.8080000000000p-83, 0x1.0000020000000p-1, -0x1.0000000000000p-77, -0x1.fffdfdfffff88p-2, -0x1.f3fc000000000p-78}, {-0x1.ffff00fffffc4p-1, 0x1.8080000000000p-83, -0x1.0000020000000p-1, 0x1.0000000000000p-77, -0x1.7fff817ffffe2p+0, 0x1.0602000000000p-77}, {0x1.0000000000040p-1, -0x1.8000000800000p-76, 0x1.0000000002000p-1, -0x1.0000000000000p-105, 0x1.0000000001020p+0, -0x1.8000001000000p-76}, {0x1.0000000000040p-1, -0x1.8000000800000p-76, -0x1.0000000002000p-1, 0x1.0000000000000p-105, -0x1.fc00000030000p-41, 0x0.0000000000000p+0}, {-0x1.0000000000040p-1, 0x1.8000000800000p-76, 0x1.0000000002000p-1, -0x1.0000000000000p-105, 0x1.fc00000030000p-41, 0x0.0000000000000p+0}, {-0x1.0000000000040p-1, 0x1.8000000800000p-76, -0x1.0000000002000p-1, 0x1.0000000000000p-105, -0x1.0000000001020p+0, 0x1.8000001000000p-76}, {0x1.0000000800000p-1, -0x1.ffffc02000000p-79, 0x1.7fffe00800000p-1, -0x1.0000000000000p-106, 0x1.3ffff00800000p+0, -0x1.ffffc04000000p-79}, {0x1.0000000800000p-1, -0x1.ffffc02000000p-79, -0x1.7fffe00800000p-1, 0x1.0000000000000p-106, -0x1.ffff800000000p-3, -0x1.ffffc00000000p-79}, {-0x1.0000000800000p-1, 0x1.ffffc02000000p-79, 0x1.7fffe00800000p-1, -0x1.0000000000000p-106, 0x1.ffff800000000p-3, 0x1.ffffc00000000p-79}, {-0x1.0000000800000p-1, 0x1.ffffc02000000p-79, -0x1.7fffe00800000p-1, 0x1.0000000000000p-106, -0x1.3ffff00800000p+0, 0x1.ffffc04000000p-79}, {0x1.0000400000000p-1, -0x1.0000000000000p-92, 0x1.4000000000000p-1, -0x1.ffffffff00020p-59, 0x1.2000200000000p+0, -0x1.ffffffff80000p-59}, {0x1.0000400000000p-1, -0x1.0000000000000p-92, -0x1.4000000000000p-1, 0x1.ffffffff00020p-59, -0x1.fffe000000000p-4, 0x1.fffffffe80020p-59}, {-0x1.0000400000000p-1, 0x1.0000000000000p-92, 0x1.4000000000000p-1, -0x1.ffffffff00020p-59, 0x1.fffe000000000p-4, -0x1.fffffffe80020p-59}, {-0x1.0000400000000p-1, 0x1.0000000000000p-92, -0x1.4000000000000p-1, 0x1.ffffffff00020p-59, -0x1.2000200000000p+0, 0x1.ffffffff80000p-59}, {0x1.0000000000000p-1, 0x1.03eff7ff3fff0p-58, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, 0x1.00000fffe0000p+0, 0x1.42eff83d401e0p-58}, {0x1.0000000000000p-1, 0x1.03eff7ff3fff0p-58, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, -0x1.fffbfffff9d88p-21, -0x1.07d8040000000p-79}, {-0x1.0000000000000p-1, -0x1.03eff7ff3fff0p-58, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, 0x1.fffbfffff9d88p-21, 0x1.07d8040000000p-79}, {-0x1.0000000000000p-1, -0x1.03eff7ff3fff0p-58, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, -0x1.00000fffe0000p+0, -0x1.42eff83d401e0p-58}, {0x1.03ffffffffffep-1, 0x1.8000000000000p-105, 0x1.0000040000000p-1, -0x1.0000000000000p-106, 0x1.020001fffffffp+0, 0x1.0000000000000p-105}, {0x1.03ffffffffffep-1, 0x1.8000000000000p-105, -0x1.0000040000000p-1, 0x1.0000000000000p-106, 0x1.fffdfffffff00p-8, 0x1.0000000000000p-104}, {-0x1.03ffffffffffep-1, -0x1.8000000000000p-105, 0x1.0000040000000p-1, -0x1.0000000000000p-106, -0x1.fffdfffffff00p-8, -0x1.0000000000000p-104}, {-0x1.03ffffffffffep-1, -0x1.8000000000000p-105, -0x1.0000040000000p-1, 0x1.0000000000000p-106, -0x1.020001fffffffp+0, -0x1.0000000000000p-105}, {0x1.0007ffffcfffcp-1, 0x1.ff01fffe00000p-75, 0x1.01fff08000000p-1, -0x1.fffffe0000020p-55, 0x1.0103f83fe7ffep+0, -0x1.ffffde0fe0020p-55}, {0x1.0007ffffcfffcp-1, 0x1.ff01fffe00000p-75, -0x1.01fff08000000p-1, 0x1.fffffe0000020p-55, -0x1.f7f0803000380p-9, 0x1.df02001e00000p-75}, {-0x1.0007ffffcfffcp-1, -0x1.ff01fffe00000p-75, 0x1.01fff08000000p-1, -0x1.fffffe0000020p-55, 0x1.f7f0803000380p-9, -0x1.df02001e00000p-75}, {-0x1.0007ffffcfffcp-1, -0x1.ff01fffe00000p-75, -0x1.01fff08000000p-1, 0x1.fffffe0000020p-55, -0x1.0103f83fe7ffep+0, 0x1.ffffde0fe0020p-55}, {0x1.00000000007fep-1, 0x1.ff00003ffff00p-62, 0x1.004000e000008p-1, -0x1.ffffe02000000p-79, 0x1.0020007000403p+0, 0x1.feff00400fe00p-62}, {0x1.00000000007fep-1, 0x1.ff00003ffff00p-62, -0x1.004000e000008p-1, 0x1.ffffe02000000p-79, -0x1.00037ffe027fcp-11, -0x1.fdff802000000p-71}, {-0x1.00000000007fep-1, -0x1.ff00003ffff00p-62, 0x1.004000e000008p-1, -0x1.ffffe02000000p-79, 0x1.00037ffe027fcp-11, 0x1.fdff802000000p-71}, {-0x1.00000000007fep-1, -0x1.ff00003ffff00p-62, -0x1.004000e000008p-1, 0x1.ffffe02000000p-79, -0x1.0020007000403p+0, -0x1.feff00400fe00p-62}, {0x1.00000003ff000p-1, 0x1.ffff000000000p-90, 0x1.0000fffff8000p-1, 0x1.f003ffe0003e0p-59, 0x1.00008001fb800p+0, 0x1.f003ffe4003c0p-59}, {0x1.00000003ff000p-1, 0x1.ffff000000000p-90, -0x1.0000fffff8000p-1, -0x1.f003ffe0003e0p-59, -0x1.fff7f20000f80p-18, -0x1.ffee002000000p-74}, {-0x1.00000003ff000p-1, -0x1.ffff000000000p-90, 0x1.0000fffff8000p-1, 0x1.f003ffe0003e0p-59, 0x1.fff7f20000f80p-18, 0x1.ffee002000000p-74}, {-0x1.00000003ff000p-1, -0x1.ffff000000000p-90, -0x1.0000fffff8000p-1, -0x1.f003ffe0003e0p-59, -0x1.00008001fb800p+0, -0x1.f003ffe4003c0p-59}, {0x1.0000000000000p-1, 0x1.ffe001c0003c0p-60, 0x1.01fffffe00000p-1, 0x1.ffffffffffc00p-59, 0x1.00ffffff00000p+0, 0x1.7ff8006ffff00p-58}, {0x1.0000000000000p-1, 0x1.ffe001c0003c0p-60, -0x1.01fffffe00000p-1, -0x1.ffffffffffc00p-59, -0x1.fffffe0000004p-9, -0x1.ffe3fff440000p-72}, {-0x1.0000000000000p-1, -0x1.ffe001c0003c0p-60, 0x1.01fffffe00000p-1, 0x1.ffffffffffc00p-59, 0x1.fffffe0000004p-9, 0x1.ffe3fff440000p-72}, {-0x1.0000000000000p-1, -0x1.ffe001c0003c0p-60, -0x1.01fffffe00000p-1, -0x1.ffffffffffc00p-59, -0x1.00ffffff00000p+0, -0x1.7ff8006ffff00p-58}, {0x1.00003ff808000p-1, -0x1.ffe0000800000p-62, 0x1.000001ffff000p-1, 0x1.ff80000000000p-75, 0x1.000020fc03800p+0, -0x1.ffd0040800000p-62}, {0x1.00003ff808000p-1, -0x1.ffe0000800000p-62, -0x1.000001ffff000p-1, -0x1.ff80000000000p-75, 0x1.efc047ffff800p-20, 0x1.003f800000000p-74}, {-0x1.00003ff808000p-1, 0x1.ffe0000800000p-62, 0x1.000001ffff000p-1, 0x1.ff80000000000p-75, -0x1.efc047ffff800p-20, -0x1.003f800000000p-74}, {-0x1.00003ff808000p-1, 0x1.ffe0000800000p-62, -0x1.000001ffff000p-1, -0x1.ff80000000000p-75, -0x1.000020fc03800p+0, 0x1.ffd0040800000p-62}, {0x1.0000000000000p-1, 0x1.fc007f0ff0000p-63, 0x1.0000000007f80p-1, 0x1.ff0007f802000p-65, 0x1.0000000003fc0p+0, 0x1.3de04086f8400p-62}, {0x1.0000000000000p-1, 0x1.fc007f0ff0000p-63, -0x1.0000000007f80p-1, -0x1.ff0007f802000p-65, -0x1.fdfffe83bf82fp-39, 0x1.ef80000000000p-95}, {-0x1.0000000000000p-1, -0x1.fc007f0ff0000p-63, 0x1.0000000007f80p-1, 0x1.ff0007f802000p-65, 0x1.fdfffe83bf82fp-39, -0x1.ef80000000000p-95}, {-0x1.0000000000000p-1, -0x1.fc007f0ff0000p-63, -0x1.0000000007f80p-1, -0x1.ff0007f802000p-65, -0x1.0000000003fc0p+0, -0x1.3de04086f8400p-62}, {0x1.0020000000000p-1, -0x1.0000000000000p-78, 0x1.000001ffff802p-1, -0x1.ffffffc000040p-60, 0x1.001000ffffc01p+0, -0x1.00001fe000000p-59}, {0x1.0020000000000p-1, -0x1.0000000000000p-78, -0x1.000001ffff802p-1, 0x1.ffffffc000040p-60, 0x1.ffe00007fe040p-13, -0x1.00fffff000000p-78}, {-0x1.0020000000000p-1, 0x1.0000000000000p-78, 0x1.000001ffff802p-1, -0x1.ffffffc000040p-60, -0x1.ffe00007fe040p-13, 0x1.00fffff000000p-78}, {-0x1.0020000000000p-1, 0x1.0000000000000p-78, -0x1.000001ffff802p-1, 0x1.ffffffc000040p-60, -0x1.001000ffffc01p+0, 0x1.00001fe000000p-59}, {0x1.0000000000800p-1, -0x1.ffe0000400000p-63, 0x1.0000000000038p-1, 0x1.e100000000000p-75, 0x1.000000000041cp+0, -0x1.ffc1f00400000p-63}, {0x1.0000000000800p-1, -0x1.ffe0000400000p-63, -0x1.0000000000038p-1, -0x1.e100000000000p-75, 0x1.f1ffe0001effcp-43, 0x0.0000000000000p+0}, {-0x1.0000000000800p-1, 0x1.ffe0000400000p-63, 0x1.0000000000038p-1, 0x1.e100000000000p-75, -0x1.f1ffe0001effcp-43, 0x0.0000000000000p+0}, {-0x1.0000000000800p-1, 0x1.ffe0000400000p-63, -0x1.0000000000038p-1, -0x1.e100000000000p-75, -0x1.000000000041cp+0, 0x1.ffc1f00400000p-63}, {0x1.0000000000020p-1, -0x1.8007ffff80c04p-56, 0x1.0000000000000p-1, 0x1.ffffe00000c00p-64, 0x1.0000000000010p+0, -0x1.7e08001f80bf8p-56}, {0x1.0000000000020p-1, -0x1.8007ffff80c04p-56, -0x1.0000000000000p-1, -0x1.ffffe00000c00p-64, 0x1.fcfbf00040fe8p-49, -0x1.0000000000000p-104}, {-0x1.0000000000020p-1, 0x1.8007ffff80c04p-56, 0x1.0000000000000p-1, 0x1.ffffe00000c00p-64, -0x1.fcfbf00040fe8p-49, 0x1.0000000000000p-104}, {-0x1.0000000000020p-1, 0x1.8007ffff80c04p-56, -0x1.0000000000000p-1, -0x1.ffffe00000c00p-64, -0x1.0000000000010p+0, 0x1.7e08001f80bf8p-56}, {0x1.7fffffff80000p-1, 0x1.f000000000000p-78, 0x1.000007ffffffep-1, 0x1.ffffff8000000p-77, 0x1.400003ffbffffp+0, 0x1.7bffffc000000p-76}, {0x1.7fffffff80000p-1, 0x1.f000000000000p-78, -0x1.000007ffffffep-1, -0x1.ffffff8000000p-77, 0x1.ffffdffe00008p-3, -0x1.07ffff8000000p-77}, {-0x1.7fffffff80000p-1, -0x1.f000000000000p-78, 0x1.000007ffffffep-1, 0x1.ffffff8000000p-77, -0x1.ffffdffe00008p-3, 0x1.07ffff8000000p-77}, {-0x1.7fffffff80000p-1, -0x1.f000000000000p-78, -0x1.000007ffffffep-1, -0x1.ffffff8000000p-77, -0x1.400003ffbffffp+0, -0x1.7bffffc000000p-76}, {0x1.0000000010000p-1, -0x1.0000000000000p-87, 0x1.0000000000000p-1, 0x1.c000003ffc3fep-55, 0x1.0000000008000p+0, 0x1.c000003efc400p-55}, {0x1.0000000010000p-1, -0x1.0000000000000p-87, -0x1.0000000000000p-1, -0x1.c000003ffc3fep-55, 0x1.ffff1fffffdf8p-38, 0x1.e010000000000p-94}, {-0x1.0000000010000p-1, 0x1.0000000000000p-87, 0x1.0000000000000p-1, 0x1.c000003ffc3fep-55, -0x1.ffff1fffffdf8p-38, -0x1.e010000000000p-94}, {-0x1.0000000010000p-1, 0x1.0000000000000p-87, -0x1.0000000000000p-1, -0x1.c000003ffc3fep-55, -0x1.0000000008000p+0, -0x1.c000003efc400p-55}, {0x1.00000ffff0800p-1, -0x1.fff80000ffc20p-59, 0x1.0000000000002p-1, -0x1.0000000000000p-106, 0x1.000007fff8401p+0, -0x1.fff80000ffc40p-59}, {0x1.00000ffff0800p-1, -0x1.fff80000ffc20p-59, -0x1.0000000000002p-1, 0x1.0000000000000p-106, 0x1.fffe0ffbf0004p-22, -0x1.ff80000000000p-92}, {-0x1.00000ffff0800p-1, 0x1.fff80000ffc20p-59, 0x1.0000000000002p-1, -0x1.0000000000000p-106, -0x1.fffe0ffbf0004p-22, 0x1.ff80000000000p-92}, {-0x1.00000ffff0800p-1, 0x1.fff80000ffc20p-59, -0x1.0000000000002p-1, 0x1.0000000000000p-106, -0x1.000007fff8401p+0, 0x1.fff80000ffc40p-59}, {0x1.000ffffc00000p-1, 0x1.fffff00000000p-70, 0x1.0000000000040p-1, -0x1.0000000000000p-106, 0x1.0007fffe00020p+0, 0x1.fffff00000000p-70}, {0x1.000ffffc00000p-1, 0x1.fffff00000000p-70, -0x1.0000000000040p-1, 0x1.0000000000000p-106, 0x1.ffff7fff80000p-14, 0x1.fffff00010000p-70}, {-0x1.000ffffc00000p-1, -0x1.fffff00000000p-70, 0x1.0000000000040p-1, -0x1.0000000000000p-106, -0x1.ffff7fff80000p-14, -0x1.fffff00010000p-70}, {-0x1.000ffffc00000p-1, -0x1.fffff00000000p-70, -0x1.0000000000040p-1, 0x1.0000000000000p-106, -0x1.0007fffe00020p+0, -0x1.fffff00000000p-70}, {0x1.0004000000000p-1, -0x1.0000000000000p-69, 0x1.0000000200000p-1, -0x1.ffbffffff8020p-59, 0x1.0002000100000p+0, -0x1.fffffffff8000p-59}, {0x1.0004000000000p-1, -0x1.0000000000000p-69, -0x1.0000000200000p-1, 0x1.ffbffffff8020p-59, 0x1.ffff0000003ffp-16, -0x1.ff80000000000p-97}, {-0x1.0004000000000p-1, 0x1.0000000000000p-69, 0x1.0000000200000p-1, -0x1.ffbffffff8020p-59, -0x1.ffff0000003ffp-16, 0x1.ff80000000000p-97}, {-0x1.0004000000000p-1, 0x1.0000000000000p-69, -0x1.0000000200000p-1, 0x1.ffbffffff8020p-59, -0x1.0002000100000p+0, 0x1.fffffffff8000p-59}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, 0x1.0000001fffffep-1, 0x0.0000000000000p+0, 0x1.0000000ffffffp+0, 0x1.e0001e7fc0000p-62}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, -0x1.0000001fffffep-1, 0x0.0000000000000p+0, -0x1.fffffdff0ffffp-29, -0x1.8040100000000p-86}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, 0x1.0000001fffffep-1, 0x0.0000000000000p+0, 0x1.fffffdff0ffffp-29, 0x1.8040100000000p-86}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, -0x1.0000001fffffep-1, 0x0.0000000000000p+0, -0x1.0000000ffffffp+0, -0x1.e0001e7fc0000p-62}, {0x1.0000000000fffp-1, 0x1.fffff3e000000p-74, 0x1.001ffe0000000p-1, 0x1.fffffffffffc0p-60, 0x1.000fff0000800p+0, -0x1.f7ffe00000c20p-54}, {0x1.0000000000fffp-1, 0x1.fffff3e000000p-74, -0x1.001ffe0000000p-1, -0x1.fffffffffffc0p-60, -0x1.ffdffff001040p-13, 0x1.fffff3e100000p-74}, {-0x1.0000000000fffp-1, -0x1.fffff3e000000p-74, 0x1.001ffe0000000p-1, 0x1.fffffffffffc0p-60, 0x1.ffdffff001040p-13, -0x1.fffff3e100000p-74}, {-0x1.0000000000fffp-1, -0x1.fffff3e000000p-74, -0x1.001ffe0000000p-1, -0x1.fffffffffffc0p-60, -0x1.000fff0000800p+0, 0x1.f7ffe00000c20p-54}, {0x1.0000080000000p-1, -0x1.0000000000000p-106, 0x1.0000000080000p-1, -0x1.0000000000000p-56, 0x1.0000040040000p+0, -0x1.0000000000000p-56}, {0x1.0000080000000p-1, -0x1.0000000000000p-106, -0x1.0000000080000p-1, 0x1.0000000000000p-56, 0x1.ffe0000080000p-23, -0x1.0000000000000p-106}, {-0x1.0000080000000p-1, 0x1.0000000000000p-106, 0x1.0000000080000p-1, -0x1.0000000000000p-56, -0x1.ffe0000080000p-23, 0x1.0000000000000p-106}, {-0x1.0000080000000p-1, 0x1.0000000000000p-106, -0x1.0000000080000p-1, 0x1.0000000000000p-56, -0x1.0000040040000p+0, 0x1.0000000000000p-56}, {0x1.003ffffffffe0p-1, 0x1.ffffe03800000p-77, 0x1.0000000002000p-1, -0x1.0000000000000p-54, 0x1.0020000000ff0p+0, -0x1.fffff800007f0p-55}, {0x1.003ffffffffe0p-1, 0x1.ffffe03800000p-77, -0x1.0000000002000p-1, 0x1.0000000000000p-54, 0x1.ffffffeff0400p-12, 0x1.ffffe03800000p-77}, {-0x1.003ffffffffe0p-1, -0x1.ffffe03800000p-77, 0x1.0000000002000p-1, -0x1.0000000000000p-54, -0x1.ffffffeff0400p-12, -0x1.ffffe03800000p-77}, {-0x1.003ffffffffe0p-1, -0x1.ffffe03800000p-77, -0x1.0000000002000p-1, 0x1.0000000000000p-54, -0x1.0020000000ff0p+0, 0x1.fffff800007f0p-55}, {0x1.0000000000008p-1, -0x1.ff000007ffc00p-61, 0x1.0000000060000p-1, 0x1.ffffff8000000p-81, 0x1.0000000030004p+0, -0x1.feffe007ffc00p-61}, {0x1.0000000000008p-1, -0x1.ff000007ffc00p-61, -0x1.0000000060000p-1, -0x1.ffffff8000000p-81, -0x1.7ffe007fc0080p-35, -0x1.ffee000000000p-91}, {-0x1.0000000000008p-1, 0x1.ff000007ffc00p-61, 0x1.0000000060000p-1, 0x1.ffffff8000000p-81, 0x1.7ffe007fc0080p-35, 0x1.ffee000000000p-91}, {-0x1.0000000000008p-1, 0x1.ff000007ffc00p-61, -0x1.0000000060000p-1, -0x1.ffffff8000000p-81, -0x1.0000000030004p+0, 0x1.feffe007ffc00p-61}, {0x1.0000000000080p-1, -0x1.0000000000000p-106, 0x1.01ffffff80001p-1, -0x1.ff90000000000p-94, 0x1.00ffffffc0040p+0, 0x1.fffffffffe006p-54}, {0x1.0000000000080p-1, -0x1.0000000000000p-106, -0x1.01ffffff80001p-1, 0x1.ff90000000000p-94, -0x1.ffffff7ff8100p-9, 0x1.ff80000000000p-94}, {-0x1.0000000000080p-1, 0x1.0000000000000p-106, 0x1.01ffffff80001p-1, -0x1.ff90000000000p-94, 0x1.ffffff7ff8100p-9, -0x1.ff80000000000p-94}, {-0x1.0000000000080p-1, 0x1.0000000000000p-106, -0x1.01ffffff80001p-1, 0x1.ff90000000000p-94, -0x1.00ffffffc0040p+0, -0x1.fffffffffe006p-54}, {0x1.0000000000800p-1, -0x1.fffff80002000p-67, 0x1.0008000000000p-1, -0x1.0000000000000p-80, 0x1.0004000000400p+0, -0x1.0003fc0000000p-66}, {0x1.0000000000800p-1, -0x1.fffff80002000p-67, -0x1.0008000000000p-1, 0x1.0000000000000p-80, -0x1.ffffffe000002p-15, 0x1.00ffffc000000p-80}, {-0x1.0000000000800p-1, 0x1.fffff80002000p-67, 0x1.0008000000000p-1, -0x1.0000000000000p-80, 0x1.ffffffe000002p-15, -0x1.00ffffc000000p-80}, {-0x1.0000000000800p-1, 0x1.fffff80002000p-67, -0x1.0008000000000p-1, 0x1.0000000000000p-80, -0x1.0004000000400p+0, 0x1.0003fc0000000p-66}, {0x1.0000000000002p-1, -0x1.ffffffe200000p-75, 0x1.0003fffffffc0p-1, 0x1.ffffe00000400p-64, 0x1.0001fffffffe1p+0, 0x1.ffbfe00004000p-64}, {0x1.0000000000002p-1, -0x1.ffffffe200000p-75, -0x1.0003fffffffc0p-1, -0x1.ffffe00000400p-64, -0x1.fffffffdf0020p-16, -0x1.feffffe400000p-75}, {-0x1.0000000000002p-1, 0x1.ffffffe200000p-75, 0x1.0003fffffffc0p-1, 0x1.ffffe00000400p-64, 0x1.fffffffdf0020p-16, 0x1.feffffe400000p-75}, {-0x1.0000000000002p-1, 0x1.ffffffe200000p-75, -0x1.0003fffffffc0p-1, -0x1.ffffe00000400p-64, -0x1.0001fffffffe1p+0, -0x1.ffbfe00004000p-64}, {0x1.000003f000000p-1, 0x1.fffffffe00000p-62, 0x1.0000000000ff0p-1, 0x1.c03fff0e00000p-75, 0x1.000001f8007f8p+0, 0x1.000700fefc400p-61}, {0x1.000003f000000p-1, 0x1.fffffffe00000p-62, -0x1.0000000000ff0p-1, -0x1.c03fff0e00000p-75, 0x1.f7ff808007ffcp-24, 0x1.fdfe079000000p-78}, {-0x1.000003f000000p-1, -0x1.fffffffe00000p-62, 0x1.0000000000ff0p-1, 0x1.c03fff0e00000p-75, -0x1.f7ff808007ffcp-24, -0x1.fdfe079000000p-78}, {-0x1.000003f000000p-1, -0x1.fffffffe00000p-62, -0x1.0000000000ff0p-1, -0x1.c03fff0e00000p-75, -0x1.000001f8007f8p+0, -0x1.000700fefc400p-61}, {0x1.0000000018000p-1, 0x1.fffffe0000000p-83, 0x1.0000100000000p-1, -0x1.0000000000000p-106, 0x1.000008000c000p+0, 0x1.fffffc0000000p-83}, {0x1.0000000018000p-1, 0x1.fffffe0000000p-83, -0x1.0000100000000p-1, 0x1.0000000000000p-106, -0x1.fffd000000000p-22, 0x1.0000000000000p-82}, {-0x1.0000000018000p-1, -0x1.fffffe0000000p-83, 0x1.0000100000000p-1, -0x1.0000000000000p-106, 0x1.fffd000000000p-22, -0x1.0000000000000p-82}, {-0x1.0000000018000p-1, -0x1.fffffe0000000p-83, -0x1.0000100000000p-1, 0x1.0000000000000p-106, -0x1.000008000c000p+0, -0x1.fffffc0000000p-83}, {0x1.0000000000001p-1, -0x1.fffffc1000000p-68, 0x1.1ffffff01f000p-1, 0x1.ffffc000060fcp-56, 0x1.0ffffff80f801p+0, -0x1.80080fffeebc0p-54}, {0x1.0000000000001p-1, -0x1.fffffc1000000p-68, -0x1.1ffffff01f000p-1, -0x1.ffffc000060fcp-56, -0x1.ffffff01efff4p-5, -0x1.fbfffc70fc000p-68}, {-0x1.0000000000001p-1, 0x1.fffffc1000000p-68, 0x1.1ffffff01f000p-1, 0x1.ffffc000060fcp-56, 0x1.ffffff01efff4p-5, 0x1.fbfffc70fc000p-68}, {-0x1.0000000000001p-1, 0x1.fffffc1000000p-68, -0x1.1ffffff01f000p-1, -0x1.ffffc000060fcp-56, -0x1.0ffffff80f801p+0, 0x1.80080fffeebc0p-54}, {0x1.0000003800000p-1, 0x1.ffe000001fffcp-56, 0x1.0000007fffff0p-1, 0x1.fe1ffffc00000p-63, 0x1.0000005bffff8p+0, 0x1.01ee20000c000p-55}, {0x1.0000003800000p-1, 0x1.ffe000001fffcp-56, -0x1.0000007fffff0p-1, -0x1.fe1ffffc00000p-63, -0x1.1ffffbf020e20p-27, 0x1.3ffe000000000p-91}, {-0x1.0000003800000p-1, -0x1.ffe000001fffcp-56, 0x1.0000007fffff0p-1, 0x1.fe1ffffc00000p-63, 0x1.1ffffbf020e20p-27, -0x1.3ffe000000000p-91}, {-0x1.0000003800000p-1, -0x1.ffe000001fffcp-56, -0x1.0000007fffff0p-1, -0x1.fe1ffffc00000p-63, -0x1.0000005bffff8p+0, -0x1.01ee20000c000p-55}, {0x1.0000001fffc00p-1, 0x1.f00007ffe0000p-65, 0x1.0000000000180p-1, 0x1.fffffe0000800p-65, 0x1.0000000fffec0p+0, 0x1.f80002fff0000p-64}, {0x1.0000001fffc00p-1, 0x1.f00007ffe0000p-65, -0x1.0000000000180p-1, -0x1.fffffe0000800p-65, 0x1.fffa7fffff000p-29, 0x1.3ffbf00000000p-86}, {-0x1.0000001fffc00p-1, -0x1.f00007ffe0000p-65, 0x1.0000000000180p-1, 0x1.fffffe0000800p-65, -0x1.fffa7fffff000p-29, -0x1.3ffbf00000000p-86}, {-0x1.0000001fffc00p-1, -0x1.f00007ffe0000p-65, -0x1.0000000000180p-1, -0x1.fffffe0000800p-65, -0x1.0000000fffec0p+0, -0x1.f80002fff0000p-64}, {0x1.0000000008000p-1, -0x1.c0000007ffe04p-56, 0x1.00000fffffffep-1, 0x1.fc00000000000p-100, 0x1.0000080003fffp+0, -0x1.c0000007ffc08p-56}, {0x1.0000000008000p-1, -0x1.c0000007ffe04p-56, -0x1.00000fffffffep-1, -0x1.fc00000000000p-100, -0x1.fffefffc70000p-22, -0x1.0000000000000p-85}, {-0x1.0000000008000p-1, 0x1.c0000007ffe04p-56, 0x1.00000fffffffep-1, 0x1.fc00000000000p-100, 0x1.fffefffc70000p-22, 0x1.0000000000000p-85}, {-0x1.0000000008000p-1, 0x1.c0000007ffe04p-56, -0x1.00000fffffffep-1, -0x1.fc00000000000p-100, -0x1.0000080003fffp+0, 0x1.c0000007ffc08p-56}, {0x1.0000003e00004p-1, -0x1.fe00040000000p-71, 0x1.00007c0001e00p-1, 0x1.fffe13ffe0000p-65, 0x1.00003e1f00f02p+0, 0x1.f80613efe0000p-65}, {0x1.0000003e00004p-1, -0x1.fe00040000000p-71, -0x1.00007c0001e00p-1, -0x1.fffe13ffe0000p-65, -0x1.ef08077f00082p-19, 0x1.3d7e040000000p-78}, {-0x1.0000003e00004p-1, 0x1.fe00040000000p-71, 0x1.00007c0001e00p-1, 0x1.fffe13ffe0000p-65, 0x1.ef08077f00082p-19, -0x1.3d7e040000000p-78}, {-0x1.0000003e00004p-1, 0x1.fe00040000000p-71, -0x1.00007c0001e00p-1, -0x1.fffe13ffe0000p-65, -0x1.00003e1f00f02p+0, -0x1.f80613efe0000p-65}, {0x1.03fffffffc000p-1, 0x1.ffffffc000000p-76, 0x1.0003ffffff000p-1, 0x1.ffc0000000000p-96, 0x1.0201fffffd800p+0, 0x1.00000fe000000p-75}, {0x1.03fffffffc000p-1, 0x1.ffffffc000000p-76, -0x1.0003ffffff000p-1, -0x1.ffc0000000000p-96, 0x1.fdfffffe80000p-8, 0x1.ffffdfc400000p-76}, {-0x1.03fffffffc000p-1, -0x1.ffffffc000000p-76, 0x1.0003ffffff000p-1, 0x1.ffc0000000000p-96, -0x1.fdfffffe80000p-8, -0x1.ffffdfc400000p-76}, {-0x1.03fffffffc000p-1, -0x1.ffffffc000000p-76, -0x1.0003ffffff000p-1, -0x1.ffc0000000000p-96, -0x1.0201fffffd800p+0, -0x1.00000fe000000p-75}, {0x1.07ffffff80000p-1, 0x1.8007ffffc0000p-72, 0x1.0000000000004p-1, -0x1.fffc000200000p-70, 0x1.03ffffffc0002p+0, -0x1.9ffa000200000p-70}, {0x1.07ffffff80000p-1, 0x1.8007ffffc0000p-72, -0x1.0000000000004p-1, 0x1.fffc000200000p-70, 0x1.ffffffdffff00p-7, 0x1.2fff0000f8000p-69}, {-0x1.07ffffff80000p-1, -0x1.8007ffffc0000p-72, 0x1.0000000000004p-1, -0x1.fffc000200000p-70, -0x1.ffffffdffff00p-7, -0x1.2fff0000f8000p-69}, {-0x1.07ffffff80000p-1, -0x1.8007ffffc0000p-72, -0x1.0000000000004p-1, 0x1.fffc000200000p-70, -0x1.03ffffffc0002p+0, 0x1.9ffa000200000p-70}, {0x1.00003ffffff80p-1, 0x1.ffff0000ffe00p-63, 0x1.00003fffffff8p-1, 0x0.0000000000000p+0, 0x1.00003ffffffbcp+0, 0x1.ffff000100000p-63}, {0x1.00003ffffff80p-1, 0x1.ffff0000ffe00p-63, -0x1.00003fffffff8p-1, 0x0.0000000000000p+0, -0x1.dffe0000ffff0p-47, -0x1.0000000000000p-106}, {-0x1.00003ffffff80p-1, -0x1.ffff0000ffe00p-63, 0x1.00003fffffff8p-1, 0x0.0000000000000p+0, 0x1.dffe0000ffff0p-47, 0x1.0000000000000p-106}, {-0x1.00003ffffff80p-1, -0x1.ffff0000ffe00p-63, -0x1.00003fffffff8p-1, 0x0.0000000000000p+0, -0x1.00003ffffffbcp+0, -0x1.ffff000100000p-63}, {0x1.0000010000000p-1, -0x1.0000000000000p-106, 0x1.00f81ffffff81p-1, 0x1.fffff03c00000p-63, 0x1.007c107ffffc1p+0, -0x1.ff000007e2000p-54}, {0x1.0000010000000p-1, -0x1.0000000000000p-106, -0x1.00f81ffffff81p-1, -0x1.fffff03c00000p-63, -0x1.f03dfffff0201p-10, 0x1.f87ffc0000000p-84}, {-0x1.0000010000000p-1, 0x1.0000000000000p-106, 0x1.00f81ffffff81p-1, 0x1.fffff03c00000p-63, 0x1.f03dfffff0201p-10, -0x1.f87ffc0000000p-84}, {-0x1.0000010000000p-1, 0x1.0000000000000p-106, -0x1.00f81ffffff81p-1, -0x1.fffff03c00000p-63, -0x1.007c107ffffc1p+0, 0x1.ff000007e2000p-54}, {0x1.0000000000004p-1, -0x1.fff0008000000p-65, 0x1.0000000100000p-1, -0x1.fffffe0004000p-68, 0x1.0000000080002p+0, -0x1.1ff8002000000p-64}, {0x1.0000000000004p-1, -0x1.fff0008000000p-65, -0x1.0000000100000p-1, 0x1.fffffe0004000p-68, -0x1.ffff80037fe00p-34, -0x1.7fff000000000p-90}, {-0x1.0000000000004p-1, 0x1.fff0008000000p-65, 0x1.0000000100000p-1, -0x1.fffffe0004000p-68, 0x1.ffff80037fe00p-34, 0x1.7fff000000000p-90}, {-0x1.0000000000004p-1, 0x1.fff0008000000p-65, -0x1.0000000100000p-1, 0x1.fffffe0004000p-68, -0x1.0000000080002p+0, 0x1.1ff8002000000p-64}, {0x1.0000000000800p-1, -0x1.0000000000000p-79, 0x1.0000010000000p-1, -0x1.0000000000000p-104, 0x1.0000008000400p+0, -0x1.0000008000000p-79}, {0x1.0000000000800p-1, -0x1.0000000000000p-79, -0x1.0000010000000p-1, 0x1.0000000000000p-104, -0x1.ffff000000000p-26, -0x1.ffffff0000000p-80}, {-0x1.0000000000800p-1, 0x1.0000000000000p-79, 0x1.0000010000000p-1, -0x1.0000000000000p-104, 0x1.ffff000000000p-26, 0x1.ffffff0000000p-80}, {-0x1.0000000000800p-1, 0x1.0000000000000p-79, -0x1.0000010000000p-1, 0x1.0000000000000p-104, -0x1.0000008000400p+0, 0x1.0000008000000p-79}, {0x1.00000007fff00p-1, 0x1.fffc1ffff87f0p-57, 0x1.0000007c00000p-1, 0x1.fff0000000000p-72, 0x1.00000041fff80p+0, 0x1.00000feffc3f8p-56}, {0x1.00000007fff00p-1, 0x1.fffc1ffff87f0p-57, -0x1.0000007c00000p-1, -0x1.fff0000000000p-72, -0x1.d0003ff8001f8p-27, 0x1.ff87f00000000p-85}, {-0x1.00000007fff00p-1, -0x1.fffc1ffff87f0p-57, 0x1.0000007c00000p-1, 0x1.fff0000000000p-72, 0x1.d0003ff8001f8p-27, -0x1.ff87f00000000p-85}, {-0x1.00000007fff00p-1, -0x1.fffc1ffff87f0p-57, -0x1.0000007c00000p-1, -0x1.fff0000000000p-72, -0x1.00000041fff80p+0, -0x1.00000feffc3f8p-56}, {0x1.fffffffe00000p-1, 0x1.e000001fff800p-65, 0x1.00000001ffffep-1, 0x0.0000000000000p+0, 0x1.7ffffffffffffp+0, 0x1.e000002000000p-65}, {0x1.fffffffe00000p-1, 0x1.e000001fff800p-65, -0x1.00000001ffffep-1, 0x0.0000000000000p+0, 0x1.fffffff800004p-2, 0x1.e000001fff800p-65}, {-0x1.fffffffe00000p-1, -0x1.e000001fff800p-65, 0x1.00000001ffffep-1, 0x0.0000000000000p+0, -0x1.fffffff800004p-2, -0x1.e000001fff800p-65}, {-0x1.fffffffe00000p-1, -0x1.e000001fff800p-65, -0x1.00000001ffffep-1, 0x0.0000000000000p+0, -0x1.7ffffffffffffp+0, -0x1.e000002000000p-65}, {0x1.0000000000008p-1, -0x1.fffff00400000p-73, 0x1.00003ffffe000p-1, 0x1.ffffe00000000p-73, 0x1.00001fffff004p+0, -0x1.0040000000000p-93}, {0x1.0000000000008p-1, -0x1.fffff00400000p-73, -0x1.00003ffffe000p-1, -0x1.ffffe00000000p-73, -0x1.ffffeffc00002p-20, 0x1.7fe0000000000p-92}, {-0x1.0000000000008p-1, 0x1.fffff00400000p-73, 0x1.00003ffffe000p-1, 0x1.ffffe00000000p-73, 0x1.ffffeffc00002p-20, -0x1.7fe0000000000p-92}, {-0x1.0000000000008p-1, 0x1.fffff00400000p-73, -0x1.00003ffffe000p-1, -0x1.ffffe00000000p-73, -0x1.00001fffff004p+0, 0x1.0040000000000p-93}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, 0x1.000001ffe0000p-1, 0x1.ff87ff9f801c0p-60, 0x1.000000fff0000p+0, 0x1.0fc3ffcfc00c0p-59}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, -0x1.000001ffe0000p-1, -0x1.ff87ff9f801c0p-60, -0x1.ffe000003bf10p-25, 0x1.81ff800000000p-86}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, 0x1.000001ffe0000p-1, 0x1.ff87ff9f801c0p-60, 0x1.ffe000003bf10p-25, -0x1.81ff800000000p-86}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, -0x1.000001ffe0000p-1, -0x1.ff87ff9f801c0p-60, -0x1.000000fff0000p+0, -0x1.0fc3ffcfc00c0p-59}, {0x1.0000000000400p-1, -0x1.f800000002000p-62, 0x1.03fffffffff00p-1, 0x1.fffe7fffffffep-55, 0x1.0200000000180p+0, 0x1.fc0e7ffffffc0p-55}, {0x1.0000000000400p-1, -0x1.f800000002000p-62, -0x1.03fffffffff00p-1, -0x1.fffe7fffffffep-55, -0x1.ffffffffd8040p-8, -0x1.f740000001f00p-62}, {-0x1.0000000000400p-1, 0x1.f800000002000p-62, 0x1.03fffffffff00p-1, 0x1.fffe7fffffffep-55, 0x1.ffffffffd8040p-8, 0x1.f740000001f00p-62}, {-0x1.0000000000400p-1, 0x1.f800000002000p-62, -0x1.03fffffffff00p-1, -0x1.fffe7fffffffep-55, -0x1.0200000000180p+0, -0x1.fc0e7ffffffc0p-55}, {0x1.0000000000000p-1, 0x1.fffffffffff00p-57, 0x1.000007c000000p-1, 0x1.fff8000000000p-57, 0x1.000003e000000p+0, 0x1.fffbfffffff80p-56}, {0x1.0000000000000p-1, 0x1.fffffffffff00p-57, -0x1.000007c000000p-1, -0x1.fff8000000000p-57, -0x1.effffffffffe0p-23, -0x1.0000000000000p-101}, {-0x1.0000000000000p-1, -0x1.fffffffffff00p-57, 0x1.000007c000000p-1, 0x1.fff8000000000p-57, 0x1.effffffffffe0p-23, 0x1.0000000000000p-101}, {-0x1.0000000000000p-1, -0x1.fffffffffff00p-57, -0x1.000007c000000p-1, -0x1.fff8000000000p-57, -0x1.000003e000000p+0, -0x1.fffbfffffff80p-56}, {0x1.0000000000400p-1, -0x1.fffc0003fffd0p-58, 0x1.0000000000000p-1, 0x1.fffffff800000p-57, 0x1.0000000000200p+0, 0x1.0001fff600020p-57}, {0x1.0000000000400p-1, -0x1.fffc0003fffd0p-58, -0x1.0000000000000p-1, -0x1.fffffff800000p-57, 0x1.ffe8001000300p-44, 0x1.8000000000000p-105}, {-0x1.0000000000400p-1, 0x1.fffc0003fffd0p-58, 0x1.0000000000000p-1, 0x1.fffffff800000p-57, -0x1.ffe8001000300p-44, -0x1.8000000000000p-105}, {-0x1.0000000000400p-1, 0x1.fffc0003fffd0p-58, -0x1.0000000000000p-1, -0x1.fffffff800000p-57, -0x1.0000000000200p+0, -0x1.0001fff600020p-57}, {0x1.0000000002000p-1, -0x1.ffff040000000p-72, 0x1.03fffff800000p-1, 0x1.fffffe0000000p-69, 0x1.01fffffc01000p+0, 0x1.c0001d8000000p-69}, {0x1.0000000002000p-1, -0x1.ffff040000000p-72, -0x1.03fffff800000p-1, -0x1.fffffe0000000p-69, -0x1.fffffbff00000p-8, -0x1.1fffef4000000p-68}, {-0x1.0000000002000p-1, 0x1.ffff040000000p-72, 0x1.03fffff800000p-1, 0x1.fffffe0000000p-69, 0x1.fffffbff00000p-8, 0x1.1fffef4000000p-68}, {-0x1.0000000002000p-1, 0x1.ffff040000000p-72, -0x1.03fffff800000p-1, -0x1.fffffe0000000p-69, -0x1.01fffffc01000p+0, -0x1.c0001d8000000p-69}, {0x1.0000008000000p-1, -0x1.ffffff8200000p-58, 0x1.000fff8000000p-1, 0x1.fffffe0000000p-63, 0x1.0008000000000p+0, -0x1.efffff9200000p-58}, {0x1.0000008000000p-1, -0x1.ffffff8200000p-58, -0x1.000fff8000000p-1, -0x1.fffffe0000000p-63, -0x1.ffe0000000210p-14, 0x1.1c00000000000p-83}, {-0x1.0000008000000p-1, 0x1.ffffff8200000p-58, 0x1.000fff8000000p-1, 0x1.fffffe0000000p-63, 0x1.ffe0000000210p-14, -0x1.1c00000000000p-83}, {-0x1.0000008000000p-1, 0x1.ffffff8200000p-58, -0x1.000fff8000000p-1, -0x1.fffffe0000000p-63, -0x1.0008000000000p+0, 0x1.efffff9200000p-58}, {0x1.0000000000000p-1, 0x1.0001f9e000000p-61, 0x1.0000000000040p-1, -0x1.fffffc0080000p-73, 0x1.0000000000020p+0, 0x1.ffc3f3c080000p-62}, {0x1.0000000000000p-1, 0x1.0001f9e000000p-61, -0x1.0000000000040p-1, 0x1.fffffc0080000p-73, -0x1.fff7fef031020p-48, 0x1.0000000000000p-106}, {-0x1.0000000000000p-1, -0x1.0001f9e000000p-61, 0x1.0000000000040p-1, -0x1.fffffc0080000p-73, 0x1.fff7fef031020p-48, -0x1.0000000000000p-106}, {-0x1.0000000000000p-1, -0x1.0001f9e000000p-61, -0x1.0000000000040p-1, 0x1.fffffc0080000p-73, -0x1.0000000000020p+0, -0x1.ffc3f3c080000p-62}, {0x1.0000ff0007e00p-1, 0x1.ffc001ff00000p-68, 0x1.0000010000000p-1, -0x1.ffc007ffffe20p-59, 0x1.0000800003f00p+0, -0x1.fec027ff00600p-59}, {0x1.0000ff0007e00p-1, 0x1.ffc001ff00000p-68, -0x1.0000010000000p-1, 0x1.ffc007ffffe20p-59, 0x1.fc000fc001006p-18, -0x1.7ff009e000000p-79}, {-0x1.0000ff0007e00p-1, -0x1.ffc001ff00000p-68, 0x1.0000010000000p-1, -0x1.ffc007ffffe20p-59, -0x1.fc000fc001006p-18, 0x1.7ff009e000000p-79}, {-0x1.0000ff0007e00p-1, -0x1.ffc001ff00000p-68, -0x1.0000010000000p-1, 0x1.ffc007ffffe20p-59, -0x1.0000800003f00p+0, 0x1.fec027ff00600p-59}, {0x1.07ffffff1fe00p-1, 0x1.fc00000000000p-98, 0x1.0040000000000p-1, -0x1.c000000400000p-62, 0x1.041fffff8ff00p+0, -0x1.c0000003e0400p-62}, {0x1.07ffffff1fe00p-1, 0x1.fc00000000000p-98, -0x1.0040000000000p-1, 0x1.c000000400000p-62, 0x1.efffffc7f8000p-7, 0x1.c00000041fc00p-62}, {-0x1.07ffffff1fe00p-1, -0x1.fc00000000000p-98, 0x1.0040000000000p-1, -0x1.c000000400000p-62, -0x1.efffffc7f8000p-7, -0x1.c00000041fc00p-62}, {-0x1.07ffffff1fe00p-1, -0x1.fc00000000000p-98, -0x1.0040000000000p-1, 0x1.c000000400000p-62, -0x1.041fffff8ff00p+0, 0x1.c0000003e0400p-62}, {0x1.0080000000000p-1, -0x1.0000000000000p-106, 0x1.00000001fffc0p-1, 0x1.fffff80f80000p-73, 0x1.00400000fffe0p+0, 0x1.fffff80f00000p-73}, {0x1.0080000000000p-1, -0x1.0000000000000p-106, -0x1.00000001fffc0p-1, -0x1.fffff80f80000p-73, 0x1.fffff80010000p-11, -0x1.fffff81000000p-73}, {-0x1.0080000000000p-1, 0x1.0000000000000p-106, 0x1.00000001fffc0p-1, 0x1.fffff80f80000p-73, -0x1.fffff80010000p-11, 0x1.fffff81000000p-73}, {-0x1.0080000000000p-1, 0x1.0000000000000p-106, -0x1.00000001fffc0p-1, -0x1.fffff80f80000p-73, -0x1.00400000fffe0p+0, -0x1.fffff80f00000p-73}, {0x1.000000003ff00p-1, 0x0.0000000000000p+0, 0x1.0000000000000p-1, 0x1.f83007ffffe00p-61, 0x1.000000001ff80p+0, 0x1.f83007ffffe00p-61}, {0x1.000000003ff00p-1, 0x0.0000000000000p+0, -0x1.0000000000000p-1, -0x1.f83007ffffe00p-61, 0x1.ff7fff03e7fc0p-36, 0x1.0000000000000p-104}, {-0x1.000000003ff00p-1, 0x0.0000000000000p+0, 0x1.0000000000000p-1, 0x1.f83007ffffe00p-61, -0x1.ff7fff03e7fc0p-36, -0x1.0000000000000p-104}, {-0x1.000000003ff00p-1, 0x0.0000000000000p+0, -0x1.0000000000000p-1, -0x1.f83007ffffe00p-61, -0x1.000000001ff80p+0, -0x1.f83007ffffe00p-61}, {0x1.00003fffffe00p-1, 0x1.fffffc0000380p-61, 0x1.0000010000000p-1, -0x1.ffffff8000008p-57, 0x1.0000207ffff00p+0, -0x1.dfffffbffffd0p-57}, {0x1.00003fffffe00p-1, 0x1.fffffc0000380p-61, -0x1.0000010000000p-1, 0x1.ffffff8000008p-57, 0x1.f7ffff0011000p-20, -0x1.7ffff80000000p-82}, {-0x1.00003fffffe00p-1, -0x1.fffffc0000380p-61, 0x1.0000010000000p-1, -0x1.ffffff8000008p-57, -0x1.f7ffff0011000p-20, 0x1.7ffff80000000p-82}, {-0x1.00003fffffe00p-1, -0x1.fffffc0000380p-61, -0x1.0000010000000p-1, 0x1.ffffff8000008p-57, -0x1.0000207ffff00p+0, 0x1.dfffffbffffd0p-57}, {0x1.0000000080000p-1, -0x1.fffffc0010000p-70, 0x1.3fffff8000000p-1, 0x1.fffff800fe000p-67, 0x1.1fffffc040000p+0, 0x1.bffff880fc000p-67}, {0x1.0000000080000p-1, -0x1.fffffc0010000p-70, -0x1.3fffff8000000p-1, -0x1.fffff800fe000p-67, -0x1.fffffbfc00000p-4, -0x1.1ffffbc080000p-66}, {-0x1.0000000080000p-1, 0x1.fffffc0010000p-70, 0x1.3fffff8000000p-1, 0x1.fffff800fe000p-67, 0x1.fffffbfc00000p-4, 0x1.1ffffbc080000p-66}, {-0x1.0000000080000p-1, 0x1.fffffc0010000p-70, -0x1.3fffff8000000p-1, -0x1.fffff800fe000p-67, -0x1.1fffffc040000p+0, -0x1.bffff880fc000p-67}, {0x1.0003f001fc3f0p-1, 0x1.fffffc0000000p-57, 0x1.0000000000000p-1, 0x1.fc1fffc0000fep-55, 0x1.0001f800fe1f8p+0, 0x1.3e0fff6000080p-54}, {0x1.0003f001fc3f0p-1, 0x1.fffffc0000000p-57, -0x1.0000000000000p-1, -0x1.fc1fffc0000fep-55, 0x1.f800fe1f7d07cp-16, -0x1.80001fc000000p-80}, {-0x1.0003f001fc3f0p-1, -0x1.fffffc0000000p-57, 0x1.0000000000000p-1, 0x1.fc1fffc0000fep-55, -0x1.f800fe1f7d07cp-16, 0x1.80001fc000000p-80}, {-0x1.0003f001fc3f0p-1, -0x1.fffffc0000000p-57, -0x1.0000000000000p-1, -0x1.fc1fffc0000fep-55, -0x1.0001f800fe1f8p+0, -0x1.3e0fff6000080p-54}, {0x1.0000000000000p-1, 0x1.fffffffffffc0p-60, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-63, 0x1.0000000000000p+0, 0x1.1ffffffffffc0p-59}, {0x1.0000000000000p-1, 0x1.fffffffffffc0p-60, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-63, 0x1.c000000000000p-60, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffffffffffc0p-60, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-63, -0x1.c000000000000p-60, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffffffffffc0p-60, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-63, -0x1.0000000000000p+0, -0x1.1ffffffffffc0p-59}, {0x1.0000000100000p-1, -0x1.0000000000000p-80, 0x1.0000004000000p-1, -0x1.0000000000000p-81, 0x1.0000002080000p+0, -0x1.8000000000000p-80}, {0x1.0000000100000p-1, -0x1.0000000000000p-80, -0x1.0000004000000p-1, 0x1.0000000000000p-81, -0x1.f800000000000p-28, -0x1.0000000000000p-81}, {-0x1.0000000100000p-1, 0x1.0000000000000p-80, 0x1.0000004000000p-1, -0x1.0000000000000p-81, 0x1.f800000000000p-28, 0x1.0000000000000p-81}, {-0x1.0000000100000p-1, 0x1.0000000000000p-80, -0x1.0000004000000p-1, 0x1.0000000000000p-81, -0x1.0000002080000p+0, 0x1.8000000000000p-80}, {0x1.0000010000000p-1, -0x1.ffffe00001000p-57, 0x1.000ffffff007fp-1, 0x1.ffffc00000000p-82, 0x1.0008007ff803fp+0, 0x1.c000041fffdc0p-54}, {0x1.0000010000000p-1, -0x1.ffffe00001000p-57, -0x1.000ffffff007fp-1, -0x1.ffffc00000000p-82, -0x1.ffdffe00fe400p-14, 0x1.effff20000000p-77}, {-0x1.0000010000000p-1, 0x1.ffffe00001000p-57, 0x1.000ffffff007fp-1, 0x1.ffffc00000000p-82, 0x1.ffdffe00fe400p-14, -0x1.effff20000000p-77}, {-0x1.0000010000000p-1, 0x1.ffffe00001000p-57, -0x1.000ffffff007fp-1, -0x1.ffffc00000000p-82, -0x1.0008007ff803fp+0, -0x1.c000041fffdc0p-54}, {0x1.1000fffffc000p-1, 0x1.fffffc003f000p-57, 0x1.0000000001000p-1, -0x1.0000000000000p-106, 0x1.08007ffffe800p+0, 0x1.fffffc003f000p-57}, {0x1.1000fffffc000p-1, 0x1.fffffc003f000p-57, -0x1.0000000001000p-1, 0x1.0000000000000p-106, 0x1.000fffffb0002p-5, -0x1.ffe07fc000000p-80}, {-0x1.1000fffffc000p-1, -0x1.fffffc003f000p-57, 0x1.0000000001000p-1, -0x1.0000000000000p-106, -0x1.000fffffb0002p-5, 0x1.ffe07fc000000p-80}, {-0x1.1000fffffc000p-1, -0x1.fffffc003f000p-57, -0x1.0000000001000p-1, 0x1.0000000000000p-106, -0x1.08007ffffe800p+0, -0x1.fffffc003f000p-57}, {0x1.00000fff80000p-1, 0x1.fffe000000000p-86, 0x1.0000001f00000p-1, 0x1.fffffff000000p-78, 0x1.0000080f40000p+0, 0x1.00ffff0000000p-77}, {0x1.00000fff80000p-1, 0x1.fffe000000000p-86, -0x1.0000001f00000p-1, -0x1.fffffff000000p-78, 0x1.fc10000000000p-22, -0x1.fe0001f000000p-78}, {-0x1.00000fff80000p-1, -0x1.fffe000000000p-86, 0x1.0000001f00000p-1, 0x1.fffffff000000p-78, -0x1.fc10000000000p-22, 0x1.fe0001f000000p-78}, {-0x1.00000fff80000p-1, -0x1.fffe000000000p-86, -0x1.0000001f00000p-1, -0x1.fffffff000000p-78, -0x1.0000080f40000p+0, -0x1.00ffff0000000p-77}, {0x1.3fdfffff02000p-1, -0x1.0000000000000p-79, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-62, 0x1.1fefffff81000p+0, 0x1.ffff7fffffe00p-62}, {0x1.3fdfffff02000p-1, -0x1.0000000000000p-79, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-62, 0x1.fefffff810000p-4, -0x1.00003ffffff00p-61}, {-0x1.3fdfffff02000p-1, 0x1.0000000000000p-79, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-62, -0x1.fefffff810000p-4, 0x1.00003ffffff00p-61}, {-0x1.3fdfffff02000p-1, 0x1.0000000000000p-79, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-62, -0x1.1fefffff81000p+0, -0x1.ffff7fffffe00p-62}, {0x1.0000000000008p-1, -0x1.e0ffffd002000p-67, 0x1.0000000000400p-1, 0x1.ffffffff03ffep-55, 0x1.0000000000204p+0, 0x1.ffe1efff06ffcp-55}, {0x1.0000000000008p-1, -0x1.e0ffffd002000p-67, -0x1.0000000000400p-1, -0x1.ffffffff03ffep-55, -0x1.fc4003c1ffe02p-44, 0x0.0000000000000p+0}, {-0x1.0000000000008p-1, 0x1.e0ffffd002000p-67, 0x1.0000000000400p-1, 0x1.ffffffff03ffep-55, 0x1.fc4003c1ffe02p-44, 0x0.0000000000000p+0}, {-0x1.0000000000008p-1, 0x1.e0ffffd002000p-67, -0x1.0000000000400p-1, -0x1.ffffffff03ffep-55, -0x1.0000000000204p+0, -0x1.ffe1efff06ffcp-55}, {0x1.000000fffe020p-1, -0x1.f800100000000p-74, 0x1.0001fff80ffc0p-1, 0x1.ff00000000000p-98, 0x1.0001007c06ff0p+0, -0x1.f8000e0000000p-74}, {0x1.000000fffe020p-1, -0x1.f800100000000p-74, -0x1.0001fff80ffc0p-1, -0x1.ff00000000000p-98, -0x1.fef811fa00000p-17, -0x1.f80011ff00000p-74}, {-0x1.000000fffe020p-1, 0x1.f800100000000p-74, 0x1.0001fff80ffc0p-1, 0x1.ff00000000000p-98, 0x1.fef811fa00000p-17, 0x1.f80011ff00000p-74}, {-0x1.000000fffe020p-1, 0x1.f800100000000p-74, -0x1.0001fff80ffc0p-1, -0x1.ff00000000000p-98, -0x1.0001007c06ff0p+0, 0x1.f8000e0000000p-74}, {0x1.4000000000000p-1, -0x1.0000000000000p-106, 0x1.0000000000010p-1, 0x1.e000000000000p-69, 0x1.2000000000008p+0, 0x1.e000000000000p-69}, {0x1.4000000000000p-1, -0x1.0000000000000p-106, -0x1.0000000000010p-1, -0x1.e000000000000p-69, 0x1.fffffffffff80p-4, -0x1.e000000008000p-69}, {-0x1.4000000000000p-1, 0x1.0000000000000p-106, 0x1.0000000000010p-1, 0x1.e000000000000p-69, -0x1.fffffffffff80p-4, 0x1.e000000008000p-69}, {-0x1.4000000000000p-1, 0x1.0000000000000p-106, -0x1.0000000000010p-1, -0x1.e000000000000p-69, -0x1.2000000000008p+0, -0x1.e000000000000p-69}, {0x1.2000000000000p-1, -0x1.fffffff01ff20p-58, 0x1.0000000000000p-1, 0x1.fff8003ff0000p-58, 0x1.1000000000000p+0, -0x1.ffec0bfc80000p-72}, {0x1.2000000000000p-1, -0x1.fffffff01ff20p-58, -0x1.0000000000000p-1, -0x1.fff8003ff0000p-58, 0x1.ffffffffffffep-5, 0x1.fff3fc0380000p-72}, {-0x1.2000000000000p-1, 0x1.fffffff01ff20p-58, 0x1.0000000000000p-1, 0x1.fff8003ff0000p-58, -0x1.ffffffffffffep-5, -0x1.fff3fc0380000p-72}, {-0x1.2000000000000p-1, 0x1.fffffff01ff20p-58, -0x1.0000000000000p-1, -0x1.fff8003ff0000p-58, -0x1.1000000000000p+0, 0x1.ffec0bfc80000p-72}, {0x1.2000000000000p-1, -0x1.fc08000000000p-93, 0x1.0000000038004p-1, -0x1.fffffc4000000p-70, 0x1.100000001c002p+0, -0x1.0000001c00000p-69}, {0x1.2000000000000p-1, -0x1.fc08000000000p-93, -0x1.0000000038004p-1, 0x1.fffffc4000000p-70, 0x1.fffffffc7ffc0p-5, 0x1.fffff847f0000p-70}, {-0x1.2000000000000p-1, 0x1.fc08000000000p-93, 0x1.0000000038004p-1, -0x1.fffffc4000000p-70, -0x1.fffffffc7ffc0p-5, -0x1.fffff847f0000p-70}, {-0x1.2000000000000p-1, 0x1.fc08000000000p-93, -0x1.0000000038004p-1, 0x1.fffffc4000000p-70, -0x1.100000001c002p+0, 0x1.0000001c00000p-69}, {0x1.0000000000200p-1, 0x0.0000000000000p+0, 0x1.00001ffff0000p-1, 0x1.ffff80001f000p-58, 0x1.00000ffff8100p+0, 0x1.ffff80001f000p-58}, {0x1.0000000000200p-1, 0x0.0000000000000p+0, -0x1.00001ffff0000p-1, -0x1.ffff80001f000p-58, -0x1.fffefe0010000p-21, 0x1.ffff840000000p-76}, {-0x1.0000000000200p-1, 0x0.0000000000000p+0, 0x1.00001ffff0000p-1, 0x1.ffff80001f000p-58, 0x1.fffefe0010000p-21, -0x1.ffff840000000p-76}, {-0x1.0000000000200p-1, 0x0.0000000000000p+0, -0x1.00001ffff0000p-1, -0x1.ffff80001f000p-58, -0x1.00000ffff8100p+0, -0x1.ffff80001f000p-58}, {0x1.0000100000000p-1, -0x1.0000000000000p-106, 0x1.0038000800000p-1, -0x1.fffffe0000080p-61, 0x1.001c080400000p+0, -0x1.fffffe0000100p-61}, {0x1.0000100000000p-1, -0x1.0000000000000p-106, -0x1.0038000800000p-1, 0x1.fffffe0000080p-61, -0x1.bf803fffffff0p-12, -0x1.0000000000000p-84}, {-0x1.0000100000000p-1, 0x1.0000000000000p-106, 0x1.0038000800000p-1, -0x1.fffffe0000080p-61, 0x1.bf803fffffff0p-12, 0x1.0000000000000p-84}, {-0x1.0000100000000p-1, 0x1.0000000000000p-106, -0x1.0038000800000p-1, 0x1.fffffe0000080p-61, -0x1.001c080400000p+0, 0x1.fffffe0000100p-61}, {0x1.0000000000004p-1, -0x1.ffffe00400000p-74, 0x1.0000000000000p-1, 0x1.ffffffffffff8p-57, 0x1.0000000000002p+0, 0x1.ffff00000ffe0p-57}, {0x1.0000000000004p-1, -0x1.ffffe00400000p-74, -0x1.0000000000000p-1, -0x1.ffffffffffff8p-57, 0x1.effff800007ffp-52, 0x1.0000000000000p-106}, {-0x1.0000000000004p-1, 0x1.ffffe00400000p-74, 0x1.0000000000000p-1, 0x1.ffffffffffff8p-57, -0x1.effff800007ffp-52, -0x1.0000000000000p-106}, {-0x1.0000000000004p-1, 0x1.ffffe00400000p-74, -0x1.0000000000000p-1, -0x1.ffffffffffff8p-57, -0x1.0000000000002p+0, -0x1.ffff00000ffe0p-57}, {0x1.0000000000100p-1, -0x1.ffffe7e400000p-71, 0x1.1ffe000008000p-1, -0x1.fffc000004000p-68, 0x1.0fff000004080p+0, -0x1.1ffdfe7e40000p-67}, {0x1.0000000000100p-1, -0x1.ffffe7e400000p-71, -0x1.1ffe000008000p-1, 0x1.fffc000004000p-68, -0x1.ffe000007f000p-5, 0x1.bffc030384000p-68}, {-0x1.0000000000100p-1, 0x1.ffffe7e400000p-71, 0x1.1ffe000008000p-1, -0x1.fffc000004000p-68, 0x1.ffe000007f000p-5, -0x1.bffc030384000p-68}, {-0x1.0000000000100p-1, 0x1.ffffe7e400000p-71, -0x1.1ffe000008000p-1, 0x1.fffc000004000p-68, -0x1.0fff000004080p+0, 0x1.1ffdfe7e40000p-67}, {0x1.0000000000004p-1, -0x1.0000000000000p-106, 0x1.00000007ffffep-1, 0x1.ffffe000f0000p-62, 0x1.0000000400001p+0, 0x1.ffffe000f0000p-62}, {0x1.0000000000004p-1, -0x1.0000000000000p-106, -0x1.00000007ffffep-1, -0x1.ffffe000f0000p-62, -0x1.ffffe803ffffcp-31, -0x1.e020000000000p-95}, {-0x1.0000000000004p-1, 0x1.0000000000000p-106, 0x1.00000007ffffep-1, 0x1.ffffe000f0000p-62, 0x1.ffffe803ffffcp-31, 0x1.e020000000000p-95}, {-0x1.0000000000004p-1, 0x1.0000000000000p-106, -0x1.00000007ffffep-1, -0x1.ffffe000f0000p-62, -0x1.0000000400001p+0, -0x1.ffffe000f0000p-62}, {0x1.0000000000000p-1, 0x1.fffffff000000p-62, 0x1.0001fffc00001p-1, -0x1.0000000000000p-80, 0x1.0000fffe00001p+0, -0x1.fe00004010000p-54}, {0x1.0000000000000p-1, 0x1.fffffff000000p-62, -0x1.0001fffc00001p-1, 0x1.0000000000000p-80, -0x1.fffc00000ff00p-17, 0x1.ff80000000000p-81}, {-0x1.0000000000000p-1, -0x1.fffffff000000p-62, 0x1.0001fffc00001p-1, -0x1.0000000000000p-80, 0x1.fffc00000ff00p-17, -0x1.ff80000000000p-81}, {-0x1.0000000000000p-1, -0x1.fffffff000000p-62, -0x1.0001fffc00001p-1, 0x1.0000000000000p-80, -0x1.0000fffe00001p+0, 0x1.fe00004010000p-54}, {0x1.00007fdfffff0p-1, 0x1.fff000f803fe0p-59, 0x1.0080000000000p-1, -0x1.0000000000000p-93, 0x1.00403fefffff8p+0, 0x1.fff000f7c4000p-59}, {0x1.00007fdfffff0p-1, 0x1.fff000f803fe0p-59, -0x1.0080000000000p-1, 0x1.0000000000000p-93, -0x1.fe00800003fe0p-11, -0x1.ffe0f78040000p-72}, {-0x1.00007fdfffff0p-1, -0x1.fff000f803fe0p-59, 0x1.0080000000000p-1, -0x1.0000000000000p-93, 0x1.fe00800003fe0p-11, 0x1.ffe0f78040000p-72}, {-0x1.00007fdfffff0p-1, -0x1.fff000f803fe0p-59, -0x1.0080000000000p-1, 0x1.0000000000000p-93, -0x1.00403fefffff8p+0, -0x1.fff000f7c4000p-59}, {0x1.0000000000080p-1, 0x0.0000000000000p+0, 0x1.0000080000000p-1, -0x1.0000000000000p-86, 0x1.0000040000040p+0, -0x1.0000000000000p-86}, {0x1.0000000000080p-1, 0x0.0000000000000p+0, -0x1.0000080000000p-1, 0x1.0000000000000p-86, -0x1.fffffe0000000p-23, 0x1.0000000000000p-86}, {-0x1.0000000000080p-1, 0x0.0000000000000p+0, 0x1.0000080000000p-1, -0x1.0000000000000p-86, 0x1.fffffe0000000p-23, -0x1.0000000000000p-86}, {-0x1.0000000000080p-1, 0x0.0000000000000p+0, -0x1.0000080000000p-1, 0x1.0000000000000p-86, -0x1.0000040000040p+0, 0x1.0000000000000p-86}, {0x1.0400000000000p-1, -0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.fffff00008000p-57, 0x1.0200000000200p+0, -0x1.fffff00008000p-57}, {0x1.0400000000000p-1, -0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.fffff00008000p-57, 0x1.ffffffffe0010p-8, -0x1.ffff001000000p-78}, {-0x1.0400000000000p-1, 0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.fffff00008000p-57, -0x1.ffffffffe0010p-8, 0x1.ffff001000000p-78}, {-0x1.0400000000000p-1, 0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.fffff00008000p-57, -0x1.0200000000200p+0, 0x1.fffff00008000p-57}, {0x1.0000000000001p-1, -0x1.fc0000c004000p-66, 0x1.0000000000200p-1, -0x1.ffe0000200000p-69, 0x1.0000000000100p+0, 0x1.ffdc403ff3fbcp-54}, {0x1.0000000000001p-1, -0x1.fc0000c004000p-66, -0x1.0000000000200p-1, 0x1.ffe0000200000p-69, -0x1.ff000de020060p-45, 0x1.e000000000000p-101}, {-0x1.0000000000001p-1, 0x1.fc0000c004000p-66, 0x1.0000000000200p-1, -0x1.ffe0000200000p-69, 0x1.ff000de020060p-45, -0x1.e000000000000p-101}, {-0x1.0000000000001p-1, 0x1.fc0000c004000p-66, -0x1.0000000000200p-1, 0x1.ffe0000200000p-69, -0x1.0000000000100p+0, -0x1.ffdc403ff3fbcp-54}, {0x1.00000c0000004p-1, -0x1.ff80000800000p-69, 0x1.18003ffff8000p-1, 0x1.ffffff8000000p-67, 0x1.0c0025fffc002p+0, 0x1.801fff7e00000p-67}, {0x1.00000c0000004p-1, -0x1.ff80000800000p-69, -0x1.18003ffff8000p-1, -0x1.ffffff8000000p-67, -0x1.80033fff7ffc0p-5, -0x1.3fefffc100000p-66}, {-0x1.00000c0000004p-1, 0x1.ff80000800000p-69, 0x1.18003ffff8000p-1, 0x1.ffffff8000000p-67, 0x1.80033fff7ffc0p-5, 0x1.3fefffc100000p-66}, {-0x1.00000c0000004p-1, 0x1.ff80000800000p-69, -0x1.18003ffff8000p-1, -0x1.ffffff8000000p-67, -0x1.0c0025fffc002p+0, -0x1.801fff7e00000p-67}, {0x1.1ffff80000040p-1, -0x1.0000000000000p-91, 0x1.000000000fe00p-1, 0x1.ffff7e0003ff8p-57, 0x1.0ffffc0007f20p+0, 0x1.ffff7dffc4000p-57}, {0x1.1ffff80000040p-1, -0x1.0000000000000p-91, -0x1.000000000fe00p-1, -0x1.ffff7e0003ff8p-57, 0x1.ffff7fff023fep-5, 0x1.03ff780100000p-74}, {-0x1.1ffff80000040p-1, 0x1.0000000000000p-91, 0x1.000000000fe00p-1, 0x1.ffff7e0003ff8p-57, -0x1.ffff7fff023fep-5, -0x1.03ff780100000p-74}, {-0x1.1ffff80000040p-1, 0x1.0000000000000p-91, -0x1.000000000fe00p-1, -0x1.ffff7e0003ff8p-57, -0x1.0ffffc0007f20p+0, -0x1.ffff7dffc4000p-57}, {0x1.3fc0000040000p-1, -0x1.fffffff802000p-57, 0x1.fffffffffff00p-1, 0x0.0000000000000p+0, 0x1.9fe000001ff80p+0, -0x1.fffffff802000p-57}, {0x1.3fc0000040000p-1, -0x1.fffffff802000p-57, -0x1.fffffffffff00p-1, 0x0.0000000000000p+0, -0x1.807fffff7fe00p-2, -0x1.fffffff802000p-57}, {-0x1.3fc0000040000p-1, 0x1.fffffff802000p-57, 0x1.fffffffffff00p-1, 0x0.0000000000000p+0, 0x1.807fffff7fe00p-2, 0x1.fffffff802000p-57}, {-0x1.3fc0000040000p-1, 0x1.fffffff802000p-57, -0x1.fffffffffff00p-1, 0x0.0000000000000p+0, -0x1.9fe000001ff80p+0, 0x1.fffffff802000p-57}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, 0x1.0000000000200p-1, -0x1.0000000000000p-106, 0x1.0000000100100p+0, -0x1.ffffbffff8200p-54}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, -0x1.0000000000200p-1, 0x1.0000000000000p-106, 0x1.ffdff00002000p-33, 0x1.f804000000000p-92}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, 0x1.0000000000200p-1, -0x1.0000000000000p-106, -0x1.ffdff00002000p-33, -0x1.f804000000000p-92}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, -0x1.0000000000200p-1, 0x1.0000000000000p-106, -0x1.0000000100100p+0, 0x1.ffffbffff8200p-54}, {0x1.0000000010000p-1, -0x1.0000000000000p-78, 0x1.1fff010000000p-1, 0x1.ff8c0000007fep-55, 0x1.0fff808008000p+0, 0x1.ff8bfe0000800p-55}, {0x1.0000000010000p-1, -0x1.0000000000000p-78, -0x1.1fff010000000p-1, -0x1.ff8c0000007fep-55, -0x1.fff00fff00008p-5, 0x1.cff7fffe00800p-65}, {-0x1.0000000010000p-1, 0x1.0000000000000p-78, 0x1.1fff010000000p-1, 0x1.ff8c0000007fep-55, 0x1.fff00fff00008p-5, -0x1.cff7fffe00800p-65}, {-0x1.0000000010000p-1, 0x1.0000000000000p-78, -0x1.1fff010000000p-1, -0x1.ff8c0000007fep-55, -0x1.0fff808008000p+0, -0x1.ff8bfe0000800p-55}, {0x1.0000000000002p-1, -0x1.0000000000000p-88, 0x1.0000000000200p-1, -0x1.0000000000000p-86, 0x1.0000000000101p+0, -0x1.4000000000000p-86}, {0x1.0000000000002p-1, -0x1.0000000000000p-88, -0x1.0000000000200p-1, 0x1.0000000000000p-86, -0x1.fdffffffffa00p-45, 0x0.0000000000000p+0}, {-0x1.0000000000002p-1, 0x1.0000000000000p-88, 0x1.0000000000200p-1, -0x1.0000000000000p-86, 0x1.fdffffffffa00p-45, 0x0.0000000000000p+0}, {-0x1.0000000000002p-1, 0x1.0000000000000p-88, -0x1.0000000000200p-1, 0x1.0000000000000p-86, -0x1.0000000000101p+0, 0x1.4000000000000p-86}, {0x1.0000000000002p-1, -0x1.ffff800008000p-68, 0x1.000000003fffep-1, 0x1.f81fc007c0000p-72, 0x1.0000000020000p+0, -0x1.e07d83ff90000p-68}, {0x1.0000000000002p-1, -0x1.ffff800008000p-68, -0x1.000000003fffep-1, -0x1.f81fc007c0000p-72, -0x1.fffe00021f818p-36, 0x1.ffbe000000000p-91}, {-0x1.0000000000002p-1, 0x1.ffff800008000p-68, 0x1.000000003fffep-1, 0x1.f81fc007c0000p-72, 0x1.fffe00021f818p-36, -0x1.ffbe000000000p-91}, {-0x1.0000000000002p-1, 0x1.ffff800008000p-68, -0x1.000000003fffep-1, -0x1.f81fc007c0000p-72, -0x1.0000000020000p+0, 0x1.e07d83ff90000p-68}, {0x1.7ffffffff0000p-1, 0x1.ffff07fffc000p-65, 0x1.000000000ffe0p-1, 0x1.ff0000003c000p-64, 0x1.3fffffffffff0p+0, 0x1.7f7fc2001d000p-63}, {0x1.7ffffffff0000p-1, 0x1.ffff07fffc000p-65, -0x1.000000000ffe0p-1, -0x1.ff0000003c000p-64, 0x1.ffffffff80080p-3, -0x1.fe00f8007c000p-65}, {-0x1.7ffffffff0000p-1, -0x1.ffff07fffc000p-65, 0x1.000000000ffe0p-1, 0x1.ff0000003c000p-64, -0x1.ffffffff80080p-3, 0x1.fe00f8007c000p-65}, {-0x1.7ffffffff0000p-1, -0x1.ffff07fffc000p-65, -0x1.000000000ffe0p-1, -0x1.ff0000003c000p-64, -0x1.3fffffffffff0p+0, -0x1.7f7fc2001d000p-63}, {0x1.00007fff00080p-1, -0x1.ffffff0001000p-66, 0x1.00000000007c0p-1, 0x1.ffffff8000000p-68, 0x1.00003fff80420p+0, -0x1.7fffff2000000p-66}, {0x1.00007fff00080p-1, -0x1.ffffff0001000p-66, -0x1.00000000007c0p-1, -0x1.ffffff8000000p-68, 0x1.fffbfe2ffffb0p-19, 0x1.1fff000000000p-90}, {-0x1.00007fff00080p-1, 0x1.ffffff0001000p-66, 0x1.00000000007c0p-1, 0x1.ffffff8000000p-68, -0x1.fffbfe2ffffb0p-19, -0x1.1fff000000000p-90}, {-0x1.00007fff00080p-1, 0x1.ffffff0001000p-66, -0x1.00000000007c0p-1, -0x1.ffffff8000000p-68, -0x1.00003fff80420p+0, 0x1.7fffff2000000p-66}, {0x1.1fff81ff00000p-1, 0x1.e007ffff00000p-58, 0x1.1ffffffff8000p-1, 0x1.fe001ffffffe0p-57, 0x1.1fffc0ff7c000p+0, 0x1.77020fffbfff0p-56}, {0x1.1fff81ff00000p-1, 0x1.e007ffff00000p-58, -0x1.1ffffffff8000p-1, -0x1.fe001ffffffe0p-57, -0x1.f803e0000437fp-19, -0x1.0003fff000000p-76}, {-0x1.1fff81ff00000p-1, -0x1.e007ffff00000p-58, 0x1.1ffffffff8000p-1, 0x1.fe001ffffffe0p-57, 0x1.f803e0000437fp-19, 0x1.0003fff000000p-76}, {-0x1.1fff81ff00000p-1, -0x1.e007ffff00000p-58, -0x1.1ffffffff8000p-1, -0x1.fe001ffffffe0p-57, -0x1.1fffc0ff7c000p+0, -0x1.77020fffbfff0p-56}, {0x1.0000000000000p-1, 0x1.fffc03fe00700p-62, 0x1.0000000000001p-1, -0x1.fff8060000f34p-56, 0x1.0000000000000p+0, 0x1.8201fa83fdc3ap-54}, {0x1.0000000000000p-1, 0x1.fffc03fe00700p-62, -0x1.0000000000001p-1, 0x1.fff8060000f34p-56, -0x1.7e02027c01c2cp-54, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffc03fe00700p-62, 0x1.0000000000001p-1, -0x1.fff8060000f34p-56, 0x1.7e02027c01c2cp-54, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffc03fe00700p-62, -0x1.0000000000001p-1, 0x1.fff8060000f34p-56, -0x1.0000000000000p+0, -0x1.8201fa83fdc3ap-54}, {0x1.001ffffc00080p-1, -0x1.fe00000200000p-62, 0x1.0000000001000p-1, -0x1.fe3ffffff0080p-61, 0x1.000ffffe00840p+0, -0x1.7ea0000078000p-60}, {0x1.001ffffc00080p-1, -0x1.fe00000200000p-62, -0x1.0000000001000p-1, 0x1.fe3ffffff0080p-61, 0x1.ffffbff080010p-13, -0x1.8000021ff0000p-70}, {-0x1.001ffffc00080p-1, 0x1.fe00000200000p-62, 0x1.0000000001000p-1, -0x1.fe3ffffff0080p-61, -0x1.ffffbff080010p-13, 0x1.8000021ff0000p-70}, {-0x1.001ffffc00080p-1, 0x1.fe00000200000p-62, -0x1.0000000001000p-1, 0x1.fe3ffffff0080p-61, -0x1.000ffffe00840p+0, 0x1.7ea0000078000p-60}, {0x1.00001fffff800p-1, 0x1.ffffff801ffc0p-60, 0x1.0000000002000p-1, -0x1.0000000000000p-106, 0x1.0000100000c00p+0, 0x1.ffffff801ff80p-60}, {0x1.00001fffff800p-1, 0x1.ffffff801ffc0p-60, -0x1.0000000002000p-1, 0x1.0000000000000p-106, 0x1.ffffd80004000p-21, -0x1.ff80000000000p-86}, {-0x1.00001fffff800p-1, -0x1.ffffff801ffc0p-60, 0x1.0000000002000p-1, -0x1.0000000000000p-106, -0x1.ffffd80004000p-21, 0x1.ff80000000000p-86}, {-0x1.00001fffff800p-1, -0x1.ffffff801ffc0p-60, -0x1.0000000002000p-1, 0x1.0000000000000p-106, -0x1.0000100000c00p+0, -0x1.ffffff801ff80p-60}, {0x1.0000000000000p-1, 0x1.ffff83ffbfff0p-57, 0x1.0000000000000p-1, 0x1.ffffffffe0000p-57, 0x1.0000000000000p+0, 0x1.ffffc1ffcfff8p-56}, {0x1.0000000000000p-1, 0x1.ffff83ffbfff0p-57, -0x1.0000000000000p-1, -0x1.ffffffffe0000p-57, -0x1.f000800400000p-75, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ffff83ffbfff0p-57, 0x1.0000000000000p-1, 0x1.ffffffffe0000p-57, 0x1.f000800400000p-75, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ffff83ffbfff0p-57, -0x1.0000000000000p-1, -0x1.ffffffffe0000p-57, -0x1.0000000000000p+0, -0x1.ffffc1ffcfff8p-56}, {0x1.0000000000000p-1, 0x1.fffe7ff3dff00p-62, 0x1.000007f830000p-1, 0x1.fff0000ffe100p-62, 0x1.000003fc18000p+0, 0x1.fff74001ef000p-61}, {0x1.0000000000000p-1, 0x1.fffe7ff3dff00p-62, -0x1.000007f830000p-1, -0x1.fff0000ffe100p-62, -0x1.fe0bffffffffep-23, -0x1.801c1e2000000p-78}, {-0x1.0000000000000p-1, -0x1.fffe7ff3dff00p-62, 0x1.000007f830000p-1, 0x1.fff0000ffe100p-62, 0x1.fe0bffffffffep-23, 0x1.801c1e2000000p-78}, {-0x1.0000000000000p-1, -0x1.fffe7ff3dff00p-62, -0x1.000007f830000p-1, -0x1.fff0000ffe100p-62, -0x1.000003fc18000p+0, -0x1.fff74001ef000p-61}, {0x1.00000ffffe000p-1, 0x1.fffffffffc000p-68, 0x1.0000000000002p-1, -0x1.fffffe01f8004p-56, 0x1.000007ffff001p+0, -0x1.ffdffe01f8008p-56}, {0x1.00000ffffe000p-1, 0x1.fffffffffc000p-68, -0x1.0000000000002p-1, 0x1.fffffe01f8004p-56, 0x1.ffffbffc80080p-22, -0x1.fe08000000000p-80}, {-0x1.00000ffffe000p-1, -0x1.fffffffffc000p-68, 0x1.0000000000002p-1, -0x1.fffffe01f8004p-56, -0x1.ffffbffc80080p-22, 0x1.fe08000000000p-80}, {-0x1.00000ffffe000p-1, -0x1.fffffffffc000p-68, -0x1.0000000000002p-1, 0x1.fffffe01f8004p-56, -0x1.000007ffff001p+0, 0x1.ffdffe01f8008p-56}, {0x1.0000000000060p-1, 0x1.fffe3fff00000p-64, 0x1.0000000002000p-1, -0x1.ffe0002000000p-58, 0x1.0000000001030p+0, -0x1.f7e0072004000p-58}, {0x1.0000000000060p-1, 0x1.fffe3fff00000p-64, -0x1.0000000002000p-1, 0x1.ffe0002000000p-58, -0x1.f9fefc1003700p-41, -0x1.0000000000000p-96}, {-0x1.0000000000060p-1, -0x1.fffe3fff00000p-64, 0x1.0000000002000p-1, -0x1.ffe0002000000p-58, 0x1.f9fefc1003700p-41, 0x1.0000000000000p-96}, {-0x1.0000000000060p-1, -0x1.fffe3fff00000p-64, -0x1.0000000002000p-1, 0x1.ffe0002000000p-58, -0x1.0000000001030p+0, 0x1.f7e0072004000p-58}, {0x1.0003ffffffff8p-1, 0x1.ffffe07e00000p-75, 0x1.07ff000008000p-1, -0x1.e000020000000p-62, 0x1.0401800003ffcp+0, -0x1.dff00200fc000p-62}, {0x1.0003ffffffff8p-1, 0x1.ffffe07e00000p-75, -0x1.07ff000008000p-1, 0x1.e000020000000p-62, -0x1.fec0000200200p-7, 0x1.e01001ff03f00p-62}, {-0x1.0003ffffffff8p-1, -0x1.ffffe07e00000p-75, 0x1.07ff000008000p-1, -0x1.e000020000000p-62, 0x1.fec0000200200p-7, -0x1.e01001ff03f00p-62}, {-0x1.0003ffffffff8p-1, -0x1.ffffe07e00000p-75, -0x1.07ff000008000p-1, 0x1.e000020000000p-62, -0x1.0401800003ffcp+0, 0x1.dff00200fc000p-62}, }; const int numAccuracyTests = sizeof(accuracyTests) / sizeof(struct testVector); #include double testAccuracy() { int i; DD a, b, c, r; double worstUlps = 0.5; for (i=0; i worstUlps) { #ifdef PRINT_ACCURACY_INFORMATION printf("New worst rounding error for (%a,%a) + (%a,%a):\n", a.hi, a.lo, b.hi, b.lo); printf("\tExpected: (%a,%a)\n", r.hi, r.lo); printf("\tComputed: (%a,%a)\n", c.hi, c.lo); printf("\tError: %f ulps\n", ulpError); #endif worstUlps = ulpError; } } } return worstUlps; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ppc/qmul_test.c0000664000175000017500000023664711221175607027717 0ustar mwhudsonmwhudson#include #include "DD.h" long double __gcc_qmul(long double x, long double y); double testAccuracy(); int testEdgeCases(); int main(int argc, char *argv[]) { if (testEdgeCases()) return 1; if (testAccuracy() > 2.0) return 1; return 0; } struct testVector { double xhi; double xlo; double yhi; double ylo; double rhi; double rlo; }; #define INFINITY __builtin_inf() #define HUGE 0x1.fffffffffffffp1023 #define QNAN __builtin_nan("") const struct testVector edgeCases[] = { { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { -0.0, 0.0, 0.0, 0.0, -0.0, 0.0 }, { 0.0, 0.0, -0.0, 0.0, -0.0, 0.0 }, { -0.0, 0.0, -0.0, 0.0, 0.0, 0.0 }, { INFINITY, 0.0, 0.0, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, 0.0, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, -0.0, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, -0.0, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, 1.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 1.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -1.0, 0.0, -INFINITY, 0.0 }, { -INFINITY, 0.0, -1.0, 0.0, INFINITY, 0.0 }, { INFINITY, 0.0, HUGE, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, HUGE, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -HUGE, 0.0, -INFINITY, 0.0 }, { -INFINITY, 0.0, -HUGE, 0.0, INFINITY, 0.0 }, { INFINITY, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { -INFINITY, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { 0.0, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { 0.0, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { -0.0, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -0.0, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { 1.0, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { 1.0, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { -1.0, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { -1.0, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { HUGE, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { HUGE, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { -HUGE, 0.0, INFINITY, 0.0, -INFINITY, 0.0 }, { -HUGE, 0.0, -INFINITY, 0.0, INFINITY, 0.0 }, { QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, }; const int numEdgeCases = sizeof(edgeCases) / sizeof(struct testVector); int testEdgeCases() { int i; DD a, b, c, r; for (i=0; i #include #include #include #ifdef __x86_64__ #define randlength 2 #else #define randlength 4 #endif void printTest(mpfr_t a, mpfr_t b, mpfr_t c) { static const double INFINITYD = __builtin_INFINITY(); MPFR_DECL_INIT(tmp, 53); double ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); double alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); double bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); double blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); double chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); double clo = isINFINITY(chi) ? 0.0 : mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); } int main(int argc, char *argv[]) { MPFR_DECL_INIT(a, 106); MPFR_DECL_INIT(b, 106); MPFR_DECL_INIT(c, 106); int exponent_range = atoi(argv[1]); int i; for (i=0; i<128; ++i) { mpfr_random2(a, randlength, exponent_range); mpfr_random2(b, randlength, exponent_range); mpfr_mul(c, a, b, GMP_RNDN); printTest(a, b, c); mpfr_neg(b, b, GMP_RNDN); mpfr_mul(c, a, b, GMP_RNDN); printTest(a, b, c); mpfr_neg(a, a, GMP_RNDN); mpfr_neg(b, b, GMP_RNDN); mpfr_mul(c, a, b, GMP_RNDN); printTest(a, b, c); mpfr_neg(b, b, GMP_RNDN); mpfr_mul(c, a, b, GMP_RNDN); printTest(a, b, c); } return 0; } */ const struct testVector accuracyTests[] = { {0x1.00001ffffff00p-784, 0x1.fffff83ff8000p-839, 0x1.00ffc00ffff00p-771, 0x1.fe0007fffff00p-827, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00001ffffff00p-784, 0x1.fffff83ff8000p-839, -0x1.00ffc00ffff00p-771, -0x1.fe0007fffff00p-827, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00001ffffff00p-784, -0x1.fffff83ff8000p-839, 0x1.00ffc00ffff00p-771, 0x1.fe0007fffff00p-827, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00001ffffff00p-784, -0x1.fffff83ff8000p-839, -0x1.00ffc00ffff00p-771, -0x1.fe0007fffff00p-827, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00001fffff800p-705, 0x1.fffffffe00000p-779, 0x1.3fffffff80000p+666, 0x1.ffffffff00000p+593, 0x1.400027ff7f5ffp-39, 0x1.e0001ffe80000p-111}, {0x1.00001fffff800p-705, 0x1.fffffffe00000p-779, -0x1.3fffffff80000p+666, -0x1.ffffffff00000p+593, -0x1.400027ff7f5ffp-39, -0x1.e0001ffe80000p-111}, {-0x1.00001fffff800p-705, -0x1.fffffffe00000p-779, 0x1.3fffffff80000p+666, 0x1.ffffffff00000p+593, -0x1.400027ff7f5ffp-39, -0x1.e0001ffe80000p-111}, {-0x1.00001fffff800p-705, -0x1.fffffffe00000p-779, -0x1.3fffffff80000p+666, -0x1.ffffffff00000p+593, 0x1.400027ff7f5ffp-39, 0x1.e0001ffe80000p-111}, {0x1.0000000800000p-800, -0x1.0000000000000p-872, 0x1.000003fffc002p-916, -0x1.0000000000000p-1021, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000000800000p-800, -0x1.0000000000000p-872, -0x1.000003fffc002p-916, 0x1.0000000000000p-1021, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000800000p-800, 0x1.0000000000000p-872, 0x1.000003fffc002p-916, -0x1.0000000000000p-1021, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000800000p-800, 0x1.0000000000000p-872, -0x1.000003fffc002p-916, 0x1.0000000000000p-1021, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.000003ffffffep-19, -0x1.ffe0080000000p-103, 0x1.0800000000000p-211, -0x1.0000000000000p-307, 0x1.0800041fffffep-230, -0x1.00000020fef08p-286}, {0x1.000003ffffffep-19, -0x1.ffe0080000000p-103, -0x1.0800000000000p-211, 0x1.0000000000000p-307, -0x1.0800041fffffep-230, 0x1.00000020fef08p-286}, {-0x1.000003ffffffep-19, 0x1.ffe0080000000p-103, 0x1.0800000000000p-211, -0x1.0000000000000p-307, -0x1.0800041fffffep-230, 0x1.00000020fef08p-286}, {-0x1.000003ffffffep-19, 0x1.ffe0080000000p-103, -0x1.0800000000000p-211, 0x1.0000000000000p-307, 0x1.0800041fffffep-230, -0x1.00000020fef08p-286}, {0x1.0000007fffc00p-464, 0x1.efe0000000000p-558, 0x1.007fffffe0000p+756, 0x0.0000000000000p+0, 0x1.008000801fbfep+292, -0x1.fffeffff07900p+231}, {0x1.0000007fffc00p-464, 0x1.efe0000000000p-558, -0x1.007fffffe0000p+756, 0x0.0000000000000p+0, -0x1.008000801fbfep+292, 0x1.fffeffff07900p+231}, {-0x1.0000007fffc00p-464, -0x1.efe0000000000p-558, 0x1.007fffffe0000p+756, 0x0.0000000000000p+0, -0x1.008000801fbfep+292, 0x1.fffeffff07900p+231}, {-0x1.0000007fffc00p-464, -0x1.efe0000000000p-558, -0x1.007fffffe0000p+756, 0x0.0000000000000p+0, 0x1.008000801fbfep+292, -0x1.fffeffff07900p+231}, {0x1.3fe0000100000p-20, -0x1.0000000000000p-93, 0x1.3fffffffffe00p-397, 0x1.fe00040000000p-472, 0x1.8fd800013fd80p-417, 0x1.ffffc7d404500p-472}, {0x1.3fe0000100000p-20, -0x1.0000000000000p-93, -0x1.3fffffffffe00p-397, -0x1.fe00040000000p-472, -0x1.8fd800013fd80p-417, -0x1.ffffc7d404500p-472}, {-0x1.3fe0000100000p-20, 0x1.0000000000000p-93, 0x1.3fffffffffe00p-397, 0x1.fe00040000000p-472, -0x1.8fd800013fd80p-417, -0x1.ffffc7d404500p-472}, {-0x1.3fe0000100000p-20, 0x1.0000000000000p-93, -0x1.3fffffffffe00p-397, -0x1.fe00040000000p-472, 0x1.8fd800013fd80p-417, 0x1.ffffc7d404500p-472}, {0x1.0001fff800000p-371, 0x1.ffffff0000ffep-425, 0x1.00ff000000800p-806, -0x1.0000000800000p-872, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0001fff800000p-371, 0x1.ffffff0000ffep-425, -0x1.00ff000000800p-806, 0x1.0000000800000p-872, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0001fff800000p-371, -0x1.ffffff0000ffep-425, 0x1.00ff000000800p-806, -0x1.0000000800000p-872, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0001fff800000p-371, -0x1.ffffff0000ffep-425, -0x1.00ff000000800p-806, 0x1.0000000800000p-872, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000800000000p-723, -0x1.ffffffe400000p-786, 0x1.000001ffffffap-94, -0x1.ffe1f80400000p-169, 0x1.0000820000ffap-817, -0x1.0c100109bfa00p-879}, {0x1.0000800000000p-723, -0x1.ffffffe400000p-786, -0x1.000001ffffffap-94, 0x1.ffe1f80400000p-169, -0x1.0000820000ffap-817, 0x1.0c100109bfa00p-879}, {-0x1.0000800000000p-723, 0x1.ffffffe400000p-786, 0x1.000001ffffffap-94, -0x1.ffe1f80400000p-169, -0x1.0000820000ffap-817, 0x1.0c100109bfa00p-879}, {-0x1.0000800000000p-723, 0x1.ffffffe400000p-786, -0x1.000001ffffffap-94, 0x1.ffe1f80400000p-169, 0x1.0000820000ffap-817, -0x1.0c100109bfa00p-879}, {0x1.0000010000000p-343, -0x1.0000000000000p-448, 0x1.007fffffffc00p-425, 0x1.fffffc0000000p-496, 0x1.008001007fc00p-768, -0x1.e000002004000p-835}, {0x1.0000010000000p-343, -0x1.0000000000000p-448, -0x1.007fffffffc00p-425, -0x1.fffffc0000000p-496, -0x1.008001007fc00p-768, 0x1.e000002004000p-835}, {-0x1.0000010000000p-343, 0x1.0000000000000p-448, 0x1.007fffffffc00p-425, 0x1.fffffc0000000p-496, -0x1.008001007fc00p-768, 0x1.e000002004000p-835}, {-0x1.0000010000000p-343, 0x1.0000000000000p-448, -0x1.007fffffffc00p-425, -0x1.fffffc0000000p-496, 0x1.008001007fc00p-768, -0x1.e000002004000p-835}, {0x1.0080000000000p-417, -0x1.0000000000000p-490, 0x1.001ffffffc000p-985, 0x1.0000000000000p-1039, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0080000000000p-417, -0x1.0000000000000p-490, -0x1.001ffffffc000p-985, -0x1.0000000000000p-1039, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0080000000000p-417, 0x1.0000000000000p-490, 0x1.001ffffffc000p-985, 0x1.0000000000000p-1039, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0080000000000p-417, 0x1.0000000000000p-490, -0x1.001ffffffc000p-985, -0x1.0000000000000p-1039, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.000001fffff80p-758, 0x1.fffffc001fffcp-813, 0x1.00001ffff8000p+939, 0x1.00007f001e000p+884, 0x1.000021fff8380p+181, 0x1.7bc05e90173aep+127}, {0x1.000001fffff80p-758, 0x1.fffffc001fffcp-813, -0x1.00001ffff8000p+939, -0x1.00007f001e000p+884, -0x1.000021fff8380p+181, -0x1.7bc05e90173aep+127}, {-0x1.000001fffff80p-758, -0x1.fffffc001fffcp-813, 0x1.00001ffff8000p+939, 0x1.00007f001e000p+884, -0x1.000021fff8380p+181, -0x1.7bc05e90173aep+127}, {-0x1.000001fffff80p-758, -0x1.fffffc001fffcp-813, -0x1.00001ffff8000p+939, -0x1.00007f001e000p+884, 0x1.000021fff8380p+181, 0x1.7bc05e90173aep+127}, {0x1.00f3ffffff000p-189, 0x1.fff8000000000p-257, 0x1.3dfffffffc000p+294, 0x1.ff000003ffe00p+233, 0x1.3f2f17fffabe3p+105, 0x1.02efbc1200d00p+45}, {0x1.00f3ffffff000p-189, 0x1.fff8000000000p-257, -0x1.3dfffffffc000p+294, -0x1.ff000003ffe00p+233, -0x1.3f2f17fffabe3p+105, -0x1.02efbc1200d00p+45}, {-0x1.00f3ffffff000p-189, -0x1.fff8000000000p-257, 0x1.3dfffffffc000p+294, 0x1.ff000003ffe00p+233, -0x1.3f2f17fffabe3p+105, -0x1.02efbc1200d00p+45}, {-0x1.00f3ffffff000p-189, -0x1.fff8000000000p-257, -0x1.3dfffffffc000p+294, -0x1.ff000003ffe00p+233, 0x1.3f2f17fffabe3p+105, 0x1.02efbc1200d00p+45}, {0x1.0000001ffff80p-98, 0x1.fffffdfffff8ep-152, 0x1.0000000000000p+1023, -0x1.0000000000000p+953, 0x1.0000001ffff80p+925, 0x1.fffefdffffd8ep+871}, {0x1.0000001ffff80p-98, 0x1.fffffdfffff8ep-152, -0x1.0000000000000p+1023, 0x1.0000000000000p+953, -0x1.0000001ffff80p+925, -0x1.fffefdffffd8ep+871}, {-0x1.0000001ffff80p-98, -0x1.fffffdfffff8ep-152, 0x1.0000000000000p+1023, -0x1.0000000000000p+953, -0x1.0000001ffff80p+925, -0x1.fffefdffffd8ep+871}, {-0x1.0000001ffff80p-98, -0x1.fffffdfffff8ep-152, -0x1.0000000000000p+1023, 0x1.0000000000000p+953, 0x1.0000001ffff80p+925, 0x1.fffefdffffd8ep+871}, {0x1.001fffffffe00p+730, 0x0.0000000000000p+0, 0x1.0000002000000p+702, -0x1.0000000000000p+602, INFINITY, 0x0.0000000000000p+0}, {0x1.001fffffffe00p+730, 0x0.0000000000000p+0, -0x1.0000002000000p+702, 0x1.0000000000000p+602, -INFINITY, 0x0.0000000000000p+0}, {-0x1.001fffffffe00p+730, 0x0.0000000000000p+0, 0x1.0000002000000p+702, -0x1.0000000000000p+602, -INFINITY, 0x0.0000000000000p+0}, {-0x1.001fffffffe00p+730, 0x0.0000000000000p+0, -0x1.0000002000000p+702, 0x1.0000000000000p+602, INFINITY, 0x0.0000000000000p+0}, {0x1.01ffffffe0000p+902, 0x1.c000000200000p+841, 0x1.0001fff800ffep-251, 0x1.c000000000000p-354, 0x1.020203f7d101ap+651, -0x1.88001fe2ff740p+592}, {0x1.01ffffffe0000p+902, 0x1.c000000200000p+841, -0x1.0001fff800ffep-251, -0x1.c000000000000p-354, -0x1.020203f7d101ap+651, 0x1.88001fe2ff740p+592}, {-0x1.01ffffffe0000p+902, -0x1.c000000200000p+841, 0x1.0001fff800ffep-251, 0x1.c000000000000p-354, -0x1.020203f7d101ap+651, 0x1.88001fe2ff740p+592}, {-0x1.01ffffffe0000p+902, -0x1.c000000200000p+841, -0x1.0001fff800ffep-251, -0x1.c000000000000p-354, 0x1.020203f7d101ap+651, -0x1.88001fe2ff740p+592}, {0x1.00000007ff800p-179, 0x1.ffff800000000p-267, 0x1.00003fe0c4000p+973, -0x1.fffc032000000p+910, 0x1.00003fe8c3820p+794, -0x1.1dd05a045ffe0p+738}, {0x1.00000007ff800p-179, 0x1.ffff800000000p-267, -0x1.00003fe0c4000p+973, 0x1.fffc032000000p+910, -0x1.00003fe8c3820p+794, 0x1.1dd05a045ffe0p+738}, {-0x1.00000007ff800p-179, -0x1.ffff800000000p-267, 0x1.00003fe0c4000p+973, -0x1.fffc032000000p+910, -0x1.00003fe8c3820p+794, 0x1.1dd05a045ffe0p+738}, {-0x1.00000007ff800p-179, -0x1.ffff800000000p-267, -0x1.00003fe0c4000p+973, 0x1.fffc032000000p+910, 0x1.00003fe8c3820p+794, -0x1.1dd05a045ffe0p+738}, {0x1.000001fff8008p-475, -0x1.0000000000000p-557, 0x1.000ffffff8000p+593, 0x1.ffffffffffc00p+538, 0x1.0010020010000p+118, 0x1.fc0023ddedc10p+63}, {0x1.000001fff8008p-475, -0x1.0000000000000p-557, -0x1.000ffffff8000p+593, -0x1.ffffffffffc00p+538, -0x1.0010020010000p+118, -0x1.fc0023ddedc10p+63}, {-0x1.000001fff8008p-475, 0x1.0000000000000p-557, 0x1.000ffffff8000p+593, 0x1.ffffffffffc00p+538, -0x1.0010020010000p+118, -0x1.fc0023ddedc10p+63}, {-0x1.000001fff8008p-475, 0x1.0000000000000p-557, -0x1.000ffffff8000p+593, -0x1.ffffffffffc00p+538, 0x1.0010020010000p+118, 0x1.fc0023ddedc10p+63}, {0x1.007fbfffffcf0p-964, 0x1.ffff803ffe000p-1019, 0x1.0007ffff00000p+383, 0x1.fffff80000000p+313, 0x1.0087c3fcff4f4p-581, 0x1.3c139ab8eff88p-636}, {0x1.007fbfffffcf0p-964, 0x1.ffff803ffe000p-1019, -0x1.0007ffff00000p+383, -0x1.fffff80000000p+313, -0x1.0087c3fcff4f4p-581, -0x1.3c139ab8eff88p-636}, {-0x1.007fbfffffcf0p-964, -0x1.ffff803ffe000p-1019, 0x1.0007ffff00000p+383, 0x1.fffff80000000p+313, -0x1.0087c3fcff4f4p-581, -0x1.3c139ab8eff88p-636}, {-0x1.007fbfffffcf0p-964, -0x1.ffff803ffe000p-1019, -0x1.0007ffff00000p+383, -0x1.fffff80000000p+313, 0x1.0087c3fcff4f4p-581, 0x1.3c139ab8eff88p-636}, {0x1.0000001fc4000p-493, -0x1.fe003ffe00000p-549, 0x1.01ffffffc0004p+997, -0x1.fffc100000000p+936, 0x1.0200001fc3884p+504, -0x1.0cf68c873c5e4p+449}, {0x1.0000001fc4000p-493, -0x1.fe003ffe00000p-549, -0x1.01ffffffc0004p+997, 0x1.fffc100000000p+936, -0x1.0200001fc3884p+504, 0x1.0cf68c873c5e4p+449}, {-0x1.0000001fc4000p-493, 0x1.fe003ffe00000p-549, 0x1.01ffffffc0004p+997, -0x1.fffc100000000p+936, -0x1.0200001fc3884p+504, 0x1.0cf68c873c5e4p+449}, {-0x1.0000001fc4000p-493, 0x1.fe003ffe00000p-549, -0x1.01ffffffc0004p+997, 0x1.fffc100000000p+936, 0x1.0200001fc3884p+504, -0x1.0cf68c873c5e4p+449}, {0x1.0007e3ffe0000p-845, 0x1.fe0ffffffe000p-909, 0x1.0000001000000p+62, -0x1.ffffff0000800p-2, 0x1.0007e40fe07e4p-783, -0x1.00ffe36fecc00p-846}, {0x1.0007e3ffe0000p-845, 0x1.fe0ffffffe000p-909, -0x1.0000001000000p+62, 0x1.ffffff0000800p-2, -0x1.0007e40fe07e4p-783, 0x1.00ffe36fecc00p-846}, {-0x1.0007e3ffe0000p-845, -0x1.fe0ffffffe000p-909, 0x1.0000001000000p+62, -0x1.ffffff0000800p-2, -0x1.0007e40fe07e4p-783, 0x1.00ffe36fecc00p-846}, {-0x1.0007e3ffe0000p-845, -0x1.fe0ffffffe000p-909, -0x1.0000001000000p+62, 0x1.ffffff0000800p-2, 0x1.0007e40fe07e4p-783, -0x1.00ffe36fecc00p-846}, {0x1.0000001000000p-487, -0x1.fffffff804000p-554, 0x1.003ffffff8000p+696, 0x1.f00000007fc00p+638, 0x1.0040000ffc000p+209, 0x1.ecffc01f83c60p+151}, {0x1.0000001000000p-487, -0x1.fffffff804000p-554, -0x1.003ffffff8000p+696, -0x1.f00000007fc00p+638, -0x1.0040000ffc000p+209, -0x1.ecffc01f83c60p+151}, {-0x1.0000001000000p-487, 0x1.fffffff804000p-554, 0x1.003ffffff8000p+696, 0x1.f00000007fc00p+638, -0x1.0040000ffc000p+209, -0x1.ecffc01f83c60p+151}, {-0x1.0000001000000p-487, 0x1.fffffff804000p-554, -0x1.003ffffff8000p+696, -0x1.f00000007fc00p+638, 0x1.0040000ffc000p+209, 0x1.ecffc01f83c60p+151}, {0x1.1ffff80000000p+591, 0x1.ffffff7ff8000p+532, 0x1.00ff000000004p+69, -0x1.ffffff0000400p+6, 0x1.211ed7f808005p+660, -0x1.f1108ffb743c6p+606}, {0x1.1ffff80000000p+591, 0x1.ffffff7ff8000p+532, -0x1.00ff000000004p+69, 0x1.ffffff0000400p+6, -0x1.211ed7f808005p+660, 0x1.f1108ffb743c6p+606}, {-0x1.1ffff80000000p+591, -0x1.ffffff7ff8000p+532, 0x1.00ff000000004p+69, -0x1.ffffff0000400p+6, -0x1.211ed7f808005p+660, 0x1.f1108ffb743c6p+606}, {-0x1.1ffff80000000p+591, -0x1.ffffff7ff8000p+532, -0x1.00ff000000004p+69, 0x1.ffffff0000400p+6, 0x1.211ed7f808005p+660, -0x1.f1108ffb743c6p+606}, {0x1.000000ffff800p-309, 0x1.fffffc0000000p-392, 0x1.0008000000000p+75, -0x1.0000000000000p+7, 0x1.0008010007800p-234, -0x1.0003fff003802p-288}, {0x1.000000ffff800p-309, 0x1.fffffc0000000p-392, -0x1.0008000000000p+75, 0x1.0000000000000p+7, -0x1.0008010007800p-234, 0x1.0003fff003802p-288}, {-0x1.000000ffff800p-309, -0x1.fffffc0000000p-392, 0x1.0008000000000p+75, -0x1.0000000000000p+7, -0x1.0008010007800p-234, 0x1.0003fff003802p-288}, {-0x1.000000ffff800p-309, -0x1.fffffc0000000p-392, -0x1.0008000000000p+75, 0x1.0000000000000p+7, 0x1.0008010007800p-234, -0x1.0003fff003802p-288}, {0x1.0000183ffffc0p+670, 0x1.fff07fcfffffcp+616, 0x1.0000010000000p+363, -0x1.0000000000000p+288, INFINITY, 0x0.0000000000000p+0}, {0x1.0000183ffffc0p+670, 0x1.fff07fcfffffcp+616, -0x1.0000010000000p+363, 0x1.0000000000000p+288, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000183ffffc0p+670, -0x1.fff07fcfffffcp+616, 0x1.0000010000000p+363, -0x1.0000000000000p+288, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000183ffffc0p+670, -0x1.fff07fcfffffcp+616, -0x1.0000010000000p+363, 0x1.0000000000000p+288, INFINITY, 0x0.0000000000000p+0}, {0x1.0001000000000p-455, -0x1.fffffff800400p-518, 0x1.0000800000000p-998, -0x1.0000000000000p-1070, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0001000000000p-455, -0x1.fffffff800400p-518, -0x1.0000800000000p-998, 0x1.0000000000000p-1070, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0001000000000p-455, 0x1.fffffff800400p-518, 0x1.0000800000000p-998, -0x1.0000000000000p-1070, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0001000000000p-455, 0x1.fffffff800400p-518, -0x1.0000800000000p-998, 0x1.0000000000000p-1070, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.3ffff800fff81p-572, -0x1.0000000000000p-663, 0x1.1fffffff00000p+890, 0x1.fffffff000000p+813, 0x1.67fff6ffdff72p+318, -0x1.803ff90409202p+264}, {0x1.3ffff800fff81p-572, -0x1.0000000000000p-663, -0x1.1fffffff00000p+890, -0x1.fffffff000000p+813, -0x1.67fff6ffdff72p+318, 0x1.803ff90409202p+264}, {-0x1.3ffff800fff81p-572, 0x1.0000000000000p-663, 0x1.1fffffff00000p+890, 0x1.fffffff000000p+813, -0x1.67fff6ffdff72p+318, 0x1.803ff90409202p+264}, {-0x1.3ffff800fff81p-572, 0x1.0000000000000p-663, -0x1.1fffffff00000p+890, -0x1.fffffff000000p+813, 0x1.67fff6ffdff72p+318, -0x1.803ff90409202p+264}, {0x1.fffffc0000100p-97, -0x1.fffe000040000p-168, 0x1.0000800000000p-692, -0x1.c000fffffffd0p-749, 0x1.00007dffff080p-788, -0x1.b804fc7dfe0a0p-845}, {0x1.fffffc0000100p-97, -0x1.fffe000040000p-168, -0x1.0000800000000p-692, 0x1.c000fffffffd0p-749, -0x1.00007dffff080p-788, 0x1.b804fc7dfe0a0p-845}, {-0x1.fffffc0000100p-97, 0x1.fffe000040000p-168, 0x1.0000800000000p-692, -0x1.c000fffffffd0p-749, -0x1.00007dffff080p-788, 0x1.b804fc7dfe0a0p-845}, {-0x1.fffffc0000100p-97, 0x1.fffe000040000p-168, -0x1.0000800000000p-692, 0x1.c000fffffffd0p-749, 0x1.00007dffff080p-788, -0x1.b804fc7dfe0a0p-845}, {0x1.003f80ff00004p-671, -0x1.ffffc00040000p-742, 0x1.0000ffffff000p+38, 0x1.ffe000003ffe0p-20, 0x1.0040813e7fff0p-633, 0x1.fea97cff90170p-690}, {0x1.003f80ff00004p-671, -0x1.ffffc00040000p-742, -0x1.0000ffffff000p+38, -0x1.ffe000003ffe0p-20, -0x1.0040813e7fff0p-633, -0x1.fea97cff90170p-690}, {-0x1.003f80ff00004p-671, 0x1.ffffc00040000p-742, 0x1.0000ffffff000p+38, 0x1.ffe000003ffe0p-20, -0x1.0040813e7fff0p-633, -0x1.fea97cff90170p-690}, {-0x1.003f80ff00004p-671, 0x1.ffffc00040000p-742, -0x1.0000ffffff000p+38, -0x1.ffe000003ffe0p-20, 0x1.0040813e7fff0p-633, 0x1.fea97cff90170p-690}, {0x1.000003fffff80p+967, 0x1.f007ffe00fc00p+904, 0x1.3ff8007ffffc0p-732, 0x1.e0007ff000000p-798, 0x1.3ff8057fdff40p+235, 0x1.14efd48c70c80p+177}, {0x1.000003fffff80p+967, 0x1.f007ffe00fc00p+904, -0x1.3ff8007ffffc0p-732, -0x1.e0007ff000000p-798, -0x1.3ff8057fdff40p+235, -0x1.14efd48c70c80p+177}, {-0x1.000003fffff80p+967, -0x1.f007ffe00fc00p+904, 0x1.3ff8007ffffc0p-732, 0x1.e0007ff000000p-798, -0x1.3ff8057fdff40p+235, -0x1.14efd48c70c80p+177}, {-0x1.000003fffff80p+967, -0x1.f007ffe00fc00p+904, -0x1.3ff8007ffffc0p-732, -0x1.e0007ff000000p-798, 0x1.3ff8057fdff40p+235, 0x1.14efd48c70c80p+177}, {0x1.ffffffe000000p-621, -0x1.ff80000020000p-677, 0x1.0000ffffff81fp+121, 0x1.ffc7fff800000p+57, 0x1.0000ffefff71fp-499, -0x1.fb72ad806efd0p-556}, {0x1.ffffffe000000p-621, -0x1.ff80000020000p-677, -0x1.0000ffffff81fp+121, -0x1.ffc7fff800000p+57, -0x1.0000ffefff71fp-499, 0x1.fb72ad806efd0p-556}, {-0x1.ffffffe000000p-621, 0x1.ff80000020000p-677, 0x1.0000ffffff81fp+121, 0x1.ffc7fff800000p+57, -0x1.0000ffefff71fp-499, 0x1.fb72ad806efd0p-556}, {-0x1.ffffffe000000p-621, 0x1.ff80000020000p-677, -0x1.0000ffffff81fp+121, -0x1.ffc7fff800000p+57, 0x1.0000ffefff71fp-499, -0x1.fb72ad806efd0p-556}, {0x1.0000000800000p-286, -0x1.ffffc02000000p-364, 0x1.7fffe00800000p-363, -0x1.0000000000000p-468, 0x1.7fffe013ffff0p-649, 0x1.ffffa00013f40p-708}, {0x1.0000000800000p-286, -0x1.ffffc02000000p-364, -0x1.7fffe00800000p-363, 0x1.0000000000000p-468, -0x1.7fffe013ffff0p-649, -0x1.ffffa00013f40p-708}, {-0x1.0000000800000p-286, 0x1.ffffc02000000p-364, 0x1.7fffe00800000p-363, -0x1.0000000000000p-468, -0x1.7fffe013ffff0p-649, -0x1.ffffa00013f40p-708}, {-0x1.0000000800000p-286, 0x1.ffffc02000000p-364, -0x1.7fffe00800000p-363, 0x1.0000000000000p-468, 0x1.7fffe013ffff0p-649, 0x1.ffffa00013f40p-708}, {0x1.0000400000000p+600, -0x1.0000000000000p+509, 0x1.4000000000000p-65, -0x1.ffffffff00020p-123, 0x1.4000500000000p+535, -0x1.00003fffd0010p+478}, {0x1.0000400000000p+600, -0x1.0000000000000p+509, -0x1.4000000000000p-65, 0x1.ffffffff00020p-123, -0x1.4000500000000p+535, 0x1.00003fffd0010p+478}, {-0x1.0000400000000p+600, 0x1.0000000000000p+509, 0x1.4000000000000p-65, -0x1.ffffffff00020p-123, -0x1.4000500000000p+535, 0x1.00003fffd0010p+478}, {-0x1.0000400000000p+600, 0x1.0000000000000p+509, -0x1.4000000000000p-65, 0x1.ffffffff00020p-123, 0x1.4000500000000p+535, -0x1.00003fffd0010p+478}, {0x1.000000fffff80p-307, 0x1.ffffef003e000p-370, 0x1.0000010000000p-490, -0x1.8000000000020p-548, 0x1.000001fffff90p-797, -0x1.702001f7fe060p-855}, {0x1.000000fffff80p-307, 0x1.ffffef003e000p-370, -0x1.0000010000000p-490, 0x1.8000000000020p-548, -0x1.000001fffff90p-797, 0x1.702001f7fe060p-855}, {-0x1.000000fffff80p-307, -0x1.ffffef003e000p-370, 0x1.0000010000000p-490, -0x1.8000000000020p-548, -0x1.000001fffff90p-797, 0x1.702001f7fe060p-855}, {-0x1.000000fffff80p-307, -0x1.ffffef003e000p-370, -0x1.0000010000000p-490, 0x1.8000000000020p-548, 0x1.000001fffff90p-797, -0x1.702001f7fe060p-855}, {0x1.7fffffffc0000p-18, 0x1.fffc000000000p-88, 0x1.0000001fe0000p-469, 0x1.fffffc0001f00p-530, 0x1.8000002f90000p-487, 0x1.00fffbffd1600p-547}, {0x1.7fffffffc0000p-18, 0x1.fffc000000000p-88, -0x1.0000001fe0000p-469, -0x1.fffffc0001f00p-530, -0x1.8000002f90000p-487, -0x1.00fffbffd1600p-547}, {-0x1.7fffffffc0000p-18, -0x1.fffc000000000p-88, 0x1.0000001fe0000p-469, 0x1.fffffc0001f00p-530, -0x1.8000002f90000p-487, -0x1.00fffbffd1600p-547}, {-0x1.7fffffffc0000p-18, -0x1.fffc000000000p-88, -0x1.0000001fe0000p-469, -0x1.fffffc0001f00p-530, 0x1.8000002f90000p-487, 0x1.00fffbffd1600p-547}, {0x1.0000004000000p+707, -0x1.0000000000000p+649, 0x1.8000000000000p+850, -0x1.ffe7ffc001000p+785, INFINITY, 0x0.0000000000000p+0}, {0x1.0000004000000p+707, -0x1.0000000000000p+649, -0x1.8000000000000p+850, 0x1.ffe7ffc001000p+785, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000004000000p+707, 0x1.0000000000000p+649, 0x1.8000000000000p+850, -0x1.ffe7ffc001000p+785, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000004000000p+707, 0x1.0000000000000p+649, -0x1.8000000000000p+850, 0x1.ffe7ffc001000p+785, INFINITY, 0x0.0000000000000p+0}, {0x1.0000000800000p+842, -0x1.fffffff400000p+767, 0x1.007fc00007800p+448, 0x1.e0000f80001e0p+390, INFINITY, 0x0.0000000000000p+0}, {0x1.0000000800000p+842, -0x1.fffffff400000p+767, -0x1.007fc00007800p+448, -0x1.e0000f80001e0p+390, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000000800000p+842, 0x1.fffffff400000p+767, 0x1.007fc00007800p+448, 0x1.e0000f80001e0p+390, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000000800000p+842, 0x1.fffffff400000p+767, -0x1.007fc00007800p+448, -0x1.e0000f80001e0p+390, INFINITY, 0x0.0000000000000p+0}, {0x1.3fffff0000000p+131, 0x1.fffffe0000000p+68, 0x1.0000200000000p+733, -0x1.0000000000000p+628, 0x1.400026ffffe00p+864, 0x1.00001effffc00p+802}, {0x1.3fffff0000000p+131, 0x1.fffffe0000000p+68, -0x1.0000200000000p+733, 0x1.0000000000000p+628, -0x1.400026ffffe00p+864, -0x1.00001effffc00p+802}, {-0x1.3fffff0000000p+131, -0x1.fffffe0000000p+68, 0x1.0000200000000p+733, -0x1.0000000000000p+628, -0x1.400026ffffe00p+864, -0x1.00001effffc00p+802}, {-0x1.3fffff0000000p+131, -0x1.fffffe0000000p+68, -0x1.0000200000000p+733, 0x1.0000000000000p+628, 0x1.400026ffffe00p+864, 0x1.00001effffc00p+802}, {0x1.7fe0000000008p+383, -0x1.fffff3ff80200p+321, 0x1.000001fff8400p-754, -0x1.fffff80010000p-819, 0x1.7fe002ffb4617p-371, 0x1.fda04808886c8p-425}, {0x1.7fe0000000008p+383, -0x1.fffff3ff80200p+321, -0x1.000001fff8400p-754, 0x1.fffff80010000p-819, -0x1.7fe002ffb4617p-371, -0x1.fda04808886c8p-425}, {-0x1.7fe0000000008p+383, 0x1.fffff3ff80200p+321, 0x1.000001fff8400p-754, -0x1.fffff80010000p-819, -0x1.7fe002ffb4617p-371, -0x1.fda04808886c8p-425}, {-0x1.7fe0000000008p+383, 0x1.fffff3ff80200p+321, -0x1.000001fff8400p-754, 0x1.fffff80010000p-819, 0x1.7fe002ffb4617p-371, 0x1.fda04808886c8p-425}, {0x1.00000fffffff8p-769, 0x1.fffffffc00000p-828, 0x1.0000007001000p+11, -0x1.e00000fff8200p-49, 0x1.0000107001068p-758, 0x1.8ffe315805e80p-817}, {0x1.00000fffffff8p-769, 0x1.fffffffc00000p-828, -0x1.0000007001000p+11, 0x1.e00000fff8200p-49, -0x1.0000107001068p-758, -0x1.8ffe315805e80p-817}, {-0x1.00000fffffff8p-769, -0x1.fffffffc00000p-828, 0x1.0000007001000p+11, -0x1.e00000fff8200p-49, -0x1.0000107001068p-758, -0x1.8ffe315805e80p-817}, {-0x1.00000fffffff8p-769, -0x1.fffffffc00000p-828, -0x1.0000007001000p+11, 0x1.e00000fff8200p-49, 0x1.0000107001068p-758, 0x1.8ffe315805e80p-817}, {0x1.001fffc000400p-304, -0x1.e000000001000p-369, 0x1.0200000000000p+539, -0x1.0000000000000p+436, 0x1.02203fbf80408p+235, -0x1.e3c0000005000p+170}, {0x1.001fffc000400p-304, -0x1.e000000001000p-369, -0x1.0200000000000p+539, 0x1.0000000000000p+436, -0x1.02203fbf80408p+235, 0x1.e3c0000005000p+170}, {-0x1.001fffc000400p-304, 0x1.e000000001000p-369, 0x1.0200000000000p+539, -0x1.0000000000000p+436, -0x1.02203fbf80408p+235, 0x1.e3c0000005000p+170}, {-0x1.001fffc000400p-304, 0x1.e000000001000p-369, -0x1.0200000000000p+539, 0x1.0000000000000p+436, 0x1.02203fbf80408p+235, -0x1.e3c0000005000p+170}, {0x1.0000008000000p+148, -0x1.0000000000000p+78, 0x1.07fff80000002p-186, -0x1.c010000000000p-257, 0x1.07fff883fffc2p-38, -0x1.e407f87000000p-108}, {0x1.0000008000000p+148, -0x1.0000000000000p+78, -0x1.07fff80000002p-186, 0x1.c010000000000p-257, -0x1.07fff883fffc2p-38, 0x1.e407f87000000p-108}, {-0x1.0000008000000p+148, 0x1.0000000000000p+78, 0x1.07fff80000002p-186, -0x1.c010000000000p-257, -0x1.07fff883fffc2p-38, 0x1.e407f87000000p-108}, {-0x1.0000008000000p+148, 0x1.0000000000000p+78, -0x1.07fff80000002p-186, 0x1.c010000000000p-257, 0x1.07fff883fffc2p-38, -0x1.e407f87000000p-108}, {0x1.03ffffffe0000p+267, 0x1.ff80000000000p+178, 0x1.7ffff00000002p+830, -0x1.0000000000000p+737, INFINITY, 0x0.0000000000000p+0}, {0x1.03ffffffe0000p+267, 0x1.ff80000000000p+178, -0x1.7ffff00000002p+830, 0x1.0000000000000p+737, -INFINITY, 0x0.0000000000000p+0}, {-0x1.03ffffffe0000p+267, -0x1.ff80000000000p+178, 0x1.7ffff00000002p+830, -0x1.0000000000000p+737, -INFINITY, 0x0.0000000000000p+0}, {-0x1.03ffffffe0000p+267, -0x1.ff80000000000p+178, -0x1.7ffff00000002p+830, 0x1.0000000000000p+737, INFINITY, 0x0.0000000000000p+0}, {0x1.0008000000000p-881, -0x1.9000000000000p-982, 0x1.0000000700002p-545, -0x1.fffff80200000p-608, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0008000000000p-881, -0x1.9000000000000p-982, -0x1.0000000700002p-545, 0x1.fffff80200000p-608, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0008000000000p-881, 0x1.9000000000000p-982, 0x1.0000000700002p-545, -0x1.fffff80200000p-608, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0008000000000p-881, 0x1.9000000000000p-982, -0x1.0000000700002p-545, 0x1.fffff80200000p-608, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0010000000000p-465, -0x1.0000000000000p-542, 0x1.007fc00001000p+895, -0x1.ff80000400000p+839, 0x1.008fc7fc01001p+430, -0x1.ffa00007fe400p+374}, {0x1.0010000000000p-465, -0x1.0000000000000p-542, -0x1.007fc00001000p+895, 0x1.ff80000400000p+839, -0x1.008fc7fc01001p+430, 0x1.ffa00007fe400p+374}, {-0x1.0010000000000p-465, 0x1.0000000000000p-542, 0x1.007fc00001000p+895, -0x1.ff80000400000p+839, -0x1.008fc7fc01001p+430, 0x1.ffa00007fe400p+374}, {-0x1.0010000000000p-465, 0x1.0000000000000p-542, -0x1.007fc00001000p+895, 0x1.ff80000400000p+839, 0x1.008fc7fc01001p+430, -0x1.ffa00007fe400p+374}, {0x1.0000008000000p-249, -0x1.fff0000000100p-308, 0x1.7fffff8100000p+89, -0x1.fffcc00000080p+29, 0x1.80000040ffffcp-160, 0x1.9a07df8c40000p-231}, {0x1.0000008000000p-249, -0x1.fff0000000100p-308, -0x1.7fffff8100000p+89, 0x1.fffcc00000080p+29, -0x1.80000040ffffcp-160, -0x1.9a07df8c40000p-231}, {-0x1.0000008000000p-249, 0x1.fff0000000100p-308, 0x1.7fffff8100000p+89, -0x1.fffcc00000080p+29, -0x1.80000040ffffcp-160, -0x1.9a07df8c40000p-231}, {-0x1.0000008000000p-249, 0x1.fff0000000100p-308, -0x1.7fffff8100000p+89, 0x1.fffcc00000080p+29, 0x1.80000040ffffcp-160, 0x1.9a07df8c40000p-231}, {0x1.0000003ffc010p+789, -0x1.ffffc00400000p+720, 0x1.0000c00400000p+535, -0x1.ff80800000000p+454, INFINITY, 0x0.0000000000000p+0}, {0x1.0000003ffc010p+789, -0x1.ffffc00400000p+720, -0x1.0000c00400000p+535, 0x1.ff80800000000p+454, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000003ffc010p+789, 0x1.ffffc00400000p+720, 0x1.0000c00400000p+535, -0x1.ff80800000000p+454, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000003ffc010p+789, 0x1.ffffc00400000p+720, -0x1.0000c00400000p+535, 0x1.ff80800000000p+454, INFINITY, 0x0.0000000000000p+0}, {0x1.0000007fff800p+957, 0x1.ffff800007fc0p+898, 0x1.0000007fff000p+26, 0x1.ffffff8000000p-49, 0x1.000000fffe804p+983, 0x1.fa018500063c0p+924}, {0x1.0000007fff800p+957, 0x1.ffff800007fc0p+898, -0x1.0000007fff000p+26, -0x1.ffffff8000000p-49, -0x1.000000fffe804p+983, -0x1.fa018500063c0p+924}, {-0x1.0000007fff800p+957, -0x1.ffff800007fc0p+898, 0x1.0000007fff000p+26, 0x1.ffffff8000000p-49, -0x1.000000fffe804p+983, -0x1.fa018500063c0p+924}, {-0x1.0000007fff800p+957, -0x1.ffff800007fc0p+898, -0x1.0000007fff000p+26, -0x1.ffffff8000000p-49, 0x1.000000fffe804p+983, 0x1.fa018500063c0p+924}, {0x1.4000000000000p-257, -0x1.0000000000000p-339, 0x1.0000001ff8040p+59, -0x1.fff0ffffff008p+3, 0x1.40000027f6050p-198, -0x1.3ff6a01fff604p-253}, {0x1.4000000000000p-257, -0x1.0000000000000p-339, -0x1.0000001ff8040p+59, 0x1.fff0ffffff008p+3, -0x1.40000027f6050p-198, 0x1.3ff6a01fff604p-253}, {-0x1.4000000000000p-257, 0x1.0000000000000p-339, 0x1.0000001ff8040p+59, -0x1.fff0ffffff008p+3, -0x1.40000027f6050p-198, 0x1.3ff6a01fff604p-253}, {-0x1.4000000000000p-257, 0x1.0000000000000p-339, -0x1.0000001ff8040p+59, 0x1.fff0ffffff008p+3, 0x1.40000027f6050p-198, -0x1.3ff6a01fff604p-253}, {0x1.0004000000000p+457, -0x1.fffffffe40000p+386, 0x1.000001ffff1f0p+241, 0x1.ff807ffffc000p+187, 0x1.00040200071f0p+698, 0x1.1e877e01fa00ep+644}, {0x1.0004000000000p+457, -0x1.fffffffe40000p+386, -0x1.000001ffff1f0p+241, -0x1.ff807ffffc000p+187, -0x1.00040200071f0p+698, -0x1.1e877e01fa00ep+644}, {-0x1.0004000000000p+457, 0x1.fffffffe40000p+386, 0x1.000001ffff1f0p+241, 0x1.ff807ffffc000p+187, -0x1.00040200071f0p+698, -0x1.1e877e01fa00ep+644}, {-0x1.0004000000000p+457, 0x1.fffffffe40000p+386, -0x1.000001ffff1f0p+241, -0x1.ff807ffffc000p+187, 0x1.00040200071f0p+698, 0x1.1e877e01fa00ep+644}, {0x1.003fe00030100p-370, -0x1.00003fe002000p-436, 0x1.3ffffff800200p-197, -0x1.0000000000000p-274, 0x1.404fd7f83a350p-567, 0x1.fe8bdf7b033fep-621}, {0x1.003fe00030100p-370, -0x1.00003fe002000p-436, -0x1.3ffffff800200p-197, 0x1.0000000000000p-274, -0x1.404fd7f83a350p-567, -0x1.fe8bdf7b033fep-621}, {-0x1.003fe00030100p-370, 0x1.00003fe002000p-436, 0x1.3ffffff800200p-197, -0x1.0000000000000p-274, -0x1.404fd7f83a350p-567, -0x1.fe8bdf7b033fep-621}, {-0x1.003fe00030100p-370, 0x1.00003fe002000p-436, -0x1.3ffffff800200p-197, 0x1.0000000000000p-274, 0x1.404fd7f83a350p-567, 0x1.fe8bdf7b033fep-621}, {0x1.0001ffc1ffc20p+658, -0x1.fffffc0002000p+592, 0x1.000003fffffc0p-919, 0x1.fffffe0000000p-997, 0x1.000203c207bd0p-261, 0x1.fda2400001fd6p-315}, {0x1.0001ffc1ffc20p+658, -0x1.fffffc0002000p+592, -0x1.000003fffffc0p-919, -0x1.fffffe0000000p-997, -0x1.000203c207bd0p-261, -0x1.fda2400001fd6p-315}, {-0x1.0001ffc1ffc20p+658, 0x1.fffffc0002000p+592, 0x1.000003fffffc0p-919, 0x1.fffffe0000000p-997, -0x1.000203c207bd0p-261, -0x1.fda2400001fd6p-315}, {-0x1.0001ffc1ffc20p+658, 0x1.fffffc0002000p+592, -0x1.000003fffffc0p-919, -0x1.fffffe0000000p-997, 0x1.000203c207bd0p-261, 0x1.fda2400001fd6p-315}, {0x1.0400000000000p-38, -0x1.0000000000000p-92, 0x1.0000200000000p-364, -0x1.ffffffffffc40p-423, 0x1.0400208000000p-402, -0x1.10401ffffffe2p-456}, {0x1.0400000000000p-38, -0x1.0000000000000p-92, -0x1.0000200000000p-364, 0x1.ffffffffffc40p-423, -0x1.0400208000000p-402, 0x1.10401ffffffe2p-456}, {-0x1.0400000000000p-38, 0x1.0000000000000p-92, 0x1.0000200000000p-364, -0x1.ffffffffffc40p-423, -0x1.0400208000000p-402, 0x1.10401ffffffe2p-456}, {-0x1.0400000000000p-38, 0x1.0000000000000p-92, -0x1.0000200000000p-364, 0x1.ffffffffffc40p-423, 0x1.0400208000000p-402, -0x1.10401ffffffe2p-456}, {0x1.00003ff820000p+644, -0x1.ffffffe000100p+589, 0x1.0001f80020000p+462, -0x1.ffffffc1c0040p+403, INFINITY, 0x0.0000000000000p+0}, {0x1.00003ff820000p+644, -0x1.ffffffe000100p+589, -0x1.0001f80020000p+462, 0x1.ffffffc1c0040p+403, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00003ff820000p+644, 0x1.ffffffe000100p+589, 0x1.0001f80020000p+462, -0x1.ffffffc1c0040p+403, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00003ff820000p+644, 0x1.ffffffe000100p+589, -0x1.0001f80020000p+462, 0x1.ffffffc1c0040p+403, INFINITY, 0x0.0000000000000p+0}, {0x1.007ffffffff80p-432, 0x1.fffffffe00000p-506, 0x1.0100000000000p+937, -0x1.0000000000000p+860, 0x1.01807ffffff80p+505, -0x1.ffffe1e100002p+451}, {0x1.007ffffffff80p-432, 0x1.fffffffe00000p-506, -0x1.0100000000000p+937, 0x1.0000000000000p+860, -0x1.01807ffffff80p+505, 0x1.ffffe1e100002p+451}, {-0x1.007ffffffff80p-432, -0x1.fffffffe00000p-506, 0x1.0100000000000p+937, -0x1.0000000000000p+860, -0x1.01807ffffff80p+505, 0x1.ffffe1e100002p+451}, {-0x1.007ffffffff80p-432, -0x1.fffffffe00000p-506, -0x1.0100000000000p+937, 0x1.0000000000000p+860, 0x1.01807ffffff80p+505, -0x1.ffffe1e100002p+451}, {0x1.0000000400000p+229, -0x1.e00003fff8200p+167, 0x1.000ffff802000p-917, -0x1.fffe3fffffe00p-979, 0x1.000ffffc02400p-688, -0x1.7bc3887f27780p-747}, {0x1.0000000400000p+229, -0x1.e00003fff8200p+167, -0x1.000ffff802000p-917, 0x1.fffe3fffffe00p-979, -0x1.000ffffc02400p-688, 0x1.7bc3887f27780p-747}, {-0x1.0000000400000p+229, 0x1.e00003fff8200p+167, 0x1.000ffff802000p-917, -0x1.fffe3fffffe00p-979, -0x1.000ffffc02400p-688, 0x1.7bc3887f27780p-747}, {-0x1.0000000400000p+229, 0x1.e00003fff8200p+167, -0x1.000ffff802000p-917, 0x1.fffe3fffffe00p-979, 0x1.000ffffc02400p-688, -0x1.7bc3887f27780p-747}, {0x1.00003ffffff00p-811, 0x1.ffc003ffffe00p-866, 0x1.0001ff0000000p+595, 0x1.ff8007fffffe0p+540, 0x1.00023f007fb00p-216, 0x1.f7a644b024dd0p-270}, {0x1.00003ffffff00p-811, 0x1.ffc003ffffe00p-866, -0x1.0001ff0000000p+595, -0x1.ff8007fffffe0p+540, -0x1.00023f007fb00p-216, -0x1.f7a644b024dd0p-270}, {-0x1.00003ffffff00p-811, -0x1.ffc003ffffe00p-866, 0x1.0001ff0000000p+595, 0x1.ff8007fffffe0p+540, -0x1.00023f007fb00p-216, -0x1.f7a644b024dd0p-270}, {-0x1.00003ffffff00p-811, -0x1.ffc003ffffe00p-866, -0x1.0001ff0000000p+595, -0x1.ff8007fffffe0p+540, 0x1.00023f007fb00p-216, 0x1.f7a644b024dd0p-270}, {0x1.1000000000000p-978, -0x1.ff00000000000p-1043, 0x1.0200000000000p+352, -0x1.c000000000008p+296, 0x1.1220000000000p-626, -0x1.dd017f0000010p-682}, {0x1.1000000000000p-978, -0x1.ff00000000000p-1043, -0x1.0200000000000p+352, 0x1.c000000000008p+296, -0x1.1220000000000p-626, 0x1.dd017f0000010p-682}, {-0x1.1000000000000p-978, 0x1.ff00000000000p-1043, 0x1.0200000000000p+352, -0x1.c000000000008p+296, -0x1.1220000000000p-626, 0x1.dd017f0000010p-682}, {-0x1.1000000000000p-978, 0x1.ff00000000000p-1043, -0x1.0200000000000p+352, 0x1.c000000000008p+296, 0x1.1220000000000p-626, -0x1.dd017f0000010p-682}, {0x1.1fffffc000000p+620, 0x1.ffffffffffff0p+563, 0x1.007fc00000800p+980, -0x1.fffff03fff000p+920, INFINITY, 0x0.0000000000000p+0}, {0x1.1fffffc000000p+620, 0x1.ffffffffffff0p+563, -0x1.007fc00000800p+980, 0x1.fffff03fff000p+920, -INFINITY, 0x0.0000000000000p+0}, {-0x1.1fffffc000000p+620, -0x1.ffffffffffff0p+563, 0x1.007fc00000800p+980, -0x1.fffff03fff000p+920, -INFINITY, 0x0.0000000000000p+0}, {-0x1.1fffffc000000p+620, -0x1.ffffffffffff0p+563, -0x1.007fc00000800p+980, 0x1.fffff03fff000p+920, INFINITY, 0x0.0000000000000p+0}, {0x1.00007fffff000p+841, 0x1.ffffffff00000p+769, 0x1.1fffffffc0000p+334, 0x1.fff0000000000p+266, INFINITY, 0x0.0000000000000p+0}, {0x1.00007fffff000p+841, 0x1.ffffffff00000p+769, -0x1.1fffffffc0000p+334, -0x1.fff0000000000p+266, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00007fffff000p+841, -0x1.ffffffff00000p+769, 0x1.1fffffffc0000p+334, 0x1.fff0000000000p+266, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00007fffff000p+841, -0x1.ffffffff00000p+769, -0x1.1fffffffc0000p+334, -0x1.fff0000000000p+266, INFINITY, 0x0.0000000000000p+0}, {0x1.0003ffffffffcp+878, 0x1.f000000000000p+777, 0x1.0000003ffff80p+707, 0x1.fffffefff8000p+639, INFINITY, 0x0.0000000000000p+0}, {0x1.0003ffffffffcp+878, 0x1.f000000000000p+777, -0x1.0000003ffff80p+707, -0x1.fffffefff8000p+639, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0003ffffffffcp+878, -0x1.f000000000000p+777, 0x1.0000003ffff80p+707, 0x1.fffffefff8000p+639, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0003ffffffffcp+878, -0x1.f000000000000p+777, -0x1.0000003ffff80p+707, -0x1.fffffefff8000p+639, INFINITY, 0x0.0000000000000p+0}, {0x1.00007ffc00000p+210, 0x1.ffffe00000000p+141, 0x1.3fffffc004000p+887, -0x1.ffffe00010000p+823, INFINITY, 0x0.0000000000000p+0}, {0x1.00007ffc00000p+210, 0x1.ffffe00000000p+141, -0x1.3fffffc004000p+887, 0x1.ffffe00010000p+823, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00007ffc00000p+210, -0x1.ffffe00000000p+141, 0x1.3fffffc004000p+887, -0x1.ffffe00010000p+823, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00007ffc00000p+210, -0x1.ffffe00000000p+141, -0x1.3fffffc004000p+887, 0x1.ffffe00010000p+823, INFINITY, 0x0.0000000000000p+0}, {0x1.0007ffffc0004p+901, -0x1.fffffe0040000p+830, 0x1.00ffffe000400p-637, -0x1.0000000000000p-729, 0x1.010807dfbf004p+264, 0x1.23fdf20002418p+209}, {0x1.0007ffffc0004p+901, -0x1.fffffe0040000p+830, -0x1.00ffffe000400p-637, 0x1.0000000000000p-729, -0x1.010807dfbf004p+264, -0x1.23fdf20002418p+209}, {-0x1.0007ffffc0004p+901, 0x1.fffffe0040000p+830, 0x1.00ffffe000400p-637, -0x1.0000000000000p-729, -0x1.010807dfbf004p+264, -0x1.23fdf20002418p+209}, {-0x1.0007ffffc0004p+901, 0x1.fffffe0040000p+830, -0x1.00ffffe000400p-637, 0x1.0000000000000p-729, 0x1.010807dfbf004p+264, 0x1.23fdf20002418p+209}, {0x1.007ffffffff00p-57, 0x1.fff8003000000p-134, 0x1.01fffffffe000p-715, 0x1.fffc000000000p-803, 0x1.0280fffffdeeep-772, 0x1.041c07d800000p-848}, {0x1.007ffffffff00p-57, 0x1.fff8003000000p-134, -0x1.01fffffffe000p-715, -0x1.fffc000000000p-803, -0x1.0280fffffdeeep-772, -0x1.041c07d800000p-848}, {-0x1.007ffffffff00p-57, -0x1.fff8003000000p-134, 0x1.01fffffffe000p-715, 0x1.fffc000000000p-803, -0x1.0280fffffdeeep-772, -0x1.041c07d800000p-848}, {-0x1.007ffffffff00p-57, -0x1.fff8003000000p-134, -0x1.01fffffffe000p-715, -0x1.fffc000000000p-803, 0x1.0280fffffdeeep-772, 0x1.041c07d800000p-848}, {0x1.00003e0000000p-443, 0x1.ffffffffe0000p-502, 0x1.07ffffff80000p+79, 0x1.8007ffffc0000p+8, 0x1.08003fef7fffep-364, 0x1.4203001095e38p-420}, {0x1.00003e0000000p-443, 0x1.ffffffffe0000p-502, -0x1.07ffffff80000p+79, -0x1.8007ffffc0000p+8, -0x1.08003fef7fffep-364, -0x1.4203001095e38p-420}, {-0x1.00003e0000000p-443, -0x1.ffffffffe0000p-502, 0x1.07ffffff80000p+79, 0x1.8007ffffc0000p+8, -0x1.08003fef7fffep-364, -0x1.4203001095e38p-420}, {-0x1.00003e0000000p-443, -0x1.ffffffffe0000p-502, -0x1.07ffffff80000p+79, -0x1.8007ffffc0000p+8, 0x1.08003fef7fffep-364, 0x1.4203001095e38p-420}, {0x1.00003ff810000p-96, -0x1.fffffffc00800p-160, 0x1.00000ffff8002p+307, -0x1.fffffffe04000p+240, 0x1.00004ff80bffap+211, -0x1.01f8812df9b50p+155}, {0x1.00003ff810000p-96, -0x1.fffffffc00800p-160, -0x1.00000ffff8002p+307, 0x1.fffffffe04000p+240, -0x1.00004ff80bffap+211, 0x1.01f8812df9b50p+155}, {-0x1.00003ff810000p-96, 0x1.fffffffc00800p-160, 0x1.00000ffff8002p+307, -0x1.fffffffe04000p+240, -0x1.00004ff80bffap+211, 0x1.01f8812df9b50p+155}, {-0x1.00003ff810000p-96, 0x1.fffffffc00800p-160, -0x1.00000ffff8002p+307, 0x1.fffffffe04000p+240, 0x1.00004ff80bffap+211, -0x1.01f8812df9b50p+155}, {0x1.0100000000000p-135, -0x1.0000000000000p-222, 0x1.01ffffff00004p-1000, -0x0.0000000000000p+0, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0100000000000p-135, -0x1.0000000000000p-222, -0x1.01ffffff00004p-1000, 0x0.0000000000000p+0, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0100000000000p-135, 0x1.0000000000000p-222, 0x1.01ffffff00004p-1000, -0x0.0000000000000p+0, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0100000000000p-135, 0x1.0000000000000p-222, -0x1.01ffffff00004p-1000, 0x0.0000000000000p+0, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.001fffffff800p+829, 0x1.fffff00000000p+749, 0x1.07ffe00001000p+551, -0x1.c7ffc001fe010p+494, INFINITY, 0x0.0000000000000p+0}, {0x1.001fffffff800p+829, 0x1.fffff00000000p+749, -0x1.07ffe00001000p+551, 0x1.c7ffc001fe010p+494, -INFINITY, 0x0.0000000000000p+0}, {-0x1.001fffffff800p+829, -0x1.fffff00000000p+749, 0x1.07ffe00001000p+551, -0x1.c7ffc001fe010p+494, -INFINITY, 0x0.0000000000000p+0}, {-0x1.001fffffff800p+829, -0x1.fffff00000000p+749, -0x1.07ffe00001000p+551, 0x1.c7ffc001fe010p+494, INFINITY, 0x0.0000000000000p+0}, {0x1.000000ffffff8p-632, 0x1.ffe0000000000p-704, 0x1.1fffffff00001p+944, -0x1.0000000000000p+859, 0x1.2000011effff8p+312, -0x1.fffb5f5800140p+255}, {0x1.000000ffffff8p-632, 0x1.ffe0000000000p-704, -0x1.1fffffff00001p+944, 0x1.0000000000000p+859, -0x1.2000011effff8p+312, 0x1.fffb5f5800140p+255}, {-0x1.000000ffffff8p-632, -0x1.ffe0000000000p-704, 0x1.1fffffff00001p+944, -0x1.0000000000000p+859, -0x1.2000011effff8p+312, 0x1.fffb5f5800140p+255}, {-0x1.000000ffffff8p-632, -0x1.ffe0000000000p-704, -0x1.1fffffff00001p+944, 0x1.0000000000000p+859, 0x1.2000011effff8p+312, -0x1.fffb5f5800140p+255}, {0x1.00000007fff00p-172, 0x1.fffc1ffff87f0p-228, 0x1.0000007c00000p+935, 0x1.fff0000000000p+864, 0x1.00000083fff00p+763, 0x1.77fe1835fdafap+709}, {0x1.00000007fff00p-172, 0x1.fffc1ffff87f0p-228, -0x1.0000007c00000p+935, -0x1.fff0000000000p+864, -0x1.00000083fff00p+763, -0x1.77fe1835fdafap+709}, {-0x1.00000007fff00p-172, -0x1.fffc1ffff87f0p-228, 0x1.0000007c00000p+935, 0x1.fff0000000000p+864, -0x1.00000083fff00p+763, -0x1.77fe1835fdafap+709}, {-0x1.00000007fff00p-172, -0x1.fffc1ffff87f0p-228, -0x1.0000007c00000p+935, -0x1.fff0000000000p+864, 0x1.00000083fff00p+763, 0x1.77fe1835fdafap+709}, {0x1.fffffffe00000p-318, 0x1.e000001fff800p-382, 0x1.0000000000000p+232, -0x1.f000080000000p+147, 0x1.fffffffe00000p-86, 0x1.dfffe11fff000p-150}, {0x1.fffffffe00000p-318, 0x1.e000001fff800p-382, -0x1.0000000000000p+232, 0x1.f000080000000p+147, -0x1.fffffffe00000p-86, -0x1.dfffe11fff000p-150}, {-0x1.fffffffe00000p-318, -0x1.e000001fff800p-382, 0x1.0000000000000p+232, -0x1.f000080000000p+147, -0x1.fffffffe00000p-86, -0x1.dfffe11fff000p-150}, {-0x1.fffffffe00000p-318, -0x1.e000001fff800p-382, -0x1.0000000000000p+232, 0x1.f000080000000p+147, 0x1.fffffffe00000p-86, 0x1.dfffe11fff000p-150}, {0x1.00007fffffe00p+860, 0x1.ffffff8000000p+790, 0x1.001f03f07ff00p-428, 0x1.ffffff8000000p-501, 0x1.001f840001c84p+432, -0x1.f43a8782b15e0p+377}, {0x1.00007fffffe00p+860, 0x1.ffffff8000000p+790, -0x1.001f03f07ff00p-428, -0x1.ffffff8000000p-501, -0x1.001f840001c84p+432, 0x1.f43a8782b15e0p+377}, {-0x1.00007fffffe00p+860, -0x1.ffffff8000000p+790, 0x1.001f03f07ff00p-428, 0x1.ffffff8000000p-501, -0x1.001f840001c84p+432, 0x1.f43a8782b15e0p+377}, {-0x1.00007fffffe00p+860, -0x1.ffffff8000000p+790, -0x1.001f03f07ff00p-428, -0x1.ffffff8000000p-501, 0x1.001f840001c84p+432, -0x1.f43a8782b15e0p+377}, {0x1.00003fffffffcp+10, 0x1.ffe0000700000p-63, 0x1.001f000000040p-31, 0x1.ffc0ffffc0000p-102, 0x1.001f4007c003cp-21, -0x1.aec01b80c3200p-83}, {0x1.00003fffffffcp+10, 0x1.ffe0000700000p-63, -0x1.001f000000040p-31, -0x1.ffc0ffffc0000p-102, -0x1.001f4007c003cp-21, 0x1.aec01b80c3200p-83}, {-0x1.00003fffffffcp+10, -0x1.ffe0000700000p-63, 0x1.001f000000040p-31, 0x1.ffc0ffffc0000p-102, -0x1.001f4007c003cp-21, 0x1.aec01b80c3200p-83}, {-0x1.00003fffffffcp+10, -0x1.ffe0000700000p-63, -0x1.001f000000040p-31, -0x1.ffc0ffffc0000p-102, 0x1.001f4007c003cp-21, -0x1.aec01b80c3200p-83}, {0x1.0000100000000p+594, -0x1.0000000000000p+512, 0x1.0000020000000p+926, -0x1.0000000000000p+834, INFINITY, 0x0.0000000000000p+0}, {0x1.0000100000000p+594, -0x1.0000000000000p+512, -0x1.0000020000000p+926, 0x1.0000000000000p+834, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000100000000p+594, 0x1.0000000000000p+512, 0x1.0000020000000p+926, -0x1.0000000000000p+834, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000100000000p+594, 0x1.0000000000000p+512, -0x1.0000020000000p+926, 0x1.0000000000000p+834, INFINITY, 0x0.0000000000000p+0}, {0x1.000007c000000p-87, 0x1.fff8000000000p-143, 0x1.003fff0000200p+65, -0x1.fe0003fc00040p+6, 0x1.004006c1f0184p-22, 0x1.c1aff992783b8p-78}, {0x1.000007c000000p-87, 0x1.fff8000000000p-143, -0x1.003fff0000200p+65, 0x1.fe0003fc00040p+6, -0x1.004006c1f0184p-22, -0x1.c1aff992783b8p-78}, {-0x1.000007c000000p-87, -0x1.fff8000000000p-143, 0x1.003fff0000200p+65, -0x1.fe0003fc00040p+6, -0x1.004006c1f0184p-22, -0x1.c1aff992783b8p-78}, {-0x1.000007c000000p-87, -0x1.fff8000000000p-143, -0x1.003fff0000200p+65, 0x1.fe0003fc00040p+6, 0x1.004006c1f0184p-22, 0x1.c1aff992783b8p-78}, {0x1.00001fffcffc0p+987, -0x1.fffe000000004p+932, 0x1.03fffff800000p-975, 0x1.fffffe0000000p-1043, 0x1.04002077cf3afp+12, -0x1.0396f3f70809ap-42}, {0x1.00001fffcffc0p+987, -0x1.fffe000000004p+932, -0x1.03fffff800000p-975, -0x1.fffffe0000000p-1043, -0x1.04002077cf3afp+12, 0x1.0396f3f70809ap-42}, {-0x1.00001fffcffc0p+987, 0x1.fffe000000004p+932, 0x1.03fffff800000p-975, 0x1.fffffe0000000p-1043, -0x1.04002077cf3afp+12, 0x1.0396f3f70809ap-42}, {-0x1.00001fffcffc0p+987, 0x1.fffe000000004p+932, -0x1.03fffff800000p-975, -0x1.fffffe0000000p-1043, 0x1.04002077cf3afp+12, -0x1.0396f3f70809ap-42}, {0x1.0000008000000p-118, -0x1.ffffff8200000p-175, 0x1.000fff8000000p-555, 0x1.fffffe0000000p-617, 0x1.0010000007ffcp-673, -0x1.f01ffe89f8200p-730}, {0x1.0000008000000p-118, -0x1.ffffff8200000p-175, -0x1.000fff8000000p-555, -0x1.fffffe0000000p-617, -0x1.0010000007ffcp-673, 0x1.f01ffe89f8200p-730}, {-0x1.0000008000000p-118, 0x1.ffffff8200000p-175, 0x1.000fff8000000p-555, 0x1.fffffe0000000p-617, -0x1.0010000007ffcp-673, 0x1.f01ffe89f8200p-730}, {-0x1.0000008000000p-118, 0x1.ffffff8200000p-175, -0x1.000fff8000000p-555, -0x1.fffffe0000000p-617, 0x1.0010000007ffcp-673, -0x1.f01ffe89f8200p-730}, {0x1.00000010001f8p+695, 0x1.fffc007e00000p+621, 0x1.0003fc0000000p-756, 0x1.ffff80ffffc00p-813, 0x1.0003fc10005f4p-61, 0x1.7d824090fe170p-117}, {0x1.00000010001f8p+695, 0x1.fffc007e00000p+621, -0x1.0003fc0000000p-756, -0x1.ffff80ffffc00p-813, -0x1.0003fc10005f4p-61, -0x1.7d824090fe170p-117}, {-0x1.00000010001f8p+695, -0x1.fffc007e00000p+621, 0x1.0003fc0000000p-756, 0x1.ffff80ffffc00p-813, -0x1.0003fc10005f4p-61, -0x1.7d824090fe170p-117}, {-0x1.00000010001f8p+695, -0x1.fffc007e00000p+621, -0x1.0003fc0000000p-756, -0x1.ffff80ffffc00p-813, 0x1.0003fc10005f4p-61, 0x1.7d824090fe170p-117}, {0x1.0000000000000p-985, -0x0.0000000000000p+0, 0x1.0300000001f00p-132, 0x1.fffffff800000p-208, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000000000000p-985, -0x0.0000000000000p+0, -0x1.0300000001f00p-132, -0x1.fffffff800000p-208, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000000000p-985, 0x0.0000000000000p+0, 0x1.0300000001f00p-132, 0x1.fffffff800000p-208, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000000000p-985, 0x0.0000000000000p+0, -0x1.0300000001f00p-132, -0x1.fffffff800000p-208, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.07ffffff1fe00p+389, 0x1.fc00000000000p+292, 0x1.0040000000000p+564, -0x1.c000000400000p+503, 0x1.0841ffff1fa7fp+953, 0x1.fc63fffffb100p+899}, {0x1.07ffffff1fe00p+389, 0x1.fc00000000000p+292, -0x1.0040000000000p+564, 0x1.c000000400000p+503, -0x1.0841ffff1fa7fp+953, -0x1.fc63fffffb100p+899}, {-0x1.07ffffff1fe00p+389, -0x1.fc00000000000p+292, 0x1.0040000000000p+564, -0x1.c000000400000p+503, -0x1.0841ffff1fa7fp+953, -0x1.fc63fffffb100p+899}, {-0x1.07ffffff1fe00p+389, -0x1.fc00000000000p+292, -0x1.0040000000000p+564, 0x1.c000000400000p+503, 0x1.0841ffff1fa7fp+953, 0x1.fc63fffffb100p+899}, {0x1.0080000000000p+192, -0x1.0000000000000p+87, 0x1.fffff1ff80000p+667, 0x1.ffffc000fe000p+612, 0x1.007ff8fc3fe00p+860, 0x1.007fdff07f3f4p+805}, {0x1.0080000000000p+192, -0x1.0000000000000p+87, -0x1.fffff1ff80000p+667, -0x1.ffffc000fe000p+612, -0x1.007ff8fc3fe00p+860, -0x1.007fdff07f3f4p+805}, {-0x1.0080000000000p+192, 0x1.0000000000000p+87, 0x1.fffff1ff80000p+667, 0x1.ffffc000fe000p+612, -0x1.007ff8fc3fe00p+860, -0x1.007fdff07f3f4p+805}, {-0x1.0080000000000p+192, 0x1.0000000000000p+87, -0x1.fffff1ff80000p+667, -0x1.ffffc000fe000p+612, 0x1.007ff8fc3fe00p+860, 0x1.007fdff07f3f4p+805}, {0x1.0400000000000p-301, -0x1.0000000000000p-406, 0x1.7fffe00000008p-283, -0x1.e000080000000p-363, 0x1.85ffdf8000008p-584, 0x1.fffffe187ff70p-640}, {0x1.0400000000000p-301, -0x1.0000000000000p-406, -0x1.7fffe00000008p-283, 0x1.e000080000000p-363, -0x1.85ffdf8000008p-584, -0x1.fffffe187ff70p-640}, {-0x1.0400000000000p-301, 0x1.0000000000000p-406, 0x1.7fffe00000008p-283, -0x1.e000080000000p-363, -0x1.85ffdf8000008p-584, -0x1.fffffe187ff70p-640}, {-0x1.0400000000000p-301, 0x1.0000000000000p-406, -0x1.7fffe00000008p-283, 0x1.e000080000000p-363, 0x1.85ffdf8000008p-584, 0x1.fffffe187ff70p-640}, {0x1.000001d000000p+298, -0x1.ff80000200000p+243, 0x1.0000003fffffcp+636, 0x1.feffff8000000p+556, 0x1.0000021000003p+934, 0x1.ff19f68008000p+869}, {0x1.000001d000000p+298, -0x1.ff80000200000p+243, -0x1.0000003fffffcp+636, -0x1.feffff8000000p+556, -0x1.0000021000003p+934, -0x1.ff19f68008000p+869}, {-0x1.000001d000000p+298, 0x1.ff80000200000p+243, 0x1.0000003fffffcp+636, 0x1.feffff8000000p+556, -0x1.0000021000003p+934, -0x1.ff19f68008000p+869}, {-0x1.000001d000000p+298, 0x1.ff80000200000p+243, -0x1.0000003fffffcp+636, -0x1.feffff8000000p+556, 0x1.0000021000003p+934, 0x1.ff19f68008000p+869}, {0x1.001ffffffffc0p+376, 0x1.fffffff03ff00p+315, 0x1.0000010000000p+147, -0x1.fffffff810000p+78, 0x1.002001001ffc0p+523, 0x1.fd7fc1f047e00p+462}, {0x1.001ffffffffc0p+376, 0x1.fffffff03ff00p+315, -0x1.0000010000000p+147, 0x1.fffffff810000p+78, -0x1.002001001ffc0p+523, -0x1.fd7fc1f047e00p+462}, {-0x1.001ffffffffc0p+376, -0x1.fffffff03ff00p+315, 0x1.0000010000000p+147, -0x1.fffffff810000p+78, -0x1.002001001ffc0p+523, -0x1.fd7fc1f047e00p+462}, {-0x1.001ffffffffc0p+376, -0x1.fffffff03ff00p+315, -0x1.0000010000000p+147, 0x1.fffffff810000p+78, 0x1.002001001ffc0p+523, 0x1.fd7fc1f047e00p+462}, {0x1.00000fffc0001p+666, -0x1.fc000007e0040p+607, 0x1.000007fffffc0p+408, 0x1.fc0003fc00000p+348, INFINITY, 0x0.0000000000000p+0}, {0x1.00000fffc0001p+666, -0x1.fc000007e0040p+607, -0x1.000007fffffc0p+408, -0x1.fc0003fc00000p+348, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00000fffc0001p+666, 0x1.fc000007e0040p+607, 0x1.000007fffffc0p+408, 0x1.fc0003fc00000p+348, -INFINITY, 0x0.0000000000000p+0}, {-0x1.00000fffc0001p+666, 0x1.fc000007e0040p+607, -0x1.000007fffffc0p+408, -0x1.fc0003fc00000p+348, INFINITY, 0x0.0000000000000p+0}, {0x1.01ffe000003fep+235, 0x1.ffffff8000000p+169, 0x1.00fffffe00000p+680, 0x1.ffffffe7ff800p+619, 0x1.0301dfddfc406p+915, -0x1.ec00381c54000p+854}, {0x1.01ffe000003fep+235, 0x1.ffffff8000000p+169, -0x1.00fffffe00000p+680, -0x1.ffffffe7ff800p+619, -0x1.0301dfddfc406p+915, 0x1.ec00381c54000p+854}, {-0x1.01ffe000003fep+235, -0x1.ffffff8000000p+169, 0x1.00fffffe00000p+680, 0x1.ffffffe7ff800p+619, -0x1.0301dfddfc406p+915, 0x1.ec00381c54000p+854}, {-0x1.01ffe000003fep+235, -0x1.ffffff8000000p+169, -0x1.00fffffe00000p+680, -0x1.ffffffe7ff800p+619, 0x1.0301dfddfc406p+915, -0x1.ec00381c54000p+854}, {0x1.3fffffffffc00p-546, 0x1.ffffffe000000p-609, 0x1.07c0ffc200000p+282, -0x1.e000003bfffe0p+224, 0x1.49b13fb27fbe1p-264, -0x1.a3a2f827f3a30p-321}, {0x1.3fffffffffc00p-546, 0x1.ffffffe000000p-609, -0x1.07c0ffc200000p+282, 0x1.e000003bfffe0p+224, -0x1.49b13fb27fbe1p-264, 0x1.a3a2f827f3a30p-321}, {-0x1.3fffffffffc00p-546, -0x1.ffffffe000000p-609, 0x1.07c0ffc200000p+282, -0x1.e000003bfffe0p+224, -0x1.49b13fb27fbe1p-264, 0x1.a3a2f827f3a30p-321}, {-0x1.3fffffffffc00p-546, -0x1.ffffffe000000p-609, -0x1.07c0ffc200000p+282, 0x1.e000003bfffe0p+224, 0x1.49b13fb27fbe1p-264, -0x1.a3a2f827f3a30p-321}, {0x1.0000001800000p+988, 0x1.fffffc0000200p+934, 0x1.0000004000000p+36, -0x1.fff0000004000p-31, INFINITY, 0x0.0000000000000p+0}, {0x1.0000001800000p+988, 0x1.fffffc0000200p+934, -0x1.0000004000000p+36, 0x1.fff0000004000p-31, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000001800000p+988, -0x1.fffffc0000200p+934, 0x1.0000004000000p+36, -0x1.fff0000004000p-31, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000001800000p+988, -0x1.fffffc0000200p+934, -0x1.0000004000000p+36, 0x1.fff0000004000p-31, INFINITY, 0x0.0000000000000p+0}, {0x1.0000800000000p+726, -0x1.0000000000000p+663, 0x1.0fc007c004000p-506, -0x1.fffe100000000p-570, 0x1.0fc08fa007e00p+220, 0x1.fbe080e080f00p+164}, {0x1.0000800000000p+726, -0x1.0000000000000p+663, -0x1.0fc007c004000p-506, 0x1.fffe100000000p-570, -0x1.0fc08fa007e00p+220, -0x1.fbe080e080f00p+164}, {-0x1.0000800000000p+726, 0x1.0000000000000p+663, 0x1.0fc007c004000p-506, -0x1.fffe100000000p-570, -0x1.0fc08fa007e00p+220, -0x1.fbe080e080f00p+164}, {-0x1.0000800000000p+726, 0x1.0000000000000p+663, -0x1.0fc007c004000p-506, 0x1.fffe100000000p-570, 0x1.0fc08fa007e00p+220, 0x1.fbe080e080f00p+164}, {0x1.00007fffffe00p-706, 0x1.ffffffc003f00p-767, 0x1.0080000000000p-265, -0x1.0000000000000p-323, 0x1.0080803fffdffp-971, -0x1.7fc1001006c00p-1030}, {0x1.00007fffffe00p-706, 0x1.ffffffc003f00p-767, -0x1.0080000000000p-265, 0x1.0000000000000p-323, -0x1.0080803fffdffp-971, 0x1.7fc1001006c00p-1030}, {-0x1.00007fffffe00p-706, -0x1.ffffffc003f00p-767, 0x1.0080000000000p-265, -0x1.0000000000000p-323, -0x1.0080803fffdffp-971, 0x1.7fc1001006c00p-1030}, {-0x1.00007fffffe00p-706, -0x1.ffffffc003f00p-767, -0x1.0080000000000p-265, 0x1.0000000000000p-323, 0x1.0080803fffdffp-971, -0x1.7fc1001006c00p-1030}, {0x1.0000200000000p+215, -0x1.0000000000000p+159, 0x1.00000ffffff80p+645, 0x1.ffffff0007ff8p+589, 0x1.0000300001f80p+860, 0x1.fe005e000fcf0p+803}, {0x1.0000200000000p+215, -0x1.0000000000000p+159, -0x1.00000ffffff80p+645, -0x1.ffffff0007ff8p+589, -0x1.0000300001f80p+860, -0x1.fe005e000fcf0p+803}, {-0x1.0000200000000p+215, 0x1.0000000000000p+159, 0x1.00000ffffff80p+645, 0x1.ffffff0007ff8p+589, -0x1.0000300001f80p+860, -0x1.fe005e000fcf0p+803}, {-0x1.0000200000000p+215, 0x1.0000000000000p+159, -0x1.00000ffffff80p+645, -0x1.ffffff0007ff8p+589, 0x1.0000300001f80p+860, 0x1.fe005e000fcf0p+803}, {0x1.00fe000000000p-121, 0x1.001ffffff0000p-190, 0x1.00007fffff000p+370, 0x0.0000000000000p+0, 0x1.00fe807efeff0p+249, 0x1.00040082003fcp+194}, {0x1.00fe000000000p-121, 0x1.001ffffff0000p-190, -0x1.00007fffff000p+370, 0x0.0000000000000p+0, -0x1.00fe807efeff0p+249, -0x1.00040082003fcp+194}, {-0x1.00fe000000000p-121, -0x1.001ffffff0000p-190, 0x1.00007fffff000p+370, 0x0.0000000000000p+0, -0x1.00fe807efeff0p+249, -0x1.00040082003fcp+194}, {-0x1.00fe000000000p-121, -0x1.001ffffff0000p-190, -0x1.00007fffff000p+370, 0x0.0000000000000p+0, 0x1.00fe807efeff0p+249, 0x1.00040082003fcp+194}, {0x1.01e0000000002p+273, -0x1.fffffffffc200p+214, 0x1.0000080000000p-103, -0x1.0000000000000p-208, 0x1.01e0080f00002p+170, -0x1.fff80ffffc240p+111}, {0x1.01e0000000002p+273, -0x1.fffffffffc200p+214, -0x1.0000080000000p-103, 0x1.0000000000000p-208, -0x1.01e0080f00002p+170, 0x1.fff80ffffc240p+111}, {-0x1.01e0000000002p+273, 0x1.fffffffffc200p+214, 0x1.0000080000000p-103, -0x1.0000000000000p-208, -0x1.01e0080f00002p+170, 0x1.fff80ffffc240p+111}, {-0x1.01e0000000002p+273, 0x1.fffffffffc200p+214, -0x1.0000080000000p-103, 0x1.0000000000000p-208, 0x1.01e0080f00002p+170, -0x1.fff80ffffc240p+111}, {0x1.000000f1fe001p-504, -0x1.0000000000000p-587, 0x1.00003fffffff0p-718, 0x1.fc00000000000p-795, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.000000f1fe001p-504, -0x1.0000000000000p-587, -0x1.00003fffffff0p-718, -0x1.fc00000000000p-795, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.000000f1fe001p-504, 0x1.0000000000000p-587, 0x1.00003fffffff0p-718, 0x1.fc00000000000p-795, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.000000f1fe001p-504, 0x1.0000000000000p-587, -0x1.00003fffffff0p-718, -0x1.fc00000000000p-795, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0008000000010p+198, -0x1.f8000ffff9000p+133, 0x1.00001ffff0000p+936, 0x1.ffff80001f000p+879, INFINITY, 0x0.0000000000000p+0}, {0x1.0008000000010p+198, -0x1.f8000ffff9000p+133, -0x1.00001ffff0000p+936, -0x1.ffff80001f000p+879, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0008000000010p+198, 0x1.f8000ffff9000p+133, 0x1.00001ffff0000p+936, 0x1.ffff80001f000p+879, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0008000000010p+198, 0x1.f8000ffff9000p+133, -0x1.00001ffff0000p+936, -0x1.ffff80001f000p+879, INFINITY, 0x0.0000000000000p+0}, {0x1.0000100000000p+641, -0x1.0000000000000p+536, 0x1.0038000800000p-759, -0x1.fffffe0000080p-819, 0x1.0038100b80008p-118, -0x1.00000efffff80p-177}, {0x1.0000100000000p+641, -0x1.0000000000000p+536, -0x1.0038000800000p-759, 0x1.fffffe0000080p-819, -0x1.0038100b80008p-118, 0x1.00000efffff80p-177}, {-0x1.0000100000000p+641, 0x1.0000000000000p+536, 0x1.0038000800000p-759, -0x1.fffffe0000080p-819, -0x1.0038100b80008p-118, 0x1.00000efffff80p-177}, {-0x1.0000100000000p+641, 0x1.0000000000000p+536, -0x1.0038000800000p-759, 0x1.fffffe0000080p-819, 0x1.0038100b80008p-118, -0x1.00000efffff80p-177}, {0x1.00003fe008000p-579, -0x1.fffdff0000080p-638, 0x1.ffffffffff800p-344, 0x1.fe00000000000p-442, 0x1.00003fe007c00p-922, -0x1.3fdf077ffec60p-980}, {0x1.00003fe008000p-579, -0x1.fffdff0000080p-638, -0x1.ffffffffff800p-344, -0x1.fe00000000000p-442, -0x1.00003fe007c00p-922, 0x1.3fdf077ffec60p-980}, {-0x1.00003fe008000p-579, 0x1.fffdff0000080p-638, 0x1.ffffffffff800p-344, 0x1.fe00000000000p-442, -0x1.00003fe007c00p-922, 0x1.3fdf077ffec60p-980}, {-0x1.00003fe008000p-579, 0x1.fffdff0000080p-638, -0x1.ffffffffff800p-344, -0x1.fe00000000000p-442, 0x1.00003fe007c00p-922, -0x1.3fdf077ffec60p-980}, {0x1.1fffffff00000p-455, 0x1.ffffff8000000p-527, 0x1.0000100000000p+435, -0x1.0000000000000p+341, 0x1.200011fefffffp-20, 0x1.00000d8000000p-91}, {0x1.1fffffff00000p-455, 0x1.ffffff8000000p-527, -0x1.0000100000000p+435, 0x1.0000000000000p+341, -0x1.200011fefffffp-20, -0x1.00000d8000000p-91}, {-0x1.1fffffff00000p-455, -0x1.ffffff8000000p-527, 0x1.0000100000000p+435, -0x1.0000000000000p+341, -0x1.200011fefffffp-20, -0x1.00000d8000000p-91}, {-0x1.1fffffff00000p-455, -0x1.ffffff8000000p-527, -0x1.0000100000000p+435, 0x1.0000000000000p+341, 0x1.200011fefffffp-20, 0x1.00000d8000000p-91}, {0x1.0ffffc0000010p+917, 0x1.f000000ff0000p+848, 0x1.00003ff002010p+155, -0x1.0000020000000p+90, INFINITY, 0x0.0000000000000p+0}, {0x1.0ffffc0000010p+917, 0x1.f000000ff0000p+848, -0x1.00003ff002010p+155, 0x1.0000020000000p+90, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0ffffc0000010p+917, -0x1.f000000ff0000p+848, 0x1.00003ff002010p+155, -0x1.0000020000000p+90, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0ffffc0000010p+917, -0x1.f000000ff0000p+848, -0x1.00003ff002010p+155, 0x1.0000020000000p+90, INFINITY, 0x0.0000000000000p+0}, {0x1.00ffffffc0000p+784, 0x1.fffffe00003f0p+729, 0x1.1fffffffff020p-125, -0x1.ffff000400000p-200, 0x1.211fffffb7010p+659, 0x1.9ffffeb0072d6p+605}, {0x1.00ffffffc0000p+784, 0x1.fffffe00003f0p+729, -0x1.1fffffffff020p-125, 0x1.ffff000400000p-200, -0x1.211fffffb7010p+659, -0x1.9ffffeb0072d6p+605}, {-0x1.00ffffffc0000p+784, -0x1.fffffe00003f0p+729, 0x1.1fffffffff020p-125, -0x1.ffff000400000p-200, -0x1.211fffffb7010p+659, -0x1.9ffffeb0072d6p+605}, {-0x1.00ffffffc0000p+784, -0x1.fffffe00003f0p+729, -0x1.1fffffffff020p-125, 0x1.ffff000400000p-200, 0x1.211fffffb7010p+659, 0x1.9ffffeb0072d6p+605}, {0x1.0200000000000p+902, -0x1.0000000000000p+849, 0x1.0000700000000p-969, 0x1.ffffffe000000p-1040, 0x1.020070e000000p-67, -0x1.ffffde0000102p-121}, {0x1.0200000000000p+902, -0x1.0000000000000p+849, -0x1.0000700000000p-969, -0x1.ffffffe000000p-1040, -0x1.020070e000000p-67, 0x1.ffffde0000102p-121}, {-0x1.0200000000000p+902, 0x1.0000000000000p+849, 0x1.0000700000000p-969, 0x1.ffffffe000000p-1040, -0x1.020070e000000p-67, 0x1.ffffde0000102p-121}, {-0x1.0200000000000p+902, 0x1.0000000000000p+849, -0x1.0000700000000p-969, -0x1.ffffffe000000p-1040, 0x1.020070e000000p-67, -0x1.ffffde0000102p-121}, {0x1.3fffffc0001fcp+335, 0x1.007fffff00000p+272, 0x1.007fffff80000p+3, 0x1.fffffffe00000p-65, 0x1.409fffbf401fdp+338, 0x1.14f84ffa6b400p+275}, {0x1.3fffffc0001fcp+335, 0x1.007fffff00000p+272, -0x1.007fffff80000p+3, -0x1.fffffffe00000p-65, -0x1.409fffbf401fdp+338, -0x1.14f84ffa6b400p+275}, {-0x1.3fffffc0001fcp+335, -0x1.007fffff00000p+272, 0x1.007fffff80000p+3, 0x1.fffffffe00000p-65, -0x1.409fffbf401fdp+338, -0x1.14f84ffa6b400p+275}, {-0x1.3fffffc0001fcp+335, -0x1.007fffff00000p+272, -0x1.007fffff80000p+3, -0x1.fffffffe00000p-65, 0x1.409fffbf401fdp+338, 0x1.14f84ffa6b400p+275}, {0x1.00000ffffffd0p+189, -0x1.ffffff8200000p+123, 0x1.00000c0000004p-197, -0x1.ff80000800000p-265, 0x1.00001c0000bd4p-8, -0x1.7ff00fc280000p-73}, {0x1.00000ffffffd0p+189, -0x1.ffffff8200000p+123, -0x1.00000c0000004p-197, 0x1.ff80000800000p-265, -0x1.00001c0000bd4p-8, 0x1.7ff00fc280000p-73}, {-0x1.00000ffffffd0p+189, 0x1.ffffff8200000p+123, 0x1.00000c0000004p-197, -0x1.ff80000800000p-265, -0x1.00001c0000bd4p-8, 0x1.7ff00fc280000p-73}, {-0x1.00000ffffffd0p+189, 0x1.ffffff8200000p+123, -0x1.00000c0000004p-197, 0x1.ff80000800000p-265, 0x1.00001c0000bd4p-8, -0x1.7ff00fc280000p-73}, {0x1.18003ffff8000p+281, 0x1.ffffff8000000p+215, 0x1.1ffff80000040p-329, -0x1.0000000000000p-419, 0x1.3b003f3ff5046p-48, 0x1.063fff6e58000p-106}, {0x1.18003ffff8000p+281, 0x1.ffffff8000000p+215, -0x1.1ffff80000040p-329, 0x1.0000000000000p-419, -0x1.3b003f3ff5046p-48, -0x1.063fff6e58000p-106}, {-0x1.18003ffff8000p+281, -0x1.ffffff8000000p+215, 0x1.1ffff80000040p-329, -0x1.0000000000000p-419, -0x1.3b003f3ff5046p-48, -0x1.063fff6e58000p-106}, {-0x1.18003ffff8000p+281, -0x1.ffffff8000000p+215, -0x1.1ffff80000040p-329, 0x1.0000000000000p-419, 0x1.3b003f3ff5046p-48, 0x1.063fff6e58000p-106}, {0x1.0ffffff9ffff0p+735, 0x1.f800008200000p+665, 0x1.000000ffffff8p+876, 0x1.ff0000007ffc0p+817, INFINITY, 0x0.0000000000000p+0}, {0x1.0ffffff9ffff0p+735, 0x1.f800008200000p+665, -0x1.000000ffffff8p+876, -0x1.ff0000007ffc0p+817, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0ffffff9ffff0p+735, -0x1.f800008200000p+665, 0x1.000000ffffff8p+876, 0x1.ff0000007ffc0p+817, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0ffffff9ffff0p+735, -0x1.f800008200000p+665, -0x1.000000ffffff8p+876, -0x1.ff0000007ffc0p+817, INFINITY, 0x0.0000000000000p+0}, {0x1.1fffffe000000p-807, 0x1.ffff800001ffep-861, 0x1.0000008000000p+287, -0x1.fffffc0000008p+231, 0x1.2000006ffffffp-520, 0x1.6fff823001bfap-574}, {0x1.1fffffe000000p-807, 0x1.ffff800001ffep-861, -0x1.0000008000000p+287, 0x1.fffffc0000008p+231, -0x1.2000006ffffffp-520, -0x1.6fff823001bfap-574}, {-0x1.1fffffe000000p-807, -0x1.ffff800001ffep-861, 0x1.0000008000000p+287, -0x1.fffffc0000008p+231, -0x1.2000006ffffffp-520, -0x1.6fff823001bfap-574}, {-0x1.1fffffe000000p-807, -0x1.ffff800001ffep-861, -0x1.0000008000000p+287, 0x1.fffffc0000008p+231, 0x1.2000006ffffffp-520, 0x1.6fff823001bfap-574}, {0x1.0000200000000p-310, -0x1.fffffff804000p-377, 0x1.0000080000000p+614, -0x1.0000000000000p+519, 0x1.0000280001000p+304, -0x1.0000080402000p+238}, {0x1.0000200000000p-310, -0x1.fffffff804000p-377, -0x1.0000080000000p+614, 0x1.0000000000000p+519, -0x1.0000280001000p+304, 0x1.0000080402000p+238}, {-0x1.0000200000000p-310, 0x1.fffffff804000p-377, 0x1.0000080000000p+614, -0x1.0000000000000p+519, -0x1.0000280001000p+304, 0x1.0000080402000p+238}, {-0x1.0000200000000p-310, 0x1.fffffff804000p-377, -0x1.0000080000000p+614, 0x1.0000000000000p+519, 0x1.0000280001000p+304, -0x1.0000080402000p+238}, {0x1.03ffff0000010p-506, -0x1.fffc010000000p-582, 0x1.0000020000000p+657, -0x1.0000000000000p+552, 0x1.04000107ffff0p+151, 0x1.e0003faf80000p+79}, {0x1.03ffff0000010p-506, -0x1.fffc010000000p-582, -0x1.0000020000000p+657, 0x1.0000000000000p+552, -0x1.04000107ffff0p+151, -0x1.e0003faf80000p+79}, {-0x1.03ffff0000010p-506, 0x1.fffc010000000p-582, 0x1.0000020000000p+657, -0x1.0000000000000p+552, -0x1.04000107ffff0p+151, -0x1.e0003faf80000p+79}, {-0x1.03ffff0000010p-506, 0x1.fffc010000000p-582, -0x1.0000020000000p+657, 0x1.0000000000000p+552, 0x1.04000107ffff0p+151, 0x1.e0003faf80000p+79}, {0x1.7ffffffc00000p-455, 0x1.fff80000fc000p-516, 0x1.0010000000000p+908, -0x1.ffffffffc4000p+841, 0x1.8017fffbffc00p+453, 0x1.f417ff811d700p+392}, {0x1.7ffffffc00000p-455, 0x1.fff80000fc000p-516, -0x1.0010000000000p+908, 0x1.ffffffffc4000p+841, -0x1.8017fffbffc00p+453, -0x1.f417ff811d700p+392}, {-0x1.7ffffffc00000p-455, -0x1.fff80000fc000p-516, 0x1.0010000000000p+908, -0x1.ffffffffc4000p+841, -0x1.8017fffbffc00p+453, -0x1.f417ff811d700p+392}, {-0x1.7ffffffc00000p-455, -0x1.fff80000fc000p-516, -0x1.0010000000000p+908, 0x1.ffffffffc4000p+841, 0x1.8017fffbffc00p+453, 0x1.f417ff811d700p+392}, {0x1.000007fffc004p-48, -0x1.8000004000000p-107, 0x1.7fe000001ff00p+482, 0x1.f000000000000p+381, 0x1.7fe00bff19f0ep+434, 0x1.5f0b0077ee250p+377}, {0x1.000007fffc004p-48, -0x1.8000004000000p-107, -0x1.7fe000001ff00p+482, -0x1.f000000000000p+381, -0x1.7fe00bff19f0ep+434, -0x1.5f0b0077ee250p+377}, {-0x1.000007fffc004p-48, 0x1.8000004000000p-107, 0x1.7fe000001ff00p+482, 0x1.f000000000000p+381, -0x1.7fe00bff19f0ep+434, -0x1.5f0b0077ee250p+377}, {-0x1.000007fffc004p-48, 0x1.8000004000000p-107, -0x1.7fe000001ff00p+482, -0x1.f000000000000p+381, 0x1.7fe00bff19f0ep+434, 0x1.5f0b0077ee250p+377}, {0x1.01ffffffffc00p-235, 0x0.0000000000000p+0, 0x1.0ffffff000000p-5, 0x1.fffffff000000p-75, 0x1.121fffefdfbc0p-240, 0x1.81fffff7f0000p-309}, {0x1.01ffffffffc00p-235, 0x0.0000000000000p+0, -0x1.0ffffff000000p-5, -0x1.fffffff000000p-75, -0x1.121fffefdfbc0p-240, -0x1.81fffff7f0000p-309}, {-0x1.01ffffffffc00p-235, 0x0.0000000000000p+0, 0x1.0ffffff000000p-5, 0x1.fffffff000000p-75, -0x1.121fffefdfbc0p-240, -0x1.81fffff7f0000p-309}, {-0x1.01ffffffffc00p-235, 0x0.0000000000000p+0, -0x1.0ffffff000000p-5, -0x1.fffffff000000p-75, 0x1.121fffefdfbc0p-240, 0x1.81fffff7f0000p-309}, {0x1.0000010000000p-572, -0x1.ffffffffe4000p-634, 0x1.0000020000000p-195, -0x1.ff80000100000p-268, 0x1.0000030000020p-767, -0x1.001ffa0012000p-828}, {0x1.0000010000000p-572, -0x1.ffffffffe4000p-634, -0x1.0000020000000p-195, 0x1.ff80000100000p-268, -0x1.0000030000020p-767, 0x1.001ffa0012000p-828}, {-0x1.0000010000000p-572, 0x1.ffffffffe4000p-634, 0x1.0000020000000p-195, -0x1.ff80000100000p-268, -0x1.0000030000020p-767, 0x1.001ffa0012000p-828}, {-0x1.0000010000000p-572, 0x1.ffffffffe4000p-634, -0x1.0000020000000p-195, 0x1.ff80000100000p-268, 0x1.0000030000020p-767, -0x1.001ffa0012000p-828}, {0x1.0008000000000p+139, -0x1.0000000000000p+34, 0x1.000fffff80000p+540, 0x1.fffffffc00000p+484, 0x1.0018007f7ffc0p+679, 0x1.0007fffdffefcp+624}, {0x1.0008000000000p+139, -0x1.0000000000000p+34, -0x1.000fffff80000p+540, -0x1.fffffffc00000p+484, -0x1.0018007f7ffc0p+679, -0x1.0007fffdffefcp+624}, {-0x1.0008000000000p+139, 0x1.0000000000000p+34, 0x1.000fffff80000p+540, 0x1.fffffffc00000p+484, -0x1.0018007f7ffc0p+679, -0x1.0007fffdffefcp+624}, {-0x1.0008000000000p+139, 0x1.0000000000000p+34, -0x1.000fffff80000p+540, -0x1.fffffffc00000p+484, 0x1.0018007f7ffc0p+679, 0x1.0007fffdffefcp+624}, {0x1.007fffffffc00p+663, 0x1.ffffc00000000p+598, 0x1.1ffffffff8000p-133, 0x1.fe001ffffffe0p-189, 0x1.208ffffff7b40p+530, 0x1.000f90f5ffbb4p+475}, {0x1.007fffffffc00p+663, 0x1.ffffc00000000p+598, -0x1.1ffffffff8000p-133, -0x1.fe001ffffffe0p-189, -0x1.208ffffff7b40p+530, -0x1.000f90f5ffbb4p+475}, {-0x1.007fffffffc00p+663, -0x1.ffffc00000000p+598, 0x1.1ffffffff8000p-133, 0x1.fe001ffffffe0p-189, -0x1.208ffffff7b40p+530, -0x1.000f90f5ffbb4p+475}, {-0x1.007fffffffc00p+663, -0x1.ffffc00000000p+598, -0x1.1ffffffff8000p-133, -0x1.fe001ffffffe0p-189, 0x1.208ffffff7b40p+530, 0x1.000f90f5ffbb4p+475}, {0x1.0000000fffe00p-673, 0x1.3fffff87fc000p-733, 0x1.00003ffffc000p-1010, 0x1.0000000000000p-1074, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000000fffe00p-673, 0x1.3fffff87fc000p-733, -0x1.00003ffffc000p-1010, -0x1.0000000000000p-1074, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000fffe00p-673, -0x1.3fffff87fc000p-733, 0x1.00003ffffc000p-1010, 0x1.0000000000000p-1074, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000fffe00p-673, -0x1.3fffff87fc000p-733, -0x1.00003ffffc000p-1010, -0x1.0000000000000p-1074, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000000800000p+490, -0x1.0000000000000p+385, 0x1.7ffff80000000p+812, 0x1.ffffffffe0000p+756, INFINITY, 0x0.0000000000000p+0}, {0x1.0000000800000p+490, -0x1.0000000000000p+385, -0x1.7ffff80000000p+812, -0x1.ffffffffe0000p+756, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000000800000p+490, 0x1.0000000000000p+385, 0x1.7ffff80000000p+812, 0x1.ffffffffe0000p+756, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000000800000p+490, 0x1.0000000000000p+385, -0x1.7ffff80000000p+812, -0x1.ffffffffe0000p+756, INFINITY, 0x0.0000000000000p+0}, {0x1.00fffffff8000p-776, 0x1.fffe000000000p-850, 0x1.0000100000000p+556, -0x1.fffffffffc100p+501, 0x1.0100100ff8000p-220, -0x1.20ffe00014060p-274}, {0x1.00fffffff8000p-776, 0x1.fffe000000000p-850, -0x1.0000100000000p+556, 0x1.fffffffffc100p+501, -0x1.0100100ff8000p-220, 0x1.20ffe00014060p-274}, {-0x1.00fffffff8000p-776, -0x1.fffe000000000p-850, 0x1.0000100000000p+556, -0x1.fffffffffc100p+501, -0x1.0100100ff8000p-220, 0x1.20ffe00014060p-274}, {-0x1.00fffffff8000p-776, -0x1.fffe000000000p-850, -0x1.0000100000000p+556, 0x1.fffffffffc100p+501, 0x1.0100100ff8000p-220, -0x1.20ffe00014060p-274}, {0x1.0007ffffffff0p+441, 0x1.fffffc0000000p+358, 0x1.0003800000080p+407, -0x1.0000000000000p+302, 0x1.000b801c00070p+848, 0x1.e40001ffc6f80p+789}, {0x1.0007ffffffff0p+441, 0x1.fffffc0000000p+358, -0x1.0003800000080p+407, 0x1.0000000000000p+302, -0x1.000b801c00070p+848, -0x1.e40001ffc6f80p+789}, {-0x1.0007ffffffff0p+441, -0x1.fffffc0000000p+358, 0x1.0003800000080p+407, -0x1.0000000000000p+302, -0x1.000b801c00070p+848, -0x1.e40001ffc6f80p+789}, {-0x1.0007ffffffff0p+441, -0x1.fffffc0000000p+358, -0x1.0003800000080p+407, 0x1.0000000000000p+302, 0x1.000b801c00070p+848, 0x1.e40001ffc6f80p+789}, {0x1.000001fffff80p-397, 0x1.ff00000000000p-481, 0x1.0000020000000p+10, -0x1.8002000000000p-66, 0x1.000003fffffc0p-387, -0x1.017e030300000p-455}, {0x1.000001fffff80p-397, 0x1.ff00000000000p-481, -0x1.0000020000000p+10, 0x1.8002000000000p-66, -0x1.000003fffffc0p-387, 0x1.017e030300000p-455}, {-0x1.000001fffff80p-397, -0x1.ff00000000000p-481, 0x1.0000020000000p+10, -0x1.8002000000000p-66, -0x1.000003fffffc0p-387, 0x1.017e030300000p-455}, {-0x1.000001fffff80p-397, -0x1.ff00000000000p-481, -0x1.0000020000000p+10, 0x1.8002000000000p-66, 0x1.000003fffffc0p-387, -0x1.017e030300000p-455}, {0x1.0003fffff0000p+165, 0x1.ffff800007f80p+105, 0x1.000007ffffe00p+981, -0x1.fe0c000004000p+923, INFINITY, 0x0.0000000000000p+0}, {0x1.0003fffff0000p+165, 0x1.ffff800007f80p+105, -0x1.000007ffffe00p+981, 0x1.fe0c000004000p+923, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0003fffff0000p+165, -0x1.ffff800007f80p+105, 0x1.000007ffffe00p+981, -0x1.fe0c000004000p+923, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0003fffff0000p+165, -0x1.ffff800007f80p+105, -0x1.000007ffffe00p+981, 0x1.fe0c000004000p+923, INFINITY, 0x0.0000000000000p+0}, {0x1.00000003f0000p+687, 0x1.ffffffe000000p+609, 0x1.0100000000000p-215, -0x1.fffffff000080p-275, 0x1.01000003f3f00p+472, -0x1.ffff7f77e0100p+412}, {0x1.00000003f0000p+687, 0x1.ffffffe000000p+609, -0x1.0100000000000p-215, 0x1.fffffff000080p-275, -0x1.01000003f3f00p+472, 0x1.ffff7f77e0100p+412}, {-0x1.00000003f0000p+687, -0x1.ffffffe000000p+609, 0x1.0100000000000p-215, -0x1.fffffff000080p-275, -0x1.01000003f3f00p+472, 0x1.ffff7f77e0100p+412}, {-0x1.00000003f0000p+687, -0x1.ffffffe000000p+609, -0x1.0100000000000p-215, 0x1.fffffff000080p-275, 0x1.01000003f3f00p+472, -0x1.ffff7f77e0100p+412}, {0x1.007fffffffc00p-448, 0x1.fffffe0000000p-530, 0x1.0000003fffff8p-643, 0x1.fffff80000000p-714, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.007fffffffc00p-448, 0x1.fffffe0000000p-530, -0x1.0000003fffff8p-643, -0x1.fffff80000000p-714, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.007fffffffc00p-448, -0x1.fffffe0000000p-530, 0x1.0000003fffff8p-643, 0x1.fffff80000000p-714, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.007fffffffc00p-448, -0x1.fffffe0000000p-530, -0x1.0000003fffff8p-643, -0x1.fffff80000000p-714, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00000003ff000p-711, 0x1.ffffff0000000p-773, 0x1.0000ffff80000p+16, 0x1.e0000000fffc0p-43, 0x1.000100037f040p-695, -0x1.7bfef005e8810p-752}, {0x1.00000003ff000p-711, 0x1.ffffff0000000p-773, -0x1.0000ffff80000p+16, -0x1.e0000000fffc0p-43, -0x1.000100037f040p-695, 0x1.7bfef005e8810p-752}, {-0x1.00000003ff000p-711, -0x1.ffffff0000000p-773, 0x1.0000ffff80000p+16, 0x1.e0000000fffc0p-43, -0x1.000100037f040p-695, 0x1.7bfef005e8810p-752}, {-0x1.00000003ff000p-711, -0x1.ffffff0000000p-773, -0x1.0000ffff80000p+16, -0x1.e0000000fffc0p-43, 0x1.000100037f040p-695, -0x1.7bfef005e8810p-752}, {0x1.007ffffffc000p-157, 0x1.ffffff8000000p-224, 0x1.0003fffffffe0p-88, 0x1.fffffff000780p-148, 0x1.008401fffbfdfp-245, -0x1.bf5ffdf221f10p-302}, {0x1.007ffffffc000p-157, 0x1.ffffff8000000p-224, -0x1.0003fffffffe0p-88, -0x1.fffffff000780p-148, -0x1.008401fffbfdfp-245, 0x1.bf5ffdf221f10p-302}, {-0x1.007ffffffc000p-157, -0x1.ffffff8000000p-224, 0x1.0003fffffffe0p-88, 0x1.fffffff000780p-148, -0x1.008401fffbfdfp-245, 0x1.bf5ffdf221f10p-302}, {-0x1.007ffffffc000p-157, -0x1.ffffff8000000p-224, -0x1.0003fffffffe0p-88, -0x1.fffffff000780p-148, 0x1.008401fffbfdfp-245, -0x1.bf5ffdf221f10p-302}, {0x1.07fffffe0003cp-432, 0x1.ffe000007f000p-497, 0x1.1ffff00800000p+307, -0x1.0000000000000p+210, 0x1.28ffef8600045p-125, 0x1.fc3902fc0230cp-179}, {0x1.07fffffe0003cp-432, 0x1.ffe000007f000p-497, -0x1.1ffff00800000p+307, 0x1.0000000000000p+210, -0x1.28ffef8600045p-125, -0x1.fc3902fc0230cp-179}, {-0x1.07fffffe0003cp-432, -0x1.ffe000007f000p-497, 0x1.1ffff00800000p+307, -0x1.0000000000000p+210, -0x1.28ffef8600045p-125, -0x1.fc3902fc0230cp-179}, {-0x1.07fffffe0003cp-432, -0x1.ffe000007f000p-497, -0x1.1ffff00800000p+307, 0x1.0000000000000p+210, 0x1.28ffef8600045p-125, 0x1.fc3902fc0230cp-179}, {0x1.000003fff8000p+711, 0x1.ffff00000003cp+656, 0x1.000001ffff020p+18, -0x1.fff0000200000p-52, 0x1.000005fff70a0p+729, 0x1.f5ff0817ec048p+674}, {0x1.000003fff8000p+711, 0x1.ffff00000003cp+656, -0x1.000001ffff020p+18, 0x1.fff0000200000p-52, -0x1.000005fff70a0p+729, -0x1.f5ff0817ec048p+674}, {-0x1.000003fff8000p+711, -0x1.ffff00000003cp+656, 0x1.000001ffff020p+18, -0x1.fff0000200000p-52, -0x1.000005fff70a0p+729, -0x1.f5ff0817ec048p+674}, {-0x1.000003fff8000p+711, -0x1.ffff00000003cp+656, -0x1.000001ffff020p+18, 0x1.fff0000200000p-52, 0x1.000005fff70a0p+729, 0x1.f5ff0817ec048p+674}, {0x1.00ffe00000000p-302, 0x1.fe00000000000p-362, 0x1.0000100000000p+87, -0x1.ffff800010000p+18, 0x1.00fff00ffe000p-215, 0x1.fcff20403ff00p-275}, {0x1.00ffe00000000p-302, 0x1.fe00000000000p-362, -0x1.0000100000000p+87, 0x1.ffff800010000p+18, -0x1.00fff00ffe000p-215, -0x1.fcff20403ff00p-275}, {-0x1.00ffe00000000p-302, -0x1.fe00000000000p-362, 0x1.0000100000000p+87, -0x1.ffff800010000p+18, -0x1.00fff00ffe000p-215, -0x1.fcff20403ff00p-275}, {-0x1.00ffe00000000p-302, -0x1.fe00000000000p-362, -0x1.0000100000000p+87, 0x1.ffff800010000p+18, 0x1.00fff00ffe000p-215, 0x1.fcff20403ff00p-275}, {0x1.fffffff000008p+565, -0x1.ffffff1000000p+488, 0x1.0001fffffff80p-162, 0x1.fffe000000000p-247, 0x1.0001fff7ffe84p+404, 0x1.00701fdbe7000p+339}, {0x1.fffffff000008p+565, -0x1.ffffff1000000p+488, -0x1.0001fffffff80p-162, -0x1.fffe000000000p-247, -0x1.0001fff7ffe84p+404, -0x1.00701fdbe7000p+339}, {-0x1.fffffff000008p+565, 0x1.ffffff1000000p+488, 0x1.0001fffffff80p-162, 0x1.fffe000000000p-247, -0x1.0001fff7ffe84p+404, -0x1.00701fdbe7000p+339}, {-0x1.fffffff000008p+565, 0x1.ffffff1000000p+488, -0x1.0001fffffff80p-162, -0x1.fffe000000000p-247, 0x1.0001fff7ffe84p+404, 0x1.00701fdbe7000p+339}, }; const int numAccuracyTests = sizeof(accuracyTests) / sizeof(struct testVector); #include double testAccuracy() { int i; DD a, b, c, r; double worstUlps = 0.5; for (i=0; i worstUlps) { #ifdef PRINT_ACCURACY_INFORMATION printf("New worst rounding error for (%a,%a) x (%a,%a):\n", a.hi, a.lo, b.hi, b.lo); printf("\tExpected: (%a,%a)\n", r.hi, r.lo); printf("\tComputed: (%a,%a)\n", c.hi, c.lo); printf("\tError: %f ulps\n", ulpError); #endif worstUlps = ulpError; } } } return worstUlps; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ppc/fixtfdi_test.c0000664000175000017500000007577711221175607030403 0ustar mwhudsonmwhudson#include #include #include #include "DD.h" struct testVector { double xhi; double xlo; int64_t result; }; #define INFINITY __builtin_inf() #define HUGE 0x1.fffffffffffffp1023 #define QNAN __builtin_nan("") const struct testVector testCases[] = { // Edge cases // { HUGE, 0.0, INT64_MAX }, // { INFINITY, 0.0, INT64_MAX }, // { -HUGE, 0.0, INT64_MIN }, // { -INFINITY, 0.0, INT64_MIN }, // { QNAN, 0.0, INT64_MIN }, // Exact cases: { 0.0, 0.0, 0LL }, { -0.0, 0.0, 0LL }, { 1.0, 0.0, 1LL }, { -1.0, 0.0, -1LL }, { 2.0, 0.0, 2LL }, { -2.0, 0.0, -2LL }, { 3.0, 0.0, 3LL }, { -3.0, 0.0, -3LL }, { 4.0, 0.0, 4LL }, { -4.0, 0.0, -4LL }, { 5.0, 0.0, 5LL }, { -5.0, 0.0, -5LL }, { 6.0, 0.0, 6LL }, { -6.0, 0.0, -6LL }, { 7.0, 0.0, 7LL }, { -7.0, 0.0, -7LL }, { 8.0, 0.0, 8LL }, { -8.0, 0.0, -8LL }, { 9.0, 0.0, 9LL }, { -9.0, 0.0, -9LL }, // Near integer cases: { 1.0, -0x1.0p-54, 0LL }, { 1.0, -0.0, 1LL }, { 1.0, 0x1.0p-54, 1LL }, { 0x1.0000000000001p0, -0x1.0p-54, 1LL }, { 0x1.0000000000001p0, -0.0, 1LL }, { 0x1.0000000000001p0, 0.0, 1LL }, { 0x1.0000000000001p0, 0x1.0p-54, 1LL }, { -1.0, 0x1.0p-54, 0LL }, { -1.0, 0.0, -1LL }, { -1.0, 0.0, -1LL }, { -1.0, -0x1.0p-54, -1LL }, { -0x1.0000000000001p0, 0x1.0p-54, -1LL }, { -0x1.0000000000001p0, -0.0, -1LL }, { -0x1.0000000000001p0, -0x1.0p-54, -1LL }, // Close to 32-bit overflow boundaries: { 0x1.fffffffcp30, -0x1.0p-24, INT64_C(0x7ffffffe) }, { 0x1.fffffffcp30, 0.0, INT64_C(0x7fffffff) }, { 0x1.fffffffcp30, 0x1.0p-24, INT64_C(0x7fffffff) }, { 0x1.fffffffffffffp30, -0x1.0p-24, INT64_C(0x7fffffff) }, { 0x1.fffffffffffffp30, 0.0, INT64_C(0x7fffffff) }, { 0x1.fffffffffffffp30, 0x1.fffffffffffffp-24, INT64_C(0x7fffffff) }, { 0x1.0p31, -0x1.fffffffffffffp-24, INT64_C(0x7fffffff) }, { 0x1.0p31, 0.0, INT64_C(0x80000000) }, { 0x1.0p31, 0x1.fffffffffffffp-24, INT64_C(0x80000000) }, { 0x1.0000000000001p31, -0x1.fffffffffffffp-24, INT64_C(0x80000000) }, { 0x1.0000000000001p31, 0.0, INT64_C(0x80000000) }, { 0x1.0000000000001p31, 0x1.fffffffffffffp-24, INT64_C(0x80000000) }, { 0x1.00000002p31, -0x1.fffffffffffffp-24, INT64_C(0x80000000) }, { 0x1.00000002p31, 0.0, INT64_C(0x80000001) }, { 0x1.00000002p31, 0x1.fffffffffffffp-24, INT64_C(0x80000001) }, { 0x1.fffffffep31, -0x1.0p-24, INT64_C(0xfffffffe) }, { 0x1.fffffffep31, 0.0, INT64_C(0xffffffff) }, { 0x1.fffffffep31, 0x1.0p-24, INT64_C(0xffffffff) }, { 0x1.fffffffffffffp31, -0x1.0p-24, INT64_C(0xffffffff) }, { 0x1.fffffffffffffp31, 0.0, INT64_C(0xffffffff) }, { 0x1.fffffffffffffp31, 0x1.fffffffffffffp-24, INT64_C(0xffffffff) }, { 0x1.0p32, -0x1.fffffffffffffp-24, INT64_C(0xffffffff) }, { 0x1.0p32, 0.0, INT64_C(0x100000000) }, { 0x1.0p32, 0x1.fffffffffffffp-24, INT64_C(0x100000000) }, { 0x1.0000000000001p32, -0x1.fffffffffffffp-24, INT64_C(0x100000000) }, { 0x1.0000000000001p32, 0.0, INT64_C(0x100000000) }, { 0x1.0000000000001p32, 0x1.fffffffffffffp-24, INT64_C(0x100000000) }, { 0x1.00000001p32, -0x1.fffffffffffffp-24, INT64_C(0x100000000) }, { 0x1.00000001p32, 0.0, INT64_C(0x100000001) }, { 0x1.00000001p32, 0x1.fffffffffffffp-24, INT64_C(0x100000001) }, { -0x1.fffffffcp30, 0x1.0p-24, INT64_C(0xffffffff80000002) }, { -0x1.fffffffcp30, 0.0, INT64_C(0xffffffff80000001) }, { -0x1.fffffffcp30, -0x1.0p-24, INT64_C(0xffffffff80000001) }, { -0x1.fffffffffffffp30, 0x1.0p-24, INT64_C(0xffffffff80000001) }, { -0x1.fffffffffffffp30, 0.0, INT64_C(0xffffffff80000001) }, { -0x1.fffffffffffffp30, -0x1.fffffffffffffp-24, INT64_C(0xffffffff80000001) }, { -0x1.0p31, 0x1.fffffffffffffp-24, INT64_C(0xffffffff80000001) }, { -0x1.0p31, 0.0, INT64_C(0xffffffff80000000) }, { -0x1.0p31, -0x1.fffffffffffffp-24, INT64_C(0xffffffff80000000) }, { -0x1.0000000000001p31, 0x1.fffffffffffffp-24, INT64_C(0xffffffff80000000) }, { -0x1.0000000000001p31, 0.0, INT64_C(0xffffffff80000000) }, { -0x1.0000000000001p31, -0x1.fffffffffffffp-24, INT64_C(0xffffffff80000000) }, { -0x1.00000002p31, 0x1.fffffffffffffp-24, INT64_C(0xffffffff80000000) }, { -0x1.00000002p31, 0.0, INT64_C(0xffffffff7fffffff) }, { -0x1.00000002p31, -0x1.fffffffffffffp-24, INT64_C(0xffffffff7fffffff) }, { -0x1.fffffffep31, 0x1.0p-24, INT64_C(0xffffffff00000002) }, { -0x1.fffffffep31, 0.0, INT64_C(0xffffffff00000001) }, { -0x1.fffffffep31, -0x1.0p-24, INT64_C(0xffffffff00000001) }, { -0x1.fffffffffffffp31, 0x1.0p-24, INT64_C(0xffffffff00000001) }, { -0x1.fffffffffffffp31, 0.0, INT64_C(0xffffffff00000001) }, { -0x1.fffffffffffffp31, -0x1.fffffffffffffp-24, INT64_C(0xffffffff00000001) }, { -0x1.0p32, 0x1.fffffffffffffp-24, INT64_C(0xffffffff00000001) }, { -0x1.0p32, 0.0, INT64_C(0xffffffff00000000) }, { -0x1.0p32, -0x1.fffffffffffffp-24, INT64_C(0xffffffff00000000) }, { -0x1.0000000000001p32, 0x1.fffffffffffffp-24, INT64_C(0xffffffff00000000) }, { -0x1.0000000000001p32, 0.0, INT64_C(0xffffffff00000000) }, { -0x1.0000000000001p32, -0x1.fffffffffffffp-24, INT64_C(0xffffffff00000000) }, { -0x1.00000001p32, 0x1.fffffffffffffp-24, INT64_C(0xffffffff00000000) }, { -0x1.00000001p32, 0.0, INT64_C(0xfffffffeffffffff) }, { -0x1.00000001p32, -0x1.fffffffffffffp-24, INT64_C(0xfffffffeffffffff) }, // Randomly generated in-range values: {0x1.00ffc00ffff00p+11, 0x1.fe0007fffff00p-45, INT64_C(0x0000000000000807)}, {-0x1.00001fffff800p+38, -0x1.fffffffe00000p-36, INT64_C(0xffffffbffff80001)}, {0x1.000003fffc002p+48, -0x1.0000000000000p-57, INT64_C(0x0001000003fffc00)}, {-0x1.000003ffffffep+3, 0x1.ffe0080000000p-81, INT64_C(0xfffffffffffffff8)}, {0x1.0800000000000p+21, -0x1.0000000000000p-75, INT64_C(0x000000000020ffff)}, {-0x1.007fffffe0000p+61, 0x0.0000000000000p+0, INT64_C(0xdff0000004000000)}, {0x1.3fe0000100000p+33, -0x1.0000000000000p-40, INT64_C(0x000000027fc00001)}, {-0x1.0001fff800000p+1, -0x1.ffffff0000ffep-53, INT64_C(0xfffffffffffffffe)}, {0x1.0000800000000p+54, -0x1.ffffffe400000p-9, INT64_C(0x0040001fffffffff)}, {-0x1.007fffffffc00p+15, -0x1.fffffc0000000p-56, INT64_C(0xffffffffffff7fc1)}, {0x1.0080000000000p+13, -0x1.0000000000000p-60, INT64_C(0x000000000000200f)}, {-0x1.00f3ffffff000p+56, -0x1.fff8000000000p-12, INT64_C(0xfeff0c0000010000)}, {0x1.3dfffffffc000p+47, 0x1.ff000003ffe00p-14, INT64_C(0x00009efffffffe00)}, {-0x1.0000001ffff80p+12, -0x1.fffffdfffff8ep-42, INT64_C(0xfffffffffffff000)}, {0x1.0000000000000p+4, -0x1.0000000000000p-66, INT64_C(0x000000000000000f)}, {-0x1.001fffffffe00p+39, 0x0.0000000000000p+0, INT64_C(0xffffff7ff0000001)}, {0x1.00000007ff800p+5, 0x1.ffff800000000p-83, INT64_C(0x0000000000000020)}, {-0x1.000ffffff8000p+57, -0x1.ffffffffffc00p+2, INT64_C(0xfdffe000000ffff9)}, {0x1.007fbfffffcf0p+43, 0x1.ffff803ffe000p-12, INT64_C(0x00000803fdfffffe)}, {-0x1.01ffffffc0004p+24, 0x1.fffc100000000p-37, INT64_C(0xfffffffffefe0001)}, {0x1.0000001000000p+19, -0x1.ffffff0000800p-45, INT64_C(0x0000000000080000)}, {-0x1.00000003ff800p+25, -0x1.ffffe00000000p-61, INT64_C(0xfffffffffe000000)}, {0x1.0000001000000p+23, -0x1.fffffff804000p-44, INT64_C(0x0000000000800000)}, {-0x1.0008000000000p+20, 0x1.0000000000000p-48, INT64_C(0xffffffffffefff81)}, {0x1.0000183ffffc0p+60, 0x1.fff07fcfffffcp+6, INT64_C(0x10000183ffffc07f)}, {-0x1.0001000000000p+42, 0x1.fffffff800400p-21, INT64_C(0xfffffbfffc000001)}, {0x1.0000800000000p+11, -0x1.fffff80100000p-62, INT64_C(0x0000000000000800)}, {-0x1.1fffffff00000p+28, -0x1.fffffff000000p-49, INT64_C(0xffffffffee000001)}, {0x1.fffffc0000100p+59, -0x1.fffe000040000p-12, INT64_C(0x0fffffe000007fff)}, {-0x1.0000800000000p+39, 0x1.c000fffffffd0p-18, INT64_C(0xffffff7fffc00001)}, {0x1.3ff8007ffffc0p+61, 0x1.e0007ff000000p-5, INT64_C(0x27ff000fffff8000)}, {-0x1.ffffffe000000p+13, 0x1.ff80000020000p-43, INT64_C(0xffffffffffffc001)}, {0x1.7fffe00800000p+35, -0x1.0000000000000p-70, INT64_C(0x0000000bffff003f)}, {-0x1.0000400000000p+62, 0x1.0000000000000p-29, INT64_C(0xbffff00000000001)}, {0x1.4000000000000p+31, -0x1.ffffffff00020p-27, INT64_C(0x000000009fffffff)}, {-0x1.0000010000000p+29, 0x1.8000000000020p-29, INT64_C(0xffffffffdfffffe1)}, {0x1.7fffffffc0000p+45, 0x1.fffc000000000p-25, INT64_C(0x00002ffffffff800)}, {-0x1.0000001fe0000p+46, -0x1.fffffc0001f00p-15, INT64_C(0xffffbffffff80800)}, {0x1.0000004000000p+54, -0x1.0000000000000p-4, INT64_C(0x004000000fffffff)}, {-0x1.8000000000000p+48, 0x1.ffe7ffc001000p-17, INT64_C(0xfffe800000000001)}, {0x1.007fc00007800p+34, 0x1.e0000f80001e0p-24, INT64_C(0x0000000401ff0000)}, {-0x1.3fffff0000000p+8, -0x1.fffffe0000000p-55, INT64_C(0xfffffffffffffec1)}, {0x1.0000200000000p+14, -0x1.0000000000000p-91, INT64_C(0x0000000000004000)}, {-0x1.00000fffffff8p+1, -0x1.fffffffc00000p-58, INT64_C(0xfffffffffffffffe)}, {0x1.001fffc000400p+34, -0x1.e000000001000p-31, INT64_C(0x00000004007fff00)}, {-0x1.0200000000000p+41, 0x1.0000000000000p-62, INT64_C(0xfffffdfc00000001)}, {0x1.03ffffffe0000p+55, 0x1.ff80000000000p-34, INT64_C(0x0081fffffff00000)}, {-0x1.0010000000000p+45, 0x1.0000000000000p-32, INT64_C(0xffffdffe00000001)}, {0x1.0000008000000p+31, -0x1.fff0000000100p-28, INT64_C(0x000000008000003f)}, {-0x1.0000c00400000p+26, 0x1.ff80800000000p-55, INT64_C(0xfffffffffbfffd00)}, {0x1.0000007fff000p+48, 0x1.ffffff8000000p-27, INT64_C(0x00010000007fff00)}, {-0x1.3ffffff800200p+60, 0x1.0000000000000p-17, INT64_C(0xec0000007ffe0001)}, {0x1.0000200000000p+8, -0x1.ffffffffffc40p-51, INT64_C(0x0000000000000100)}, {-0x1.007ffffffff80p+54, -0x1.fffffffe00000p-20, INT64_C(0xffbfe00000000200)}, {0x1.00003ffffff00p+25, 0x1.ffc003ffffe00p-30, INT64_C(0x000000000200007f)}, {-0x1.0200000000000p+26, 0x1.c000000000008p-30, INT64_C(0xfffffffffbf80001)}, {0x1.1fffffc000000p+8, 0x1.ffffffffffff0p-49, INT64_C(0x000000000000011f)}, {-0x1.007fc00000800p+2, 0x1.fffff03fff000p-58, INT64_C(0xfffffffffffffffc)}, {0x1.00007fffff000p+31, 0x1.ffffffff00000p-41, INT64_C(0x0000000080003fff)}, {-0x1.0000003ffff80p+54, -0x1.fffffefff8000p-14, INT64_C(0xffbffffff0000200)}, {0x1.00007ffc00000p+46, 0x1.ffffe00000000p-23, INT64_C(0x000040001fff0000)}, {-0x1.3fffffc004000p+8, 0x1.ffffe00010000p-56, INT64_C(0xfffffffffffffec1)}, {0x1.01fffffffe000p+49, 0x1.fffc000000000p-39, INT64_C(0x000203fffffffc00)}, {-0x1.07ffffff80000p+54, -0x1.8007ffffc0000p-17, INT64_C(0xffbe000000200000)}, {0x1.00003ff810000p+56, -0x1.fffffffc00800p-8, INT64_C(0x0100003ff80fffff)}, {-0x1.01ffffff00004p+25, 0x1.0000000000000p-65, INT64_C(0xfffffffffdfc0001)}, {0x1.000000ffffff8p+11, 0x1.ffe0000000000p-61, INT64_C(0x0000000000000800)}, {-0x1.001f03f07ff00p+10, -0x1.ffffff8000000p-63, INT64_C(0xfffffffffffffc00)}, {0x1.00003fffffffcp+9, 0x1.ffe0000700000p-64, INT64_C(0x0000000000000200)}, {-0x1.0000100000000p+27, 0x1.0000000000000p-55, INT64_C(0xfffffffff7ffff81)}, {0x1.0000020000000p+62, -0x1.0000000000000p-30, INT64_C(0x4000007fffffffff)}, {-0x1.00001fffcffc0p+52, 0x1.fffe000000004p-3, INT64_C(0xffeffffe00030041)}, {0x1.03fffff800000p+47, 0x1.fffffe0000000p-21, INT64_C(0x000081fffffc0000)}, {-0x1.000fff8000000p+0, -0x1.fffffe0000000p-62, INT64_C(0xffffffffffffffff)}, {0x1.0003fc0000000p+57, 0x1.ffff80ffffc00p+0, INT64_C(0x020007f800000001)}, {-0x1.0300000001f00p+61, -0x1.fffffff800000p-15, INT64_C(0xdf9fffffffc20000)}, {0x1.fffff1ff80000p+43, 0x1.ffffc000fe000p-12, INT64_C(0x00000fffff8ffc00)}, {-0x1.000001d000000p+33, 0x1.ff80000200000p-22, INT64_C(0xfffffffdfffffc61)}, {0x1.000007fffffc0p+24, 0x1.fc0003fc00000p-36, INT64_C(0x0000000001000007)}, {-0x1.0000004000000p+23, 0x1.fff0000004000p-44, INT64_C(0xffffffffff800000)}, {0x1.0fc007c004000p+9, -0x1.fffe100000000p-55, INT64_C(0x000000000000021f)}, {-0x1.00007fffffe00p+13, -0x1.ffffffc003f00p-48, INT64_C(0xffffffffffffe000)}, {0x1.0080000000000p+24, -0x1.0000000000000p-34, INT64_C(0x0000000001007fff)}, {-0x1.00000ffffff80p+60, -0x1.ffffff0007ff8p+4, INT64_C(0xefffff0000007fe1)}, {0x1.01e0000000002p+44, -0x1.fffffffffc200p-15, INT64_C(0x0000101e00000000)}, {-0x1.0000080000000p+35, 0x1.0000000000000p-70, INT64_C(0xfffffff7ffffc001)}, {0x1.000000f1fe001p+23, -0x1.0000000000000p-60, INT64_C(0x0000000000800000)}, {-0x1.00003fffffff0p+40, -0x1.fc00000000000p-37, INT64_C(0xfffffeffffc00001)}, {0x1.00001ffff0000p+16, 0x1.ffff80001f000p-41, INT64_C(0x0000000000010000)}, {-0x1.0000100000000p+12, 0x1.0000000000000p-93, INT64_C(0xfffffffffffff000)}, {0x1.0038000800000p+41, -0x1.fffffe0000080p-19, INT64_C(0x0000020070000fff)}, {-0x1.00003fe008000p+14, 0x1.fffdff0000080p-45, INT64_C(0xffffffffffffc000)}, {0x1.0000100000000p+42, -0x1.0000000000000p-52, INT64_C(0x00000400003fffff)}, {-0x1.00003ff002010p+17, 0x1.0000020000000p-48, INT64_C(0xfffffffffffe0000)}, {0x1.00ffffffc0000p+8, 0x1.fffffe00003f0p-47, INT64_C(0x0000000000000100)}, {-0x1.1fffffffff020p+39, 0x1.ffff000400000p-36, INT64_C(0xffffff7000000001)}, {0x1.0200000000000p+33, -0x1.0000000000000p-20, INT64_C(0x0000000203ffffff)}, {-0x1.0000700000000p+0, -0x1.ffffffe000000p-71, INT64_C(0xffffffffffffffff)}, {0x1.00000ffffffd0p+33, -0x1.ffffff8200000p-33, INT64_C(0x0000000200001fff)}, {-0x1.00000c0000004p+59, 0x1.ff80000800000p-9, INT64_C(0xf7ffff9ffffffe01)}, {0x1.1ffff80000040p+5, -0x1.0000000000000p-85, INT64_C(0x0000000000000023)}, {-0x1.0ffffff9ffff0p+58, -0x1.f800008200000p-12, INT64_C(0xfbc0000018000400)}, {0x1.000000ffffff8p+13, 0x1.ff0000007ffc0p-46, INT64_C(0x0000000000002000)}, {-0x1.0000008000000p+6, 0x1.fffffc0000008p-50, INT64_C(0xffffffffffffffc0)}, {0x1.0000200000000p+25, -0x1.fffffff804000p-42, INT64_C(0x000000000200003f)}, {-0x1.0000080000000p+61, 0x1.0000000000000p-34, INT64_C(0xdfffff0000000001)}, {0x1.03ffff0000010p+42, -0x1.fffc010000000p-34, INT64_C(0x0000040ffffc0000)}, {-0x1.7ffffffc00000p+38, -0x1.fff80000fc000p-23, INT64_C(0xffffffa000000100)}, {0x1.0010000000000p+23, -0x1.ffffffffc4000p-44, INT64_C(0x00000000008007ff)}, {-0x1.000007fffc004p+7, 0x1.8000004000000p-52, INT64_C(0xffffffffffffff80)}, {0x1.7fe000001ff00p+11, 0x1.f000000000000p-90, INT64_C(0x0000000000000bff)}, {-0x1.0ffffff000000p+0, -0x1.fffffff000000p-70, INT64_C(0xffffffffffffffff)}, {0x1.0000010000000p+45, -0x1.ffffffffe4000p-17, INT64_C(0x00002000001fffff)}, {-0x1.0000020000000p+50, 0x1.ff80000100000p-23, INT64_C(0xfffbfffff8000001)}, {0x1.1ffffffff8000p+8, 0x1.fe001ffffffe0p-48, INT64_C(0x000000000000011f)}, {-0x1.0000000fffe00p+44, -0x1.3fffff87fc000p-16, INT64_C(0xffffefffffff0002)}, {0x1.0000000800000p+3, -0x1.0000000000000p-102, INT64_C(0x0000000000000008)}, {-0x1.00fffffff8000p+3, -0x1.fffe000000000p-71, INT64_C(0xfffffffffffffff8)}, {0x1.0007ffffffff0p+60, 0x1.fffffc0000000p-23, INT64_C(0x10007ffffffff000)}, {-0x1.0003800000080p+32, 0x1.0000000000000p-73, INT64_C(0xfffffffefffc8000)}, {0x1.000001fffff80p+14, 0x1.ff00000000000p-70, INT64_C(0x0000000000004000)}, {-0x1.000007ffffe00p+52, 0x1.fe0c000004000p-6, INT64_C(0xffefffff80000201)}, {0x1.00000003f0000p+56, 0x1.ffffffe000000p-22, INT64_C(0x0100000003f00000)}, {-0x1.0100000000000p+5, 0x1.fffffff000080p-55, INT64_C(0xffffffffffffffe0)}, {0x1.007fffffffc00p+16, 0x1.fffffe0000000p-66, INT64_C(0x000000000001007f)}, {-0x1.007ffffffc000p+11, -0x1.ffffff8000000p-56, INT64_C(0xfffffffffffff7fd)}, {0x1.0003fffffffe0p+61, 0x1.fffffff000780p+1, INT64_C(0x20007fffffffc003)}, {-0x1.1ffff00800000p+3, 0x1.0000000000000p-94, INT64_C(0xfffffffffffffff8)}, {0x1.000003fff8000p+9, 0x1.ffff00000003cp-46, INT64_C(0x0000000000000200)}, {-0x1.000001ffff020p+48, 0x1.fff0000200000p-22, INT64_C(0xfffefffffe0000ff)}, {0x1.00ffe00000000p+43, 0x1.fe00000000000p-17, INT64_C(0x00000807ff000000)}, {-0x1.0000100000000p+29, 0x1.ffff800010000p-40, INT64_C(0xffffffffdffffe01)}, {0x1.0100000000000p+52, -0x1.0000000000000p-35, INT64_C(0x00100fffffffffff)}, {-0x1.000003fff8001p+19, 0x1.0000000000000p-64, INT64_C(0xfffffffffff80000)}, {0x1.00f8000200000p+40, -0x1.ff80000100000p-33, INT64_C(0x00000100f80001ff)}, {-0x1.003ffffffe000p+23, -0x1.f007fffffc000p-36, INT64_C(0xffffffffff7fe001)}, {0x1.0000080000000p+55, -0x1.0000000000000p-50, INT64_C(0x00800003ffffffff)}, {-0x1.0200000000000p+52, 0x1.0000000000000p-18, INT64_C(0xffefe00000000001)}, {0x1.03fffffc00000p+6, 0x1.fe0000c000000p-54, INT64_C(0x0000000000000040)}, {-0x1.7ff0000040000p+38, 0x1.0000000000000p-37, INT64_C(0xffffffa003fffff1)}, {0x1.0000018000010p+16, -0x1.fffffe0200000p-58, INT64_C(0x0000000000010000)}, {-0x1.001ffffffff00p+30, -0x1.ffffffe000000p-25, INT64_C(0xffffffffbff80001)}, {0x1.07fc000007ffep+52, 0x1.8000000010000p-17, INT64_C(0x00107fc000007ffe)}, {-0x1.0007fffffff00p+11, -0x1.fffe000000000p-79, INT64_C(0xfffffffffffff800)}, {0x1.0000003fffffcp+31, 0x1.fffff8007fff0p-26, INT64_C(0x000000008000001f)}, {-0x1.0000003f000f8p+4, -0x1.fffc03fffe000p-54, INT64_C(0xfffffffffffffff0)}, {0x1.00000007ffe00p+2, 0x1.ffffe000007f8p-54, INT64_C(0x0000000000000004)}, {-0x1.00001fffc0000p+12, -0x1.fffffffffe1f0p-45, INT64_C(0xfffffffffffff000)}, {0x1.00001fffff801p+23, -0x1.80003f0000040p-36, INT64_C(0x000000000080000f)}, {-0x1.00001ffffe000p+23, -0x1.f00001f000000p-41, INT64_C(0xffffffffff7ffff1)}, {0x1.0000007007f80p+38, 0x1.c00ffffffe000p-27, INT64_C(0x0000004000001c01)}, {-0x1.0000010000000p+26, 0x1.0000000000000p-79, INT64_C(0xfffffffffbfffffd)}, {0x1.0000002000000p+7, -0x1.0000000000000p-98, INT64_C(0x0000000000000080)}, {-0x1.00001ffe00010p+13, 0x1.0000000000000p-69, INT64_C(0xffffffffffffe000)}, {0x1.0fe0000008000p+30, -0x1.c00007fffc100p-31, INT64_C(0x0000000043f80000)}, {-0x1.0000001fc0000p+0, -0x1.ffc003ffff000p-65, INT64_C(0xffffffffffffffff)}, {0x1.00007e3fffff0p+44, 0x1.ffff000000000p-28, INT64_C(0x0000100007e3ffff)}, {-0x1.ffffff0002000p+56, 0x1.ffffc00000040p+2, INT64_C(0xfe000000fffe0008)}, {0x1.0000ffffffc00p+21, 0x1.ffffffffffe00p-41, INT64_C(0x000000000020001f)}, {-0x1.07ffff0000000p+35, -0x1.ffff0003ffffep-19, INT64_C(0xfffffff7c0000800)}, {0x1.0000040000000p+18, -0x1.0000000000000p-74, INT64_C(0x0000000000040000)}, {-0x1.0003ffffffe00p+55, -0x1.ffff800000000p-13, INT64_C(0xff7ffe0000001000)}, {0x1.001fc00000300p+30, -0x1.ffff000040000p-41, INT64_C(0x000000004007f000)}, {-0x1.07fffffc01000p+11, 0x1.ffffffe002000p-46, INT64_C(0xfffffffffffff7c1)}, {0x1.03ffff81f8001p+55, -0x1.f800800000000p-22, INT64_C(0x0081ffffc0fc0007)}, {-0x1.0040000000000p+4, 0x1.fffffffffffe0p-54, INT64_C(0xfffffffffffffff0)}, {0x1.0008000000000p+47, -0x1.ffffffff01000p-18, INT64_C(0x00008003ffffffff)}, {-0x1.0000010000000p+23, 0x1.0000000000000p-82, INT64_C(0xffffffffff800000)}, {0x1.0000007fffff4p+62, -0x1.f800003ffffe0p+4, INT64_C(0x4000001fffffcfe0)}, {-0x1.0000001ff8000p+12, -0x1.8003fffff0c00p-51, INT64_C(0xfffffffffffff000)}, {0x1.00000007ffff8p+62, 0x1.ffffffffff000p+7, INT64_C(0x40000001ffffe0ff)}, {-0x1.03ffffffffff8p+5, -0x1.fffffffc00000p-70, INT64_C(0xffffffffffffffe0)}, {0x1.0003f00000040p+58, -0x1.fffffe0800000p-18, INT64_C(0x04000fc000000fff)}, {-0x1.07fffffc00100p+55, 0x1.0000000000000p-27, INT64_C(0xff7c000001fff801)}, {0x1.fffffe0000000p+57, 0x1.ffffffff00000p-16, INT64_C(0x03fffffc00000000)}, {-0x1.0000000ffffe0p+53, -0x1.fffffff000000p-16, INT64_C(0xffdffffffe000040)}, {0x1.0001fffff8000p-1, 0x1.fffffff800000p-69, INT64_C(0x0000000000000000)}, {-0x1.001fffffff000p+45, -0x1.fffffc0000000p-13, INT64_C(0xffffdffc00000020)}, {0x1.000f00007fff8p+2, 0x1.ffffff8000000p-60, INT64_C(0x0000000000000004)}, {-0x1.0080000000000p+46, 0x1.0000000000000p-37, INT64_C(0xffffbfe000000001)}, {0x1.7fffffffffffep+34, 0x0.0000000000000p+0, INT64_C(0x00000005ffffffff)}, {-0x1.00000007ffffep+2, -0x1.ff003f8000380p-53, INT64_C(0xfffffffffffffffc)}, {0x1.0067ffffe0000p+19, 0x1.fffffff800000p-52, INT64_C(0x000000000008033f)}, {-0x1.1ff1000000000p+12, 0x1.fff0000100000p-61, INT64_C(0xffffffffffffee01)}, {0x1.0000100000000p+46, -0x1.0000000000000p-33, INT64_C(0x0000400003ffffff)}, {-0x1.0000ffe000080p+14, 0x1.fffffe0002000p-50, INT64_C(0xffffffffffffc000)}, {0x1.0000100000000p+22, -0x1.ffffff0020000p-36, INT64_C(0x0000000000400003)}, {-0x1.001fffff01f00p+22, -0x1.fffffff800000p-44, INT64_C(0xffffffffffbff801)}, {0x1.0000ffc000000p+35, 0x1.ff003fffffe00p-27, INT64_C(0x000000080007fe00)}, {-0x1.07c0000001ff8p+54, -0x1.fffff00000000p-26, INT64_C(0xffbe0fffffff8020)}, {0x1.0000400000000p+12, -0x1.8000000400000p-60, INT64_C(0x0000000000001000)}, {-0x1.0000000300000p+30, 0x0.0000000000000p+0, INT64_C(0xffffffffc0000000)}, {0x1.00ff000008000p+29, -0x1.fffff02000000p-38, INT64_C(0x00000000201fe000)}, {-0x1.000fffff80000p+29, -0x1.3ffffffc00000p-46, INT64_C(0xffffffffdffe0001)}, {0x1.007f8000007fcp+9, 0x1.fffffe0000000p-58, INT64_C(0x0000000000000200)}, {-0x1.1ffffffffc004p+23, 0x1.0000000000000p-75, INT64_C(0xffffffffff700001)}, {0x1.0000001f00010p+29, -0x1.0000000000000p-45, INT64_C(0x0000000020000003)}, {-0x1.0007fffffe000p+5, -0x1.fffff80000300p-56, INT64_C(0xffffffffffffffe0)}, {0x1.00003f0000800p+41, -0x1.ffffff8000080p-13, INT64_C(0x00000200007e0000)}, {-0x1.000001ffffff0p+0, -0x1.fffc000000000p-80, INT64_C(0xffffffffffffffff)}, {0x1.00007ffc00080p+24, -0x1.ffffffc000100p-30, INT64_C(0x000000000100007f)}, {-0x1.0ffe000100000p+38, 0x1.fff8200000000p-48, INT64_C(0xffffffbc007fffc1)}, {0x1.fffffff000008p+5, -0x1.8001000000000p-67, INT64_C(0x000000000000003f)}, {-0x1.0000000800000p+32, 0x1.ffffc00200000p-24, INT64_C(0xfffffffefffffff9)}, {0x1.7fffc00000000p+58, 0x1.ffffe00000000p-28, INT64_C(0x05ffff0000000000)}, {-0x1.00fffffffff80p+40, 0x0.0000000000000p+0, INT64_C(0xfffffeff00000001)}, {0x1.0010000000000p+28, -0x1.0000000000000p-61, INT64_C(0x000000001000ffff)}, {-0x1.00ffffe07fc00p+30, -0x1.fffffc3000000p-24, INT64_C(0xffffffffbfc00008)}, {0x1.000ffe0fffffep+38, 0x1.ffffc00000000p-49, INT64_C(0x0000004003ff83ff)}, {-0x1.0000003ff0000p+24, -0x1.fffffff080000p-42, INT64_C(0xffffffffff000000)}, {0x1.0000e00003ff8p+34, 0x1.ffffff8ffc000p-33, INT64_C(0x0000000400038000)}, {-0x1.0080000000000p+47, 0x1.0000000000000p-58, INT64_C(0xffff7fc000000001)}, {0x1.0008000000000p+19, 0x0.0000000000000p+0, INT64_C(0x0000000000080040)}, {-0x1.0001fe0000002p+49, 0x1.fff0000080008p-7, INT64_C(0xfffdfffc04000000)}, {0x1.03c03c0000020p+39, -0x1.0000000000000p-40, INT64_C(0x00000081e01e0000)}, {-0x1.0001fff9c0008p+0, 0x1.ffffff0002000p-56, INT64_C(0xffffffffffffffff)}, {0x1.ffffffff80000p+49, 0x1.fffffffffe000p-17, INT64_C(0x0003ffffffff0000)}, {-0x1.0000fffc00000p+3, -0x1.1ffffe0000000p-60, INT64_C(0xfffffffffffffff8)}, {0x1.0000020000000p+56, -0x1.0000000000000p-40, INT64_C(0x01000001ffffffff)}, {-0x1.007fffffffffcp+41, -0x1.fffefffffff80p-19, INT64_C(0xfffffdff00000001)}, {0x1.007ffffffffc0p+15, 0x1.ffffff8000000p-52, INT64_C(0x000000000000803f)}, {-0x1.ffffff0000000p+60, -0x1.fffffffff0000p-2, INT64_C(0xe000001000000000)}, {0x1.00000003f81ffp+0, 0x1.ffc0000000000p-82, INT64_C(0x0000000000000001)}, {-0x1.0000001ff8039p+45, 0x1.ffff800080000p-27, INT64_C(0xffffdffffffc0100)}, {0x1.0008000000000p+32, -0x1.f000000000080p-28, INT64_C(0x000000010007ffff)}, {-0x1.00c1fffc00000p+21, -0x1.ffff800000000p-67, INT64_C(0xffffffffffdfe7c1)}, {0x1.1fe0000080000p+15, -0x1.fffffe0000008p-39, INT64_C(0x0000000000008ff0)}, {-0x1.01ffffff00000p+55, -0x1.ffffffe000000p-22, INT64_C(0xff7f000000800000)}, {0x1.0000003ffffe0p+45, 0x0.0000000000000p+0, INT64_C(0x000020000007ffff)}, {-0x1.003ffffe00000p+21, 0x0.0000000000000p+0, INT64_C(0xffffffffffdff801)}, {0x1.00007fc000000p+54, 0x1.fffffff000000p-3, INT64_C(0x0040001ff0000000)}, {-0x1.0000000000000p+58, 0x1.0000000000000p-14, INT64_C(0xfc00000000000001)}, {0x1.0400000000000p+23, -0x1.0000000000000p-39, INT64_C(0x000000000081ffff)}, {-0x1.000003fffff00p+32, -0x1.ffc00003c0000p-39, INT64_C(0xfffffffefffffc01)}, {0x1.7ffffffffffe0p+9, 0x0.0000000000000p+0, INT64_C(0x00000000000002ff)}, {-0x1.0000fffff0400p+59, 0x1.f000000fe0020p+1, INT64_C(0xf7fff800007e0004)}, {0x1.0000000400000p+45, -0x1.fffe000010200p-17, INT64_C(0x0000200000007fff)}, {-0x1.0ffe000008000p+41, 0x1.ffffffff80100p-20, INT64_C(0xfffffde003fffff1)}, {0x1.4000000000000p+34, -0x1.0000000000000p-71, INT64_C(0x00000004ffffffff)}, {-0x1.0000010000000p+54, 0x1.0000000000000p-16, INT64_C(0xffbfffffc0000001)}, {0x1.fffffffc00000p+21, 0x1.fffff801ffffep-33, INT64_C(0x00000000003fffff)}, {-0x1.00001ff7fc000p+60, -0x1.8000000001f80p+0, INT64_C(0xeffffe00803fffff)}, {0x1.3e00001000000p+52, -0x1.e07ff80001000p-6, INT64_C(0x0013e00000ffffff)}, {-0x1.0000000400000p+38, 0x1.0000000000000p-67, INT64_C(0xffffffbfffffff01)}, {0x1.0000010000000p+62, -0x1.0000000000000p-12, INT64_C(0x4000003fffffffff)}, {-0x1.000000ffc0008p+59, 0x1.0000000000000p-23, INT64_C(0xf7fffff801fffc01)}, {0x1.0000002000000p+55, -0x1.ffffffffff004p+0, INT64_C(0x008000000ffffffe)}, {-0x1.000001fffc000p+62, -0x1.fffffffffe000p+1, INT64_C(0xbfffff8000fffffd)}, {0x1.001ffff800002p+36, -0x1.c3fe800000000p-33, INT64_C(0x0000001001ffff80)}, {-0x1.00000ffffffe0p+26, -0x1.fff8000000000p-61, INT64_C(0xfffffffffbffffc1)}, {0x1.00007fe080000p+59, -0x1.ff00040000000p-1, INT64_C(0x080003ff03ffffff)}, {-0x1.0000001000000p+39, 0x1.0000000000000p-60, INT64_C(0xffffff7ffffff801)}, {0x1.0000003f80002p+48, -0x1.0000000000000p-52, INT64_C(0x00010000003f8000)}, {-0x1.0800000000000p+28, 0x1.0000000000000p-26, INT64_C(0xffffffffef800001)}, {0x1.0000004000000p+4, -0x1.fc000000fff08p-52, INT64_C(0x0000000000000010)}, {-0x1.0000ff8000000p+55, -0x1.f803ff0000000p-26, INT64_C(0xff7fff8040000000)}, // Out-of-range values: {0x1.3fffffff80000p+666, 0x1.ffffffff00000p+593, INT64_C(0x7fffffffffffffff)}, {-0x1.007fffffe0000p+756, 0x0.0000000000000p+0, INT64_C(0x8000000000000000)}, {0x1.00001ffff8000p+939, 0x1.00007f001e000p+884, INT64_C(0x7fffffffffffffff)}, {-0x1.3dfffffffc000p+294, -0x1.ff000003ffe00p+233, INT64_C(0x8000000000000000)}, {0x1.0000000000000p+1023, -0x1.0000000000000p+953, INT64_C(0x7fffffffffffffff)}, {-0x1.001fffffffe00p+730, 0x0.0000000000000p+0, INT64_C(0x8000000000000000)}, {0x1.0000002000000p+702, -0x1.0000000000000p+602, INT64_C(0x7fffffffffffffff)}, {-0x1.01ffffffe0000p+902, -0x1.c000000200000p+841, INT64_C(0x8000000000000000)}, {0x1.00003fe0c4000p+973, -0x1.fffc032000000p+910, INT64_C(0x7fffffffffffffff)}, {-0x1.000ffffff8000p+593, -0x1.ffffffffffc00p+538, INT64_C(0x8000000000000000)}, {0x1.0007ffff00000p+383, 0x1.fffff80000000p+313, INT64_C(0x7fffffffffffffff)}, {-0x1.01ffffffc0004p+997, 0x1.fffc100000000p+936, INT64_C(0x8000000000000000)}, {0x1.0000001000000p+62, -0x1.ffffff0000800p-2, INT64_C(0x40000003ffffffff)}, {-0x1.00000003ff800p+64, -0x1.ffffe00000000p-22, INT64_C(0x8000000000000000)}, {0x1.003ffffff8000p+696, 0x1.f00000007fc00p+638, INT64_C(0x7fffffffffffffff)}, {-0x1.1ffff80000000p+591, -0x1.ffffff7ff8000p+532, INT64_C(0x8000000000000000)}, {0x1.00ff000000004p+69, -0x1.ffffff0000400p+6, INT64_C(0x7fffffffffffffff)}, {-0x1.0008000000000p+75, 0x1.0000000000000p+7, INT64_C(0x8000000000000000)}, {0x1.0000183ffffc0p+670, 0x1.fff07fcfffffcp+616, INT64_C(0x7fffffffffffffff)}, {-0x1.0000010000000p+363, 0x1.0000000000000p+288, INT64_C(0x8000000000000000)}, {0x1.1fffffff00000p+890, 0x1.fffffff000000p+813, INT64_C(0x7fffffffffffffff)}, {-0x1.0000ffffff000p+38, -0x1.ffe000003ffe0p-20, INT64_C(0xffffffbfffc00001)}, {0x1.000003fffff80p+967, 0x1.f007ffe00fc00p+904, INT64_C(0x7fffffffffffffff)}, {-0x1.0000ffffff81fp+121, -0x1.ffc7fff800000p+57, INT64_C(0x8000000000000000)}, {0x1.0000400000000p+600, -0x1.0000000000000p+509, INT64_C(0x7fffffffffffffff)}, {-0x1.0000004000000p+707, 0x1.0000000000000p+649, INT64_C(0x8000000000000000)}, {0x1.8000000000000p+850, -0x1.ffe7ffc001000p+785, INT64_C(0x7fffffffffffffff)}, {-0x1.0000000800000p+842, 0x1.fffffff400000p+767, INT64_C(0x8000000000000000)}, {0x1.007fc00007800p+448, 0x1.e0000f80001e0p+390, INT64_C(0x7fffffffffffffff)}, {-0x1.3fffff0000000p+131, -0x1.fffffe0000000p+68, INT64_C(0x8000000000000000)}, {0x1.0000200000000p+733, -0x1.0000000000000p+628, INT64_C(0x7fffffffffffffff)}, {-0x1.7fe0000000008p+383, 0x1.fffff3ff80200p+321, INT64_C(0x8000000000000000)}, // Values smaller than one: {0x1.00001ffffff00p-784, 0x1.fffff83ff8000p-839, INT64_C(0x0000000000000000)}, {-0x1.00ffc00ffff00p-771, -0x1.fe0007fffff00p-827, INT64_C(0x0000000000000000)}, {0x1.00001fffff800p-705, 0x1.fffffffe00000p-779, INT64_C(0x0000000000000000)}, {-0x1.0000000800000p-800, 0x1.0000000000000p-872, INT64_C(0x0000000000000000)}, {0x1.000003fffc002p-916, -0x1.0000000000000p-1021, INT64_C(0x0000000000000000)}, {-0x1.000003ffffffep-19, 0x1.ffe0080000000p-103, INT64_C(0x0000000000000000)}, {0x1.0800000000000p-211, -0x1.0000000000000p-307, INT64_C(0x0000000000000000)}, {-0x1.0000007fffc00p-464, -0x1.efe0000000000p-558, INT64_C(0x0000000000000000)}, {0x1.3fe0000100000p-20, -0x1.0000000000000p-93, INT64_C(0x0000000000000000)}, {-0x1.3fffffffffe00p-397, -0x1.fe00040000000p-472, INT64_C(0x0000000000000000)}, {0x1.0001fff800000p-371, 0x1.ffffff0000ffep-425, INT64_C(0x0000000000000000)}, {-0x1.00ff000000800p-806, 0x1.0000000800000p-872, INT64_C(0x0000000000000000)}, {0x1.0000800000000p-723, -0x1.ffffffe400000p-786, INT64_C(0x0000000000000000)}, {-0x1.000001ffffffap-94, 0x1.ffe1f80400000p-169, INT64_C(0x0000000000000000)}, {0x1.0000010000000p-343, -0x1.0000000000000p-448, INT64_C(0x0000000000000000)}, {-0x1.007fffffffc00p-425, -0x1.fffffc0000000p-496, INT64_C(0x0000000000000000)}, {0x1.0080000000000p-417, -0x1.0000000000000p-490, INT64_C(0x0000000000000000)}, {-0x1.001ffffffc000p-985, -0x1.0000000000000p-1039, INT64_C(0x0000000000000000)}, {0x1.000001fffff80p-758, 0x1.fffffc001fffcp-813, INT64_C(0x0000000000000000)}, {-0x1.00f3ffffff000p-189, -0x1.fff8000000000p-257, INT64_C(0x0000000000000000)}, {0x1.0000001ffff80p-98, 0x1.fffffdfffff8ep-152, INT64_C(0x0000000000000000)}, {-0x1.0001fff800ffep-251, -0x1.c000000000000p-354, INT64_C(0x0000000000000000)}, {0x1.00000007ff800p-179, 0x1.ffff800000000p-267, INT64_C(0x0000000000000000)}, {-0x1.000001fff8008p-475, 0x1.0000000000000p-557, INT64_C(0x0000000000000000)}, {0x1.007fbfffffcf0p-964, 0x1.ffff803ffe000p-1019, INT64_C(0x0000000000000000)}, {-0x1.0000001fc4000p-493, 0x1.fe003ffe00000p-549, INT64_C(0x0000000000000000)}, {0x1.0007e3ffe0000p-845, 0x1.fe0ffffffe000p-909, INT64_C(0x0000000000000000)}, {-0x1.0000200000000p-1021, 0x0.0000000000000p+0, INT64_C(0x0000000000000000)}, {0x1.0000001000000p-487, -0x1.fffffff804000p-554, INT64_C(0x0000000000000000)}, {-0x1.000000ffff800p-309, -0x1.fffffc0000000p-392, INT64_C(0x0000000000000000)}, {0x1.0001000000000p-455, -0x1.fffffff800400p-518, INT64_C(0x0000000000000000)}, {-0x1.0000800000000p-998, 0x1.0000000000000p-1070, INT64_C(0x0000000000000000)}, }; const int numTestCases = sizeof(testCases) / sizeof(struct testVector); int64_t __fixtfdi(long double x); int main(int argc, char *argv[]) { int i; DD input; int64_t expected_result, computed_result; for (i=0; i #include COMPILER_RT_ABI long double __floatditf(int64_t); #include "floatunditf_test.h" #include "DD.h" int main(int argc, char *argv[]) { int i; DD expected; DD computed; for (i=0; i #include "DD.h" long double __gcc_qdiv(long double x, long double y); double testAccuracy(); int testEdgeCases(); int main(int argc, char *argv[]) { if (testEdgeCases()) return 1; if (testAccuracy() > 4.0) return 1; return 0; } struct testVector { double xhi; double xlo; double yhi; double ylo; double rhi; double rlo; }; #define INFINITY __builtin_inf() #define HUGE 0x1.fffffffffffffp1023 #define QNAN __builtin_nan("") const struct testVector edgeCases[] = { { 0.0, 0.0, 0.0, 0.0, QNAN, 0.0 }, { -0.0, 0.0, 0.0, 0.0, QNAN, 0.0 }, { 0.0, 0.0, -0.0, 0.0, QNAN, 0.0 }, { -0.0, 0.0, -0.0, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, 0.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 0.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -0.0, 0.0, -INFINITY, 0.0 }, { -INFINITY, 0.0, -0.0, 0.0, INFINITY, 0.0 }, { INFINITY, 0.0, 1.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 1.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -1.0, 0.0, -INFINITY, 0.0 }, { -INFINITY, 0.0, -1.0, 0.0, INFINITY, 0.0 }, { INFINITY, 0.0, HUGE, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, HUGE, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -HUGE, 0.0, -INFINITY, 0.0 }, { -INFINITY, 0.0, -HUGE, 0.0, INFINITY, 0.0 }, { INFINITY, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, INFINITY, 0.0, -QNAN, 0.0 }, { INFINITY, 0.0, -INFINITY, 0.0, -QNAN, 0.0 }, { -INFINITY, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { 0.0, 0.0, INFINITY, 0.0, 0.0, 0.0 }, { 0.0, 0.0, -INFINITY, 0.0, -0.0, 0.0 }, { -0.0, 0.0, INFINITY, 0.0, -0.0, 0.0 }, { -0.0, 0.0, -INFINITY, 0.0, 0.0, 0.0 }, { 1.0, 0.0, INFINITY, 0.0, 0.0, 0.0 }, { 1.0, 0.0, -INFINITY, 0.0, -0.0, 0.0 }, { -1.0, 0.0, INFINITY, 0.0, -0.0, 0.0 }, { -1.0, 0.0, -INFINITY, 0.0, 0.0, 0.0 }, { HUGE, 0.0, INFINITY, 0.0, 0.0, 0.0 }, { HUGE, 0.0, -INFINITY, 0.0, -0.0, 0.0 }, { -HUGE, 0.0, INFINITY, 0.0, -0.0, 0.0 }, { -HUGE, 0.0, -INFINITY, 0.0, 0.0, 0.0 }, { QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, }; const int numEdgeCases = sizeof(edgeCases) / sizeof(struct testVector); int testEdgeCases() { int i; DD a, b, c, r; for (i=0; i #include #include #include #ifdef __x86_64__ #define randlength 2 #else #define randlength 4 #endif void printTest(mpfr_t a, mpfr_t b, mpfr_t c) { static const double infinityD = __builtin_inf(); MPFR_DECL_INIT(tmp, 53); double ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); double alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); double bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); double blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); double chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); double clo = isinf(chi) ? 0.0 : mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); } int main(int argc, char *argv[]) { MPFR_DECL_INIT(a, 106); MPFR_DECL_INIT(b, 106); MPFR_DECL_INIT(c, 106); int exponent_range = atoi(argv[1]); int i; for (i=0; i<128; ++i) { mpfr_random2(a, randlength, exponent_range); mpfr_random2(b, randlength, exponent_range); mpfr_div(c, a, b, GMP_RNDN); printTest(a, b, c); mpfr_neg(b, b, GMP_RNDN); mpfr_div(c, a, b, GMP_RNDN); printTest(a, b, c); mpfr_neg(a, a, GMP_RNDN); mpfr_neg(b, b, GMP_RNDN); mpfr_div(c, a, b, GMP_RNDN); printTest(a, b, c); mpfr_neg(b, b, GMP_RNDN); mpfr_div(c, a, b, GMP_RNDN); printTest(a, b, c); } return 0; } */ const struct testVector accuracyTests[] = { {0x1.00001ffffff00p+419, 0x1.fffff83ff8000p+364, 0x1.00ffc00ffff00p-598, 0x1.fe0007fffff00p-654, 0x1.fe02bca42ad25p+1016, 0x1.29aa5d717c42cp+961}, {0x1.00001ffffff00p+419, 0x1.fffff83ff8000p+364, -0x1.00ffc00ffff00p-598, -0x1.fe0007fffff00p-654, -0x1.fe02bca42ad25p+1016, -0x1.29aa5d717c42cp+961}, {-0x1.00001ffffff00p+419, -0x1.fffff83ff8000p+364, 0x1.00ffc00ffff00p-598, 0x1.fe0007fffff00p-654, -0x1.fe02bca42ad25p+1016, -0x1.29aa5d717c42cp+961}, {-0x1.00001ffffff00p+419, -0x1.fffff83ff8000p+364, -0x1.00ffc00ffff00p-598, -0x1.fe0007fffff00p-654, 0x1.fe02bca42ad25p+1016, 0x1.29aa5d717c42cp+961}, {0x1.00001fffff800p-575, 0x1.fffffffe00000p-649, 0x1.3fffffff80000p-17, 0x1.ffffffff00000p-90, 0x1.9999cccd6fd72p-559, -0x1.476d58085a038p-615}, {0x1.00001fffff800p-575, 0x1.fffffffe00000p-649, -0x1.3fffffff80000p-17, -0x1.ffffffff00000p-90, -0x1.9999cccd6fd72p-559, 0x1.476d58085a038p-615}, {-0x1.00001fffff800p-575, -0x1.fffffffe00000p-649, 0x1.3fffffff80000p-17, 0x1.ffffffff00000p-90, -0x1.9999cccd6fd72p-559, 0x1.476d58085a038p-615}, {-0x1.00001fffff800p-575, -0x1.fffffffe00000p-649, -0x1.3fffffff80000p-17, -0x1.ffffffff00000p-90, 0x1.9999cccd6fd72p-559, -0x1.476d58085a038p-615}, {0x1.0000000800000p-557, -0x1.0000000000000p-629, 0x1.000003fffc002p+323, -0x1.0000000000000p+218, 0x1.fffff810081f8p-881, -0x1.00fb820825b80p-939}, {0x1.0000000800000p-557, -0x1.0000000000000p-629, -0x1.000003fffc002p+323, 0x1.0000000000000p+218, -0x1.fffff810081f8p-881, 0x1.00fb820825b80p-939}, {-0x1.0000000800000p-557, 0x1.0000000000000p-629, 0x1.000003fffc002p+323, -0x1.0000000000000p+218, -0x1.fffff810081f8p-881, 0x1.00fb820825b80p-939}, {-0x1.0000000800000p-557, 0x1.0000000000000p-629, -0x1.000003fffc002p+323, 0x1.0000000000000p+218, 0x1.fffff810081f8p-881, -0x1.00fb820825b80p-939}, {0x1.000003ffffffep+356, -0x1.ffe0080000000p+272, 0x1.0800000000000p-150, -0x1.0000000000000p-246, 0x1.f07c26c9b26c6p+505, -0x1.745d1764d6558p+450}, {0x1.000003ffffffep+356, -0x1.ffe0080000000p+272, -0x1.0800000000000p-150, 0x1.0000000000000p-246, -0x1.f07c26c9b26c6p+505, 0x1.745d1764d6558p+450}, {-0x1.000003ffffffep+356, 0x1.ffe0080000000p+272, 0x1.0800000000000p-150, -0x1.0000000000000p-246, -0x1.f07c26c9b26c6p+505, 0x1.745d1764d6558p+450}, {-0x1.000003ffffffep+356, 0x1.ffe0080000000p+272, -0x1.0800000000000p-150, 0x1.0000000000000p-246, 0x1.f07c26c9b26c6p+505, -0x1.745d1764d6558p+450}, {0x1.0000007fffc00p-14, 0x1.efe0000000000p-108, 0x1.007fffffe0000p-312, 0x0.0000000000000p+0, 0x1.ff0080bfdf705p+297, 0x1.fb017ac5608fap+243}, {0x1.0000007fffc00p-14, 0x1.efe0000000000p-108, -0x1.007fffffe0000p-312, 0x0.0000000000000p+0, -0x1.ff0080bfdf705p+297, -0x1.fb017ac5608fap+243}, {-0x1.0000007fffc00p-14, -0x1.efe0000000000p-108, 0x1.007fffffe0000p-312, 0x0.0000000000000p+0, -0x1.ff0080bfdf705p+297, -0x1.fb017ac5608fap+243}, {-0x1.0000007fffc00p-14, -0x1.efe0000000000p-108, -0x1.007fffffe0000p-312, 0x0.0000000000000p+0, 0x1.ff0080bfdf705p+297, 0x1.fb017ac5608fap+243}, {0x1.3fe0000100000p-744, -0x1.0000000000000p-817, 0x1.3fffffffffe00p+293, 0x1.fe00040000000p+218, 0x1.ffccccce60000p-1038, 0x0.0000000000000p+0}, {0x1.3fe0000100000p-744, -0x1.0000000000000p-817, -0x1.3fffffffffe00p+293, -0x1.fe00040000000p+218, -0x1.ffccccce60000p-1038, -0x0.0000000000000p+0}, {-0x1.3fe0000100000p-744, 0x1.0000000000000p-817, 0x1.3fffffffffe00p+293, 0x1.fe00040000000p+218, -0x1.ffccccce60000p-1038, -0x0.0000000000000p+0}, {-0x1.3fe0000100000p-744, 0x1.0000000000000p-817, -0x1.3fffffffffe00p+293, -0x1.fe00040000000p+218, 0x1.ffccccce60000p-1038, 0x0.0000000000000p+0}, {0x1.0001fff800000p+0, 0x1.ffffff0000ffep-54, 0x1.00ff000000800p+11, -0x1.0000000800000p-55, 0x1.fe07f601f30ffp-12, -0x1.b3714144d2a90p-69}, {0x1.0001fff800000p+0, 0x1.ffffff0000ffep-54, -0x1.00ff000000800p+11, 0x1.0000000800000p-55, -0x1.fe07f601f30ffp-12, 0x1.b3714144d2a90p-69}, {-0x1.0001fff800000p+0, -0x1.ffffff0000ffep-54, 0x1.00ff000000800p+11, -0x1.0000000800000p-55, -0x1.fe07f601f30ffp-12, 0x1.b3714144d2a90p-69}, {-0x1.0001fff800000p+0, -0x1.ffffff0000ffep-54, -0x1.00ff000000800p+11, 0x1.0000000800000p-55, 0x1.fe07f601f30ffp-12, -0x1.b3714144d2a90p-69}, {0x1.0000800000000p-381, -0x1.ffffffe400000p-444, 0x1.000001ffffffap+606, -0x1.ffe1f80400000p+531, 0x1.00007dffff046p-987, -0x1.d940000000000p-1051}, {0x1.0000800000000p-381, -0x1.ffffffe400000p-444, -0x1.000001ffffffap+606, 0x1.ffe1f80400000p+531, -0x1.00007dffff046p-987, 0x1.d940000000000p-1051}, {-0x1.0000800000000p-381, 0x1.ffffffe400000p-444, 0x1.000001ffffffap+606, -0x1.ffe1f80400000p+531, -0x1.00007dffff046p-987, 0x1.d940000000000p-1051}, {-0x1.0000800000000p-381, 0x1.ffffffe400000p-444, -0x1.000001ffffffap+606, 0x1.ffe1f80400000p+531, 0x1.00007dffff046p-987, -0x1.d940000000000p-1051}, {0x1.0000010000000p+772, -0x1.0000000000000p+667, 0x1.007fffffffc00p+750, 0x1.fffffc0000000p+679, 0x1.ff0081bf20ef5p+21, -0x1.e0f5922874ff2p-33}, {0x1.0000010000000p+772, -0x1.0000000000000p+667, -0x1.007fffffffc00p+750, -0x1.fffffc0000000p+679, -0x1.ff0081bf20ef5p+21, 0x1.e0f5922874ff2p-33}, {-0x1.0000010000000p+772, 0x1.0000000000000p+667, 0x1.007fffffffc00p+750, 0x1.fffffc0000000p+679, -0x1.ff0081bf20ef5p+21, 0x1.e0f5922874ff2p-33}, {-0x1.0000010000000p+772, 0x1.0000000000000p+667, -0x1.007fffffffc00p+750, -0x1.fffffc0000000p+679, 0x1.ff0081bf20ef5p+21, -0x1.e0f5922874ff2p-33}, {0x1.0080000000000p-547, -0x1.0000000000000p-620, 0x1.001ffffffc000p+963, 0x1.fffffffff001cp+908, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0080000000000p-547, -0x1.0000000000000p-620, -0x1.001ffffffc000p+963, -0x1.fffffffff001cp+908, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0080000000000p-547, 0x1.0000000000000p-620, 0x1.001ffffffc000p+963, 0x1.fffffffff001cp+908, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0080000000000p-547, 0x1.0000000000000p-620, -0x1.001ffffffc000p+963, -0x1.fffffffff001cp+908, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.000001fffff80p-138, 0x1.fffffc001fffcp-193, 0x1.00001ffff8000p-554, 0x1.00007f001e000p-609, 0x1.ffffc40017700p+415, -0x1.9c017d7fb3e20p+358}, {0x1.000001fffff80p-138, 0x1.fffffc001fffcp-193, -0x1.00001ffff8000p-554, -0x1.00007f001e000p-609, -0x1.ffffc40017700p+415, 0x1.9c017d7fb3e20p+358}, {-0x1.000001fffff80p-138, -0x1.fffffc001fffcp-193, 0x1.00001ffff8000p-554, 0x1.00007f001e000p-609, -0x1.ffffc40017700p+415, 0x1.9c017d7fb3e20p+358}, {-0x1.000001fffff80p-138, -0x1.fffffc001fffcp-193, -0x1.00001ffff8000p-554, -0x1.00007f001e000p-609, 0x1.ffffc40017700p+415, -0x1.9c017d7fb3e20p+358}, {0x1.00f3ffffff000p-238, 0x1.fff8000000000p-306, 0x1.3dfffffffc000p-529, 0x1.ff000003ffe00p-590, 0x1.9db5efe640c6bp+290, 0x1.d0e9f9b84e302p+236}, {0x1.00f3ffffff000p-238, 0x1.fff8000000000p-306, -0x1.3dfffffffc000p-529, -0x1.ff000003ffe00p-590, -0x1.9db5efe640c6bp+290, -0x1.d0e9f9b84e302p+236}, {-0x1.00f3ffffff000p-238, -0x1.fff8000000000p-306, 0x1.3dfffffffc000p-529, 0x1.ff000003ffe00p-590, -0x1.9db5efe640c6bp+290, -0x1.d0e9f9b84e302p+236}, {-0x1.00f3ffffff000p-238, -0x1.fff8000000000p-306, -0x1.3dfffffffc000p-529, -0x1.ff000003ffe00p-590, 0x1.9db5efe640c6bp+290, 0x1.d0e9f9b84e302p+236}, {0x1.0000001ffff80p-69, 0x1.fffffdfffff8ep-123, 0x1.0000000000000p-311, -0x1.0000000000000p-381, 0x1.0000001ffff81p+242, -0x1.ffff01ffffe72p+188}, {0x1.0000001ffff80p-69, 0x1.fffffdfffff8ep-123, -0x1.0000000000000p-311, 0x1.0000000000000p-381, -0x1.0000001ffff81p+242, 0x1.ffff01ffffe72p+188}, {-0x1.0000001ffff80p-69, -0x1.fffffdfffff8ep-123, 0x1.0000000000000p-311, -0x1.0000000000000p-381, -0x1.0000001ffff81p+242, 0x1.ffff01ffffe72p+188}, {-0x1.0000001ffff80p-69, -0x1.fffffdfffff8ep-123, -0x1.0000000000000p-311, 0x1.0000000000000p-381, 0x1.0000001ffff81p+242, -0x1.ffff01ffffe72p+188}, {0x1.001fffffffe00p-160, 0x0.0000000000000p+0, 0x1.0000002000000p+499, -0x1.0000000000000p+399, 0x1.001fffdffbe00p-659, 0x1.0020ffdffbe40p-713}, {0x1.001fffffffe00p-160, 0x0.0000000000000p+0, -0x1.0000002000000p+499, 0x1.0000000000000p+399, -0x1.001fffdffbe00p-659, -0x1.0020ffdffbe40p-713}, {-0x1.001fffffffe00p-160, 0x0.0000000000000p+0, 0x1.0000002000000p+499, -0x1.0000000000000p+399, -0x1.001fffdffbe00p-659, -0x1.0020ffdffbe40p-713}, {-0x1.001fffffffe00p-160, 0x0.0000000000000p+0, -0x1.0000002000000p+499, 0x1.0000000000000p+399, 0x1.001fffdffbe00p-659, 0x1.0020ffdffbe40p-713}, {0x1.01ffffffe0000p+182, 0x1.c000000200000p+121, 0x1.0001fff800ffep-8, 0x1.c000000000000p-111, 0x1.01fdfc0bf6d61p+190, 0x1.41500c3427868p+136}, {0x1.01ffffffe0000p+182, 0x1.c000000200000p+121, -0x1.0001fff800ffep-8, -0x1.c000000000000p-111, -0x1.01fdfc0bf6d61p+190, -0x1.41500c3427868p+136}, {-0x1.01ffffffe0000p+182, -0x1.c000000200000p+121, 0x1.0001fff800ffep-8, 0x1.c000000000000p-111, -0x1.01fdfc0bf6d61p+190, -0x1.41500c3427868p+136}, {-0x1.01ffffffe0000p+182, -0x1.c000000200000p+121, -0x1.0001fff800ffep-8, -0x1.c000000000000p-111, 0x1.01fdfc0bf6d61p+190, 0x1.41500c3427868p+136}, {0x1.00000007ff800p-868, 0x1.ffff800000000p-956, 0x1.00003fe0c4000p+822, -0x1.fffc032000000p+759, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00000007ff800p-868, 0x1.ffff800000000p-956, -0x1.00003fe0c4000p+822, 0x1.fffc032000000p+759, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00000007ff800p-868, -0x1.ffff800000000p-956, 0x1.00003fe0c4000p+822, -0x1.fffc032000000p+759, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00000007ff800p-868, -0x1.ffff800000000p-956, -0x1.00003fe0c4000p+822, 0x1.fffc032000000p+759, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.000001fff8008p-330, -0x1.0000000000000p-412, 0x1.000ffffff8000p-674, 0x1.ffffffffffc00p-729, 0x1.ffe005ffa005fp+343, 0x1.f43ff5ecf10d0p+289}, {0x1.000001fff8008p-330, -0x1.0000000000000p-412, -0x1.000ffffff8000p-674, -0x1.ffffffffffc00p-729, -0x1.ffe005ffa005fp+343, -0x1.f43ff5ecf10d0p+289}, {-0x1.000001fff8008p-330, 0x1.0000000000000p-412, 0x1.000ffffff8000p-674, 0x1.ffffffffffc00p-729, -0x1.ffe005ffa005fp+343, -0x1.f43ff5ecf10d0p+289}, {-0x1.000001fff8008p-330, 0x1.0000000000000p-412, -0x1.000ffffff8000p-674, -0x1.ffffffffffc00p-729, 0x1.ffe005ffa005fp+343, 0x1.f43ff5ecf10d0p+289}, {0x1.007fbfffffcf0p+664, 0x1.ffff803ffe000p+609, 0x1.0007ffff00000p+281, 0x1.fffff80000000p+211, 0x1.0077bc431e2ddp+383, -0x1.2b617a631e528p+327}, {0x1.007fbfffffcf0p+664, 0x1.ffff803ffe000p+609, -0x1.0007ffff00000p+281, -0x1.fffff80000000p+211, -0x1.0077bc431e2ddp+383, 0x1.2b617a631e528p+327}, {-0x1.007fbfffffcf0p+664, -0x1.ffff803ffe000p+609, 0x1.0007ffff00000p+281, 0x1.fffff80000000p+211, -0x1.0077bc431e2ddp+383, 0x1.2b617a631e528p+327}, {-0x1.007fbfffffcf0p+664, -0x1.ffff803ffe000p+609, -0x1.0007ffff00000p+281, -0x1.fffff80000000p+211, 0x1.0077bc431e2ddp+383, -0x1.2b617a631e528p+327}, {0x1.0000001fc4000p+296, -0x1.fe003ffe00000p+240, 0x1.01ffffffc0004p+770, -0x1.fffc100000000p+709, 0x1.fc07f05f4870ap-475, -0x1.fd9f5028f5e8ap-529}, {0x1.0000001fc4000p+296, -0x1.fe003ffe00000p+240, -0x1.01ffffffc0004p+770, 0x1.fffc100000000p+709, -0x1.fc07f05f4870ap-475, 0x1.fd9f5028f5e8ap-529}, {-0x1.0000001fc4000p+296, 0x1.fe003ffe00000p+240, 0x1.01ffffffc0004p+770, -0x1.fffc100000000p+709, -0x1.fc07f05f4870ap-475, 0x1.fd9f5028f5e8ap-529}, {-0x1.0000001fc4000p+296, 0x1.fe003ffe00000p+240, -0x1.01ffffffc0004p+770, 0x1.fffc100000000p+709, 0x1.fc07f05f4870ap-475, -0x1.fd9f5028f5e8ap-529}, {0x1.0007e3ffe0000p+601, 0x1.fe0ffffffe000p+537, 0x1.0000001000000p+631, -0x1.ffffff0000800p+567, 0x1.0007e3efdf81cp-30, 0x1.060603b67f558p-86}, {0x1.0007e3ffe0000p+601, 0x1.fe0ffffffe000p+537, -0x1.0000001000000p+631, 0x1.ffffff0000800p+567, -0x1.0007e3efdf81cp-30, -0x1.060603b67f558p-86}, {-0x1.0007e3ffe0000p+601, -0x1.fe0ffffffe000p+537, 0x1.0000001000000p+631, -0x1.ffffff0000800p+567, -0x1.0007e3efdf81cp-30, -0x1.060603b67f558p-86}, {-0x1.0007e3ffe0000p+601, -0x1.fe0ffffffe000p+537, -0x1.0000001000000p+631, 0x1.ffffff0000800p+567, 0x1.0007e3efdf81cp-30, 0x1.060603b67f558p-86}, {0x1.00000003ff800p+298, 0x1.ffffe00000000p+212, 0x1.0000200000000p+469, -0x1.ff80800000000p+404, 0x1.ffffc00806ff0p-172, -0x1.bbc0c7e7b71b0p-229}, {0x1.00000003ff800p+298, 0x1.ffffe00000000p+212, -0x1.0000200000000p+469, 0x1.ff80800000000p+404, -0x1.ffffc00806ff0p-172, 0x1.bbc0c7e7b71b0p-229}, {-0x1.00000003ff800p+298, -0x1.ffffe00000000p+212, 0x1.0000200000000p+469, -0x1.ff80800000000p+404, -0x1.ffffc00806ff0p-172, 0x1.bbc0c7e7b71b0p-229}, {-0x1.00000003ff800p+298, -0x1.ffffe00000000p+212, -0x1.0000200000000p+469, 0x1.ff80800000000p+404, 0x1.ffffc00806ff0p-172, -0x1.bbc0c7e7b71b0p-229}, {0x1.0000001000000p-64, -0x1.fffffff804000p-131, 0x1.003ffffff8000p+483, 0x1.f00000007fc00p+425, 0x1.ff80201809f98p-548, 0x1.a8143b315e430p-604}, {0x1.0000001000000p-64, -0x1.fffffff804000p-131, -0x1.003ffffff8000p+483, -0x1.f00000007fc00p+425, -0x1.ff80201809f98p-548, -0x1.a8143b315e430p-604}, {-0x1.0000001000000p-64, 0x1.fffffff804000p-131, 0x1.003ffffff8000p+483, 0x1.f00000007fc00p+425, -0x1.ff80201809f98p-548, -0x1.a8143b315e430p-604}, {-0x1.0000001000000p-64, 0x1.fffffff804000p-131, -0x1.003ffffff8000p+483, -0x1.f00000007fc00p+425, 0x1.ff80201809f98p-548, 0x1.a8143b315e430p-604}, {0x1.1ffff80000000p-10, 0x1.ffffff7ff8000p-69, 0x1.00ff000000004p-167, -0x1.ffffff0000400p-230, 0x1.1ee234ad87262p+157, -0x1.99e41e6e04f48p+103}, {0x1.1ffff80000000p-10, 0x1.ffffff7ff8000p-69, -0x1.00ff000000004p-167, 0x1.ffffff0000400p-230, -0x1.1ee234ad87262p+157, 0x1.99e41e6e04f48p+103}, {-0x1.1ffff80000000p-10, -0x1.ffffff7ff8000p-69, 0x1.00ff000000004p-167, -0x1.ffffff0000400p-230, -0x1.1ee234ad87262p+157, 0x1.99e41e6e04f48p+103}, {-0x1.1ffff80000000p-10, -0x1.ffffff7ff8000p-69, -0x1.00ff000000004p-167, 0x1.ffffff0000400p-230, 0x1.1ee234ad87262p+157, -0x1.99e41e6e04f48p+103}, {0x1.000000ffff800p+869, 0x1.fffffc0000000p+786, 0x1.0008000000000p+602, -0x1.0000000000000p+534, 0x1.fff0027feb00ap+266, 0x1.feb80a1fb901ap+212}, {0x1.000000ffff800p+869, 0x1.fffffc0000000p+786, -0x1.0008000000000p+602, 0x1.0000000000000p+534, -0x1.fff0027feb00ap+266, -0x1.feb80a1fb901ap+212}, {-0x1.000000ffff800p+869, -0x1.fffffc0000000p+786, 0x1.0008000000000p+602, -0x1.0000000000000p+534, -0x1.fff0027feb00ap+266, -0x1.feb80a1fb901ap+212}, {-0x1.000000ffff800p+869, -0x1.fffffc0000000p+786, -0x1.0008000000000p+602, 0x1.0000000000000p+534, 0x1.fff0027feb00ap+266, 0x1.feb80a1fb901ap+212}, {0x1.0000183ffffc0p+625, 0x1.fff07fcfffffcp+571, 0x1.0000010000000p-809, -0x1.0000000000000p-884, INFINITY, 0x0.0000000000000p+0}, {0x1.0000183ffffc0p+625, 0x1.fff07fcfffffcp+571, -0x1.0000010000000p-809, 0x1.0000000000000p-884, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000183ffffc0p+625, -0x1.fff07fcfffffcp+571, 0x1.0000010000000p-809, -0x1.0000000000000p-884, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000183ffffc0p+625, -0x1.fff07fcfffffcp+571, -0x1.0000010000000p-809, 0x1.0000000000000p-884, INFINITY, 0x0.0000000000000p+0}, {0x1.0001000000000p+252, -0x1.fffffff800400p+189, 0x1.0000800000000p+229, -0x1.fffff80100000p+156, 0x1.00007fffc0002p+23, -0x1.03bf7dfd41200p-39}, {0x1.0001000000000p+252, -0x1.fffffff800400p+189, -0x1.0000800000000p+229, 0x1.fffff80100000p+156, -0x1.00007fffc0002p+23, 0x1.03bf7dfd41200p-39}, {-0x1.0001000000000p+252, 0x1.fffffff800400p+189, 0x1.0000800000000p+229, -0x1.fffff80100000p+156, -0x1.00007fffc0002p+23, 0x1.03bf7dfd41200p-39}, {-0x1.0001000000000p+252, 0x1.fffffff800400p+189, -0x1.0000800000000p+229, 0x1.fffff80100000p+156, 0x1.00007fffc0002p+23, -0x1.03bf7dfd41200p-39}, {0x1.3ffff800fff81p+251, -0x1.0000000000000p+160, 0x1.1fffffff00000p-134, 0x1.fffffff000000p-211, 0x1.1c71c001e05e1p+385, -0x1.c571834f1dba0p+329}, {0x1.3ffff800fff81p+251, -0x1.0000000000000p+160, -0x1.1fffffff00000p-134, -0x1.fffffff000000p-211, -0x1.1c71c001e05e1p+385, 0x1.c571834f1dba0p+329}, {-0x1.3ffff800fff81p+251, 0x1.0000000000000p+160, 0x1.1fffffff00000p-134, 0x1.fffffff000000p-211, -0x1.1c71c001e05e1p+385, 0x1.c571834f1dba0p+329}, {-0x1.3ffff800fff81p+251, 0x1.0000000000000p+160, -0x1.1fffffff00000p-134, -0x1.fffffff000000p-211, 0x1.1c71c001e05e1p+385, -0x1.c571834f1dba0p+329}, {0x1.fffffc0000100p+380, -0x1.fffe000040000p+309, 0x1.0000800000000p+410, -0x1.c000fffffffd0p+353, 0x1.fffefc00820fcp-30, 0x1.703780ec1f1f0p-87}, {0x1.fffffc0000100p+380, -0x1.fffe000040000p+309, -0x1.0000800000000p+410, 0x1.c000fffffffd0p+353, -0x1.fffefc00820fcp-30, -0x1.703780ec1f1f0p-87}, {-0x1.fffffc0000100p+380, 0x1.fffe000040000p+309, 0x1.0000800000000p+410, -0x1.c000fffffffd0p+353, -0x1.fffefc00820fcp-30, -0x1.703780ec1f1f0p-87}, {-0x1.fffffc0000100p+380, 0x1.fffe000040000p+309, -0x1.0000800000000p+410, 0x1.c000fffffffd0p+353, 0x1.fffefc00820fcp-30, 0x1.703780ec1f1f0p-87}, {0x1.003f80ff00004p-166, -0x1.ffffc00040000p-237, 0x1.0000ffffff000p+849, 0x1.ffe000003ffe0p+791, 0x1.003e80c080400p-1015, -0x1.2000000000000p-1070}, {0x1.003f80ff00004p-166, -0x1.ffffc00040000p-237, -0x1.0000ffffff000p+849, -0x1.ffe000003ffe0p+791, -0x1.003e80c080400p-1015, 0x1.2000000000000p-1070}, {-0x1.003f80ff00004p-166, 0x1.ffffc00040000p-237, 0x1.0000ffffff000p+849, 0x1.ffe000003ffe0p+791, -0x1.003e80c080400p-1015, 0x1.2000000000000p-1070}, {-0x1.003f80ff00004p-166, 0x1.ffffc00040000p-237, -0x1.0000ffffff000p+849, -0x1.ffe000003ffe0p+791, 0x1.003e80c080400p-1015, -0x1.2000000000000p-1070}, {0x1.000003fffff80p-485, 0x1.f007ffe00fc00p-548, 0x1.3ff8007ffffc0p+163, 0x1.e0007ff000000p+97, 0x1.99a3dd0e7862fp-649, -0x1.e94ba8273c842p-703}, {0x1.000003fffff80p-485, 0x1.f007ffe00fc00p-548, -0x1.3ff8007ffffc0p+163, -0x1.e0007ff000000p+97, -0x1.99a3dd0e7862fp-649, 0x1.e94ba8273c842p-703}, {-0x1.000003fffff80p-485, -0x1.f007ffe00fc00p-548, 0x1.3ff8007ffffc0p+163, 0x1.e0007ff000000p+97, -0x1.99a3dd0e7862fp-649, 0x1.e94ba8273c842p-703}, {-0x1.000003fffff80p-485, -0x1.f007ffe00fc00p-548, -0x1.3ff8007ffffc0p+163, -0x1.e0007ff000000p+97, 0x1.99a3dd0e7862fp-649, -0x1.e94ba8273c842p-703}, {0x1.ffffffe000000p-232, -0x1.ff80000020000p-288, 0x1.0000ffffff81fp+818, 0x1.ffc7fff800000p+754, 0x1.fffe000000000p-1050, -0x0.0000000000000p+0}, {0x1.ffffffe000000p-232, -0x1.ff80000020000p-288, -0x1.0000ffffff81fp+818, -0x1.ffc7fff800000p+754, -0x1.fffe000000000p-1050, 0x0.0000000000000p+0}, {-0x1.ffffffe000000p-232, 0x1.ff80000020000p-288, 0x1.0000ffffff81fp+818, 0x1.ffc7fff800000p+754, -0x1.fffe000000000p-1050, 0x0.0000000000000p+0}, {-0x1.ffffffe000000p-232, 0x1.ff80000020000p-288, -0x1.0000ffffff81fp+818, -0x1.ffc7fff800000p+754, 0x1.fffe000000000p-1050, -0x0.0000000000000p+0}, {0x1.0000000800000p-741, -0x1.ffffc02000000p-819, 0x1.7fffe00800000p-232, -0x1.0000000000000p-337, 0x1.555571caad093p-510, -0x1.e0b116af638a0p-568}, {0x1.0000000800000p-741, -0x1.ffffc02000000p-819, -0x1.7fffe00800000p-232, 0x1.0000000000000p-337, -0x1.555571caad093p-510, 0x1.e0b116af638a0p-568}, {-0x1.0000000800000p-741, 0x1.ffffc02000000p-819, 0x1.7fffe00800000p-232, -0x1.0000000000000p-337, -0x1.555571caad093p-510, 0x1.e0b116af638a0p-568}, {-0x1.0000000800000p-741, 0x1.ffffc02000000p-819, -0x1.7fffe00800000p-232, 0x1.0000000000000p-337, 0x1.555571caad093p-510, -0x1.e0b116af638a0p-568}, {0x1.0000400000000p-741, -0x1.0000000000000p-832, 0x1.4000000000000p-919, -0x1.ffffffff00020p-977, 0x1.999a000000000p+177, 0x1.47ae66655c2a0p+120}, {0x1.0000400000000p-741, -0x1.0000000000000p-832, -0x1.4000000000000p-919, 0x1.ffffffff00020p-977, -0x1.999a000000000p+177, -0x1.47ae66655c2a0p+120}, {-0x1.0000400000000p-741, 0x1.0000000000000p-832, 0x1.4000000000000p-919, -0x1.ffffffff00020p-977, -0x1.999a000000000p+177, -0x1.47ae66655c2a0p+120}, {-0x1.0000400000000p-741, 0x1.0000000000000p-832, -0x1.4000000000000p-919, 0x1.ffffffff00020p-977, 0x1.999a000000000p+177, 0x1.47ae66655c2a0p+120}, {0x1.000000fffff80p+807, 0x1.ffffef003e000p+744, 0x1.0000010000000p+666, -0x1.8000000000020p+608, 0x1.fffffffffff00p+140, 0x1.901ffde7e1e80p+83}, {0x1.000000fffff80p+807, 0x1.ffffef003e000p+744, -0x1.0000010000000p+666, 0x1.8000000000020p+608, -0x1.fffffffffff00p+140, -0x1.901ffde7e1e80p+83}, {-0x1.000000fffff80p+807, -0x1.ffffef003e000p+744, 0x1.0000010000000p+666, -0x1.8000000000020p+608, -0x1.fffffffffff00p+140, -0x1.901ffde7e1e80p+83}, {-0x1.000000fffff80p+807, -0x1.ffffef003e000p+744, -0x1.0000010000000p+666, 0x1.8000000000020p+608, 0x1.fffffffffff00p+140, 0x1.901ffde7e1e80p+83}, {0x1.7fffffffc0000p-420, 0x1.fffc000000000p-490, 0x1.0000001fe0000p+340, 0x1.fffffc0001f00p+279, 0x1.7fffffcff0000p-760, 0x1.79017fd9cf2a6p-814}, {0x1.7fffffffc0000p-420, 0x1.fffc000000000p-490, -0x1.0000001fe0000p+340, -0x1.fffffc0001f00p+279, -0x1.7fffffcff0000p-760, -0x1.79017fd9cf2a6p-814}, {-0x1.7fffffffc0000p-420, -0x1.fffc000000000p-490, 0x1.0000001fe0000p+340, 0x1.fffffc0001f00p+279, -0x1.7fffffcff0000p-760, -0x1.79017fd9cf2a6p-814}, {-0x1.7fffffffc0000p-420, -0x1.fffc000000000p-490, -0x1.0000001fe0000p+340, -0x1.fffffc0001f00p+279, 0x1.7fffffcff0000p-760, 0x1.79017fd9cf2a6p-814}, {0x1.0000004000000p-97, -0x1.0000000000000p-155, 0x1.8000000000000p-464, -0x1.ffe7ffc001000p-529, 0x1.555555aaaaaabp+366, -0x1.6a71c9c71555ep+312}, {0x1.0000004000000p-97, -0x1.0000000000000p-155, -0x1.8000000000000p-464, 0x1.ffe7ffc001000p-529, -0x1.555555aaaaaabp+366, 0x1.6a71c9c71555ep+312}, {-0x1.0000004000000p-97, 0x1.0000000000000p-155, 0x1.8000000000000p-464, -0x1.ffe7ffc001000p-529, -0x1.555555aaaaaabp+366, 0x1.6a71c9c71555ep+312}, {-0x1.0000004000000p-97, 0x1.0000000000000p-155, -0x1.8000000000000p-464, 0x1.ffe7ffc001000p-529, 0x1.555555aaaaaabp+366, -0x1.6a71c9c71555ep+312}, {0x1.0000000800000p-953, -0x1.fffffff400000p-1028, 0x1.007fc00007800p-531, 0x1.e0000f80001e0p-589, 0x1.ff00ff5088975p-423, -0x1.eb9bace924318p-479}, {0x1.0000000800000p-953, -0x1.fffffff400000p-1028, -0x1.007fc00007800p-531, -0x1.e0000f80001e0p-589, -0x1.ff00ff5088975p-423, 0x1.eb9bace924318p-479}, {-0x1.0000000800000p-953, 0x1.fffffff400000p-1028, 0x1.007fc00007800p-531, 0x1.e0000f80001e0p-589, -0x1.ff00ff5088975p-423, 0x1.eb9bace924318p-479}, {-0x1.0000000800000p-953, 0x1.fffffff400000p-1028, -0x1.007fc00007800p-531, -0x1.e0000f80001e0p-589, 0x1.ff00ff5088975p-423, -0x1.eb9bace924318p-479}, {0x1.3fffff0000000p+486, 0x1.fffffe0000000p+423, 0x1.0000200000000p-608, -0x1.0000000000000p-713, INFINITY, 0x0.0000000000000p+0}, {0x1.3fffff0000000p+486, 0x1.fffffe0000000p+423, -0x1.0000200000000p-608, 0x1.0000000000000p-713, -INFINITY, 0x0.0000000000000p+0}, {-0x1.3fffff0000000p+486, -0x1.fffffe0000000p+423, 0x1.0000200000000p-608, -0x1.0000000000000p-713, -INFINITY, 0x0.0000000000000p+0}, {-0x1.3fffff0000000p+486, -0x1.fffffe0000000p+423, -0x1.0000200000000p-608, 0x1.0000000000000p-713, INFINITY, 0x0.0000000000000p+0}, {0x1.7fe0000000008p-874, -0x1.fffff3ff80200p-936, 0x1.000001fff8400p+934, -0x1.fffff80010000p+869, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.7fe0000000008p-874, -0x1.fffff3ff80200p-936, -0x1.000001fff8400p+934, 0x1.fffff80010000p+869, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.7fe0000000008p-874, 0x1.fffff3ff80200p-936, 0x1.000001fff8400p+934, -0x1.fffff80010000p+869, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.7fe0000000008p-874, 0x1.fffff3ff80200p-936, -0x1.000001fff8400p+934, 0x1.fffff80010000p+869, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00000fffffff8p-940, 0x1.fffffffc00000p-999, 0x1.0000007001000p+288, -0x1.e00000fff8200p+228, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00000fffffff8p-940, 0x1.fffffffc00000p-999, -0x1.0000007001000p+288, 0x1.e00000fff8200p+228, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00000fffffff8p-940, -0x1.fffffffc00000p-999, 0x1.0000007001000p+288, -0x1.e00000fff8200p+228, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00000fffffff8p-940, -0x1.fffffffc00000p-999, -0x1.0000007001000p+288, 0x1.e00000fff8200p+228, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.001fffc000400p-967, -0x1.e000000001000p-1032, 0x1.0200000000000p+224, -0x1.0000000000000p+121, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.001fffc000400p-967, -0x1.e000000001000p-1032, -0x1.0200000000000p+224, 0x1.0000000000000p+121, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.001fffc000400p-967, 0x1.e000000001000p-1032, 0x1.0200000000000p+224, -0x1.0000000000000p+121, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.001fffc000400p-967, 0x1.e000000001000p-1032, -0x1.0200000000000p+224, 0x1.0000000000000p+121, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000008000000p-97, -0x1.0000000000000p-167, 0x1.07fff80000002p-376, -0x1.c010000000000p-447, 0x1.f07c2f0b854dbp+278, 0x1.2c698df3c3460p+221}, {0x1.0000008000000p-97, -0x1.0000000000000p-167, -0x1.07fff80000002p-376, 0x1.c010000000000p-447, -0x1.f07c2f0b854dbp+278, -0x1.2c698df3c3460p+221}, {-0x1.0000008000000p-97, 0x1.0000000000000p-167, 0x1.07fff80000002p-376, -0x1.c010000000000p-447, -0x1.f07c2f0b854dbp+278, -0x1.2c698df3c3460p+221}, {-0x1.0000008000000p-97, 0x1.0000000000000p-167, -0x1.07fff80000002p-376, 0x1.c010000000000p-447, 0x1.f07c2f0b854dbp+278, 0x1.2c698df3c3460p+221}, {0x1.03ffffffe0000p+781, 0x1.ff80000000000p+692, 0x1.7ffff00000002p-601, -0x1.0000000000000p-694, INFINITY, 0x0.0000000000000p+0}, {0x1.03ffffffe0000p+781, 0x1.ff80000000000p+692, -0x1.7ffff00000002p-601, 0x1.0000000000000p-694, -INFINITY, 0x0.0000000000000p+0}, {-0x1.03ffffffe0000p+781, -0x1.ff80000000000p+692, 0x1.7ffff00000002p-601, -0x1.0000000000000p-694, -INFINITY, 0x0.0000000000000p+0}, {-0x1.03ffffffe0000p+781, -0x1.ff80000000000p+692, -0x1.7ffff00000002p-601, 0x1.0000000000000p-694, INFINITY, 0x0.0000000000000p+0}, {0x1.0008000000000p+386, -0x1.9000000000000p+285, 0x1.0000000700002p+420, -0x1.fffff80200000p+357, 0x1.0007fff8ffc7ep-34, 0x1.a00d4d7413580p-93}, {0x1.0008000000000p+386, -0x1.9000000000000p+285, -0x1.0000000700002p+420, 0x1.fffff80200000p+357, -0x1.0007fff8ffc7ep-34, -0x1.a00d4d7413580p-93}, {-0x1.0008000000000p+386, 0x1.9000000000000p+285, 0x1.0000000700002p+420, -0x1.fffff80200000p+357, -0x1.0007fff8ffc7ep-34, -0x1.a00d4d7413580p-93}, {-0x1.0008000000000p+386, 0x1.9000000000000p+285, -0x1.0000000700002p+420, 0x1.fffff80200000p+357, 0x1.0007fff8ffc7ep-34, 0x1.a00d4d7413580p-93}, {0x1.0010000000000p-808, -0x1.0000000000000p-885, 0x1.007fc00001000p-874, -0x1.ff80000400000p-930, 0x1.ff20ef50918c4p+65, 0x1.5059d3d1c2168p+9}, {0x1.0010000000000p-808, -0x1.0000000000000p-885, -0x1.007fc00001000p-874, 0x1.ff80000400000p-930, -0x1.ff20ef50918c4p+65, -0x1.5059d3d1c2168p+9}, {-0x1.0010000000000p-808, 0x1.0000000000000p-885, 0x1.007fc00001000p-874, -0x1.ff80000400000p-930, -0x1.ff20ef50918c4p+65, -0x1.5059d3d1c2168p+9}, {-0x1.0010000000000p-808, 0x1.0000000000000p-885, -0x1.007fc00001000p-874, 0x1.ff80000400000p-930, 0x1.ff20ef50918c4p+65, 0x1.5059d3d1c2168p+9}, {0x1.0000008000000p+531, -0x1.fff0000000100p+472, 0x1.7fffff8100000p-278, -0x1.fffcc00000080p-338, 0x1.55555670e38e9p+808, 0x1.9c985b0496336p+754}, {0x1.0000008000000p+531, -0x1.fff0000000100p+472, -0x1.7fffff8100000p-278, 0x1.fffcc00000080p-338, -0x1.55555670e38e9p+808, -0x1.9c985b0496336p+754}, {-0x1.0000008000000p+531, 0x1.fff0000000100p+472, 0x1.7fffff8100000p-278, -0x1.fffcc00000080p-338, -0x1.55555670e38e9p+808, -0x1.9c985b0496336p+754}, {-0x1.0000008000000p+531, 0x1.fff0000000100p+472, -0x1.7fffff8100000p-278, 0x1.fffcc00000080p-338, 0x1.55555670e38e9p+808, 0x1.9c985b0496336p+754}, {0x1.0000003ffc010p-568, -0x1.ffffc00400000p-637, 0x1.0000c00400000p+799, -0x1.ff80800000000p+718, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000003ffc010p-568, -0x1.ffffc00400000p-637, -0x1.0000c00400000p+799, 0x1.ff80800000000p+718, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000003ffc010p-568, 0x1.ffffc00400000p-637, 0x1.0000c00400000p+799, -0x1.ff80800000000p+718, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000003ffc010p-568, 0x1.ffffc00400000p-637, -0x1.0000c00400000p+799, 0x1.ff80800000000p+718, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000007fff800p-430, 0x1.ffff800007fc0p-489, 0x1.0000007fff000p+851, 0x1.ffffff8000000p+776, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000007fff800p-430, 0x1.ffff800007fc0p-489, -0x1.0000007fff000p+851, -0x1.ffffff8000000p+776, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000007fff800p-430, -0x1.ffff800007fc0p-489, 0x1.0000007fff000p+851, 0x1.ffffff8000000p+776, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000007fff800p-430, -0x1.ffff800007fc0p-489, -0x1.0000007fff000p+851, -0x1.ffffff8000000p+776, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.4000000000000p-853, -0x1.0000000000000p-935, 0x1.0000001ff8040p+392, -0x1.fff0ffffff008p+336, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.4000000000000p-853, -0x1.0000000000000p-935, -0x1.0000001ff8040p+392, 0x1.fff0ffffff008p+336, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.4000000000000p-853, 0x1.0000000000000p-935, 0x1.0000001ff8040p+392, -0x1.fff0ffffff008p+336, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.4000000000000p-853, 0x1.0000000000000p-935, -0x1.0000001ff8040p+392, 0x1.fff0ffffff008p+336, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0004000000000p+80, -0x1.fffffffe40000p+9, 0x1.000001ffff1f0p+442, 0x1.ff807ffffc000p+388, 0x1.0003fdfff8e50p-362, -0x1.1b6c795bc3930p-416}, {0x1.0004000000000p+80, -0x1.fffffffe40000p+9, -0x1.000001ffff1f0p+442, -0x1.ff807ffffc000p+388, -0x1.0003fdfff8e50p-362, 0x1.1b6c795bc3930p-416}, {-0x1.0004000000000p+80, 0x1.fffffffe40000p+9, 0x1.000001ffff1f0p+442, 0x1.ff807ffffc000p+388, -0x1.0003fdfff8e50p-362, 0x1.1b6c795bc3930p-416}, {-0x1.0004000000000p+80, 0x1.fffffffe40000p+9, -0x1.000001ffff1f0p+442, -0x1.ff807ffffc000p+388, 0x1.0003fdfff8e50p-362, -0x1.1b6c795bc3930p-416}, {0x1.003fe00030100p-112, -0x1.00003fe002000p-178, 0x1.3ffffff800200p+913, -0x1.0000000000000p+836, 0x1.99ffccd759890p-1026, -0x0.0000000000000p+0}, {0x1.003fe00030100p-112, -0x1.00003fe002000p-178, -0x1.3ffffff800200p+913, 0x1.0000000000000p+836, -0x1.99ffccd759890p-1026, 0x0.0000000000000p+0}, {-0x1.003fe00030100p-112, 0x1.00003fe002000p-178, 0x1.3ffffff800200p+913, -0x1.0000000000000p+836, -0x1.99ffccd759890p-1026, 0x0.0000000000000p+0}, {-0x1.003fe00030100p-112, 0x1.00003fe002000p-178, -0x1.3ffffff800200p+913, 0x1.0000000000000p+836, 0x1.99ffccd759890p-1026, -0x0.0000000000000p+0}, {0x1.0001ffc1ffc20p+846, -0x1.fffffc0002000p+780, 0x1.000003fffffc0p-56, 0x1.fffffe0000000p-134, 0x1.0001fbc1f7d70p+902, -0x1.f5fb3830001ccp+848}, {0x1.0001ffc1ffc20p+846, -0x1.fffffc0002000p+780, -0x1.000003fffffc0p-56, -0x1.fffffe0000000p-134, -0x1.0001fbc1f7d70p+902, 0x1.f5fb3830001ccp+848}, {-0x1.0001ffc1ffc20p+846, 0x1.fffffc0002000p+780, 0x1.000003fffffc0p-56, 0x1.fffffe0000000p-134, -0x1.0001fbc1f7d70p+902, 0x1.f5fb3830001ccp+848}, {-0x1.0001ffc1ffc20p+846, 0x1.fffffc0002000p+780, -0x1.000003fffffc0p-56, -0x1.fffffe0000000p-134, 0x1.0001fbc1f7d70p+902, -0x1.f5fb3830001ccp+848}, {0x1.0400000000000p-92, -0x1.0000000000000p-146, 0x1.0000200000000p+893, -0x1.ffffffffffc40p+834, 0x1.03ffdf8004100p-985, -0x1.103fe00000000p-1039}, {0x1.0400000000000p-92, -0x1.0000000000000p-146, -0x1.0000200000000p+893, 0x1.ffffffffffc40p+834, -0x1.03ffdf8004100p-985, 0x1.103fe00000000p-1039}, {-0x1.0400000000000p-92, 0x1.0000000000000p-146, 0x1.0000200000000p+893, -0x1.ffffffffffc40p+834, -0x1.03ffdf8004100p-985, 0x1.103fe00000000p-1039}, {-0x1.0400000000000p-92, 0x1.0000000000000p-146, -0x1.0000200000000p+893, 0x1.ffffffffffc40p+834, 0x1.03ffdf8004100p-985, -0x1.103fe00000000p-1039}, {0x1.00003ff820000p-373, -0x1.ffffffe000100p-428, 0x1.0001f80020000p-217, -0x1.ffffffc1c0040p-276, 0x1.fffc8ff6c4929p-157, 0x1.c04a167bfc32cp-212}, {0x1.00003ff820000p-373, -0x1.ffffffe000100p-428, -0x1.0001f80020000p-217, 0x1.ffffffc1c0040p-276, -0x1.fffc8ff6c4929p-157, -0x1.c04a167bfc32cp-212}, {-0x1.00003ff820000p-373, 0x1.ffffffe000100p-428, 0x1.0001f80020000p-217, -0x1.ffffffc1c0040p-276, -0x1.fffc8ff6c4929p-157, -0x1.c04a167bfc32cp-212}, {-0x1.00003ff820000p-373, 0x1.ffffffe000100p-428, -0x1.0001f80020000p-217, 0x1.ffffffc1c0040p-276, 0x1.fffc8ff6c4929p-157, 0x1.c04a167bfc32cp-212}, {0x1.007ffffffff80p+570, 0x1.fffffffe00000p+496, 0x1.0100000000000p-172, -0x1.0000000000000p-249, 0x1.ff00ff00fef11p+741, -0x1.0ef00007f0190p+685}, {0x1.007ffffffff80p+570, 0x1.fffffffe00000p+496, -0x1.0100000000000p-172, 0x1.0000000000000p-249, -0x1.ff00ff00fef11p+741, 0x1.0ef00007f0190p+685}, {-0x1.007ffffffff80p+570, -0x1.fffffffe00000p+496, 0x1.0100000000000p-172, -0x1.0000000000000p-249, -0x1.ff00ff00fef11p+741, 0x1.0ef00007f0190p+685}, {-0x1.007ffffffff80p+570, -0x1.fffffffe00000p+496, -0x1.0100000000000p-172, 0x1.0000000000000p-249, 0x1.ff00ff00fef11p+741, -0x1.0ef00007f0190p+685}, {0x1.0000000400000p-622, -0x1.e00003fff8200p-684, 0x1.000ffff802000p-88, -0x1.fffe3fffffe00p-150, 0x1.ffe00217d982cp-535, -0x1.dbfb6b1d22926p-589}, {0x1.0000000400000p-622, -0x1.e00003fff8200p-684, -0x1.000ffff802000p-88, 0x1.fffe3fffffe00p-150, -0x1.ffe00217d982cp-535, 0x1.dbfb6b1d22926p-589}, {-0x1.0000000400000p-622, 0x1.e00003fff8200p-684, 0x1.000ffff802000p-88, -0x1.fffe3fffffe00p-150, -0x1.ffe00217d982cp-535, 0x1.dbfb6b1d22926p-589}, {-0x1.0000000400000p-622, 0x1.e00003fff8200p-684, -0x1.000ffff802000p-88, 0x1.fffe3fffffe00p-150, 0x1.ffe00217d982cp-535, -0x1.dbfb6b1d22926p-589}, {0x1.00003ffffff00p+633, 0x1.ffc003ffffe00p+578, 0x1.0001ff0000000p+629, 0x1.ff8007fffffe0p+574, 0x1.fffc8206f8541p+3, 0x1.944d561338738p-51}, {0x1.00003ffffff00p+633, 0x1.ffc003ffffe00p+578, -0x1.0001ff0000000p+629, -0x1.ff8007fffffe0p+574, -0x1.fffc8206f8541p+3, -0x1.944d561338738p-51}, {-0x1.00003ffffff00p+633, -0x1.ffc003ffffe00p+578, 0x1.0001ff0000000p+629, 0x1.ff8007fffffe0p+574, -0x1.fffc8206f8541p+3, -0x1.944d561338738p-51}, {-0x1.00003ffffff00p+633, -0x1.ffc003ffffe00p+578, -0x1.0001ff0000000p+629, -0x1.ff8007fffffe0p+574, 0x1.fffc8206f8541p+3, 0x1.944d561338738p-51}, {0x1.1000000000000p+920, -0x1.ff00000001000p+855, 0x1.0200000000000p-494, -0x1.c000000000008p-550, INFINITY, 0x0.0000000000000p+0}, {0x1.1000000000000p+920, -0x1.ff00000001000p+855, -0x1.0200000000000p-494, 0x1.c000000000008p-550, -INFINITY, 0x0.0000000000000p+0}, {-0x1.1000000000000p+920, 0x1.ff00000001000p+855, 0x1.0200000000000p-494, -0x1.c000000000008p-550, -INFINITY, 0x0.0000000000000p+0}, {-0x1.1000000000000p+920, 0x1.ff00000001000p+855, -0x1.0200000000000p-494, 0x1.c000000000008p-550, INFINITY, 0x0.0000000000000p+0}, {0x1.1fffffc000000p+266, 0x1.ffffffffffff0p+209, 0x1.007fc00000800p-488, -0x1.fffff03fff000p-548, 0x1.1f708f547908ep+754, 0x1.5692f64f2b738p+699}, {0x1.1fffffc000000p+266, 0x1.ffffffffffff0p+209, -0x1.007fc00000800p-488, 0x1.fffff03fff000p-548, -0x1.1f708f547908ep+754, -0x1.5692f64f2b738p+699}, {-0x1.1fffffc000000p+266, -0x1.ffffffffffff0p+209, 0x1.007fc00000800p-488, -0x1.fffff03fff000p-548, -0x1.1f708f547908ep+754, -0x1.5692f64f2b738p+699}, {-0x1.1fffffc000000p+266, -0x1.ffffffffffff0p+209, -0x1.007fc00000800p-488, 0x1.fffff03fff000p-548, 0x1.1f708f547908ep+754, 0x1.5692f64f2b738p+699}, {0x1.00007fffff000p+951, 0x1.ffffffff00000p+879, 0x1.1fffffffc0000p+24, 0x1.fff0000000000p-44, 0x1.c71d5555b8b13p+926, -0x1.2f9a266305f00p+869}, {0x1.00007fffff000p+951, 0x1.ffffffff00000p+879, -0x1.1fffffffc0000p+24, -0x1.fff0000000000p-44, -0x1.c71d5555b8b13p+926, 0x1.2f9a266305f00p+869}, {-0x1.00007fffff000p+951, -0x1.ffffffff00000p+879, 0x1.1fffffffc0000p+24, 0x1.fff0000000000p-44, -0x1.c71d5555b8b13p+926, 0x1.2f9a266305f00p+869}, {-0x1.00007fffff000p+951, -0x1.ffffffff00000p+879, -0x1.1fffffffc0000p+24, -0x1.fff0000000000p-44, 0x1.c71d5555b8b13p+926, -0x1.2f9a266305f00p+869}, {0x1.0003ffffffffcp+259, 0x1.f000000000000p+158, 0x1.0000003ffff80p+431, 0x1.fffffefff8000p+363, 0x1.0003ffbfff07dp-172, 0x1.00e05b827c740p-231}, {0x1.0003ffffffffcp+259, 0x1.f000000000000p+158, -0x1.0000003ffff80p+431, -0x1.fffffefff8000p+363, -0x1.0003ffbfff07dp-172, -0x1.00e05b827c740p-231}, {-0x1.0003ffffffffcp+259, -0x1.f000000000000p+158, 0x1.0000003ffff80p+431, 0x1.fffffefff8000p+363, -0x1.0003ffbfff07dp-172, -0x1.00e05b827c740p-231}, {-0x1.0003ffffffffcp+259, -0x1.f000000000000p+158, -0x1.0000003ffff80p+431, -0x1.fffffefff8000p+363, 0x1.0003ffbfff07dp-172, 0x1.00e05b827c740p-231}, {0x1.00007ffc00000p-308, 0x1.ffffe00000000p-377, 0x1.3fffffc004000p+942, -0x1.ffffe00010000p+878, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00007ffc00000p-308, 0x1.ffffe00000000p-377, -0x1.3fffffc004000p+942, 0x1.ffffe00010000p+878, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00007ffc00000p-308, -0x1.ffffe00000000p-377, 0x1.3fffffc004000p+942, -0x1.ffffe00010000p+878, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00007ffc00000p-308, -0x1.ffffe00000000p-377, -0x1.3fffffc004000p+942, 0x1.ffffe00010000p+878, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0007ffffc0004p+198, -0x1.fffffe0040000p+127, 0x1.00ffffe000400p-503, -0x1.0000000000000p-595, 0x1.fe11ee50f0cdfp+700, 0x1.eab4ac047c964p+646}, {0x1.0007ffffc0004p+198, -0x1.fffffe0040000p+127, -0x1.00ffffe000400p-503, 0x1.0000000000000p-595, -0x1.fe11ee50f0cdfp+700, -0x1.eab4ac047c964p+646}, {-0x1.0007ffffc0004p+198, 0x1.fffffe0040000p+127, 0x1.00ffffe000400p-503, -0x1.0000000000000p-595, -0x1.fe11ee50f0cdfp+700, -0x1.eab4ac047c964p+646}, {-0x1.0007ffffc0004p+198, 0x1.fffffe0040000p+127, -0x1.00ffffe000400p-503, 0x1.0000000000000p-595, 0x1.fe11ee50f0cdfp+700, 0x1.eab4ac047c964p+646}, {0x1.007ffffffff00p+38, 0x1.fff8003000000p-39, 0x1.01fffffffe000p-764, 0x1.fffc000000000p-852, 0x1.fd05f417d431bp+801, -0x1.da3f8ecab4cb2p+747}, {0x1.007ffffffff00p+38, 0x1.fff8003000000p-39, -0x1.01fffffffe000p-764, -0x1.fffc000000000p-852, -0x1.fd05f417d431bp+801, 0x1.da3f8ecab4cb2p+747}, {-0x1.007ffffffff00p+38, -0x1.fff8003000000p-39, 0x1.01fffffffe000p-764, 0x1.fffc000000000p-852, -0x1.fd05f417d431bp+801, 0x1.da3f8ecab4cb2p+747}, {-0x1.007ffffffff00p+38, -0x1.fff8003000000p-39, -0x1.01fffffffe000p-764, -0x1.fffc000000000p-852, 0x1.fd05f417d431bp+801, -0x1.da3f8ecab4cb2p+747}, {0x1.00003e0000000p+844, 0x1.ffffffffe0000p+785, 0x1.07ffffff80000p+555, 0x1.8007ffffc0000p+484, 0x1.f07c9746c22cep+288, 0x1.3edfd2a2574e4p+234}, {0x1.00003e0000000p+844, 0x1.ffffffffe0000p+785, -0x1.07ffffff80000p+555, -0x1.8007ffffc0000p+484, -0x1.f07c9746c22cep+288, -0x1.3edfd2a2574e4p+234}, {-0x1.00003e0000000p+844, -0x1.ffffffffe0000p+785, 0x1.07ffffff80000p+555, 0x1.8007ffffc0000p+484, -0x1.f07c9746c22cep+288, -0x1.3edfd2a2574e4p+234}, {-0x1.00003e0000000p+844, -0x1.ffffffffe0000p+785, -0x1.07ffffff80000p+555, -0x1.8007ffffc0000p+484, 0x1.f07c9746c22cep+288, 0x1.3edfd2a2574e4p+234}, {0x1.00003ff810000p+183, -0x1.fffffffc00800p+119, 0x1.00000ffff8002p+532, -0x1.fffffffe04000p+465, 0x1.00002ff815006p-349, 0x1.6fa53168c6300p-408}, {0x1.00003ff810000p+183, -0x1.fffffffc00800p+119, -0x1.00000ffff8002p+532, 0x1.fffffffe04000p+465, -0x1.00002ff815006p-349, -0x1.6fa53168c6300p-408}, {-0x1.00003ff810000p+183, 0x1.fffffffc00800p+119, 0x1.00000ffff8002p+532, -0x1.fffffffe04000p+465, -0x1.00002ff815006p-349, -0x1.6fa53168c6300p-408}, {-0x1.00003ff810000p+183, 0x1.fffffffc00800p+119, -0x1.00000ffff8002p+532, 0x1.fffffffe04000p+465, 0x1.00002ff815006p-349, 0x1.6fa53168c6300p-408}, {0x1.0100000000000p-963, -0x1.0000000000000p-1050, 0x1.01ffffff00004p+35, -0x1.0000000000000p-55, 0x1.fe03f811da4eep-999, -0x1.4936800000000p-1053}, {0x1.0100000000000p-963, -0x1.0000000000000p-1050, -0x1.01ffffff00004p+35, 0x1.0000000000000p-55, -0x1.fe03f811da4eep-999, 0x1.4936800000000p-1053}, {-0x1.0100000000000p-963, 0x1.0000000000000p-1050, 0x1.01ffffff00004p+35, -0x1.0000000000000p-55, -0x1.fe03f811da4eep-999, 0x1.4936800000000p-1053}, {-0x1.0100000000000p-963, 0x1.0000000000000p-1050, -0x1.01ffffff00004p+35, 0x1.0000000000000p-55, 0x1.fe03f811da4eep-999, -0x1.4936800000000p-1053}, {0x1.001fffffff800p+716, 0x1.fffff00000000p+636, 0x1.07ffe00001000p-16, -0x1.c7ffc001fe010p-73, 0x1.f0ba6ac140645p+731, -0x1.85bb11db4ee88p+676}, {0x1.001fffffff800p+716, 0x1.fffff00000000p+636, -0x1.07ffe00001000p-16, 0x1.c7ffc001fe010p-73, -0x1.f0ba6ac140645p+731, 0x1.85bb11db4ee88p+676}, {-0x1.001fffffff800p+716, -0x1.fffff00000000p+636, 0x1.07ffe00001000p-16, -0x1.c7ffc001fe010p-73, -0x1.f0ba6ac140645p+731, 0x1.85bb11db4ee88p+676}, {-0x1.001fffffff800p+716, -0x1.fffff00000000p+636, -0x1.07ffe00001000p-16, 0x1.c7ffc001fe010p-73, 0x1.f0ba6ac140645p+731, -0x1.85bb11db4ee88p+676}, {0x1.000000ffffff8p+223, 0x1.ffe0000000000p+151, 0x1.1fffffff00001p+902, -0x1.0000000000000p+817, 0x1.c71c738fcd6dap-680, 0x1.62af33c1d8a00p-735}, {0x1.000000ffffff8p+223, 0x1.ffe0000000000p+151, -0x1.1fffffff00001p+902, 0x1.0000000000000p+817, -0x1.c71c738fcd6dap-680, -0x1.62af33c1d8a00p-735}, {-0x1.000000ffffff8p+223, -0x1.ffe0000000000p+151, 0x1.1fffffff00001p+902, -0x1.0000000000000p+817, -0x1.c71c738fcd6dap-680, -0x1.62af33c1d8a00p-735}, {-0x1.000000ffffff8p+223, -0x1.ffe0000000000p+151, -0x1.1fffffff00001p+902, 0x1.0000000000000p+817, 0x1.c71c738fcd6dap-680, 0x1.62af33c1d8a00p-735}, {0x1.00000007fff00p+641, 0x1.fffc1ffff87f0p+585, 0x1.0000007c00000p+146, 0x1.fff0000000000p+75, 0x1.ffffff17ffe07p+494, 0x1.17ffe1f85d360p+440}, {0x1.00000007fff00p+641, 0x1.fffc1ffff87f0p+585, -0x1.0000007c00000p+146, -0x1.fff0000000000p+75, -0x1.ffffff17ffe07p+494, -0x1.17ffe1f85d360p+440}, {-0x1.00000007fff00p+641, -0x1.fffc1ffff87f0p+585, 0x1.0000007c00000p+146, 0x1.fff0000000000p+75, -0x1.ffffff17ffe07p+494, -0x1.17ffe1f85d360p+440}, {-0x1.00000007fff00p+641, -0x1.fffc1ffff87f0p+585, -0x1.0000007c00000p+146, -0x1.fff0000000000p+75, 0x1.ffffff17ffe07p+494, 0x1.17ffe1f85d360p+440}, {0x1.fffffffe00000p+119, 0x1.e000001fff800p+55, 0x1.0000000000000p+792, -0x1.f000080000000p+707, 0x1.fffffffe00000p-673, 0x1.e0001f2000000p-737}, {0x1.fffffffe00000p+119, 0x1.e000001fff800p+55, -0x1.0000000000000p+792, 0x1.f000080000000p+707, -0x1.fffffffe00000p-673, -0x1.e0001f2000000p-737}, {-0x1.fffffffe00000p+119, -0x1.e000001fff800p+55, 0x1.0000000000000p+792, -0x1.f000080000000p+707, -0x1.fffffffe00000p-673, -0x1.e0001f2000000p-737}, {-0x1.fffffffe00000p+119, -0x1.e000001fff800p+55, -0x1.0000000000000p+792, 0x1.f000080000000p+707, 0x1.fffffffe00000p-673, 0x1.e0001f2000000p-737}, {0x1.00007fffffe00p-629, 0x1.ffffff8000000p-699, 0x1.001f03f07ff00p-553, 0x1.ffffff8000000p-626, 0x1.ffc2ff82ff538p-77, -0x1.3d82a9119b388p-132}, {0x1.00007fffffe00p-629, 0x1.ffffff8000000p-699, -0x1.001f03f07ff00p-553, -0x1.ffffff8000000p-626, -0x1.ffc2ff82ff538p-77, 0x1.3d82a9119b388p-132}, {-0x1.00007fffffe00p-629, -0x1.ffffff8000000p-699, 0x1.001f03f07ff00p-553, 0x1.ffffff8000000p-626, -0x1.ffc2ff82ff538p-77, 0x1.3d82a9119b388p-132}, {-0x1.00007fffffe00p-629, -0x1.ffffff8000000p-699, -0x1.001f03f07ff00p-553, -0x1.ffffff8000000p-626, 0x1.ffc2ff82ff538p-77, -0x1.3d82a9119b388p-132}, {0x1.00003fffffffcp-120, 0x1.ffe0000700000p-193, 0x1.001f000000040p-170, 0x1.ffc0ffffc0000p-241, 0x1.ffc287719935fp+49, 0x1.b6b0fe47ab6b8p-6}, {0x1.00003fffffffcp-120, 0x1.ffe0000700000p-193, -0x1.001f000000040p-170, -0x1.ffc0ffffc0000p-241, -0x1.ffc287719935fp+49, -0x1.b6b0fe47ab6b8p-6}, {-0x1.00003fffffffcp-120, -0x1.ffe0000700000p-193, 0x1.001f000000040p-170, 0x1.ffc0ffffc0000p-241, -0x1.ffc287719935fp+49, -0x1.b6b0fe47ab6b8p-6}, {-0x1.00003fffffffcp-120, -0x1.ffe0000700000p-193, -0x1.001f000000040p-170, -0x1.ffc0ffffc0000p-241, 0x1.ffc287719935fp+49, 0x1.b6b0fe47ab6b8p-6}, {0x1.0000100000000p+396, -0x1.0000000000000p+314, 0x1.0000020000000p-778, -0x1.0000000000000p-870, INFINITY, 0x0.0000000000000p+0}, {0x1.0000100000000p+396, -0x1.0000000000000p+314, -0x1.0000020000000p-778, 0x1.0000000000000p-870, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000100000000p+396, 0x1.0000000000000p+314, 0x1.0000020000000p-778, -0x1.0000000000000p-870, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000100000000p+396, 0x1.0000000000000p+314, -0x1.0000020000000p-778, 0x1.0000000000000p-870, INFINITY, 0x0.0000000000000p+0}, {0x1.000007c000000p-728, 0x1.fff8000000000p-784, 0x1.003fff0000200p-354, -0x1.fe0003fc00040p-413, 0x1.ff8031732328cp-375, -0x1.49885abdce908p-430}, {0x1.000007c000000p-728, 0x1.fff8000000000p-784, -0x1.003fff0000200p-354, 0x1.fe0003fc00040p-413, -0x1.ff8031732328cp-375, 0x1.49885abdce908p-430}, {-0x1.000007c000000p-728, -0x1.fff8000000000p-784, 0x1.003fff0000200p-354, -0x1.fe0003fc00040p-413, -0x1.ff8031732328cp-375, 0x1.49885abdce908p-430}, {-0x1.000007c000000p-728, -0x1.fff8000000000p-784, -0x1.003fff0000200p-354, 0x1.fe0003fc00040p-413, 0x1.ff8031732328cp-375, -0x1.49885abdce908p-430}, {0x1.00001fffcffc0p-216, -0x1.fffe000000004p-271, 0x1.03fffff800000p+515, 0x1.fffffe0000000p+447, 0x1.f81fc10b34257p-732, -0x1.5454259251f24p-786}, {0x1.00001fffcffc0p-216, -0x1.fffe000000004p-271, -0x1.03fffff800000p+515, -0x1.fffffe0000000p+447, -0x1.f81fc10b34257p-732, 0x1.5454259251f24p-786}, {-0x1.00001fffcffc0p-216, 0x1.fffe000000004p-271, 0x1.03fffff800000p+515, 0x1.fffffe0000000p+447, -0x1.f81fc10b34257p-732, 0x1.5454259251f24p-786}, {-0x1.00001fffcffc0p-216, 0x1.fffe000000004p-271, -0x1.03fffff800000p+515, -0x1.fffffe0000000p+447, 0x1.f81fc10b34257p-732, -0x1.5454259251f24p-786}, {0x1.0000008000000p-347, -0x1.ffffff8200000p-404, 0x1.000fff8000000p+341, 0x1.fffffe0000000p+279, 0x1.ffe003ffb0070p-689, -0x1.53e881ead4d3cp-744}, {0x1.0000008000000p-347, -0x1.ffffff8200000p-404, -0x1.000fff8000000p+341, -0x1.fffffe0000000p+279, -0x1.ffe003ffb0070p-689, 0x1.53e881ead4d3cp-744}, {-0x1.0000008000000p-347, 0x1.ffffff8200000p-404, 0x1.000fff8000000p+341, 0x1.fffffe0000000p+279, -0x1.ffe003ffb0070p-689, 0x1.53e881ead4d3cp-744}, {-0x1.0000008000000p-347, 0x1.ffffff8200000p-404, -0x1.000fff8000000p+341, -0x1.fffffe0000000p+279, 0x1.ffe003ffb0070p-689, -0x1.53e881ead4d3cp-744}, {0x1.00000010001f8p-866, 0x1.fffc007e00000p-940, 0x1.0003fc0000000p+17, 0x1.ffff80ffffc00p-40, 0x1.fff8083fbf610p-884, -0x1.0ce0e337685c0p-941}, {0x1.00000010001f8p-866, 0x1.fffc007e00000p-940, -0x1.0003fc0000000p+17, -0x1.ffff80ffffc00p-40, -0x1.fff8083fbf610p-884, 0x1.0ce0e337685c0p-941}, {-0x1.00000010001f8p-866, -0x1.fffc007e00000p-940, 0x1.0003fc0000000p+17, 0x1.ffff80ffffc00p-40, -0x1.fff8083fbf610p-884, 0x1.0ce0e337685c0p-941}, {-0x1.00000010001f8p-866, -0x1.fffc007e00000p-940, -0x1.0003fc0000000p+17, -0x1.ffff80ffffc00p-40, 0x1.fff8083fbf610p-884, -0x1.0ce0e337685c0p-941}, {0x1.0000000000000p-406, -0x1.0000000000000p-501, 0x1.0300000001f00p+916, 0x1.fffffff800000p+840, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.0000000000000p-406, -0x1.0000000000000p-501, -0x1.0300000001f00p+916, -0x1.fffffff800000p+840, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000000000p-406, 0x1.0000000000000p-501, 0x1.0300000001f00p+916, 0x1.fffffff800000p+840, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.0000000000000p-406, 0x1.0000000000000p-501, -0x1.0300000001f00p+916, -0x1.fffffff800000p+840, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.07ffffff1fe00p-512, 0x1.fc00000000000p-609, 0x1.0040000000000p-704, -0x1.c000000400000p-765, 0x1.07be107b011fcp+192, -0x1.f7e6ed0b063d2p+138}, {0x1.07ffffff1fe00p-512, 0x1.fc00000000000p-609, -0x1.0040000000000p-704, 0x1.c000000400000p-765, -0x1.07be107b011fcp+192, 0x1.f7e6ed0b063d2p+138}, {-0x1.07ffffff1fe00p-512, -0x1.fc00000000000p-609, 0x1.0040000000000p-704, -0x1.c000000400000p-765, -0x1.07be107b011fcp+192, 0x1.f7e6ed0b063d2p+138}, {-0x1.07ffffff1fe00p-512, -0x1.fc00000000000p-609, -0x1.0040000000000p-704, 0x1.c000000400000p-765, 0x1.07be107b011fcp+192, -0x1.f7e6ed0b063d2p+138}, {0x1.0080000000000p+198, -0x1.0000000000000p+93, 0x1.fffff1ff80000p-814, 0x1.ffffc000fe000p-869, 0x1.00800703c0512p+1011, -0x1.7f7600e4b93c0p+957}, {0x1.0080000000000p+198, -0x1.0000000000000p+93, -0x1.fffff1ff80000p-814, -0x1.ffffc000fe000p-869, -0x1.00800703c0512p+1011, 0x1.7f7600e4b93c0p+957}, {-0x1.0080000000000p+198, 0x1.0000000000000p+93, 0x1.fffff1ff80000p-814, 0x1.ffffc000fe000p-869, -0x1.00800703c0512p+1011, 0x1.7f7600e4b93c0p+957}, {-0x1.0080000000000p+198, 0x1.0000000000000p+93, -0x1.fffff1ff80000p-814, -0x1.ffffc000fe000p-869, 0x1.00800703c0512p+1011, -0x1.7f7600e4b93c0p+957}, {0x1.0400000000000p+566, -0x1.0000000000000p+461, 0x1.7fffe00000008p+712, -0x1.e000080000000p+632, 0x1.5aaac78e3b4b6p-147, 0x1.ae0183122f590p-201}, {0x1.0400000000000p+566, -0x1.0000000000000p+461, -0x1.7fffe00000008p+712, 0x1.e000080000000p+632, -0x1.5aaac78e3b4b6p-147, -0x1.ae0183122f590p-201}, {-0x1.0400000000000p+566, 0x1.0000000000000p+461, 0x1.7fffe00000008p+712, -0x1.e000080000000p+632, -0x1.5aaac78e3b4b6p-147, -0x1.ae0183122f590p-201}, {-0x1.0400000000000p+566, 0x1.0000000000000p+461, -0x1.7fffe00000008p+712, 0x1.e000080000000p+632, 0x1.5aaac78e3b4b6p-147, 0x1.ae0183122f590p-201}, {0x1.000001d000000p-530, -0x1.ff80000200000p-585, 0x1.0000003fffffcp+783, 0x1.feffff8000000p+703, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.000001d000000p-530, -0x1.ff80000200000p-585, -0x1.0000003fffffcp+783, -0x1.feffff8000000p+703, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.000001d000000p-530, 0x1.ff80000200000p-585, 0x1.0000003fffffcp+783, 0x1.feffff8000000p+703, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.000001d000000p-530, 0x1.ff80000200000p-585, -0x1.0000003fffffcp+783, -0x1.feffff8000000p+703, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.001ffffffffc0p+355, 0x1.fffffff03ff00p+294, 0x1.0000010000000p-724, -0x1.fffffff810000p-793, INFINITY, 0x0.0000000000000p+0}, {0x1.001ffffffffc0p+355, 0x1.fffffff03ff00p+294, -0x1.0000010000000p-724, 0x1.fffffff810000p-793, -INFINITY, 0x0.0000000000000p+0}, {-0x1.001ffffffffc0p+355, -0x1.fffffff03ff00p+294, 0x1.0000010000000p-724, -0x1.fffffff810000p-793, -INFINITY, 0x0.0000000000000p+0}, {-0x1.001ffffffffc0p+355, -0x1.fffffff03ff00p+294, -0x1.0000010000000p-724, 0x1.fffffff810000p-793, INFINITY, 0x0.0000000000000p+0}, {0x1.00000fffc0001p+277, -0x1.fc000007e0040p+218, 0x1.000007fffffc0p+726, 0x1.fc0003fc00000p+666, 0x1.000007ffbfc41p-449, 0x1.a2bf70aa60b60p-505}, {0x1.00000fffc0001p+277, -0x1.fc000007e0040p+218, -0x1.000007fffffc0p+726, -0x1.fc0003fc00000p+666, -0x1.000007ffbfc41p-449, -0x1.a2bf70aa60b60p-505}, {-0x1.00000fffc0001p+277, 0x1.fc000007e0040p+218, 0x1.000007fffffc0p+726, 0x1.fc0003fc00000p+666, -0x1.000007ffbfc41p-449, -0x1.a2bf70aa60b60p-505}, {-0x1.00000fffc0001p+277, 0x1.fc000007e0040p+218, -0x1.000007fffffc0p+726, -0x1.fc0003fc00000p+666, 0x1.000007ffbfc41p-449, 0x1.a2bf70aa60b60p-505}, {0x1.01ffe000003fep-455, 0x1.ffffff8000000p-521, 0x1.00fffffe00000p-662, 0x1.ffffffe7ff800p-723, 0x1.00fee120e15c4p+207, 0x1.7b11a0fd9d316p+153}, {0x1.01ffe000003fep-455, 0x1.ffffff8000000p-521, -0x1.00fffffe00000p-662, -0x1.ffffffe7ff800p-723, -0x1.00fee120e15c4p+207, -0x1.7b11a0fd9d316p+153}, {-0x1.01ffe000003fep-455, -0x1.ffffff8000000p-521, 0x1.00fffffe00000p-662, 0x1.ffffffe7ff800p-723, -0x1.00fee120e15c4p+207, -0x1.7b11a0fd9d316p+153}, {-0x1.01ffe000003fep-455, -0x1.ffffff8000000p-521, -0x1.00fffffe00000p-662, -0x1.ffffffe7ff800p-723, 0x1.00fee120e15c4p+207, 0x1.7b11a0fd9d316p+153}, {0x1.3fffffffffc00p+478, 0x1.ffffffe000000p+415, 0x1.07c0ffc200000p+108, -0x1.e000003bfffe0p+50, 0x1.3697b20f8de20p+370, -0x1.388b9803adee0p+316}, {0x1.3fffffffffc00p+478, 0x1.ffffffe000000p+415, -0x1.07c0ffc200000p+108, 0x1.e000003bfffe0p+50, -0x1.3697b20f8de20p+370, 0x1.388b9803adee0p+316}, {-0x1.3fffffffffc00p+478, -0x1.ffffffe000000p+415, 0x1.07c0ffc200000p+108, -0x1.e000003bfffe0p+50, -0x1.3697b20f8de20p+370, 0x1.388b9803adee0p+316}, {-0x1.3fffffffffc00p+478, -0x1.ffffffe000000p+415, -0x1.07c0ffc200000p+108, 0x1.e000003bfffe0p+50, 0x1.3697b20f8de20p+370, -0x1.388b9803adee0p+316}, {0x1.0000001800000p+405, 0x1.fffffc0000200p+351, 0x1.0000004000000p-957, -0x1.fff0000004000p-1024, INFINITY, 0x0.0000000000000p+0}, {0x1.0000001800000p+405, 0x1.fffffc0000200p+351, -0x1.0000004000000p-957, 0x1.fff0000004000p-1024, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000001800000p+405, -0x1.fffffc0000200p+351, 0x1.0000004000000p-957, -0x1.fff0000004000p-1024, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000001800000p+405, -0x1.fffffc0000200p+351, -0x1.0000004000000p-957, 0x1.fff0000004000p-1024, INFINITY, 0x0.0000000000000p+0}, {0x1.0000800000000p+271, -0x1.0000000000000p+208, 0x1.0fc007c004000p-537, -0x1.fffe100000000p-601, 0x1.e2544251693b5p+807, 0x1.bf6c5bc03d0b8p+751}, {0x1.0000800000000p+271, -0x1.0000000000000p+208, -0x1.0fc007c004000p-537, 0x1.fffe100000000p-601, -0x1.e2544251693b5p+807, -0x1.bf6c5bc03d0b8p+751}, {-0x1.0000800000000p+271, 0x1.0000000000000p+208, 0x1.0fc007c004000p-537, -0x1.fffe100000000p-601, -0x1.e2544251693b5p+807, -0x1.bf6c5bc03d0b8p+751}, {-0x1.0000800000000p+271, 0x1.0000000000000p+208, -0x1.0fc007c004000p-537, 0x1.fffe100000000p-601, 0x1.e2544251693b5p+807, 0x1.bf6c5bc03d0b8p+751}, {0x1.00007fffffe00p-85, 0x1.ffffffc003f00p-146, 0x1.0080000000000p-834, -0x1.0000000000000p-892, 0x1.ff017f405f904p+748, -0x1.df2057e109728p+694}, {0x1.00007fffffe00p-85, 0x1.ffffffc003f00p-146, -0x1.0080000000000p-834, 0x1.0000000000000p-892, -0x1.ff017f405f904p+748, 0x1.df2057e109728p+694}, {-0x1.00007fffffe00p-85, -0x1.ffffffc003f00p-146, 0x1.0080000000000p-834, -0x1.0000000000000p-892, -0x1.ff017f405f904p+748, 0x1.df2057e109728p+694}, {-0x1.00007fffffe00p-85, -0x1.ffffffc003f00p-146, -0x1.0080000000000p-834, 0x1.0000000000000p-892, 0x1.ff017f405f904p+748, -0x1.df2057e109728p+694}, {0x1.0000200000000p-779, -0x1.0000000000000p-835, 0x1.00000ffffff80p-484, 0x1.ffffff0007ff8p-540, 0x1.00000fffff080p-295, -0x1.77fff803e38b4p-350}, {0x1.0000200000000p-779, -0x1.0000000000000p-835, -0x1.00000ffffff80p-484, -0x1.ffffff0007ff8p-540, -0x1.00000fffff080p-295, 0x1.77fff803e38b4p-350}, {-0x1.0000200000000p-779, 0x1.0000000000000p-835, 0x1.00000ffffff80p-484, 0x1.ffffff0007ff8p-540, -0x1.00000fffff080p-295, 0x1.77fff803e38b4p-350}, {-0x1.0000200000000p-779, 0x1.0000000000000p-835, -0x1.00000ffffff80p-484, -0x1.ffffff0007ff8p-540, 0x1.00000fffff080p-295, -0x1.77fff803e38b4p-350}, {0x1.00fe000000000p-622, 0x1.001ffffff0000p-691, 0x1.00007fffff000p+682, 0x0.0000000000000p+0, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.00fe000000000p-622, 0x1.001ffffff0000p-691, -0x1.00007fffff000p+682, 0x0.0000000000000p+0, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00fe000000000p-622, -0x1.001ffffff0000p-691, 0x1.00007fffff000p+682, 0x0.0000000000000p+0, -0x0.0000000000000p+0, -0x0.0000000000000p+0}, {-0x1.00fe000000000p-622, -0x1.001ffffff0000p-691, -0x1.00007fffff000p+682, 0x0.0000000000000p+0, 0x0.0000000000000p+0, 0x0.0000000000000p+0}, {0x1.01e0000000002p+213, -0x1.fffffffffc200p+154, 0x1.0000080000000p-358, -0x1.0000000000000p-463, 0x1.01dff7f100409p+571, 0x1.ef7ed084099b0p+517}, {0x1.01e0000000002p+213, -0x1.fffffffffc200p+154, -0x1.0000080000000p-358, 0x1.0000000000000p-463, -0x1.01dff7f100409p+571, -0x1.ef7ed084099b0p+517}, {-0x1.01e0000000002p+213, 0x1.fffffffffc200p+154, 0x1.0000080000000p-358, -0x1.0000000000000p-463, -0x1.01dff7f100409p+571, -0x1.ef7ed084099b0p+517}, {-0x1.01e0000000002p+213, 0x1.fffffffffc200p+154, -0x1.0000080000000p-358, 0x1.0000000000000p-463, 0x1.01dff7f100409p+571, 0x1.ef7ed084099b0p+517}, {0x1.000000f1fe001p+66, -0x1.0000000000000p-17, 0x1.00003fffffff0p-433, 0x1.fc00000000000p-510, 0x1.ffff81e41b892p+498, -0x1.b8b120ccd3920p+444}, {0x1.000000f1fe001p+66, -0x1.0000000000000p-17, -0x1.00003fffffff0p-433, -0x1.fc00000000000p-510, -0x1.ffff81e41b892p+498, 0x1.b8b120ccd3920p+444}, {-0x1.000000f1fe001p+66, 0x1.0000000000000p-17, 0x1.00003fffffff0p-433, 0x1.fc00000000000p-510, -0x1.ffff81e41b892p+498, 0x1.b8b120ccd3920p+444}, {-0x1.000000f1fe001p+66, 0x1.0000000000000p-17, -0x1.00003fffffff0p-433, -0x1.fc00000000000p-510, 0x1.ffff81e41b892p+498, -0x1.b8b120ccd3920p+444}, {0x1.0008000000010p+115, -0x1.f8000ffff9000p+50, 0x1.00001ffff0000p-192, 0x1.ffff80001f000p-249, 0x1.0007dfff1401ap+307, -0x1.60516bf0b366cp+253}, {0x1.0008000000010p+115, -0x1.f8000ffff9000p+50, -0x1.00001ffff0000p-192, -0x1.ffff80001f000p-249, -0x1.0007dfff1401ap+307, 0x1.60516bf0b366cp+253}, {-0x1.0008000000010p+115, 0x1.f8000ffff9000p+50, 0x1.00001ffff0000p-192, 0x1.ffff80001f000p-249, -0x1.0007dfff1401ap+307, 0x1.60516bf0b366cp+253}, {-0x1.0008000000010p+115, 0x1.f8000ffff9000p+50, -0x1.00001ffff0000p-192, -0x1.ffff80001f000p-249, 0x1.0007dfff1401ap+307, -0x1.60516bf0b366cp+253}, {0x1.0000100000000p-13, -0x1.0000000000000p-118, 0x1.0038000800000p+253, -0x1.fffffe0000080p+193, 0x1.ff903863adb04p-267, -0x1.6b2c09860d9d8p-323}, {0x1.0000100000000p-13, -0x1.0000000000000p-118, -0x1.0038000800000p+253, 0x1.fffffe0000080p+193, -0x1.ff903863adb04p-267, 0x1.6b2c09860d9d8p-323}, {-0x1.0000100000000p-13, 0x1.0000000000000p-118, 0x1.0038000800000p+253, -0x1.fffffe0000080p+193, -0x1.ff903863adb04p-267, 0x1.6b2c09860d9d8p-323}, {-0x1.0000100000000p-13, 0x1.0000000000000p-118, -0x1.0038000800000p+253, 0x1.fffffe0000080p+193, 0x1.ff903863adb04p-267, -0x1.6b2c09860d9d8p-323}, {0x1.00003fe008000p-845, -0x1.fffdff0000080p-904, 0x1.ffffffffff800p+109, 0x1.fe00000000000p+11, 0x1.00003fe008400p-955, -0x1.803dee8002680p-1014}, {0x1.00003fe008000p-845, -0x1.fffdff0000080p-904, -0x1.ffffffffff800p+109, -0x1.fe00000000000p+11, -0x1.00003fe008400p-955, 0x1.803dee8002680p-1014}, {-0x1.00003fe008000p-845, 0x1.fffdff0000080p-904, 0x1.ffffffffff800p+109, 0x1.fe00000000000p+11, -0x1.00003fe008400p-955, 0x1.803dee8002680p-1014}, {-0x1.00003fe008000p-845, 0x1.fffdff0000080p-904, -0x1.ffffffffff800p+109, -0x1.fe00000000000p+11, 0x1.00003fe008400p-955, -0x1.803dee8002680p-1014}, {0x1.1fffffff00000p-151, 0x1.ffffff8000000p-223, 0x1.0000100000000p-443, -0x1.0000000000000p-537, 0x1.1fffedff01201p+292, -0x1.1fefee00c1200p+232}, {0x1.1fffffff00000p-151, 0x1.ffffff8000000p-223, -0x1.0000100000000p-443, 0x1.0000000000000p-537, -0x1.1fffedff01201p+292, 0x1.1fefee00c1200p+232}, {-0x1.1fffffff00000p-151, -0x1.ffffff8000000p-223, 0x1.0000100000000p-443, -0x1.0000000000000p-537, -0x1.1fffedff01201p+292, 0x1.1fefee00c1200p+232}, {-0x1.1fffffff00000p-151, -0x1.ffffff8000000p-223, -0x1.0000100000000p-443, 0x1.0000000000000p-537, 0x1.1fffedff01201p+292, -0x1.1fefee00c1200p+232}, {0x1.0ffffc0000010p-901, 0x1.f000000ff0000p-970, 0x1.00003ff002010p-855, -0x1.0000020000000p-920, 0x1.0fffb8110fd73p-46, -0x1.2a08548118244p-101}, {0x1.0ffffc0000010p-901, 0x1.f000000ff0000p-970, -0x1.00003ff002010p-855, 0x1.0000020000000p-920, -0x1.0fffb8110fd73p-46, 0x1.2a08548118244p-101}, {-0x1.0ffffc0000010p-901, -0x1.f000000ff0000p-970, 0x1.00003ff002010p-855, -0x1.0000020000000p-920, -0x1.0fffb8110fd73p-46, 0x1.2a08548118244p-101}, {-0x1.0ffffc0000010p-901, -0x1.f000000ff0000p-970, -0x1.00003ff002010p-855, 0x1.0000020000000p-920, 0x1.0fffb8110fd73p-46, -0x1.2a08548118244p-101}, {0x1.00ffffffc0000p+149, 0x1.fffffe00003f0p+94, 0x1.1fffffffff020p-235, -0x1.ffff000400000p-310, 0x1.c8e38e38735a1p+383, 0x1.ba7818263c098p+329}, {0x1.00ffffffc0000p+149, 0x1.fffffe00003f0p+94, -0x1.1fffffffff020p-235, 0x1.ffff000400000p-310, -0x1.c8e38e38735a1p+383, -0x1.ba7818263c098p+329}, {-0x1.00ffffffc0000p+149, -0x1.fffffe00003f0p+94, 0x1.1fffffffff020p-235, -0x1.ffff000400000p-310, -0x1.c8e38e38735a1p+383, -0x1.ba7818263c098p+329}, {-0x1.00ffffffc0000p+149, -0x1.fffffe00003f0p+94, -0x1.1fffffffff020p-235, 0x1.ffff000400000p-310, 0x1.c8e38e38735a1p+383, 0x1.ba7818263c098p+329}, {0x1.0200000000000p+564, -0x1.0000000000000p+511, 0x1.0000700000000p-366, 0x1.ffffffe000000p-437, 0x1.01ff8f203161ep+930, 0x1.329475dfee4e0p+875}, {0x1.0200000000000p+564, -0x1.0000000000000p+511, -0x1.0000700000000p-366, -0x1.ffffffe000000p-437, -0x1.01ff8f203161ep+930, -0x1.329475dfee4e0p+875}, {-0x1.0200000000000p+564, 0x1.0000000000000p+511, 0x1.0000700000000p-366, 0x1.ffffffe000000p-437, -0x1.01ff8f203161ep+930, -0x1.329475dfee4e0p+875}, {-0x1.0200000000000p+564, 0x1.0000000000000p+511, -0x1.0000700000000p-366, -0x1.ffffffe000000p-437, 0x1.01ff8f203161ep+930, 0x1.329475dfee4e0p+875}, {0x1.3fffffc0001fcp+882, 0x1.007fffff00000p+819, 0x1.007fffff80000p-564, 0x1.fffffffe00000p-632, INFINITY, 0x0.0000000000000p+0}, {0x1.3fffffc0001fcp+882, 0x1.007fffff00000p+819, -0x1.007fffff80000p-564, -0x1.fffffffe00000p-632, -INFINITY, 0x0.0000000000000p+0}, {-0x1.3fffffc0001fcp+882, -0x1.007fffff00000p+819, 0x1.007fffff80000p-564, 0x1.fffffffe00000p-632, -INFINITY, 0x0.0000000000000p+0}, {-0x1.3fffffc0001fcp+882, -0x1.007fffff00000p+819, -0x1.007fffff80000p-564, -0x1.fffffffe00000p-632, INFINITY, 0x0.0000000000000p+0}, {0x1.00000ffffffd0p-606, -0x1.ffffff8200000p-672, 0x1.00000c0000004p+258, -0x1.ff80000800000p+190, 0x1.000003ffffcccp-864, 0x1.02fbf43288800p-927}, {0x1.00000ffffffd0p-606, -0x1.ffffff8200000p-672, -0x1.00000c0000004p+258, 0x1.ff80000800000p+190, -0x1.000003ffffcccp-864, -0x1.02fbf43288800p-927}, {-0x1.00000ffffffd0p-606, 0x1.ffffff8200000p-672, 0x1.00000c0000004p+258, -0x1.ff80000800000p+190, -0x1.000003ffffcccp-864, -0x1.02fbf43288800p-927}, {-0x1.00000ffffffd0p-606, 0x1.ffffff8200000p-672, -0x1.00000c0000004p+258, 0x1.ff80000800000p+190, 0x1.000003ffffcccp-864, 0x1.02fbf43288800p-927}, {0x1.18003ffff8000p-770, 0x1.ffffff8000000p-836, 0x1.1ffff80000040p-581, -0x1.0000000000000p-671, 0x1.f1c79c0c99a42p-190, -0x1.672e152d5a5bep-244}, {0x1.18003ffff8000p-770, 0x1.ffffff8000000p-836, -0x1.1ffff80000040p-581, 0x1.0000000000000p-671, -0x1.f1c79c0c99a42p-190, 0x1.672e152d5a5bep-244}, {-0x1.18003ffff8000p-770, -0x1.ffffff8000000p-836, 0x1.1ffff80000040p-581, -0x1.0000000000000p-671, -0x1.f1c79c0c99a42p-190, 0x1.672e152d5a5bep-244}, {-0x1.18003ffff8000p-770, -0x1.ffffff8000000p-836, -0x1.1ffff80000040p-581, 0x1.0000000000000p-671, 0x1.f1c79c0c99a42p-190, -0x1.672e152d5a5bep-244}, {0x1.0ffffff9ffff0p+390, 0x1.f800008200000p+320, 0x1.000000ffffff8p+202, 0x1.ff0000007ffc0p+143, 0x1.0ffffeea0000ap+188, -0x1.21eba43b6d104p+133}, {0x1.0ffffff9ffff0p+390, 0x1.f800008200000p+320, -0x1.000000ffffff8p+202, -0x1.ff0000007ffc0p+143, -0x1.0ffffeea0000ap+188, 0x1.21eba43b6d104p+133}, {-0x1.0ffffff9ffff0p+390, -0x1.f800008200000p+320, 0x1.000000ffffff8p+202, 0x1.ff0000007ffc0p+143, -0x1.0ffffeea0000ap+188, 0x1.21eba43b6d104p+133}, {-0x1.0ffffff9ffff0p+390, -0x1.f800008200000p+320, -0x1.000000ffffff8p+202, -0x1.ff0000007ffc0p+143, 0x1.0ffffeea0000ap+188, -0x1.21eba43b6d104p+133}, {0x1.1fffffe000000p-899, 0x1.ffff800001ffep-953, 0x1.0000008000000p-864, -0x1.fffffc0000008p-920, 0x1.1fffff5000006p-35, 0x1.1ffee480048f8p-90}, {0x1.1fffffe000000p-899, 0x1.ffff800001ffep-953, -0x1.0000008000000p-864, 0x1.fffffc0000008p-920, -0x1.1fffff5000006p-35, -0x1.1ffee480048f8p-90}, {-0x1.1fffffe000000p-899, -0x1.ffff800001ffep-953, 0x1.0000008000000p-864, -0x1.fffffc0000008p-920, -0x1.1fffff5000006p-35, -0x1.1ffee480048f8p-90}, {-0x1.1fffffe000000p-899, -0x1.ffff800001ffep-953, -0x1.0000008000000p-864, 0x1.fffffc0000008p-920, 0x1.1fffff5000006p-35, 0x1.1ffee480048f8p-90}, {0x1.0000200000000p-148, -0x1.fffffff804000p-215, 0x1.0000080000000p+818, -0x1.0000000000000p+723, 0x1.000017ffff400p-966, 0x1.6ffff480c0400p-1028}, {0x1.0000200000000p-148, -0x1.fffffff804000p-215, -0x1.0000080000000p+818, 0x1.0000000000000p+723, -0x1.000017ffff400p-966, -0x1.6ffff480c0400p-1028}, {-0x1.0000200000000p-148, 0x1.fffffff804000p-215, 0x1.0000080000000p+818, -0x1.0000000000000p+723, -0x1.000017ffff400p-966, -0x1.6ffff480c0400p-1028}, {-0x1.0000200000000p-148, 0x1.fffffff804000p-215, -0x1.0000080000000p+818, 0x1.0000000000000p+723, 0x1.000017ffff400p-966, 0x1.6ffff480c0400p-1028}, {0x1.03ffff0000010p+113, -0x1.fffc010000000p+37, 0x1.0000020000000p+293, -0x1.0000000000000p+188, 0x1.03fffcf800071p-180, -0x1.c7fff471f0000p-249}, {0x1.03ffff0000010p+113, -0x1.fffc010000000p+37, -0x1.0000020000000p+293, 0x1.0000000000000p+188, -0x1.03fffcf800071p-180, 0x1.c7fff471f0000p-249}, {-0x1.03ffff0000010p+113, 0x1.fffc010000000p+37, 0x1.0000020000000p+293, -0x1.0000000000000p+188, -0x1.03fffcf800071p-180, 0x1.c7fff471f0000p-249}, {-0x1.03ffff0000010p+113, 0x1.fffc010000000p+37, -0x1.0000020000000p+293, 0x1.0000000000000p+188, 0x1.03fffcf800071p-180, -0x1.c7fff471f0000p-249}, {0x1.7ffffffc00000p-873, 0x1.fff80000fc000p-934, 0x1.0010000000000p+21, -0x1.ffffffffc4000p-46, 0x1.7fe8017be8418p-894, -0x1.01d7f400a641ep-948}, {0x1.7ffffffc00000p-873, 0x1.fff80000fc000p-934, -0x1.0010000000000p+21, 0x1.ffffffffc4000p-46, -0x1.7fe8017be8418p-894, 0x1.01d7f400a641ep-948}, {-0x1.7ffffffc00000p-873, -0x1.fff80000fc000p-934, 0x1.0010000000000p+21, -0x1.ffffffffc4000p-46, -0x1.7fe8017be8418p-894, 0x1.01d7f400a641ep-948}, {-0x1.7ffffffc00000p-873, -0x1.fff80000fc000p-934, -0x1.0010000000000p+21, 0x1.ffffffffc4000p-46, 0x1.7fe8017be8418p-894, -0x1.01d7f400a641ep-948}, {0x1.000007fffc004p-531, -0x1.8000004000000p-590, 0x1.7fe000001ff00p+464, 0x1.f000000000000p+363, 0x1.5571d426e1829p-996, -0x1.e917b80000000p-1050}, {0x1.000007fffc004p-531, -0x1.8000004000000p-590, -0x1.7fe000001ff00p+464, -0x1.f000000000000p+363, -0x1.5571d426e1829p-996, 0x1.e917b80000000p-1050}, {-0x1.000007fffc004p-531, 0x1.8000004000000p-590, 0x1.7fe000001ff00p+464, 0x1.f000000000000p+363, -0x1.5571d426e1829p-996, 0x1.e917b80000000p-1050}, {-0x1.000007fffc004p-531, 0x1.8000004000000p-590, -0x1.7fe000001ff00p+464, -0x1.f000000000000p+363, 0x1.5571d426e1829p-996, -0x1.e917b80000000p-1050}, {0x1.01ffffffffc00p+132, 0x0.0000000000000p+0, 0x1.0ffffff000000p+156, 0x1.fffffff000000p+86, 0x1.e5a5a5c236733p-25, -0x1.9d54b36e3ce32p-79}, {0x1.01ffffffffc00p+132, 0x0.0000000000000p+0, -0x1.0ffffff000000p+156, -0x1.fffffff000000p+86, -0x1.e5a5a5c236733p-25, 0x1.9d54b36e3ce32p-79}, {-0x1.01ffffffffc00p+132, 0x0.0000000000000p+0, 0x1.0ffffff000000p+156, 0x1.fffffff000000p+86, -0x1.e5a5a5c236733p-25, 0x1.9d54b36e3ce32p-79}, {-0x1.01ffffffffc00p+132, 0x0.0000000000000p+0, -0x1.0ffffff000000p+156, -0x1.fffffff000000p+86, 0x1.e5a5a5c236733p-25, -0x1.9d54b36e3ce32p-79}, {0x1.0000010000000p-428, -0x1.ffffffffe4000p-490, 0x1.0000020000000p-498, -0x1.ff80000100000p-571, 0x1.fffffe0000040p+69, -0x1.006005ff51e00p+9}, {0x1.0000010000000p-428, -0x1.ffffffffe4000p-490, -0x1.0000020000000p-498, 0x1.ff80000100000p-571, -0x1.fffffe0000040p+69, 0x1.006005ff51e00p+9}, {-0x1.0000010000000p-428, 0x1.ffffffffe4000p-490, 0x1.0000020000000p-498, -0x1.ff80000100000p-571, -0x1.fffffe0000040p+69, 0x1.006005ff51e00p+9}, {-0x1.0000010000000p-428, 0x1.ffffffffe4000p-490, -0x1.0000020000000p-498, 0x1.ff80000100000p-571, 0x1.fffffe0000040p+69, -0x1.006005ff51e00p+9}, {0x1.0008000000000p+313, -0x1.0000000000000p+208, 0x1.000fffff80000p+721, 0x1.fffffffc00000p+665, 0x1.fff00100efe90p-409, -0x1.07a38c84ab908p-464}, {0x1.0008000000000p+313, -0x1.0000000000000p+208, -0x1.000fffff80000p+721, -0x1.fffffffc00000p+665, -0x1.fff00100efe90p-409, 0x1.07a38c84ab908p-464}, {-0x1.0008000000000p+313, 0x1.0000000000000p+208, 0x1.000fffff80000p+721, 0x1.fffffffc00000p+665, -0x1.fff00100efe90p-409, 0x1.07a38c84ab908p-464}, {-0x1.0008000000000p+313, 0x1.0000000000000p+208, -0x1.000fffff80000p+721, -0x1.fffffffc00000p+665, 0x1.fff00100efe90p-409, -0x1.07a38c84ab908p-464}, {0x1.007fffffffc00p+944, 0x1.ffffc00000000p+879, 0x1.1ffffffff8000p-208, 0x1.fe001ffffffe0p-264, INFINITY, 0x0.0000000000000p+0}, {0x1.007fffffffc00p+944, 0x1.ffffc00000000p+879, -0x1.1ffffffff8000p-208, -0x1.fe001ffffffe0p-264, -INFINITY, 0x0.0000000000000p+0}, {-0x1.007fffffffc00p+944, -0x1.ffffc00000000p+879, 0x1.1ffffffff8000p-208, 0x1.fe001ffffffe0p-264, -INFINITY, 0x0.0000000000000p+0}, {-0x1.007fffffffc00p+944, -0x1.ffffc00000000p+879, -0x1.1ffffffff8000p-208, -0x1.fe001ffffffe0p-264, INFINITY, 0x0.0000000000000p+0}, {0x1.0000000fffe00p+879, 0x1.3fffff87fc000p+819, 0x1.00003ffffc000p-310, 0x1.e003ff8000000p-375, INFINITY, 0x0.0000000000000p+0}, {0x1.0000000fffe00p+879, 0x1.3fffff87fc000p+819, -0x1.00003ffffc000p-310, -0x1.e003ff8000000p-375, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000000fffe00p+879, -0x1.3fffff87fc000p+819, 0x1.00003ffffc000p-310, 0x1.e003ff8000000p-375, -INFINITY, 0x0.0000000000000p+0}, {-0x1.0000000fffe00p+879, -0x1.3fffff87fc000p+819, -0x1.00003ffffc000p-310, -0x1.e003ff8000000p-375, INFINITY, 0x0.0000000000000p+0}, {0x1.0000000800000p-526, -0x1.0000000000000p-631, 0x1.7ffff80000000p-359, 0x1.ffffffffe0000p-415, 0x1.55555c7c71ed4p-168, 0x1.30ff0fb9aebd0p-225}, {0x1.0000000800000p-526, -0x1.0000000000000p-631, -0x1.7ffff80000000p-359, -0x1.ffffffffe0000p-415, -0x1.55555c7c71ed4p-168, -0x1.30ff0fb9aebd0p-225}, {-0x1.0000000800000p-526, 0x1.0000000000000p-631, 0x1.7ffff80000000p-359, 0x1.ffffffffe0000p-415, -0x1.55555c7c71ed4p-168, -0x1.30ff0fb9aebd0p-225}, {-0x1.0000000800000p-526, 0x1.0000000000000p-631, -0x1.7ffff80000000p-359, -0x1.ffffffffe0000p-415, 0x1.55555c7c71ed4p-168, 0x1.30ff0fb9aebd0p-225}, {0x1.00fffffff8000p-357, 0x1.fffe000000000p-431, 0x1.0000100000000p-423, -0x1.fffffffffc100p-478, 0x1.00ffefeff9010p+66, 0x1.1cfbfe2017250p+12}, {0x1.00fffffff8000p-357, 0x1.fffe000000000p-431, -0x1.0000100000000p-423, 0x1.fffffffffc100p-478, -0x1.00ffefeff9010p+66, -0x1.1cfbfe2017250p+12}, {-0x1.00fffffff8000p-357, -0x1.fffe000000000p-431, 0x1.0000100000000p-423, -0x1.fffffffffc100p-478, -0x1.00ffefeff9010p+66, -0x1.1cfbfe2017250p+12}, {-0x1.00fffffff8000p-357, -0x1.fffe000000000p-431, -0x1.0000100000000p-423, 0x1.fffffffffc100p-478, 0x1.00ffefeff9010p+66, 0x1.1cfbfe2017250p+12}, {0x1.0007ffffffff0p-319, 0x1.fffffc0000000p-402, 0x1.0003800000080p-931, -0x1.0000000000000p-1036, 0x1.00047ff0402e2p+612, -0x1.8ad99d893a930p+555}, {0x1.0007ffffffff0p-319, 0x1.fffffc0000000p-402, -0x1.0003800000080p-931, 0x1.0000000000000p-1036, -0x1.00047ff0402e2p+612, 0x1.8ad99d893a930p+555}, {-0x1.0007ffffffff0p-319, -0x1.fffffc0000000p-402, 0x1.0003800000080p-931, -0x1.0000000000000p-1036, -0x1.00047ff0402e2p+612, 0x1.8ad99d893a930p+555}, {-0x1.0007ffffffff0p-319, -0x1.fffffc0000000p-402, -0x1.0003800000080p-931, 0x1.0000000000000p-1036, 0x1.00047ff0402e2p+612, -0x1.8ad99d893a930p+555}, {0x1.000001fffff80p-279, 0x1.ff00000000000p-363, 0x1.0000020000000p-640, -0x1.8002000000000p-716, 0x1.fffffffffff00p+360, 0x1.0181fefcfc000p+293}, {0x1.000001fffff80p-279, 0x1.ff00000000000p-363, -0x1.0000020000000p-640, 0x1.8002000000000p-716, -0x1.fffffffffff00p+360, -0x1.0181fefcfc000p+293}, {-0x1.000001fffff80p-279, -0x1.ff00000000000p-363, 0x1.0000020000000p-640, -0x1.8002000000000p-716, -0x1.fffffffffff00p+360, -0x1.0181fefcfc000p+293}, {-0x1.000001fffff80p-279, -0x1.ff00000000000p-363, -0x1.0000020000000p-640, 0x1.8002000000000p-716, 0x1.fffffffffff00p+360, 0x1.0181fefcfc000p+293}, {0x1.0003fffff0000p+964, 0x1.ffff800007f80p+904, 0x1.000007ffffe00p+308, -0x1.fe0c000004000p+250, 0x1.0003f7ffd0600p+656, 0x1.4dc26b9fd5b00p+601}, {0x1.0003fffff0000p+964, 0x1.ffff800007f80p+904, -0x1.000007ffffe00p+308, 0x1.fe0c000004000p+250, -0x1.0003f7ffd0600p+656, -0x1.4dc26b9fd5b00p+601}, {-0x1.0003fffff0000p+964, -0x1.ffff800007f80p+904, 0x1.000007ffffe00p+308, -0x1.fe0c000004000p+250, -0x1.0003f7ffd0600p+656, -0x1.4dc26b9fd5b00p+601}, {-0x1.0003fffff0000p+964, -0x1.ffff800007f80p+904, -0x1.000007ffffe00p+308, 0x1.fe0c000004000p+250, 0x1.0003f7ffd0600p+656, 0x1.4dc26b9fd5b00p+601}, {0x1.00000003f0000p+137, 0x1.ffffffe000000p+59, 0x1.0100000000000p+110, -0x1.fffffff000080p+50, 0x1.fe01fe09d629dp+26, 0x1.9a55be319d934p-28}, {0x1.00000003f0000p+137, 0x1.ffffffe000000p+59, -0x1.0100000000000p+110, 0x1.fffffff000080p+50, -0x1.fe01fe09d629dp+26, -0x1.9a55be319d934p-28}, {-0x1.00000003f0000p+137, -0x1.ffffffe000000p+59, 0x1.0100000000000p+110, -0x1.fffffff000080p+50, -0x1.fe01fe09d629dp+26, -0x1.9a55be319d934p-28}, {-0x1.00000003f0000p+137, -0x1.ffffffe000000p+59, -0x1.0100000000000p+110, 0x1.fffffff000080p+50, 0x1.fe01fe09d629dp+26, 0x1.9a55be319d934p-28}, {0x1.007fffffffc00p+472, 0x1.fffffe0000000p+390, 0x1.0000003fffff8p-373, 0x1.fffff80000000p-444, 0x1.007fffbfdfc09p+845, 0x1.202ee977b9860p+787}, {0x1.007fffffffc00p+472, 0x1.fffffe0000000p+390, -0x1.0000003fffff8p-373, -0x1.fffff80000000p-444, -0x1.007fffbfdfc09p+845, -0x1.202ee977b9860p+787}, {-0x1.007fffffffc00p+472, -0x1.fffffe0000000p+390, 0x1.0000003fffff8p-373, 0x1.fffff80000000p-444, -0x1.007fffbfdfc09p+845, -0x1.202ee977b9860p+787}, {-0x1.007fffffffc00p+472, -0x1.fffffe0000000p+390, -0x1.0000003fffff8p-373, -0x1.fffff80000000p-444, 0x1.007fffbfdfc09p+845, 0x1.202ee977b9860p+787}, {0x1.00000003ff000p+517, 0x1.ffffff0000000p+455, 0x1.0000ffff80000p+482, 0x1.e0000000fffc0p+423, 0x1.fffe000afdf40p+34, 0x1.a97dc87838c28p-22}, {0x1.00000003ff000p+517, 0x1.ffffff0000000p+455, -0x1.0000ffff80000p+482, -0x1.e0000000fffc0p+423, -0x1.fffe000afdf40p+34, -0x1.a97dc87838c28p-22}, {-0x1.00000003ff000p+517, -0x1.ffffff0000000p+455, 0x1.0000ffff80000p+482, 0x1.e0000000fffc0p+423, -0x1.fffe000afdf40p+34, -0x1.a97dc87838c28p-22}, {-0x1.00000003ff000p+517, -0x1.ffffff0000000p+455, -0x1.0000ffff80000p+482, -0x1.e0000000fffc0p+423, 0x1.fffe000afdf40p+34, 0x1.a97dc87838c28p-22}, {0x1.007ffffffc000p-870, 0x1.ffffff8000000p-937, 0x1.0003fffffffe0p-380, 0x1.fffffff000780p-440, 0x1.007bfe1003c1fp-490, 0x1.d0655eb0f91c0p-546}, {0x1.007ffffffc000p-870, 0x1.ffffff8000000p-937, -0x1.0003fffffffe0p-380, -0x1.fffffff000780p-440, -0x1.007bfe1003c1fp-490, -0x1.d0655eb0f91c0p-546}, {-0x1.007ffffffc000p-870, -0x1.ffffff8000000p-937, 0x1.0003fffffffe0p-380, 0x1.fffffff000780p-440, -0x1.007bfe1003c1fp-490, -0x1.d0655eb0f91c0p-546}, {-0x1.007ffffffc000p-870, -0x1.ffffff8000000p-937, -0x1.0003fffffffe0p-380, -0x1.fffffff000780p-440, 0x1.007bfe1003c1fp-490, 0x1.d0655eb0f91c0p-546}, {0x1.07fffffe0003cp+175, 0x1.ffe000007f000p+110, 0x1.1ffff00800000p-290, -0x1.0000000000000p-387, 0x1.d5556f57b59dcp+464, 0x1.ea436d67e8132p+410}, {0x1.07fffffe0003cp+175, 0x1.ffe000007f000p+110, -0x1.1ffff00800000p-290, 0x1.0000000000000p-387, -0x1.d5556f57b59dcp+464, -0x1.ea436d67e8132p+410}, {-0x1.07fffffe0003cp+175, -0x1.ffe000007f000p+110, 0x1.1ffff00800000p-290, -0x1.0000000000000p-387, -0x1.d5556f57b59dcp+464, -0x1.ea436d67e8132p+410}, {-0x1.07fffffe0003cp+175, -0x1.ffe000007f000p+110, -0x1.1ffff00800000p-290, 0x1.0000000000000p-387, 0x1.d5556f57b59dcp+464, 0x1.ea436d67e8132p+410}, {0x1.000003fff8000p+401, 0x1.ffff00000003cp+346, 0x1.000001ffff020p+721, -0x1.fff0000200000p+651, 0x1.000001fff8fa0p-320, 0x1.04037c2a010d6p-374}, {0x1.000003fff8000p+401, 0x1.ffff00000003cp+346, -0x1.000001ffff020p+721, 0x1.fff0000200000p+651, -0x1.000001fff8fa0p-320, -0x1.04037c2a010d6p-374}, {-0x1.000003fff8000p+401, -0x1.ffff00000003cp+346, 0x1.000001ffff020p+721, -0x1.fff0000200000p+651, -0x1.000001fff8fa0p-320, -0x1.04037c2a010d6p-374}, {-0x1.000003fff8000p+401, -0x1.ffff00000003cp+346, -0x1.000001ffff020p+721, 0x1.fff0000200000p+651, 0x1.000001fff8fa0p-320, 0x1.04037c2a010d6p-374}, {0x1.00ffe00000000p-249, 0x1.fe00000000000p-309, 0x1.0000100000000p+516, -0x1.ffff800010000p+447, 0x1.00ffcff003010p-765, -0x1.01fef05060e00p-825}, {0x1.00ffe00000000p-249, 0x1.fe00000000000p-309, -0x1.0000100000000p+516, 0x1.ffff800010000p+447, -0x1.00ffcff003010p-765, 0x1.01fef05060e00p-825}, {-0x1.00ffe00000000p-249, -0x1.fe00000000000p-309, 0x1.0000100000000p+516, -0x1.ffff800010000p+447, -0x1.00ffcff003010p-765, 0x1.01fef05060e00p-825}, {-0x1.00ffe00000000p-249, -0x1.fe00000000000p-309, -0x1.0000100000000p+516, 0x1.ffff800010000p+447, 0x1.00ffcff003010p-765, -0x1.01fef05060e00p-825}, {0x1.fffffff000008p-375, -0x1.ffffff1000000p-452, 0x1.0001fffffff80p-412, 0x1.fffe000000000p-497, 0x1.fffbfff800208p+37, -0x1.83fe387f7d700p-21}, {0x1.fffffff000008p-375, -0x1.ffffff1000000p-452, -0x1.0001fffffff80p-412, -0x1.fffe000000000p-497, -0x1.fffbfff800208p+37, 0x1.83fe387f7d700p-21}, {-0x1.fffffff000008p-375, 0x1.ffffff1000000p-452, 0x1.0001fffffff80p-412, 0x1.fffe000000000p-497, -0x1.fffbfff800208p+37, 0x1.83fe387f7d700p-21}, {-0x1.fffffff000008p-375, 0x1.ffffff1000000p-452, -0x1.0001fffffff80p-412, -0x1.fffe000000000p-497, 0x1.fffbfff800208p+37, -0x1.83fe387f7d700p-21}, }; const int numAccuracyTests = sizeof(accuracyTests) / sizeof(struct testVector); #include double testAccuracy() { int i; DD a, b, c, r; double worstUlps = 0.5; for (i=0; i worstUlps) { #ifdef PRINT_ACCURACY_INFORMATION printf("New worst rounding error for (%a,%a) / (%a,%a):\n", a.hi, a.lo, b.hi, b.lo); printf("\tExpected: (%a,%a)\n", r.hi, r.lo); printf("\tComputed: (%a,%a)\n", c.hi, c.lo); printf("\tError: %f ulps\n", ulpError); #endif worstUlps = ulpError; } } } return worstUlps; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ppc/qadd_test.c0000664000175000017500000070075511221175607027646 0ustar mwhudsonmwhudson#include #include "DD.h" long double __gcc_qadd(long double x, long double y); double testAccuracy(); int testEdgeCases(); int main(int argc, char *argv[]) { if (testEdgeCases()) return 1; if (testAccuracy() > 1.0) return 1; return 0; } struct testVector { double xhi; double xlo; double yhi; double ylo; double rhi; double rlo; }; #define INFINITY __builtin_inf() #define HUGE 0x1.fffffffffffffp1023 #define QNAN __builtin_nan("") const struct testVector edgeCases[] = { { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { -0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, -0.0, 0.0, 0.0, 0.0 }, { -0.0, 0.0, -0.0, 0.0, -0.0, 0.0 }, { INFINITY, 0.0, 0.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 0.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -0.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -0.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, 1.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, 1.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -1.0, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -1.0, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, HUGE, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, HUGE, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, -HUGE, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, -HUGE, 0.0, -INFINITY, 0.0 }, { INFINITY, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { -INFINITY, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { 0.0, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { 0.0, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { -0.0, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { -0.0, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { 1.0, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { 1.0, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { -1.0, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { -1.0, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { HUGE, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { HUGE, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { -HUGE, 0.0, INFINITY, 0.0, INFINITY, 0.0 }, { -HUGE, 0.0, -INFINITY, 0.0, -INFINITY, 0.0 }, { QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -0.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, 1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -1.0, 0.0, QNAN, 0.0 }, { QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -HUGE, 0.0, QNAN, 0.0 }, { QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -INFINITY, 0.0, QNAN, 0.0 }, { QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, QNAN, 0.0, QNAN, 0.0 }, { QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -QNAN, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -0.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { 1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -1.0, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -HUGE, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, QNAN, 0.0, QNAN, 0.0 }, { -INFINITY, 0.0, -QNAN, 0.0, QNAN, 0.0 }, }; const int numEdgeCases = sizeof(edgeCases) / sizeof(struct testVector); int testEdgeCases() { int i; DD a, b, c, r; for (i=0; i #include #include #ifdef __x86_64__ #define randlength 2 #else #define randlength 4 #endif int main(int argc, char *argv[]) { MPFR_DECL_INIT(a, 106); MPFR_DECL_INIT(b, 106); MPFR_DECL_INIT(c, 106); MPFR_DECL_INIT(tmp, 53); int exponent_range = atoi(argv[1]); int i; for (i=0; i<128; ++i) { mpfr_random2(a, randlength, exponent_range); mpfr_random2(b, randlength, exponent_range); mpfr_add(c, a, b, GMP_RNDN); double ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); double alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); double bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); double blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); double chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); double clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); mpfr_neg(b, b, GMP_RNDN); mpfr_add(c, a, b, GMP_RNDN); ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); mpfr_neg(a, a, GMP_RNDN); mpfr_neg(b, b, GMP_RNDN); mpfr_add(c, a, b, GMP_RNDN); ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); mpfr_neg(b, b, GMP_RNDN); mpfr_add(c, a, b, GMP_RNDN); ahi = mpfr_get_d(a, GMP_RNDN); mpfr_set_d(tmp, ahi, GMP_RNDN); mpfr_sub(tmp, a, tmp, GMP_RNDN); alo = mpfr_get_d(tmp, GMP_RNDN); printf("{%0.13a, %0.13a, ", ahi, alo); bhi = mpfr_get_d(b, GMP_RNDN); mpfr_set_d(tmp, bhi, GMP_RNDN); mpfr_sub(tmp, b, tmp, GMP_RNDN); blo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a, ", bhi, blo); chi = mpfr_get_d(c, GMP_RNDN); mpfr_set_d(tmp, chi, GMP_RNDN); mpfr_sub(tmp, c, tmp, GMP_RNDN); clo = mpfr_get_d(tmp, GMP_RNDN); printf("%0.13a, %0.13a},\n", chi, clo); } return 0; } */ const struct testVector accuracyTests[] = { // Some test cases that cover the whole exponent range: {0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302, 0x1.0003ffffffffcp+140, 0x1.ffffc00000000p+53, 0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302}, {0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302, -0x1.0003ffffffffcp+140, -0x1.ffffc00000000p+53, 0x1.0000000000002p+366, -0x1.ffc0ffff90000p+302}, {-0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302, 0x1.0003ffffffffcp+140, 0x1.ffffc00000000p+53, -0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302}, {-0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302, -0x1.0003ffffffffcp+140, -0x1.ffffc00000000p+53, -0x1.0000000000002p+366, 0x1.ffc0ffff90000p+302}, {0x1.0000100000000p-746, -0x1.0000000000000p-808, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692}, {0x1.0000100000000p-746, -0x1.0000000000000p-808, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692}, {-0x1.0000100000000p-746, 0x1.0000000000000p-808, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692, 0x1.0000000004000p-636, -0x1.ffffe00fc0200p-692}, {-0x1.0000100000000p-746, 0x1.0000000000000p-808, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692, -0x1.0000000004000p-636, 0x1.ffffe00fc0200p-692}, {0x1.0000000800000p+426, -0x1.0000000000000p+354, 0x1.000003fffc002p-730, -0x1.0000000000000p-835, 0x1.0000000800000p+426, -0x1.0000000000000p+354}, {0x1.0000000800000p+426, -0x1.0000000000000p+354, -0x1.000003fffc002p-730, 0x1.0000000000000p-835, 0x1.0000000800000p+426, -0x1.0000000000000p+354}, {-0x1.0000000800000p+426, 0x1.0000000000000p+354, 0x1.000003fffc002p-730, -0x1.0000000000000p-835, -0x1.0000000800000p+426, 0x1.0000000000000p+354}, {-0x1.0000000800000p+426, 0x1.0000000000000p+354, -0x1.000003fffc002p-730, 0x1.0000000000000p-835, -0x1.0000000800000p+426, 0x1.0000000000000p+354}, {0x1.0000000000000p-262, 0x1.ffc001ffffe00p-317, 0x1.000003fff8000p-258, 0x1.fffc000fc0000p-329, 0x1.100003fff8000p-258, 0x1.ffe001c000dc0p-317}, {0x1.0000000000000p-262, 0x1.ffc001ffffe00p-317, -0x1.000003fff8000p-258, -0x1.fffc000fc0000p-329, -0x1.e00007fff0000p-259, 0x1.ffa0023ffee40p-317}, {-0x1.0000000000000p-262, -0x1.ffc001ffffe00p-317, 0x1.000003fff8000p-258, 0x1.fffc000fc0000p-329, 0x1.e00007fff0000p-259, -0x1.ffa0023ffee40p-317}, {-0x1.0000000000000p-262, -0x1.ffc001ffffe00p-317, -0x1.000003fff8000p-258, -0x1.fffc000fc0000p-329, -0x1.100003fff8000p-258, -0x1.ffe001c000dc0p-317}, {0x1.0000000000003p+980, 0x1.fc00001fff800p+916, 0x1.0000000000020p+626, -0x1.fc01ffe002000p+562, 0x1.0000000000003p+980, 0x1.fc00001fff800p+916}, {0x1.0000000000003p+980, 0x1.fc00001fff800p+916, -0x1.0000000000020p+626, 0x1.fc01ffe002000p+562, 0x1.0000000000003p+980, 0x1.fc00001fff800p+916}, {-0x1.0000000000003p+980, -0x1.fc00001fff800p+916, 0x1.0000000000020p+626, -0x1.fc01ffe002000p+562, -0x1.0000000000003p+980, -0x1.fc00001fff800p+916}, {-0x1.0000000000003p+980, -0x1.fc00001fff800p+916, -0x1.0000000000020p+626, 0x1.fc01ffe002000p+562, -0x1.0000000000003p+980, -0x1.fc00001fff800p+916}, {0x1.0000000000000p-800, 0x1.fffff00001ffep-854, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410}, {0x1.0000000000000p-800, 0x1.fffff00001ffep-854, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410}, {-0x1.0000000000000p-800, -0x1.fffff00001ffep-854, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410, 0x1.0000000000000p+470, 0x1.ff00000ffff80p+410}, {-0x1.0000000000000p-800, -0x1.fffff00001ffep-854, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410, -0x1.0000000000000p+470, -0x1.ff00000ffff80p+410}, {0x1.0000000000000p+925, 0x1.ffffffffffc00p+862, 0x1.0000200000000p-454, -0x1.ffc0000080000p-526, 0x1.0000000000000p+925, 0x1.ffffffffffc00p+862}, {0x1.0000000000000p+925, 0x1.ffffffffffc00p+862, -0x1.0000200000000p-454, 0x1.ffc0000080000p-526, 0x1.0000000000000p+925, 0x1.ffffffffffc00p+862}, {-0x1.0000000000000p+925, -0x1.ffffffffffc00p+862, 0x1.0000200000000p-454, -0x1.ffc0000080000p-526, -0x1.0000000000000p+925, -0x1.ffffffffffc00p+862}, {-0x1.0000000000000p+925, -0x1.ffffffffffc00p+862, -0x1.0000200000000p-454, 0x1.ffc0000080000p-526, -0x1.0000000000000p+925, -0x1.ffffffffffc00p+862}, {0x1.0000000000800p+265, -0x1.fffc000000010p+208, 0x1.0000000000008p-204, -0x1.ffe03fffff010p-261, 0x1.0000000000800p+265, -0x1.fffc000000010p+208}, {0x1.0000000000800p+265, -0x1.fffc000000010p+208, -0x1.0000000000008p-204, 0x1.ffe03fffff010p-261, 0x1.0000000000800p+265, -0x1.fffc000000010p+208}, {-0x1.0000000000800p+265, 0x1.fffc000000010p+208, 0x1.0000000000008p-204, -0x1.ffe03fffff010p-261, -0x1.0000000000800p+265, 0x1.fffc000000010p+208}, {-0x1.0000000000800p+265, 0x1.fffc000000010p+208, -0x1.0000000000008p-204, 0x1.ffe03fffff010p-261, -0x1.0000000000800p+265, 0x1.fffc000000010p+208}, {0x1.0000000000000p-690, 0x1.fffef0ffff000p-753, 0x1.0000100000000p+763, -0x1.fff8000000800p+699, 0x1.0000100000000p+763, -0x1.fff8000000800p+699}, {0x1.0000000000000p-690, 0x1.fffef0ffff000p-753, -0x1.0000100000000p+763, 0x1.fff8000000800p+699, -0x1.0000100000000p+763, 0x1.fff8000000800p+699}, {-0x1.0000000000000p-690, -0x1.fffef0ffff000p-753, 0x1.0000100000000p+763, -0x1.fff8000000800p+699, 0x1.0000100000000p+763, -0x1.fff8000000800p+699}, {-0x1.0000000000000p-690, -0x1.fffef0ffff000p-753, -0x1.0000100000000p+763, 0x1.fff8000000800p+699, -0x1.0000100000000p+763, 0x1.fff8000000800p+699}, {0x1.07c00007ffff0p-506, 0x1.fffc00f800000p-582, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373}, {0x1.07c00007ffff0p-506, 0x1.fffc00f800000p-582, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373}, {-0x1.07c00007ffff0p-506, -0x1.fffc00f800000p-582, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373, 0x1.0000007ffffe0p-302, 0x1.f000000000000p-373}, {-0x1.07c00007ffff0p-506, -0x1.fffc00f800000p-582, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373, -0x1.0000007ffffe0p-302, -0x1.f000000000000p-373}, {0x1.0000000000000p-958, 0x1.ff800fffff800p-1014, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317}, {0x1.0000000000000p-958, 0x1.ff800fffff800p-1014, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317}, {-0x1.0000000000000p-958, -0x1.ff800fffff800p-1014, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317, 0x1.0000000000000p+373, 0x1.fffc0000ffff8p+317}, {-0x1.0000000000000p-958, -0x1.ff800fffff800p-1014, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317, -0x1.0000000000000p+373, -0x1.fffc0000ffff8p+317}, {0x1.0000000008000p+114, -0x1.ffff807ffe002p+60, 0x1.0000000800000p-783, -0x1.ffffff8000008p-839, 0x1.0000000008000p+114, -0x1.ffff807ffe002p+60}, {0x1.0000000008000p+114, -0x1.ffff807ffe002p+60, -0x1.0000000800000p-783, 0x1.ffffff8000008p-839, 0x1.0000000008000p+114, -0x1.ffff807ffe002p+60}, {-0x1.0000000008000p+114, 0x1.ffff807ffe002p+60, 0x1.0000000800000p-783, -0x1.ffffff8000008p-839, -0x1.0000000008000p+114, 0x1.ffff807ffe002p+60}, {-0x1.0000000008000p+114, 0x1.ffff807ffe002p+60, -0x1.0000000800000p-783, 0x1.ffffff8000008p-839, -0x1.0000000008000p+114, 0x1.ffff807ffe002p+60}, {0x1.0000000000020p+340, -0x1.0000000000000p+257, 0x1.0000000000000p-442, 0x1.fffff000003c0p-501, 0x1.0000000000020p+340, -0x1.0000000000000p+257}, {0x1.0000000000020p+340, -0x1.0000000000000p+257, -0x1.0000000000000p-442, -0x1.fffff000003c0p-501, 0x1.0000000000020p+340, -0x1.0000000000000p+257}, {-0x1.0000000000020p+340, 0x1.0000000000000p+257, 0x1.0000000000000p-442, 0x1.fffff000003c0p-501, -0x1.0000000000020p+340, 0x1.0000000000000p+257}, {-0x1.0000000000020p+340, 0x1.0000000000000p+257, -0x1.0000000000000p-442, -0x1.fffff000003c0p-501, -0x1.0000000000020p+340, 0x1.0000000000000p+257}, {0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331, 0x1.0000000200000p+69, -0x1.0000000000000p+0, 0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331}, {0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331, -0x1.0000000200000p+69, 0x1.0000000000000p+0, 0x1.0000001ffff80p+385, 0x1.fffffdfffff8ep+331}, {-0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331, 0x1.0000000200000p+69, -0x1.0000000000000p+0, -0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331}, {-0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331, -0x1.0000000200000p+69, 0x1.0000000000000p+0, -0x1.0000001ffff80p+385, -0x1.fffffdfffff8ep+331}, {0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198, 0x1.0000000000000p-934, 0x1.8fff01fffff00p-994, 0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198}, {0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198, -0x1.0000000000000p-934, -0x1.8fff01fffff00p-994, 0x1.01ffffff80400p-140, -0x1.c7ffffc000100p-198}, {-0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198, 0x1.0000000000000p-934, 0x1.8fff01fffff00p-994, -0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198}, {-0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198, -0x1.0000000000000p-934, -0x1.8fff01fffff00p-994, -0x1.01ffffff80400p-140, 0x1.c7ffffc000100p-198}, {0x1.0000000000008p+975, -0x1.ffffc00800000p+902, 0x1.00003ffe00002p-979, -0x1.ffffffc180000p-1039, 0x1.0000000000008p+975, -0x1.ffffc00800000p+902}, {0x1.0000000000008p+975, -0x1.ffffc00800000p+902, -0x1.00003ffe00002p-979, 0x1.ffffffc180000p-1039, 0x1.0000000000008p+975, -0x1.ffffc00800000p+902}, {-0x1.0000000000008p+975, 0x1.ffffc00800000p+902, 0x1.00003ffe00002p-979, -0x1.ffffffc180000p-1039, -0x1.0000000000008p+975, 0x1.ffffc00800000p+902}, {-0x1.0000000000008p+975, 0x1.ffffc00800000p+902, -0x1.00003ffe00002p-979, 0x1.ffffffc180000p-1039, -0x1.0000000000008p+975, 0x1.ffffc00800000p+902}, {0x1.000000ffffff8p+56, 0x1.ffffffc000000p-1, 0x1.0000000000000p-40, 0x1.ffffffe000000p-98, 0x1.000000ffffff8p+56, 0x1.ffffffc002000p-1}, {0x1.000000ffffff8p+56, 0x1.ffffffc000000p-1, -0x1.0000000000000p-40, -0x1.ffffffe000000p-98, 0x1.000000ffffff8p+56, 0x1.ffffffbffe000p-1}, {-0x1.000000ffffff8p+56, -0x1.ffffffc000000p-1, 0x1.0000000000000p-40, 0x1.ffffffe000000p-98, -0x1.000000ffffff8p+56, -0x1.ffffffbffe000p-1}, {-0x1.000000ffffff8p+56, -0x1.ffffffc000000p-1, -0x1.0000000000000p-40, -0x1.ffffffe000000p-98, -0x1.000000ffffff8p+56, -0x1.ffffffc002000p-1}, {0x1.0000000020000p-764, -0x1.0000000000000p-869, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470}, {0x1.0000000020000p-764, -0x1.0000000000000p-869, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470}, {-0x1.0000000020000p-764, 0x1.0000000000000p-869, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470, 0x1.0000000000400p-403, -0x1.ff1ffffff4000p-470}, {-0x1.0000000020000p-764, 0x1.0000000000000p-869, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470, -0x1.0000000000400p-403, 0x1.ff1ffffff4000p-470}, {0x1.0000ff8020000p-469, -0x1.fffffa0000000p-531, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80}, {0x1.0000ff8020000p-469, -0x1.fffffa0000000p-531, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80}, {-0x1.0000ff8020000p-469, 0x1.fffffa0000000p-531, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80, 0x1.0000000001ff0p-14, 0x1.f700000ffe000p-80}, {-0x1.0000ff8020000p-469, 0x1.fffffa0000000p-531, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80, -0x1.0000000001ff0p-14, -0x1.f700000ffe000p-80}, {0x1.0000020000000p+518, -0x1.0000000000000p+454, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710}, {0x1.0000020000000p+518, -0x1.0000000000000p+454, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710}, {-0x1.0000020000000p+518, 0x1.0000000000000p+454, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710, 0x1.003e00001f800p+772, 0x1.ffde000001e00p+710}, {-0x1.0000020000000p+518, 0x1.0000000000000p+454, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710, -0x1.003e00001f800p+772, -0x1.ffde000001e00p+710}, {0x1.0007e3ffe0000p-546, 0x1.fe0ffffffe000p-610, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506}, {0x1.0007e3ffe0000p-546, 0x1.fe0ffffffe000p-610, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506}, {-0x1.0007e3ffe0000p-546, -0x1.fe0ffffffe000p-610, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506, 0x1.0000000000000p+567, 0x1.fffffe07fff00p+506}, {-0x1.0007e3ffe0000p-546, -0x1.fe0ffffffe000p-610, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506, -0x1.0000000000000p+567, -0x1.fffffe07fff00p+506}, {0x1.00000000fe000p-853, 0x1.ff00004000000p-920, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322}, {0x1.00000000fe000p-853, 0x1.ff00004000000p-920, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322}, {-0x1.00000000fe000p-853, -0x1.ff00004000000p-920, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322, 0x1.000003fffff80p+382, 0x1.fff8400000000p+322}, {-0x1.00000000fe000p-853, -0x1.ff00004000000p-920, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322, -0x1.000003fffff80p+382, -0x1.fff8400000000p+322}, {0x1.0000800000000p-529, -0x1.0000000000000p-585, 0x1.0000000000000p-716, 0x1.fffffffc1fc00p-779, 0x1.0000800000000p-529, -0x1.0000000000000p-585}, {0x1.0000800000000p-529, -0x1.0000000000000p-585, -0x1.0000000000000p-716, -0x1.fffffffc1fc00p-779, 0x1.0000800000000p-529, -0x1.0000000000000p-585}, {-0x1.0000800000000p-529, 0x1.0000000000000p-585, 0x1.0000000000000p-716, 0x1.fffffffc1fc00p-779, -0x1.0000800000000p-529, 0x1.0000000000000p-585}, {-0x1.0000800000000p-529, 0x1.0000000000000p-585, -0x1.0000000000000p-716, -0x1.fffffffc1fc00p-779, -0x1.0000800000000p-529, 0x1.0000000000000p-585}, {0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491, 0x1.0000000000000p-565, 0x1.fe0003fffc000p-624, 0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491}, {0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491, -0x1.0000000000000p-565, -0x1.fe0003fffc000p-624, 0x1.0000000000000p+545, 0x1.ff000ff3ffe00p+491}, {-0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491, 0x1.0000000000000p-565, 0x1.fe0003fffc000p-624, -0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491}, {-0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491, -0x1.0000000000000p-565, -0x1.fe0003fffc000p-624, -0x1.0000000000000p+545, -0x1.ff000ff3ffe00p+491}, {0x1.000000e000010p-739, -0x1.ffffffc020000p-809, 0x1.00000001f0000p+66, 0x1.8000000000000p-38, 0x1.00000001f0000p+66, 0x1.8000000000000p-38}, {0x1.000000e000010p-739, -0x1.ffffffc020000p-809, -0x1.00000001f0000p+66, -0x1.8000000000000p-38, -0x1.00000001f0000p+66, -0x1.8000000000000p-38}, {-0x1.000000e000010p-739, 0x1.ffffffc020000p-809, 0x1.00000001f0000p+66, 0x1.8000000000000p-38, 0x1.00000001f0000p+66, 0x1.8000000000000p-38}, {-0x1.000000e000010p-739, 0x1.ffffffc020000p-809, -0x1.00000001f0000p+66, -0x1.8000000000000p-38, -0x1.00000001f0000p+66, -0x1.8000000000000p-38}, {0x1.000003ff00000p-980, 0x1.8000000000000p-1057, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386}, {0x1.000003ff00000p-980, 0x1.8000000000000p-1057, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386}, {-0x1.000003ff00000p-980, -0x1.8000000000000p-1057, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386, 0x1.0001ffffe0000p-313, 0x1.f800000100000p-386}, {-0x1.000003ff00000p-980, -0x1.8000000000000p-1057, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386, -0x1.0001ffffe0000p-313, -0x1.f800000100000p-386}, {0x1.0000000000200p+292, -0x1.ffffffffffc08p+236, 0x1.0000000000000p-660, 0x1.ffffffffffffep-714, 0x1.0000000000200p+292, -0x1.ffffffffffc08p+236}, {0x1.0000000000200p+292, -0x1.ffffffffffc08p+236, -0x1.0000000000000p-660, -0x1.ffffffffffffep-714, 0x1.0000000000200p+292, -0x1.ffffffffffc08p+236}, {-0x1.0000000000200p+292, 0x1.ffffffffffc08p+236, 0x1.0000000000000p-660, 0x1.ffffffffffffep-714, -0x1.0000000000200p+292, 0x1.ffffffffffc08p+236}, {-0x1.0000000000200p+292, 0x1.ffffffffffc08p+236, -0x1.0000000000000p-660, -0x1.ffffffffffffep-714, -0x1.0000000000200p+292, 0x1.ffffffffffc08p+236}, {0x1.0000000040000p-475, -0x1.fffff80002000p-541, 0x1.0000000000000p-741, 0x1.ffc01ffff3c00p-804, 0x1.0000000040000p-475, -0x1.fffff80002000p-541}, {0x1.0000000040000p-475, -0x1.fffff80002000p-541, -0x1.0000000000000p-741, -0x1.ffc01ffff3c00p-804, 0x1.0000000040000p-475, -0x1.fffff80002000p-541}, {-0x1.0000000040000p-475, 0x1.fffff80002000p-541, 0x1.0000000000000p-741, 0x1.ffc01ffff3c00p-804, -0x1.0000000040000p-475, 0x1.fffff80002000p-541}, {-0x1.0000000040000p-475, 0x1.fffff80002000p-541, -0x1.0000000000000p-741, -0x1.ffc01ffff3c00p-804, -0x1.0000000040000p-475, 0x1.fffff80002000p-541}, {0x1.0000800000000p+1022, -0x1.0000000000000p+917, 0x1.0000003800001p-290, 0x1.fffffe000003ep-344, 0x1.0000800000000p+1022, -0x1.0000000000000p+917}, {0x1.0000800000000p+1022, -0x1.0000000000000p+917, -0x1.0000003800001p-290, -0x1.fffffe000003ep-344, 0x1.0000800000000p+1022, -0x1.0000000000000p+917}, {-0x1.0000800000000p+1022, 0x1.0000000000000p+917, 0x1.0000003800001p-290, 0x1.fffffe000003ep-344, -0x1.0000800000000p+1022, 0x1.0000000000000p+917}, {-0x1.0000800000000p+1022, 0x1.0000000000000p+917, -0x1.0000003800001p-290, -0x1.fffffe000003ep-344, -0x1.0000800000000p+1022, 0x1.0000000000000p+917}, {0x1.0f00000020000p-425, -0x1.fffe000000100p-479, 0x1.0000000400000p-527, -0x1.ffffffc004000p-594, 0x1.0f00000020000p-425, -0x1.fffe0000000f0p-479}, {0x1.0f00000020000p-425, -0x1.fffe000000100p-479, -0x1.0000000400000p-527, 0x1.ffffffc004000p-594, 0x1.0f00000020000p-425, -0x1.fffe000000110p-479}, {-0x1.0f00000020000p-425, 0x1.fffe000000100p-479, 0x1.0000000400000p-527, -0x1.ffffffc004000p-594, -0x1.0f00000020000p-425, 0x1.fffe000000110p-479}, {-0x1.0f00000020000p-425, 0x1.fffe000000100p-479, -0x1.0000000400000p-527, 0x1.ffffffc004000p-594, -0x1.0f00000020000p-425, 0x1.fffe0000000f0p-479}, {0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652, 0x1.0000000000400p+142, -0x1.ffff800007ffcp+87, 0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652}, {0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652, -0x1.0000000000400p+142, 0x1.ffff800007ffcp+87, 0x1.003fe00020000p+720, -0x1.ffffffffe8000p+652}, {-0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652, 0x1.0000000000400p+142, -0x1.ffff800007ffcp+87, -0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652}, {-0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652, -0x1.0000000000400p+142, 0x1.ffff800007ffcp+87, -0x1.003fe00020000p+720, 0x1.ffffffffe8000p+652}, {0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11, 0x1.0000020000000p-926, -0x1.0000000000000p-1002, 0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11}, {0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11, -0x1.0000020000000p-926, 0x1.0000000000000p-1002, 0x1.ffff00fffffc4p+71, -0x1.8080000000000p-11}, {-0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11, 0x1.0000020000000p-926, -0x1.0000000000000p-1002, -0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11}, {-0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11, -0x1.0000020000000p-926, 0x1.0000000000000p-1002, -0x1.ffff00fffffc4p+71, 0x1.8080000000000p-11}, {0x1.0000000000040p-915, -0x1.8000000800000p-990, 0x1.0000000002000p-454, -0x1.0000000000000p-558, 0x1.0000000002000p-454, -0x1.0000000000000p-558}, {0x1.0000000000040p-915, -0x1.8000000800000p-990, -0x1.0000000002000p-454, 0x1.0000000000000p-558, -0x1.0000000002000p-454, 0x1.0000000000000p-558}, {-0x1.0000000000040p-915, 0x1.8000000800000p-990, 0x1.0000000002000p-454, -0x1.0000000000000p-558, 0x1.0000000002000p-454, -0x1.0000000000000p-558}, {-0x1.0000000000040p-915, 0x1.8000000800000p-990, -0x1.0000000002000p-454, 0x1.0000000000000p-558, -0x1.0000000002000p-454, 0x1.0000000000000p-558}, {0x1.0000000800000p-123, -0x1.ffffc02000000p-201, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488}, {0x1.0000000800000p-123, -0x1.ffffc02000000p-201, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488}, {-0x1.0000000800000p-123, 0x1.ffffc02000000p-201, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488, 0x1.7fffe00800000p+593, -0x1.0000000000000p+488}, {-0x1.0000000800000p-123, 0x1.ffffc02000000p-201, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488, -0x1.7fffe00800000p+593, 0x1.0000000000000p+488}, {0x1.0000400000000p+352, -0x1.0000000000000p+261, 0x1.4000000000000p-216, -0x1.ffffffff00020p-274, 0x1.0000400000000p+352, -0x1.0000000000000p+261}, {0x1.0000400000000p+352, -0x1.0000000000000p+261, -0x1.4000000000000p-216, 0x1.ffffffff00020p-274, 0x1.0000400000000p+352, -0x1.0000000000000p+261}, {-0x1.0000400000000p+352, 0x1.0000000000000p+261, 0x1.4000000000000p-216, -0x1.ffffffff00020p-274, -0x1.0000400000000p+352, 0x1.0000000000000p+261}, {-0x1.0000400000000p+352, 0x1.0000000000000p+261, -0x1.4000000000000p-216, 0x1.ffffffff00020p-274, -0x1.0000400000000p+352, 0x1.0000000000000p+261}, {0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771, 0x1.00001fffc0000p-889, 0x1.f80001f000f80p-949, 0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771}, {0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771, -0x1.00001fffc0000p-889, -0x1.f80001f000f80p-949, 0x1.0000000000000p-714, 0x1.03eff7ff3fff0p-771}, {-0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771, 0x1.00001fffc0000p-889, 0x1.f80001f000f80p-949, -0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771}, {-0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771, -0x1.00001fffc0000p-889, -0x1.f80001f000f80p-949, -0x1.0000000000000p-714, -0x1.03eff7ff3fff0p-771}, {0x1.03ffffffffffep-517, 0x1.8000000000000p-621, 0x1.0000040000000p-478, -0x1.0000000000000p-583, 0x1.0000040002080p-478, -0x1.0002000000000p-568}, {0x1.03ffffffffffep-517, 0x1.8000000000000p-621, -0x1.0000040000000p-478, 0x1.0000000000000p-583, -0x1.000003fffdf80p-478, -0x1.fffc000000000p-569}, {-0x1.03ffffffffffep-517, -0x1.8000000000000p-621, 0x1.0000040000000p-478, -0x1.0000000000000p-583, 0x1.000003fffdf80p-478, 0x1.fffc000000000p-569}, {-0x1.03ffffffffffep-517, -0x1.8000000000000p-621, -0x1.0000040000000p-478, 0x1.0000000000000p-583, -0x1.0000040002080p-478, 0x1.0002000000000p-568}, {0x1.0007ffffcfffcp-566, 0x1.ff01fffe00000p-640, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66}, {0x1.0007ffffcfffcp-566, 0x1.ff01fffe00000p-640, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66}, {-0x1.0007ffffcfffcp-566, -0x1.ff01fffe00000p-640, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66, 0x1.01fff08000000p-12, -0x1.fffffe0000020p-66}, {-0x1.0007ffffcfffcp-566, -0x1.ff01fffe00000p-640, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66, -0x1.01fff08000000p-12, 0x1.fffffe0000020p-66}, {0x1.00000000007fep-907, 0x1.ff00003ffff00p-968, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751}, {0x1.00000000007fep-907, 0x1.ff00003ffff00p-968, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751}, {-0x1.00000000007fep-907, -0x1.ff00003ffff00p-968, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751, 0x1.004000e000008p+829, -0x1.ffffe02000000p+751}, {-0x1.00000000007fep-907, -0x1.ff00003ffff00p-968, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751, -0x1.004000e000008p+829, 0x1.ffffe02000000p+751}, {0x1.00000003ff000p-540, 0x1.ffff000000000p-629, 0x1.0000fffff8000p-864, 0x1.f003ffe0003e0p-922, 0x1.00000003ff000p-540, 0x1.ffff000000000p-629}, {0x1.00000003ff000p-540, 0x1.ffff000000000p-629, -0x1.0000fffff8000p-864, -0x1.f003ffe0003e0p-922, 0x1.00000003ff000p-540, 0x1.ffff000000000p-629}, {-0x1.00000003ff000p-540, -0x1.ffff000000000p-629, 0x1.0000fffff8000p-864, 0x1.f003ffe0003e0p-922, -0x1.00000003ff000p-540, -0x1.ffff000000000p-629}, {-0x1.00000003ff000p-540, -0x1.ffff000000000p-629, -0x1.0000fffff8000p-864, -0x1.f003ffe0003e0p-922, -0x1.00000003ff000p-540, -0x1.ffff000000000p-629}, {0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45, 0x1.01fffffe00000p-954, 0x1.ffffffffffc00p-1012, 0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45}, {0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45, -0x1.01fffffe00000p-954, -0x1.ffffffffffc00p-1012, 0x1.0000000000000p+14, 0x1.ffe001c0003c0p-45}, {-0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45, 0x1.01fffffe00000p-954, 0x1.ffffffffffc00p-1012, -0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45}, {-0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45, -0x1.01fffffe00000p-954, -0x1.ffffffffffc00p-1012, -0x1.0000000000000p+14, -0x1.ffe001c0003c0p-45}, {0x1.00003ff808000p-919, -0x1.ffe0000800000p-980, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136}, {0x1.00003ff808000p-919, -0x1.ffe0000800000p-980, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136}, {-0x1.00003ff808000p-919, 0x1.ffe0000800000p-980, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136, 0x1.000001ffff000p-62, 0x1.ff80000000000p-136}, {-0x1.00003ff808000p-919, 0x1.ffe0000800000p-980, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136, -0x1.000001ffff000p-62, -0x1.ff80000000000p-136}, {0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727, 0x1.0000000007f80p-960, 0x1.ff0007f802000p-1024, 0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727}, {0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727, -0x1.0000000007f80p-960, -0x1.ff0007f802000p-1024, 0x1.0000000000000p-665, 0x1.fc007f0ff0000p-727}, {-0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727, 0x1.0000000007f80p-960, 0x1.ff0007f802000p-1024, -0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727}, {-0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727, -0x1.0000000007f80p-960, -0x1.ff0007f802000p-1024, -0x1.0000000000000p-665, -0x1.fc007f0ff0000p-727}, {0x1.0020000000000p+107, -0x1.0000000000000p+30, 0x1.000001ffff802p-529, -0x1.ffffffc000040p-588, 0x1.0020000000000p+107, -0x1.0000000000000p+30}, {0x1.0020000000000p+107, -0x1.0000000000000p+30, -0x1.000001ffff802p-529, 0x1.ffffffc000040p-588, 0x1.0020000000000p+107, -0x1.0000000000000p+30}, {-0x1.0020000000000p+107, 0x1.0000000000000p+30, 0x1.000001ffff802p-529, -0x1.ffffffc000040p-588, -0x1.0020000000000p+107, 0x1.0000000000000p+30}, {-0x1.0020000000000p+107, 0x1.0000000000000p+30, -0x1.000001ffff802p-529, 0x1.ffffffc000040p-588, -0x1.0020000000000p+107, 0x1.0000000000000p+30}, {0x1.0000000000800p+985, -0x1.ffe0000400000p+923, 0x1.0000000000038p+697, 0x1.e100000000000p+623, 0x1.0000000000800p+985, -0x1.ffe0000400000p+923}, {0x1.0000000000800p+985, -0x1.ffe0000400000p+923, -0x1.0000000000038p+697, -0x1.e100000000000p+623, 0x1.0000000000800p+985, -0x1.ffe0000400000p+923}, {-0x1.0000000000800p+985, 0x1.ffe0000400000p+923, 0x1.0000000000038p+697, 0x1.e100000000000p+623, -0x1.0000000000800p+985, 0x1.ffe0000400000p+923}, {-0x1.0000000000800p+985, 0x1.ffe0000400000p+923, -0x1.0000000000038p+697, -0x1.e100000000000p+623, -0x1.0000000000800p+985, 0x1.ffe0000400000p+923}, {0x1.0000000000020p+26, -0x1.8007ffff80c04p-29, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513}, {0x1.0000000000020p+26, -0x1.8007ffff80c04p-29, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513}, {-0x1.0000000000020p+26, 0x1.8007ffff80c04p-29, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513, 0x1.0000000000000p+576, 0x1.ffffe00000c00p+513}, {-0x1.0000000000020p+26, 0x1.8007ffff80c04p-29, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513, -0x1.0000000000000p+576, -0x1.ffffe00000c00p+513}, {0x1.7fffffff80000p-290, 0x1.f000000000000p-367, 0x1.000007ffffffep-351, 0x1.ffffff8000000p-427, 0x1.7fffffff80000p-290, 0x1.0001f80000000p-351}, {0x1.7fffffff80000p-290, 0x1.f000000000000p-367, -0x1.000007ffffffep-351, -0x1.ffffff8000000p-427, 0x1.7fffffff80000p-290, -0x1.fffc300000000p-352}, {-0x1.7fffffff80000p-290, -0x1.f000000000000p-367, 0x1.000007ffffffep-351, 0x1.ffffff8000000p-427, -0x1.7fffffff80000p-290, 0x1.fffc300000000p-352}, {-0x1.7fffffff80000p-290, -0x1.f000000000000p-367, -0x1.000007ffffffep-351, -0x1.ffffff8000000p-427, -0x1.7fffffff80000p-290, -0x1.0001f80000000p-351}, {0x1.0000000010000p-869, -0x1.0000000000000p-955, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304}, {0x1.0000000010000p-869, -0x1.0000000000000p-955, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304}, {-0x1.0000000010000p-869, 0x1.0000000000000p-955, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304, 0x1.0000000000000p-250, 0x1.c000003ffc3fep-304}, {-0x1.0000000010000p-869, 0x1.0000000000000p-955, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304, -0x1.0000000000000p-250, -0x1.c000003ffc3fep-304}, {0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297, 0x1.0000000000002p-749, -0x1.0000000000000p-854, 0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297}, {0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297, -0x1.0000000000002p-749, 0x1.0000000000000p-854, 0x1.00000ffff0800p-239, -0x1.fff80000ffc20p-297}, {-0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297, 0x1.0000000000002p-749, -0x1.0000000000000p-854, -0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297}, {-0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297, -0x1.0000000000002p-749, 0x1.0000000000000p-854, -0x1.00000ffff0800p-239, 0x1.fff80000ffc20p-297}, {0x1.000ffffc00000p+483, 0x1.fffff00000000p+414, 0x1.0000000000040p+210, -0x1.0000000000000p+105, 0x1.000ffffc00000p+483, 0x1.fffff00000000p+414}, {0x1.000ffffc00000p+483, 0x1.fffff00000000p+414, -0x1.0000000000040p+210, 0x1.0000000000000p+105, 0x1.000ffffc00000p+483, 0x1.fffff00000000p+414}, {-0x1.000ffffc00000p+483, -0x1.fffff00000000p+414, 0x1.0000000000040p+210, -0x1.0000000000000p+105, -0x1.000ffffc00000p+483, -0x1.fffff00000000p+414}, {-0x1.000ffffc00000p+483, -0x1.fffff00000000p+414, -0x1.0000000000040p+210, 0x1.0000000000000p+105, -0x1.000ffffc00000p+483, -0x1.fffff00000000p+414}, {0x1.0004000000000p-94, -0x1.0000000000000p-162, 0x1.0000000200000p-175, -0x1.ffbffffff8020p-233, 0x1.0004000000000p-94, -0x1.fff0000000000p-163}, {0x1.0004000000000p-94, -0x1.0000000000000p-162, -0x1.0000000200000p-175, 0x1.ffbffffff8020p-233, 0x1.0004000000000p-94, -0x1.0008000000000p-162}, {-0x1.0004000000000p-94, 0x1.0000000000000p-162, 0x1.0000000200000p-175, -0x1.ffbffffff8020p-233, -0x1.0004000000000p-94, 0x1.0008000000000p-162}, {-0x1.0004000000000p-94, 0x1.0000000000000p-162, -0x1.0000000200000p-175, 0x1.ffbffffff8020p-233, -0x1.0004000000000p-94, 0x1.fff0000000000p-163}, {0x1.0000000000000p-421, 0x1.e0001e7fbff00p-482, 0x1.0000001fffffep-395, 0x0.0000000000000p+0, 0x1.0000005fffffep-395, 0x1.e000000000000p-482}, {0x1.0000000000000p-421, 0x1.e0001e7fbff00p-482, -0x1.0000001fffffep-395, 0x0.0000000000000p+0, -0x1.ffffffbfffffcp-396, 0x1.e000200000000p-482}, {-0x1.0000000000000p-421, -0x1.e0001e7fbff00p-482, 0x1.0000001fffffep-395, 0x0.0000000000000p+0, 0x1.ffffffbfffffcp-396, -0x1.e000200000000p-482}, {-0x1.0000000000000p-421, -0x1.e0001e7fbff00p-482, -0x1.0000001fffffep-395, 0x0.0000000000000p+0, -0x1.0000005fffffep-395, -0x1.e000000000000p-482}, {0x1.0000000000fffp-362, 0x1.fffff3e000000p-435, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813}, {0x1.0000000000fffp-362, 0x1.fffff3e000000p-435, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813}, {-0x1.0000000000fffp-362, -0x1.fffff3e000000p-435, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813, 0x1.001ffe0000000p+872, 0x1.fffffffffffc0p+813}, {-0x1.0000000000fffp-362, -0x1.fffff3e000000p-435, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813, -0x1.001ffe0000000p+872, -0x1.fffffffffffc0p+813}, {0x1.0000080000000p+509, -0x1.0000000000000p+404, 0x1.0000000080000p-689, -0x1.0000000000000p-744, 0x1.0000080000000p+509, -0x1.0000000000000p+404}, {0x1.0000080000000p+509, -0x1.0000000000000p+404, -0x1.0000000080000p-689, 0x1.0000000000000p-744, 0x1.0000080000000p+509, -0x1.0000000000000p+404}, {-0x1.0000080000000p+509, 0x1.0000000000000p+404, 0x1.0000000080000p-689, -0x1.0000000000000p-744, -0x1.0000080000000p+509, 0x1.0000000000000p+404}, {-0x1.0000080000000p+509, 0x1.0000000000000p+404, -0x1.0000000080000p-689, 0x1.0000000000000p-744, -0x1.0000080000000p+509, 0x1.0000000000000p+404}, {0x1.003ffffffffe0p+511, 0x1.ffffe03800000p+435, 0x1.0000000002000p+705, -0x1.0000000000000p+652, 0x1.0000000002000p+705, -0x1.0000000000000p+652}, {0x1.003ffffffffe0p+511, 0x1.ffffe03800000p+435, -0x1.0000000002000p+705, 0x1.0000000000000p+652, -0x1.0000000002000p+705, 0x1.0000000000000p+652}, {-0x1.003ffffffffe0p+511, -0x1.ffffe03800000p+435, 0x1.0000000002000p+705, -0x1.0000000000000p+652, 0x1.0000000002000p+705, -0x1.0000000000000p+652}, {-0x1.003ffffffffe0p+511, -0x1.ffffe03800000p+435, -0x1.0000000002000p+705, 0x1.0000000000000p+652, -0x1.0000000002000p+705, 0x1.0000000000000p+652}, {0x1.0000000000008p-749, -0x1.ff000007ffc00p-809, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786}, {0x1.0000000000008p-749, -0x1.ff000007ffc00p-809, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786}, {-0x1.0000000000008p-749, 0x1.ff000007ffc00p-809, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786, 0x1.0000000060000p+866, 0x1.ffffff8000000p+786}, {-0x1.0000000000008p-749, 0x1.ff000007ffc00p-809, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786, -0x1.0000000060000p+866, -0x1.ffffff8000000p+786}, {0x1.0000000000080p+921, -0x1.0000000000000p+816, 0x1.01ffffff80001p+85, -0x1.ff90000000000p-8, 0x1.0000000000080p+921, -0x1.0000000000000p+816}, {0x1.0000000000080p+921, -0x1.0000000000000p+816, -0x1.01ffffff80001p+85, 0x1.ff90000000000p-8, 0x1.0000000000080p+921, -0x1.0000000000000p+816}, {-0x1.0000000000080p+921, 0x1.0000000000000p+816, 0x1.01ffffff80001p+85, -0x1.ff90000000000p-8, -0x1.0000000000080p+921, 0x1.0000000000000p+816}, {-0x1.0000000000080p+921, 0x1.0000000000000p+816, -0x1.01ffffff80001p+85, 0x1.ff90000000000p-8, -0x1.0000000000080p+921, 0x1.0000000000000p+816}, {0x1.0000000000800p-666, -0x1.fffff80002000p-732, 0x1.0008000000000p-639, -0x1.0000000000000p-718, 0x1.0008002000000p-639, 0x1.ffbffe0000000p-708}, {0x1.0000000000800p-666, -0x1.fffff80002000p-732, -0x1.0008000000000p-639, 0x1.0000000000000p-718, -0x1.0007ffe000000p-639, 0x1.001fff0000000p-707}, {-0x1.0000000000800p-666, 0x1.fffff80002000p-732, 0x1.0008000000000p-639, -0x1.0000000000000p-718, 0x1.0007ffe000000p-639, -0x1.001fff0000000p-707}, {-0x1.0000000000800p-666, 0x1.fffff80002000p-732, -0x1.0008000000000p-639, 0x1.0000000000000p-718, -0x1.0008002000000p-639, -0x1.ffbffe0000000p-708}, {0x1.0000000000002p+14, -0x1.ffffffe200000p-60, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70}, {0x1.0000000000002p+14, -0x1.ffffffe200000p-60, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70}, {-0x1.0000000000002p+14, 0x1.ffffffe200000p-60, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70, 0x1.0003fffffffc0p+133, 0x1.ffffe00000400p+70}, {-0x1.0000000000002p+14, 0x1.ffffffe200000p-60, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70, -0x1.0003fffffffc0p+133, -0x1.ffffe00000400p+70}, {0x1.000003f000000p+120, 0x1.fffffffe00000p+59, 0x1.0000000000ff0p+144, 0x1.c03fff0e00000p+70, 0x1.000001000102fp+144, 0x1.c07fff0e00000p+70}, {0x1.000003f000000p+120, 0x1.fffffffe00000p+59, -0x1.0000000000ff0p+144, -0x1.c03fff0e00000p+70, -0x1.fffffe0001f62p+143, -0x1.bfffff0e00000p+70}, {-0x1.000003f000000p+120, -0x1.fffffffe00000p+59, 0x1.0000000000ff0p+144, 0x1.c03fff0e00000p+70, 0x1.fffffe0001f62p+143, 0x1.bfffff0e00000p+70}, {-0x1.000003f000000p+120, -0x1.fffffffe00000p+59, -0x1.0000000000ff0p+144, -0x1.c03fff0e00000p+70, -0x1.000001000102fp+144, -0x1.c07fff0e00000p+70}, {0x1.0000000018000p+68, 0x1.fffffe0000000p-14, 0x1.0000100000000p+766, -0x1.0000000000000p+661, 0x1.0000100000000p+766, -0x1.0000000000000p+661}, {0x1.0000000018000p+68, 0x1.fffffe0000000p-14, -0x1.0000100000000p+766, 0x1.0000000000000p+661, -0x1.0000100000000p+766, 0x1.0000000000000p+661}, {-0x1.0000000018000p+68, -0x1.fffffe0000000p-14, 0x1.0000100000000p+766, -0x1.0000000000000p+661, 0x1.0000100000000p+766, -0x1.0000000000000p+661}, {-0x1.0000000018000p+68, -0x1.fffffe0000000p-14, -0x1.0000100000000p+766, 0x1.0000000000000p+661, -0x1.0000100000000p+766, 0x1.0000000000000p+661}, {0x1.0000000000001p-191, -0x1.fffffc1000000p-258, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256}, {0x1.0000000000001p-191, -0x1.fffffc1000000p-258, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256}, {-0x1.0000000000001p-191, 0x1.fffffc1000000p-258, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256, 0x1.1ffffff01f000p+311, 0x1.ffffc000060fcp+256}, {-0x1.0000000000001p-191, 0x1.fffffc1000000p-258, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256, -0x1.1ffffff01f000p+311, -0x1.ffffc000060fcp+256}, {0x1.0000003800000p-790, 0x1.ffe000001fffcp-845, 0x1.0000007fffff0p-815, 0x1.fe1ffffc00000p-877, 0x1.000000b800004p-790, 0x1.ffdfc0021e1fcp-845}, {0x1.0000003800000p-790, 0x1.ffe000001fffcp-845, -0x1.0000007fffff0p-815, -0x1.fe1ffffc00000p-877, 0x1.ffffff6fffff8p-791, 0x1.ffe03ffe21dfcp-845}, {-0x1.0000003800000p-790, -0x1.ffe000001fffcp-845, 0x1.0000007fffff0p-815, 0x1.fe1ffffc00000p-877, -0x1.ffffff6fffff8p-791, -0x1.ffe03ffe21dfcp-845}, {-0x1.0000003800000p-790, -0x1.ffe000001fffcp-845, -0x1.0000007fffff0p-815, -0x1.fe1ffffc00000p-877, -0x1.000000b800004p-790, -0x1.ffdfc0021e1fcp-845}, {0x1.0000001fffc00p-770, 0x1.f00007ffe0000p-834, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932}, {0x1.0000001fffc00p-770, 0x1.f00007ffe0000p-834, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932}, {-0x1.0000001fffc00p-770, -0x1.f00007ffe0000p-834, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932, 0x1.0000000000180p+996, 0x1.fffffe0000800p+932}, {-0x1.0000001fffc00p-770, -0x1.f00007ffe0000p-834, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932, -0x1.0000000000180p+996, -0x1.fffffe0000800p+932}, {0x1.0000000008000p+440, -0x1.c0000007ffe04p+385, 0x1.00000fffffffep-521, 0x1.fc00000000000p-620, 0x1.0000000008000p+440, -0x1.c0000007ffe04p+385}, {0x1.0000000008000p+440, -0x1.c0000007ffe04p+385, -0x1.00000fffffffep-521, -0x1.fc00000000000p-620, 0x1.0000000008000p+440, -0x1.c0000007ffe04p+385}, {-0x1.0000000008000p+440, 0x1.c0000007ffe04p+385, 0x1.00000fffffffep-521, 0x1.fc00000000000p-620, -0x1.0000000008000p+440, 0x1.c0000007ffe04p+385}, {-0x1.0000000008000p+440, 0x1.c0000007ffe04p+385, -0x1.00000fffffffep-521, -0x1.fc00000000000p-620, -0x1.0000000008000p+440, 0x1.c0000007ffe04p+385}, {0x1.0000003e00004p-731, -0x1.fe00040000000p-801, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419}, {0x1.0000003e00004p-731, -0x1.fe00040000000p-801, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419}, {-0x1.0000003e00004p-731, 0x1.fe00040000000p-801, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419, 0x1.00007c0001e00p+483, 0x1.fffe13ffe0000p+419}, {-0x1.0000003e00004p-731, 0x1.fe00040000000p-801, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419, -0x1.00007c0001e00p+483, -0x1.fffe13ffe0000p+419}, {0x1.03fffffffc000p-192, 0x1.ffffffc000000p-267, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554}, {0x1.03fffffffc000p-192, 0x1.ffffffc000000p-267, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554}, {-0x1.03fffffffc000p-192, -0x1.ffffffc000000p-267, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554, 0x1.0003ffffff000p+649, 0x1.ffc0000000000p+554}, {-0x1.03fffffffc000p-192, -0x1.ffffffc000000p-267, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554, -0x1.0003ffffff000p+649, -0x1.ffc0000000000p+554}, {0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230, 0x1.0000000000004p-464, -0x1.fffc000200000p-533, 0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230}, {0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230, -0x1.0000000000004p-464, 0x1.fffc000200000p-533, 0x1.07ffffff80000p+301, 0x1.8007ffffc0000p+230}, {-0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230, 0x1.0000000000004p-464, -0x1.fffc000200000p-533, -0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230}, {-0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230, -0x1.0000000000004p-464, 0x1.fffc000200000p-533, -0x1.07ffffff80000p+301, -0x1.8007ffffc0000p+230}, {0x1.00003ffffff80p-1007, 0x1.0000000000000p-1068, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {0x1.00003ffffff80p-1007, 0x1.0000000000000p-1068, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {-0x1.00003ffffff80p-1007, -0x1.0000000000000p-1068, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0, 0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {-0x1.00003ffffff80p-1007, -0x1.0000000000000p-1068, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0, -0x1.00003fffffff8p+0, 0x0.0000000000000p+0}, {0x1.0000010000000p-912, -0x1.0000000000000p-1017, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60}, {0x1.0000010000000p-912, -0x1.0000000000000p-1017, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60}, {-0x1.0000010000000p-912, 0x1.0000000000000p-1017, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60, 0x1.00f81ffffff81p+122, 0x1.fffff03c00000p+60}, {-0x1.0000010000000p-912, 0x1.0000000000000p-1017, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60, -0x1.00f81ffffff81p+122, -0x1.fffff03c00000p+60}, {0x1.0000000000004p+652, -0x1.fff0008000000p+588, 0x1.0000000100000p+402, -0x1.fffffe0004000p+335, 0x1.0000000000004p+652, -0x1.fff0008000000p+588}, {0x1.0000000000004p+652, -0x1.fff0008000000p+588, -0x1.0000000100000p+402, 0x1.fffffe0004000p+335, 0x1.0000000000004p+652, -0x1.fff0008000000p+588}, {-0x1.0000000000004p+652, 0x1.fff0008000000p+588, 0x1.0000000100000p+402, -0x1.fffffe0004000p+335, -0x1.0000000000004p+652, 0x1.fff0008000000p+588}, {-0x1.0000000000004p+652, 0x1.fff0008000000p+588, -0x1.0000000100000p+402, 0x1.fffffe0004000p+335, -0x1.0000000000004p+652, 0x1.fff0008000000p+588}, {0x1.0000000000800p-11, -0x1.0000000000000p-89, 0x1.0000010000000p+68, -0x1.0000000000000p-35, 0x1.0000010000000p+68, 0x1.fffffe0000000p-12}, {0x1.0000000000800p-11, -0x1.0000000000000p-89, -0x1.0000010000000p+68, 0x1.0000000000000p-35, -0x1.0000010000000p+68, 0x1.0000010000000p-11}, {-0x1.0000000000800p-11, 0x1.0000000000000p-89, 0x1.0000010000000p+68, -0x1.0000000000000p-35, 0x1.0000010000000p+68, -0x1.0000010000000p-11}, {-0x1.0000000000800p-11, 0x1.0000000000000p-89, -0x1.0000010000000p+68, 0x1.0000000000000p-35, -0x1.0000010000000p+68, -0x1.fffffe0000000p-12}, {0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842, 0x1.0000007c00000p-1007, 0x0.0000000000000p+0, 0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842}, {0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842, -0x1.0000007c00000p-1007, -0x0.0000000000000p+0, 0x1.00000007fff00p+898, 0x1.fffc1ffff87f0p+842}, {-0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842, 0x1.0000007c00000p-1007, 0x0.0000000000000p+0, -0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842}, {-0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842, -0x1.0000007c00000p-1007, -0x0.0000000000000p+0, -0x1.00000007fff00p+898, -0x1.fffc1ffff87f0p+842}, {0x1.fffffffe00000p+397, 0x1.e000001fff800p+333, 0x1.00000001ffffep+347, 0x0.0000000000000p+0, 0x1.fffffffe00004p+397, 0x1.e000801ff7800p+333}, {0x1.fffffffe00000p+397, 0x1.e000001fff800p+333, -0x1.00000001ffffep+347, 0x0.0000000000000p+0, 0x1.fffffffdffffcp+397, 0x1.dfff802007800p+333}, {-0x1.fffffffe00000p+397, -0x1.e000001fff800p+333, 0x1.00000001ffffep+347, 0x0.0000000000000p+0, -0x1.fffffffdffffcp+397, -0x1.dfff802007800p+333}, {-0x1.fffffffe00000p+397, -0x1.e000001fff800p+333, -0x1.00000001ffffep+347, 0x0.0000000000000p+0, -0x1.fffffffe00004p+397, -0x1.e000801ff7800p+333}, {0x1.0000000000008p-231, -0x1.fffff00400000p-303, 0x1.00003ffffe000p-829, 0x1.ffffe00000000p-901, 0x1.0000000000008p-231, -0x1.fffff00400000p-303}, {0x1.0000000000008p-231, -0x1.fffff00400000p-303, -0x1.00003ffffe000p-829, -0x1.ffffe00000000p-901, 0x1.0000000000008p-231, -0x1.fffff00400000p-303}, {-0x1.0000000000008p-231, 0x1.fffff00400000p-303, 0x1.00003ffffe000p-829, 0x1.ffffe00000000p-901, -0x1.0000000000008p-231, 0x1.fffff00400000p-303}, {-0x1.0000000000008p-231, 0x1.fffff00400000p-303, -0x1.00003ffffe000p-829, -0x1.ffffe00000000p-901, -0x1.0000000000008p-231, 0x1.fffff00400000p-303}, {0x1.0000000000000p-479, 0x1.ffffffffffc00p-542, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414}, {0x1.0000000000000p-479, 0x1.ffffffffffc00p-542, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414}, {-0x1.0000000000000p-479, -0x1.ffffffffffc00p-542, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414, 0x1.000001ffe0000p-355, 0x1.ff87ff9f801c0p-414}, {-0x1.0000000000000p-479, -0x1.ffffffffffc00p-542, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414, -0x1.000001ffe0000p-355, -0x1.ff87ff9f801c0p-414}, {0x1.0000000000400p-496, -0x1.f800000002000p-557, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116}, {0x1.0000000000400p-496, -0x1.f800000002000p-557, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116}, {-0x1.0000000000400p-496, 0x1.f800000002000p-557, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116, 0x1.03fffffffff00p-62, 0x1.fffe7fffffffep-116}, {-0x1.0000000000400p-496, 0x1.f800000002000p-557, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116, -0x1.03fffffffff00p-62, -0x1.fffe7fffffffep-116}, {0x1.0000000000000p+267, 0x1.fffffffffff00p+211, 0x1.000007c000000p+439, 0x1.fff8000000000p+383, 0x1.000007c000000p+439, 0x1.fff8000000000p+383}, {0x1.0000000000000p+267, 0x1.fffffffffff00p+211, -0x1.000007c000000p+439, -0x1.fff8000000000p+383, -0x1.000007c000000p+439, -0x1.fff8000000000p+383}, {-0x1.0000000000000p+267, -0x1.fffffffffff00p+211, 0x1.000007c000000p+439, 0x1.fff8000000000p+383, 0x1.000007c000000p+439, 0x1.fff8000000000p+383}, {-0x1.0000000000000p+267, -0x1.fffffffffff00p+211, -0x1.000007c000000p+439, -0x1.fff8000000000p+383, -0x1.000007c000000p+439, -0x1.fff8000000000p+383}, {0x1.0000000000400p-383, -0x1.fffc0003fffd0p-440, 0x1.0000000000000p+249, 0x1.fffffff800000p+193, 0x1.0000000000000p+249, 0x1.fffffff800000p+193}, {0x1.0000000000400p-383, -0x1.fffc0003fffd0p-440, -0x1.0000000000000p+249, -0x1.fffffff800000p+193, -0x1.0000000000000p+249, -0x1.fffffff800000p+193}, {-0x1.0000000000400p-383, 0x1.fffc0003fffd0p-440, 0x1.0000000000000p+249, 0x1.fffffff800000p+193, 0x1.0000000000000p+249, 0x1.fffffff800000p+193}, {-0x1.0000000000400p-383, 0x1.fffc0003fffd0p-440, -0x1.0000000000000p+249, -0x1.fffffff800000p+193, -0x1.0000000000000p+249, -0x1.fffffff800000p+193}, {0x1.0000000002000p-673, -0x1.ffff040000000p-744, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862}, {0x1.0000000002000p-673, -0x1.ffff040000000p-744, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862}, {-0x1.0000000002000p-673, 0x1.ffff040000000p-744, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862, 0x1.03fffff800000p+930, 0x1.fffffe0000000p+862}, {-0x1.0000000002000p-673, 0x1.ffff040000000p-744, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862, -0x1.03fffff800000p+930, -0x1.fffffe0000000p+862}, {0x1.0000008000000p+436, -0x1.ffffff8200000p+379, 0x1.000fff8000000p-8, 0x1.fffffe0000000p-70, 0x1.0000008000000p+436, -0x1.ffffff8200000p+379}, {0x1.0000008000000p+436, -0x1.ffffff8200000p+379, -0x1.000fff8000000p-8, -0x1.fffffe0000000p-70, 0x1.0000008000000p+436, -0x1.ffffff8200000p+379}, {-0x1.0000008000000p+436, 0x1.ffffff8200000p+379, 0x1.000fff8000000p-8, 0x1.fffffe0000000p-70, -0x1.0000008000000p+436, 0x1.ffffff8200000p+379}, {-0x1.0000008000000p+436, 0x1.ffffff8200000p+379, -0x1.000fff8000000p-8, -0x1.fffffe0000000p-70, -0x1.0000008000000p+436, 0x1.ffffff8200000p+379}, {0x1.0000000000000p+138, 0x1.0001f9e000000p+78, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366}, {0x1.0000000000000p+138, 0x1.0001f9e000000p+78, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366}, {-0x1.0000000000000p+138, -0x1.0001f9e000000p+78, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366, 0x1.0000000000040p+438, -0x1.fffffc0080000p+366}, {-0x1.0000000000000p+138, -0x1.0001f9e000000p+78, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366, -0x1.0000000000040p+438, 0x1.fffffc0080000p+366}, {0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888, 0x1.0000010000000p+582, -0x1.ffc007ffffe20p+524, 0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888}, {0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888, -0x1.0000010000000p+582, 0x1.ffc007ffffe20p+524, 0x1.0000ff0007e00p+955, 0x1.ffc001ff00000p+888}, {-0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888, 0x1.0000010000000p+582, -0x1.ffc007ffffe20p+524, -0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888}, {-0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888, -0x1.0000010000000p+582, 0x1.ffc007ffffe20p+524, -0x1.0000ff0007e00p+955, -0x1.ffc001ff00000p+888}, {0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694, 0x1.0040000000000p-580, -0x1.c000000400000p-641, 0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694}, {0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694, -0x1.0040000000000p-580, 0x1.c000000400000p-641, 0x1.07ffffff1fe00p+791, 0x1.fc00000000000p+694}, {-0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694, 0x1.0040000000000p-580, -0x1.c000000400000p-641, -0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694}, {-0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694, -0x1.0040000000000p-580, 0x1.c000000400000p-641, -0x1.07ffffff1fe00p+791, -0x1.fc00000000000p+694}, {0x1.0080000000000p-806, -0x1.0000000000000p-911, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541}, {0x1.0080000000000p-806, -0x1.0000000000000p-911, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541}, {-0x1.0080000000000p-806, 0x1.0000000000000p-911, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541, 0x1.00000001fffc0p+613, 0x1.fffff80f80000p+541}, {-0x1.0080000000000p-806, 0x1.0000000000000p-911, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541, -0x1.00000001fffc0p+613, -0x1.fffff80f80000p+541}, {0x1.000000003ff00p-698, 0x0.0000000000000p+0, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362}, {0x1.000000003ff00p-698, 0x0.0000000000000p+0, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362}, {-0x1.000000003ff00p-698, 0x0.0000000000000p+0, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362, 0x1.0000000000000p-302, 0x1.f83007ffffe00p-362}, {-0x1.000000003ff00p-698, 0x0.0000000000000p+0, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362, -0x1.0000000000000p-302, -0x1.f83007ffffe00p-362}, {0x1.00003fffffe00p-546, 0x1.fffffc0000380p-606, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386}, {0x1.00003fffffe00p-546, 0x1.fffffc0000380p-606, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386}, {-0x1.00003fffffe00p-546, -0x1.fffffc0000380p-606, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386, 0x1.0000010000000p-330, -0x1.ffffff8000008p-386}, {-0x1.00003fffffe00p-546, -0x1.fffffc0000380p-606, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386, -0x1.0000010000000p-330, 0x1.ffffff8000008p-386}, {0x1.0000000080000p-450, -0x1.fffffc0010000p-519, 0x1.3fffff8000000p-829, 0x1.fffff800fe000p-895, 0x1.0000000080000p-450, -0x1.fffffc0010000p-519}, {0x1.0000000080000p-450, -0x1.fffffc0010000p-519, -0x1.3fffff8000000p-829, -0x1.fffff800fe000p-895, 0x1.0000000080000p-450, -0x1.fffffc0010000p-519}, {-0x1.0000000080000p-450, 0x1.fffffc0010000p-519, 0x1.3fffff8000000p-829, 0x1.fffff800fe000p-895, -0x1.0000000080000p-450, 0x1.fffffc0010000p-519}, {-0x1.0000000080000p-450, 0x1.fffffc0010000p-519, -0x1.3fffff8000000p-829, -0x1.fffff800fe000p-895, -0x1.0000000080000p-450, 0x1.fffffc0010000p-519}, {0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794, 0x1.0000000000000p+214, 0x1.fc1fffc0000fep+160, 0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794}, {0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794, -0x1.0000000000000p+214, -0x1.fc1fffc0000fep+160, 0x1.0003f001fc3f0p+850, 0x1.fffffc0000000p+794}, {-0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794, 0x1.0000000000000p+214, 0x1.fc1fffc0000fep+160, -0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794}, {-0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794, -0x1.0000000000000p+214, -0x1.fc1fffc0000fep+160, -0x1.0003f001fc3f0p+850, -0x1.fffffc0000000p+794}, {0x1.0000000000000p+702, 0x1.fffffffffffc0p+643, 0x1.0000000000000p-646, 0x1.ffffffffffe00p-708, 0x1.0000000000000p+702, 0x1.fffffffffffc0p+643}, {0x1.0000000000000p+702, 0x1.fffffffffffc0p+643, -0x1.0000000000000p-646, -0x1.ffffffffffe00p-708, 0x1.0000000000000p+702, 0x1.fffffffffffc0p+643}, {-0x1.0000000000000p+702, -0x1.fffffffffffc0p+643, 0x1.0000000000000p-646, 0x1.ffffffffffe00p-708, -0x1.0000000000000p+702, -0x1.fffffffffffc0p+643}, {-0x1.0000000000000p+702, -0x1.fffffffffffc0p+643, -0x1.0000000000000p-646, -0x1.ffffffffffe00p-708, -0x1.0000000000000p+702, -0x1.fffffffffffc0p+643}, {0x1.0000000100000p+167, -0x1.0000000000000p+88, 0x1.0000004000000p+455, -0x1.0000000000000p+375, 0x1.0000004000000p+455, -0x1.0000000000000p+375}, {0x1.0000000100000p+167, -0x1.0000000000000p+88, -0x1.0000004000000p+455, 0x1.0000000000000p+375, -0x1.0000004000000p+455, 0x1.0000000000000p+375}, {-0x1.0000000100000p+167, 0x1.0000000000000p+88, 0x1.0000004000000p+455, -0x1.0000000000000p+375, 0x1.0000004000000p+455, -0x1.0000000000000p+375}, {-0x1.0000000100000p+167, 0x1.0000000000000p+88, -0x1.0000004000000p+455, 0x1.0000000000000p+375, -0x1.0000004000000p+455, 0x1.0000000000000p+375}, {0x1.0000010000000p+394, -0x1.ffffe00001000p+338, 0x1.000ffffff007fp-145, 0x1.ffffc00000000p-226, 0x1.0000010000000p+394, -0x1.ffffe00001000p+338}, {0x1.0000010000000p+394, -0x1.ffffe00001000p+338, -0x1.000ffffff007fp-145, -0x1.ffffc00000000p-226, 0x1.0000010000000p+394, -0x1.ffffe00001000p+338}, {-0x1.0000010000000p+394, 0x1.ffffe00001000p+338, 0x1.000ffffff007fp-145, 0x1.ffffc00000000p-226, -0x1.0000010000000p+394, 0x1.ffffe00001000p+338}, {-0x1.0000010000000p+394, 0x1.ffffe00001000p+338, -0x1.000ffffff007fp-145, -0x1.ffffc00000000p-226, -0x1.0000010000000p+394, 0x1.ffffe00001000p+338}, {0x1.1000fffffc000p+16, 0x1.fffffc003f000p-40, 0x1.0000000001000p+243, -0x1.0000000000000p+138, 0x1.0000000001000p+243, -0x1.0000000000000p+138}, {0x1.1000fffffc000p+16, 0x1.fffffc003f000p-40, -0x1.0000000001000p+243, 0x1.0000000000000p+138, -0x1.0000000001000p+243, 0x1.0000000000000p+138}, {-0x1.1000fffffc000p+16, -0x1.fffffc003f000p-40, 0x1.0000000001000p+243, -0x1.0000000000000p+138, 0x1.0000000001000p+243, -0x1.0000000000000p+138}, {-0x1.1000fffffc000p+16, -0x1.fffffc003f000p-40, -0x1.0000000001000p+243, 0x1.0000000000000p+138, -0x1.0000000001000p+243, 0x1.0000000000000p+138}, {0x1.00000fff80000p+494, 0x1.fffe000000000p+409, 0x1.0000001f00000p-623, 0x1.fffffff000000p-700, 0x1.00000fff80000p+494, 0x1.fffe000000000p+409}, {0x1.00000fff80000p+494, 0x1.fffe000000000p+409, -0x1.0000001f00000p-623, -0x1.fffffff000000p-700, 0x1.00000fff80000p+494, 0x1.fffe000000000p+409}, {-0x1.00000fff80000p+494, -0x1.fffe000000000p+409, 0x1.0000001f00000p-623, 0x1.fffffff000000p-700, -0x1.00000fff80000p+494, -0x1.fffe000000000p+409}, {-0x1.00000fff80000p+494, -0x1.fffe000000000p+409, -0x1.0000001f00000p-623, -0x1.fffffff000000p-700, -0x1.00000fff80000p+494, -0x1.fffe000000000p+409}, {0x1.3fdfffff02000p-533, -0x1.0000000000000p-611, 0x1.0000000000000p-602, 0x1.ffffffffffe00p-663, 0x1.3fdfffff02000p-533, 0x1.ff00000000000p-603}, {0x1.3fdfffff02000p-533, -0x1.0000000000000p-611, -0x1.0000000000000p-602, -0x1.ffffffffffe00p-663, 0x1.3fdfffff02000p-533, -0x1.0080000000000p-602}, {-0x1.3fdfffff02000p-533, 0x1.0000000000000p-611, 0x1.0000000000000p-602, 0x1.ffffffffffe00p-663, -0x1.3fdfffff02000p-533, 0x1.0080000000000p-602}, {-0x1.3fdfffff02000p-533, 0x1.0000000000000p-611, -0x1.0000000000000p-602, -0x1.ffffffffffe00p-663, -0x1.3fdfffff02000p-533, -0x1.ff00000000000p-603}, {0x1.0000000000008p-274, -0x1.e0ffffd002000p-340, 0x1.0000000000400p-229, 0x1.ffffffff03ffep-283, 0x1.0000000000480p-229, 0x1.ffffffff04ffep-283}, {0x1.0000000000008p-274, -0x1.e0ffffd002000p-340, -0x1.0000000000400p-229, -0x1.ffffffff03ffep-283, -0x1.0000000000380p-229, -0x1.ffffffff02ffep-283}, {-0x1.0000000000008p-274, 0x1.e0ffffd002000p-340, 0x1.0000000000400p-229, 0x1.ffffffff03ffep-283, 0x1.0000000000380p-229, 0x1.ffffffff02ffep-283}, {-0x1.0000000000008p-274, 0x1.e0ffffd002000p-340, -0x1.0000000000400p-229, -0x1.ffffffff03ffep-283, -0x1.0000000000480p-229, -0x1.ffffffff04ffep-283}, {0x1.000000fffe020p-113, -0x1.f800100000000p-186, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84}, {0x1.000000fffe020p-113, -0x1.f800100000000p-186, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84}, {-0x1.000000fffe020p-113, 0x1.f800100000000p-186, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84, 0x1.0001fff80ffc0p+13, 0x1.ff00000000000p-84}, {-0x1.000000fffe020p-113, 0x1.f800100000000p-186, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84, -0x1.0001fff80ffc0p+13, -0x1.ff00000000000p-84}, {0x1.4000000000000p+455, -0x1.0000000000000p+350, 0x1.0000000000010p-968, 0x1.e000000000000p-1036, 0x1.4000000000000p+455, -0x1.0000000000000p+350}, {0x1.4000000000000p+455, -0x1.0000000000000p+350, -0x1.0000000000010p-968, -0x1.e000000000000p-1036, 0x1.4000000000000p+455, -0x1.0000000000000p+350}, {-0x1.4000000000000p+455, 0x1.0000000000000p+350, 0x1.0000000000010p-968, 0x1.e000000000000p-1036, -0x1.4000000000000p+455, 0x1.0000000000000p+350}, {-0x1.4000000000000p+455, 0x1.0000000000000p+350, -0x1.0000000000010p-968, -0x1.e000000000000p-1036, -0x1.4000000000000p+455, 0x1.0000000000000p+350}, {0x1.2000000000000p+333, -0x1.fffffff01ff20p+276, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644}, {0x1.2000000000000p+333, -0x1.fffffff01ff20p+276, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644}, {-0x1.2000000000000p+333, 0x1.fffffff01ff20p+276, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644, 0x1.0000000000000p+701, 0x1.fff8003ff0000p+644}, {-0x1.2000000000000p+333, 0x1.fffffff01ff20p+276, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644, -0x1.0000000000000p+701, -0x1.fff8003ff0000p+644}, {0x1.2000000000000p+275, -0x1.fc08000000000p+183, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681}, {0x1.2000000000000p+275, -0x1.fc08000000000p+183, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681}, {-0x1.2000000000000p+275, 0x1.fc08000000000p+183, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681, 0x1.0000000038004p+750, -0x1.fffffc4000000p+681}, {-0x1.2000000000000p+275, 0x1.fc08000000000p+183, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681, -0x1.0000000038004p+750, 0x1.fffffc4000000p+681}, {0x1.0000000000200p+680, 0x0.0000000000000p+0, 0x1.00001ffff0000p-146, 0x1.ffff80001f000p-203, 0x1.0000000000200p+680, 0x0.0000000000000p+0}, {0x1.0000000000200p+680, 0x0.0000000000000p+0, -0x1.00001ffff0000p-146, -0x1.ffff80001f000p-203, 0x1.0000000000200p+680, 0x0.0000000000000p+0}, {-0x1.0000000000200p+680, 0x0.0000000000000p+0, 0x1.00001ffff0000p-146, 0x1.ffff80001f000p-203, -0x1.0000000000200p+680, 0x0.0000000000000p+0}, {-0x1.0000000000200p+680, 0x0.0000000000000p+0, -0x1.00001ffff0000p-146, -0x1.ffff80001f000p-203, -0x1.0000000000200p+680, 0x0.0000000000000p+0}, {0x1.0000100000000p-400, -0x1.0000000000000p-505, 0x1.0038000800000p-754, -0x1.fffffe0000080p-814, 0x1.0000100000000p-400, -0x1.0000000000000p-505}, {0x1.0000100000000p-400, -0x1.0000000000000p-505, -0x1.0038000800000p-754, 0x1.fffffe0000080p-814, 0x1.0000100000000p-400, -0x1.0000000000000p-505}, {-0x1.0000100000000p-400, 0x1.0000000000000p-505, 0x1.0038000800000p-754, -0x1.fffffe0000080p-814, -0x1.0000100000000p-400, 0x1.0000000000000p-505}, {-0x1.0000100000000p-400, 0x1.0000000000000p-505, -0x1.0038000800000p-754, 0x1.fffffe0000080p-814, -0x1.0000100000000p-400, 0x1.0000000000000p-505}, {0x1.0000000000004p+838, -0x1.ffffe00400000p+765, 0x1.0000000000000p-355, 0x1.ffffffffffff8p-411, 0x1.0000000000004p+838, -0x1.ffffe00400000p+765}, {0x1.0000000000004p+838, -0x1.ffffe00400000p+765, -0x1.0000000000000p-355, -0x1.ffffffffffff8p-411, 0x1.0000000000004p+838, -0x1.ffffe00400000p+765}, {-0x1.0000000000004p+838, 0x1.ffffe00400000p+765, 0x1.0000000000000p-355, 0x1.ffffffffffff8p-411, -0x1.0000000000004p+838, 0x1.ffffe00400000p+765}, {-0x1.0000000000004p+838, 0x1.ffffe00400000p+765, -0x1.0000000000000p-355, -0x1.ffffffffffff8p-411, -0x1.0000000000004p+838, 0x1.ffffe00400000p+765}, {0x1.0000000000100p+877, -0x1.ffffe7e400000p+807, 0x1.1ffe000008000p+922, -0x1.fffc000004000p+855, 0x1.1ffe000008080p+922, -0x1.fffbfc0004000p+855}, {0x1.0000000000100p+877, -0x1.ffffe7e400000p+807, -0x1.1ffe000008000p+922, 0x1.fffc000004000p+855, -0x1.1ffe000007f80p+922, 0x1.fffc040004000p+855}, {-0x1.0000000000100p+877, 0x1.ffffe7e400000p+807, 0x1.1ffe000008000p+922, -0x1.fffc000004000p+855, 0x1.1ffe000007f80p+922, -0x1.fffc040004000p+855}, {-0x1.0000000000100p+877, 0x1.ffffe7e400000p+807, -0x1.1ffe000008000p+922, 0x1.fffc000004000p+855, -0x1.1ffe000008080p+922, 0x1.fffbfc0004000p+855}, {0x1.0000000000004p-490, -0x1.0000000000000p-595, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413}, {0x1.0000000000004p-490, -0x1.0000000000000p-595, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413}, {-0x1.0000000000004p-490, 0x1.0000000000000p-595, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413, 0x1.00000007ffffep-352, 0x1.ffffe000f0000p-413}, {-0x1.0000000000004p-490, 0x1.0000000000000p-595, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413, -0x1.00000007ffffep-352, -0x1.ffffe000f0000p-413}, {0x1.0000000000000p-458, 0x1.fffffff000000p-519, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712}, {0x1.0000000000000p-458, 0x1.fffffff000000p-519, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712}, {-0x1.0000000000000p-458, -0x1.fffffff000000p-519, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712, 0x1.0001fffc00001p+791, -0x1.0000000000000p+712}, {-0x1.0000000000000p-458, -0x1.fffffff000000p-519, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712, -0x1.0001fffc00001p+791, 0x1.0000000000000p+712}, {0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803, 0x1.0080000000000p-983, -0x0.0000000000000p+0, 0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803}, {0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803, -0x1.0080000000000p-983, 0x0.0000000000000p+0, 0x1.00007fdfffff0p-745, 0x1.fff000f803fe0p-803}, {-0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803, 0x1.0080000000000p-983, -0x0.0000000000000p+0, -0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803}, {-0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803, -0x1.0080000000000p-983, 0x0.0000000000000p+0, -0x1.00007fdfffff0p-745, -0x1.fff000f803fe0p-803}, {0x1.0000000000080p-788, 0x0.0000000000000p+0, 0x1.0000080000000p+973, -0x1.0000000000000p+888, 0x1.0000080000000p+973, -0x1.0000000000000p+888}, {0x1.0000000000080p-788, 0x0.0000000000000p+0, -0x1.0000080000000p+973, 0x1.0000000000000p+888, -0x1.0000080000000p+973, 0x1.0000000000000p+888}, {-0x1.0000000000080p-788, 0x0.0000000000000p+0, 0x1.0000080000000p+973, -0x1.0000000000000p+888, 0x1.0000080000000p+973, -0x1.0000000000000p+888}, {-0x1.0000000000080p-788, 0x0.0000000000000p+0, -0x1.0000080000000p+973, 0x1.0000000000000p+888, -0x1.0000080000000p+973, 0x1.0000000000000p+888}, {0x1.0400000000000p-287, -0x1.0000000000000p-392, 0x1.0000000000400p+736, -0x1.fffff00008000p+680, 0x1.0000000000400p+736, -0x1.fffff00008000p+680}, {0x1.0400000000000p-287, -0x1.0000000000000p-392, -0x1.0000000000400p+736, 0x1.fffff00008000p+680, -0x1.0000000000400p+736, 0x1.fffff00008000p+680}, {-0x1.0400000000000p-287, 0x1.0000000000000p-392, 0x1.0000000000400p+736, -0x1.fffff00008000p+680, 0x1.0000000000400p+736, -0x1.fffff00008000p+680}, {-0x1.0400000000000p-287, 0x1.0000000000000p-392, -0x1.0000000000400p+736, 0x1.fffff00008000p+680, -0x1.0000000000400p+736, 0x1.fffff00008000p+680}, {0x1.0000000000001p+232, -0x1.fc0000c004000p+167, 0x1.0000000000200p+192, -0x1.ffe0000200000p+124, 0x1.0000000001001p+232, -0x1.fbffc0c004000p+167}, {0x1.0000000000001p+232, -0x1.fc0000c004000p+167, -0x1.0000000000200p+192, 0x1.ffe0000200000p+124, 0x1.fffffffffe002p+231, -0x1.fc0040c004000p+167}, {-0x1.0000000000001p+232, 0x1.fc0000c004000p+167, 0x1.0000000000200p+192, -0x1.ffe0000200000p+124, -0x1.fffffffffe002p+231, 0x1.fc0040c004000p+167}, {-0x1.0000000000001p+232, 0x1.fc0000c004000p+167, -0x1.0000000000200p+192, 0x1.ffe0000200000p+124, -0x1.0000000001001p+232, 0x1.fbffc0c004000p+167}, {0x1.00000c0000004p+583, -0x1.ff80000800000p+515, 0x1.18003ffff8000p-786, 0x1.ffffff8000000p-852, 0x1.00000c0000004p+583, -0x1.ff80000800000p+515}, {0x1.00000c0000004p+583, -0x1.ff80000800000p+515, -0x1.18003ffff8000p-786, -0x1.ffffff8000000p-852, 0x1.00000c0000004p+583, -0x1.ff80000800000p+515}, {-0x1.00000c0000004p+583, 0x1.ff80000800000p+515, 0x1.18003ffff8000p-786, 0x1.ffffff8000000p-852, -0x1.00000c0000004p+583, 0x1.ff80000800000p+515}, {-0x1.00000c0000004p+583, 0x1.ff80000800000p+515, -0x1.18003ffff8000p-786, -0x1.ffffff8000000p-852, -0x1.00000c0000004p+583, 0x1.ff80000800000p+515}, {0x1.1ffff80000040p+488, -0x1.0000000000000p+398, 0x1.000000000fe00p-510, 0x1.ffff7e0003ff8p-566, 0x1.1ffff80000040p+488, -0x1.0000000000000p+398}, {0x1.1ffff80000040p+488, -0x1.0000000000000p+398, -0x1.000000000fe00p-510, -0x1.ffff7e0003ff8p-566, 0x1.1ffff80000040p+488, -0x1.0000000000000p+398}, {-0x1.1ffff80000040p+488, 0x1.0000000000000p+398, 0x1.000000000fe00p-510, 0x1.ffff7e0003ff8p-566, -0x1.1ffff80000040p+488, 0x1.0000000000000p+398}, {-0x1.1ffff80000040p+488, 0x1.0000000000000p+398, -0x1.000000000fe00p-510, -0x1.ffff7e0003ff8p-566, -0x1.1ffff80000040p+488, 0x1.0000000000000p+398}, {0x1.3fc0000040000p+871, -0x1.fffffff802000p+815, 0x1.fffffffffff00p-663, 0x0.0000000000000p+0, 0x1.3fc0000040000p+871, -0x1.fffffff802000p+815}, {0x1.3fc0000040000p+871, -0x1.fffffff802000p+815, -0x1.fffffffffff00p-663, 0x0.0000000000000p+0, 0x1.3fc0000040000p+871, -0x1.fffffff802000p+815}, {-0x1.3fc0000040000p+871, 0x1.fffffff802000p+815, 0x1.fffffffffff00p-663, 0x0.0000000000000p+0, -0x1.3fc0000040000p+871, 0x1.fffffff802000p+815}, {-0x1.3fc0000040000p+871, 0x1.fffffff802000p+815, -0x1.fffffffffff00p-663, 0x0.0000000000000p+0, -0x1.3fc0000040000p+871, 0x1.fffffff802000p+815}, {0x1.00000001fffffp-628, 0x1.00001f8000000p-699, 0x1.0000000000200p-312, -0x1.0000000000000p-417, 0x1.0000000000200p-312, -0x1.0000000000000p-417}, {0x1.00000001fffffp-628, 0x1.00001f8000000p-699, -0x1.0000000000200p-312, 0x1.0000000000000p-417, -0x1.0000000000200p-312, 0x1.0000000000000p-417}, {-0x1.00000001fffffp-628, -0x1.00001f8000000p-699, 0x1.0000000000200p-312, -0x1.0000000000000p-417, 0x1.0000000000200p-312, -0x1.0000000000000p-417}, {-0x1.00000001fffffp-628, -0x1.00001f8000000p-699, -0x1.0000000000200p-312, 0x1.0000000000000p-417, -0x1.0000000000200p-312, 0x1.0000000000000p-417}, {0x1.0000000010000p+23, -0x1.0000000000000p-54, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268}, {0x1.0000000010000p+23, -0x1.0000000000000p-54, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268}, {-0x1.0000000010000p+23, 0x1.0000000000000p-54, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268, 0x1.1fff010000000p+322, 0x1.ff8c0000007fep+268}, {-0x1.0000000010000p+23, 0x1.0000000000000p-54, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268, -0x1.1fff010000000p+322, -0x1.ff8c0000007fep+268}, {0x1.0000000000002p-4, -0x1.0000000000000p-91, 0x1.0000000000200p+643, -0x1.0000000000000p+558, 0x1.0000000000200p+643, -0x1.0000000000000p+558}, {0x1.0000000000002p-4, -0x1.0000000000000p-91, -0x1.0000000000200p+643, 0x1.0000000000000p+558, -0x1.0000000000200p+643, 0x1.0000000000000p+558}, {-0x1.0000000000002p-4, 0x1.0000000000000p-91, 0x1.0000000000200p+643, -0x1.0000000000000p+558, 0x1.0000000000200p+643, -0x1.0000000000000p+558}, {-0x1.0000000000002p-4, 0x1.0000000000000p-91, -0x1.0000000000200p+643, 0x1.0000000000000p+558, -0x1.0000000000200p+643, 0x1.0000000000000p+558}, {0x1.0000000000002p-252, -0x1.ffff800008000p-319, 0x1.000000003fffep-236, 0x1.f81fc007c0000p-307, 0x1.000100003fffep-236, 0x1.1f7ffc00fc000p-303}, {0x1.0000000000002p-252, -0x1.ffff800008000p-319, -0x1.000000003fffep-236, -0x1.f81fc007c0000p-307, -0x1.fffe00007fffcp-237, 0x1.c0f8080008000p-304}, {-0x1.0000000000002p-252, 0x1.ffff800008000p-319, 0x1.000000003fffep-236, 0x1.f81fc007c0000p-307, 0x1.fffe00007fffcp-237, -0x1.c0f8080008000p-304}, {-0x1.0000000000002p-252, 0x1.ffff800008000p-319, -0x1.000000003fffep-236, -0x1.f81fc007c0000p-307, -0x1.000100003fffep-236, -0x1.1f7ffc00fc000p-303}, {0x1.7ffffffff0000p-1014, 0x0.0000000000000p+0, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957}, {0x1.7ffffffff0000p-1014, 0x0.0000000000000p+0, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957}, {-0x1.7ffffffff0000p-1014, -0x0.0000000000000p+0, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957, 0x1.000000000ffe0p-894, 0x1.ff0000003c000p-957}, {-0x1.7ffffffff0000p-1014, -0x0.0000000000000p+0, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957, -0x1.000000000ffe0p-894, -0x1.ff0000003c000p-957}, {0x1.00007fff00080p+981, -0x1.ffffff0001000p+916, 0x1.00000000007c0p-918, 0x1.ffffff8000000p-985, 0x1.00007fff00080p+981, -0x1.ffffff0001000p+916}, {0x1.00007fff00080p+981, -0x1.ffffff0001000p+916, -0x1.00000000007c0p-918, -0x1.ffffff8000000p-985, 0x1.00007fff00080p+981, -0x1.ffffff0001000p+916}, {-0x1.00007fff00080p+981, 0x1.ffffff0001000p+916, 0x1.00000000007c0p-918, 0x1.ffffff8000000p-985, -0x1.00007fff00080p+981, 0x1.ffffff0001000p+916}, {-0x1.00007fff00080p+981, 0x1.ffffff0001000p+916, -0x1.00000000007c0p-918, -0x1.ffffff8000000p-985, -0x1.00007fff00080p+981, 0x1.ffffff0001000p+916}, {0x1.1fff81ff00000p-768, 0x1.e007ffff00000p-825, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292}, {0x1.1fff81ff00000p-768, 0x1.e007ffff00000p-825, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292}, {-0x1.1fff81ff00000p-768, -0x1.e007ffff00000p-825, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292, 0x1.1ffffffff8000p-236, 0x1.fe001ffffffe0p-292}, {-0x1.1fff81ff00000p-768, -0x1.e007ffff00000p-825, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292, -0x1.1ffffffff8000p-236, -0x1.fe001ffffffe0p-292}, {0x1.0000000000000p-141, 0x1.fffc03fe00700p-202, 0x1.0000000000001p-845, -0x1.fff8060000f34p-900, 0x1.0000000000000p-141, 0x1.fffc03fe00700p-202}, {0x1.0000000000000p-141, 0x1.fffc03fe00700p-202, -0x1.0000000000001p-845, 0x1.fff8060000f34p-900, 0x1.0000000000000p-141, 0x1.fffc03fe00700p-202}, {-0x1.0000000000000p-141, -0x1.fffc03fe00700p-202, 0x1.0000000000001p-845, -0x1.fff8060000f34p-900, -0x1.0000000000000p-141, -0x1.fffc03fe00700p-202}, {-0x1.0000000000000p-141, -0x1.fffc03fe00700p-202, -0x1.0000000000001p-845, 0x1.fff8060000f34p-900, -0x1.0000000000000p-141, -0x1.fffc03fe00700p-202}, {0x1.001ffffc00080p+872, -0x1.fe00000200000p+811, 0x1.0000000001000p-359, -0x1.fe3ffffff0080p-419, 0x1.001ffffc00080p+872, -0x1.fe00000200000p+811}, {0x1.001ffffc00080p+872, -0x1.fe00000200000p+811, -0x1.0000000001000p-359, 0x1.fe3ffffff0080p-419, 0x1.001ffffc00080p+872, -0x1.fe00000200000p+811}, {-0x1.001ffffc00080p+872, 0x1.fe00000200000p+811, 0x1.0000000001000p-359, -0x1.fe3ffffff0080p-419, -0x1.001ffffc00080p+872, 0x1.fe00000200000p+811}, {-0x1.001ffffc00080p+872, 0x1.fe00000200000p+811, -0x1.0000000001000p-359, 0x1.fe3ffffff0080p-419, -0x1.001ffffc00080p+872, 0x1.fe00000200000p+811}, {0x1.00001fffff800p-894, 0x1.ffffff801ffc0p-953, 0x1.0000000002000p-720, -0x1.0000000000000p-825, 0x1.0000000002000p-720, -0x1.0000000000000p-825}, {0x1.00001fffff800p-894, 0x1.ffffff801ffc0p-953, -0x1.0000000002000p-720, 0x1.0000000000000p-825, -0x1.0000000002000p-720, 0x1.0000000000000p-825}, {-0x1.00001fffff800p-894, -0x1.ffffff801ffc0p-953, 0x1.0000000002000p-720, -0x1.0000000000000p-825, 0x1.0000000002000p-720, -0x1.0000000000000p-825}, {-0x1.00001fffff800p-894, -0x1.ffffff801ffc0p-953, -0x1.0000000002000p-720, 0x1.0000000000000p-825, -0x1.0000000002000p-720, 0x1.0000000000000p-825}, {0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86, 0x1.0000000000000p-240, 0x1.ffffffffe0000p-296, 0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86}, {0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86, -0x1.0000000000000p-240, -0x1.ffffffffe0000p-296, 0x1.0000000000000p-30, 0x1.ffff83ffbfff0p-86}, {-0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86, 0x1.0000000000000p-240, 0x1.ffffffffe0000p-296, -0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86}, {-0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86, -0x1.0000000000000p-240, -0x1.ffffffffe0000p-296, -0x1.0000000000000p-30, -0x1.ffff83ffbfff0p-86}, {0x1.0000000000000p-874, 0x1.fffe7ff3dff00p-935, 0x1.000007f830000p-977, 0x1.fff0001000000p-1038, 0x1.0000000000000p-874, 0x1.fffe7ff3e0300p-935}, {0x1.0000000000000p-874, 0x1.fffe7ff3dff00p-935, -0x1.000007f830000p-977, -0x1.fff0001000000p-1038, 0x1.0000000000000p-874, 0x1.fffe7ff3dfb00p-935}, {-0x1.0000000000000p-874, -0x1.fffe7ff3dff00p-935, 0x1.000007f830000p-977, 0x1.fff0001000000p-1038, -0x1.0000000000000p-874, -0x1.fffe7ff3dfb00p-935}, {-0x1.0000000000000p-874, -0x1.fffe7ff3dff00p-935, -0x1.000007f830000p-977, -0x1.fff0001000000p-1038, -0x1.0000000000000p-874, -0x1.fffe7ff3e0300p-935}, {0x1.00000ffffe000p-269, 0x1.fffffffffc000p-336, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171}, {0x1.00000ffffe000p-269, 0x1.fffffffffc000p-336, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171}, {-0x1.00000ffffe000p-269, -0x1.fffffffffc000p-336, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171, 0x1.0000000000002p+226, -0x1.fffffe01f8004p+171}, {-0x1.00000ffffe000p-269, -0x1.fffffffffc000p-336, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171, -0x1.0000000000002p+226, 0x1.fffffe01f8004p+171}, {0x1.0000000000060p+403, 0x1.fffe3fff00000p+340, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726}, {0x1.0000000000060p+403, 0x1.fffe3fff00000p+340, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726}, {-0x1.0000000000060p+403, -0x1.fffe3fff00000p+340, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726, 0x1.0000000002000p+783, -0x1.ffe0002000000p+726}, {-0x1.0000000000060p+403, -0x1.fffe3fff00000p+340, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726, -0x1.0000000002000p+783, 0x1.ffe0002000000p+726}, {0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347, 0x1.07ff000008000p-591, -0x1.e000020000000p-652, 0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347}, {0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347, -0x1.07ff000008000p-591, 0x1.e000020000000p-652, 0x1.0003ffffffff8p-273, 0x1.ffffe07e00000p-347}, {-0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347, 0x1.07ff000008000p-591, -0x1.e000020000000p-652, -0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347}, {-0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347, -0x1.07ff000008000p-591, 0x1.e000020000000p-652, -0x1.0003ffffffff8p-273, -0x1.ffffe07e00000p-347}, // Some test cases where a and b are guaranteed to overlap: {0x1.0000000000002p-39, -0x1.ffc0ffff90000p-103, 0x1.0003ffffffffcp-35, 0x1.ffffc00000000p-122, 0x1.1003ffffffffcp-35, 0x1.ffe003f400068p-91}, {0x1.0000000000002p-39, -0x1.ffc0ffff90000p-103, -0x1.0003ffffffffcp-35, -0x1.ffffc00000000p-122, -0x1.e007ffffffff8p-36, 0x1.ffe003ec00078p-91}, {-0x1.0000000000002p-39, 0x1.ffc0ffff90000p-103, 0x1.0003ffffffffcp-35, 0x1.ffffc00000000p-122, 0x1.e007ffffffff8p-36, -0x1.ffe003ec00078p-91}, {-0x1.0000000000002p-39, 0x1.ffc0ffff90000p-103, -0x1.0003ffffffffcp-35, -0x1.ffffc00000000p-122, -0x1.1003ffffffffcp-35, -0x1.ffe003f400068p-91}, {0x1.0000100000000p+23, -0x1.0000000000000p-39, 0x1.0000000004000p-41, -0x1.ffffe00fc0200p-97, 0x1.0000100000000p+23, -0x1.7ffffffffe000p-40}, {0x1.0000100000000p+23, -0x1.0000000000000p-39, -0x1.0000000004000p-41, 0x1.ffffe00fc0200p-97, 0x1.0000100000000p+23, -0x1.4000000001000p-39}, {-0x1.0000100000000p+23, 0x1.0000000000000p-39, 0x1.0000000004000p-41, -0x1.ffffe00fc0200p-97, -0x1.0000100000000p+23, 0x1.4000000001000p-39}, {-0x1.0000100000000p+23, 0x1.0000000000000p-39, -0x1.0000000004000p-41, 0x1.ffffe00fc0200p-97, -0x1.0000100000000p+23, 0x1.7ffffffffe000p-40}, {0x1.0000000800000p-42, -0x1.0000000000000p-114, 0x1.000003fffc002p-41, -0x1.0000000000000p-146, 0x1.80000403fc002p-41, -0x1.0000000100000p-114}, {0x1.0000000800000p-42, -0x1.0000000000000p-114, -0x1.000003fffc002p-41, 0x1.0000000000000p-146, -0x1.000007f7f8004p-42, -0x1.fffffffe00000p-115}, {-0x1.0000000800000p-42, 0x1.0000000000000p-114, 0x1.000003fffc002p-41, -0x1.0000000000000p-146, 0x1.000007f7f8004p-42, 0x1.fffffffe00000p-115}, {-0x1.0000000800000p-42, 0x1.0000000000000p-114, -0x1.000003fffc002p-41, 0x1.0000000000000p-146, -0x1.80000403fc002p-41, 0x1.0000000100000p-114}, {0x1.0000000000000p+46, 0x1.ffc001ffffe00p-9, 0x1.000003fff8000p-19, 0x1.fffc000fc0000p-90, 0x1.0000000000000p+46, 0x1.000001007fef0p-8}, {0x1.0000000000000p+46, 0x1.ffc001ffffe00p-9, -0x1.000003fff8000p-19, -0x1.fffc000fc0000p-90, 0x1.0000000000000p+46, 0x1.ff8001feffe20p-9}, {-0x1.0000000000000p+46, -0x1.ffc001ffffe00p-9, 0x1.000003fff8000p-19, 0x1.fffc000fc0000p-90, -0x1.0000000000000p+46, -0x1.ff8001feffe20p-9}, {-0x1.0000000000000p+46, -0x1.ffc001ffffe00p-9, -0x1.000003fff8000p-19, -0x1.fffc000fc0000p-90, -0x1.0000000000000p+46, -0x1.000001007fef0p-8}, {0x1.0000000000003p+33, 0x1.fc00001fff800p-31, 0x1.0000000000020p+40, -0x1.fc01ffe002000p-24, 0x1.0200000000020p+40, 0x1.781fd80080f80p-18}, {0x1.0000000000003p+33, 0x1.fc00001fff800p-31, -0x1.0000000000020p+40, 0x1.fc01ffe002000p-24, -0x1.fc00000000040p+39, 0x1.87ffe7ff81080p-18}, {-0x1.0000000000003p+33, -0x1.fc00001fff800p-31, 0x1.0000000000020p+40, -0x1.fc01ffe002000p-24, 0x1.fc00000000040p+39, -0x1.87ffe7ff81080p-18}, {-0x1.0000000000003p+33, -0x1.fc00001fff800p-31, -0x1.0000000000020p+40, 0x1.fc01ffe002000p-24, -0x1.0200000000020p+40, -0x1.781fd80080f80p-18}, {0x1.0000000000000p-42, 0x1.fffff00001ffep-96, 0x1.0000000000000p-9, 0x1.ff00000ffff80p-69, 0x1.0000000080000p-9, 0x1.ff00004ffff80p-69}, {0x1.0000000000000p-42, 0x1.fffff00001ffep-96, -0x1.0000000000000p-9, -0x1.ff00000ffff80p-69, -0x1.ffffffff00000p-10, -0x1.feffffcffff80p-69}, {-0x1.0000000000000p-42, -0x1.fffff00001ffep-96, 0x1.0000000000000p-9, 0x1.ff00000ffff80p-69, 0x1.ffffffff00000p-10, 0x1.feffffcffff80p-69}, {-0x1.0000000000000p-42, -0x1.fffff00001ffep-96, -0x1.0000000000000p-9, -0x1.ff00000ffff80p-69, -0x1.0000000080000p-9, -0x1.ff00004ffff80p-69}, {0x1.0000000000000p-46, 0x1.ffffffffffc00p-109, 0x1.0000200000000p+11, -0x1.ffc0000080000p-61, 0x1.0000200000000p+11, 0x1.fff800fffffe0p-47}, {0x1.0000000000000p-46, 0x1.ffffffffffc00p-109, -0x1.0000200000000p+11, 0x1.ffc0000080000p-61, -0x1.0000200000000p+11, 0x1.0003ff8000010p-46}, {-0x1.0000000000000p-46, -0x1.ffffffffffc00p-109, 0x1.0000200000000p+11, -0x1.ffc0000080000p-61, 0x1.0000200000000p+11, -0x1.0003ff8000010p-46}, {-0x1.0000000000000p-46, -0x1.ffffffffffc00p-109, -0x1.0000200000000p+11, 0x1.ffc0000080000p-61, -0x1.0000200000000p+11, -0x1.fff800fffffe0p-47}, {0x1.0000000000800p-4, -0x1.fffc000000010p-61, 0x1.0000000000008p-2, -0x1.ffe03fffff010p-59, 0x1.4000000000208p-2, -0x1.3fef9fffff808p-58}, {0x1.0000000000800p-4, -0x1.fffc000000010p-61, -0x1.0000000000008p-2, 0x1.ffe03fffff010p-59, -0x1.7fffffffffc10p-3, 0x1.7fe13fffff010p-59}, {-0x1.0000000000800p-4, 0x1.fffc000000010p-61, 0x1.0000000000008p-2, -0x1.ffe03fffff010p-59, 0x1.7fffffffffc10p-3, -0x1.7fe13fffff010p-59}, {-0x1.0000000000800p-4, 0x1.fffc000000010p-61, -0x1.0000000000008p-2, 0x1.ffe03fffff010p-59, -0x1.4000000000208p-2, 0x1.3fef9fffff808p-58}, {0x1.0000000000000p-39, 0x1.fffef0ffff000p-102, 0x1.0000100000000p-7, -0x1.fff8000000800p-71, 0x1.0000100100000p-7, -0x1.fff7fffc00800p-71}, {0x1.0000000000000p-39, 0x1.fffef0ffff000p-102, -0x1.0000100000000p-7, 0x1.fff8000000800p-71, -0x1.00000fff00000p-7, 0x1.fff8000400800p-71}, {-0x1.0000000000000p-39, -0x1.fffef0ffff000p-102, 0x1.0000100000000p-7, -0x1.fff8000000800p-71, 0x1.00000fff00000p-7, -0x1.fff8000400800p-71}, {-0x1.0000000000000p-39, -0x1.fffef0ffff000p-102, -0x1.0000100000000p-7, 0x1.fff8000000800p-71, -0x1.0000100100000p-7, 0x1.fff7fffc00800p-71}, {0x1.07c00007ffff0p-15, 0x1.fffc00f800000p-91, 0x1.0000007ffffe0p-11, 0x1.f000000000000p-82, 0x1.107c00807ffdfp-11, 0x1.f0fffe0080000p-82}, {0x1.07c00007ffff0p-15, 0x1.fffc00f800000p-91, -0x1.0000007ffffe0p-11, -0x1.f000000000000p-82, -0x1.df0800fefffc2p-12, -0x1.ef0001ff80000p-82}, {-0x1.07c00007ffff0p-15, -0x1.fffc00f800000p-91, 0x1.0000007ffffe0p-11, 0x1.f000000000000p-82, 0x1.df0800fefffc2p-12, 0x1.ef0001ff80000p-82}, {-0x1.07c00007ffff0p-15, -0x1.fffc00f800000p-91, -0x1.0000007ffffe0p-11, -0x1.f000000000000p-82, -0x1.107c00807ffdfp-11, -0x1.f0fffe0080000p-82}, {0x1.0000000000000p+37, 0x1.ff800fffff800p-19, 0x1.0000000000000p-32, 0x1.fffc0000ffff8p-88, 0x1.0000000000000p+37, 0x1.ff880fffff800p-19}, {0x1.0000000000000p+37, 0x1.ff800fffff800p-19, -0x1.0000000000000p-32, -0x1.fffc0000ffff8p-88, 0x1.0000000000000p+37, 0x1.ff780fffff800p-19}, {-0x1.0000000000000p+37, -0x1.ff800fffff800p-19, 0x1.0000000000000p-32, 0x1.fffc0000ffff8p-88, -0x1.0000000000000p+37, -0x1.ff780fffff800p-19}, {-0x1.0000000000000p+37, -0x1.ff800fffff800p-19, -0x1.0000000000000p-32, -0x1.fffc0000ffff8p-88, -0x1.0000000000000p+37, -0x1.ff880fffff800p-19}, {0x1.0000000008000p+44, -0x1.ffff807ffe002p-10, 0x1.0000000800000p-6, -0x1.ffffff8000008p-62, 0x1.0000000008004p+44, -0x1.ffff7ffffe004p-10}, {0x1.0000000008000p+44, -0x1.ffff807ffe002p-10, -0x1.0000000800000p-6, 0x1.ffffff8000008p-62, 0x1.0000000007ffcp+44, -0x1.ffff80fffe000p-10}, {-0x1.0000000008000p+44, 0x1.ffff807ffe002p-10, 0x1.0000000800000p-6, -0x1.ffffff8000008p-62, -0x1.0000000007ffcp+44, 0x1.ffff80fffe000p-10}, {-0x1.0000000008000p+44, 0x1.ffff807ffe002p-10, -0x1.0000000800000p-6, 0x1.ffffff8000008p-62, -0x1.0000000008004p+44, 0x1.ffff7ffffe004p-10}, {0x1.0000000000020p-53, -0x1.0000000000000p-136, 0x1.0000000000000p+33, 0x1.fffff000003c0p-26, 0x1.0000000000000p+33, 0x1.fffff020003c0p-26}, {0x1.0000000000020p-53, -0x1.0000000000000p-136, -0x1.0000000000000p+33, -0x1.fffff000003c0p-26, -0x1.0000000000000p+33, -0x1.ffffefe0003c0p-26}, {-0x1.0000000000020p-53, 0x1.0000000000000p-136, 0x1.0000000000000p+33, 0x1.fffff000003c0p-26, 0x1.0000000000000p+33, 0x1.ffffefe0003c0p-26}, {-0x1.0000000000020p-53, 0x1.0000000000000p-136, -0x1.0000000000000p+33, -0x1.fffff000003c0p-26, -0x1.0000000000000p+33, -0x1.fffff020003c0p-26}, {0x1.0000001ffff80p-7, 0x1.fffffdfffff8ep-61, 0x1.0000000200000p-27, -0x1.0000000000000p-96, 0x1.0000101ffff82p-7, 0x1.fffffdffdff8ep-61}, {0x1.0000001ffff80p-7, 0x1.fffffdfffff8ep-61, -0x1.0000000200000p-27, 0x1.0000000000000p-96, 0x1.ffffe03fffefdp-8, -0x1.ffe0072000000p-85}, {-0x1.0000001ffff80p-7, -0x1.fffffdfffff8ep-61, 0x1.0000000200000p-27, -0x1.0000000000000p-96, -0x1.ffffe03fffefdp-8, 0x1.ffe0072000000p-85}, {-0x1.0000001ffff80p-7, -0x1.fffffdfffff8ep-61, -0x1.0000000200000p-27, 0x1.0000000000000p-96, -0x1.0000101ffff82p-7, -0x1.fffffdffdff8ep-61}, {0x1.01ffffff80400p-38, -0x1.c7ffffc000100p-96, 0x1.0000000000000p-47, 0x1.8fff01fffff00p-107, 0x1.027fffff80400p-38, -0x1.c7cdffdfc0100p-96}, {0x1.01ffffff80400p-38, -0x1.c7ffffc000100p-96, -0x1.0000000000000p-47, -0x1.8fff01fffff00p-107, 0x1.017fffff80400p-38, -0x1.c831ffa040100p-96}, {-0x1.01ffffff80400p-38, 0x1.c7ffffc000100p-96, 0x1.0000000000000p-47, 0x1.8fff01fffff00p-107, -0x1.017fffff80400p-38, 0x1.c831ffa040100p-96}, {-0x1.01ffffff80400p-38, 0x1.c7ffffc000100p-96, -0x1.0000000000000p-47, -0x1.8fff01fffff00p-107, -0x1.027fffff80400p-38, 0x1.c7cdffdfc0100p-96}, {0x1.0000000000008p-27, -0x1.ffffc00800000p-100, 0x1.00003ffe00002p+16, -0x1.ffffffc180080p-44, 0x1.00003ffe00202p+16, -0x1.ffffffc080080p-44}, {0x1.0000000000008p-27, -0x1.ffffc00800000p-100, -0x1.00003ffe00002p+16, 0x1.ffffffc180080p-44, -0x1.00003ffdffe02p+16, 0x1.ffffffc280080p-44}, {-0x1.0000000000008p-27, 0x1.ffffc00800000p-100, 0x1.00003ffe00002p+16, -0x1.ffffffc180080p-44, 0x1.00003ffdffe02p+16, -0x1.ffffffc280080p-44}, {-0x1.0000000000008p-27, 0x1.ffffc00800000p-100, -0x1.00003ffe00002p+16, 0x1.ffffffc180080p-44, -0x1.00003ffe00202p+16, 0x1.ffffffc080080p-44}, {0x1.000000ffffff8p+16, 0x1.ffffffc000000p-41, 0x1.0000000000000p+8, 0x1.ffffffe000000p-50, 0x1.010000ffffff8p+16, 0x1.007fffdff8000p-40}, {0x1.000000ffffff8p+16, 0x1.ffffffc000000p-41, -0x1.0000000000000p+8, -0x1.ffffffe000000p-50, 0x1.fe0001ffffff0p+15, 0x1.feffffc010000p-41}, {-0x1.000000ffffff8p+16, -0x1.ffffffc000000p-41, 0x1.0000000000000p+8, 0x1.ffffffe000000p-50, -0x1.fe0001ffffff0p+15, -0x1.feffffc010000p-41}, {-0x1.000000ffffff8p+16, -0x1.ffffffc000000p-41, -0x1.0000000000000p+8, -0x1.ffffffe000000p-50, -0x1.010000ffffff8p+16, -0x1.007fffdff8000p-40}, {0x1.0000000020000p-39, -0x1.0000000000000p-144, 0x1.0000000000400p-40, -0x1.ff1ffffff4000p-107, 0x1.8000000020200p-39, -0x1.ff20000000000p-107}, {0x1.0000000020000p-39, -0x1.0000000000000p-144, -0x1.0000000000400p-40, 0x1.ff1ffffff4000p-107, 0x1.000000003fc00p-40, 0x1.ff1fffffec000p-107}, {-0x1.0000000020000p-39, 0x1.0000000000000p-144, 0x1.0000000000400p-40, -0x1.ff1ffffff4000p-107, -0x1.000000003fc00p-40, -0x1.ff1fffffec000p-107}, {-0x1.0000000020000p-39, 0x1.0000000000000p-144, -0x1.0000000000400p-40, 0x1.ff1ffffff4000p-107, -0x1.8000000020200p-39, 0x1.ff20000000000p-107}, {0x1.0000ff8020000p-18, -0x1.fffffa0000000p-80, 0x1.0000000001ff0p+30, 0x1.f700000ffe000p-36, 0x1.0000000002000p+30, 0x1.7d402003ff800p-34}, {0x1.0000ff8020000p-18, -0x1.fffffa0000000p-80, -0x1.0000000001ff0p+30, -0x1.f700000ffe000p-36, -0x1.0000000001fe0p+30, 0x1.03803ff801000p-35}, {-0x1.0000ff8020000p-18, 0x1.fffffa0000000p-80, 0x1.0000000001ff0p+30, 0x1.f700000ffe000p-36, 0x1.0000000001fe0p+30, -0x1.03803ff801000p-35}, {-0x1.0000ff8020000p-18, 0x1.fffffa0000000p-80, -0x1.0000000001ff0p+30, -0x1.f700000ffe000p-36, -0x1.0000000002000p+30, -0x1.7d402003ff800p-34}, {0x1.0000020000000p+8, -0x1.0000000000000p-56, 0x1.003e00001f800p-14, 0x1.ffde000001e00p-76, 0x1.00000600f8000p+8, 0x1.f400007ff7800p-50}, {0x1.0000020000000p+8, -0x1.0000000000000p-56, -0x1.003e00001f800p-14, -0x1.ffde000001e00p-76, 0x1.fffffbfe10000p+7, -0x1.fc00007ff7800p-50}, {-0x1.0000020000000p+8, 0x1.0000000000000p-56, 0x1.003e00001f800p-14, 0x1.ffde000001e00p-76, -0x1.fffffbfe10000p+7, 0x1.fc00007ff7800p-50}, {-0x1.0000020000000p+8, 0x1.0000000000000p-56, -0x1.003e00001f800p-14, -0x1.ffde000001e00p-76, -0x1.00000600f8000p+8, -0x1.f400007ff7800p-50}, {0x1.0007e3ffe0000p-24, 0x1.fe0ffffffe000p-88, 0x1.0000000000000p+0, 0x1.fffffe07fff00p-61, 0x1.0000010007e40p+0, -0x1.000000dc1f080p-60}, {0x1.0007e3ffe0000p-24, 0x1.fe0ffffffe000p-88, -0x1.0000000000000p+0, -0x1.fffffe07fff00p-61, -0x1.fffffdfff0380p-1, -0x1.7fffff720f7c0p-59}, {-0x1.0007e3ffe0000p-24, -0x1.fe0ffffffe000p-88, 0x1.0000000000000p+0, 0x1.fffffe07fff00p-61, 0x1.fffffdfff0380p-1, 0x1.7fffff720f7c0p-59}, {-0x1.0007e3ffe0000p-24, -0x1.fe0ffffffe000p-88, -0x1.0000000000000p+0, -0x1.fffffe07fff00p-61, -0x1.0000010007e40p+0, 0x1.000000dc1f080p-60}, {0x1.00000000fe000p+38, 0x1.ff00004000000p-29, 0x1.000003fffff80p-32, 0x1.fff8400000000p-92, 0x1.00000000fe000p+38, 0x1.0f80006000000p-28}, {0x1.00000000fe000p+38, 0x1.ff00004000000p-29, -0x1.000003fffff80p-32, -0x1.fff8400000000p-92, 0x1.00000000fe000p+38, 0x1.deffffc000000p-29}, {-0x1.00000000fe000p+38, -0x1.ff00004000000p-29, 0x1.000003fffff80p-32, 0x1.fff8400000000p-92, -0x1.00000000fe000p+38, -0x1.deffffc000000p-29}, {-0x1.00000000fe000p+38, -0x1.ff00004000000p-29, -0x1.000003fffff80p-32, -0x1.fff8400000000p-92, -0x1.00000000fe000p+38, -0x1.0f80006000000p-28}, {0x1.0000800000000p-9, -0x1.0000000000000p-65, 0x1.0000000000000p-51, 0x1.fffffffc1fc00p-114, 0x1.0000800000400p-9, -0x1.fffffffffffe0p-66}, {0x1.0000800000000p-9, -0x1.0000000000000p-65, -0x1.0000000000000p-51, -0x1.fffffffc1fc00p-114, 0x1.00007fffffc00p-9, -0x1.0000000000010p-65}, {-0x1.0000800000000p-9, 0x1.0000000000000p-65, 0x1.0000000000000p-51, 0x1.fffffffc1fc00p-114, -0x1.00007fffffc00p-9, 0x1.0000000000010p-65}, {-0x1.0000800000000p-9, 0x1.0000000000000p-65, -0x1.0000000000000p-51, -0x1.fffffffc1fc00p-114, -0x1.0000800000400p-9, 0x1.fffffffffffe0p-66}, {0x1.0000000000000p-40, 0x1.ff000ff3ffe00p-94, 0x1.0000000000000p-18, 0x1.fe0003fffc000p-77, 0x1.0000040000000p-18, 0x1.fe01038003f80p-77}, {0x1.0000000000000p-40, 0x1.ff000ff3ffe00p-94, -0x1.0000000000000p-18, -0x1.fe0003fffc000p-77, -0x1.fffff80000000p-19, -0x1.fdff047ff4060p-77}, {-0x1.0000000000000p-40, -0x1.ff000ff3ffe00p-94, 0x1.0000000000000p-18, 0x1.fe0003fffc000p-77, 0x1.fffff80000000p-19, 0x1.fdff047ff4060p-77}, {-0x1.0000000000000p-40, -0x1.ff000ff3ffe00p-94, -0x1.0000000000000p-18, -0x1.fe0003fffc000p-77, -0x1.0000040000000p-18, -0x1.fe01038003f80p-77}, {0x1.000000e000010p-12, -0x1.ffffffc020000p-82, 0x1.00000001f0000p-4, 0x1.8000000000000p-108, 0x1.01000002d0000p-4, 0x1.fffff00000050p-61}, {0x1.000000e000010p-12, -0x1.ffffffc020000p-82, -0x1.00000001f0000p-4, -0x1.8000000000000p-108, -0x1.fe00000220000p-5, 0x1.ffffefffffff0p-61}, {-0x1.000000e000010p-12, 0x1.ffffffc020000p-82, 0x1.00000001f0000p-4, 0x1.8000000000000p-108, 0x1.fe00000220000p-5, -0x1.ffffefffffff0p-61}, {-0x1.000000e000010p-12, 0x1.ffffffc020000p-82, -0x1.00000001f0000p-4, -0x1.8000000000000p-108, -0x1.01000002d0000p-4, -0x1.fffff00000050p-61}, {0x1.000003ff00000p+23, 0x1.8000000000000p-54, 0x1.0001ffffe0000p-39, 0x1.f800000100000p-112, 0x1.000003ff00000p+23, 0x1.0004ffffe0000p-39}, {0x1.000003ff00000p+23, 0x1.8000000000000p-54, -0x1.0001ffffe0000p-39, -0x1.f800000100000p-112, 0x1.000003ff00000p+23, -0x1.fffdffffc0000p-40}, {-0x1.000003ff00000p+23, -0x1.8000000000000p-54, 0x1.0001ffffe0000p-39, 0x1.f800000100000p-112, -0x1.000003ff00000p+23, 0x1.fffdffffc0000p-40}, {-0x1.000003ff00000p+23, -0x1.8000000000000p-54, -0x1.0001ffffe0000p-39, -0x1.f800000100000p-112, -0x1.000003ff00000p+23, -0x1.0004ffffe0000p-39}, {0x1.0000000000200p+14, -0x1.ffffffffffc08p-42, 0x1.0000000000000p-48, 0x1.ffffffffffffep-102, 0x1.0000000000200p+14, -0x1.fbffffffffc08p-42}, {0x1.0000000000200p+14, -0x1.ffffffffffc08p-42, -0x1.0000000000000p-48, -0x1.ffffffffffffep-102, 0x1.0000000000200p+14, -0x1.01ffffffffe04p-41}, {-0x1.0000000000200p+14, 0x1.ffffffffffc08p-42, 0x1.0000000000000p-48, 0x1.ffffffffffffep-102, -0x1.0000000000200p+14, 0x1.01ffffffffe04p-41}, {-0x1.0000000000200p+14, 0x1.ffffffffffc08p-42, -0x1.0000000000000p-48, -0x1.ffffffffffffep-102, -0x1.0000000000200p+14, 0x1.fbffffffffc08p-42}, {0x1.0000000040000p+37, -0x1.fffff80002000p-29, 0x1.0000000000000p-21, 0x1.ffc01ffff3c00p-84, 0x1.0000000040000p+37, 0x1.fc00000ffffc0p-22}, {0x1.0000000040000p+37, -0x1.fffff80002000p-29, -0x1.0000000000000p-21, -0x1.ffc01ffff3c00p-84, 0x1.0000000040000p+37, -0x1.01fffff800020p-21}, {-0x1.0000000040000p+37, 0x1.fffff80002000p-29, 0x1.0000000000000p-21, 0x1.ffc01ffff3c00p-84, -0x1.0000000040000p+37, 0x1.01fffff800020p-21}, {-0x1.0000000040000p+37, 0x1.fffff80002000p-29, -0x1.0000000000000p-21, -0x1.ffc01ffff3c00p-84, -0x1.0000000040000p+37, -0x1.fc00000ffffc0p-22}, {0x1.0000800000000p+25, -0x1.0000000000000p-80, 0x1.0000003800001p-52, 0x1.fffffe000003ep-106, 0x1.0000800000000p+25, 0x1.0000003000000p-52}, {0x1.0000800000000p+25, -0x1.0000000000000p-80, -0x1.0000003800001p-52, -0x1.fffffe000003ep-106, 0x1.0000800000000p+25, -0x1.0000005000000p-52}, {-0x1.0000800000000p+25, 0x1.0000000000000p-80, 0x1.0000003800001p-52, 0x1.fffffe000003ep-106, -0x1.0000800000000p+25, 0x1.0000005000000p-52}, {-0x1.0000800000000p+25, 0x1.0000000000000p-80, -0x1.0000003800001p-52, -0x1.fffffe000003ep-106, -0x1.0000800000000p+25, -0x1.0000003000000p-52}, {0x1.0f00000020000p-4, -0x1.fffe000000100p-58, 0x1.0000000400000p-7, -0x1.ffffffc004000p-74, 0x1.2f000000a0000p-4, -0x1.ffffffffffd00p-58}, {0x1.0f00000020000p-4, -0x1.fffe000000100p-58, -0x1.0000000400000p-7, 0x1.ffffffc004000p-74, 0x1.ddffffff3ffffp-5, 0x1.ffffffd800000p-73}, {-0x1.0f00000020000p-4, 0x1.fffe000000100p-58, 0x1.0000000400000p-7, -0x1.ffffffc004000p-74, -0x1.ddffffff3ffffp-5, -0x1.ffffffd800000p-73}, {-0x1.0f00000020000p-4, 0x1.fffe000000100p-58, -0x1.0000000400000p-7, 0x1.ffffffc004000p-74, -0x1.2f000000a0000p-4, 0x1.ffffffffffd00p-58}, {0x1.003fe00020000p-13, -0x1.ffffffffe8000p-81, 0x1.0000000000400p-48, -0x1.ffff800007ffcp-103, 0x1.003fe00040000p-13, -0x1.ff8007ffe8000p-81}, {0x1.003fe00020000p-13, -0x1.ffffffffe8000p-81, -0x1.0000000000400p-48, 0x1.ffff800007ffcp-103, 0x1.003fe00000000p-13, -0x1.003ffbfff4000p-80}, {-0x1.003fe00020000p-13, 0x1.ffffffffe8000p-81, 0x1.0000000000400p-48, -0x1.ffff800007ffcp-103, -0x1.003fe00000000p-13, 0x1.003ffbfff4000p-80}, {-0x1.003fe00020000p-13, 0x1.ffffffffe8000p-81, -0x1.0000000000400p-48, 0x1.ffff800007ffcp-103, -0x1.003fe00040000p-13, 0x1.ff8007ffe8000p-81}, {0x1.ffff00fffffc4p-6, -0x1.8080000000000p-88, 0x1.0000020000000p-1, -0x1.0000000000000p-77, 0x1.0ffffa07ffffep-1, 0x1.ffffeffcff000p-57}, {0x1.ffff00fffffc4p-6, -0x1.8080000000000p-88, -0x1.0000020000000p-1, 0x1.0000000000000p-77, -0x1.e00013f000004p-2, 0x1.000007fe7f800p-56}, {-0x1.ffff00fffffc4p-6, 0x1.8080000000000p-88, 0x1.0000020000000p-1, -0x1.0000000000000p-77, 0x1.e00013f000004p-2, -0x1.000007fe7f800p-56}, {-0x1.ffff00fffffc4p-6, 0x1.8080000000000p-88, -0x1.0000020000000p-1, 0x1.0000000000000p-77, -0x1.0ffffa07ffffep-1, -0x1.ffffeffcff000p-57}, {0x1.0000000000040p+36, -0x1.8000000800000p-39, 0x1.0000000002000p+30, -0x1.0000000000000p-74, 0x1.04000000000c0p+36, -0x1.8000000800000p-39}, {0x1.0000000000040p+36, -0x1.8000000800000p-39, -0x1.0000000002000p+30, 0x1.0000000000000p-74, 0x1.f7fffffffff80p+35, -0x1.8000000800000p-39}, {-0x1.0000000000040p+36, 0x1.8000000800000p-39, 0x1.0000000002000p+30, -0x1.0000000000000p-74, -0x1.f7fffffffff80p+35, 0x1.8000000800000p-39}, {-0x1.0000000000040p+36, 0x1.8000000800000p-39, -0x1.0000000002000p+30, 0x1.0000000000000p-74, -0x1.04000000000c0p+36, 0x1.8000000800000p-39}, {0x1.0000000800000p-29, -0x1.ffffc02000000p-107, 0x1.7fffe00800000p-48, -0x1.0000000000000p-153, 0x1.00003007fc010p-29, -0x1.ffffc02000000p-107}, {0x1.0000000800000p-29, -0x1.ffffc02000000p-107, -0x1.7fffe00800000p-48, 0x1.0000000000000p-153, 0x1.ffffa01007fe0p-30, -0x1.ffffc02000000p-107}, {-0x1.0000000800000p-29, 0x1.ffffc02000000p-107, 0x1.7fffe00800000p-48, -0x1.0000000000000p-153, -0x1.ffffa01007fe0p-30, 0x1.ffffc02000000p-107}, {-0x1.0000000800000p-29, 0x1.ffffc02000000p-107, -0x1.7fffe00800000p-48, 0x1.0000000000000p-153, -0x1.00003007fc010p-29, 0x1.ffffc02000000p-107}, {0x1.0000400000000p+11, -0x1.0000000000000p-80, 0x1.4000000000000p+51, -0x1.ffffffff00020p-7, 0x1.4000000001000p+51, -0x1.fffffffe00040p-8}, {0x1.0000400000000p+11, -0x1.0000000000000p-80, -0x1.4000000000000p+51, 0x1.ffffffff00020p-7, -0x1.3fffffffff000p+51, 0x1.7fffffff80010p-6}, {-0x1.0000400000000p+11, 0x1.0000000000000p-80, 0x1.4000000000000p+51, -0x1.ffffffff00020p-7, 0x1.3fffffffff000p+51, -0x1.7fffffff80010p-6}, {-0x1.0000400000000p+11, 0x1.0000000000000p-80, -0x1.4000000000000p+51, 0x1.ffffffff00020p-7, -0x1.4000000001000p+51, 0x1.fffffffe00040p-8}, {0x1.0000000000000p+42, 0x1.03eff7ff3fff0p-15, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, 0x1.0000000000200p+42, 0x1.0befe7ff40070p-15}, {0x1.0000000000000p+42, 0x1.03eff7ff3fff0p-15, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, 0x1.ffffffffffc00p+41, 0x1.f7e00ffe7fee0p-16}, {-0x1.0000000000000p+42, -0x1.03eff7ff3fff0p-15, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, -0x1.ffffffffffc00p+41, -0x1.f7e00ffe7fee0p-16}, {-0x1.0000000000000p+42, -0x1.03eff7ff3fff0p-15, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, -0x1.0000000000200p+42, -0x1.0befe7ff40070p-15}, {0x1.03ffffffffffep-18, 0x1.8000000000000p-122, 0x1.0000040000000p+49, -0x1.0000000000000p-56, 0x1.0000040000000p+49, 0x1.03fffffffc000p-18}, {0x1.03ffffffffffep-18, 0x1.8000000000000p-122, -0x1.0000040000000p+49, 0x1.0000000000000p-56, -0x1.0000040000000p+49, 0x1.0400000004000p-18}, {-0x1.03ffffffffffep-18, -0x1.8000000000000p-122, 0x1.0000040000000p+49, -0x1.0000000000000p-56, 0x1.0000040000000p+49, -0x1.0400000004000p-18}, {-0x1.03ffffffffffep-18, -0x1.8000000000000p-122, -0x1.0000040000000p+49, 0x1.0000000000000p-56, -0x1.0000040000000p+49, -0x1.03fffffffc000p-18}, {0x1.0007ffffcfffcp+9, 0x1.ff01fffe00000p-65, 0x1.01fff08000000p-5, -0x1.fffffe0000020p-59, 0x1.000c07ff91ffcp+9, -0x1.f803f60008000p-59}, {0x1.0007ffffcfffcp+9, 0x1.ff01fffe00000p-65, -0x1.01fff08000000p-5, 0x1.fffffe0000020p-59, 0x1.0003f8000dffcp+9, 0x1.03fe02fffc000p-58}, {-0x1.0007ffffcfffcp+9, -0x1.ff01fffe00000p-65, 0x1.01fff08000000p-5, -0x1.fffffe0000020p-59, -0x1.0003f8000dffcp+9, -0x1.03fe02fffc000p-58}, {-0x1.0007ffffcfffcp+9, -0x1.ff01fffe00000p-65, -0x1.01fff08000000p-5, 0x1.fffffe0000020p-59, -0x1.000c07ff91ffcp+9, 0x1.f803f60008000p-59}, {0x1.00000000007fep-4, 0x1.ff00003ffff00p-65, 0x1.004000e000008p+5, -0x1.ffffe02000000p-73, 0x1.00c000e00000cp+5, -0x1.ff017fffd0100p-56}, {0x1.00000000007fep-4, 0x1.ff00003ffff00p-65, -0x1.004000e000008p+5, 0x1.ffffe02000000p-73, -0x1.ff8001c000008p+4, -0x1.feff7fffeff00p-56}, {-0x1.00000000007fep-4, -0x1.ff00003ffff00p-65, 0x1.004000e000008p+5, -0x1.ffffe02000000p-73, 0x1.ff8001c000008p+4, 0x1.feff7fffeff00p-56}, {-0x1.00000000007fep-4, -0x1.ff00003ffff00p-65, -0x1.004000e000008p+5, 0x1.ffffe02000000p-73, -0x1.00c000e00000cp+5, 0x1.ff017fffd0100p-56}, {0x1.00000003ff000p-41, 0x1.ffff000000000p-130, 0x1.0000fffff8000p-20, 0x1.f003ffe0003e0p-78, 0x1.000107fff8002p-20, 0x1.d003ffe0003e0p-78}, {0x1.00000003ff000p-41, 0x1.ffff000000000p-130, -0x1.0000fffff8000p-20, -0x1.f003ffe0003e0p-78, -0x1.0000f7fff7ffep-20, -0x1.0801fff0001f0p-77}, {-0x1.00000003ff000p-41, -0x1.ffff000000000p-130, 0x1.0000fffff8000p-20, 0x1.f003ffe0003e0p-78, 0x1.0000f7fff7ffep-20, 0x1.0801fff0001f0p-77}, {-0x1.00000003ff000p-41, -0x1.ffff000000000p-130, -0x1.0000fffff8000p-20, -0x1.f003ffe0003e0p-78, -0x1.000107fff8002p-20, -0x1.d003ffe0003e0p-78}, {0x1.0000000000000p-41, 0x1.ffe001c0003c0p-100, 0x1.01fffffe00000p+41, 0x1.ffffffffffc00p-17, 0x1.01fffffe00000p+41, 0x1.0000007fffe00p-16}, {0x1.0000000000000p-41, 0x1.ffe001c0003c0p-100, -0x1.01fffffe00000p+41, -0x1.ffffffffffc00p-17, -0x1.01fffffe00000p+41, -0x1.fffffeffffc00p-17}, {-0x1.0000000000000p-41, -0x1.ffe001c0003c0p-100, 0x1.01fffffe00000p+41, 0x1.ffffffffffc00p-17, 0x1.01fffffe00000p+41, 0x1.fffffeffffc00p-17}, {-0x1.0000000000000p-41, -0x1.ffe001c0003c0p-100, -0x1.01fffffe00000p+41, -0x1.ffffffffffc00p-17, -0x1.01fffffe00000p+41, -0x1.0000007fffe00p-16}, {0x1.00003ff808000p+36, -0x1.ffe0000800000p-25, 0x1.000001ffff000p+41, 0x1.ff80000000000p-33, 0x1.080003ffbf400p+41, -0x1.fde0800800000p-25}, {0x1.00003ff808000p+36, -0x1.ffe0000800000p-25, -0x1.000001ffff000p+41, -0x1.ff80000000000p-33, -0x1.f00000007d800p+40, -0x1.00efc00400000p-24}, {-0x1.00003ff808000p+36, 0x1.ffe0000800000p-25, 0x1.000001ffff000p+41, 0x1.ff80000000000p-33, 0x1.f00000007d800p+40, 0x1.00efc00400000p-24}, {-0x1.00003ff808000p+36, 0x1.ffe0000800000p-25, -0x1.000001ffff000p+41, -0x1.ff80000000000p-33, -0x1.080003ffbf400p+41, 0x1.fde0800800000p-25}, {0x1.0000000000000p+6, 0x1.fc007f0ff0000p-56, 0x1.0000000007f80p-50, 0x1.ff0007f802000p-114, 0x1.0000000000000p+6, 0x1.07f001fc47b80p-50}, {0x1.0000000000000p+6, 0x1.fc007f0ff0000p-56, -0x1.0000000007f80p-50, -0x1.ff0007f802000p-114, 0x1.0000000000000p+6, -0x1.f01ffc0790700p-51}, {-0x1.0000000000000p+6, -0x1.fc007f0ff0000p-56, 0x1.0000000007f80p-50, 0x1.ff0007f802000p-114, -0x1.0000000000000p+6, 0x1.f01ffc0790700p-51}, {-0x1.0000000000000p+6, -0x1.fc007f0ff0000p-56, -0x1.0000000007f80p-50, -0x1.ff0007f802000p-114, -0x1.0000000000000p+6, -0x1.07f001fc47b80p-50}, {0x1.0020000000000p+12, -0x1.0000000000000p-65, 0x1.000001ffff802p-4, -0x1.ffffffc000040p-63, 0x1.0021000002000p+12, -0x1.ff811fffffe00p-46}, {0x1.0020000000000p+12, -0x1.0000000000000p-65, -0x1.000001ffff802p-4, 0x1.ffffffc000040p-63, 0x1.001efffffe000p+12, 0x1.ff80dfffffe00p-46}, {-0x1.0020000000000p+12, 0x1.0000000000000p-65, 0x1.000001ffff802p-4, -0x1.ffffffc000040p-63, -0x1.001efffffe000p+12, -0x1.ff80dfffffe00p-46}, {-0x1.0020000000000p+12, 0x1.0000000000000p-65, -0x1.000001ffff802p-4, 0x1.ffffffc000040p-63, -0x1.0021000002000p+12, 0x1.ff811fffffe00p-46}, {0x1.0000000000800p-45, -0x1.ffe0000400000p-107, 0x1.0000000000038p+25, 0x1.e100000000000p-49, 0x1.0000000000038p+25, 0x1.1e10000000000p-45}, {0x1.0000000000800p-45, -0x1.ffe0000400000p-107, -0x1.0000000000038p+25, -0x1.e100000000000p-49, -0x1.0000000000038p+25, 0x1.c3e0000000000p-46}, {-0x1.0000000000800p-45, 0x1.ffe0000400000p-107, 0x1.0000000000038p+25, 0x1.e100000000000p-49, 0x1.0000000000038p+25, -0x1.c3e0000000000p-46}, {-0x1.0000000000800p-45, 0x1.ffe0000400000p-107, -0x1.0000000000038p+25, -0x1.e100000000000p-49, -0x1.0000000000038p+25, -0x1.1e10000000000p-45}, {0x1.0000000000020p-31, -0x1.8007ffff80c04p-86, 0x1.0000000000000p+50, 0x1.ffffe00000c00p-13, 0x1.0000000000000p+50, 0x1.0000100000600p-12}, {0x1.0000000000020p-31, -0x1.8007ffff80c04p-86, -0x1.0000000000000p+50, -0x1.ffffe00000c00p-13, -0x1.0000000000000p+50, -0x1.ffffa00000c00p-13}, {-0x1.0000000000020p-31, 0x1.8007ffff80c04p-86, 0x1.0000000000000p+50, 0x1.ffffe00000c00p-13, 0x1.0000000000000p+50, 0x1.ffffa00000c00p-13}, {-0x1.0000000000020p-31, 0x1.8007ffff80c04p-86, -0x1.0000000000000p+50, -0x1.ffffe00000c00p-13, -0x1.0000000000000p+50, -0x1.0000100000600p-12}, {0x1.7fffffff80000p+1, 0x1.f000000000000p-76, 0x1.000007ffffffep-41, 0x1.ffffff8000000p-117, 0x1.7fffffff80400p+1, 0x1.0007bffc00000p-62}, {0x1.7fffffff80000p+1, 0x1.f000000000000p-76, -0x1.000007ffffffep-41, -0x1.ffffff8000000p-117, 0x1.7fffffff7fc00p+1, -0x1.fff07ff800000p-63}, {-0x1.7fffffff80000p+1, -0x1.f000000000000p-76, 0x1.000007ffffffep-41, 0x1.ffffff8000000p-117, -0x1.7fffffff7fc00p+1, 0x1.fff07ff800000p-63}, {-0x1.7fffffff80000p+1, -0x1.f000000000000p-76, -0x1.000007ffffffep-41, -0x1.ffffff8000000p-117, -0x1.7fffffff80400p+1, -0x1.0007bffc00000p-62}, {0x1.0000000010000p+45, -0x1.0000000000000p-41, 0x1.0000000000000p+5, 0x1.c000003ffc3fep-49, 0x1.0000000011000p+45, -0x1.fc80000000000p-42}, {0x1.0000000010000p+45, -0x1.0000000000000p-41, -0x1.0000000000000p+5, -0x1.c000003ffc3fep-49, 0x1.000000000f000p+45, -0x1.01c0000000000p-41}, {-0x1.0000000010000p+45, 0x1.0000000000000p-41, 0x1.0000000000000p+5, 0x1.c000003ffc3fep-49, -0x1.000000000f000p+45, 0x1.01c0000000000p-41}, {-0x1.0000000010000p+45, 0x1.0000000000000p-41, -0x1.0000000000000p+5, -0x1.c000003ffc3fep-49, -0x1.0000000011000p+45, 0x1.fc80000000000p-42}, {0x1.00000ffff0800p-14, -0x1.fff80000ffc20p-72, 0x1.0000000000002p-19, -0x1.0000000000000p-124, 0x1.08000ffff0800p-14, 0x1.0003ffff801f0p-71}, {0x1.00000ffff0800p-14, -0x1.fff80000ffc20p-72, -0x1.0000000000002p-19, 0x1.0000000000000p-124, 0x1.f0001fffe1000p-15, -0x1.7ffe00003ff08p-70}, {-0x1.00000ffff0800p-14, 0x1.fff80000ffc20p-72, 0x1.0000000000002p-19, -0x1.0000000000000p-124, -0x1.f0001fffe1000p-15, 0x1.7ffe00003ff08p-70}, {-0x1.00000ffff0800p-14, 0x1.fff80000ffc20p-72, -0x1.0000000000002p-19, 0x1.0000000000000p-124, -0x1.08000ffff0800p-14, -0x1.0003ffff801f0p-71}, {0x1.000ffffc00000p+49, 0x1.fffff00000000p-20, 0x1.0000000000040p+45, -0x1.0000000000000p-60, 0x1.100ffffc00004p+49, 0x1.fffff00000000p-20}, {0x1.000ffffc00000p+49, 0x1.fffff00000000p-20, -0x1.0000000000040p+45, 0x1.0000000000000p-60, 0x1.e01ffff7ffff8p+48, 0x1.fffff00000000p-20}, {-0x1.000ffffc00000p+49, -0x1.fffff00000000p-20, 0x1.0000000000040p+45, -0x1.0000000000000p-60, -0x1.e01ffff7ffff8p+48, -0x1.fffff00000000p-20}, {-0x1.000ffffc00000p+49, -0x1.fffff00000000p-20, -0x1.0000000000040p+45, 0x1.0000000000000p-60, -0x1.100ffffc00004p+49, -0x1.fffff00000000p-20}, {0x1.0004000000000p+14, -0x1.0000000000000p-54, 0x1.0000000200000p-4, -0x1.ffbffffff8020p-62, 0x1.0004400000008p+14, -0x1.01ffc00000000p-54}, {0x1.0004000000000p+14, -0x1.0000000000000p-54, -0x1.0000000200000p-4, 0x1.ffbffffff8020p-62, 0x1.0003bfffffff8p+14, -0x1.fc00800000000p-55}, {-0x1.0004000000000p+14, 0x1.0000000000000p-54, 0x1.0000000200000p-4, -0x1.ffbffffff8020p-62, -0x1.0003bfffffff8p+14, 0x1.fc00800000000p-55}, {-0x1.0004000000000p+14, 0x1.0000000000000p-54, -0x1.0000000200000p-4, 0x1.ffbffffff8020p-62, -0x1.0004400000008p+14, 0x1.01ffc00000000p-54}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, 0x1.0000001fffffep+43, 0x0.0000000000000p+0, 0x1.00000020000fep+43, 0x1.0000000000000p-61}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, -0x1.0000001fffffep+43, 0x0.0000000000000p+0, -0x1.0000001fffefep+43, 0x1.0000000000000p-61}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, 0x1.0000001fffffep+43, 0x0.0000000000000p+0, 0x1.0000001fffefep+43, -0x1.0000000000000p-61}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, -0x1.0000001fffffep+43, 0x0.0000000000000p+0, -0x1.00000020000fep+43, -0x1.0000000000000p-61}, {0x1.0000000000fffp-39, 0x1.fffff3e000000p-112, 0x1.001ffe0000000p-15, 0x1.fffffffffffc0p-74, 0x1.001fff0000000p-15, 0x1.03ffc00003fe0p-73}, {0x1.0000000000fffp-39, 0x1.fffff3e000000p-112, -0x1.001ffe0000000p-15, -0x1.fffffffffffc0p-74, -0x1.001ffd0000000p-15, -0x1.f8007ffff7fc0p-74}, {-0x1.0000000000fffp-39, -0x1.fffff3e000000p-112, 0x1.001ffe0000000p-15, 0x1.fffffffffffc0p-74, 0x1.001ffd0000000p-15, 0x1.f8007ffff7fc0p-74}, {-0x1.0000000000fffp-39, -0x1.fffff3e000000p-112, -0x1.001ffe0000000p-15, -0x1.fffffffffffc0p-74, -0x1.001fff0000000p-15, -0x1.03ffc00003fe0p-73}, {0x1.0000080000000p-27, -0x1.0000000000000p-132, 0x1.0000000080000p-48, -0x1.0000000000000p-103, 0x1.0000100000000p-27, 0x1.fffff7ffffffcp-82}, {0x1.0000080000000p-27, -0x1.0000000000000p-132, -0x1.0000000080000p-48, 0x1.0000000000000p-103, 0x1.0000000000000p-27, -0x1.fffff80000004p-82}, {-0x1.0000080000000p-27, 0x1.0000000000000p-132, 0x1.0000000080000p-48, -0x1.0000000000000p-103, -0x1.0000000000000p-27, 0x1.fffff80000004p-82}, {-0x1.0000080000000p-27, 0x1.0000000000000p-132, -0x1.0000000080000p-48, 0x1.0000000000000p-103, -0x1.0000100000000p-27, -0x1.fffff7ffffffcp-82}, {0x1.003ffffffffe0p-31, 0x1.ffffe03800000p-107, 0x1.0000000002000p-53, -0x1.0000000000000p-106, 0x1.004003fffffe0p-31, 0x1.ffffffff80e00p-93}, {0x1.003ffffffffe0p-31, 0x1.ffffe03800000p-107, -0x1.0000000002000p-53, 0x1.0000000000000p-106, 0x1.003ffbfffffe0p-31, -0x1.fff000007f200p-93}, {-0x1.003ffffffffe0p-31, -0x1.ffffe03800000p-107, 0x1.0000000002000p-53, -0x1.0000000000000p-106, -0x1.003ffbfffffe0p-31, 0x1.fff000007f200p-93}, {-0x1.003ffffffffe0p-31, -0x1.ffffe03800000p-107, -0x1.0000000002000p-53, 0x1.0000000000000p-106, -0x1.004003fffffe0p-31, -0x1.ffffffff80e00p-93}, {0x1.0000000000008p+23, -0x1.ff000007ffc00p-37, 0x1.0000000060000p+36, 0x1.ffffff8000000p-44, 0x1.0008000060000p+36, 0x1.ff813ffffdc00p-27}, {0x1.0000000000008p+23, -0x1.ff000007ffc00p-37, -0x1.0000000060000p+36, -0x1.ffffff8000000p-44, -0x1.fff00000c0000p+35, 0x1.ff7f3ffffe400p-27}, {-0x1.0000000000008p+23, 0x1.ff000007ffc00p-37, 0x1.0000000060000p+36, 0x1.ffffff8000000p-44, 0x1.fff00000c0000p+35, -0x1.ff7f3ffffe400p-27}, {-0x1.0000000000008p+23, 0x1.ff000007ffc00p-37, -0x1.0000000060000p+36, -0x1.ffffff8000000p-44, -0x1.0008000060000p+36, -0x1.ff813ffffdc00p-27}, {0x1.0000000000080p+25, -0x1.0000000000000p-80, 0x1.01ffffff80001p+15, -0x1.ff90000000000p-78, 0x1.00407fffffe80p+25, 0x1.fffffffffdc00p-38}, {0x1.0000000000080p+25, -0x1.0000000000000p-80, -0x1.01ffffff80001p+15, 0x1.ff90000000000p-78, 0x1.ff7f000000500p+24, -0x1.fffffffffe400p-38}, {-0x1.0000000000080p+25, 0x1.0000000000000p-80, 0x1.01ffffff80001p+15, -0x1.ff90000000000p-78, -0x1.ff7f000000500p+24, 0x1.fffffffffe400p-38}, {-0x1.0000000000080p+25, 0x1.0000000000000p-80, -0x1.01ffffff80001p+15, 0x1.ff90000000000p-78, -0x1.00407fffffe80p+25, -0x1.fffffffffdc00p-38}, {0x1.0000000000800p+7, -0x1.fffff80002000p-59, 0x1.0008000000000p+50, -0x1.0000000000000p-29, 0x1.0008000000200p+50, -0x1.f000000000000p-30}, {0x1.0000000000800p+7, -0x1.fffff80002000p-59, -0x1.0008000000000p+50, 0x1.0000000000000p-29, -0x1.0007ffffffe00p+50, 0x1.0800000000000p-29}, {-0x1.0000000000800p+7, 0x1.fffff80002000p-59, 0x1.0008000000000p+50, -0x1.0000000000000p-29, 0x1.0007ffffffe00p+50, -0x1.0800000000000p-29}, {-0x1.0000000000800p+7, 0x1.fffff80002000p-59, -0x1.0008000000000p+50, 0x1.0000000000000p-29, -0x1.0008000000200p+50, 0x1.f000000000000p-30}, {0x1.0000000000002p+26, -0x1.ffffffe200000p-48, 0x1.0003fffffffc0p+27, 0x1.ffffe00000400p-36, 0x1.8003fffffffc1p+27, 0x1.ffdfe00002000p-36}, {0x1.0000000000002p+26, -0x1.ffffffe200000p-48, -0x1.0003fffffffc0p+27, -0x1.ffffe00000400p-36, -0x1.0007fffffff7ep+26, -0x1.000fefffff300p-35}, {-0x1.0000000000002p+26, 0x1.ffffffe200000p-48, 0x1.0003fffffffc0p+27, 0x1.ffffe00000400p-36, 0x1.0007fffffff7ep+26, 0x1.000fefffff300p-35}, {-0x1.0000000000002p+26, 0x1.ffffffe200000p-48, -0x1.0003fffffffc0p+27, -0x1.ffffe00000400p-36, -0x1.8003fffffffc1p+27, -0x1.ffdfe00002000p-36}, {0x1.000003f000000p+13, 0x1.fffffffe00000p-48, 0x1.0000000000ff0p+50, 0x1.c03fff0e00000p-24, 0x1.0000000008ff0p+50, 0x1.f807010004380p-10}, {0x1.000003f000000p+13, 0x1.fffffffe00000p-48, -0x1.0000000000ff0p+50, -0x1.c03fff0e00000p-24, -0x1.fffffffff1fe0p+49, 0x1.f7f8ff000bc80p-10}, {-0x1.000003f000000p+13, -0x1.fffffffe00000p-48, 0x1.0000000000ff0p+50, 0x1.c03fff0e00000p-24, 0x1.fffffffff1fe0p+49, -0x1.f7f8ff000bc80p-10}, {-0x1.000003f000000p+13, -0x1.fffffffe00000p-48, -0x1.0000000000ff0p+50, -0x1.c03fff0e00000p-24, -0x1.0000000008ff0p+50, -0x1.f807010004380p-10}, {0x1.0000000018000p-6, 0x1.fffffe0000000p-88, 0x1.0000100000000p+32, -0x1.0000000000000p-73, 0x1.0000100004000p+32, 0x1.7ffffffe00000p-42}, {0x1.0000000018000p-6, 0x1.fffffe0000000p-88, -0x1.0000100000000p+32, 0x1.0000000000000p-73, -0x1.00000ffffc000p+32, 0x1.8000000200000p-42}, {-0x1.0000000018000p-6, -0x1.fffffe0000000p-88, 0x1.0000100000000p+32, -0x1.0000000000000p-73, 0x1.00000ffffc000p+32, -0x1.8000000200000p-42}, {-0x1.0000000018000p-6, -0x1.fffffe0000000p-88, -0x1.0000100000000p+32, 0x1.0000000000000p-73, -0x1.0000100004000p+32, -0x1.7ffffffe00000p-42}, {0x1.0000000000001p+35, -0x1.fffffc1000000p-32, 0x1.1ffffff01f000p+36, 0x1.ffffc000060fcp-19, 0x1.9ffffff01f001p+36, -0x1.00081fffed382p-18}, {0x1.0000000000001p+35, -0x1.fffffc1000000p-32, -0x1.1ffffff01f000p+36, -0x1.ffffc000060fcp-19, -0x1.3fffffe03e000p+35, 0x1.fff0400019704p-19}, {-0x1.0000000000001p+35, 0x1.fffffc1000000p-32, 0x1.1ffffff01f000p+36, 0x1.ffffc000060fcp-19, 0x1.3fffffe03e000p+35, -0x1.fff0400019704p-19}, {-0x1.0000000000001p+35, 0x1.fffffc1000000p-32, -0x1.1ffffff01f000p+36, -0x1.ffffc000060fcp-19, -0x1.9ffffff01f001p+36, 0x1.00081fffed382p-18}, {0x1.0000003800000p+43, 0x1.ffe000001fffcp-12, 0x1.0000007fffff0p+50, 0x1.fe1ffffc00000p-12, 0x1.020000806fff0p+50, 0x1.fefffffe10000p-11}, {0x1.0000003800000p+43, 0x1.ffe000001fffcp-12, -0x1.0000007fffff0p+50, -0x1.fe1ffffc00000p-12, -0x1.fc0000ff1ffe0p+49, 0x1.c000042000000p-20}, {-0x1.0000003800000p+43, -0x1.ffe000001fffcp-12, 0x1.0000007fffff0p+50, 0x1.fe1ffffc00000p-12, 0x1.fc0000ff1ffe0p+49, -0x1.c000042000000p-20}, {-0x1.0000003800000p+43, -0x1.ffe000001fffcp-12, -0x1.0000007fffff0p+50, -0x1.fe1ffffc00000p-12, -0x1.020000806fff0p+50, -0x1.fefffffe10000p-11}, {0x1.0000001fffc00p+32, 0x1.f00007ffe0000p-32, 0x1.0000000000180p+25, 0x1.fffffe0000800p-39, 0x1.0200001fffc03p+32, 0x1.f40007fbe0000p-32}, {0x1.0000001fffc00p+32, 0x1.f00007ffe0000p-32, -0x1.0000000000180p+25, -0x1.fffffe0000800p-39, 0x1.fc00003fff7fap+31, 0x1.ec000803e0000p-32}, {-0x1.0000001fffc00p+32, -0x1.f00007ffe0000p-32, 0x1.0000000000180p+25, 0x1.fffffe0000800p-39, -0x1.fc00003fff7fap+31, -0x1.ec000803e0000p-32}, {-0x1.0000001fffc00p+32, -0x1.f00007ffe0000p-32, -0x1.0000000000180p+25, -0x1.fffffe0000800p-39, -0x1.0200001fffc03p+32, -0x1.f40007fbe0000p-32}, {0x1.0000000008000p+19, -0x1.c0000007ffe04p-36, 0x1.00000fffffffep-53, 0x1.fc00000000000p-152, 0x1.0000000008000p+19, -0x1.bfff8007f7e04p-36}, {0x1.0000000008000p+19, -0x1.c0000007ffe04p-36, -0x1.00000fffffffep-53, -0x1.fc00000000000p-152, 0x1.0000000008000p+19, -0x1.c000800807e04p-36}, {-0x1.0000000008000p+19, 0x1.c0000007ffe04p-36, 0x1.00000fffffffep-53, 0x1.fc00000000000p-152, -0x1.0000000008000p+19, 0x1.c000800807e04p-36}, {-0x1.0000000008000p+19, 0x1.c0000007ffe04p-36, -0x1.00000fffffffep-53, -0x1.fc00000000000p-152, -0x1.0000000008000p+19, 0x1.bfff8007f7e04p-36}, {0x1.0000003e00004p+43, -0x1.fe00040000000p-27, 0x1.00007c0001e00p+8, 0x1.fffe13ffe0000p-56, 0x1.0000003e20005p+43, -0x1.000f78001f800p-14}, {0x1.0000003e00004p+43, -0x1.fe00040000000p-27, -0x1.00007c0001e00p+8, -0x1.fffe13ffe0000p-56, 0x1.0000003de0003p+43, 0x1.ffdf2fffbf000p-15}, {-0x1.0000003e00004p+43, 0x1.fe00040000000p-27, 0x1.00007c0001e00p+8, 0x1.fffe13ffe0000p-56, -0x1.0000003de0003p+43, -0x1.ffdf2fffbf000p-15}, {-0x1.0000003e00004p+43, 0x1.fe00040000000p-27, -0x1.00007c0001e00p+8, -0x1.fffe13ffe0000p-56, -0x1.0000003e20005p+43, 0x1.000f78001f800p-14}, {0x1.03fffffffc000p+44, 0x1.ffffffc000000p-31, 0x1.0003ffffff000p-28, 0x1.ffc0000000000p-123, 0x1.03fffffffc000p+44, 0x1.4003fff800000p-28}, {0x1.03fffffffc000p+44, 0x1.ffffffc000000p-31, -0x1.0003ffffff000p-28, -0x1.ffc0000000000p-123, 0x1.03fffffffc000p+44, -0x1.8008001000000p-29}, {-0x1.03fffffffc000p+44, -0x1.ffffffc000000p-31, 0x1.0003ffffff000p-28, 0x1.ffc0000000000p-123, -0x1.03fffffffc000p+44, 0x1.8008001000000p-29}, {-0x1.03fffffffc000p+44, -0x1.ffffffc000000p-31, -0x1.0003ffffff000p-28, -0x1.ffc0000000000p-123, -0x1.03fffffffc000p+44, -0x1.4003fff800000p-28}, {0x1.07ffffff80000p+48, 0x1.8007ffffc0000p-23, 0x1.0000000000004p-5, -0x1.fffc000200000p-74, 0x1.07ffffff80001p+48, -0x1.ffff3ffbffffap-6}, {0x1.07ffffff80000p+48, 0x1.8007ffffc0000p-23, -0x1.0000000000004p-5, 0x1.fffc000200000p-74, 0x1.07ffffff80000p+48, -0x1.ffff3ffc0000ap-6}, {-0x1.07ffffff80000p+48, -0x1.8007ffffc0000p-23, 0x1.0000000000004p-5, -0x1.fffc000200000p-74, -0x1.07ffffff80000p+48, 0x1.ffff3ffc0000ap-6}, {-0x1.07ffffff80000p+48, -0x1.8007ffffc0000p-23, -0x1.0000000000004p-5, 0x1.fffc000200000p-74, -0x1.07ffffff80001p+48, 0x1.ffff3ffbffffap-6}, {0x1.00003ffffff80p-25, 0x1.ffff0000ffe00p-87, 0x1.00003fffffff8p-48, 0x0.0000000000000p+0, 0x1.0000420000780p-25, 0x1.ffbf0000ffe00p-87}, {0x1.00003ffffff80p-25, 0x1.ffff0000ffe00p-87, -0x1.00003fffffff8p-48, 0x0.0000000000000p+0, 0x1.00003dffff780p-25, 0x1.001f80007ff00p-86}, {-0x1.00003ffffff80p-25, -0x1.ffff0000ffe00p-87, 0x1.00003fffffff8p-48, 0x0.0000000000000p+0, -0x1.00003dffff780p-25, -0x1.001f80007ff00p-86}, {-0x1.00003ffffff80p-25, -0x1.ffff0000ffe00p-87, -0x1.00003fffffff8p-48, 0x0.0000000000000p+0, -0x1.0000420000780p-25, -0x1.ffbf0000ffe00p-87}, {0x1.0000010000000p+29, -0x1.0000000000000p-76, 0x1.00f81ffffff81p-9, 0x1.fffff03c00000p-71, 0x1.000001000403ep+29, 0x1.ffffff81007e0p-29}, {0x1.0000010000000p+29, -0x1.0000000000000p-76, -0x1.00f81ffffff81p-9, -0x1.fffff03c00000p-71, 0x1.000000fffbfc2p+29, -0x1.ffffff8100820p-29}, {-0x1.0000010000000p+29, 0x1.0000000000000p-76, 0x1.00f81ffffff81p-9, 0x1.fffff03c00000p-71, -0x1.000000fffbfc2p+29, 0x1.ffffff8100820p-29}, {-0x1.0000010000000p+29, 0x1.0000000000000p-76, -0x1.00f81ffffff81p-9, -0x1.fffff03c00000p-71, -0x1.000001000403ep+29, -0x1.ffffff81007e0p-29}, {0x1.0000000000004p+5, -0x1.fff0008000000p-59, 0x1.0000000100000p+48, -0x1.fffffe0004000p-19, 0x1.0000000100200p+48, -0x1.fffffdc004000p-19}, {0x1.0000000000004p+5, -0x1.fff0008000000p-59, -0x1.0000000100000p+48, 0x1.fffffe0004000p-19, -0x1.00000000ffe00p+48, 0x1.fffffe4004000p-19}, {-0x1.0000000000004p+5, 0x1.fff0008000000p-59, 0x1.0000000100000p+48, -0x1.fffffe0004000p-19, 0x1.00000000ffe00p+48, -0x1.fffffe4004000p-19}, {-0x1.0000000000004p+5, 0x1.fff0008000000p-59, -0x1.0000000100000p+48, 0x1.fffffe0004000p-19, -0x1.0000000100200p+48, 0x1.fffffdc004000p-19}, {0x1.0000000000800p+23, -0x1.0000000000000p-55, 0x1.0000010000000p+11, -0x1.0000000000000p-92, 0x1.0010000010800p+23, -0x1.0000000000000p-55}, {0x1.0000000000800p+23, -0x1.0000000000000p-55, -0x1.0000010000000p+11, 0x1.0000000000000p-92, 0x1.ffdfffffe1000p+22, -0x1.0000000000000p-55}, {-0x1.0000000000800p+23, 0x1.0000000000000p-55, 0x1.0000010000000p+11, -0x1.0000000000000p-92, -0x1.ffdfffffe1000p+22, 0x1.0000000000000p-55}, {-0x1.0000000000800p+23, 0x1.0000000000000p-55, -0x1.0000010000000p+11, 0x1.0000000000000p-92, -0x1.0010000010800p+23, 0x1.0000000000000p-55}, {0x1.00000007fff00p-25, 0x1.fffc1ffff87f0p-81, 0x1.0000007c00000p-2, 0x1.fff0000000000p-73, 0x1.0000027c00001p-2, -0x1.bfc2007c00000p-70}, {0x1.00000007fff00p-25, 0x1.fffc1ffff87f0p-81, -0x1.0000007c00000p-2, -0x1.fff0000000000p-73, -0x1.fffffcf7ffffep-3, -0x1.1fdf003e00000p-69}, {-0x1.00000007fff00p-25, -0x1.fffc1ffff87f0p-81, 0x1.0000007c00000p-2, 0x1.fff0000000000p-73, 0x1.fffffcf7ffffep-3, 0x1.1fdf003e00000p-69}, {-0x1.00000007fff00p-25, -0x1.fffc1ffff87f0p-81, -0x1.0000007c00000p-2, -0x1.fff0000000000p-73, -0x1.0000027c00001p-2, 0x1.bfc2007c00000p-70}, {0x1.fffffffe00000p+40, 0x1.e000001fff800p-24, 0x1.00000001ffffep-36, 0x0.0000000000000p+0, 0x1.fffffffe00000p+40, 0x1.e010001fff800p-24}, {0x1.fffffffe00000p+40, 0x1.e000001fff800p-24, -0x1.00000001ffffep-36, 0x0.0000000000000p+0, 0x1.fffffffe00000p+40, 0x1.dff0001fff800p-24}, {-0x1.fffffffe00000p+40, -0x1.e000001fff800p-24, 0x1.00000001ffffep-36, 0x0.0000000000000p+0, -0x1.fffffffe00000p+40, -0x1.dff0001fff800p-24}, {-0x1.fffffffe00000p+40, -0x1.e000001fff800p-24, -0x1.00000001ffffep-36, 0x0.0000000000000p+0, -0x1.fffffffe00000p+40, -0x1.e010001fff800p-24}, {0x1.0000000000008p+12, -0x1.fffff00400000p-60, 0x1.00003ffffe000p-40, 0x1.ffffe00000000p-112, 0x1.0000000000009p+12, 0x1.ffffeffc00000p-60}, {0x1.0000000000008p+12, -0x1.fffff00400000p-60, -0x1.00003ffffe000p-40, -0x1.ffffe00000000p-112, 0x1.0000000000007p+12, -0x1.7ffff40100000p-58}, {-0x1.0000000000008p+12, 0x1.fffff00400000p-60, 0x1.00003ffffe000p-40, 0x1.ffffe00000000p-112, -0x1.0000000000007p+12, 0x1.7ffff40100000p-58}, {-0x1.0000000000008p+12, 0x1.fffff00400000p-60, -0x1.00003ffffe000p-40, -0x1.ffffe00000000p-112, -0x1.0000000000009p+12, -0x1.ffffeffc00000p-60}, {0x1.0000000000000p-26, 0x1.ffffffffffc00p-89, 0x1.000001ffe0000p+32, 0x1.ff87ff9f801c0p-27, 0x1.000001ffe0000p+32, 0x1.ffc3ffcfc00e0p-26}, {0x1.0000000000000p-26, 0x1.ffffffffffc00p-89, -0x1.000001ffe0000p+32, -0x1.ff87ff9f801c0p-27, -0x1.000001ffe0000p+32, 0x1.e00181ff90000p-37}, {-0x1.0000000000000p-26, -0x1.ffffffffffc00p-89, 0x1.000001ffe0000p+32, 0x1.ff87ff9f801c0p-27, 0x1.000001ffe0000p+32, -0x1.e00181ff90000p-37}, {-0x1.0000000000000p-26, -0x1.ffffffffffc00p-89, -0x1.000001ffe0000p+32, -0x1.ff87ff9f801c0p-27, -0x1.000001ffe0000p+32, -0x1.ffc3ffcfc00e0p-26}, {0x1.0000000000400p+5, -0x1.f800000002000p-56, 0x1.03fffffffff00p+2, 0x1.fffe7fffffffep-52, 0x1.20800000003e0p+5, 0x1.e07e7fffffe00p-52}, {0x1.0000000000400p+5, -0x1.f800000002000p-56, -0x1.03fffffffff00p+2, -0x1.fffe7fffffffep-52, 0x1.bf00000000840p+4, -0x1.0fbf400000100p-51}, {-0x1.0000000000400p+5, 0x1.f800000002000p-56, 0x1.03fffffffff00p+2, 0x1.fffe7fffffffep-52, -0x1.bf00000000840p+4, 0x1.0fbf400000100p-51}, {-0x1.0000000000400p+5, 0x1.f800000002000p-56, -0x1.03fffffffff00p+2, -0x1.fffe7fffffffep-52, -0x1.20800000003e0p+5, -0x1.e07e7fffffe00p-52}, {0x1.0000000000000p+13, 0x1.fffffffffff00p-43, 0x1.000007c000000p-28, 0x1.fff8000000000p-84, 0x1.0000000000800p+13, 0x1.01f0000000780p-42}, {0x1.0000000000000p+13, 0x1.fffffffffff00p-43, -0x1.000007c000000p-28, -0x1.fff8000000000p-84, 0x1.ffffffffff000p+12, 0x1.fc1ffffffef00p-43}, {-0x1.0000000000000p+13, -0x1.fffffffffff00p-43, 0x1.000007c000000p-28, 0x1.fff8000000000p-84, -0x1.ffffffffff000p+12, -0x1.fc1ffffffef00p-43}, {-0x1.0000000000000p+13, -0x1.fffffffffff00p-43, -0x1.000007c000000p-28, -0x1.fff8000000000p-84, -0x1.0000000000800p+13, -0x1.01f0000000780p-42}, {0x1.0000000000400p-35, -0x1.fffc0003fffd0p-92, 0x1.0000000000000p+4, 0x1.fffffff800000p-52, 0x1.0000000002000p+4, 0x1.0000003bff000p-51}, {0x1.0000000000400p-35, -0x1.fffc0003fffd0p-92, -0x1.0000000000000p+4, -0x1.fffffff800000p-52, -0x1.fffffffffc000p+3, -0x1.ffffff7802000p-52}, {-0x1.0000000000400p-35, 0x1.fffc0003fffd0p-92, 0x1.0000000000000p+4, 0x1.fffffff800000p-52, 0x1.fffffffffc000p+3, 0x1.ffffff7802000p-52}, {-0x1.0000000000400p-35, 0x1.fffc0003fffd0p-92, -0x1.0000000000000p+4, -0x1.fffffff800000p-52, -0x1.0000000002000p+4, -0x1.0000003bff000p-51}, {0x1.0000000002000p-51, -0x1.ffff040000000p-122, 0x1.03fffff800000p-40, 0x1.fffffe0000000p-108, 0x1.041ffff800004p-40, 0x1.fff7fe03f0000p-108}, {0x1.0000000002000p-51, -0x1.ffff040000000p-122, -0x1.03fffff800000p-40, -0x1.fffffe0000000p-108, -0x1.03dffff7ffffcp-40, -0x1.0003fefe08000p-107}, {-0x1.0000000002000p-51, 0x1.ffff040000000p-122, 0x1.03fffff800000p-40, 0x1.fffffe0000000p-108, 0x1.03dffff7ffffcp-40, 0x1.0003fefe08000p-107}, {-0x1.0000000002000p-51, 0x1.ffff040000000p-122, -0x1.03fffff800000p-40, -0x1.fffffe0000000p-108, -0x1.041ffff800004p-40, -0x1.fff7fe03f0000p-108}, {0x1.0000008000000p-21, -0x1.ffffff8200000p-78, 0x1.000fff8000000p+9, 0x1.fffffe0000000p-53, 0x1.000fff8400000p+9, 0x1.03fffffa00000p-46}, {0x1.0000008000000p-21, -0x1.ffffff8200000p-78, -0x1.000fff8000000p+9, -0x1.fffffe0000000p-53, -0x1.000fff7c00000p+9, 0x1.f800000400000p-47}, {-0x1.0000008000000p-21, 0x1.ffffff8200000p-78, 0x1.000fff8000000p+9, 0x1.fffffe0000000p-53, 0x1.000fff7c00000p+9, -0x1.f800000400000p-47}, {-0x1.0000008000000p-21, 0x1.ffffff8200000p-78, -0x1.000fff8000000p+9, -0x1.fffffe0000000p-53, -0x1.000fff8400000p+9, -0x1.03fffffa00000p-46}, {0x1.0000000000000p-33, 0x1.0001f9e000000p-93, 0x1.0000000000040p+19, -0x1.fffffc0080000p-53, 0x1.0000000000041p+19, -0x1.fffffc0080000p-53}, {0x1.0000000000000p-33, 0x1.0001f9e000000p-93, -0x1.0000000000040p+19, 0x1.fffffc0080000p-53, -0x1.000000000003fp+19, 0x1.fffffc0080000p-53}, {-0x1.0000000000000p-33, -0x1.0001f9e000000p-93, 0x1.0000000000040p+19, -0x1.fffffc0080000p-53, 0x1.000000000003fp+19, -0x1.fffffc0080000p-53}, {-0x1.0000000000000p-33, -0x1.0001f9e000000p-93, -0x1.0000000000040p+19, 0x1.fffffc0080000p-53, -0x1.0000000000041p+19, 0x1.fffffc0080000p-53}, {0x1.0000ff0007e00p-13, 0x1.ffc001ff00000p-80, 0x1.0000010000000p-33, -0x1.ffc007ffffe20p-91, 0x1.00010f0007f00p-13, 0x1.ff8009fe00000p-80}, {0x1.0000ff0007e00p-13, 0x1.ffc001ff00000p-80, -0x1.0000010000000p-33, 0x1.ffc007ffffe20p-91, 0x1.0000ef0007d00p-13, 0x1.fffffa0000000p-80}, {-0x1.0000ff0007e00p-13, -0x1.ffc001ff00000p-80, 0x1.0000010000000p-33, -0x1.ffc007ffffe20p-91, -0x1.0000ef0007d00p-13, -0x1.fffffa0000000p-80}, {-0x1.0000ff0007e00p-13, -0x1.ffc001ff00000p-80, -0x1.0000010000000p-33, 0x1.ffc007ffffe20p-91, -0x1.00010f0007f00p-13, -0x1.ff8009fe00000p-80}, {0x1.07ffffff1fe00p-53, 0x1.fc00000000000p-150, 0x1.0040000000000p-23, -0x1.c000000400000p-84, 0x1.0040000420000p-23, -0x1.1808000200000p-83}, {0x1.07ffffff1fe00p-53, 0x1.fc00000000000p-150, -0x1.0040000000000p-23, 0x1.c000000400000p-84, -0x1.003ffffbe0000p-23, 0x1.4ff0000400000p-84}, {-0x1.07ffffff1fe00p-53, -0x1.fc00000000000p-150, 0x1.0040000000000p-23, -0x1.c000000400000p-84, 0x1.003ffffbe0000p-23, -0x1.4ff0000400000p-84}, {-0x1.07ffffff1fe00p-53, -0x1.fc00000000000p-150, -0x1.0040000000000p-23, 0x1.c000000400000p-84, -0x1.0040000420000p-23, 0x1.1808000200000p-83}, {0x1.0080000000000p+15, -0x1.0000000000000p-90, 0x1.00000001fffc0p-35, 0x1.fffff80f80000p-107, 0x1.0080000000004p+15, 0x1.fffbfe0000000p-67}, {0x1.0080000000000p+15, -0x1.0000000000000p-90, -0x1.00000001fffc0p-35, -0x1.fffff80f80000p-107, 0x1.007fffffffffcp+15, -0x1.fffc020000000p-67}, {-0x1.0080000000000p+15, 0x1.0000000000000p-90, 0x1.00000001fffc0p-35, 0x1.fffff80f80000p-107, -0x1.007fffffffffcp+15, 0x1.fffc020000000p-67}, {-0x1.0080000000000p+15, 0x1.0000000000000p-90, -0x1.00000001fffc0p-35, -0x1.fffff80f80000p-107, -0x1.0080000000004p+15, -0x1.fffbfe0000000p-67}, {0x1.000000003ff00p+2, 0x0.0000000000000p+0, 0x1.0000000000000p+46, 0x1.f83007ffffe00p-14, 0x1.0000000000100p+46, 0x1.f83047efffe00p-14}, {0x1.000000003ff00p+2, 0x0.0000000000000p+0, -0x1.0000000000000p+46, -0x1.f83007ffffe00p-14, -0x1.ffffffffffe00p+45, -0x1.f82fc80fffe00p-14}, {-0x1.000000003ff00p+2, 0x0.0000000000000p+0, 0x1.0000000000000p+46, 0x1.f83007ffffe00p-14, 0x1.ffffffffffe00p+45, 0x1.f82fc80fffe00p-14}, {-0x1.000000003ff00p+2, 0x0.0000000000000p+0, -0x1.0000000000000p+46, -0x1.f83007ffffe00p-14, -0x1.0000000000100p+46, -0x1.f83047efffe00p-14}, {0x1.00003fffffe00p+13, 0x1.fffffc0000380p-47, 0x1.0000010000000p-8, -0x1.ffffff8000008p-64, 0x1.000047ffffe80p+13, 0x1.fffefc0000780p-47}, {0x1.00003fffffe00p+13, 0x1.fffffc0000380p-47, -0x1.0000010000000p-8, 0x1.ffffff8000008p-64, 0x1.000037ffffd80p+13, 0x1.00007dfffffc0p-46}, {-0x1.00003fffffe00p+13, -0x1.fffffc0000380p-47, 0x1.0000010000000p-8, -0x1.ffffff8000008p-64, -0x1.000037ffffd80p+13, -0x1.00007dfffffc0p-46}, {-0x1.00003fffffe00p+13, -0x1.fffffc0000380p-47, -0x1.0000010000000p-8, 0x1.ffffff8000008p-64, -0x1.000047ffffe80p+13, -0x1.fffefc0000780p-47}, {0x1.0000000080000p+13, -0x1.fffffc0010000p-56, 0x1.3fffff8000000p-19, 0x1.fffff800fe000p-85, 0x1.00000001c0000p+13, -0x1.001fffffbf010p-44}, {0x1.0000000080000p+13, -0x1.fffffc0010000p-56, -0x1.3fffff8000000p-19, -0x1.fffff800fe000p-85, 0x1.fffffffe80000p+12, 0x1.ffc000007dfe0p-45}, {-0x1.0000000080000p+13, 0x1.fffffc0010000p-56, 0x1.3fffff8000000p-19, 0x1.fffff800fe000p-85, -0x1.fffffffe80000p+12, -0x1.ffc000007dfe0p-45}, {-0x1.0000000080000p+13, 0x1.fffffc0010000p-56, -0x1.3fffff8000000p-19, -0x1.fffff800fe000p-85, -0x1.00000001c0000p+13, 0x1.001fffffbf010p-44}, {0x1.0003f001fc3f0p-13, 0x1.fffffc0000000p-69, 0x1.0000000000000p+27, 0x1.fc1fffc0000fep-27, 0x1.0000000001001p+27, -0x1.07df81303f702p-27}, {0x1.0003f001fc3f0p-13, 0x1.fffffc0000000p-69, -0x1.0000000000000p+27, -0x1.fc1fffc0000fep-27, -0x1.fffffffffe001p+26, 0x1.ffc0fe9f80e04p-28}, {-0x1.0003f001fc3f0p-13, -0x1.fffffc0000000p-69, 0x1.0000000000000p+27, 0x1.fc1fffc0000fep-27, 0x1.fffffffffe001p+26, -0x1.ffc0fe9f80e04p-28}, {-0x1.0003f001fc3f0p-13, -0x1.fffffc0000000p-69, -0x1.0000000000000p+27, -0x1.fc1fffc0000fep-27, -0x1.0000000001001p+27, 0x1.07df81303f702p-27}, {0x1.0000000000000p+49, 0x1.fffffffffffc0p-10, 0x1.0000000000000p+12, 0x1.ffffffffffe00p-50, 0x1.0000000008000p+49, 0x1.0000000000fe0p-9}, {0x1.0000000000000p+49, 0x1.fffffffffffc0p-10, -0x1.0000000000000p+12, -0x1.ffffffffffe00p-50, 0x1.fffffffff0000p+48, 0x1.fffffffffdfc0p-10}, {-0x1.0000000000000p+49, -0x1.fffffffffffc0p-10, 0x1.0000000000000p+12, 0x1.ffffffffffe00p-50, -0x1.fffffffff0000p+48, -0x1.fffffffffdfc0p-10}, {-0x1.0000000000000p+49, -0x1.fffffffffffc0p-10, -0x1.0000000000000p+12, -0x1.ffffffffffe00p-50, -0x1.0000000008000p+49, -0x1.0000000000fe0p-9}, {0x1.0000000100000p-51, -0x1.0000000000000p-130, 0x1.0000004000000p+23, -0x1.0000000000000p-57, 0x1.0000004000000p+23, 0x1.f800000000000p-52}, {0x1.0000000100000p-51, -0x1.0000000000000p-130, -0x1.0000004000000p+23, 0x1.0000000000000p-57, -0x1.0000004000000p+23, 0x1.0400000000000p-51}, {-0x1.0000000100000p-51, 0x1.0000000000000p-130, 0x1.0000004000000p+23, -0x1.0000000000000p-57, 0x1.0000004000000p+23, -0x1.0400000000000p-51}, {-0x1.0000000100000p-51, 0x1.0000000000000p-130, -0x1.0000004000000p+23, 0x1.0000000000000p-57, -0x1.0000004000000p+23, -0x1.f800000000000p-52}, {0x1.0000010000000p-27, -0x1.ffffe00001000p-83, 0x1.000ffffff007fp-2, 0x1.ffffc00000000p-83, 0x1.0010007ff0087p-2, -0x1.0000000000000p-102}, {0x1.0000010000000p-27, -0x1.ffffe00001000p-83, -0x1.000ffffff007fp-2, -0x1.ffffc00000000p-83, -0x1.000fff7ff0077p-2, -0x1.ffffd00000000p-82}, {-0x1.0000010000000p-27, 0x1.ffffe00001000p-83, 0x1.000ffffff007fp-2, 0x1.ffffc00000000p-83, 0x1.000fff7ff0077p-2, 0x1.ffffd00000000p-82}, {-0x1.0000010000000p-27, 0x1.ffffe00001000p-83, -0x1.000ffffff007fp-2, -0x1.ffffc00000000p-83, -0x1.0010007ff0087p-2, 0x1.0000000000000p-102}, {0x1.1000fffffc000p+50, 0x1.fffffc003f000p-6, 0x1.0000000001000p+30, -0x1.0000000000000p-75, 0x1.10010ffffc000p+50, 0x1.07fffe001f800p-5}, {0x1.1000fffffc000p+50, 0x1.fffffc003f000p-6, -0x1.0000000001000p+30, 0x1.0000000000000p-75, 0x1.1000effffc000p+50, 0x1.effffc003f000p-6}, {-0x1.1000fffffc000p+50, -0x1.fffffc003f000p-6, 0x1.0000000001000p+30, -0x1.0000000000000p-75, -0x1.1000effffc000p+50, -0x1.effffc003f000p-6}, {-0x1.1000fffffc000p+50, -0x1.fffffc003f000p-6, -0x1.0000000001000p+30, 0x1.0000000000000p-75, -0x1.10010ffffc000p+50, -0x1.07fffe001f800p-5}, {0x1.00000fff80000p+32, 0x1.fffe000000000p-53, 0x1.0000001f00000p+41, 0x1.fffffff000000p-36, 0x1.00800026ffc00p+41, 0x1.00007ff800000p-35}, {0x1.00000fff80000p+32, 0x1.fffe000000000p-53, -0x1.0000001f00000p+41, -0x1.fffffff000000p-36, -0x1.ff00002e00800p+40, -0x1.fffefff000000p-36}, {-0x1.00000fff80000p+32, -0x1.fffe000000000p-53, 0x1.0000001f00000p+41, 0x1.fffffff000000p-36, 0x1.ff00002e00800p+40, 0x1.fffefff000000p-36}, {-0x1.00000fff80000p+32, -0x1.fffe000000000p-53, -0x1.0000001f00000p+41, -0x1.fffffff000000p-36, -0x1.00800026ffc00p+41, -0x1.00007ff800000p-35}, {0x1.3fdfffff02000p+34, -0x1.0000000000000p-44, 0x1.0000000000000p+31, 0x1.ffffffffffe00p-30, 0x1.5fdfffff02000p+34, 0x1.fffc000000000p-30}, {0x1.3fdfffff02000p+34, -0x1.0000000000000p-44, -0x1.0000000000000p+31, -0x1.ffffffffffe00p-30, 0x1.1fdfffff02000p+34, -0x1.0002000000000p-29}, {-0x1.3fdfffff02000p+34, 0x1.0000000000000p-44, 0x1.0000000000000p+31, 0x1.ffffffffffe00p-30, -0x1.1fdfffff02000p+34, 0x1.0002000000000p-29}, {-0x1.3fdfffff02000p+34, 0x1.0000000000000p-44, -0x1.0000000000000p+31, -0x1.ffffffffffe00p-30, -0x1.5fdfffff02000p+34, -0x1.fffc000000000p-30}, {0x1.0000000000008p+41, -0x1.e0ffffd002000p-25, 0x1.0000000000400p+36, 0x1.ffffffff03ffep-18, 0x1.0800000000028p+41, 0x1.fc3dffff63fc0p-18}, {0x1.0000000000008p+41, -0x1.e0ffffd002000p-25, -0x1.0000000000400p+36, -0x1.ffffffff03ffep-18, 0x1.effffffffffd0p+40, -0x1.01e0ffff52020p-17}, {-0x1.0000000000008p+41, 0x1.e0ffffd002000p-25, 0x1.0000000000400p+36, 0x1.ffffffff03ffep-18, -0x1.effffffffffd0p+40, 0x1.01e0ffff52020p-17}, {-0x1.0000000000008p+41, 0x1.e0ffffd002000p-25, -0x1.0000000000400p+36, -0x1.ffffffff03ffep-18, -0x1.0800000000028p+41, -0x1.fc3dffff63fc0p-18}, {0x1.000000fffe020p+17, -0x1.f800100000000p-56, 0x1.0001fff80ffc0p+20, 0x1.ff00000000000p-77, 0x1.200200180fbc4p+20, -0x1.f800000800000p-56}, {0x1.000000fffe020p+17, -0x1.f800100000000p-56, -0x1.0001fff80ffc0p+20, -0x1.ff00000000000p-77, -0x1.c003ffb020778p+19, -0x1.f8001ff800000p-56}, {-0x1.000000fffe020p+17, 0x1.f800100000000p-56, 0x1.0001fff80ffc0p+20, 0x1.ff00000000000p-77, 0x1.c003ffb020778p+19, 0x1.f8001ff800000p-56}, {-0x1.000000fffe020p+17, 0x1.f800100000000p-56, -0x1.0001fff80ffc0p+20, -0x1.ff00000000000p-77, -0x1.200200180fbc4p+20, 0x1.f800000800000p-56}, {0x1.4000000000000p+46, -0x1.0000000000000p-59, 0x1.0000000000010p-11, 0x1.e000000000000p-79, 0x1.4000000000000p+46, 0x1.0000000000000p-11}, {0x1.4000000000000p+46, -0x1.0000000000000p-59, -0x1.0000000000010p-11, -0x1.e000000000000p-79, 0x1.4000000000000p+46, -0x1.0000000000020p-11}, {-0x1.4000000000000p+46, 0x1.0000000000000p-59, 0x1.0000000000010p-11, 0x1.e000000000000p-79, -0x1.4000000000000p+46, 0x1.0000000000020p-11}, {-0x1.4000000000000p+46, 0x1.0000000000000p-59, -0x1.0000000000010p-11, -0x1.e000000000000p-79, -0x1.4000000000000p+46, -0x1.0000000000000p-11}, {0x1.2000000000000p+0, -0x1.fffffff01ff20p-57, 0x1.0000000000000p-33, 0x1.fff8003ff0000p-90, 0x1.2000000080000p+0, -0x1.ffffffef1ff60p-57}, {0x1.2000000000000p+0, -0x1.fffffff01ff20p-57, -0x1.0000000000000p-33, -0x1.fff8003ff0000p-90, 0x1.1fffffff80000p+0, -0x1.fffffff11fee0p-57}, {-0x1.2000000000000p+0, 0x1.fffffff01ff20p-57, 0x1.0000000000000p-33, 0x1.fff8003ff0000p-90, -0x1.1fffffff80000p+0, 0x1.fffffff11fee0p-57}, {-0x1.2000000000000p+0, 0x1.fffffff01ff20p-57, -0x1.0000000000000p-33, -0x1.fff8003ff0000p-90, -0x1.2000000080000p+0, 0x1.ffffffef1ff60p-57}, {0x1.2000000000000p+14, -0x1.fc08000000000p-78, 0x1.0000000038004p+6, -0x1.fffffc4000000p-63, 0x1.2100000000380p+14, 0x1.ffff7fff02ec0p-45}, {0x1.2000000000000p+14, -0x1.fc08000000000p-78, -0x1.0000000038004p+6, 0x1.fffffc4000000p-63, 0x1.1effffffffc80p+14, -0x1.ffff8000fef40p-45}, {-0x1.2000000000000p+14, 0x1.fc08000000000p-78, 0x1.0000000038004p+6, -0x1.fffffc4000000p-63, -0x1.1effffffffc80p+14, 0x1.ffff8000fef40p-45}, {-0x1.2000000000000p+14, 0x1.fc08000000000p-78, -0x1.0000000038004p+6, 0x1.fffffc4000000p-63, -0x1.2100000000380p+14, -0x1.ffff7fff02ec0p-45}, {0x1.0000000000200p+30, 0x0.0000000000000p+0, 0x1.00001ffff0000p+10, 0x1.ffff80001f000p-47, 0x1.0000100002200p+30, -0x1.ffffe00008000p-27}, {0x1.0000000000200p+30, 0x0.0000000000000p+0, -0x1.00001ffff0000p+10, -0x1.ffff80001f000p-47, 0x1.ffffdffffc400p+29, 0x1.ffffe00008000p-27}, {-0x1.0000000000200p+30, 0x0.0000000000000p+0, 0x1.00001ffff0000p+10, 0x1.ffff80001f000p-47, -0x1.ffffdffffc400p+29, -0x1.ffffe00008000p-27}, {-0x1.0000000000200p+30, 0x0.0000000000000p+0, -0x1.00001ffff0000p+10, -0x1.ffff80001f000p-47, -0x1.0000100002200p+30, 0x1.ffffe00008000p-27}, {0x1.0000100000000p-17, -0x1.0000000000000p-122, 0x1.0038000800000p+15, -0x1.fffffe0000080p-45, 0x1.0038000900001p+15, -0x1.fffffe0000080p-45}, {0x1.0000100000000p-17, -0x1.0000000000000p-122, -0x1.0038000800000p+15, 0x1.fffffe0000080p-45, -0x1.00380006fffffp+15, 0x1.fffffe0000080p-45}, {-0x1.0000100000000p-17, 0x1.0000000000000p-122, 0x1.0038000800000p+15, -0x1.fffffe0000080p-45, 0x1.00380006fffffp+15, -0x1.fffffe0000080p-45}, {-0x1.0000100000000p-17, 0x1.0000000000000p-122, -0x1.0038000800000p+15, 0x1.fffffe0000080p-45, -0x1.0038000900001p+15, 0x1.fffffe0000080p-45}, {0x1.0000000000004p-11, -0x1.ffffe00400000p-84, 0x1.0000000000000p-12, 0x1.ffffffffffff8p-68, 0x1.8000000000004p-11, 0x1.fffe00001ffc0p-68}, {0x1.0000000000004p-11, -0x1.ffffe00400000p-84, -0x1.0000000000000p-12, -0x1.ffffffffffff8p-68, 0x1.0000000000008p-12, -0x1.0000fffff001cp-67}, {-0x1.0000000000004p-11, 0x1.ffffe00400000p-84, 0x1.0000000000000p-12, 0x1.ffffffffffff8p-68, -0x1.0000000000008p-12, 0x1.0000fffff001cp-67}, {-0x1.0000000000004p-11, 0x1.ffffe00400000p-84, -0x1.0000000000000p-12, -0x1.ffffffffffff8p-68, -0x1.8000000000004p-11, -0x1.fffe00001ffc0p-68}, {0x1.0000000000100p-33, -0x1.ffffe7e400000p-103, 0x1.1ffe000008000p-33, -0x1.fffc000004000p-100, 0x1.0fff000004080p-32, -0x1.1ffdfe7e40000p-99}, {0x1.0000000000100p-33, -0x1.ffffe7e400000p-103, -0x1.1ffe000008000p-33, 0x1.fffc000004000p-100, -0x1.ffe000007f000p-37, 0x1.bffc030384000p-100}, {-0x1.0000000000100p-33, 0x1.ffffe7e400000p-103, 0x1.1ffe000008000p-33, -0x1.fffc000004000p-100, 0x1.ffe000007f000p-37, -0x1.bffc030384000p-100}, {-0x1.0000000000100p-33, 0x1.ffffe7e400000p-103, -0x1.1ffe000008000p-33, 0x1.fffc000004000p-100, -0x1.0fff000004080p-32, 0x1.1ffdfe7e40000p-99}, {0x1.0000000000004p-52, -0x1.0000000000000p-157, 0x1.00000007ffffep-10, 0x1.ffffe000f0000p-71, 0x1.00000008003fep-10, 0x1.ffffe002f0000p-71}, {0x1.0000000000004p-52, -0x1.0000000000000p-157, -0x1.00000007ffffep-10, -0x1.ffffe000f0000p-71, -0x1.00000007ffbfep-10, -0x1.ffffdffef0000p-71}, {-0x1.0000000000004p-52, 0x1.0000000000000p-157, 0x1.00000007ffffep-10, 0x1.ffffe000f0000p-71, 0x1.00000007ffbfep-10, 0x1.ffffdffef0000p-71}, {-0x1.0000000000004p-52, 0x1.0000000000000p-157, -0x1.00000007ffffep-10, -0x1.ffffe000f0000p-71, -0x1.00000008003fep-10, -0x1.ffffe002f0000p-71}, {0x1.0000000000000p+3, 0x1.fffffff000000p-58, 0x1.0001fffc00001p-42, -0x1.0000000000000p-121, 0x1.0000000000080p+3, 0x1.fffdfff808000p-57}, {0x1.0000000000000p+3, 0x1.fffffff000000p-58, -0x1.0001fffc00001p-42, 0x1.0000000000000p-121, 0x1.fffffffffff00p+2, 0x1.fff7f80000000p-73}, {-0x1.0000000000000p+3, -0x1.fffffff000000p-58, 0x1.0001fffc00001p-42, -0x1.0000000000000p-121, -0x1.fffffffffff00p+2, -0x1.fff7f80000000p-73}, {-0x1.0000000000000p+3, -0x1.fffffff000000p-58, -0x1.0001fffc00001p-42, 0x1.0000000000000p-121, -0x1.0000000000080p+3, -0x1.fffdfff808000p-57}, {0x1.00007fdfffff0p+50, 0x1.fff000f803fe0p-8, 0x1.0080000000000p-8, -0x1.0000000000000p-100, 0x1.00007fdfffff0p+50, 0x1.8038007c01ff0p-7}, {0x1.00007fdfffff0p+50, 0x1.fff000f803fe0p-8, -0x1.0080000000000p-8, 0x1.0000000000000p-100, 0x1.00007fdfffff0p+50, 0x1.fee001f007fc0p-9}, {-0x1.00007fdfffff0p+50, -0x1.fff000f803fe0p-8, 0x1.0080000000000p-8, -0x1.0000000000000p-100, -0x1.00007fdfffff0p+50, -0x1.fee001f007fc0p-9}, {-0x1.00007fdfffff0p+50, -0x1.fff000f803fe0p-8, -0x1.0080000000000p-8, 0x1.0000000000000p-100, -0x1.00007fdfffff0p+50, -0x1.8038007c01ff0p-7}, {0x1.0000000000080p+4, 0x0.0000000000000p+0, 0x1.0000080000000p+20, -0x1.0000000000000p-65, 0x1.0001080000000p+20, 0x1.fffffe0000000p-42}, {0x1.0000000000080p+4, 0x0.0000000000000p+0, -0x1.0000080000000p+20, 0x1.0000000000000p-65, -0x1.fffe100000000p+19, 0x1.0000010000000p-41}, {-0x1.0000000000080p+4, 0x0.0000000000000p+0, 0x1.0000080000000p+20, -0x1.0000000000000p-65, 0x1.fffe100000000p+19, -0x1.0000010000000p-41}, {-0x1.0000000000080p+4, 0x0.0000000000000p+0, -0x1.0000080000000p+20, 0x1.0000000000000p-65, -0x1.0001080000000p+20, -0x1.fffffe0000000p-42}, {0x1.0400000000000p+20, -0x1.0000000000000p-85, 0x1.0000000000400p+5, -0x1.fffff00008000p-51, 0x1.0402000000000p+20, 0x1.fff000007ffe0p-38}, {0x1.0400000000000p+20, -0x1.0000000000000p-85, -0x1.0000000000400p+5, 0x1.fffff00008000p-51, 0x1.03fe000000000p+20, -0x1.fff0000080020p-38}, {-0x1.0400000000000p+20, 0x1.0000000000000p-85, 0x1.0000000000400p+5, -0x1.fffff00008000p-51, -0x1.03fe000000000p+20, 0x1.fff0000080020p-38}, {-0x1.0400000000000p+20, 0x1.0000000000000p-85, -0x1.0000000000400p+5, 0x1.fffff00008000p-51, -0x1.0402000000000p+20, -0x1.fff000007ffe0p-38}, {0x1.0000000000001p+43, -0x1.fc0000c004000p-22, 0x1.0000000000200p+29, -0x1.ffe0000200000p-39, 0x1.0004000000001p+43, 0x1.fc07fdfe9ff80p-15}, {0x1.0000000000001p+43, -0x1.fc0000c004000p-22, -0x1.0000000000200p+29, 0x1.ffe0000200000p-39, 0x1.fff8000000002p+42, -0x1.01fbff00d0040p-14}, {-0x1.0000000000001p+43, 0x1.fc0000c004000p-22, 0x1.0000000000200p+29, -0x1.ffe0000200000p-39, -0x1.fff8000000002p+42, 0x1.01fbff00d0040p-14}, {-0x1.0000000000001p+43, 0x1.fc0000c004000p-22, -0x1.0000000000200p+29, 0x1.ffe0000200000p-39, -0x1.0004000000001p+43, -0x1.fc07fdfe9ff80p-15}, {0x1.00000c0000004p+1, -0x1.ff80000800000p-67, 0x1.18003ffff8000p+4, 0x1.ffffff8000000p-62, 0x1.3800417ff8001p+4, -0x1.ffe0ffc008040p-50}, {0x1.00000c0000004p+1, -0x1.ff80000800000p-67, -0x1.18003ffff8000p+4, -0x1.ffffff8000000p-62, -0x1.f0007cffeffffp+3, -0x1.07fdffc020000p-61}, {-0x1.00000c0000004p+1, 0x1.ff80000800000p-67, 0x1.18003ffff8000p+4, 0x1.ffffff8000000p-62, 0x1.f0007cffeffffp+3, 0x1.07fdffc020000p-61}, {-0x1.00000c0000004p+1, 0x1.ff80000800000p-67, -0x1.18003ffff8000p+4, -0x1.ffffff8000000p-62, -0x1.3800417ff8001p+4, 0x1.ffe0ffc008040p-50}, {0x1.1ffff80000040p+31, -0x1.0000000000000p-59, 0x1.000000000fe00p+44, 0x1.ffff7e0003ff8p-12, 0x1.0008ffffcfe00p+44, 0x1.0fffbf0001fecp-11}, {0x1.1ffff80000040p+31, -0x1.0000000000000p-59, -0x1.000000000fe00p+44, -0x1.ffff7e0003ff8p-12, -0x1.ffee00009fc00p+43, -0x1.dfff7e0004018p-12}, {-0x1.1ffff80000040p+31, 0x1.0000000000000p-59, 0x1.000000000fe00p+44, 0x1.ffff7e0003ff8p-12, 0x1.ffee00009fc00p+43, 0x1.dfff7e0004018p-12}, {-0x1.1ffff80000040p+31, 0x1.0000000000000p-59, -0x1.000000000fe00p+44, -0x1.ffff7e0003ff8p-12, -0x1.0008ffffcfe00p+44, -0x1.0fffbf0001fecp-11}, {0x1.3fc0000040000p-13, -0x1.fffffff802000p-69, 0x1.fffffffffff00p+30, 0x0.0000000000000p+0, 0x1.00000000000c0p+31, -0x1.fffffe0000100p-24}, {0x1.3fc0000040000p-13, -0x1.fffffff802000p-69, -0x1.fffffffffff00p+30, 0x0.0000000000000p+0, -0x1.ffffffffffc80p+30, -0x1.fffffe0000100p-24}, {-0x1.3fc0000040000p-13, 0x1.fffffff802000p-69, 0x1.fffffffffff00p+30, 0x0.0000000000000p+0, 0x1.ffffffffffc80p+30, 0x1.fffffe0000100p-24}, {-0x1.3fc0000040000p-13, 0x1.fffffff802000p-69, -0x1.fffffffffff00p+30, 0x0.0000000000000p+0, -0x1.00000000000c0p+31, 0x1.fffffe0000100p-24}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, 0x1.0000000000200p-15, -0x1.0000000000000p-120, 0x1.00040001fffffp-1, 0x1.000400007e000p-58}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, -0x1.0000000000200p-15, 0x1.0000000000000p-120, 0x1.fff80003ffffep-2, -0x1.fff7ffff04000p-59}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, 0x1.0000000000200p-15, -0x1.0000000000000p-120, -0x1.fff80003ffffep-2, 0x1.fff7ffff04000p-59}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, -0x1.0000000000200p-15, 0x1.0000000000000p-120, -0x1.00040001fffffp-1, -0x1.000400007e000p-58}, {0x1.0000000010000p+26, -0x1.0000000000000p-51, 0x1.1fff010000000p-53, 0x1.ff8c0000007fep-107, 0x1.0000000010000p+26, -0x1.70007f8000000p-52}, {0x1.0000000010000p+26, -0x1.0000000000000p-51, -0x1.1fff010000000p-53, -0x1.ff8c0000007fep-107, 0x1.0000000010000p+26, -0x1.47ffc04000000p-51}, {-0x1.0000000010000p+26, 0x1.0000000000000p-51, 0x1.1fff010000000p-53, 0x1.ff8c0000007fep-107, -0x1.0000000010000p+26, 0x1.47ffc04000000p-51}, {-0x1.0000000010000p+26, 0x1.0000000000000p-51, -0x1.1fff010000000p-53, -0x1.ff8c0000007fep-107, -0x1.0000000010000p+26, 0x1.70007f8000000p-52}, {0x1.0000000000002p-44, -0x1.0000000000000p-131, 0x1.0000000000200p+33, -0x1.0000000000000p-52, 0x1.0000000000200p+33, 0x1.fe00000000000p-45}, {0x1.0000000000002p-44, -0x1.0000000000000p-131, -0x1.0000000000200p+33, 0x1.0000000000000p-52, -0x1.0000000000200p+33, 0x1.0100000000000p-44}, {-0x1.0000000000002p-44, 0x1.0000000000000p-131, 0x1.0000000000200p+33, -0x1.0000000000000p-52, 0x1.0000000000200p+33, -0x1.0100000000000p-44}, {-0x1.0000000000002p-44, 0x1.0000000000000p-131, -0x1.0000000000200p+33, 0x1.0000000000000p-52, -0x1.0000000000200p+33, -0x1.fe00000000000p-45}, {0x1.0000000000002p+32, -0x1.ffff800008000p-35, 0x1.000000003fffep-25, 0x1.f81fc007c0000p-96, 0x1.0000000000002p+32, 0x1.ff0000407ffc0p-26}, {0x1.0000000000002p+32, -0x1.ffff800008000p-35, -0x1.000000003fffep-25, -0x1.f81fc007c0000p-96, 0x1.0000000000002p+32, -0x1.007fffe040020p-25}, {-0x1.0000000000002p+32, 0x1.ffff800008000p-35, 0x1.000000003fffep-25, 0x1.f81fc007c0000p-96, -0x1.0000000000002p+32, 0x1.007fffe040020p-25}, {-0x1.0000000000002p+32, 0x1.ffff800008000p-35, -0x1.000000003fffep-25, -0x1.f81fc007c0000p-96, -0x1.0000000000002p+32, -0x1.ff0000407ffc0p-26}, {0x1.7ffffffff0000p+18, 0x1.ffff07fffc000p-46, 0x1.000000000ffe0p-32, 0x1.ff0000003c000p-95, 0x1.7ffffffff0004p+18, 0x1.ffff0bff7c000p-46}, {0x1.7ffffffff0000p+18, 0x1.ffff07fffc000p-46, -0x1.000000000ffe0p-32, -0x1.ff0000003c000p-95, 0x1.7fffffffefffcp+18, 0x1.ffff04007c000p-46}, {-0x1.7ffffffff0000p+18, -0x1.ffff07fffc000p-46, 0x1.000000000ffe0p-32, 0x1.ff0000003c000p-95, -0x1.7fffffffefffcp+18, -0x1.ffff04007c000p-46}, {-0x1.7ffffffff0000p+18, -0x1.ffff07fffc000p-46, -0x1.000000000ffe0p-32, -0x1.ff0000003c000p-95, -0x1.7ffffffff0004p+18, -0x1.ffff0bff7c000p-46}, {0x1.00007fff00080p-52, -0x1.ffffff0001000p-117, 0x1.00000000007c0p+41, 0x1.ffffff8000000p-26, 0x1.00000000007c0p+41, 0x1.ffffffc000000p-26}, {0x1.00007fff00080p-52, -0x1.ffffff0001000p-117, -0x1.00000000007c0p+41, -0x1.ffffff8000000p-26, -0x1.00000000007c0p+41, -0x1.ffffff4000000p-26}, {-0x1.00007fff00080p-52, 0x1.ffffff0001000p-117, 0x1.00000000007c0p+41, 0x1.ffffff8000000p-26, 0x1.00000000007c0p+41, 0x1.ffffff4000000p-26}, {-0x1.00007fff00080p-52, 0x1.ffffff0001000p-117, -0x1.00000000007c0p+41, -0x1.ffffff8000000p-26, -0x1.00000000007c0p+41, -0x1.ffffffc000000p-26}, {0x1.1fff81ff00000p+13, 0x1.e007ffff00000p-44, 0x1.1ffffffff8000p-5, 0x1.fe001ffffffe0p-61, 0x1.1fffc9ff00000p+13, -0x1.0ffb808078000p-43}, {0x1.1fff81ff00000p+13, 0x1.e007ffff00000p-44, -0x1.1ffffffff8000p-5, -0x1.fe001ffffffe0p-61, 0x1.1fff39ff00000p+13, 0x1.7801c03fbc000p-42}, {-0x1.1fff81ff00000p+13, -0x1.e007ffff00000p-44, 0x1.1ffffffff8000p-5, 0x1.fe001ffffffe0p-61, -0x1.1fff39ff00000p+13, -0x1.7801c03fbc000p-42}, {-0x1.1fff81ff00000p+13, -0x1.e007ffff00000p-44, -0x1.1ffffffff8000p-5, -0x1.fe001ffffffe0p-61, -0x1.1fffc9ff00000p+13, 0x1.0ffb808078000p-43}, {0x1.0000000000000p+15, 0x1.fffc03fe00700p-46, 0x1.0000000000001p+24, -0x1.fff8060000f34p-31, 0x1.0080000000001p+24, -0x1.fff40607f8f74p-31}, {0x1.0000000000000p+15, 0x1.fffc03fe00700p-46, -0x1.0000000000001p+24, 0x1.fff8060000f34p-31, -0x1.ff00000000002p+23, 0x1.fffc05f808ef4p-31}, {-0x1.0000000000000p+15, -0x1.fffc03fe00700p-46, 0x1.0000000000001p+24, -0x1.fff8060000f34p-31, 0x1.ff00000000002p+23, -0x1.fffc05f808ef4p-31}, {-0x1.0000000000000p+15, -0x1.fffc03fe00700p-46, -0x1.0000000000001p+24, 0x1.fff8060000f34p-31, -0x1.0080000000001p+24, 0x1.fff40607f8f74p-31}, {0x1.001ffffc00080p+19, -0x1.fe00000200000p-42, 0x1.0000000001000p-24, -0x1.fe3ffffff0080p-84, 0x1.001ffffc00280p+19, -0x1.fdfffc0200800p-42}, {0x1.001ffffc00080p+19, -0x1.fe00000200000p-42, -0x1.0000000001000p-24, 0x1.fe3ffffff0080p-84, 0x1.001ffffbffe80p+19, -0x1.fe000401ff800p-42}, {-0x1.001ffffc00080p+19, 0x1.fe00000200000p-42, 0x1.0000000001000p-24, -0x1.fe3ffffff0080p-84, -0x1.001ffffbffe80p+19, 0x1.fe000401ff800p-42}, {-0x1.001ffffc00080p+19, 0x1.fe00000200000p-42, -0x1.0000000001000p-24, 0x1.fe3ffffff0080p-84, -0x1.001ffffc00280p+19, 0x1.fdfffc0200800p-42}, {0x1.00001fffff800p+37, 0x1.ffffff801ffc0p-22, 0x1.0000000002000p+12, -0x1.0000000000000p-93, 0x1.0000207fff800p+37, 0x1.03ffffc00ffe0p-21}, {0x1.00001fffff800p+37, 0x1.ffffff801ffc0p-22, -0x1.0000000002000p+12, 0x1.0000000000000p-93, 0x1.00001f7fff800p+37, 0x1.f7ffff801ffc0p-22}, {-0x1.00001fffff800p+37, -0x1.ffffff801ffc0p-22, 0x1.0000000002000p+12, -0x1.0000000000000p-93, -0x1.00001f7fff800p+37, -0x1.f7ffff801ffc0p-22}, {-0x1.00001fffff800p+37, -0x1.ffffff801ffc0p-22, -0x1.0000000002000p+12, 0x1.0000000000000p-93, -0x1.0000207fff800p+37, -0x1.03ffffc00ffe0p-21}, {0x1.0000000000000p-40, 0x1.ffff83ffbfff0p-96, 0x1.0000000000000p-34, 0x1.ffffffffe0000p-90, 0x1.0400000000000p-34, 0x1.03ffff07ef800p-89}, {0x1.0000000000000p-40, 0x1.ffff83ffbfff0p-96, -0x1.0000000000000p-34, -0x1.ffffffffe0000p-90, -0x1.f800000000000p-35, -0x1.f80001efe1000p-90}, {-0x1.0000000000000p-40, -0x1.ffff83ffbfff0p-96, 0x1.0000000000000p-34, 0x1.ffffffffe0000p-90, 0x1.f800000000000p-35, 0x1.f80001efe1000p-90}, {-0x1.0000000000000p-40, -0x1.ffff83ffbfff0p-96, -0x1.0000000000000p-34, -0x1.ffffffffe0000p-90, -0x1.0400000000000p-34, -0x1.03ffff07ef800p-89}, {0x1.0000000000000p+39, 0x1.fffe7ff3dff00p-22, 0x1.000007f830000p+13, 0x1.fff0000ffe100p-48, 0x1.0000004000020p+39, -0x1.e4000bfc61208p-17}, {0x1.0000000000000p+39, 0x1.fffe7ff3dff00p-22, -0x1.000007f830000p+13, -0x1.fff0000ffe100p-48, 0x1.ffffff7ffffc0p+38, 0x1.01fff9fdcf8fcp-16}, {-0x1.0000000000000p+39, -0x1.fffe7ff3dff00p-22, 0x1.000007f830000p+13, 0x1.fff0000ffe100p-48, -0x1.ffffff7ffffc0p+38, -0x1.01fff9fdcf8fcp-16}, {-0x1.0000000000000p+39, -0x1.fffe7ff3dff00p-22, -0x1.000007f830000p+13, -0x1.fff0000ffe100p-48, -0x1.0000004000020p+39, 0x1.e4000bfc61208p-17}, {0x1.00000ffffe000p+18, 0x1.fffffffffc000p-49, 0x1.0000000000002p-46, -0x1.fffffe01f8004p-101, 0x1.00000ffffe000p+18, 0x1.3fffffffff800p-46}, {0x1.00000ffffe000p+18, 0x1.fffffffffc000p-49, -0x1.0000000000002p-46, 0x1.fffffe01f8004p-101, 0x1.00000ffffe000p+18, -0x1.8000000001000p-47}, {-0x1.00000ffffe000p+18, -0x1.fffffffffc000p-49, 0x1.0000000000002p-46, -0x1.fffffe01f8004p-101, -0x1.00000ffffe000p+18, 0x1.8000000001000p-47}, {-0x1.00000ffffe000p+18, -0x1.fffffffffc000p-49, -0x1.0000000000002p-46, 0x1.fffffe01f8004p-101, -0x1.00000ffffe000p+18, -0x1.3fffffffff800p-46}, {0x1.0000000000060p+41, 0x1.fffe3fff00000p-22, 0x1.0000000002000p+4, -0x1.ffe0002000000p-53, 0x1.0000000008060p+41, 0x1.00031ffd80200p-21}, {0x1.0000000000060p+41, 0x1.fffe3fff00000p-22, -0x1.0000000002000p+4, 0x1.ffe0002000000p-53, 0x1.fffffffff00c0p+40, 0x1.fff64002ffc00p-22}, {-0x1.0000000000060p+41, -0x1.fffe3fff00000p-22, 0x1.0000000002000p+4, -0x1.ffe0002000000p-53, -0x1.fffffffff00c0p+40, -0x1.fff64002ffc00p-22}, {-0x1.0000000000060p+41, -0x1.fffe3fff00000p-22, -0x1.0000000002000p+4, 0x1.ffe0002000000p-53, -0x1.0000000008060p+41, -0x1.00031ffd80200p-21}, {0x1.0003ffffffff8p-50, 0x1.ffffe07e00000p-124, 0x1.07ff000008000p+19, -0x1.e000020000000p-42, 0x1.07ff000008000p+19, -0x1.defffe0000000p-42}, {0x1.0003ffffffff8p-50, 0x1.ffffe07e00000p-124, -0x1.07ff000008000p+19, 0x1.e000020000000p-42, -0x1.07ff000008000p+19, 0x1.e100060000000p-42}, {-0x1.0003ffffffff8p-50, -0x1.ffffe07e00000p-124, 0x1.07ff000008000p+19, -0x1.e000020000000p-42, 0x1.07ff000008000p+19, -0x1.e100060000000p-42}, {-0x1.0003ffffffff8p-50, -0x1.ffffe07e00000p-124, -0x1.07ff000008000p+19, 0x1.e000020000000p-42, -0x1.07ff000008000p+19, 0x1.defffe0000000p-42}, // Some test cases drawn only from the [0.5,1] binade: {0x1.0000000000002p-1, -0x1.ffc0ffff90000p-65, 0x1.0003ffffffffcp-1, 0x1.ffffc00000000p-88, 0x1.0001fffffffffp+0, -0x1.ffc0fbff90000p-65}, {0x1.0000000000002p-1, -0x1.ffc0ffff90000p-65, -0x1.0003ffffffffcp-1, -0x1.ffffc00000000p-88, -0x1.ffffffffd0010p-16, 0x1.f7e0038400000p-76}, {-0x1.0000000000002p-1, 0x1.ffc0ffff90000p-65, 0x1.0003ffffffffcp-1, 0x1.ffffc00000000p-88, 0x1.ffffffffd0010p-16, -0x1.f7e0038400000p-76}, {-0x1.0000000000002p-1, 0x1.ffc0ffff90000p-65, -0x1.0003ffffffffcp-1, -0x1.ffffc00000000p-88, -0x1.0001fffffffffp+0, 0x1.ffc0fbff90000p-65}, {0x1.0000100000000p-1, -0x1.0000000000000p-63, 0x1.0000000004000p-1, -0x1.ffffe00fc0200p-57, 0x1.0000080002000p+0, -0x1.01fff007e0100p-56}, {0x1.0000100000000p-1, -0x1.0000000000000p-63, -0x1.0000000004000p-1, 0x1.ffffe00fc0200p-57, 0x1.ffff80003f800p-22, -0x1.ff03fe0000000p-77}, {-0x1.0000100000000p-1, 0x1.0000000000000p-63, 0x1.0000000004000p-1, -0x1.ffffe00fc0200p-57, -0x1.ffff80003f800p-22, 0x1.ff03fe0000000p-77}, {-0x1.0000100000000p-1, 0x1.0000000000000p-63, -0x1.0000000004000p-1, 0x1.ffffe00fc0200p-57, -0x1.0000080002000p+0, 0x1.01fff007e0100p-56}, {0x1.0000000800000p-1, -0x1.0000000000000p-73, 0x1.000003fffc002p-1, -0x1.0000000000000p-106, 0x1.00000203fe001p+0, -0x1.0000000000000p-73}, {0x1.0000000800000p-1, -0x1.0000000000000p-73, -0x1.000003fffc002p-1, 0x1.0000000000000p-106, -0x1.fbfe001000008p-24, 0x1.0000000000000p-106}, {-0x1.0000000800000p-1, 0x1.0000000000000p-73, 0x1.000003fffc002p-1, -0x1.0000000000000p-106, 0x1.fbfe001000008p-24, -0x1.0000000000000p-106}, {-0x1.0000000800000p-1, 0x1.0000000000000p-73, -0x1.000003fffc002p-1, 0x1.0000000000000p-106, -0x1.00000203fe001p+0, 0x1.0000000000000p-73}, {0x1.0000000000000p-1, 0x1.ffc001ffffe00p-56, 0x1.000003fff8000p-1, 0x1.fffc000fc0000p-72, 0x1.000001fffc000p+0, 0x1.ffc201fbfff00p-56}, {0x1.0000000000000p-1, 0x1.ffc001ffffe00p-56, -0x1.000003fff8000p-1, -0x1.fffc000fc0000p-72, -0x1.fffbfffe00420p-24, 0x1.01ffe82000000p-79}, {-0x1.0000000000000p-1, -0x1.ffc001ffffe00p-56, 0x1.000003fff8000p-1, 0x1.fffc000fc0000p-72, 0x1.fffbfffe00420p-24, -0x1.01ffe82000000p-79}, {-0x1.0000000000000p-1, -0x1.ffc001ffffe00p-56, -0x1.000003fff8000p-1, -0x1.fffc000fc0000p-72, -0x1.000001fffc000p+0, -0x1.ffc201fbfff00p-56}, {0x1.0000000000003p-1, 0x1.fc00001fff800p-65, 0x1.0000000000020p-1, -0x1.fc01ffe002000p-65, 0x1.0000000000011p+0, 0x1.ffffffc007ffcp-54}, {0x1.0000000000003p-1, 0x1.fc00001fff800p-65, -0x1.0000000000020p-1, 0x1.fc01ffe002000p-65, -0x1.cffc07fe00000p-49, 0x1.8000000000000p-105}, {-0x1.0000000000003p-1, -0x1.fc00001fff800p-65, 0x1.0000000000020p-1, -0x1.fc01ffe002000p-65, 0x1.cffc07fe00000p-49, -0x1.8000000000000p-105}, {-0x1.0000000000003p-1, -0x1.fc00001fff800p-65, -0x1.0000000000020p-1, 0x1.fc01ffe002000p-65, -0x1.0000000000011p+0, -0x1.ffffffc007ffcp-54}, {0x1.0000000000000p-1, 0x1.fffff00001ffep-55, 0x1.0000000000000p-1, 0x1.ff00000ffff80p-61, 0x1.0000000000000p+0, 0x1.03fdf80020ffep-54}, {0x1.0000000000000p-1, 0x1.fffff00001ffep-55, -0x1.0000000000000p-1, -0x1.ff00000ffff80p-61, 0x1.f803efffc2000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffff00001ffep-55, 0x1.0000000000000p-1, 0x1.ff00000ffff80p-61, -0x1.f803efffc2000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffff00001ffep-55, -0x1.0000000000000p-1, -0x1.ff00000ffff80p-61, -0x1.0000000000000p+0, -0x1.03fdf80020ffep-54}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, 0x1.0000200000000p-1, -0x1.ffc0000080000p-73, 0x1.0000100000000p+0, 0x1.ff001fffff800p-64}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, -0x1.0000200000000p-1, 0x1.ffc0000080000p-73, -0x1.ffffffffffbfep-21, -0x1.0000000000000p-83}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, 0x1.0000200000000p-1, -0x1.ffc0000080000p-73, 0x1.ffffffffffbfep-21, 0x1.0000000000000p-83}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, -0x1.0000200000000p-1, 0x1.ffc0000080000p-73, -0x1.0000100000000p+0, -0x1.ff001fffff800p-64}, {0x1.0000000000800p-1, -0x1.fffc000000010p-58, 0x1.0000000000008p-1, -0x1.ffe03fffff010p-58, 0x1.0000000000404p+0, -0x1.ffee1fffff810p-57}, {0x1.0000000000800p-1, -0x1.fffc000000010p-58, -0x1.0000000000008p-1, 0x1.ffe03fffff010p-58, 0x1.fdffffc880000p-43, -0x1.0000000000000p-98}, {-0x1.0000000000800p-1, 0x1.fffc000000010p-58, 0x1.0000000000008p-1, -0x1.ffe03fffff010p-58, -0x1.fdffffc880000p-43, 0x1.0000000000000p-98}, {-0x1.0000000000800p-1, 0x1.fffc000000010p-58, -0x1.0000000000008p-1, 0x1.ffe03fffff010p-58, -0x1.0000000000404p+0, 0x1.ffee1fffff810p-57}, {0x1.0000000000000p-1, 0x1.fffef0ffff000p-64, 0x1.0000100000000p-1, -0x1.fff8000000800p-65, 0x1.0000080000000p+0, 0x1.0002f0ffff000p-64}, {0x1.0000000000000p-1, 0x1.fffef0ffff000p-64, -0x1.0000100000000p-1, 0x1.fff8000000800p-65, -0x1.ffffffffff400p-22, -0x1.43c0003000000p-78}, {-0x1.0000000000000p-1, -0x1.fffef0ffff000p-64, 0x1.0000100000000p-1, -0x1.fff8000000800p-65, 0x1.ffffffffff400p-22, 0x1.43c0003000000p-78}, {-0x1.0000000000000p-1, -0x1.fffef0ffff000p-64, -0x1.0000100000000p-1, 0x1.fff8000000800p-65, -0x1.0000080000000p+0, -0x1.0002f0ffff000p-64}, {0x1.07c00007ffff0p-1, 0x1.fffc00f800000p-77, 0x1.0000007ffffe0p-1, 0x1.f000000000000p-72, 0x1.03e00043fffe8p+0, 0x1.ffffe00800000p-72}, {0x1.07c00007ffff0p-1, 0x1.fffc00f800000p-77, -0x1.0000007ffffe0p-1, -0x1.f000000000000p-72, 0x1.efffe20000400p-7, -0x1.e0001ff840000p-72}, {-0x1.07c00007ffff0p-1, -0x1.fffc00f800000p-77, 0x1.0000007ffffe0p-1, 0x1.f000000000000p-72, -0x1.efffe20000400p-7, 0x1.e0001ff840000p-72}, {-0x1.07c00007ffff0p-1, -0x1.fffc00f800000p-77, -0x1.0000007ffffe0p-1, -0x1.f000000000000p-72, -0x1.03e00043fffe8p+0, -0x1.ffffe00800000p-72}, {0x1.0000000000000p-1, 0x1.ff800fffff800p-57, 0x1.0000000000000p-1, 0x1.fffc0000ffff8p-57, 0x1.0000000000000p+0, 0x1.ffbe08007fc00p-56}, {0x1.0000000000000p-1, 0x1.ff800fffff800p-57, -0x1.0000000000000p-1, -0x1.fffc0000ffff8p-57, -0x1.efc00401fe000p-67, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff800fffff800p-57, 0x1.0000000000000p-1, 0x1.fffc0000ffff8p-57, 0x1.efc00401fe000p-67, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff800fffff800p-57, -0x1.0000000000000p-1, -0x1.fffc0000ffff8p-57, -0x1.0000000000000p+0, -0x1.ffbe08007fc00p-56}, {0x1.0000000008000p-1, -0x1.ffff807ffe002p-55, 0x1.0000000800000p-1, -0x1.ffffff8000008p-57, 0x1.0000000404000p+0, -0x1.3fffc02fff002p-54}, {0x1.0000000008000p-1, -0x1.ffff807ffe002p-55, -0x1.0000000800000p-1, 0x1.ffffff8000008p-57, -0x1.fe00017fff80ap-31, 0x1.0000000000000p-94}, {-0x1.0000000008000p-1, 0x1.ffff807ffe002p-55, 0x1.0000000800000p-1, -0x1.ffffff8000008p-57, 0x1.fe00017fff80ap-31, -0x1.0000000000000p-94}, {-0x1.0000000008000p-1, 0x1.ffff807ffe002p-55, -0x1.0000000800000p-1, 0x1.ffffff8000008p-57, -0x1.0000000404000p+0, 0x1.3fffc02fff002p-54}, {0x1.0000000000020p-1, -0x1.0000000000000p-84, 0x1.0000000000000p-1, 0x1.fffff000003c0p-60, 0x1.0000000000010p+0, 0x1.ffffef0000400p-60}, {0x1.0000000000020p-1, -0x1.0000000000000p-84, -0x1.0000000000000p-1, -0x1.fffff000003c0p-60, 0x1.ffc00001e0000p-49, -0x1.e000000000000p-103}, {-0x1.0000000000020p-1, 0x1.0000000000000p-84, 0x1.0000000000000p-1, 0x1.fffff000003c0p-60, -0x1.ffc00001e0000p-49, 0x1.e000000000000p-103}, {-0x1.0000000000020p-1, 0x1.0000000000000p-84, -0x1.0000000000000p-1, -0x1.fffff000003c0p-60, -0x1.0000000000010p+0, -0x1.ffffef0000400p-60}, {0x1.0000001ffff80p-1, 0x1.fffffdfffff8ep-55, 0x1.0000000200000p-1, -0x1.0000000000000p-70, 0x1.00000010fffc0p+0, 0x1.fffdfdfffff90p-55}, {0x1.0000001ffff80p-1, 0x1.fffffdfffff8ep-55, -0x1.0000000200000p-1, 0x1.0000000000000p-70, 0x1.dfff8080007f8p-29, -0x1.c800000000000p-101}, {-0x1.0000001ffff80p-1, -0x1.fffffdfffff8ep-55, 0x1.0000000200000p-1, -0x1.0000000000000p-70, -0x1.dfff8080007f8p-29, 0x1.c800000000000p-101}, {-0x1.0000001ffff80p-1, -0x1.fffffdfffff8ep-55, -0x1.0000000200000p-1, 0x1.0000000000000p-70, -0x1.00000010fffc0p+0, -0x1.fffdfdfffff90p-55}, {0x1.01ffffff80400p-1, -0x1.c7ffffc000100p-59, 0x1.0000000000000p-1, 0x1.8fff01fffff00p-61, 0x1.00ffffffc0200p+0, -0x1.64003f4000140p-59}, {0x1.01ffffff80400p-1, -0x1.c7ffffc000100p-59, -0x1.0000000000000p-1, -0x1.8fff01fffff00p-61, 0x1.ffffff803fff7p-9, 0x1.4003fbffff400p-63}, {-0x1.01ffffff80400p-1, 0x1.c7ffffc000100p-59, 0x1.0000000000000p-1, 0x1.8fff01fffff00p-61, -0x1.ffffff803fff7p-9, -0x1.4003fbffff400p-63}, {-0x1.01ffffff80400p-1, 0x1.c7ffffc000100p-59, -0x1.0000000000000p-1, -0x1.8fff01fffff00p-61, -0x1.00ffffffc0200p+0, 0x1.64003f4000140p-59}, {0x1.0000000000008p-1, -0x1.ffffc00800000p-74, 0x1.00003ffe00002p-1, -0x1.ffffffc180080p-61, 0x1.00001fff00005p+0, -0x1.0007ffdfc0200p-60}, {0x1.0000000000008p-1, -0x1.ffffc00800000p-74, -0x1.00003ffe00002p-1, 0x1.ffffffc180080p-61, -0x1.ffeffffcff001p-20, 0x1.fff86ff900000p-74}, {-0x1.0000000000008p-1, 0x1.ffffc00800000p-74, 0x1.00003ffe00002p-1, -0x1.ffffffc180080p-61, 0x1.ffeffffcff001p-20, -0x1.fff86ff900000p-74}, {-0x1.0000000000008p-1, 0x1.ffffc00800000p-74, -0x1.00003ffe00002p-1, 0x1.ffffffc180080p-61, -0x1.00001fff00005p+0, 0x1.0007ffdfc0200p-60}, {0x1.000000ffffff8p-1, 0x1.ffffffc000000p-58, 0x1.0000000000000p-1, 0x1.ffffffe000000p-59, 0x1.0000007fffffcp+0, 0x1.7fffffd800000p-57}, {0x1.000000ffffff8p-1, 0x1.ffffffc000000p-58, -0x1.0000000000000p-1, -0x1.ffffffe000000p-59, 0x1.ffffff0100000p-26, -0x1.8000000000000p-85}, {-0x1.000000ffffff8p-1, -0x1.ffffffc000000p-58, 0x1.0000000000000p-1, 0x1.ffffffe000000p-59, -0x1.ffffff0100000p-26, 0x1.8000000000000p-85}, {-0x1.000000ffffff8p-1, -0x1.ffffffc000000p-58, -0x1.0000000000000p-1, -0x1.ffffffe000000p-59, -0x1.0000007fffffcp+0, -0x1.7fffffd800000p-57}, {0x1.0000000020000p-1, -0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.ff1ffffff4000p-68, 0x1.0000000010200p+0, -0x1.ff1ffffff8000p-68}, {0x1.0000000020000p-1, -0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.ff1ffffff4000p-68, 0x1.fc000003fe400p-37, -0x1.0000000000000p-104}, {-0x1.0000000020000p-1, 0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.ff1ffffff4000p-68, -0x1.fc000003fe400p-37, 0x1.0000000000000p-104}, {-0x1.0000000020000p-1, 0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.ff1ffffff4000p-68, -0x1.0000000010200p+0, 0x1.ff1ffffff8000p-68}, {0x1.0000ff8020000p-1, -0x1.fffffa0000000p-63, 0x1.0000000001ff0p-1, 0x1.f700000ffe000p-67, 0x1.00007fc010ff8p+0, -0x1.e08ff9ff00000p-63}, {0x1.0000ff8020000p-1, -0x1.fffffa0000000p-63, -0x1.0000000001ff0p-1, -0x1.f700000ffe000p-67, 0x1.ff003c01ffef0p-18, 0x1.200bfe0040000p-72}, {-0x1.0000ff8020000p-1, 0x1.fffffa0000000p-63, 0x1.0000000001ff0p-1, 0x1.f700000ffe000p-67, -0x1.ff003c01ffef0p-18, -0x1.200bfe0040000p-72}, {-0x1.0000ff8020000p-1, 0x1.fffffa0000000p-63, -0x1.0000000001ff0p-1, -0x1.f700000ffe000p-67, -0x1.00007fc010ff8p+0, 0x1.e08ff9ff00000p-63}, {0x1.0000020000000p-1, -0x1.0000000000000p-65, 0x1.003e00001f800p-1, 0x1.ffde000001e00p-63, 0x1.001f01000fc00p+0, 0x1.bfde000002000p-63}, {0x1.0000020000000p-1, -0x1.0000000000000p-65, -0x1.003e00001f800p-1, -0x1.ffde000001e00p-63, -0x1.eff000fc00004p-12, -0x1.fef000000f000p-66}, {-0x1.0000020000000p-1, 0x1.0000000000000p-65, 0x1.003e00001f800p-1, 0x1.ffde000001e00p-63, 0x1.eff000fc00004p-12, 0x1.fef000000f000p-66}, {-0x1.0000020000000p-1, 0x1.0000000000000p-65, -0x1.003e00001f800p-1, -0x1.ffde000001e00p-63, -0x1.001f01000fc00p+0, -0x1.bfde000002000p-63}, {0x1.0007e3ffe0000p-1, 0x1.fe0ffffffe000p-65, 0x1.0000000000000p-1, 0x1.fffffe07fff00p-62, 0x1.0003f1fff0000p+0, 0x1.1fe0ff03ffe00p-61}, {0x1.0007e3ffe0000p-1, 0x1.fe0ffffffe000p-65, -0x1.0000000000000p-1, -0x1.fffffe07fff00p-62, 0x1.f8fff7fffffc8p-15, -0x1.eff0400180000p-73}, {-0x1.0007e3ffe0000p-1, -0x1.fe0ffffffe000p-65, 0x1.0000000000000p-1, 0x1.fffffe07fff00p-62, -0x1.f8fff7fffffc8p-15, 0x1.eff0400180000p-73}, {-0x1.0007e3ffe0000p-1, -0x1.fe0ffffffe000p-65, -0x1.0000000000000p-1, -0x1.fffffe07fff00p-62, -0x1.0003f1fff0000p+0, -0x1.1fe0ff03ffe00p-61}, {0x1.00000000fe000p-1, 0x1.ff00004000000p-68, 0x1.000003fffff80p-1, 0x1.fff8400000000p-61, 0x1.000002007efc0p+0, 0x1.01fb200040000p-60}, {0x1.00000000fe000p-1, 0x1.ff00004000000p-68, -0x1.000003fffff80p-1, -0x1.fff8400000000p-61, -0x1.ff80fc000fdfdp-24, -0x1.fffc000000000p-80}, {-0x1.00000000fe000p-1, -0x1.ff00004000000p-68, 0x1.000003fffff80p-1, 0x1.fff8400000000p-61, 0x1.ff80fc000fdfdp-24, 0x1.fffc000000000p-80}, {-0x1.00000000fe000p-1, -0x1.ff00004000000p-68, -0x1.000003fffff80p-1, -0x1.fff8400000000p-61, -0x1.000002007efc0p+0, -0x1.01fb200040000p-60}, {0x1.0000800000000p-1, -0x1.0000000000000p-57, 0x1.0000000000000p-1, 0x1.fffffffc1fc00p-64, 0x1.0000400000000p+0, -0x1.f80000000f800p-58}, {0x1.0000800000000p-1, -0x1.0000000000000p-57, -0x1.0000000000000p-1, -0x1.fffffffc1fc00p-64, 0x1.fffffffffbf00p-19, 0x1.f020000000000p-95}, {-0x1.0000800000000p-1, 0x1.0000000000000p-57, 0x1.0000000000000p-1, 0x1.fffffffc1fc00p-64, -0x1.fffffffffbf00p-19, -0x1.f020000000000p-95}, {-0x1.0000800000000p-1, 0x1.0000000000000p-57, -0x1.0000000000000p-1, -0x1.fffffffc1fc00p-64, -0x1.0000400000000p+0, 0x1.f80000000f800p-58}, {0x1.0000000000000p-1, 0x1.ff000ff3ffe00p-55, 0x1.0000000000000p-1, 0x1.fe0003fffc000p-60, 0x1.0000000000000p+0, 0x1.07780809ffe00p-54}, {0x1.0000000000000p-1, 0x1.ff000ff3ffe00p-55, -0x1.0000000000000p-1, -0x1.fe0003fffc000p-60, 0x1.ef100fd400000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff000ff3ffe00p-55, 0x1.0000000000000p-1, 0x1.fe0003fffc000p-60, -0x1.ef100fd400000p-55, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ff000ff3ffe00p-55, -0x1.0000000000000p-1, -0x1.fe0003fffc000p-60, -0x1.0000000000000p+0, -0x1.07780809ffe00p-54}, {0x1.000000e000010p-1, -0x1.ffffffc020000p-71, 0x1.00000001f0000p-1, 0x1.8000000000000p-105, 0x1.00000070f8008p+0, -0x1.ffffffbfc0000p-71}, {0x1.000000e000010p-1, -0x1.ffffffc020000p-71, -0x1.00000001f0000p-1, -0x1.8000000000000p-105, 0x1.bc2001fffff00p-26, 0x1.fc00000000000p-98}, {-0x1.000000e000010p-1, 0x1.ffffffc020000p-71, 0x1.00000001f0000p-1, 0x1.8000000000000p-105, -0x1.bc2001fffff00p-26, -0x1.fc00000000000p-98}, {-0x1.000000e000010p-1, 0x1.ffffffc020000p-71, -0x1.00000001f0000p-1, -0x1.8000000000000p-105, -0x1.00000070f8008p+0, 0x1.ffffffbfc0000p-71}, {0x1.000003ff00000p-1, 0x1.8000000000000p-78, 0x1.0001ffffe0000p-1, 0x1.f800000100000p-74, 0x1.000101ff70000p+0, 0x1.0800000000000p-73}, {0x1.000003ff00000p-1, 0x1.8000000000000p-78, -0x1.0001ffffe0000p-1, -0x1.f800000100000p-74, -0x1.fc00e00000000p-17, -0x1.e000000100000p-74}, {-0x1.000003ff00000p-1, -0x1.8000000000000p-78, 0x1.0001ffffe0000p-1, 0x1.f800000100000p-74, 0x1.fc00e00000000p-17, 0x1.e000000100000p-74}, {-0x1.000003ff00000p-1, -0x1.8000000000000p-78, -0x1.0001ffffe0000p-1, -0x1.f800000100000p-74, -0x1.000101ff70000p+0, -0x1.0800000000000p-73}, {0x1.0000000000200p-1, -0x1.ffffffffffc08p-57, 0x1.0000000000000p-1, 0x1.ffffffffffffep-55, 0x1.0000000000100p+0, 0x1.80000000000fcp-55}, {0x1.0000000000200p-1, -0x1.ffffffffffc08p-57, -0x1.0000000000000p-1, -0x1.ffffffffffffep-55, 0x1.ff60000000000p-45, 0x1.0000000000000p-99}, {-0x1.0000000000200p-1, 0x1.ffffffffffc08p-57, 0x1.0000000000000p-1, 0x1.ffffffffffffep-55, -0x1.ff60000000000p-45, -0x1.0000000000000p-99}, {-0x1.0000000000200p-1, 0x1.ffffffffffc08p-57, -0x1.0000000000000p-1, -0x1.ffffffffffffep-55, -0x1.0000000000100p+0, -0x1.80000000000fcp-55}, {0x1.0000000040000p-1, -0x1.fffff80002000p-67, 0x1.0000000000000p-1, 0x1.ffc01ffff3c00p-64, 0x1.0000000020000p+0, 0x1.bfc020fff3800p-64}, {0x1.0000000040000p-1, -0x1.fffff80002000p-67, -0x1.0000000000000p-1, -0x1.ffc01ffff3c00p-64, 0x1.ffffffdc03fe1p-36, 0x1.8000000000000p-101}, {-0x1.0000000040000p-1, 0x1.fffff80002000p-67, 0x1.0000000000000p-1, 0x1.ffc01ffff3c00p-64, -0x1.ffffffdc03fe1p-36, -0x1.8000000000000p-101}, {-0x1.0000000040000p-1, 0x1.fffff80002000p-67, -0x1.0000000000000p-1, -0x1.ffc01ffff3c00p-64, -0x1.0000000020000p+0, -0x1.bfc020fff3800p-64}, {0x1.0000800000000p-1, -0x1.0000000000000p-106, 0x1.0000003800001p-1, 0x1.fffffe000003ep-55, 0x1.0000401c00001p+0, -0x1.000000fffffe2p-54}, {0x1.0000800000000p-1, -0x1.0000000000000p-106, -0x1.0000003800001p-1, -0x1.fffffe000003ep-55, 0x1.ff1fffffa0000p-19, 0x1.fffffc0000000p-79}, {-0x1.0000800000000p-1, 0x1.0000000000000p-106, 0x1.0000003800001p-1, 0x1.fffffe000003ep-55, -0x1.ff1fffffa0000p-19, -0x1.fffffc0000000p-79}, {-0x1.0000800000000p-1, 0x1.0000000000000p-106, -0x1.0000003800001p-1, -0x1.fffffe000003ep-55, -0x1.0000401c00001p+0, 0x1.000000fffffe2p-54}, {0x1.0f00000020000p-1, -0x1.fffe000000100p-55, 0x1.0000000400000p-1, -0x1.ffffffc004000p-68, 0x1.0780000210000p+0, -0x1.0006ffffff080p-54}, {0x1.0f00000020000p-1, -0x1.fffe000000100p-55, -0x1.0000000400000p-1, 0x1.ffffffc004000p-68, 0x1.dfffff83ffff0p-6, 0x1.1fffffdf02000p-67}, {-0x1.0f00000020000p-1, 0x1.fffe000000100p-55, 0x1.0000000400000p-1, -0x1.ffffffc004000p-68, -0x1.dfffff83ffff0p-6, -0x1.1fffffdf02000p-67}, {-0x1.0f00000020000p-1, 0x1.fffe000000100p-55, -0x1.0000000400000p-1, 0x1.ffffffc004000p-68, -0x1.0780000210000p+0, 0x1.0006ffffff080p-54}, {0x1.003fe00020000p-1, -0x1.ffffffffe8000p-69, 0x1.0000000000400p-1, -0x1.ffff800007ffcp-56, 0x1.001ff00010200p+0, -0x1.0007c00003ff8p-55}, {0x1.003fe00020000p-1, -0x1.ffffffffe8000p-69, -0x1.0000000000400p-1, 0x1.ffff800007ffcp-56, 0x1.ff0000fe00200p-12, -0x1.07ffff7ff8000p-68}, {-0x1.003fe00020000p-1, 0x1.ffffffffe8000p-69, 0x1.0000000000400p-1, -0x1.ffff800007ffcp-56, -0x1.ff0000fe00200p-12, 0x1.07ffff7ff8000p-68}, {-0x1.003fe00020000p-1, 0x1.ffffffffe8000p-69, -0x1.0000000000400p-1, 0x1.ffff800007ffcp-56, -0x1.001ff00010200p+0, 0x1.0007c00003ff8p-55}, {0x1.ffff00fffffc4p-1, -0x1.8080000000000p-83, 0x1.0000020000000p-1, -0x1.0000000000000p-77, 0x1.7fff817ffffe2p+0, -0x1.0602000000000p-77}, {0x1.ffff00fffffc4p-1, -0x1.8080000000000p-83, -0x1.0000020000000p-1, 0x1.0000000000000p-77, 0x1.fffdfdfffff88p-2, 0x1.f3fc000000000p-78}, {-0x1.ffff00fffffc4p-1, 0x1.8080000000000p-83, 0x1.0000020000000p-1, -0x1.0000000000000p-77, -0x1.fffdfdfffff88p-2, -0x1.f3fc000000000p-78}, {-0x1.ffff00fffffc4p-1, 0x1.8080000000000p-83, -0x1.0000020000000p-1, 0x1.0000000000000p-77, -0x1.7fff817ffffe2p+0, 0x1.0602000000000p-77}, {0x1.0000000000040p-1, -0x1.8000000800000p-76, 0x1.0000000002000p-1, -0x1.0000000000000p-105, 0x1.0000000001020p+0, -0x1.8000001000000p-76}, {0x1.0000000000040p-1, -0x1.8000000800000p-76, -0x1.0000000002000p-1, 0x1.0000000000000p-105, -0x1.fc00000030000p-41, 0x0.0000000000000p+0}, {-0x1.0000000000040p-1, 0x1.8000000800000p-76, 0x1.0000000002000p-1, -0x1.0000000000000p-105, 0x1.fc00000030000p-41, 0x0.0000000000000p+0}, {-0x1.0000000000040p-1, 0x1.8000000800000p-76, -0x1.0000000002000p-1, 0x1.0000000000000p-105, -0x1.0000000001020p+0, 0x1.8000001000000p-76}, {0x1.0000000800000p-1, -0x1.ffffc02000000p-79, 0x1.7fffe00800000p-1, -0x1.0000000000000p-106, 0x1.3ffff00800000p+0, -0x1.ffffc04000000p-79}, {0x1.0000000800000p-1, -0x1.ffffc02000000p-79, -0x1.7fffe00800000p-1, 0x1.0000000000000p-106, -0x1.ffff800000000p-3, -0x1.ffffc00000000p-79}, {-0x1.0000000800000p-1, 0x1.ffffc02000000p-79, 0x1.7fffe00800000p-1, -0x1.0000000000000p-106, 0x1.ffff800000000p-3, 0x1.ffffc00000000p-79}, {-0x1.0000000800000p-1, 0x1.ffffc02000000p-79, -0x1.7fffe00800000p-1, 0x1.0000000000000p-106, -0x1.3ffff00800000p+0, 0x1.ffffc04000000p-79}, {0x1.0000400000000p-1, -0x1.0000000000000p-92, 0x1.4000000000000p-1, -0x1.ffffffff00020p-59, 0x1.2000200000000p+0, -0x1.ffffffff80000p-59}, {0x1.0000400000000p-1, -0x1.0000000000000p-92, -0x1.4000000000000p-1, 0x1.ffffffff00020p-59, -0x1.fffe000000000p-4, 0x1.fffffffe80020p-59}, {-0x1.0000400000000p-1, 0x1.0000000000000p-92, 0x1.4000000000000p-1, -0x1.ffffffff00020p-59, 0x1.fffe000000000p-4, -0x1.fffffffe80020p-59}, {-0x1.0000400000000p-1, 0x1.0000000000000p-92, -0x1.4000000000000p-1, 0x1.ffffffff00020p-59, -0x1.2000200000000p+0, 0x1.ffffffff80000p-59}, {0x1.0000000000000p-1, 0x1.03eff7ff3fff0p-58, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, 0x1.00000fffe0000p+0, 0x1.42eff83d401e0p-58}, {0x1.0000000000000p-1, 0x1.03eff7ff3fff0p-58, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, -0x1.fffbfffff9d88p-21, -0x1.07d8040000000p-79}, {-0x1.0000000000000p-1, -0x1.03eff7ff3fff0p-58, 0x1.00001fffc0000p-1, 0x1.f80001f000f80p-61, 0x1.fffbfffff9d88p-21, 0x1.07d8040000000p-79}, {-0x1.0000000000000p-1, -0x1.03eff7ff3fff0p-58, -0x1.00001fffc0000p-1, -0x1.f80001f000f80p-61, -0x1.00000fffe0000p+0, -0x1.42eff83d401e0p-58}, {0x1.03ffffffffffep-1, 0x1.8000000000000p-105, 0x1.0000040000000p-1, -0x1.0000000000000p-106, 0x1.020001fffffffp+0, 0x1.0000000000000p-105}, {0x1.03ffffffffffep-1, 0x1.8000000000000p-105, -0x1.0000040000000p-1, 0x1.0000000000000p-106, 0x1.fffdfffffff00p-8, 0x1.0000000000000p-104}, {-0x1.03ffffffffffep-1, -0x1.8000000000000p-105, 0x1.0000040000000p-1, -0x1.0000000000000p-106, -0x1.fffdfffffff00p-8, -0x1.0000000000000p-104}, {-0x1.03ffffffffffep-1, -0x1.8000000000000p-105, -0x1.0000040000000p-1, 0x1.0000000000000p-106, -0x1.020001fffffffp+0, -0x1.0000000000000p-105}, {0x1.0007ffffcfffcp-1, 0x1.ff01fffe00000p-75, 0x1.01fff08000000p-1, -0x1.fffffe0000020p-55, 0x1.0103f83fe7ffep+0, -0x1.ffffde0fe0020p-55}, {0x1.0007ffffcfffcp-1, 0x1.ff01fffe00000p-75, -0x1.01fff08000000p-1, 0x1.fffffe0000020p-55, -0x1.f7f0803000380p-9, 0x1.df02001e00000p-75}, {-0x1.0007ffffcfffcp-1, -0x1.ff01fffe00000p-75, 0x1.01fff08000000p-1, -0x1.fffffe0000020p-55, 0x1.f7f0803000380p-9, -0x1.df02001e00000p-75}, {-0x1.0007ffffcfffcp-1, -0x1.ff01fffe00000p-75, -0x1.01fff08000000p-1, 0x1.fffffe0000020p-55, -0x1.0103f83fe7ffep+0, 0x1.ffffde0fe0020p-55}, {0x1.00000000007fep-1, 0x1.ff00003ffff00p-62, 0x1.004000e000008p-1, -0x1.ffffe02000000p-79, 0x1.0020007000403p+0, 0x1.feff00400fe00p-62}, {0x1.00000000007fep-1, 0x1.ff00003ffff00p-62, -0x1.004000e000008p-1, 0x1.ffffe02000000p-79, -0x1.00037ffe027fcp-11, -0x1.fdff802000000p-71}, {-0x1.00000000007fep-1, -0x1.ff00003ffff00p-62, 0x1.004000e000008p-1, -0x1.ffffe02000000p-79, 0x1.00037ffe027fcp-11, 0x1.fdff802000000p-71}, {-0x1.00000000007fep-1, -0x1.ff00003ffff00p-62, -0x1.004000e000008p-1, 0x1.ffffe02000000p-79, -0x1.0020007000403p+0, -0x1.feff00400fe00p-62}, {0x1.00000003ff000p-1, 0x1.ffff000000000p-90, 0x1.0000fffff8000p-1, 0x1.f003ffe0003e0p-59, 0x1.00008001fb800p+0, 0x1.f003ffe4003c0p-59}, {0x1.00000003ff000p-1, 0x1.ffff000000000p-90, -0x1.0000fffff8000p-1, -0x1.f003ffe0003e0p-59, -0x1.fff7f20000f80p-18, -0x1.ffee002000000p-74}, {-0x1.00000003ff000p-1, -0x1.ffff000000000p-90, 0x1.0000fffff8000p-1, 0x1.f003ffe0003e0p-59, 0x1.fff7f20000f80p-18, 0x1.ffee002000000p-74}, {-0x1.00000003ff000p-1, -0x1.ffff000000000p-90, -0x1.0000fffff8000p-1, -0x1.f003ffe0003e0p-59, -0x1.00008001fb800p+0, -0x1.f003ffe4003c0p-59}, {0x1.0000000000000p-1, 0x1.ffe001c0003c0p-60, 0x1.01fffffe00000p-1, 0x1.ffffffffffc00p-59, 0x1.00ffffff00000p+0, 0x1.7ff8006ffff00p-58}, {0x1.0000000000000p-1, 0x1.ffe001c0003c0p-60, -0x1.01fffffe00000p-1, -0x1.ffffffffffc00p-59, -0x1.fffffe0000004p-9, -0x1.ffe3fff440000p-72}, {-0x1.0000000000000p-1, -0x1.ffe001c0003c0p-60, 0x1.01fffffe00000p-1, 0x1.ffffffffffc00p-59, 0x1.fffffe0000004p-9, 0x1.ffe3fff440000p-72}, {-0x1.0000000000000p-1, -0x1.ffe001c0003c0p-60, -0x1.01fffffe00000p-1, -0x1.ffffffffffc00p-59, -0x1.00ffffff00000p+0, -0x1.7ff8006ffff00p-58}, {0x1.00003ff808000p-1, -0x1.ffe0000800000p-62, 0x1.000001ffff000p-1, 0x1.ff80000000000p-75, 0x1.000020fc03800p+0, -0x1.ffd0040800000p-62}, {0x1.00003ff808000p-1, -0x1.ffe0000800000p-62, -0x1.000001ffff000p-1, -0x1.ff80000000000p-75, 0x1.efc047ffff800p-20, 0x1.003f800000000p-74}, {-0x1.00003ff808000p-1, 0x1.ffe0000800000p-62, 0x1.000001ffff000p-1, 0x1.ff80000000000p-75, -0x1.efc047ffff800p-20, -0x1.003f800000000p-74}, {-0x1.00003ff808000p-1, 0x1.ffe0000800000p-62, -0x1.000001ffff000p-1, -0x1.ff80000000000p-75, -0x1.000020fc03800p+0, 0x1.ffd0040800000p-62}, {0x1.0000000000000p-1, 0x1.fc007f0ff0000p-63, 0x1.0000000007f80p-1, 0x1.ff0007f802000p-65, 0x1.0000000003fc0p+0, 0x1.3de04086f8400p-62}, {0x1.0000000000000p-1, 0x1.fc007f0ff0000p-63, -0x1.0000000007f80p-1, -0x1.ff0007f802000p-65, -0x1.fdfffe83bf82fp-39, 0x1.ef80000000000p-95}, {-0x1.0000000000000p-1, -0x1.fc007f0ff0000p-63, 0x1.0000000007f80p-1, 0x1.ff0007f802000p-65, 0x1.fdfffe83bf82fp-39, -0x1.ef80000000000p-95}, {-0x1.0000000000000p-1, -0x1.fc007f0ff0000p-63, -0x1.0000000007f80p-1, -0x1.ff0007f802000p-65, -0x1.0000000003fc0p+0, -0x1.3de04086f8400p-62}, {0x1.0020000000000p-1, -0x1.0000000000000p-78, 0x1.000001ffff802p-1, -0x1.ffffffc000040p-60, 0x1.001000ffffc01p+0, -0x1.00001fe000000p-59}, {0x1.0020000000000p-1, -0x1.0000000000000p-78, -0x1.000001ffff802p-1, 0x1.ffffffc000040p-60, 0x1.ffe00007fe040p-13, -0x1.00fffff000000p-78}, {-0x1.0020000000000p-1, 0x1.0000000000000p-78, 0x1.000001ffff802p-1, -0x1.ffffffc000040p-60, -0x1.ffe00007fe040p-13, 0x1.00fffff000000p-78}, {-0x1.0020000000000p-1, 0x1.0000000000000p-78, -0x1.000001ffff802p-1, 0x1.ffffffc000040p-60, -0x1.001000ffffc01p+0, 0x1.00001fe000000p-59}, {0x1.0000000000800p-1, -0x1.ffe0000400000p-63, 0x1.0000000000038p-1, 0x1.e100000000000p-75, 0x1.000000000041cp+0, -0x1.ffc1f00400000p-63}, {0x1.0000000000800p-1, -0x1.ffe0000400000p-63, -0x1.0000000000038p-1, -0x1.e100000000000p-75, 0x1.f1ffe0001effcp-43, 0x0.0000000000000p+0}, {-0x1.0000000000800p-1, 0x1.ffe0000400000p-63, 0x1.0000000000038p-1, 0x1.e100000000000p-75, -0x1.f1ffe0001effcp-43, 0x0.0000000000000p+0}, {-0x1.0000000000800p-1, 0x1.ffe0000400000p-63, -0x1.0000000000038p-1, -0x1.e100000000000p-75, -0x1.000000000041cp+0, 0x1.ffc1f00400000p-63}, {0x1.0000000000020p-1, -0x1.8007ffff80c04p-56, 0x1.0000000000000p-1, 0x1.ffffe00000c00p-64, 0x1.0000000000010p+0, -0x1.7e08001f80bf8p-56}, {0x1.0000000000020p-1, -0x1.8007ffff80c04p-56, -0x1.0000000000000p-1, -0x1.ffffe00000c00p-64, 0x1.fcfbf00040fe8p-49, -0x1.0000000000000p-104}, {-0x1.0000000000020p-1, 0x1.8007ffff80c04p-56, 0x1.0000000000000p-1, 0x1.ffffe00000c00p-64, -0x1.fcfbf00040fe8p-49, 0x1.0000000000000p-104}, {-0x1.0000000000020p-1, 0x1.8007ffff80c04p-56, -0x1.0000000000000p-1, -0x1.ffffe00000c00p-64, -0x1.0000000000010p+0, 0x1.7e08001f80bf8p-56}, {0x1.7fffffff80000p-1, 0x1.f000000000000p-78, 0x1.000007ffffffep-1, 0x1.ffffff8000000p-77, 0x1.400003ffbffffp+0, 0x1.7bffffc000000p-76}, {0x1.7fffffff80000p-1, 0x1.f000000000000p-78, -0x1.000007ffffffep-1, -0x1.ffffff8000000p-77, 0x1.ffffdffe00008p-3, -0x1.07ffff8000000p-77}, {-0x1.7fffffff80000p-1, -0x1.f000000000000p-78, 0x1.000007ffffffep-1, 0x1.ffffff8000000p-77, -0x1.ffffdffe00008p-3, 0x1.07ffff8000000p-77}, {-0x1.7fffffff80000p-1, -0x1.f000000000000p-78, -0x1.000007ffffffep-1, -0x1.ffffff8000000p-77, -0x1.400003ffbffffp+0, -0x1.7bffffc000000p-76}, {0x1.0000000010000p-1, -0x1.0000000000000p-87, 0x1.0000000000000p-1, 0x1.c000003ffc3fep-55, 0x1.0000000008000p+0, 0x1.c000003efc400p-55}, {0x1.0000000010000p-1, -0x1.0000000000000p-87, -0x1.0000000000000p-1, -0x1.c000003ffc3fep-55, 0x1.ffff1fffffdf8p-38, 0x1.e010000000000p-94}, {-0x1.0000000010000p-1, 0x1.0000000000000p-87, 0x1.0000000000000p-1, 0x1.c000003ffc3fep-55, -0x1.ffff1fffffdf8p-38, -0x1.e010000000000p-94}, {-0x1.0000000010000p-1, 0x1.0000000000000p-87, -0x1.0000000000000p-1, -0x1.c000003ffc3fep-55, -0x1.0000000008000p+0, -0x1.c000003efc400p-55}, {0x1.00000ffff0800p-1, -0x1.fff80000ffc20p-59, 0x1.0000000000002p-1, -0x1.0000000000000p-106, 0x1.000007fff8401p+0, -0x1.fff80000ffc40p-59}, {0x1.00000ffff0800p-1, -0x1.fff80000ffc20p-59, -0x1.0000000000002p-1, 0x1.0000000000000p-106, 0x1.fffe0ffbf0004p-22, -0x1.ff80000000000p-92}, {-0x1.00000ffff0800p-1, 0x1.fff80000ffc20p-59, 0x1.0000000000002p-1, -0x1.0000000000000p-106, -0x1.fffe0ffbf0004p-22, 0x1.ff80000000000p-92}, {-0x1.00000ffff0800p-1, 0x1.fff80000ffc20p-59, -0x1.0000000000002p-1, 0x1.0000000000000p-106, -0x1.000007fff8401p+0, 0x1.fff80000ffc40p-59}, {0x1.000ffffc00000p-1, 0x1.fffff00000000p-70, 0x1.0000000000040p-1, -0x1.0000000000000p-106, 0x1.0007fffe00020p+0, 0x1.fffff00000000p-70}, {0x1.000ffffc00000p-1, 0x1.fffff00000000p-70, -0x1.0000000000040p-1, 0x1.0000000000000p-106, 0x1.ffff7fff80000p-14, 0x1.fffff00010000p-70}, {-0x1.000ffffc00000p-1, -0x1.fffff00000000p-70, 0x1.0000000000040p-1, -0x1.0000000000000p-106, -0x1.ffff7fff80000p-14, -0x1.fffff00010000p-70}, {-0x1.000ffffc00000p-1, -0x1.fffff00000000p-70, -0x1.0000000000040p-1, 0x1.0000000000000p-106, -0x1.0007fffe00020p+0, -0x1.fffff00000000p-70}, {0x1.0004000000000p-1, -0x1.0000000000000p-69, 0x1.0000000200000p-1, -0x1.ffbffffff8020p-59, 0x1.0002000100000p+0, -0x1.fffffffff8000p-59}, {0x1.0004000000000p-1, -0x1.0000000000000p-69, -0x1.0000000200000p-1, 0x1.ffbffffff8020p-59, 0x1.ffff0000003ffp-16, -0x1.ff80000000000p-97}, {-0x1.0004000000000p-1, 0x1.0000000000000p-69, 0x1.0000000200000p-1, -0x1.ffbffffff8020p-59, -0x1.ffff0000003ffp-16, 0x1.ff80000000000p-97}, {-0x1.0004000000000p-1, 0x1.0000000000000p-69, -0x1.0000000200000p-1, 0x1.ffbffffff8020p-59, -0x1.0002000100000p+0, 0x1.fffffffff8000p-59}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, 0x1.0000001fffffep-1, 0x0.0000000000000p+0, 0x1.0000000ffffffp+0, 0x1.e0001e7fc0000p-62}, {0x1.0000000000000p-1, 0x1.e0001e7fbff00p-62, -0x1.0000001fffffep-1, 0x0.0000000000000p+0, -0x1.fffffdff0ffffp-29, -0x1.8040100000000p-86}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, 0x1.0000001fffffep-1, 0x0.0000000000000p+0, 0x1.fffffdff0ffffp-29, 0x1.8040100000000p-86}, {-0x1.0000000000000p-1, -0x1.e0001e7fbff00p-62, -0x1.0000001fffffep-1, 0x0.0000000000000p+0, -0x1.0000000ffffffp+0, -0x1.e0001e7fc0000p-62}, {0x1.0000000000fffp-1, 0x1.fffff3e000000p-74, 0x1.001ffe0000000p-1, 0x1.fffffffffffc0p-60, 0x1.000fff0000800p+0, -0x1.f7ffe00000c20p-54}, {0x1.0000000000fffp-1, 0x1.fffff3e000000p-74, -0x1.001ffe0000000p-1, -0x1.fffffffffffc0p-60, -0x1.ffdffff001040p-13, 0x1.fffff3e100000p-74}, {-0x1.0000000000fffp-1, -0x1.fffff3e000000p-74, 0x1.001ffe0000000p-1, 0x1.fffffffffffc0p-60, 0x1.ffdffff001040p-13, -0x1.fffff3e100000p-74}, {-0x1.0000000000fffp-1, -0x1.fffff3e000000p-74, -0x1.001ffe0000000p-1, -0x1.fffffffffffc0p-60, -0x1.000fff0000800p+0, 0x1.f7ffe00000c20p-54}, {0x1.0000080000000p-1, -0x1.0000000000000p-106, 0x1.0000000080000p-1, -0x1.0000000000000p-56, 0x1.0000040040000p+0, -0x1.0000000000000p-56}, {0x1.0000080000000p-1, -0x1.0000000000000p-106, -0x1.0000000080000p-1, 0x1.0000000000000p-56, 0x1.ffe0000080000p-23, -0x1.0000000000000p-106}, {-0x1.0000080000000p-1, 0x1.0000000000000p-106, 0x1.0000000080000p-1, -0x1.0000000000000p-56, -0x1.ffe0000080000p-23, 0x1.0000000000000p-106}, {-0x1.0000080000000p-1, 0x1.0000000000000p-106, -0x1.0000000080000p-1, 0x1.0000000000000p-56, -0x1.0000040040000p+0, 0x1.0000000000000p-56}, {0x1.003ffffffffe0p-1, 0x1.ffffe03800000p-77, 0x1.0000000002000p-1, -0x1.0000000000000p-54, 0x1.0020000000ff0p+0, -0x1.fffff800007f0p-55}, {0x1.003ffffffffe0p-1, 0x1.ffffe03800000p-77, -0x1.0000000002000p-1, 0x1.0000000000000p-54, 0x1.ffffffeff0400p-12, 0x1.ffffe03800000p-77}, {-0x1.003ffffffffe0p-1, -0x1.ffffe03800000p-77, 0x1.0000000002000p-1, -0x1.0000000000000p-54, -0x1.ffffffeff0400p-12, -0x1.ffffe03800000p-77}, {-0x1.003ffffffffe0p-1, -0x1.ffffe03800000p-77, -0x1.0000000002000p-1, 0x1.0000000000000p-54, -0x1.0020000000ff0p+0, 0x1.fffff800007f0p-55}, {0x1.0000000000008p-1, -0x1.ff000007ffc00p-61, 0x1.0000000060000p-1, 0x1.ffffff8000000p-81, 0x1.0000000030004p+0, -0x1.feffe007ffc00p-61}, {0x1.0000000000008p-1, -0x1.ff000007ffc00p-61, -0x1.0000000060000p-1, -0x1.ffffff8000000p-81, -0x1.7ffe007fc0080p-35, -0x1.ffee000000000p-91}, {-0x1.0000000000008p-1, 0x1.ff000007ffc00p-61, 0x1.0000000060000p-1, 0x1.ffffff8000000p-81, 0x1.7ffe007fc0080p-35, 0x1.ffee000000000p-91}, {-0x1.0000000000008p-1, 0x1.ff000007ffc00p-61, -0x1.0000000060000p-1, -0x1.ffffff8000000p-81, -0x1.0000000030004p+0, 0x1.feffe007ffc00p-61}, {0x1.0000000000080p-1, -0x1.0000000000000p-106, 0x1.01ffffff80001p-1, -0x1.ff90000000000p-94, 0x1.00ffffffc0040p+0, 0x1.fffffffffe006p-54}, {0x1.0000000000080p-1, -0x1.0000000000000p-106, -0x1.01ffffff80001p-1, 0x1.ff90000000000p-94, -0x1.ffffff7ff8100p-9, 0x1.ff80000000000p-94}, {-0x1.0000000000080p-1, 0x1.0000000000000p-106, 0x1.01ffffff80001p-1, -0x1.ff90000000000p-94, 0x1.ffffff7ff8100p-9, -0x1.ff80000000000p-94}, {-0x1.0000000000080p-1, 0x1.0000000000000p-106, -0x1.01ffffff80001p-1, 0x1.ff90000000000p-94, -0x1.00ffffffc0040p+0, -0x1.fffffffffe006p-54}, {0x1.0000000000800p-1, -0x1.fffff80002000p-67, 0x1.0008000000000p-1, -0x1.0000000000000p-80, 0x1.0004000000400p+0, -0x1.0003fc0000000p-66}, {0x1.0000000000800p-1, -0x1.fffff80002000p-67, -0x1.0008000000000p-1, 0x1.0000000000000p-80, -0x1.ffffffe000002p-15, 0x1.00ffffc000000p-80}, {-0x1.0000000000800p-1, 0x1.fffff80002000p-67, 0x1.0008000000000p-1, -0x1.0000000000000p-80, 0x1.ffffffe000002p-15, -0x1.00ffffc000000p-80}, {-0x1.0000000000800p-1, 0x1.fffff80002000p-67, -0x1.0008000000000p-1, 0x1.0000000000000p-80, -0x1.0004000000400p+0, 0x1.0003fc0000000p-66}, {0x1.0000000000002p-1, -0x1.ffffffe200000p-75, 0x1.0003fffffffc0p-1, 0x1.ffffe00000400p-64, 0x1.0001fffffffe1p+0, 0x1.ffbfe00004000p-64}, {0x1.0000000000002p-1, -0x1.ffffffe200000p-75, -0x1.0003fffffffc0p-1, -0x1.ffffe00000400p-64, -0x1.fffffffdf0020p-16, -0x1.feffffe400000p-75}, {-0x1.0000000000002p-1, 0x1.ffffffe200000p-75, 0x1.0003fffffffc0p-1, 0x1.ffffe00000400p-64, 0x1.fffffffdf0020p-16, 0x1.feffffe400000p-75}, {-0x1.0000000000002p-1, 0x1.ffffffe200000p-75, -0x1.0003fffffffc0p-1, -0x1.ffffe00000400p-64, -0x1.0001fffffffe1p+0, -0x1.ffbfe00004000p-64}, {0x1.000003f000000p-1, 0x1.fffffffe00000p-62, 0x1.0000000000ff0p-1, 0x1.c03fff0e00000p-75, 0x1.000001f8007f8p+0, 0x1.000700fefc400p-61}, {0x1.000003f000000p-1, 0x1.fffffffe00000p-62, -0x1.0000000000ff0p-1, -0x1.c03fff0e00000p-75, 0x1.f7ff808007ffcp-24, 0x1.fdfe079000000p-78}, {-0x1.000003f000000p-1, -0x1.fffffffe00000p-62, 0x1.0000000000ff0p-1, 0x1.c03fff0e00000p-75, -0x1.f7ff808007ffcp-24, -0x1.fdfe079000000p-78}, {-0x1.000003f000000p-1, -0x1.fffffffe00000p-62, -0x1.0000000000ff0p-1, -0x1.c03fff0e00000p-75, -0x1.000001f8007f8p+0, -0x1.000700fefc400p-61}, {0x1.0000000018000p-1, 0x1.fffffe0000000p-83, 0x1.0000100000000p-1, -0x1.0000000000000p-106, 0x1.000008000c000p+0, 0x1.fffffc0000000p-83}, {0x1.0000000018000p-1, 0x1.fffffe0000000p-83, -0x1.0000100000000p-1, 0x1.0000000000000p-106, -0x1.fffd000000000p-22, 0x1.0000000000000p-82}, {-0x1.0000000018000p-1, -0x1.fffffe0000000p-83, 0x1.0000100000000p-1, -0x1.0000000000000p-106, 0x1.fffd000000000p-22, -0x1.0000000000000p-82}, {-0x1.0000000018000p-1, -0x1.fffffe0000000p-83, -0x1.0000100000000p-1, 0x1.0000000000000p-106, -0x1.000008000c000p+0, -0x1.fffffc0000000p-83}, {0x1.0000000000001p-1, -0x1.fffffc1000000p-68, 0x1.1ffffff01f000p-1, 0x1.ffffc000060fcp-56, 0x1.0ffffff80f801p+0, -0x1.80080fffeebc0p-54}, {0x1.0000000000001p-1, -0x1.fffffc1000000p-68, -0x1.1ffffff01f000p-1, -0x1.ffffc000060fcp-56, -0x1.ffffff01efff4p-5, -0x1.fbfffc70fc000p-68}, {-0x1.0000000000001p-1, 0x1.fffffc1000000p-68, 0x1.1ffffff01f000p-1, 0x1.ffffc000060fcp-56, 0x1.ffffff01efff4p-5, 0x1.fbfffc70fc000p-68}, {-0x1.0000000000001p-1, 0x1.fffffc1000000p-68, -0x1.1ffffff01f000p-1, -0x1.ffffc000060fcp-56, -0x1.0ffffff80f801p+0, 0x1.80080fffeebc0p-54}, {0x1.0000003800000p-1, 0x1.ffe000001fffcp-56, 0x1.0000007fffff0p-1, 0x1.fe1ffffc00000p-63, 0x1.0000005bffff8p+0, 0x1.01ee20000c000p-55}, {0x1.0000003800000p-1, 0x1.ffe000001fffcp-56, -0x1.0000007fffff0p-1, -0x1.fe1ffffc00000p-63, -0x1.1ffffbf020e20p-27, 0x1.3ffe000000000p-91}, {-0x1.0000003800000p-1, -0x1.ffe000001fffcp-56, 0x1.0000007fffff0p-1, 0x1.fe1ffffc00000p-63, 0x1.1ffffbf020e20p-27, -0x1.3ffe000000000p-91}, {-0x1.0000003800000p-1, -0x1.ffe000001fffcp-56, -0x1.0000007fffff0p-1, -0x1.fe1ffffc00000p-63, -0x1.0000005bffff8p+0, -0x1.01ee20000c000p-55}, {0x1.0000001fffc00p-1, 0x1.f00007ffe0000p-65, 0x1.0000000000180p-1, 0x1.fffffe0000800p-65, 0x1.0000000fffec0p+0, 0x1.f80002fff0000p-64}, {0x1.0000001fffc00p-1, 0x1.f00007ffe0000p-65, -0x1.0000000000180p-1, -0x1.fffffe0000800p-65, 0x1.fffa7fffff000p-29, 0x1.3ffbf00000000p-86}, {-0x1.0000001fffc00p-1, -0x1.f00007ffe0000p-65, 0x1.0000000000180p-1, 0x1.fffffe0000800p-65, -0x1.fffa7fffff000p-29, -0x1.3ffbf00000000p-86}, {-0x1.0000001fffc00p-1, -0x1.f00007ffe0000p-65, -0x1.0000000000180p-1, -0x1.fffffe0000800p-65, -0x1.0000000fffec0p+0, -0x1.f80002fff0000p-64}, {0x1.0000000008000p-1, -0x1.c0000007ffe04p-56, 0x1.00000fffffffep-1, 0x1.fc00000000000p-100, 0x1.0000080003fffp+0, -0x1.c0000007ffc08p-56}, {0x1.0000000008000p-1, -0x1.c0000007ffe04p-56, -0x1.00000fffffffep-1, -0x1.fc00000000000p-100, -0x1.fffefffc70000p-22, -0x1.0000000000000p-85}, {-0x1.0000000008000p-1, 0x1.c0000007ffe04p-56, 0x1.00000fffffffep-1, 0x1.fc00000000000p-100, 0x1.fffefffc70000p-22, 0x1.0000000000000p-85}, {-0x1.0000000008000p-1, 0x1.c0000007ffe04p-56, -0x1.00000fffffffep-1, -0x1.fc00000000000p-100, -0x1.0000080003fffp+0, 0x1.c0000007ffc08p-56}, {0x1.0000003e00004p-1, -0x1.fe00040000000p-71, 0x1.00007c0001e00p-1, 0x1.fffe13ffe0000p-65, 0x1.00003e1f00f02p+0, 0x1.f80613efe0000p-65}, {0x1.0000003e00004p-1, -0x1.fe00040000000p-71, -0x1.00007c0001e00p-1, -0x1.fffe13ffe0000p-65, -0x1.ef08077f00082p-19, 0x1.3d7e040000000p-78}, {-0x1.0000003e00004p-1, 0x1.fe00040000000p-71, 0x1.00007c0001e00p-1, 0x1.fffe13ffe0000p-65, 0x1.ef08077f00082p-19, -0x1.3d7e040000000p-78}, {-0x1.0000003e00004p-1, 0x1.fe00040000000p-71, -0x1.00007c0001e00p-1, -0x1.fffe13ffe0000p-65, -0x1.00003e1f00f02p+0, -0x1.f80613efe0000p-65}, {0x1.03fffffffc000p-1, 0x1.ffffffc000000p-76, 0x1.0003ffffff000p-1, 0x1.ffc0000000000p-96, 0x1.0201fffffd800p+0, 0x1.00000fe000000p-75}, {0x1.03fffffffc000p-1, 0x1.ffffffc000000p-76, -0x1.0003ffffff000p-1, -0x1.ffc0000000000p-96, 0x1.fdfffffe80000p-8, 0x1.ffffdfc400000p-76}, {-0x1.03fffffffc000p-1, -0x1.ffffffc000000p-76, 0x1.0003ffffff000p-1, 0x1.ffc0000000000p-96, -0x1.fdfffffe80000p-8, -0x1.ffffdfc400000p-76}, {-0x1.03fffffffc000p-1, -0x1.ffffffc000000p-76, -0x1.0003ffffff000p-1, -0x1.ffc0000000000p-96, -0x1.0201fffffd800p+0, -0x1.00000fe000000p-75}, {0x1.07ffffff80000p-1, 0x1.8007ffffc0000p-72, 0x1.0000000000004p-1, -0x1.fffc000200000p-70, 0x1.03ffffffc0002p+0, -0x1.9ffa000200000p-70}, {0x1.07ffffff80000p-1, 0x1.8007ffffc0000p-72, -0x1.0000000000004p-1, 0x1.fffc000200000p-70, 0x1.ffffffdffff00p-7, 0x1.2fff0000f8000p-69}, {-0x1.07ffffff80000p-1, -0x1.8007ffffc0000p-72, 0x1.0000000000004p-1, -0x1.fffc000200000p-70, -0x1.ffffffdffff00p-7, -0x1.2fff0000f8000p-69}, {-0x1.07ffffff80000p-1, -0x1.8007ffffc0000p-72, -0x1.0000000000004p-1, 0x1.fffc000200000p-70, -0x1.03ffffffc0002p+0, 0x1.9ffa000200000p-70}, {0x1.00003ffffff80p-1, 0x1.ffff0000ffe00p-63, 0x1.00003fffffff8p-1, 0x0.0000000000000p+0, 0x1.00003ffffffbcp+0, 0x1.ffff000100000p-63}, {0x1.00003ffffff80p-1, 0x1.ffff0000ffe00p-63, -0x1.00003fffffff8p-1, 0x0.0000000000000p+0, -0x1.dffe0000ffff0p-47, -0x1.0000000000000p-106}, {-0x1.00003ffffff80p-1, -0x1.ffff0000ffe00p-63, 0x1.00003fffffff8p-1, 0x0.0000000000000p+0, 0x1.dffe0000ffff0p-47, 0x1.0000000000000p-106}, {-0x1.00003ffffff80p-1, -0x1.ffff0000ffe00p-63, -0x1.00003fffffff8p-1, 0x0.0000000000000p+0, -0x1.00003ffffffbcp+0, -0x1.ffff000100000p-63}, {0x1.0000010000000p-1, -0x1.0000000000000p-106, 0x1.00f81ffffff81p-1, 0x1.fffff03c00000p-63, 0x1.007c107ffffc1p+0, -0x1.ff000007e2000p-54}, {0x1.0000010000000p-1, -0x1.0000000000000p-106, -0x1.00f81ffffff81p-1, -0x1.fffff03c00000p-63, -0x1.f03dfffff0201p-10, 0x1.f87ffc0000000p-84}, {-0x1.0000010000000p-1, 0x1.0000000000000p-106, 0x1.00f81ffffff81p-1, 0x1.fffff03c00000p-63, 0x1.f03dfffff0201p-10, -0x1.f87ffc0000000p-84}, {-0x1.0000010000000p-1, 0x1.0000000000000p-106, -0x1.00f81ffffff81p-1, -0x1.fffff03c00000p-63, -0x1.007c107ffffc1p+0, 0x1.ff000007e2000p-54}, {0x1.0000000000004p-1, -0x1.fff0008000000p-65, 0x1.0000000100000p-1, -0x1.fffffe0004000p-68, 0x1.0000000080002p+0, -0x1.1ff8002000000p-64}, {0x1.0000000000004p-1, -0x1.fff0008000000p-65, -0x1.0000000100000p-1, 0x1.fffffe0004000p-68, -0x1.ffff80037fe00p-34, -0x1.7fff000000000p-90}, {-0x1.0000000000004p-1, 0x1.fff0008000000p-65, 0x1.0000000100000p-1, -0x1.fffffe0004000p-68, 0x1.ffff80037fe00p-34, 0x1.7fff000000000p-90}, {-0x1.0000000000004p-1, 0x1.fff0008000000p-65, -0x1.0000000100000p-1, 0x1.fffffe0004000p-68, -0x1.0000000080002p+0, 0x1.1ff8002000000p-64}, {0x1.0000000000800p-1, -0x1.0000000000000p-79, 0x1.0000010000000p-1, -0x1.0000000000000p-104, 0x1.0000008000400p+0, -0x1.0000008000000p-79}, {0x1.0000000000800p-1, -0x1.0000000000000p-79, -0x1.0000010000000p-1, 0x1.0000000000000p-104, -0x1.ffff000000000p-26, -0x1.ffffff0000000p-80}, {-0x1.0000000000800p-1, 0x1.0000000000000p-79, 0x1.0000010000000p-1, -0x1.0000000000000p-104, 0x1.ffff000000000p-26, 0x1.ffffff0000000p-80}, {-0x1.0000000000800p-1, 0x1.0000000000000p-79, -0x1.0000010000000p-1, 0x1.0000000000000p-104, -0x1.0000008000400p+0, 0x1.0000008000000p-79}, {0x1.00000007fff00p-1, 0x1.fffc1ffff87f0p-57, 0x1.0000007c00000p-1, 0x1.fff0000000000p-72, 0x1.00000041fff80p+0, 0x1.00000feffc3f8p-56}, {0x1.00000007fff00p-1, 0x1.fffc1ffff87f0p-57, -0x1.0000007c00000p-1, -0x1.fff0000000000p-72, -0x1.d0003ff8001f8p-27, 0x1.ff87f00000000p-85}, {-0x1.00000007fff00p-1, -0x1.fffc1ffff87f0p-57, 0x1.0000007c00000p-1, 0x1.fff0000000000p-72, 0x1.d0003ff8001f8p-27, -0x1.ff87f00000000p-85}, {-0x1.00000007fff00p-1, -0x1.fffc1ffff87f0p-57, -0x1.0000007c00000p-1, -0x1.fff0000000000p-72, -0x1.00000041fff80p+0, -0x1.00000feffc3f8p-56}, {0x1.fffffffe00000p-1, 0x1.e000001fff800p-65, 0x1.00000001ffffep-1, 0x0.0000000000000p+0, 0x1.7ffffffffffffp+0, 0x1.e000002000000p-65}, {0x1.fffffffe00000p-1, 0x1.e000001fff800p-65, -0x1.00000001ffffep-1, 0x0.0000000000000p+0, 0x1.fffffff800004p-2, 0x1.e000001fff800p-65}, {-0x1.fffffffe00000p-1, -0x1.e000001fff800p-65, 0x1.00000001ffffep-1, 0x0.0000000000000p+0, -0x1.fffffff800004p-2, -0x1.e000001fff800p-65}, {-0x1.fffffffe00000p-1, -0x1.e000001fff800p-65, -0x1.00000001ffffep-1, 0x0.0000000000000p+0, -0x1.7ffffffffffffp+0, -0x1.e000002000000p-65}, {0x1.0000000000008p-1, -0x1.fffff00400000p-73, 0x1.00003ffffe000p-1, 0x1.ffffe00000000p-73, 0x1.00001fffff004p+0, -0x1.0040000000000p-93}, {0x1.0000000000008p-1, -0x1.fffff00400000p-73, -0x1.00003ffffe000p-1, -0x1.ffffe00000000p-73, -0x1.ffffeffc00002p-20, 0x1.7fe0000000000p-92}, {-0x1.0000000000008p-1, 0x1.fffff00400000p-73, 0x1.00003ffffe000p-1, 0x1.ffffe00000000p-73, 0x1.ffffeffc00002p-20, -0x1.7fe0000000000p-92}, {-0x1.0000000000008p-1, 0x1.fffff00400000p-73, -0x1.00003ffffe000p-1, -0x1.ffffe00000000p-73, -0x1.00001fffff004p+0, 0x1.0040000000000p-93}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, 0x1.000001ffe0000p-1, 0x1.ff87ff9f801c0p-60, 0x1.000000fff0000p+0, 0x1.0fc3ffcfc00c0p-59}, {0x1.0000000000000p-1, 0x1.ffffffffffc00p-64, -0x1.000001ffe0000p-1, -0x1.ff87ff9f801c0p-60, -0x1.ffe000003bf10p-25, 0x1.81ff800000000p-86}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, 0x1.000001ffe0000p-1, 0x1.ff87ff9f801c0p-60, 0x1.ffe000003bf10p-25, -0x1.81ff800000000p-86}, {-0x1.0000000000000p-1, -0x1.ffffffffffc00p-64, -0x1.000001ffe0000p-1, -0x1.ff87ff9f801c0p-60, -0x1.000000fff0000p+0, -0x1.0fc3ffcfc00c0p-59}, {0x1.0000000000400p-1, -0x1.f800000002000p-62, 0x1.03fffffffff00p-1, 0x1.fffe7fffffffep-55, 0x1.0200000000180p+0, 0x1.fc0e7ffffffc0p-55}, {0x1.0000000000400p-1, -0x1.f800000002000p-62, -0x1.03fffffffff00p-1, -0x1.fffe7fffffffep-55, -0x1.ffffffffd8040p-8, -0x1.f740000001f00p-62}, {-0x1.0000000000400p-1, 0x1.f800000002000p-62, 0x1.03fffffffff00p-1, 0x1.fffe7fffffffep-55, 0x1.ffffffffd8040p-8, 0x1.f740000001f00p-62}, {-0x1.0000000000400p-1, 0x1.f800000002000p-62, -0x1.03fffffffff00p-1, -0x1.fffe7fffffffep-55, -0x1.0200000000180p+0, -0x1.fc0e7ffffffc0p-55}, {0x1.0000000000000p-1, 0x1.fffffffffff00p-57, 0x1.000007c000000p-1, 0x1.fff8000000000p-57, 0x1.000003e000000p+0, 0x1.fffbfffffff80p-56}, {0x1.0000000000000p-1, 0x1.fffffffffff00p-57, -0x1.000007c000000p-1, -0x1.fff8000000000p-57, -0x1.effffffffffe0p-23, -0x1.0000000000000p-101}, {-0x1.0000000000000p-1, -0x1.fffffffffff00p-57, 0x1.000007c000000p-1, 0x1.fff8000000000p-57, 0x1.effffffffffe0p-23, 0x1.0000000000000p-101}, {-0x1.0000000000000p-1, -0x1.fffffffffff00p-57, -0x1.000007c000000p-1, -0x1.fff8000000000p-57, -0x1.000003e000000p+0, -0x1.fffbfffffff80p-56}, {0x1.0000000000400p-1, -0x1.fffc0003fffd0p-58, 0x1.0000000000000p-1, 0x1.fffffff800000p-57, 0x1.0000000000200p+0, 0x1.0001fff600020p-57}, {0x1.0000000000400p-1, -0x1.fffc0003fffd0p-58, -0x1.0000000000000p-1, -0x1.fffffff800000p-57, 0x1.ffe8001000300p-44, 0x1.8000000000000p-105}, {-0x1.0000000000400p-1, 0x1.fffc0003fffd0p-58, 0x1.0000000000000p-1, 0x1.fffffff800000p-57, -0x1.ffe8001000300p-44, -0x1.8000000000000p-105}, {-0x1.0000000000400p-1, 0x1.fffc0003fffd0p-58, -0x1.0000000000000p-1, -0x1.fffffff800000p-57, -0x1.0000000000200p+0, -0x1.0001fff600020p-57}, {0x1.0000000002000p-1, -0x1.ffff040000000p-72, 0x1.03fffff800000p-1, 0x1.fffffe0000000p-69, 0x1.01fffffc01000p+0, 0x1.c0001d8000000p-69}, {0x1.0000000002000p-1, -0x1.ffff040000000p-72, -0x1.03fffff800000p-1, -0x1.fffffe0000000p-69, -0x1.fffffbff00000p-8, -0x1.1fffef4000000p-68}, {-0x1.0000000002000p-1, 0x1.ffff040000000p-72, 0x1.03fffff800000p-1, 0x1.fffffe0000000p-69, 0x1.fffffbff00000p-8, 0x1.1fffef4000000p-68}, {-0x1.0000000002000p-1, 0x1.ffff040000000p-72, -0x1.03fffff800000p-1, -0x1.fffffe0000000p-69, -0x1.01fffffc01000p+0, -0x1.c0001d8000000p-69}, {0x1.0000008000000p-1, -0x1.ffffff8200000p-58, 0x1.000fff8000000p-1, 0x1.fffffe0000000p-63, 0x1.0008000000000p+0, -0x1.efffff9200000p-58}, {0x1.0000008000000p-1, -0x1.ffffff8200000p-58, -0x1.000fff8000000p-1, -0x1.fffffe0000000p-63, -0x1.ffe0000000210p-14, 0x1.1c00000000000p-83}, {-0x1.0000008000000p-1, 0x1.ffffff8200000p-58, 0x1.000fff8000000p-1, 0x1.fffffe0000000p-63, 0x1.ffe0000000210p-14, -0x1.1c00000000000p-83}, {-0x1.0000008000000p-1, 0x1.ffffff8200000p-58, -0x1.000fff8000000p-1, -0x1.fffffe0000000p-63, -0x1.0008000000000p+0, 0x1.efffff9200000p-58}, {0x1.0000000000000p-1, 0x1.0001f9e000000p-61, 0x1.0000000000040p-1, -0x1.fffffc0080000p-73, 0x1.0000000000020p+0, 0x1.ffc3f3c080000p-62}, {0x1.0000000000000p-1, 0x1.0001f9e000000p-61, -0x1.0000000000040p-1, 0x1.fffffc0080000p-73, -0x1.fff7fef031020p-48, 0x1.0000000000000p-106}, {-0x1.0000000000000p-1, -0x1.0001f9e000000p-61, 0x1.0000000000040p-1, -0x1.fffffc0080000p-73, 0x1.fff7fef031020p-48, -0x1.0000000000000p-106}, {-0x1.0000000000000p-1, -0x1.0001f9e000000p-61, -0x1.0000000000040p-1, 0x1.fffffc0080000p-73, -0x1.0000000000020p+0, -0x1.ffc3f3c080000p-62}, {0x1.0000ff0007e00p-1, 0x1.ffc001ff00000p-68, 0x1.0000010000000p-1, -0x1.ffc007ffffe20p-59, 0x1.0000800003f00p+0, -0x1.fec027ff00600p-59}, {0x1.0000ff0007e00p-1, 0x1.ffc001ff00000p-68, -0x1.0000010000000p-1, 0x1.ffc007ffffe20p-59, 0x1.fc000fc001006p-18, -0x1.7ff009e000000p-79}, {-0x1.0000ff0007e00p-1, -0x1.ffc001ff00000p-68, 0x1.0000010000000p-1, -0x1.ffc007ffffe20p-59, -0x1.fc000fc001006p-18, 0x1.7ff009e000000p-79}, {-0x1.0000ff0007e00p-1, -0x1.ffc001ff00000p-68, -0x1.0000010000000p-1, 0x1.ffc007ffffe20p-59, -0x1.0000800003f00p+0, 0x1.fec027ff00600p-59}, {0x1.07ffffff1fe00p-1, 0x1.fc00000000000p-98, 0x1.0040000000000p-1, -0x1.c000000400000p-62, 0x1.041fffff8ff00p+0, -0x1.c0000003e0400p-62}, {0x1.07ffffff1fe00p-1, 0x1.fc00000000000p-98, -0x1.0040000000000p-1, 0x1.c000000400000p-62, 0x1.efffffc7f8000p-7, 0x1.c00000041fc00p-62}, {-0x1.07ffffff1fe00p-1, -0x1.fc00000000000p-98, 0x1.0040000000000p-1, -0x1.c000000400000p-62, -0x1.efffffc7f8000p-7, -0x1.c00000041fc00p-62}, {-0x1.07ffffff1fe00p-1, -0x1.fc00000000000p-98, -0x1.0040000000000p-1, 0x1.c000000400000p-62, -0x1.041fffff8ff00p+0, 0x1.c0000003e0400p-62}, {0x1.0080000000000p-1, -0x1.0000000000000p-106, 0x1.00000001fffc0p-1, 0x1.fffff80f80000p-73, 0x1.00400000fffe0p+0, 0x1.fffff80f00000p-73}, {0x1.0080000000000p-1, -0x1.0000000000000p-106, -0x1.00000001fffc0p-1, -0x1.fffff80f80000p-73, 0x1.fffff80010000p-11, -0x1.fffff81000000p-73}, {-0x1.0080000000000p-1, 0x1.0000000000000p-106, 0x1.00000001fffc0p-1, 0x1.fffff80f80000p-73, -0x1.fffff80010000p-11, 0x1.fffff81000000p-73}, {-0x1.0080000000000p-1, 0x1.0000000000000p-106, -0x1.00000001fffc0p-1, -0x1.fffff80f80000p-73, -0x1.00400000fffe0p+0, -0x1.fffff80f00000p-73}, {0x1.000000003ff00p-1, 0x0.0000000000000p+0, 0x1.0000000000000p-1, 0x1.f83007ffffe00p-61, 0x1.000000001ff80p+0, 0x1.f83007ffffe00p-61}, {0x1.000000003ff00p-1, 0x0.0000000000000p+0, -0x1.0000000000000p-1, -0x1.f83007ffffe00p-61, 0x1.ff7fff03e7fc0p-36, 0x1.0000000000000p-104}, {-0x1.000000003ff00p-1, 0x0.0000000000000p+0, 0x1.0000000000000p-1, 0x1.f83007ffffe00p-61, -0x1.ff7fff03e7fc0p-36, -0x1.0000000000000p-104}, {-0x1.000000003ff00p-1, 0x0.0000000000000p+0, -0x1.0000000000000p-1, -0x1.f83007ffffe00p-61, -0x1.000000001ff80p+0, -0x1.f83007ffffe00p-61}, {0x1.00003fffffe00p-1, 0x1.fffffc0000380p-61, 0x1.0000010000000p-1, -0x1.ffffff8000008p-57, 0x1.0000207ffff00p+0, -0x1.dfffffbffffd0p-57}, {0x1.00003fffffe00p-1, 0x1.fffffc0000380p-61, -0x1.0000010000000p-1, 0x1.ffffff8000008p-57, 0x1.f7ffff0011000p-20, -0x1.7ffff80000000p-82}, {-0x1.00003fffffe00p-1, -0x1.fffffc0000380p-61, 0x1.0000010000000p-1, -0x1.ffffff8000008p-57, -0x1.f7ffff0011000p-20, 0x1.7ffff80000000p-82}, {-0x1.00003fffffe00p-1, -0x1.fffffc0000380p-61, -0x1.0000010000000p-1, 0x1.ffffff8000008p-57, -0x1.0000207ffff00p+0, 0x1.dfffffbffffd0p-57}, {0x1.0000000080000p-1, -0x1.fffffc0010000p-70, 0x1.3fffff8000000p-1, 0x1.fffff800fe000p-67, 0x1.1fffffc040000p+0, 0x1.bffff880fc000p-67}, {0x1.0000000080000p-1, -0x1.fffffc0010000p-70, -0x1.3fffff8000000p-1, -0x1.fffff800fe000p-67, -0x1.fffffbfc00000p-4, -0x1.1ffffbc080000p-66}, {-0x1.0000000080000p-1, 0x1.fffffc0010000p-70, 0x1.3fffff8000000p-1, 0x1.fffff800fe000p-67, 0x1.fffffbfc00000p-4, 0x1.1ffffbc080000p-66}, {-0x1.0000000080000p-1, 0x1.fffffc0010000p-70, -0x1.3fffff8000000p-1, -0x1.fffff800fe000p-67, -0x1.1fffffc040000p+0, -0x1.bffff880fc000p-67}, {0x1.0003f001fc3f0p-1, 0x1.fffffc0000000p-57, 0x1.0000000000000p-1, 0x1.fc1fffc0000fep-55, 0x1.0001f800fe1f8p+0, 0x1.3e0fff6000080p-54}, {0x1.0003f001fc3f0p-1, 0x1.fffffc0000000p-57, -0x1.0000000000000p-1, -0x1.fc1fffc0000fep-55, 0x1.f800fe1f7d07cp-16, -0x1.80001fc000000p-80}, {-0x1.0003f001fc3f0p-1, -0x1.fffffc0000000p-57, 0x1.0000000000000p-1, 0x1.fc1fffc0000fep-55, -0x1.f800fe1f7d07cp-16, 0x1.80001fc000000p-80}, {-0x1.0003f001fc3f0p-1, -0x1.fffffc0000000p-57, -0x1.0000000000000p-1, -0x1.fc1fffc0000fep-55, -0x1.0001f800fe1f8p+0, -0x1.3e0fff6000080p-54}, {0x1.0000000000000p-1, 0x1.fffffffffffc0p-60, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-63, 0x1.0000000000000p+0, 0x1.1ffffffffffc0p-59}, {0x1.0000000000000p-1, 0x1.fffffffffffc0p-60, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-63, 0x1.c000000000000p-60, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffffffffffc0p-60, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-63, -0x1.c000000000000p-60, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffffffffffc0p-60, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-63, -0x1.0000000000000p+0, -0x1.1ffffffffffc0p-59}, {0x1.0000000100000p-1, -0x1.0000000000000p-80, 0x1.0000004000000p-1, -0x1.0000000000000p-81, 0x1.0000002080000p+0, -0x1.8000000000000p-80}, {0x1.0000000100000p-1, -0x1.0000000000000p-80, -0x1.0000004000000p-1, 0x1.0000000000000p-81, -0x1.f800000000000p-28, -0x1.0000000000000p-81}, {-0x1.0000000100000p-1, 0x1.0000000000000p-80, 0x1.0000004000000p-1, -0x1.0000000000000p-81, 0x1.f800000000000p-28, 0x1.0000000000000p-81}, {-0x1.0000000100000p-1, 0x1.0000000000000p-80, -0x1.0000004000000p-1, 0x1.0000000000000p-81, -0x1.0000002080000p+0, 0x1.8000000000000p-80}, {0x1.0000010000000p-1, -0x1.ffffe00001000p-57, 0x1.000ffffff007fp-1, 0x1.ffffc00000000p-82, 0x1.0008007ff803fp+0, 0x1.c000041fffdc0p-54}, {0x1.0000010000000p-1, -0x1.ffffe00001000p-57, -0x1.000ffffff007fp-1, -0x1.ffffc00000000p-82, -0x1.ffdffe00fe400p-14, 0x1.effff20000000p-77}, {-0x1.0000010000000p-1, 0x1.ffffe00001000p-57, 0x1.000ffffff007fp-1, 0x1.ffffc00000000p-82, 0x1.ffdffe00fe400p-14, -0x1.effff20000000p-77}, {-0x1.0000010000000p-1, 0x1.ffffe00001000p-57, -0x1.000ffffff007fp-1, -0x1.ffffc00000000p-82, -0x1.0008007ff803fp+0, -0x1.c000041fffdc0p-54}, {0x1.1000fffffc000p-1, 0x1.fffffc003f000p-57, 0x1.0000000001000p-1, -0x1.0000000000000p-106, 0x1.08007ffffe800p+0, 0x1.fffffc003f000p-57}, {0x1.1000fffffc000p-1, 0x1.fffffc003f000p-57, -0x1.0000000001000p-1, 0x1.0000000000000p-106, 0x1.000fffffb0002p-5, -0x1.ffe07fc000000p-80}, {-0x1.1000fffffc000p-1, -0x1.fffffc003f000p-57, 0x1.0000000001000p-1, -0x1.0000000000000p-106, -0x1.000fffffb0002p-5, 0x1.ffe07fc000000p-80}, {-0x1.1000fffffc000p-1, -0x1.fffffc003f000p-57, -0x1.0000000001000p-1, 0x1.0000000000000p-106, -0x1.08007ffffe800p+0, -0x1.fffffc003f000p-57}, {0x1.00000fff80000p-1, 0x1.fffe000000000p-86, 0x1.0000001f00000p-1, 0x1.fffffff000000p-78, 0x1.0000080f40000p+0, 0x1.00ffff0000000p-77}, {0x1.00000fff80000p-1, 0x1.fffe000000000p-86, -0x1.0000001f00000p-1, -0x1.fffffff000000p-78, 0x1.fc10000000000p-22, -0x1.fe0001f000000p-78}, {-0x1.00000fff80000p-1, -0x1.fffe000000000p-86, 0x1.0000001f00000p-1, 0x1.fffffff000000p-78, -0x1.fc10000000000p-22, 0x1.fe0001f000000p-78}, {-0x1.00000fff80000p-1, -0x1.fffe000000000p-86, -0x1.0000001f00000p-1, -0x1.fffffff000000p-78, -0x1.0000080f40000p+0, -0x1.00ffff0000000p-77}, {0x1.3fdfffff02000p-1, -0x1.0000000000000p-79, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-62, 0x1.1fefffff81000p+0, 0x1.ffff7fffffe00p-62}, {0x1.3fdfffff02000p-1, -0x1.0000000000000p-79, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-62, 0x1.fefffff810000p-4, -0x1.00003ffffff00p-61}, {-0x1.3fdfffff02000p-1, 0x1.0000000000000p-79, 0x1.0000000000000p-1, 0x1.ffffffffffe00p-62, -0x1.fefffff810000p-4, 0x1.00003ffffff00p-61}, {-0x1.3fdfffff02000p-1, 0x1.0000000000000p-79, -0x1.0000000000000p-1, -0x1.ffffffffffe00p-62, -0x1.1fefffff81000p+0, -0x1.ffff7fffffe00p-62}, {0x1.0000000000008p-1, -0x1.e0ffffd002000p-67, 0x1.0000000000400p-1, 0x1.ffffffff03ffep-55, 0x1.0000000000204p+0, 0x1.ffe1efff06ffcp-55}, {0x1.0000000000008p-1, -0x1.e0ffffd002000p-67, -0x1.0000000000400p-1, -0x1.ffffffff03ffep-55, -0x1.fc4003c1ffe02p-44, 0x0.0000000000000p+0}, {-0x1.0000000000008p-1, 0x1.e0ffffd002000p-67, 0x1.0000000000400p-1, 0x1.ffffffff03ffep-55, 0x1.fc4003c1ffe02p-44, 0x0.0000000000000p+0}, {-0x1.0000000000008p-1, 0x1.e0ffffd002000p-67, -0x1.0000000000400p-1, -0x1.ffffffff03ffep-55, -0x1.0000000000204p+0, -0x1.ffe1efff06ffcp-55}, {0x1.000000fffe020p-1, -0x1.f800100000000p-74, 0x1.0001fff80ffc0p-1, 0x1.ff00000000000p-98, 0x1.0001007c06ff0p+0, -0x1.f8000e0000000p-74}, {0x1.000000fffe020p-1, -0x1.f800100000000p-74, -0x1.0001fff80ffc0p-1, -0x1.ff00000000000p-98, -0x1.fef811fa00000p-17, -0x1.f80011ff00000p-74}, {-0x1.000000fffe020p-1, 0x1.f800100000000p-74, 0x1.0001fff80ffc0p-1, 0x1.ff00000000000p-98, 0x1.fef811fa00000p-17, 0x1.f80011ff00000p-74}, {-0x1.000000fffe020p-1, 0x1.f800100000000p-74, -0x1.0001fff80ffc0p-1, -0x1.ff00000000000p-98, -0x1.0001007c06ff0p+0, 0x1.f8000e0000000p-74}, {0x1.4000000000000p-1, -0x1.0000000000000p-106, 0x1.0000000000010p-1, 0x1.e000000000000p-69, 0x1.2000000000008p+0, 0x1.e000000000000p-69}, {0x1.4000000000000p-1, -0x1.0000000000000p-106, -0x1.0000000000010p-1, -0x1.e000000000000p-69, 0x1.fffffffffff80p-4, -0x1.e000000008000p-69}, {-0x1.4000000000000p-1, 0x1.0000000000000p-106, 0x1.0000000000010p-1, 0x1.e000000000000p-69, -0x1.fffffffffff80p-4, 0x1.e000000008000p-69}, {-0x1.4000000000000p-1, 0x1.0000000000000p-106, -0x1.0000000000010p-1, -0x1.e000000000000p-69, -0x1.2000000000008p+0, -0x1.e000000000000p-69}, {0x1.2000000000000p-1, -0x1.fffffff01ff20p-58, 0x1.0000000000000p-1, 0x1.fff8003ff0000p-58, 0x1.1000000000000p+0, -0x1.ffec0bfc80000p-72}, {0x1.2000000000000p-1, -0x1.fffffff01ff20p-58, -0x1.0000000000000p-1, -0x1.fff8003ff0000p-58, 0x1.ffffffffffffep-5, 0x1.fff3fc0380000p-72}, {-0x1.2000000000000p-1, 0x1.fffffff01ff20p-58, 0x1.0000000000000p-1, 0x1.fff8003ff0000p-58, -0x1.ffffffffffffep-5, -0x1.fff3fc0380000p-72}, {-0x1.2000000000000p-1, 0x1.fffffff01ff20p-58, -0x1.0000000000000p-1, -0x1.fff8003ff0000p-58, -0x1.1000000000000p+0, 0x1.ffec0bfc80000p-72}, {0x1.2000000000000p-1, -0x1.fc08000000000p-93, 0x1.0000000038004p-1, -0x1.fffffc4000000p-70, 0x1.100000001c002p+0, -0x1.0000001c00000p-69}, {0x1.2000000000000p-1, -0x1.fc08000000000p-93, -0x1.0000000038004p-1, 0x1.fffffc4000000p-70, 0x1.fffffffc7ffc0p-5, 0x1.fffff847f0000p-70}, {-0x1.2000000000000p-1, 0x1.fc08000000000p-93, 0x1.0000000038004p-1, -0x1.fffffc4000000p-70, -0x1.fffffffc7ffc0p-5, -0x1.fffff847f0000p-70}, {-0x1.2000000000000p-1, 0x1.fc08000000000p-93, -0x1.0000000038004p-1, 0x1.fffffc4000000p-70, -0x1.100000001c002p+0, 0x1.0000001c00000p-69}, {0x1.0000000000200p-1, 0x0.0000000000000p+0, 0x1.00001ffff0000p-1, 0x1.ffff80001f000p-58, 0x1.00000ffff8100p+0, 0x1.ffff80001f000p-58}, {0x1.0000000000200p-1, 0x0.0000000000000p+0, -0x1.00001ffff0000p-1, -0x1.ffff80001f000p-58, -0x1.fffefe0010000p-21, 0x1.ffff840000000p-76}, {-0x1.0000000000200p-1, 0x0.0000000000000p+0, 0x1.00001ffff0000p-1, 0x1.ffff80001f000p-58, 0x1.fffefe0010000p-21, -0x1.ffff840000000p-76}, {-0x1.0000000000200p-1, 0x0.0000000000000p+0, -0x1.00001ffff0000p-1, -0x1.ffff80001f000p-58, -0x1.00000ffff8100p+0, -0x1.ffff80001f000p-58}, {0x1.0000100000000p-1, -0x1.0000000000000p-106, 0x1.0038000800000p-1, -0x1.fffffe0000080p-61, 0x1.001c080400000p+0, -0x1.fffffe0000100p-61}, {0x1.0000100000000p-1, -0x1.0000000000000p-106, -0x1.0038000800000p-1, 0x1.fffffe0000080p-61, -0x1.bf803fffffff0p-12, -0x1.0000000000000p-84}, {-0x1.0000100000000p-1, 0x1.0000000000000p-106, 0x1.0038000800000p-1, -0x1.fffffe0000080p-61, 0x1.bf803fffffff0p-12, 0x1.0000000000000p-84}, {-0x1.0000100000000p-1, 0x1.0000000000000p-106, -0x1.0038000800000p-1, 0x1.fffffe0000080p-61, -0x1.001c080400000p+0, 0x1.fffffe0000100p-61}, {0x1.0000000000004p-1, -0x1.ffffe00400000p-74, 0x1.0000000000000p-1, 0x1.ffffffffffff8p-57, 0x1.0000000000002p+0, 0x1.ffff00000ffe0p-57}, {0x1.0000000000004p-1, -0x1.ffffe00400000p-74, -0x1.0000000000000p-1, -0x1.ffffffffffff8p-57, 0x1.effff800007ffp-52, 0x1.0000000000000p-106}, {-0x1.0000000000004p-1, 0x1.ffffe00400000p-74, 0x1.0000000000000p-1, 0x1.ffffffffffff8p-57, -0x1.effff800007ffp-52, -0x1.0000000000000p-106}, {-0x1.0000000000004p-1, 0x1.ffffe00400000p-74, -0x1.0000000000000p-1, -0x1.ffffffffffff8p-57, -0x1.0000000000002p+0, -0x1.ffff00000ffe0p-57}, {0x1.0000000000100p-1, -0x1.ffffe7e400000p-71, 0x1.1ffe000008000p-1, -0x1.fffc000004000p-68, 0x1.0fff000004080p+0, -0x1.1ffdfe7e40000p-67}, {0x1.0000000000100p-1, -0x1.ffffe7e400000p-71, -0x1.1ffe000008000p-1, 0x1.fffc000004000p-68, -0x1.ffe000007f000p-5, 0x1.bffc030384000p-68}, {-0x1.0000000000100p-1, 0x1.ffffe7e400000p-71, 0x1.1ffe000008000p-1, -0x1.fffc000004000p-68, 0x1.ffe000007f000p-5, -0x1.bffc030384000p-68}, {-0x1.0000000000100p-1, 0x1.ffffe7e400000p-71, -0x1.1ffe000008000p-1, 0x1.fffc000004000p-68, -0x1.0fff000004080p+0, 0x1.1ffdfe7e40000p-67}, {0x1.0000000000004p-1, -0x1.0000000000000p-106, 0x1.00000007ffffep-1, 0x1.ffffe000f0000p-62, 0x1.0000000400001p+0, 0x1.ffffe000f0000p-62}, {0x1.0000000000004p-1, -0x1.0000000000000p-106, -0x1.00000007ffffep-1, -0x1.ffffe000f0000p-62, -0x1.ffffe803ffffcp-31, -0x1.e020000000000p-95}, {-0x1.0000000000004p-1, 0x1.0000000000000p-106, 0x1.00000007ffffep-1, 0x1.ffffe000f0000p-62, 0x1.ffffe803ffffcp-31, 0x1.e020000000000p-95}, {-0x1.0000000000004p-1, 0x1.0000000000000p-106, -0x1.00000007ffffep-1, -0x1.ffffe000f0000p-62, -0x1.0000000400001p+0, -0x1.ffffe000f0000p-62}, {0x1.0000000000000p-1, 0x1.fffffff000000p-62, 0x1.0001fffc00001p-1, -0x1.0000000000000p-80, 0x1.0000fffe00001p+0, -0x1.fe00004010000p-54}, {0x1.0000000000000p-1, 0x1.fffffff000000p-62, -0x1.0001fffc00001p-1, 0x1.0000000000000p-80, -0x1.fffc00000ff00p-17, 0x1.ff80000000000p-81}, {-0x1.0000000000000p-1, -0x1.fffffff000000p-62, 0x1.0001fffc00001p-1, -0x1.0000000000000p-80, 0x1.fffc00000ff00p-17, -0x1.ff80000000000p-81}, {-0x1.0000000000000p-1, -0x1.fffffff000000p-62, -0x1.0001fffc00001p-1, 0x1.0000000000000p-80, -0x1.0000fffe00001p+0, 0x1.fe00004010000p-54}, {0x1.00007fdfffff0p-1, 0x1.fff000f803fe0p-59, 0x1.0080000000000p-1, -0x1.0000000000000p-93, 0x1.00403fefffff8p+0, 0x1.fff000f7c4000p-59}, {0x1.00007fdfffff0p-1, 0x1.fff000f803fe0p-59, -0x1.0080000000000p-1, 0x1.0000000000000p-93, -0x1.fe00800003fe0p-11, -0x1.ffe0f78040000p-72}, {-0x1.00007fdfffff0p-1, -0x1.fff000f803fe0p-59, 0x1.0080000000000p-1, -0x1.0000000000000p-93, 0x1.fe00800003fe0p-11, 0x1.ffe0f78040000p-72}, {-0x1.00007fdfffff0p-1, -0x1.fff000f803fe0p-59, -0x1.0080000000000p-1, 0x1.0000000000000p-93, -0x1.00403fefffff8p+0, -0x1.fff000f7c4000p-59}, {0x1.0000000000080p-1, 0x0.0000000000000p+0, 0x1.0000080000000p-1, -0x1.0000000000000p-86, 0x1.0000040000040p+0, -0x1.0000000000000p-86}, {0x1.0000000000080p-1, 0x0.0000000000000p+0, -0x1.0000080000000p-1, 0x1.0000000000000p-86, -0x1.fffffe0000000p-23, 0x1.0000000000000p-86}, {-0x1.0000000000080p-1, 0x0.0000000000000p+0, 0x1.0000080000000p-1, -0x1.0000000000000p-86, 0x1.fffffe0000000p-23, -0x1.0000000000000p-86}, {-0x1.0000000000080p-1, 0x0.0000000000000p+0, -0x1.0000080000000p-1, 0x1.0000000000000p-86, -0x1.0000040000040p+0, 0x1.0000000000000p-86}, {0x1.0400000000000p-1, -0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.fffff00008000p-57, 0x1.0200000000200p+0, -0x1.fffff00008000p-57}, {0x1.0400000000000p-1, -0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.fffff00008000p-57, 0x1.ffffffffe0010p-8, -0x1.ffff001000000p-78}, {-0x1.0400000000000p-1, 0x1.0000000000000p-106, 0x1.0000000000400p-1, -0x1.fffff00008000p-57, -0x1.ffffffffe0010p-8, 0x1.ffff001000000p-78}, {-0x1.0400000000000p-1, 0x1.0000000000000p-106, -0x1.0000000000400p-1, 0x1.fffff00008000p-57, -0x1.0200000000200p+0, 0x1.fffff00008000p-57}, {0x1.0000000000001p-1, -0x1.fc0000c004000p-66, 0x1.0000000000200p-1, -0x1.ffe0000200000p-69, 0x1.0000000000100p+0, 0x1.ffdc403ff3fbcp-54}, {0x1.0000000000001p-1, -0x1.fc0000c004000p-66, -0x1.0000000000200p-1, 0x1.ffe0000200000p-69, -0x1.ff000de020060p-45, 0x1.e000000000000p-101}, {-0x1.0000000000001p-1, 0x1.fc0000c004000p-66, 0x1.0000000000200p-1, -0x1.ffe0000200000p-69, 0x1.ff000de020060p-45, -0x1.e000000000000p-101}, {-0x1.0000000000001p-1, 0x1.fc0000c004000p-66, -0x1.0000000000200p-1, 0x1.ffe0000200000p-69, -0x1.0000000000100p+0, -0x1.ffdc403ff3fbcp-54}, {0x1.00000c0000004p-1, -0x1.ff80000800000p-69, 0x1.18003ffff8000p-1, 0x1.ffffff8000000p-67, 0x1.0c0025fffc002p+0, 0x1.801fff7e00000p-67}, {0x1.00000c0000004p-1, -0x1.ff80000800000p-69, -0x1.18003ffff8000p-1, -0x1.ffffff8000000p-67, -0x1.80033fff7ffc0p-5, -0x1.3fefffc100000p-66}, {-0x1.00000c0000004p-1, 0x1.ff80000800000p-69, 0x1.18003ffff8000p-1, 0x1.ffffff8000000p-67, 0x1.80033fff7ffc0p-5, 0x1.3fefffc100000p-66}, {-0x1.00000c0000004p-1, 0x1.ff80000800000p-69, -0x1.18003ffff8000p-1, -0x1.ffffff8000000p-67, -0x1.0c0025fffc002p+0, -0x1.801fff7e00000p-67}, {0x1.1ffff80000040p-1, -0x1.0000000000000p-91, 0x1.000000000fe00p-1, 0x1.ffff7e0003ff8p-57, 0x1.0ffffc0007f20p+0, 0x1.ffff7dffc4000p-57}, {0x1.1ffff80000040p-1, -0x1.0000000000000p-91, -0x1.000000000fe00p-1, -0x1.ffff7e0003ff8p-57, 0x1.ffff7fff023fep-5, 0x1.03ff780100000p-74}, {-0x1.1ffff80000040p-1, 0x1.0000000000000p-91, 0x1.000000000fe00p-1, 0x1.ffff7e0003ff8p-57, -0x1.ffff7fff023fep-5, -0x1.03ff780100000p-74}, {-0x1.1ffff80000040p-1, 0x1.0000000000000p-91, -0x1.000000000fe00p-1, -0x1.ffff7e0003ff8p-57, -0x1.0ffffc0007f20p+0, -0x1.ffff7dffc4000p-57}, {0x1.3fc0000040000p-1, -0x1.fffffff802000p-57, 0x1.fffffffffff00p-1, 0x0.0000000000000p+0, 0x1.9fe000001ff80p+0, -0x1.fffffff802000p-57}, {0x1.3fc0000040000p-1, -0x1.fffffff802000p-57, -0x1.fffffffffff00p-1, 0x0.0000000000000p+0, -0x1.807fffff7fe00p-2, -0x1.fffffff802000p-57}, {-0x1.3fc0000040000p-1, 0x1.fffffff802000p-57, 0x1.fffffffffff00p-1, 0x0.0000000000000p+0, 0x1.807fffff7fe00p-2, 0x1.fffffff802000p-57}, {-0x1.3fc0000040000p-1, 0x1.fffffff802000p-57, -0x1.fffffffffff00p-1, 0x0.0000000000000p+0, -0x1.9fe000001ff80p+0, 0x1.fffffff802000p-57}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, 0x1.0000000000200p-1, -0x1.0000000000000p-106, 0x1.0000000100100p+0, -0x1.ffffbffff8200p-54}, {0x1.00000001fffffp-1, 0x1.00001f8000000p-72, -0x1.0000000000200p-1, 0x1.0000000000000p-106, 0x1.ffdff00002000p-33, 0x1.f804000000000p-92}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, 0x1.0000000000200p-1, -0x1.0000000000000p-106, -0x1.ffdff00002000p-33, -0x1.f804000000000p-92}, {-0x1.00000001fffffp-1, -0x1.00001f8000000p-72, -0x1.0000000000200p-1, 0x1.0000000000000p-106, -0x1.0000000100100p+0, 0x1.ffffbffff8200p-54}, {0x1.0000000010000p-1, -0x1.0000000000000p-78, 0x1.1fff010000000p-1, 0x1.ff8c0000007fep-55, 0x1.0fff808008000p+0, 0x1.ff8bfe0000800p-55}, {0x1.0000000010000p-1, -0x1.0000000000000p-78, -0x1.1fff010000000p-1, -0x1.ff8c0000007fep-55, -0x1.fff00fff00008p-5, 0x1.cff7fffe00800p-65}, {-0x1.0000000010000p-1, 0x1.0000000000000p-78, 0x1.1fff010000000p-1, 0x1.ff8c0000007fep-55, 0x1.fff00fff00008p-5, -0x1.cff7fffe00800p-65}, {-0x1.0000000010000p-1, 0x1.0000000000000p-78, -0x1.1fff010000000p-1, -0x1.ff8c0000007fep-55, -0x1.0fff808008000p+0, -0x1.ff8bfe0000800p-55}, {0x1.0000000000002p-1, -0x1.0000000000000p-88, 0x1.0000000000200p-1, -0x1.0000000000000p-86, 0x1.0000000000101p+0, -0x1.4000000000000p-86}, {0x1.0000000000002p-1, -0x1.0000000000000p-88, -0x1.0000000000200p-1, 0x1.0000000000000p-86, -0x1.fdffffffffa00p-45, 0x0.0000000000000p+0}, {-0x1.0000000000002p-1, 0x1.0000000000000p-88, 0x1.0000000000200p-1, -0x1.0000000000000p-86, 0x1.fdffffffffa00p-45, 0x0.0000000000000p+0}, {-0x1.0000000000002p-1, 0x1.0000000000000p-88, -0x1.0000000000200p-1, 0x1.0000000000000p-86, -0x1.0000000000101p+0, 0x1.4000000000000p-86}, {0x1.0000000000002p-1, -0x1.ffff800008000p-68, 0x1.000000003fffep-1, 0x1.f81fc007c0000p-72, 0x1.0000000020000p+0, -0x1.e07d83ff90000p-68}, {0x1.0000000000002p-1, -0x1.ffff800008000p-68, -0x1.000000003fffep-1, -0x1.f81fc007c0000p-72, -0x1.fffe00021f818p-36, 0x1.ffbe000000000p-91}, {-0x1.0000000000002p-1, 0x1.ffff800008000p-68, 0x1.000000003fffep-1, 0x1.f81fc007c0000p-72, 0x1.fffe00021f818p-36, -0x1.ffbe000000000p-91}, {-0x1.0000000000002p-1, 0x1.ffff800008000p-68, -0x1.000000003fffep-1, -0x1.f81fc007c0000p-72, -0x1.0000000020000p+0, 0x1.e07d83ff90000p-68}, {0x1.7ffffffff0000p-1, 0x1.ffff07fffc000p-65, 0x1.000000000ffe0p-1, 0x1.ff0000003c000p-64, 0x1.3fffffffffff0p+0, 0x1.7f7fc2001d000p-63}, {0x1.7ffffffff0000p-1, 0x1.ffff07fffc000p-65, -0x1.000000000ffe0p-1, -0x1.ff0000003c000p-64, 0x1.ffffffff80080p-3, -0x1.fe00f8007c000p-65}, {-0x1.7ffffffff0000p-1, -0x1.ffff07fffc000p-65, 0x1.000000000ffe0p-1, 0x1.ff0000003c000p-64, -0x1.ffffffff80080p-3, 0x1.fe00f8007c000p-65}, {-0x1.7ffffffff0000p-1, -0x1.ffff07fffc000p-65, -0x1.000000000ffe0p-1, -0x1.ff0000003c000p-64, -0x1.3fffffffffff0p+0, -0x1.7f7fc2001d000p-63}, {0x1.00007fff00080p-1, -0x1.ffffff0001000p-66, 0x1.00000000007c0p-1, 0x1.ffffff8000000p-68, 0x1.00003fff80420p+0, -0x1.7fffff2000000p-66}, {0x1.00007fff00080p-1, -0x1.ffffff0001000p-66, -0x1.00000000007c0p-1, -0x1.ffffff8000000p-68, 0x1.fffbfe2ffffb0p-19, 0x1.1fff000000000p-90}, {-0x1.00007fff00080p-1, 0x1.ffffff0001000p-66, 0x1.00000000007c0p-1, 0x1.ffffff8000000p-68, -0x1.fffbfe2ffffb0p-19, -0x1.1fff000000000p-90}, {-0x1.00007fff00080p-1, 0x1.ffffff0001000p-66, -0x1.00000000007c0p-1, -0x1.ffffff8000000p-68, -0x1.00003fff80420p+0, 0x1.7fffff2000000p-66}, {0x1.1fff81ff00000p-1, 0x1.e007ffff00000p-58, 0x1.1ffffffff8000p-1, 0x1.fe001ffffffe0p-57, 0x1.1fffc0ff7c000p+0, 0x1.77020fffbfff0p-56}, {0x1.1fff81ff00000p-1, 0x1.e007ffff00000p-58, -0x1.1ffffffff8000p-1, -0x1.fe001ffffffe0p-57, -0x1.f803e0000437fp-19, -0x1.0003fff000000p-76}, {-0x1.1fff81ff00000p-1, -0x1.e007ffff00000p-58, 0x1.1ffffffff8000p-1, 0x1.fe001ffffffe0p-57, 0x1.f803e0000437fp-19, 0x1.0003fff000000p-76}, {-0x1.1fff81ff00000p-1, -0x1.e007ffff00000p-58, -0x1.1ffffffff8000p-1, -0x1.fe001ffffffe0p-57, -0x1.1fffc0ff7c000p+0, -0x1.77020fffbfff0p-56}, {0x1.0000000000000p-1, 0x1.fffc03fe00700p-62, 0x1.0000000000001p-1, -0x1.fff8060000f34p-56, 0x1.0000000000000p+0, 0x1.8201fa83fdc3ap-54}, {0x1.0000000000000p-1, 0x1.fffc03fe00700p-62, -0x1.0000000000001p-1, 0x1.fff8060000f34p-56, -0x1.7e02027c01c2cp-54, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffc03fe00700p-62, 0x1.0000000000001p-1, -0x1.fff8060000f34p-56, 0x1.7e02027c01c2cp-54, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.fffc03fe00700p-62, -0x1.0000000000001p-1, 0x1.fff8060000f34p-56, -0x1.0000000000000p+0, -0x1.8201fa83fdc3ap-54}, {0x1.001ffffc00080p-1, -0x1.fe00000200000p-62, 0x1.0000000001000p-1, -0x1.fe3ffffff0080p-61, 0x1.000ffffe00840p+0, -0x1.7ea0000078000p-60}, {0x1.001ffffc00080p-1, -0x1.fe00000200000p-62, -0x1.0000000001000p-1, 0x1.fe3ffffff0080p-61, 0x1.ffffbff080010p-13, -0x1.8000021ff0000p-70}, {-0x1.001ffffc00080p-1, 0x1.fe00000200000p-62, 0x1.0000000001000p-1, -0x1.fe3ffffff0080p-61, -0x1.ffffbff080010p-13, 0x1.8000021ff0000p-70}, {-0x1.001ffffc00080p-1, 0x1.fe00000200000p-62, -0x1.0000000001000p-1, 0x1.fe3ffffff0080p-61, -0x1.000ffffe00840p+0, 0x1.7ea0000078000p-60}, {0x1.00001fffff800p-1, 0x1.ffffff801ffc0p-60, 0x1.0000000002000p-1, -0x1.0000000000000p-106, 0x1.0000100000c00p+0, 0x1.ffffff801ff80p-60}, {0x1.00001fffff800p-1, 0x1.ffffff801ffc0p-60, -0x1.0000000002000p-1, 0x1.0000000000000p-106, 0x1.ffffd80004000p-21, -0x1.ff80000000000p-86}, {-0x1.00001fffff800p-1, -0x1.ffffff801ffc0p-60, 0x1.0000000002000p-1, -0x1.0000000000000p-106, -0x1.ffffd80004000p-21, 0x1.ff80000000000p-86}, {-0x1.00001fffff800p-1, -0x1.ffffff801ffc0p-60, -0x1.0000000002000p-1, 0x1.0000000000000p-106, -0x1.0000100000c00p+0, -0x1.ffffff801ff80p-60}, {0x1.0000000000000p-1, 0x1.ffff83ffbfff0p-57, 0x1.0000000000000p-1, 0x1.ffffffffe0000p-57, 0x1.0000000000000p+0, 0x1.ffffc1ffcfff8p-56}, {0x1.0000000000000p-1, 0x1.ffff83ffbfff0p-57, -0x1.0000000000000p-1, -0x1.ffffffffe0000p-57, -0x1.f000800400000p-75, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ffff83ffbfff0p-57, 0x1.0000000000000p-1, 0x1.ffffffffe0000p-57, 0x1.f000800400000p-75, 0x0.0000000000000p+0}, {-0x1.0000000000000p-1, -0x1.ffff83ffbfff0p-57, -0x1.0000000000000p-1, -0x1.ffffffffe0000p-57, -0x1.0000000000000p+0, -0x1.ffffc1ffcfff8p-56}, {0x1.0000000000000p-1, 0x1.fffe7ff3dff00p-62, 0x1.000007f830000p-1, 0x1.fff0000ffe100p-62, 0x1.000003fc18000p+0, 0x1.fff74001ef000p-61}, {0x1.0000000000000p-1, 0x1.fffe7ff3dff00p-62, -0x1.000007f830000p-1, -0x1.fff0000ffe100p-62, -0x1.fe0bffffffffep-23, -0x1.801c1e2000000p-78}, {-0x1.0000000000000p-1, -0x1.fffe7ff3dff00p-62, 0x1.000007f830000p-1, 0x1.fff0000ffe100p-62, 0x1.fe0bffffffffep-23, 0x1.801c1e2000000p-78}, {-0x1.0000000000000p-1, -0x1.fffe7ff3dff00p-62, -0x1.000007f830000p-1, -0x1.fff0000ffe100p-62, -0x1.000003fc18000p+0, -0x1.fff74001ef000p-61}, {0x1.00000ffffe000p-1, 0x1.fffffffffc000p-68, 0x1.0000000000002p-1, -0x1.fffffe01f8004p-56, 0x1.000007ffff001p+0, -0x1.ffdffe01f8008p-56}, {0x1.00000ffffe000p-1, 0x1.fffffffffc000p-68, -0x1.0000000000002p-1, 0x1.fffffe01f8004p-56, 0x1.ffffbffc80080p-22, -0x1.fe08000000000p-80}, {-0x1.00000ffffe000p-1, -0x1.fffffffffc000p-68, 0x1.0000000000002p-1, -0x1.fffffe01f8004p-56, -0x1.ffffbffc80080p-22, 0x1.fe08000000000p-80}, {-0x1.00000ffffe000p-1, -0x1.fffffffffc000p-68, -0x1.0000000000002p-1, 0x1.fffffe01f8004p-56, -0x1.000007ffff001p+0, 0x1.ffdffe01f8008p-56}, {0x1.0000000000060p-1, 0x1.fffe3fff00000p-64, 0x1.0000000002000p-1, -0x1.ffe0002000000p-58, 0x1.0000000001030p+0, -0x1.f7e0072004000p-58}, {0x1.0000000000060p-1, 0x1.fffe3fff00000p-64, -0x1.0000000002000p-1, 0x1.ffe0002000000p-58, -0x1.f9fefc1003700p-41, -0x1.0000000000000p-96}, {-0x1.0000000000060p-1, -0x1.fffe3fff00000p-64, 0x1.0000000002000p-1, -0x1.ffe0002000000p-58, 0x1.f9fefc1003700p-41, 0x1.0000000000000p-96}, {-0x1.0000000000060p-1, -0x1.fffe3fff00000p-64, -0x1.0000000002000p-1, 0x1.ffe0002000000p-58, -0x1.0000000001030p+0, 0x1.f7e0072004000p-58}, {0x1.0003ffffffff8p-1, 0x1.ffffe07e00000p-75, 0x1.07ff000008000p-1, -0x1.e000020000000p-62, 0x1.0401800003ffcp+0, -0x1.dff00200fc000p-62}, {0x1.0003ffffffff8p-1, 0x1.ffffe07e00000p-75, -0x1.07ff000008000p-1, 0x1.e000020000000p-62, -0x1.fec0000200200p-7, 0x1.e01001ff03f00p-62}, {-0x1.0003ffffffff8p-1, -0x1.ffffe07e00000p-75, 0x1.07ff000008000p-1, -0x1.e000020000000p-62, 0x1.fec0000200200p-7, -0x1.e01001ff03f00p-62}, {-0x1.0003ffffffff8p-1, -0x1.ffffe07e00000p-75, -0x1.07ff000008000p-1, 0x1.e000020000000p-62, -0x1.0401800003ffcp+0, 0x1.dff00200fc000p-62}, }; const int numAccuracyTests = sizeof(accuracyTests) / sizeof(struct testVector); #include double testAccuracy() { int i; DD a, b, c, r; double worstUlps = 0.5; for (i=0; i worstUlps) { #ifdef PRINT_ACCURACY_INFORMATION printf("New worst rounding error for (%a,%a) + (%a,%a):\n", a.hi, a.lo, b.hi, b.lo); printf("\tExpected: (%a,%a)\n", r.hi, r.lo); printf("\tComputed: (%a,%a)\n", c.hi, c.lo); printf("\tError: %f ulps\n", ulpError); #endif worstUlps = ulpError; } } } return worstUlps; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ppc/floatunditf_test.c0000664000175000017500000000127212516462465031251 0ustar mwhudsonmwhudson#include #include COMPILER_RT_ABI long double __floatunditf(uint64_t); #include "floatunditf_test.h" #include "DD.h" int main(int argc, char *argv[]) { int i; DD expected; DD computed; for (i=0; i typedef union { long double ld; struct { double hi; double lo; }; } DD; #endif // __DD_HEADER golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/clzsi2_test.c0000664000175000017500000004007712516462465027364 0ustar mwhudsonmwhudson//===-- clzsi2_test.c - Test __clzsi2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __clzsi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: the number of leading 0-bits // Precondition: a != 0 COMPILER_RT_ABI si_int __clzsi2(si_int a); int test__clzsi2(si_int a, si_int expected) { si_int x = __clzsi2(a); if (x != expected) printf("error in __clzsi2(0x%X) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(si_int)*CHAR_BIT == 32] = {0}; int main() { // if (test__clzsi2(0x00000000, 32)) // undefined // return 1; if (test__clzsi2(0x00800000, 8)) return 1; if (test__clzsi2(0x01000000, 7)) return 1; if (test__clzsi2(0x02000000, 6)) return 1; if (test__clzsi2(0x03000000, 6)) return 1; if (test__clzsi2(0x04000000, 5)) return 1; if (test__clzsi2(0x05000000, 5)) return 1; if (test__clzsi2(0x06000000, 5)) return 1; if (test__clzsi2(0x07000000, 5)) return 1; if (test__clzsi2(0x08000000, 4)) return 1; if (test__clzsi2(0x09000000, 4)) return 1; if (test__clzsi2(0x0A000000, 4)) return 1; if (test__clzsi2(0x0B000000, 4)) return 1; if (test__clzsi2(0x0C000000, 4)) return 1; if (test__clzsi2(0x0D000000, 4)) return 1; if (test__clzsi2(0x0E000000, 4)) return 1; if (test__clzsi2(0x0F000000, 4)) return 1; if (test__clzsi2(0x10000000, 3)) return 1; if (test__clzsi2(0x11000000, 3)) return 1; if (test__clzsi2(0x12000000, 3)) return 1; if (test__clzsi2(0x13000000, 3)) return 1; if (test__clzsi2(0x14000000, 3)) return 1; if (test__clzsi2(0x15000000, 3)) return 1; if (test__clzsi2(0x16000000, 3)) return 1; if (test__clzsi2(0x17000000, 3)) return 1; if (test__clzsi2(0x18000000, 3)) return 1; if (test__clzsi2(0x19000000, 3)) return 1; if (test__clzsi2(0x1A000000, 3)) return 1; if (test__clzsi2(0x1B000000, 3)) return 1; if (test__clzsi2(0x1C000000, 3)) return 1; if (test__clzsi2(0x1D000000, 3)) return 1; if (test__clzsi2(0x1E000000, 3)) return 1; if (test__clzsi2(0x1F000000, 3)) return 1; if (test__clzsi2(0x20000000, 2)) return 1; if (test__clzsi2(0x21000000, 2)) return 1; if (test__clzsi2(0x22000000, 2)) return 1; if (test__clzsi2(0x23000000, 2)) return 1; if (test__clzsi2(0x24000000, 2)) return 1; if (test__clzsi2(0x25000000, 2)) return 1; if (test__clzsi2(0x26000000, 2)) return 1; if (test__clzsi2(0x27000000, 2)) return 1; if (test__clzsi2(0x28000000, 2)) return 1; if (test__clzsi2(0x29000000, 2)) return 1; if (test__clzsi2(0x2A000000, 2)) return 1; if (test__clzsi2(0x2B000000, 2)) return 1; if (test__clzsi2(0x2C000000, 2)) return 1; if (test__clzsi2(0x2D000000, 2)) return 1; if (test__clzsi2(0x2E000000, 2)) return 1; if (test__clzsi2(0x2F000000, 2)) return 1; if (test__clzsi2(0x30000000, 2)) return 1; if (test__clzsi2(0x31000000, 2)) return 1; if (test__clzsi2(0x32000000, 2)) return 1; if (test__clzsi2(0x33000000, 2)) return 1; if (test__clzsi2(0x34000000, 2)) return 1; if (test__clzsi2(0x35000000, 2)) return 1; if (test__clzsi2(0x36000000, 2)) return 1; if (test__clzsi2(0x37000000, 2)) return 1; if (test__clzsi2(0x38000000, 2)) return 1; if (test__clzsi2(0x39000000, 2)) return 1; if (test__clzsi2(0x3A000000, 2)) return 1; if (test__clzsi2(0x3B000000, 2)) return 1; if (test__clzsi2(0x3C000000, 2)) return 1; if (test__clzsi2(0x3D000000, 2)) return 1; if (test__clzsi2(0x3E000000, 2)) return 1; if (test__clzsi2(0x3F000000, 2)) return 1; if (test__clzsi2(0x40000000, 1)) return 1; if (test__clzsi2(0x41000000, 1)) return 1; if (test__clzsi2(0x42000000, 1)) return 1; if (test__clzsi2(0x43000000, 1)) return 1; if (test__clzsi2(0x44000000, 1)) return 1; if (test__clzsi2(0x45000000, 1)) return 1; if (test__clzsi2(0x46000000, 1)) return 1; if (test__clzsi2(0x47000000, 1)) return 1; if (test__clzsi2(0x48000000, 1)) return 1; if (test__clzsi2(0x49000000, 1)) return 1; if (test__clzsi2(0x4A000000, 1)) return 1; if (test__clzsi2(0x4B000000, 1)) return 1; if (test__clzsi2(0x4C000000, 1)) return 1; if (test__clzsi2(0x4D000000, 1)) return 1; if (test__clzsi2(0x4E000000, 1)) return 1; if (test__clzsi2(0x4F000000, 1)) return 1; if (test__clzsi2(0x50000000, 1)) return 1; if (test__clzsi2(0x51000000, 1)) return 1; if (test__clzsi2(0x52000000, 1)) return 1; if (test__clzsi2(0x53000000, 1)) return 1; if (test__clzsi2(0x54000000, 1)) return 1; if (test__clzsi2(0x55000000, 1)) return 1; if (test__clzsi2(0x56000000, 1)) return 1; if (test__clzsi2(0x57000000, 1)) return 1; if (test__clzsi2(0x58000000, 1)) return 1; if (test__clzsi2(0x59000000, 1)) return 1; if (test__clzsi2(0x5A000000, 1)) return 1; if (test__clzsi2(0x5B000000, 1)) return 1; if (test__clzsi2(0x5C000000, 1)) return 1; if (test__clzsi2(0x5D000000, 1)) return 1; if (test__clzsi2(0x5E000000, 1)) return 1; if (test__clzsi2(0x5F000000, 1)) return 1; if (test__clzsi2(0x60000000, 1)) return 1; if (test__clzsi2(0x61000000, 1)) return 1; if (test__clzsi2(0x62000000, 1)) return 1; if (test__clzsi2(0x63000000, 1)) return 1; if (test__clzsi2(0x64000000, 1)) return 1; if (test__clzsi2(0x65000000, 1)) return 1; if (test__clzsi2(0x66000000, 1)) return 1; if (test__clzsi2(0x67000000, 1)) return 1; if (test__clzsi2(0x68000000, 1)) return 1; if (test__clzsi2(0x69000000, 1)) return 1; if (test__clzsi2(0x6A000000, 1)) return 1; if (test__clzsi2(0x6B000000, 1)) return 1; if (test__clzsi2(0x6C000000, 1)) return 1; if (test__clzsi2(0x6D000000, 1)) return 1; if (test__clzsi2(0x6E000000, 1)) return 1; if (test__clzsi2(0x6F000000, 1)) return 1; if (test__clzsi2(0x70000000, 1)) return 1; if (test__clzsi2(0x71000000, 1)) return 1; if (test__clzsi2(0x72000000, 1)) return 1; if (test__clzsi2(0x73000000, 1)) return 1; if (test__clzsi2(0x74000000, 1)) return 1; if (test__clzsi2(0x75000000, 1)) return 1; if (test__clzsi2(0x76000000, 1)) return 1; if (test__clzsi2(0x77000000, 1)) return 1; if (test__clzsi2(0x78000000, 1)) return 1; if (test__clzsi2(0x79000000, 1)) return 1; if (test__clzsi2(0x7A000000, 1)) return 1; if (test__clzsi2(0x7B000000, 1)) return 1; if (test__clzsi2(0x7C000000, 1)) return 1; if (test__clzsi2(0x7D000000, 1)) return 1; if (test__clzsi2(0x7E000000, 1)) return 1; if (test__clzsi2(0x7F000000, 1)) return 1; if (test__clzsi2(0x80000000, 0)) return 1; if (test__clzsi2(0x81000000, 0)) return 1; if (test__clzsi2(0x82000000, 0)) return 1; if (test__clzsi2(0x83000000, 0)) return 1; if (test__clzsi2(0x84000000, 0)) return 1; if (test__clzsi2(0x85000000, 0)) return 1; if (test__clzsi2(0x86000000, 0)) return 1; if (test__clzsi2(0x87000000, 0)) return 1; if (test__clzsi2(0x88000000, 0)) return 1; if (test__clzsi2(0x89000000, 0)) return 1; if (test__clzsi2(0x8A000000, 0)) return 1; if (test__clzsi2(0x8B000000, 0)) return 1; if (test__clzsi2(0x8C000000, 0)) return 1; if (test__clzsi2(0x8D000000, 0)) return 1; if (test__clzsi2(0x8E000000, 0)) return 1; if (test__clzsi2(0x8F000000, 0)) return 1; if (test__clzsi2(0x90000000, 0)) return 1; if (test__clzsi2(0x91000000, 0)) return 1; if (test__clzsi2(0x92000000, 0)) return 1; if (test__clzsi2(0x93000000, 0)) return 1; if (test__clzsi2(0x94000000, 0)) return 1; if (test__clzsi2(0x95000000, 0)) return 1; if (test__clzsi2(0x96000000, 0)) return 1; if (test__clzsi2(0x97000000, 0)) return 1; if (test__clzsi2(0x98000000, 0)) return 1; if (test__clzsi2(0x99000000, 0)) return 1; if (test__clzsi2(0x9A000000, 0)) return 1; if (test__clzsi2(0x9B000000, 0)) return 1; if (test__clzsi2(0x9C000000, 0)) return 1; if (test__clzsi2(0x9D000000, 0)) return 1; if (test__clzsi2(0x9E000000, 0)) return 1; if (test__clzsi2(0x9F000000, 0)) return 1; if (test__clzsi2(0xA0000000, 0)) return 1; if (test__clzsi2(0xA1000000, 0)) return 1; if (test__clzsi2(0xA2000000, 0)) return 1; if (test__clzsi2(0xA3000000, 0)) return 1; if (test__clzsi2(0xA4000000, 0)) return 1; if (test__clzsi2(0xA5000000, 0)) return 1; if (test__clzsi2(0xA6000000, 0)) return 1; if (test__clzsi2(0xA7000000, 0)) return 1; if (test__clzsi2(0xA8000000, 0)) return 1; if (test__clzsi2(0xA9000000, 0)) return 1; if (test__clzsi2(0xAA000000, 0)) return 1; if (test__clzsi2(0xAB000000, 0)) return 1; if (test__clzsi2(0xAC000000, 0)) return 1; if (test__clzsi2(0xAD000000, 0)) return 1; if (test__clzsi2(0xAE000000, 0)) return 1; if (test__clzsi2(0xAF000000, 0)) return 1; if (test__clzsi2(0xB0000000, 0)) return 1; if (test__clzsi2(0xB1000000, 0)) return 1; if (test__clzsi2(0xB2000000, 0)) return 1; if (test__clzsi2(0xB3000000, 0)) return 1; if (test__clzsi2(0xB4000000, 0)) return 1; if (test__clzsi2(0xB5000000, 0)) return 1; if (test__clzsi2(0xB6000000, 0)) return 1; if (test__clzsi2(0xB7000000, 0)) return 1; if (test__clzsi2(0xB8000000, 0)) return 1; if (test__clzsi2(0xB9000000, 0)) return 1; if (test__clzsi2(0xBA000000, 0)) return 1; if (test__clzsi2(0xBB000000, 0)) return 1; if (test__clzsi2(0xBC000000, 0)) return 1; if (test__clzsi2(0xBD000000, 0)) return 1; if (test__clzsi2(0xBE000000, 0)) return 1; if (test__clzsi2(0xBF000000, 0)) return 1; if (test__clzsi2(0xC0000000, 0)) return 1; if (test__clzsi2(0xC1000000, 0)) return 1; if (test__clzsi2(0xC2000000, 0)) return 1; if (test__clzsi2(0xC3000000, 0)) return 1; if (test__clzsi2(0xC4000000, 0)) return 1; if (test__clzsi2(0xC5000000, 0)) return 1; if (test__clzsi2(0xC6000000, 0)) return 1; if (test__clzsi2(0xC7000000, 0)) return 1; if (test__clzsi2(0xC8000000, 0)) return 1; if (test__clzsi2(0xC9000000, 0)) return 1; if (test__clzsi2(0xCA000000, 0)) return 1; if (test__clzsi2(0xCB000000, 0)) return 1; if (test__clzsi2(0xCC000000, 0)) return 1; if (test__clzsi2(0xCD000000, 0)) return 1; if (test__clzsi2(0xCE000000, 0)) return 1; if (test__clzsi2(0xCF000000, 0)) return 1; if (test__clzsi2(0xD0000000, 0)) return 1; if (test__clzsi2(0xD1000000, 0)) return 1; if (test__clzsi2(0xD2000000, 0)) return 1; if (test__clzsi2(0xD3000000, 0)) return 1; if (test__clzsi2(0xD4000000, 0)) return 1; if (test__clzsi2(0xD5000000, 0)) return 1; if (test__clzsi2(0xD6000000, 0)) return 1; if (test__clzsi2(0xD7000000, 0)) return 1; if (test__clzsi2(0xD8000000, 0)) return 1; if (test__clzsi2(0xD9000000, 0)) return 1; if (test__clzsi2(0xDA000000, 0)) return 1; if (test__clzsi2(0xDB000000, 0)) return 1; if (test__clzsi2(0xDC000000, 0)) return 1; if (test__clzsi2(0xDD000000, 0)) return 1; if (test__clzsi2(0xDE000000, 0)) return 1; if (test__clzsi2(0xDF000000, 0)) return 1; if (test__clzsi2(0xE0000000, 0)) return 1; if (test__clzsi2(0xE1000000, 0)) return 1; if (test__clzsi2(0xE2000000, 0)) return 1; if (test__clzsi2(0xE3000000, 0)) return 1; if (test__clzsi2(0xE4000000, 0)) return 1; if (test__clzsi2(0xE5000000, 0)) return 1; if (test__clzsi2(0xE6000000, 0)) return 1; if (test__clzsi2(0xE7000000, 0)) return 1; if (test__clzsi2(0xE8000000, 0)) return 1; if (test__clzsi2(0xE9000000, 0)) return 1; if (test__clzsi2(0xEA000000, 0)) return 1; if (test__clzsi2(0xEB000000, 0)) return 1; if (test__clzsi2(0xEC000000, 0)) return 1; if (test__clzsi2(0xED000000, 0)) return 1; if (test__clzsi2(0xEE000000, 0)) return 1; if (test__clzsi2(0xEF000000, 0)) return 1; if (test__clzsi2(0xF0000000, 0)) return 1; if (test__clzsi2(0xF1000000, 0)) return 1; if (test__clzsi2(0xF2000000, 0)) return 1; if (test__clzsi2(0xF3000000, 0)) return 1; if (test__clzsi2(0xF4000000, 0)) return 1; if (test__clzsi2(0xF5000000, 0)) return 1; if (test__clzsi2(0xF6000000, 0)) return 1; if (test__clzsi2(0xF7000000, 0)) return 1; if (test__clzsi2(0xF8000000, 0)) return 1; if (test__clzsi2(0xF9000000, 0)) return 1; if (test__clzsi2(0xFA000000, 0)) return 1; if (test__clzsi2(0xFB000000, 0)) return 1; if (test__clzsi2(0xFC000000, 0)) return 1; if (test__clzsi2(0xFD000000, 0)) return 1; if (test__clzsi2(0xFE000000, 0)) return 1; if (test__clzsi2(0xFF000000, 0)) return 1; if (test__clzsi2(0x00000001, 31)) return 1; if (test__clzsi2(0x00000002, 30)) return 1; if (test__clzsi2(0x00000004, 29)) return 1; if (test__clzsi2(0x00000008, 28)) return 1; if (test__clzsi2(0x00000010, 27)) return 1; if (test__clzsi2(0x00000020, 26)) return 1; if (test__clzsi2(0x00000040, 25)) return 1; if (test__clzsi2(0x00000080, 24)) return 1; if (test__clzsi2(0x00000100, 23)) return 1; if (test__clzsi2(0x00000200, 22)) return 1; if (test__clzsi2(0x00000400, 21)) return 1; if (test__clzsi2(0x00000800, 20)) return 1; if (test__clzsi2(0x00001000, 19)) return 1; if (test__clzsi2(0x00002000, 18)) return 1; if (test__clzsi2(0x00004000, 17)) return 1; if (test__clzsi2(0x00008000, 16)) return 1; if (test__clzsi2(0x00010000, 15)) return 1; if (test__clzsi2(0x00020000, 14)) return 1; if (test__clzsi2(0x00040000, 13)) return 1; if (test__clzsi2(0x00080000, 12)) return 1; if (test__clzsi2(0x00100000, 11)) return 1; if (test__clzsi2(0x00200000, 10)) return 1; if (test__clzsi2(0x00400000, 9)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatsitf_test.c0000664000175000017500000000331412556674331030143 0ustar mwhudsonmwhudson//===--------------- floatsitf_test.c - Test __floatsitf ------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatsitf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" long COMPILER_RT_ABI double __floatsitf(int a); int test__floatsitf(int a, uint64_t expectedHi, uint64_t expectedLo) { long double x = __floatsitf(a); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret) { printf("error in test__floatsitf(%d) = %.20Lf, " "expected %.20Lf\n", a, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__floatsitf(0x80000000, UINT64_C(0xc01e000000000000), UINT64_C(0x0))) return 1; if (test__floatsitf(0x7fffffff, UINT64_C(0x401dfffffffc0000), UINT64_C(0x0))) return 1; if (test__floatsitf(0, UINT64_C(0x0), UINT64_C(0x0))) return 1; if (test__floatsitf(0xffffffff, UINT64_C(0xbfff000000000000), UINT64_C(0x0))) return 1; if (test__floatsitf(0x12345678, UINT64_C(0x401b234567800000), UINT64_C(0x0))) return 1; if (test__floatsitf(-0x12345678, UINT64_C(0xc01b234567800000), UINT64_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunssfsi_test.c0000664000175000017500000000527012616720672030351 0ustar mwhudsonmwhudson//===-- fixunssfsi_test.c - Test __fixunssfsi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunssfsi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a unsigned int, rounding toward zero. // Negative values all become zero. // Assumption: float is a IEEE 32 bit floating point type // su_int is a 32 bit integral type // value in float is representable in su_int or is negative // (no range checking performed) // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI su_int __fixunssfsi(float a); int test__fixunssfsi(float a, su_int expected) { su_int x = __fixunssfsi(a); if (x != expected) printf("error in __fixunssfsi(%A) = %X, expected %X\n", a, x, expected); return x != expected; } char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; int main() { if (test__fixunssfsi(0.0F, 0)) return 1; if (test__fixunssfsi(0.5F, 0)) return 1; if (test__fixunssfsi(0.99F, 0)) return 1; if (test__fixunssfsi(1.0F, 1)) return 1; if (test__fixunssfsi(1.5F, 1)) return 1; if (test__fixunssfsi(1.99F, 1)) return 1; if (test__fixunssfsi(2.0F, 2)) return 1; if (test__fixunssfsi(2.01F, 2)) return 1; if (test__fixunssfsi(-0.5F, 0)) return 1; if (test__fixunssfsi(-0.99F, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunssfsi(-1.0F, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunssfsi(-1.5F, 0)) return 1; if (test__fixunssfsi(-1.99F, 0)) return 1; if (test__fixunssfsi(-2.0F, 0)) return 1; if (test__fixunssfsi(-2.01F, 0)) return 1; #endif if (test__fixunssfsi(0x1.000000p+31F, 0x80000000)) return 1; if (test__fixunssfsi(0x1.000000p+32F, 0xFFFFFFFF)) return 1; if (test__fixunssfsi(0x1.FFFFFEp+31F, 0xFFFFFF00)) return 1; if (test__fixunssfsi(0x1.FFFFFEp+30F, 0x7FFFFF80)) return 1; if (test__fixunssfsi(0x1.FFFFFCp+30F, 0x7FFFFF00)) return 1; #if !TARGET_LIBGCC if (test__fixunssfsi(-0x1.FFFFFEp+30F, 0)) return 1; if (test__fixunssfsi(-0x1.FFFFFCp+30F, 0)) return 1; #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/subdf3vfp_test.c0000664000175000017500000000232512516462465030052 0ustar mwhudsonmwhudson//===-- subdf3vfp_test.c - Test __subdf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __subdf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #if __arm__ extern COMPILER_RT_ABI double __subdf3vfp(double a, double b); int test__subdf3vfp(double a, double b) { double actual = __subdf3vfp(a, b); double expected = a - b; if (actual != expected) printf("error in test__subdf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__subdf3vfp(1.0, 1.0)) return 1; if (test__subdf3vfp(1234.567, 765.4321)) return 1; if (test__subdf3vfp(-123.0, -678.0)) return 1; if (test__subdf3vfp(0.0, -0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/absvti2_test.c0000664000175000017500000000457312516462465027531 0ustar mwhudsonmwhudson//===-- absvti2_test.c - Test __absvti2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __absvti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: absolute value // Effects: aborts if abs(x) < 0 COMPILER_RT_ABI ti_int __absvti2(ti_int a); int test__absvti2(ti_int a) { ti_int x = __absvti2(a); ti_int expected = a; if (expected < 0) expected = -expected; if (x != expected || expected < 0) { twords at; at.all = a; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __absvti2(0x%llX%.16llX) = " "0x%llX%.16llX, expected positive 0x%llX%.16llX\n", at.s.high, at.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } #endif int main() { #ifdef CRT_HAS_128BIT // if (test__absvti2(make_ti(0x8000000000000000LL, 0))) // should abort // return 1; if (test__absvti2(0x0000000000000000LL)) return 1; if (test__absvti2(0x0000000000000001LL)) return 1; if (test__absvti2(0x0000000000000002LL)) return 1; if (test__absvti2(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFELL))) return 1; if (test__absvti2(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__absvti2(make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; if (test__absvti2(make_ti(0x8000000000000000LL, 0x0000000000000002LL))) return 1; if (test__absvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFELL))) return 1; if (test__absvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; int i; for (i = 0; i < 10000; ++i) if (test__absvti2(make_ti(((ti_int)rand() << 32) | rand(), ((ti_int)rand() << 32) | rand()))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatditf_test.c0000664000175000017500000000424012564633211030112 0ustar mwhudsonmwhudson//===-- floatditf_test.c - Test __floatditf -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatditf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" // Returns: long integer converted to long double COMPILER_RT_ABI long double __floatditf(long long a); int test__floatditf(long long a, uint64_t expectedHi, uint64_t expectedLo) { long double x = __floatditf(a); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret) printf("error in __floatditf(%Ld) = %.20Lf, " "expected %.20Lf\n", a, x, fromRep128(expectedHi, expectedLo)); return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__floatditf(0x7fffffffffffffff, UINT64_C(0x403dffffffffffff), UINT64_C(0xfffc000000000000))) return 1; if (test__floatditf(0x123456789abcdef1, UINT64_C(0x403b23456789abcd), UINT64_C(0xef10000000000000))) return 1; if (test__floatditf(0x2, UINT64_C(0x4000000000000000), UINT64_C(0x0))) return 1; if (test__floatditf(0x1, UINT64_C(0x3fff000000000000), UINT64_C(0x0))) return 1; if (test__floatditf(0x0, UINT64_C(0x0), UINT64_C(0x0))) return 1; if (test__floatditf(0xffffffffffffffff, UINT64_C(0xbfff000000000000), UINT64_C(0x0))) return 1; if (test__floatditf(0xfffffffffffffffe, UINT64_C(0xc000000000000000), UINT64_C(0x0))) return 1; if (test__floatditf(-0x123456789abcdef1, UINT64_C(0xc03b23456789abcd), UINT64_C(0xef10000000000000))) return 1; if (test__floatditf(0x8000000000000000, UINT64_C(0xc03e000000000000), UINT64_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/truncdfsf2vfp_test.c0000664000175000017500000000240612516462465030744 0ustar mwhudsonmwhudson//===-- truncdfsf2vfp_test.c - Test __truncdfsf2vfp -----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __truncdfsf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __truncdfsf2vfp(double a); #if __arm__ int test__truncdfsf2vfp(double a) { float actual = __truncdfsf2vfp(a); float expected = a; if (actual != expected) printf("error in test__truncdfsf2vfp(%f) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__truncdfsf2vfp(0.0)) return 1; if (test__truncdfsf2vfp(1.0)) return 1; if (test__truncdfsf2vfp(-1.0)) return 1; if (test__truncdfsf2vfp(3.1415926535)) return 1; if (test__truncdfsf2vfp(123.456)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunstfsi_test.c0000664000175000017500000000341112616720672030345 0ustar mwhudsonmwhudson//===--------------- fixunstfsi_test.c - Test __fixunstfsi ----------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunstfsi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" unsigned int __fixunstfsi(long double a); int test__fixunstfsi(long double a, unsigned int expected) { unsigned int x = __fixunstfsi(a); int ret = (x != expected); if (ret) { printf("error in test__fixunstfsi(%.20Lf) = %u, " "expected %u\n", a, x, expected); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__fixunstfsi(makeInf128(), UINT32_C(0xffffffff))) return 1; if (test__fixunstfsi(0, UINT32_C(0x0))) return 1; if (test__fixunstfsi(0x1.23456789abcdefp+5, UINT32_C(0x24))) return 1; if (test__fixunstfsi(0x1.23456789abcdefp-3, UINT32_C(0x0))) return 1; if (test__fixunstfsi(0x1.23456789abcdefp+20, UINT32_C(0x123456))) return 1; if (test__fixunstfsi(0x1.23456789abcdefp+40, UINT32_C(0xffffffff))) return 1; if (test__fixunstfsi(0x1.23456789abcdefp+256, UINT32_C(0xffffffff))) return 1; if (test__fixunstfsi(-0x1.23456789abcdefp+3, UINT32_C(0x0))) return 1; if (test__fixunstfsi(0x1.p+32, 0xFFFFFFFFLL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatdisf_test.c0000664000175000017500000000554512516462465030132 0ustar mwhudsonmwhudson//===-- floatdisf_test.c - Test __floatdisf -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatdisf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: convert a to a float, rounding toward even. // Assumption: float is a IEEE 32 bit floating point type // di_int is a 64 bit integral type // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI float __floatdisf(di_int a); int test__floatdisf(di_int a, float expected) { float x = __floatdisf(a); if (x != expected) printf("error in __floatdisf(%llX) = %a, expected %a\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; int main() { if (test__floatdisf(0, 0.0F)) return 1; if (test__floatdisf(1, 1.0F)) return 1; if (test__floatdisf(2, 2.0F)) return 1; if (test__floatdisf(-1, -1.0F)) return 1; if (test__floatdisf(-2, -2.0F)) return 1; if (test__floatdisf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62F)) return 1; if (test__floatdisf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62F)) return 1; if (test__floatdisf(0x8000008000000000LL, -0x1.FFFFFEp+62F)) return 1; if (test__floatdisf(0x8000010000000000LL, -0x1.FFFFFCp+62F)) return 1; if (test__floatdisf(0x8000000000000000LL, -0x1.000000p+63F)) return 1; if (test__floatdisf(0x8000000000000001LL, -0x1.000000p+63F)) return 1; if (test__floatdisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72EA000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72EB000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72EC000000LL, 0x1.FEDCBCp+50F)) return 1; if (test__floatdisf(0x0007FB72E8000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72E6000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72E7000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72E7FFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72E4000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatdisf(0x0007FB72E4000000LL, 0x1.FEDCB8p+50F)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/unorddf2vfp_test.c0000664000175000017500000000234311570537001030373 0ustar mwhudsonmwhudson//===-- unorddf2vfp_test.c - Test __unorddf2vfp ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __unorddf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __unorddf2vfp(double a, double b); #if __arm__ int test__unorddf2vfp(double a, double b) { int actual = __unorddf2vfp(a, b); int expected = (isnan(a) || isnan(b)) ? 1 : 0; if (actual != expected) printf("error in __unorddf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__unorddf2vfp(0.0, NAN)) return 1; if (test__unorddf2vfp(NAN, 1.0)) return 1; if (test__unorddf2vfp(NAN, NAN)) return 1; if (test__unorddf2vfp(1.0, 1.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixtfti_test.c0000664000175000017500000000503712616720672027626 0ustar mwhudsonmwhudson//===--------------- fixtfti_test.c - Test __fixtfti ----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixtfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" ti_int __fixtfti(long double a); int test__fixtfti(long double a, ti_int expected) { ti_int x = __fixtfti(a); int ret = (x != expected); if (ret) { twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in test__fixtfti(%.20Lf) = 0x%.16llX%.16llX, " "expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__fixtfti(makeInf128(), make_ti(0x7fffffffffffffffLL, 0xffffffffffffffffLL))) return 1; if (test__fixtfti(0, make_ti(0x0LL, 0x0LL))) return 1; if (test__fixtfti(0x1.23456789abcdefp+5L, make_ti(0x0LL, 0x24LL))) return 1; if (test__fixtfti(0x1.23456789abcdefp-3L, make_ti(0x0LL, 0x0LL))) return 1; if (test__fixtfti(0x1.23456789abcdef12345678p+20L, make_ti(0x0LL, 0x123456LL))) return 1; if (test__fixtfti(0x1.23456789abcdef123456789abcdep+112L, make_ti(0x123456789abcdLL, 0xef123456789abcdeLL))) return 1; if (test__fixtfti(-0x1.23456789abcdef123456789abcdep+112L, make_ti(0xFFFEDCBA98765432LL, 0x10EDCBA987654322LL))) return 1; if (test__fixtfti(0x1.23456789abcdefp+256L, make_ti(0x7fffffffffffffffLL, 0xffffffffffffffffLL))) return 1; if (test__fixtfti(-0x1.23456789abcdefp+20L, make_ti(0xffffffffffffffffLL, 0xffffffffffedcbaaLL))) return 1; if (test__fixtfti(-0x1.23456789abcdefp+256L, make_ti(0x8000000000000000LL, 0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/paritydi2_test.c0000664000175000017500000000243212516462465030056 0ustar mwhudsonmwhudson//===-- paritydi2_test.c - Test __paritydi2 -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __paritydi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: 1 if number of bits is odd else returns 0 COMPILER_RT_ABI si_int __paritydi2(di_int a); int naive_parity(di_int a) { int r = 0; for (; a; a = a & (a - 1)) r = ~r; return r & 1; } int test__paritydi2(di_int a) { si_int x = __paritydi2(a); si_int expected = naive_parity(a); if (x != expected) printf("error in __paritydi2(0x%llX) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(si_int)*CHAR_BIT == 32] = {0}; int main() { int i; for (i = 0; i < 10000; ++i) if (test__paritydi2(((di_int)rand() << 32) + rand())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gttf2_test.c0000664000175000017500000000500712316541140027160 0ustar mwhudsonmwhudson//===------------ gttf2_test.c - Test __gttf2------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __gttf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if __LP64__ && __LDBL_MANT_DIG__ == 113 #include "fp_test.h" int __gttf2(long double a, long double b); int test__gttf2(long double a, long double b, enum EXPECTED_RESULT expected) { int x = __gttf2(a, b); int ret = compareResultCMP(x, expected); if (ret){ printf("error in test__gttf2(%.20Lf, %.20Lf) = %d, " "expected %s\n", a, b, x, expectedStr(expected)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LP64__ && __LDBL_MANT_DIG__ == 113 // NaN if (test__gttf2(makeQNaN128(), 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // < // exp if (test__gttf2(0x1.234567890abcdef1234567890abcp-3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // mantissa if (test__gttf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.334567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // sign if (test__gttf2(-0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // == if (test__gttf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, LESS_EQUAL_0)) return 1; // > // exp if (test__gttf2(0x1.234567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp-3L, GREATER_0)) return 1; // mantissa if (test__gttf2(0x1.334567890abcdef1234567890abcp+3L, 0x1.234567890abcdef1234567890abcp+3L, GREATER_0)) return 1; // sign if (test__gttf2(0x1.234567890abcdef1234567890abcp+3L, -0x1.234567890abcdef1234567890abcp+3L, GREATER_0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsxfsi_test.c0000664000175000017500000000607512516462465030364 0ustar mwhudsonmwhudson//===-- fixunsxfsi_test.c - Test __fixunsxfsi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsxfsi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if HAS_80_BIT_LONG_DOUBLE // Returns: convert a to a unsigned int, rounding toward zero. // Negative values all become zero. // Assumption: long double is an intel 80 bit floating point type padded with 6 bytes // su_int is a 32 bit integral type // value in long double is representable in su_int or is negative // (no range checking performed) // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI su_int __fixunsxfsi(long double a); int test__fixunsxfsi(long double a, su_int expected) { su_int x = __fixunsxfsi(a); if (x != expected) printf("error in __fixunsxfsi(%LA) = %X, expected %X\n", a, x, expected); return x != expected; } char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if HAS_80_BIT_LONG_DOUBLE if (test__fixunsxfsi(0.0, 0)) return 1; if (test__fixunsxfsi(0.5, 0)) return 1; if (test__fixunsxfsi(0.99, 0)) return 1; if (test__fixunsxfsi(1.0, 1)) return 1; if (test__fixunsxfsi(1.5, 1)) return 1; if (test__fixunsxfsi(1.99, 1)) return 1; if (test__fixunsxfsi(2.0, 2)) return 1; if (test__fixunsxfsi(2.01, 2)) return 1; if (test__fixunsxfsi(-0.5, 0)) return 1; if (test__fixunsxfsi(-0.99, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunsxfsi(-1.0, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunsxfsi(-1.5, 0)) return 1; if (test__fixunsxfsi(-1.99, 0)) return 1; if (test__fixunsxfsi(-2.0, 0)) return 1; if (test__fixunsxfsi(-2.01, 0)) return 1; #endif if (test__fixunsxfsi(0x1.000000p+31, 0x80000000)) return 1; if (test__fixunsxfsi(0x1.FFFFFEp+31, 0xFFFFFF00)) return 1; if (test__fixunsxfsi(0x1.FFFFFEp+30, 0x7FFFFF80)) return 1; if (test__fixunsxfsi(0x1.FFFFFCp+30, 0x7FFFFF00)) return 1; #if !TARGET_LIBGCC if (test__fixunsxfsi(-0x1.FFFFFEp+30, 0)) return 1; if (test__fixunsxfsi(-0x1.FFFFFCp+30, 0)) return 1; #endif if (test__fixunsxfsi(0x1.FFFFFFFEp+31, 0xFFFFFFFF)) return 1; if (test__fixunsxfsi(0x1.FFFFFFFC00000p+30, 0x7FFFFFFF)) return 1; if (test__fixunsxfsi(0x1.FFFFFFF800000p+30, 0x7FFFFFFE)) return 1; #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ltdf2vfp_test.c0000664000175000017500000000237111570537001027664 0ustar mwhudsonmwhudson//===-- ltdf2vfp_test.c - Test __ltdf2vfp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ltdf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __ltdf2vfp(double a, double b); #if __arm__ int test__ltdf2vfp(double a, double b) { int actual = __ltdf2vfp(a, b); int expected = (a < b) ? 1 : 0; if (actual != expected) printf("error in __ltdf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__ltdf2vfp(0.0, 0.0)) return 1; if (test__ltdf2vfp(1.0, 1.0)) return 1; if (test__ltdf2vfp(-1.0, -1.0)) return 1; if (test__ltdf2vfp(HUGE_VAL, 1.0)) return 1; if (test__ltdf2vfp(1.0, HUGE_VAL)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/moddi3_test.c0000664000175000017500000000322712516462465027331 0ustar mwhudsonmwhudson//===-- moddi3_test.c - Test __moddi3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __moddi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a % b COMPILER_RT_ABI di_int __moddi3(di_int a, di_int b); int test__moddi3(di_int a, di_int b, di_int expected) { di_int x = __moddi3(a, b); if (x != expected) printf("error in __moddi3: %lld %% %lld = %lld, expected %lld\n", a, b, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__moddi3(0, 1, 0)) return 1; if (test__moddi3(0, -1, 0)) return 1; if (test__moddi3(5, 3, 2)) return 1; if (test__moddi3(5, -3, 2)) return 1; if (test__moddi3(-5, 3, -2)) return 1; if (test__moddi3(-5, -3, -2)) return 1; if (test__moddi3(0x8000000000000000LL, 1, 0x0LL)) return 1; if (test__moddi3(0x8000000000000000LL, -1, 0x0LL)) return 1; if (test__moddi3(0x8000000000000000LL, 2, 0x0LL)) return 1; if (test__moddi3(0x8000000000000000LL, -2, 0x0LL)) return 1; if (test__moddi3(0x8000000000000000LL, 3, -2)) return 1; if (test__moddi3(0x8000000000000000LL, -3, -2)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/muloti4_test.c0000664000175000017500000002451112516462465027546 0ustar mwhudsonmwhudson//===-- muloti4_test.c - Test __muloti4 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __muloti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a * b // Effects: sets overflow if a * b overflows COMPILER_RT_ABI ti_int __muloti4(ti_int a, ti_int b, int *overflow); int test__muloti4(ti_int a, ti_int b, ti_int expected, int expected_overflow) { int ov; ti_int x = __muloti4(a, b, &ov); if (ov != expected_overflow) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __muloti4: overflow=%d expected=%d\n", ov, expected_overflow); printf("error in __muloti4: 0x%.16llX%.16llX * 0x%.16llX%.16llX = " "0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); return 1; } else if (!expected_overflow && x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __muloti4: 0x%.16llX%.16llX * 0x%.16llX%.16llX = " "0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); return 1; } return 0; } #endif int main() { #ifdef CRT_HAS_128BIT if (test__muloti4(0, 0, 0, 0)) return 1; if (test__muloti4(0, 1, 0, 0)) return 1; if (test__muloti4(1, 0, 0, 0)) return 1; if (test__muloti4(0, 10, 0, 0)) return 1; if (test__muloti4(10, 0, 0, 0)) return 1; if (test__muloti4(0, 81985529216486895LL, 0, 0)) return 1; if (test__muloti4(81985529216486895LL, 0, 0, 0)) return 1; if (test__muloti4(0, -1, 0, 0)) return 1; if (test__muloti4(-1, 0, 0, 0)) return 1; if (test__muloti4(0, -10, 0, 0)) return 1; if (test__muloti4(-10, 0, 0, 0)) return 1; if (test__muloti4(0, -81985529216486895LL, 0, 0)) return 1; if (test__muloti4(-81985529216486895LL, 0, 0, 0)) return 1; if (test__muloti4(1, 1, 1, 0)) return 1; if (test__muloti4(1, 10, 10, 0)) return 1; if (test__muloti4(10, 1, 10, 0)) return 1; if (test__muloti4(1, 81985529216486895LL, 81985529216486895LL, 0)) return 1; if (test__muloti4(81985529216486895LL, 1, 81985529216486895LL, 0)) return 1; if (test__muloti4(1, -1, -1, 0)) return 1; if (test__muloti4(1, -10, -10, 0)) return 1; if (test__muloti4(-10, 1, -10, 0)) return 1; if (test__muloti4(1, -81985529216486895LL, -81985529216486895LL, 0)) return 1; if (test__muloti4(-81985529216486895LL, 1, -81985529216486895LL, 0)) return 1; if (test__muloti4(3037000499LL, 3037000499LL, 9223372030926249001LL, 0)) return 1; if (test__muloti4(-3037000499LL, 3037000499LL, -9223372030926249001LL, 0)) return 1; if (test__muloti4(3037000499LL, -3037000499LL, -9223372030926249001LL, 0)) return 1; if (test__muloti4(-3037000499LL, -3037000499LL, 9223372030926249001LL, 0)) return 1; if (test__muloti4(4398046511103LL, 2097152LL, 9223372036852678656LL, 0)) return 1; if (test__muloti4(-4398046511103LL, 2097152LL, -9223372036852678656LL, 0)) return 1; if (test__muloti4(4398046511103LL, -2097152LL, -9223372036852678656LL, 0)) return 1; if (test__muloti4(-4398046511103LL, -2097152LL, 9223372036852678656LL, 0)) return 1; if (test__muloti4(2097152LL, 4398046511103LL, 9223372036852678656LL, 0)) return 1; if (test__muloti4(-2097152LL, 4398046511103LL, -9223372036852678656LL, 0)) return 1; if (test__muloti4(2097152LL, -4398046511103LL, -9223372036852678656LL, 0)) return 1; if (test__muloti4(-2097152LL, -4398046511103LL, 9223372036852678656LL, 0)) return 1; if (test__muloti4(make_ti(0x00000000000000B5LL, 0x04F333F9DE5BE000LL), make_ti(0x0000000000000000LL, 0x00B504F333F9DE5BLL), make_ti(0x7FFFFFFFFFFFF328LL, 0xDF915DA296E8A000LL), 0)) return 1; if (test__muloti4(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), -2, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1)) return 1; if (test__muloti4(-2, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1)) return 1; if (test__muloti4(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), -1, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0)) return 1; if (test__muloti4(-1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0)) return 1; if (test__muloti4(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0, 0, 0)) return 1; if (test__muloti4(0, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0, 0)) return 1; if (test__muloti4(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0)) return 1; if (test__muloti4(1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0)) return 1; if (test__muloti4(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 2, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1)) return 1; if (test__muloti4(2, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000000LL), -2, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(-2, make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000000LL), -1, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(-1, make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000000LL), 0, 0, 0)) return 1; if (test__muloti4(0, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 0, 0)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 0)) return 1; if (test__muloti4(1, make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL), 0)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000000LL), 2, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(2, make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000001LL), -2, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1)) return 1; if (test__muloti4(-2, make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000001LL), -1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0)) return 1; if (test__muloti4(-1, make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0, 0, 0)) return 1; if (test__muloti4(0, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0, 0)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0)) return 1; if (test__muloti4(1, make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0)) return 1; if (test__muloti4(make_ti(0x8000000000000000LL, 0x0000000000000001LL), 2, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; if (test__muloti4(2, make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/subvti3_test.c0000664000175000017500000000477212516462465027557 0ustar mwhudsonmwhudson//===-- subvti3_test.c - Test __subvti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __subvti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: a - b // Effects: aborts if a - b overflows COMPILER_RT_ABI ti_int __subvti3(ti_int a, ti_int b); int test__subvti3(ti_int a, ti_int b) { ti_int x = __subvti3(a, b); ti_int expected = a - b; if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in test__subvsi3(0x%.16llX%.16llX, 0x%.16llX%.16llX) = " "0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } #endif int main() { #ifdef CRT_HAS_128BIT // test__subvti3(make_ti(0x8000000000000000LL, 0), 1); // should abort // test__subvti3(0, make_ti(0x8000000000000000LL, 0)); // should abort // test__subvti3(1, make_ti(0x8000000000000000LL, 0)); // should abort // test__subvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), -1); // should abort // test__subvti3(-2, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL)); // should abort if (test__subvti3(make_ti(0x8000000000000000LL, 0), -1)) return 1; if (test__subvti3(make_ti(0x8000000000000000LL, 0), 0)) return 1; if (test__subvti3(-1, make_ti(0x8000000000000000LL, 0))) return 1; if (test__subvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 1)) return 1; if (test__subvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0)) return 1; if (test__subvti3(1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__subvti3(0, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__subvti3(-1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunstfdi_test.c0000664000175000017500000000714512616720672030336 0ustar mwhudsonmwhudson//===-- fixunstfdi_test.c - Test __fixunstfdi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunstfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if _ARCH_PPC || __aarch64__ #include "int_lib.h" // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: long double is a 128 bit floating point type // du_int is a 64 bit integral type // value in long double is representable in du_int or is negative // (no range checking performed) COMPILER_RT_ABI du_int __fixunstfdi(long double a); int test__fixunstfdi(long double a, du_int expected) { du_int x = __fixunstfdi(a); if (x != expected) printf("error in __fixunstfdi(%LA) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(du_int) == 2*sizeof(su_int)] = {0}; char assumption_2[sizeof(du_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #if _ARCH_PPC || __aarch64__ if (test__fixunstfdi(0.0, 0)) return 1; if (test__fixunstfdi(0.5, 0)) return 1; if (test__fixunstfdi(0.99, 0)) return 1; if (test__fixunstfdi(1.0, 1)) return 1; if (test__fixunstfdi(1.5, 1)) return 1; if (test__fixunstfdi(1.99, 1)) return 1; if (test__fixunstfdi(2.0, 2)) return 1; if (test__fixunstfdi(2.01, 2)) return 1; if (test__fixunstfdi(-0.5, 0)) return 1; if (test__fixunstfdi(-0.99, 0)) return 1; if (test__fixunstfdi(-1.0, 0)) return 1; if (test__fixunstfdi(-1.5, 0)) return 1; if (test__fixunstfdi(-1.99, 0)) return 1; if (test__fixunstfdi(-2.0, 0)) return 1; if (test__fixunstfdi(-2.01, 0)) return 1; if (test__fixunstfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixunstfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixunstfdi(-0x1.FFFFFEp+62, 0)) return 1; if (test__fixunstfdi(-0x1.FFFFFCp+62, 0)) return 1; if (test__fixunstfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixunstfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0)) return 1; if (test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0)) return 1; if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL)) return 1; if (test__fixunstfdi(0x1.0000000000000002p+63L, 0x8000000000000001LL)) return 1; if (test__fixunstfdi(0x1.0000000000000000p+63L, 0x8000000000000000LL)) return 1; if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL)) return 1; if (test__fixunstfdi(0x1.p+64L, 0xFFFFFFFFFFFFFFFFLL)) return 1; if (test__fixunstfdi(-0x1.0000000000000000p+63L, 0)) return 1; if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0)) return 1; if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/modsi3_test.c0000664000175000017500000000273512516462465027353 0ustar mwhudsonmwhudson/* ===-- modsi3_test.c - Test __modsi3 -------------------------------------=== * * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file tests __modsi3 for the compiler_rt library. * * ===----------------------------------------------------------------------=== */ #include "int_lib.h" #include /* Returns: a % b */ COMPILER_RT_ABI si_int __modsi3(si_int a, si_int b); int test__modsi3(si_int a, si_int b, si_int expected) { si_int x = __modsi3(a, b); if (x != expected) fprintf(stderr, "error in __modsi3: %d %% %d = %d, expected %d\n", a, b, x, expected); return x != expected; } int main() { if (test__modsi3(0, 1, 0)) return 1; if (test__modsi3(0, -1, 0)) return 1; if (test__modsi3(5, 3, 2)) return 1; if (test__modsi3(5, -3, 2)) return 1; if (test__modsi3(-5, 3, -2)) return 1; if (test__modsi3(-5, -3, -2)) return 1; if (test__modsi3(0x80000000, 1, 0x0)) return 1; if (test__modsi3(0x80000000, 2, 0x0)) return 1; if (test__modsi3(0x80000000, -2, 0x0)) return 1; if (test__modsi3(0x80000000, 3, -2)) return 1; if (test__modsi3(0x80000000, -3, -2)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulvti3_test.c0000664000175000017500000002340212516462465027552 0ustar mwhudsonmwhudson//===-- mulvti3_test.c - Test __mulvti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulvti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a * b // Effects: aborts if a * b overflows COMPILER_RT_ABI ti_int __mulvti3(ti_int a, ti_int b); int test__mulvti3(ti_int a, ti_int b, ti_int expected) { ti_int x = __mulvti3(a, b); if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __mulvti3: 0x%.16llX%.16llX * 0x%.16llX%.16llX = " "0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } #endif int main() { #ifdef CRT_HAS_128BIT if (test__mulvti3(0, 0, 0)) return 1; if (test__mulvti3(0, 1, 0)) return 1; if (test__mulvti3(1, 0, 0)) return 1; if (test__mulvti3(0, 10, 0)) return 1; if (test__mulvti3(10, 0, 0)) return 1; if (test__mulvti3(0, 81985529216486895LL, 0)) return 1; if (test__mulvti3(81985529216486895LL, 0, 0)) return 1; if (test__mulvti3(0, -1, 0)) return 1; if (test__mulvti3(-1, 0, 0)) return 1; if (test__mulvti3(0, -10, 0)) return 1; if (test__mulvti3(-10, 0, 0)) return 1; if (test__mulvti3(0, -81985529216486895LL, 0)) return 1; if (test__mulvti3(-81985529216486895LL, 0, 0)) return 1; if (test__mulvti3(1, 1, 1)) return 1; if (test__mulvti3(1, 10, 10)) return 1; if (test__mulvti3(10, 1, 10)) return 1; if (test__mulvti3(1, 81985529216486895LL, 81985529216486895LL)) return 1; if (test__mulvti3(81985529216486895LL, 1, 81985529216486895LL)) return 1; if (test__mulvti3(1, -1, -1)) return 1; if (test__mulvti3(1, -10, -10)) return 1; if (test__mulvti3(-10, 1, -10)) return 1; if (test__mulvti3(1, -81985529216486895LL, -81985529216486895LL)) return 1; if (test__mulvti3(-81985529216486895LL, 1, -81985529216486895LL)) return 1; if (test__mulvti3(3037000499LL, 3037000499LL, 9223372030926249001LL)) return 1; if (test__mulvti3(-3037000499LL, 3037000499LL, -9223372030926249001LL)) return 1; if (test__mulvti3(3037000499LL, -3037000499LL, -9223372030926249001LL)) return 1; if (test__mulvti3(-3037000499LL, -3037000499LL, 9223372030926249001LL)) return 1; if (test__mulvti3(4398046511103LL, 2097152LL, 9223372036852678656LL)) return 1; if (test__mulvti3(-4398046511103LL, 2097152LL, -9223372036852678656LL)) return 1; if (test__mulvti3(4398046511103LL, -2097152LL, -9223372036852678656LL)) return 1; if (test__mulvti3(-4398046511103LL, -2097152LL, 9223372036852678656LL)) return 1; if (test__mulvti3(2097152LL, 4398046511103LL, 9223372036852678656LL)) return 1; if (test__mulvti3(-2097152LL, 4398046511103LL, -9223372036852678656LL)) return 1; if (test__mulvti3(2097152LL, -4398046511103LL, -9223372036852678656LL)) return 1; if (test__mulvti3(-2097152LL, -4398046511103LL, 9223372036852678656LL)) return 1; if (test__mulvti3(make_ti(0x00000000000000B5LL, 0x04F333F9DE5BE000LL), make_ti(0x0000000000000000LL, 0x00B504F333F9DE5BLL), make_ti(0x7FFFFFFFFFFFF328LL, 0xDF915DA296E8A000LL))) return 1; // if (test__mulvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), // -2, // make_ti(0x8000000000000000LL, 0x0000000000000001LL))) // abort // return 1; // if (test__mulvti3(-2, // make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), // make_ti(0x8000000000000000LL, 0x0000000000000001LL))) // abort // return 1; if (test__mulvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), -1, make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; if (test__mulvti3(-1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; if (test__mulvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0, 0)) return 1; if (test__mulvti3(0, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 0)) return 1; if (test__mulvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), 1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__mulvti3(1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; // if (test__mulvti3(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), // 2, // make_ti(0x8000000000000000LL, 0x0000000000000001LL))) // abort // return 1; // if (test__mulvti3(2, // make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL), // make_ti(0x8000000000000000LL, 0x0000000000000001LL))) // abort // return 1; // if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), // -2, // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; // if (test__mulvti3(-2, // make_ti(0x8000000000000000LL, 0x0000000000000000LL), // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; // if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), // -1, // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; // if (test__mulvti3(-1, // make_ti(0x8000000000000000LL, 0x0000000000000000LL), // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), 0, 0)) return 1; if (test__mulvti3(0, make_ti(0x8000000000000000LL, 0x0000000000000000LL), 0)) return 1; if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), 1, make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; if (test__mulvti3(1, make_ti(0x8000000000000000LL, 0x0000000000000000LL), make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; // if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000000LL), // 2, // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; // if (test__mulvti3(2, // make_ti(0x8000000000000000LL, 0x0000000000000000LL), // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; // if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000001LL), // -2, // make_ti(0x8000000000000000LL, 0x0000000000000001LL))) // abort // return 1; // if (test__mulvti3(-2, // make_ti(0x8000000000000000LL, 0x0000000000000001LL), // make_ti(0x8000000000000000LL, 0x0000000000000001LL))) // abort // return 1; if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000001LL), -1, make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__mulvti3(-1, make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0, 0)) return 1; if (test__mulvti3(0, make_ti(0x8000000000000000LL, 0x0000000000000001LL), 0)) return 1; if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000001LL), 1, make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; if (test__mulvti3(1, make_ti(0x8000000000000000LL, 0x0000000000000001LL), make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; // if (test__mulvti3(make_ti(0x8000000000000000LL, 0x0000000000000001LL), // 2, // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; // if (test__mulvti3(2, // make_ti(0x8000000000000000LL, 0x0000000000000001LL), // make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/0000775000175000017500000000000013040224623025503 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/aeabi_drsub_test.c0000664000175000017500000000240412564672431031164 0ustar mwhudsonmwhudson//===-- aeabi_drsub.c - Test __aeabi_drsub --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __aeabi_drsub for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #if __arm__ extern __attribute__((pcs("aapcs"))) double __aeabi_drsub(double a, double b); int test__aeabi_drsub(double a, double b, double expected) { double actual = __aeabi_drsub(a, b); if (actual != expected) printf("error in __aeabi_drsub(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__aeabi_drsub(1.0, 1.0, 0.0)) return 1; if (test__aeabi_drsub(1234.567, 765.4321, -469.134900)) return 1; if (test__aeabi_drsub(-123.0, -678.0, -555.0)) return 1; if (test__aeabi_drsub(0.0, -0.0, 0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c0000664000175000017500000000371512565470001031455 0ustar mwhudsonmwhudson//===-- aeabi_cdcmpeq.c - Test __aeabi_cdcmpeq ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __aeabi_cdcmpeq for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include #if __arm__ #include "call_apsr.h" extern __attribute__((pcs("aapcs"))) void __aeabi_cdcmpeq(double a, double b); int test__aeabi_cdcmpeq(double a, double b, int expected) { uint32_t cpsr_value = call_apsr_d(a, b, __aeabi_cdcmpeq); union cpsr cpsr = { .value = cpsr_value }; if (expected != cpsr.flags.z) { printf("error in __aeabi_cdcmpeq(%f, %f) => Z = %d, expected %d\n", a, b, cpsr.flags.z, expected); return 1; } return 0; } #endif int main() { #if __arm__ if (test__aeabi_cdcmpeq(1.0, 1.0, 1)) return 1; if (test__aeabi_cdcmpeq(1234.567, 765.4321, 0)) return 1; if (test__aeabi_cdcmpeq(-123.0, -678.0, 0)) return 1; if (test__aeabi_cdcmpeq(0.0, -0.0, 1)) return 1; if (test__aeabi_cdcmpeq(1.0, NAN, 0)) return 1; if (test__aeabi_cdcmpeq(NAN, 1.0, 0)) return 1; if (test__aeabi_cdcmpeq(NAN, NAN, 0)) return 1; if (test__aeabi_cdcmpeq(INFINITY, 1.0, 0)) return 1; if (test__aeabi_cdcmpeq(0.0, INFINITY, 0)) return 1; if (test__aeabi_cdcmpeq(-INFINITY, 0.0, 0)) return 1; if (test__aeabi_cdcmpeq(0.0, -INFINITY, 0)) return 1; if (test__aeabi_cdcmpeq(INFINITY, INFINITY, 1)) return 1; if (test__aeabi_cdcmpeq(-INFINITY, -INFINITY, 1)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/call_apsr.S0000664000175000017500000000225012565470001027572 0ustar mwhudsonmwhudson//===-- call_apsr.S - Helpers for ARM EABI floating point tests -----------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements helpers for ARM EABI floating point tests for the // compiler_rt library. // //===----------------------------------------------------------------------===// #include "../../../../lib/builtins/assembly.h" .syntax unified // __attribute__((pcs("aapcs"))) // int32_t call_apsr_d(double a, double b, void(*fn)(double, double)) { // fn(a, b); // return apsr; // } DEFINE_COMPILERRT_PRIVATE_FUNCTION(call_apsr_d) push {lr} ldr ip, [sp, #4] blx ip mrs r0, apsr pop {pc} END_COMPILERRT_FUNCTION(call_apsr_d) // __attribute__((pcs("aapcs"))) // int32_t call_apsr_f(float a, float b, void(*fn)(float, float)) { // fn(a, b); // return apsr; // } DEFINE_COMPILERRT_PRIVATE_FUNCTION(call_apsr_f) push {lr} blx r2 mrs r0, apsr pop {pc} END_COMPILERRT_FUNCTION(call_apsr_f) golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/call_apsr.h0000664000175000017500000000220312565470001027615 0ustar mwhudsonmwhudson//===-- call_apsr.h - Helpers for ARM EABI floating point tests -----------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file declares helpers for ARM EABI floating point tests for the // compiler_rt library. // //===----------------------------------------------------------------------===// #ifndef CALL_APSR_H #define CALL_APSR_H #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ #error big endian support not implemented #endif union cpsr { struct { uint32_t filler: 28; uint32_t v: 1; uint32_t c: 1; uint32_t z: 1; uint32_t n: 1; } flags; uint32_t value; }; extern __attribute__((pcs("aapcs"))) uint32_t call_apsr_f(float a, float b, __attribute__((pcs("aapcs"))) void (*fn)(float, float)); extern __attribute__((pcs("aapcs"))) uint32_t call_apsr_d(double a, double b, __attribute__((pcs("aapcs"))) void (*fn)(double, double)); #endif // CALL_APSR_H golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c0000664000175000017500000000371112565470001031453 0ustar mwhudsonmwhudson//===-- aeabi_cfcmpeq.c - Test __aeabi_cfcmpeq ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __aeabi_cfcmpeq for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include #if __arm__ #include "call_apsr.h" extern __attribute__((pcs("aapcs"))) void __aeabi_cfcmpeq(float a, float b); int test__aeabi_cfcmpeq(float a, float b, int expected) { uint32_t cpsr_value = call_apsr_f(a, b, __aeabi_cfcmpeq); union cpsr cpsr = { .value = cpsr_value }; if (expected != cpsr.flags.z) { printf("error in __aeabi_cfcmpeq(%f, %f) => Z = %d, expected %d\n", a, b, cpsr.flags.z, expected); return 1; } return 0; } #endif int main() { #if __arm__ if (test__aeabi_cfcmpeq(1.0, 1.0, 1)) return 1; if (test__aeabi_cfcmpeq(1234.567, 765.4321, 0)) return 1; if (test__aeabi_cfcmpeq(-123.0, -678.0, 0)) return 1; if (test__aeabi_cfcmpeq(0.0, -0.0, 1)) return 1; if (test__aeabi_cfcmpeq(1.0, NAN, 0)) return 1; if (test__aeabi_cfcmpeq(NAN, 1.0, 0)) return 1; if (test__aeabi_cfcmpeq(NAN, NAN, 0)) return 1; if (test__aeabi_cfcmpeq(INFINITY, 1.0, 0)) return 1; if (test__aeabi_cfcmpeq(0.0, INFINITY, 0)) return 1; if (test__aeabi_cfcmpeq(-INFINITY, 0.0, 0)) return 1; if (test__aeabi_cfcmpeq(0.0, -INFINITY, 0)) return 1; if (test__aeabi_cfcmpeq(INFINITY, INFINITY, 1)) return 1; if (test__aeabi_cfcmpeq(-INFINITY, -INFINITY, 1)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/aeabi_cdcmple_test.c0000664000175000017500000000524712565470001031452 0ustar mwhudsonmwhudson//===-- aeabi_cdcmple.c - Test __aeabi_cdcmple and __aeabi_cdrcmple -------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __aeabi_cdcmple and __aeabi_cdrcmple for the compiler_rt // library. // //===----------------------------------------------------------------------===// #include #include #include #include #include "call_apsr.h" #if __arm__ extern __attribute__((pcs("aapcs"))) void __aeabi_cdcmple(double a, double b); extern __attribute__((pcs("aapcs"))) void __aeabi_cdrcmple(double a, double b); int test__aeabi_cdcmple(double a, double b, int expected) { int32_t cpsr_value = call_apsr_d(a, b, __aeabi_cdcmple); int32_t r_cpsr_value = call_apsr_d(b, a, __aeabi_cdrcmple); if (cpsr_value != r_cpsr_value) { printf("error: __aeabi_cdcmple(%f, %f) != __aeabi_cdrcmple(%f, %f)\n", a, b, b, a); return 1; } int expected_z, expected_c; if (expected == -1) { expected_z = 0; expected_c = 0; } else if (expected == 0) { expected_z = 1; expected_c = 1; } else { // a or b is NaN, or a > b expected_z = 0; expected_c = 1; } union cpsr cpsr = { .value = cpsr_value }; if (expected_z != cpsr.flags.z || expected_c != cpsr.flags.c) { printf("error in __aeabi_cdcmple(%f, %f) => (Z = %d, C = %d), expected (Z = %d, C = %d)\n", a, b, cpsr.flags.z, cpsr.flags.c, expected_z, expected_c); return 1; } cpsr.value = r_cpsr_value; if (expected_z != cpsr.flags.z || expected_c != cpsr.flags.c) { printf("error in __aeabi_cdrcmple(%f, %f) => (Z = %d, C = %d), expected (Z = %d, C = %d)\n", a, b, cpsr.flags.z, cpsr.flags.c, expected_z, expected_c); return 1; } return 0; } #endif int main() { #if __arm__ if (test__aeabi_cdcmple(1.0, 1.0, 0)) return 1; if (test__aeabi_cdcmple(1234.567, 765.4321, 1)) return 1; if (test__aeabi_cdcmple(765.4321, 1234.567, -1)) return 1; if (test__aeabi_cdcmple(-123.0, -678.0, 1)) return 1; if (test__aeabi_cdcmple(-678.0, -123.0, -1)) return 1; if (test__aeabi_cdcmple(0.0, -0.0, 0)) return 1; if (test__aeabi_cdcmple(1.0, NAN, 1)) return 1; if (test__aeabi_cdcmple(NAN, 1.0, 1)) return 1; if (test__aeabi_cdcmple(NAN, NAN, 1)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/aeabi_frsub_test.c0000664000175000017500000000237512564672431031175 0ustar mwhudsonmwhudson//===-- aeabi_frsub.c - Test __aeabi_frsub --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __aeabi_frsub for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #if __arm__ extern __attribute__((pcs("aapcs"))) float __aeabi_frsub(float a, float b); int test__aeabi_frsub(float a, float b, float expected) { float actual = __aeabi_frsub(a, b); if (actual != expected) printf("error in __aeabi_frsub(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__aeabi_frsub(1.0, 1.0, 0.0)) return 1; if (test__aeabi_frsub(1234.567, 765.4321, -469.134900)) return 1; if (test__aeabi_frsub(-123.0, -678.0, -555.0)) return 1; if (test__aeabi_frsub(0.0, -0.0, 0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/arm/aeabi_cfcmple_test.c0000664000175000017500000000524112565470001031446 0ustar mwhudsonmwhudson//===-- aeabi_cfcmple.c - Test __aeabi_cfcmple and __aeabi_cfrcmple -------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __aeabi_cfcmple and __aeabi_cfrcmple for the compiler_rt // library. // //===----------------------------------------------------------------------===// #include #include #include #include #include "call_apsr.h" #if __arm__ extern __attribute__((pcs("aapcs"))) void __aeabi_cfcmple(float a, float b); extern __attribute__((pcs("aapcs"))) void __aeabi_cfrcmple(float a, float b); int test__aeabi_cfcmple(float a, float b, int expected) { int32_t cpsr_value = call_apsr_f(a, b, __aeabi_cfcmple); int32_t r_cpsr_value = call_apsr_f(b, a, __aeabi_cfrcmple); if (cpsr_value != r_cpsr_value) { printf("error: __aeabi_cfcmple(%f, %f) != __aeabi_cfrcmple(%f, %f)\n", a, b, b, a); return 1; } int expected_z, expected_c; if (expected == -1) { expected_z = 0; expected_c = 0; } else if (expected == 0) { expected_z = 1; expected_c = 1; } else { // a or b is NaN, or a > b expected_z = 0; expected_c = 1; } union cpsr cpsr = { .value = cpsr_value }; if (expected_z != cpsr.flags.z || expected_c != cpsr.flags.c) { printf("error in __aeabi_cfcmple(%f, %f) => (Z = %d, C = %d), expected (Z = %d, C = %d)\n", a, b, cpsr.flags.z, cpsr.flags.c, expected_z, expected_c); return 1; } cpsr.value = r_cpsr_value; if (expected_z != cpsr.flags.z || expected_c != cpsr.flags.c) { printf("error in __aeabi_cfrcmple(%f, %f) => (Z = %d, C = %d), expected (Z = %d, C = %d)\n", a, b, cpsr.flags.z, cpsr.flags.c, expected_z, expected_c); return 1; } return 0; } #endif int main() { #if __arm__ if (test__aeabi_cfcmple(1.0, 1.0, 0)) return 1; if (test__aeabi_cfcmple(1234.567, 765.4321, 1)) return 1; if (test__aeabi_cfcmple(765.4321, 1234.567, -1)) return 1; if (test__aeabi_cfcmple(-123.0, -678.0, 1)) return 1; if (test__aeabi_cfcmple(-678.0, -123.0, -1)) return 1; if (test__aeabi_cfcmple(0.0, -0.0, 0)) return 1; if (test__aeabi_cfcmple(1.0, NAN, 1)) return 1; if (test__aeabi_cfcmple(NAN, 1.0, 1)) return 1; if (test__aeabi_cfcmple(NAN, NAN, 1)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ctzsi2_test.c0000664000175000017500000003641112516462465027371 0ustar mwhudsonmwhudson//===-- ctzsi2_test.c - Test __ctzsi2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ctzsi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: the number of trailing 0-bits // Precondition: a != 0 COMPILER_RT_ABI si_int __ctzsi2(si_int a); int test__ctzsi2(si_int a, si_int expected) { si_int x = __ctzsi2(a); if (x != expected) printf("error in __ctzsi2(0x%X) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(si_int)*CHAR_BIT == 32] = {0}; int main() { // if (test__ctzsi2(0x00000000, 32)) // undefined // return 1; if (test__ctzsi2(0x00000001, 0)) return 1; if (test__ctzsi2(0x00000002, 1)) return 1; if (test__ctzsi2(0x00000003, 0)) return 1; if (test__ctzsi2(0x00000004, 2)) return 1; if (test__ctzsi2(0x00000005, 0)) return 1; if (test__ctzsi2(0x00000006, 1)) return 1; if (test__ctzsi2(0x00000007, 0)) return 1; if (test__ctzsi2(0x00000008, 3)) return 1; if (test__ctzsi2(0x00000009, 0)) return 1; if (test__ctzsi2(0x0000000A, 1)) return 1; if (test__ctzsi2(0x0000000B, 0)) return 1; if (test__ctzsi2(0x0000000C, 2)) return 1; if (test__ctzsi2(0x0000000D, 0)) return 1; if (test__ctzsi2(0x0000000E, 1)) return 1; if (test__ctzsi2(0x0000000F, 0)) return 1; if (test__ctzsi2(0x00000010, 4)) return 1; if (test__ctzsi2(0x00000012, 1)) return 1; if (test__ctzsi2(0x00000013, 0)) return 1; if (test__ctzsi2(0x00000014, 2)) return 1; if (test__ctzsi2(0x00000015, 0)) return 1; if (test__ctzsi2(0x00000016, 1)) return 1; if (test__ctzsi2(0x00000017, 0)) return 1; if (test__ctzsi2(0x00000018, 3)) return 1; if (test__ctzsi2(0x00000019, 0)) return 1; if (test__ctzsi2(0x0000001A, 1)) return 1; if (test__ctzsi2(0x0000001B, 0)) return 1; if (test__ctzsi2(0x0000001C, 2)) return 1; if (test__ctzsi2(0x0000001D, 0)) return 1; if (test__ctzsi2(0x0000001E, 1)) return 1; if (test__ctzsi2(0x0000001F, 0)) return 1; if (test__ctzsi2(0x00000020, 5)) return 1; if (test__ctzsi2(0x00000022, 1)) return 1; if (test__ctzsi2(0x00000023, 0)) return 1; if (test__ctzsi2(0x00000024, 2)) return 1; if (test__ctzsi2(0x00000025, 0)) return 1; if (test__ctzsi2(0x00000026, 1)) return 1; if (test__ctzsi2(0x00000027, 0)) return 1; if (test__ctzsi2(0x00000028, 3)) return 1; if (test__ctzsi2(0x00000029, 0)) return 1; if (test__ctzsi2(0x0000002A, 1)) return 1; if (test__ctzsi2(0x0000002B, 0)) return 1; if (test__ctzsi2(0x0000002C, 2)) return 1; if (test__ctzsi2(0x0000002D, 0)) return 1; if (test__ctzsi2(0x0000002E, 1)) return 1; if (test__ctzsi2(0x0000002F, 0)) return 1; if (test__ctzsi2(0x00000030, 4)) return 1; if (test__ctzsi2(0x00000032, 1)) return 1; if (test__ctzsi2(0x00000033, 0)) return 1; if (test__ctzsi2(0x00000034, 2)) return 1; if (test__ctzsi2(0x00000035, 0)) return 1; if (test__ctzsi2(0x00000036, 1)) return 1; if (test__ctzsi2(0x00000037, 0)) return 1; if (test__ctzsi2(0x00000038, 3)) return 1; if (test__ctzsi2(0x00000039, 0)) return 1; if (test__ctzsi2(0x0000003A, 1)) return 1; if (test__ctzsi2(0x0000003B, 0)) return 1; if (test__ctzsi2(0x0000003C, 2)) return 1; if (test__ctzsi2(0x0000003D, 0)) return 1; if (test__ctzsi2(0x0000003E, 1)) return 1; if (test__ctzsi2(0x0000003F, 0)) return 1; if (test__ctzsi2(0x00000040, 6)) return 1; if (test__ctzsi2(0x00000042, 1)) return 1; if (test__ctzsi2(0x00000043, 0)) return 1; if (test__ctzsi2(0x00000044, 2)) return 1; if (test__ctzsi2(0x00000045, 0)) return 1; if (test__ctzsi2(0x00000046, 1)) return 1; if (test__ctzsi2(0x00000047, 0)) return 1; if (test__ctzsi2(0x00000048, 3)) return 1; if (test__ctzsi2(0x00000049, 0)) return 1; if (test__ctzsi2(0x0000004A, 1)) return 1; if (test__ctzsi2(0x0000004B, 0)) return 1; if (test__ctzsi2(0x0000004C, 2)) return 1; if (test__ctzsi2(0x0000004D, 0)) return 1; if (test__ctzsi2(0x0000004E, 1)) return 1; if (test__ctzsi2(0x0000004F, 0)) return 1; if (test__ctzsi2(0x00000050, 4)) return 1; if (test__ctzsi2(0x00000052, 1)) return 1; if (test__ctzsi2(0x00000053, 0)) return 1; if (test__ctzsi2(0x00000054, 2)) return 1; if (test__ctzsi2(0x00000055, 0)) return 1; if (test__ctzsi2(0x00000056, 1)) return 1; if (test__ctzsi2(0x00000057, 0)) return 1; if (test__ctzsi2(0x00000058, 3)) return 1; if (test__ctzsi2(0x00000059, 0)) return 1; if (test__ctzsi2(0x0000005A, 1)) return 1; if (test__ctzsi2(0x0000005B, 0)) return 1; if (test__ctzsi2(0x0000005C, 2)) return 1; if (test__ctzsi2(0x0000005D, 0)) return 1; if (test__ctzsi2(0x0000005E, 1)) return 1; if (test__ctzsi2(0x0000005F, 0)) return 1; if (test__ctzsi2(0x00000060, 5)) return 1; if (test__ctzsi2(0x00000062, 1)) return 1; if (test__ctzsi2(0x00000063, 0)) return 1; if (test__ctzsi2(0x00000064, 2)) return 1; if (test__ctzsi2(0x00000065, 0)) return 1; if (test__ctzsi2(0x00000066, 1)) return 1; if (test__ctzsi2(0x00000067, 0)) return 1; if (test__ctzsi2(0x00000068, 3)) return 1; if (test__ctzsi2(0x00000069, 0)) return 1; if (test__ctzsi2(0x0000006A, 1)) return 1; if (test__ctzsi2(0x0000006B, 0)) return 1; if (test__ctzsi2(0x0000006C, 2)) return 1; if (test__ctzsi2(0x0000006D, 0)) return 1; if (test__ctzsi2(0x0000006E, 1)) return 1; if (test__ctzsi2(0x0000006F, 0)) return 1; if (test__ctzsi2(0x00000070, 4)) return 1; if (test__ctzsi2(0x00000072, 1)) return 1; if (test__ctzsi2(0x00000073, 0)) return 1; if (test__ctzsi2(0x00000074, 2)) return 1; if (test__ctzsi2(0x00000075, 0)) return 1; if (test__ctzsi2(0x00000076, 1)) return 1; if (test__ctzsi2(0x00000077, 0)) return 1; if (test__ctzsi2(0x00000078, 3)) return 1; if (test__ctzsi2(0x00000079, 0)) return 1; if (test__ctzsi2(0x0000007A, 1)) return 1; if (test__ctzsi2(0x0000007B, 0)) return 1; if (test__ctzsi2(0x0000007C, 2)) return 1; if (test__ctzsi2(0x0000007D, 0)) return 1; if (test__ctzsi2(0x0000007E, 1)) return 1; if (test__ctzsi2(0x0000007F, 0)) return 1; if (test__ctzsi2(0x00000080, 7)) return 1; if (test__ctzsi2(0x00000082, 1)) return 1; if (test__ctzsi2(0x00000083, 0)) return 1; if (test__ctzsi2(0x00000084, 2)) return 1; if (test__ctzsi2(0x00000085, 0)) return 1; if (test__ctzsi2(0x00000086, 1)) return 1; if (test__ctzsi2(0x00000087, 0)) return 1; if (test__ctzsi2(0x00000088, 3)) return 1; if (test__ctzsi2(0x00000089, 0)) return 1; if (test__ctzsi2(0x0000008A, 1)) return 1; if (test__ctzsi2(0x0000008B, 0)) return 1; if (test__ctzsi2(0x0000008C, 2)) return 1; if (test__ctzsi2(0x0000008D, 0)) return 1; if (test__ctzsi2(0x0000008E, 1)) return 1; if (test__ctzsi2(0x0000008F, 0)) return 1; if (test__ctzsi2(0x00000090, 4)) return 1; if (test__ctzsi2(0x00000092, 1)) return 1; if (test__ctzsi2(0x00000093, 0)) return 1; if (test__ctzsi2(0x00000094, 2)) return 1; if (test__ctzsi2(0x00000095, 0)) return 1; if (test__ctzsi2(0x00000096, 1)) return 1; if (test__ctzsi2(0x00000097, 0)) return 1; if (test__ctzsi2(0x00000098, 3)) return 1; if (test__ctzsi2(0x00000099, 0)) return 1; if (test__ctzsi2(0x0000009A, 1)) return 1; if (test__ctzsi2(0x0000009B, 0)) return 1; if (test__ctzsi2(0x0000009C, 2)) return 1; if (test__ctzsi2(0x0000009D, 0)) return 1; if (test__ctzsi2(0x0000009E, 1)) return 1; if (test__ctzsi2(0x0000009F, 0)) return 1; if (test__ctzsi2(0x000000A0, 5)) return 1; if (test__ctzsi2(0x000000A2, 1)) return 1; if (test__ctzsi2(0x000000A3, 0)) return 1; if (test__ctzsi2(0x000000A4, 2)) return 1; if (test__ctzsi2(0x000000A5, 0)) return 1; if (test__ctzsi2(0x000000A6, 1)) return 1; if (test__ctzsi2(0x000000A7, 0)) return 1; if (test__ctzsi2(0x000000A8, 3)) return 1; if (test__ctzsi2(0x000000A9, 0)) return 1; if (test__ctzsi2(0x000000AA, 1)) return 1; if (test__ctzsi2(0x000000AB, 0)) return 1; if (test__ctzsi2(0x000000AC, 2)) return 1; if (test__ctzsi2(0x000000AD, 0)) return 1; if (test__ctzsi2(0x000000AE, 1)) return 1; if (test__ctzsi2(0x000000AF, 0)) return 1; if (test__ctzsi2(0x000000B0, 4)) return 1; if (test__ctzsi2(0x000000B2, 1)) return 1; if (test__ctzsi2(0x000000B3, 0)) return 1; if (test__ctzsi2(0x000000B4, 2)) return 1; if (test__ctzsi2(0x000000B5, 0)) return 1; if (test__ctzsi2(0x000000B6, 1)) return 1; if (test__ctzsi2(0x000000B7, 0)) return 1; if (test__ctzsi2(0x000000B8, 3)) return 1; if (test__ctzsi2(0x000000B9, 0)) return 1; if (test__ctzsi2(0x000000BA, 1)) return 1; if (test__ctzsi2(0x000000BB, 0)) return 1; if (test__ctzsi2(0x000000BC, 2)) return 1; if (test__ctzsi2(0x000000BD, 0)) return 1; if (test__ctzsi2(0x000000BE, 1)) return 1; if (test__ctzsi2(0x000000BF, 0)) return 1; if (test__ctzsi2(0x000000C0, 6)) return 1; if (test__ctzsi2(0x000000C2, 1)) return 1; if (test__ctzsi2(0x000000C3, 0)) return 1; if (test__ctzsi2(0x000000C4, 2)) return 1; if (test__ctzsi2(0x000000C5, 0)) return 1; if (test__ctzsi2(0x000000C6, 1)) return 1; if (test__ctzsi2(0x000000C7, 0)) return 1; if (test__ctzsi2(0x000000C8, 3)) return 1; if (test__ctzsi2(0x000000C9, 0)) return 1; if (test__ctzsi2(0x000000CA, 1)) return 1; if (test__ctzsi2(0x000000CB, 0)) return 1; if (test__ctzsi2(0x000000CC, 2)) return 1; if (test__ctzsi2(0x000000CD, 0)) return 1; if (test__ctzsi2(0x000000CE, 1)) return 1; if (test__ctzsi2(0x000000CF, 0)) return 1; if (test__ctzsi2(0x000000D0, 4)) return 1; if (test__ctzsi2(0x000000D2, 1)) return 1; if (test__ctzsi2(0x000000D3, 0)) return 1; if (test__ctzsi2(0x000000D4, 2)) return 1; if (test__ctzsi2(0x000000D5, 0)) return 1; if (test__ctzsi2(0x000000D6, 1)) return 1; if (test__ctzsi2(0x000000D7, 0)) return 1; if (test__ctzsi2(0x000000D8, 3)) return 1; if (test__ctzsi2(0x000000D9, 0)) return 1; if (test__ctzsi2(0x000000DA, 1)) return 1; if (test__ctzsi2(0x000000DB, 0)) return 1; if (test__ctzsi2(0x000000DC, 2)) return 1; if (test__ctzsi2(0x000000DD, 0)) return 1; if (test__ctzsi2(0x000000DE, 1)) return 1; if (test__ctzsi2(0x000000DF, 0)) return 1; if (test__ctzsi2(0x000000E0, 5)) return 1; if (test__ctzsi2(0x000000E2, 1)) return 1; if (test__ctzsi2(0x000000E3, 0)) return 1; if (test__ctzsi2(0x000000E4, 2)) return 1; if (test__ctzsi2(0x000000E5, 0)) return 1; if (test__ctzsi2(0x000000E6, 1)) return 1; if (test__ctzsi2(0x000000E7, 0)) return 1; if (test__ctzsi2(0x000000E8, 3)) return 1; if (test__ctzsi2(0x000000E9, 0)) return 1; if (test__ctzsi2(0x000000EA, 1)) return 1; if (test__ctzsi2(0x000000EB, 0)) return 1; if (test__ctzsi2(0x000000EC, 2)) return 1; if (test__ctzsi2(0x000000ED, 0)) return 1; if (test__ctzsi2(0x000000EE, 1)) return 1; if (test__ctzsi2(0x000000EF, 0)) return 1; if (test__ctzsi2(0x000000F0, 4)) return 1; if (test__ctzsi2(0x000000F2, 1)) return 1; if (test__ctzsi2(0x000000F3, 0)) return 1; if (test__ctzsi2(0x000000F4, 2)) return 1; if (test__ctzsi2(0x000000F5, 0)) return 1; if (test__ctzsi2(0x000000F6, 1)) return 1; if (test__ctzsi2(0x000000F7, 0)) return 1; if (test__ctzsi2(0x000000F8, 3)) return 1; if (test__ctzsi2(0x000000F9, 0)) return 1; if (test__ctzsi2(0x000000FA, 1)) return 1; if (test__ctzsi2(0x000000FB, 0)) return 1; if (test__ctzsi2(0x000000FC, 2)) return 1; if (test__ctzsi2(0x000000FD, 0)) return 1; if (test__ctzsi2(0x000000FE, 1)) return 1; if (test__ctzsi2(0x000000FF, 0)) return 1; if (test__ctzsi2(0x00000100, 8)) return 1; if (test__ctzsi2(0x00000200, 9)) return 1; if (test__ctzsi2(0x00000400, 10)) return 1; if (test__ctzsi2(0x00000800, 11)) return 1; if (test__ctzsi2(0x00001000, 12)) return 1; if (test__ctzsi2(0x00002000, 13)) return 1; if (test__ctzsi2(0x00004000, 14)) return 1; if (test__ctzsi2(0x00008000, 15)) return 1; if (test__ctzsi2(0x00010000, 16)) return 1; if (test__ctzsi2(0x00020000, 17)) return 1; if (test__ctzsi2(0x00040000, 18)) return 1; if (test__ctzsi2(0x00080000, 19)) return 1; if (test__ctzsi2(0x00100000, 20)) return 1; if (test__ctzsi2(0x00200000, 21)) return 1; if (test__ctzsi2(0x00400000, 22)) return 1; if (test__ctzsi2(0x00800000, 23)) return 1; if (test__ctzsi2(0x01000000, 24)) return 1; if (test__ctzsi2(0x02000000, 25)) return 1; if (test__ctzsi2(0x04000000, 26)) return 1; if (test__ctzsi2(0x08000000, 27)) return 1; if (test__ctzsi2(0x10000000, 28)) return 1; if (test__ctzsi2(0x20000000, 29)) return 1; if (test__ctzsi2(0x40000000, 30)) return 1; if (test__ctzsi2(0x80000000, 31)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsxfti_test.c0000664000175000017500000001063012516462465030355 0ustar mwhudsonmwhudson//===-- fixunsxfti_test.c - Test __fixunsxfti -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsxfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: long double is an intel 80 bit floating point type padded with 6 bytes // tu_int is a 64 bit integral type // value in long double is representable in tu_int or is negative // (no range checking performed) // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI tu_int __fixunsxfti(long double a); int test__fixunsxfti(long double a, tu_int expected) { tu_int x = __fixunsxfti(a); if (x != expected) { utwords xt; xt.all = x; utwords expectedt; expectedt.all = expected; printf("error in __fixunsxfti(%LA) = 0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(tu_int) == 2*sizeof(du_int)] = {0}; char assumption_2[sizeof(tu_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__fixunsxfti(0.0, 0)) return 1; if (test__fixunsxfti(0.5, 0)) return 1; if (test__fixunsxfti(0.99, 0)) return 1; if (test__fixunsxfti(1.0, 1)) return 1; if (test__fixunsxfti(1.5, 1)) return 1; if (test__fixunsxfti(1.99, 1)) return 1; if (test__fixunsxfti(2.0, 2)) return 1; if (test__fixunsxfti(2.01, 2)) return 1; if (test__fixunsxfti(-0.5, 0)) return 1; if (test__fixunsxfti(-0.99, 0)) return 1; if (test__fixunsxfti(-1.0, 0)) return 1; if (test__fixunsxfti(-1.5, 0)) return 1; if (test__fixunsxfti(-1.99, 0)) return 1; if (test__fixunsxfti(-2.0, 0)) return 1; if (test__fixunsxfti(-2.01, 0)) return 1; if (test__fixunsxfti(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixunsxfti(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixunsxfti(-0x1.FFFFFEp+62, 0)) return 1; if (test__fixunsxfti(-0x1.FFFFFCp+62, 0)) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixunsxfti(-0x1.FFFFFFFFFFFFFp+62, 0)) return 1; if (test__fixunsxfti(-0x1.FFFFFFFFFFFFEp+62, 0)) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL)) return 1; if (test__fixunsxfti(0x1.0000000000000002p+63L, 0x8000000000000001LL)) return 1; if (test__fixunsxfti(0x1.0000000000000000p+63L, 0x8000000000000000LL)) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL)) return 1; if (test__fixunsxfti(-0x1.0000000000000000p+63L, 0)) return 1; if (test__fixunsxfti(-0x1.FFFFFFFFFFFFFFFCp+62L, 0)) return 1; if (test__fixunsxfti(-0x1.FFFFFFFFFFFFFFF8p+62L, 0)) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFFFEp+127L, make_ti(0xFFFFFFFFFFFFFFFFLL, 0))) return 1; if (test__fixunsxfti(0x1.0000000000000002p+127L, make_ti(0x8000000000000001LL, 0))) return 1; if (test__fixunsxfti(0x1.0000000000000000p+127L, make_ti(0x8000000000000000LL, 0))) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFFFCp+126L, make_ti(0x7FFFFFFFFFFFFFFFLL, 0))) return 1; if (test__fixunsxfti(0x1.FFFFFFFFFFFFFFF8p+126L, make_ti(0x7FFFFFFFFFFFFFFELL, 0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/absvdi2_test.c0000664000175000017500000000340112516462465027476 0ustar mwhudsonmwhudson//===-- absvdi2_test.c - Test __absvdi2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __absvdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: absolute value // Effects: aborts if abs(x) < 0 COMPILER_RT_ABI di_int __absvdi2(di_int a); int test__absvdi2(di_int a) { di_int x = __absvdi2(a); di_int expected = a; if (expected < 0) expected = -expected; if (x != expected || expected < 0) printf("error in __absvdi2(0x%llX) = %lld, expected positive %lld\n", a, x, expected); return x != expected; } int main() { // if (test__absvdi2(0x8000000000000000LL)) // should abort // return 1; if (test__absvdi2(0x0000000000000000LL)) return 1; if (test__absvdi2(0x0000000000000001LL)) return 1; if (test__absvdi2(0x0000000000000002LL)) return 1; if (test__absvdi2(0x7FFFFFFFFFFFFFFELL)) return 1; if (test__absvdi2(0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__absvdi2(0x8000000000000001LL)) return 1; if (test__absvdi2(0x8000000000000002LL)) return 1; if (test__absvdi2(0xFFFFFFFFFFFFFFFELL)) return 1; if (test__absvdi2(0xFFFFFFFFFFFFFFFFLL)) return 1; int i; for (i = 0; i < 10000; ++i) if (test__absvdi2(((di_int)rand() << 32) | rand())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floattisf_test.c0000664000175000017500000001040612516462465030142 0ustar mwhudsonmwhudson//===-- floattisf_test.c - Test __floattisf -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floattisf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: convert a to a float, rounding toward even. // Assumption: float is a IEEE 32 bit floating point type // ti_int is a 64 bit integral type // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI float __floattisf(ti_int a); int test__floattisf(ti_int a, float expected) { float x = __floattisf(a); if (x != expected) { twords at; at.all = a; printf("error in __floattisf(0x%.16llX%.16llX) = %a, expected %a\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(ti_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__floattisf(0, 0.0F)) return 1; if (test__floattisf(1, 1.0F)) return 1; if (test__floattisf(2, 2.0F)) return 1; if (test__floattisf(-1, -1.0F)) return 1; if (test__floattisf(-2, -2.0F)) return 1; if (test__floattisf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62F)) return 1; if (test__floattisf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62F)) return 1; if (test__floattisf(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000008000000000LL), -0x1.FFFFFEp+62F)) return 1; if (test__floattisf(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000010000000000LL), -0x1.FFFFFCp+62F)) return 1; if (test__floattisf(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000000LL), -0x1.000000p+63F)) return 1; if (test__floattisf(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000001LL), -0x1.000000p+63F)) return 1; if (test__floattisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72EA000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72EB000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72EC000000LL, 0x1.FEDCBCp+50F)) return 1; if (test__floattisf(0x0007FB72E8000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72E6000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72E7000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72E7FFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72E4000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floattisf(0x0007FB72E4000000LL, 0x1.FEDCB8p+50F)) return 1; if (test__floattisf(make_ti(0x0007FB72E8000000LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72EA000000LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72EB000000LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72EBFFFFFFLL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72EC000000LL, 0), 0x1.FEDCBCp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72E8000001LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72E6000000LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72E7000000LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72E7FFFFFFLL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72E4000001LL, 0), 0x1.FEDCBAp+114F)) return 1; if (test__floattisf(make_ti(0x0007FB72E4000000LL, 0), 0x1.FEDCB8p+114F)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatundidf_test.c0000664000175000017500000001107312516462465030447 0ustar mwhudsonmwhudson//===-- floatundidf_test.c - Test __floatundidf ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatundidf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: convert a to a double, rounding toward even. // Assumption: double is a IEEE 64 bit floating point type // du_int is a 64 bit integral type // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI double __floatundidf(du_int a); int test__floatundidf(di_int a, double expected) { double x = __floatundidf(a); if (x != expected) printf("error in __floatundidf(%llX) = %a, expected %a\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; int main() { if (test__floatundidf(0, 0.0)) return 1; if (test__floatundidf(1, 1.0)) return 1; if (test__floatundidf(2, 2.0)) return 1; if (test__floatundidf(20, 20.0)) return 1; if (test__floatundidf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62)) return 1; if (test__floatundidf(0x7FFFFFFFFFFFF800LL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatundidf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62)) return 1; if (test__floatundidf(0x7FFFFFFFFFFFF000LL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatundidf(0x8000008000000000LL, 0x1.000001p+63)) return 1; if (test__floatundidf(0x8000000000000800LL, 0x1.0000000000001p+63)) return 1; if (test__floatundidf(0x8000010000000000LL, 0x1.000002p+63)) return 1; if (test__floatundidf(0x8000000000001000LL, 0x1.0000000000002p+63)) return 1; if (test__floatundidf(0x8000000000000000LL, 0x1p+63)) return 1; if (test__floatundidf(0x8000000000000001LL, 0x1p+63)) return 1; if (test__floatundidf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floatundidf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floatundidf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floatundidf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floatundidf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floatundidf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floatundidf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floatundidf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floatundidf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floatundidf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floatundidf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floatundidf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DA1LL, 0x1.1A3CFE870496Dp+57)) return 1; if (test__floatundidf(0x023479FD0E092DB0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DB8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DB6LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DBFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DC1LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DC7LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DC8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DCFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DD0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatundidf(0x023479FD0E092DD1LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatundidf(0x023479FD0E092DD8LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatundidf(0x023479FD0E092DDFLL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatundidf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulsc3_test.c0000664000175000017500000001665712516462465027373 0ustar mwhudsonmwhudson//===-- mulsc3_test.c - Test __mulsc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulsc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include // Returns: the product of a + ib and c + id COMPILER_RT_ABI float _Complex __mulsc3(float __a, float __b, float __c, float __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(float _Complex x) { if (x == 0) return zero; if (isinf(crealf(x)) || isinf(cimagf(x))) return inf; if (isnan(crealf(x)) && isnan(cimagf(x))) return NaN; if (isnan(crealf(x))) { if (cimagf(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimagf(x))) { if (crealf(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__mulsc3(float a, float b, float c, float d) { float _Complex r = __mulsc3(a, b, c, d); // printf("test__mulsc3(%f, %f, %f, %f) = %f + I%f\n", // a, b, c, d, crealf(r), cimagf(r)); float _Complex dividend; float _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != zero) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; { float _Complex z = a * c - b * d + _Complex_I*(a * d + b * c); // relaxed tolerance to arbitrary (1.e-6) amount. if (cabsf((r-z)/r) > 1.e-6) return 1; } break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != inf) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != inf) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } float x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; int main() { const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__mulsc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gcc_personality_test.c0000664000175000017500000000211511470601015031312 0ustar mwhudsonmwhudson/* ===-- gcc_personality_test.c - Tests __gcc_personality_v0 -------------=== * * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ #include #include extern void foo_clean(void* x); extern void bar_clean(void* x); extern void register_foo_local(int* x); extern void register_bar_local(int* x); extern void done_foo(); extern void done_bar(); /* * foo() is called by main() in gcc_personality_test_helper.cxx. * done_bar() is implemented in C++ and will throw an exception. * main() will catch the exception and verify that the cleanup * routines for foo() and bar() were called by the personality * function. */ void bar() { int x __attribute__((cleanup(bar_clean))) = 0; register_bar_local(&x); done_bar(); } void foo() { int x __attribute__((cleanup(foo_clean))) = 0; register_foo_local(&x); bar(); done_foo(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/absvsi2_test.c0000664000175000017500000000317612516462465027526 0ustar mwhudsonmwhudson//===-- absvsi2_test.c - Test __absvsi2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __absvsi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: absolute value // Effects: aborts if abs(x) < 0 COMPILER_RT_ABI si_int __absvsi2(si_int a); int test__absvsi2(si_int a) { si_int x = __absvsi2(a); si_int expected = a; if (expected < 0) expected = -expected; if (x != expected || expected < 0) printf("error in __absvsi2(0x%X) = %d, expected positive %d\n", a, x, expected); return x != expected; } int main() { // if (test__absvsi2(0x80000000)) // should abort // return 1; if (test__absvsi2(0x00000000)) return 1; if (test__absvsi2(0x00000001)) return 1; if (test__absvsi2(0x00000002)) return 1; if (test__absvsi2(0x7FFFFFFE)) return 1; if (test__absvsi2(0x7FFFFFFF)) return 1; if (test__absvsi2(0x80000001)) return 1; if (test__absvsi2(0x80000002)) return 1; if (test__absvsi2(0xFFFFFFFE)) return 1; if (test__absvsi2(0xFFFFFFFF)) return 1; int i; for (i = 0; i < 10000; ++i) if (test__absvsi2(rand())) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/gcc_personality_test_helper.cxx0000664000175000017500000000323511470601015033235 0ustar mwhudsonmwhudson//===-- gcc_personality_test_helper.cxx -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include #include extern "C" { extern void foo_clean(void* x); extern void bar_clean(void* x); extern void register_foo_local(int* x); extern void register_bar_local(int* x); extern void done_foo(); extern void done_bar(); extern void foo(); } static int* foo_x = NULL; void register_foo_local(int* x) { foo_x = x; } static int* bar_x = NULL; void register_bar_local(int* x) { bar_x = x; } static bool foo_clean_called = false; void foo_clean(void* x) { if ( foo_x == NULL ) abort(); if ( foo_x != (int*)x) abort(); foo_clean_called = true; } static bool bar_clean_called = false; void bar_clean(void* x) { if ( bar_x == NULL ) abort(); if ( bar_x != (int*)x) abort(); bar_clean_called = true; } void done_foo() { } void done_bar() { throw "done"; } // // foo() is in gcc_personality_test.c and calls bar() which // calls done_bar() which throws an exception. // main() will catch the exception and verify that the cleanup // routines for foo() and bar() were called by the personality // function. // int main() { try { foo(); } catch(...) { if ( !foo_clean_called ) abort(); if ( !bar_clean_called ) abort(); return 0; } abort(); } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floattidf_test.c0000664000175000017500000001460012516462465030123 0ustar mwhudsonmwhudson//===-- floattidf.c - Test __floattidf ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floattidf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: convert a to a double, rounding toward even. // Assumption: double is a IEEE 64 bit floating point type // ti_int is a 64 bit integral type // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI double __floattidf(ti_int a); int test__floattidf(ti_int a, double expected) { double x = __floattidf(a); if (x != expected) { twords at; at.all = a; printf("error in __floattidf(0x%.16llX%.16llX) = %a, expected %a\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(ti_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__floattidf(0, 0.0)) return 1; if (test__floattidf(1, 1.0)) return 1; if (test__floattidf(2, 2.0)) return 1; if (test__floattidf(20, 20.0)) return 1; if (test__floattidf(-1, -1.0)) return 1; if (test__floattidf(-2, -2.0)) return 1; if (test__floattidf(-20, -20.0)) return 1; if (test__floattidf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62)) return 1; if (test__floattidf(0x7FFFFFFFFFFFF800LL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floattidf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62)) return 1; if (test__floattidf(0x7FFFFFFFFFFFF000LL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floattidf(make_ti(0x8000008000000000LL, 0), -0x1.FFFFFEp+126)) return 1; if (test__floattidf(make_ti(0x8000000000000800LL, 0), -0x1.FFFFFFFFFFFFEp+126)) return 1; if (test__floattidf(make_ti(0x8000010000000000LL, 0), -0x1.FFFFFCp+126)) return 1; if (test__floattidf(make_ti(0x8000000000001000LL, 0), -0x1.FFFFFFFFFFFFCp+126)) return 1; if (test__floattidf(make_ti(0x8000000000000000LL, 0), -0x1.000000p+127)) return 1; if (test__floattidf(make_ti(0x8000000000000001LL, 0), -0x1.000000p+127)) return 1; if (test__floattidf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floattidf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floattidf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floattidf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floattidf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floattidf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floattidf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floattidf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floattidf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floattidf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floattidf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floattidf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DA1LL, 0x1.1A3CFE870496Dp+57)) return 1; if (test__floattidf(0x023479FD0E092DB0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DB8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DB6LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DBFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DC1LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DC7LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DC8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DCFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DD0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattidf(0x023479FD0E092DD1LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floattidf(0x023479FD0E092DD8LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floattidf(0x023479FD0E092DDFLL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floattidf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DC0LL, 0), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DA1LL, 1), 0x1.1A3CFE870496Dp+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DB0LL, 2), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DB8LL, 3), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DB6LL, 4), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DBFLL, 5), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DC1LL, 6), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DC7LL, 7), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DC8LL, 8), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DCFLL, 9), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DD0LL, 0), 0x1.1A3CFE870496Ep+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DD1LL, 11), 0x1.1A3CFE870496Fp+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DD8LL, 12), 0x1.1A3CFE870496Fp+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DDFLL, 13), 0x1.1A3CFE870496Fp+121)) return 1; if (test__floattidf(make_ti(0x023479FD0E092DE0LL, 14), 0x1.1A3CFE870496Fp+121)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatunsitf_test.c0000664000175000017500000000304212516462465030503 0ustar mwhudsonmwhudson//===--------------- floatunsitf_test.c - Test __floatunsitf --------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatunsitf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" COMPILER_RT_ABI long double __floatunsitf(unsigned int a); int test__floatunsitf(unsigned int a, uint64_t expectedHi, uint64_t expectedLo) { long double x = __floatunsitf(a); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret){ printf("error in test__floatunsitf(%u) = %.20Lf, " "expected %.20Lf\n", a, x, fromRep128(expectedHi, expectedLo)); } return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__floatunsitf(0x7fffffff, UINT64_C(0x401dfffffffc0000), UINT64_C(0x0))) return 1; if (test__floatunsitf(0, UINT64_C(0x0), UINT64_C(0x0))) return 1; if (test__floatunsitf(0xffffffff, UINT64_C(0x401efffffffe0000), UINT64_C(0x0))) return 1; if (test__floatunsitf(0x12345678, UINT64_C(0x401b234567800000), UINT64_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/udivmodti4_test.c0000664000175000017500007541036112516462465030257 0ustar mwhudsonmwhudson//===-- udivmodti4_test.c - Test __udivmodti4 -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __udivmodti4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: the index of the least significant 1-bit in a, or // the value zero if a is zero. The least significant bit is index one. COMPILER_RT_ABI si_int __ffsdi2(di_int a); int test__ffsdi2(di_int a, si_int expected) { si_int x = __ffsdi2(a); if (x != expected) printf("error in __ffsdi2(0x%llX) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__ffsdi2(0x00000000, 0)) return 1; if (test__ffsdi2(0x00000001, 1)) return 1; if (test__ffsdi2(0x00000002, 2)) return 1; if (test__ffsdi2(0x00000003, 1)) return 1; if (test__ffsdi2(0x00000004, 3)) return 1; if (test__ffsdi2(0x00000005, 1)) return 1; if (test__ffsdi2(0x0000000A, 2)) return 1; if (test__ffsdi2(0x10000000, 29)) return 1; if (test__ffsdi2(0x20000000, 30)) return 1; if (test__ffsdi2(0x60000000, 30)) return 1; if (test__ffsdi2(0x80000000uLL, 32)) return 1; if (test__ffsdi2(0x0000050000000000uLL, 41)) return 1; if (test__ffsdi2(0x0200080000000000uLL, 44)) return 1; if (test__ffsdi2(0x7200000000000000uLL, 58)) return 1; if (test__ffsdi2(0x8000000000000000uLL, 64)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/comparesf2_test.c0000664000175000017500000005046211470601015030176 0ustar mwhudsonmwhudson//===-- cmpsf2_test.c - Test __cmpsf2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests single-precision soft-float comparisons for the compiler-rt // library. // //===----------------------------------------------------------------------===// #include int __eqsf2(float, float); int __gesf2(float, float); int __gtsf2(float, float); int __lesf2(float, float); int __ltsf2(float, float); int __nesf2(float, float); int __unordsf2(float, float); struct TestVector { float a; float b; int eqReference; int geReference; int gtReference; int leReference; int ltReference; int neReference; int unReference; }; int test__cmpsf2(const struct TestVector *vector) { if (__eqsf2(vector->a, vector->b) != vector->eqReference) { printf("error in __eqsf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __eqsf2(vector->a, vector->b), vector->eqReference); return 1; } if (__gesf2(vector->a, vector->b) != vector->geReference) { printf("error in __gesf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __gesf2(vector->a, vector->b), vector->geReference); return 1; } if (__gtsf2(vector->a, vector->b) != vector->gtReference) { printf("error in __gtsf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __gtsf2(vector->a, vector->b), vector->gtReference); return 1; } if (__lesf2(vector->a, vector->b) != vector->leReference) { printf("error in __lesf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __lesf2(vector->a, vector->b), vector->leReference); return 1; } if (__ltsf2(vector->a, vector->b) != vector->ltReference) { printf("error in __ltsf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __ltsf2(vector->a, vector->b), vector->ltReference); return 1; } if (__nesf2(vector->a, vector->b) != vector->neReference) { printf("error in __nesf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __nesf2(vector->a, vector->b), vector->neReference); return 1; } if (__unordsf2(vector->a, vector->b) != vector->unReference) { printf("error in __unordsf2(%a, %a) = %d, expected %d\n", vector->a, vector->b, __unordsf2(vector->a, vector->b), vector->unReference); return 1; } return 0; } /* void generateVectors() { const float arguments[] = { __builtin_nanf(""), -__builtin_inff(), -0x1.fffffep127, -0x1.000002p0 -0x1.000000p0, -0x1.fffffep-1f, -0x1.000000p-126f, -0x0.fffffep-126f, -0x0.000002p-126f, -0.0, 0.0, 0x0.000002p-126f, 0x0.fffffep-126f, 0x1.000000p-126f, 0x1.fffffep-1f, 0x1.000000p0, 0x1.000002p0, 0x1.fffffep127, __builtin_inff() }; int numArguments = sizeof arguments / sizeof arguments[0]; for (int i=0; i b ? 1 : a == b ? 0 : -1; const int unResult = a != a || b != b ? 1 : 0; printf("{%a,%a,%d,%d,%d,%d,%d,%d,%d},\n", a, b, leResult, geResult, geResult, leResult, leResult, leResult, unResult); } } } */ static const struct TestVector vectors[] = { {__builtin_nanf(""),__builtin_nanf(""),1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-__builtin_inff(),1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x1.fffffep+127f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x1p0f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x1.fffffep-1f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x1p-126f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x1.fffffcp-127,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x1p-149f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),-0x0p0f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x0p0f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1p-149f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1.fffffcp-127,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1p-126f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1.fffffep-1f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1p0f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1.000002p0f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),0x1.fffffep+127f,1,-1,-1,1,1,1,1}, {__builtin_nanf(""),__builtin_inff(),1,-1,-1,1,1,1,1}, {-__builtin_inff(),__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-__builtin_inff(),-__builtin_inff(),0,0,0,0,0,0,0}, {-__builtin_inff(),-0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),-0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),-0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),-0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),-0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),-0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-__builtin_inff(),__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x1.fffffep+127f,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x1.fffffep+127f,-0x1.fffffep+127f,0,0,0,0,0,0,0}, {-0x1.fffffep+127f,-0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,-0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,-0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,-0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,-0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep+127f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x1p0f,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x1p0f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {-0x1p0f,-0x1p0f,0,0,0,0,0,0,0}, {-0x1p0f,-0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,-0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,-0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,-0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x1p0f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x1.fffffep-1f,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x1.fffffep-1f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {-0x1.fffffep-1f,-0x1p0f,1,1,1,1,1,1,0}, {-0x1.fffffep-1f,-0x1.fffffep-1f,0,0,0,0,0,0,0}, {-0x1.fffffep-1f,-0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,-0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,-0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffep-1f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x1p-126f,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x1p-126f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {-0x1p-126f,-0x1p0f,1,1,1,1,1,1,0}, {-0x1p-126f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {-0x1p-126f,-0x1p-126f,0,0,0,0,0,0,0}, {-0x1p-126f,-0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,-0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-126f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x1.fffffcp-127,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x1.fffffcp-127,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {-0x1.fffffcp-127,-0x1p0f,1,1,1,1,1,1,0}, {-0x1.fffffcp-127,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {-0x1.fffffcp-127,-0x1p-126f,1,1,1,1,1,1,0}, {-0x1.fffffcp-127,-0x1.fffffcp-127,0,0,0,0,0,0,0}, {-0x1.fffffcp-127,-0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x1.fffffcp-127,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x1p-149f,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x1p-149f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {-0x1p-149f,-0x1p0f,1,1,1,1,1,1,0}, {-0x1p-149f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {-0x1p-149f,-0x1p-126f,1,1,1,1,1,1,0}, {-0x1p-149f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {-0x1p-149f,-0x1p-149f,0,0,0,0,0,0,0}, {-0x1p-149f,-0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x0p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x1p-149f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {-0x0p0f,-__builtin_inff(),1,1,1,1,1,1,0}, {-0x0p0f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {-0x0p0f,-0x1p0f,1,1,1,1,1,1,0}, {-0x0p0f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {-0x0p0f,-0x1p-126f,1,1,1,1,1,1,0}, {-0x0p0f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {-0x0p0f,-0x1p-149f,1,1,1,1,1,1,0}, {-0x0p0f,-0x0p0f,0,0,0,0,0,0,0}, {-0x0p0f,0x0p0f,0,0,0,0,0,0,0}, {-0x0p0f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {-0x0p0f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x0p0f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x0p0f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x0p0f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x0p0f,-0x1p0f,1,1,1,1,1,1,0}, {0x0p0f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x0p0f,-0x1p-126f,1,1,1,1,1,1,0}, {0x0p0f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x0p0f,-0x1p-149f,1,1,1,1,1,1,0}, {0x0p0f,-0x0p0f,0,0,0,0,0,0,0}, {0x0p0f,0x0p0f,0,0,0,0,0,0,0}, {0x0p0f,0x1p-149f,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x0p0f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1p-149f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1p-149f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1p-149f,-0x1p0f,1,1,1,1,1,1,0}, {0x1p-149f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1p-149f,-0x1p-126f,1,1,1,1,1,1,0}, {0x1p-149f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1p-149f,-0x1p-149f,1,1,1,1,1,1,0}, {0x1p-149f,-0x0p0f,1,1,1,1,1,1,0}, {0x1p-149f,0x0p0f,1,1,1,1,1,1,0}, {0x1p-149f,0x1p-149f,0,0,0,0,0,0,0}, {0x1p-149f,0x1.fffffcp-127,-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x1p-149f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-127,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1.fffffcp-127,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x1p0f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x1p-126f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x1p-149f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,-0x0p0f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,0x0p0f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,0x1p-149f,1,1,1,1,1,1,0}, {0x1.fffffcp-127,0x1.fffffcp-127,0,0,0,0,0,0,0}, {0x1.fffffcp-127,0x1p-126f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-127,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-127,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-127,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-127,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffcp-127,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1p-126f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1p-126f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1p-126f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1p-126f,-0x1p0f,1,1,1,1,1,1,0}, {0x1p-126f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1p-126f,-0x1p-126f,1,1,1,1,1,1,0}, {0x1p-126f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1p-126f,-0x1p-149f,1,1,1,1,1,1,0}, {0x1p-126f,-0x0p0f,1,1,1,1,1,1,0}, {0x1p-126f,0x0p0f,1,1,1,1,1,1,0}, {0x1p-126f,0x1p-149f,1,1,1,1,1,1,0}, {0x1p-126f,0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1p-126f,0x1p-126f,0,0,0,0,0,0,0}, {0x1p-126f,0x1.fffffep-1f,-1,-1,-1,-1,-1,-1,0}, {0x1p-126f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {0x1p-126f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {0x1p-126f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x1p-126f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1.fffffep-1f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1.fffffep-1f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x1p0f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x1p-126f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x1p-149f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,-0x0p0f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,0x0p0f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,0x1p-149f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.fffffep-1f,0x1p-126f,1,1,1,1,1,1,0}, {0x1.fffffep-1f,0x1.fffffep-1f,0,0,0,0,0,0,0}, {0x1.fffffep-1f,0x1p0f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffep-1f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffep-1f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x1.fffffep-1f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1p0f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1p0f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1p0f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1p0f,-0x1p0f,1,1,1,1,1,1,0}, {0x1p0f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1p0f,-0x1p-126f,1,1,1,1,1,1,0}, {0x1p0f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1p0f,-0x1p-149f,1,1,1,1,1,1,0}, {0x1p0f,-0x0p0f,1,1,1,1,1,1,0}, {0x1p0f,0x0p0f,1,1,1,1,1,1,0}, {0x1p0f,0x1p-149f,1,1,1,1,1,1,0}, {0x1p0f,0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1p0f,0x1p-126f,1,1,1,1,1,1,0}, {0x1p0f,0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1p0f,0x1p0f,0,0,0,0,0,0,0}, {0x1p0f,0x1.000002p0f,-1,-1,-1,-1,-1,-1,0}, {0x1p0f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x1p0f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1.000002p0f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1.000002p0f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1.000002p0f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1.000002p0f,-0x1p0f,1,1,1,1,1,1,0}, {0x1.000002p0f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1.000002p0f,-0x1p-126f,1,1,1,1,1,1,0}, {0x1.000002p0f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.000002p0f,-0x1p-149f,1,1,1,1,1,1,0}, {0x1.000002p0f,-0x0p0f,1,1,1,1,1,1,0}, {0x1.000002p0f,0x0p0f,1,1,1,1,1,1,0}, {0x1.000002p0f,0x1p-149f,1,1,1,1,1,1,0}, {0x1.000002p0f,0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.000002p0f,0x1p-126f,1,1,1,1,1,1,0}, {0x1.000002p0f,0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1.000002p0f,0x1p0f,1,1,1,1,1,1,0}, {0x1.000002p0f,0x1.000002p0f,0,0,0,0,0,0,0}, {0x1.000002p0f,0x1.fffffep+127f,-1,-1,-1,-1,-1,-1,0}, {0x1.000002p0f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {0x1.fffffep+127f,__builtin_nanf(""),1,-1,-1,1,1,1,1}, {0x1.fffffep+127f,-__builtin_inff(),1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x1.fffffep+127f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x1p0f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x1p-126f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x1p-149f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,-0x0p0f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x0p0f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1p-149f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1.fffffcp-127,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1p-126f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1.fffffep-1f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1p0f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1.000002p0f,1,1,1,1,1,1,0}, {0x1.fffffep+127f,0x1.fffffep+127f,0,0,0,0,0,0,0}, {0x1.fffffep+127f,__builtin_inff(),-1,-1,-1,-1,-1,-1,0}, {__builtin_inff(),__builtin_nanf(""),1,-1,-1,1,1,1,1}, {__builtin_inff(),-__builtin_inff(),1,1,1,1,1,1,0}, {__builtin_inff(),-0x1.fffffep+127f,1,1,1,1,1,1,0}, {__builtin_inff(),-0x1p0f,1,1,1,1,1,1,0}, {__builtin_inff(),-0x1.fffffep-1f,1,1,1,1,1,1,0}, {__builtin_inff(),-0x1p-126f,1,1,1,1,1,1,0}, {__builtin_inff(),-0x1.fffffcp-127,1,1,1,1,1,1,0}, {__builtin_inff(),-0x1p-149f,1,1,1,1,1,1,0}, {__builtin_inff(),-0x0p0f,1,1,1,1,1,1,0}, {__builtin_inff(),0x0p0f,1,1,1,1,1,1,0}, {__builtin_inff(),0x1p-149f,1,1,1,1,1,1,0}, {__builtin_inff(),0x1.fffffcp-127,1,1,1,1,1,1,0}, {__builtin_inff(),0x1p-126f,1,1,1,1,1,1,0}, {__builtin_inff(),0x1.fffffep-1f,1,1,1,1,1,1,0}, {__builtin_inff(),0x1p0f,1,1,1,1,1,1,0}, {__builtin_inff(),0x1.000002p0f,1,1,1,1,1,1,0}, {__builtin_inff(),0x1.fffffep+127f,1,1,1,1,1,1,0}, {__builtin_inff(),__builtin_inff(),0,0,0,0,0,0,0}, }; int main(int argc, char *argv[]) { const int numVectors = sizeof vectors / sizeof vectors[0]; int i; for (i = 0; i #include #include extern int __fixdfsivfp(double a); #if __arm__ int test__fixdfsivfp(double a) { int actual = __fixdfsivfp(a); int expected = a; if (actual != expected) printf("error in test__fixdfsivfp(%f) = %d, expected %d\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__fixdfsivfp(0.0)) return 1; if (test__fixdfsivfp(1.0)) return 1; if (test__fixdfsivfp(-1.0)) return 1; if (test__fixdfsivfp(2147483647)) return 1; if (test__fixdfsivfp(-2147483648.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatsisfvfp_test.c0000664000175000017500000000236112516462465030656 0ustar mwhudsonmwhudson//===-- floatsisfvfp_test.c - Test __floatsisfvfp -------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatsisfvfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __floatsisfvfp(int a); #if __arm__ int test__floatsisfvfp(int a) { float actual = __floatsisfvfp(a); float expected = a; if (actual != expected) printf("error in test__floatsisfvfp(%d) = %f, expected %f\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__floatsisfvfp(0)) return 1; if (test__floatsisfvfp(1)) return 1; if (test__floatsisfvfp(-1)) return 1; if (test__floatsisfvfp(0x7FFFFFFF)) return 1; if (test__floatsisfvfp(0x80000000)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixsfsivfp_test.c0000664000175000017500000000236011570537001030322 0ustar mwhudsonmwhudson//===-- fixsfsivfp_test.c - Test __fixsfsivfp -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixsfsivfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include extern int __fixsfsivfp(float a); #if __arm__ int test__fixsfsivfp(float a) { int actual = __fixsfsivfp(a); int expected = a; if (actual != expected) printf("error in test__fixsfsivfp(%f) = %u, expected %u\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__fixsfsivfp(0.0)) return 1; if (test__fixsfsivfp(1.0)) return 1; if (test__fixsfsivfp(-1.0)) return 1; if (test__fixsfsivfp(2147483647.0)) return 1; if (test__fixsfsivfp(-2147483648.0)) return 1; if (test__fixsfsivfp(65536.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixxfti_test.c0000664000175000017500000001203712516462465027632 0ustar mwhudsonmwhudson//===-- fixxfti_test.c - Test __fixxfti -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixxfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: convert a to a signed long long, rounding toward zero. // Assumption: long double is an intel 80 bit floating point type padded with 6 bytes // su_int is a 32 bit integral type // value in long double is representable in ti_int (no range checking performed) // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI ti_int __fixxfti(long double a); int test__fixxfti(long double a, ti_int expected) { ti_int x = __fixxfti(a); if (x != expected) { utwords xt; xt.all = x; utwords expectedt; expectedt.all = expected; printf("error in __fixxfti(%LA) = 0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__fixxfti(0.0, 0)) return 1; if (test__fixxfti(0.5, 0)) return 1; if (test__fixxfti(0.99, 0)) return 1; if (test__fixxfti(1.0, 1)) return 1; if (test__fixxfti(1.5, 1)) return 1; if (test__fixxfti(1.99, 1)) return 1; if (test__fixxfti(2.0, 2)) return 1; if (test__fixxfti(2.01, 2)) return 1; if (test__fixxfti(-0.5, 0)) return 1; if (test__fixxfti(-0.99, 0)) return 1; if (test__fixxfti(-1.0, -1)) return 1; if (test__fixxfti(-1.5, -1)) return 1; if (test__fixxfti(-1.99, -1)) return 1; if (test__fixxfti(-2.0, -2)) return 1; if (test__fixxfti(-2.01, -2)) return 1; if (test__fixxfti(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixxfti(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixxfti(-0x1.FFFFFEp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000008000000000LL))) return 1; if (test__fixxfti(-0x1.FFFFFCp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000010000000000LL))) return 1; if (test__fixxfti(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixxfti(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixxfti(-0x1.FFFFFFFFFFFFFp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000400LL))) return 1; if (test__fixxfti(-0x1.FFFFFFFFFFFFEp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000800LL))) return 1; if (test__fixxfti(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL)) return 1; if (test__fixxfti(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL)) return 1; if (test__fixxfti(-0x1.0000000000000000p+63L, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000000LL))) return 1; if (test__fixxfti(-0x1.FFFFFFFFFFFFFFFCp+62L, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000001LL))) return 1; if (test__fixxfti(-0x1.FFFFFFFFFFFFFFF8p+62L, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000002LL))) return 1; if (test__fixxfti(0x1.FFFFFFFFFFFFFFFEp+126L, make_ti(0x7FFFFFFFFFFFFFFFLL, 0x8000000000000000LL))) return 1; if (test__fixxfti(0x1.FFFFFFFFFFFFFFFCp+126L, make_ti(0x7FFFFFFFFFFFFFFFLL, 0x0000000000000000LL))) return 1; if (test__fixxfti(-0x1.0000000000000000p+127L, make_ti(0x8000000000000000LL, 0x0000000000000000LL))) return 1; if (test__fixxfti(-0x1.FFFFFFFFFFFFFFFEp+126L, make_ti(0x8000000000000000LL, 0x8000000000000000LL))) return 1; if (test__fixxfti(-0x1.FFFFFFFFFFFFFFFCp+126L, make_ti(0x8000000000000001LL, 0x0000000000000000LL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsdfsivfp_test.c0000664000175000017500000000243312516462465031046 0ustar mwhudsonmwhudson//===-- fixunsdfsivfp_test.c - Test __fixunsdfsivfp -----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsdfsivfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI unsigned int __fixunsdfsivfp(double a); #if __arm__ int test__fixunsdfsivfp(double a) { unsigned int actual = __fixunsdfsivfp(a); unsigned int expected = a; if (actual != expected) printf("error in test__fixunsdfsivfp(%f) = %u, expected %u\n", a, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__fixunsdfsivfp(0.0)) return 1; if (test__fixunsdfsivfp(1.0)) return 1; if (test__fixunsdfsivfp(-1.0)) return 1; if (test__fixunsdfsivfp(4294967295.0)) return 1; if (test__fixunsdfsivfp(65536.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/subvsi3_test.c0000664000175000017500000000323312516462465027545 0ustar mwhudsonmwhudson//===-- subvsi3_test.c - Test __subvsi3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __subvsi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: a - b // Effects: aborts if a - b overflows COMPILER_RT_ABI si_int __subvsi3(si_int a, si_int b); int test__subvsi3(si_int a, si_int b) { si_int x = __subvsi3(a, b); si_int expected = a - b; if (x != expected) printf("error in test__subvsi3(0x%X, 0x%X) = %d, expected %d\n", a, b, x, expected); return x != expected; } int main() { // test__subvsi3(0x80000000, 1); // should abort // test__subvsi3(0, 0x80000000); // should abort // test__subvsi3(1, 0x80000000); // should abort // test__subvsi3(0x7FFFFFFF, -1); // should abort // test__subvsi3(-2, 0x7FFFFFFF); // should abort if (test__subvsi3(0x80000000, -1)) return 1; if (test__subvsi3(0x80000000, 0)) return 1; if (test__subvsi3(-1, 0x80000000)) return 1; if (test__subvsi3(0x7FFFFFFF, 1)) return 1; if (test__subvsi3(0x7FFFFFFF, 0)) return 1; if (test__subvsi3(1, 0x7FFFFFFF)) return 1; if (test__subvsi3(0, 0x7FFFFFFF)) return 1; if (test__subvsi3(-1, 0x7FFFFFFF)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/multi3_test.c0000664000175000017500000001000712516462465027361 0ustar mwhudsonmwhudson//===-- multi3_test.c - Test __multi3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __multi3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT COMPILER_RT_ABI ti_int __multi3(ti_int a, ti_int b); int test__multi3(ti_int a, ti_int b, ti_int expected) { ti_int x = __multi3(a, b); if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __multi3: 0x%.16llX%.16llX * 0x%.16llX%.16llX = " "0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__multi3(0, 0, 0)) return 1; if (test__multi3(0, 1, 0)) return 1; if (test__multi3(1, 0, 0)) return 1; if (test__multi3(0, 10, 0)) return 1; if (test__multi3(10, 0, 0)) return 1; if (test__multi3(0, 81985529216486895LL, 0)) return 1; if (test__multi3(81985529216486895LL, 0, 0)) return 1; if (test__multi3(0, -1, 0)) return 1; if (test__multi3(-1, 0, 0)) return 1; if (test__multi3(0, -10, 0)) return 1; if (test__multi3(-10, 0, 0)) return 1; if (test__multi3(0, -81985529216486895LL, 0)) return 1; if (test__multi3(-81985529216486895LL, 0, 0)) return 1; if (test__multi3(1, 1, 1)) return 1; if (test__multi3(1, 10, 10)) return 1; if (test__multi3(10, 1, 10)) return 1; if (test__multi3(1, 81985529216486895LL, 81985529216486895LL)) return 1; if (test__multi3(81985529216486895LL, 1, 81985529216486895LL)) return 1; if (test__multi3(1, -1, -1)) return 1; if (test__multi3(1, -10, -10)) return 1; if (test__multi3(-10, 1, -10)) return 1; if (test__multi3(1, -81985529216486895LL, -81985529216486895LL)) return 1; if (test__multi3(-81985529216486895LL, 1, -81985529216486895LL)) return 1; if (test__multi3(3037000499LL, 3037000499LL, 9223372030926249001LL)) return 1; if (test__multi3(-3037000499LL, 3037000499LL, -9223372030926249001LL)) return 1; if (test__multi3(3037000499LL, -3037000499LL, -9223372030926249001LL)) return 1; if (test__multi3(-3037000499LL, -3037000499LL, 9223372030926249001LL)) return 1; if (test__multi3(4398046511103LL, 2097152LL, 9223372036852678656LL)) return 1; if (test__multi3(-4398046511103LL, 2097152LL, -9223372036852678656LL)) return 1; if (test__multi3(4398046511103LL, -2097152LL, -9223372036852678656LL)) return 1; if (test__multi3(-4398046511103LL, -2097152LL, 9223372036852678656LL)) return 1; if (test__multi3(2097152LL, 4398046511103LL, 9223372036852678656LL)) return 1; if (test__multi3(-2097152LL, 4398046511103LL, -9223372036852678656LL)) return 1; if (test__multi3(2097152LL, -4398046511103LL, -9223372036852678656LL)) return 1; if (test__multi3(-2097152LL, -4398046511103LL, 9223372036852678656LL)) return 1; if (test__multi3(make_ti(0x00000000000000B5LL, 0x04F333F9DE5BE000LL), make_ti(0x0000000000000000LL, 0x00B504F333F9DE5BLL), make_ti(0x7FFFFFFFFFFFF328LL, 0xDF915DA296E8A000LL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/mulsf3vfp_test.c0000664000175000017500000000243312516462465030075 0ustar mwhudsonmwhudson//===-- mulsf3vfp_test.c - Test __mulsf3vfp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __mulsf3vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include extern COMPILER_RT_ABI float __mulsf3vfp(float a, float b); #if __arm__ int test__mulsf3vfp(float a, float b) { float actual = __mulsf3vfp(a, b); float expected = a * b; if (actual != expected) printf("error in test__mulsf3vfp(%f, %f) = %f, expected %f\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__mulsf3vfp(0.5, 10.0)) return 1; if (test__mulsf3vfp(-0.5, -2.0)) return 1; if (test__mulsf3vfp(HUGE_VALF, 0.25)) return 1; if (test__mulsf3vfp(-0.125, HUGE_VALF)) return 1; if (test__mulsf3vfp(0.0, -0.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divxc3_test.c0000664000175000017500000001715512516462465027357 0ustar mwhudsonmwhudson//===-- divxc3_test.c - Test __divxc3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divxc3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #if !_ARCH_PPC #include "int_lib.h" #include #include #include // Returns: the quotient of (a + ib) / (c + id) COMPILER_RT_ABI long double _Complex __divxc3(long double __a, long double __b, long double __c, long double __d); enum {zero, non_zero, inf, NaN, non_zero_nan}; int classify(long double _Complex x) { if (x == 0) return zero; if (isinf(creall(x)) || isinf(cimagl(x))) return inf; if (isnan(creall(x)) && isnan(cimagl(x))) return NaN; if (isnan(creall(x))) { if (cimagl(x) == 0) return NaN; return non_zero_nan; } if (isnan(cimagl(x))) { if (creall(x) == 0) return NaN; return non_zero_nan; } return non_zero; } int test__divxc3(long double a, long double b, long double c, long double d) { long double _Complex r = __divxc3(a, b, c, d); // printf("test__divxc3(%Lf, %Lf, %Lf, %Lf) = %Lf + I%Lf\n", // a, b, c, d, creall(r), cimagl(r)); long double _Complex dividend; long double _Complex divisor; __real__ dividend = a; __imag__ dividend = b; __real__ divisor = c; __imag__ divisor = d; switch (classify(dividend)) { case zero: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != zero) return 1; break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != non_zero) return 1; { long double _Complex z = (a * c + b * d) / (c * c + d * d) + (b * c - a * d) / (c * c + d * d) * _Complex_I; if (cabs((r - z)/r) > 1.e-6) return 1; } break; case inf: if (classify(r) != zero) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case inf: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != inf) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case NaN: switch (classify(divisor)) { case zero: if (classify(r) != NaN) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; case non_zero_nan: switch (classify(divisor)) { case zero: if (classify(r) != inf) return 1; break; case non_zero: if (classify(r) != NaN) return 1; break; case inf: if (classify(r) != NaN) return 1; break; case NaN: if (classify(r) != NaN) return 1; break; case non_zero_nan: if (classify(r) != NaN) return 1; break; } break; } return 0; } long double x[][2] = { { 1.e-6, 1.e-6}, {-1.e-6, 1.e-6}, {-1.e-6, -1.e-6}, { 1.e-6, -1.e-6}, { 1.e+6, 1.e-6}, {-1.e+6, 1.e-6}, {-1.e+6, -1.e-6}, { 1.e+6, -1.e-6}, { 1.e-6, 1.e+6}, {-1.e-6, 1.e+6}, {-1.e-6, -1.e+6}, { 1.e-6, -1.e+6}, { 1.e+6, 1.e+6}, {-1.e+6, 1.e+6}, {-1.e+6, -1.e+6}, { 1.e+6, -1.e+6}, {NAN, NAN}, {-INFINITY, NAN}, {-2, NAN}, {-1, NAN}, {-0.5, NAN}, {-0., NAN}, {+0., NAN}, {0.5, NAN}, {1, NAN}, {2, NAN}, {INFINITY, NAN}, {NAN, -INFINITY}, {-INFINITY, -INFINITY}, {-2, -INFINITY}, {-1, -INFINITY}, {-0.5, -INFINITY}, {-0., -INFINITY}, {+0., -INFINITY}, {0.5, -INFINITY}, {1, -INFINITY}, {2, -INFINITY}, {INFINITY, -INFINITY}, {NAN, -2}, {-INFINITY, -2}, {-2, -2}, {-1, -2}, {-0.5, -2}, {-0., -2}, {+0., -2}, {0.5, -2}, {1, -2}, {2, -2}, {INFINITY, -2}, {NAN, -1}, {-INFINITY, -1}, {-2, -1}, {-1, -1}, {-0.5, -1}, {-0., -1}, {+0., -1}, {0.5, -1}, {1, -1}, {2, -1}, {INFINITY, -1}, {NAN, -0.5}, {-INFINITY, -0.5}, {-2, -0.5}, {-1, -0.5}, {-0.5, -0.5}, {-0., -0.5}, {+0., -0.5}, {0.5, -0.5}, {1, -0.5}, {2, -0.5}, {INFINITY, -0.5}, {NAN, -0.}, {-INFINITY, -0.}, {-2, -0.}, {-1, -0.}, {-0.5, -0.}, {-0., -0.}, {+0., -0.}, {0.5, -0.}, {1, -0.}, {2, -0.}, {INFINITY, -0.}, {NAN, 0.}, {-INFINITY, 0.}, {-2, 0.}, {-1, 0.}, {-0.5, 0.}, {-0., 0.}, {+0., 0.}, {0.5, 0.}, {1, 0.}, {2, 0.}, {INFINITY, 0.}, {NAN, 0.5}, {-INFINITY, 0.5}, {-2, 0.5}, {-1, 0.5}, {-0.5, 0.5}, {-0., 0.5}, {+0., 0.5}, {0.5, 0.5}, {1, 0.5}, {2, 0.5}, {INFINITY, 0.5}, {NAN, 1}, {-INFINITY, 1}, {-2, 1}, {-1, 1}, {-0.5, 1}, {-0., 1}, {+0., 1}, {0.5, 1}, {1, 1}, {2, 1}, {INFINITY, 1}, {NAN, 2}, {-INFINITY, 2}, {-2, 2}, {-1, 2}, {-0.5, 2}, {-0., 2}, {+0., 2}, {0.5, 2}, {1, 2}, {2, 2}, {INFINITY, 2}, {NAN, INFINITY}, {-INFINITY, INFINITY}, {-2, INFINITY}, {-1, INFINITY}, {-0.5, INFINITY}, {-0., INFINITY}, {+0., INFINITY}, {0.5, INFINITY}, {1, INFINITY}, {2, INFINITY}, {INFINITY, INFINITY} }; #endif int main() { #if !_ARCH_PPC const unsigned N = sizeof(x) / sizeof(x[0]); unsigned i, j; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { if (test__divxc3(x[i][0], x[i][1], x[j][0], x[j][1])) return 1; } } #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ashrti3_test.c0000664000175000017500000001667512516462465027542 0ustar mwhudsonmwhudson//===-- ashrti3_test.c - Test __ashrti3 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ashrti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: arithmetic a >> b // Precondition: 0 <= b < bits_in_tword COMPILER_RT_ABI ti_int __ashrti3(ti_int a, si_int b); int test__ashrti3(ti_int a, si_int b, ti_int expected) { ti_int x = __ashrti3(a, b); if (x != expected) { twords at; at.all = a; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __ashrti3: 0x%llX%.16llX >> %d = 0x%llX%.16llX," " expected 0x%llX%.16llX\n", at.s.high, at.s.low, b, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 0, make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 1, make_ti(0xFF6E5D4C3B2A190ALL, 0xFF6E5D4C3B2A190ALL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 2, make_ti(0xFFB72EA61D950C85LL, 0x7FB72EA61D950C85LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 3, make_ti(0xFFDB97530ECA8642LL, 0xBFDB97530ECA8642LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 4, make_ti(0xFFEDCBA987654321LL, 0x5FEDCBA987654321LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 28, make_ti(0xFFFFFFFFEDCBA987LL, 0x6543215FEDCBA987LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 29, make_ti(0xFFFFFFFFF6E5D4C3LL, 0xB2A190AFF6E5D4C3LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 30, make_ti(0xFFFFFFFFFB72EA61LL, 0xD950C857FB72EA61LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 31, make_ti(0xFFFFFFFFFDB97530LL, 0xECA8642BFDB97530LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 32, make_ti(0xFFFFFFFFFEDCBA98LL, 0x76543215FEDCBA98LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 33, make_ti(0xFFFFFFFFFF6E5D4CLL, 0x3B2A190AFF6E5D4CLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 34, make_ti(0xFFFFFFFFFFB72EA6LL, 0x1D950C857FB72EA6LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 35, make_ti(0xFFFFFFFFFFDB9753LL, 0x0ECA8642BFDB9753LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 36, make_ti(0xFFFFFFFFFFEDCBA9LL, 0x876543215FEDCBA9LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 60, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xEDCBA9876543215FLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 61, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xF6E5D4C3B2A190AFLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFB72EA61D950C857LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 63, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFDB97530ECA8642BLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 64, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFEDCBA9876543215LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 65, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFF6E5D4C3B2A190ALL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 66, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFB72EA61D950C85LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 67, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFDB97530ECA8642LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 68, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFEDCBA987654321LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 92, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFEDCBA987LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 93, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFF6E5D4C3LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 94, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFB72EA61LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 95, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFDB97530LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 96, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFEDCBA98LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 97, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFF6E5D4CLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 98, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFB72EA6LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 99, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFDB9753LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 100, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFEDCBA9LL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 124, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 125, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 126, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; if (test__ashrti3(make_ti(0xFEDCBA9876543215LL, 0xFEDCBA9876543215LL), 127, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floattixf_test.c0000664000175000017500000001777012516462465030162 0ustar mwhudsonmwhudson//===-- floattixf.c - Test __floattixf ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floattixf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: convert a to a long double, rounding toward even. // Assumption: long double is a IEEE 80 bit floating point type padded to 128 bits // ti_int is a 128 bit integral type // gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | // 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI long double __floattixf(ti_int a); int test__floattixf(ti_int a, long double expected) { long double x = __floattixf(a); if (x != expected) { twords at; at.all = a; printf("error in __floattixf(0x%.16llX%.16llX) = %LA, expected %LA\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(ti_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__floattixf(0, 0.0)) return 1; if (test__floattixf(1, 1.0)) return 1; if (test__floattixf(2, 2.0)) return 1; if (test__floattixf(20, 20.0)) return 1; if (test__floattixf(-1, -1.0)) return 1; if (test__floattixf(-2, -2.0)) return 1; if (test__floattixf(-20, -20.0)) return 1; if (test__floattixf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62)) return 1; if (test__floattixf(0x7FFFFFFFFFFFF800LL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floattixf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62)) return 1; if (test__floattixf(0x7FFFFFFFFFFFF000LL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floattixf(make_ti(0x8000008000000000LL, 0), -0x1.FFFFFEp+126)) return 1; if (test__floattixf(make_ti(0x8000000000000800LL, 0), -0x1.FFFFFFFFFFFFEp+126)) return 1; if (test__floattixf(make_ti(0x8000010000000000LL, 0), -0x1.FFFFFCp+126)) return 1; if (test__floattixf(make_ti(0x8000000000001000LL, 0), -0x1.FFFFFFFFFFFFCp+126)) return 1; if (test__floattixf(make_ti(0x8000000000000000LL, 0), -0x1.000000p+127)) return 1; if (test__floattixf(make_ti(0x8000000000000001LL, 0), -0x1.FFFFFFFFFFFFFFFCp+126L)) return 1; if (test__floattixf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floattixf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floattixf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floattixf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floattixf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floattixf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floattixf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floattixf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floattixf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floattixf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floattixf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floattixf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floattixf(0x023479FD0E092DA1LL, 0x1.1A3CFE870496D08p+57L)) return 1; if (test__floattixf(0x023479FD0E092DB0LL, 0x1.1A3CFE870496D8p+57L)) return 1; if (test__floattixf(0x023479FD0E092DB8LL, 0x1.1A3CFE870496DCp+57L)) return 1; if (test__floattixf(0x023479FD0E092DB6LL, 0x1.1A3CFE870496DBp+57L)) return 1; if (test__floattixf(0x023479FD0E092DBFLL, 0x1.1A3CFE870496DF8p+57L)) return 1; if (test__floattixf(0x023479FD0E092DC1LL, 0x1.1A3CFE870496E08p+57L)) return 1; if (test__floattixf(0x023479FD0E092DC7LL, 0x1.1A3CFE870496E38p+57L)) return 1; if (test__floattixf(0x023479FD0E092DC8LL, 0x1.1A3CFE870496E4p+57L)) return 1; if (test__floattixf(0x023479FD0E092DCFLL, 0x1.1A3CFE870496E78p+57L)) return 1; if (test__floattixf(0x023479FD0E092DD0LL, 0x1.1A3CFE870496E8p+57L)) return 1; if (test__floattixf(0x023479FD0E092DD1LL, 0x1.1A3CFE870496E88p+57L)) return 1; if (test__floattixf(0x023479FD0E092DD8LL, 0x1.1A3CFE870496ECp+57L)) return 1; if (test__floattixf(0x023479FD0E092DDFLL, 0x1.1A3CFE870496EF8p+57L)) return 1; if (test__floattixf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DC0LL, 0), 0x1.1A3CFE870496Ep+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DA1LL, 1), 0x1.1A3CFE870496D08p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DB0LL, 2), 0x1.1A3CFE870496D8p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DB8LL, 3), 0x1.1A3CFE870496DCp+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DB6LL, 4), 0x1.1A3CFE870496DBp+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DBFLL, 5), 0x1.1A3CFE870496DF8p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DC1LL, 6), 0x1.1A3CFE870496E08p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DC7LL, 7), 0x1.1A3CFE870496E38p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DC8LL, 8), 0x1.1A3CFE870496E4p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DCFLL, 9), 0x1.1A3CFE870496E78p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DD0LL, 0), 0x1.1A3CFE870496E8p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DD1LL, 11), 0x1.1A3CFE870496E88p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DD8LL, 12), 0x1.1A3CFE870496ECp+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DDFLL, 13), 0x1.1A3CFE870496EF8p+121L)) return 1; if (test__floattixf(make_ti(0x023479FD0E092DE0LL, 14), 0x1.1A3CFE870496Fp+121L)) return 1; if (test__floattixf(make_ti(0, 0xFFFFFFFFFFFFFFFFLL), 0x1.FFFFFFFFFFFFFFFEp+63L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x3456100000000001LL), 0x1.2345678901234562p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x3456200000000000LL), 0x1.2345678901234562p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x34562FFFFFFFFFFFLL), 0x1.2345678901234562p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x3456300000000000LL), 0x1.2345678901234564p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x3456400000000000LL), 0x1.2345678901234564p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x34564FFFFFFFFFFFLL), 0x1.2345678901234564p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x3456500000000000LL), 0x1.2345678901234564p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x3456500000000001LL), 0x1.2345678901234566p+108L)) return 1; if (test__floattixf(make_ti(0x0000123456789012LL, 0x34566FFFFFFFFFFFLL), 0x1.2345678901234566p+108L)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/cmpdi2_test.c0000664000175000017500000000455412516462465027334 0ustar mwhudsonmwhudson//===-- cmpdi2_test.c - Test __cmpdi2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __cmpdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: if (a < b) returns 0 // if (a == b) returns 1 // if (a > b) returns 2 COMPILER_RT_ABI si_int __cmpdi2(di_int a, di_int b); int test__cmpdi2(di_int a, di_int b, si_int expected) { si_int x = __cmpdi2(a, b); if (x != expected) printf("error in __cmpdi2(0x%llX, 0x%llX) = %d, expected %d\n", a, b, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { if (test__cmpdi2(0, 0, 1)) return 1; if (test__cmpdi2(1, 1, 1)) return 1; if (test__cmpdi2(2, 2, 1)) return 1; if (test__cmpdi2(0x7FFFFFFF, 0x7FFFFFFF, 1)) return 1; if (test__cmpdi2(0x80000000, 0x80000000, 1)) return 1; if (test__cmpdi2(0x80000001, 0x80000001, 1)) return 1; if (test__cmpdi2(0xFFFFFFFF, 0xFFFFFFFF, 1)) return 1; if (test__cmpdi2(0x000000010000000LL, 0x000000010000000LL, 1)) return 1; if (test__cmpdi2(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL, 1)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000300000001LL, 0)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000300000002LL, 0)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000300000003LL, 0)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000100000001LL, 2)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000100000002LL, 2)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000100000003LL, 2)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000200000001LL, 2)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000200000002LL, 1)) return 1; if (test__cmpdi2(0x0000000200000002LL, 0x0000000200000003LL, 0)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/unordsf2vfp_test.c0000664000175000017500000000233711570537001030415 0ustar mwhudsonmwhudson//===-- unordsf2vfp_test.c - Test __unordsf2vfp ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __unordsf2vfp for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include #include #include extern int __unordsf2vfp(float a, float b); #if __arm__ int test__unordsf2vfp(float a, float b) { int actual = __unordsf2vfp(a, b); int expected = (isnan(a) || isnan(b)) ? 1 : 0; if (actual != expected) printf("error in __unordsf2vfp(%f, %f) = %d, expected %d\n", a, b, actual, expected); return actual != expected; } #endif int main() { #if __arm__ if (test__unordsf2vfp(0.0, NAN)) return 1; if (test__unordsf2vfp(NAN, 1.0)) return 1; if (test__unordsf2vfp(NAN, NAN)) return 1; if (test__unordsf2vfp(1.0, 1.0)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/ffsti2_test.c0000664000175000017500000000430112516462465027341 0ustar mwhudsonmwhudson//===-- ffsti2_test.c - Test __ffsti2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __ffsti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: the index of the least significant 1-bit in a, or // the value zero if a is zero. The least significant bit is index one. COMPILER_RT_ABI si_int __ffsti2(ti_int a); int test__ffsti2(ti_int a, si_int expected) { si_int x = __ffsti2(a); if (x != expected) { twords at; at.all = a; printf("error in __ffsti2(0x%llX%.16llX) = %d, expected %d\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__ffsti2(0x00000000, 0)) return 1; if (test__ffsti2(0x00000001, 1)) return 1; if (test__ffsti2(0x00000002, 2)) return 1; if (test__ffsti2(0x00000003, 1)) return 1; if (test__ffsti2(0x00000004, 3)) return 1; if (test__ffsti2(0x00000005, 1)) return 1; if (test__ffsti2(0x0000000A, 2)) return 1; if (test__ffsti2(0x10000000, 29)) return 1; if (test__ffsti2(0x20000000, 30)) return 1; if (test__ffsti2(0x60000000, 30)) return 1; if (test__ffsti2(0x80000000uLL, 32)) return 1; if (test__ffsti2(0x0000050000000000uLL, 41)) return 1; if (test__ffsti2(0x0200080000000000uLL, 44)) return 1; if (test__ffsti2(0x7200000000000000uLL, 58)) return 1; if (test__ffsti2(0x8000000000000000uLL, 64)) return 1; if (test__ffsti2(make_ti(0x8000000800000000uLL, 0), 100)) return 1; if (test__ffsti2(make_ti(0x8000000000000000uLL, 0), 128)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsdfdi_test.c0000664000175000017500000000625712616720672030321 0ustar mwhudsonmwhudson//===-- fixunsdfdi_test.c - Test __fixunsdfdi -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsdfdi for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: double is a IEEE 64 bit floating point type // du_int is a 64 bit integral type // value in double is representable in du_int or is negative // (no range checking performed) // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI du_int __fixunsdfdi(double a); int test__fixunsdfdi(double a, du_int expected) { du_int x = __fixunsdfdi(a); if (x != expected) printf("error in __fixunsdfdi(%A) = %llX, expected %llX\n", a, x, expected); return x != expected; } char assumption_1[sizeof(du_int) == 2*sizeof(su_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; int main() { if (test__fixunsdfdi(0.0, 0)) return 1; if (test__fixunsdfdi(0.5, 0)) return 1; if (test__fixunsdfdi(0.99, 0)) return 1; if (test__fixunsdfdi(1.0, 1)) return 1; if (test__fixunsdfdi(1.5, 1)) return 1; if (test__fixunsdfdi(1.99, 1)) return 1; if (test__fixunsdfdi(2.0, 2)) return 1; if (test__fixunsdfdi(2.01, 2)) return 1; if (test__fixunsdfdi(-0.5, 0)) return 1; if (test__fixunsdfdi(-0.99, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfdi(-1.0, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunsdfdi(-1.5, 0)) return 1; if (test__fixunsdfdi(-1.99, 0)) return 1; if (test__fixunsdfdi(-2.0, 0)) return 1; if (test__fixunsdfdi(-2.01, 0)) return 1; #endif if (test__fixunsdfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixunsdfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfdi(-0x1.FFFFFEp+62, 0)) return 1; if (test__fixunsdfdi(-0x1.FFFFFCp+62, 0)) return 1; #endif if (test__fixunsdfdi(0x1.FFFFFFFFFFFFFp+63, 0xFFFFFFFFFFFFF800LL)) return 1; if (test__fixunsdfdi(0x1.0000000000000p+63, 0x8000000000000000LL)) return 1; if (test__fixunsdfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixunsdfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixunsdfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFFLL)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfdi(-0x1.FFFFFFFFFFFFFp+62, 0)) return 1; if (test__fixunsdfdi(-0x1.FFFFFFFFFFFFEp+62, 0)) return 1; #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divti3_test.c0000664000175000017500000000412312516462465027350 0ustar mwhudsonmwhudson//===-- divti3_test.c - Test __divti3 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divti3 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: a / b COMPILER_RT_ABI ti_int __divti3(ti_int a, ti_int b); int test__divti3(ti_int a, ti_int b, ti_int expected) { ti_int x = __divti3(a, b); if (x != expected) { twords at; at.all = a; twords bt; bt.all = b; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __divti3: 0x%llX%.16llX / 0x%llX%.16llX = " "0x%llX%.16llX, expected 0x%llX%.16llX\n", at.s.high, at.s.low, bt.s.high, bt.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__divti3(0, 1, 0)) return 1; if (test__divti3(0, -1, 0)) return 1; if (test__divti3(2, 1, 2)) return 1; if (test__divti3(2, -1, -2)) return 1; if (test__divti3(-2, 1, -2)) return 1; if (test__divti3(-2, -1, 2)) return 1; if (test__divti3(make_ti(0x8000000000000000LL, 0), 1, make_ti(0x8000000000000000LL, 0))) return 1; if (test__divti3(make_ti(0x8000000000000000LL, 0), -1, make_ti(0x8000000000000000LL, 0))) return 1; if (test__divti3(make_ti(0x8000000000000000LL, 0), -2, make_ti(0x4000000000000000LL, 0))) return 1; if (test__divti3(make_ti(0x8000000000000000LL, 0), 2, make_ti(0xC000000000000000LL, 0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/divmodsi4_test.c0000664000175000017500000000351312516462465030052 0ustar mwhudsonmwhudson//===-- divmodsi4_test.c - Test __divmodsi4 -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __divmodsi4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a / b extern COMPILER_RT_ABI si_int __divmodsi4(si_int a, si_int b, si_int* rem); int test__divmodsi4(si_int a, si_int b, si_int expected_result, si_int expected_rem) { si_int rem; si_int result = __divmodsi4(a, b, &rem); if (result != expected_result) { printf("error in __divmodsi4: %d / %d = %d, expected %d\n", a, b, result, expected_result); return 1; } if (rem != expected_rem) { printf("error in __divmodsi4: %d mod %d = %d, expected %d\n", a, b, rem, expected_rem); return 1; } return 0; } int main() { if (test__divmodsi4(0, 1, 0, 0)) return 1; if (test__divmodsi4(0, -1, 0, 0)) return 1; if (test__divmodsi4(2, 1, 2, 0)) return 1; if (test__divmodsi4(2, -1, -2, 0)) return 1; if (test__divmodsi4(-2, 1, -2, 0)) return 1; if (test__divmodsi4(-2, -1, 2, 0)) return 1; if (test__divmodsi4(7, 5, 1, 2)) return 1; if (test__divmodsi4(-7, 5, -1, -2)) return 1; if (test__divmodsi4(19, 5, 3, 4)) return 1; if (test__divmodsi4(19, -5, -3, 4)) return 1; if (test__divmodsi4(0x80000000, 8, 0xf0000000, 0)) return 1; if (test__divmodsi4(0x80000007, 8, 0xf0000001, -1)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/negvti2_test.c0000664000175000017500000000667712516462465027544 0ustar mwhudsonmwhudson//===-- negvti2_test.c - Test __negvti2 -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __negvti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: -a // Effects: aborts if -a overflows COMPILER_RT_ABI ti_int __negvti2(ti_int a); COMPILER_RT_ABI ti_int __negti2(ti_int a); int test__negvti2(ti_int a) { ti_int x = __negvti2(a); ti_int expected = __negti2(a); if (x != expected) { twords at; at.all = a; twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __negvti2(0x%.16llX%.16llX) = 0x%.16llX%.16llX, " "expected 0x%.16llX%.16llX\n", at.s.high, at.s.low, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } #endif int main() { #ifdef CRT_HAS_128BIT if (test__negvti2(0)) return 1; if (test__negvti2(1)) return 1; if (test__negvti2(-1)) return 1; if (test__negvti2(2)) return 1; if (test__negvti2(-2)) return 1; if (test__negvti2(3)) return 1; if (test__negvti2(-3)) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x00000000FFFFFFFELL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000002LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x00000000FFFFFFFFLL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000001LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x0000000100000000LL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000000LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x0000000200000000LL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFE00000000LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x0000000300000000LL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFD00000000LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x7FFFFFFFFFFFFFFFLL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000001LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x7FFFFFFFFFFFFFFFLL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFE00000000LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x0000000200000000LL))) return 1; if (test__negvti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFF00000000LL))) return 1; if (test__negvti2(make_ti(0x0000000000000000LL, 0x0000000100000000LL))) return 1; // if (test__negvti2(make_ti(0x8000000000000000LL, 0x0000000000000000LL))) // abort // return 1; if (test__negvti2(make_ti(0x8000000000000000LL, 0x0000000000000001LL))) return 1; if (test__negvti2(make_ti(0x7FFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/powitf2_test.c0000664000175000017500000001414612516462465027546 0ustar mwhudsonmwhudson//===-- powitf2_test.cpp - Test __powitf2 ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __powitf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #if _ARCH_PPC #include "int_lib.h" #include // Returns: a ^ b COMPILER_RT_ABI long double __powitf2(long double a, si_int b); int test__powitf2(long double a, si_int b, long double expected) { long double x = __powitf2(a, b); int correct = (x == expected) && (signbit(x) == signbit(expected)); if (!correct) printf("error in __powitf2(%Lf, %d) = %Lf, expected %Lf\n", a, b, x, expected); return !correct; } #endif int main() { #if _ARCH_PPC if (test__powitf2(0, 0, 1)) return 1; if (test__powitf2(1, 0, 1)) return 1; if (test__powitf2(1.5, 0, 1)) return 1; if (test__powitf2(2, 0, 1)) return 1; if (test__powitf2(INFINITY, 0, 1)) return 1; if (test__powitf2(-0., 0, 1)) return 1; if (test__powitf2(-1, 0, 1)) return 1; if (test__powitf2(-1.5, 0, 1)) return 1; if (test__powitf2(-2, 0, 1)) return 1; if (test__powitf2(-INFINITY, 0, 1)) return 1; if (test__powitf2(0, 1, 0)) return 1; if (test__powitf2(0, 2, 0)) return 1; if (test__powitf2(0, 3, 0)) return 1; if (test__powitf2(0, 4, 0)) return 1; if (test__powitf2(0, 0x7FFFFFFE, 0)) return 1; if (test__powitf2(0, 0x7FFFFFFF, 0)) return 1; if (test__powitf2(-0., 1, -0.)) return 1; if (test__powitf2(-0., 2, 0)) return 1; if (test__powitf2(-0., 3, -0.)) return 1; if (test__powitf2(-0., 4, 0)) return 1; if (test__powitf2(-0., 0x7FFFFFFE, 0)) return 1; if (test__powitf2(-0., 0x7FFFFFFF, -0.)) return 1; if (test__powitf2(1, 1, 1)) return 1; if (test__powitf2(1, 2, 1)) return 1; if (test__powitf2(1, 3, 1)) return 1; if (test__powitf2(1, 4, 1)) return 1; if (test__powitf2(1, 0x7FFFFFFE, 1)) return 1; if (test__powitf2(1, 0x7FFFFFFF, 1)) return 1; if (test__powitf2(INFINITY, 1, INFINITY)) return 1; if (test__powitf2(INFINITY, 2, INFINITY)) return 1; if (test__powitf2(INFINITY, 3, INFINITY)) return 1; if (test__powitf2(INFINITY, 4, INFINITY)) return 1; if (test__powitf2(INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powitf2(INFINITY, 0x7FFFFFFF, INFINITY)) return 1; if (test__powitf2(-INFINITY, 1, -INFINITY)) return 1; if (test__powitf2(-INFINITY, 2, INFINITY)) return 1; if (test__powitf2(-INFINITY, 3, -INFINITY)) return 1; if (test__powitf2(-INFINITY, 4, INFINITY)) return 1; if (test__powitf2(-INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powitf2(-INFINITY, 0x7FFFFFFF, -INFINITY)) return 1; if (test__powitf2(0, -1, INFINITY)) return 1; if (test__powitf2(0, -2, INFINITY)) return 1; if (test__powitf2(0, -3, INFINITY)) return 1; if (test__powitf2(0, -4, INFINITY)) return 1; if (test__powitf2(0, 0x80000002, INFINITY)) return 1; if (test__powitf2(0, 0x80000001, INFINITY)) return 1; if (test__powitf2(0, 0x80000000, INFINITY)) return 1; if (test__powitf2(-0., -1, -INFINITY)) return 1; if (test__powitf2(-0., -2, INFINITY)) return 1; if (test__powitf2(-0., -3, -INFINITY)) return 1; if (test__powitf2(-0., -4, INFINITY)) return 1; if (test__powitf2(-0., 0x80000002, INFINITY)) return 1; if (test__powitf2(-0., 0x80000001, -INFINITY)) return 1; if (test__powitf2(-0., 0x80000000, INFINITY)) return 1; if (test__powitf2(1, -1, 1)) return 1; if (test__powitf2(1, -2, 1)) return 1; if (test__powitf2(1, -3, 1)) return 1; if (test__powitf2(1, -4, 1)) return 1; if (test__powitf2(1, 0x80000002, 1)) return 1; if (test__powitf2(1, 0x80000001, 1)) return 1; if (test__powitf2(1, 0x80000000, 1)) return 1; if (test__powitf2(INFINITY, -1, 0)) return 1; if (test__powitf2(INFINITY, -2, 0)) return 1; if (test__powitf2(INFINITY, -3, 0)) return 1; if (test__powitf2(INFINITY, -4, 0)) return 1; if (test__powitf2(INFINITY, 0x80000002, 0)) return 1; if (test__powitf2(INFINITY, 0x80000001, 0)) return 1; if (test__powitf2(INFINITY, 0x80000000, 0)) return 1; if (test__powitf2(-INFINITY, -1, -0.)) return 1; if (test__powitf2(-INFINITY, -2, 0)) return 1; if (test__powitf2(-INFINITY, -3, -0.)) return 1; if (test__powitf2(-INFINITY, -4, 0)) return 1; if (test__powitf2(-INFINITY, 0x80000002, 0)) return 1; if (test__powitf2(-INFINITY, 0x80000001, -0.)) return 1; if (test__powitf2(-INFINITY, 0x80000000, 0)) return 1; if (test__powitf2(2, 10, 1024.)) return 1; if (test__powitf2(-2, 10, 1024.)) return 1; if (test__powitf2(2, -10, 1/1024.)) return 1; if (test__powitf2(-2, -10, 1/1024.)) return 1; if (test__powitf2(2, 19, 524288.)) return 1; if (test__powitf2(-2, 19, -524288.)) return 1; if (test__powitf2(2, -19, 1/524288.)) return 1; if (test__powitf2(-2, -19, -1/524288.)) return 1; if (test__powitf2(2, 31, 2147483648.)) return 1; if (test__powitf2(-2, 31, -2147483648.)) return 1; if (test__powitf2(2, -31, 1/2147483648.)) return 1; if (test__powitf2(-2, -31, -1/2147483648.)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/powisf2_test.c0000664000175000017500000001377112516462465027550 0ustar mwhudsonmwhudson//===-- powisf2_test.cpp - Test __powisf2 ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __powisf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: a ^ b COMPILER_RT_ABI float __powisf2(float a, si_int b); int test__powisf2(float a, si_int b, float expected) { float x = __powisf2(a, b); int correct = (x == expected) && (signbit(x) == signbit(expected)); if (!correct) printf("error in __powisf2(%f, %d) = %f, expected %f\n", a, b, x, expected); return !correct; } int main() { if (test__powisf2(0, 0, 1)) return 1; if (test__powisf2(1, 0, 1)) return 1; if (test__powisf2(1.5, 0, 1)) return 1; if (test__powisf2(2, 0, 1)) return 1; if (test__powisf2(INFINITY, 0, 1)) return 1; if (test__powisf2(-0., 0, 1)) return 1; if (test__powisf2(-1, 0, 1)) return 1; if (test__powisf2(-1.5, 0, 1)) return 1; if (test__powisf2(-2, 0, 1)) return 1; if (test__powisf2(-INFINITY, 0, 1)) return 1; if (test__powisf2(0, 1, 0)) return 1; if (test__powisf2(0, 2, 0)) return 1; if (test__powisf2(0, 3, 0)) return 1; if (test__powisf2(0, 4, 0)) return 1; if (test__powisf2(0, 0x7FFFFFFE, 0)) return 1; if (test__powisf2(0, 0x7FFFFFFF, 0)) return 1; if (test__powisf2(-0., 1, -0.)) return 1; if (test__powisf2(-0., 2, 0)) return 1; if (test__powisf2(-0., 3, -0.)) return 1; if (test__powisf2(-0., 4, 0)) return 1; if (test__powisf2(-0., 0x7FFFFFFE, 0)) return 1; if (test__powisf2(-0., 0x7FFFFFFF, -0.)) return 1; if (test__powisf2(1, 1, 1)) return 1; if (test__powisf2(1, 2, 1)) return 1; if (test__powisf2(1, 3, 1)) return 1; if (test__powisf2(1, 4, 1)) return 1; if (test__powisf2(1, 0x7FFFFFFE, 1)) return 1; if (test__powisf2(1, 0x7FFFFFFF, 1)) return 1; if (test__powisf2(INFINITY, 1, INFINITY)) return 1; if (test__powisf2(INFINITY, 2, INFINITY)) return 1; if (test__powisf2(INFINITY, 3, INFINITY)) return 1; if (test__powisf2(INFINITY, 4, INFINITY)) return 1; if (test__powisf2(INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powisf2(INFINITY, 0x7FFFFFFF, INFINITY)) return 1; if (test__powisf2(-INFINITY, 1, -INFINITY)) return 1; if (test__powisf2(-INFINITY, 2, INFINITY)) return 1; if (test__powisf2(-INFINITY, 3, -INFINITY)) return 1; if (test__powisf2(-INFINITY, 4, INFINITY)) return 1; if (test__powisf2(-INFINITY, 0x7FFFFFFE, INFINITY)) return 1; if (test__powisf2(-INFINITY, 0x7FFFFFFF, -INFINITY)) return 1; if (test__powisf2(0, -1, INFINITY)) return 1; if (test__powisf2(0, -2, INFINITY)) return 1; if (test__powisf2(0, -3, INFINITY)) return 1; if (test__powisf2(0, -4, INFINITY)) return 1; if (test__powisf2(0, 0x80000002, INFINITY)) return 1; if (test__powisf2(0, 0x80000001, INFINITY)) return 1; if (test__powisf2(0, 0x80000000, INFINITY)) return 1; if (test__powisf2(-0., -1, -INFINITY)) return 1; if (test__powisf2(-0., -2, INFINITY)) return 1; if (test__powisf2(-0., -3, -INFINITY)) return 1; if (test__powisf2(-0., -4, INFINITY)) return 1; if (test__powisf2(-0., 0x80000002, INFINITY)) return 1; if (test__powisf2(-0., 0x80000001, -INFINITY)) return 1; if (test__powisf2(-0., 0x80000000, INFINITY)) return 1; if (test__powisf2(1, -1, 1)) return 1; if (test__powisf2(1, -2, 1)) return 1; if (test__powisf2(1, -3, 1)) return 1; if (test__powisf2(1, -4, 1)) return 1; if (test__powisf2(1, 0x80000002, 1)) return 1; if (test__powisf2(1, 0x80000001, 1)) return 1; if (test__powisf2(1, 0x80000000, 1)) return 1; if (test__powisf2(INFINITY, -1, 0)) return 1; if (test__powisf2(INFINITY, -2, 0)) return 1; if (test__powisf2(INFINITY, -3, 0)) return 1; if (test__powisf2(INFINITY, -4, 0)) return 1; if (test__powisf2(INFINITY, 0x80000002, 0)) return 1; if (test__powisf2(INFINITY, 0x80000001, 0)) return 1; if (test__powisf2(INFINITY, 0x80000000, 0)) return 1; if (test__powisf2(-INFINITY, -1, -0.)) return 1; if (test__powisf2(-INFINITY, -2, 0)) return 1; if (test__powisf2(-INFINITY, -3, -0.)) return 1; if (test__powisf2(-INFINITY, -4, 0)) return 1; if (test__powisf2(-INFINITY, 0x80000002, 0)) return 1; if (test__powisf2(-INFINITY, 0x80000001, -0.)) return 1; if (test__powisf2(-INFINITY, 0x80000000, 0)) return 1; if (test__powisf2(2, 10, 1024.)) return 1; if (test__powisf2(-2, 10, 1024.)) return 1; if (test__powisf2(2, -10, 1/1024.)) return 1; if (test__powisf2(-2, -10, 1/1024.)) return 1; if (test__powisf2(2, 19, 524288.)) return 1; if (test__powisf2(-2, 19, -524288.)) return 1; if (test__powisf2(2, -19, 1/524288.)) return 1; if (test__powisf2(-2, -19, -1/524288.)) return 1; if (test__powisf2(2, 31, 2147483648.)) return 1; if (test__powisf2(-2, 31, -2147483648.)) return 1; if (test__powisf2(2, -31, 1/2147483648.)) return 1; if (test__powisf2(-2, -31, -1/2147483648.)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatdidf_test.c0000664000175000017500000001120712516462465030103 0ustar mwhudsonmwhudson//===-- floatdidf.c - Test __floatdidf ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatdidf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include // Returns: convert a to a double, rounding toward even. // Assumption: double is a IEEE 64 bit floating point type // di_int is a 64 bit integral type // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI double __floatdidf(di_int a); int test__floatdidf(di_int a, double expected) { double x = __floatdidf(a); if (x != expected) printf("error in __floatdidf(%llX) = %a, expected %a\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; int main() { if (test__floatdidf(0, 0.0)) return 1; if (test__floatdidf(1, 1.0)) return 1; if (test__floatdidf(2, 2.0)) return 1; if (test__floatdidf(20, 20.0)) return 1; if (test__floatdidf(-1, -1.0)) return 1; if (test__floatdidf(-2, -2.0)) return 1; if (test__floatdidf(-20, -20.0)) return 1; if (test__floatdidf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62)) return 1; if (test__floatdidf(0x7FFFFFFFFFFFF800LL, 0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatdidf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62)) return 1; if (test__floatdidf(0x7FFFFFFFFFFFF000LL, 0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatdidf(0x8000008000000000LL, -0x1.FFFFFEp+62)) return 1; if (test__floatdidf(0x8000000000000800LL, -0x1.FFFFFFFFFFFFEp+62)) return 1; if (test__floatdidf(0x8000010000000000LL, -0x1.FFFFFCp+62)) return 1; if (test__floatdidf(0x8000000000001000LL, -0x1.FFFFFFFFFFFFCp+62)) return 1; if (test__floatdidf(0x8000000000000000LL, -0x1.000000p+63)) return 1; if (test__floatdidf(0x8000000000000001LL, -0x1.000000p+63)) return 1; if (test__floatdidf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50)) return 1; if (test__floatdidf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50)) return 1; if (test__floatdidf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50)) return 1; if (test__floatdidf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAFFFFFFCp+50)) return 1; if (test__floatdidf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50)) return 1; if (test__floatdidf(0x0007FB72E8000001LL, 0x1.FEDCBA0000004p+50)) return 1; if (test__floatdidf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50)) return 1; if (test__floatdidf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50)) return 1; if (test__floatdidf(0x0007FB72E7FFFFFFLL, 0x1.FEDCB9FFFFFFCp+50)) return 1; if (test__floatdidf(0x0007FB72E4000001LL, 0x1.FEDCB90000004p+50)) return 1; if (test__floatdidf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50)) return 1; if (test__floatdidf(0x023479FD0E092DC0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DA1LL, 0x1.1A3CFE870496Dp+57)) return 1; if (test__floatdidf(0x023479FD0E092DB0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DB8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DB6LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DBFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DC1LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DC7LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DC8LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DCFLL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DD0LL, 0x1.1A3CFE870496Ep+57)) return 1; if (test__floatdidf(0x023479FD0E092DD1LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatdidf(0x023479FD0E092DD8LL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatdidf(0x023479FD0E092DDFLL, 0x1.1A3CFE870496Fp+57)) return 1; if (test__floatdidf(0x023479FD0E092DE0LL, 0x1.1A3CFE870496Fp+57)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/truncsfhf2_test.c0000664000175000017500000000645112542340225030224 0ustar mwhudsonmwhudson//===--------------- truncsfhf2_test.c - Test __truncsfhf2 ----------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __truncsfhf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include "fp_test.h" uint16_t __truncsfhf2(float a); int test__truncsfhf2(float a, uint16_t expected) { uint16_t x = __truncsfhf2(a); int ret = compareResultH(x, expected); if (ret){ printf("error in test__truncsfhf2(%f) = %#.4x, " "expected %#.4x\n", a, x, fromRep16(expected)); } return ret; } char assumption_1[sizeof(__fp16) * CHAR_BIT == 16] = {0}; int main() { // qNaN if (test__truncsfhf2(makeQNaN32(), UINT16_C(0x7e00))) return 1; // NaN if (test__truncsfhf2(makeNaN32(UINT32_C(0x8000)), UINT16_C(0x7e00))) return 1; // inf if (test__truncsfhf2(makeInf32(), UINT16_C(0x7c00))) return 1; if (test__truncsfhf2(-makeInf32(), UINT16_C(0xfc00))) return 1; // zero if (test__truncsfhf2(0.0f, UINT16_C(0x0))) return 1; if (test__truncsfhf2(-0.0f, UINT16_C(0x8000))) return 1; if (test__truncsfhf2(3.1415926535f, UINT16_C(0x4248))) return 1; if (test__truncsfhf2(-3.1415926535f, UINT16_C(0xc248))) return 1; if (test__truncsfhf2(0x1.987124876876324p+100f, UINT16_C(0x7c00))) return 1; if (test__truncsfhf2(0x1.987124876876324p+12f, UINT16_C(0x6e62))) return 1; if (test__truncsfhf2(0x1.0p+0f, UINT16_C(0x3c00))) return 1; if (test__truncsfhf2(0x1.0p-14f, UINT16_C(0x0400))) return 1; // denormal if (test__truncsfhf2(0x1.0p-20f, UINT16_C(0x0010))) return 1; if (test__truncsfhf2(0x1.0p-24f, UINT16_C(0x0001))) return 1; if (test__truncsfhf2(-0x1.0p-24f, UINT16_C(0x8001))) return 1; if (test__truncsfhf2(0x1.5p-25f, UINT16_C(0x0001))) return 1; // and back to zero if (test__truncsfhf2(0x1.0p-25f, UINT16_C(0x0000))) return 1; if (test__truncsfhf2(-0x1.0p-25f, UINT16_C(0x8000))) return 1; // max (precise) if (test__truncsfhf2(65504.0f, UINT16_C(0x7bff))) return 1; // max (rounded) if (test__truncsfhf2(65519.0f, UINT16_C(0x7bff))) return 1; // max (to +inf) if (test__truncsfhf2(65520.0f, UINT16_C(0x7c00))) return 1; if (test__truncsfhf2(65536.0f, UINT16_C(0x7c00))) return 1; if (test__truncsfhf2(-65520.0f, UINT16_C(0xfc00))) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/udivmodsi4_test.c0000664000175000017500000000271612516462465030243 0ustar mwhudsonmwhudson//===-- udivmodsi4_test.c - Test __udivmodsi4 -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __udivmodsi4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: a / b extern COMPILER_RT_ABI su_int __udivmodsi4(su_int a, su_int b, su_int* rem); int test__udivmodsi4(su_int a, su_int b, su_int expected_result, su_int expected_rem) { su_int rem; su_int result = __udivmodsi4(a, b, &rem); if (result != expected_result) { printf("error in __udivmodsi4: %u / %u = %u, expected %u\n", a, b, result, expected_result); return 1; } if (rem != expected_rem) { printf("error in __udivmodsi4: %u mod %u = %u, expected %u\n", a, b, rem, expected_rem); return 1; } return 0; } int main() { if (test__udivmodsi4(0, 1, 0, 0)) return 1; if (test__udivmodsi4(2, 1, 2, 0)) return 1; if (test__udivmodsi4(19, 5, 3, 4)) return 1; if (test__udivmodsi4(0x80000000, 8, 0x10000000, 0)) return 1; if (test__udivmodsi4(0x80000003, 8, 0x10000000, 3)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatunditf_test.c0000664000175000017500000000420612564633211030457 0ustar mwhudsonmwhudson//===-- floatunditf_test.c - Test __floatunditf ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatunditf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #include #if __LDBL_MANT_DIG__ == 113 #include "fp_test.h" // Returns: long integer converted to long double COMPILER_RT_ABI long double __floatunditf(unsigned long long a); int test__floatunditf(unsigned long long a, uint64_t expectedHi, uint64_t expectedLo) { long double x = __floatunditf(a); int ret = compareResultLD(x, expectedHi, expectedLo); if (ret) printf("error in __floatunditf(%Lu) = %.20Lf, " "expected %.20Lf\n", a, x, fromRep128(expectedHi, expectedLo)); return ret; } char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0}; #endif int main() { #if __LDBL_MANT_DIG__ == 113 if (test__floatunditf(0xffffffffffffffffULL, UINT64_C(0x403effffffffffff), UINT64_C(0xfffe000000000000))) return 1; if (test__floatunditf(0xfffffffffffffffeULL, UINT64_C(0x403effffffffffff), UINT64_C(0xfffc000000000000))) return 1; if (test__floatunditf(0x8000000000000000ULL, UINT64_C(0x403e000000000000), UINT64_C(0x0))) return 1; if (test__floatunditf(0x7fffffffffffffffULL, UINT64_C(0x403dffffffffffff), UINT64_C(0xfffc000000000000))) return 1; if (test__floatunditf(0x123456789abcdef1ULL, UINT64_C(0x403b23456789abcd), UINT64_C(0xef10000000000000))) return 1; if (test__floatunditf(0x2ULL, UINT64_C(0x4000000000000000), UINT64_C(0x0))) return 1; if (test__floatunditf(0x1ULL, UINT64_C(0x3fff000000000000), UINT64_C(0x0))) return 1; if (test__floatunditf(0x0ULL, UINT64_C(0x0), UINT64_C(0x0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixunsdfti_test.c0000664000175000017500000000765412616720672030343 0ustar mwhudsonmwhudson//===-- fixunsdfti_test.c - Test __fixunsdfti -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixunsdfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: convert a to a unsigned long long, rounding toward zero. // Negative values all become zero. // Assumption: double is a IEEE 64 bit floating point type // tu_int is a 64 bit integral type // value in double is representable in tu_int or is negative // (no range checking performed) // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm #ifdef CRT_HAS_128BIT COMPILER_RT_ABI tu_int __fixunsdfti(double a); int test__fixunsdfti(double a, tu_int expected) { tu_int x = __fixunsdfti(a); if (x != expected) { utwords xt; xt.all = x; utwords expectedt; expectedt.all = expected; printf("error in __fixunsdfti(%A) = 0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(tu_int) == 2*sizeof(du_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__fixunsdfti(0.0, 0)) return 1; if (test__fixunsdfti(0.5, 0)) return 1; if (test__fixunsdfti(0.99, 0)) return 1; if (test__fixunsdfti(1.0, 1)) return 1; if (test__fixunsdfti(1.5, 1)) return 1; if (test__fixunsdfti(1.99, 1)) return 1; if (test__fixunsdfti(2.0, 2)) return 1; if (test__fixunsdfti(2.01, 2)) return 1; if (test__fixunsdfti(-0.5, 0)) return 1; if (test__fixunsdfti(-0.99, 0)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfti(-1.0, 0)) // libgcc ignores "returns 0 for negative input" spec return 1; if (test__fixunsdfti(-1.5, 0)) return 1; if (test__fixunsdfti(-1.99, 0)) return 1; if (test__fixunsdfti(-2.0, 0)) return 1; if (test__fixunsdfti(-2.01, 0)) return 1; #endif if (test__fixunsdfti(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixunsdfti(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; #if !TARGET_LIBGCC if (test__fixunsdfti(-0x1.FFFFFEp+62, 0)) return 1; if (test__fixunsdfti(-0x1.FFFFFCp+62, 0)) return 1; #endif if (test__fixunsdfti(0x1.FFFFFFFFFFFFFp+63, 0xFFFFFFFFFFFFF800LL)) return 1; if (test__fixunsdfti(0x1.0000000000000p+63, 0x8000000000000000LL)) return 1; if (test__fixunsdfti(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixunsdfti(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixunsdfti(0x1.FFFFFFFFFFFFFp+127, make_ti(0xFFFFFFFFFFFFF800LL, 0))) return 1; if (test__fixunsdfti(0x1.0000000000000p+127, make_ti(0x8000000000000000LL, 0))) return 1; if (test__fixunsdfti(0x1.FFFFFFFFFFFFFp+126, make_ti(0x7FFFFFFFFFFFFC00LL, 0))) return 1; if (test__fixunsdfti(0x1.FFFFFFFFFFFFEp+126, make_ti(0x7FFFFFFFFFFFF800LL, 0))) return 1; if (test__fixunsdfti(0x1.0000000000000p+128, make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; #if !TARGET_LIBGCC if (test__fixunsdfti(-0x1.FFFFFFFFFFFFFp+62, 0)) return 1; if (test__fixunsdfti(-0x1.FFFFFFFFFFFFEp+62, 0)) return 1; #endif #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/clear_cache_test.c0000664000175000017500000000436512452604052030354 0ustar mwhudsonmwhudson//===-- clear_cache_test.c - Test clear_cache -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include #include #include #if defined(_WIN32) #include void __clear_cache(void* start, void* end) { if (!FlushInstructionCache(GetCurrentProcess(), start, end-start)) exit(1); } #else #include extern void __clear_cache(void* start, void* end); #endif typedef int (*pfunc)(void); int func1() { return 1; } int func2() { return 2; } void *__attribute__((noinline)) memcpy_f(void *dst, const void *src, size_t n) { // ARM and MIPS nartually align functions, but use the LSB for ISA selection // (THUMB, MIPS16/uMIPS respectively). Ensure that the ISA bit is ignored in // the memcpy #if defined(__arm__) || defined(__mips__) return (void *)((uintptr_t)memcpy(dst, (void *)((uintptr_t)src & ~1), n) | ((uintptr_t)src & 1)); #else return memcpy(dst, (void *)((uintptr_t)src), n); #endif } unsigned char execution_buffer[128]; int main() { // make executable the page containing execution_buffer char* start = (char*)((uintptr_t)execution_buffer & (-4095)); char* end = (char*)((uintptr_t)(&execution_buffer[128+4096]) & (-4095)); #if defined(_WIN32) DWORD dummy_oldProt; MEMORY_BASIC_INFORMATION b; if (!VirtualQuery(start, &b, sizeof(b))) return 1; if (!VirtualProtect(b.BaseAddress, b.RegionSize, PAGE_EXECUTE_READWRITE, &b.Protect)) #else if (mprotect(start, end-start, PROT_READ|PROT_WRITE|PROT_EXEC) != 0) #endif return 1; // verify you can copy and execute a function pfunc f1 = (pfunc)memcpy_f(execution_buffer, func1, 128); __clear_cache(execution_buffer, &execution_buffer[128]); if ((*f1)() != 1) return 1; // verify you can overwrite a function with another pfunc f2 = (pfunc)memcpy_f(execution_buffer, func2, 128); __clear_cache(execution_buffer, &execution_buffer[128]); if ((*f2)() != 2) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/floatuntisf_test.c0000664000175000017500000001271112516462465030506 0ustar mwhudsonmwhudson//===-- floatuntisf.c - Test __floatuntisf --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __floatuntisf for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: convert a to a float, rounding toward even. // Assumption: float is a IEEE 32 bit floating point type // tu_int is a 128 bit integral type // seee eeee emmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI float __floatuntisf(tu_int a); int test__floatuntisf(tu_int a, float expected) { float x = __floatuntisf(a); if (x != expected) { utwords at; at.all = a; printf("error in __floatuntisf(0x%.16llX%.16llX) = %a, expected %a\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(tu_int) == 2*sizeof(du_int)] = {0}; char assumption_2[sizeof(tu_int)*CHAR_BIT == 128] = {0}; char assumption_3[sizeof(float)*CHAR_BIT == 32] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__floatuntisf(0, 0.0F)) return 1; if (test__floatuntisf(1, 1.0F)) return 1; if (test__floatuntisf(2, 2.0F)) return 1; if (test__floatuntisf(20, 20.0F)) return 1; if (test__floatuntisf(0x7FFFFF8000000000LL, 0x1.FFFFFEp+62F)) return 1; if (test__floatuntisf(0x7FFFFF0000000000LL, 0x1.FFFFFCp+62F)) return 1; if (test__floatuntisf(make_ti(0x8000008000000000LL, 0), 0x1.000001p+127F)) return 1; if (test__floatuntisf(make_ti(0x8000000000000800LL, 0), 0x1.0p+127F)) return 1; if (test__floatuntisf(make_ti(0x8000010000000000LL, 0), 0x1.000002p+127F)) return 1; if (test__floatuntisf(make_ti(0x8000000000000000LL, 0), 0x1.000000p+127F)) return 1; if (test__floatuntisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EA000000LL, 0x1.FEDCBA8p+50F)) return 1; if (test__floatuntisf(0x0007FB72EB000000LL, 0x1.FEDCBACp+50F)) return 1; if (test__floatuntisf(0x0007FB72EC000000LL, 0x1.FEDCBBp+50F)) return 1; if (test__floatuntisf(0x0007FB72E6000000LL, 0x1.FEDCB98p+50F)) return 1; if (test__floatuntisf(0x0007FB72E7000000LL, 0x1.FEDCB9Cp+50F)) return 1; if (test__floatuntisf(0x0007FB72E4000000LL, 0x1.FEDCB9p+50F)) return 1; if (test__floatuntisf(0xFFFFFFFFFFFFFFFELL, 0x1p+64F)) return 1; if (test__floatuntisf(0xFFFFFFFFFFFFFFFFLL, 0x1p+64F)) return 1; if (test__floatuntisf(0x0007FB72E8000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EA000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EB000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EBFFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72EC000000LL, 0x1.FEDCBCp+50F)) return 1; if (test__floatuntisf(0x0007FB72E8000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E6000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E7000000LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E7FFFFFFLL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E4000001LL, 0x1.FEDCBAp+50F)) return 1; if (test__floatuntisf(0x0007FB72E4000000LL, 0x1.FEDCB8p+50F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCB90000000000001LL), 0x1.FEDCBAp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBA0000000000000LL), 0x1.FEDCBAp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBAFFFFFFFFFFFFFLL), 0x1.FEDCBAp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBB0000000000000LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBB0000000000001LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBBFFFFFFFFFFFFFLL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBC0000000000000LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBC0000000000001LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBD0000000000000LL), 0x1.FEDCBCp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBD0000000000001LL), 0x1.FEDCBEp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBDFFFFFFFFFFFFFLL), 0x1.FEDCBEp+76F)) return 1; if (test__floatuntisf(make_ti(0x0000000000001FEDLL, 0xCBE0000000000000LL), 0x1.FEDCBEp+76F)) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/fixdfti_test.c0000664000175000017500000000730112516462465027604 0ustar mwhudsonmwhudson//===-- fixdfti_test.c - Test __fixdfti -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __fixdfti for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #ifdef CRT_HAS_128BIT // Returns: convert a to a signed long long, rounding toward zero. // Assumption: double is a IEEE 64 bit floating point type // su_int is a 32 bit integral type // value in double is representable in ti_int (no range checking performed) // seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm COMPILER_RT_ABI ti_int __fixdfti(double a); int test__fixdfti(double a, ti_int expected) { ti_int x = __fixdfti(a); if (x != expected) { twords xt; xt.all = x; twords expectedt; expectedt.all = expected; printf("error in __fixdfti(%A) = 0x%.16llX%.16llX, expected 0x%.16llX%.16llX\n", a, xt.s.high, xt.s.low, expectedt.s.high, expectedt.s.low); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0}; char assumption_3[sizeof(double)*CHAR_BIT == 64] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__fixdfti(0.0, 0)) return 1; if (test__fixdfti(0.5, 0)) return 1; if (test__fixdfti(0.99, 0)) return 1; if (test__fixdfti(1.0, 1)) return 1; if (test__fixdfti(1.5, 1)) return 1; if (test__fixdfti(1.99, 1)) return 1; if (test__fixdfti(2.0, 2)) return 1; if (test__fixdfti(2.01, 2)) return 1; if (test__fixdfti(-0.5, 0)) return 1; if (test__fixdfti(-0.99, 0)) return 1; if (test__fixdfti(-1.0, -1)) return 1; if (test__fixdfti(-1.5, -1)) return 1; if (test__fixdfti(-1.99, -1)) return 1; if (test__fixdfti(-2.0, -2)) return 1; if (test__fixdfti(-2.01, -2)) return 1; if (test__fixdfti(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL)) return 1; if (test__fixdfti(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL)) return 1; if (test__fixdfti(-0x1.FFFFFEp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000008000000000LL))) return 1; if (test__fixdfti(-0x1.FFFFFCp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000010000000000LL))) return 1; if (test__fixdfti(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL)) return 1; if (test__fixdfti(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; if (test__fixdfti(-0x1.FFFFFFFFFFFFFp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000400LL))) return 1; if (test__fixdfti(-0x1.FFFFFFFFFFFFEp+62, make_ti(0xFFFFFFFFFFFFFFFFLL, 0x8000000000000800LL))) return 1; if (test__fixdfti(0x1.FFFFFFFFFFFFFp+126, make_ti(0x7FFFFFFFFFFFFC00LL, 0))) return 1; if (test__fixdfti(0x1.FFFFFFFFFFFFEp+126, make_ti(0x7FFFFFFFFFFFF800LL, 0))) return 1; if (test__fixdfti(-0x1.FFFFFFFFFFFFFp+126, make_ti(0x8000000000000400LL, 0))) return 1; if (test__fixdfti(-0x1.FFFFFFFFFFFFEp+126, make_ti(0x8000000000000800LL, 0))) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/popcountti2_test.c0000664000175000017500000000421512516462465030436 0ustar mwhudsonmwhudson//===-- popcountti2_test.c - Test __popcountti2 ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __popcountti2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include #include #ifdef CRT_HAS_128BIT // Returns: count of 1 bits COMPILER_RT_ABI si_int __popcountti2(ti_int a); int naive_popcount(ti_int a) { int r = 0; for (; a; a = (tu_int)a >> 1) r += a & 1; return r; } int test__popcountti2(ti_int a) { si_int x = __popcountti2(a); si_int expected = naive_popcount(a); if (x != expected) { twords at; at.all = a; printf("error in __popcountti2(0x%.16llX%.16llX) = %d, expected %d\n", at.s.high, at.s.low, x, expected); } return x != expected; } char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0}; char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0}; #endif int main() { #ifdef CRT_HAS_128BIT if (test__popcountti2(0)) return 1; if (test__popcountti2(1)) return 1; if (test__popcountti2(2)) return 1; if (test__popcountti2(0xFFFFFFFFFFFFFFFDLL)) return 1; if (test__popcountti2(0xFFFFFFFFFFFFFFFELL)) return 1; if (test__popcountti2(0xFFFFFFFFFFFFFFFFLL)) return 1; if (test__popcountti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFDLL))) return 1; if (test__popcountti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFELL))) return 1; if (test__popcountti2(make_ti(0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL))) return 1; int i; for (i = 0; i < 10000; ++i) if (test__popcountti2(((ti_int)rand() << 96) | ((ti_int)rand() << 64) | ((ti_int)rand() << 32) | rand())) return 1; #else printf("skipped\n"); #endif return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/trampoline_setup_test.c0000664000175000017500000000241711570537001031530 0ustar mwhudsonmwhudson/* ===-- trampoline_setup_test.c - Test __trampoline_setup -----------------=== * * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== */ #include #include #include #include /* * Tests nested functions * The ppc compiler generates a call to __trampoline_setup * The i386 and x86_64 compilers generate a call to ___enable_execute_stack */ /* * Note that, nested functions are not ISO C and are not supported in Clang. */ #if !defined(__clang__) typedef int (*nested_func_t)(int x); nested_func_t proc; int main() { /* Some locals */ int c = 10; int d = 7; /* Define a nested function: */ int bar(int x) { return x*5 + c*d; }; /* Assign global to point to nested function * (really points to trampoline). */ proc = bar; /* Invoke nested function: */ c = 4; if ( (*proc)(3) != 43 ) return 1; d = 5; if ( (*proc)(4) != 40 ) return 1; /* Success. */ return 0; } #else int main() { printf("skipped\n"); return 0; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/clzdi2_test.c0000664000175000017500000000360012516462465027334 0ustar mwhudsonmwhudson//===-- clzdi2_test.c - Test __clzdi2 -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __clzdi2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" #include // Returns: the number of leading 0-bits // Precondition: a != 0 COMPILER_RT_ABI si_int __clzdi2(di_int a); int test__clzdi2(di_int a, si_int expected) { si_int x = __clzdi2(a); if (x != expected) printf("error in __clzdi2(0x%llX) = %d, expected %d\n", a, x, expected); return x != expected; } char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0}; int main() { const int N = (int)(sizeof(di_int) * CHAR_BIT); // if (test__clzdi2(0x00000000, N)) // undefined // return 1; if (test__clzdi2(0x00000001, N-1)) return 1; if (test__clzdi2(0x00000002, N-2)) return 1; if (test__clzdi2(0x00000003, N-2)) return 1; if (test__clzdi2(0x00000004, N-3)) return 1; if (test__clzdi2(0x00000005, N-3)) return 1; if (test__clzdi2(0x0000000A, N-4)) return 1; if (test__clzdi2(0x1000000A, N/2+3)) return 1; if (test__clzdi2(0x2000000A, N/2+2)) return 1; if (test__clzdi2(0x6000000A, N/2+1)) return 1; if (test__clzdi2(0x8000000AuLL, N/2)) return 1; if (test__clzdi2(0x000005008000000AuLL, 21)) return 1; if (test__clzdi2(0x020005008000000AuLL, 6)) return 1; if (test__clzdi2(0x720005008000000AuLL, 1)) return 1; if (test__clzdi2(0x820005008000000AuLL, 0)) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/Unit/truncdfhf2_test.c0000664000175000017500000000643112542340225030203 0ustar mwhudsonmwhudson//===--------------- truncdfhf2_test.c - Test __truncdfhf2 ----------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file tests __truncdfhf2 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include #include "fp_test.h" uint16_t __truncdfhf2(double a); int test__truncdfhf2(double a, uint16_t expected) { uint16_t x = __truncdfhf2(a); int ret = compareResultH(x, expected); if (ret){ printf("error in test__truncdfhf2(%f) = %#.4x, " "expected %#.4x\n", a, x, fromRep16(expected)); } return ret; } char assumption_1[sizeof(__fp16) * CHAR_BIT == 16] = {0}; int main() { // qNaN if (test__truncdfhf2(makeQNaN64(), UINT16_C(0x7e00))) return 1; // NaN if (test__truncdfhf2(makeNaN64(UINT64_C(0x8000)), UINT16_C(0x7e00))) return 1; // inf if (test__truncdfhf2(makeInf64(), UINT16_C(0x7c00))) return 1; if (test__truncdfhf2(-makeInf64(), UINT16_C(0xfc00))) return 1; // zero if (test__truncdfhf2(0.0, UINT16_C(0x0))) return 1; if (test__truncdfhf2(-0.0, UINT16_C(0x8000))) return 1; if (test__truncdfhf2(3.1415926535, UINT16_C(0x4248))) return 1; if (test__truncdfhf2(-3.1415926535, UINT16_C(0xc248))) return 1; if (test__truncdfhf2(0x1.987124876876324p+1000, UINT16_C(0x7c00))) return 1; if (test__truncdfhf2(0x1.987124876876324p+12, UINT16_C(0x6e62))) return 1; if (test__truncdfhf2(0x1.0p+0, UINT16_C(0x3c00))) return 1; if (test__truncdfhf2(0x1.0p-14, UINT16_C(0x0400))) return 1; // denormal if (test__truncdfhf2(0x1.0p-20, UINT16_C(0x0010))) return 1; if (test__truncdfhf2(0x1.0p-24, UINT16_C(0x0001))) return 1; if (test__truncdfhf2(-0x1.0p-24, UINT16_C(0x8001))) return 1; if (test__truncdfhf2(0x1.5p-25, UINT16_C(0x0001))) return 1; // and back to zero if (test__truncdfhf2(0x1.0p-25, UINT16_C(0x0000))) return 1; if (test__truncdfhf2(-0x1.0p-25, UINT16_C(0x8000))) return 1; // max (precise) if (test__truncdfhf2(65504.0, UINT16_C(0x7bff))) return 1; // max (rounded) if (test__truncdfhf2(65519.0, UINT16_C(0x7bff))) return 1; // max (to +inf) if (test__truncdfhf2(65520.0, UINT16_C(0x7c00))) return 1; if (test__truncdfhf2(-65520.0, UINT16_C(0xfc00))) return 1; if (test__truncdfhf2(65536.0, UINT16_C(0x7c00))) return 1; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/timing/0000775000175000017500000000000013040224624025275 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/timing/udivdi3.c0000664000175000017500000000246311221175607027022 0ustar mwhudsonmwhudson#include "timing.h" #include #define INPUT_TYPE uint64_t #define INPUT_SIZE 256 #define FUNCTION_NAME __udivdi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input1, INPUT_TYPE input2); int main(int argc, char *argv[]) { INPUT_TYPE input1[INPUT_SIZE]; INPUT_TYPE input2[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); input2[i] = ((((uint64_t)rand() << 36) | (uint64_t)rand()) >> (rand() & 63)) + 1LL; } int64_t fixedInput = INT64_C(0x1234567890ABCDEF); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int32_t #define INPUT_SIZE 256 #define FUNCTION_NAME __modsi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input1, INPUT_TYPE input2); int main(int argc, char *argv[]) { INPUT_TYPE input1[INPUT_SIZE]; INPUT_TYPE input2[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i #define INPUT_TYPE uint64_t #define INPUT_SIZE 512 #define FUNCTION_NAME __floatundixf #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a long double FUNCTION_NAME(INPUT_TYPE x); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 256 #define FUNCTION_NAME __negdi2 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); } int64_t fixedInput = INT64_C(0x1234567890ABCDEF); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 512 #define FUNCTION_NAME __floatdixf #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a long double FUNCTION_NAME(INPUT_TYPE x); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 512 #define FUNCTION_NAME __floatdisf #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a float FUNCTION_NAME(INPUT_TYPE x); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE uint64_t #define INPUT_SIZE 256 #define FUNCTION_NAME __umoddi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input1, INPUT_TYPE input2); int main(int argc, char *argv[]) { INPUT_TYPE input1[INPUT_SIZE]; INPUT_TYPE input2[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); input2[i] = ((((uint64_t)rand() << 36) | (uint64_t)rand()) >> (rand() & 63)) + 1LL; } int64_t fixedInput = INT64_C(0x1234567890ABCDEF); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int #define INPUT_SIZE 512 #define FUNCTION_NAME __ashldi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a int64_t FUNCTION_NAME(int64_t input, INPUT_TYPE count); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 256 #define FUNCTION_NAME __divdi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input1, INPUT_TYPE input2); int main(int argc, char *argv[]) { INPUT_TYPE input1[INPUT_SIZE]; INPUT_TYPE input2[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); input2[i] = ((((int64_t)rand() << 36) | (uint64_t)rand()) >> (rand() & 63)) + 1LL; } int64_t fixedInput = INT64_C(0x1234567890ABCDEF); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 512 #define FUNCTION_NAME __floatdidf #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a double FUNCTION_NAME(INPUT_TYPE x); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 256 #define FUNCTION_NAME __muldi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input1, INPUT_TYPE input2); int main(int argc, char *argv[]) { INPUT_TYPE input1[INPUT_SIZE]; INPUT_TYPE input2[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); input2[i] = (((int64_t)rand() << 36) | (uint64_t)rand()) >> (rand() & 63); } int64_t fixedInput = INT64_C(0x1234567890ABCDEF); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE int #define INPUT_SIZE 512 #define FUNCTION_NAME __ashrdi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a int64_t FUNCTION_NAME(int64_t input, INPUT_TYPE count); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a double __floatundidf(uint64_t x); int main(int argc, char *argv[]) { #define INPUT_SIZE 512 uint64_t input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #define INPUT_TYPE uint64_t #define INPUT_SIZE 512 #define FUNCTION_NAME __floatundisf #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a float FUNCTION_NAME(INPUT_TYPE x); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i #include #include double intervalInCycles( uint64_t startTime, uint64_t endTime ) { uint64_t rawTime = endTime - startTime; static double conversion = 0.0; if( 0.0 == conversion ) { mach_timebase_info_data_t info; kern_return_t err = mach_timebase_info( &info ); if( 0 != err ) return 0; uint64_t freq = 0; size_t freqSize = sizeof( freq ); int err2 = sysctlbyname( "hw.cpufrequency", &freq, &freqSize, NULL, 0L ); if( 0 != err2 ) return 0; conversion = (double) freq * (1e-9 * (double) info.numer / (double) info.denom); } return (double) rawTime * conversion; } golang-1.8-race-detector-runtime_0.0+svn285455/test/builtins/timing/lshrdi3.c0000664000175000017500000000217011221175607027016 0ustar mwhudsonmwhudson#include "timing.h" #include #define INPUT_TYPE int #define INPUT_SIZE 512 #define FUNCTION_NAME __lshrdi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a int64_t FUNCTION_NAME(int64_t input, INPUT_TYPE count); int main(int argc, char *argv[]) { INPUT_TYPE input[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i #define INPUT_TYPE int64_t #define INPUT_SIZE 256 #define FUNCTION_NAME __moddi3 #ifndef LIBNAME #define LIBNAME UNKNOWN #endif #define LIBSTRING LIBSTRINGX(LIBNAME) #define LIBSTRINGX(a) LIBSTRINGXX(a) #define LIBSTRINGXX(a) #a INPUT_TYPE FUNCTION_NAME(INPUT_TYPE input1, INPUT_TYPE input2); int main(int argc, char *argv[]) { INPUT_TYPE input1[INPUT_SIZE]; INPUT_TYPE input2[INPUT_SIZE]; int i, j; srand(42); // Initialize the input array with data of various sizes. for (i=0; i> (rand() & 63); input2[i] = ((((int64_t)rand() << 36) | (uint64_t)rand()) >> (rand() & 63)) + 1LL; } int64_t fixedInput = INT64_C(0x1234567890ABCDEF); double bestTime = __builtin_inf(); void *dummyp; for (j=0; j<1024; ++j) { uint64_t startTime = mach_absolute_time(); for (i=0; i struct CompleteObjectLocator { int is_image_relative; int offset_to_top; int vfptr_offset; int rtti_addr; int chd_addr; int obj_locator_addr; }; struct CompleteObjectLocatorAbs { int is_image_relative; int offset_to_top; int vfptr_offset; std::type_info *rtti_addr; void *chd_addr; CompleteObjectLocator *obj_locator_addr; }; bool __ubsan::checkDynamicType(void *Object, void *Type, HashValue Hash) { // FIXME: Implement. return false; } __ubsan::DynamicTypeInfo __ubsan::getDynamicTypeInfoFromVtable(void *VtablePtr) { // The virtual table may not have a complete object locator if the object // was compiled without RTTI (i.e. we might be reading from some other global // laid out before the virtual table), so we need to carefully validate each // pointer dereference and perform sanity checks. CompleteObjectLocator **obj_locator_ptr = ((CompleteObjectLocator**)VtablePtr)-1; if (!IsAccessibleMemoryRange((uptr)obj_locator_ptr, sizeof(void*))) return DynamicTypeInfo(0, 0, 0); CompleteObjectLocator *obj_locator = *obj_locator_ptr; if (!IsAccessibleMemoryRange((uptr)obj_locator, sizeof(CompleteObjectLocator))) return DynamicTypeInfo(0, 0, 0); std::type_info *tinfo; if (obj_locator->is_image_relative == 1) { char *image_base = ((char *)obj_locator) - obj_locator->obj_locator_addr; tinfo = (std::type_info *)(image_base + obj_locator->rtti_addr); } else if (obj_locator->is_image_relative == 0) tinfo = ((CompleteObjectLocatorAbs *)obj_locator)->rtti_addr; else // Probably not a complete object locator. return DynamicTypeInfo(0, 0, 0); if (!IsAccessibleMemoryRange((uptr)tinfo, sizeof(std::type_info))) return DynamicTypeInfo(0, 0, 0); // Okay, this is probably a std::type_info. Request its name. // FIXME: Implement a base class search like we do for Itanium. return DynamicTypeInfo(tinfo->name(), obj_locator->offset_to_top, ""); } #endif // CAN_SANITIZE_UB && SANITIZER_WINDOWS golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_flags.h0000664000175000017500000000240612507072134025517 0ustar mwhudsonmwhudson//===-- ubsan_flags.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Runtime flags for UndefinedBehaviorSanitizer. // //===----------------------------------------------------------------------===// #ifndef UBSAN_FLAGS_H #define UBSAN_FLAGS_H #include "sanitizer_common/sanitizer_internal_defs.h" namespace __sanitizer { class FlagParser; } namespace __ubsan { struct Flags { #define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "ubsan_flags.inc" #undef UBSAN_FLAG void SetDefaults(); }; extern Flags ubsan_flags; inline Flags *flags() { return &ubsan_flags; } void InitializeFlags(); void RegisterUbsanFlags(FlagParser *parser, Flags *f); const char *MaybeCallUbsanDefaultOptions(); } // namespace __ubsan extern "C" { // Users may provide their own implementation of __ubsan_default_options to // override the default flag values. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *__ubsan_default_options(); } // extern "C" #endif // UBSAN_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_handlers.h0000664000175000017500000001206012654476330026231 0ustar mwhudsonmwhudson//===-- ubsan_handlers.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Entry points to the runtime library for Clang's undefined behavior sanitizer. // //===----------------------------------------------------------------------===// #ifndef UBSAN_HANDLERS_H #define UBSAN_HANDLERS_H #include "ubsan_value.h" namespace __ubsan { struct TypeMismatchData { SourceLocation Loc; const TypeDescriptor &Type; uptr Alignment; unsigned char TypeCheckKind; }; #define UNRECOVERABLE(checkname, ...) \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE NORETURN \ void __ubsan_handle_ ## checkname( __VA_ARGS__ ); #define RECOVERABLE(checkname, ...) \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE \ void __ubsan_handle_ ## checkname( __VA_ARGS__ ); \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE NORETURN \ void __ubsan_handle_ ## checkname ## _abort( __VA_ARGS__ ); /// \brief Handle a runtime type check failure, caused by either a misaligned /// pointer, a null pointer, or a pointer to insufficient storage for the /// type. RECOVERABLE(type_mismatch, TypeMismatchData *Data, ValueHandle Pointer) struct OverflowData { SourceLocation Loc; const TypeDescriptor &Type; }; /// \brief Handle an integer addition overflow. RECOVERABLE(add_overflow, OverflowData *Data, ValueHandle LHS, ValueHandle RHS) /// \brief Handle an integer subtraction overflow. RECOVERABLE(sub_overflow, OverflowData *Data, ValueHandle LHS, ValueHandle RHS) /// \brief Handle an integer multiplication overflow. RECOVERABLE(mul_overflow, OverflowData *Data, ValueHandle LHS, ValueHandle RHS) /// \brief Handle a signed integer overflow for a unary negate operator. RECOVERABLE(negate_overflow, OverflowData *Data, ValueHandle OldVal) /// \brief Handle an INT_MIN/-1 overflow or division by zero. RECOVERABLE(divrem_overflow, OverflowData *Data, ValueHandle LHS, ValueHandle RHS) struct ShiftOutOfBoundsData { SourceLocation Loc; const TypeDescriptor &LHSType; const TypeDescriptor &RHSType; }; /// \brief Handle a shift where the RHS is out of bounds or a left shift where /// the LHS is negative or overflows. RECOVERABLE(shift_out_of_bounds, ShiftOutOfBoundsData *Data, ValueHandle LHS, ValueHandle RHS) struct OutOfBoundsData { SourceLocation Loc; const TypeDescriptor &ArrayType; const TypeDescriptor &IndexType; }; /// \brief Handle an array index out of bounds error. RECOVERABLE(out_of_bounds, OutOfBoundsData *Data, ValueHandle Index) struct UnreachableData { SourceLocation Loc; }; /// \brief Handle a __builtin_unreachable which is reached. UNRECOVERABLE(builtin_unreachable, UnreachableData *Data) /// \brief Handle reaching the end of a value-returning function. UNRECOVERABLE(missing_return, UnreachableData *Data) struct VLABoundData { SourceLocation Loc; const TypeDescriptor &Type; }; /// \brief Handle a VLA with a non-positive bound. RECOVERABLE(vla_bound_not_positive, VLABoundData *Data, ValueHandle Bound) // Keeping this around for binary compatibility with (sanitized) programs // compiled with older compilers. struct FloatCastOverflowData { const TypeDescriptor &FromType; const TypeDescriptor &ToType; }; struct FloatCastOverflowDataV2 { SourceLocation Loc; const TypeDescriptor &FromType; const TypeDescriptor &ToType; }; /// Handle overflow in a conversion to or from a floating-point type. /// void *Data is one of FloatCastOverflowData* or FloatCastOverflowDataV2* RECOVERABLE(float_cast_overflow, void *Data, ValueHandle From) struct InvalidValueData { SourceLocation Loc; const TypeDescriptor &Type; }; /// \brief Handle a load of an invalid value for the type. RECOVERABLE(load_invalid_value, InvalidValueData *Data, ValueHandle Val) struct FunctionTypeMismatchData { SourceLocation Loc; const TypeDescriptor &Type; }; RECOVERABLE(function_type_mismatch, FunctionTypeMismatchData *Data, ValueHandle Val) struct NonNullReturnData { SourceLocation Loc; SourceLocation AttrLoc; }; /// \brief Handle returning null from function with returns_nonnull attribute. RECOVERABLE(nonnull_return, NonNullReturnData *Data) struct NonNullArgData { SourceLocation Loc; SourceLocation AttrLoc; int ArgIndex; }; /// \brief Handle passing null pointer to function with nonnull attribute. RECOVERABLE(nonnull_arg, NonNullArgData *Data) /// \brief Known CFI check kinds. /// Keep in sync with the enum of the same name in CodeGenFunction.h enum CFITypeCheckKind : unsigned char { CFITCK_VCall, CFITCK_NVCall, CFITCK_DerivedCast, CFITCK_UnrelatedCast, CFITCK_ICall, }; struct CFICheckFailData { CFITypeCheckKind CheckKind; SourceLocation Loc; const TypeDescriptor &Type; }; /// \brief Handle control flow integrity failures. RECOVERABLE(cfi_check_fail, CFICheckFailData *Data, ValueHandle Function, uptr VtableIsValid) } #endif // UBSAN_HANDLERS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan.syms.extra0000664000175000017500000000001212207140322026210 0ustar mwhudsonmwhudson__ubsan_* golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_diag.cc0000664000175000017500000003354612670411456025503 0ustar mwhudsonmwhudson//===-- ubsan_diag.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Diagnostic reporting for the UBSan runtime. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_diag.h" #include "ubsan_init.h" #include "ubsan_flags.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_report_decorator.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_stacktrace_printer.h" #include "sanitizer_common/sanitizer_suppressions.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include using namespace __ubsan; static void MaybePrintStackTrace(uptr pc, uptr bp) { // We assume that flags are already parsed, as UBSan runtime // will definitely be called when we print the first diagnostics message. if (!flags()->print_stacktrace) return; // We can only use slow unwind, as we don't have any information about stack // top/bottom. // FIXME: It's better to respect "fast_unwind_on_fatal" runtime flag and // fetch stack top/bottom information if we have it (e.g. if we're running // under ASan). if (StackTrace::WillUseFastUnwind(false)) return; BufferedStackTrace stack; stack.Unwind(kStackTraceMax, pc, bp, 0, 0, 0, false); stack.Print(); } static const char *ConvertTypeToString(ErrorType Type) { switch (Type) { #define UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) \ case ErrorType::Name: \ return SummaryKind; #include "ubsan_checks.inc" #undef UBSAN_CHECK } UNREACHABLE("unknown ErrorType!"); } static const char *ConvertTypeToFlagName(ErrorType Type) { switch (Type) { #define UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) \ case ErrorType::Name: \ return FSanitizeFlagName; #include "ubsan_checks.inc" #undef UBSAN_CHECK } UNREACHABLE("unknown ErrorType!"); } static void MaybeReportErrorSummary(Location Loc, ErrorType Type) { if (!common_flags()->print_summary) return; if (!flags()->report_error_type) Type = ErrorType::GenericUB; const char *ErrorKind = ConvertTypeToString(Type); if (Loc.isSourceLocation()) { SourceLocation SLoc = Loc.getSourceLocation(); if (!SLoc.isInvalid()) { AddressInfo AI; AI.file = internal_strdup(SLoc.getFilename()); AI.line = SLoc.getLine(); AI.column = SLoc.getColumn(); AI.function = internal_strdup(""); // Avoid printing ?? as function name. ReportErrorSummary(ErrorKind, AI); AI.Clear(); return; } } else if (Loc.isSymbolizedStack()) { const AddressInfo &AI = Loc.getSymbolizedStack()->info; ReportErrorSummary(ErrorKind, AI); return; } ReportErrorSummary(ErrorKind); } namespace { class Decorator : public SanitizerCommonDecorator { public: Decorator() : SanitizerCommonDecorator() {} const char *Highlight() const { return Green(); } const char *EndHighlight() const { return Default(); } const char *Note() const { return Black(); } const char *EndNote() const { return Default(); } }; } SymbolizedStack *__ubsan::getSymbolizedLocation(uptr PC) { InitAsStandaloneIfNecessary(); return Symbolizer::GetOrInit()->SymbolizePC(PC); } Diag &Diag::operator<<(const TypeDescriptor &V) { return AddArg(V.getTypeName()); } Diag &Diag::operator<<(const Value &V) { if (V.getType().isSignedIntegerTy()) AddArg(V.getSIntValue()); else if (V.getType().isUnsignedIntegerTy()) AddArg(V.getUIntValue()); else if (V.getType().isFloatTy()) AddArg(V.getFloatValue()); else AddArg(""); return *this; } /// Hexadecimal printing for numbers too large for Printf to handle directly. static void RenderHex(InternalScopedString *Buffer, UIntMax Val) { #if HAVE_INT128_T Buffer->append("0x%08x%08x%08x%08x", (unsigned int)(Val >> 96), (unsigned int)(Val >> 64), (unsigned int)(Val >> 32), (unsigned int)(Val)); #else UNREACHABLE("long long smaller than 64 bits?"); #endif } static void RenderLocation(InternalScopedString *Buffer, Location Loc) { switch (Loc.getKind()) { case Location::LK_Source: { SourceLocation SLoc = Loc.getSourceLocation(); if (SLoc.isInvalid()) Buffer->append(""); else RenderSourceLocation(Buffer, SLoc.getFilename(), SLoc.getLine(), SLoc.getColumn(), common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix); return; } case Location::LK_Memory: Buffer->append("%p", Loc.getMemoryLocation()); return; case Location::LK_Symbolized: { const AddressInfo &Info = Loc.getSymbolizedStack()->info; if (Info.file) RenderSourceLocation(Buffer, Info.file, Info.line, Info.column, common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix); else if (Info.module) RenderModuleLocation(Buffer, Info.module, Info.module_offset, common_flags()->strip_path_prefix); else Buffer->append("%p", Info.address); return; } case Location::LK_Null: Buffer->append(""); return; } } static void RenderText(InternalScopedString *Buffer, const char *Message, const Diag::Arg *Args) { for (const char *Msg = Message; *Msg; ++Msg) { if (*Msg != '%') { Buffer->append("%c", *Msg); continue; } const Diag::Arg &A = Args[*++Msg - '0']; switch (A.Kind) { case Diag::AK_String: Buffer->append("%s", A.String); break; case Diag::AK_TypeName: { if (SANITIZER_WINDOWS) // The Windows implementation demangles names early. Buffer->append("'%s'", A.String); else Buffer->append("'%s'", Symbolizer::GetOrInit()->Demangle(A.String)); break; } case Diag::AK_SInt: // 'long long' is guaranteed to be at least 64 bits wide. if (A.SInt >= INT64_MIN && A.SInt <= INT64_MAX) Buffer->append("%lld", (long long)A.SInt); else RenderHex(Buffer, A.SInt); break; case Diag::AK_UInt: if (A.UInt <= UINT64_MAX) Buffer->append("%llu", (unsigned long long)A.UInt); else RenderHex(Buffer, A.UInt); break; case Diag::AK_Float: { // FIXME: Support floating-point formatting in sanitizer_common's // printf, and stop using snprintf here. char FloatBuffer[32]; #if SANITIZER_WINDOWS sprintf_s(FloatBuffer, sizeof(FloatBuffer), "%Lg", (long double)A.Float); #else snprintf(FloatBuffer, sizeof(FloatBuffer), "%Lg", (long double)A.Float); #endif Buffer->append("%s", FloatBuffer); break; } case Diag::AK_Pointer: Buffer->append("%p", A.Pointer); break; } } } /// Find the earliest-starting range in Ranges which ends after Loc. static Range *upperBound(MemoryLocation Loc, Range *Ranges, unsigned NumRanges) { Range *Best = 0; for (unsigned I = 0; I != NumRanges; ++I) if (Ranges[I].getEnd().getMemoryLocation() > Loc && (!Best || Best->getStart().getMemoryLocation() > Ranges[I].getStart().getMemoryLocation())) Best = &Ranges[I]; return Best; } static inline uptr subtractNoOverflow(uptr LHS, uptr RHS) { return (LHS < RHS) ? 0 : LHS - RHS; } static inline uptr addNoOverflow(uptr LHS, uptr RHS) { const uptr Limit = (uptr)-1; return (LHS > Limit - RHS) ? Limit : LHS + RHS; } /// Render a snippet of the address space near a location. static void PrintMemorySnippet(const Decorator &Decor, MemoryLocation Loc, Range *Ranges, unsigned NumRanges, const Diag::Arg *Args) { // Show at least the 8 bytes surrounding Loc. const unsigned MinBytesNearLoc = 4; MemoryLocation Min = subtractNoOverflow(Loc, MinBytesNearLoc); MemoryLocation Max = addNoOverflow(Loc, MinBytesNearLoc); MemoryLocation OrigMin = Min; for (unsigned I = 0; I < NumRanges; ++I) { Min = __sanitizer::Min(Ranges[I].getStart().getMemoryLocation(), Min); Max = __sanitizer::Max(Ranges[I].getEnd().getMemoryLocation(), Max); } // If we have too many interesting bytes, prefer to show bytes after Loc. const unsigned BytesToShow = 32; if (Max - Min > BytesToShow) Min = __sanitizer::Min(Max - BytesToShow, OrigMin); Max = addNoOverflow(Min, BytesToShow); if (!IsAccessibleMemoryRange(Min, Max - Min)) { Printf("\n"); return; } // Emit data. InternalScopedString Buffer(1024); for (uptr P = Min; P != Max; ++P) { unsigned char C = *reinterpret_cast(P); Buffer.append("%s%02x", (P % 8 == 0) ? " " : " ", C); } Buffer.append("\n"); // Emit highlights. Buffer.append(Decor.Highlight()); Range *InRange = upperBound(Min, Ranges, NumRanges); for (uptr P = Min; P != Max; ++P) { char Pad = ' ', Byte = ' '; if (InRange && InRange->getEnd().getMemoryLocation() == P) InRange = upperBound(P, Ranges, NumRanges); if (!InRange && P > Loc) break; if (InRange && InRange->getStart().getMemoryLocation() < P) Pad = '~'; if (InRange && InRange->getStart().getMemoryLocation() <= P) Byte = '~'; if (P % 8 == 0) Buffer.append("%c", Pad); Buffer.append("%c", Pad); Buffer.append("%c", P == Loc ? '^' : Byte); Buffer.append("%c", Byte); } Buffer.append("%s\n", Decor.EndHighlight()); // Go over the line again, and print names for the ranges. InRange = 0; unsigned Spaces = 0; for (uptr P = Min; P != Max; ++P) { if (!InRange || InRange->getEnd().getMemoryLocation() == P) InRange = upperBound(P, Ranges, NumRanges); if (!InRange) break; Spaces += (P % 8) == 0 ? 2 : 1; if (InRange && InRange->getStart().getMemoryLocation() == P) { while (Spaces--) Buffer.append(" "); RenderText(&Buffer, InRange->getText(), Args); Buffer.append("\n"); // FIXME: We only support naming one range for now! break; } Spaces += 2; } Printf("%s", Buffer.data()); // FIXME: Print names for anything we can identify within the line: // // * If we can identify the memory itself as belonging to a particular // global, stack variable, or dynamic allocation, then do so. // // * If we have a pointer-size, pointer-aligned range highlighted, // determine whether the value of that range is a pointer to an // entity which we can name, and if so, print that name. // // This needs an external symbolizer, or (preferably) ASan instrumentation. } Diag::~Diag() { // All diagnostics should be printed under report mutex. CommonSanitizerReportMutex.CheckLocked(); Decorator Decor; InternalScopedString Buffer(1024); Buffer.append(Decor.Bold()); RenderLocation(&Buffer, Loc); Buffer.append(":"); switch (Level) { case DL_Error: Buffer.append("%s runtime error: %s%s", Decor.Warning(), Decor.EndWarning(), Decor.Bold()); break; case DL_Note: Buffer.append("%s note: %s", Decor.Note(), Decor.EndNote()); break; } RenderText(&Buffer, Message, Args); Buffer.append("%s\n", Decor.Default()); Printf("%s", Buffer.data()); if (Loc.isMemoryLocation()) PrintMemorySnippet(Decor, Loc.getMemoryLocation(), Ranges, NumRanges, Args); } ScopedReport::ScopedReport(ReportOptions Opts, Location SummaryLoc, ErrorType Type) : Opts(Opts), SummaryLoc(SummaryLoc), Type(Type) { InitAsStandaloneIfNecessary(); CommonSanitizerReportMutex.Lock(); } ScopedReport::~ScopedReport() { MaybePrintStackTrace(Opts.pc, Opts.bp); MaybeReportErrorSummary(SummaryLoc, Type); CommonSanitizerReportMutex.Unlock(); if (flags()->halt_on_error) Die(); } ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)]; static SuppressionContext *suppression_ctx = nullptr; static const char kVptrCheck[] = "vptr_check"; static const char *kSuppressionTypes[] = { #define UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) FSanitizeFlagName, #include "ubsan_checks.inc" #undef UBSAN_CHECK kVptrCheck, }; void __ubsan::InitializeSuppressions() { CHECK_EQ(nullptr, suppression_ctx); suppression_ctx = new (suppression_placeholder) // NOLINT SuppressionContext(kSuppressionTypes, ARRAY_SIZE(kSuppressionTypes)); suppression_ctx->ParseFromFile(flags()->suppressions); } bool __ubsan::IsVptrCheckSuppressed(const char *TypeName) { InitAsStandaloneIfNecessary(); CHECK(suppression_ctx); Suppression *s; return suppression_ctx->Match(TypeName, kVptrCheck, &s); } bool __ubsan::IsPCSuppressed(ErrorType ET, uptr PC, const char *Filename) { InitAsStandaloneIfNecessary(); CHECK(suppression_ctx); const char *SuppType = ConvertTypeToFlagName(ET); // Fast path: don't symbolize PC if there is no suppressions for given UB // type. if (!suppression_ctx->HasSuppressionType(SuppType)) return false; Suppression *s = nullptr; // Suppress by file name known to runtime. if (Filename != nullptr && suppression_ctx->Match(Filename, SuppType, &s)) return true; // Suppress by module name. if (const char *Module = Symbolizer::GetOrInit()->GetModuleNameForPc(PC)) { if (suppression_ctx->Match(Module, SuppType, &s)) return true; } // Suppress by function or source file name from debug info. SymbolizedStackHolder Stack(Symbolizer::GetOrInit()->SymbolizePC(PC)); const AddressInfo &AI = Stack.get()->info; return suppression_ctx->Match(AI.function, SuppType, &s) || suppression_ctx->Match(AI.file, SuppType, &s); } #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/CMakeLists.txt0000664000175000017500000000737612760126006025634 0ustar mwhudsonmwhudson# Build for the undefined behavior sanitizer runtime support library. set(UBSAN_SOURCES ubsan_diag.cc ubsan_init.cc ubsan_flags.cc ubsan_handlers.cc ubsan_value.cc ) set(UBSAN_STANDALONE_SOURCES ubsan_init_standalone.cc ) set(UBSAN_CXXABI_SOURCES ubsan_handlers_cxx.cc ubsan_type_hash.cc ubsan_type_hash_itanium.cc ubsan_type_hash_win.cc ) include_directories(..) set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF UBSAN_CFLAGS) append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS) set(UBSAN_STANDALONE_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF UBSAN_STANDALONE_CFLAGS) append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_STANDALONE_CFLAGS) set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(ON UBSAN_CXXFLAGS) append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS) add_compiler_rt_component(ubsan) if(APPLE) set(UBSAN_COMMON_SOURCES ${UBSAN_SOURCES}) if(SANITIZER_CAN_USE_CXXABI) list(APPEND UBSAN_COMMON_SOURCES ${UBSAN_CXXABI_SOURCES}) endif() # Common parts of UBSan runtime. add_compiler_rt_object_libraries(RTUbsan OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH} SOURCES ${UBSAN_COMMON_SOURCES} CFLAGS ${UBSAN_CXXFLAGS}) if(COMPILER_RT_HAS_UBSAN) # Initializer of standalone UBSan runtime. add_compiler_rt_object_libraries(RTUbsan_standalone OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${UBSAN_SUPPORTED_ARCH} SOURCES ${UBSAN_STANDALONE_SOURCES} CFLAGS ${UBSAN_STANDALONE_CFLAGS}) add_compiler_rt_runtime(clang_rt.ubsan SHARED OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${UBSAN_SUPPORTED_ARCH} OBJECT_LIBS RTUbsan RTUbsan_standalone RTSanitizerCommon RTSanitizerCommonLibc PARENT_TARGET ubsan) endif() else() # Common parts of UBSan runtime. add_compiler_rt_object_libraries(RTUbsan ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH} SOURCES ${UBSAN_SOURCES} CFLAGS ${UBSAN_CFLAGS}) if(SANITIZER_CAN_USE_CXXABI) # C++-specific parts of UBSan runtime. Requires a C++ ABI library. set(UBSAN_CXX_SOURCES ${UBSAN_CXXABI_SOURCES}) else() # Dummy target if we don't have C++ ABI library. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/cxx_dummy.cc "") set(UBSAN_CXX_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cxx_dummy.cc) endif() add_compiler_rt_object_libraries(RTUbsan_cxx ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH} SOURCES ${UBSAN_CXX_SOURCES} CFLAGS ${UBSAN_CXXFLAGS}) if(COMPILER_RT_HAS_UBSAN) # Initializer of standalone UBSan runtime. add_compiler_rt_object_libraries(RTUbsan_standalone ARCHS ${UBSAN_SUPPORTED_ARCH} SOURCES ${UBSAN_STANDALONE_SOURCES} CFLAGS ${UBSAN_STANDALONE_CFLAGS}) # Standalone UBSan runtimes. add_compiler_rt_runtime(clang_rt.ubsan_standalone STATIC ARCHS ${UBSAN_SUPPORTED_ARCH} OBJECT_LIBS RTSanitizerCommon RTSanitizerCommonLibc RTUbsan RTUbsan_standalone CFLAGS ${UBSAN_CFLAGS} PARENT_TARGET ubsan) add_compiler_rt_runtime(clang_rt.ubsan_standalone_cxx STATIC ARCHS ${UBSAN_SUPPORTED_ARCH} OBJECT_LIBS RTUbsan_cxx CFLAGS ${UBSAN_CXXFLAGS} PARENT_TARGET ubsan) if (UNIX) set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH}) list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686) add_sanitizer_rt_symbols(clang_rt.ubsan_standalone ARCHS ${ARCHS_FOR_SYMBOLS} PARENT_TARGET ubsan EXTRA ubsan.syms.extra) add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx ARCHS ${ARCHS_FOR_SYMBOLS} PARENT_TARGET ubsan EXTRA ubsan.syms.extra) endif() endif() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_init.cc0000664000175000017500000000414112754405574025536 0ustar mwhudsonmwhudson//===-- ubsan_init.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Initialization of UBSan runtime. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_diag.h" #include "ubsan_init.h" #include "ubsan_flags.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_mutex.h" #include "sanitizer_common/sanitizer_symbolizer.h" using namespace __ubsan; static enum { UBSAN_MODE_UNKNOWN = 0, UBSAN_MODE_STANDALONE, UBSAN_MODE_PLUGIN } ubsan_mode; static StaticSpinMutex ubsan_init_mu; static void CommonInit() { InitializeSuppressions(); } static void CommonStandaloneInit() { SanitizerToolName = "UndefinedBehaviorSanitizer"; InitializeFlags(); CacheBinaryName(); __sanitizer_set_report_path(common_flags()->log_path); AndroidLogInit(); InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir); CommonInit(); ubsan_mode = UBSAN_MODE_STANDALONE; } void __ubsan::InitAsStandalone() { if (SANITIZER_CAN_USE_PREINIT_ARRAY) { CHECK_EQ(UBSAN_MODE_UNKNOWN, ubsan_mode); CommonStandaloneInit(); return; } SpinMutexLock l(&ubsan_init_mu); CHECK_NE(UBSAN_MODE_PLUGIN, ubsan_mode); if (ubsan_mode == UBSAN_MODE_UNKNOWN) CommonStandaloneInit(); } void __ubsan::InitAsStandaloneIfNecessary() { if (SANITIZER_CAN_USE_PREINIT_ARRAY) { CHECK_NE(UBSAN_MODE_UNKNOWN, ubsan_mode); return; } SpinMutexLock l(&ubsan_init_mu); if (ubsan_mode == UBSAN_MODE_UNKNOWN) CommonStandaloneInit(); } void __ubsan::InitAsPlugin() { #if !SANITIZER_CAN_USE_PREINIT_ARRAY SpinMutexLock l(&ubsan_init_mu); #endif CHECK_EQ(UBSAN_MODE_UNKNOWN, ubsan_mode); CommonInit(); ubsan_mode = UBSAN_MODE_PLUGIN; } #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_diag.h0000664000175000017500000001645612635062372025346 0ustar mwhudsonmwhudson//===-- ubsan_diag.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Diagnostics emission for Clang's undefined behavior sanitizer. // //===----------------------------------------------------------------------===// #ifndef UBSAN_DIAG_H #define UBSAN_DIAG_H #include "ubsan_value.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_symbolizer.h" namespace __ubsan { class SymbolizedStackHolder { SymbolizedStack *Stack; void clear() { if (Stack) Stack->ClearAll(); } public: explicit SymbolizedStackHolder(SymbolizedStack *Stack = nullptr) : Stack(Stack) {} ~SymbolizedStackHolder() { clear(); } void reset(SymbolizedStack *S) { if (Stack != S) clear(); Stack = S; } const SymbolizedStack *get() const { return Stack; } }; SymbolizedStack *getSymbolizedLocation(uptr PC); inline SymbolizedStack *getCallerLocation(uptr CallerPC) { CHECK(CallerPC); uptr PC = StackTrace::GetPreviousInstructionPc(CallerPC); return getSymbolizedLocation(PC); } /// A location of some data within the program's address space. typedef uptr MemoryLocation; /// \brief Location at which a diagnostic can be emitted. Either a /// SourceLocation, a MemoryLocation, or a SymbolizedStack. class Location { public: enum LocationKind { LK_Null, LK_Source, LK_Memory, LK_Symbolized }; private: LocationKind Kind; // FIXME: In C++11, wrap these in an anonymous union. SourceLocation SourceLoc; MemoryLocation MemoryLoc; const SymbolizedStack *SymbolizedLoc; // Not owned. public: Location() : Kind(LK_Null) {} Location(SourceLocation Loc) : Kind(LK_Source), SourceLoc(Loc) {} Location(MemoryLocation Loc) : Kind(LK_Memory), MemoryLoc(Loc) {} // SymbolizedStackHolder must outlive Location object. Location(const SymbolizedStackHolder &Stack) : Kind(LK_Symbolized), SymbolizedLoc(Stack.get()) {} LocationKind getKind() const { return Kind; } bool isSourceLocation() const { return Kind == LK_Source; } bool isMemoryLocation() const { return Kind == LK_Memory; } bool isSymbolizedStack() const { return Kind == LK_Symbolized; } SourceLocation getSourceLocation() const { CHECK(isSourceLocation()); return SourceLoc; } MemoryLocation getMemoryLocation() const { CHECK(isMemoryLocation()); return MemoryLoc; } const SymbolizedStack *getSymbolizedStack() const { CHECK(isSymbolizedStack()); return SymbolizedLoc; } }; /// A diagnostic severity level. enum DiagLevel { DL_Error, ///< An error. DL_Note ///< A note, attached to a prior diagnostic. }; /// \brief Annotation for a range of locations in a diagnostic. class Range { Location Start, End; const char *Text; public: Range() : Start(), End(), Text() {} Range(MemoryLocation Start, MemoryLocation End, const char *Text) : Start(Start), End(End), Text(Text) {} Location getStart() const { return Start; } Location getEnd() const { return End; } const char *getText() const { return Text; } }; /// \brief A C++ type name. Really just a strong typedef for 'const char*'. class TypeName { const char *Name; public: TypeName(const char *Name) : Name(Name) {} const char *getName() const { return Name; } }; /// \brief Representation of an in-flight diagnostic. /// /// Temporary \c Diag instances are created by the handler routines to /// accumulate arguments for a diagnostic. The destructor emits the diagnostic /// message. class Diag { /// The location at which the problem occurred. Location Loc; /// The diagnostic level. DiagLevel Level; /// The message which will be emitted, with %0, %1, ... placeholders for /// arguments. const char *Message; public: /// Kinds of arguments, corresponding to members of \c Arg's union. enum ArgKind { AK_String, ///< A string argument, displayed as-is. AK_TypeName,///< A C++ type name, possibly demangled before display. AK_UInt, ///< An unsigned integer argument. AK_SInt, ///< A signed integer argument. AK_Float, ///< A floating-point argument. AK_Pointer ///< A pointer argument, displayed in hexadecimal. }; /// An individual diagnostic message argument. struct Arg { Arg() {} Arg(const char *String) : Kind(AK_String), String(String) {} Arg(TypeName TN) : Kind(AK_TypeName), String(TN.getName()) {} Arg(UIntMax UInt) : Kind(AK_UInt), UInt(UInt) {} Arg(SIntMax SInt) : Kind(AK_SInt), SInt(SInt) {} Arg(FloatMax Float) : Kind(AK_Float), Float(Float) {} Arg(const void *Pointer) : Kind(AK_Pointer), Pointer(Pointer) {} ArgKind Kind; union { const char *String; UIntMax UInt; SIntMax SInt; FloatMax Float; const void *Pointer; }; }; private: static const unsigned MaxArgs = 5; static const unsigned MaxRanges = 1; /// The arguments which have been added to this diagnostic so far. Arg Args[MaxArgs]; unsigned NumArgs; /// The ranges which have been added to this diagnostic so far. Range Ranges[MaxRanges]; unsigned NumRanges; Diag &AddArg(Arg A) { CHECK(NumArgs != MaxArgs); Args[NumArgs++] = A; return *this; } Diag &AddRange(Range A) { CHECK(NumRanges != MaxRanges); Ranges[NumRanges++] = A; return *this; } /// \c Diag objects are not copyable. Diag(const Diag &); // NOT IMPLEMENTED Diag &operator=(const Diag &); public: Diag(Location Loc, DiagLevel Level, const char *Message) : Loc(Loc), Level(Level), Message(Message), NumArgs(0), NumRanges(0) {} ~Diag(); Diag &operator<<(const char *Str) { return AddArg(Str); } Diag &operator<<(TypeName TN) { return AddArg(TN); } Diag &operator<<(unsigned long long V) { return AddArg(UIntMax(V)); } Diag &operator<<(const void *V) { return AddArg(V); } Diag &operator<<(const TypeDescriptor &V); Diag &operator<<(const Value &V); Diag &operator<<(const Range &R) { return AddRange(R); } }; struct ReportOptions { // If FromUnrecoverableHandler is specified, UBSan runtime handler is not // expected to return. bool FromUnrecoverableHandler; /// pc/bp are used to unwind the stack trace. uptr pc; uptr bp; }; enum class ErrorType { #define UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) Name, #include "ubsan_checks.inc" #undef UBSAN_CHECK }; bool ignoreReport(SourceLocation SLoc, ReportOptions Opts, ErrorType ET); #define GET_REPORT_OPTIONS(unrecoverable_handler) \ GET_CALLER_PC_BP; \ ReportOptions Opts = {unrecoverable_handler, pc, bp} /// \brief Instantiate this class before printing diagnostics in the error /// report. This class ensures that reports from different threads and from /// different sanitizers won't be mixed. class ScopedReport { ReportOptions Opts; Location SummaryLoc; ErrorType Type; public: ScopedReport(ReportOptions Opts, Location SummaryLoc, ErrorType Type); ~ScopedReport(); }; void InitializeSuppressions(); bool IsVptrCheckSuppressed(const char *TypeName); // Sometimes UBSan runtime can know filename from handlers arguments, even if // debug info is missing. bool IsPCSuppressed(ErrorType ET, uptr PC, const char *Filename); } // namespace __ubsan #endif // UBSAN_DIAG_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_value.cc0000664000175000017500000000713112670673613025707 0ustar mwhudsonmwhudson//===-- ubsan_value.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Representation of a runtime value, as marshaled from the generated code to // the ubsan runtime. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_value.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" using namespace __ubsan; SIntMax Value::getSIntValue() const { CHECK(getType().isSignedIntegerTy()); if (isInlineInt()) { // Val was zero-extended to ValueHandle. Sign-extend from original width // to SIntMax. const unsigned ExtraBits = sizeof(SIntMax) * 8 - getType().getIntegerBitWidth(); return SIntMax(Val) << ExtraBits >> ExtraBits; } if (getType().getIntegerBitWidth() == 64) return *reinterpret_cast(Val); #if HAVE_INT128_T if (getType().getIntegerBitWidth() == 128) return *reinterpret_cast(Val); #else if (getType().getIntegerBitWidth() == 128) UNREACHABLE("libclang_rt.ubsan was built without __int128 support"); #endif UNREACHABLE("unexpected bit width"); } UIntMax Value::getUIntValue() const { CHECK(getType().isUnsignedIntegerTy()); if (isInlineInt()) return Val; if (getType().getIntegerBitWidth() == 64) return *reinterpret_cast(Val); #if HAVE_INT128_T if (getType().getIntegerBitWidth() == 128) return *reinterpret_cast(Val); #else if (getType().getIntegerBitWidth() == 128) UNREACHABLE("libclang_rt.ubsan was built without __int128 support"); #endif UNREACHABLE("unexpected bit width"); } UIntMax Value::getPositiveIntValue() const { if (getType().isUnsignedIntegerTy()) return getUIntValue(); SIntMax Val = getSIntValue(); CHECK(Val >= 0); return Val; } /// Get the floating-point value of this object, extended to a long double. /// These are always passed by address (our calling convention doesn't allow /// them to be passed in floating-point registers, so this has little cost). FloatMax Value::getFloatValue() const { CHECK(getType().isFloatTy()); if (isInlineFloat()) { switch (getType().getFloatBitWidth()) { #if 0 // FIXME: OpenCL / NEON 'half' type. LLVM can't lower the conversion // from '__fp16' to 'long double'. case 16: { __fp16 Value; internal_memcpy(&Value, &Val, 4); return Value; } #endif case 32: { float Value; #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ // For big endian the float value is in the last 4 bytes. // On some targets we may only have 4 bytes so we count backwards from // the end of Val to account for both the 32-bit and 64-bit cases. internal_memcpy(&Value, ((const char*)(&Val + 1)) - 4, 4); #else internal_memcpy(&Value, &Val, 4); #endif return Value; } case 64: { double Value; internal_memcpy(&Value, &Val, 8); return Value; } } } else { switch (getType().getFloatBitWidth()) { case 64: return *reinterpret_cast(Val); case 80: return *reinterpret_cast(Val); case 96: return *reinterpret_cast(Val); case 128: return *reinterpret_cast(Val); } } UNREACHABLE("unexpected floating point bit width"); } #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_checks.inc0000664000175000017500000000434512631663740026220 0ustar mwhudsonmwhudson//===-- ubsan_checks.inc ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // List of checks handled by UBSan runtime. // //===----------------------------------------------------------------------===// #ifndef UBSAN_CHECK # error "Define UBSAN_CHECK prior to including this file!" #endif // UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) // SummaryKind and FSanitizeFlagName should be string literals. UBSAN_CHECK(GenericUB, "undefined-behavior", "undefined") UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null") UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment") UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size") UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow", "signed-integer-overflow") UBSAN_CHECK(UnsignedIntegerOverflow, "unsigned-integer-overflow", "unsigned-integer-overflow") UBSAN_CHECK(IntegerDivideByZero, "integer-divide-by-zero", "integer-divide-by-zero") UBSAN_CHECK(FloatDivideByZero, "float-divide-by-zero", "float-divide-by-zero") UBSAN_CHECK(InvalidShiftBase, "invalid-shift-base", "shift-base") UBSAN_CHECK(InvalidShiftExponent, "invalid-shift-exponent", "shift-exponent") UBSAN_CHECK(OutOfBoundsIndex, "out-of-bounds-index", "bounds") UBSAN_CHECK(UnreachableCall, "unreachable-call", "unreachable") UBSAN_CHECK(MissingReturn, "missing-return", "return") UBSAN_CHECK(NonPositiveVLAIndex, "non-positive-vla-index", "vla-bound") UBSAN_CHECK(FloatCastOverflow, "float-cast-overflow", "float-cast-overflow") UBSAN_CHECK(InvalidBoolLoad, "invalid-bool-load", "bool") UBSAN_CHECK(InvalidEnumLoad, "invalid-enum-load", "enum") UBSAN_CHECK(FunctionTypeMismatch, "function-type-mismatch", "function") UBSAN_CHECK(InvalidNullReturn, "invalid-null-return", "returns-nonnull-attribute") UBSAN_CHECK(InvalidNullArgument, "invalid-null-argument", "nonnull-attribute") UBSAN_CHECK(DynamicTypeMismatch, "dynamic-type-mismatch", "vptr") UBSAN_CHECK(CFIBadType, "cfi-bad-type", "cfi") golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_type_hash.h0000664000175000017500000000500712724076234026415 0ustar mwhudsonmwhudson//===-- ubsan_type_hash.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Hashing of types for Clang's undefined behavior checker. // //===----------------------------------------------------------------------===// #ifndef UBSAN_TYPE_HASH_H #define UBSAN_TYPE_HASH_H #include "sanitizer_common/sanitizer_common.h" namespace __ubsan { typedef uptr HashValue; /// \brief Information about the dynamic type of an object (extracted from its /// vptr). class DynamicTypeInfo { const char *MostDerivedTypeName; sptr Offset; const char *SubobjectTypeName; public: DynamicTypeInfo(const char *MDTN, sptr Offset, const char *STN) : MostDerivedTypeName(MDTN), Offset(Offset), SubobjectTypeName(STN) {} /// Determine whether the object had a valid dynamic type. bool isValid() const { return MostDerivedTypeName; } /// Get the name of the most-derived type of the object. const char *getMostDerivedTypeName() const { return MostDerivedTypeName; } /// Get the offset from the most-derived type to this base class. sptr getOffset() const { return Offset; } /// Get the name of the most-derived type at the specified offset. const char *getSubobjectTypeName() const { return SubobjectTypeName; } }; /// \brief Get information about the dynamic type of an object. DynamicTypeInfo getDynamicTypeInfoFromObject(void *Object); /// \brief Get information about the dynamic type of an object from its vtable. DynamicTypeInfo getDynamicTypeInfoFromVtable(void *Vtable); /// \brief Check whether the dynamic type of \p Object has a \p Type subobject /// at offset 0. /// \return \c true if the type matches, \c false if not. bool checkDynamicType(void *Object, void *Type, HashValue Hash); const unsigned VptrTypeCacheSize = 128; /// A sanity check for Vtable. Offsets to top must be reasonably small /// numbers (by absolute value). It's a weak check for Vtable corruption. const int VptrMaxOffsetToTop = 1<<20; /// \brief A cache of the results of checkDynamicType. \c checkDynamicType would /// return \c true (modulo hash collisions) if /// \code /// __ubsan_vptr_type_cache[Hash % VptrTypeCacheSize] == Hash /// \endcode extern "C" SANITIZER_INTERFACE_ATTRIBUTE HashValue __ubsan_vptr_type_cache[VptrTypeCacheSize]; } // namespace __ubsan #endif // UBSAN_TYPE_HASH_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_value.h0000664000175000017500000001360012505040454025533 0ustar mwhudsonmwhudson//===-- ubsan_value.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Representation of data which is passed from the compiler-generated calls into // the ubsan runtime. // //===----------------------------------------------------------------------===// #ifndef UBSAN_VALUE_H #define UBSAN_VALUE_H #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" // FIXME: Move this out to a config header. #if __SIZEOF_INT128__ __extension__ typedef __int128 s128; __extension__ typedef unsigned __int128 u128; #define HAVE_INT128_T 1 #else #define HAVE_INT128_T 0 #endif namespace __ubsan { /// \brief Largest integer types we support. #if HAVE_INT128_T typedef s128 SIntMax; typedef u128 UIntMax; #else typedef s64 SIntMax; typedef u64 UIntMax; #endif /// \brief Largest floating-point type we support. typedef long double FloatMax; /// \brief A description of a source location. This corresponds to Clang's /// \c PresumedLoc type. class SourceLocation { const char *Filename; u32 Line; u32 Column; public: SourceLocation() : Filename(), Line(), Column() {} SourceLocation(const char *Filename, unsigned Line, unsigned Column) : Filename(Filename), Line(Line), Column(Column) {} /// \brief Determine whether the source location is known. bool isInvalid() const { return !Filename; } /// \brief Atomically acquire a copy, disabling original in-place. /// Exactly one call to acquire() returns a copy that isn't disabled. SourceLocation acquire() { u32 OldColumn = __sanitizer::atomic_exchange( (__sanitizer::atomic_uint32_t *)&Column, ~u32(0), __sanitizer::memory_order_relaxed); return SourceLocation(Filename, Line, OldColumn); } /// \brief Determine if this Location has been disabled. /// Disabled SourceLocations are invalid to use. bool isDisabled() { return Column == ~u32(0); } /// \brief Get the presumed filename for the source location. const char *getFilename() const { return Filename; } /// \brief Get the presumed line number. unsigned getLine() const { return Line; } /// \brief Get the column within the presumed line. unsigned getColumn() const { return Column; } }; /// \brief A description of a type. class TypeDescriptor { /// A value from the \c Kind enumeration, specifying what flavor of type we /// have. u16 TypeKind; /// A \c Type-specific value providing information which allows us to /// interpret the meaning of a ValueHandle of this type. u16 TypeInfo; /// The name of the type follows, in a format suitable for including in /// diagnostics. char TypeName[1]; public: enum Kind { /// An integer type. Lowest bit is 1 for a signed value, 0 for an unsigned /// value. Remaining bits are log_2(bit width). The value representation is /// the integer itself if it fits into a ValueHandle, and a pointer to the /// integer otherwise. TK_Integer = 0x0000, /// A floating-point type. Low 16 bits are bit width. The value /// representation is that of bitcasting the floating-point value to an /// integer type. TK_Float = 0x0001, /// Any other type. The value representation is unspecified. TK_Unknown = 0xffff }; const char *getTypeName() const { return TypeName; } Kind getKind() const { return static_cast(TypeKind); } bool isIntegerTy() const { return getKind() == TK_Integer; } bool isSignedIntegerTy() const { return isIntegerTy() && (TypeInfo & 1); } bool isUnsignedIntegerTy() const { return isIntegerTy() && !(TypeInfo & 1); } unsigned getIntegerBitWidth() const { CHECK(isIntegerTy()); return 1 << (TypeInfo >> 1); } bool isFloatTy() const { return getKind() == TK_Float; } unsigned getFloatBitWidth() const { CHECK(isFloatTy()); return TypeInfo; } }; /// \brief An opaque handle to a value. typedef uptr ValueHandle; /// \brief Representation of an operand value provided by the instrumented code. /// /// This is a combination of a TypeDescriptor (which is emitted as constant data /// as an operand to a handler function) and a ValueHandle (which is passed at /// runtime when a check failure occurs). class Value { /// The type of the value. const TypeDescriptor &Type; /// The encoded value itself. ValueHandle Val; /// Is \c Val a (zero-extended) integer? bool isInlineInt() const { CHECK(getType().isIntegerTy()); const unsigned InlineBits = sizeof(ValueHandle) * 8; const unsigned Bits = getType().getIntegerBitWidth(); return Bits <= InlineBits; } /// Is \c Val a (zero-extended) integer representation of a float? bool isInlineFloat() const { CHECK(getType().isFloatTy()); const unsigned InlineBits = sizeof(ValueHandle) * 8; const unsigned Bits = getType().getFloatBitWidth(); return Bits <= InlineBits; } public: Value(const TypeDescriptor &Type, ValueHandle Val) : Type(Type), Val(Val) {} const TypeDescriptor &getType() const { return Type; } /// \brief Get this value as a signed integer. SIntMax getSIntValue() const; /// \brief Get this value as an unsigned integer. UIntMax getUIntValue() const; /// \brief Decode this value, which must be a positive or unsigned integer. UIntMax getPositiveIntValue() const; /// Is this an integer with value -1? bool isMinusOne() const { return getType().isSignedIntegerTy() && getSIntValue() == -1; } /// Is this a negative integer? bool isNegative() const { return getType().isSignedIntegerTy() && getSIntValue() < 0; } /// \brief Get this value as a floating-point quantity. FloatMax getFloatValue() const; }; } // namespace __ubsan #endif // UBSAN_VALUE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_flags.cc0000664000175000017500000000455612673053307025672 0ustar mwhudsonmwhudson//===-- ubsan_flags.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Runtime flags for UndefinedBehaviorSanitizer. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_flags.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" namespace __ubsan { const char *MaybeCallUbsanDefaultOptions() { return (&__ubsan_default_options) ? __ubsan_default_options() : ""; } Flags ubsan_flags; void Flags::SetDefaults() { #define UBSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "ubsan_flags.inc" #undef UBSAN_FLAG } void RegisterUbsanFlags(FlagParser *parser, Flags *f) { #define UBSAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "ubsan_flags.inc" #undef UBSAN_FLAG } void InitializeFlags() { SetCommonFlagsDefaults(); { CommonFlags cf; cf.CopyFrom(*common_flags()); cf.print_summary = false; OverrideCommonFlags(cf); } Flags *f = flags(); f->SetDefaults(); FlagParser parser; RegisterCommonFlags(&parser); RegisterUbsanFlags(&parser, f); // Override from user-specified string. parser.ParseString(MaybeCallUbsanDefaultOptions()); // Override from environment variable. parser.ParseString(GetEnv("UBSAN_OPTIONS")); InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) parser.PrintFlagDescriptions(); } } // namespace __ubsan extern "C" { #if !SANITIZER_SUPPORTS_WEAK_HOOKS SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *__ubsan_default_options() { return ""; } #endif #if SANITIZER_WINDOWS const char *__ubsan_default_default_options() { return ""; } # ifdef _WIN64 # pragma comment(linker, "/alternatename:__ubsan_default_options=__ubsan_default_default_options") # else # pragma comment(linker, "/alternatename:___ubsan_default_options=___ubsan_default_default_options") # endif #endif } // extern "C" #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_platform.h0000664000175000017500000000171512704265100026245 0ustar mwhudsonmwhudson//===-- ubsan_platform.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Defines the platforms which UBSan is supported at. // //===----------------------------------------------------------------------===// #ifndef UBSAN_PLATFORM_H #define UBSAN_PLATFORM_H // Other platforms should be easy to add, and probably work as-is. #if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \ (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__) || \ defined(__s390__)) # define CAN_SANITIZE_UB 1 #elif defined(_WIN32) # define CAN_SANITIZE_UB 1 #else # define CAN_SANITIZE_UB 0 #endif #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_handlers.cc0000664000175000017500000004766612654476330026413 0ustar mwhudsonmwhudson//===-- ubsan_handlers.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Error logging entry points for the UBSan runtime. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_handlers.h" #include "ubsan_diag.h" #include "sanitizer_common/sanitizer_common.h" using namespace __sanitizer; using namespace __ubsan; namespace __ubsan { bool ignoreReport(SourceLocation SLoc, ReportOptions Opts, ErrorType ET) { // We are not allowed to skip error report: if we are in unrecoverable // handler, we have to terminate the program right now, and therefore // have to print some diagnostic. // // Even if source location is disabled, it doesn't mean that we have // already report an error to the user: some concurrently running // thread could have acquired it, but not yet printed the report. if (Opts.FromUnrecoverableHandler) return false; return SLoc.isDisabled() || IsPCSuppressed(ET, Opts.pc, SLoc.getFilename()); } const char *TypeCheckKinds[] = { "load of", "store to", "reference binding to", "member access within", "member call on", "constructor call on", "downcast of", "downcast of", "upcast of", "cast to virtual base of"}; } static void handleTypeMismatchImpl(TypeMismatchData *Data, ValueHandle Pointer, ReportOptions Opts) { Location Loc = Data->Loc.acquire(); ErrorType ET; if (!Pointer) ET = ErrorType::NullPointerUse; else if (Data->Alignment && (Pointer & (Data->Alignment - 1))) ET = ErrorType::MisalignedPointerUse; else ET = ErrorType::InsufficientObjectSize; // Use the SourceLocation from Data to track deduplication, even if it's // invalid. if (ignoreReport(Loc.getSourceLocation(), Opts, ET)) return; SymbolizedStackHolder FallbackLoc; if (Data->Loc.isInvalid()) { FallbackLoc.reset(getCallerLocation(Opts.pc)); Loc = FallbackLoc; } ScopedReport R(Opts, Loc, ET); switch (ET) { case ErrorType::NullPointerUse: Diag(Loc, DL_Error, "%0 null pointer of type %1") << TypeCheckKinds[Data->TypeCheckKind] << Data->Type; break; case ErrorType::MisalignedPointerUse: Diag(Loc, DL_Error, "%0 misaligned address %1 for type %3, " "which requires %2 byte alignment") << TypeCheckKinds[Data->TypeCheckKind] << (void *)Pointer << Data->Alignment << Data->Type; break; case ErrorType::InsufficientObjectSize: Diag(Loc, DL_Error, "%0 address %1 with insufficient space " "for an object of type %2") << TypeCheckKinds[Data->TypeCheckKind] << (void *)Pointer << Data->Type; break; default: UNREACHABLE("unexpected error type!"); } if (Pointer) Diag(Pointer, DL_Note, "pointer points here"); } void __ubsan::__ubsan_handle_type_mismatch(TypeMismatchData *Data, ValueHandle Pointer) { GET_REPORT_OPTIONS(false); handleTypeMismatchImpl(Data, Pointer, Opts); } void __ubsan::__ubsan_handle_type_mismatch_abort(TypeMismatchData *Data, ValueHandle Pointer) { GET_REPORT_OPTIONS(true); handleTypeMismatchImpl(Data, Pointer, Opts); Die(); } /// \brief Common diagnostic emission for various forms of integer overflow. template static void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS, const char *Operator, T RHS, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); bool IsSigned = Data->Type.isSignedIntegerTy(); ErrorType ET = IsSigned ? ErrorType::SignedIntegerOverflow : ErrorType::UnsignedIntegerOverflow; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "%0 integer overflow: " "%1 %2 %3 cannot be represented in type %4") << (IsSigned ? "signed" : "unsigned") << Value(Data->Type, LHS) << Operator << RHS << Data->Type; } #define UBSAN_OVERFLOW_HANDLER(handler_name, op, unrecoverable) \ void __ubsan::handler_name(OverflowData *Data, ValueHandle LHS, \ ValueHandle RHS) { \ GET_REPORT_OPTIONS(unrecoverable); \ handleIntegerOverflowImpl(Data, LHS, op, Value(Data->Type, RHS), Opts); \ if (unrecoverable) \ Die(); \ } UBSAN_OVERFLOW_HANDLER(__ubsan_handle_add_overflow, "+", false) UBSAN_OVERFLOW_HANDLER(__ubsan_handle_add_overflow_abort, "+", true) UBSAN_OVERFLOW_HANDLER(__ubsan_handle_sub_overflow, "-", false) UBSAN_OVERFLOW_HANDLER(__ubsan_handle_sub_overflow_abort, "-", true) UBSAN_OVERFLOW_HANDLER(__ubsan_handle_mul_overflow, "*", false) UBSAN_OVERFLOW_HANDLER(__ubsan_handle_mul_overflow_abort, "*", true) static void handleNegateOverflowImpl(OverflowData *Data, ValueHandle OldVal, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); bool IsSigned = Data->Type.isSignedIntegerTy(); ErrorType ET = IsSigned ? ErrorType::SignedIntegerOverflow : ErrorType::UnsignedIntegerOverflow; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); if (IsSigned) Diag(Loc, DL_Error, "negation of %0 cannot be represented in type %1; " "cast to an unsigned type to negate this value to itself") << Value(Data->Type, OldVal) << Data->Type; else Diag(Loc, DL_Error, "negation of %0 cannot be represented in type %1") << Value(Data->Type, OldVal) << Data->Type; } void __ubsan::__ubsan_handle_negate_overflow(OverflowData *Data, ValueHandle OldVal) { GET_REPORT_OPTIONS(false); handleNegateOverflowImpl(Data, OldVal, Opts); } void __ubsan::__ubsan_handle_negate_overflow_abort(OverflowData *Data, ValueHandle OldVal) { GET_REPORT_OPTIONS(true); handleNegateOverflowImpl(Data, OldVal, Opts); Die(); } static void handleDivremOverflowImpl(OverflowData *Data, ValueHandle LHS, ValueHandle RHS, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); Value LHSVal(Data->Type, LHS); Value RHSVal(Data->Type, RHS); ErrorType ET; if (RHSVal.isMinusOne()) ET = ErrorType::SignedIntegerOverflow; else if (Data->Type.isIntegerTy()) ET = ErrorType::IntegerDivideByZero; else ET = ErrorType::FloatDivideByZero; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); switch (ET) { case ErrorType::SignedIntegerOverflow: Diag(Loc, DL_Error, "division of %0 by -1 cannot be represented in type %1") << LHSVal << Data->Type; break; default: Diag(Loc, DL_Error, "division by zero"); break; } } void __ubsan::__ubsan_handle_divrem_overflow(OverflowData *Data, ValueHandle LHS, ValueHandle RHS) { GET_REPORT_OPTIONS(false); handleDivremOverflowImpl(Data, LHS, RHS, Opts); } void __ubsan::__ubsan_handle_divrem_overflow_abort(OverflowData *Data, ValueHandle LHS, ValueHandle RHS) { GET_REPORT_OPTIONS(true); handleDivremOverflowImpl(Data, LHS, RHS, Opts); Die(); } static void handleShiftOutOfBoundsImpl(ShiftOutOfBoundsData *Data, ValueHandle LHS, ValueHandle RHS, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); Value LHSVal(Data->LHSType, LHS); Value RHSVal(Data->RHSType, RHS); ErrorType ET; if (RHSVal.isNegative() || RHSVal.getPositiveIntValue() >= Data->LHSType.getIntegerBitWidth()) ET = ErrorType::InvalidShiftExponent; else ET = ErrorType::InvalidShiftBase; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); if (ET == ErrorType::InvalidShiftExponent) { if (RHSVal.isNegative()) Diag(Loc, DL_Error, "shift exponent %0 is negative") << RHSVal; else Diag(Loc, DL_Error, "shift exponent %0 is too large for %1-bit type %2") << RHSVal << Data->LHSType.getIntegerBitWidth() << Data->LHSType; } else { if (LHSVal.isNegative()) Diag(Loc, DL_Error, "left shift of negative value %0") << LHSVal; else Diag(Loc, DL_Error, "left shift of %0 by %1 places cannot be represented in type %2") << LHSVal << RHSVal << Data->LHSType; } } void __ubsan::__ubsan_handle_shift_out_of_bounds(ShiftOutOfBoundsData *Data, ValueHandle LHS, ValueHandle RHS) { GET_REPORT_OPTIONS(false); handleShiftOutOfBoundsImpl(Data, LHS, RHS, Opts); } void __ubsan::__ubsan_handle_shift_out_of_bounds_abort( ShiftOutOfBoundsData *Data, ValueHandle LHS, ValueHandle RHS) { GET_REPORT_OPTIONS(true); handleShiftOutOfBoundsImpl(Data, LHS, RHS, Opts); Die(); } static void handleOutOfBoundsImpl(OutOfBoundsData *Data, ValueHandle Index, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::OutOfBoundsIndex; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Value IndexVal(Data->IndexType, Index); Diag(Loc, DL_Error, "index %0 out of bounds for type %1") << IndexVal << Data->ArrayType; } void __ubsan::__ubsan_handle_out_of_bounds(OutOfBoundsData *Data, ValueHandle Index) { GET_REPORT_OPTIONS(false); handleOutOfBoundsImpl(Data, Index, Opts); } void __ubsan::__ubsan_handle_out_of_bounds_abort(OutOfBoundsData *Data, ValueHandle Index) { GET_REPORT_OPTIONS(true); handleOutOfBoundsImpl(Data, Index, Opts); Die(); } static void handleBuiltinUnreachableImpl(UnreachableData *Data, ReportOptions Opts) { ScopedReport R(Opts, Data->Loc, ErrorType::UnreachableCall); Diag(Data->Loc, DL_Error, "execution reached a __builtin_unreachable() call"); } void __ubsan::__ubsan_handle_builtin_unreachable(UnreachableData *Data) { GET_REPORT_OPTIONS(true); handleBuiltinUnreachableImpl(Data, Opts); Die(); } static void handleMissingReturnImpl(UnreachableData *Data, ReportOptions Opts) { ScopedReport R(Opts, Data->Loc, ErrorType::MissingReturn); Diag(Data->Loc, DL_Error, "execution reached the end of a value-returning function " "without returning a value"); } void __ubsan::__ubsan_handle_missing_return(UnreachableData *Data) { GET_REPORT_OPTIONS(true); handleMissingReturnImpl(Data, Opts); Die(); } static void handleVLABoundNotPositive(VLABoundData *Data, ValueHandle Bound, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::NonPositiveVLAIndex; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "variable length array bound evaluates to " "non-positive value %0") << Value(Data->Type, Bound); } void __ubsan::__ubsan_handle_vla_bound_not_positive(VLABoundData *Data, ValueHandle Bound) { GET_REPORT_OPTIONS(false); handleVLABoundNotPositive(Data, Bound, Opts); } void __ubsan::__ubsan_handle_vla_bound_not_positive_abort(VLABoundData *Data, ValueHandle Bound) { GET_REPORT_OPTIONS(true); handleVLABoundNotPositive(Data, Bound, Opts); Die(); } static bool looksLikeFloatCastOverflowDataV1(void *Data) { // First field is either a pointer to filename or a pointer to a // TypeDescriptor. u8 *FilenameOrTypeDescriptor; internal_memcpy(&FilenameOrTypeDescriptor, Data, sizeof(FilenameOrTypeDescriptor)); // Heuristic: For float_cast_overflow, the TypeKind will be either TK_Integer // (0x0), TK_Float (0x1) or TK_Unknown (0xff). If both types are known, // adding both bytes will be 0 or 1 (for BE or LE). If it were a filename, // adding two printable characters will not yield such a value. Otherwise, // if one of them is 0xff, this is most likely TK_Unknown type descriptor. u16 MaybeFromTypeKind = FilenameOrTypeDescriptor[0] + FilenameOrTypeDescriptor[1]; return MaybeFromTypeKind < 2 || FilenameOrTypeDescriptor[0] == 0xff || FilenameOrTypeDescriptor[1] == 0xff; } static void handleFloatCastOverflow(void *DataPtr, ValueHandle From, ReportOptions Opts) { SymbolizedStackHolder CallerLoc; Location Loc; const TypeDescriptor *FromType, *ToType; ErrorType ET = ErrorType::FloatCastOverflow; if (looksLikeFloatCastOverflowDataV1(DataPtr)) { auto Data = reinterpret_cast(DataPtr); CallerLoc.reset(getCallerLocation(Opts.pc)); Loc = CallerLoc; FromType = &Data->FromType; ToType = &Data->ToType; } else { auto Data = reinterpret_cast(DataPtr); SourceLocation SLoc = Data->Loc.acquire(); if (ignoreReport(SLoc, Opts, ET)) return; Loc = SLoc; FromType = &Data->FromType; ToType = &Data->ToType; } ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "value %0 is outside the range of representable values of type %2") << Value(*FromType, From) << *FromType << *ToType; } void __ubsan::__ubsan_handle_float_cast_overflow(void *Data, ValueHandle From) { GET_REPORT_OPTIONS(false); handleFloatCastOverflow(Data, From, Opts); } void __ubsan::__ubsan_handle_float_cast_overflow_abort(void *Data, ValueHandle From) { GET_REPORT_OPTIONS(true); handleFloatCastOverflow(Data, From, Opts); Die(); } static void handleLoadInvalidValue(InvalidValueData *Data, ValueHandle Val, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); // This check could be more precise if we used different handlers for // -fsanitize=bool and -fsanitize=enum. bool IsBool = (0 == internal_strcmp(Data->Type.getTypeName(), "'bool'")); ErrorType ET = IsBool ? ErrorType::InvalidBoolLoad : ErrorType::InvalidEnumLoad; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "load of value %0, which is not a valid value for type %1") << Value(Data->Type, Val) << Data->Type; } void __ubsan::__ubsan_handle_load_invalid_value(InvalidValueData *Data, ValueHandle Val) { GET_REPORT_OPTIONS(false); handleLoadInvalidValue(Data, Val, Opts); } void __ubsan::__ubsan_handle_load_invalid_value_abort(InvalidValueData *Data, ValueHandle Val) { GET_REPORT_OPTIONS(true); handleLoadInvalidValue(Data, Val, Opts); Die(); } static void handleFunctionTypeMismatch(FunctionTypeMismatchData *Data, ValueHandle Function, ReportOptions Opts) { SourceLocation CallLoc = Data->Loc.acquire(); ErrorType ET = ErrorType::FunctionTypeMismatch; if (ignoreReport(CallLoc, Opts, ET)) return; ScopedReport R(Opts, CallLoc, ET); SymbolizedStackHolder FLoc(getSymbolizedLocation(Function)); const char *FName = FLoc.get()->info.function; if (!FName) FName = "(unknown)"; Diag(CallLoc, DL_Error, "call to function %0 through pointer to incorrect function type %1") << FName << Data->Type; Diag(FLoc, DL_Note, "%0 defined here") << FName; } void __ubsan::__ubsan_handle_function_type_mismatch(FunctionTypeMismatchData *Data, ValueHandle Function) { GET_REPORT_OPTIONS(false); handleFunctionTypeMismatch(Data, Function, Opts); } void __ubsan::__ubsan_handle_function_type_mismatch_abort( FunctionTypeMismatchData *Data, ValueHandle Function) { GET_REPORT_OPTIONS(true); handleFunctionTypeMismatch(Data, Function, Opts); Die(); } static void handleNonNullReturn(NonNullReturnData *Data, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::InvalidNullReturn; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "null pointer returned from function declared to never " "return null"); if (!Data->AttrLoc.isInvalid()) Diag(Data->AttrLoc, DL_Note, "returns_nonnull attribute specified here"); } void __ubsan::__ubsan_handle_nonnull_return(NonNullReturnData *Data) { GET_REPORT_OPTIONS(false); handleNonNullReturn(Data, Opts); } void __ubsan::__ubsan_handle_nonnull_return_abort(NonNullReturnData *Data) { GET_REPORT_OPTIONS(true); handleNonNullReturn(Data, Opts); Die(); } static void handleNonNullArg(NonNullArgData *Data, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::InvalidNullArgument; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "null pointer passed as argument %0, which is declared to " "never be null") << Data->ArgIndex; if (!Data->AttrLoc.isInvalid()) Diag(Data->AttrLoc, DL_Note, "nonnull attribute specified here"); } void __ubsan::__ubsan_handle_nonnull_arg(NonNullArgData *Data) { GET_REPORT_OPTIONS(false); handleNonNullArg(Data, Opts); } void __ubsan::__ubsan_handle_nonnull_arg_abort(NonNullArgData *Data) { GET_REPORT_OPTIONS(true); handleNonNullArg(Data, Opts); Die(); } static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function, ReportOptions Opts) { if (Data->CheckKind != CFITCK_ICall) Die(); SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::CFIBadType; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "control flow integrity check for type %0 failed during " "indirect function call") << Data->Type; SymbolizedStackHolder FLoc(getSymbolizedLocation(Function)); const char *FName = FLoc.get()->info.function; if (!FName) FName = "(unknown)"; Diag(FLoc, DL_Note, "%0 defined here") << FName; } namespace __ubsan { #ifdef UBSAN_CAN_USE_CXXABI SANITIZER_WEAK_ATTRIBUTE void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable, bool ValidVtable, ReportOptions Opts); #else static void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable, bool ValidVtable, ReportOptions Opts) { Die(); } #endif } // namespace __ubsan void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data, ValueHandle Value, uptr ValidVtable) { GET_REPORT_OPTIONS(false); if (Data->CheckKind == CFITCK_ICall) handleCFIBadIcall(Data, Value, Opts); else HandleCFIBadType(Data, Value, ValidVtable, Opts); } void __ubsan::__ubsan_handle_cfi_check_fail_abort(CFICheckFailData *Data, ValueHandle Value, uptr ValidVtable) { GET_REPORT_OPTIONS(true); if (Data->CheckKind == CFITCK_ICall) handleCFIBadIcall(Data, Value, Opts); else HandleCFIBadType(Data, Value, ValidVtable, Opts); Die(); } #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_type_hash.cc0000664000175000017500000000234512547317732026561 0ustar mwhudsonmwhudson//===-- ubsan_type_hash.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Implementation of a hash table for fast checking of inheritance // relationships. This file is only linked into C++ compilations, and is // permitted to use language features which require a C++ ABI library. // // Most of the implementation lives in an ABI-specific source file // (ubsan_type_hash_{itanium,win}.cc). // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_type_hash.h" #include "sanitizer_common/sanitizer_common.h" /// A cache of recently-checked hashes. Mini hash table with "random" evictions. __ubsan::HashValue __ubsan::__ubsan_vptr_type_cache[__ubsan::VptrTypeCacheSize]; __ubsan::DynamicTypeInfo __ubsan::getDynamicTypeInfoFromObject(void *Object) { void *VtablePtr = *reinterpret_cast(Object); return getDynamicTypeInfoFromVtable(VtablePtr); } #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_flags.inc0000664000175000017500000000203712566723131026046 0ustar mwhudsonmwhudson//===-- ubsan_flags.inc -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UBSan runtime flags. // //===----------------------------------------------------------------------===// #ifndef UBSAN_FLAG # error "Define UBSAN_FLAG prior to including this file!" #endif // UBSAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. UBSAN_FLAG(bool, halt_on_error, false, "Crash the program after printing the first error report") UBSAN_FLAG(bool, print_stacktrace, false, "Include full stacktrace into an error report") UBSAN_FLAG(const char *, suppressions, "", "Suppressions file name.") UBSAN_FLAG(bool, report_error_type, false, "Print specific error type instead of 'undefined-behavior' in summary.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_handlers_cxx.cc0000664000175000017500000001211312724076234027245 0ustar mwhudsonmwhudson//===-- ubsan_handlers_cxx.cc ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Error logging entry points for the UBSan runtime, which are only used for C++ // compilations. This file is permitted to use language features which require // linking against a C++ ABI library. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_handlers.h" #include "ubsan_handlers_cxx.h" #include "ubsan_diag.h" #include "ubsan_type_hash.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_suppressions.h" using namespace __sanitizer; using namespace __ubsan; namespace __ubsan { extern const char *TypeCheckKinds[]; } // Returns true if UBSan has printed an error report. static bool HandleDynamicTypeCacheMiss( DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash, ReportOptions Opts) { if (checkDynamicType((void*)Pointer, Data->TypeInfo, Hash)) // Just a cache miss. The type matches after all. return false; // Check if error report should be suppressed. DynamicTypeInfo DTI = getDynamicTypeInfoFromObject((void*)Pointer); if (DTI.isValid() && IsVptrCheckSuppressed(DTI.getMostDerivedTypeName())) return false; SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::DynamicTypeMismatch; if (ignoreReport(Loc, Opts, ET)) return false; ScopedReport R(Opts, Loc, ET); Diag(Loc, DL_Error, "%0 address %1 which does not point to an object of type %2") << TypeCheckKinds[Data->TypeCheckKind] << (void*)Pointer << Data->Type; // If possible, say what type it actually points to. if (!DTI.isValid()) { if (DTI.getOffset() < -VptrMaxOffsetToTop || DTI.getOffset() > VptrMaxOffsetToTop) { Diag(Pointer, DL_Note, "object has a possibly invalid vptr: abs(offset to top) too big") << TypeName(DTI.getMostDerivedTypeName()) << Range(Pointer, Pointer + sizeof(uptr), "possibly invalid vptr"); } else { Diag(Pointer, DL_Note, "object has invalid vptr") << TypeName(DTI.getMostDerivedTypeName()) << Range(Pointer, Pointer + sizeof(uptr), "invalid vptr"); } } else if (!DTI.getOffset()) Diag(Pointer, DL_Note, "object is of type %0") << TypeName(DTI.getMostDerivedTypeName()) << Range(Pointer, Pointer + sizeof(uptr), "vptr for %0"); else // FIXME: Find the type at the specified offset, and include that // in the note. Diag(Pointer - DTI.getOffset(), DL_Note, "object is base class subobject at offset %0 within object of type %1") << DTI.getOffset() << TypeName(DTI.getMostDerivedTypeName()) << TypeName(DTI.getSubobjectTypeName()) << Range(Pointer, Pointer + sizeof(uptr), "vptr for %2 base class of %1"); return true; } void __ubsan::__ubsan_handle_dynamic_type_cache_miss( DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash) { GET_REPORT_OPTIONS(false); HandleDynamicTypeCacheMiss(Data, Pointer, Hash, Opts); } void __ubsan::__ubsan_handle_dynamic_type_cache_miss_abort( DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash) { // Note: -fsanitize=vptr is always recoverable. GET_REPORT_OPTIONS(false); if (HandleDynamicTypeCacheMiss(Data, Pointer, Hash, Opts)) Die(); } namespace __ubsan { void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable, bool ValidVtable, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); ErrorType ET = ErrorType::CFIBadType; if (ignoreReport(Loc, Opts, ET)) return; ScopedReport R(Opts, Loc, ET); DynamicTypeInfo DTI = ValidVtable ? getDynamicTypeInfoFromVtable((void *)Vtable) : DynamicTypeInfo(0, 0, 0); const char *CheckKindStr; switch (Data->CheckKind) { case CFITCK_VCall: CheckKindStr = "virtual call"; break; case CFITCK_NVCall: CheckKindStr = "non-virtual call"; break; case CFITCK_DerivedCast: CheckKindStr = "base-to-derived cast"; break; case CFITCK_UnrelatedCast: CheckKindStr = "cast to unrelated type"; break; case CFITCK_ICall: Die(); } Diag(Loc, DL_Error, "control flow integrity check for type %0 failed during " "%1 (vtable address %2)") << Data->Type << CheckKindStr << (void *)Vtable; // If possible, say what type it actually points to. if (!DTI.isValid()) { const char *module = Symbolizer::GetOrInit()->GetModuleNameForPc(Vtable); if (module) Diag(Vtable, DL_Note, "invalid vtable in module %0") << module; else Diag(Vtable, DL_Note, "invalid vtable"); } else { Diag(Vtable, DL_Note, "vtable is of type %0") << TypeName(DTI.getMostDerivedTypeName()); } } } // namespace __ubsan #endif // CAN_SANITIZE_UB golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_init_standalone.cc0000664000175000017500000000206212524214751027734 0ustar mwhudsonmwhudson//===-- ubsan_init_standalone.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Initialization of standalone UBSan runtime. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if !CAN_SANITIZE_UB # error "UBSan is not supported on this platform!" #endif #include "sanitizer_common/sanitizer_internal_defs.h" #include "ubsan_init.h" #if SANITIZER_CAN_USE_PREINIT_ARRAY __attribute__((section(".preinit_array"), used)) void (*__local_ubsan_preinit)(void) = __ubsan::InitAsStandalone; #else // Use a dynamic initializer. class UbsanStandaloneInitializer { public: UbsanStandaloneInitializer() { __ubsan::InitAsStandalone(); } }; static UbsanStandaloneInitializer ubsan_standalone_initializer; #endif // SANITIZER_CAN_USE_PREINIT_ARRAY golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_type_hash_itanium.cc0000664000175000017500000002165412775560505030314 0ustar mwhudsonmwhudson//===-- ubsan_type_hash_itanium.cc ----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Implementation of type hashing/lookup for Itanium C++ ABI. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #include "ubsan_platform.h" #if CAN_SANITIZE_UB && !SANITIZER_WINDOWS #include "ubsan_type_hash.h" #include "sanitizer_common/sanitizer_common.h" // The following are intended to be binary compatible with the definitions // given in the Itanium ABI. We make no attempt to be ODR-compatible with // those definitions, since existing ABI implementations aren't. namespace std { class type_info { public: virtual ~type_info(); const char *__type_name; }; } namespace __cxxabiv1 { /// Type info for classes with no bases, and base class for type info for /// classes with bases. class __class_type_info : public std::type_info { ~__class_type_info() override; }; /// Type info for classes with simple single public inheritance. class __si_class_type_info : public __class_type_info { public: ~__si_class_type_info() override; const __class_type_info *__base_type; }; class __base_class_type_info { public: const __class_type_info *__base_type; long __offset_flags; enum __offset_flags_masks { __virtual_mask = 0x1, __public_mask = 0x2, __offset_shift = 8 }; }; /// Type info for classes with multiple, virtual, or non-public inheritance. class __vmi_class_type_info : public __class_type_info { public: ~__vmi_class_type_info() override; unsigned int flags; unsigned int base_count; __base_class_type_info base_info[1]; }; } namespace abi = __cxxabiv1; using namespace __sanitizer; // We implement a simple two-level cache for type-checking results. For each // (vptr,type) pair, a hash is computed. This hash is assumed to be globally // unique; if it collides, we will get false negatives, but: // * such a collision would have to occur on the *first* bad access, // * the probability of such a collision is low (and for a 64-bit target, is // negligible), and // * the vptr, and thus the hash, can be affected by ASLR, so multiple runs // give better coverage. // // The first caching layer is a small hash table with no chaining; buckets are // reused as needed. The second caching layer is a large hash table with open // chaining. We can freely evict from either layer since this is just a cache. // // FIXME: Make these hash table accesses thread-safe. The races here are benign: // assuming the unsequenced loads and stores don't misbehave too badly, // the worst case is false negatives or poor cache behavior, not false // positives or crashes. /// Find a bucket to store the given hash value in. static __ubsan::HashValue *getTypeCacheHashTableBucket(__ubsan::HashValue V) { static const unsigned HashTableSize = 65537; static __ubsan::HashValue __ubsan_vptr_hash_set[HashTableSize]; unsigned First = (V & 65535) ^ 1; unsigned Probe = First; for (int Tries = 5; Tries; --Tries) { if (!__ubsan_vptr_hash_set[Probe] || __ubsan_vptr_hash_set[Probe] == V) return &__ubsan_vptr_hash_set[Probe]; Probe += ((V >> 16) & 65535) + 1; if (Probe >= HashTableSize) Probe -= HashTableSize; } // FIXME: Pick a random entry from the probe sequence to evict rather than // just taking the first. return &__ubsan_vptr_hash_set[First]; } /// \brief Determine whether \p Derived has a \p Base base class subobject at /// offset \p Offset. static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived, const abi::__class_type_info *Base, sptr Offset) { if (Derived->__type_name == Base->__type_name || (SANITIZER_NON_UNIQUE_TYPEINFO && !internal_strcmp(Derived->__type_name, Base->__type_name))) return Offset == 0; if (const abi::__si_class_type_info *SI = dynamic_cast(Derived)) return isDerivedFromAtOffset(SI->__base_type, Base, Offset); const abi::__vmi_class_type_info *VTI = dynamic_cast(Derived); if (!VTI) // No base class subobjects. return false; // Look for a base class which is derived from \p Base at the right offset. for (unsigned int base = 0; base != VTI->base_count; ++base) { // FIXME: Curtail the recursion if this base can't possibly contain the // given offset. sptr OffsetHere = VTI->base_info[base].__offset_flags >> abi::__base_class_type_info::__offset_shift; if (VTI->base_info[base].__offset_flags & abi::__base_class_type_info::__virtual_mask) // For now, just punt on virtual bases and say 'yes'. // FIXME: OffsetHere is the offset in the vtable of the virtual base // offset. Read the vbase offset out of the vtable and use it. return true; if (isDerivedFromAtOffset(VTI->base_info[base].__base_type, Base, Offset - OffsetHere)) return true; } return false; } /// \brief Find the derived-most dynamic base class of \p Derived at offset /// \p Offset. static const abi::__class_type_info *findBaseAtOffset( const abi::__class_type_info *Derived, sptr Offset) { if (!Offset) return Derived; if (const abi::__si_class_type_info *SI = dynamic_cast(Derived)) return findBaseAtOffset(SI->__base_type, Offset); const abi::__vmi_class_type_info *VTI = dynamic_cast(Derived); if (!VTI) // No base class subobjects. return nullptr; for (unsigned int base = 0; base != VTI->base_count; ++base) { sptr OffsetHere = VTI->base_info[base].__offset_flags >> abi::__base_class_type_info::__offset_shift; if (VTI->base_info[base].__offset_flags & abi::__base_class_type_info::__virtual_mask) // FIXME: Can't handle virtual bases yet. continue; if (const abi::__class_type_info *Base = findBaseAtOffset(VTI->base_info[base].__base_type, Offset - OffsetHere)) return Base; } return nullptr; } namespace { struct VtablePrefix { /// The offset from the vptr to the start of the most-derived object. /// This will only be greater than zero in some virtual base class vtables /// used during object con-/destruction, and will usually be exactly zero. sptr Offset; /// The type_info object describing the most-derived class type. std::type_info *TypeInfo; }; VtablePrefix *getVtablePrefix(void *Vtable) { VtablePrefix *Vptr = reinterpret_cast(Vtable); if (!Vptr) return nullptr; VtablePrefix *Prefix = Vptr - 1; if (!Prefix->TypeInfo) // This can't possibly be a valid vtable. return nullptr; return Prefix; } } bool __ubsan::checkDynamicType(void *Object, void *Type, HashValue Hash) { // A crash anywhere within this function probably means the vptr is corrupted. // FIXME: Perform these checks more cautiously. // Check whether this is something we've evicted from the cache. HashValue *Bucket = getTypeCacheHashTableBucket(Hash); if (*Bucket == Hash) { __ubsan_vptr_type_cache[Hash % VptrTypeCacheSize] = Hash; return true; } void *VtablePtr = *reinterpret_cast(Object); VtablePrefix *Vtable = getVtablePrefix(VtablePtr); if (!Vtable) return false; if (Vtable->Offset < -VptrMaxOffsetToTop || Vtable->Offset > VptrMaxOffsetToTop) { // Too large or too small offset are signs of Vtable corruption. return false; } // Check that this is actually a type_info object for a class type. abi::__class_type_info *Derived = dynamic_cast(Vtable->TypeInfo); if (!Derived) return false; abi::__class_type_info *Base = (abi::__class_type_info*)Type; if (!isDerivedFromAtOffset(Derived, Base, -Vtable->Offset)) return false; // Success. Cache this result. __ubsan_vptr_type_cache[Hash % VptrTypeCacheSize] = Hash; *Bucket = Hash; return true; } __ubsan::DynamicTypeInfo __ubsan::getDynamicTypeInfoFromVtable(void *VtablePtr) { VtablePrefix *Vtable = getVtablePrefix(VtablePtr); if (!Vtable) return DynamicTypeInfo(nullptr, 0, nullptr); if (Vtable->Offset < -VptrMaxOffsetToTop || Vtable->Offset > VptrMaxOffsetToTop) return DynamicTypeInfo(nullptr, Vtable->Offset, nullptr); const abi::__class_type_info *ObjectType = findBaseAtOffset( static_cast(Vtable->TypeInfo), -Vtable->Offset); return DynamicTypeInfo(Vtable->TypeInfo->__type_name, -Vtable->Offset, ObjectType ? ObjectType->__type_name : ""); } #endif // CAN_SANITIZE_UB && !SANITIZER_WINDOWS golang-1.8-race-detector-runtime_0.0+svn285455/lib/ubsan/ubsan_init.h0000664000175000017500000000172212507072134025366 0ustar mwhudsonmwhudson//===-- ubsan_init.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Initialization function for UBSan runtime. // //===----------------------------------------------------------------------===// #ifndef UBSAN_INIT_H #define UBSAN_INIT_H namespace __ubsan { // Initialize UBSan as a standalone tool. Typically should be called early // during initialization. void InitAsStandalone(); // Initialize UBSan as a standalone tool, if it hasn't been initialized before. void InitAsStandaloneIfNecessary(); // Initializes UBSan as a plugin tool. This function should be called once // from "parent tool" (e.g. ASan) initialization. void InitAsPlugin(); } // namespace __ubsan #endif // UBSAN_INIT_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/safestack/0000775000175000017500000000000013040224626023712 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/safestack/safestack.cc0000664000175000017500000002263612766606132026210 0ustar mwhudsonmwhudson//===-- safestack.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements the runtime support for the safe stack protection // mechanism. The runtime manages allocation/deallocation of the unsafe stack // for the main thread, as well as all pthreads that are created/destroyed // during program execution. // //===----------------------------------------------------------------------===// #include #include #include #include #include #include #include #include #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" // TODO: The runtime library does not currently protect the safe stack beyond // relying on the system-enforced ASLR. The protection of the (safe) stack can // be provided by three alternative features: // // 1) Protection via hardware segmentation on x86-32 and some x86-64 // architectures: the (safe) stack segment (implicitly accessed via the %ss // segment register) can be separated from the data segment (implicitly // accessed via the %ds segment register). Dereferencing a pointer to the safe // segment would result in a segmentation fault. // // 2) Protection via software fault isolation: memory writes that are not meant // to access the safe stack can be prevented from doing so through runtime // instrumentation. One way to do it is to allocate the safe stack(s) in the // upper half of the userspace and bitmask the corresponding upper bit of the // memory addresses of memory writes that are not meant to access the safe // stack. // // 3) Protection via information hiding on 64 bit architectures: the location // of the safe stack(s) can be randomized through secure mechanisms, and the // leakage of the stack pointer can be prevented. Currently, libc can leak the // stack pointer in several ways (e.g. in longjmp, signal handling, user-level // context switching related functions, etc.). These can be fixed in libc and // in other low-level libraries, by either eliminating the escaping/dumping of // the stack pointer (i.e., %rsp) when that's possible, or by using // encryption/PTR_MANGLE (XOR-ing the dumped stack pointer with another secret // we control and protect better, as is already done for setjmp in glibc.) // Furthermore, a static machine code level verifier can be ran after code // generation to make sure that the stack pointer is never written to memory, // or if it is, its written on the safe stack. // // Finally, while the Unsafe Stack pointer is currently stored in a thread // local variable, with libc support it could be stored in the TCB (thread // control block) as well, eliminating another level of indirection and making // such accesses faster. Alternatively, dedicating a separate register for // storing it would also be possible. /// Minimum stack alignment for the unsafe stack. const unsigned kStackAlign = 16; /// Default size of the unsafe stack. This value is only used if the stack /// size rlimit is set to infinity. const unsigned kDefaultUnsafeStackSize = 0x2800000; /// Runtime page size obtained through sysconf static unsigned pageSize; // TODO: To make accessing the unsafe stack pointer faster, we plan to // eventually store it directly in the thread control block data structure on // platforms where this structure is pointed to by %fs or %gs. This is exactly // the same mechanism as currently being used by the traditional stack // protector pass to store the stack guard (see getStackCookieLocation() // function above). Doing so requires changing the tcbhead_t struct in glibc // on Linux and tcb struct in libc on FreeBSD. // // For now, store it in a thread-local variable. extern "C" { __attribute__((visibility( "default"))) __thread void *__safestack_unsafe_stack_ptr = nullptr; } // Per-thread unsafe stack information. It's not frequently accessed, so there // it can be kept out of the tcb in normal thread-local variables. static __thread void *unsafe_stack_start = nullptr; static __thread size_t unsafe_stack_size = 0; static __thread size_t unsafe_stack_guard = 0; using namespace __sanitizer; static inline void *unsafe_stack_alloc(size_t size, size_t guard) { CHECK_GE(size + guard, size); void *addr = MmapOrDie(size + guard, "unsafe_stack_alloc"); MprotectNoAccess((uptr)addr, (uptr)guard); return (char *)addr + guard; } static inline void unsafe_stack_setup(void *start, size_t size, size_t guard) { CHECK_GE((char *)start + size, (char *)start); CHECK_GE((char *)start + guard, (char *)start); void *stack_ptr = (char *)start + size; CHECK_EQ((((size_t)stack_ptr) & (kStackAlign - 1)), 0); __safestack_unsafe_stack_ptr = stack_ptr; unsafe_stack_start = start; unsafe_stack_size = size; unsafe_stack_guard = guard; } static void unsafe_stack_free() { if (unsafe_stack_start) { UnmapOrDie((char *)unsafe_stack_start - unsafe_stack_guard, unsafe_stack_size + unsafe_stack_guard); } unsafe_stack_start = nullptr; } /// Thread data for the cleanup handler static pthread_key_t thread_cleanup_key; /// Safe stack per-thread information passed to the thread_start function struct tinfo { void *(*start_routine)(void *); void *start_routine_arg; void *unsafe_stack_start; size_t unsafe_stack_size; size_t unsafe_stack_guard; }; /// Wrap the thread function in order to deallocate the unsafe stack when the /// thread terminates by returning from its main function. static void *thread_start(void *arg) { struct tinfo *tinfo = (struct tinfo *)arg; void *(*start_routine)(void *) = tinfo->start_routine; void *start_routine_arg = tinfo->start_routine_arg; // Setup the unsafe stack; this will destroy tinfo content unsafe_stack_setup(tinfo->unsafe_stack_start, tinfo->unsafe_stack_size, tinfo->unsafe_stack_guard); // Make sure out thread-specific destructor will be called // FIXME: we can do this only any other specific key is set by // intercepting the pthread_setspecific function itself pthread_setspecific(thread_cleanup_key, (void *)1); return start_routine(start_routine_arg); } /// Thread-specific data destructor static void thread_cleanup_handler(void *_iter) { // We want to free the unsafe stack only after all other destructors // have already run. We force this function to be called multiple times. // User destructors that might run more then PTHREAD_DESTRUCTOR_ITERATIONS-1 // times might still end up executing after the unsafe stack is deallocated. size_t iter = (size_t)_iter; if (iter < PTHREAD_DESTRUCTOR_ITERATIONS) { pthread_setspecific(thread_cleanup_key, (void *)(iter + 1)); } else { // This is the last iteration unsafe_stack_free(); } } /// Intercept thread creation operation to allocate and setup the unsafe stack INTERCEPTOR(int, pthread_create, pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg) { size_t size = 0; size_t guard = 0; if (attr) { pthread_attr_getstacksize(attr, &size); pthread_attr_getguardsize(attr, &guard); } else { // get pthread default stack size pthread_attr_t tmpattr; pthread_attr_init(&tmpattr); pthread_attr_getstacksize(&tmpattr, &size); pthread_attr_getguardsize(&tmpattr, &guard); pthread_attr_destroy(&tmpattr); } CHECK_NE(size, 0); CHECK_EQ((size & (kStackAlign - 1)), 0); CHECK_EQ((guard & (pageSize - 1)), 0); void *addr = unsafe_stack_alloc(size, guard); struct tinfo *tinfo = (struct tinfo *)(((char *)addr) + size - sizeof(struct tinfo)); tinfo->start_routine = start_routine; tinfo->start_routine_arg = arg; tinfo->unsafe_stack_start = addr; tinfo->unsafe_stack_size = size; tinfo->unsafe_stack_guard = guard; return REAL(pthread_create)(thread, attr, thread_start, tinfo); } extern "C" __attribute__((visibility("default"))) #if !SANITIZER_CAN_USE_PREINIT_ARRAY // On ELF platforms, the constructor is invoked using .preinit_array (see below) __attribute__((constructor(0))) #endif void __safestack_init() { // Determine the stack size for the main thread. size_t size = kDefaultUnsafeStackSize; size_t guard = 4096; struct rlimit limit; if (getrlimit(RLIMIT_STACK, &limit) == 0 && limit.rlim_cur != RLIM_INFINITY) size = limit.rlim_cur; // Allocate unsafe stack for main thread void *addr = unsafe_stack_alloc(size, guard); unsafe_stack_setup(addr, size, guard); pageSize = sysconf(_SC_PAGESIZE); // Initialize pthread interceptors for thread allocation INTERCEPT_FUNCTION(pthread_create); // Setup the cleanup handler pthread_key_create(&thread_cleanup_key, thread_cleanup_handler); } #if SANITIZER_CAN_USE_PREINIT_ARRAY // On ELF platforms, run safestack initialization before any other constructors. // On other platforms we use the constructor attribute to arrange to run our // initialization early. extern "C" { __attribute__((section(".preinit_array"), used)) void (*__safestack_preinit)(void) = __safestack_init; } #endif extern "C" __attribute__((visibility("default"))) void *__get_unsafe_stack_start() { return unsafe_stack_start; } extern "C" __attribute__((visibility("default"))) void *__get_unsafe_stack_ptr() { return __safestack_unsafe_stack_ptr; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/safestack/.clang-format0000664000175000017500000000002512623444376026276 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/safestack/CMakeLists.txt0000664000175000017500000000202112760126006026446 0ustar mwhudsonmwhudsonadd_compiler_rt_component(safestack) set(SAFESTACK_SOURCES safestack.cc) include_directories(..) set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS}) if(APPLE) # Build universal binary on APPLE. add_compiler_rt_runtime(clang_rt.safestack STATIC OS osx ARCHS ${SAFESTACK_SUPPORTED_ARCH} SOURCES ${SAFESTACK_SOURCES} $ $ $ CFLAGS ${SAFESTACK_CFLAGS} PARENT_TARGET safestack) else() # Otherwise, build separate libraries for each target. foreach(arch ${SAFESTACK_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.safestack STATIC ARCHS ${arch} SOURCES ${SAFESTACK_SOURCES} $ $ $ CFLAGS ${SAFESTACK_CFLAGS} PARENT_TARGET safestack) endforeach() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/0000775000175000017500000000000013040224626023406 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingUtil.h0000664000175000017500000000434712743511000027370 0ustar mwhudsonmwhudson/*===- InstrProfilingUtil.h - Support library for PGO instrumentation -----===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #ifndef PROFILE_INSTRPROFILINGUTIL_H #define PROFILE_INSTRPROFILINGUTIL_H #include #include /*! \brief Create a directory tree. */ void __llvm_profile_recursive_mkdir(char *Pathname); /*! Open file \c Filename for read+write with write * lock for exclusive access. The caller will block * if the lock is already held by another process. */ FILE *lprofOpenFileEx(const char *Filename); /* PS4 doesn't have getenv. Define a shim. */ #if __ORBIS__ static inline char *getenv(const char *name) { return NULL; } #endif /* #if __ORBIS__ */ /* GCOV_PREFIX and GCOV_PREFIX_STRIP support */ /* Return the path prefix specified by GCOV_PREFIX environment variable. * If GCOV_PREFIX_STRIP is also specified, the strip level (integer value) * is returned via \c *PrefixStrip. The prefix length is stored in *PrefixLen. */ const char *lprofGetPathPrefix(int *PrefixStrip, size_t *PrefixLen); /* Apply the path prefix specified in \c Prefix to path string in \c PathStr, * and store the result to buffer pointed to by \c Buffer. If \c PrefixStrip * is not zero, path prefixes are stripped from \c PathStr (the level of * stripping is specified by \c PrefixStrip) before \c Prefix is added. */ void lprofApplyPathPrefix(char *Dest, const char *PathStr, const char *Prefix, size_t PrefixLen, int PrefixStrip); /* Returns a pointer to the first occurrence of \c DIR_SEPARATOR char in * the string \c Path, or NULL if the char is not found. */ const char *lprofFindFirstDirSeparator(const char *Path); /* Returns a pointer to the last occurrence of \c DIR_SEPARATOR char in * the string \c Path, or NULL if the char is not found. */ const char *lprofFindLastDirSeparator(const char *Path); int lprofGetHostName(char *Name, int Len); unsigned lprofBoolCmpXchg(void **Ptr, void *OldV, void *NewV); void *lprofPtrFetchAdd(void **Mem, long ByteIncr); #endif /* PROFILE_INSTRPROFILINGUTIL_H */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingPlatformDarwin.c0000664000175000017500000000440212720357763031412 0ustar mwhudsonmwhudson/*===- InstrProfilingPlatformDarwin.c - Profile data on Darwin ------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #if defined(__APPLE__) /* Use linker magic to find the bounds of the Data section. */ COMPILER_RT_VISIBILITY extern __llvm_profile_data DataStart __asm("section$start$__DATA$" INSTR_PROF_DATA_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern __llvm_profile_data DataEnd __asm("section$end$__DATA$" INSTR_PROF_DATA_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern char NamesStart __asm("section$start$__DATA$" INSTR_PROF_NAME_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern char NamesEnd __asm("section$end$__DATA$" INSTR_PROF_NAME_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern uint64_t CountersStart __asm("section$start$__DATA$" INSTR_PROF_CNTS_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern uint64_t CountersEnd __asm("section$end$__DATA$" INSTR_PROF_CNTS_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern ValueProfNode VNodesStart __asm("section$start$__DATA$" INSTR_PROF_VNODES_SECT_NAME_STR); COMPILER_RT_VISIBILITY extern ValueProfNode VNodesEnd __asm("section$end$__DATA$" INSTR_PROF_VNODES_SECT_NAME_STR); COMPILER_RT_VISIBILITY const __llvm_profile_data *__llvm_profile_begin_data(void) { return &DataStart; } COMPILER_RT_VISIBILITY const __llvm_profile_data *__llvm_profile_end_data(void) { return &DataEnd; } COMPILER_RT_VISIBILITY const char *__llvm_profile_begin_names(void) { return &NamesStart; } COMPILER_RT_VISIBILITY const char *__llvm_profile_end_names(void) { return &NamesEnd; } COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_begin_counters(void) { return &CountersStart; } COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_end_counters(void) { return &CountersEnd; } COMPILER_RT_VISIBILITY ValueProfNode *__llvm_profile_begin_vnodes(void) { return &VNodesStart; } COMPILER_RT_VISIBILITY ValueProfNode *__llvm_profile_end_vnodes(void) { return &VNodesEnd; } COMPILER_RT_VISIBILITY ValueProfNode *CurrentVNode = &VNodesStart; COMPILER_RT_VISIBILITY ValueProfNode *EndVNode = &VNodesEnd; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingMerge.c0000664000175000017500000001223012726126674027517 0ustar mwhudsonmwhudson/*===- InstrProfilingMerge.c - Profile in-process Merging ---------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* |*===----------------------------------------------------------------------===* |* This file defines the API needed for in-process merging of profile data |* stored in memory buffer. \*===---------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" #include "InstrProfilingUtil.h" #define INSTR_PROF_VALUE_PROF_DATA #include "InstrProfData.inc" COMPILER_RT_WEAK void (*VPMergeHook)(ValueProfData *, __llvm_profile_data *) = NULL; COMPILER_RT_VISIBILITY uint64_t lprofGetLoadModuleSignature() { /* A very fast way to compute a module signature. */ uint64_t CounterSize = (uint64_t)(__llvm_profile_end_counters() - __llvm_profile_begin_counters()); uint64_t DataSize = __llvm_profile_get_data_size(__llvm_profile_begin_data(), __llvm_profile_end_data()); uint64_t NamesSize = (uint64_t)(__llvm_profile_end_names() - __llvm_profile_begin_names()); uint64_t NumVnodes = (uint64_t)(__llvm_profile_end_vnodes() - __llvm_profile_begin_vnodes()); const __llvm_profile_data *FirstD = __llvm_profile_begin_data(); return (NamesSize << 40) + (CounterSize << 30) + (DataSize << 20) + (NumVnodes << 10) + (DataSize > 0 ? FirstD->NameRef : 0); } /* Returns 1 if profile is not structurally compatible. */ COMPILER_RT_VISIBILITY int __llvm_profile_check_compatibility(const char *ProfileData, uint64_t ProfileSize) { /* Check profile header only for now */ __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData; __llvm_profile_data *SrcDataStart, *SrcDataEnd, *SrcData, *DstData; SrcDataStart = (__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header)); SrcDataEnd = SrcDataStart + Header->DataSize; if (ProfileSize < sizeof(__llvm_profile_header)) return 1; /* Check the header first. */ if (Header->Magic != __llvm_profile_get_magic() || Header->Version != __llvm_profile_get_version() || Header->DataSize != __llvm_profile_get_data_size(__llvm_profile_begin_data(), __llvm_profile_end_data()) || Header->CountersSize != (uint64_t)(__llvm_profile_end_counters() - __llvm_profile_begin_counters()) || Header->NamesSize != (uint64_t)(__llvm_profile_end_names() - __llvm_profile_begin_names()) || Header->ValueKindLast != IPVK_Last) return 1; if (ProfileSize < sizeof(__llvm_profile_header) + Header->DataSize * sizeof(__llvm_profile_data) + Header->NamesSize + Header->CountersSize) return 1; for (SrcData = SrcDataStart, DstData = (__llvm_profile_data *)__llvm_profile_begin_data(); SrcData < SrcDataEnd; ++SrcData, ++DstData) { if (SrcData->NameRef != DstData->NameRef || SrcData->FuncHash != DstData->FuncHash || SrcData->NumCounters != DstData->NumCounters) return 1; } /* Matched! */ return 0; } COMPILER_RT_VISIBILITY void __llvm_profile_merge_from_buffer(const char *ProfileData, uint64_t ProfileSize) { __llvm_profile_data *SrcDataStart, *SrcDataEnd, *SrcData, *DstData; __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData; uint64_t *SrcCountersStart; const char *SrcNameStart; ValueProfData *SrcValueProfDataStart, *SrcValueProfData; SrcDataStart = (__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header)); SrcDataEnd = SrcDataStart + Header->DataSize; SrcCountersStart = (uint64_t *)SrcDataEnd; SrcNameStart = (const char *)(SrcCountersStart + Header->CountersSize); SrcValueProfDataStart = (ValueProfData *)(SrcNameStart + Header->NamesSize + __llvm_profile_get_num_padding_bytes( Header->NamesSize)); for (SrcData = SrcDataStart, DstData = (__llvm_profile_data *)__llvm_profile_begin_data(), SrcValueProfData = SrcValueProfDataStart; SrcData < SrcDataEnd; ++SrcData, ++DstData) { uint64_t *SrcCounters; uint64_t *DstCounters = (uint64_t *)DstData->CounterPtr; unsigned I, NC, NVK = 0; NC = SrcData->NumCounters; SrcCounters = SrcCountersStart + ((size_t)SrcData->CounterPtr - Header->CountersDelta) / sizeof(uint64_t); for (I = 0; I < NC; I++) DstCounters[I] += SrcCounters[I]; /* Now merge value profile data. */ if (!VPMergeHook) continue; for (I = 0; I <= IPVK_Last; I++) NVK += (SrcData->NumValueSites[I] != 0); if (!NVK) continue; VPMergeHook(SrcValueProfData, DstData); SrcValueProfData = (ValueProfData *)((char *)SrcValueProfData + SrcValueProfData->TotalSize); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/GCDAProfiling.c0000664000175000017500000003414012745516365026143 0ustar mwhudsonmwhudson/*===- GCDAProfiling.c - Support library for GCDA file emission -----------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* |*===----------------------------------------------------------------------===*| |* |* This file implements the call back routines for the gcov profiling |* instrumentation pass. Link against this library when running code through |* the -insert-gcov-profiling LLVM pass. |* |* We emit files in a corrupt version of GCOV's "gcda" file format. These files |* are only close enough that LCOV will happily parse them. Anything that lcov |* ignores is missing. |* |* TODO: gcov is multi-process safe by having each exit open the existing file |* and append to it. We'd like to achieve that and be thread-safe too. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfilingPort.h" #include "InstrProfilingUtil.h" #include #include #include #include #include #if defined(_WIN32) #include "WindowsMMap.h" #else #include #include #ifndef MAP_FILE #define MAP_FILE 0 #endif #endif #if defined(__FreeBSD__) && defined(__i386__) #define I386_FREEBSD 1 #else #define I386_FREEBSD 0 #endif #if !defined(_MSC_VER) && !I386_FREEBSD #include #endif #if defined(_MSC_VER) typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; #elif I386_FREEBSD /* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to * FreeBSD 10, r232261) when compiled in 32-bit mode. */ typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; #endif /* #define DEBUG_GCDAPROFILING */ /* * --- GCOV file format I/O primitives --- */ /* * The current file name we're outputting. Used primarily for error logging. */ static char *filename = NULL; /* * The current file we're outputting. */ static FILE *output_file = NULL; /* * Buffer that we write things into. */ #define WRITE_BUFFER_SIZE (128 * 1024) static char *write_buffer = NULL; static uint64_t cur_buffer_size = 0; static uint64_t cur_pos = 0; static uint64_t file_size = 0; static int new_file = 0; static int fd = -1; /* * A list of functions to write out the data. */ typedef void (*writeout_fn)(); struct writeout_fn_node { writeout_fn fn; struct writeout_fn_node *next; }; static struct writeout_fn_node *writeout_fn_head = NULL; static struct writeout_fn_node *writeout_fn_tail = NULL; /* * A list of flush functions that our __gcov_flush() function should call. */ typedef void (*flush_fn)(); struct flush_fn_node { flush_fn fn; struct flush_fn_node *next; }; static struct flush_fn_node *flush_fn_head = NULL; static struct flush_fn_node *flush_fn_tail = NULL; static void resize_write_buffer(uint64_t size) { if (!new_file) return; size += cur_pos; if (size <= cur_buffer_size) return; size = (size - 1) / WRITE_BUFFER_SIZE + 1; size *= WRITE_BUFFER_SIZE; write_buffer = realloc(write_buffer, size); cur_buffer_size = size; } static void write_bytes(const char *s, size_t len) { resize_write_buffer(len); memcpy(&write_buffer[cur_pos], s, len); cur_pos += len; } static void write_32bit_value(uint32_t i) { write_bytes((char*)&i, 4); } static void write_64bit_value(uint64_t i) { write_bytes((char*)&i, 8); } static uint32_t length_of_string(const char *s) { return (strlen(s) / 4) + 1; } static void write_string(const char *s) { uint32_t len = length_of_string(s); write_32bit_value(len); write_bytes(s, strlen(s)); write_bytes("\0\0\0\0", 4 - (strlen(s) % 4)); } static uint32_t read_32bit_value() { uint32_t val; if (new_file) return (uint32_t)-1; val = *(uint32_t*)&write_buffer[cur_pos]; cur_pos += 4; return val; } static uint64_t read_64bit_value() { uint64_t val; if (new_file) return (uint64_t)-1; val = *(uint64_t*)&write_buffer[cur_pos]; cur_pos += 8; return val; } static char *mangle_filename(const char *orig_filename) { char *new_filename; size_t prefix_len; int prefix_strip; const char *prefix = lprofGetPathPrefix(&prefix_strip, &prefix_len); if (prefix == NULL) return strdup(orig_filename); new_filename = malloc(prefix_len + 1 + strlen(orig_filename) + 1); lprofApplyPathPrefix(new_filename, orig_filename, prefix, prefix_len, prefix_strip); return new_filename; } static int map_file() { fseek(output_file, 0L, SEEK_END); file_size = ftell(output_file); /* A size of 0 is invalid to `mmap'. Return a fail here, but don't issue an * error message because it should "just work" for the user. */ if (file_size == 0) return -1; write_buffer = mmap(0, file_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, 0); if (write_buffer == (void *)-1) { int errnum = errno; fprintf(stderr, "profiling: %s: cannot map: %s\n", filename, strerror(errnum)); return -1; } return 0; } static void unmap_file() { if (msync(write_buffer, file_size, MS_SYNC) == -1) { int errnum = errno; fprintf(stderr, "profiling: %s: cannot msync: %s\n", filename, strerror(errnum)); } /* We explicitly ignore errors from unmapping because at this point the data * is written and we don't care. */ (void)munmap(write_buffer, file_size); write_buffer = NULL; file_size = 0; } /* * --- LLVM line counter API --- */ /* A file in this case is a translation unit. Each .o file built with line * profiling enabled will emit to a different file. Only one file may be * started at a time. */ void llvm_gcda_start_file(const char *orig_filename, const char version[4], uint32_t checksum) { const char *mode = "r+b"; filename = mangle_filename(orig_filename); /* Try just opening the file. */ new_file = 0; fd = open(filename, O_RDWR); if (fd == -1) { /* Try opening the file, creating it if necessary. */ new_file = 1; mode = "w+b"; fd = open(filename, O_RDWR | O_CREAT, 0644); if (fd == -1) { /* Try creating the directories first then opening the file. */ __llvm_profile_recursive_mkdir(filename); fd = open(filename, O_RDWR | O_CREAT, 0644); if (fd == -1) { /* Bah! It's hopeless. */ int errnum = errno; fprintf(stderr, "profiling: %s: cannot open: %s\n", filename, strerror(errnum)); return; } } } /* Try to flock the file to serialize concurrent processes writing out to the * same GCDA. This can fail if the filesystem doesn't support it, but in that * case we'll just carry on with the old racy behaviour and hope for the best. */ flock(fd, LOCK_EX); output_file = fdopen(fd, mode); /* Initialize the write buffer. */ write_buffer = NULL; cur_buffer_size = 0; cur_pos = 0; if (new_file) { resize_write_buffer(WRITE_BUFFER_SIZE); memset(write_buffer, 0, WRITE_BUFFER_SIZE); } else { if (map_file() == -1) { /* mmap failed, try to recover by clobbering */ new_file = 1; write_buffer = NULL; cur_buffer_size = 0; resize_write_buffer(WRITE_BUFFER_SIZE); memset(write_buffer, 0, WRITE_BUFFER_SIZE); } } /* gcda file, version, stamp checksum. */ write_bytes("adcg", 4); write_bytes(version, 4); write_32bit_value(checksum); #ifdef DEBUG_GCDAPROFILING fprintf(stderr, "llvmgcda: [%s]\n", orig_filename); #endif } /* Given an array of pointers to counters (counters), increment the n-th one, * where we're also given a pointer to n (predecessor). */ void llvm_gcda_increment_indirect_counter(uint32_t *predecessor, uint64_t **counters) { uint64_t *counter; uint32_t pred; pred = *predecessor; if (pred == 0xffffffff) return; counter = counters[pred]; /* Don't crash if the pred# is out of sync. This can happen due to threads, or because of a TODO in GCOVProfiling.cpp buildEdgeLookupTable(). */ if (counter) ++*counter; #ifdef DEBUG_GCDAPROFILING else fprintf(stderr, "llvmgcda: increment_indirect_counter counters=%08llx, pred=%u\n", *counter, *predecessor); #endif } void llvm_gcda_emit_function(uint32_t ident, const char *function_name, uint32_t func_checksum, uint8_t use_extra_checksum, uint32_t cfg_checksum) { uint32_t len = 2; if (use_extra_checksum) len++; #ifdef DEBUG_GCDAPROFILING fprintf(stderr, "llvmgcda: function id=0x%08x name=%s\n", ident, function_name ? function_name : "NULL"); #endif if (!output_file) return; /* function tag */ write_bytes("\0\0\0\1", 4); if (function_name) len += 1 + length_of_string(function_name); write_32bit_value(len); write_32bit_value(ident); write_32bit_value(func_checksum); if (use_extra_checksum) write_32bit_value(cfg_checksum); if (function_name) write_string(function_name); } void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) { uint32_t i; uint64_t *old_ctrs = NULL; uint32_t val = 0; uint64_t save_cur_pos = cur_pos; if (!output_file) return; val = read_32bit_value(); if (val != (uint32_t)-1) { /* There are counters present in the file. Merge them. */ if (val != 0x01a10000) { fprintf(stderr, "profiling: %s: cannot merge previous GCDA file: " "corrupt arc tag (0x%08x)\n", filename, val); return; } val = read_32bit_value(); if (val == (uint32_t)-1 || val / 2 != num_counters) { fprintf(stderr, "profiling: %s: cannot merge previous GCDA file: " "mismatched number of counters (%d)\n", filename, val); return; } old_ctrs = malloc(sizeof(uint64_t) * num_counters); for (i = 0; i < num_counters; ++i) old_ctrs[i] = read_64bit_value(); } cur_pos = save_cur_pos; /* Counter #1 (arcs) tag */ write_bytes("\0\0\xa1\1", 4); write_32bit_value(num_counters * 2); for (i = 0; i < num_counters; ++i) { counters[i] += (old_ctrs ? old_ctrs[i] : 0); write_64bit_value(counters[i]); } free(old_ctrs); #ifdef DEBUG_GCDAPROFILING fprintf(stderr, "llvmgcda: %u arcs\n", num_counters); for (i = 0; i < num_counters; ++i) fprintf(stderr, "llvmgcda: %llu\n", (unsigned long long)counters[i]); #endif } void llvm_gcda_summary_info() { const uint32_t obj_summary_len = 9; /* Length for gcov compatibility. */ uint32_t i; uint32_t runs = 1; uint32_t val = 0; uint64_t save_cur_pos = cur_pos; if (!output_file) return; val = read_32bit_value(); if (val != (uint32_t)-1) { /* There are counters present in the file. Merge them. */ if (val != 0xa1000000) { fprintf(stderr, "profiling: %s: cannot merge previous run count: " "corrupt object tag (0x%08x)\n", filename, val); return; } val = read_32bit_value(); /* length */ if (val != obj_summary_len) { fprintf(stderr, "profiling: %s: cannot merge previous run count: " "mismatched object length (%d)\n", filename, val); return; } read_32bit_value(); /* checksum, unused */ read_32bit_value(); /* num, unused */ runs += read_32bit_value(); /* Add previous run count to new counter. */ } cur_pos = save_cur_pos; /* Object summary tag */ write_bytes("\0\0\0\xa1", 4); write_32bit_value(obj_summary_len); write_32bit_value(0); /* checksum, unused */ write_32bit_value(0); /* num, unused */ write_32bit_value(runs); for (i = 3; i < obj_summary_len; ++i) write_32bit_value(0); /* Program summary tag */ write_bytes("\0\0\0\xa3", 4); /* tag indicates 1 program */ write_32bit_value(0); /* 0 length */ #ifdef DEBUG_GCDAPROFILING fprintf(stderr, "llvmgcda: %u runs\n", runs); #endif } void llvm_gcda_end_file() { /* Write out EOF record. */ if (output_file) { write_bytes("\0\0\0\0\0\0\0\0", 8); if (new_file) { fwrite(write_buffer, cur_pos, 1, output_file); free(write_buffer); } else { unmap_file(); } flock(fd, LOCK_UN); fclose(output_file); output_file = NULL; write_buffer = NULL; } free(filename); #ifdef DEBUG_GCDAPROFILING fprintf(stderr, "llvmgcda: -----\n"); #endif } void llvm_register_writeout_function(writeout_fn fn) { struct writeout_fn_node *new_node = malloc(sizeof(struct writeout_fn_node)); new_node->fn = fn; new_node->next = NULL; if (!writeout_fn_head) { writeout_fn_head = writeout_fn_tail = new_node; } else { writeout_fn_tail->next = new_node; writeout_fn_tail = new_node; } } void llvm_writeout_files(void) { struct writeout_fn_node *curr = writeout_fn_head; while (curr) { curr->fn(); curr = curr->next; } } void llvm_delete_writeout_function_list(void) { while (writeout_fn_head) { struct writeout_fn_node *node = writeout_fn_head; writeout_fn_head = writeout_fn_head->next; free(node); } writeout_fn_head = writeout_fn_tail = NULL; } void llvm_register_flush_function(flush_fn fn) { struct flush_fn_node *new_node = malloc(sizeof(struct flush_fn_node)); new_node->fn = fn; new_node->next = NULL; if (!flush_fn_head) { flush_fn_head = flush_fn_tail = new_node; } else { flush_fn_tail->next = new_node; flush_fn_tail = new_node; } } void __gcov_flush() { struct flush_fn_node *curr = flush_fn_head; while (curr) { curr->fn(); curr = curr->next; } } void llvm_delete_flush_function_list(void) { while (flush_fn_head) { struct flush_fn_node *node = flush_fn_head; flush_fn_head = flush_fn_head->next; free(node); } flush_fn_head = flush_fn_tail = NULL; } void llvm_gcov_init(writeout_fn wfn, flush_fn ffn) { static int atexit_ran = 0; if (wfn) llvm_register_writeout_function(wfn); if (ffn) llvm_register_flush_function(ffn); if (atexit_ran == 0) { atexit_ran = 1; /* Make sure we write out the data and delete the data structures. */ atexit(llvm_delete_flush_function_list); atexit(llvm_delete_writeout_function_list); atexit(llvm_writeout_files); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingValue.c0000664000175000017500000002576612731036642027545 0ustar mwhudsonmwhudson/*===- InstrProfilingValue.c - Support library for PGO instrumentation ----===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" #include "InstrProfilingUtil.h" /* For PS4 getenv shim. */ #include #include #include #include #define INSTR_PROF_VALUE_PROF_DATA #define INSTR_PROF_COMMON_API_IMPL #include "InstrProfData.inc" static int hasStaticCounters = 1; static int OutOfNodesWarnings = 0; static int hasNonDefaultValsPerSite = 0; #define INSTR_PROF_MAX_VP_WARNS 10 #define INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE 8 #define INSTR_PROF_VNODE_POOL_SIZE 1024 #ifndef _MSC_VER /* A shared static pool in addition to the vnodes statically * allocated by the compiler. */ COMPILER_RT_VISIBILITY ValueProfNode lprofValueProfNodes[INSTR_PROF_VNODE_POOL_SIZE] COMPILER_RT_SECTION( COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME_STR); #endif COMPILER_RT_VISIBILITY uint32_t VPMaxNumValsPerSite = INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE; COMPILER_RT_VISIBILITY void lprofSetupValueProfiler() { const char *Str = 0; Str = getenv("LLVM_VP_MAX_NUM_VALS_PER_SITE"); if (Str && Str[0]) { VPMaxNumValsPerSite = atoi(Str); hasNonDefaultValsPerSite = 1; } if (VPMaxNumValsPerSite > INSTR_PROF_MAX_NUM_VAL_PER_SITE) VPMaxNumValsPerSite = INSTR_PROF_MAX_NUM_VAL_PER_SITE; } COMPILER_RT_VISIBILITY void lprofSetMaxValsPerSite(uint32_t MaxVals) { VPMaxNumValsPerSite = MaxVals; hasNonDefaultValsPerSite = 1; } /* This method is only used in value profiler mock testing. */ COMPILER_RT_VISIBILITY void __llvm_profile_set_num_value_sites(__llvm_profile_data *Data, uint32_t ValueKind, uint16_t NumValueSites) { *((uint16_t *)&Data->NumValueSites[ValueKind]) = NumValueSites; } /* This method is only used in value profiler mock testing. */ COMPILER_RT_VISIBILITY const __llvm_profile_data * __llvm_profile_iterate_data(const __llvm_profile_data *Data) { return Data + 1; } /* This method is only used in value profiler mock testing. */ COMPILER_RT_VISIBILITY void * __llvm_get_function_addr(const __llvm_profile_data *Data) { return Data->FunctionPointer; } /* Allocate an array that holds the pointers to the linked lists of * value profile counter nodes. The number of element of the array * is the total number of value profile sites instrumented. Returns * 0 if allocation fails. */ static int allocateValueProfileCounters(__llvm_profile_data *Data) { uint64_t NumVSites = 0; uint32_t VKI; /* This function will never be called when value site array is allocated statically at compile time. */ hasStaticCounters = 0; /* When dynamic allocation is enabled, allow tracking the max number of * values allowd. */ if (!hasNonDefaultValsPerSite) VPMaxNumValsPerSite = INSTR_PROF_MAX_NUM_VAL_PER_SITE; for (VKI = IPVK_First; VKI <= IPVK_Last; ++VKI) NumVSites += Data->NumValueSites[VKI]; ValueProfNode **Mem = (ValueProfNode **)calloc(NumVSites, sizeof(ValueProfNode *)); if (!Mem) return 0; if (!COMPILER_RT_BOOL_CMPXCHG(&Data->Values, 0, Mem)) { free(Mem); return 0; } return 1; } static ValueProfNode *allocateOneNode(__llvm_profile_data *Data, uint32_t Index, uint64_t Value) { ValueProfNode *Node; if (!hasStaticCounters) return (ValueProfNode *)calloc(1, sizeof(ValueProfNode)); /* Early check to avoid value wrapping around. */ if (CurrentVNode + 1 > EndVNode) { if (OutOfNodesWarnings++ < INSTR_PROF_MAX_VP_WARNS) { PROF_WARN("Unable to track new values: %s. " " Consider using option -mllvm -vp-counters-per-site= to " "allocate more" " value profile counters at compile time. \n", "Running out of static counters"); } return 0; } Node = COMPILER_RT_PTR_FETCH_ADD(ValueProfNode, CurrentVNode, 1); /* Due to section padding, EndVNode point to a byte which is one pass * an incomplete VNode, so we need to skip the last incomplete node. */ if (Node + 1 > EndVNode) return 0; return Node; } COMPILER_RT_VISIBILITY void __llvm_profile_instrument_target(uint64_t TargetValue, void *Data, uint32_t CounterIndex) { __llvm_profile_data *PData = (__llvm_profile_data *)Data; if (!PData) return; if (!PData->Values) { if (!allocateValueProfileCounters(PData)) return; } ValueProfNode **ValueCounters = (ValueProfNode **)PData->Values; ValueProfNode *PrevVNode = NULL; ValueProfNode *MinCountVNode = NULL; ValueProfNode *CurVNode = ValueCounters[CounterIndex]; uint64_t MinCount = UINT64_MAX; uint8_t VDataCount = 0; while (CurVNode) { if (TargetValue == CurVNode->Value) { CurVNode->Count++; return; } if (CurVNode->Count < MinCount) { MinCount = CurVNode->Count; MinCountVNode = CurVNode; } PrevVNode = CurVNode; CurVNode = CurVNode->Next; ++VDataCount; } if (VDataCount >= VPMaxNumValsPerSite) { /* Bump down the min count node's count. If it reaches 0, * evict it. This eviction/replacement policy makes hot * targets more sticky while cold targets less so. In other * words, it makes it less likely for the hot targets to be * prematurally evicted during warmup/establishment period, * when their counts are still low. In a special case when * the number of values tracked is reduced to only one, this * policy will guarantee that the dominating target with >50% * total count will survive in the end. Note that this scheme * allows the runtime to track the min count node in an adaptive * manner. It can correct previous mistakes and eventually * lock on a cold target that is alread in stable state. * * In very rare cases, this replacement scheme may still lead * to target loss. For instance, out of \c N value slots, \c N-1 * slots are occupied by luke warm targets during the warmup * period and the remaining one slot is competed by two or more * very hot targets. If those hot targets occur in an interleaved * way, none of them will survive (gain enough weight to throw out * other established entries) due to the ping-pong effect. * To handle this situation, user can choose to increase the max * number of tracked values per value site. Alternatively, a more * expensive eviction mechanism can be implemented. It requires * the runtime to track the total number of evictions per-site. * When the total number of evictions reaches certain threshold, * the runtime can wipe out more than one lowest count entries * to give space for hot targets. */ if (!(--MinCountVNode->Count)) { CurVNode = MinCountVNode; CurVNode->Value = TargetValue; CurVNode->Count++; } return; } CurVNode = allocateOneNode(PData, CounterIndex, TargetValue); if (!CurVNode) return; CurVNode->Value = TargetValue; CurVNode->Count++; uint32_t Success = 0; if (!ValueCounters[CounterIndex]) Success = COMPILER_RT_BOOL_CMPXCHG(&ValueCounters[CounterIndex], 0, CurVNode); else if (PrevVNode && !PrevVNode->Next) Success = COMPILER_RT_BOOL_CMPXCHG(&(PrevVNode->Next), 0, CurVNode); if (!Success && !hasStaticCounters) { free(CurVNode); return; } } /* * A wrapper struct that represents value profile runtime data. * Like InstrProfRecord class which is used by profiling host tools, * ValueProfRuntimeRecord also implements the abstract intefaces defined in * ValueProfRecordClosure so that the runtime data can be serialized using * shared C implementation. */ typedef struct ValueProfRuntimeRecord { const __llvm_profile_data *Data; ValueProfNode **NodesKind[IPVK_Last + 1]; uint8_t **SiteCountArray; } ValueProfRuntimeRecord; /* ValueProfRecordClosure Interface implementation. */ static uint32_t getNumValueSitesRT(const void *R, uint32_t VK) { return ((const ValueProfRuntimeRecord *)R)->Data->NumValueSites[VK]; } static uint32_t getNumValueDataRT(const void *R, uint32_t VK) { uint32_t S = 0, I; const ValueProfRuntimeRecord *Record = (const ValueProfRuntimeRecord *)R; if (Record->SiteCountArray[VK] == INSTR_PROF_NULLPTR) return 0; for (I = 0; I < Record->Data->NumValueSites[VK]; I++) S += Record->SiteCountArray[VK][I]; return S; } static uint32_t getNumValueDataForSiteRT(const void *R, uint32_t VK, uint32_t S) { const ValueProfRuntimeRecord *Record = (const ValueProfRuntimeRecord *)R; return Record->SiteCountArray[VK][S]; } static ValueProfRuntimeRecord RTRecord; static ValueProfRecordClosure RTRecordClosure = { &RTRecord, INSTR_PROF_NULLPTR, /* GetNumValueKinds */ getNumValueSitesRT, getNumValueDataRT, getNumValueDataForSiteRT, INSTR_PROF_NULLPTR, /* RemapValueData */ INSTR_PROF_NULLPTR, /* GetValueForSite, */ INSTR_PROF_NULLPTR /* AllocValueProfData */ }; static uint32_t initializeValueProfRuntimeRecord(const __llvm_profile_data *Data, uint8_t *SiteCountArray[]) { unsigned I, J, S = 0, NumValueKinds = 0; ValueProfNode **Nodes = (ValueProfNode **)Data->Values; RTRecord.Data = Data; RTRecord.SiteCountArray = SiteCountArray; for (I = 0; I <= IPVK_Last; I++) { uint16_t N = Data->NumValueSites[I]; if (!N) continue; NumValueKinds++; RTRecord.NodesKind[I] = Nodes ? &Nodes[S] : INSTR_PROF_NULLPTR; for (J = 0; J < N; J++) { /* Compute value count for each site. */ uint32_t C = 0; ValueProfNode *Site = Nodes ? RTRecord.NodesKind[I][J] : INSTR_PROF_NULLPTR; while (Site) { C++; Site = Site->Next; } if (C > UCHAR_MAX) C = UCHAR_MAX; RTRecord.SiteCountArray[I][J] = C; } S += N; } return NumValueKinds; } static ValueProfNode *getNextNValueData(uint32_t VK, uint32_t Site, InstrProfValueData *Dst, ValueProfNode *StartNode, uint32_t N) { unsigned I; ValueProfNode *VNode = StartNode ? StartNode : RTRecord.NodesKind[VK][Site]; for (I = 0; I < N; I++) { Dst[I].Value = VNode->Value; Dst[I].Count = VNode->Count; VNode = VNode->Next; } return VNode; } static uint32_t getValueProfDataSizeWrapper(void) { return getValueProfDataSize(&RTRecordClosure); } static uint32_t getNumValueDataForSiteWrapper(uint32_t VK, uint32_t S) { return getNumValueDataForSiteRT(&RTRecord, VK, S); } static VPDataReaderType TheVPDataReader = { initializeValueProfRuntimeRecord, getValueProfRecordHeaderSize, getFirstValueProfRecord, getNumValueDataForSiteWrapper, getValueProfDataSizeWrapper, getNextNValueData}; COMPILER_RT_VISIBILITY VPDataReaderType *lprofGetVPDataReader() { return &TheVPDataReader; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingWriter.c0000664000175000017500000002366312716453643027746 0ustar mwhudsonmwhudson/*===- InstrProfilingWriter.c - Write instrumentation to a file or buffer -===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" #ifdef _MSC_VER /* For _alloca */ #include #endif #include #define INSTR_PROF_VALUE_PROF_DATA #include "InstrProfData.inc" COMPILER_RT_VISIBILITY void (*FreeHook)(void *) = NULL; static ProfBufferIO TheBufferIO; #define VP_BUFFER_SIZE 8 * 1024 static uint8_t BufferIOBuffer[VP_BUFFER_SIZE]; static InstrProfValueData VPDataArray[16]; static uint32_t VPDataArraySize = sizeof(VPDataArray) / sizeof(*VPDataArray); COMPILER_RT_VISIBILITY uint8_t *DynamicBufferIOBuffer = 0; COMPILER_RT_VISIBILITY uint32_t VPBufferSize = 0; /* The buffer writer is reponsponsible in keeping writer state * across the call. */ COMPILER_RT_VISIBILITY uint32_t lprofBufferWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs, void **WriterCtx) { uint32_t I; char **Buffer = (char **)WriterCtx; for (I = 0; I < NumIOVecs; I++) { size_t Length = IOVecs[I].ElmSize * IOVecs[I].NumElm; memcpy(*Buffer, IOVecs[I].Data, Length); *Buffer += Length; } return 0; } static void llvmInitBufferIO(ProfBufferIO *BufferIO, WriterCallback FileWriter, void *File, uint8_t *Buffer, uint32_t BufferSz) { BufferIO->File = File; BufferIO->FileWriter = FileWriter; BufferIO->BufferStart = Buffer; BufferIO->BufferSz = BufferSz; BufferIO->CurOffset = 0; } COMPILER_RT_VISIBILITY ProfBufferIO * lprofCreateBufferIO(WriterCallback FileWriter, void *File) { uint8_t *Buffer = DynamicBufferIOBuffer; uint32_t BufferSize = VPBufferSize; if (!Buffer) { Buffer = &BufferIOBuffer[0]; BufferSize = sizeof(BufferIOBuffer); } llvmInitBufferIO(&TheBufferIO, FileWriter, File, Buffer, BufferSize); return &TheBufferIO; } COMPILER_RT_VISIBILITY void lprofDeleteBufferIO(ProfBufferIO *BufferIO) { if (DynamicBufferIOBuffer) { FreeHook(DynamicBufferIOBuffer); DynamicBufferIOBuffer = 0; VPBufferSize = 0; } } COMPILER_RT_VISIBILITY int lprofBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data, uint32_t Size) { /* Buffer is not large enough, it is time to flush. */ if (Size + BufferIO->CurOffset > BufferIO->BufferSz) { if (lprofBufferIOFlush(BufferIO) != 0) return -1; } /* Special case, bypass the buffer completely. */ ProfDataIOVec IO[] = {{Data, sizeof(uint8_t), Size}}; if (Size > BufferIO->BufferSz) { if (BufferIO->FileWriter(IO, 1, &BufferIO->File)) return -1; } else { /* Write the data to buffer */ uint8_t *Buffer = BufferIO->BufferStart + BufferIO->CurOffset; lprofBufferWriter(IO, 1, (void **)&Buffer); BufferIO->CurOffset = Buffer - BufferIO->BufferStart; } return 0; } COMPILER_RT_VISIBILITY int lprofBufferIOFlush(ProfBufferIO *BufferIO) { if (BufferIO->CurOffset) { ProfDataIOVec IO[] = { {BufferIO->BufferStart, sizeof(uint8_t), BufferIO->CurOffset}}; if (BufferIO->FileWriter(IO, 1, &BufferIO->File)) return -1; BufferIO->CurOffset = 0; } return 0; } /* Write out value profile data for function specified with \c Data. * The implementation does not use the method \c serializeValueProfData * which depends on dynamic memory allocation. In this implementation, * value profile data is written out to \c BufferIO piecemeal. */ static int writeOneValueProfData(ProfBufferIO *BufferIO, VPDataReaderType *VPDataReader, const __llvm_profile_data *Data) { unsigned I, NumValueKinds = 0; ValueProfData VPHeader; uint8_t *SiteCountArray[IPVK_Last + 1]; for (I = 0; I <= IPVK_Last; I++) { if (!Data->NumValueSites[I]) SiteCountArray[I] = 0; else { uint32_t Sz = VPDataReader->GetValueProfRecordHeaderSize(Data->NumValueSites[I]) - offsetof(ValueProfRecord, SiteCountArray); /* Only use alloca for this small byte array to avoid excessive * stack growth. */ SiteCountArray[I] = (uint8_t *)COMPILER_RT_ALLOCA(Sz); memset(SiteCountArray[I], 0, Sz); } } /* If NumValueKinds returned is 0, there is nothing to write, report success and return. This should match the raw profile reader's behavior. */ if (!(NumValueKinds = VPDataReader->InitRTRecord(Data, SiteCountArray))) return 0; /* First write the header structure. */ VPHeader.TotalSize = VPDataReader->GetValueProfDataSize(); VPHeader.NumValueKinds = NumValueKinds; if (lprofBufferIOWrite(BufferIO, (const uint8_t *)&VPHeader, sizeof(ValueProfData))) return -1; /* Make sure nothing else needs to be written before value profile * records. */ if ((void *)VPDataReader->GetFirstValueProfRecord(&VPHeader) != (void *)(&VPHeader + 1)) return -1; /* Write out the value profile record for each value kind * one by one. */ for (I = 0; I <= IPVK_Last; I++) { uint32_t J; ValueProfRecord RecordHeader; /* The size of the value prof record header without counting the * site count array .*/ uint32_t RecordHeaderSize = offsetof(ValueProfRecord, SiteCountArray); uint32_t SiteCountArraySize; if (!Data->NumValueSites[I]) continue; /* Write out the record header. */ RecordHeader.Kind = I; RecordHeader.NumValueSites = Data->NumValueSites[I]; if (lprofBufferIOWrite(BufferIO, (const uint8_t *)&RecordHeader, RecordHeaderSize)) return -1; /* Write out the site value count array including padding space. */ SiteCountArraySize = VPDataReader->GetValueProfRecordHeaderSize(Data->NumValueSites[I]) - RecordHeaderSize; if (lprofBufferIOWrite(BufferIO, SiteCountArray[I], SiteCountArraySize)) return -1; /* Write out the value profile data for each value site. */ for (J = 0; J < Data->NumValueSites[I]; J++) { uint32_t NRead, NRemain; ValueProfNode *NextStartNode = 0; NRemain = VPDataReader->GetNumValueDataForSite(I, J); if (!NRemain) continue; /* Read and write out value data in small chunks till it is done. */ do { NRead = (NRemain > VPDataArraySize ? VPDataArraySize : NRemain); NextStartNode = VPDataReader->GetValueData(I, /* ValueKind */ J, /* Site */ &VPDataArray[0], NextStartNode, NRead); if (lprofBufferIOWrite(BufferIO, (const uint8_t *)&VPDataArray[0], NRead * sizeof(InstrProfValueData))) return -1; NRemain -= NRead; } while (NRemain != 0); } } /* All done report success. */ return 0; } static int writeValueProfData(WriterCallback Writer, void *WriterCtx, VPDataReaderType *VPDataReader, const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd) { ProfBufferIO *BufferIO; const __llvm_profile_data *DI = 0; if (!VPDataReader) return 0; BufferIO = lprofCreateBufferIO(Writer, WriterCtx); for (DI = DataBegin; DI < DataEnd; DI++) { if (writeOneValueProfData(BufferIO, VPDataReader, DI)) return -1; } if (lprofBufferIOFlush(BufferIO) != 0) return -1; lprofDeleteBufferIO(BufferIO); return 0; } COMPILER_RT_VISIBILITY int lprofWriteData(WriterCallback Writer, void *WriterCtx, VPDataReaderType *VPDataReader) { /* Match logic in __llvm_profile_write_buffer(). */ const __llvm_profile_data *DataBegin = __llvm_profile_begin_data(); const __llvm_profile_data *DataEnd = __llvm_profile_end_data(); const uint64_t *CountersBegin = __llvm_profile_begin_counters(); const uint64_t *CountersEnd = __llvm_profile_end_counters(); const char *NamesBegin = __llvm_profile_begin_names(); const char *NamesEnd = __llvm_profile_end_names(); return lprofWriteDataImpl(Writer, WriterCtx, DataBegin, DataEnd, CountersBegin, CountersEnd, VPDataReader, NamesBegin, NamesEnd); } COMPILER_RT_VISIBILITY int lprofWriteDataImpl(WriterCallback Writer, void *WriterCtx, const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, VPDataReaderType *VPDataReader, const char *NamesBegin, const char *NamesEnd) { /* Calculate size of sections. */ const uint64_t DataSize = __llvm_profile_get_data_size(DataBegin, DataEnd); const uint64_t CountersSize = CountersEnd - CountersBegin; const uint64_t NamesSize = NamesEnd - NamesBegin; const uint64_t Padding = __llvm_profile_get_num_padding_bytes(NamesSize); /* Enough zeroes for padding. */ const char Zeroes[sizeof(uint64_t)] = {0}; /* Create the header. */ __llvm_profile_header Header; if (!DataSize) return 0; /* Initialize header structure. */ #define INSTR_PROF_RAW_HEADER(Type, Name, Init) Header.Name = Init; #include "InstrProfData.inc" /* Write the data. */ ProfDataIOVec IOVec[] = {{&Header, sizeof(__llvm_profile_header), 1}, {DataBegin, sizeof(__llvm_profile_data), DataSize}, {CountersBegin, sizeof(uint64_t), CountersSize}, {NamesBegin, sizeof(uint8_t), NamesSize}, {Zeroes, sizeof(uint8_t), Padding}}; if (Writer(IOVec, sizeof(IOVec) / sizeof(*IOVec), &WriterCtx)) return -1; return writeValueProfData(Writer, WriterCtx, VPDataReader, DataBegin, DataEnd); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfData.inc0000664000175000017500000006112012744316060026625 0ustar mwhudsonmwhudson/*===-- InstrProfData.inc - instr profiling runtime structures -*- C++ -*-=== *\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ /* * This is the master file that defines all the data structure, signature, * constant literals that are shared across profiling runtime library, * compiler (instrumentation), and host tools (reader/writer). The entities * defined in this file affect the profile runtime ABI, the raw profile format, * or both. * * The file has two identical copies. The master copy lives in LLVM and * the other one sits in compiler-rt/lib/profile directory. To make changes * in this file, first modify the master copy and copy it over to compiler-rt. * Testing of any change in this file can start only after the two copies are * synced up. * * The first part of the file includes macros that defines types, names, and * initializers for the member fields of the core data structures. The field * declarations for one structure is enabled by defining the field activation * macro associated with that structure. Only one field activation record * can be defined at one time and the rest definitions will be filtered out by * the preprocessor. * * Examples of how the template is used to instantiate structure definition: * 1. To declare a structure: * * struct ProfData { * #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \ * Type Name; * #include "llvm/ProfileData/InstrProfData.inc" * }; * * 2. To construct LLVM type arrays for the struct type: * * Type *DataTypes[] = { * #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \ * LLVMType, * #include "llvm/ProfileData/InstrProfData.inc" * }; * * 4. To construct constant array for the initializers: * #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \ * Initializer, * Constant *ConstantVals[] = { * #include "llvm/ProfileData/InstrProfData.inc" * }; * * * The second part of the file includes definitions all other entities that * are related to runtime ABI and format. When no field activation macro is * defined, this file can be included to introduce the definitions. * \*===----------------------------------------------------------------------===*/ /* Functions marked with INSTR_PROF_VISIBILITY must have hidden visibility in * the compiler runtime. */ #ifndef INSTR_PROF_VISIBILITY #define INSTR_PROF_VISIBILITY #endif /* INSTR_PROF_DATA start. */ /* Definition of member fields of the per-function control structure. */ #ifndef INSTR_PROF_DATA #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) #else #define INSTR_PROF_DATA_DEFINED #endif INSTR_PROF_DATA(const uint64_t, llvm::Type::getInt64Ty(Ctx), NameRef, \ ConstantInt::get(llvm::Type::getInt64Ty(Ctx), \ IndexedInstrProf::ComputeHash(getPGOFuncNameVarInitializer(Inc->getName())))) INSTR_PROF_DATA(const uint64_t, llvm::Type::getInt64Ty(Ctx), FuncHash, \ ConstantInt::get(llvm::Type::getInt64Ty(Ctx), \ Inc->getHash()->getZExtValue())) INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt64PtrTy(Ctx), CounterPtr, \ ConstantExpr::getBitCast(CounterPtr, \ llvm::Type::getInt64PtrTy(Ctx))) /* This is used to map function pointers for the indirect call targets to * function name hashes during the conversion from raw to merged profile * data. */ INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), FunctionPointer, \ FunctionAddr) INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \ ValuesPtrExpr) INSTR_PROF_DATA(const uint32_t, llvm::Type::getInt32Ty(Ctx), NumCounters, \ ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumCounters)) INSTR_PROF_DATA(const uint16_t, Int16ArrayTy, NumValueSites[IPVK_Last+1], \ ConstantArray::get(Int16ArrayTy, Int16ArrayVals)) #undef INSTR_PROF_DATA /* INSTR_PROF_DATA end. */ /* This is an internal data structure used by value profiler. It * is defined here to allow serialization code sharing by LLVM * to be used in unit test. * * typedef struct ValueProfNode { * // InstrProfValueData VData; * uint64_t Value; * uint64_t Count; * struct ValueProfNode *Next; * } ValueProfNode; */ /* INSTR_PROF_VALUE_NODE start. */ #ifndef INSTR_PROF_VALUE_NODE #define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer) #else #define INSTR_PROF_DATA_DEFINED #endif INSTR_PROF_VALUE_NODE(uint64_t, llvm::Type::getInt64Ty(Ctx), Value, \ ConstantInt::get(llvm::Type::GetInt64Ty(Ctx), 0)) INSTR_PROF_VALUE_NODE(uint64_t, llvm::Type::getInt64Ty(Ctx), Count, \ ConstantInt::get(llvm::Type::GetInt64Ty(Ctx), 0)) INSTR_PROF_VALUE_NODE(PtrToNodeT, llvm::Type::getInt8PtrTy(Ctx), Next, \ ConstantInt::get(llvm::Type::GetInt8PtrTy(Ctx), 0)) #undef INSTR_PROF_VALUE_NODE /* INSTR_PROF_VALUE_NODE end. */ /* INSTR_PROF_RAW_HEADER start */ /* Definition of member fields of the raw profile header data structure. */ #ifndef INSTR_PROF_RAW_HEADER #define INSTR_PROF_RAW_HEADER(Type, Name, Initializer) #else #define INSTR_PROF_DATA_DEFINED #endif INSTR_PROF_RAW_HEADER(uint64_t, Magic, __llvm_profile_get_magic()) INSTR_PROF_RAW_HEADER(uint64_t, Version, __llvm_profile_get_version()) INSTR_PROF_RAW_HEADER(uint64_t, DataSize, DataSize) INSTR_PROF_RAW_HEADER(uint64_t, CountersSize, CountersSize) INSTR_PROF_RAW_HEADER(uint64_t, NamesSize, NamesSize) INSTR_PROF_RAW_HEADER(uint64_t, CountersDelta, (uintptr_t)CountersBegin) INSTR_PROF_RAW_HEADER(uint64_t, NamesDelta, (uintptr_t)NamesBegin) INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last) #undef INSTR_PROF_RAW_HEADER /* INSTR_PROF_RAW_HEADER end */ /* VALUE_PROF_FUNC_PARAM start */ /* Definition of parameter types of the runtime API used to do value profiling * for a given value site. */ #ifndef VALUE_PROF_FUNC_PARAM #define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType) #define INSTR_PROF_COMMA #else #define INSTR_PROF_DATA_DEFINED #define INSTR_PROF_COMMA , #endif VALUE_PROF_FUNC_PARAM(uint64_t, TargetValue, Type::getInt64Ty(Ctx)) \ INSTR_PROF_COMMA VALUE_PROF_FUNC_PARAM(void *, Data, Type::getInt8PtrTy(Ctx)) INSTR_PROF_COMMA VALUE_PROF_FUNC_PARAM(uint32_t, CounterIndex, Type::getInt32Ty(Ctx)) #undef VALUE_PROF_FUNC_PARAM #undef INSTR_PROF_COMMA /* VALUE_PROF_FUNC_PARAM end */ /* VALUE_PROF_KIND start */ #ifndef VALUE_PROF_KIND #define VALUE_PROF_KIND(Enumerator, Value) #else #define INSTR_PROF_DATA_DEFINED #endif /* For indirect function call value profiling, the addresses of the target * functions are profiled by the instrumented code. The target addresses are * written in the raw profile data and converted to target function name's MD5 * hash by the profile reader during deserialization. Typically, this happens * when the the raw profile data is read during profile merging. * * For this remapping the ProfData is used. ProfData contains both the function * name hash and the function address. */ VALUE_PROF_KIND(IPVK_IndirectCallTarget, 0) /* These two kinds must be the last to be * declared. This is to make sure the string * array created with the template can be * indexed with the kind value. */ VALUE_PROF_KIND(IPVK_First, IPVK_IndirectCallTarget) VALUE_PROF_KIND(IPVK_Last, IPVK_IndirectCallTarget) #undef VALUE_PROF_KIND /* VALUE_PROF_KIND end */ /* COVMAP_FUNC_RECORD start */ /* Definition of member fields of the function record structure in coverage * map. */ #ifndef COVMAP_FUNC_RECORD #define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Initializer) #else #define INSTR_PROF_DATA_DEFINED #endif #ifdef COVMAP_V1 COVMAP_FUNC_RECORD(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), \ NamePtr, llvm::ConstantExpr::getBitCast(NamePtr, \ llvm::Type::getInt8PtrTy(Ctx))) COVMAP_FUNC_RECORD(const uint32_t, llvm::Type::getInt32Ty(Ctx), NameSize, \ llvm::ConstantInt::get(llvm::Type::getInt32Ty(Ctx), \ NameValue.size())) #else COVMAP_FUNC_RECORD(const int64_t, llvm::Type::getInt64Ty(Ctx), NameRef, \ llvm::ConstantInt::get(llvm::Type::getInt64Ty(Ctx), \ llvm::IndexedInstrProf::ComputeHash(NameValue))) #endif COVMAP_FUNC_RECORD(const uint32_t, llvm::Type::getInt32Ty(Ctx), DataSize, \ llvm::ConstantInt::get(llvm::Type::getInt32Ty(Ctx),\ CoverageMapping.size())) COVMAP_FUNC_RECORD(const uint64_t, llvm::Type::getInt64Ty(Ctx), FuncHash, \ llvm::ConstantInt::get(llvm::Type::getInt64Ty(Ctx), FuncHash)) #undef COVMAP_FUNC_RECORD /* COVMAP_FUNC_RECORD end. */ /* COVMAP_HEADER start */ /* Definition of member fields of coverage map header. */ #ifndef COVMAP_HEADER #define COVMAP_HEADER(Type, LLVMType, Name, Initializer) #else #define INSTR_PROF_DATA_DEFINED #endif COVMAP_HEADER(uint32_t, Int32Ty, NRecords, \ llvm::ConstantInt::get(Int32Ty, FunctionRecords.size())) COVMAP_HEADER(uint32_t, Int32Ty, FilenamesSize, \ llvm::ConstantInt::get(Int32Ty, FilenamesSize)) COVMAP_HEADER(uint32_t, Int32Ty, CoverageSize, \ llvm::ConstantInt::get(Int32Ty, CoverageMappingSize)) COVMAP_HEADER(uint32_t, Int32Ty, Version, \ llvm::ConstantInt::get(Int32Ty, CovMapVersion::CurrentVersion)) #undef COVMAP_HEADER /* COVMAP_HEADER end. */ #ifdef INSTR_PROF_VALUE_PROF_DATA #define INSTR_PROF_DATA_DEFINED #define INSTR_PROF_MAX_NUM_VAL_PER_SITE 255 /*! * This is the header of the data structure that defines the on-disk * layout of the value profile data of a particular kind for one function. */ typedef struct ValueProfRecord { /* The kind of the value profile record. */ uint32_t Kind; /* * The number of value profile sites. It is guaranteed to be non-zero; * otherwise the record for this kind won't be emitted. */ uint32_t NumValueSites; /* * The first element of the array that stores the number of profiled * values for each value site. The size of the array is NumValueSites. * Since NumValueSites is greater than zero, there is at least one * element in the array. */ uint8_t SiteCountArray[1]; /* * The fake declaration is for documentation purpose only. * Align the start of next field to be on 8 byte boundaries. uint8_t Padding[X]; */ /* The array of value profile data. The size of the array is the sum * of all elements in SiteCountArray[]. InstrProfValueData ValueData[]; */ #ifdef __cplusplus /*! * \brief Return the number of value sites. */ uint32_t getNumValueSites() const { return NumValueSites; } /*! * \brief Read data from this record and save it to Record. */ void deserializeTo(InstrProfRecord &Record, InstrProfRecord::ValueMapType *VMap); /* * In-place byte swap: * Do byte swap for this instance. \c Old is the original order before * the swap, and \c New is the New byte order. */ void swapBytes(support::endianness Old, support::endianness New); #endif } ValueProfRecord; /*! * Per-function header/control data structure for value profiling * data in indexed format. */ typedef struct ValueProfData { /* * Total size in bytes including this field. It must be a multiple * of sizeof(uint64_t). */ uint32_t TotalSize; /* *The number of value profile kinds that has value profile data. * In this implementation, a value profile kind is considered to * have profile data if the number of value profile sites for the * kind is not zero. More aggressively, the implementation can * choose to check the actual data value: if none of the value sites * has any profiled values, the kind can be skipped. */ uint32_t NumValueKinds; /* * Following are a sequence of variable length records. The prefix/header * of each record is defined by ValueProfRecord type. The number of * records is NumValueKinds. * ValueProfRecord Record_1; * ValueProfRecord Record_N; */ #if __cplusplus /*! * Return the total size in bytes of the on-disk value profile data * given the data stored in Record. */ static uint32_t getSize(const InstrProfRecord &Record); /*! * Return a pointer to \c ValueProfData instance ready to be streamed. */ static std::unique_ptr serializeFrom(const InstrProfRecord &Record); /*! * Check the integrity of the record. */ Error checkIntegrity(); /*! * Return a pointer to \c ValueProfileData instance ready to be read. * All data in the instance are properly byte swapped. The input * data is assumed to be in little endian order. */ static Expected> getValueProfData(const unsigned char *SrcBuffer, const unsigned char *const SrcBufferEnd, support::endianness SrcDataEndianness); /*! * Swap byte order from \c Endianness order to host byte order. */ void swapBytesToHost(support::endianness Endianness); /*! * Swap byte order from host byte order to \c Endianness order. */ void swapBytesFromHost(support::endianness Endianness); /*! * Return the total size of \c ValueProfileData. */ uint32_t getSize() const { return TotalSize; } /*! * Read data from this data and save it to \c Record. */ void deserializeTo(InstrProfRecord &Record, InstrProfRecord::ValueMapType *VMap); void operator delete(void *ptr) { ::operator delete(ptr); } #endif } ValueProfData; /* * The closure is designed to abstact away two types of value profile data: * - InstrProfRecord which is the primary data structure used to * represent profile data in host tools (reader, writer, and profile-use) * - value profile runtime data structure suitable to be used by C * runtime library. * * Both sources of data need to serialize to disk/memory-buffer in common * format: ValueProfData. The abstraction allows compiler-rt's raw profiler * writer to share the same format and code with indexed profile writer. * * For documentation of the member methods below, refer to corresponding methods * in class InstrProfRecord. */ typedef struct ValueProfRecordClosure { const void *Record; uint32_t (*GetNumValueKinds)(const void *Record); uint32_t (*GetNumValueSites)(const void *Record, uint32_t VKind); uint32_t (*GetNumValueData)(const void *Record, uint32_t VKind); uint32_t (*GetNumValueDataForSite)(const void *R, uint32_t VK, uint32_t S); /* * After extracting the value profile data from the value profile record, * this method is used to map the in-memory value to on-disk value. If * the method is null, value will be written out untranslated. */ uint64_t (*RemapValueData)(uint32_t, uint64_t Value); void (*GetValueForSite)(const void *R, InstrProfValueData *Dst, uint32_t K, uint32_t S); ValueProfData *(*AllocValueProfData)(size_t TotalSizeInBytes); } ValueProfRecordClosure; INSTR_PROF_VISIBILITY ValueProfRecord * getFirstValueProfRecord(ValueProfData *VPD); INSTR_PROF_VISIBILITY ValueProfRecord * getValueProfRecordNext(ValueProfRecord *VPR); INSTR_PROF_VISIBILITY InstrProfValueData * getValueProfRecordValueData(ValueProfRecord *VPR); INSTR_PROF_VISIBILITY uint32_t getValueProfRecordHeaderSize(uint32_t NumValueSites); #undef INSTR_PROF_VALUE_PROF_DATA #endif /* INSTR_PROF_VALUE_PROF_DATA */ #ifdef INSTR_PROF_COMMON_API_IMPL #define INSTR_PROF_DATA_DEFINED #ifdef __cplusplus #define INSTR_PROF_INLINE inline #define INSTR_PROF_NULLPTR nullptr #else #define INSTR_PROF_INLINE #define INSTR_PROF_NULLPTR NULL #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif /*! * \brief Return the \c ValueProfRecord header size including the * padding bytes. */ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint32_t getValueProfRecordHeaderSize(uint32_t NumValueSites) { uint32_t Size = offsetof(ValueProfRecord, SiteCountArray) + sizeof(uint8_t) * NumValueSites; /* Round the size to multiple of 8 bytes. */ Size = (Size + 7) & ~7; return Size; } /*! * \brief Return the total size of the value profile record including the * header and the value data. */ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint32_t getValueProfRecordSize(uint32_t NumValueSites, uint32_t NumValueData) { return getValueProfRecordHeaderSize(NumValueSites) + sizeof(InstrProfValueData) * NumValueData; } /*! * \brief Return the pointer to the start of value data array. */ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE InstrProfValueData *getValueProfRecordValueData(ValueProfRecord *This) { return (InstrProfValueData *)((char *)This + getValueProfRecordHeaderSize( This->NumValueSites)); } /*! * \brief Return the total number of value data for \c This record. */ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint32_t getValueProfRecordNumValueData(ValueProfRecord *This) { uint32_t NumValueData = 0; uint32_t I; for (I = 0; I < This->NumValueSites; I++) NumValueData += This->SiteCountArray[I]; return NumValueData; } /*! * \brief Use this method to advance to the next \c This \c ValueProfRecord. */ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE ValueProfRecord *getValueProfRecordNext(ValueProfRecord *This) { uint32_t NumValueData = getValueProfRecordNumValueData(This); return (ValueProfRecord *)((char *)This + getValueProfRecordSize(This->NumValueSites, NumValueData)); } /*! * \brief Return the first \c ValueProfRecord instance. */ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE ValueProfRecord *getFirstValueProfRecord(ValueProfData *This) { return (ValueProfRecord *)((char *)This + sizeof(ValueProfData)); } /* Closure based interfaces. */ /*! * Return the total size in bytes of the on-disk value profile data * given the data stored in Record. */ INSTR_PROF_VISIBILITY uint32_t getValueProfDataSize(ValueProfRecordClosure *Closure) { uint32_t Kind; uint32_t TotalSize = sizeof(ValueProfData); const void *Record = Closure->Record; for (Kind = IPVK_First; Kind <= IPVK_Last; Kind++) { uint32_t NumValueSites = Closure->GetNumValueSites(Record, Kind); if (!NumValueSites) continue; TotalSize += getValueProfRecordSize(NumValueSites, Closure->GetNumValueData(Record, Kind)); } return TotalSize; } /*! * Extract value profile data of a function for the profile kind \c ValueKind * from the \c Closure and serialize the data into \c This record instance. */ INSTR_PROF_VISIBILITY void serializeValueProfRecordFrom(ValueProfRecord *This, ValueProfRecordClosure *Closure, uint32_t ValueKind, uint32_t NumValueSites) { uint32_t S; const void *Record = Closure->Record; This->Kind = ValueKind; This->NumValueSites = NumValueSites; InstrProfValueData *DstVD = getValueProfRecordValueData(This); for (S = 0; S < NumValueSites; S++) { uint32_t ND = Closure->GetNumValueDataForSite(Record, ValueKind, S); This->SiteCountArray[S] = ND; Closure->GetValueForSite(Record, DstVD, ValueKind, S); DstVD += ND; } } /*! * Extract value profile data of a function from the \c Closure * and serialize the data into \c DstData if it is not NULL or heap * memory allocated by the \c Closure's allocator method. If \c * DstData is not null, the caller is expected to set the TotalSize * in DstData. */ INSTR_PROF_VISIBILITY ValueProfData * serializeValueProfDataFrom(ValueProfRecordClosure *Closure, ValueProfData *DstData) { uint32_t Kind; uint32_t TotalSize = DstData ? DstData->TotalSize : getValueProfDataSize(Closure); ValueProfData *VPD = DstData ? DstData : Closure->AllocValueProfData(TotalSize); VPD->TotalSize = TotalSize; VPD->NumValueKinds = Closure->GetNumValueKinds(Closure->Record); ValueProfRecord *VR = getFirstValueProfRecord(VPD); for (Kind = IPVK_First; Kind <= IPVK_Last; Kind++) { uint32_t NumValueSites = Closure->GetNumValueSites(Closure->Record, Kind); if (!NumValueSites) continue; serializeValueProfRecordFrom(VR, Closure, Kind, NumValueSites); VR = getValueProfRecordNext(VR); } return VPD; } #undef INSTR_PROF_COMMON_API_IMPL #endif /* INSTR_PROF_COMMON_API_IMPL */ /*============================================================================*/ #ifndef INSTR_PROF_DATA_DEFINED #ifndef INSTR_PROF_DATA_INC #define INSTR_PROF_DATA_INC /* Helper macros. */ #define INSTR_PROF_SIMPLE_QUOTE(x) #x #define INSTR_PROF_QUOTE(x) INSTR_PROF_SIMPLE_QUOTE(x) #define INSTR_PROF_SIMPLE_CONCAT(x,y) x ## y #define INSTR_PROF_CONCAT(x,y) INSTR_PROF_SIMPLE_CONCAT(x,y) /* Magic number to detect file format and endianness. * Use 255 at one end, since no UTF-8 file can use that character. Avoid 0, * so that utilities, like strings, don't grab it as a string. 129 is also * invalid UTF-8, and high enough to be interesting. * Use "lprofr" in the centre to stand for "LLVM Profile Raw", or "lprofR" * for 32-bit platforms. */ #define INSTR_PROF_RAW_MAGIC_64 (uint64_t)255 << 56 | (uint64_t)'l' << 48 | \ (uint64_t)'p' << 40 | (uint64_t)'r' << 32 | (uint64_t)'o' << 24 | \ (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129 #define INSTR_PROF_RAW_MAGIC_32 (uint64_t)255 << 56 | (uint64_t)'l' << 48 | \ (uint64_t)'p' << 40 | (uint64_t)'r' << 32 | (uint64_t)'o' << 24 | \ (uint64_t)'f' << 16 | (uint64_t)'R' << 8 | (uint64_t)129 /* Raw profile format version (start from 1). */ #define INSTR_PROF_RAW_VERSION 4 /* Indexed profile format version (start from 1). */ #define INSTR_PROF_INDEX_VERSION 4 /* Coverage mapping format vresion (start from 0). */ #define INSTR_PROF_COVMAP_VERSION 1 /* Profile version is always of type uint64_t. Reserve the upper 8 bits in the * version for other variants of profile. We set the lowest bit of the upper 8 * bits (i.e. bit 56) to 1 to indicate if this is an IR-level instrumentaiton * generated profile, and 0 if this is a Clang FE generated profile. */ #define VARIANT_MASKS_ALL 0xff00000000000000ULL #define GET_VERSION(V) ((V) & ~VARIANT_MASKS_ALL) #define VARIANT_MASK_IR_PROF (0x1ULL << 56) #define INSTR_PROF_RAW_VERSION_VAR __llvm_profile_raw_version #define INSTR_PROF_PROFILE_RUNTIME_VAR __llvm_profile_runtime /* The variable that holds the name of the profile data * specified via command line. */ #define INSTR_PROF_PROFILE_NAME_VAR __llvm_profile_filename /* Runtime section names and name strings. */ #define INSTR_PROF_DATA_SECT_NAME __llvm_prf_data #define INSTR_PROF_NAME_SECT_NAME __llvm_prf_names #define INSTR_PROF_CNTS_SECT_NAME __llvm_prf_cnts /* Array of pointers. Each pointer points to a list * of value nodes associated with one value site. */ #define INSTR_PROF_VALS_SECT_NAME __llvm_prf_vals /* Value profile nodes section. */ #define INSTR_PROF_VNODES_SECT_NAME __llvm_prf_vnds #define INSTR_PROF_COVMAP_SECT_NAME __llvm_covmap #define INSTR_PROF_DATA_SECT_NAME_STR \ INSTR_PROF_QUOTE(INSTR_PROF_DATA_SECT_NAME) #define INSTR_PROF_NAME_SECT_NAME_STR \ INSTR_PROF_QUOTE(INSTR_PROF_NAME_SECT_NAME) #define INSTR_PROF_CNTS_SECT_NAME_STR \ INSTR_PROF_QUOTE(INSTR_PROF_CNTS_SECT_NAME) #define INSTR_PROF_COVMAP_SECT_NAME_STR \ INSTR_PROF_QUOTE(INSTR_PROF_COVMAP_SECT_NAME) #define INSTR_PROF_VALS_SECT_NAME_STR \ INSTR_PROF_QUOTE(INSTR_PROF_VALS_SECT_NAME) #define INSTR_PROF_VNODES_SECT_NAME_STR \ INSTR_PROF_QUOTE(INSTR_PROF_VNODES_SECT_NAME) /* Macros to define start/stop section symbol for a given * section on Linux. For instance * INSTR_PROF_SECT_START(INSTR_PROF_DATA_SECT_NAME) will * expand to __start___llvm_prof_data */ #define INSTR_PROF_SECT_START(Sect) \ INSTR_PROF_CONCAT(__start_,Sect) #define INSTR_PROF_SECT_STOP(Sect) \ INSTR_PROF_CONCAT(__stop_,Sect) /* Value Profiling API linkage name. */ #define INSTR_PROF_VALUE_PROF_FUNC __llvm_profile_instrument_target #define INSTR_PROF_VALUE_PROF_FUNC_STR \ INSTR_PROF_QUOTE(INSTR_PROF_VALUE_PROF_FUNC) /* InstrProfile per-function control data alignment. */ #define INSTR_PROF_DATA_ALIGNMENT 8 /* The data structure that represents a tracked value by the * value profiler. */ typedef struct InstrProfValueData { /* Profiled value. */ uint64_t Value; /* Number of times the value appears in the training run. */ uint64_t Count; } InstrProfValueData; #endif /* INSTR_PROF_DATA_INC */ #else #undef INSTR_PROF_DATA_DEFINED #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingPlatformOther.c0000664000175000017500000000623312720357763031253 0ustar mwhudsonmwhudson/*===- InstrProfilingPlatformOther.c - Profile data default platform ------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) #include static const __llvm_profile_data *DataFirst = NULL; static const __llvm_profile_data *DataLast = NULL; static const char *NamesFirst = NULL; static const char *NamesLast = NULL; static uint64_t *CountersFirst = NULL; static uint64_t *CountersLast = NULL; static const void *getMinAddr(const void *A1, const void *A2) { return A1 < A2 ? A1 : A2; } static const void *getMaxAddr(const void *A1, const void *A2) { return A1 > A2 ? A1 : A2; } /*! * \brief Register an instrumented function. * * Calls to this are emitted by clang with -fprofile-instr-generate. Such * calls are only required (and only emitted) on targets where we haven't * implemented linker magic to find the bounds of the sections. */ COMPILER_RT_VISIBILITY void __llvm_profile_register_function(void *Data_) { /* TODO: Only emit this function if we can't use linker magic. */ const __llvm_profile_data *Data = (__llvm_profile_data *)Data_; if (!DataFirst) { DataFirst = Data; DataLast = Data + 1; CountersFirst = Data->CounterPtr; CountersLast = (uint64_t *)Data->CounterPtr + Data->NumCounters; return; } DataFirst = (const __llvm_profile_data *)getMinAddr(DataFirst, Data); CountersFirst = (uint64_t *)getMinAddr(CountersFirst, Data->CounterPtr); DataLast = (const __llvm_profile_data *)getMaxAddr(DataLast, Data + 1); CountersLast = (uint64_t *)getMaxAddr( CountersLast, (uint64_t *)Data->CounterPtr + Data->NumCounters); } COMPILER_RT_VISIBILITY void __llvm_profile_register_names_function(void *NamesStart, uint64_t NamesSize) { if (!NamesFirst) { NamesFirst = (const char *)NamesStart; NamesLast = (const char *)NamesStart + NamesSize; return; } NamesFirst = (const char *)getMinAddr(NamesFirst, NamesStart); NamesLast = (const char *)getMaxAddr(NamesLast, (const char *)NamesStart + NamesSize); } COMPILER_RT_VISIBILITY const __llvm_profile_data *__llvm_profile_begin_data(void) { return DataFirst; } COMPILER_RT_VISIBILITY const __llvm_profile_data *__llvm_profile_end_data(void) { return DataLast; } COMPILER_RT_VISIBILITY const char *__llvm_profile_begin_names(void) { return NamesFirst; } COMPILER_RT_VISIBILITY const char *__llvm_profile_end_names(void) { return NamesLast; } COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_begin_counters(void) { return CountersFirst; } COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_end_counters(void) { return CountersLast; } COMPILER_RT_VISIBILITY ValueProfNode *__llvm_profile_begin_vnodes(void) { return 0; } COMPILER_RT_VISIBILITY ValueProfNode *__llvm_profile_end_vnodes(void) { return 0; } COMPILER_RT_VISIBILITY ValueProfNode *CurrentVNode = 0; COMPILER_RT_VISIBILITY ValueProfNode *EndVNode = 0; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingInternal.h0000664000175000017500000001570412771044510030236 0ustar mwhudsonmwhudson/*===- InstrProfiling.h- Support library for PGO instrumentation ----------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #ifndef PROFILE_INSTRPROFILING_INTERNALH_ #define PROFILE_INSTRPROFILING_INTERNALH_ #include "InstrProfiling.h" #include "stddef.h" /*! * \brief Write instrumentation data to the given buffer, given explicit * pointers to the live data in memory. This function is probably not what you * want. Use __llvm_profile_get_size_for_buffer instead. Use this function if * your program has a custom memory layout. */ uint64_t __llvm_profile_get_size_for_buffer_internal( const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, const char *NamesBegin, const char *NamesEnd); /*! * \brief Write instrumentation data to the given buffer, given explicit * pointers to the live data in memory. This function is probably not what you * want. Use __llvm_profile_write_buffer instead. Use this function if your * program has a custom memory layout. * * \pre \c Buffer is the start of a buffer at least as big as \a * __llvm_profile_get_size_for_buffer_internal(). */ int __llvm_profile_write_buffer_internal( char *Buffer, const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, const char *NamesBegin, const char *NamesEnd); /*! * The data structure describing the data to be written by the * low level writer callback function. */ typedef struct ProfDataIOVec { const void *Data; size_t ElmSize; size_t NumElm; } ProfDataIOVec; typedef uint32_t (*WriterCallback)(ProfDataIOVec *, uint32_t NumIOVecs, void **WriterCtx); /*! * The data structure for buffered IO of profile data. */ typedef struct ProfBufferIO { /* File handle. */ void *File; /* Low level IO callback. */ WriterCallback FileWriter; /* The start of the buffer. */ uint8_t *BufferStart; /* Total size of the buffer. */ uint32_t BufferSz; /* Current byte offset from the start of the buffer. */ uint32_t CurOffset; } ProfBufferIO; /* The creator interface used by testing. */ ProfBufferIO *lprofCreateBufferIOInternal(void *File, uint32_t BufferSz); /*! * This is the interface to create a handle for buffered IO. */ ProfBufferIO *lprofCreateBufferIO(WriterCallback FileWriter, void *File); /*! * The interface to destroy the bufferIO handle and reclaim * the memory. */ void lprofDeleteBufferIO(ProfBufferIO *BufferIO); /*! * This is the interface to write \c Data of \c Size bytes through * \c BufferIO. Returns 0 if successful, otherwise return -1. */ int lprofBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data, uint32_t Size); /*! * The interface to flush the remaining data in the buffer. * through the low level writer callback. */ int lprofBufferIOFlush(ProfBufferIO *BufferIO); /* The low level interface to write data into a buffer. It is used as the * callback by other high level writer methods such as buffered IO writer * and profile data writer. */ uint32_t lprofBufferWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs, void **WriterCtx); struct ValueProfData; struct ValueProfRecord; struct InstrProfValueData; struct ValueProfNode; /*! * The class that defines a set of methods to read value profile * data for streaming/serialization from the instrumentation runtime. */ typedef struct VPDataReaderType { uint32_t (*InitRTRecord)(const __llvm_profile_data *Data, uint8_t *SiteCountArray[]); /* Function pointer to getValueProfRecordHeader method. */ uint32_t (*GetValueProfRecordHeaderSize)(uint32_t NumSites); /* Function pointer to getFristValueProfRecord method. */ struct ValueProfRecord *(*GetFirstValueProfRecord)(struct ValueProfData *); /* Return the number of value data for site \p Site. */ uint32_t (*GetNumValueDataForSite)(uint32_t VK, uint32_t Site); /* Return the total size of the value profile data of the * current function. */ uint32_t (*GetValueProfDataSize)(void); /*! * Read the next \p N value data for site \p Site and store the data * in \p Dst. \p StartNode is the first value node to start with if * it is not null. The function returns the pointer to the value * node pointer to be used as the \p StartNode of the next batch reading. * If there is nothing left, it returns NULL. */ struct ValueProfNode *(*GetValueData)(uint32_t ValueKind, uint32_t Site, struct InstrProfValueData *Dst, struct ValueProfNode *StartNode, uint32_t N); } VPDataReaderType; int lprofWriteData(WriterCallback Writer, void *WriterCtx, VPDataReaderType *VPDataReader); int lprofWriteDataImpl(WriterCallback Writer, void *WriterCtx, const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, VPDataReaderType *VPDataReader, const char *NamesBegin, const char *NamesEnd); /* Merge value profile data pointed to by SrcValueProfData into * in-memory profile counters pointed by to DstData. */ void lprofMergeValueProfData(struct ValueProfData *SrcValueProfData, __llvm_profile_data *DstData); VPDataReaderType *lprofGetVPDataReader(); /* Internal interface used by test to reset the max number of * tracked values per value site to be \p MaxVals. */ void lprofSetMaxValsPerSite(uint32_t MaxVals); void lprofSetupValueProfiler(); /* Return the profile header 'signature' value associated with the current * executable or shared library. The signature value can be used to for * a profile name that is unique to this load module so that it does not * collide with profiles from other binaries. It also allows shared libraries * to dump merged profile data into its own profile file. */ uint64_t lprofGetLoadModuleSignature(); /* * Return non zero value if the profile data has already been * dumped to the file. */ unsigned lprofProfileDumped(); void lprofSetProfileDumped(); COMPILER_RT_VISIBILITY extern void (*FreeHook)(void *); COMPILER_RT_VISIBILITY extern uint8_t *DynamicBufferIOBuffer; COMPILER_RT_VISIBILITY extern uint32_t VPBufferSize; COMPILER_RT_VISIBILITY extern uint32_t VPMaxNumValsPerSite; /* Pointer to the start of static value counters to be allocted. */ COMPILER_RT_VISIBILITY extern ValueProfNode *CurrentVNode; COMPILER_RT_VISIBILITY extern ValueProfNode *EndVNode; extern void (*VPMergeHook)(struct ValueProfData *, __llvm_profile_data *); #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfiling.c0000664000175000017500000000455312771044510026534 0ustar mwhudsonmwhudson/*===- InstrProfiling.c - Support library for PGO instrumentation ---------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" #include #include #include #include #define INSTR_PROF_VALUE_PROF_DATA #include "InstrProfData.inc" COMPILER_RT_WEAK uint64_t INSTR_PROF_RAW_VERSION_VAR = INSTR_PROF_RAW_VERSION; COMPILER_RT_WEAK char INSTR_PROF_PROFILE_NAME_VAR[1] = {0}; COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) { return sizeof(void *) == sizeof(uint64_t) ? (INSTR_PROF_RAW_MAGIC_64) : (INSTR_PROF_RAW_MAGIC_32); } static unsigned ProfileDumped = 0; COMPILER_RT_VISIBILITY unsigned lprofProfileDumped() { return ProfileDumped; } COMPILER_RT_VISIBILITY void lprofSetProfileDumped() { ProfileDumped = 1; } /* Return the number of bytes needed to add to SizeInBytes to make it * the result a multiple of 8. */ COMPILER_RT_VISIBILITY uint8_t __llvm_profile_get_num_padding_bytes(uint64_t SizeInBytes) { return 7 & (sizeof(uint64_t) - SizeInBytes % sizeof(uint64_t)); } COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_version(void) { return __llvm_profile_raw_version; } COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) { uint64_t *I = __llvm_profile_begin_counters(); uint64_t *E = __llvm_profile_end_counters(); memset(I, 0, sizeof(uint64_t) * (E - I)); const __llvm_profile_data *DataBegin = __llvm_profile_begin_data(); const __llvm_profile_data *DataEnd = __llvm_profile_end_data(); const __llvm_profile_data *DI; for (DI = DataBegin; DI < DataEnd; ++DI) { uint64_t CurrentVSiteCount = 0; uint32_t VKI, i; if (!DI->Values) continue; ValueProfNode **ValueCounters = (ValueProfNode **)DI->Values; for (VKI = IPVK_First; VKI <= IPVK_Last; ++VKI) CurrentVSiteCount += DI->NumValueSites[VKI]; for (i = 0; i < CurrentVSiteCount; ++i) { ValueProfNode *CurrentVNode = ValueCounters[i]; while (CurrentVNode) { CurrentVNode->Count = 0; CurrentVNode = CurrentVNode->Next; } } } ProfileDumped = 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/CMakeLists.txt0000664000175000017500000000441412760126006026152 0ustar mwhudsonmwhudson CHECK_CXX_SOURCE_COMPILES(" #ifdef _MSC_VER #include /* Workaround for PR19898. */ #include #endif int main() { #ifdef _MSC_VER volatile LONG val = 1; MemoryBarrier(); InterlockedCompareExchange(&val, 0, 1); InterlockedIncrement(&val); InterlockedDecrement(&val); #else volatile unsigned long val = 1; __sync_synchronize(); __sync_val_compare_and_swap(&val, 1, 0); __sync_add_and_fetch(&val, 1); __sync_sub_and_fetch(&val, 1); #endif return 0; } " COMPILER_RT_TARGET_HAS_ATOMICS) CHECK_CXX_SOURCE_COMPILES(" #if defined(__linux__) #include #endif #include int fd; int main() { struct flock s_flock; s_flock.l_type = F_WRLCK; fcntl(fd, F_SETLKW, &s_flock); return 0; } " COMPILER_RT_TARGET_HAS_FCNTL_LCK) add_compiler_rt_component(profile) set(PROFILE_SOURCES GCDAProfiling.c InstrProfiling.c InstrProfilingValue.c InstrProfilingBuffer.c InstrProfilingFile.c InstrProfilingMerge.c InstrProfilingMergeFile.c InstrProfilingWriter.c InstrProfilingPlatformDarwin.c InstrProfilingPlatformLinux.c InstrProfilingPlatformOther.c InstrProfilingRuntime.cc InstrProfilingUtil.c) if(WIN32) list(APPEND PROFILE_SOURCES WindowsMMap.c) endif() if(UNIX) set(EXTRA_FLAGS -fPIC -Wno-pedantic) endif() if(COMPILER_RT_TARGET_HAS_ATOMICS) set(EXTRA_FLAGS ${EXTRA_FLAGS} -DCOMPILER_RT_HAS_ATOMICS=1) endif() if(COMPILER_RT_TARGET_HAS_FCNTL_LCK) set(EXTRA_FLAGS ${EXTRA_FLAGS} -DCOMPILER_RT_HAS_FCNTL_LCK=1) endif() # This appears to be a C-only warning banning the use of locals in aggregate # initializers. All other compilers accept this, though. # nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable append_list_if(COMPILER_RT_HAS_WD4221_FLAG /wd4221 EXTRA_FLAGS) if(APPLE) add_compiler_rt_runtime(clang_rt.profile STATIC OS ${PROFILE_SUPPORTED_OS} ARCHS ${PROFILE_SUPPORTED_ARCH} CFLAGS ${EXTRA_FLAGS} SOURCES ${PROFILE_SOURCES} PARENT_TARGET profile) else() add_compiler_rt_runtime(clang_rt.profile STATIC ARCHS ${PROFILE_SUPPORTED_ARCH} CFLAGS ${EXTRA_FLAGS} SOURCES ${PROFILE_SOURCES} PARENT_TARGET profile) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingRuntime.cc0000664000175000017500000000124412744316060030237 0ustar mwhudsonmwhudson//===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// extern "C" { #include "InstrProfiling.h" /* int __llvm_profile_runtime */ COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR; } namespace { class RegisterRuntime { public: RegisterRuntime() { __llvm_profile_register_write_file_atexit(); __llvm_profile_initialize_file(); } }; RegisterRuntime Registration; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/WindowsMMap.h0000664000175000017500000000274712731036642026003 0ustar mwhudsonmwhudson/*===- WindowsMMap.h - Support library for PGO instrumentation ------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #ifndef PROFILE_INSTRPROFILING_WINDOWS_MMAP_H #define PROFILE_INSTRPROFILING_WINDOWS_MMAP_H #if defined(_WIN32) #include #include #include /* * mmap() flags */ #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define PROT_EXEC 0x0 #define MAP_FILE 0x00 #define MAP_SHARED 0x01 #define MAP_PRIVATE 0x02 #define MAP_ANONYMOUS 0x20 #define MAP_ANON MAP_ANONYMOUS #define MAP_FAILED ((void *) -1) /* * msync() flags */ #define MS_ASYNC 0x0001 /* return immediately */ #define MS_INVALIDATE 0x0002 /* invalidate all cached data */ #define MS_SYNC 0x0010 /* msync synchronously */ /* * flock() operations */ #define LOCK_SH 1 /* shared lock */ #define LOCK_EX 2 /* exclusive lock */ #define LOCK_NB 4 /* don't block when locking */ #define LOCK_UN 8 /* unlock */ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); void munmap(void *addr, size_t length); int msync(void *addr, size_t length, int flags); int flock(int fd, int operation); #endif /* _WIN32 */ #endif /* PROFILE_INSTRPROFILING_WINDOWS_MMAP_H */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingBuffer.c0000664000175000017500000000506012714224233027657 0ustar mwhudsonmwhudson/*===- InstrProfilingBuffer.c - Write instrumentation to a memory buffer --===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_size_for_buffer(void) { const __llvm_profile_data *DataBegin = __llvm_profile_begin_data(); const __llvm_profile_data *DataEnd = __llvm_profile_end_data(); const uint64_t *CountersBegin = __llvm_profile_begin_counters(); const uint64_t *CountersEnd = __llvm_profile_end_counters(); const char *NamesBegin = __llvm_profile_begin_names(); const char *NamesEnd = __llvm_profile_end_names(); return __llvm_profile_get_size_for_buffer_internal( DataBegin, DataEnd, CountersBegin, CountersEnd, NamesBegin, NamesEnd); } COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin, const __llvm_profile_data *End) { intptr_t BeginI = (intptr_t)Begin, EndI = (intptr_t)End; return ((EndI + sizeof(__llvm_profile_data) - 1) - BeginI) / sizeof(__llvm_profile_data); } COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_size_for_buffer_internal( const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, const char *NamesBegin, const char *NamesEnd) { /* Match logic in __llvm_profile_write_buffer(). */ const uint64_t NamesSize = (NamesEnd - NamesBegin) * sizeof(char); const uint8_t Padding = __llvm_profile_get_num_padding_bytes(NamesSize); return sizeof(__llvm_profile_header) + (__llvm_profile_get_data_size(DataBegin, DataEnd) * sizeof(__llvm_profile_data)) + (CountersEnd - CountersBegin) * sizeof(uint64_t) + NamesSize + Padding; } COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer(char *Buffer) { return lprofWriteData(lprofBufferWriter, Buffer, 0); } COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer_internal( char *Buffer, const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, const char *NamesBegin, const char *NamesEnd) { return lprofWriteDataImpl(lprofBufferWriter, Buffer, DataBegin, DataEnd, CountersBegin, CountersEnd, 0, NamesBegin, NamesEnd); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingUtil.c0000664000175000017500000001126512743511000027360 0ustar mwhudsonmwhudson/*===- InstrProfilingUtil.c - Support library for PGO instrumentation -----===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfilingUtil.h" #include "InstrProfiling.h" #ifdef _WIN32 #include #include #include #else #include #include #include #include #include #endif #ifdef COMPILER_RT_HAS_UNAME #include #endif #include #include COMPILER_RT_VISIBILITY void __llvm_profile_recursive_mkdir(char *path) { int i; for (i = 1; path[i] != '\0'; ++i) { char save = path[i]; if (!IS_DIR_SEPARATOR(path[i])) continue; path[i] = '\0'; #ifdef _WIN32 _mkdir(path); #else mkdir(path, 0755); /* Some of these will fail, ignore it. */ #endif path[i] = save; } } #if COMPILER_RT_HAS_ATOMICS != 1 COMPILER_RT_VISIBILITY uint32_t lprofBoolCmpXchg(void **Ptr, void *OldV, void *NewV) { void *R = *Ptr; if (R == OldV) { *Ptr = NewV; return 1; } return 0; } COMPILER_RT_VISIBILITY void *lprofPtrFetchAdd(void **Mem, long ByteIncr) { void *Old = *Mem; *((char **)Mem) += ByteIncr; return Old; } #endif #ifdef COMPILER_RT_HAS_UNAME COMPILER_RT_VISIBILITY int lprofGetHostName(char *Name, int Len) { struct utsname N; int R; if (!(R = uname(&N))) strncpy(Name, N.nodename, Len); return R; } #endif COMPILER_RT_VISIBILITY FILE *lprofOpenFileEx(const char *ProfileName) { FILE *f; int fd; #ifdef COMPILER_RT_HAS_FCNTL_LCK struct flock s_flock; s_flock.l_whence = SEEK_SET; s_flock.l_start = 0; s_flock.l_len = 0; /* Until EOF. */ s_flock.l_pid = getpid(); s_flock.l_type = F_WRLCK; fd = open(ProfileName, O_RDWR | O_CREAT, 0666); if (fd < 0) return NULL; while (fcntl(fd, F_SETLKW, &s_flock) == -1) { if (errno != EINTR) { if (errno == ENOLCK) { PROF_WARN("Data may be corrupted during profile merging : %s\n", "Fail to obtain file lock due to system limit."); } break; } } f = fdopen(fd, "r+b"); #elif defined(_WIN32) // FIXME: Use the wide variants to handle Unicode filenames. HANDLE h = CreateFileA(ProfileName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (h == INVALID_HANDLE_VALUE) return NULL; fd = _open_osfhandle((intptr_t)h, 0); if (fd == -1) { CloseHandle(h); return NULL; } f = _fdopen(fd, "r+b"); if (f == 0) { CloseHandle(h); return NULL; } #else /* Worst case no locking applied. */ PROF_WARN("Concurrent file access is not supported : %s\n", "lack file locking"); fd = open(ProfileName, O_RDWR | O_CREAT, 0666); if (fd < 0) return NULL; f = fdopen(fd, "r+b"); #endif return f; } COMPILER_RT_VISIBILITY const char *lprofGetPathPrefix(int *PrefixStrip, size_t *PrefixLen) { const char *Prefix = getenv("GCOV_PREFIX"); const char *PrefixStripStr = getenv("GCOV_PREFIX_STRIP"); *PrefixLen = 0; *PrefixStrip = 0; if (Prefix == NULL || Prefix[0] == '\0') return NULL; if (PrefixStripStr) { *PrefixStrip = atoi(PrefixStripStr); /* Negative GCOV_PREFIX_STRIP values are ignored */ if (*PrefixStrip < 0) *PrefixStrip = 0; } else { *PrefixStrip = 0; } *PrefixLen = strlen(Prefix); return Prefix; } COMPILER_RT_VISIBILITY void lprofApplyPathPrefix(char *Dest, const char *PathStr, const char *Prefix, size_t PrefixLen, int PrefixStrip) { const char *Ptr; int Level; const char *StrippedPathStr = PathStr; for (Level = 0, Ptr = PathStr + 1; Level < PrefixStrip; ++Ptr) { if (*Ptr == '\0') break; if (!IS_DIR_SEPARATOR(*Ptr)) continue; StrippedPathStr = Ptr; ++Level; } memcpy(Dest, Prefix, PrefixLen); if (!IS_DIR_SEPARATOR(Prefix[PrefixLen - 1])) Dest[PrefixLen++] = DIR_SEPARATOR; memcpy(Dest + PrefixLen, StrippedPathStr, strlen(StrippedPathStr) + 1); } COMPILER_RT_VISIBILITY const char * lprofFindFirstDirSeparator(const char *Path) { const char *Sep; Sep = strchr(Path, DIR_SEPARATOR); if (Sep) return Sep; #if defined(DIR_SEPARATOR_2) Sep = strchr(Path, DIR_SEPARATOR_2); #endif return Sep; } COMPILER_RT_VISIBILITY const char *lprofFindLastDirSeparator(const char *Path) { const char *Sep; Sep = strrchr(Path, DIR_SEPARATOR); if (Sep) return Sep; #if defined(DIR_SEPARATOR_2) Sep = strrchr(Path, DIR_SEPARATOR_2); #endif return Sep; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingPort.h0000664000175000017500000001063412742227756027420 0ustar mwhudsonmwhudson/*===- InstrProfilingPort.h- Support library for PGO instrumentation ------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #ifndef PROFILE_INSTRPROFILING_PORT_H_ #define PROFILE_INSTRPROFILING_PORT_H_ #ifdef _MSC_VER #define COMPILER_RT_ALIGNAS(x) __declspec(align(x)) #define COMPILER_RT_VISIBILITY /* FIXME: selectany does not have the same semantics as weak. */ #define COMPILER_RT_WEAK __declspec(selectany) /* Need to include */ #define COMPILER_RT_ALLOCA _alloca /* Need to include and */ #define COMPILER_RT_FTRUNCATE(f,l) _chsize(_fileno(f),l) #elif __GNUC__ #define COMPILER_RT_ALIGNAS(x) __attribute__((aligned(x))) #define COMPILER_RT_VISIBILITY __attribute__((visibility("hidden"))) #define COMPILER_RT_WEAK __attribute__((weak)) #define COMPILER_RT_ALLOCA __builtin_alloca #define COMPILER_RT_FTRUNCATE(f,l) ftruncate(fileno(f),l) #endif #if defined(__APPLE__) #define COMPILER_RT_SEG "__DATA," #else #define COMPILER_RT_SEG "" #endif #ifdef _MSC_VER #define COMPILER_RT_SECTION(Sect) __declspec(allocate(Sect)) #else #define COMPILER_RT_SECTION(Sect) __attribute__((section(Sect))) #endif #define COMPILER_RT_MAX_HOSTLEN 128 #ifdef _MSC_VER #define COMPILER_RT_GETHOSTNAME(Name, Len) gethostname(Name, Len) #elif defined(__ORBIS__) #define COMPILER_RT_GETHOSTNAME(Name, Len) ((void)(Name), (void)(Len), (-1)) #else #define COMPILER_RT_GETHOSTNAME(Name, Len) lprofGetHostName(Name, Len) #define COMPILER_RT_HAS_UNAME 1 #endif #if COMPILER_RT_HAS_ATOMICS == 1 #ifdef _MSC_VER #include #if _MSC_VER < 1900 #define snprintf _snprintf #endif #if defined(_WIN64) #define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \ (InterlockedCompareExchange64((LONGLONG volatile *)Ptr, (LONGLONG)NewV, \ (LONGLONG)OldV) == (LONGLONG)OldV) #define COMPILER_RT_PTR_FETCH_ADD(DomType, PtrVar, PtrIncr) \ (DomType *)InterlockedExchangeAdd64((LONGLONG volatile *)&PtrVar, \ (LONGLONG)sizeof(DomType) * PtrIncr) #else /* !defined(_WIN64) */ #define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \ (InterlockedCompareExchange((LONG volatile *)Ptr, (LONG)NewV, (LONG)OldV) == \ (LONG)OldV) #define COMPILER_RT_PTR_FETCH_ADD(DomType, PtrVar, PtrIncr) \ (DomType *)InterlockedExchangeAdd((LONG volatile *)&PtrVar, \ (LONG)sizeof(DomType) * PtrIncr) #endif #else /* !defined(_MSC_VER) */ #define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \ __sync_bool_compare_and_swap(Ptr, OldV, NewV) #define COMPILER_RT_PTR_FETCH_ADD(DomType, PtrVar, PtrIncr) \ (DomType *)__sync_fetch_and_add((long *)&PtrVar, sizeof(DomType) * PtrIncr) #endif #else /* COMPILER_RT_HAS_ATOMICS != 1 */ #include "InstrProfilingUtil.h" #define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \ lprofBoolCmpXchg((void **)Ptr, OldV, NewV) #define COMPILER_RT_PTR_FETCH_ADD(DomType, PtrVar, PtrIncr) \ (DomType *)lprofPtrFetchAdd((void **)&PtrVar, sizeof(DomType) * PtrIncr) #endif #if defined(_WIN32) #define DIR_SEPARATOR '\\' #define DIR_SEPARATOR_2 '/' #else #define DIR_SEPARATOR '/' #endif #ifndef DIR_SEPARATOR_2 #define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ #define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define PROF_ERR(Format, ...) \ fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__); #define PROF_WARN(Format, ...) \ fprintf(stderr, "LLVM Profile Warning: " Format, __VA_ARGS__); #define PROF_NOTE(Format, ...) \ fprintf(stderr, "LLVM Profile Note: " Format, __VA_ARGS__); #if defined(__FreeBSD__) #include #include #else /* defined(__FreeBSD__) */ #include #include #endif /* defined(__FreeBSD__) && defined(__i386__) */ #endif /* PROFILE_INSTRPROFILING_PORT_H_ */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfiling.h0000664000175000017500000001743612752255072026553 0ustar mwhudsonmwhudson/*===- InstrProfiling.h- Support library for PGO instrumentation ----------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #ifndef PROFILE_INSTRPROFILING_H_ #define PROFILE_INSTRPROFILING_H_ #include "InstrProfilingPort.h" #define INSTR_PROF_VISIBILITY COMPILER_RT_VISIBILITY #include "InstrProfData.inc" enum ValueKind { #define VALUE_PROF_KIND(Enumerator, Value) Enumerator = Value, #include "InstrProfData.inc" }; typedef void *IntPtrT; typedef struct COMPILER_RT_ALIGNAS(INSTR_PROF_DATA_ALIGNMENT) __llvm_profile_data { #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) Type Name; #include "InstrProfData.inc" } __llvm_profile_data; typedef struct __llvm_profile_header { #define INSTR_PROF_RAW_HEADER(Type, Name, Initializer) Type Name; #include "InstrProfData.inc" } __llvm_profile_header; typedef struct ValueProfNode * PtrToNodeT; typedef struct ValueProfNode { #define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer) Type Name; #include "InstrProfData.inc" } ValueProfNode; /*! * \brief Get number of bytes necessary to pad the argument to eight * byte boundary. */ uint8_t __llvm_profile_get_num_padding_bytes(uint64_t SizeInBytes); /*! * \brief Get required size for profile buffer. */ uint64_t __llvm_profile_get_size_for_buffer(void); /*! * \brief Write instrumentation data to the given buffer. * * \pre \c Buffer is the start of a buffer at least as big as \a * __llvm_profile_get_size_for_buffer(). */ int __llvm_profile_write_buffer(char *Buffer); const __llvm_profile_data *__llvm_profile_begin_data(void); const __llvm_profile_data *__llvm_profile_end_data(void); const char *__llvm_profile_begin_names(void); const char *__llvm_profile_end_names(void); uint64_t *__llvm_profile_begin_counters(void); uint64_t *__llvm_profile_end_counters(void); ValueProfNode *__llvm_profile_begin_vnodes(); ValueProfNode *__llvm_profile_end_vnodes(); /*! * \brief Clear profile counters to zero. * */ void __llvm_profile_reset_counters(void); /*! * \brief Merge profile data from buffer. * * Read profile data form buffer \p Profile and merge with * in-process profile counters. The client is expected to * have checked or already knows the profile data in the * buffer matches the in-process counter structure before * calling it. */ void __llvm_profile_merge_from_buffer(const char *Profile, uint64_t Size); /*! \brief Check if profile in buffer matches the current binary. * * Returns 0 (success) if the profile data in buffer \p Profile with size * \p Size was generated by the same binary and therefore matches * structurally the in-process counters. If the profile data in buffer is * not compatible, the interface returns 1 (failure). */ int __llvm_profile_check_compatibility(const char *Profile, uint64_t Size); /*! * \brief Counts the number of times a target value is seen. * * Records the target value for the CounterIndex if not seen before. Otherwise, * increments the counter associated w/ the target value. * void __llvm_profile_instrument_target(uint64_t TargetValue, void *Data, * uint32_t CounterIndex); */ void INSTR_PROF_VALUE_PROF_FUNC( #define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType) ArgType ArgName #include "InstrProfData.inc" ); /*! * \brief Write instrumentation data to the current file. * * Writes to the file with the last name given to \a * * __llvm_profile_set_filename(), * or if it hasn't been called, the \c LLVM_PROFILE_FILE environment variable, * or if that's not set, the last name set to INSTR_PROF_PROFILE_NAME_VAR, * or if that's not set, \c "default.profraw". */ int __llvm_profile_write_file(void); /*! * \brief this is a wrapper interface to \c __llvm_profile_write_file. * After this interface is invoked, a arleady dumped flag will be set * so that profile won't be dumped again during program exit. * Invocation of interface __llvm_profile_reset_counters will clear * the flag. This interface is designed to be used to collect profile * data from user selected hot regions. The use model is * __llvm_profile_reset_counters(); * ... hot region 1 * __llvm_profile_dump(); * .. some other code * __llvm_profile_reset_counters(); * ... hot region 2 * __llvm_profile_dump(); * * It is expected that on-line profile merging is on with \c %m specifier * used in profile filename . If merging is not turned on, user is expected * to invoke __llvm_profile_set_filename to specify different profile names * for different regions before dumping to avoid profile write clobbering. */ int __llvm_profile_dump(void); /*! * \brief Set the filename for writing instrumentation data. * * Sets the filename to be used for subsequent calls to * \a __llvm_profile_write_file(). * * \c Name is not copied, so it must remain valid. Passing NULL resets the * filename logic to the default behaviour. */ void __llvm_profile_set_filename(const char *Name); /*! \brief Register to write instrumentation data to file at exit. */ int __llvm_profile_register_write_file_atexit(void); /*! \brief Initialize file handling. */ void __llvm_profile_initialize_file(void); /*! * \brief Return path prefix (excluding the base filename) of the profile data. * This is useful for users using \c -fprofile-generate=./path_prefix who do * not care about the default raw profile name. It is also useful to collect * more than more profile data files dumped in the same directory (Online * merge mode is turned on for instrumented programs with shared libs). * Side-effect: this API call will invoke malloc with dynamic memory allocation. */ const char *__llvm_profile_get_path_prefix(); /*! \brief Get the magic token for the file format. */ uint64_t __llvm_profile_get_magic(void); /*! \brief Get the version of the file format. */ uint64_t __llvm_profile_get_version(void); /*! \brief Get the number of entries in the profile data section. */ uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin, const __llvm_profile_data *End); /*! * This variable is defined in InstrProfilingRuntime.cc as a hidden * symbol. Its main purpose is to enable profile runtime user to * bypass runtime initialization code -- if the client code explicitly * define this variable, then InstProfileRuntime.o won't be linked in. * Note that this variable's visibility needs to be hidden so that the * definition of this variable in an instrumented shared library won't * affect runtime initialization decision of the main program. * __llvm_profile_profile_runtime. */ COMPILER_RT_VISIBILITY extern int INSTR_PROF_PROFILE_RUNTIME_VAR; /*! * This variable is defined in InstrProfiling.c. Its main purpose is to * encode the raw profile version value and other format related information * such as whether the profile is from IR based instrumentation. The variable * is defined as weak so that compiler can emit an overriding definition * depending on user option. Since we don't support mixing FE and IR based * data in the same raw profile data file (in other words, shared libs and * main program are expected to be instrumented in the same way), there is * no need for this variable to be hidden. */ extern uint64_t INSTR_PROF_RAW_VERSION_VAR; /* __llvm_profile_raw_version */ /*! * This variable is a weak symbol defined in InstrProfiling.c. It allows * compiler instrumentation to provide overriding definition with value * from compiler command line. This variable has default visibility. */ extern char INSTR_PROF_PROFILE_NAME_VAR[1]; /* __llvm_profile_filename. */ #endif /* PROFILE_INSTRPROFILING_H_ */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingMergeFile.c0000664000175000017500000000302112666727605030321 0ustar mwhudsonmwhudson/*===- InstrProfilingMergeFile.c - Profile in-process Merging ------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* |*===----------------------------------------------------------------------=== |* This file defines APIs needed to support in-process merging for profile data |* stored in files. \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" #include "InstrProfilingUtil.h" #define INSTR_PROF_VALUE_PROF_DATA #include "InstrProfData.inc" void (*VPMergeHook)(ValueProfData *, __llvm_profile_data *) = &lprofMergeValueProfData; /* Merge value profile data pointed to by SrcValueProfData into * in-memory profile counters pointed by to DstData. */ void lprofMergeValueProfData(ValueProfData *SrcValueProfData, __llvm_profile_data *DstData) { unsigned I, S, V, C; InstrProfValueData *VData; ValueProfRecord *VR = getFirstValueProfRecord(SrcValueProfData); for (I = 0; I < SrcValueProfData->NumValueKinds; I++) { VData = getValueProfRecordValueData(VR); for (S = 0; S < VR->NumValueSites; S++) { uint8_t NV = VR->SiteCountArray[S]; for (V = 0; V < NV; V++) { for (C = 0; C < VData[V].Count; C++) __llvm_profile_instrument_target(VData[V].Value, DstData, S); } } VR = getValueProfRecordNext(VR); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingPlatformLinux.c0000664000175000017500000000570112720357763031270 0ustar mwhudsonmwhudson/*===- InstrProfilingPlatformLinux.c - Profile data Linux platform ------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #if defined(__linux__) || defined(__FreeBSD__) #include #define PROF_DATA_START INSTR_PROF_SECT_START(INSTR_PROF_DATA_SECT_NAME) #define PROF_DATA_STOP INSTR_PROF_SECT_STOP(INSTR_PROF_DATA_SECT_NAME) #define PROF_NAME_START INSTR_PROF_SECT_START(INSTR_PROF_NAME_SECT_NAME) #define PROF_NAME_STOP INSTR_PROF_SECT_STOP(INSTR_PROF_NAME_SECT_NAME) #define PROF_CNTS_START INSTR_PROF_SECT_START(INSTR_PROF_CNTS_SECT_NAME) #define PROF_CNTS_STOP INSTR_PROF_SECT_STOP(INSTR_PROF_CNTS_SECT_NAME) #define PROF_VNODES_START INSTR_PROF_SECT_START(INSTR_PROF_VNODES_SECT_NAME) #define PROF_VNODES_STOP INSTR_PROF_SECT_STOP(INSTR_PROF_VNODES_SECT_NAME) /* Declare section start and stop symbols for various sections * generated by compiler instrumentation. */ extern __llvm_profile_data PROF_DATA_START COMPILER_RT_VISIBILITY; extern __llvm_profile_data PROF_DATA_STOP COMPILER_RT_VISIBILITY; extern uint64_t PROF_CNTS_START COMPILER_RT_VISIBILITY; extern uint64_t PROF_CNTS_STOP COMPILER_RT_VISIBILITY; extern char PROF_NAME_START COMPILER_RT_VISIBILITY; extern char PROF_NAME_STOP COMPILER_RT_VISIBILITY; extern ValueProfNode PROF_VNODES_START COMPILER_RT_VISIBILITY; extern ValueProfNode PROF_VNODES_STOP COMPILER_RT_VISIBILITY; /* Add dummy data to ensure the section is always created. */ __llvm_profile_data __prof_data_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_DATA_SECT_NAME_STR); uint64_t __prof_cnts_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_CNTS_SECT_NAME_STR); char __prof_nms_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_NAME_SECT_NAME_STR); ValueProfNode __prof_vnodes_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_VNODES_SECT_NAME_STR); COMPILER_RT_VISIBILITY const __llvm_profile_data * __llvm_profile_begin_data(void) { return &PROF_DATA_START; } COMPILER_RT_VISIBILITY const __llvm_profile_data * __llvm_profile_end_data(void) { return &PROF_DATA_STOP; } COMPILER_RT_VISIBILITY const char *__llvm_profile_begin_names(void) { return &PROF_NAME_START; } COMPILER_RT_VISIBILITY const char *__llvm_profile_end_names(void) { return &PROF_NAME_STOP; } COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_begin_counters(void) { return &PROF_CNTS_START; } COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_end_counters(void) { return &PROF_CNTS_STOP; } COMPILER_RT_VISIBILITY ValueProfNode * __llvm_profile_begin_vnodes(void) { return &PROF_VNODES_START; } COMPILER_RT_VISIBILITY ValueProfNode *__llvm_profile_end_vnodes(void) { return &PROF_VNODES_STOP; } COMPILER_RT_VISIBILITY ValueProfNode *CurrentVNode = &PROF_VNODES_START; COMPILER_RT_VISIBILITY ValueProfNode *EndVNode = &PROF_VNODES_STOP; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/WindowsMMap.c0000664000175000017500000000612712761364560026000 0ustar mwhudsonmwhudson/* * This code is derived from uClibc (original license follows). * https://git.uclibc.org/uClibc/tree/utils/mmap-windows.c */ /* mmap() replacement for Windows * * Author: Mike Frysinger * Placed into the public domain */ /* References: * CreateFileMapping: http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx * CloseHandle: http://msdn.microsoft.com/en-us/library/ms724211(VS.85).aspx * MapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366761(VS.85).aspx * UnmapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366882(VS.85).aspx */ #if defined(_WIN32) #include "WindowsMMap.h" #include "InstrProfiling.h" #define WIN32_LEAN_AND_MEAN #include #ifdef __USE_FILE_OFFSET64 # define DWORD_HI(x) (x >> 32) # define DWORD_LO(x) ((x) & 0xffffffff) #else # define DWORD_HI(x) (0) # define DWORD_LO(x) (x) #endif COMPILER_RT_VISIBILITY void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) return MAP_FAILED; if (fd == -1) { if (!(flags & MAP_ANON) || offset) return MAP_FAILED; } else if (flags & MAP_ANON) return MAP_FAILED; DWORD flProtect; if (prot & PROT_WRITE) { if (prot & PROT_EXEC) flProtect = PAGE_EXECUTE_READWRITE; else flProtect = PAGE_READWRITE; } else if (prot & PROT_EXEC) { if (prot & PROT_READ) flProtect = PAGE_EXECUTE_READ; else if (prot & PROT_EXEC) flProtect = PAGE_EXECUTE; } else flProtect = PAGE_READONLY; off_t end = length + offset; HANDLE mmap_fd, h; if (fd == -1) mmap_fd = INVALID_HANDLE_VALUE; else mmap_fd = (HANDLE)_get_osfhandle(fd); h = CreateFileMapping(mmap_fd, NULL, flProtect, DWORD_HI(end), DWORD_LO(end), NULL); if (h == NULL) return MAP_FAILED; DWORD dwDesiredAccess; if (prot & PROT_WRITE) dwDesiredAccess = FILE_MAP_WRITE; else dwDesiredAccess = FILE_MAP_READ; if (prot & PROT_EXEC) dwDesiredAccess |= FILE_MAP_EXECUTE; if (flags & MAP_PRIVATE) dwDesiredAccess |= FILE_MAP_COPY; void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); if (ret == NULL) { CloseHandle(h); ret = MAP_FAILED; } return ret; } COMPILER_RT_VISIBILITY void munmap(void *addr, size_t length) { UnmapViewOfFile(addr); /* ruh-ro, we leaked handle from CreateFileMapping() ... */ } COMPILER_RT_VISIBILITY int msync(void *addr, size_t length, int flags) { if (flags & MS_INVALIDATE) return -1; /* Not supported. */ /* Exactly one of MS_ASYNC or MS_SYNC must be specified. */ switch (flags & (MS_ASYNC | MS_SYNC)) { case MS_SYNC: case MS_ASYNC: break; default: return -1; } if (!FlushViewOfFile(addr, length)) return -1; if (flags & MS_SYNC) { /* FIXME: No longer have access to handle from CreateFileMapping(). */ /* * if (!FlushFileBuffers(h)) * return -1; */ } return 0; } COMPILER_RT_VISIBILITY int flock(int fd, int operation) { return -1; /* Not supported. */ } #undef DWORD_HI #undef DWORD_LO #endif /* _WIN32 */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/profile/InstrProfilingFile.c0000664000175000017500000004420113001263224027316 0ustar mwhudsonmwhudson/*===- InstrProfilingFile.c - Write instrumentation to a file -------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" #include "InstrProfilingInternal.h" #include "InstrProfilingUtil.h" #include #include #include #include #ifdef _MSC_VER /* For _alloca. */ #include #endif #if defined(_WIN32) #include "WindowsMMap.h" /* For _chsize_s */ #include #else #include #include #include #if defined(__linux__) #include #endif #endif /* From where is profile name specified. * The order the enumerators define their * precedence. Re-order them may lead to * runtime behavior change. */ typedef enum ProfileNameSpecifier { PNS_unknown = 0, PNS_default, PNS_command_line, PNS_environment, PNS_runtime_api } ProfileNameSpecifier; static const char *getPNSStr(ProfileNameSpecifier PNS) { switch (PNS) { case PNS_default: return "default setting"; case PNS_command_line: return "command line"; case PNS_environment: return "environment variable"; case PNS_runtime_api: return "runtime API"; default: return "Unknown"; } } #define MAX_PID_SIZE 16 /* Data structure holding the result of parsed filename pattern. */ typedef struct lprofFilename { /* File name string possibly with %p or %h specifiers. */ const char *FilenamePat; /* A flag indicating if FilenamePat's memory is allocated * by runtime. */ unsigned OwnsFilenamePat; const char *ProfilePathPrefix; char PidChars[MAX_PID_SIZE]; char Hostname[COMPILER_RT_MAX_HOSTLEN]; unsigned NumPids; unsigned NumHosts; /* When in-process merging is enabled, this parameter specifies * the total number of profile data files shared by all the processes * spawned from the same binary. By default the value is 1. If merging * is not enabled, its value should be 0. This parameter is specified * by the %[0-9]m specifier. For instance %2m enables merging using * 2 profile data files. %1m is equivalent to %m. Also %m specifier * can only appear once at the end of the name pattern. */ unsigned MergePoolSize; ProfileNameSpecifier PNS; } lprofFilename; COMPILER_RT_WEAK lprofFilename lprofCurFilename = {0, 0, 0, {0}, {0}, 0, 0, 0, PNS_unknown}; int getpid(void); static int getCurFilenameLength(); static const char *getCurFilename(char *FilenameBuf); static unsigned doMerging() { return lprofCurFilename.MergePoolSize; } /* Return 1 if there is an error, otherwise return 0. */ static uint32_t fileWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs, void **WriterCtx) { uint32_t I; FILE *File = (FILE *)*WriterCtx; for (I = 0; I < NumIOVecs; I++) { if (fwrite(IOVecs[I].Data, IOVecs[I].ElmSize, IOVecs[I].NumElm, File) != IOVecs[I].NumElm) return 1; } return 0; } COMPILER_RT_VISIBILITY ProfBufferIO * lprofCreateBufferIOInternal(void *File, uint32_t BufferSz) { FreeHook = &free; DynamicBufferIOBuffer = (uint8_t *)calloc(BufferSz, 1); VPBufferSize = BufferSz; return lprofCreateBufferIO(fileWriter, File); } static void setupIOBuffer() { const char *BufferSzStr = 0; BufferSzStr = getenv("LLVM_VP_BUFFER_SIZE"); if (BufferSzStr && BufferSzStr[0]) { VPBufferSize = atoi(BufferSzStr); DynamicBufferIOBuffer = (uint8_t *)calloc(VPBufferSize, 1); } } /* Read profile data in \c ProfileFile and merge with in-memory profile counters. Returns -1 if there is fatal error, otheriwse 0 is returned. */ static int doProfileMerging(FILE *ProfileFile) { uint64_t ProfileFileSize; char *ProfileBuffer; if (fseek(ProfileFile, 0L, SEEK_END) == -1) { PROF_ERR("Unable to merge profile data, unable to get size: %s\n", strerror(errno)); return -1; } ProfileFileSize = ftell(ProfileFile); /* Restore file offset. */ if (fseek(ProfileFile, 0L, SEEK_SET) == -1) { PROF_ERR("Unable to merge profile data, unable to rewind: %s\n", strerror(errno)); return -1; } /* Nothing to merge. */ if (ProfileFileSize < sizeof(__llvm_profile_header)) { if (ProfileFileSize) PROF_WARN("Unable to merge profile data: %s\n", "source profile file is too small."); return 0; } ProfileBuffer = mmap(NULL, ProfileFileSize, PROT_READ, MAP_SHARED | MAP_FILE, fileno(ProfileFile), 0); if (ProfileBuffer == MAP_FAILED) { PROF_ERR("Unable to merge profile data, mmap failed: %s\n", strerror(errno)); return -1; } if (__llvm_profile_check_compatibility(ProfileBuffer, ProfileFileSize)) { (void)munmap(ProfileBuffer, ProfileFileSize); PROF_WARN("Unable to merge profile data: %s\n", "source profile file is not compatible."); return 0; } /* Now start merging */ __llvm_profile_merge_from_buffer(ProfileBuffer, ProfileFileSize); (void)munmap(ProfileBuffer, ProfileFileSize); return 0; } /* Open the profile data for merging. It opens the file in r+b mode with * file locking. If the file has content which is compatible with the * current process, it also reads in the profile data in the file and merge * it with in-memory counters. After the profile data is merged in memory, * the original profile data is truncated and gets ready for the profile * dumper. With profile merging enabled, each executable as well as any of * its instrumented shared libraries dump profile data into their own data file. */ static FILE *openFileForMerging(const char *ProfileFileName) { FILE *ProfileFile; int rc; ProfileFile = lprofOpenFileEx(ProfileFileName); if (!ProfileFile) return NULL; rc = doProfileMerging(ProfileFile); if (rc || COMPILER_RT_FTRUNCATE(ProfileFile, 0L) || fseek(ProfileFile, 0L, SEEK_SET) == -1) { PROF_ERR("Profile Merging of file %s failed: %s\n", ProfileFileName, strerror(errno)); fclose(ProfileFile); return NULL; } fseek(ProfileFile, 0L, SEEK_SET); return ProfileFile; } /* Write profile data to file \c OutputName. */ static int writeFile(const char *OutputName) { int RetVal; FILE *OutputFile; if (!doMerging()) OutputFile = fopen(OutputName, "ab"); else OutputFile = openFileForMerging(OutputName); if (!OutputFile) return -1; FreeHook = &free; setupIOBuffer(); RetVal = lprofWriteData(fileWriter, OutputFile, lprofGetVPDataReader()); fclose(OutputFile); return RetVal; } static void truncateCurrentFile(void) { const char *Filename; char *FilenameBuf; FILE *File; int Length; Length = getCurFilenameLength(); FilenameBuf = (char *)COMPILER_RT_ALLOCA(Length + 1); Filename = getCurFilename(FilenameBuf); if (!Filename) return; /* Create the directory holding the file, if needed. */ if (lprofFindFirstDirSeparator(Filename)) { char *Copy = (char *)COMPILER_RT_ALLOCA(Length + 1); strncpy(Copy, Filename, Length + 1); __llvm_profile_recursive_mkdir(Copy); } /* By pass file truncation to allow online raw profile * merging. */ if (lprofCurFilename.MergePoolSize) return; /* Truncate the file. Later we'll reopen and append. */ File = fopen(Filename, "w"); if (!File) return; fclose(File); } static const char *DefaultProfileName = "default.profraw"; static void resetFilenameToDefault(void) { if (lprofCurFilename.FilenamePat && lprofCurFilename.OwnsFilenamePat) { free((void *)lprofCurFilename.FilenamePat); } memset(&lprofCurFilename, 0, sizeof(lprofCurFilename)); lprofCurFilename.FilenamePat = DefaultProfileName; lprofCurFilename.PNS = PNS_default; } static int containsMergeSpecifier(const char *FilenamePat, int I) { return (FilenamePat[I] == 'm' || (FilenamePat[I] >= '1' && FilenamePat[I] <= '9' && /* If FilenamePat[I] is not '\0', the next byte is guaranteed * to be in-bound as the string is null terminated. */ FilenamePat[I + 1] == 'm')); } /* Parses the pattern string \p FilenamePat and stores the result to * lprofcurFilename structure. */ static int parseFilenamePattern(const char *FilenamePat, unsigned CopyFilenamePat) { int NumPids = 0, NumHosts = 0, I; char *PidChars = &lprofCurFilename.PidChars[0]; char *Hostname = &lprofCurFilename.Hostname[0]; int MergingEnabled = 0; /* Clean up cached prefix. */ if (lprofCurFilename.ProfilePathPrefix) free((void *)lprofCurFilename.ProfilePathPrefix); memset(&lprofCurFilename, 0, sizeof(lprofCurFilename)); if (lprofCurFilename.FilenamePat && lprofCurFilename.OwnsFilenamePat) { free((void *)lprofCurFilename.FilenamePat); } if (!CopyFilenamePat) lprofCurFilename.FilenamePat = FilenamePat; else { lprofCurFilename.FilenamePat = strdup(FilenamePat); lprofCurFilename.OwnsFilenamePat = 1; } /* Check the filename for "%p", which indicates a pid-substitution. */ for (I = 0; FilenamePat[I]; ++I) if (FilenamePat[I] == '%') { if (FilenamePat[++I] == 'p') { if (!NumPids++) { if (snprintf(PidChars, MAX_PID_SIZE, "%d", getpid()) <= 0) { PROF_WARN( "Unable to parse filename pattern %s. Using the default name.", FilenamePat); return -1; } } } else if (FilenamePat[I] == 'h') { if (!NumHosts++) if (COMPILER_RT_GETHOSTNAME(Hostname, COMPILER_RT_MAX_HOSTLEN)) { PROF_WARN( "Unable to parse filename pattern %s. Using the default name.", FilenamePat); return -1; } } else if (containsMergeSpecifier(FilenamePat, I)) { if (MergingEnabled) { PROF_WARN("%%m specifier can only be specified once in %s.\n", FilenamePat); return -1; } MergingEnabled = 1; if (FilenamePat[I] == 'm') lprofCurFilename.MergePoolSize = 1; else { lprofCurFilename.MergePoolSize = FilenamePat[I] - '0'; I++; /* advance to 'm' */ } } } lprofCurFilename.NumPids = NumPids; lprofCurFilename.NumHosts = NumHosts; return 0; } static void parseAndSetFilename(const char *FilenamePat, ProfileNameSpecifier PNS, unsigned CopyFilenamePat) { const char *OldFilenamePat = lprofCurFilename.FilenamePat; ProfileNameSpecifier OldPNS = lprofCurFilename.PNS; if (PNS < OldPNS) return; if (!FilenamePat) FilenamePat = DefaultProfileName; if (OldFilenamePat && !strcmp(OldFilenamePat, FilenamePat)) { lprofCurFilename.PNS = PNS; return; } /* When PNS >= OldPNS, the last one wins. */ if (!FilenamePat || parseFilenamePattern(FilenamePat, CopyFilenamePat)) resetFilenameToDefault(); lprofCurFilename.PNS = PNS; if (!OldFilenamePat) { if (getenv("LLVM_PROFILE_VERBOSE")) PROF_NOTE("Set profile file path to \"%s\" via %s.\n", lprofCurFilename.FilenamePat, getPNSStr(PNS)); } else { if (getenv("LLVM_PROFILE_VERBOSE")) PROF_NOTE("Override old profile path \"%s\" via %s to \"%s\" via %s.\n", OldFilenamePat, getPNSStr(OldPNS), lprofCurFilename.FilenamePat, getPNSStr(PNS)); } truncateCurrentFile(); } /* Return buffer length that is required to store the current profile * filename with PID and hostname substitutions. */ /* The length to hold uint64_t followed by 2 digit pool id including '_' */ #define SIGLEN 24 static int getCurFilenameLength() { int Len; if (!lprofCurFilename.FilenamePat || !lprofCurFilename.FilenamePat[0]) return 0; if (!(lprofCurFilename.NumPids || lprofCurFilename.NumHosts || lprofCurFilename.MergePoolSize)) return strlen(lprofCurFilename.FilenamePat); Len = strlen(lprofCurFilename.FilenamePat) + lprofCurFilename.NumPids * (strlen(lprofCurFilename.PidChars) - 2) + lprofCurFilename.NumHosts * (strlen(lprofCurFilename.Hostname) - 2); if (lprofCurFilename.MergePoolSize) Len += SIGLEN; return Len; } /* Return the pointer to the current profile file name (after substituting * PIDs and Hostnames in filename pattern. \p FilenameBuf is the buffer * to store the resulting filename. If no substitution is needed, the * current filename pattern string is directly returned. */ static const char *getCurFilename(char *FilenameBuf) { int I, J, PidLength, HostNameLength; const char *FilenamePat = lprofCurFilename.FilenamePat; if (!lprofCurFilename.FilenamePat || !lprofCurFilename.FilenamePat[0]) return 0; if (!(lprofCurFilename.NumPids || lprofCurFilename.NumHosts || lprofCurFilename.MergePoolSize)) return lprofCurFilename.FilenamePat; PidLength = strlen(lprofCurFilename.PidChars); HostNameLength = strlen(lprofCurFilename.Hostname); /* Construct the new filename. */ for (I = 0, J = 0; FilenamePat[I]; ++I) if (FilenamePat[I] == '%') { if (FilenamePat[++I] == 'p') { memcpy(FilenameBuf + J, lprofCurFilename.PidChars, PidLength); J += PidLength; } else if (FilenamePat[I] == 'h') { memcpy(FilenameBuf + J, lprofCurFilename.Hostname, HostNameLength); J += HostNameLength; } else if (containsMergeSpecifier(FilenamePat, I)) { char LoadModuleSignature[SIGLEN]; int S; int ProfilePoolId = getpid() % lprofCurFilename.MergePoolSize; S = snprintf(LoadModuleSignature, SIGLEN, "%" PRIu64 "_%d", lprofGetLoadModuleSignature(), ProfilePoolId); if (S == -1 || S > SIGLEN) S = SIGLEN; memcpy(FilenameBuf + J, LoadModuleSignature, S); J += S; if (FilenamePat[I] != 'm') I++; } /* Drop any unknown substitutions. */ } else FilenameBuf[J++] = FilenamePat[I]; FilenameBuf[J] = 0; return FilenameBuf; } /* Returns the pointer to the environment variable * string. Returns null if the env var is not set. */ static const char *getFilenamePatFromEnv(void) { const char *Filename = getenv("LLVM_PROFILE_FILE"); if (!Filename || !Filename[0]) return 0; return Filename; } COMPILER_RT_VISIBILITY const char *__llvm_profile_get_path_prefix(void) { int Length; char *FilenameBuf, *Prefix; const char *Filename, *PrefixEnd; if (lprofCurFilename.ProfilePathPrefix) return lprofCurFilename.ProfilePathPrefix; Length = getCurFilenameLength(); FilenameBuf = (char *)COMPILER_RT_ALLOCA(Length + 1); Filename = getCurFilename(FilenameBuf); if (!Filename) return "\0"; PrefixEnd = lprofFindLastDirSeparator(Filename); if (!PrefixEnd) return "\0"; Length = PrefixEnd - Filename + 1; Prefix = (char *)malloc(Length + 1); if (!Prefix) { PROF_ERR("Failed to %s\n", "allocate memory."); return "\0"; } memcpy(Prefix, Filename, Length); Prefix[Length] = '\0'; lprofCurFilename.ProfilePathPrefix = Prefix; return Prefix; } /* This method is invoked by the runtime initialization hook * InstrProfilingRuntime.o if it is linked in. Both user specified * profile path via -fprofile-instr-generate= and LLVM_PROFILE_FILE * environment variable can override this default value. */ COMPILER_RT_VISIBILITY void __llvm_profile_initialize_file(void) { const char *EnvFilenamePat; const char *SelectedPat = NULL; ProfileNameSpecifier PNS = PNS_unknown; int hasCommandLineOverrider = (INSTR_PROF_PROFILE_NAME_VAR[0] != 0); EnvFilenamePat = getFilenamePatFromEnv(); if (EnvFilenamePat) { SelectedPat = EnvFilenamePat; PNS = PNS_environment; } else if (hasCommandLineOverrider) { SelectedPat = INSTR_PROF_PROFILE_NAME_VAR; PNS = PNS_command_line; } else { SelectedPat = NULL; PNS = PNS_default; } parseAndSetFilename(SelectedPat, PNS, 0); } /* This API is directly called by the user application code. It has the * highest precedence compared with LLVM_PROFILE_FILE environment variable * and command line option -fprofile-instr-generate=. */ COMPILER_RT_VISIBILITY void __llvm_profile_set_filename(const char *FilenamePat) { parseAndSetFilename(FilenamePat, PNS_runtime_api, 1); } /* The public API for writing profile data into the file with name * set by previous calls to __llvm_profile_set_filename or * __llvm_profile_override_default_filename or * __llvm_profile_initialize_file. */ COMPILER_RT_VISIBILITY int __llvm_profile_write_file(void) { int rc, Length; const char *Filename; char *FilenameBuf; if (lprofProfileDumped()) { PROF_NOTE("Profile data not written to file: %s.\n", "already written"); return 0; } Length = getCurFilenameLength(); FilenameBuf = (char *)COMPILER_RT_ALLOCA(Length + 1); Filename = getCurFilename(FilenameBuf); /* Check the filename. */ if (!Filename) { PROF_ERR("Failed to write file : %s\n", "Filename not set"); return -1; } /* Check if there is llvm/runtime version mismatch. */ if (GET_VERSION(__llvm_profile_get_version()) != INSTR_PROF_RAW_VERSION) { PROF_ERR("Runtime and instrumentation version mismatch : " "expected %d, but get %d\n", INSTR_PROF_RAW_VERSION, (int)GET_VERSION(__llvm_profile_get_version())); return -1; } /* Write profile data to the file. */ rc = writeFile(Filename); if (rc) PROF_ERR("Failed to write file \"%s\": %s\n", Filename, strerror(errno)); return rc; } COMPILER_RT_VISIBILITY int __llvm_profile_dump(void) { if (!doMerging()) PROF_WARN("Later invocation of __llvm_profile_dump can lead to clobbering " " of previously dumped profile data : %s. Either use %%m " "in profile name or change profile name before dumping.\n", "online profile merging is not on"); int rc = __llvm_profile_write_file(); lprofSetProfileDumped(); return rc; } static void writeFileWithoutReturn(void) { __llvm_profile_write_file(); } COMPILER_RT_VISIBILITY int __llvm_profile_register_write_file_atexit(void) { static int HasBeenRegistered = 0; if (HasBeenRegistered) return 0; lprofSetupValueProfiler(); HasBeenRegistered = 1; return atexit(writeFileWithoutReturn); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/0000775000175000017500000000000013040224626022713 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/go/0000775000175000017500000000000013040224626023320 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/go/tsan_go.cc0000664000175000017500000001526413004741121025263 0ustar mwhudsonmwhudson//===-- tsan_go.cc --------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // ThreadSanitizer runtime for Go language. // //===----------------------------------------------------------------------===// #include "tsan_rtl.h" #include "tsan_symbolize.h" #include "sanitizer_common/sanitizer_common.h" #include namespace __tsan { void InitializeInterceptors() { } void InitializeDynamicAnnotations() { } bool IsExpectedReport(uptr addr, uptr size) { return false; } void *internal_alloc(MBlockType typ, uptr sz) { return InternalAlloc(sz); } void internal_free(void *p) { InternalFree(p); } // Callback into Go. static void (*go_runtime_cb)(uptr cmd, void *ctx); enum { CallbackGetProc = 0, CallbackSymbolizeCode = 1, CallbackSymbolizeData = 2, }; struct SymbolizeCodeContext { uptr pc; char *func; char *file; uptr line; uptr off; uptr res; }; SymbolizedStack *SymbolizeCode(uptr addr) { SymbolizedStack *s = SymbolizedStack::New(addr); SymbolizeCodeContext cbctx; internal_memset(&cbctx, 0, sizeof(cbctx)); cbctx.pc = addr; go_runtime_cb(CallbackSymbolizeCode, &cbctx); if (cbctx.res) { AddressInfo &info = s->info; info.module_offset = cbctx.off; info.function = internal_strdup(cbctx.func ? cbctx.func : "??"); info.file = internal_strdup(cbctx.file ? cbctx.file : "-"); info.line = cbctx.line; info.column = 0; } return s; } struct SymbolizeDataContext { uptr addr; uptr heap; uptr start; uptr size; char *name; char *file; uptr line; uptr res; }; ReportLocation *SymbolizeData(uptr addr) { SymbolizeDataContext cbctx; internal_memset(&cbctx, 0, sizeof(cbctx)); cbctx.addr = addr; go_runtime_cb(CallbackSymbolizeData, &cbctx); if (!cbctx.res) return 0; if (cbctx.heap) { MBlock *b = ctx->metamap.GetBlock(cbctx.start); if (!b) return 0; ReportLocation *loc = ReportLocation::New(ReportLocationHeap); loc->heap_chunk_start = cbctx.start; loc->heap_chunk_size = b->siz; loc->tid = b->tid; loc->stack = SymbolizeStackId(b->stk); return loc; } else { ReportLocation *loc = ReportLocation::New(ReportLocationGlobal); loc->global.name = internal_strdup(cbctx.name ? cbctx.name : "??"); loc->global.file = internal_strdup(cbctx.file ? cbctx.file : "??"); loc->global.line = cbctx.line; loc->global.start = cbctx.start; loc->global.size = cbctx.size; return loc; } } static ThreadState *main_thr; static bool inited; static Processor* get_cur_proc() { if (UNLIKELY(!inited)) { // Running Initialize(). // We have not yet returned the Processor to Go, so we cannot ask it back. // Currently, Initialize() does not use the Processor, so return nullptr. return nullptr; } Processor *proc; go_runtime_cb(CallbackGetProc, &proc); return proc; } Processor *ThreadState::proc() { return get_cur_proc(); } extern "C" { static ThreadState *AllocGoroutine() { ThreadState *thr = (ThreadState*)internal_alloc(MBlockThreadContex, sizeof(ThreadState)); internal_memset(thr, 0, sizeof(*thr)); return thr; } void __tsan_init(ThreadState **thrp, Processor **procp, void (*cb)(uptr cmd, void *cb)) { go_runtime_cb = cb; ThreadState *thr = AllocGoroutine(); main_thr = *thrp = thr; Initialize(thr); *procp = thr->proc1; inited = true; } void __tsan_fini() { // FIXME: Not necessary thread 0. ThreadState *thr = main_thr; int res = Finalize(thr); exit(res); } void __tsan_map_shadow(uptr addr, uptr size) { MapShadow(addr, size); } void __tsan_read(ThreadState *thr, void *addr, void *pc) { MemoryRead(thr, (uptr)pc, (uptr)addr, kSizeLog1); } void __tsan_read_pc(ThreadState *thr, void *addr, uptr callpc, uptr pc) { if (callpc != 0) FuncEntry(thr, callpc); MemoryRead(thr, (uptr)pc, (uptr)addr, kSizeLog1); if (callpc != 0) FuncExit(thr); } void __tsan_write(ThreadState *thr, void *addr, void *pc) { MemoryWrite(thr, (uptr)pc, (uptr)addr, kSizeLog1); } void __tsan_write_pc(ThreadState *thr, void *addr, uptr callpc, uptr pc) { if (callpc != 0) FuncEntry(thr, callpc); MemoryWrite(thr, (uptr)pc, (uptr)addr, kSizeLog1); if (callpc != 0) FuncExit(thr); } void __tsan_read_range(ThreadState *thr, void *addr, uptr size, uptr pc) { MemoryAccessRange(thr, (uptr)pc, (uptr)addr, size, false); } void __tsan_write_range(ThreadState *thr, void *addr, uptr size, uptr pc) { MemoryAccessRange(thr, (uptr)pc, (uptr)addr, size, true); } void __tsan_func_enter(ThreadState *thr, void *pc) { FuncEntry(thr, (uptr)pc); } void __tsan_func_exit(ThreadState *thr) { FuncExit(thr); } void __tsan_malloc(ThreadState *thr, uptr pc, uptr p, uptr sz) { CHECK(inited); if (thr && pc) ctx->metamap.AllocBlock(thr, pc, p, sz); MemoryResetRange(0, 0, (uptr)p, sz); } void __tsan_free(uptr p, uptr sz) { ctx->metamap.FreeRange(get_cur_proc(), p, sz); } void __tsan_go_start(ThreadState *parent, ThreadState **pthr, void *pc) { ThreadState *thr = AllocGoroutine(); *pthr = thr; int goid = ThreadCreate(parent, (uptr)pc, 0, true); ThreadStart(thr, goid, 0); } void __tsan_go_end(ThreadState *thr) { ThreadFinish(thr); internal_free(thr); } void __tsan_proc_create(Processor **pproc) { *pproc = ProcCreate(); } void __tsan_proc_destroy(Processor *proc) { ProcDestroy(proc); } void __tsan_acquire(ThreadState *thr, void *addr) { Acquire(thr, 0, (uptr)addr); } void __tsan_release(ThreadState *thr, void *addr) { ReleaseStore(thr, 0, (uptr)addr); } void __tsan_release_merge(ThreadState *thr, void *addr) { Release(thr, 0, (uptr)addr); } void __tsan_finalizer_goroutine(ThreadState *thr) { AcquireGlobal(thr, 0); } void __tsan_mutex_before_lock(ThreadState *thr, uptr addr, uptr write) { } void __tsan_mutex_after_lock(ThreadState *thr, uptr addr, uptr write) { if (write) MutexLock(thr, 0, addr); else MutexReadLock(thr, 0, addr); } void __tsan_mutex_before_unlock(ThreadState *thr, uptr addr, uptr write) { if (write) MutexUnlock(thr, 0, addr); else MutexReadUnlock(thr, 0, addr); } void __tsan_go_ignore_sync_begin(ThreadState *thr) { ThreadIgnoreSyncBegin(thr, 0); } void __tsan_go_ignore_sync_end(ThreadState *thr) { ThreadIgnoreSyncEnd(thr, 0); } void __tsan_report_count(u64 *pn) { Lock lock(&ctx->report_mtx); *pn = ctx->nreported; } } // extern "C" } // namespace __tsan namespace __sanitizer { void SymbolizerPrepareForSandboxing() { // Nothing to do here for Go. } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/go/buildgo.sh0000775000175000017500000001004213004730632025300 0ustar mwhudsonmwhudson#!/bin/sh set -e SRCS=" tsan_go.cc ../rtl/tsan_clock.cc ../rtl/tsan_flags.cc ../rtl/tsan_interface_atomic.cc ../rtl/tsan_md5.cc ../rtl/tsan_mutex.cc ../rtl/tsan_report.cc ../rtl/tsan_rtl.cc ../rtl/tsan_rtl_mutex.cc ../rtl/tsan_rtl_report.cc ../rtl/tsan_rtl_thread.cc ../rtl/tsan_rtl_proc.cc ../rtl/tsan_stack_trace.cc ../rtl/tsan_stat.cc ../rtl/tsan_suppressions.cc ../rtl/tsan_sync.cc ../../sanitizer_common/sanitizer_allocator.cc ../../sanitizer_common/sanitizer_common.cc ../../sanitizer_common/sanitizer_common_libcdep.cc ../../sanitizer_common/sanitizer_deadlock_detector2.cc ../../sanitizer_common/sanitizer_flag_parser.cc ../../sanitizer_common/sanitizer_flags.cc ../../sanitizer_common/sanitizer_libc.cc ../../sanitizer_common/sanitizer_persistent_allocator.cc ../../sanitizer_common/sanitizer_printf.cc ../../sanitizer_common/sanitizer_suppressions.cc ../../sanitizer_common/sanitizer_thread_registry.cc ../../sanitizer_common/sanitizer_stackdepot.cc ../../sanitizer_common/sanitizer_stacktrace.cc ../../sanitizer_common/sanitizer_symbolizer.cc ../../sanitizer_common/sanitizer_termination.cc " if [ "`uname -a | grep Linux`" != "" ]; then SUFFIX="linux_amd64" OSCFLAGS="-fPIC -ffreestanding -Wno-maybe-uninitialized -Wno-unused-const-variable -Werror -Wno-unknown-warning-option" OSLDFLAGS="-lpthread -fPIC -fpie" SRCS=" $SRCS ../rtl/tsan_platform_linux.cc ../../sanitizer_common/sanitizer_posix.cc ../../sanitizer_common/sanitizer_posix_libcdep.cc ../../sanitizer_common/sanitizer_procmaps_common.cc ../../sanitizer_common/sanitizer_procmaps_linux.cc ../../sanitizer_common/sanitizer_linux.cc ../../sanitizer_common/sanitizer_linux_libcdep.cc ../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc " elif [ "`uname -a | grep FreeBSD`" != "" ]; then SUFFIX="freebsd_amd64" OSCFLAGS="-fno-strict-aliasing -fPIC -Werror" OSLDFLAGS="-lpthread -fPIC -fpie" SRCS=" $SRCS ../rtl/tsan_platform_linux.cc ../../sanitizer_common/sanitizer_posix.cc ../../sanitizer_common/sanitizer_posix_libcdep.cc ../../sanitizer_common/sanitizer_procmaps_common.cc ../../sanitizer_common/sanitizer_procmaps_freebsd.cc ../../sanitizer_common/sanitizer_linux.cc ../../sanitizer_common/sanitizer_linux_libcdep.cc ../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc " elif [ "`uname -a | grep Darwin`" != "" ]; then SUFFIX="darwin_amd64" OSCFLAGS="-fPIC -Wno-unused-const-variable -Wno-unknown-warning-option -mmacosx-version-min=10.7" OSLDFLAGS="-lpthread -fPIC -fpie -mmacosx-version-min=10.7" SRCS=" $SRCS ../rtl/tsan_platform_mac.cc ../../sanitizer_common/sanitizer_mac.cc ../../sanitizer_common/sanitizer_posix.cc ../../sanitizer_common/sanitizer_posix_libcdep.cc ../../sanitizer_common/sanitizer_procmaps_mac.cc " elif [ "`uname -a | grep MINGW`" != "" ]; then SUFFIX="windows_amd64" OSCFLAGS="-Wno-error=attributes -Wno-attributes -Wno-unused-const-variable -Wno-unknown-warning-option" OSLDFLAGS="" SRCS=" $SRCS ../rtl/tsan_platform_windows.cc ../../sanitizer_common/sanitizer_win.cc " else echo Unknown platform exit 1 fi CC=${CC:-gcc} IN_TMPDIR=${IN_TMPDIR:-0} SILENT=${SILENT:-0} if [ $IN_TMPDIR != "0" ]; then DIR=$(mktemp -qd /tmp/gotsan.XXXXXXXXXX) cleanup() { rm -rf $DIR } trap cleanup EXIT else DIR=. fi SRCS="$SRCS $ADD_SRCS" rm -f $DIR/gotsan.cc for F in $SRCS; do cat $F >> $DIR/gotsan.cc done FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++11 -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 $OSCFLAGS" if [ "$DEBUG" = "" ]; then FLAGS="$FLAGS -DSANITIZER_DEBUG=0 -O3 -msse3 -fomit-frame-pointer" else FLAGS="$FLAGS -DSANITIZER_DEBUG=1 -g" fi if [ "$SILENT" != "1" ]; then echo $CC gotsan.cc -c -o $DIR/race_$SUFFIX.syso $FLAGS $CFLAGS fi $CC $DIR/gotsan.cc -c -o $DIR/race_$SUFFIX.syso $FLAGS $CFLAGS $CC $OSCFLAGS test.c $DIR/race_$SUFFIX.syso -m64 -g -o $DIR/test $OSLDFLAGS export GORACE="exitcode=0 atexit_sleep_ms=0" if [ "$SILENT" != "1" ]; then $DIR/test else $DIR/test 2>/dev/null fi golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/go/build.bat0000664000175000017500000000260013004730632025104 0ustar mwhudsonmwhudsontype tsan_go.cc ..\rtl\tsan_interface_atomic.cc ..\rtl\tsan_clock.cc ..\rtl\tsan_flags.cc ..\rtl\tsan_md5.cc ..\rtl\tsan_mutex.cc ..\rtl\tsan_report.cc ..\rtl\tsan_rtl.cc ..\rtl\tsan_rtl_mutex.cc ..\rtl\tsan_rtl_report.cc ..\rtl\tsan_rtl_thread.cc ..\rtl\tsan_rtl_proc.cc ..\rtl\tsan_stat.cc ..\rtl\tsan_suppressions.cc ..\rtl\tsan_sync.cc ..\rtl\tsan_stack_trace.cc ..\..\sanitizer_common\sanitizer_allocator.cc ..\..\sanitizer_common\sanitizer_common.cc ..\..\sanitizer_common\sanitizer_flags.cc ..\..\sanitizer_common\sanitizer_stacktrace.cc ..\..\sanitizer_common\sanitizer_libc.cc ..\..\sanitizer_common\sanitizer_printf.cc ..\..\sanitizer_common\sanitizer_suppressions.cc ..\..\sanitizer_common\sanitizer_thread_registry.cc ..\rtl\tsan_platform_windows.cc ..\..\sanitizer_common\sanitizer_win.cc ..\..\sanitizer_common\sanitizer_deadlock_detector1.cc ..\..\sanitizer_common\sanitizer_stackdepot.cc ..\..\sanitizer_common\sanitizer_persistent_allocator.cc ..\..\sanitizer_common\sanitizer_flag_parser.cc ..\..\sanitizer_common\sanitizer_symbolizer.cc ..\..\sanitizer_common\sanitizer_termination.cc > gotsan.cc gcc -c -o race_windows_amd64.syso gotsan.cc -I..\rtl -I..\.. -I..\..\sanitizer_common -I..\..\..\include -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -Wno-error=attributes -Wno-attributes -Wno-format -Wno-maybe-uninitialized -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer -std=c++11 golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/go/test.c0000664000175000017500000000531712710133667024460 0ustar mwhudsonmwhudson//===-- test.c ------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Sanity test for Go runtime. // //===----------------------------------------------------------------------===// #include #include void __tsan_init(void **thr, void **proc, void (*cb)(long, void*)); void __tsan_fini(); void __tsan_map_shadow(void *addr, unsigned long size); void __tsan_go_start(void *thr, void **chthr, void *pc); void __tsan_go_end(void *thr); void __tsan_proc_create(void **pproc); void __tsan_proc_destroy(void *proc); void __tsan_proc_wire(void *proc, void *thr); void __tsan_proc_unwire(void *proc, void *thr); void __tsan_read(void *thr, void *addr, void *pc); void __tsan_write(void *thr, void *addr, void *pc); void __tsan_func_enter(void *thr, void *pc); void __tsan_func_exit(void *thr); void __tsan_malloc(void *thr, void *pc, void *p, unsigned long sz); void __tsan_free(void *p, unsigned long sz); void __tsan_acquire(void *thr, void *addr); void __tsan_release(void *thr, void *addr); void __tsan_release_merge(void *thr, void *addr); void *current_proc; void symbolize_cb(long cmd, void *ctx) { switch (cmd) { case 0: if (current_proc == 0) abort(); *(void**)ctx = current_proc; } } char buf0[100<<10]; void foobar() {} void barfoo() {} int main(void) { void *thr0 = 0; void *proc0 = 0; __tsan_init(&thr0, &proc0, symbolize_cb); current_proc = proc0; char *buf = (char*)((unsigned long)buf0 + (64<<10) - 1 & ~((64<<10) - 1)); __tsan_map_shadow(buf, 4096); __tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10); __tsan_free(buf, 10); __tsan_func_enter(thr0, (char*)&main + 1); __tsan_malloc(thr0, (char*)&barfoo + 1, buf, 10); __tsan_release(thr0, buf); __tsan_release_merge(thr0, buf); void *thr1 = 0; __tsan_go_start(thr0, &thr1, (char*)&barfoo + 1); void *thr2 = 0; __tsan_go_start(thr0, &thr2, (char*)&barfoo + 1); __tsan_func_exit(thr0); __tsan_func_enter(thr1, (char*)&foobar + 1); __tsan_func_enter(thr1, (char*)&foobar + 1); __tsan_write(thr1, buf, (char*)&barfoo + 1); __tsan_acquire(thr1, buf); __tsan_func_exit(thr1); __tsan_func_exit(thr1); __tsan_go_end(thr1); void *proc1 = 0; __tsan_proc_create(&proc1); current_proc = proc1; __tsan_func_enter(thr2, (char*)&foobar + 1); __tsan_read(thr2, buf, (char*)&barfoo + 1); __tsan_free(buf, 10); __tsan_func_exit(thr2); __tsan_go_end(thr2); __tsan_proc_destroy(proc1); current_proc = proc0; __tsan_fini(); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/0000775000175000017500000000000013040224626024055 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/CMakeLists.txt0000664000175000017500000000657513004235372026632 0ustar mwhudsonmwhudsoninclude_directories(../rtl) add_custom_target(TsanUnitTests) set_target_properties(TsanUnitTests PROPERTIES FOLDER "TSan unittests") set(TSAN_UNITTEST_CFLAGS ${TSAN_CFLAGS} ${COMPILER_RT_UNITTEST_CFLAGS} ${COMPILER_RT_GTEST_CFLAGS} -I${COMPILER_RT_SOURCE_DIR}/lib -I${COMPILER_RT_SOURCE_DIR}/lib/tsan/rtl -DGTEST_HAS_RTTI=0) if(APPLE) list(APPEND TSAN_UNITTEST_CFLAGS ${DARWIN_osx_CFLAGS}) endif() set(TSAN_RTL_HEADERS) foreach (header ${TSAN_HEADERS}) list(APPEND TSAN_RTL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../${header}) endforeach() # tsan_compile(obj_list, source, arch, {headers}) macro(tsan_compile obj_list source arch) get_filename_component(basename ${source} NAME) set(output_obj "${basename}.${arch}.o") get_target_flags_for_arch(${arch} TARGET_CFLAGS) set(COMPILE_DEPS ${TSAN_RTL_HEADERS} ${ARGN}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND COMPILE_DEPS gtest tsan) endif() clang_compile(${output_obj} ${source} CFLAGS ${TSAN_UNITTEST_CFLAGS} ${TARGET_CFLAGS} DEPS ${COMPILE_DEPS}) list(APPEND ${obj_list} ${output_obj}) endmacro() macro(add_tsan_unittest testname) set(TSAN_TEST_ARCH ${TSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(TSAN_SUPPORTED_ARCH TSAN_TEST_ARCH) endif() if(UNIX) foreach(arch ${TSAN_TEST_ARCH}) cmake_parse_arguments(TEST "" "" "SOURCES;HEADERS" ${ARGN}) set(TEST_OBJECTS) foreach(SOURCE ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}) tsan_compile(TEST_OBJECTS ${SOURCE} ${arch} ${TEST_HEADERS}) endforeach() get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) set(TEST_DEPS ${TEST_OBJECTS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TEST_DEPS tsan) endif() if(NOT APPLE) # FIXME: Looks like we should link TSan with just-built runtime, # and not rely on -fsanitize=thread, as these tests are essentially # unit tests. add_compiler_rt_test(TsanUnitTests ${testname} OBJECTS ${TEST_OBJECTS} DEPS ${TEST_DEPS} LINK_FLAGS ${TARGET_LINK_FLAGS} -fsanitize=thread -lstdc++ -lm) else() set(TSAN_TEST_RUNTIME_OBJECTS $ $ $ $ $) set(TSAN_TEST_RUNTIME RTTsanTest.${testname}.${arch}) add_library(${TSAN_TEST_RUNTIME} STATIC ${TSAN_TEST_RUNTIME_OBJECTS}) set_target_properties(${TSAN_TEST_RUNTIME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) list(APPEND TEST_OBJECTS lib${TSAN_TEST_RUNTIME}.a) list(APPEND TEST_DEPS ${TSAN_TEST_RUNTIME}) # Intentionally do *not* link with `-fsanitize=thread`. We already link # against a static version of the runtime, and we don't want the dynamic # one. add_compiler_rt_test(TsanUnitTests "${testname}-${arch}-Test" OBJECTS ${TEST_OBJECTS} DEPS ${TEST_DEPS} LINK_FLAGS ${TARGET_LINK_FLAGS} ${DARWIN_osx_LINKFLAGS} -lc++) endif() endforeach() endif() endmacro() if(COMPILER_RT_CAN_EXECUTE_TESTS) add_subdirectory(rtl) add_subdirectory(unit) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/0000775000175000017500000000000013040224626025034 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_mutexset_test.cc0000664000175000017500000000622212122337171031307 0ustar mwhudsonmwhudson//===-- tsan_mutexset_test.cc ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_mutexset.h" #include "gtest/gtest.h" namespace __tsan { static void Expect(const MutexSet &mset, uptr i, u64 id, bool write, u64 epoch, int count) { MutexSet::Desc d = mset.Get(i); EXPECT_EQ(id, d.id); EXPECT_EQ(write, d.write); EXPECT_EQ(epoch, d.epoch); EXPECT_EQ(count, d.count); } TEST(MutexSet, Basic) { MutexSet mset; EXPECT_EQ(mset.Size(), (uptr)0); mset.Add(1, true, 2); EXPECT_EQ(mset.Size(), (uptr)1); Expect(mset, 0, 1, true, 2, 1); mset.Del(1, true); EXPECT_EQ(mset.Size(), (uptr)0); mset.Add(3, true, 4); mset.Add(5, false, 6); EXPECT_EQ(mset.Size(), (uptr)2); Expect(mset, 0, 3, true, 4, 1); Expect(mset, 1, 5, false, 6, 1); mset.Del(3, true); EXPECT_EQ(mset.Size(), (uptr)1); mset.Del(5, false); EXPECT_EQ(mset.Size(), (uptr)0); } TEST(MutexSet, DoubleAdd) { MutexSet mset; mset.Add(1, true, 2); EXPECT_EQ(mset.Size(), (uptr)1); Expect(mset, 0, 1, true, 2, 1); mset.Add(1, true, 2); EXPECT_EQ(mset.Size(), (uptr)1); Expect(mset, 0, 1, true, 2, 2); mset.Del(1, true); EXPECT_EQ(mset.Size(), (uptr)1); Expect(mset, 0, 1, true, 2, 1); mset.Del(1, true); EXPECT_EQ(mset.Size(), (uptr)0); } TEST(MutexSet, DoubleDel) { MutexSet mset; mset.Add(1, true, 2); EXPECT_EQ(mset.Size(), (uptr)1); mset.Del(1, true); EXPECT_EQ(mset.Size(), (uptr)0); mset.Del(1, true); EXPECT_EQ(mset.Size(), (uptr)0); } TEST(MutexSet, Remove) { MutexSet mset; mset.Add(1, true, 2); mset.Add(1, true, 2); mset.Add(3, true, 4); mset.Add(3, true, 4); EXPECT_EQ(mset.Size(), (uptr)2); mset.Remove(1); EXPECT_EQ(mset.Size(), (uptr)1); Expect(mset, 0, 3, true, 4, 2); } TEST(MutexSet, Full) { MutexSet mset; for (uptr i = 0; i < MutexSet::kMaxSize; i++) { mset.Add(i, true, i + 1); } EXPECT_EQ(mset.Size(), MutexSet::kMaxSize); for (uptr i = 0; i < MutexSet::kMaxSize; i++) { Expect(mset, i, i, true, i + 1, 1); } for (uptr i = 0; i < MutexSet::kMaxSize; i++) { mset.Add(i, true, i + 1); } EXPECT_EQ(mset.Size(), MutexSet::kMaxSize); for (uptr i = 0; i < MutexSet::kMaxSize; i++) { Expect(mset, i, i, true, i + 1, 2); } } TEST(MutexSet, Overflow) { MutexSet mset; for (uptr i = 0; i < MutexSet::kMaxSize; i++) { mset.Add(i, true, i + 1); mset.Add(i, true, i + 1); } mset.Add(100, true, 200); EXPECT_EQ(mset.Size(), MutexSet::kMaxSize); for (uptr i = 0; i < MutexSet::kMaxSize; i++) { if (i == 0) Expect(mset, i, MutexSet::kMaxSize - 1, true, MutexSet::kMaxSize, 2); else if (i == MutexSet::kMaxSize - 1) Expect(mset, i, 100, true, 200, 1); else Expect(mset, i, i, true, i + 1, 2); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_stack_test.cc0000664000175000017500000000511712426000160030530 0ustar mwhudsonmwhudson//===-- tsan_stack_test.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_sync.h" #include "tsan_rtl.h" #include "gtest/gtest.h" #include namespace __tsan { template static void TestStackTrace(StackTraceTy *trace) { ThreadState thr(0, 0, 0, 0, 0, 0, 0, 0, 0); uptr stack[128]; thr.shadow_stack = &stack[0]; thr.shadow_stack_pos = &stack[0]; thr.shadow_stack_end = &stack[128]; ObtainCurrentStack(&thr, 0, trace); EXPECT_EQ(0U, trace->size); ObtainCurrentStack(&thr, 42, trace); EXPECT_EQ(1U, trace->size); EXPECT_EQ(42U, trace->trace[0]); *thr.shadow_stack_pos++ = 100; *thr.shadow_stack_pos++ = 101; ObtainCurrentStack(&thr, 0, trace); EXPECT_EQ(2U, trace->size); EXPECT_EQ(100U, trace->trace[0]); EXPECT_EQ(101U, trace->trace[1]); ObtainCurrentStack(&thr, 42, trace); EXPECT_EQ(3U, trace->size); EXPECT_EQ(100U, trace->trace[0]); EXPECT_EQ(101U, trace->trace[1]); EXPECT_EQ(42U, trace->trace[2]); } template static void TestTrim(StackTraceTy *trace) { ThreadState thr(0, 0, 0, 0, 0, 0, 0, 0, 0); const uptr kShadowStackSize = 2 * kStackTraceMax; uptr stack[kShadowStackSize]; thr.shadow_stack = &stack[0]; thr.shadow_stack_pos = &stack[0]; thr.shadow_stack_end = &stack[kShadowStackSize]; for (uptr i = 0; i < kShadowStackSize; ++i) *thr.shadow_stack_pos++ = 100 + i; ObtainCurrentStack(&thr, 0, trace); EXPECT_EQ(kStackTraceMax, trace->size); for (uptr i = 0; i < kStackTraceMax; i++) { EXPECT_EQ(100 + kStackTraceMax + i, trace->trace[i]); } ObtainCurrentStack(&thr, 42, trace); EXPECT_EQ(kStackTraceMax, trace->size); for (uptr i = 0; i < kStackTraceMax - 1; i++) { EXPECT_EQ(101 + kStackTraceMax + i, trace->trace[i]); } EXPECT_EQ(42U, trace->trace[kStackTraceMax - 1]); } TEST(StackTrace, BasicVarSize) { VarSizeStackTrace trace; TestStackTrace(&trace); } TEST(StackTrace, BasicBuffered) { BufferedStackTrace trace; TestStackTrace(&trace); } TEST(StackTrace, TrimVarSize) { VarSizeStackTrace trace; TestTrim(&trace); } TEST(StackTrace, TrimBuffered) { BufferedStackTrace trace; TestTrim(&trace); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_mutex_test.cc0000664000175000017500000000612412451670030030573 0ustar mwhudsonmwhudson//===-- tsan_mutex_test.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_mutex.h" #include "tsan_mutex.h" #include "gtest/gtest.h" namespace __tsan { template class TestData { public: explicit TestData(MutexType *mtx) : mtx_(mtx) { for (int i = 0; i < kSize; i++) data_[i] = 0; } void Write() { Lock l(mtx_); T v0 = data_[0]; for (int i = 0; i < kSize; i++) { CHECK_EQ(data_[i], v0); data_[i]++; } } void Read() { ReadLock l(mtx_); T v0 = data_[0]; for (int i = 0; i < kSize; i++) { CHECK_EQ(data_[i], v0); } } void Backoff() { volatile T data[kSize] = {}; for (int i = 0; i < kSize; i++) { data[i]++; CHECK_EQ(data[i], 1); } } private: typedef GenericScopedLock Lock; static const int kSize = 64; typedef u64 T; MutexType *mtx_; char pad_[kCacheLineSize]; T data_[kSize]; }; const int kThreads = 8; const int kWriteRate = 1024; #if SANITIZER_DEBUG const int kIters = 16*1024; #else const int kIters = 64*1024; #endif template static void *write_mutex_thread(void *param) { TestData *data = (TestData*)param; for (int i = 0; i < kIters; i++) { data->Write(); data->Backoff(); } return 0; } template static void *read_mutex_thread(void *param) { TestData *data = (TestData*)param; for (int i = 0; i < kIters; i++) { if ((i % kWriteRate) == 0) data->Write(); else data->Read(); data->Backoff(); } return 0; } TEST(Mutex, Write) { Mutex mtx(MutexTypeAnnotations, StatMtxAnnotations); TestData data(&mtx); pthread_t threads[kThreads]; for (int i = 0; i < kThreads; i++) pthread_create(&threads[i], 0, write_mutex_thread, &data); for (int i = 0; i < kThreads; i++) pthread_join(threads[i], 0); } TEST(Mutex, ReadWrite) { Mutex mtx(MutexTypeAnnotations, StatMtxAnnotations); TestData data(&mtx); pthread_t threads[kThreads]; for (int i = 0; i < kThreads; i++) pthread_create(&threads[i], 0, read_mutex_thread, &data); for (int i = 0; i < kThreads; i++) pthread_join(threads[i], 0); } TEST(Mutex, SpinWrite) { SpinMutex mtx; TestData data(&mtx); pthread_t threads[kThreads]; for (int i = 0; i < kThreads; i++) pthread_create(&threads[i], 0, write_mutex_thread, &data); for (int i = 0; i < kThreads; i++) pthread_join(threads[i], 0); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/CMakeLists.txt0000664000175000017500000000044212214037121027566 0ustar mwhudsonmwhudsonset(TSAN_UNIT_TEST_SOURCES tsan_clock_test.cc tsan_flags_test.cc tsan_mman_test.cc tsan_mutex_test.cc tsan_shadow_test.cc tsan_stack_test.cc tsan_sync_test.cc tsan_unit_test_main.cc tsan_vector_test.cc) add_tsan_unittest(TsanUnitTest SOURCES ${TSAN_UNIT_TEST_SOURCES}) golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_dense_alloc_test.cc0000664000175000017500000000250112425777403031711 0ustar mwhudsonmwhudson//===-- tsan_dense_alloc_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_dense_alloc.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "gtest/gtest.h" #include #include #include namespace __tsan { TEST(DenseSlabAlloc, Basic) { typedef DenseSlabAlloc Alloc; typedef Alloc::Cache Cache; typedef Alloc::IndexT IndexT; const int N = 1000; Alloc alloc; Cache cache; alloc.InitCache(&cache); IndexT blocks[N]; for (int ntry = 0; ntry < 3; ntry++) { for (int i = 0; i < N; i++) { IndexT idx = alloc.Alloc(&cache); blocks[i] = idx; EXPECT_NE(idx, 0U); int *v = alloc.Map(idx); *v = i; } for (int i = 0; i < N; i++) { IndexT idx = blocks[i]; int *v = alloc.Map(idx); EXPECT_EQ(*v, i); alloc.Free(&cache, idx); } alloc.FlushCache(&cache); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_sync_test.cc0000664000175000017500000001050612734205263030412 0ustar mwhudsonmwhudson//===-- tsan_sync_test.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_sync.h" #include "tsan_rtl.h" #include "gtest/gtest.h" namespace __tsan { TEST(MetaMap, Basic) { ThreadState *thr = cur_thread(); MetaMap *m = &ctx->metamap; u64 block[1] = {}; // fake malloc block m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); MBlock *mb = m->GetBlock((uptr)&block[0]); EXPECT_NE(mb, (MBlock*)0); EXPECT_EQ(mb->siz, 1 * sizeof(u64)); EXPECT_EQ(mb->tid, thr->tid); uptr sz = m->FreeBlock(thr->proc(), (uptr)&block[0]); EXPECT_EQ(sz, 1 * sizeof(u64)); mb = m->GetBlock((uptr)&block[0]); EXPECT_EQ(mb, (MBlock*)0); } TEST(MetaMap, FreeRange) { ThreadState *thr = cur_thread(); MetaMap *m = &ctx->metamap; u64 block[4] = {}; // fake malloc block m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); m->AllocBlock(thr, 0, (uptr)&block[1], 3 * sizeof(u64)); MBlock *mb1 = m->GetBlock((uptr)&block[0]); EXPECT_EQ(mb1->siz, 1 * sizeof(u64)); MBlock *mb2 = m->GetBlock((uptr)&block[1]); EXPECT_EQ(mb2->siz, 3 * sizeof(u64)); m->FreeRange(thr->proc(), (uptr)&block[0], 4 * sizeof(u64)); mb1 = m->GetBlock((uptr)&block[0]); EXPECT_EQ(mb1, (MBlock*)0); mb2 = m->GetBlock((uptr)&block[1]); EXPECT_EQ(mb2, (MBlock*)0); } TEST(MetaMap, Sync) { ThreadState *thr = cur_thread(); MetaMap *m = &ctx->metamap; u64 block[4] = {}; // fake malloc block m->AllocBlock(thr, 0, (uptr)&block[0], 4 * sizeof(u64)); SyncVar *s1 = m->GetIfExistsAndLock((uptr)&block[0], true); EXPECT_EQ(s1, (SyncVar*)0); s1 = m->GetOrCreateAndLock(thr, 0, (uptr)&block[0], true); EXPECT_NE(s1, (SyncVar*)0); EXPECT_EQ(s1->addr, (uptr)&block[0]); s1->mtx.Unlock(); SyncVar *s2 = m->GetOrCreateAndLock(thr, 0, (uptr)&block[1], false); EXPECT_NE(s2, (SyncVar*)0); EXPECT_EQ(s2->addr, (uptr)&block[1]); s2->mtx.ReadUnlock(); m->FreeBlock(thr->proc(), (uptr)&block[0]); s1 = m->GetIfExistsAndLock((uptr)&block[0], true); EXPECT_EQ(s1, (SyncVar*)0); s2 = m->GetIfExistsAndLock((uptr)&block[1], true); EXPECT_EQ(s2, (SyncVar*)0); m->OnProcIdle(thr->proc()); } TEST(MetaMap, MoveMemory) { ThreadState *thr = cur_thread(); MetaMap *m = &ctx->metamap; u64 block1[4] = {}; // fake malloc block u64 block2[4] = {}; // fake malloc block m->AllocBlock(thr, 0, (uptr)&block1[0], 3 * sizeof(u64)); m->AllocBlock(thr, 0, (uptr)&block1[3], 1 * sizeof(u64)); SyncVar *s1 = m->GetOrCreateAndLock(thr, 0, (uptr)&block1[0], true); s1->mtx.Unlock(); SyncVar *s2 = m->GetOrCreateAndLock(thr, 0, (uptr)&block1[1], true); s2->mtx.Unlock(); m->MoveMemory((uptr)&block1[0], (uptr)&block2[0], 4 * sizeof(u64)); MBlock *mb1 = m->GetBlock((uptr)&block1[0]); EXPECT_EQ(mb1, (MBlock*)0); MBlock *mb2 = m->GetBlock((uptr)&block1[3]); EXPECT_EQ(mb2, (MBlock*)0); mb1 = m->GetBlock((uptr)&block2[0]); EXPECT_NE(mb1, (MBlock*)0); EXPECT_EQ(mb1->siz, 3 * sizeof(u64)); mb2 = m->GetBlock((uptr)&block2[3]); EXPECT_NE(mb2, (MBlock*)0); EXPECT_EQ(mb2->siz, 1 * sizeof(u64)); s1 = m->GetIfExistsAndLock((uptr)&block1[0], true); EXPECT_EQ(s1, (SyncVar*)0); s2 = m->GetIfExistsAndLock((uptr)&block1[1], true); EXPECT_EQ(s2, (SyncVar*)0); s1 = m->GetIfExistsAndLock((uptr)&block2[0], true); EXPECT_NE(s1, (SyncVar*)0); EXPECT_EQ(s1->addr, (uptr)&block2[0]); s1->mtx.Unlock(); s2 = m->GetIfExistsAndLock((uptr)&block2[1], true); EXPECT_NE(s2, (SyncVar*)0); EXPECT_EQ(s2->addr, (uptr)&block2[1]); s2->mtx.Unlock(); m->FreeRange(thr->proc(), (uptr)&block2[0], 4 * sizeof(u64)); } TEST(MetaMap, ResetSync) { ThreadState *thr = cur_thread(); MetaMap *m = &ctx->metamap; u64 block[1] = {}; // fake malloc block m->AllocBlock(thr, 0, (uptr)&block[0], 1 * sizeof(u64)); SyncVar *s = m->GetOrCreateAndLock(thr, 0, (uptr)&block[0], true); s->Reset(thr->proc()); s->mtx.Unlock(); uptr sz = m->FreeBlock(thr->proc(), (uptr)&block[0]); EXPECT_EQ(sz, 1 * sizeof(u64)); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_shadow_test.cc0000664000175000017500000000432612102711317030715 0ustar mwhudsonmwhudson//===-- tsan_shadow_test.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_platform.h" #include "tsan_rtl.h" #include "gtest/gtest.h" namespace __tsan { TEST(Shadow, FastState) { Shadow s(FastState(11, 22)); EXPECT_EQ(s.tid(), (u64)11); EXPECT_EQ(s.epoch(), (u64)22); EXPECT_EQ(s.GetIgnoreBit(), false); EXPECT_EQ(s.GetFreedAndReset(), false); EXPECT_EQ(s.GetHistorySize(), 0); EXPECT_EQ(s.addr0(), (u64)0); EXPECT_EQ(s.size(), (u64)1); EXPECT_EQ(s.IsWrite(), true); s.IncrementEpoch(); EXPECT_EQ(s.epoch(), (u64)23); s.IncrementEpoch(); EXPECT_EQ(s.epoch(), (u64)24); s.SetIgnoreBit(); EXPECT_EQ(s.GetIgnoreBit(), true); s.ClearIgnoreBit(); EXPECT_EQ(s.GetIgnoreBit(), false); for (int i = 0; i < 8; i++) { s.SetHistorySize(i); EXPECT_EQ(s.GetHistorySize(), i); } s.SetHistorySize(2); s.ClearHistorySize(); EXPECT_EQ(s.GetHistorySize(), 0); } TEST(Shadow, Mapping) { static int global; int stack; void *heap = malloc(0); free(heap); CHECK(IsAppMem((uptr)&global)); CHECK(IsAppMem((uptr)&stack)); CHECK(IsAppMem((uptr)heap)); CHECK(IsShadowMem(MemToShadow((uptr)&global))); CHECK(IsShadowMem(MemToShadow((uptr)&stack))); CHECK(IsShadowMem(MemToShadow((uptr)heap))); } TEST(Shadow, Celling) { u64 aligned_data[4]; char *data = (char*)aligned_data; CHECK_EQ((uptr)data % kShadowSize, 0); uptr s0 = MemToShadow((uptr)&data[0]); CHECK_EQ(s0 % kShadowSize, 0); for (unsigned i = 1; i < kShadowCell; i++) CHECK_EQ(s0, MemToShadow((uptr)&data[i])); for (unsigned i = kShadowCell; i < 2*kShadowCell; i++) CHECK_EQ(s0 + kShadowSize*kShadowCnt, MemToShadow((uptr)&data[i])); for (unsigned i = 2*kShadowCell; i < 3*kShadowCell; i++) CHECK_EQ(s0 + 2*kShadowSize*kShadowCnt, MemToShadow((uptr)&data[i])); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_vector_test.cc0000664000175000017500000000213412256302134030730 0ustar mwhudsonmwhudson//===-- tsan_vector_test.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_vector.h" #include "tsan_rtl.h" #include "gtest/gtest.h" namespace __tsan { TEST(Vector, Basic) { Vector v(MBlockScopedBuf); EXPECT_EQ(v.Size(), (uptr)0); v.PushBack(42); EXPECT_EQ(v.Size(), (uptr)1); EXPECT_EQ(v[0], 42); v.PushBack(43); EXPECT_EQ(v.Size(), (uptr)2); EXPECT_EQ(v[0], 42); EXPECT_EQ(v[1], 43); } TEST(Vector, Stride) { Vector v(MBlockScopedBuf); for (int i = 0; i < 1000; i++) { v.PushBack(i); EXPECT_EQ(v.Size(), (uptr)(i + 1)); EXPECT_EQ(v[i], i); } for (int i = 0; i < 1000; i++) { EXPECT_EQ(v[i], i); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_unit_test_main.cc0000664000175000017500000000135312672466305031430 0ustar mwhudsonmwhudson//===-- tsan_unit_test_main.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "gtest/gtest.h" namespace __sanitizer { bool ReexecDisabled() { return true; } } int main(int argc, char **argv) { testing::GTEST_FLAG(death_test_style) = "threadsafe"; testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_mman_test.cc0000664000175000017500000001106012750130377030363 0ustar mwhudsonmwhudson//===-- tsan_mman_test.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include #include #include "tsan_mman.h" #include "tsan_rtl.h" #include "gtest/gtest.h" namespace __tsan { TEST(Mman, Internal) { char *p = (char*)internal_alloc(MBlockScopedBuf, 10); EXPECT_NE(p, (char*)0); char *p2 = (char*)internal_alloc(MBlockScopedBuf, 20); EXPECT_NE(p2, (char*)0); EXPECT_NE(p2, p); for (int i = 0; i < 10; i++) { p[i] = 42; } for (int i = 0; i < 20; i++) { ((char*)p2)[i] = 42; } internal_free(p); internal_free(p2); } TEST(Mman, User) { ThreadState *thr = cur_thread(); uptr pc = 0; char *p = (char*)user_alloc(thr, pc, 10); EXPECT_NE(p, (char*)0); char *p2 = (char*)user_alloc(thr, pc, 20); EXPECT_NE(p2, (char*)0); EXPECT_NE(p2, p); EXPECT_EQ(10U, user_alloc_usable_size(p)); EXPECT_EQ(20U, user_alloc_usable_size(p2)); user_free(thr, pc, p); user_free(thr, pc, p2); } TEST(Mman, UserRealloc) { ThreadState *thr = cur_thread(); uptr pc = 0; { void *p = user_realloc(thr, pc, 0, 0); // Realloc(NULL, N) is equivalent to malloc(N), thus must return // non-NULL pointer. EXPECT_NE(p, (void*)0); } { void *p = user_realloc(thr, pc, 0, 100); EXPECT_NE(p, (void*)0); memset(p, 0xde, 100); user_free(thr, pc, p); } { void *p = user_alloc(thr, pc, 100); EXPECT_NE(p, (void*)0); memset(p, 0xde, 100); void *p2 = user_realloc(thr, pc, p, 0); EXPECT_NE(p2, (void*)0); } { void *p = user_realloc(thr, pc, 0, 100); EXPECT_NE(p, (void*)0); memset(p, 0xde, 100); void *p2 = user_realloc(thr, pc, p, 10000); EXPECT_NE(p2, (void*)0); for (int i = 0; i < 100; i++) EXPECT_EQ(((char*)p2)[i], (char)0xde); memset(p2, 0xde, 10000); user_free(thr, pc, p2); } { void *p = user_realloc(thr, pc, 0, 10000); EXPECT_NE(p, (void*)0); memset(p, 0xde, 10000); void *p2 = user_realloc(thr, pc, p, 10); EXPECT_NE(p2, (void*)0); for (int i = 0; i < 10; i++) EXPECT_EQ(((char*)p2)[i], (char)0xde); user_free(thr, pc, p2); } } TEST(Mman, UsableSize) { ThreadState *thr = cur_thread(); uptr pc = 0; char *p = (char*)user_alloc(thr, pc, 10); char *p2 = (char*)user_alloc(thr, pc, 20); EXPECT_EQ(0U, user_alloc_usable_size(NULL)); EXPECT_EQ(10U, user_alloc_usable_size(p)); EXPECT_EQ(20U, user_alloc_usable_size(p2)); user_free(thr, pc, p); user_free(thr, pc, p2); EXPECT_EQ(0U, user_alloc_usable_size((void*)0x4123)); } TEST(Mman, Stats) { ThreadState *thr = cur_thread(); uptr alloc0 = __sanitizer_get_current_allocated_bytes(); uptr heap0 = __sanitizer_get_heap_size(); uptr free0 = __sanitizer_get_free_bytes(); uptr unmapped0 = __sanitizer_get_unmapped_bytes(); EXPECT_EQ(10U, __sanitizer_get_estimated_allocated_size(10)); EXPECT_EQ(20U, __sanitizer_get_estimated_allocated_size(20)); EXPECT_EQ(100U, __sanitizer_get_estimated_allocated_size(100)); char *p = (char*)user_alloc(thr, 0, 10); EXPECT_TRUE(__sanitizer_get_ownership(p)); EXPECT_EQ(10U, __sanitizer_get_allocated_size(p)); EXPECT_EQ(alloc0 + 16, __sanitizer_get_current_allocated_bytes()); EXPECT_GE(__sanitizer_get_heap_size(), heap0); EXPECT_EQ(free0, __sanitizer_get_free_bytes()); EXPECT_EQ(unmapped0, __sanitizer_get_unmapped_bytes()); user_free(thr, 0, p); EXPECT_EQ(alloc0, __sanitizer_get_current_allocated_bytes()); EXPECT_GE(__sanitizer_get_heap_size(), heap0); EXPECT_EQ(free0, __sanitizer_get_free_bytes()); EXPECT_EQ(unmapped0, __sanitizer_get_unmapped_bytes()); } TEST(Mman, CallocOverflow) { #if SANITIZER_DEBUG // EXPECT_DEATH clones a thread with 4K stack, // which is overflown by tsan memory accesses functions in debug mode. return; #endif ThreadState *thr = cur_thread(); uptr pc = 0; size_t kArraySize = 4096; volatile size_t kMaxSizeT = std::numeric_limits::max(); volatile size_t kArraySize2 = kMaxSizeT / kArraySize + 10; volatile void *p = NULL; EXPECT_DEATH(p = user_calloc(thr, pc, kArraySize, kArraySize2), "allocator is terminating the process instead of returning 0"); EXPECT_EQ(0L, p); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_flags_test.cc0000664000175000017500000001104612565707341030540 0ustar mwhudsonmwhudson//===-- tsan_flags_test.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_flags.h" #include "tsan_rtl.h" #include "gtest/gtest.h" #include namespace __tsan { TEST(Flags, Basic) { // At least should not crash. Flags f; InitializeFlags(&f, 0); InitializeFlags(&f, ""); } TEST(Flags, DefaultValues) { Flags f; f.enable_annotations = false; InitializeFlags(&f, ""); EXPECT_EQ(true, f.enable_annotations); } static const char *options1 = " enable_annotations=0" " suppress_equal_stacks=0" " suppress_equal_addresses=0" " report_bugs=0" " report_thread_leaks=0" " report_destroy_locked=0" " report_mutex_bugs=0" " report_signal_unsafe=0" " report_atomic_races=0" " force_seq_cst_atomics=0" " print_benign=0" " halt_on_error=0" " atexit_sleep_ms=222" " profile_memory=qqq" " flush_memory_ms=444" " flush_symbolizer_ms=555" " memory_limit_mb=666" " stop_on_start=0" " running_on_valgrind=0" " history_size=5" " io_sync=1" " die_after_fork=true" ""; static const char *options2 = " enable_annotations=true" " suppress_equal_stacks=true" " suppress_equal_addresses=true" " report_bugs=true" " report_thread_leaks=true" " report_destroy_locked=true" " report_mutex_bugs=true" " report_signal_unsafe=true" " report_atomic_races=true" " force_seq_cst_atomics=true" " print_benign=true" " halt_on_error=true" " atexit_sleep_ms=123" " profile_memory=bbbbb" " flush_memory_ms=234" " flush_symbolizer_ms=345" " memory_limit_mb=456" " stop_on_start=true" " running_on_valgrind=true" " history_size=6" " io_sync=2" " die_after_fork=false" ""; void VerifyOptions1(Flags *f) { EXPECT_EQ(f->enable_annotations, 0); EXPECT_EQ(f->suppress_equal_stacks, 0); EXPECT_EQ(f->suppress_equal_addresses, 0); EXPECT_EQ(f->report_bugs, 0); EXPECT_EQ(f->report_thread_leaks, 0); EXPECT_EQ(f->report_destroy_locked, 0); EXPECT_EQ(f->report_mutex_bugs, 0); EXPECT_EQ(f->report_signal_unsafe, 0); EXPECT_EQ(f->report_atomic_races, 0); EXPECT_EQ(f->force_seq_cst_atomics, 0); EXPECT_EQ(f->print_benign, 0); EXPECT_EQ(f->halt_on_error, 0); EXPECT_EQ(f->atexit_sleep_ms, 222); EXPECT_EQ(f->profile_memory, std::string("qqq")); EXPECT_EQ(f->flush_memory_ms, 444); EXPECT_EQ(f->flush_symbolizer_ms, 555); EXPECT_EQ(f->memory_limit_mb, 666); EXPECT_EQ(f->stop_on_start, 0); EXPECT_EQ(f->running_on_valgrind, 0); EXPECT_EQ(f->history_size, 5); EXPECT_EQ(f->io_sync, 1); EXPECT_EQ(f->die_after_fork, true); } void VerifyOptions2(Flags *f) { EXPECT_EQ(f->enable_annotations, true); EXPECT_EQ(f->suppress_equal_stacks, true); EXPECT_EQ(f->suppress_equal_addresses, true); EXPECT_EQ(f->report_bugs, true); EXPECT_EQ(f->report_thread_leaks, true); EXPECT_EQ(f->report_destroy_locked, true); EXPECT_EQ(f->report_mutex_bugs, true); EXPECT_EQ(f->report_signal_unsafe, true); EXPECT_EQ(f->report_atomic_races, true); EXPECT_EQ(f->force_seq_cst_atomics, true); EXPECT_EQ(f->print_benign, true); EXPECT_EQ(f->halt_on_error, true); EXPECT_EQ(f->atexit_sleep_ms, 123); EXPECT_EQ(f->profile_memory, std::string("bbbbb")); EXPECT_EQ(f->flush_memory_ms, 234); EXPECT_EQ(f->flush_symbolizer_ms, 345); EXPECT_EQ(f->memory_limit_mb, 456); EXPECT_EQ(f->stop_on_start, true); EXPECT_EQ(f->running_on_valgrind, true); EXPECT_EQ(f->history_size, 6); EXPECT_EQ(f->io_sync, 2); EXPECT_EQ(f->die_after_fork, false); } static const char *test_default_options; extern "C" const char *__tsan_default_options() { return test_default_options; } TEST(Flags, ParseDefaultOptions) { Flags f; test_default_options = options1; InitializeFlags(&f, ""); VerifyOptions1(&f); test_default_options = options2; InitializeFlags(&f, ""); VerifyOptions2(&f); } TEST(Flags, ParseEnvOptions) { Flags f; InitializeFlags(&f, options1); VerifyOptions1(&f); InitializeFlags(&f, options2); VerifyOptions2(&f); } TEST(Flags, ParsePriority) { Flags f; test_default_options = options2; InitializeFlags(&f, options1); VerifyOptions1(&f); test_default_options = options1; InitializeFlags(&f, options2); VerifyOptions2(&f); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/unit/tsan_clock_test.cc0000664000175000017500000002543312620653205030533 0ustar mwhudsonmwhudson//===-- tsan_clock_test.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_clock.h" #include "tsan_rtl.h" #include "gtest/gtest.h" #include #include namespace __tsan { ClockCache cache; TEST(Clock, VectorBasic) { ThreadClock clk(0); ASSERT_EQ(clk.size(), 1U); clk.tick(); ASSERT_EQ(clk.size(), 1U); ASSERT_EQ(clk.get(0), 1U); clk.set(3, clk.get(3) + 1); ASSERT_EQ(clk.size(), 4U); ASSERT_EQ(clk.get(0), 1U); ASSERT_EQ(clk.get(1), 0U); ASSERT_EQ(clk.get(2), 0U); ASSERT_EQ(clk.get(3), 1U); clk.set(3, clk.get(3) + 1); ASSERT_EQ(clk.get(3), 2U); } TEST(Clock, ChunkedBasic) { ThreadClock vector(0); SyncClock chunked; ASSERT_EQ(vector.size(), 1U); ASSERT_EQ(chunked.size(), 0U); vector.acquire(&cache, &chunked); ASSERT_EQ(vector.size(), 1U); ASSERT_EQ(chunked.size(), 0U); vector.release(&cache, &chunked); ASSERT_EQ(vector.size(), 1U); ASSERT_EQ(chunked.size(), 1U); vector.acq_rel(&cache, &chunked); ASSERT_EQ(vector.size(), 1U); ASSERT_EQ(chunked.size(), 1U); chunked.Reset(&cache); } TEST(Clock, AcquireRelease) { ThreadClock vector1(100); vector1.tick(); SyncClock chunked; vector1.release(&cache, &chunked); ASSERT_EQ(chunked.size(), 101U); ThreadClock vector2(0); vector2.acquire(&cache, &chunked); ASSERT_EQ(vector2.size(), 101U); ASSERT_EQ(vector2.get(0), 0U); ASSERT_EQ(vector2.get(1), 0U); ASSERT_EQ(vector2.get(99), 0U); ASSERT_EQ(vector2.get(100), 1U); chunked.Reset(&cache); } TEST(Clock, RepeatedAcquire) { ThreadClock thr1(1); thr1.tick(); ThreadClock thr2(2); thr2.tick(); SyncClock sync; thr1.ReleaseStore(&cache, &sync); thr2.acquire(&cache, &sync); thr2.acquire(&cache, &sync); sync.Reset(&cache); } TEST(Clock, ManyThreads) { SyncClock chunked; for (unsigned i = 0; i < 100; i++) { ThreadClock vector(0); vector.tick(); vector.set(i, 1); vector.release(&cache, &chunked); ASSERT_EQ(i + 1, chunked.size()); vector.acquire(&cache, &chunked); ASSERT_EQ(i + 1, vector.size()); } for (unsigned i = 0; i < 100; i++) ASSERT_EQ(1U, chunked.get(i)); ThreadClock vector(1); vector.acquire(&cache, &chunked); ASSERT_EQ(100U, vector.size()); for (unsigned i = 0; i < 100; i++) ASSERT_EQ(1U, vector.get(i)); chunked.Reset(&cache); } TEST(Clock, DifferentSizes) { { ThreadClock vector1(10); vector1.tick(); ThreadClock vector2(20); vector2.tick(); { SyncClock chunked; vector1.release(&cache, &chunked); ASSERT_EQ(chunked.size(), 11U); vector2.release(&cache, &chunked); ASSERT_EQ(chunked.size(), 21U); chunked.Reset(&cache); } { SyncClock chunked; vector2.release(&cache, &chunked); ASSERT_EQ(chunked.size(), 21U); vector1.release(&cache, &chunked); ASSERT_EQ(chunked.size(), 21U); chunked.Reset(&cache); } { SyncClock chunked; vector1.release(&cache, &chunked); vector2.acquire(&cache, &chunked); ASSERT_EQ(vector2.size(), 21U); chunked.Reset(&cache); } { SyncClock chunked; vector2.release(&cache, &chunked); vector1.acquire(&cache, &chunked); ASSERT_EQ(vector1.size(), 21U); chunked.Reset(&cache); } } } TEST(Clock, Growth) { { ThreadClock vector(10); vector.tick(); vector.set(5, 42); SyncClock sync; vector.release(&cache, &sync); ASSERT_EQ(sync.size(), 11U); ASSERT_EQ(sync.get(0), 0ULL); ASSERT_EQ(sync.get(1), 0ULL); ASSERT_EQ(sync.get(5), 42ULL); ASSERT_EQ(sync.get(9), 0ULL); ASSERT_EQ(sync.get(10), 1ULL); sync.Reset(&cache); } { ThreadClock vector1(10); vector1.tick(); ThreadClock vector2(20); vector2.tick(); SyncClock sync; vector1.release(&cache, &sync); vector2.release(&cache, &sync); ASSERT_EQ(sync.size(), 21U); ASSERT_EQ(sync.get(0), 0ULL); ASSERT_EQ(sync.get(10), 1ULL); ASSERT_EQ(sync.get(19), 0ULL); ASSERT_EQ(sync.get(20), 1ULL); sync.Reset(&cache); } { ThreadClock vector(100); vector.tick(); vector.set(5, 42); vector.set(90, 84); SyncClock sync; vector.release(&cache, &sync); ASSERT_EQ(sync.size(), 101U); ASSERT_EQ(sync.get(0), 0ULL); ASSERT_EQ(sync.get(1), 0ULL); ASSERT_EQ(sync.get(5), 42ULL); ASSERT_EQ(sync.get(60), 0ULL); ASSERT_EQ(sync.get(70), 0ULL); ASSERT_EQ(sync.get(90), 84ULL); ASSERT_EQ(sync.get(99), 0ULL); ASSERT_EQ(sync.get(100), 1ULL); sync.Reset(&cache); } { ThreadClock vector1(10); vector1.tick(); ThreadClock vector2(100); vector2.tick(); SyncClock sync; vector1.release(&cache, &sync); vector2.release(&cache, &sync); ASSERT_EQ(sync.size(), 101U); ASSERT_EQ(sync.get(0), 0ULL); ASSERT_EQ(sync.get(10), 1ULL); ASSERT_EQ(sync.get(99), 0ULL); ASSERT_EQ(sync.get(100), 1ULL); sync.Reset(&cache); } } const uptr kThreads = 4; const uptr kClocks = 4; // SimpleSyncClock and SimpleThreadClock implement the same thing as // SyncClock and ThreadClock, but in a very simple way. struct SimpleSyncClock { u64 clock[kThreads]; uptr size; SimpleSyncClock() { Reset(); } void Reset() { size = 0; for (uptr i = 0; i < kThreads; i++) clock[i] = 0; } bool verify(const SyncClock *other) const { for (uptr i = 0; i < min(size, other->size()); i++) { if (clock[i] != other->get(i)) return false; } for (uptr i = min(size, other->size()); i < max(size, other->size()); i++) { if (i < size && clock[i] != 0) return false; if (i < other->size() && other->get(i) != 0) return false; } return true; } }; struct SimpleThreadClock { u64 clock[kThreads]; uptr size; unsigned tid; explicit SimpleThreadClock(unsigned tid) { this->tid = tid; size = tid + 1; for (uptr i = 0; i < kThreads; i++) clock[i] = 0; } void tick() { clock[tid]++; } void acquire(const SimpleSyncClock *src) { if (size < src->size) size = src->size; for (uptr i = 0; i < kThreads; i++) clock[i] = max(clock[i], src->clock[i]); } void release(SimpleSyncClock *dst) const { if (dst->size < size) dst->size = size; for (uptr i = 0; i < kThreads; i++) dst->clock[i] = max(dst->clock[i], clock[i]); } void acq_rel(SimpleSyncClock *dst) { acquire(dst); release(dst); } void ReleaseStore(SimpleSyncClock *dst) const { if (dst->size < size) dst->size = size; for (uptr i = 0; i < kThreads; i++) dst->clock[i] = clock[i]; } bool verify(const ThreadClock *other) const { for (uptr i = 0; i < min(size, other->size()); i++) { if (clock[i] != other->get(i)) return false; } for (uptr i = min(size, other->size()); i < max(size, other->size()); i++) { if (i < size && clock[i] != 0) return false; if (i < other->size() && other->get(i) != 0) return false; } return true; } }; static bool ClockFuzzer(bool printing) { // Create kThreads thread clocks. SimpleThreadClock *thr0[kThreads]; ThreadClock *thr1[kThreads]; unsigned reused[kThreads]; for (unsigned i = 0; i < kThreads; i++) { reused[i] = 0; thr0[i] = new SimpleThreadClock(i); thr1[i] = new ThreadClock(i, reused[i]); } // Create kClocks sync clocks. SimpleSyncClock *sync0[kClocks]; SyncClock *sync1[kClocks]; for (unsigned i = 0; i < kClocks; i++) { sync0[i] = new SimpleSyncClock(); sync1[i] = new SyncClock(); } // Do N random operations (acquire, release, etc) and compare results // for SimpleThread/SyncClock and real Thread/SyncClock. for (int i = 0; i < 10000; i++) { unsigned tid = rand() % kThreads; unsigned cid = rand() % kClocks; thr0[tid]->tick(); thr1[tid]->tick(); switch (rand() % 6) { case 0: if (printing) printf("acquire thr%d <- clk%d\n", tid, cid); thr0[tid]->acquire(sync0[cid]); thr1[tid]->acquire(&cache, sync1[cid]); break; case 1: if (printing) printf("release thr%d -> clk%d\n", tid, cid); thr0[tid]->release(sync0[cid]); thr1[tid]->release(&cache, sync1[cid]); break; case 2: if (printing) printf("acq_rel thr%d <> clk%d\n", tid, cid); thr0[tid]->acq_rel(sync0[cid]); thr1[tid]->acq_rel(&cache, sync1[cid]); break; case 3: if (printing) printf("rel_str thr%d >> clk%d\n", tid, cid); thr0[tid]->ReleaseStore(sync0[cid]); thr1[tid]->ReleaseStore(&cache, sync1[cid]); break; case 4: if (printing) printf("reset clk%d\n", cid); sync0[cid]->Reset(); sync1[cid]->Reset(&cache); break; case 5: if (printing) printf("reset thr%d\n", tid); u64 epoch = thr0[tid]->clock[tid] + 1; reused[tid]++; delete thr0[tid]; thr0[tid] = new SimpleThreadClock(tid); thr0[tid]->clock[tid] = epoch; delete thr1[tid]; thr1[tid] = new ThreadClock(tid, reused[tid]); thr1[tid]->set(epoch); break; } if (printing) { for (unsigned i = 0; i < kThreads; i++) { printf("thr%d: ", i); thr1[i]->DebugDump(printf); printf("\n"); } for (unsigned i = 0; i < kClocks; i++) { printf("clk%d: ", i); sync1[i]->DebugDump(printf); printf("\n"); } printf("\n"); } if (!thr0[tid]->verify(thr1[tid]) || !sync0[cid]->verify(sync1[cid])) { if (!printing) return false; printf("differs with model:\n"); for (unsigned i = 0; i < kThreads; i++) { printf("thr%d: clock=[", i); for (uptr j = 0; j < thr0[i]->size; j++) printf("%s%llu", j == 0 ? "" : ",", thr0[i]->clock[j]); printf("]\n"); } for (unsigned i = 0; i < kClocks; i++) { printf("clk%d: clock=[", i); for (uptr j = 0; j < sync0[i]->size; j++) printf("%s%llu", j == 0 ? "" : ",", sync0[i]->clock[j]); printf("]\n"); } return false; } } for (unsigned i = 0; i < kClocks; i++) { sync1[i]->Reset(&cache); } return true; } TEST(Clock, Fuzzer) { struct timeval tv; gettimeofday(&tv, NULL); int seed = tv.tv_sec + tv.tv_usec; printf("seed=%d\n", seed); srand(seed); if (!ClockFuzzer(false)) { // Redo the test with the same seed, but logging operations. srand(seed); ClockFuzzer(true); ASSERT_TRUE(false); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/0000775000175000017500000000000013040224626024656 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_test_util.h0000664000175000017500000000703512621445521030100 0ustar mwhudsonmwhudson//===-- tsan_test_util.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Test utils. //===----------------------------------------------------------------------===// #ifndef TSAN_TEST_UTIL_H #define TSAN_TEST_UTIL_H void TestMutexBeforeInit(); // A location of memory on which a race may be detected. class MemLoc { public: explicit MemLoc(int offset_from_aligned = 0); explicit MemLoc(void *const real_addr) : loc_(real_addr) { } ~MemLoc(); void *loc() const { return loc_; } private: void *const loc_; MemLoc(const MemLoc&); void operator = (const MemLoc&); }; class Mutex { public: enum Type { Normal, RW, #ifndef __APPLE__ Spin #else Spin = Normal #endif }; explicit Mutex(Type type = Normal); ~Mutex(); void Init(); void StaticInit(); // Emulates static initialization (tsan invisible). void Destroy(); void Lock(); bool TryLock(); void Unlock(); void ReadLock(); bool TryReadLock(); void ReadUnlock(); private: // Placeholder for pthread_mutex_t, CRITICAL_SECTION or whatever. void *mtx_[128]; bool alive_; const Type type_; Mutex(const Mutex&); void operator = (const Mutex&); }; // A thread is started in CTOR and joined in DTOR. class ScopedThread { public: explicit ScopedThread(bool detached = false, bool main = false); ~ScopedThread(); void Detach(); void Access(void *addr, bool is_write, int size, bool expect_race); void Read(const MemLoc &ml, int size, bool expect_race = false) { Access(ml.loc(), false, size, expect_race); } void Write(const MemLoc &ml, int size, bool expect_race = false) { Access(ml.loc(), true, size, expect_race); } void Read1(const MemLoc &ml, bool expect_race = false) { Read(ml, 1, expect_race); } void Read2(const MemLoc &ml, bool expect_race = false) { Read(ml, 2, expect_race); } void Read4(const MemLoc &ml, bool expect_race = false) { Read(ml, 4, expect_race); } void Read8(const MemLoc &ml, bool expect_race = false) { Read(ml, 8, expect_race); } void Write1(const MemLoc &ml, bool expect_race = false) { Write(ml, 1, expect_race); } void Write2(const MemLoc &ml, bool expect_race = false) { Write(ml, 2, expect_race); } void Write4(const MemLoc &ml, bool expect_race = false) { Write(ml, 4, expect_race); } void Write8(const MemLoc &ml, bool expect_race = false) { Write(ml, 8, expect_race); } void VptrUpdate(const MemLoc &vptr, const MemLoc &new_val, bool expect_race = false); void Call(void(*pc)()); void Return(); void Create(const Mutex &m); void Destroy(const Mutex &m); void Lock(const Mutex &m); bool TryLock(const Mutex &m); void Unlock(const Mutex &m); void ReadLock(const Mutex &m); bool TryReadLock(const Mutex &m); void ReadUnlock(const Mutex &m); void Memcpy(void *dst, const void *src, int size, bool expect_race = false); void Memset(void *dst, int val, int size, bool expect_race = false); private: struct Impl; Impl *impl_; ScopedThread(const ScopedThread&); // Not implemented. void operator = (const ScopedThread&); // Not implemented. }; class MainThread : public ScopedThread { public: MainThread() : ScopedThread(false, true) { } }; #endif // #ifndef TSAN_TEST_UTIL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_string.cc0000664000175000017500000000417212457216063027533 0ustar mwhudsonmwhudson//===-- tsan_string.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_test_util.h" #include "gtest/gtest.h" #include namespace __tsan { TEST(ThreadSanitizer, Memcpy) { char data0[7] = {1, 2, 3, 4, 5, 6, 7}; char data[7] = {42, 42, 42, 42, 42, 42, 42}; MainThread().Memcpy(data+1, data0+1, 5); EXPECT_EQ(data[0], 42); EXPECT_EQ(data[1], 2); EXPECT_EQ(data[2], 3); EXPECT_EQ(data[3], 4); EXPECT_EQ(data[4], 5); EXPECT_EQ(data[5], 6); EXPECT_EQ(data[6], 42); MainThread().Memset(data+1, 13, 5); EXPECT_EQ(data[0], 42); EXPECT_EQ(data[1], 13); EXPECT_EQ(data[2], 13); EXPECT_EQ(data[3], 13); EXPECT_EQ(data[4], 13); EXPECT_EQ(data[5], 13); EXPECT_EQ(data[6], 42); } TEST(ThreadSanitizer, MemcpyRace1) { char *data = new char[10]; char *data1 = new char[10]; char *data2 = new char[10]; ScopedThread t1, t2; t1.Memcpy(data, data1, 10); t2.Memcpy(data, data2, 10, true); } TEST(ThreadSanitizer, MemcpyRace2) { char *data = new char[10]; char *data1 = new char[10]; char *data2 = new char[10]; ScopedThread t1, t2; t1.Memcpy(data+5, data1, 1); t2.Memcpy(data+3, data2, 4, true); } TEST(ThreadSanitizer, MemcpyRace3) { char *data = new char[10]; char *data1 = new char[10]; char *data2 = new char[10]; ScopedThread t1, t2; t1.Memcpy(data, data1, 10); t2.Memcpy(data1, data2, 10, true); } TEST(ThreadSanitizer, MemcpyStack) { char *data = new char[10]; char *data1 = new char[10]; ScopedThread t1, t2; t1.Memcpy(data, data1, 10); t2.Memcpy(data, data1, 10, true); } TEST(ThreadSanitizer, MemsetRace1) { char *data = new char[10]; ScopedThread t1, t2; t1.Memset(data, 1, 10); t2.Memset(data, 2, 10, true); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_posix.cc0000664000175000017500000001017012623405717027363 0ustar mwhudsonmwhudson//===-- tsan_posix.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_interface.h" #include "tsan_test_util.h" #include "gtest/gtest.h" #include struct thread_key { pthread_key_t key; pthread_mutex_t *mtx; int val; int *cnt; thread_key(pthread_key_t key, pthread_mutex_t *mtx, int val, int *cnt) : key(key) , mtx(mtx) , val(val) , cnt(cnt) { } }; static void thread_secific_dtor(void *v) { thread_key *k = (thread_key *)v; EXPECT_EQ(pthread_mutex_lock(k->mtx), 0); (*k->cnt)++; __tsan_write4(&k->cnt); EXPECT_EQ(pthread_mutex_unlock(k->mtx), 0); if (k->val == 42) { // Okay. } else if (k->val == 43 || k->val == 44) { k->val--; EXPECT_EQ(pthread_setspecific(k->key, k), 0); } else { ASSERT_TRUE(false); } } static void *dtors_thread(void *p) { thread_key *k = (thread_key *)p; EXPECT_EQ(pthread_setspecific(k->key, k), 0); return 0; } TEST(Posix, ThreadSpecificDtors) { int cnt = 0; pthread_key_t key; EXPECT_EQ(pthread_key_create(&key, thread_secific_dtor), 0); pthread_mutex_t mtx; EXPECT_EQ(pthread_mutex_init(&mtx, 0), 0); pthread_t th[3]; thread_key k1 = thread_key(key, &mtx, 42, &cnt); thread_key k2 = thread_key(key, &mtx, 43, &cnt); thread_key k3 = thread_key(key, &mtx, 44, &cnt); EXPECT_EQ(pthread_create(&th[0], 0, dtors_thread, &k1), 0); EXPECT_EQ(pthread_create(&th[1], 0, dtors_thread, &k2), 0); EXPECT_EQ(pthread_join(th[0], 0), 0); EXPECT_EQ(pthread_create(&th[2], 0, dtors_thread, &k3), 0); EXPECT_EQ(pthread_join(th[1], 0), 0); EXPECT_EQ(pthread_join(th[2], 0), 0); EXPECT_EQ(pthread_key_delete(key), 0); EXPECT_EQ(6, cnt); } #ifndef __aarch64__ static __thread int local_var; static void *local_thread(void *p) { __tsan_write1(&local_var); __tsan_write1(&p); if (p == 0) return 0; const int kThreads = 4; pthread_t th[kThreads]; for (int i = 0; i < kThreads; i++) EXPECT_EQ(pthread_create(&th[i], 0, local_thread, (void*)((long)p - 1)), 0); // NOLINT for (int i = 0; i < kThreads; i++) EXPECT_EQ(pthread_join(th[i], 0), 0); return 0; } #endif TEST(Posix, ThreadLocalAccesses) { // The test is failing with high thread count for aarch64. // FIXME: track down the issue and re-enable the test. #ifndef __aarch64__ local_thread((void*)2); #endif } struct CondContext { pthread_mutex_t m; pthread_cond_t c; int data; }; static void *cond_thread(void *p) { CondContext &ctx = *static_cast(p); EXPECT_EQ(pthread_mutex_lock(&ctx.m), 0); EXPECT_EQ(ctx.data, 0); ctx.data = 1; EXPECT_EQ(pthread_cond_signal(&ctx.c), 0); EXPECT_EQ(pthread_mutex_unlock(&ctx.m), 0); EXPECT_EQ(pthread_mutex_lock(&ctx.m), 0); while (ctx.data != 2) EXPECT_EQ(pthread_cond_wait(&ctx.c, &ctx.m), 0); EXPECT_EQ(pthread_mutex_unlock(&ctx.m), 0); EXPECT_EQ(pthread_mutex_lock(&ctx.m), 0); ctx.data = 3; EXPECT_EQ(pthread_cond_broadcast(&ctx.c), 0); EXPECT_EQ(pthread_mutex_unlock(&ctx.m), 0); return 0; } TEST(Posix, CondBasic) { CondContext ctx; EXPECT_EQ(pthread_mutex_init(&ctx.m, 0), 0); EXPECT_EQ(pthread_cond_init(&ctx.c, 0), 0); ctx.data = 0; pthread_t th; EXPECT_EQ(pthread_create(&th, 0, cond_thread, &ctx), 0); EXPECT_EQ(pthread_mutex_lock(&ctx.m), 0); while (ctx.data != 1) EXPECT_EQ(pthread_cond_wait(&ctx.c, &ctx.m), 0); ctx.data = 2; EXPECT_EQ(pthread_mutex_unlock(&ctx.m), 0); EXPECT_EQ(pthread_cond_broadcast(&ctx.c), 0); EXPECT_EQ(pthread_mutex_lock(&ctx.m), 0); while (ctx.data != 3) EXPECT_EQ(pthread_cond_wait(&ctx.c, &ctx.m), 0); EXPECT_EQ(pthread_mutex_unlock(&ctx.m), 0); EXPECT_EQ(pthread_join(th, 0), 0); EXPECT_EQ(pthread_cond_destroy(&ctx.c), 0); EXPECT_EQ(pthread_mutex_destroy(&ctx.m), 0); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_mop.cc0000664000175000017500000001071112025572451027011 0ustar mwhudsonmwhudson//===-- tsan_mop.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_interface.h" #include "tsan_test_util.h" #include "gtest/gtest.h" #include #include TEST(ThreadSanitizer, SimpleWrite) { ScopedThread t; MemLoc l; t.Write1(l); } TEST(ThreadSanitizer, SimpleWriteWrite) { ScopedThread t1, t2; MemLoc l1, l2; t1.Write1(l1); t2.Write1(l2); } TEST(ThreadSanitizer, WriteWriteRace) { ScopedThread t1, t2; MemLoc l; t1.Write1(l); t2.Write1(l, true); } TEST(ThreadSanitizer, ReadWriteRace) { ScopedThread t1, t2; MemLoc l; t1.Read1(l); t2.Write1(l, true); } TEST(ThreadSanitizer, WriteReadRace) { ScopedThread t1, t2; MemLoc l; t1.Write1(l); t2.Read1(l, true); } TEST(ThreadSanitizer, ReadReadNoRace) { ScopedThread t1, t2; MemLoc l; t1.Read1(l); t2.Read1(l); } TEST(ThreadSanitizer, WriteThenRead) { MemLoc l; ScopedThread t1, t2; t1.Write1(l); t1.Read1(l); t2.Read1(l, true); } TEST(ThreadSanitizer, WriteThenLockedRead) { Mutex m(Mutex::RW); MainThread t0; t0.Create(m); MemLoc l; { ScopedThread t1, t2; t1.Write8(l); t1.Lock(m); t1.Read8(l); t1.Unlock(m); t2.Read8(l, true); } t0.Destroy(m); } TEST(ThreadSanitizer, LockedWriteThenRead) { Mutex m(Mutex::RW); MainThread t0; t0.Create(m); MemLoc l; { ScopedThread t1, t2; t1.Lock(m); t1.Write8(l); t1.Unlock(m); t1.Read8(l); t2.Read8(l, true); } t0.Destroy(m); } TEST(ThreadSanitizer, RaceWithOffset) { ScopedThread t1, t2; { MemLoc l; t1.Access(l.loc(), true, 8, false); t2.Access((char*)l.loc() + 4, true, 4, true); } { MemLoc l; t1.Access(l.loc(), true, 8, false); t2.Access((char*)l.loc() + 7, true, 1, true); } { MemLoc l; t1.Access((char*)l.loc() + 4, true, 4, false); t2.Access((char*)l.loc() + 4, true, 2, true); } { MemLoc l; t1.Access((char*)l.loc() + 4, true, 4, false); t2.Access((char*)l.loc() + 6, true, 2, true); } { MemLoc l; t1.Access((char*)l.loc() + 3, true, 2, false); t2.Access((char*)l.loc() + 4, true, 1, true); } { MemLoc l; t1.Access((char*)l.loc() + 1, true, 8, false); t2.Access((char*)l.loc() + 3, true, 1, true); } } TEST(ThreadSanitizer, RaceWithOffset2) { ScopedThread t1, t2; { MemLoc l; t1.Access((char*)l.loc(), true, 4, false); t2.Access((char*)l.loc() + 2, true, 1, true); } { MemLoc l; t1.Access((char*)l.loc() + 2, true, 1, false); t2.Access((char*)l.loc(), true, 4, true); } } TEST(ThreadSanitizer, NoRaceWithOffset) { ScopedThread t1, t2; { MemLoc l; t1.Access(l.loc(), true, 4, false); t2.Access((char*)l.loc() + 4, true, 4, false); } { MemLoc l; t1.Access((char*)l.loc() + 3, true, 2, false); t2.Access((char*)l.loc() + 1, true, 2, false); t2.Access((char*)l.loc() + 5, true, 2, false); } } TEST(ThreadSanitizer, RaceWithDeadThread) { MemLoc l; ScopedThread t; ScopedThread().Write1(l); t.Write1(l, true); } TEST(ThreadSanitizer, BenignRaceOnVptr) { void *vptr_storage; MemLoc vptr(&vptr_storage), val; vptr_storage = val.loc(); ScopedThread t1, t2; t1.VptrUpdate(vptr, val); t2.Read8(vptr); } TEST(ThreadSanitizer, HarmfulRaceOnVptr) { void *vptr_storage; MemLoc vptr(&vptr_storage), val1, val2; vptr_storage = val1.loc(); ScopedThread t1, t2; t1.VptrUpdate(vptr, val2); t2.Read8(vptr, true); } static void foo() { volatile int x = 42; int x2 = x; (void)x2; } static void bar() { volatile int x = 43; int x2 = x; (void)x2; } TEST(ThreadSanitizer, ReportDeadThread) { MemLoc l; ScopedThread t1; { ScopedThread t2; t2.Call(&foo); t2.Call(&bar); t2.Write1(l); } t1.Write1(l, true); } struct ClassWithStatic { static int Data[4]; }; int ClassWithStatic::Data[4]; static void foobarbaz() {} TEST(ThreadSanitizer, ReportRace) { ScopedThread t1; MainThread().Access(&ClassWithStatic::Data, true, 4, false); t1.Call(&foobarbaz); t1.Access(&ClassWithStatic::Data, true, 2, true); t1.Return(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_mutex.cc0000664000175000017500000001027112025572451027361 0ustar mwhudsonmwhudson//===-- tsan_mutex.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" #include "tsan_interface.h" #include "tsan_interface_ann.h" #include "tsan_test_util.h" #include "gtest/gtest.h" #include namespace __tsan { TEST(ThreadSanitizer, BasicMutex) { ScopedThread t; Mutex m; t.Create(m); t.Lock(m); t.Unlock(m); CHECK(t.TryLock(m)); t.Unlock(m); t.Lock(m); CHECK(!t.TryLock(m)); t.Unlock(m); t.Destroy(m); } TEST(ThreadSanitizer, BasicSpinMutex) { ScopedThread t; Mutex m(Mutex::Spin); t.Create(m); t.Lock(m); t.Unlock(m); CHECK(t.TryLock(m)); t.Unlock(m); t.Lock(m); CHECK(!t.TryLock(m)); t.Unlock(m); t.Destroy(m); } TEST(ThreadSanitizer, BasicRwMutex) { ScopedThread t; Mutex m(Mutex::RW); t.Create(m); t.Lock(m); t.Unlock(m); CHECK(t.TryLock(m)); t.Unlock(m); t.Lock(m); CHECK(!t.TryLock(m)); t.Unlock(m); t.ReadLock(m); t.ReadUnlock(m); CHECK(t.TryReadLock(m)); t.ReadUnlock(m); t.Lock(m); CHECK(!t.TryReadLock(m)); t.Unlock(m); t.ReadLock(m); CHECK(!t.TryLock(m)); t.ReadUnlock(m); t.ReadLock(m); CHECK(t.TryReadLock(m)); t.ReadUnlock(m); t.ReadUnlock(m); t.Destroy(m); } TEST(ThreadSanitizer, Mutex) { Mutex m; MainThread t0; t0.Create(m); ScopedThread t1, t2; MemLoc l; t1.Lock(m); t1.Write1(l); t1.Unlock(m); t2.Lock(m); t2.Write1(l); t2.Unlock(m); t2.Destroy(m); } TEST(ThreadSanitizer, SpinMutex) { Mutex m(Mutex::Spin); MainThread t0; t0.Create(m); ScopedThread t1, t2; MemLoc l; t1.Lock(m); t1.Write1(l); t1.Unlock(m); t2.Lock(m); t2.Write1(l); t2.Unlock(m); t2.Destroy(m); } TEST(ThreadSanitizer, RwMutex) { Mutex m(Mutex::RW); MainThread t0; t0.Create(m); ScopedThread t1, t2, t3; MemLoc l; t1.Lock(m); t1.Write1(l); t1.Unlock(m); t2.Lock(m); t2.Write1(l); t2.Unlock(m); t1.ReadLock(m); t3.ReadLock(m); t1.Read1(l); t3.Read1(l); t1.ReadUnlock(m); t3.ReadUnlock(m); t2.Lock(m); t2.Write1(l); t2.Unlock(m); t2.Destroy(m); } TEST(ThreadSanitizer, StaticMutex) { // Emulates statically initialized mutex. Mutex m; m.StaticInit(); { ScopedThread t1, t2; t1.Lock(m); t1.Unlock(m); t2.Lock(m); t2.Unlock(m); } MainThread().Destroy(m); } static void *singleton_thread(void *param) { atomic_uintptr_t *singleton = (atomic_uintptr_t *)param; for (int i = 0; i < 4*1024*1024; i++) { int *val = (int *)atomic_load(singleton, memory_order_acquire); __tsan_acquire(singleton); __tsan_read4(val); CHECK_EQ(*val, 42); } return 0; } TEST(DISABLED_BENCH_ThreadSanitizer, Singleton) { const int kClockSize = 100; const int kThreadCount = 8; // Puff off thread's clock. for (int i = 0; i < kClockSize; i++) { ScopedThread t1; (void)t1; } // Create the singleton. int val = 42; __tsan_write4(&val); atomic_uintptr_t singleton; __tsan_release(&singleton); atomic_store(&singleton, (uintptr_t)&val, memory_order_release); // Create reader threads. pthread_t threads[kThreadCount]; for (int t = 0; t < kThreadCount; t++) pthread_create(&threads[t], 0, singleton_thread, &singleton); for (int t = 0; t < kThreadCount; t++) pthread_join(threads[t], 0); } TEST(DISABLED_BENCH_ThreadSanitizer, StopFlag) { const int kClockSize = 100; const int kIters = 16*1024*1024; // Puff off thread's clock. for (int i = 0; i < kClockSize; i++) { ScopedThread t1; (void)t1; } // Create the stop flag. atomic_uintptr_t flag; __tsan_release(&flag); atomic_store(&flag, 0, memory_order_release); // Read it a lot. for (int i = 0; i < kIters; i++) { uptr v = atomic_load(&flag, memory_order_acquire); __tsan_acquire(&flag); CHECK_EQ(v, 0); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/CMakeLists.txt0000664000175000017500000000055612620660710027425 0ustar mwhudsonmwhudsonset(TSAN_RTL_TEST_SOURCES tsan_bench.cc tsan_mop.cc tsan_mutex.cc tsan_posix.cc tsan_string.cc tsan_test.cc tsan_thread.cc) if(UNIX) list(APPEND TSAN_RTL_TEST_SOURCES tsan_test_util_posix.cc) endif() set(TSAN_RTL_TEST_HEADERS tsan_test_util.h) add_tsan_unittest(TsanRtlTest SOURCES ${TSAN_RTL_TEST_SOURCES} HEADERS ${TSAN_RTL_TEST_HEADERS}) golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_bench.cc0000664000175000017500000000440212025572451027275 0ustar mwhudsonmwhudson//===-- tsan_bench.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_test_util.h" #include "tsan_interface.h" #include "tsan_defs.h" #include "gtest/gtest.h" #include const int kSize = 128; const int kRepeat = 2*1024*1024; void noinstr(void *p) {} template static void Benchmark() { volatile T data[kSize]; for (int i = 0; i < kRepeat; i++) { for (int j = 0; j < kSize; j++) { __tsan_mop((void*)&data[j]); data[j]++; } } } TEST(DISABLED_BENCH, Mop1) { Benchmark(); } TEST(DISABLED_BENCH, Mop1Read) { Benchmark(); } TEST(DISABLED_BENCH, Mop1Write) { Benchmark(); } TEST(DISABLED_BENCH, Mop2) { Benchmark(); } TEST(DISABLED_BENCH, Mop2Read) { Benchmark(); } TEST(DISABLED_BENCH, Mop2Write) { Benchmark(); } TEST(DISABLED_BENCH, Mop4) { Benchmark(); } TEST(DISABLED_BENCH, Mop4Read) { Benchmark(); } TEST(DISABLED_BENCH, Mop4Write) { Benchmark(); } TEST(DISABLED_BENCH, Mop8) { Benchmark(); } TEST(DISABLED_BENCH, Mop8Read) { Benchmark(); } TEST(DISABLED_BENCH, Mop8Write) { Benchmark(); } TEST(DISABLED_BENCH, FuncCall) { for (int i = 0; i < kRepeat; i++) { for (int j = 0; j < kSize; j++) __tsan_func_entry((void*)(uintptr_t)j); for (int j = 0; j < kSize; j++) __tsan_func_exit(); } } TEST(DISABLED_BENCH, MutexLocal) { Mutex m; ScopedThread().Create(m); for (int i = 0; i < 50; i++) { ScopedThread t; t.Lock(m); t.Unlock(m); } for (int i = 0; i < 16*1024*1024; i++) { m.Lock(); m.Unlock(); } ScopedThread().Destroy(m); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_test_util_posix.cc0000664000175000017500000003545412624063200031457 0ustar mwhudsonmwhudson//===-- tsan_test_util_posix.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Test utils, Linux, FreeBSD and Darwin implementation. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" #include "tsan_interface.h" #include "tsan_test_util.h" #include "tsan_report.h" #include "gtest/gtest.h" #include #include #include #include #include #include #include using namespace __tsan; // NOLINT static __thread bool expect_report; static __thread bool expect_report_reported; static __thread ReportType expect_report_type; #ifdef __APPLE__ #define __interceptor_memcpy wrap_memcpy #define __interceptor_memset wrap_memset #define __interceptor_pthread_create wrap_pthread_create #define __interceptor_pthread_join wrap_pthread_join #define __interceptor_pthread_detach wrap_pthread_detach #define __interceptor_pthread_mutex_init wrap_pthread_mutex_init #define __interceptor_pthread_mutex_lock wrap_pthread_mutex_lock #define __interceptor_pthread_mutex_unlock wrap_pthread_mutex_unlock #define __interceptor_pthread_mutex_destroy wrap_pthread_mutex_destroy #define __interceptor_pthread_mutex_trylock wrap_pthread_mutex_trylock #define __interceptor_pthread_rwlock_init wrap_pthread_rwlock_init #define __interceptor_pthread_rwlock_destroy wrap_pthread_rwlock_destroy #define __interceptor_pthread_rwlock_trywrlock wrap_pthread_rwlock_trywrlock #define __interceptor_pthread_rwlock_wrlock wrap_pthread_rwlock_wrlock #define __interceptor_pthread_rwlock_unlock wrap_pthread_rwlock_unlock #define __interceptor_pthread_rwlock_rdlock wrap_pthread_rwlock_rdlock #define __interceptor_pthread_rwlock_tryrdlock wrap_pthread_rwlock_tryrdlock #endif extern "C" void *__interceptor_memcpy(void *, const void *, uptr); extern "C" void *__interceptor_memset(void *, int, uptr); extern "C" int __interceptor_pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg); extern "C" int __interceptor_pthread_join(pthread_t thread, void **value_ptr); extern "C" int __interceptor_pthread_detach(pthread_t thread); extern "C" int __interceptor_pthread_mutex_init( pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); extern "C" int __interceptor_pthread_mutex_lock(pthread_mutex_t *mutex); extern "C" int __interceptor_pthread_mutex_unlock(pthread_mutex_t *mutex); extern "C" int __interceptor_pthread_mutex_destroy(pthread_mutex_t *mutex); extern "C" int __interceptor_pthread_mutex_trylock(pthread_mutex_t *mutex); extern "C" int __interceptor_pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr); extern "C" int __interceptor_pthread_rwlock_destroy(pthread_rwlock_t *rwlock); extern "C" int __interceptor_pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock); extern "C" int __interceptor_pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); extern "C" int __interceptor_pthread_rwlock_unlock(pthread_rwlock_t *rwlock); extern "C" int __interceptor_pthread_rwlock_rdlock(pthread_rwlock_t *rwlock); extern "C" int __interceptor_pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock); static void *BeforeInitThread(void *param) { (void)param; return 0; } static void AtExit() { } void TestMutexBeforeInit() { // Mutexes must be usable before __tsan_init(); pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; __interceptor_pthread_mutex_lock(&mtx); __interceptor_pthread_mutex_unlock(&mtx); __interceptor_pthread_mutex_destroy(&mtx); pthread_t thr; __interceptor_pthread_create(&thr, 0, BeforeInitThread, 0); __interceptor_pthread_join(thr, 0); atexit(AtExit); } namespace __tsan { bool OnReport(const ReportDesc *rep, bool suppressed) { if (expect_report) { if (rep->typ != expect_report_type) { printf("Expected report of type %d, got type %d\n", (int)expect_report_type, (int)rep->typ); EXPECT_FALSE("Wrong report type"); return false; } } else { EXPECT_FALSE("Unexpected report"); return false; } expect_report_reported = true; return true; } } // namespace __tsan static void* allocate_addr(int size, int offset_from_aligned = 0) { static uintptr_t foo; static atomic_uintptr_t uniq = {(uintptr_t)&foo}; // Some real address. const int kAlign = 16; CHECK(offset_from_aligned < kAlign); size = (size + 2 * kAlign) & ~(kAlign - 1); uintptr_t addr = atomic_fetch_add(&uniq, size, memory_order_relaxed); return (void*)(addr + offset_from_aligned); } MemLoc::MemLoc(int offset_from_aligned) : loc_(allocate_addr(16, offset_from_aligned)) { } MemLoc::~MemLoc() { } Mutex::Mutex(Type type) : alive_() , type_(type) { } Mutex::~Mutex() { CHECK(!alive_); } void Mutex::Init() { CHECK(!alive_); alive_ = true; if (type_ == Normal) CHECK_EQ(__interceptor_pthread_mutex_init((pthread_mutex_t*)mtx_, 0), 0); #ifndef __APPLE__ else if (type_ == Spin) CHECK_EQ(pthread_spin_init((pthread_spinlock_t*)mtx_, 0), 0); #endif else if (type_ == RW) CHECK_EQ(__interceptor_pthread_rwlock_init((pthread_rwlock_t*)mtx_, 0), 0); else CHECK(0); } void Mutex::StaticInit() { CHECK(!alive_); CHECK(type_ == Normal); alive_ = true; pthread_mutex_t tmp = PTHREAD_MUTEX_INITIALIZER; memcpy(mtx_, &tmp, sizeof(tmp)); } void Mutex::Destroy() { CHECK(alive_); alive_ = false; if (type_ == Normal) CHECK_EQ(__interceptor_pthread_mutex_destroy((pthread_mutex_t*)mtx_), 0); #ifndef __APPLE__ else if (type_ == Spin) CHECK_EQ(pthread_spin_destroy((pthread_spinlock_t*)mtx_), 0); #endif else if (type_ == RW) CHECK_EQ(__interceptor_pthread_rwlock_destroy((pthread_rwlock_t*)mtx_), 0); } void Mutex::Lock() { CHECK(alive_); if (type_ == Normal) CHECK_EQ(__interceptor_pthread_mutex_lock((pthread_mutex_t*)mtx_), 0); #ifndef __APPLE__ else if (type_ == Spin) CHECK_EQ(pthread_spin_lock((pthread_spinlock_t*)mtx_), 0); #endif else if (type_ == RW) CHECK_EQ(__interceptor_pthread_rwlock_wrlock((pthread_rwlock_t*)mtx_), 0); } bool Mutex::TryLock() { CHECK(alive_); if (type_ == Normal) return __interceptor_pthread_mutex_trylock((pthread_mutex_t*)mtx_) == 0; #ifndef __APPLE__ else if (type_ == Spin) return pthread_spin_trylock((pthread_spinlock_t*)mtx_) == 0; #endif else if (type_ == RW) return __interceptor_pthread_rwlock_trywrlock((pthread_rwlock_t*)mtx_) == 0; return false; } void Mutex::Unlock() { CHECK(alive_); if (type_ == Normal) CHECK_EQ(__interceptor_pthread_mutex_unlock((pthread_mutex_t*)mtx_), 0); #ifndef __APPLE__ else if (type_ == Spin) CHECK_EQ(pthread_spin_unlock((pthread_spinlock_t*)mtx_), 0); #endif else if (type_ == RW) CHECK_EQ(__interceptor_pthread_rwlock_unlock((pthread_rwlock_t*)mtx_), 0); } void Mutex::ReadLock() { CHECK(alive_); CHECK(type_ == RW); CHECK_EQ(__interceptor_pthread_rwlock_rdlock((pthread_rwlock_t*)mtx_), 0); } bool Mutex::TryReadLock() { CHECK(alive_); CHECK(type_ == RW); return __interceptor_pthread_rwlock_tryrdlock((pthread_rwlock_t*)mtx_) == 0; } void Mutex::ReadUnlock() { CHECK(alive_); CHECK(type_ == RW); CHECK_EQ(__interceptor_pthread_rwlock_unlock((pthread_rwlock_t*)mtx_), 0); } struct Event { enum Type { SHUTDOWN, READ, WRITE, VPTR_UPDATE, CALL, RETURN, MUTEX_CREATE, MUTEX_DESTROY, MUTEX_LOCK, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_READLOCK, MUTEX_TRYREADLOCK, MUTEX_READUNLOCK, MEMCPY, MEMSET }; Type type; void *ptr; uptr arg; uptr arg2; bool res; bool expect_report; ReportType report_type; Event(Type type, const void *ptr = 0, uptr arg = 0, uptr arg2 = 0) : type(type) , ptr(const_cast(ptr)) , arg(arg) , arg2(arg2) , res() , expect_report() , report_type() { } void ExpectReport(ReportType type) { expect_report = true; report_type = type; } }; struct ScopedThread::Impl { pthread_t thread; bool main; bool detached; atomic_uintptr_t event; // Event* static void *ScopedThreadCallback(void *arg); void send(Event *ev); void HandleEvent(Event *ev); }; void ScopedThread::Impl::HandleEvent(Event *ev) { CHECK_EQ(expect_report, false); expect_report = ev->expect_report; expect_report_reported = false; expect_report_type = ev->report_type; switch (ev->type) { case Event::READ: case Event::WRITE: { void (*tsan_mop)(void *addr) = 0; if (ev->type == Event::READ) { switch (ev->arg /*size*/) { case 1: tsan_mop = __tsan_read1; break; case 2: tsan_mop = __tsan_read2; break; case 4: tsan_mop = __tsan_read4; break; case 8: tsan_mop = __tsan_read8; break; case 16: tsan_mop = __tsan_read16; break; } } else { switch (ev->arg /*size*/) { case 1: tsan_mop = __tsan_write1; break; case 2: tsan_mop = __tsan_write2; break; case 4: tsan_mop = __tsan_write4; break; case 8: tsan_mop = __tsan_write8; break; case 16: tsan_mop = __tsan_write16; break; } } CHECK_NE(tsan_mop, 0); #if defined(__FreeBSD__) || defined(__APPLE__) const int ErrCode = ESOCKTNOSUPPORT; #else const int ErrCode = ECHRNG; #endif errno = ErrCode; tsan_mop(ev->ptr); CHECK_EQ(ErrCode, errno); // In no case must errno be changed. break; } case Event::VPTR_UPDATE: __tsan_vptr_update((void**)ev->ptr, (void*)ev->arg); break; case Event::CALL: __tsan_func_entry((void*)((uptr)ev->ptr)); break; case Event::RETURN: __tsan_func_exit(); break; case Event::MUTEX_CREATE: static_cast(ev->ptr)->Init(); break; case Event::MUTEX_DESTROY: static_cast(ev->ptr)->Destroy(); break; case Event::MUTEX_LOCK: static_cast(ev->ptr)->Lock(); break; case Event::MUTEX_TRYLOCK: ev->res = static_cast(ev->ptr)->TryLock(); break; case Event::MUTEX_UNLOCK: static_cast(ev->ptr)->Unlock(); break; case Event::MUTEX_READLOCK: static_cast(ev->ptr)->ReadLock(); break; case Event::MUTEX_TRYREADLOCK: ev->res = static_cast(ev->ptr)->TryReadLock(); break; case Event::MUTEX_READUNLOCK: static_cast(ev->ptr)->ReadUnlock(); break; case Event::MEMCPY: __interceptor_memcpy(ev->ptr, (void*)ev->arg, ev->arg2); break; case Event::MEMSET: __interceptor_memset(ev->ptr, ev->arg, ev->arg2); break; default: CHECK(0); } if (expect_report && !expect_report_reported) { printf("Missed expected report of type %d\n", (int)ev->report_type); EXPECT_FALSE("Missed expected race"); } expect_report = false; } void *ScopedThread::Impl::ScopedThreadCallback(void *arg) { __tsan_func_entry(__builtin_return_address(0)); Impl *impl = (Impl*)arg; for (;;) { Event* ev = (Event*)atomic_load(&impl->event, memory_order_acquire); if (ev == 0) { sched_yield(); continue; } if (ev->type == Event::SHUTDOWN) { atomic_store(&impl->event, 0, memory_order_release); break; } impl->HandleEvent(ev); atomic_store(&impl->event, 0, memory_order_release); } __tsan_func_exit(); return 0; } void ScopedThread::Impl::send(Event *e) { if (main) { HandleEvent(e); } else { CHECK_EQ(atomic_load(&event, memory_order_relaxed), 0); atomic_store(&event, (uintptr_t)e, memory_order_release); while (atomic_load(&event, memory_order_acquire) != 0) sched_yield(); } } ScopedThread::ScopedThread(bool detached, bool main) { impl_ = new Impl; impl_->main = main; impl_->detached = detached; atomic_store(&impl_->event, 0, memory_order_relaxed); if (!main) { pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate( &attr, detached ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE); pthread_attr_setstacksize(&attr, 64*1024); __interceptor_pthread_create(&impl_->thread, &attr, ScopedThread::Impl::ScopedThreadCallback, impl_); } } ScopedThread::~ScopedThread() { if (!impl_->main) { Event event(Event::SHUTDOWN); impl_->send(&event); if (!impl_->detached) __interceptor_pthread_join(impl_->thread, 0); } delete impl_; } void ScopedThread::Detach() { CHECK(!impl_->main); CHECK(!impl_->detached); impl_->detached = true; __interceptor_pthread_detach(impl_->thread); } void ScopedThread::Access(void *addr, bool is_write, int size, bool expect_race) { Event event(is_write ? Event::WRITE : Event::READ, addr, size); if (expect_race) event.ExpectReport(ReportTypeRace); impl_->send(&event); } void ScopedThread::VptrUpdate(const MemLoc &vptr, const MemLoc &new_val, bool expect_race) { Event event(Event::VPTR_UPDATE, vptr.loc(), (uptr)new_val.loc()); if (expect_race) event.ExpectReport(ReportTypeRace); impl_->send(&event); } void ScopedThread::Call(void(*pc)()) { Event event(Event::CALL, (void*)((uintptr_t)pc)); impl_->send(&event); } void ScopedThread::Return() { Event event(Event::RETURN); impl_->send(&event); } void ScopedThread::Create(const Mutex &m) { Event event(Event::MUTEX_CREATE, &m); impl_->send(&event); } void ScopedThread::Destroy(const Mutex &m) { Event event(Event::MUTEX_DESTROY, &m); impl_->send(&event); } void ScopedThread::Lock(const Mutex &m) { Event event(Event::MUTEX_LOCK, &m); impl_->send(&event); } bool ScopedThread::TryLock(const Mutex &m) { Event event(Event::MUTEX_TRYLOCK, &m); impl_->send(&event); return event.res; } void ScopedThread::Unlock(const Mutex &m) { Event event(Event::MUTEX_UNLOCK, &m); impl_->send(&event); } void ScopedThread::ReadLock(const Mutex &m) { Event event(Event::MUTEX_READLOCK, &m); impl_->send(&event); } bool ScopedThread::TryReadLock(const Mutex &m) { Event event(Event::MUTEX_TRYREADLOCK, &m); impl_->send(&event); return event.res; } void ScopedThread::ReadUnlock(const Mutex &m) { Event event(Event::MUTEX_READUNLOCK, &m); impl_->send(&event); } void ScopedThread::Memcpy(void *dst, const void *src, int size, bool expect_race) { Event event(Event::MEMCPY, dst, (uptr)src, size); if (expect_race) event.ExpectReport(ReportTypeRace); impl_->send(&event); } void ScopedThread::Memset(void *dst, int val, int size, bool expect_race) { Event event(Event::MEMSET, dst, val, size); if (expect_race) event.ExpectReport(ReportTypeRace); impl_->send(&event); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_thread.cc0000664000175000017500000000257312025572451027474 0ustar mwhudsonmwhudson//===-- tsan_thread.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_test_util.h" #include "gtest/gtest.h" TEST(ThreadSanitizer, ThreadSync) { MainThread t0; MemLoc l; t0.Write1(l); { ScopedThread t1; t1.Write1(l); } t0.Write1(l); } TEST(ThreadSanitizer, ThreadDetach1) { ScopedThread t1(true); MemLoc l; t1.Write1(l); } TEST(ThreadSanitizer, ThreadDetach2) { ScopedThread t1; MemLoc l; t1.Write1(l); t1.Detach(); } static void *thread_alot_func(void *arg) { (void)arg; int usleep(unsigned); usleep(50); return 0; } TEST(DISABLED_SLOW_ThreadSanitizer, ThreadALot) { const int kThreads = 70000; const int kAlive = 1000; pthread_t threads[kAlive] = {}; for (int i = 0; i < kThreads; i++) { if (threads[i % kAlive]) pthread_join(threads[i % kAlive], 0); pthread_create(&threads[i % kAlive], 0, thread_alot_func, 0); } for (int i = 0; i < kAlive; i++) { pthread_join(threads[i], 0); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/tests/rtl/tsan_test.cc0000664000175000017500000000327712672466305027216 0ustar mwhudsonmwhudson//===-- tsan_test.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_interface.h" #include "tsan_test_util.h" #include "gtest/gtest.h" static void foo() {} static void bar() {} TEST(ThreadSanitizer, FuncCall) { ScopedThread t1, t2; MemLoc l; t1.Write1(l); t2.Call(foo); t2.Call(bar); t2.Write1(l, true); t2.Return(); t2.Return(); } // We use this function instead of main, as ISO C++ forbids taking the address // of main, which we need to pass inside __tsan_func_entry. int run_tests(int argc, char **argv) { TestMutexBeforeInit(); // Mutexes must be usable before __tsan_init(); __tsan_init(); __tsan_func_entry(__builtin_return_address(0)); __tsan_func_entry((void*)((intptr_t)&run_tests + 1)); testing::GTEST_FLAG(death_test_style) = "threadsafe"; testing::InitGoogleTest(&argc, argv); int res = RUN_ALL_TESTS(); __tsan_func_exit(); __tsan_func_exit(); return res; } const char *argv0; #ifdef __APPLE__ // On Darwin, turns off symbolication and crash logs to make tests faster. extern "C" const char* __tsan_default_options() { return "symbolize=false:abort_on_error=0"; } #endif namespace __sanitizer { bool ReexecDisabled() { return true; } } int main(int argc, char **argv) { argv0 = argv[0]; return run_tests(argc, argv); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/.clang-format0000664000175000017500000000002512623444376025277 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/check_cmake.sh0000775000175000017500000000065612417433257025507 0ustar mwhudsonmwhudson#!/bin/bash set -u set -e ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ -d "$ROOT/llvm-build" ]; then cd $ROOT/llvm-build else mkdir -p $ROOT/llvm-build cd $ROOT/llvm-build CC=clang CXX=clang++ cmake -G Ninja -DLLVM_ENABLE_WERROR=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON $ROOT/../../../.. fi ninja ninja check-sanitizer ninja check-tsan ninja check-asan ninja check-msan ninja check-lsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/CMakeLists.txt0000664000175000017500000001735512762111417025471 0ustar mwhudsonmwhudson# Build for the ThreadSanitizer runtime support library. include_directories(..) set(TSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) # SANITIZER_COMMON_CFLAGS contains -fPIC, but it's performance-critical for # TSan runtime to be built with -fPIE to reduce the number of register spills. append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE TSAN_CFLAGS) append_rtti_flag(OFF TSAN_CFLAGS) if(COMPILER_RT_TSAN_DEBUG_OUTPUT) # Add extra debug information to TSan runtime. This configuration is rarely # used, but we need to support it so that debug output will not bitrot. list(APPEND TSAN_CFLAGS -DTSAN_COLLECT_STATS=1 -DTSAN_DEBUG_OUTPUT=2) endif() set(TSAN_RTL_CFLAGS ${TSAN_CFLAGS}) append_list_if(COMPILER_RT_HAS_MSSE3_FLAG -msse3 TSAN_RTL_CFLAGS) append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=530 TSAN_RTL_CFLAGS) append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors TSAN_RTL_CFLAGS) set(TSAN_SOURCES rtl/tsan_clock.cc rtl/tsan_debugging.cc rtl/tsan_fd.cc rtl/tsan_flags.cc rtl/tsan_ignoreset.cc rtl/tsan_interceptors.cc rtl/tsan_interface.cc rtl/tsan_interface_ann.cc rtl/tsan_interface_atomic.cc rtl/tsan_interface_java.cc rtl/tsan_malloc_mac.cc rtl/tsan_md5.cc rtl/tsan_mman.cc rtl/tsan_mutex.cc rtl/tsan_mutexset.cc rtl/tsan_preinit.cc rtl/tsan_report.cc rtl/tsan_rtl.cc rtl/tsan_rtl_mutex.cc rtl/tsan_rtl_proc.cc rtl/tsan_rtl_report.cc rtl/tsan_rtl_thread.cc rtl/tsan_stack_trace.cc rtl/tsan_stat.cc rtl/tsan_suppressions.cc rtl/tsan_symbolize.cc rtl/tsan_sync.cc) set(TSAN_CXX_SOURCES rtl/tsan_new_delete.cc) if(APPLE) list(APPEND TSAN_SOURCES rtl/tsan_interceptors_mac.cc rtl/tsan_libdispatch_mac.cc rtl/tsan_platform_mac.cc rtl/tsan_platform_posix.cc) elseif(UNIX) # Assume Linux list(APPEND TSAN_SOURCES rtl/tsan_platform_linux.cc rtl/tsan_platform_posix.cc) endif() set(TSAN_HEADERS rtl/tsan_clock.h rtl/tsan_defs.h rtl/tsan_dense_alloc.h rtl/tsan_fd.h rtl/tsan_flags.h rtl/tsan_flags.inc rtl/tsan_ignoreset.h rtl/tsan_interceptors.h rtl/tsan_interface_ann.h rtl/tsan_interface.h rtl/tsan_interface_inl.h rtl/tsan_interface_java.h rtl/tsan_mman.h rtl/tsan_mutex.h rtl/tsan_mutexset.h rtl/tsan_platform.h rtl/tsan_report.h rtl/tsan_rtl.h rtl/tsan_stack_trace.h rtl/tsan_stat.h rtl/tsan_suppressions.h rtl/tsan_symbolize.h rtl/tsan_sync.h rtl/tsan_trace.h rtl/tsan_update_shadow_word_inl.h rtl/tsan_vector.h) set(TSAN_RUNTIME_LIBRARIES) add_compiler_rt_component(tsan) if(APPLE) set(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S) # Xcode will try to compile this file as C ('clang -x c'), and that will fail. if (${CMAKE_GENERATOR} STREQUAL "Xcode") enable_language(ASM) else() # Pass ASM file directly to the C++ compiler. set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES LANGUAGE C) endif() add_compiler_rt_runtime(clang_rt.tsan SHARED OS ${TSAN_SUPPORTED_OS} ARCHS ${TSAN_SUPPORTED_ARCH} SOURCES ${TSAN_SOURCES} ${TSAN_CXX_SOURCES} ${TSAN_ASM_SOURCES} OBJECT_LIBS RTInterception RTSanitizerCommon RTSanitizerCommonLibc RTUbsan CFLAGS ${TSAN_RTL_CFLAGS} PARENT_TARGET tsan) add_compiler_rt_object_libraries(RTTsan_dynamic OS ${TSAN_SUPPORTED_OS} ARCHS ${TSAN_SUPPORTED_ARCH} SOURCES ${TSAN_SOURCES} ${TSAN_CXX_SOURCES} ${TSAN_ASM_SOURCES} CFLAGS ${TSAN_RTL_CFLAGS}) # Build and check Go runtime. set(BUILDGO_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh) add_custom_target(GotsanRuntimeCheck COMMAND env "CC=${CMAKE_C_COMPILER} ${OSX_SYSROOT_FLAG}" IN_TMPDIR=1 SILENT=1 ${BUILDGO_SCRIPT} DEPENDS tsan ${BUILDGO_SCRIPT} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/go COMMENT "Checking TSan Go runtime..." VERBATIM) else() foreach(arch ${TSAN_SUPPORTED_ARCH}) if(arch STREQUAL "x86_64") set(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S) # Pass ASM file directly to the C++ compiler. set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES LANGUAGE C) # Sanity check for Go runtime. set(BUILDGO_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh) add_custom_target(GotsanRuntimeCheck COMMAND env "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" IN_TMPDIR=1 SILENT=1 ${BUILDGO_SCRIPT} DEPENDS clang_rt.tsan-${arch} ${BUILDGO_SCRIPT} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/go COMMENT "Checking TSan Go runtime..." VERBATIM) elseif(arch STREQUAL "aarch64") set(TSAN_ASM_SOURCES rtl/tsan_rtl_aarch64.S) # Pass ASM file directly to the C++ compiler. set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES LANGUAGE C) elseif(arch MATCHES "powerpc64|powerpc64le") set(TSAN_ASM_SOURCES rtl/tsan_rtl_ppc64.S) # Pass ASM file directly to the C++ compiler. set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES LANGUAGE C) elseif(arch MATCHES "mips64|mips64le") set(TSAN_ASM_SOURCES rtl/tsan_rtl_mips64.S) # Pass ASM file directly to the C++ compiler. set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES LANGUAGE C) else() set(TSAN_ASM_SOURCES) endif() add_compiler_rt_runtime(clang_rt.tsan STATIC ARCHS ${arch} SOURCES ${TSAN_SOURCES} ${TSAN_ASM_SOURCES} $ $ $ $ CFLAGS ${TSAN_RTL_CFLAGS}) add_compiler_rt_runtime(clang_rt.tsan_cxx STATIC ARCHS ${arch} SOURCES ${TSAN_CXX_SOURCES} $ CFLAGS ${TSAN_RTL_CFLAGS}) list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch} clang_rt.tsan_cxx-${arch}) add_sanitizer_rt_symbols(clang_rt.tsan ARCHS ${arch} EXTRA rtl/tsan.syms.extra) add_sanitizer_rt_symbols(clang_rt.tsan_cxx ARCHS ${arch} EXTRA rtl/tsan.syms.extra) add_dependencies(tsan clang_rt.tsan-${arch} clang_rt.tsan_cxx-${arch} clang_rt.tsan-${arch}-symbols clang_rt.tsan_cxx-${arch}-symbols) endforeach() endif() # Make sure that non-platform-specific files don't include any system headers. # FreeBSD does not install a number of Clang-provided headers for the compiler # in the base system due to incompatibilities between FreeBSD's and Clang's # versions. As a workaround do not use --sysroot=. on FreeBSD until this is # addressed. if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD") file(GLOB _tsan_generic_sources rtl/tsan*) file(GLOB _tsan_platform_sources rtl/tsan*posix* rtl/tsan*mac* rtl/tsan*linux*) list(REMOVE_ITEM _tsan_generic_sources ${_tsan_platform_sources}) set_source_files_properties(${_tsan_generic_sources} PROPERTIES COMPILE_FLAGS "--sysroot=.") endif() # Build libcxx instrumented with TSan. if(COMPILER_RT_HAS_LIBCXX_SOURCES AND COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang") set(libcxx_tsan_deps) foreach(arch ${TSAN_SUPPORTED_ARCH}) get_target_flags_for_arch(${arch} TARGET_CFLAGS) set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch}) add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX} DEPS ${TSAN_RUNTIME_LIBRARIES} CFLAGS ${TARGET_CFLAGS} -fsanitize=thread) list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}) endforeach() add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps}) endif() if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/dd/0000775000175000017500000000000013040224626023302 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/dd/dd_rtl.h0000664000175000017500000000305712512105210024716 0ustar mwhudsonmwhudson//===-- dd_rtl.h ----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef DD_RTL_H #define DD_RTL_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_deadlock_detector_interface.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_addrhashmap.h" #include "sanitizer_common/sanitizer_mutex.h" namespace __dsan { typedef DDFlags Flags; struct Mutex { DDMutex dd; }; struct Thread { DDPhysicalThread *dd_pt; DDLogicalThread *dd_lt; bool ignore_interceptors; }; struct Callback : DDCallback { Thread *thr; Callback(Thread *thr); u32 Unwind() override; }; typedef AddrHashMap MutexHashMap; struct Context { DDetector *dd; BlockingMutex report_mutex; MutexHashMap mutex_map; }; inline Flags* flags() { static Flags flags; return &flags; } void Initialize(); void InitializeInterceptors(); void ThreadInit(Thread *thr); void ThreadDestroy(Thread *thr); void MutexBeforeLock(Thread *thr, uptr m, bool writelock); void MutexAfterLock(Thread *thr, uptr m, bool writelock, bool trylock); void MutexBeforeUnlock(Thread *thr, uptr m, bool writelock); void MutexDestroy(Thread *thr, uptr m); } // namespace __dsan #endif // DD_RTL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/dd/CMakeLists.txt0000664000175000017500000000252512666527140026060 0ustar mwhudsonmwhudson# Build for the experimental deadlock detector runtime library. include_directories(../..) set(DD_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF DD_CFLAGS) set(DD_SOURCES dd_rtl.cc dd_interceptors.cc ) set(DD_LINKLIBS) append_list_if(COMPILER_RT_HAS_LIBDL dl DD_LINKLIBS) append_list_if(COMPILER_RT_HAS_LIBRT rt DD_LINKLIBS) append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread DD_LINKLIBS) add_custom_target(dd) # Deadlock detector is currently supported on 64-bit Linux only. if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE AND NOT ANDROID) set(arch "x86_64") add_compiler_rt_runtime(clang_rt.dd STATIC ARCHS ${arch} SOURCES ${DD_SOURCES} $ $ $ CFLAGS ${DD_CFLAGS} PARENT_TARGET dd) add_compiler_rt_object_libraries(RTDD ARCHS ${arch} SOURCES ${DD_SOURCES} CFLAGS ${DD_CFLAGS}) add_compiler_rt_runtime(clang_rt.dyndd SHARED ARCHS ${arch} SOURCES $ $ $ $ LINK_LIBS ${DD_LINKLIBS} PARENT_TARGET dd) endif() add_dependencies(compiler-rt dd) golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/dd/dd_rtl.cc0000664000175000017500000001051412466772632025102 0ustar mwhudsonmwhudson//===-- dd_rtl.cc ---------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "dd_rtl.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_stackdepot.h" namespace __dsan { static Context *ctx; static u32 CurrentStackTrace(Thread *thr, uptr skip) { BufferedStackTrace stack; thr->ignore_interceptors = true; stack.Unwind(1000, 0, 0, 0, 0, 0, false); thr->ignore_interceptors = false; if (stack.size <= skip) return 0; return StackDepotPut(StackTrace(stack.trace + skip, stack.size - skip)); } static void PrintStackTrace(Thread *thr, u32 stk) { StackTrace stack = StackDepotGet(stk); thr->ignore_interceptors = true; stack.Print(); thr->ignore_interceptors = false; } static void ReportDeadlock(Thread *thr, DDReport *rep) { if (rep == 0) return; BlockingMutexLock lock(&ctx->report_mutex); Printf("==============================\n"); Printf("WARNING: lock-order-inversion (potential deadlock)\n"); for (int i = 0; i < rep->n; i++) { Printf("Thread %d locks mutex %llu while holding mutex %llu:\n", rep->loop[i].thr_ctx, rep->loop[i].mtx_ctx1, rep->loop[i].mtx_ctx0); PrintStackTrace(thr, rep->loop[i].stk[1]); if (rep->loop[i].stk[0]) { Printf("Mutex %llu was acquired here:\n", rep->loop[i].mtx_ctx0); PrintStackTrace(thr, rep->loop[i].stk[0]); } } Printf("==============================\n"); } Callback::Callback(Thread *thr) : thr(thr) { lt = thr->dd_lt; pt = thr->dd_pt; } u32 Callback::Unwind() { return CurrentStackTrace(thr, 3); } static void InitializeFlags() { Flags *f = flags(); // Default values. f->second_deadlock_stack = false; SetCommonFlagsDefaults(); { // Override some common flags defaults. CommonFlags cf; cf.CopyFrom(*common_flags()); cf.allow_addr2line = true; OverrideCommonFlags(cf); } // Override from command line. FlagParser parser; RegisterFlag(&parser, "second_deadlock_stack", "", &f->second_deadlock_stack); RegisterCommonFlags(&parser); parser.ParseString(GetEnv("DSAN_OPTIONS")); SetVerbosity(common_flags()->verbosity); } void Initialize() { static u64 ctx_mem[sizeof(Context) / sizeof(u64) + 1]; ctx = new(ctx_mem) Context(); InitializeInterceptors(); InitializeFlags(); ctx->dd = DDetector::Create(flags()); } void ThreadInit(Thread *thr) { static atomic_uintptr_t id_gen; uptr id = atomic_fetch_add(&id_gen, 1, memory_order_relaxed); thr->dd_pt = ctx->dd->CreatePhysicalThread(); thr->dd_lt = ctx->dd->CreateLogicalThread(id); } void ThreadDestroy(Thread *thr) { ctx->dd->DestroyPhysicalThread(thr->dd_pt); ctx->dd->DestroyLogicalThread(thr->dd_lt); } void MutexBeforeLock(Thread *thr, uptr m, bool writelock) { if (thr->ignore_interceptors) return; Callback cb(thr); { MutexHashMap::Handle h(&ctx->mutex_map, m); if (h.created()) ctx->dd->MutexInit(&cb, &h->dd); ctx->dd->MutexBeforeLock(&cb, &h->dd, writelock); } ReportDeadlock(thr, ctx->dd->GetReport(&cb)); } void MutexAfterLock(Thread *thr, uptr m, bool writelock, bool trylock) { if (thr->ignore_interceptors) return; Callback cb(thr); { MutexHashMap::Handle h(&ctx->mutex_map, m); if (h.created()) ctx->dd->MutexInit(&cb, &h->dd); ctx->dd->MutexAfterLock(&cb, &h->dd, writelock, trylock); } ReportDeadlock(thr, ctx->dd->GetReport(&cb)); } void MutexBeforeUnlock(Thread *thr, uptr m, bool writelock) { if (thr->ignore_interceptors) return; Callback cb(thr); { MutexHashMap::Handle h(&ctx->mutex_map, m); ctx->dd->MutexBeforeUnlock(&cb, &h->dd, writelock); } ReportDeadlock(thr, ctx->dd->GetReport(&cb)); } void MutexDestroy(Thread *thr, uptr m) { if (thr->ignore_interceptors) return; Callback cb(thr); MutexHashMap::Handle h(&ctx->mutex_map, m, true); if (!h.exists()) return; ctx->dd->MutexDestroy(&cb, &h->dd); } } // namespace __dsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/dd/dd_interceptors.cc0000664000175000017500000002231512725337207027015 0ustar mwhudsonmwhudson//===-- dd_interceptors.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "dd_rtl.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_procmaps.h" #include #include using namespace __dsan; __attribute__((tls_model("initial-exec"))) static __thread Thread *thr; __attribute__((tls_model("initial-exec"))) static __thread volatile int initing; static bool inited; static uptr g_data_start; static uptr g_data_end; static bool InitThread() { if (initing) return false; if (thr != 0) return true; initing = true; if (!inited) { inited = true; Initialize(); } thr = (Thread*)InternalAlloc(sizeof(*thr)); internal_memset(thr, 0, sizeof(*thr)); ThreadInit(thr); initing = false; return true; } INTERCEPTOR(int, pthread_mutex_destroy, pthread_mutex_t *m) { InitThread(); MutexDestroy(thr, (uptr)m); return REAL(pthread_mutex_destroy)(m); } INTERCEPTOR(int, pthread_mutex_lock, pthread_mutex_t *m) { InitThread(); MutexBeforeLock(thr, (uptr)m, true); int res = REAL(pthread_mutex_lock)(m); MutexAfterLock(thr, (uptr)m, true, false); return res; } INTERCEPTOR(int, pthread_mutex_trylock, pthread_mutex_t *m) { InitThread(); int res = REAL(pthread_mutex_trylock)(m); if (res == 0) MutexAfterLock(thr, (uptr)m, true, true); return res; } INTERCEPTOR(int, pthread_mutex_unlock, pthread_mutex_t *m) { InitThread(); MutexBeforeUnlock(thr, (uptr)m, true); return REAL(pthread_mutex_unlock)(m); } INTERCEPTOR(int, pthread_spin_destroy, pthread_spinlock_t *m) { InitThread(); int res = REAL(pthread_spin_destroy)(m); MutexDestroy(thr, (uptr)m); return res; } INTERCEPTOR(int, pthread_spin_lock, pthread_spinlock_t *m) { InitThread(); MutexBeforeLock(thr, (uptr)m, true); int res = REAL(pthread_spin_lock)(m); MutexAfterLock(thr, (uptr)m, true, false); return res; } INTERCEPTOR(int, pthread_spin_trylock, pthread_spinlock_t *m) { InitThread(); int res = REAL(pthread_spin_trylock)(m); if (res == 0) MutexAfterLock(thr, (uptr)m, true, true); return res; } INTERCEPTOR(int, pthread_spin_unlock, pthread_spinlock_t *m) { InitThread(); MutexBeforeUnlock(thr, (uptr)m, true); return REAL(pthread_spin_unlock)(m); } INTERCEPTOR(int, pthread_rwlock_destroy, pthread_rwlock_t *m) { InitThread(); MutexDestroy(thr, (uptr)m); return REAL(pthread_rwlock_destroy)(m); } INTERCEPTOR(int, pthread_rwlock_rdlock, pthread_rwlock_t *m) { InitThread(); MutexBeforeLock(thr, (uptr)m, false); int res = REAL(pthread_rwlock_rdlock)(m); MutexAfterLock(thr, (uptr)m, false, false); return res; } INTERCEPTOR(int, pthread_rwlock_tryrdlock, pthread_rwlock_t *m) { InitThread(); int res = REAL(pthread_rwlock_tryrdlock)(m); if (res == 0) MutexAfterLock(thr, (uptr)m, false, true); return res; } INTERCEPTOR(int, pthread_rwlock_timedrdlock, pthread_rwlock_t *m, const timespec *abstime) { InitThread(); int res = REAL(pthread_rwlock_timedrdlock)(m, abstime); if (res == 0) MutexAfterLock(thr, (uptr)m, false, true); return res; } INTERCEPTOR(int, pthread_rwlock_wrlock, pthread_rwlock_t *m) { InitThread(); MutexBeforeLock(thr, (uptr)m, true); int res = REAL(pthread_rwlock_wrlock)(m); MutexAfterLock(thr, (uptr)m, true, false); return res; } INTERCEPTOR(int, pthread_rwlock_trywrlock, pthread_rwlock_t *m) { InitThread(); int res = REAL(pthread_rwlock_trywrlock)(m); if (res == 0) MutexAfterLock(thr, (uptr)m, true, true); return res; } INTERCEPTOR(int, pthread_rwlock_timedwrlock, pthread_rwlock_t *m, const timespec *abstime) { InitThread(); int res = REAL(pthread_rwlock_timedwrlock)(m, abstime); if (res == 0) MutexAfterLock(thr, (uptr)m, true, true); return res; } INTERCEPTOR(int, pthread_rwlock_unlock, pthread_rwlock_t *m) { InitThread(); MutexBeforeUnlock(thr, (uptr)m, true); // note: not necessary write unlock return REAL(pthread_rwlock_unlock)(m); } static pthread_cond_t *init_cond(pthread_cond_t *c, bool force = false) { atomic_uintptr_t *p = (atomic_uintptr_t*)c; uptr cond = atomic_load(p, memory_order_acquire); if (!force && cond != 0) return (pthread_cond_t*)cond; void *newcond = malloc(sizeof(pthread_cond_t)); internal_memset(newcond, 0, sizeof(pthread_cond_t)); if (atomic_compare_exchange_strong(p, &cond, (uptr)newcond, memory_order_acq_rel)) return (pthread_cond_t*)newcond; free(newcond); return (pthread_cond_t*)cond; } INTERCEPTOR(int, pthread_cond_init, pthread_cond_t *c, const pthread_condattr_t *a) { InitThread(); pthread_cond_t *cond = init_cond(c, true); return REAL(pthread_cond_init)(cond, a); } INTERCEPTOR(int, pthread_cond_wait, pthread_cond_t *c, pthread_mutex_t *m) { InitThread(); pthread_cond_t *cond = init_cond(c); MutexBeforeUnlock(thr, (uptr)m, true); MutexBeforeLock(thr, (uptr)m, true); int res = REAL(pthread_cond_wait)(cond, m); MutexAfterLock(thr, (uptr)m, true, false); return res; } INTERCEPTOR(int, pthread_cond_timedwait, pthread_cond_t *c, pthread_mutex_t *m, const timespec *abstime) { InitThread(); pthread_cond_t *cond = init_cond(c); MutexBeforeUnlock(thr, (uptr)m, true); MutexBeforeLock(thr, (uptr)m, true); int res = REAL(pthread_cond_timedwait)(cond, m, abstime); MutexAfterLock(thr, (uptr)m, true, false); return res; } INTERCEPTOR(int, pthread_cond_signal, pthread_cond_t *c) { InitThread(); pthread_cond_t *cond = init_cond(c); return REAL(pthread_cond_signal)(cond); } INTERCEPTOR(int, pthread_cond_broadcast, pthread_cond_t *c) { InitThread(); pthread_cond_t *cond = init_cond(c); return REAL(pthread_cond_broadcast)(cond); } INTERCEPTOR(int, pthread_cond_destroy, pthread_cond_t *c) { InitThread(); pthread_cond_t *cond = init_cond(c); int res = REAL(pthread_cond_destroy)(cond); free(cond); atomic_store((atomic_uintptr_t*)c, 0, memory_order_relaxed); return res; } // for symbolizer INTERCEPTOR(char*, realpath, const char *path, char *resolved_path) { InitThread(); return REAL(realpath)(path, resolved_path); } INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) { InitThread(); return REAL(read)(fd, ptr, count); } INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) { InitThread(); return REAL(pread)(fd, ptr, count, offset); } extern "C" { void __dsan_before_mutex_lock(uptr m, int writelock) { if (!InitThread()) return; MutexBeforeLock(thr, m, writelock); } void __dsan_after_mutex_lock(uptr m, int writelock, int trylock) { if (!InitThread()) return; MutexAfterLock(thr, m, writelock, trylock); } void __dsan_before_mutex_unlock(uptr m, int writelock) { if (!InitThread()) return; MutexBeforeUnlock(thr, m, writelock); } void __dsan_mutex_destroy(uptr m) { if (!InitThread()) return; // if (m >= g_data_start && m < g_data_end) // return; MutexDestroy(thr, m); } } // extern "C" namespace __dsan { static void InitDataSeg() { MemoryMappingLayout proc_maps(true); uptr start, end, offset; char name[128]; bool prev_is_data = false; while (proc_maps.Next(&start, &end, &offset, name, ARRAY_SIZE(name), /*protection*/ 0)) { bool is_data = offset != 0 && name[0] != 0; // BSS may get merged with [heap] in /proc/self/maps. This is not very // reliable. bool is_bss = offset == 0 && (name[0] == 0 || internal_strcmp(name, "[heap]") == 0) && prev_is_data; if (g_data_start == 0 && is_data) g_data_start = start; if (is_bss) g_data_end = end; prev_is_data = is_data; } VPrintf(1, "guessed data_start=%p data_end=%p\n", g_data_start, g_data_end); CHECK_LT(g_data_start, g_data_end); CHECK_GE((uptr)&g_data_start, g_data_start); CHECK_LT((uptr)&g_data_start, g_data_end); } void InitializeInterceptors() { INTERCEPT_FUNCTION(pthread_mutex_destroy); INTERCEPT_FUNCTION(pthread_mutex_lock); INTERCEPT_FUNCTION(pthread_mutex_trylock); INTERCEPT_FUNCTION(pthread_mutex_unlock); INTERCEPT_FUNCTION(pthread_spin_destroy); INTERCEPT_FUNCTION(pthread_spin_lock); INTERCEPT_FUNCTION(pthread_spin_trylock); INTERCEPT_FUNCTION(pthread_spin_unlock); INTERCEPT_FUNCTION(pthread_rwlock_destroy); INTERCEPT_FUNCTION(pthread_rwlock_rdlock); INTERCEPT_FUNCTION(pthread_rwlock_tryrdlock); INTERCEPT_FUNCTION(pthread_rwlock_timedrdlock); INTERCEPT_FUNCTION(pthread_rwlock_wrlock); INTERCEPT_FUNCTION(pthread_rwlock_trywrlock); INTERCEPT_FUNCTION(pthread_rwlock_timedwrlock); INTERCEPT_FUNCTION(pthread_rwlock_unlock); INTERCEPT_FUNCTION_VER(pthread_cond_init, "GLIBC_2.3.2"); INTERCEPT_FUNCTION_VER(pthread_cond_signal, "GLIBC_2.3.2"); INTERCEPT_FUNCTION_VER(pthread_cond_broadcast, "GLIBC_2.3.2"); INTERCEPT_FUNCTION_VER(pthread_cond_wait, "GLIBC_2.3.2"); INTERCEPT_FUNCTION_VER(pthread_cond_timedwait, "GLIBC_2.3.2"); INTERCEPT_FUNCTION_VER(pthread_cond_destroy, "GLIBC_2.3.2"); // for symbolizer INTERCEPT_FUNCTION(realpath); INTERCEPT_FUNCTION(read); INTERCEPT_FUNCTION(pread); InitDataSeg(); } } // namespace __dsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/benchmarks/0000775000175000017500000000000013040224626025030 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/benchmarks/vts_many_threads_bench.cc0000664000175000017500000000677611752747056032107 0ustar mwhudsonmwhudson// Mini-benchmark for tsan VTS worst case performance // Idea: // 1) Spawn M + N threads (M >> N) // We'll call the 'M' threads as 'garbage threads'. // 2) Make sure all threads have created thus no TIDs were reused // 3) Join the garbage threads // 4) Do many sync operations on the remaining N threads // // It turns out that due to O(M+N) VTS complexity the (4) is much slower with // when N is large. // // Some numbers: // a) clang++ native O1 with n_iterations=200kk takes // 5s regardless of M // clang++ tsanv2 O1 with n_iterations=20kk takes // 23.5s with M=200 // 11.5s with M=1 // i.e. tsanv2 is ~23x to ~47x slower than native, depends on M. // b) g++ native O1 with n_iterations=200kk takes // 5.5s regardless of M // g++ tsanv1 O1 with n_iterations=2kk takes // 39.5s with M=200 // 20.5s with M=1 // i.e. tsanv1 is ~370x to ~720x slower than native, depends on M. #include #include #include #include class __attribute__((aligned(64))) Mutex { public: Mutex() { pthread_mutex_init(&m_, NULL); } ~Mutex() { pthread_mutex_destroy(&m_); } void Lock() { pthread_mutex_lock(&m_); } void Unlock() { pthread_mutex_unlock(&m_); } private: pthread_mutex_t m_; }; const int kNumMutexes = 1024; Mutex mutexes[kNumMutexes]; int n_threads, n_iterations; pthread_barrier_t all_threads_ready, main_threads_ready; void* GarbageThread(void *unused) { pthread_barrier_wait(&all_threads_ready); return 0; } void *Thread(void *arg) { long idx = (long)arg; pthread_barrier_wait(&all_threads_ready); // Wait for the main thread to join the garbage threads. pthread_barrier_wait(&main_threads_ready); printf("Thread %ld go!\n", idx); int offset = idx * kNumMutexes / n_threads; for (int i = 0; i < n_iterations; i++) { mutexes[(offset + i) % kNumMutexes].Lock(); mutexes[(offset + i) % kNumMutexes].Unlock(); } printf("Thread %ld done\n", idx); return 0; } int main(int argc, char **argv) { int n_garbage_threads; if (argc == 1) { n_threads = 2; n_garbage_threads = 200; n_iterations = 20000000; } else if (argc == 4) { n_threads = atoi(argv[1]); assert(n_threads > 0 && n_threads <= 32); n_garbage_threads = atoi(argv[2]); assert(n_garbage_threads > 0 && n_garbage_threads <= 16000); n_iterations = atoi(argv[3]); } else { printf("Usage: %s n_threads n_garbage_threads n_iterations\n", argv[0]); return 1; } printf("%s: n_threads=%d n_garbage_threads=%d n_iterations=%d\n", __FILE__, n_threads, n_garbage_threads, n_iterations); pthread_barrier_init(&all_threads_ready, NULL, n_garbage_threads + n_threads + 1); pthread_barrier_init(&main_threads_ready, NULL, n_threads + 1); pthread_t *t = new pthread_t[n_threads]; { pthread_t *g_t = new pthread_t[n_garbage_threads]; for (int i = 0; i < n_garbage_threads; i++) { int status = pthread_create(&g_t[i], 0, GarbageThread, NULL); assert(status == 0); } for (int i = 0; i < n_threads; i++) { int status = pthread_create(&t[i], 0, Thread, (void*)i); assert(status == 0); } pthread_barrier_wait(&all_threads_ready); printf("All threads started! Killing the garbage threads.\n"); for (int i = 0; i < n_garbage_threads; i++) { pthread_join(g_t[i], 0); } delete [] g_t; } printf("Resuming the main threads.\n"); pthread_barrier_wait(&main_threads_ready); for (int i = 0; i < n_threads; i++) { pthread_join(t[i], 0); } delete [] t; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/benchmarks/mini_bench_local.cc0000664000175000017500000000207611752747056030630 0ustar mwhudsonmwhudson// Mini-benchmark for tsan: non-shared memory writes. #include #include #include #include int len; int *a; const int kNumIter = 1000; __attribute__((noinline)) void Run(int idx) { for (int i = 0, n = len; i < n; i++) a[i + idx * n] = i; } void *Thread(void *arg) { long idx = (long)arg; printf("Thread %ld started\n", idx); for (int i = 0; i < kNumIter; i++) Run(idx); printf("Thread %ld done\n", idx); return 0; } int main(int argc, char **argv) { int n_threads = 0; if (argc != 3) { n_threads = 4; len = 1000000; } else { n_threads = atoi(argv[1]); assert(n_threads > 0 && n_threads <= 32); len = atoi(argv[2]); } printf("%s: n_threads=%d len=%d iter=%d\n", __FILE__, n_threads, len, kNumIter); a = new int[n_threads * len]; pthread_t *t = new pthread_t[n_threads]; for (int i = 0; i < n_threads; i++) { pthread_create(&t[i], 0, Thread, (void*)i); } for (int i = 0; i < n_threads; i++) { pthread_join(t[i], 0); } delete [] t; delete [] a; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/benchmarks/start_many_threads.cc0000664000175000017500000000275511752747056031262 0ustar mwhudsonmwhudson// Mini-benchmark for creating a lot of threads. // // Some facts: // a) clang -O1 takes <15ms to start N=500 threads, // consuming ~4MB more RAM than N=1. // b) clang -O1 -ftsan takes ~26s to start N=500 threads, // eats 5GB more RAM than N=1 (which is somewhat expected but still a lot) // but then it consumes ~4GB of extra memory when the threads shut down! // (definitely not in the barrier_wait interceptor) // Also, it takes 26s to run with N=500 vs just 1.1s to run with N=1. #include #include #include #include #include pthread_barrier_t all_threads_ready; void* Thread(void *unused) { pthread_barrier_wait(&all_threads_ready); return 0; } int main(int argc, char **argv) { int n_threads; if (argc == 1) { n_threads = 100; } else if (argc == 2) { n_threads = atoi(argv[1]); } else { printf("Usage: %s n_threads\n", argv[0]); return 1; } printf("%s: n_threads=%d\n", __FILE__, n_threads); pthread_barrier_init(&all_threads_ready, NULL, n_threads + 1); pthread_t *t = new pthread_t[n_threads]; for (int i = 0; i < n_threads; i++) { int status = pthread_create(&t[i], 0, Thread, (void*)i); assert(status == 0); } // sleep(5); // FIXME: simplify measuring the memory usage. pthread_barrier_wait(&all_threads_ready); for (int i = 0; i < n_threads; i++) { pthread_join(t[i], 0); } // sleep(5); // FIXME: simplify measuring the memory usage. delete [] t; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/benchmarks/mini_bench_shared.cc0000664000175000017500000000214611752747056031002 0ustar mwhudsonmwhudson// Mini-benchmark for tsan: shared memory reads. #include #include #include #include int len; int *a; const int kNumIter = 1000; __attribute__((noinline)) void Run(int idx) { for (int i = 0, n = len; i < n; i++) if (a[i] != i) abort(); } void *Thread(void *arg) { long idx = (long)arg; printf("Thread %ld started\n", idx); for (int i = 0; i < kNumIter; i++) Run(idx); printf("Thread %ld done\n", idx); return 0; } int main(int argc, char **argv) { int n_threads = 0; if (argc != 3) { n_threads = 4; len = 1000000; } else { n_threads = atoi(argv[1]); assert(n_threads > 0 && n_threads <= 32); len = atoi(argv[2]); } printf("%s: n_threads=%d len=%d iter=%d\n", __FILE__, n_threads, len, kNumIter); a = new int[len]; for (int i = 0, n = len; i < n; i++) a[i] = i; pthread_t *t = new pthread_t[n_threads]; for (int i = 0; i < n_threads; i++) { pthread_create(&t[i], 0, Thread, (void*)i); } for (int i = 0; i < n_threads; i++) { pthread_join(t[i], 0); } delete [] t; delete [] a; return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/check_analyze.sh0000775000175000017500000000163212712127315026056 0ustar mwhudsonmwhudson#!/bin/bash # # Script that checks that critical functions in TSan runtime have correct number # of push/pop/rsp instructions to verify that runtime is efficient enough. set -u if [[ "$#" != 1 ]]; then echo "Usage: $0 /path/to/binary/built/with/tsan" exit 1 fi SCRIPTDIR=$(dirname $0) RES=$(${SCRIPTDIR}/analyze_libtsan.sh $1) PrintRes() { printf "%s\n" "$RES" } PrintRes check() { res=$(PrintRes | egrep "$1 .* $2 $3; ") if [ "$res" == "" ]; then echo FAILED $1 must contain $2 $3 exit 1 fi } for f in write1; do check $f rsp 1 check $f push 2 check $f pop 2 done for f in write2 write4 write8; do check $f rsp 1 check $f push 3 check $f pop 3 done for f in read1 read2 read4 read8; do check $f rsp 1 check $f push 5 check $f pop 5 done for f in func_entry func_exit; do check $f rsp 0 check $f push 0 check $f pop 0 check $f call 1 # TraceSwitch() done echo LGTM golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/0000775000175000017500000000000013040224626023514 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interceptors_mac.cc0000664000175000017500000003515212764235070030426 0ustar mwhudsonmwhudson//===-- tsan_interceptors_mac.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Mac-specific interceptors. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "interception/interception.h" #include "tsan_interceptors.h" #include "tsan_interface.h" #include "tsan_interface_ann.h" #include #include typedef long long_t; // NOLINT namespace __tsan { // The non-barrier versions of OSAtomic* functions are semantically mo_relaxed, // but the two variants (e.g. OSAtomicAdd32 and OSAtomicAdd32Barrier) are // actually aliases of each other, and we cannot have different interceptors for // them, because they're actually the same function. Thus, we have to stay // conservative and treat the non-barrier versions as mo_acq_rel. static const morder kMacOrderBarrier = mo_acq_rel; static const morder kMacOrderNonBarrier = mo_acq_rel; #define OSATOMIC_INTERCEPTOR(return_t, t, tsan_t, f, tsan_atomic_f, mo) \ TSAN_INTERCEPTOR(return_t, f, t x, volatile t *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f, x, ptr); \ return tsan_atomic_f((volatile tsan_t *)ptr, x, mo); \ } #define OSATOMIC_INTERCEPTOR_PLUS_X(return_t, t, tsan_t, f, tsan_atomic_f, mo) \ TSAN_INTERCEPTOR(return_t, f, t x, volatile t *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f, x, ptr); \ return tsan_atomic_f((volatile tsan_t *)ptr, x, mo) + x; \ } #define OSATOMIC_INTERCEPTOR_PLUS_1(return_t, t, tsan_t, f, tsan_atomic_f, mo) \ TSAN_INTERCEPTOR(return_t, f, volatile t *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f, ptr); \ return tsan_atomic_f((volatile tsan_t *)ptr, 1, mo) + 1; \ } #define OSATOMIC_INTERCEPTOR_MINUS_1(return_t, t, tsan_t, f, tsan_atomic_f, \ mo) \ TSAN_INTERCEPTOR(return_t, f, volatile t *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f, ptr); \ return tsan_atomic_f((volatile tsan_t *)ptr, 1, mo) - 1; \ } #define OSATOMIC_INTERCEPTORS_ARITHMETIC(f, tsan_atomic_f, m) \ m(int32_t, int32_t, a32, f##32, __tsan_atomic32_##tsan_atomic_f, \ kMacOrderNonBarrier) \ m(int32_t, int32_t, a32, f##32##Barrier, __tsan_atomic32_##tsan_atomic_f, \ kMacOrderBarrier) \ m(int64_t, int64_t, a64, f##64, __tsan_atomic64_##tsan_atomic_f, \ kMacOrderNonBarrier) \ m(int64_t, int64_t, a64, f##64##Barrier, __tsan_atomic64_##tsan_atomic_f, \ kMacOrderBarrier) #define OSATOMIC_INTERCEPTORS_BITWISE(f, tsan_atomic_f, m, m_orig) \ m(int32_t, uint32_t, a32, f##32, __tsan_atomic32_##tsan_atomic_f, \ kMacOrderNonBarrier) \ m(int32_t, uint32_t, a32, f##32##Barrier, __tsan_atomic32_##tsan_atomic_f, \ kMacOrderBarrier) \ m_orig(int32_t, uint32_t, a32, f##32##Orig, __tsan_atomic32_##tsan_atomic_f, \ kMacOrderNonBarrier) \ m_orig(int32_t, uint32_t, a32, f##32##OrigBarrier, \ __tsan_atomic32_##tsan_atomic_f, kMacOrderBarrier) OSATOMIC_INTERCEPTORS_ARITHMETIC(OSAtomicAdd, fetch_add, OSATOMIC_INTERCEPTOR_PLUS_X) OSATOMIC_INTERCEPTORS_ARITHMETIC(OSAtomicIncrement, fetch_add, OSATOMIC_INTERCEPTOR_PLUS_1) OSATOMIC_INTERCEPTORS_ARITHMETIC(OSAtomicDecrement, fetch_sub, OSATOMIC_INTERCEPTOR_MINUS_1) OSATOMIC_INTERCEPTORS_BITWISE(OSAtomicOr, fetch_or, OSATOMIC_INTERCEPTOR_PLUS_X, OSATOMIC_INTERCEPTOR) OSATOMIC_INTERCEPTORS_BITWISE(OSAtomicAnd, fetch_and, OSATOMIC_INTERCEPTOR_PLUS_X, OSATOMIC_INTERCEPTOR) OSATOMIC_INTERCEPTORS_BITWISE(OSAtomicXor, fetch_xor, OSATOMIC_INTERCEPTOR_PLUS_X, OSATOMIC_INTERCEPTOR) #define OSATOMIC_INTERCEPTORS_CAS(f, tsan_atomic_f, tsan_t, t) \ TSAN_INTERCEPTOR(bool, f, t old_value, t new_value, t volatile *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f, old_value, new_value, ptr); \ return tsan_atomic_f##_compare_exchange_strong( \ (tsan_t *)ptr, (tsan_t *)&old_value, (tsan_t)new_value, \ kMacOrderNonBarrier, kMacOrderNonBarrier); \ } \ \ TSAN_INTERCEPTOR(bool, f##Barrier, t old_value, t new_value, \ t volatile *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f##Barrier, old_value, new_value, ptr); \ return tsan_atomic_f##_compare_exchange_strong( \ (tsan_t *)ptr, (tsan_t *)&old_value, (tsan_t)new_value, \ kMacOrderBarrier, kMacOrderNonBarrier); \ } OSATOMIC_INTERCEPTORS_CAS(OSAtomicCompareAndSwapInt, __tsan_atomic32, a32, int) OSATOMIC_INTERCEPTORS_CAS(OSAtomicCompareAndSwapLong, __tsan_atomic64, a64, long_t) OSATOMIC_INTERCEPTORS_CAS(OSAtomicCompareAndSwapPtr, __tsan_atomic64, a64, void *) OSATOMIC_INTERCEPTORS_CAS(OSAtomicCompareAndSwap32, __tsan_atomic32, a32, int32_t) OSATOMIC_INTERCEPTORS_CAS(OSAtomicCompareAndSwap64, __tsan_atomic64, a64, int64_t) #define OSATOMIC_INTERCEPTOR_BITOP(f, op, clear, mo) \ TSAN_INTERCEPTOR(bool, f, uint32_t n, volatile void *ptr) { \ SCOPED_TSAN_INTERCEPTOR(f, n, ptr); \ char *byte_ptr = ((char *)ptr) + (n >> 3); \ char bit = 0x80u >> (n & 7); \ char mask = clear ? ~bit : bit; \ char orig_byte = op((a8 *)byte_ptr, mask, mo); \ return orig_byte & bit; \ } #define OSATOMIC_INTERCEPTORS_BITOP(f, op, clear) \ OSATOMIC_INTERCEPTOR_BITOP(f, op, clear, kMacOrderNonBarrier) \ OSATOMIC_INTERCEPTOR_BITOP(f##Barrier, op, clear, kMacOrderBarrier) OSATOMIC_INTERCEPTORS_BITOP(OSAtomicTestAndSet, __tsan_atomic8_fetch_or, false) OSATOMIC_INTERCEPTORS_BITOP(OSAtomicTestAndClear, __tsan_atomic8_fetch_and, true) TSAN_INTERCEPTOR(void, OSAtomicEnqueue, OSQueueHead *list, void *item, size_t offset) { SCOPED_TSAN_INTERCEPTOR(OSAtomicEnqueue, list, item, offset); __tsan_release(item); REAL(OSAtomicEnqueue)(list, item, offset); } TSAN_INTERCEPTOR(void *, OSAtomicDequeue, OSQueueHead *list, size_t offset) { SCOPED_TSAN_INTERCEPTOR(OSAtomicDequeue, list, offset); void *item = REAL(OSAtomicDequeue)(list, offset); if (item) __tsan_acquire(item); return item; } // OSAtomicFifoEnqueue and OSAtomicFifoDequeue are only on OS X. #if !SANITIZER_IOS TSAN_INTERCEPTOR(void, OSAtomicFifoEnqueue, OSFifoQueueHead *list, void *item, size_t offset) { SCOPED_TSAN_INTERCEPTOR(OSAtomicFifoEnqueue, list, item, offset); __tsan_release(item); REAL(OSAtomicFifoEnqueue)(list, item, offset); } TSAN_INTERCEPTOR(void *, OSAtomicFifoDequeue, OSFifoQueueHead *list, size_t offset) { SCOPED_TSAN_INTERCEPTOR(OSAtomicFifoDequeue, list, offset); void *item = REAL(OSAtomicFifoDequeue)(list, offset); if (item) __tsan_acquire(item); return item; } #endif TSAN_INTERCEPTOR(void, OSSpinLockLock, volatile OSSpinLock *lock) { CHECK(!cur_thread()->is_dead); if (!cur_thread()->is_inited) { return REAL(OSSpinLockLock)(lock); } SCOPED_TSAN_INTERCEPTOR(OSSpinLockLock, lock); REAL(OSSpinLockLock)(lock); Acquire(thr, pc, (uptr)lock); } TSAN_INTERCEPTOR(bool, OSSpinLockTry, volatile OSSpinLock *lock) { CHECK(!cur_thread()->is_dead); if (!cur_thread()->is_inited) { return REAL(OSSpinLockTry)(lock); } SCOPED_TSAN_INTERCEPTOR(OSSpinLockTry, lock); bool result = REAL(OSSpinLockTry)(lock); if (result) Acquire(thr, pc, (uptr)lock); return result; } TSAN_INTERCEPTOR(void, OSSpinLockUnlock, volatile OSSpinLock *lock) { CHECK(!cur_thread()->is_dead); if (!cur_thread()->is_inited) { return REAL(OSSpinLockUnlock)(lock); } SCOPED_TSAN_INTERCEPTOR(OSSpinLockUnlock, lock); Release(thr, pc, (uptr)lock); REAL(OSSpinLockUnlock)(lock); } TSAN_INTERCEPTOR(void, os_lock_lock, void *lock) { CHECK(!cur_thread()->is_dead); if (!cur_thread()->is_inited) { return REAL(os_lock_lock)(lock); } SCOPED_TSAN_INTERCEPTOR(os_lock_lock, lock); REAL(os_lock_lock)(lock); Acquire(thr, pc, (uptr)lock); } TSAN_INTERCEPTOR(bool, os_lock_trylock, void *lock) { CHECK(!cur_thread()->is_dead); if (!cur_thread()->is_inited) { return REAL(os_lock_trylock)(lock); } SCOPED_TSAN_INTERCEPTOR(os_lock_trylock, lock); bool result = REAL(os_lock_trylock)(lock); if (result) Acquire(thr, pc, (uptr)lock); return result; } TSAN_INTERCEPTOR(void, os_lock_unlock, void *lock) { CHECK(!cur_thread()->is_dead); if (!cur_thread()->is_inited) { return REAL(os_lock_unlock)(lock); } SCOPED_TSAN_INTERCEPTOR(os_lock_unlock, lock); Release(thr, pc, (uptr)lock); REAL(os_lock_unlock)(lock); } TSAN_INTERCEPTOR(void, xpc_connection_set_event_handler, xpc_connection_t connection, xpc_handler_t handler) { SCOPED_TSAN_INTERCEPTOR(xpc_connection_set_event_handler, connection, handler); Release(thr, pc, (uptr)connection); xpc_handler_t new_handler = ^(xpc_object_t object) { { SCOPED_INTERCEPTOR_RAW(xpc_connection_set_event_handler); Acquire(thr, pc, (uptr)connection); } handler(object); }; REAL(xpc_connection_set_event_handler)(connection, new_handler); } TSAN_INTERCEPTOR(void, xpc_connection_send_barrier, xpc_connection_t connection, dispatch_block_t barrier) { SCOPED_TSAN_INTERCEPTOR(xpc_connection_send_barrier, connection, barrier); Release(thr, pc, (uptr)connection); dispatch_block_t new_barrier = ^() { { SCOPED_INTERCEPTOR_RAW(xpc_connection_send_barrier); Acquire(thr, pc, (uptr)connection); } barrier(); }; REAL(xpc_connection_send_barrier)(connection, new_barrier); } TSAN_INTERCEPTOR(void, xpc_connection_send_message_with_reply, xpc_connection_t connection, xpc_object_t message, dispatch_queue_t replyq, xpc_handler_t handler) { SCOPED_TSAN_INTERCEPTOR(xpc_connection_send_message_with_reply, connection, message, replyq, handler); Release(thr, pc, (uptr)connection); xpc_handler_t new_handler = ^(xpc_object_t object) { { SCOPED_INTERCEPTOR_RAW(xpc_connection_send_message_with_reply); Acquire(thr, pc, (uptr)connection); } handler(object); }; REAL(xpc_connection_send_message_with_reply) (connection, message, replyq, new_handler); } // On macOS, libc++ is always linked dynamically, so intercepting works the // usual way. #define STDCXX_INTERCEPTOR TSAN_INTERCEPTOR namespace { struct fake_shared_weak_count { volatile a64 shared_owners; volatile a64 shared_weak_owners; virtual void _unused_0x0() = 0; virtual void _unused_0x8() = 0; virtual void on_zero_shared() = 0; virtual void _unused_0x18() = 0; virtual void on_zero_shared_weak() = 0; }; } // namespace // This adds a libc++ interceptor for: // void __shared_weak_count::__release_shared() _NOEXCEPT; // Shared and weak pointers in C++ maintain reference counts via atomics in // libc++.dylib, which are TSan-invisible, and this leads to false positives in // destructor code. This interceptor re-implements the whole function so that // the mo_acq_rel semantics of the atomic decrement are visible. // // Unfortunately, this interceptor cannot simply Acquire/Release some sync // object and call the original function, because it would have a race between // the sync and the destruction of the object. Calling both under a lock will // not work because the destructor can invoke this interceptor again (and even // in a different thread, so recursive locks don't help). STDCXX_INTERCEPTOR(void, _ZNSt3__119__shared_weak_count16__release_sharedEv, fake_shared_weak_count *o) { if (!flags()->shared_ptr_interceptor) return REAL(_ZNSt3__119__shared_weak_count16__release_sharedEv)(o); SCOPED_TSAN_INTERCEPTOR(_ZNSt3__119__shared_weak_count16__release_sharedEv, o); if (__tsan_atomic64_fetch_add(&o->shared_owners, -1, mo_release) == 0) { Acquire(thr, pc, (uptr)&o->shared_owners); o->on_zero_shared(); if (__tsan_atomic64_fetch_add(&o->shared_weak_owners, -1, mo_release) == 0) { Acquire(thr, pc, (uptr)&o->shared_weak_owners); o->on_zero_shared_weak(); } } } namespace { struct call_once_callback_args { void (*orig_func)(void *arg); void *orig_arg; void *flag; }; void call_once_callback_wrapper(void *arg) { call_once_callback_args *new_args = (call_once_callback_args *)arg; new_args->orig_func(new_args->orig_arg); __tsan_release(new_args->flag); } } // namespace // This adds a libc++ interceptor for: // void __call_once(volatile unsigned long&, void*, void(*)(void*)); // C++11 call_once is implemented via an internal function __call_once which is // inside libc++.dylib, and the atomic release store inside it is thus // TSan-invisible. To avoid false positives, this interceptor wraps the callback // function and performs an explicit Release after the user code has run. STDCXX_INTERCEPTOR(void, _ZNSt3__111__call_onceERVmPvPFvS2_E, void *flag, void *arg, void (*func)(void *arg)) { call_once_callback_args new_args = {func, arg, flag}; REAL(_ZNSt3__111__call_onceERVmPvPFvS2_E)(flag, &new_args, call_once_callback_wrapper); } } // namespace __tsan #endif // SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl.cc0000664000175000017500000010074513004741015025654 0ustar mwhudsonmwhudson//===-- tsan_rtl.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Main file (entry points) for the TSan run-time. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include "tsan_defs.h" #include "tsan_platform.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "tsan_suppressions.h" #include "tsan_symbolize.h" #include "ubsan/ubsan_init.h" #ifdef __SSE3__ // transitively includes , // and it's prohibited to include std headers into tsan runtime. // So we do this dirty trick. #define _MM_MALLOC_H_INCLUDED #define __MM_MALLOC_H #include typedef __m128i m128; #endif volatile int __tsan_resumed = 0; extern "C" void __tsan_resume() { __tsan_resumed = 1; } namespace __tsan { #if !SANITIZER_GO && !SANITIZER_MAC THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64); #endif static char ctx_placeholder[sizeof(Context)] ALIGNED(64); Context *ctx; // Can be overriden by a front-end. #ifdef TSAN_EXTERNAL_HOOKS bool OnFinalize(bool failed); void OnInitialize(); #else SANITIZER_WEAK_CXX_DEFAULT_IMPL bool OnFinalize(bool failed) { return failed; } SANITIZER_WEAK_CXX_DEFAULT_IMPL void OnInitialize() {} #endif static char thread_registry_placeholder[sizeof(ThreadRegistry)]; static ThreadContextBase *CreateThreadContext(u32 tid) { // Map thread trace when context is created. char name[50]; internal_snprintf(name, sizeof(name), "trace %u", tid); MapThreadTrace(GetThreadTrace(tid), TraceSize() * sizeof(Event), name); const uptr hdr = GetThreadTraceHeader(tid); internal_snprintf(name, sizeof(name), "trace header %u", tid); MapThreadTrace(hdr, sizeof(Trace), name); new((void*)hdr) Trace(); // We are going to use only a small part of the trace with the default // value of history_size. However, the constructor writes to the whole trace. // Unmap the unused part. uptr hdr_end = hdr + sizeof(Trace); hdr_end -= sizeof(TraceHeader) * (kTraceParts - TraceParts()); hdr_end = RoundUp(hdr_end, GetPageSizeCached()); if (hdr_end < hdr + sizeof(Trace)) UnmapOrDie((void*)hdr_end, hdr + sizeof(Trace) - hdr_end); void *mem = internal_alloc(MBlockThreadContex, sizeof(ThreadContext)); return new(mem) ThreadContext(tid); } #if !SANITIZER_GO static const u32 kThreadQuarantineSize = 16; #else static const u32 kThreadQuarantineSize = 64; #endif Context::Context() : initialized() , report_mtx(MutexTypeReport, StatMtxReport) , nreported() , nmissed_expected() , thread_registry(new(thread_registry_placeholder) ThreadRegistry( CreateThreadContext, kMaxTid, kThreadQuarantineSize, kMaxTidReuse)) , racy_mtx(MutexTypeRacy, StatMtxRacy) , racy_stacks(MBlockRacyStacks) , racy_addresses(MBlockRacyAddresses) , fired_suppressions_mtx(MutexTypeFired, StatMtxFired) , fired_suppressions(8) { } // The objects are allocated in TLS, so one may rely on zero-initialization. ThreadState::ThreadState(Context *ctx, int tid, int unique_id, u64 epoch, unsigned reuse_count, uptr stk_addr, uptr stk_size, uptr tls_addr, uptr tls_size) : fast_state(tid, epoch) // Do not touch these, rely on zero initialization, // they may be accessed before the ctor. // , ignore_reads_and_writes() // , ignore_interceptors() , clock(tid, reuse_count) #if !SANITIZER_GO , jmp_bufs(MBlockJmpBuf) #endif , tid(tid) , unique_id(unique_id) , stk_addr(stk_addr) , stk_size(stk_size) , tls_addr(tls_addr) , tls_size(tls_size) #if !SANITIZER_GO , last_sleep_clock(tid) #endif { } #if !SANITIZER_GO static void MemoryProfiler(Context *ctx, fd_t fd, int i) { uptr n_threads; uptr n_running_threads; ctx->thread_registry->GetNumberOfThreads(&n_threads, &n_running_threads); InternalScopedBuffer buf(4096); WriteMemoryProfile(buf.data(), buf.size(), n_threads, n_running_threads); WriteToFile(fd, buf.data(), internal_strlen(buf.data())); } static void BackgroundThread(void *arg) { // This is a non-initialized non-user thread, nothing to see here. // We don't use ScopedIgnoreInterceptors, because we want ignores to be // enabled even when the thread function exits (e.g. during pthread thread // shutdown code). cur_thread()->ignore_interceptors++; const u64 kMs2Ns = 1000 * 1000; fd_t mprof_fd = kInvalidFd; if (flags()->profile_memory && flags()->profile_memory[0]) { if (internal_strcmp(flags()->profile_memory, "stdout") == 0) { mprof_fd = 1; } else if (internal_strcmp(flags()->profile_memory, "stderr") == 0) { mprof_fd = 2; } else { InternalScopedString filename(kMaxPathLength); filename.append("%s.%d", flags()->profile_memory, (int)internal_getpid()); fd_t fd = OpenFile(filename.data(), WrOnly); if (fd == kInvalidFd) { Printf("ThreadSanitizer: failed to open memory profile file '%s'\n", &filename[0]); } else { mprof_fd = fd; } } } u64 last_flush = NanoTime(); uptr last_rss = 0; for (int i = 0; atomic_load(&ctx->stop_background_thread, memory_order_relaxed) == 0; i++) { SleepForMillis(100); u64 now = NanoTime(); // Flush memory if requested. if (flags()->flush_memory_ms > 0) { if (last_flush + flags()->flush_memory_ms * kMs2Ns < now) { VPrintf(1, "ThreadSanitizer: periodic memory flush\n"); FlushShadowMemory(); last_flush = NanoTime(); } } // GetRSS can be expensive on huge programs, so don't do it every 100ms. if (flags()->memory_limit_mb > 0) { uptr rss = GetRSS(); uptr limit = uptr(flags()->memory_limit_mb) << 20; VPrintf(1, "ThreadSanitizer: memory flush check" " RSS=%llu LAST=%llu LIMIT=%llu\n", (u64)rss >> 20, (u64)last_rss >> 20, (u64)limit >> 20); if (2 * rss > limit + last_rss) { VPrintf(1, "ThreadSanitizer: flushing memory due to RSS\n"); FlushShadowMemory(); rss = GetRSS(); VPrintf(1, "ThreadSanitizer: memory flushed RSS=%llu\n", (u64)rss>>20); } last_rss = rss; } // Write memory profile if requested. if (mprof_fd != kInvalidFd) MemoryProfiler(ctx, mprof_fd, i); // Flush symbolizer cache if requested. if (flags()->flush_symbolizer_ms > 0) { u64 last = atomic_load(&ctx->last_symbolize_time_ns, memory_order_relaxed); if (last != 0 && last + flags()->flush_symbolizer_ms * kMs2Ns < now) { Lock l(&ctx->report_mtx); SpinMutexLock l2(&CommonSanitizerReportMutex); SymbolizeFlush(); atomic_store(&ctx->last_symbolize_time_ns, 0, memory_order_relaxed); } } } } static void StartBackgroundThread() { ctx->background_thread = internal_start_thread(&BackgroundThread, 0); } #ifndef __mips__ static void StopBackgroundThread() { atomic_store(&ctx->stop_background_thread, 1, memory_order_relaxed); internal_join_thread(ctx->background_thread); ctx->background_thread = 0; } #endif #endif void DontNeedShadowFor(uptr addr, uptr size) { uptr shadow_beg = MemToShadow(addr); uptr shadow_end = MemToShadow(addr + size); ReleaseMemoryToOS(shadow_beg, shadow_end - shadow_beg); } void MapShadow(uptr addr, uptr size) { // Global data is not 64K aligned, but there are no adjacent mappings, // so we can get away with unaligned mapping. // CHECK_EQ(addr, addr & ~((64 << 10) - 1)); // windows wants 64K alignment const uptr kPageSize = GetPageSizeCached(); uptr shadow_begin = RoundDownTo((uptr)MemToShadow(addr), kPageSize); uptr shadow_end = RoundUpTo((uptr)MemToShadow(addr + size), kPageSize); MmapFixedNoReserve(shadow_begin, shadow_end - shadow_begin, "shadow"); // Meta shadow is 2:1, so tread carefully. static bool data_mapped = false; static uptr mapped_meta_end = 0; uptr meta_begin = (uptr)MemToMeta(addr); uptr meta_end = (uptr)MemToMeta(addr + size); meta_begin = RoundDownTo(meta_begin, 64 << 10); meta_end = RoundUpTo(meta_end, 64 << 10); if (!data_mapped) { // First call maps data+bss. data_mapped = true; MmapFixedNoReserve(meta_begin, meta_end - meta_begin, "meta shadow"); } else { // Mapping continous heap. // Windows wants 64K alignment. meta_begin = RoundDownTo(meta_begin, 64 << 10); meta_end = RoundUpTo(meta_end, 64 << 10); if (meta_end <= mapped_meta_end) return; if (meta_begin < mapped_meta_end) meta_begin = mapped_meta_end; MmapFixedNoReserve(meta_begin, meta_end - meta_begin, "meta shadow"); mapped_meta_end = meta_end; } VPrintf(2, "mapped meta shadow for (%p-%p) at (%p-%p)\n", addr, addr+size, meta_begin, meta_end); } void MapThreadTrace(uptr addr, uptr size, const char *name) { DPrintf("#0: Mapping trace at %p-%p(0x%zx)\n", addr, addr + size, size); CHECK_GE(addr, TraceMemBeg()); CHECK_LE(addr + size, TraceMemEnd()); CHECK_EQ(addr, addr & ~((64 << 10) - 1)); // windows wants 64K alignment uptr addr1 = (uptr)MmapFixedNoReserve(addr, size, name); if (addr1 != addr) { Printf("FATAL: ThreadSanitizer can not mmap thread trace (%p/%p->%p)\n", addr, size, addr1); Die(); } } static void CheckShadowMapping() { uptr beg, end; for (int i = 0; GetUserRegion(i, &beg, &end); i++) { // Skip cases for empty regions (heap definition for architectures that // do not use 64-bit allocator). if (beg == end) continue; VPrintf(3, "checking shadow region %p-%p\n", beg, end); uptr prev = 0; for (uptr p0 = beg; p0 <= end; p0 += (end - beg) / 4) { for (int x = -(int)kShadowCell; x <= (int)kShadowCell; x += kShadowCell) { const uptr p = RoundDown(p0 + x, kShadowCell); if (p < beg || p >= end) continue; const uptr s = MemToShadow(p); const uptr m = (uptr)MemToMeta(p); VPrintf(3, " checking pointer %p: shadow=%p meta=%p\n", p, s, m); CHECK(IsAppMem(p)); CHECK(IsShadowMem(s)); CHECK_EQ(p, ShadowToMem(s)); CHECK(IsMetaMem(m)); if (prev) { // Ensure that shadow and meta mappings are linear within a single // user range. Lots of code that processes memory ranges assumes it. const uptr prev_s = MemToShadow(prev); const uptr prev_m = (uptr)MemToMeta(prev); CHECK_EQ(s - prev_s, (p - prev) * kShadowMultiplier); CHECK_EQ((m - prev_m) / kMetaShadowSize, (p - prev) / kMetaShadowCell); } prev = p; } } } } void Initialize(ThreadState *thr) { // Thread safe because done before all threads exist. static bool is_initialized = false; if (is_initialized) return; is_initialized = true; // We are not ready to handle interceptors yet. ScopedIgnoreInterceptors ignore; SanitizerToolName = "ThreadSanitizer"; // Install tool-specific callbacks in sanitizer_common. SetCheckFailedCallback(TsanCheckFailed); ctx = new(ctx_placeholder) Context; const char *options = GetEnv(SANITIZER_GO ? "GORACE" : "TSAN_OPTIONS"); CacheBinaryName(); InitializeFlags(&ctx->flags, options); AvoidCVE_2016_2143(); InitializePlatformEarly(); #if !SANITIZER_GO // Re-exec ourselves if we need to set additional env or command line args. MaybeReexec(); InitializeAllocator(); ReplaceSystemMalloc(); #endif if (common_flags()->detect_deadlocks) ctx->dd = DDetector::Create(flags()); Processor *proc = ProcCreate(); ProcWire(proc, thr); InitializeInterceptors(); CheckShadowMapping(); InitializePlatform(); InitializeMutex(); InitializeDynamicAnnotations(); #if !SANITIZER_GO InitializeShadowMemory(); InitializeAllocatorLate(); #endif // Setup correct file descriptor for error reports. __sanitizer_set_report_path(common_flags()->log_path); InitializeSuppressions(); #if !SANITIZER_GO InitializeLibIgnore(); Symbolizer::GetOrInit()->AddHooks(EnterSymbolizer, ExitSymbolizer); // On MIPS, TSan initialization is run before // __pthread_initialize_minimal_internal() is finished, so we can not spawn // new threads. #ifndef __mips__ StartBackgroundThread(); SetSandboxingCallback(StopBackgroundThread); #endif #endif VPrintf(1, "***** Running under ThreadSanitizer v2 (pid %d) *****\n", (int)internal_getpid()); // Initialize thread 0. int tid = ThreadCreate(thr, 0, 0, true); CHECK_EQ(tid, 0); ThreadStart(thr, tid, internal_getpid()); #if TSAN_CONTAINS_UBSAN __ubsan::InitAsPlugin(); #endif ctx->initialized = true; #if !SANITIZER_GO Symbolizer::LateInitialize(); #endif if (flags()->stop_on_start) { Printf("ThreadSanitizer is suspended at startup (pid %d)." " Call __tsan_resume().\n", (int)internal_getpid()); while (__tsan_resumed == 0) {} } OnInitialize(); } int Finalize(ThreadState *thr) { bool failed = false; if (flags()->atexit_sleep_ms > 0 && ThreadCount(thr) > 1) SleepForMillis(flags()->atexit_sleep_ms); // Wait for pending reports. ctx->report_mtx.Lock(); CommonSanitizerReportMutex.Lock(); CommonSanitizerReportMutex.Unlock(); ctx->report_mtx.Unlock(); #if !SANITIZER_GO if (Verbosity()) AllocatorPrintStats(); #endif ThreadFinalize(thr); if (ctx->nreported) { failed = true; #if !SANITIZER_GO Printf("ThreadSanitizer: reported %d warnings\n", ctx->nreported); #else Printf("Found %d data race(s)\n", ctx->nreported); #endif } if (ctx->nmissed_expected) { failed = true; Printf("ThreadSanitizer: missed %d expected races\n", ctx->nmissed_expected); } if (common_flags()->print_suppressions) PrintMatchedSuppressions(); #if !SANITIZER_GO if (flags()->print_benign) PrintMatchedBenignRaces(); #endif failed = OnFinalize(failed); #if TSAN_COLLECT_STATS StatAggregate(ctx->stat, thr->stat); StatOutput(ctx->stat); #endif return failed ? common_flags()->exitcode : 0; } #if !SANITIZER_GO void ForkBefore(ThreadState *thr, uptr pc) { ctx->thread_registry->Lock(); ctx->report_mtx.Lock(); } void ForkParentAfter(ThreadState *thr, uptr pc) { ctx->report_mtx.Unlock(); ctx->thread_registry->Unlock(); } void ForkChildAfter(ThreadState *thr, uptr pc) { ctx->report_mtx.Unlock(); ctx->thread_registry->Unlock(); uptr nthread = 0; ctx->thread_registry->GetNumberOfThreads(0, 0, &nthread /* alive threads */); VPrintf(1, "ThreadSanitizer: forked new process with pid %d," " parent had %d threads\n", (int)internal_getpid(), (int)nthread); if (nthread == 1) { StartBackgroundThread(); } else { // We've just forked a multi-threaded process. We cannot reasonably function // after that (some mutexes may be locked before fork). So just enable // ignores for everything in the hope that we will exec soon. ctx->after_multithreaded_fork = true; thr->ignore_interceptors++; ThreadIgnoreBegin(thr, pc); ThreadIgnoreSyncBegin(thr, pc); } } #endif #if SANITIZER_GO NOINLINE void GrowShadowStack(ThreadState *thr) { const int sz = thr->shadow_stack_end - thr->shadow_stack; const int newsz = 2 * sz; uptr *newstack = (uptr*)internal_alloc(MBlockShadowStack, newsz * sizeof(uptr)); internal_memcpy(newstack, thr->shadow_stack, sz * sizeof(uptr)); internal_free(thr->shadow_stack); thr->shadow_stack = newstack; thr->shadow_stack_pos = newstack + sz; thr->shadow_stack_end = newstack + newsz; } #endif u32 CurrentStackId(ThreadState *thr, uptr pc) { if (!thr->is_inited) // May happen during bootstrap. return 0; if (pc != 0) { #if !SANITIZER_GO DCHECK_LT(thr->shadow_stack_pos, thr->shadow_stack_end); #else if (thr->shadow_stack_pos == thr->shadow_stack_end) GrowShadowStack(thr); #endif thr->shadow_stack_pos[0] = pc; thr->shadow_stack_pos++; } u32 id = StackDepotPut( StackTrace(thr->shadow_stack, thr->shadow_stack_pos - thr->shadow_stack)); if (pc != 0) thr->shadow_stack_pos--; return id; } void TraceSwitch(ThreadState *thr) { thr->nomalloc++; Trace *thr_trace = ThreadTrace(thr->tid); Lock l(&thr_trace->mtx); unsigned trace = (thr->fast_state.epoch() / kTracePartSize) % TraceParts(); TraceHeader *hdr = &thr_trace->headers[trace]; hdr->epoch0 = thr->fast_state.epoch(); ObtainCurrentStack(thr, 0, &hdr->stack0); hdr->mset0 = thr->mset; thr->nomalloc--; } Trace *ThreadTrace(int tid) { return (Trace*)GetThreadTraceHeader(tid); } uptr TraceTopPC(ThreadState *thr) { Event *events = (Event*)GetThreadTrace(thr->tid); uptr pc = events[thr->fast_state.GetTracePos()]; return pc; } uptr TraceSize() { return (uptr)(1ull << (kTracePartSizeBits + flags()->history_size + 1)); } uptr TraceParts() { return TraceSize() / kTracePartSize; } #if !SANITIZER_GO extern "C" void __tsan_trace_switch() { TraceSwitch(cur_thread()); } extern "C" void __tsan_report_race() { ReportRace(cur_thread()); } #endif ALWAYS_INLINE Shadow LoadShadow(u64 *p) { u64 raw = atomic_load((atomic_uint64_t*)p, memory_order_relaxed); return Shadow(raw); } ALWAYS_INLINE void StoreShadow(u64 *sp, u64 s) { atomic_store((atomic_uint64_t*)sp, s, memory_order_relaxed); } ALWAYS_INLINE void StoreIfNotYetStored(u64 *sp, u64 *s) { StoreShadow(sp, *s); *s = 0; } ALWAYS_INLINE void HandleRace(ThreadState *thr, u64 *shadow_mem, Shadow cur, Shadow old) { thr->racy_state[0] = cur.raw(); thr->racy_state[1] = old.raw(); thr->racy_shadow_addr = shadow_mem; #if !SANITIZER_GO HACKY_CALL(__tsan_report_race); #else ReportRace(thr); #endif } static inline bool HappensBefore(Shadow old, ThreadState *thr) { return thr->clock.get(old.TidWithIgnore()) >= old.epoch(); } ALWAYS_INLINE void MemoryAccessImpl1(ThreadState *thr, uptr addr, int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic, u64 *shadow_mem, Shadow cur) { StatInc(thr, StatMop); StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead); StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog)); // This potentially can live in an MMX/SSE scratch register. // The required intrinsics are: // __m128i _mm_move_epi64(__m128i*); // _mm_storel_epi64(u64*, __m128i); u64 store_word = cur.raw(); // scan all the shadow values and dispatch to 4 categories: // same, replace, candidate and race (see comments below). // we consider only 3 cases regarding access sizes: // equal, intersect and not intersect. initially I considered // larger and smaller as well, it allowed to replace some // 'candidates' with 'same' or 'replace', but I think // it's just not worth it (performance- and complexity-wise). Shadow old(0); // It release mode we manually unroll the loop, // because empirically gcc generates better code this way. // However, we can't afford unrolling in debug mode, because the function // consumes almost 4K of stack. Gtest gives only 4K of stack to death test // threads, which is not enough for the unrolled loop. #if SANITIZER_DEBUG for (int idx = 0; idx < 4; idx++) { #include "tsan_update_shadow_word_inl.h" } #else int idx = 0; #include "tsan_update_shadow_word_inl.h" idx = 1; #include "tsan_update_shadow_word_inl.h" idx = 2; #include "tsan_update_shadow_word_inl.h" idx = 3; #include "tsan_update_shadow_word_inl.h" #endif // we did not find any races and had already stored // the current access info, so we are done if (LIKELY(store_word == 0)) return; // choose a random candidate slot and replace it StoreShadow(shadow_mem + (cur.epoch() % kShadowCnt), store_word); StatInc(thr, StatShadowReplace); return; RACE: HandleRace(thr, shadow_mem, cur, old); return; } void UnalignedMemoryAccess(ThreadState *thr, uptr pc, uptr addr, int size, bool kAccessIsWrite, bool kIsAtomic) { while (size) { int size1 = 1; int kAccessSizeLog = kSizeLog1; if (size >= 8 && (addr & ~7) == ((addr + 7) & ~7)) { size1 = 8; kAccessSizeLog = kSizeLog8; } else if (size >= 4 && (addr & ~7) == ((addr + 3) & ~7)) { size1 = 4; kAccessSizeLog = kSizeLog4; } else if (size >= 2 && (addr & ~7) == ((addr + 1) & ~7)) { size1 = 2; kAccessSizeLog = kSizeLog2; } MemoryAccess(thr, pc, addr, kAccessSizeLog, kAccessIsWrite, kIsAtomic); addr += size1; size -= size1; } } ALWAYS_INLINE bool ContainsSameAccessSlow(u64 *s, u64 a, u64 sync_epoch, bool is_write) { Shadow cur(a); for (uptr i = 0; i < kShadowCnt; i++) { Shadow old(LoadShadow(&s[i])); if (Shadow::Addr0AndSizeAreEqual(cur, old) && old.TidWithIgnore() == cur.TidWithIgnore() && old.epoch() > sync_epoch && old.IsAtomic() == cur.IsAtomic() && old.IsRead() <= cur.IsRead()) return true; } return false; } #if defined(__SSE3__) #define SHUF(v0, v1, i0, i1, i2, i3) _mm_castps_si128(_mm_shuffle_ps( \ _mm_castsi128_ps(v0), _mm_castsi128_ps(v1), \ (i0)*1 + (i1)*4 + (i2)*16 + (i3)*64)) ALWAYS_INLINE bool ContainsSameAccessFast(u64 *s, u64 a, u64 sync_epoch, bool is_write) { // This is an optimized version of ContainsSameAccessSlow. // load current access into access[0:63] const m128 access = _mm_cvtsi64_si128(a); // duplicate high part of access in addr0: // addr0[0:31] = access[32:63] // addr0[32:63] = access[32:63] // addr0[64:95] = access[32:63] // addr0[96:127] = access[32:63] const m128 addr0 = SHUF(access, access, 1, 1, 1, 1); // load 4 shadow slots const m128 shadow0 = _mm_load_si128((__m128i*)s); const m128 shadow1 = _mm_load_si128((__m128i*)s + 1); // load high parts of 4 shadow slots into addr_vect: // addr_vect[0:31] = shadow0[32:63] // addr_vect[32:63] = shadow0[96:127] // addr_vect[64:95] = shadow1[32:63] // addr_vect[96:127] = shadow1[96:127] m128 addr_vect = SHUF(shadow0, shadow1, 1, 3, 1, 3); if (!is_write) { // set IsRead bit in addr_vect const m128 rw_mask1 = _mm_cvtsi64_si128(1<<15); const m128 rw_mask = SHUF(rw_mask1, rw_mask1, 0, 0, 0, 0); addr_vect = _mm_or_si128(addr_vect, rw_mask); } // addr0 == addr_vect? const m128 addr_res = _mm_cmpeq_epi32(addr0, addr_vect); // epoch1[0:63] = sync_epoch const m128 epoch1 = _mm_cvtsi64_si128(sync_epoch); // epoch[0:31] = sync_epoch[0:31] // epoch[32:63] = sync_epoch[0:31] // epoch[64:95] = sync_epoch[0:31] // epoch[96:127] = sync_epoch[0:31] const m128 epoch = SHUF(epoch1, epoch1, 0, 0, 0, 0); // load low parts of shadow cell epochs into epoch_vect: // epoch_vect[0:31] = shadow0[0:31] // epoch_vect[32:63] = shadow0[64:95] // epoch_vect[64:95] = shadow1[0:31] // epoch_vect[96:127] = shadow1[64:95] const m128 epoch_vect = SHUF(shadow0, shadow1, 0, 2, 0, 2); // epoch_vect >= sync_epoch? const m128 epoch_res = _mm_cmpgt_epi32(epoch_vect, epoch); // addr_res & epoch_res const m128 res = _mm_and_si128(addr_res, epoch_res); // mask[0] = res[7] // mask[1] = res[15] // ... // mask[15] = res[127] const int mask = _mm_movemask_epi8(res); return mask != 0; } #endif ALWAYS_INLINE bool ContainsSameAccess(u64 *s, u64 a, u64 sync_epoch, bool is_write) { #if defined(__SSE3__) bool res = ContainsSameAccessFast(s, a, sync_epoch, is_write); // NOTE: this check can fail if the shadow is concurrently mutated // by other threads. But it still can be useful if you modify // ContainsSameAccessFast and want to ensure that it's not completely broken. // DCHECK_EQ(res, ContainsSameAccessSlow(s, a, sync_epoch, is_write)); return res; #else return ContainsSameAccessSlow(s, a, sync_epoch, is_write); #endif } ALWAYS_INLINE USED void MemoryAccess(ThreadState *thr, uptr pc, uptr addr, int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic) { u64 *shadow_mem = (u64*)MemToShadow(addr); DPrintf2("#%d: MemoryAccess: @%p %p size=%d" " is_write=%d shadow_mem=%p {%zx, %zx, %zx, %zx}\n", (int)thr->fast_state.tid(), (void*)pc, (void*)addr, (int)(1 << kAccessSizeLog), kAccessIsWrite, shadow_mem, (uptr)shadow_mem[0], (uptr)shadow_mem[1], (uptr)shadow_mem[2], (uptr)shadow_mem[3]); #if SANITIZER_DEBUG if (!IsAppMem(addr)) { Printf("Access to non app mem %zx\n", addr); DCHECK(IsAppMem(addr)); } if (!IsShadowMem((uptr)shadow_mem)) { Printf("Bad shadow addr %p (%zx)\n", shadow_mem, addr); DCHECK(IsShadowMem((uptr)shadow_mem)); } #endif if (!SANITIZER_GO && *shadow_mem == kShadowRodata) { // Access to .rodata section, no races here. // Measurements show that it can be 10-20% of all memory accesses. StatInc(thr, StatMop); StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead); StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog)); StatInc(thr, StatMopRodata); return; } FastState fast_state = thr->fast_state; if (fast_state.GetIgnoreBit()) { StatInc(thr, StatMop); StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead); StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog)); StatInc(thr, StatMopIgnored); return; } Shadow cur(fast_state); cur.SetAddr0AndSizeLog(addr & 7, kAccessSizeLog); cur.SetWrite(kAccessIsWrite); cur.SetAtomic(kIsAtomic); if (LIKELY(ContainsSameAccess(shadow_mem, cur.raw(), thr->fast_synch_epoch, kAccessIsWrite))) { StatInc(thr, StatMop); StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead); StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog)); StatInc(thr, StatMopSame); return; } if (kCollectHistory) { fast_state.IncrementEpoch(); thr->fast_state = fast_state; TraceAddEvent(thr, fast_state, EventTypeMop, pc); cur.IncrementEpoch(); } MemoryAccessImpl1(thr, addr, kAccessSizeLog, kAccessIsWrite, kIsAtomic, shadow_mem, cur); } // Called by MemoryAccessRange in tsan_rtl_thread.cc ALWAYS_INLINE USED void MemoryAccessImpl(ThreadState *thr, uptr addr, int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic, u64 *shadow_mem, Shadow cur) { if (LIKELY(ContainsSameAccess(shadow_mem, cur.raw(), thr->fast_synch_epoch, kAccessIsWrite))) { StatInc(thr, StatMop); StatInc(thr, kAccessIsWrite ? StatMopWrite : StatMopRead); StatInc(thr, (StatType)(StatMop1 + kAccessSizeLog)); StatInc(thr, StatMopSame); return; } MemoryAccessImpl1(thr, addr, kAccessSizeLog, kAccessIsWrite, kIsAtomic, shadow_mem, cur); } static void MemoryRangeSet(ThreadState *thr, uptr pc, uptr addr, uptr size, u64 val) { (void)thr; (void)pc; if (size == 0) return; // FIXME: fix me. uptr offset = addr % kShadowCell; if (offset) { offset = kShadowCell - offset; if (size <= offset) return; addr += offset; size -= offset; } DCHECK_EQ(addr % 8, 0); // If a user passes some insane arguments (memset(0)), // let it just crash as usual. if (!IsAppMem(addr) || !IsAppMem(addr + size - 1)) return; // Don't want to touch lots of shadow memory. // If a program maps 10MB stack, there is no need reset the whole range. size = (size + (kShadowCell - 1)) & ~(kShadowCell - 1); // UnmapOrDie/MmapFixedNoReserve does not work on Windows, // so we do it only for C/C++. if (SANITIZER_GO || size < common_flags()->clear_shadow_mmap_threshold) { u64 *p = (u64*)MemToShadow(addr); CHECK(IsShadowMem((uptr)p)); CHECK(IsShadowMem((uptr)(p + size * kShadowCnt / kShadowCell - 1))); // FIXME: may overwrite a part outside the region for (uptr i = 0; i < size / kShadowCell * kShadowCnt;) { p[i++] = val; for (uptr j = 1; j < kShadowCnt; j++) p[i++] = 0; } } else { // The region is big, reset only beginning and end. const uptr kPageSize = GetPageSizeCached(); u64 *begin = (u64*)MemToShadow(addr); u64 *end = begin + size / kShadowCell * kShadowCnt; u64 *p = begin; // Set at least first kPageSize/2 to page boundary. while ((p < begin + kPageSize / kShadowSize / 2) || ((uptr)p % kPageSize)) { *p++ = val; for (uptr j = 1; j < kShadowCnt; j++) *p++ = 0; } // Reset middle part. u64 *p1 = p; p = RoundDown(end, kPageSize); UnmapOrDie((void*)p1, (uptr)p - (uptr)p1); MmapFixedNoReserve((uptr)p1, (uptr)p - (uptr)p1); // Set the ending. while (p < end) { *p++ = val; for (uptr j = 1; j < kShadowCnt; j++) *p++ = 0; } } } void MemoryResetRange(ThreadState *thr, uptr pc, uptr addr, uptr size) { MemoryRangeSet(thr, pc, addr, size, 0); } void MemoryRangeFreed(ThreadState *thr, uptr pc, uptr addr, uptr size) { // Processing more than 1k (4k of shadow) is expensive, // can cause excessive memory consumption (user does not necessary touch // the whole range) and most likely unnecessary. if (size > 1024) size = 1024; CHECK_EQ(thr->is_freeing, false); thr->is_freeing = true; MemoryAccessRange(thr, pc, addr, size, true); thr->is_freeing = false; if (kCollectHistory) { thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeMop, pc); } Shadow s(thr->fast_state); s.ClearIgnoreBit(); s.MarkAsFreed(); s.SetWrite(true); s.SetAddr0AndSizeLog(0, 3); MemoryRangeSet(thr, pc, addr, size, s.raw()); } void MemoryRangeImitateWrite(ThreadState *thr, uptr pc, uptr addr, uptr size) { if (kCollectHistory) { thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeMop, pc); } Shadow s(thr->fast_state); s.ClearIgnoreBit(); s.SetWrite(true); s.SetAddr0AndSizeLog(0, 3); MemoryRangeSet(thr, pc, addr, size, s.raw()); } ALWAYS_INLINE USED void FuncEntry(ThreadState *thr, uptr pc) { StatInc(thr, StatFuncEnter); DPrintf2("#%d: FuncEntry %p\n", (int)thr->fast_state.tid(), (void*)pc); if (kCollectHistory) { thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeFuncEnter, pc); } // Shadow stack maintenance can be replaced with // stack unwinding during trace switch (which presumably must be faster). DCHECK_GE(thr->shadow_stack_pos, thr->shadow_stack); #if !SANITIZER_GO DCHECK_LT(thr->shadow_stack_pos, thr->shadow_stack_end); #else if (thr->shadow_stack_pos == thr->shadow_stack_end) GrowShadowStack(thr); #endif thr->shadow_stack_pos[0] = pc; thr->shadow_stack_pos++; } ALWAYS_INLINE USED void FuncExit(ThreadState *thr) { StatInc(thr, StatFuncExit); DPrintf2("#%d: FuncExit\n", (int)thr->fast_state.tid()); if (kCollectHistory) { thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeFuncExit, 0); } DCHECK_GT(thr->shadow_stack_pos, thr->shadow_stack); #if !SANITIZER_GO DCHECK_LT(thr->shadow_stack_pos, thr->shadow_stack_end); #endif thr->shadow_stack_pos--; } void ThreadIgnoreBegin(ThreadState *thr, uptr pc) { DPrintf("#%d: ThreadIgnoreBegin\n", thr->tid); thr->ignore_reads_and_writes++; CHECK_GT(thr->ignore_reads_and_writes, 0); thr->fast_state.SetIgnoreBit(); #if !SANITIZER_GO if (!ctx->after_multithreaded_fork) thr->mop_ignore_set.Add(CurrentStackId(thr, pc)); #endif } void ThreadIgnoreEnd(ThreadState *thr, uptr pc) { DPrintf("#%d: ThreadIgnoreEnd\n", thr->tid); thr->ignore_reads_and_writes--; CHECK_GE(thr->ignore_reads_and_writes, 0); if (thr->ignore_reads_and_writes == 0) { thr->fast_state.ClearIgnoreBit(); #if !SANITIZER_GO thr->mop_ignore_set.Reset(); #endif } } void ThreadIgnoreSyncBegin(ThreadState *thr, uptr pc) { DPrintf("#%d: ThreadIgnoreSyncBegin\n", thr->tid); thr->ignore_sync++; CHECK_GT(thr->ignore_sync, 0); #if !SANITIZER_GO if (!ctx->after_multithreaded_fork) thr->sync_ignore_set.Add(CurrentStackId(thr, pc)); #endif } void ThreadIgnoreSyncEnd(ThreadState *thr, uptr pc) { DPrintf("#%d: ThreadIgnoreSyncEnd\n", thr->tid); thr->ignore_sync--; CHECK_GE(thr->ignore_sync, 0); #if !SANITIZER_GO if (thr->ignore_sync == 0) thr->sync_ignore_set.Reset(); #endif } bool MD5Hash::operator==(const MD5Hash &other) const { return hash[0] == other.hash[0] && hash[1] == other.hash[1]; } #if SANITIZER_DEBUG void build_consistency_debug() {} #else void build_consistency_release() {} #endif #if TSAN_COLLECT_STATS void build_consistency_stats() {} #else void build_consistency_nostats() {} #endif } // namespace __tsan #if !SANITIZER_GO // Must be included in this file to make sure everything is inlined. #include "tsan_interface_inl.h" #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_debugging.cc0000664000175000017500000001410512710074030026777 0ustar mwhudsonmwhudson//===-- tsan_debugging.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // TSan debugging API implementation. //===----------------------------------------------------------------------===// #include "tsan_interface.h" #include "tsan_report.h" #include "tsan_rtl.h" using namespace __tsan; static const char *ReportTypeDescription(ReportType typ) { if (typ == ReportTypeRace) return "data-race"; if (typ == ReportTypeVptrRace) return "data-race-vptr"; if (typ == ReportTypeUseAfterFree) return "heap-use-after-free"; if (typ == ReportTypeVptrUseAfterFree) return "heap-use-after-free-vptr"; if (typ == ReportTypeThreadLeak) return "thread-leak"; if (typ == ReportTypeMutexDestroyLocked) return "locked-mutex-destroy"; if (typ == ReportTypeMutexDoubleLock) return "mutex-double-lock"; if (typ == ReportTypeMutexInvalidAccess) return "mutex-invalid-access"; if (typ == ReportTypeMutexBadUnlock) return "mutex-bad-unlock"; if (typ == ReportTypeMutexBadReadLock) return "mutex-bad-read-lock"; if (typ == ReportTypeMutexBadReadUnlock) return "mutex-bad-read-unlock"; if (typ == ReportTypeSignalUnsafe) return "signal-unsafe-call"; if (typ == ReportTypeErrnoInSignal) return "errno-in-signal-handler"; if (typ == ReportTypeDeadlock) return "lock-order-inversion"; return ""; } static const char *ReportLocationTypeDescription(ReportLocationType typ) { if (typ == ReportLocationGlobal) return "global"; if (typ == ReportLocationHeap) return "heap"; if (typ == ReportLocationStack) return "stack"; if (typ == ReportLocationTLS) return "tls"; if (typ == ReportLocationFD) return "fd"; return ""; } static void CopyTrace(SymbolizedStack *first_frame, void **trace, uptr trace_size) { uptr i = 0; for (SymbolizedStack *frame = first_frame; frame != nullptr; frame = frame->next) { trace[i++] = (void *)frame->info.address; if (i >= trace_size) break; } } // Meant to be called by the debugger. SANITIZER_INTERFACE_ATTRIBUTE void *__tsan_get_current_report() { return const_cast(cur_thread()->current_report); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_data(void *report, const char **description, int *count, int *stack_count, int *mop_count, int *loc_count, int *mutex_count, int *thread_count, int *unique_tid_count, void **sleep_trace, uptr trace_size) { const ReportDesc *rep = (ReportDesc *)report; *description = ReportTypeDescription(rep->typ); *count = rep->count; *stack_count = rep->stacks.Size(); *mop_count = rep->mops.Size(); *loc_count = rep->locs.Size(); *mutex_count = rep->mutexes.Size(); *thread_count = rep->threads.Size(); *unique_tid_count = rep->unique_tids.Size(); if (rep->sleep) CopyTrace(rep->sleep->frames, sleep_trace, trace_size); return 1; } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_stack(void *report, uptr idx, void **trace, uptr trace_size) { const ReportDesc *rep = (ReportDesc *)report; CHECK_LT(idx, rep->stacks.Size()); ReportStack *stack = rep->stacks[idx]; if (stack) CopyTrace(stack->frames, trace, trace_size); return stack ? 1 : 0; } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_mop(void *report, uptr idx, int *tid, void **addr, int *size, int *write, int *atomic, void **trace, uptr trace_size) { const ReportDesc *rep = (ReportDesc *)report; CHECK_LT(idx, rep->mops.Size()); ReportMop *mop = rep->mops[idx]; *tid = mop->tid; *addr = (void *)mop->addr; *size = mop->size; *write = mop->write ? 1 : 0; *atomic = mop->atomic ? 1 : 0; if (mop->stack) CopyTrace(mop->stack->frames, trace, trace_size); return 1; } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_loc(void *report, uptr idx, const char **type, void **addr, uptr *start, uptr *size, int *tid, int *fd, int *suppressable, void **trace, uptr trace_size) { const ReportDesc *rep = (ReportDesc *)report; CHECK_LT(idx, rep->locs.Size()); ReportLocation *loc = rep->locs[idx]; *type = ReportLocationTypeDescription(loc->type); *addr = (void *)loc->global.start; *start = loc->heap_chunk_start; *size = loc->heap_chunk_size; *tid = loc->tid; *fd = loc->fd; *suppressable = loc->suppressable; if (loc->stack) CopyTrace(loc->stack->frames, trace, trace_size); return 1; } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr, int *destroyed, void **trace, uptr trace_size) { const ReportDesc *rep = (ReportDesc *)report; CHECK_LT(idx, rep->mutexes.Size()); ReportMutex *mutex = rep->mutexes[idx]; *mutex_id = mutex->id; *addr = (void *)mutex->addr; *destroyed = mutex->destroyed; if (mutex->stack) CopyTrace(mutex->stack->frames, trace, trace_size); return 1; } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_thread(void *report, uptr idx, int *tid, uptr *os_id, int *running, const char **name, int *parent_tid, void **trace, uptr trace_size) { const ReportDesc *rep = (ReportDesc *)report; CHECK_LT(idx, rep->threads.Size()); ReportThread *thread = rep->threads[idx]; *tid = thread->id; *os_id = thread->os_id; *running = thread->running; *name = thread->name; *parent_tid = thread->parent_tid; if (thread->stack) CopyTrace(thread->stack->frames, trace, trace_size); return 1; } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_unique_tid(void *report, uptr idx, int *tid) { const ReportDesc *rep = (ReportDesc *)report; CHECK_LT(idx, rep->unique_tids.Size()); *tid = rep->unique_tids[idx]; return 1; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface.cc0000664000175000017500000000712412522075312027014 0ustar mwhudsonmwhudson//===-- tsan_interface.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_interface.h" #include "tsan_interface_ann.h" #include "tsan_rtl.h" #include "sanitizer_common/sanitizer_internal_defs.h" #define CALLERPC ((uptr)__builtin_return_address(0)) using namespace __tsan; // NOLINT typedef u16 uint16_t; typedef u32 uint32_t; typedef u64 uint64_t; void __tsan_init() { Initialize(cur_thread()); } void __tsan_read16(void *addr) { MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog8); MemoryRead(cur_thread(), CALLERPC, (uptr)addr + 8, kSizeLog8); } void __tsan_write16(void *addr) { MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog8); MemoryWrite(cur_thread(), CALLERPC, (uptr)addr + 8, kSizeLog8); } void __tsan_read16_pc(void *addr, void *pc) { MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog8); MemoryRead(cur_thread(), (uptr)pc, (uptr)addr + 8, kSizeLog8); } void __tsan_write16_pc(void *addr, void *pc) { MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog8); MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr + 8, kSizeLog8); } // __tsan_unaligned_read/write calls are emitted by compiler. void __tsan_unaligned_read2(const void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 2, false, false); } void __tsan_unaligned_read4(const void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 4, false, false); } void __tsan_unaligned_read8(const void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 8, false, false); } void __tsan_unaligned_read16(const void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 16, false, false); } void __tsan_unaligned_write2(void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 2, true, false); } void __tsan_unaligned_write4(void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 4, true, false); } void __tsan_unaligned_write8(void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 8, true, false); } void __tsan_unaligned_write16(void *addr) { UnalignedMemoryAccess(cur_thread(), CALLERPC, (uptr)addr, 16, true, false); } // __sanitizer_unaligned_load/store are for user instrumentation. extern "C" { SANITIZER_INTERFACE_ATTRIBUTE u16 __sanitizer_unaligned_load16(const uu16 *addr) { __tsan_unaligned_read2(addr); return *addr; } SANITIZER_INTERFACE_ATTRIBUTE u32 __sanitizer_unaligned_load32(const uu32 *addr) { __tsan_unaligned_read4(addr); return *addr; } SANITIZER_INTERFACE_ATTRIBUTE u64 __sanitizer_unaligned_load64(const uu64 *addr) { __tsan_unaligned_read8(addr); return *addr; } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store16(uu16 *addr, u16 v) { __tsan_unaligned_write2(addr); *addr = v; } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store32(uu32 *addr, u32 v) { __tsan_unaligned_write4(addr); *addr = v; } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store64(uu64 *addr, u64 v) { __tsan_unaligned_write8(addr); *addr = v; } } // extern "C" void __tsan_acquire(void *addr) { Acquire(cur_thread(), CALLERPC, (uptr)addr); } void __tsan_release(void *addr) { Release(cur_thread(), CALLERPC, (uptr)addr); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_libdispatch_mac.cc0000664000175000017500000006711412740740776030206 0ustar mwhudsonmwhudson//===-- tsan_libdispatch_mac.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Mac-specific libdispatch (GCD) support. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_common/sanitizer_common.h" #include "interception/interception.h" #include "tsan_interceptors.h" #include "tsan_platform.h" #include "tsan_rtl.h" #include #include #include typedef long long_t; // NOLINT namespace __tsan { typedef struct { dispatch_queue_t queue; void *orig_context; dispatch_function_t orig_work; bool free_context_in_callback; bool submitted_synchronously; bool is_barrier_block; uptr non_queue_sync_object; } tsan_block_context_t; // The offsets of different fields of the dispatch_queue_t structure, exported // by libdispatch.dylib. extern "C" struct dispatch_queue_offsets_s { const uint16_t dqo_version; const uint16_t dqo_label; const uint16_t dqo_label_size; const uint16_t dqo_flags; const uint16_t dqo_flags_size; const uint16_t dqo_serialnum; const uint16_t dqo_serialnum_size; const uint16_t dqo_width; const uint16_t dqo_width_size; const uint16_t dqo_running; const uint16_t dqo_running_size; const uint16_t dqo_suspend_cnt; const uint16_t dqo_suspend_cnt_size; const uint16_t dqo_target_queue; const uint16_t dqo_target_queue_size; const uint16_t dqo_priority; const uint16_t dqo_priority_size; } dispatch_queue_offsets; static bool IsQueueSerial(dispatch_queue_t q) { CHECK_EQ(dispatch_queue_offsets.dqo_width_size, 2); uptr width = *(uint16_t *)(((uptr)q) + dispatch_queue_offsets.dqo_width); CHECK_NE(width, 0); return width == 1; } static dispatch_queue_t GetTargetQueueFromSource(dispatch_source_t source) { CHECK_EQ(dispatch_queue_offsets.dqo_target_queue_size, 8); dispatch_queue_t target_queue = *(dispatch_queue_t *)(((uptr)source) + dispatch_queue_offsets.dqo_target_queue); CHECK_NE(target_queue, 0); return target_queue; } static tsan_block_context_t *AllocContext(ThreadState *thr, uptr pc, dispatch_queue_t queue, void *orig_context, dispatch_function_t orig_work) { tsan_block_context_t *new_context = (tsan_block_context_t *)user_alloc(thr, pc, sizeof(tsan_block_context_t)); new_context->queue = queue; new_context->orig_context = orig_context; new_context->orig_work = orig_work; new_context->free_context_in_callback = true; new_context->submitted_synchronously = false; new_context->is_barrier_block = false; return new_context; } static void dispatch_callback_wrap(void *param) { SCOPED_INTERCEPTOR_RAW(dispatch_callback_wrap); tsan_block_context_t *context = (tsan_block_context_t *)param; bool is_queue_serial = context->queue && IsQueueSerial(context->queue); uptr sync_ptr = (uptr)context->queue ?: context->non_queue_sync_object; uptr serial_sync = (uptr)sync_ptr; uptr concurrent_sync = ((uptr)sync_ptr) + sizeof(uptr); uptr submit_sync = (uptr)context; bool serial_task = context->is_barrier_block || is_queue_serial; Acquire(thr, pc, submit_sync); Acquire(thr, pc, serial_sync); if (serial_task) Acquire(thr, pc, concurrent_sync); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); context->orig_work(context->orig_context); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); Release(thr, pc, serial_task ? serial_sync : concurrent_sync); if (context->submitted_synchronously) Release(thr, pc, submit_sync); if (context->free_context_in_callback) user_free(thr, pc, context); } static void invoke_block(void *param) { dispatch_block_t block = (dispatch_block_t)param; block(); } static void invoke_and_release_block(void *param) { dispatch_block_t block = (dispatch_block_t)param; block(); Block_release(block); } #define DISPATCH_INTERCEPT_B(name, barrier) \ TSAN_INTERCEPTOR(void, name, dispatch_queue_t q, dispatch_block_t block) { \ SCOPED_TSAN_INTERCEPTOR(name, q, block); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); \ dispatch_block_t heap_block = Block_copy(block); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); \ tsan_block_context_t *new_context = \ AllocContext(thr, pc, q, heap_block, &invoke_and_release_block); \ new_context->is_barrier_block = barrier; \ Release(thr, pc, (uptr)new_context); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); \ REAL(name##_f)(q, new_context, dispatch_callback_wrap); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); \ } #define DISPATCH_INTERCEPT_SYNC_B(name, barrier) \ TSAN_INTERCEPTOR(void, name, dispatch_queue_t q, dispatch_block_t block) { \ SCOPED_TSAN_INTERCEPTOR(name, q, block); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); \ dispatch_block_t heap_block = Block_copy(block); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); \ tsan_block_context_t new_context = { \ q, heap_block, &invoke_and_release_block, false, true, barrier, 0}; \ Release(thr, pc, (uptr)&new_context); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); \ REAL(name##_f)(q, &new_context, dispatch_callback_wrap); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); \ Acquire(thr, pc, (uptr)&new_context); \ } #define DISPATCH_INTERCEPT_F(name, barrier) \ TSAN_INTERCEPTOR(void, name, dispatch_queue_t q, void *context, \ dispatch_function_t work) { \ SCOPED_TSAN_INTERCEPTOR(name, q, context, work); \ tsan_block_context_t *new_context = \ AllocContext(thr, pc, q, context, work); \ new_context->is_barrier_block = barrier; \ Release(thr, pc, (uptr)new_context); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); \ REAL(name)(q, new_context, dispatch_callback_wrap); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); \ } #define DISPATCH_INTERCEPT_SYNC_F(name, barrier) \ TSAN_INTERCEPTOR(void, name, dispatch_queue_t q, void *context, \ dispatch_function_t work) { \ SCOPED_TSAN_INTERCEPTOR(name, q, context, work); \ tsan_block_context_t new_context = { \ q, context, work, false, true, barrier, 0}; \ Release(thr, pc, (uptr)&new_context); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); \ REAL(name)(q, &new_context, dispatch_callback_wrap); \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); \ Acquire(thr, pc, (uptr)&new_context); \ } // We wrap dispatch_async, dispatch_sync and friends where we allocate a new // context, which is used to synchronize (we release the context before // submitting, and the callback acquires it before executing the original // callback). DISPATCH_INTERCEPT_B(dispatch_async, false) DISPATCH_INTERCEPT_B(dispatch_barrier_async, true) DISPATCH_INTERCEPT_F(dispatch_async_f, false) DISPATCH_INTERCEPT_F(dispatch_barrier_async_f, true) DISPATCH_INTERCEPT_SYNC_B(dispatch_sync, false) DISPATCH_INTERCEPT_SYNC_B(dispatch_barrier_sync, true) DISPATCH_INTERCEPT_SYNC_F(dispatch_sync_f, false) DISPATCH_INTERCEPT_SYNC_F(dispatch_barrier_sync_f, true) TSAN_INTERCEPTOR(void, dispatch_after, dispatch_time_t when, dispatch_queue_t queue, dispatch_block_t block) { SCOPED_TSAN_INTERCEPTOR(dispatch_after, when, queue, block); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); dispatch_block_t heap_block = Block_copy(block); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); tsan_block_context_t *new_context = AllocContext(thr, pc, queue, heap_block, &invoke_and_release_block); Release(thr, pc, (uptr)new_context); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); REAL(dispatch_after_f)(when, queue, new_context, dispatch_callback_wrap); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); } TSAN_INTERCEPTOR(void, dispatch_after_f, dispatch_time_t when, dispatch_queue_t queue, void *context, dispatch_function_t work) { SCOPED_TSAN_INTERCEPTOR(dispatch_after_f, when, queue, context, work); WRAP(dispatch_after)(when, queue, ^(void) { work(context); }); } // GCD's dispatch_once implementation has a fast path that contains a racy read // and it's inlined into user's code. Furthermore, this fast path doesn't // establish a proper happens-before relations between the initialization and // code following the call to dispatch_once. We could deal with this in // instrumented code, but there's not much we can do about it in system // libraries. Let's disable the fast path (by never storing the value ~0 to // predicate), so the interceptor is always called, and let's add proper release // and acquire semantics. Since TSan does not see its own atomic stores, the // race on predicate won't be reported - the only accesses to it that TSan sees // are the loads on the fast path. Loads don't race. Secondly, dispatch_once is // both a macro and a real function, we want to intercept the function, so we // need to undefine the macro. #undef dispatch_once TSAN_INTERCEPTOR(void, dispatch_once, dispatch_once_t *predicate, dispatch_block_t block) { SCOPED_INTERCEPTOR_RAW(dispatch_once, predicate, block); atomic_uint32_t *a = reinterpret_cast(predicate); u32 v = atomic_load(a, memory_order_acquire); if (v == 0 && atomic_compare_exchange_strong(a, &v, 1, memory_order_relaxed)) { SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); block(); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); Release(thr, pc, (uptr)a); atomic_store(a, 2, memory_order_release); } else { while (v != 2) { internal_sched_yield(); v = atomic_load(a, memory_order_acquire); } Acquire(thr, pc, (uptr)a); } } #undef dispatch_once_f TSAN_INTERCEPTOR(void, dispatch_once_f, dispatch_once_t *predicate, void *context, dispatch_function_t function) { SCOPED_INTERCEPTOR_RAW(dispatch_once_f, predicate, context, function); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); WRAP(dispatch_once)(predicate, ^(void) { function(context); }); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); } TSAN_INTERCEPTOR(long_t, dispatch_semaphore_signal, dispatch_semaphore_t dsema) { SCOPED_TSAN_INTERCEPTOR(dispatch_semaphore_signal, dsema); Release(thr, pc, (uptr)dsema); return REAL(dispatch_semaphore_signal)(dsema); } TSAN_INTERCEPTOR(long_t, dispatch_semaphore_wait, dispatch_semaphore_t dsema, dispatch_time_t timeout) { SCOPED_TSAN_INTERCEPTOR(dispatch_semaphore_wait, dsema, timeout); long_t result = REAL(dispatch_semaphore_wait)(dsema, timeout); if (result == 0) Acquire(thr, pc, (uptr)dsema); return result; } TSAN_INTERCEPTOR(long_t, dispatch_group_wait, dispatch_group_t group, dispatch_time_t timeout) { SCOPED_TSAN_INTERCEPTOR(dispatch_group_wait, group, timeout); long_t result = REAL(dispatch_group_wait)(group, timeout); if (result == 0) Acquire(thr, pc, (uptr)group); return result; } TSAN_INTERCEPTOR(void, dispatch_group_leave, dispatch_group_t group) { SCOPED_TSAN_INTERCEPTOR(dispatch_group_leave, group); // Acquired in the group noticifaction callback in dispatch_group_notify[_f]. Release(thr, pc, (uptr)group); REAL(dispatch_group_leave)(group); } TSAN_INTERCEPTOR(void, dispatch_group_async, dispatch_group_t group, dispatch_queue_t queue, dispatch_block_t block) { SCOPED_TSAN_INTERCEPTOR(dispatch_group_async, group, queue, block); dispatch_retain(group); dispatch_group_enter(group); __block dispatch_block_t block_copy = (dispatch_block_t)_Block_copy(block); WRAP(dispatch_async)(queue, ^(void) { block_copy(); _Block_release(block_copy); WRAP(dispatch_group_leave)(group); dispatch_release(group); }); } TSAN_INTERCEPTOR(void, dispatch_group_async_f, dispatch_group_t group, dispatch_queue_t queue, void *context, dispatch_function_t work) { SCOPED_TSAN_INTERCEPTOR(dispatch_group_async_f, group, queue, context, work); dispatch_retain(group); dispatch_group_enter(group); WRAP(dispatch_async)(queue, ^(void) { work(context); WRAP(dispatch_group_leave)(group); dispatch_release(group); }); } TSAN_INTERCEPTOR(void, dispatch_group_notify, dispatch_group_t group, dispatch_queue_t q, dispatch_block_t block) { SCOPED_TSAN_INTERCEPTOR(dispatch_group_notify, group, q, block); // To make sure the group is still available in the callback (otherwise // it can be already destroyed). Will be released in the callback. dispatch_retain(group); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); dispatch_block_t heap_block = Block_copy(^(void) { { SCOPED_INTERCEPTOR_RAW(dispatch_read_callback); // Released when leaving the group (dispatch_group_leave). Acquire(thr, pc, (uptr)group); } dispatch_release(group); block(); }); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); tsan_block_context_t *new_context = AllocContext(thr, pc, q, heap_block, &invoke_and_release_block); new_context->is_barrier_block = true; Release(thr, pc, (uptr)new_context); REAL(dispatch_group_notify_f)(group, q, new_context, dispatch_callback_wrap); } TSAN_INTERCEPTOR(void, dispatch_group_notify_f, dispatch_group_t group, dispatch_queue_t q, void *context, dispatch_function_t work) { WRAP(dispatch_group_notify)(group, q, ^(void) { work(context); }); } TSAN_INTERCEPTOR(void, dispatch_source_set_event_handler, dispatch_source_t source, dispatch_block_t handler) { SCOPED_TSAN_INTERCEPTOR(dispatch_source_set_event_handler, source, handler); if (handler == nullptr) return REAL(dispatch_source_set_event_handler)(source, nullptr); dispatch_queue_t q = GetTargetQueueFromSource(source); __block tsan_block_context_t new_context = { q, handler, &invoke_block, false, false, false, 0 }; dispatch_block_t new_handler = Block_copy(^(void) { new_context.orig_context = handler; // To explicitly capture "handler". dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_source_set_event_handler)(source, new_handler); Block_release(new_handler); } TSAN_INTERCEPTOR(void, dispatch_source_set_event_handler_f, dispatch_source_t source, dispatch_function_t handler) { SCOPED_TSAN_INTERCEPTOR(dispatch_source_set_event_handler_f, source, handler); if (handler == nullptr) return REAL(dispatch_source_set_event_handler)(source, nullptr); dispatch_block_t block = ^(void) { handler(dispatch_get_context(source)); }; WRAP(dispatch_source_set_event_handler)(source, block); } TSAN_INTERCEPTOR(void, dispatch_source_set_cancel_handler, dispatch_source_t source, dispatch_block_t handler) { SCOPED_TSAN_INTERCEPTOR(dispatch_source_set_cancel_handler, source, handler); if (handler == nullptr) return REAL(dispatch_source_set_cancel_handler)(source, nullptr); dispatch_queue_t q = GetTargetQueueFromSource(source); __block tsan_block_context_t new_context = { q, handler, &invoke_block, false, false, false, 0}; dispatch_block_t new_handler = Block_copy(^(void) { new_context.orig_context = handler; // To explicitly capture "handler". dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_source_set_cancel_handler)(source, new_handler); Block_release(new_handler); } TSAN_INTERCEPTOR(void, dispatch_source_set_cancel_handler_f, dispatch_source_t source, dispatch_function_t handler) { SCOPED_TSAN_INTERCEPTOR(dispatch_source_set_cancel_handler_f, source, handler); if (handler == nullptr) return REAL(dispatch_source_set_cancel_handler)(source, nullptr); dispatch_block_t block = ^(void) { handler(dispatch_get_context(source)); }; WRAP(dispatch_source_set_cancel_handler)(source, block); } TSAN_INTERCEPTOR(void, dispatch_source_set_registration_handler, dispatch_source_t source, dispatch_block_t handler) { SCOPED_TSAN_INTERCEPTOR(dispatch_source_set_registration_handler, source, handler); if (handler == nullptr) return REAL(dispatch_source_set_registration_handler)(source, nullptr); dispatch_queue_t q = GetTargetQueueFromSource(source); __block tsan_block_context_t new_context = { q, handler, &invoke_block, false, false, false, 0}; dispatch_block_t new_handler = Block_copy(^(void) { new_context.orig_context = handler; // To explicitly capture "handler". dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_source_set_registration_handler)(source, new_handler); Block_release(new_handler); } TSAN_INTERCEPTOR(void, dispatch_source_set_registration_handler_f, dispatch_source_t source, dispatch_function_t handler) { SCOPED_TSAN_INTERCEPTOR(dispatch_source_set_registration_handler_f, source, handler); if (handler == nullptr) return REAL(dispatch_source_set_registration_handler)(source, nullptr); dispatch_block_t block = ^(void) { handler(dispatch_get_context(source)); }; WRAP(dispatch_source_set_registration_handler)(source, block); } TSAN_INTERCEPTOR(void, dispatch_apply, size_t iterations, dispatch_queue_t queue, void (^block)(size_t)) { SCOPED_TSAN_INTERCEPTOR(dispatch_apply, iterations, queue, block); void *parent_to_child_sync = nullptr; uptr parent_to_child_sync_uptr = (uptr)&parent_to_child_sync; void *child_to_parent_sync = nullptr; uptr child_to_parent_sync_uptr = (uptr)&child_to_parent_sync; Release(thr, pc, parent_to_child_sync_uptr); void (^new_block)(size_t) = ^(size_t iteration) { SCOPED_INTERCEPTOR_RAW(dispatch_apply); Acquire(thr, pc, parent_to_child_sync_uptr); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); block(iteration); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); Release(thr, pc, child_to_parent_sync_uptr); }; SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); REAL(dispatch_apply)(iterations, queue, new_block); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); Acquire(thr, pc, child_to_parent_sync_uptr); } TSAN_INTERCEPTOR(void, dispatch_apply_f, size_t iterations, dispatch_queue_t queue, void *context, void (*work)(void *, size_t)) { SCOPED_TSAN_INTERCEPTOR(dispatch_apply_f, iterations, queue, context, work); void (^new_block)(size_t) = ^(size_t iteration) { work(context, iteration); }; WRAP(dispatch_apply)(iterations, queue, new_block); } DECLARE_REAL_AND_INTERCEPTOR(void, free, void *ptr) DECLARE_REAL_AND_INTERCEPTOR(int, munmap, void *addr, long_t sz) TSAN_INTERCEPTOR(dispatch_data_t, dispatch_data_create, const void *buffer, size_t size, dispatch_queue_t q, dispatch_block_t destructor) { SCOPED_TSAN_INTERCEPTOR(dispatch_data_create, buffer, size, q, destructor); if ((q == nullptr) || (destructor == DISPATCH_DATA_DESTRUCTOR_DEFAULT)) return REAL(dispatch_data_create)(buffer, size, q, destructor); if (destructor == DISPATCH_DATA_DESTRUCTOR_FREE) destructor = ^(void) { WRAP(free)((void *)buffer); }; else if (destructor == DISPATCH_DATA_DESTRUCTOR_MUNMAP) destructor = ^(void) { WRAP(munmap)((void *)buffer, size); }; SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START(); dispatch_block_t heap_block = Block_copy(destructor); SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END(); tsan_block_context_t *new_context = AllocContext(thr, pc, q, heap_block, &invoke_and_release_block); uptr submit_sync = (uptr)new_context; Release(thr, pc, submit_sync); return REAL(dispatch_data_create)(buffer, size, q, ^(void) { dispatch_callback_wrap(new_context); }); } typedef void (^fd_handler_t)(dispatch_data_t data, int error); typedef void (^cleanup_handler_t)(int error); TSAN_INTERCEPTOR(void, dispatch_read, dispatch_fd_t fd, size_t length, dispatch_queue_t q, fd_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_read, fd, length, q, h); __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; fd_handler_t new_h = Block_copy(^(dispatch_data_t data, int error) { new_context.orig_context = ^(void) { h(data, error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_read)(fd, length, q, new_h); Block_release(new_h); } TSAN_INTERCEPTOR(void, dispatch_write, dispatch_fd_t fd, dispatch_data_t data, dispatch_queue_t q, fd_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_write, fd, data, q, h); __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; fd_handler_t new_h = Block_copy(^(dispatch_data_t data, int error) { new_context.orig_context = ^(void) { h(data, error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_write)(fd, data, q, new_h); Block_release(new_h); } TSAN_INTERCEPTOR(void, dispatch_io_read, dispatch_io_t channel, off_t offset, size_t length, dispatch_queue_t q, dispatch_io_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_read, channel, offset, length, q, h); __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; dispatch_io_handler_t new_h = Block_copy(^(bool done, dispatch_data_t data, int error) { new_context.orig_context = ^(void) { h(done, data, error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_io_read)(channel, offset, length, q, new_h); Block_release(new_h); } TSAN_INTERCEPTOR(void, dispatch_io_write, dispatch_io_t channel, off_t offset, dispatch_data_t data, dispatch_queue_t q, dispatch_io_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_write, channel, offset, data, q, h); __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; dispatch_io_handler_t new_h = Block_copy(^(bool done, dispatch_data_t data, int error) { new_context.orig_context = ^(void) { h(done, data, error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_io_write)(channel, offset, data, q, new_h); Block_release(new_h); } TSAN_INTERCEPTOR(void, dispatch_io_barrier, dispatch_io_t channel, dispatch_block_t barrier) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_barrier, channel, barrier); __block tsan_block_context_t new_context = { nullptr, nullptr, &invoke_block, false, false, false, 0}; new_context.non_queue_sync_object = (uptr)channel; new_context.is_barrier_block = true; dispatch_block_t new_block = Block_copy(^(void) { new_context.orig_context = ^(void) { barrier(); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); REAL(dispatch_io_barrier)(channel, new_block); Block_release(new_block); } TSAN_INTERCEPTOR(dispatch_io_t, dispatch_io_create, dispatch_io_type_t type, dispatch_fd_t fd, dispatch_queue_t q, cleanup_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_create, type, fd, q, h); __block dispatch_io_t new_channel = nullptr; __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; cleanup_handler_t new_h = Block_copy(^(int error) { { SCOPED_INTERCEPTOR_RAW(dispatch_io_create_callback); Acquire(thr, pc, (uptr)new_channel); // Release() in dispatch_io_close. } new_context.orig_context = ^(void) { h(error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); new_channel = REAL(dispatch_io_create)(type, fd, q, new_h); Block_release(new_h); return new_channel; } TSAN_INTERCEPTOR(dispatch_io_t, dispatch_io_create_with_path, dispatch_io_type_t type, const char *path, int oflag, mode_t mode, dispatch_queue_t q, cleanup_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_create_with_path, type, path, oflag, mode, q, h); __block dispatch_io_t new_channel = nullptr; __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; cleanup_handler_t new_h = Block_copy(^(int error) { { SCOPED_INTERCEPTOR_RAW(dispatch_io_create_callback); Acquire(thr, pc, (uptr)new_channel); // Release() in dispatch_io_close. } new_context.orig_context = ^(void) { h(error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); new_channel = REAL(dispatch_io_create_with_path)(type, path, oflag, mode, q, new_h); Block_release(new_h); return new_channel; } TSAN_INTERCEPTOR(dispatch_io_t, dispatch_io_create_with_io, dispatch_io_type_t type, dispatch_io_t io, dispatch_queue_t q, cleanup_handler_t h) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_create_with_io, type, io, q, h); __block dispatch_io_t new_channel = nullptr; __block tsan_block_context_t new_context = { q, nullptr, &invoke_block, false, false, false, 0}; cleanup_handler_t new_h = Block_copy(^(int error) { { SCOPED_INTERCEPTOR_RAW(dispatch_io_create_callback); Acquire(thr, pc, (uptr)new_channel); // Release() in dispatch_io_close. } new_context.orig_context = ^(void) { h(error); }; dispatch_callback_wrap(&new_context); }); uptr submit_sync = (uptr)&new_context; Release(thr, pc, submit_sync); new_channel = REAL(dispatch_io_create_with_io)(type, io, q, new_h); Block_release(new_h); return new_channel; } TSAN_INTERCEPTOR(void, dispatch_io_close, dispatch_io_t channel, dispatch_io_close_flags_t flags) { SCOPED_TSAN_INTERCEPTOR(dispatch_io_close, channel, flags); Release(thr, pc, (uptr)channel); // Acquire() in dispatch_io_create[_*]. return REAL(dispatch_io_close)(channel, flags); } } // namespace __tsan #endif // SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_defs.h0000664000175000017500000000727713004730632025647 0ustar mwhudsonmwhudson//===-- tsan_defs.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_DEFS_H #define TSAN_DEFS_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_libc.h" #include "tsan_stat.h" #include "ubsan/ubsan_platform.h" // Setup defaults for compile definitions. #ifndef TSAN_NO_HISTORY # define TSAN_NO_HISTORY 0 #endif #ifndef TSAN_COLLECT_STATS # define TSAN_COLLECT_STATS 0 #endif #ifndef TSAN_CONTAINS_UBSAN # if CAN_SANITIZE_UB && !SANITIZER_GO # define TSAN_CONTAINS_UBSAN 1 # else # define TSAN_CONTAINS_UBSAN 0 # endif #endif namespace __tsan { const int kTidBits = 13; const unsigned kMaxTid = 1 << kTidBits; #if !SANITIZER_GO const unsigned kMaxTidInClock = kMaxTid * 2; // This includes msb 'freed' bit. #else const unsigned kMaxTidInClock = kMaxTid; // Go does not track freed memory. #endif const int kClkBits = 42; const unsigned kMaxTidReuse = (1 << (64 - kClkBits)) - 1; const uptr kShadowStackSize = 64 * 1024; // Count of shadow values in a shadow cell. const uptr kShadowCnt = 4; // That many user bytes are mapped onto a single shadow cell. const uptr kShadowCell = 8; // Size of a single shadow value (u64). const uptr kShadowSize = 8; // Shadow memory is kShadowMultiplier times larger than user memory. const uptr kShadowMultiplier = kShadowSize * kShadowCnt / kShadowCell; // That many user bytes are mapped onto a single meta shadow cell. // Must be less or equal to minimal memory allocator alignment. const uptr kMetaShadowCell = 8; // Size of a single meta shadow value (u32). const uptr kMetaShadowSize = 4; #if TSAN_NO_HISTORY const bool kCollectHistory = false; #else const bool kCollectHistory = true; #endif const unsigned kInvalidTid = (unsigned)-1; // The following "build consistency" machinery ensures that all source files // are built in the same configuration. Inconsistent builds lead to // hard to debug crashes. #if SANITIZER_DEBUG void build_consistency_debug(); #else void build_consistency_release(); #endif #if TSAN_COLLECT_STATS void build_consistency_stats(); #else void build_consistency_nostats(); #endif static inline void USED build_consistency() { #if SANITIZER_DEBUG build_consistency_debug(); #else build_consistency_release(); #endif #if TSAN_COLLECT_STATS build_consistency_stats(); #else build_consistency_nostats(); #endif } template T min(T a, T b) { return a < b ? a : b; } template T max(T a, T b) { return a > b ? a : b; } template T RoundUp(T p, u64 align) { DCHECK_EQ(align & (align - 1), 0); return (T)(((u64)p + align - 1) & ~(align - 1)); } template T RoundDown(T p, u64 align) { DCHECK_EQ(align & (align - 1), 0); return (T)((u64)p & ~(align - 1)); } // Zeroizes high part, returns 'bits' lsb bits. template T GetLsb(T v, int bits) { return (T)((u64)v & ((1ull << bits) - 1)); } struct MD5Hash { u64 hash[2]; bool operator==(const MD5Hash &other) const; }; MD5Hash md5_hash(const void *data, uptr size); struct Processor; struct ThreadState; class ThreadContext; struct Context; struct ReportStack; class ReportDesc; class RegionAlloc; // Descriptor of user's memory block. struct MBlock { u64 siz; u32 stk; u16 tid; }; COMPILER_CHECK(sizeof(MBlock) == 16); } // namespace __tsan #endif // TSAN_DEFS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_thread.cc0000664000175000017500000003007113004730632027200 0ustar mwhudsonmwhudson//===-- tsan_rtl_thread.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_placement_new.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "tsan_platform.h" #include "tsan_report.h" #include "tsan_sync.h" namespace __tsan { // ThreadContext implementation. ThreadContext::ThreadContext(int tid) : ThreadContextBase(tid) , thr() , sync() , epoch0() , epoch1() { } #if !SANITIZER_GO ThreadContext::~ThreadContext() { } #endif void ThreadContext::OnDead() { CHECK_EQ(sync.size(), 0); } void ThreadContext::OnJoined(void *arg) { ThreadState *caller_thr = static_cast(arg); AcquireImpl(caller_thr, 0, &sync); sync.Reset(&caller_thr->proc()->clock_cache); } struct OnCreatedArgs { ThreadState *thr; uptr pc; }; void ThreadContext::OnCreated(void *arg) { thr = 0; if (tid == 0) return; OnCreatedArgs *args = static_cast(arg); if (!args->thr) // GCD workers don't have a parent thread. return; args->thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(args->thr, args->thr->fast_state, EventTypeMop, 0); ReleaseImpl(args->thr, 0, &sync); creation_stack_id = CurrentStackId(args->thr, args->pc); if (reuse_count == 0) StatInc(args->thr, StatThreadMaxTid); } void ThreadContext::OnReset() { CHECK_EQ(sync.size(), 0); ReleaseMemoryToOS(GetThreadTrace(tid), TraceSize() * sizeof(Event)); //!!! ReleaseMemoryToOS(GetThreadTraceHeader(tid), sizeof(Trace)); } void ThreadContext::OnDetached(void *arg) { ThreadState *thr1 = static_cast(arg); sync.Reset(&thr1->proc()->clock_cache); } struct OnStartedArgs { ThreadState *thr; uptr stk_addr; uptr stk_size; uptr tls_addr; uptr tls_size; }; void ThreadContext::OnStarted(void *arg) { OnStartedArgs *args = static_cast(arg); thr = args->thr; // RoundUp so that one trace part does not contain events // from different threads. epoch0 = RoundUp(epoch1 + 1, kTracePartSize); epoch1 = (u64)-1; new(thr) ThreadState(ctx, tid, unique_id, epoch0, reuse_count, args->stk_addr, args->stk_size, args->tls_addr, args->tls_size); #if !SANITIZER_GO thr->shadow_stack = &ThreadTrace(thr->tid)->shadow_stack[0]; thr->shadow_stack_pos = thr->shadow_stack; thr->shadow_stack_end = thr->shadow_stack + kShadowStackSize; #else // Setup dynamic shadow stack. const int kInitStackSize = 8; thr->shadow_stack = (uptr*)internal_alloc(MBlockShadowStack, kInitStackSize * sizeof(uptr)); thr->shadow_stack_pos = thr->shadow_stack; thr->shadow_stack_end = thr->shadow_stack + kInitStackSize; #endif if (common_flags()->detect_deadlocks) thr->dd_lt = ctx->dd->CreateLogicalThread(unique_id); thr->fast_state.SetHistorySize(flags()->history_size); // Commit switch to the new part of the trace. // TraceAddEvent will reset stack0/mset0 in the new part for us. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); thr->fast_synch_epoch = epoch0; AcquireImpl(thr, 0, &sync); StatInc(thr, StatSyncAcquire); sync.Reset(&thr->proc()->clock_cache); thr->is_inited = true; DPrintf("#%d: ThreadStart epoch=%zu stk_addr=%zx stk_size=%zx " "tls_addr=%zx tls_size=%zx\n", tid, (uptr)epoch0, args->stk_addr, args->stk_size, args->tls_addr, args->tls_size); } void ThreadContext::OnFinished() { #if SANITIZER_GO internal_free(thr->shadow_stack); thr->shadow_stack = nullptr; thr->shadow_stack_pos = nullptr; thr->shadow_stack_end = nullptr; #endif if (!detached) { thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); ReleaseImpl(thr, 0, &sync); } epoch1 = thr->fast_state.epoch(); if (common_flags()->detect_deadlocks) ctx->dd->DestroyLogicalThread(thr->dd_lt); thr->~ThreadState(); #if TSAN_COLLECT_STATS StatAggregate(ctx->stat, thr->stat); #endif thr = 0; } #if !SANITIZER_GO struct ThreadLeak { ThreadContext *tctx; int count; }; static void MaybeReportThreadLeak(ThreadContextBase *tctx_base, void *arg) { Vector &leaks = *(Vector*)arg; ThreadContext *tctx = static_cast(tctx_base); if (tctx->detached || tctx->status != ThreadStatusFinished) return; for (uptr i = 0; i < leaks.Size(); i++) { if (leaks[i].tctx->creation_stack_id == tctx->creation_stack_id) { leaks[i].count++; return; } } ThreadLeak leak = {tctx, 1}; leaks.PushBack(leak); } #endif #if !SANITIZER_GO static void ReportIgnoresEnabled(ThreadContext *tctx, IgnoreSet *set) { if (tctx->tid == 0) { Printf("ThreadSanitizer: main thread finished with ignores enabled\n"); } else { Printf("ThreadSanitizer: thread T%d %s finished with ignores enabled," " created at:\n", tctx->tid, tctx->name); PrintStack(SymbolizeStackId(tctx->creation_stack_id)); } Printf(" One of the following ignores was not ended" " (in order of probability)\n"); for (uptr i = 0; i < set->Size(); i++) { Printf(" Ignore was enabled at:\n"); PrintStack(SymbolizeStackId(set->At(i))); } Die(); } static void ThreadCheckIgnore(ThreadState *thr) { if (ctx->after_multithreaded_fork) return; if (thr->ignore_reads_and_writes) ReportIgnoresEnabled(thr->tctx, &thr->mop_ignore_set); if (thr->ignore_sync) ReportIgnoresEnabled(thr->tctx, &thr->sync_ignore_set); } #else static void ThreadCheckIgnore(ThreadState *thr) {} #endif void ThreadFinalize(ThreadState *thr) { ThreadCheckIgnore(thr); #if !SANITIZER_GO if (!flags()->report_thread_leaks) return; ThreadRegistryLock l(ctx->thread_registry); Vector leaks(MBlockScopedBuf); ctx->thread_registry->RunCallbackForEachThreadLocked( MaybeReportThreadLeak, &leaks); for (uptr i = 0; i < leaks.Size(); i++) { ScopedReport rep(ReportTypeThreadLeak); rep.AddThread(leaks[i].tctx, true); rep.SetCount(leaks[i].count); OutputReport(thr, rep); } #endif } int ThreadCount(ThreadState *thr) { uptr result; ctx->thread_registry->GetNumberOfThreads(0, 0, &result); return (int)result; } int ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached) { StatInc(thr, StatThreadCreate); OnCreatedArgs args = { thr, pc }; u32 parent_tid = thr ? thr->tid : kInvalidTid; // No parent for GCD workers. int tid = ctx->thread_registry->CreateThread(uid, detached, parent_tid, &args); DPrintf("#%d: ThreadCreate tid=%d uid=%zu\n", parent_tid, tid, uid); StatSet(thr, StatThreadMaxAlive, ctx->thread_registry->GetMaxAliveThreads()); return tid; } void ThreadStart(ThreadState *thr, int tid, uptr os_id) { uptr stk_addr = 0; uptr stk_size = 0; uptr tls_addr = 0; uptr tls_size = 0; #if !SANITIZER_GO GetThreadStackAndTls(tid == 0, &stk_addr, &stk_size, &tls_addr, &tls_size); if (tid) { if (stk_addr && stk_size) MemoryRangeImitateWrite(thr, /*pc=*/ 1, stk_addr, stk_size); if (tls_addr && tls_size) { // Check that the thr object is in tls; const uptr thr_beg = (uptr)thr; const uptr thr_end = (uptr)thr + sizeof(*thr); CHECK_GE(thr_beg, tls_addr); CHECK_LE(thr_beg, tls_addr + tls_size); CHECK_GE(thr_end, tls_addr); CHECK_LE(thr_end, tls_addr + tls_size); // Since the thr object is huge, skip it. MemoryRangeImitateWrite(thr, /*pc=*/ 2, tls_addr, thr_beg - tls_addr); MemoryRangeImitateWrite(thr, /*pc=*/ 2, thr_end, tls_addr + tls_size - thr_end); } } #endif ThreadRegistry *tr = ctx->thread_registry; OnStartedArgs args = { thr, stk_addr, stk_size, tls_addr, tls_size }; tr->StartThread(tid, os_id, &args); tr->Lock(); thr->tctx = (ThreadContext*)tr->GetThreadLocked(tid); tr->Unlock(); #if !SANITIZER_GO if (ctx->after_multithreaded_fork) { thr->ignore_interceptors++; ThreadIgnoreBegin(thr, 0); ThreadIgnoreSyncBegin(thr, 0); } #endif } void ThreadFinish(ThreadState *thr) { ThreadCheckIgnore(thr); StatInc(thr, StatThreadFinish); if (thr->stk_addr && thr->stk_size) DontNeedShadowFor(thr->stk_addr, thr->stk_size); if (thr->tls_addr && thr->tls_size) DontNeedShadowFor(thr->tls_addr, thr->tls_size); thr->is_dead = true; ctx->thread_registry->FinishThread(thr->tid); } static bool FindThreadByUid(ThreadContextBase *tctx, void *arg) { uptr uid = (uptr)arg; if (tctx->user_id == uid && tctx->status != ThreadStatusInvalid) { tctx->user_id = 0; return true; } return false; } int ThreadTid(ThreadState *thr, uptr pc, uptr uid) { int res = ctx->thread_registry->FindThread(FindThreadByUid, (void*)uid); DPrintf("#%d: ThreadTid uid=%zu tid=%d\n", thr->tid, uid, res); return res; } void ThreadJoin(ThreadState *thr, uptr pc, int tid) { CHECK_GT(tid, 0); CHECK_LT(tid, kMaxTid); DPrintf("#%d: ThreadJoin tid=%d\n", thr->tid, tid); ctx->thread_registry->JoinThread(tid, thr); } void ThreadDetach(ThreadState *thr, uptr pc, int tid) { CHECK_GT(tid, 0); CHECK_LT(tid, kMaxTid); ctx->thread_registry->DetachThread(tid, thr); } void ThreadSetName(ThreadState *thr, const char *name) { ctx->thread_registry->SetThreadName(thr->tid, name); } void MemoryAccessRange(ThreadState *thr, uptr pc, uptr addr, uptr size, bool is_write) { if (size == 0) return; u64 *shadow_mem = (u64*)MemToShadow(addr); DPrintf2("#%d: MemoryAccessRange: @%p %p size=%d is_write=%d\n", thr->tid, (void*)pc, (void*)addr, (int)size, is_write); #if SANITIZER_DEBUG if (!IsAppMem(addr)) { Printf("Access to non app mem %zx\n", addr); DCHECK(IsAppMem(addr)); } if (!IsAppMem(addr + size - 1)) { Printf("Access to non app mem %zx\n", addr + size - 1); DCHECK(IsAppMem(addr + size - 1)); } if (!IsShadowMem((uptr)shadow_mem)) { Printf("Bad shadow addr %p (%zx)\n", shadow_mem, addr); DCHECK(IsShadowMem((uptr)shadow_mem)); } if (!IsShadowMem((uptr)(shadow_mem + size * kShadowCnt / 8 - 1))) { Printf("Bad shadow addr %p (%zx)\n", shadow_mem + size * kShadowCnt / 8 - 1, addr + size - 1); DCHECK(IsShadowMem((uptr)(shadow_mem + size * kShadowCnt / 8 - 1))); } #endif StatInc(thr, StatMopRange); if (*shadow_mem == kShadowRodata) { // Access to .rodata section, no races here. // Measurements show that it can be 10-20% of all memory accesses. StatInc(thr, StatMopRangeRodata); return; } FastState fast_state = thr->fast_state; if (fast_state.GetIgnoreBit()) return; fast_state.IncrementEpoch(); thr->fast_state = fast_state; TraceAddEvent(thr, fast_state, EventTypeMop, pc); bool unaligned = (addr % kShadowCell) != 0; // Handle unaligned beginning, if any. for (; addr % kShadowCell && size; addr++, size--) { int const kAccessSizeLog = 0; Shadow cur(fast_state); cur.SetWrite(is_write); cur.SetAddr0AndSizeLog(addr & (kShadowCell - 1), kAccessSizeLog); MemoryAccessImpl(thr, addr, kAccessSizeLog, is_write, false, shadow_mem, cur); } if (unaligned) shadow_mem += kShadowCnt; // Handle middle part, if any. for (; size >= kShadowCell; addr += kShadowCell, size -= kShadowCell) { int const kAccessSizeLog = 3; Shadow cur(fast_state); cur.SetWrite(is_write); cur.SetAddr0AndSizeLog(0, kAccessSizeLog); MemoryAccessImpl(thr, addr, kAccessSizeLog, is_write, false, shadow_mem, cur); shadow_mem += kShadowCnt; } // Handle ending, if any. for (; size; addr++, size--) { int const kAccessSizeLog = 0; Shadow cur(fast_state); cur.SetWrite(is_write); cur.SetAddr0AndSizeLog(addr & (kShadowCell - 1), kAccessSizeLog); MemoryAccessImpl(thr, addr, kAccessSizeLog, is_write, false, shadow_mem, cur); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface_ann.h0000664000175000017500000000176712202415665027525 0ustar mwhudsonmwhudson//===-- tsan_interface_ann.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Interface for dynamic annotations. //===----------------------------------------------------------------------===// #ifndef TSAN_INTERFACE_ANN_H #define TSAN_INTERFACE_ANN_H #include // This header should NOT include any other headers. // All functions in this header are extern "C" and start with __tsan_. #ifdef __cplusplus extern "C" { #endif SANITIZER_INTERFACE_ATTRIBUTE void __tsan_acquire(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_release(void *addr); #ifdef __cplusplus } // extern "C" #endif #endif // TSAN_INTERFACE_ANN_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_preinit.cc0000664000175000017500000000174112721626340026531 0ustar mwhudsonmwhudson//===-- tsan_preinit.cc ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer. // // Call __tsan_init at the very early stage of process startup. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_internal_defs.h" #include "tsan_interface.h" #if SANITIZER_CAN_USE_PREINIT_ARRAY // The symbol is called __local_tsan_preinit, because it's not intended to be // exported. // This code linked into the main executable when -fsanitize=thread is in // the link flags. It can only use exported interface functions. __attribute__((section(".preinit_array"), used)) void (*__local_tsan_preinit)(void) = __tsan_init; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interceptors.h0000664000175000017500000000252112725337207027444 0ustar mwhudsonmwhudson#ifndef TSAN_INTERCEPTORS_H #define TSAN_INTERCEPTORS_H #include "sanitizer_common/sanitizer_stacktrace.h" #include "tsan_rtl.h" namespace __tsan { class ScopedInterceptor { public: ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc); ~ScopedInterceptor(); void UserCallbackStart(); void UserCallbackEnd(); private: ThreadState *const thr_; const uptr pc_; bool in_ignored_lib_; }; } // namespace __tsan #define SCOPED_INTERCEPTOR_RAW(func, ...) \ ThreadState *thr = cur_thread(); \ const uptr caller_pc = GET_CALLER_PC(); \ ScopedInterceptor si(thr, #func, caller_pc); \ const uptr pc = StackTrace::GetCurrentPc(); \ (void)pc; \ /**/ #define SCOPED_TSAN_INTERCEPTOR(func, ...) \ SCOPED_INTERCEPTOR_RAW(func, __VA_ARGS__); \ if (REAL(func) == 0) { \ Report("FATAL: ThreadSanitizer: failed to intercept %s\n", #func); \ Die(); \ } \ if (!thr->is_inited || thr->ignore_interceptors || thr->in_ignored_lib) \ return REAL(func)(__VA_ARGS__); \ /**/ #define SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START() \ si.UserCallbackStart(); #define SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END() \ si.UserCallbackEnd(); #define TSAN_INTERCEPTOR(ret, func, ...) INTERCEPTOR(ret, func, __VA_ARGS__) #endif // TSAN_INTERCEPTORS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_platform_posix.cc0000664000175000017500000001207313004730632030120 0ustar mwhudsonmwhudson//===-- tsan_platform_posix.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // POSIX-specific code. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_POSIX #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_procmaps.h" #include "tsan_platform.h" #include "tsan_rtl.h" namespace __tsan { #if !SANITIZER_GO void InitializeShadowMemory() { // Map memory shadow. uptr shadow = (uptr)MmapFixedNoReserve(ShadowBeg(), ShadowEnd() - ShadowBeg(), "shadow"); if (shadow != ShadowBeg()) { Printf("FATAL: ThreadSanitizer can not mmap the shadow memory\n"); Printf("FATAL: Make sure to compile with -fPIE and " "to link with -pie (%p, %p).\n", shadow, ShadowBeg()); Die(); } // This memory range is used for thread stacks and large user mmaps. // Frequently a thread uses only a small part of stack and similarly // a program uses a small part of large mmap. On some programs // we see 20% memory usage reduction without huge pages for this range. // FIXME: don't use constants here. #if defined(__x86_64__) const uptr kMadviseRangeBeg = 0x7f0000000000ull; const uptr kMadviseRangeSize = 0x010000000000ull; #elif defined(__mips64) const uptr kMadviseRangeBeg = 0xff00000000ull; const uptr kMadviseRangeSize = 0x0100000000ull; #elif defined(__aarch64__) uptr kMadviseRangeBeg = 0; uptr kMadviseRangeSize = 0; if (vmaSize == 39) { kMadviseRangeBeg = 0x7d00000000ull; kMadviseRangeSize = 0x0300000000ull; } else if (vmaSize == 42) { kMadviseRangeBeg = 0x3f000000000ull; kMadviseRangeSize = 0x01000000000ull; } else { DCHECK(0); } #elif defined(__powerpc64__) uptr kMadviseRangeBeg = 0; uptr kMadviseRangeSize = 0; if (vmaSize == 44) { kMadviseRangeBeg = 0x0f60000000ull; kMadviseRangeSize = 0x0010000000ull; } else if (vmaSize == 46) { kMadviseRangeBeg = 0x3f0000000000ull; kMadviseRangeSize = 0x010000000000ull; } else { DCHECK(0); } #endif NoHugePagesInRegion(MemToShadow(kMadviseRangeBeg), kMadviseRangeSize * kShadowMultiplier); // Meta shadow is compressing and we don't flush it, // so it makes sense to mark it as NOHUGEPAGE to not over-allocate memory. // On one program it reduces memory consumption from 5GB to 2.5GB. NoHugePagesInRegion(MetaShadowBeg(), MetaShadowEnd() - MetaShadowBeg()); if (common_flags()->use_madv_dontdump) DontDumpShadowMemory(ShadowBeg(), ShadowEnd() - ShadowBeg()); DPrintf("memory shadow: %zx-%zx (%zuGB)\n", ShadowBeg(), ShadowEnd(), (ShadowEnd() - ShadowBeg()) >> 30); // Map meta shadow. uptr meta_size = MetaShadowEnd() - MetaShadowBeg(); uptr meta = (uptr)MmapFixedNoReserve(MetaShadowBeg(), meta_size, "meta shadow"); if (meta != MetaShadowBeg()) { Printf("FATAL: ThreadSanitizer can not mmap the shadow memory\n"); Printf("FATAL: Make sure to compile with -fPIE and " "to link with -pie (%p, %p).\n", meta, MetaShadowBeg()); Die(); } if (common_flags()->use_madv_dontdump) DontDumpShadowMemory(meta, meta_size); DPrintf("meta shadow: %zx-%zx (%zuGB)\n", meta, meta + meta_size, meta_size >> 30); InitializeShadowMemoryPlatform(); } static void ProtectRange(uptr beg, uptr end) { CHECK_LE(beg, end); if (beg == end) return; if (beg != (uptr)MmapFixedNoAccess(beg, end - beg)) { Printf("FATAL: ThreadSanitizer can not protect [%zx,%zx]\n", beg, end); Printf("FATAL: Make sure you are not using unlimited stack\n"); Die(); } } void CheckAndProtect() { // Ensure that the binary is indeed compiled with -pie. MemoryMappingLayout proc_maps(true); uptr p, end, prot; while (proc_maps.Next(&p, &end, 0, 0, 0, &prot)) { if (IsAppMem(p)) continue; if (p >= HeapMemEnd() && p < HeapEnd()) continue; if (prot == 0) // Zero page or mprotected. continue; if (p >= VdsoBeg()) // vdso break; Printf("FATAL: ThreadSanitizer: unexpected memory mapping %p-%p\n", p, end); Die(); } ProtectRange(LoAppMemEnd(), ShadowBeg()); ProtectRange(ShadowEnd(), MetaShadowBeg()); #ifdef TSAN_MID_APP_RANGE ProtectRange(MetaShadowEnd(), MidAppMemBeg()); ProtectRange(MidAppMemEnd(), TraceMemBeg()); #else ProtectRange(MetaShadowEnd(), TraceMemBeg()); #endif // Memory for traces is mapped lazily in MapThreadTrace. // Protect the whole range for now, so that user does not map something here. ProtectRange(TraceMemBeg(), TraceMemEnd()); ProtectRange(TraceMemEnd(), HeapMemBeg()); ProtectRange(HeapEnd(), HiAppMemBeg()); } #endif } // namespace __tsan #endif // SANITIZER_POSIX golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_fd.h0000664000175000017500000000456012543062504025312 0ustar mwhudsonmwhudson//===-- tsan_fd.h -----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // This file handles synchronization via IO. // People use IO for synchronization along the lines of: // // int X; // int client_socket; // initialized elsewhere // int server_socket; // initialized elsewhere // // Thread 1: // X = 42; // send(client_socket, ...); // // Thread 2: // if (recv(server_socket, ...) > 0) // assert(X == 42); // // This file determines the scope of the file descriptor (pipe, socket, // all local files, etc) and executes acquire and release operations on // the scope as necessary. Some scopes are very fine grained (e.g. pipe // operations synchronize only with operations on the same pipe), while // others are corse-grained (e.g. all operations on local files synchronize // with each other). //===----------------------------------------------------------------------===// #ifndef TSAN_FD_H #define TSAN_FD_H #include "tsan_rtl.h" namespace __tsan { void FdInit(); void FdAcquire(ThreadState *thr, uptr pc, int fd); void FdRelease(ThreadState *thr, uptr pc, int fd); void FdAccess(ThreadState *thr, uptr pc, int fd); void FdClose(ThreadState *thr, uptr pc, int fd, bool write = true); void FdFileCreate(ThreadState *thr, uptr pc, int fd); void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd, bool write); void FdPipeCreate(ThreadState *thr, uptr pc, int rfd, int wfd); void FdEventCreate(ThreadState *thr, uptr pc, int fd); void FdSignalCreate(ThreadState *thr, uptr pc, int fd); void FdInotifyCreate(ThreadState *thr, uptr pc, int fd); void FdPollCreate(ThreadState *thr, uptr pc, int fd); void FdSocketCreate(ThreadState *thr, uptr pc, int fd); void FdSocketAccept(ThreadState *thr, uptr pc, int fd, int newfd); void FdSocketConnecting(ThreadState *thr, uptr pc, int fd); void FdSocketConnect(ThreadState *thr, uptr pc, int fd); bool FdLocation(uptr addr, int *fd, int *tid, u32 *stack); void FdOnFork(ThreadState *thr, uptr pc); uptr File2addr(const char *path); uptr Dir2addr(const char *path); } // namespace __tsan #endif // TSAN_INTERFACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_aarch64.S0000664000175000017500000001462112752717420027012 0ustar mwhudsonmwhudson#include "sanitizer_common/sanitizer_asm.h" .section .bss .type __tsan_pointer_chk_guard, %object .size __tsan_pointer_chk_guard, 8 __tsan_pointer_chk_guard: .zero 8 .section .text // GLIBC mangles the function pointers in jmp_buf (used in {set,long}*jmp // functions) by XORing them with a random guard pointer. For AArch64 it is a // global variable rather than a TCB one (as for x86_64/powerpc) and althought // its value is exported by the loader, it lies within a private GLIBC // namespace (meaning it should be only used by GLIBC itself and the ABI is // not stable). So InitializeGuardPtr obtains the pointer guard value by // issuing a setjmp and checking the resulting pointers values against the // original ones. .hidden _Z18InitializeGuardPtrv .global _Z18InitializeGuardPtrv .type _Z18InitializeGuardPtrv, @function _Z18InitializeGuardPtrv: CFI_STARTPROC // Allocates a jmp_buf for the setjmp call. stp x29, x30, [sp, -336]! CFI_DEF_CFA_OFFSET (336) CFI_OFFSET (29, -336) CFI_OFFSET (30, -328) add x29, sp, 0 CFI_DEF_CFA_REGISTER (29) add x0, x29, 24 // Call libc setjmp that mangle the stack pointer value adrp x1, :got:_ZN14__interception12real__setjmpE ldr x1, [x1, #:got_lo12:_ZN14__interception12real__setjmpE] ldr x1, [x1] blr x1 // glibc setjmp mangles both the frame pointer (FP, pc+4 on blr) and the // stack pointer (SP). FP will be placed on ((uintptr*)jmp_buf)[11] and // SP at ((uintptr*)jmp_buf)[13]. // The mangle operation is just 'value' xor 'pointer guard value' and // if we know the original value (SP) and the expected one, we can derive // the guard pointer value. mov x0, sp // Loads the mangled SP pointer. ldr x1, [x29, 128] eor x0, x0, x1 adrp x2, __tsan_pointer_chk_guard str x0, [x2, #:lo12:__tsan_pointer_chk_guard] ldp x29, x30, [sp], 336 CFI_RESTORE (30) CFI_RESTORE (19) CFI_DEF_CFA (31, 0) ret CFI_ENDPROC .size _Z18InitializeGuardPtrv, .-_Z18InitializeGuardPtrv .hidden __tsan_setjmp .comm _ZN14__interception11real_setjmpE,8,8 .type setjmp, @function setjmp: CFI_STARTPROC // save env parameters for function call stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) CFI_OFFSET (29, -32) CFI_OFFSET (30, -24) // Adjust the SP for previous frame add x29, sp, 0 CFI_DEF_CFA_REGISTER (29) // Save jmp_buf str x19, [sp, 16] CFI_OFFSET (19, -16) mov x19, x0 // SP pointer mangling (see glibc setjmp) adrp x2, __tsan_pointer_chk_guard ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard] add x0, x29, 32 eor x1, x2, x0 // call tsan interceptor bl __tsan_setjmp // restore env parameter mov x0, x19 ldr x19, [sp, 16] ldp x29, x30, [sp], 32 CFI_RESTORE (30) CFI_RESTORE (19) CFI_DEF_CFA (31, 0) // tail jump to libc setjmp adrp x1, :got:_ZN14__interception11real_setjmpE ldr x1, [x1, #:got_lo12:_ZN14__interception11real_setjmpE] ldr x1, [x1] br x1 CFI_ENDPROC .size setjmp, .-setjmp .comm _ZN14__interception12real__setjmpE,8,8 .globl _setjmp .type _setjmp, @function _setjmp: CFI_STARTPROC // save env parameters for function call stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) CFI_OFFSET (29, -32) CFI_OFFSET (30, -24) // Adjust the SP for previous frame add x29, sp, 0 CFI_DEF_CFA_REGISTER (29) // Save jmp_buf str x19, [sp, 16] CFI_OFFSET (19, -16) mov x19, x0 // SP pointer mangling (see glibc setjmp) adrp x2, __tsan_pointer_chk_guard ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard] add x0, x29, 32 eor x1, x2, x0 // call tsan interceptor bl __tsan_setjmp // Restore jmp_buf parameter mov x0, x19 ldr x19, [sp, 16] ldp x29, x30, [sp], 32 CFI_RESTORE (30) CFI_RESTORE (19) CFI_DEF_CFA (31, 0) // tail jump to libc setjmp adrp x1, :got:_ZN14__interception12real__setjmpE ldr x1, [x1, #:got_lo12:_ZN14__interception12real__setjmpE] ldr x1, [x1] br x1 CFI_ENDPROC .size _setjmp, .-_setjmp .comm _ZN14__interception14real_sigsetjmpE,8,8 .globl sigsetjmp .type sigsetjmp, @function sigsetjmp: CFI_STARTPROC // save env parameters for function call stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) CFI_OFFSET (29, -32) CFI_OFFSET (30, -24) // Adjust the SP for previous frame add x29, sp, 0 CFI_DEF_CFA_REGISTER (29) // Save jmp_buf and savesigs stp x19, x20, [sp, 16] CFI_OFFSET (19, -16) CFI_OFFSET (20, -8) mov w20, w1 mov x19, x0 // SP pointer mangling (see glibc setjmp) adrp x2, __tsan_pointer_chk_guard ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard] add x0, x29, 32 eor x1, x2, x0 // call tsan interceptor bl __tsan_setjmp // restore env parameter mov w1, w20 mov x0, x19 ldp x19, x20, [sp, 16] ldp x29, x30, [sp], 32 CFI_RESTORE (30) CFI_RESTORE (29) CFI_RESTORE (19) CFI_RESTORE (20) CFI_DEF_CFA (31, 0) // tail jump to libc sigsetjmp adrp x2, :got:_ZN14__interception14real_sigsetjmpE ldr x2, [x2, #:got_lo12:_ZN14__interception14real_sigsetjmpE] ldr x2, [x2] br x2 CFI_ENDPROC .size sigsetjmp, .-sigsetjmp .comm _ZN14__interception16real___sigsetjmpE,8,8 .globl __sigsetjmp .type __sigsetjmp, @function __sigsetjmp: CFI_STARTPROC // save env parameters for function call stp x29, x30, [sp, -32]! CFI_DEF_CFA_OFFSET (32) CFI_OFFSET (29, -32) CFI_OFFSET (30, -24) // Adjust the SP for previous frame add x29, sp, 0 CFI_DEF_CFA_REGISTER (29) // Save jmp_buf and savesigs stp x19, x20, [sp, 16] CFI_OFFSET (19, -16) CFI_OFFSET (20, -8) mov w20, w1 mov x19, x0 // SP pointer mangling (see glibc setjmp) adrp x2, __tsan_pointer_chk_guard ldr x2, [x2, #:lo12:__tsan_pointer_chk_guard] add x0, x29, 32 eor x1, x2, x0 // call tsan interceptor bl __tsan_setjmp mov w1, w20 mov x0, x19 ldp x19, x20, [sp, 16] ldp x29, x30, [sp], 32 CFI_RESTORE (30) CFI_RESTORE (29) CFI_RESTORE (19) CFI_RESTORE (20) CFI_DEF_CFA (31, 0) // tail jump to libc __sigsetjmp adrp x2, :got:_ZN14__interception16real___sigsetjmpE ldr x2, [x2, #:got_lo12:_ZN14__interception16real___sigsetjmpE] ldr x2, [x2] br x2 CFI_ENDPROC .size __sigsetjmp, .-__sigsetjmp #if defined(__linux__) /* We do not need executable stack. */ .section .note.GNU-stack,"",@progbits #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface_ann.cc0000664000175000017500000003316012572026416027655 0ustar mwhudsonmwhudson//===-- tsan_interface_ann.cc ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "tsan_interface_ann.h" #include "tsan_mutex.h" #include "tsan_report.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "tsan_flags.h" #include "tsan_platform.h" #include "tsan_vector.h" #define CALLERPC ((uptr)__builtin_return_address(0)) using namespace __tsan; // NOLINT namespace __tsan { class ScopedAnnotation { public: ScopedAnnotation(ThreadState *thr, const char *aname, const char *f, int l, uptr pc) : thr_(thr) { FuncEntry(thr_, pc); DPrintf("#%d: annotation %s() %s:%d\n", thr_->tid, aname, f, l); } ~ScopedAnnotation() { FuncExit(thr_); CheckNoLocks(thr_); } private: ThreadState *const thr_; }; #define SCOPED_ANNOTATION(typ) \ if (!flags()->enable_annotations) \ return; \ ThreadState *thr = cur_thread(); \ const uptr caller_pc = (uptr)__builtin_return_address(0); \ StatInc(thr, StatAnnotation); \ StatInc(thr, Stat##typ); \ ScopedAnnotation sa(thr, __func__, f, l, caller_pc); \ const uptr pc = StackTrace::GetCurrentPc(); \ (void)pc; \ /**/ static const int kMaxDescLen = 128; struct ExpectRace { ExpectRace *next; ExpectRace *prev; atomic_uintptr_t hitcount; atomic_uintptr_t addcount; uptr addr; uptr size; char *file; int line; char desc[kMaxDescLen]; }; struct DynamicAnnContext { Mutex mtx; ExpectRace expect; ExpectRace benign; DynamicAnnContext() : mtx(MutexTypeAnnotations, StatMtxAnnotations) { } }; static DynamicAnnContext *dyn_ann_ctx; static char dyn_ann_ctx_placeholder[sizeof(DynamicAnnContext)] ALIGNED(64); static void AddExpectRace(ExpectRace *list, char *f, int l, uptr addr, uptr size, char *desc) { ExpectRace *race = list->next; for (; race != list; race = race->next) { if (race->addr == addr && race->size == size) { atomic_store_relaxed(&race->addcount, atomic_load_relaxed(&race->addcount) + 1); return; } } race = (ExpectRace*)internal_alloc(MBlockExpectRace, sizeof(ExpectRace)); race->addr = addr; race->size = size; race->file = f; race->line = l; race->desc[0] = 0; atomic_store_relaxed(&race->hitcount, 0); atomic_store_relaxed(&race->addcount, 1); if (desc) { int i = 0; for (; i < kMaxDescLen - 1 && desc[i]; i++) race->desc[i] = desc[i]; race->desc[i] = 0; } race->prev = list; race->next = list->next; race->next->prev = race; list->next = race; } static ExpectRace *FindRace(ExpectRace *list, uptr addr, uptr size) { for (ExpectRace *race = list->next; race != list; race = race->next) { uptr maxbegin = max(race->addr, addr); uptr minend = min(race->addr + race->size, addr + size); if (maxbegin < minend) return race; } return 0; } static bool CheckContains(ExpectRace *list, uptr addr, uptr size) { ExpectRace *race = FindRace(list, addr, size); if (race == 0) return false; DPrintf("Hit expected/benign race: %s addr=%zx:%d %s:%d\n", race->desc, race->addr, (int)race->size, race->file, race->line); atomic_fetch_add(&race->hitcount, 1, memory_order_relaxed); return true; } static void InitList(ExpectRace *list) { list->next = list; list->prev = list; } void InitializeDynamicAnnotations() { dyn_ann_ctx = new(dyn_ann_ctx_placeholder) DynamicAnnContext; InitList(&dyn_ann_ctx->expect); InitList(&dyn_ann_ctx->benign); } bool IsExpectedReport(uptr addr, uptr size) { ReadLock lock(&dyn_ann_ctx->mtx); if (CheckContains(&dyn_ann_ctx->expect, addr, size)) return true; if (CheckContains(&dyn_ann_ctx->benign, addr, size)) return true; return false; } static void CollectMatchedBenignRaces(Vector *matched, int *unique_count, int *hit_count, atomic_uintptr_t ExpectRace::*counter) { ExpectRace *list = &dyn_ann_ctx->benign; for (ExpectRace *race = list->next; race != list; race = race->next) { (*unique_count)++; const uptr cnt = atomic_load_relaxed(&(race->*counter)); if (cnt == 0) continue; *hit_count += cnt; uptr i = 0; for (; i < matched->Size(); i++) { ExpectRace *race0 = &(*matched)[i]; if (race->line == race0->line && internal_strcmp(race->file, race0->file) == 0 && internal_strcmp(race->desc, race0->desc) == 0) { atomic_fetch_add(&(race0->*counter), cnt, memory_order_relaxed); break; } } if (i == matched->Size()) matched->PushBack(*race); } } void PrintMatchedBenignRaces() { Lock lock(&dyn_ann_ctx->mtx); int unique_count = 0; int hit_count = 0; int add_count = 0; Vector hit_matched(MBlockScopedBuf); CollectMatchedBenignRaces(&hit_matched, &unique_count, &hit_count, &ExpectRace::hitcount); Vector add_matched(MBlockScopedBuf); CollectMatchedBenignRaces(&add_matched, &unique_count, &add_count, &ExpectRace::addcount); if (hit_matched.Size()) { Printf("ThreadSanitizer: Matched %d \"benign\" races (pid=%d):\n", hit_count, (int)internal_getpid()); for (uptr i = 0; i < hit_matched.Size(); i++) { Printf("%d %s:%d %s\n", atomic_load_relaxed(&hit_matched[i].hitcount), hit_matched[i].file, hit_matched[i].line, hit_matched[i].desc); } } if (hit_matched.Size()) { Printf("ThreadSanitizer: Annotated %d \"benign\" races, %d unique" " (pid=%d):\n", add_count, unique_count, (int)internal_getpid()); for (uptr i = 0; i < add_matched.Size(); i++) { Printf("%d %s:%d %s\n", atomic_load_relaxed(&add_matched[i].addcount), add_matched[i].file, add_matched[i].line, add_matched[i].desc); } } } static void ReportMissedExpectedRace(ExpectRace *race) { Printf("==================\n"); Printf("WARNING: ThreadSanitizer: missed expected data race\n"); Printf(" %s addr=%zx %s:%d\n", race->desc, race->addr, race->file, race->line); Printf("==================\n"); } } // namespace __tsan using namespace __tsan; // NOLINT extern "C" { void INTERFACE_ATTRIBUTE AnnotateHappensBefore(char *f, int l, uptr addr) { SCOPED_ANNOTATION(AnnotateHappensBefore); Release(thr, pc, addr); } void INTERFACE_ATTRIBUTE AnnotateHappensAfter(char *f, int l, uptr addr) { SCOPED_ANNOTATION(AnnotateHappensAfter); Acquire(thr, pc, addr); } void INTERFACE_ATTRIBUTE AnnotateCondVarSignal(char *f, int l, uptr cv) { SCOPED_ANNOTATION(AnnotateCondVarSignal); } void INTERFACE_ATTRIBUTE AnnotateCondVarSignalAll(char *f, int l, uptr cv) { SCOPED_ANNOTATION(AnnotateCondVarSignalAll); } void INTERFACE_ATTRIBUTE AnnotateMutexIsNotPHB(char *f, int l, uptr mu) { SCOPED_ANNOTATION(AnnotateMutexIsNotPHB); } void INTERFACE_ATTRIBUTE AnnotateCondVarWait(char *f, int l, uptr cv, uptr lock) { SCOPED_ANNOTATION(AnnotateCondVarWait); } void INTERFACE_ATTRIBUTE AnnotateRWLockCreate(char *f, int l, uptr m) { SCOPED_ANNOTATION(AnnotateRWLockCreate); MutexCreate(thr, pc, m, true, true, false); } void INTERFACE_ATTRIBUTE AnnotateRWLockCreateStatic(char *f, int l, uptr m) { SCOPED_ANNOTATION(AnnotateRWLockCreateStatic); MutexCreate(thr, pc, m, true, true, true); } void INTERFACE_ATTRIBUTE AnnotateRWLockDestroy(char *f, int l, uptr m) { SCOPED_ANNOTATION(AnnotateRWLockDestroy); MutexDestroy(thr, pc, m); } void INTERFACE_ATTRIBUTE AnnotateRWLockAcquired(char *f, int l, uptr m, uptr is_w) { SCOPED_ANNOTATION(AnnotateRWLockAcquired); if (is_w) MutexLock(thr, pc, m); else MutexReadLock(thr, pc, m); } void INTERFACE_ATTRIBUTE AnnotateRWLockReleased(char *f, int l, uptr m, uptr is_w) { SCOPED_ANNOTATION(AnnotateRWLockReleased); if (is_w) MutexUnlock(thr, pc, m); else MutexReadUnlock(thr, pc, m); } void INTERFACE_ATTRIBUTE AnnotateTraceMemory(char *f, int l, uptr mem) { SCOPED_ANNOTATION(AnnotateTraceMemory); } void INTERFACE_ATTRIBUTE AnnotateFlushState(char *f, int l) { SCOPED_ANNOTATION(AnnotateFlushState); } void INTERFACE_ATTRIBUTE AnnotateNewMemory(char *f, int l, uptr mem, uptr size) { SCOPED_ANNOTATION(AnnotateNewMemory); } void INTERFACE_ATTRIBUTE AnnotateNoOp(char *f, int l, uptr mem) { SCOPED_ANNOTATION(AnnotateNoOp); } void INTERFACE_ATTRIBUTE AnnotateFlushExpectedRaces(char *f, int l) { SCOPED_ANNOTATION(AnnotateFlushExpectedRaces); Lock lock(&dyn_ann_ctx->mtx); while (dyn_ann_ctx->expect.next != &dyn_ann_ctx->expect) { ExpectRace *race = dyn_ann_ctx->expect.next; if (atomic_load_relaxed(&race->hitcount) == 0) { ctx->nmissed_expected++; ReportMissedExpectedRace(race); } race->prev->next = race->next; race->next->prev = race->prev; internal_free(race); } } void INTERFACE_ATTRIBUTE AnnotateEnableRaceDetection( char *f, int l, int enable) { SCOPED_ANNOTATION(AnnotateEnableRaceDetection); // FIXME: Reconsider this functionality later. It may be irrelevant. } void INTERFACE_ATTRIBUTE AnnotateMutexIsUsedAsCondVar( char *f, int l, uptr mu) { SCOPED_ANNOTATION(AnnotateMutexIsUsedAsCondVar); } void INTERFACE_ATTRIBUTE AnnotatePCQGet( char *f, int l, uptr pcq) { SCOPED_ANNOTATION(AnnotatePCQGet); } void INTERFACE_ATTRIBUTE AnnotatePCQPut( char *f, int l, uptr pcq) { SCOPED_ANNOTATION(AnnotatePCQPut); } void INTERFACE_ATTRIBUTE AnnotatePCQDestroy( char *f, int l, uptr pcq) { SCOPED_ANNOTATION(AnnotatePCQDestroy); } void INTERFACE_ATTRIBUTE AnnotatePCQCreate( char *f, int l, uptr pcq) { SCOPED_ANNOTATION(AnnotatePCQCreate); } void INTERFACE_ATTRIBUTE AnnotateExpectRace( char *f, int l, uptr mem, char *desc) { SCOPED_ANNOTATION(AnnotateExpectRace); Lock lock(&dyn_ann_ctx->mtx); AddExpectRace(&dyn_ann_ctx->expect, f, l, mem, 1, desc); DPrintf("Add expected race: %s addr=%zx %s:%d\n", desc, mem, f, l); } static void BenignRaceImpl( char *f, int l, uptr mem, uptr size, char *desc) { Lock lock(&dyn_ann_ctx->mtx); AddExpectRace(&dyn_ann_ctx->benign, f, l, mem, size, desc); DPrintf("Add benign race: %s addr=%zx %s:%d\n", desc, mem, f, l); } // FIXME: Turn it off later. WTF is benign race?1?? Go talk to Hans Boehm. void INTERFACE_ATTRIBUTE AnnotateBenignRaceSized( char *f, int l, uptr mem, uptr size, char *desc) { SCOPED_ANNOTATION(AnnotateBenignRaceSized); BenignRaceImpl(f, l, mem, size, desc); } void INTERFACE_ATTRIBUTE AnnotateBenignRace( char *f, int l, uptr mem, char *desc) { SCOPED_ANNOTATION(AnnotateBenignRace); BenignRaceImpl(f, l, mem, 1, desc); } void INTERFACE_ATTRIBUTE AnnotateIgnoreReadsBegin(char *f, int l) { SCOPED_ANNOTATION(AnnotateIgnoreReadsBegin); ThreadIgnoreBegin(thr, pc); } void INTERFACE_ATTRIBUTE AnnotateIgnoreReadsEnd(char *f, int l) { SCOPED_ANNOTATION(AnnotateIgnoreReadsEnd); ThreadIgnoreEnd(thr, pc); } void INTERFACE_ATTRIBUTE AnnotateIgnoreWritesBegin(char *f, int l) { SCOPED_ANNOTATION(AnnotateIgnoreWritesBegin); ThreadIgnoreBegin(thr, pc); } void INTERFACE_ATTRIBUTE AnnotateIgnoreWritesEnd(char *f, int l) { SCOPED_ANNOTATION(AnnotateIgnoreWritesEnd); ThreadIgnoreEnd(thr, pc); } void INTERFACE_ATTRIBUTE AnnotateIgnoreSyncBegin(char *f, int l) { SCOPED_ANNOTATION(AnnotateIgnoreSyncBegin); ThreadIgnoreSyncBegin(thr, pc); } void INTERFACE_ATTRIBUTE AnnotateIgnoreSyncEnd(char *f, int l) { SCOPED_ANNOTATION(AnnotateIgnoreSyncEnd); ThreadIgnoreSyncEnd(thr, pc); } void INTERFACE_ATTRIBUTE AnnotatePublishMemoryRange( char *f, int l, uptr addr, uptr size) { SCOPED_ANNOTATION(AnnotatePublishMemoryRange); } void INTERFACE_ATTRIBUTE AnnotateUnpublishMemoryRange( char *f, int l, uptr addr, uptr size) { SCOPED_ANNOTATION(AnnotateUnpublishMemoryRange); } void INTERFACE_ATTRIBUTE AnnotateThreadName( char *f, int l, char *name) { SCOPED_ANNOTATION(AnnotateThreadName); ThreadSetName(thr, name); } // We deliberately omit the implementation of WTFAnnotateHappensBefore() and // WTFAnnotateHappensAfter(). Those are being used by Webkit to annotate // atomic operations, which should be handled by ThreadSanitizer correctly. void INTERFACE_ATTRIBUTE WTFAnnotateHappensBefore(char *f, int l, uptr addr) { SCOPED_ANNOTATION(AnnotateHappensBefore); } void INTERFACE_ATTRIBUTE WTFAnnotateHappensAfter(char *f, int l, uptr addr) { SCOPED_ANNOTATION(AnnotateHappensAfter); } void INTERFACE_ATTRIBUTE WTFAnnotateBenignRaceSized( char *f, int l, uptr mem, uptr sz, char *desc) { SCOPED_ANNOTATION(AnnotateBenignRaceSized); BenignRaceImpl(f, l, mem, sz, desc); } int INTERFACE_ATTRIBUTE RunningOnValgrind() { return flags()->running_on_valgrind; } double __attribute__((weak)) INTERFACE_ATTRIBUTE ValgrindSlowdown(void) { return 10.0; } const char INTERFACE_ATTRIBUTE* ThreadSanitizerQuery(const char *query) { if (internal_strcmp(query, "pure_happens_before") == 0) return "1"; else return "0"; } void INTERFACE_ATTRIBUTE AnnotateMemoryIsInitialized(char *f, int l, uptr mem, uptr sz) {} void INTERFACE_ATTRIBUTE AnnotateMemoryIsUninitialized(char *f, int l, uptr mem, uptr sz) {} } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_stack_trace.h0000664000175000017500000000215212426000160027165 0ustar mwhudsonmwhudson//===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_STACK_TRACE_H #define TSAN_STACK_TRACE_H #include "sanitizer_common/sanitizer_stacktrace.h" #include "tsan_defs.h" namespace __tsan { // StackTrace which calls malloc/free to allocate the buffer for // addresses in stack traces. struct VarSizeStackTrace : public StackTrace { uptr *trace_buffer; // Owned. VarSizeStackTrace(); ~VarSizeStackTrace(); void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0); private: void ResizeBuffer(uptr new_size); VarSizeStackTrace(const VarSizeStackTrace &); void operator=(const VarSizeStackTrace &); }; } // namespace __tsan #endif // TSAN_STACK_TRACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface.h0000664000175000017500000003654513004730632026666 0ustar mwhudsonmwhudson//===-- tsan_interface.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // The functions declared in this header will be inserted by the instrumentation // module. // This header can be included by the instrumented program or by TSan tests. //===----------------------------------------------------------------------===// #ifndef TSAN_INTERFACE_H #define TSAN_INTERFACE_H #include using __sanitizer::uptr; // This header should NOT include any other headers. // All functions in this header are extern "C" and start with __tsan_. #ifdef __cplusplus extern "C" { #endif #if !SANITIZER_GO // This function should be called at the very beginning of the process, // before any instrumented code is executed and before any call to malloc. SANITIZER_INTERFACE_ATTRIBUTE void __tsan_init(); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read1(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read2(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read4(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read8(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read16(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write1(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write2(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write4(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write8(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write16(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read2(const void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read4(const void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read8(const void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_read16(const void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write2(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write4(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write8(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_unaligned_write16(void *addr); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read1_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read2_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read4_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read8_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read16_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write1_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write2_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write4_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write8_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write16_pc(void *addr, void *pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_vptr_read(void **vptr_p); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_vptr_update(void **vptr_p, void *new_val); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_entry(void *call_pc); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_exit(); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read_range(void *addr, unsigned long size); // NOLINT SANITIZER_INTERFACE_ATTRIBUTE void __tsan_write_range(void *addr, unsigned long size); // NOLINT // User may provide function that would be called right when TSan detects // an error. The argument 'report' is an opaque pointer that can be used to // gather additional information using other TSan report API functions. SANITIZER_INTERFACE_ATTRIBUTE void __tsan_on_report(void *report); // If TSan is currently reporting a detected issue on the current thread, // returns an opaque pointer to the current report. Otherwise returns NULL. SANITIZER_INTERFACE_ATTRIBUTE void *__tsan_get_current_report(); // Returns a report's description (issue type), number of duplicate issues // found, counts of array data (stack traces, memory operations, locations, // mutexes, threads, unique thread IDs) and a stack trace of a sleep() call (if // one was involved in the issue). SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_data(void *report, const char **description, int *count, int *stack_count, int *mop_count, int *loc_count, int *mutex_count, int *thread_count, int *unique_tid_count, void **sleep_trace, uptr trace_size); // Returns information about stack traces included in the report. SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_stack(void *report, uptr idx, void **trace, uptr trace_size); // Returns information about memory operations included in the report. SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_mop(void *report, uptr idx, int *tid, void **addr, int *size, int *write, int *atomic, void **trace, uptr trace_size); // Returns information about locations included in the report. SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_loc(void *report, uptr idx, const char **type, void **addr, uptr *start, uptr *size, int *tid, int *fd, int *suppressable, void **trace, uptr trace_size); // Returns information about mutexes included in the report. SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr, int *destroyed, void **trace, uptr trace_size); // Returns information about threads included in the report. SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_thread(void *report, uptr idx, int *tid, uptr *os_id, int *running, const char **name, int *parent_tid, void **trace, uptr trace_size); // Returns information about unique thread IDs included in the report. SANITIZER_INTERFACE_ATTRIBUTE int __tsan_get_report_unique_tid(void *report, uptr idx, int *tid); #endif // SANITIZER_GO #ifdef __cplusplus } // extern "C" #endif namespace __tsan { // These should match declarations from public tsan_interface_atomic.h header. typedef unsigned char a8; typedef unsigned short a16; // NOLINT typedef unsigned int a32; typedef unsigned long long a64; // NOLINT #if !SANITIZER_GO && (defined(__SIZEOF_INT128__) \ || (__clang_major__ * 100 + __clang_minor__ >= 302)) && !defined(__mips64) __extension__ typedef __int128 a128; # define __TSAN_HAS_INT128 1 #else # define __TSAN_HAS_INT128 0 #endif // Part of ABI, do not change. // http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?view=markup typedef enum { mo_relaxed, mo_consume, mo_acquire, mo_release, mo_acq_rel, mo_seq_cst } morder; struct ThreadState; extern "C" { SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_load(const volatile a8 *a, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_load(const volatile a16 *a, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_load(const volatile a32 *a, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_load(const volatile a64 *a, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_load(const volatile a128 *a, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic8_store(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic16_store(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic32_store(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic64_store(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic128_store(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_exchange(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_exchange(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_exchange(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_exchange(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_exchange(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_add(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_add(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_add(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_add(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_add(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_sub(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_sub(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_sub(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_sub(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_sub(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_and(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_and(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_and(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_and(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_and(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_or(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_or(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_or(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_or(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_or(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_xor(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_xor(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_xor(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_xor(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_xor(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_nand(volatile a8 *a, a8 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_nand(volatile a16 *a, a16 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_nand(volatile a32 *a, a32 v, morder mo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_nand(volatile a64 *a, a64 v, morder mo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_nand(volatile a128 *a, a128 v, morder mo); #endif SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic8_compare_exchange_strong(volatile a8 *a, a8 *c, a8 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic16_compare_exchange_strong(volatile a16 *a, a16 *c, a16 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic32_compare_exchange_strong(volatile a32 *a, a32 *c, a32 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic64_compare_exchange_strong(volatile a64 *a, a64 *c, a64 v, morder mo, morder fmo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic128_compare_exchange_strong(volatile a128 *a, a128 *c, a128 v, morder mo, morder fmo); #endif SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic8_compare_exchange_weak(volatile a8 *a, a8 *c, a8 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic16_compare_exchange_weak(volatile a16 *a, a16 *c, a16 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic32_compare_exchange_weak(volatile a32 *a, a32 *c, a32 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic64_compare_exchange_weak(volatile a64 *a, a64 *c, a64 v, morder mo, morder fmo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic128_compare_exchange_weak(volatile a128 *a, a128 *c, a128 v, morder mo, morder fmo); #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_compare_exchange_val(volatile a8 *a, a8 c, a8 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_compare_exchange_val(volatile a16 *a, a16 c, a16 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_compare_exchange_val(volatile a32 *a, a32 c, a32 v, morder mo, morder fmo); SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_compare_exchange_val(volatile a64 *a, a64 c, a64 v, morder mo, morder fmo); #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_compare_exchange_val(volatile a128 *a, a128 c, a128 v, morder mo, morder fmo); #endif SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic_thread_fence(morder mo); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic_signal_fence(morder mo); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_compare_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_compare_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a); } // extern "C" } // namespace __tsan #endif // TSAN_INTERFACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_fd.cc0000664000175000017500000002171212543062504025446 0ustar mwhudsonmwhudson//===-- tsan_fd.cc --------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_fd.h" #include "tsan_rtl.h" #include namespace __tsan { const int kTableSizeL1 = 1024; const int kTableSizeL2 = 1024; const int kTableSize = kTableSizeL1 * kTableSizeL2; struct FdSync { atomic_uint64_t rc; }; struct FdDesc { FdSync *sync; int creation_tid; u32 creation_stack; }; struct FdContext { atomic_uintptr_t tab[kTableSizeL1]; // Addresses used for synchronization. FdSync globsync; FdSync filesync; FdSync socksync; u64 connectsync; }; static FdContext fdctx; static bool bogusfd(int fd) { // Apparently a bogus fd value. return fd < 0 || fd >= kTableSize; } static FdSync *allocsync(ThreadState *thr, uptr pc) { FdSync *s = (FdSync*)user_alloc(thr, pc, sizeof(FdSync), kDefaultAlignment, false); atomic_store(&s->rc, 1, memory_order_relaxed); return s; } static FdSync *ref(FdSync *s) { if (s && atomic_load(&s->rc, memory_order_relaxed) != (u64)-1) atomic_fetch_add(&s->rc, 1, memory_order_relaxed); return s; } static void unref(ThreadState *thr, uptr pc, FdSync *s) { if (s && atomic_load(&s->rc, memory_order_relaxed) != (u64)-1) { if (atomic_fetch_sub(&s->rc, 1, memory_order_acq_rel) == 1) { CHECK_NE(s, &fdctx.globsync); CHECK_NE(s, &fdctx.filesync); CHECK_NE(s, &fdctx.socksync); user_free(thr, pc, s, false); } } } static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { CHECK_GE(fd, 0); CHECK_LT(fd, kTableSize); atomic_uintptr_t *pl1 = &fdctx.tab[fd / kTableSizeL2]; uptr l1 = atomic_load(pl1, memory_order_consume); if (l1 == 0) { uptr size = kTableSizeL2 * sizeof(FdDesc); // We need this to reside in user memory to properly catch races on it. void *p = user_alloc(thr, pc, size, kDefaultAlignment, false); internal_memset(p, 0, size); MemoryResetRange(thr, (uptr)&fddesc, (uptr)p, size); if (atomic_compare_exchange_strong(pl1, &l1, (uptr)p, memory_order_acq_rel)) l1 = (uptr)p; else user_free(thr, pc, p, false); } return &((FdDesc*)l1)[fd % kTableSizeL2]; // NOLINT } // pd must be already ref'ed. static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, bool write = true) { FdDesc *d = fddesc(thr, pc, fd); // As a matter of fact, we don't intercept all close calls. // See e.g. libc __res_iclose(). if (d->sync) { unref(thr, pc, d->sync); d->sync = 0; } if (flags()->io_sync == 0) { unref(thr, pc, s); } else if (flags()->io_sync == 1) { d->sync = s; } else if (flags()->io_sync == 2) { unref(thr, pc, s); d->sync = &fdctx.globsync; } d->creation_tid = thr->tid; d->creation_stack = CurrentStackId(thr, pc); if (write) { // To catch races between fd usage and open. MemoryRangeImitateWrite(thr, pc, (uptr)d, 8); } else { // See the dup-related comment in FdClose. MemoryRead(thr, pc, (uptr)d, kSizeLog8); } } void FdInit() { atomic_store(&fdctx.globsync.rc, (u64)-1, memory_order_relaxed); atomic_store(&fdctx.filesync.rc, (u64)-1, memory_order_relaxed); atomic_store(&fdctx.socksync.rc, (u64)-1, memory_order_relaxed); } void FdOnFork(ThreadState *thr, uptr pc) { // On fork() we need to reset all fd's, because the child is going // close all them, and that will cause races between previous read/write // and the close. for (int l1 = 0; l1 < kTableSizeL1; l1++) { FdDesc *tab = (FdDesc*)atomic_load(&fdctx.tab[l1], memory_order_relaxed); if (tab == 0) break; for (int l2 = 0; l2 < kTableSizeL2; l2++) { FdDesc *d = &tab[l2]; MemoryResetRange(thr, pc, (uptr)d, 8); } } } bool FdLocation(uptr addr, int *fd, int *tid, u32 *stack) { for (int l1 = 0; l1 < kTableSizeL1; l1++) { FdDesc *tab = (FdDesc*)atomic_load(&fdctx.tab[l1], memory_order_relaxed); if (tab == 0) break; if (addr >= (uptr)tab && addr < (uptr)(tab + kTableSizeL2)) { int l2 = (addr - (uptr)tab) / sizeof(FdDesc); FdDesc *d = &tab[l2]; *fd = l1 * kTableSizeL1 + l2; *tid = d->creation_tid; *stack = d->creation_stack; return true; } } return false; } void FdAcquire(ThreadState *thr, uptr pc, int fd) { if (bogusfd(fd)) return; FdDesc *d = fddesc(thr, pc, fd); FdSync *s = d->sync; DPrintf("#%d: FdAcquire(%d) -> %p\n", thr->tid, fd, s); MemoryRead(thr, pc, (uptr)d, kSizeLog8); if (s) Acquire(thr, pc, (uptr)s); } void FdRelease(ThreadState *thr, uptr pc, int fd) { if (bogusfd(fd)) return; FdDesc *d = fddesc(thr, pc, fd); FdSync *s = d->sync; DPrintf("#%d: FdRelease(%d) -> %p\n", thr->tid, fd, s); MemoryRead(thr, pc, (uptr)d, kSizeLog8); if (s) Release(thr, pc, (uptr)s); } void FdAccess(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdAccess(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; FdDesc *d = fddesc(thr, pc, fd); MemoryRead(thr, pc, (uptr)d, kSizeLog8); } void FdClose(ThreadState *thr, uptr pc, int fd, bool write) { DPrintf("#%d: FdClose(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; FdDesc *d = fddesc(thr, pc, fd); if (write) { // To catch races between fd usage and close. MemoryWrite(thr, pc, (uptr)d, kSizeLog8); } else { // This path is used only by dup2/dup3 calls. // We do read instead of write because there is a number of legitimate // cases where write would lead to false positives: // 1. Some software dups a closed pipe in place of a socket before closing // the socket (to prevent races actually). // 2. Some daemons dup /dev/null in place of stdin/stdout. // On the other hand we have not seen cases when write here catches real // bugs. MemoryRead(thr, pc, (uptr)d, kSizeLog8); } // We need to clear it, because if we do not intercept any call out there // that creates fd, we will hit false postives. MemoryResetRange(thr, pc, (uptr)d, 8); unref(thr, pc, d->sync); d->sync = 0; d->creation_tid = 0; d->creation_stack = 0; } void FdFileCreate(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdFileCreate(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; init(thr, pc, fd, &fdctx.filesync); } void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd, bool write) { DPrintf("#%d: FdDup(%d, %d)\n", thr->tid, oldfd, newfd); if (bogusfd(oldfd) || bogusfd(newfd)) return; // Ignore the case when user dups not yet connected socket. FdDesc *od = fddesc(thr, pc, oldfd); MemoryRead(thr, pc, (uptr)od, kSizeLog8); FdClose(thr, pc, newfd, write); init(thr, pc, newfd, ref(od->sync), write); } void FdPipeCreate(ThreadState *thr, uptr pc, int rfd, int wfd) { DPrintf("#%d: FdCreatePipe(%d, %d)\n", thr->tid, rfd, wfd); FdSync *s = allocsync(thr, pc); init(thr, pc, rfd, ref(s)); init(thr, pc, wfd, ref(s)); unref(thr, pc, s); } void FdEventCreate(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdEventCreate(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; init(thr, pc, fd, allocsync(thr, pc)); } void FdSignalCreate(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdSignalCreate(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; init(thr, pc, fd, 0); } void FdInotifyCreate(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdInotifyCreate(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; init(thr, pc, fd, 0); } void FdPollCreate(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdPollCreate(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; init(thr, pc, fd, allocsync(thr, pc)); } void FdSocketCreate(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdSocketCreate(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; // It can be a UDP socket. init(thr, pc, fd, &fdctx.socksync); } void FdSocketAccept(ThreadState *thr, uptr pc, int fd, int newfd) { DPrintf("#%d: FdSocketAccept(%d, %d)\n", thr->tid, fd, newfd); if (bogusfd(fd)) return; // Synchronize connect->accept. Acquire(thr, pc, (uptr)&fdctx.connectsync); init(thr, pc, newfd, &fdctx.socksync); } void FdSocketConnecting(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdSocketConnecting(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; // Synchronize connect->accept. Release(thr, pc, (uptr)&fdctx.connectsync); } void FdSocketConnect(ThreadState *thr, uptr pc, int fd) { DPrintf("#%d: FdSocketConnect(%d)\n", thr->tid, fd); if (bogusfd(fd)) return; init(thr, pc, fd, &fdctx.socksync); } uptr File2addr(const char *path) { (void)path; static u64 addr; return (uptr)&addr; } uptr Dir2addr(const char *path) { (void)path; static u64 addr; return (uptr)&addr; } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_mips64.S0000664000175000017500000000727712754517560026722 0ustar mwhudsonmwhudson.section .text .set noreorder .hidden __tsan_setjmp .comm _ZN14__interception11real_setjmpE,8,8 .globl setjmp .type setjmp, @function setjmp: // save env parameters daddiu $sp,$sp,-40 sd $s0,32($sp) sd $ra,24($sp) sd $fp,16($sp) sd $gp,8($sp) // calculate and save pointer to GOT lui $gp,%hi(%neg(%gp_rel(setjmp))) daddu $gp,$gp,$t9 daddiu $gp,$gp,%lo(%neg(%gp_rel(setjmp))) move $s0,$gp // save jmp_buf sd $a0,0($sp) // obtain $sp dadd $a0,$zero,$sp // call tsan interceptor jal __tsan_setjmp daddiu $a1,$a0,40 // restore jmp_buf ld $a0,0($sp) // restore gp move $gp,$s0 // load pointer of libc setjmp to t9 dla $t9,(_ZN14__interception11real_setjmpE) // restore env parameters ld $gp,8($sp) ld $fp,16($sp) ld $ra,24($sp) ld $s0,32($sp) daddiu $sp,$sp,40 // tail jump to libc setjmp ld $t9,0($t9) jr $t9 nop .size setjmp, .-setjmp .hidden __tsan_setjmp .globl _setjmp .comm _ZN14__interception12real__setjmpE,8,8 .type _setjmp, @function _setjmp: // Save env parameters daddiu $sp,$sp,-40 sd $s0,32($sp) sd $ra,24($sp) sd $fp,16($sp) sd $gp,8($sp) // calculate and save pointer to GOT lui $gp,%hi(%neg(%gp_rel(_setjmp))) daddu $gp,$gp,$t9 daddiu $gp,$gp,%lo(%neg(%gp_rel(_setjmp))) move $s0,$gp // save jmp_buf sd $a0,0($sp) // obtain $sp dadd $a0,$zero,$sp // call tsan interceptor jal __tsan_setjmp daddiu $a1,$a0,40 // restore jmp_buf ld $a0,0($sp) // restore gp move $gp,$s0 // load pointer of libc _setjmp to t9 dla $t9,(_ZN14__interception12real__setjmpE) // restore env parameters ld $gp,8($sp) ld $fp,16($sp) ld $ra,24($sp) ld $s0,32($sp) daddiu $sp,$sp,40 // tail jump to libc _setjmp ld $t9,0($t9) jr $t9 nop .size _setjmp, .-_setjmp .hidden __tsan_setjmp .globl sigsetjmp .comm _ZN14__interception14real_sigsetjmpE,8,8 .type sigsetjmp, @function sigsetjmp: // Save env parameters daddiu $sp,$sp,-48 sd $s0,40($sp) sd $ra,32($sp) sd $fp,24($sp) sd $gp,16($sp) // calculate and save pointer to GOT lui $gp,%hi(%neg(%gp_rel(sigsetjmp))) daddu $gp,$gp,$t9 daddiu $gp,$gp,%lo(%neg(%gp_rel(sigsetjmp))) move $s0,$gp // save jmp_buf and savesig sd $a0,0($sp) sd $a1,8($sp) // obtain $sp dadd $a0,$zero,$sp // call tsan interceptor jal __tsan_setjmp daddiu $a1,$a0,48 // restore jmp_buf and savesig ld $a0,0($sp) ld $a1,8($sp) // restore gp move $gp,$s0 // load pointer of libc sigsetjmp to t9 dla $t9,(_ZN14__interception14real_sigsetjmpE) // restore env parameters ld $gp,16($sp) ld $fp,24($sp) ld $ra,32($sp) ld $s0,40($sp) daddiu $sp,$sp,48 // tail jump to libc sigsetjmp ld $t9,0($t9) jr $t9 nop .size sigsetjmp, .-sigsetjmp .hidden __tsan_setjmp .comm _ZN14__interception16real___sigsetjmpE,8,8 .globl __sigsetjmp .type __sigsetjmp, @function __sigsetjmp: // Save env parameters daddiu $sp,$sp,-48 sd $s0,40($sp) sd $ra,32($sp) sd $fp,24($sp) sd $gp,16($sp) // calculate and save pointer to GOT lui $gp,%hi(%neg(%gp_rel(__sigsetjmp))) daddu $gp,$gp,$t9 daddiu $gp,$gp,%lo(%neg(%gp_rel(__sigsetjmp))) move $s0,$gp // save jmp_buf and savesig sd $a0,0($sp) sd $a1,8($sp) // obtain $sp dadd $a0,$zero,$sp // call tsan interceptor jal __tsan_setjmp daddiu $a1,$a0,48 // restore jmp_buf and savesig ld $a0,0($sp) ld $a1,8($sp) // restore gp move $gp,$s0 // load pointer to libc __sigsetjmp in t9 dla $t9,(_ZN14__interception16real___sigsetjmpE) // restore env parameters ld $gp,16($sp) ld $fp,24($sp) ld $ra,32($sp) ld $s0,40($sp) daddiu $sp,$sp,48 // tail jump to libc __sigsetjmp ld $t9,0($t9) jr $t9 nop .size __sigsetjmp, .-__sigsetjmp golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_mutex.cc0000664000175000017500000004007313004730632027076 0ustar mwhudsonmwhudson//===-- tsan_rtl_mutex.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include #include #include "tsan_rtl.h" #include "tsan_flags.h" #include "tsan_sync.h" #include "tsan_report.h" #include "tsan_symbolize.h" #include "tsan_platform.h" namespace __tsan { void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r); struct Callback : DDCallback { ThreadState *thr; uptr pc; Callback(ThreadState *thr, uptr pc) : thr(thr) , pc(pc) { DDCallback::pt = thr->proc()->dd_pt; DDCallback::lt = thr->dd_lt; } u32 Unwind() override { return CurrentStackId(thr, pc); } int UniqueTid() override { return thr->unique_id; } }; void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { Callback cb(thr, pc); ctx->dd->MutexInit(&cb, &s->dd); s->dd.ctx = s->GetId(); } static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ, uptr addr, u64 mid) { // In Go, these misuses are either impossible, or detected by std lib, // or false positives (e.g. unlock in a different thread). if (SANITIZER_GO) return; ThreadRegistryLock l(ctx->thread_registry); ScopedReport rep(typ); rep.AddMutex(mid); VarSizeStackTrace trace; ObtainCurrentStack(thr, pc, &trace); rep.AddStack(trace, true); rep.AddLocation(addr, 1); OutputReport(thr, rep); } void MutexCreate(ThreadState *thr, uptr pc, uptr addr, bool rw, bool recursive, bool linker_init) { DPrintf("#%d: MutexCreate %zx\n", thr->tid, addr); StatInc(thr, StatMutexCreate); if (!linker_init && IsAppMem(addr)) { CHECK(!thr->is_freeing); thr->is_freeing = true; MemoryWrite(thr, pc, addr, kSizeLog1); thr->is_freeing = false; } SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); s->is_rw = rw; s->is_recursive = recursive; s->is_linker_init = linker_init; if (!SANITIZER_GO && s->creation_stack_id == 0) s->creation_stack_id = CurrentStackId(thr, pc); s->mtx.Unlock(); } void MutexDestroy(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: MutexDestroy %zx\n", thr->tid, addr); StatInc(thr, StatMutexDestroy); SyncVar *s = ctx->metamap.GetIfExistsAndLock(addr, true); if (s == 0) return; if (s->is_linker_init) { // Destroy is no-op for linker-initialized mutexes. s->mtx.Unlock(); return; } if (common_flags()->detect_deadlocks) { Callback cb(thr, pc); ctx->dd->MutexDestroy(&cb, &s->dd); ctx->dd->MutexInit(&cb, &s->dd); } bool unlock_locked = false; if (flags()->report_destroy_locked && s->owner_tid != SyncVar::kInvalidTid && !s->is_broken) { s->is_broken = true; unlock_locked = true; } u64 mid = s->GetId(); u32 last_lock = s->last_lock; if (!unlock_locked) s->Reset(thr->proc()); // must not reset it before the report is printed s->mtx.Unlock(); if (unlock_locked) { ThreadRegistryLock l(ctx->thread_registry); ScopedReport rep(ReportTypeMutexDestroyLocked); rep.AddMutex(mid); VarSizeStackTrace trace; ObtainCurrentStack(thr, pc, &trace); rep.AddStack(trace); FastState last(last_lock); RestoreStack(last.tid(), last.epoch(), &trace, 0); rep.AddStack(trace, true); rep.AddLocation(addr, 1); OutputReport(thr, rep); SyncVar *s = ctx->metamap.GetIfExistsAndLock(addr, true); if (s != 0) { s->Reset(thr->proc()); s->mtx.Unlock(); } } thr->mset.Remove(mid); // Imitate a memory write to catch unlock-destroy races. // Do this outside of sync mutex, because it can report a race which locks // sync mutexes. if (IsAppMem(addr)) { CHECK(!thr->is_freeing); thr->is_freeing = true; MemoryWrite(thr, pc, addr, kSizeLog1); thr->is_freeing = false; } // s will be destroyed and freed in MetaMap::FreeBlock. } void MutexLock(ThreadState *thr, uptr pc, uptr addr, int rec, bool try_lock) { DPrintf("#%d: MutexLock %zx rec=%d\n", thr->tid, addr, rec); CHECK_GT(rec, 0); if (IsAppMem(addr)) MemoryReadAtomic(thr, pc, addr, kSizeLog1); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeLock, s->GetId()); bool report_double_lock = false; if (s->owner_tid == SyncVar::kInvalidTid) { CHECK_EQ(s->recursion, 0); s->owner_tid = thr->tid; s->last_lock = thr->fast_state.raw(); } else if (s->owner_tid == thr->tid) { CHECK_GT(s->recursion, 0); } else if (flags()->report_mutex_bugs && !s->is_broken) { s->is_broken = true; report_double_lock = true; } if (s->recursion == 0) { StatInc(thr, StatMutexLock); AcquireImpl(thr, pc, &s->clock); AcquireImpl(thr, pc, &s->read_clock); } else if (!s->is_recursive) { StatInc(thr, StatMutexRecLock); } s->recursion += rec; thr->mset.Add(s->GetId(), true, thr->fast_state.epoch()); if (common_flags()->detect_deadlocks && (s->recursion - rec) == 0) { Callback cb(thr, pc); if (!try_lock) ctx->dd->MutexBeforeLock(&cb, &s->dd, true); ctx->dd->MutexAfterLock(&cb, &s->dd, true, try_lock); } u64 mid = s->GetId(); s->mtx.Unlock(); // Can't touch s after this point. if (report_double_lock) ReportMutexMisuse(thr, pc, ReportTypeMutexDoubleLock, addr, mid); if (common_flags()->detect_deadlocks) { Callback cb(thr, pc); ReportDeadlock(thr, pc, ctx->dd->GetReport(&cb)); } } int MutexUnlock(ThreadState *thr, uptr pc, uptr addr, bool all) { DPrintf("#%d: MutexUnlock %zx all=%d\n", thr->tid, addr, all); if (IsAppMem(addr)) MemoryReadAtomic(thr, pc, addr, kSizeLog1); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeUnlock, s->GetId()); int rec = 0; bool report_bad_unlock = false; if (!SANITIZER_GO && (s->recursion == 0 || s->owner_tid != thr->tid)) { if (flags()->report_mutex_bugs && !s->is_broken) { s->is_broken = true; report_bad_unlock = true; } } else { rec = all ? s->recursion : 1; s->recursion -= rec; if (s->recursion == 0) { StatInc(thr, StatMutexUnlock); s->owner_tid = SyncVar::kInvalidTid; ReleaseStoreImpl(thr, pc, &s->clock); } else { StatInc(thr, StatMutexRecUnlock); } } thr->mset.Del(s->GetId(), true); if (common_flags()->detect_deadlocks && s->recursion == 0 && !report_bad_unlock) { Callback cb(thr, pc); ctx->dd->MutexBeforeUnlock(&cb, &s->dd, true); } u64 mid = s->GetId(); s->mtx.Unlock(); // Can't touch s after this point. if (report_bad_unlock) ReportMutexMisuse(thr, pc, ReportTypeMutexBadUnlock, addr, mid); if (common_flags()->detect_deadlocks && !report_bad_unlock) { Callback cb(thr, pc); ReportDeadlock(thr, pc, ctx->dd->GetReport(&cb)); } return rec; } void MutexReadLock(ThreadState *thr, uptr pc, uptr addr, bool trylock) { DPrintf("#%d: MutexReadLock %zx\n", thr->tid, addr); StatInc(thr, StatMutexReadLock); if (IsAppMem(addr)) MemoryReadAtomic(thr, pc, addr, kSizeLog1); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, false); thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeRLock, s->GetId()); bool report_bad_lock = false; if (s->owner_tid != SyncVar::kInvalidTid) { if (flags()->report_mutex_bugs && !s->is_broken) { s->is_broken = true; report_bad_lock = true; } } AcquireImpl(thr, pc, &s->clock); s->last_lock = thr->fast_state.raw(); thr->mset.Add(s->GetId(), false, thr->fast_state.epoch()); if (common_flags()->detect_deadlocks && s->recursion == 0) { Callback cb(thr, pc); if (!trylock) ctx->dd->MutexBeforeLock(&cb, &s->dd, false); ctx->dd->MutexAfterLock(&cb, &s->dd, false, trylock); } u64 mid = s->GetId(); s->mtx.ReadUnlock(); // Can't touch s after this point. if (report_bad_lock) ReportMutexMisuse(thr, pc, ReportTypeMutexBadReadLock, addr, mid); if (common_flags()->detect_deadlocks) { Callback cb(thr, pc); ReportDeadlock(thr, pc, ctx->dd->GetReport(&cb)); } } void MutexReadUnlock(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: MutexReadUnlock %zx\n", thr->tid, addr); StatInc(thr, StatMutexReadUnlock); if (IsAppMem(addr)) MemoryReadAtomic(thr, pc, addr, kSizeLog1); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeRUnlock, s->GetId()); bool report_bad_unlock = false; if (s->owner_tid != SyncVar::kInvalidTid) { if (flags()->report_mutex_bugs && !s->is_broken) { s->is_broken = true; report_bad_unlock = true; } } ReleaseImpl(thr, pc, &s->read_clock); if (common_flags()->detect_deadlocks && s->recursion == 0) { Callback cb(thr, pc); ctx->dd->MutexBeforeUnlock(&cb, &s->dd, false); } u64 mid = s->GetId(); s->mtx.Unlock(); // Can't touch s after this point. thr->mset.Del(mid, false); if (report_bad_unlock) ReportMutexMisuse(thr, pc, ReportTypeMutexBadReadUnlock, addr, mid); if (common_flags()->detect_deadlocks) { Callback cb(thr, pc); ReportDeadlock(thr, pc, ctx->dd->GetReport(&cb)); } } void MutexReadOrWriteUnlock(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: MutexReadOrWriteUnlock %zx\n", thr->tid, addr); if (IsAppMem(addr)) MemoryReadAtomic(thr, pc, addr, kSizeLog1); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); bool write = true; bool report_bad_unlock = false; if (s->owner_tid == SyncVar::kInvalidTid) { // Seems to be read unlock. write = false; StatInc(thr, StatMutexReadUnlock); thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeRUnlock, s->GetId()); ReleaseImpl(thr, pc, &s->read_clock); } else if (s->owner_tid == thr->tid) { // Seems to be write unlock. thr->fast_state.IncrementEpoch(); TraceAddEvent(thr, thr->fast_state, EventTypeUnlock, s->GetId()); CHECK_GT(s->recursion, 0); s->recursion--; if (s->recursion == 0) { StatInc(thr, StatMutexUnlock); s->owner_tid = SyncVar::kInvalidTid; ReleaseImpl(thr, pc, &s->clock); } else { StatInc(thr, StatMutexRecUnlock); } } else if (!s->is_broken) { s->is_broken = true; report_bad_unlock = true; } thr->mset.Del(s->GetId(), write); if (common_flags()->detect_deadlocks && s->recursion == 0) { Callback cb(thr, pc); ctx->dd->MutexBeforeUnlock(&cb, &s->dd, write); } u64 mid = s->GetId(); s->mtx.Unlock(); // Can't touch s after this point. if (report_bad_unlock) ReportMutexMisuse(thr, pc, ReportTypeMutexBadUnlock, addr, mid); if (common_flags()->detect_deadlocks) { Callback cb(thr, pc); ReportDeadlock(thr, pc, ctx->dd->GetReport(&cb)); } } void MutexRepair(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: MutexRepair %zx\n", thr->tid, addr); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); s->owner_tid = SyncVar::kInvalidTid; s->recursion = 0; s->mtx.Unlock(); } void MutexInvalidAccess(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: MutexInvalidAccess %zx\n", thr->tid, addr); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); u64 mid = s->GetId(); s->mtx.Unlock(); ReportMutexMisuse(thr, pc, ReportTypeMutexInvalidAccess, addr, mid); } void Acquire(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: Acquire %zx\n", thr->tid, addr); if (thr->ignore_sync) return; SyncVar *s = ctx->metamap.GetIfExistsAndLock(addr, false); if (!s) return; AcquireImpl(thr, pc, &s->clock); s->mtx.ReadUnlock(); } static void UpdateClockCallback(ThreadContextBase *tctx_base, void *arg) { ThreadState *thr = reinterpret_cast(arg); ThreadContext *tctx = static_cast(tctx_base); if (tctx->status == ThreadStatusRunning) thr->clock.set(tctx->tid, tctx->thr->fast_state.epoch()); else thr->clock.set(tctx->tid, tctx->epoch1); } void AcquireGlobal(ThreadState *thr, uptr pc) { DPrintf("#%d: AcquireGlobal\n", thr->tid); if (thr->ignore_sync) return; ThreadRegistryLock l(ctx->thread_registry); ctx->thread_registry->RunCallbackForEachThreadLocked( UpdateClockCallback, thr); } void Release(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: Release %zx\n", thr->tid, addr); if (thr->ignore_sync) return; SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); ReleaseImpl(thr, pc, &s->clock); s->mtx.Unlock(); } void ReleaseStore(ThreadState *thr, uptr pc, uptr addr) { DPrintf("#%d: ReleaseStore %zx\n", thr->tid, addr); if (thr->ignore_sync) return; SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, addr, true); thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); ReleaseStoreImpl(thr, pc, &s->clock); s->mtx.Unlock(); } #if !SANITIZER_GO static void UpdateSleepClockCallback(ThreadContextBase *tctx_base, void *arg) { ThreadState *thr = reinterpret_cast(arg); ThreadContext *tctx = static_cast(tctx_base); if (tctx->status == ThreadStatusRunning) thr->last_sleep_clock.set(tctx->tid, tctx->thr->fast_state.epoch()); else thr->last_sleep_clock.set(tctx->tid, tctx->epoch1); } void AfterSleep(ThreadState *thr, uptr pc) { DPrintf("#%d: AfterSleep %zx\n", thr->tid); if (thr->ignore_sync) return; thr->last_sleep_stack_id = CurrentStackId(thr, pc); ThreadRegistryLock l(ctx->thread_registry); ctx->thread_registry->RunCallbackForEachThreadLocked( UpdateSleepClockCallback, thr); } #endif void AcquireImpl(ThreadState *thr, uptr pc, SyncClock *c) { if (thr->ignore_sync) return; thr->clock.set(thr->fast_state.epoch()); thr->clock.acquire(&thr->proc()->clock_cache, c); StatInc(thr, StatSyncAcquire); } void ReleaseImpl(ThreadState *thr, uptr pc, SyncClock *c) { if (thr->ignore_sync) return; thr->clock.set(thr->fast_state.epoch()); thr->fast_synch_epoch = thr->fast_state.epoch(); thr->clock.release(&thr->proc()->clock_cache, c); StatInc(thr, StatSyncRelease); } void ReleaseStoreImpl(ThreadState *thr, uptr pc, SyncClock *c) { if (thr->ignore_sync) return; thr->clock.set(thr->fast_state.epoch()); thr->fast_synch_epoch = thr->fast_state.epoch(); thr->clock.ReleaseStore(&thr->proc()->clock_cache, c); StatInc(thr, StatSyncRelease); } void AcquireReleaseImpl(ThreadState *thr, uptr pc, SyncClock *c) { if (thr->ignore_sync) return; thr->clock.set(thr->fast_state.epoch()); thr->fast_synch_epoch = thr->fast_state.epoch(); thr->clock.acq_rel(&thr->proc()->clock_cache, c); StatInc(thr, StatSyncAcquire); StatInc(thr, StatSyncRelease); } void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r) { if (r == 0) return; ThreadRegistryLock l(ctx->thread_registry); ScopedReport rep(ReportTypeDeadlock); for (int i = 0; i < r->n; i++) { rep.AddMutex(r->loop[i].mtx_ctx0); rep.AddUniqueTid((int)r->loop[i].thr_ctx); rep.AddThread((int)r->loop[i].thr_ctx); } uptr dummy_pc = 0x42; for (int i = 0; i < r->n; i++) { for (int j = 0; j < (flags()->second_deadlock_stack ? 2 : 1); j++) { u32 stk = r->loop[i].stk[j]; if (stk && stk != 0xffffffff) { rep.AddStack(StackDepotGet(stk), true); } else { // Sometimes we fail to extract the stack trace (FIXME: investigate), // but we should still produce some stack trace in the report. rep.AddStack(StackTrace(&dummy_pc, 1), true); } } } OutputReport(thr, rep); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_platform_linux.cc0000664000175000017500000003202013004730632030107 0ustar mwhudsonmwhudson//===-- tsan_platform_linux.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Linux- and FreeBSD-specific code. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX || SANITIZER_FREEBSD #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_posix.h" #include "sanitizer_common/sanitizer_procmaps.h" #include "sanitizer_common/sanitizer_stoptheworld.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "tsan_platform.h" #include "tsan_rtl.h" #include "tsan_flags.h" #include #include #include #include #include #include #include #include #if SANITIZER_LINUX #include #include #endif #include #include #include #include #include #include #include #include #include #include #if SANITIZER_LINUX #define __need_res_state #include #endif #ifdef sa_handler # undef sa_handler #endif #ifdef sa_sigaction # undef sa_sigaction #endif #if SANITIZER_FREEBSD extern "C" void *__libc_stack_end; void *__libc_stack_end = 0; #endif #if SANITIZER_LINUX && defined(__aarch64__) void InitializeGuardPtr() __attribute__((visibility("hidden"))); #endif namespace __tsan { #ifdef TSAN_RUNTIME_VMA // Runtime detected VMA size. uptr vmaSize; #endif enum { MemTotal = 0, MemShadow = 1, MemMeta = 2, MemFile = 3, MemMmap = 4, MemTrace = 5, MemHeap = 6, MemOther = 7, MemCount = 8, }; void FillProfileCallback(uptr p, uptr rss, bool file, uptr *mem, uptr stats_size) { mem[MemTotal] += rss; if (p >= ShadowBeg() && p < ShadowEnd()) mem[MemShadow] += rss; else if (p >= MetaShadowBeg() && p < MetaShadowEnd()) mem[MemMeta] += rss; #if !SANITIZER_GO else if (p >= HeapMemBeg() && p < HeapMemEnd()) mem[MemHeap] += rss; else if (p >= LoAppMemBeg() && p < LoAppMemEnd()) mem[file ? MemFile : MemMmap] += rss; else if (p >= HiAppMemBeg() && p < HiAppMemEnd()) mem[file ? MemFile : MemMmap] += rss; #else else if (p >= AppMemBeg() && p < AppMemEnd()) mem[file ? MemFile : MemMmap] += rss; #endif else if (p >= TraceMemBeg() && p < TraceMemEnd()) mem[MemTrace] += rss; else mem[MemOther] += rss; } void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive) { uptr mem[MemCount]; internal_memset(mem, 0, sizeof(mem[0]) * MemCount); __sanitizer::GetMemoryProfile(FillProfileCallback, mem, 7); StackDepotStats *stacks = StackDepotGetStats(); internal_snprintf(buf, buf_size, "RSS %zd MB: shadow:%zd meta:%zd file:%zd mmap:%zd" " trace:%zd heap:%zd other:%zd stacks=%zd[%zd] nthr=%zd/%zd\n", mem[MemTotal] >> 20, mem[MemShadow] >> 20, mem[MemMeta] >> 20, mem[MemFile] >> 20, mem[MemMmap] >> 20, mem[MemTrace] >> 20, mem[MemHeap] >> 20, mem[MemOther] >> 20, stacks->allocated >> 20, stacks->n_uniq_ids, nlive, nthread); } #if SANITIZER_LINUX void FlushShadowMemoryCallback( const SuspendedThreadsList &suspended_threads_list, void *argument) { ReleaseMemoryToOS(ShadowBeg(), ShadowEnd() - ShadowBeg()); } #endif void FlushShadowMemory() { #if SANITIZER_LINUX StopTheWorld(FlushShadowMemoryCallback, 0); #endif } #if !SANITIZER_GO // Mark shadow for .rodata sections with the special kShadowRodata marker. // Accesses to .rodata can't race, so this saves time, memory and trace space. static void MapRodata() { // First create temp file. const char *tmpdir = GetEnv("TMPDIR"); if (tmpdir == 0) tmpdir = GetEnv("TEST_TMPDIR"); #ifdef P_tmpdir if (tmpdir == 0) tmpdir = P_tmpdir; #endif if (tmpdir == 0) return; char name[256]; internal_snprintf(name, sizeof(name), "%s/tsan.rodata.%d", tmpdir, (int)internal_getpid()); uptr openrv = internal_open(name, O_RDWR | O_CREAT | O_EXCL, 0600); if (internal_iserror(openrv)) return; internal_unlink(name); // Unlink it now, so that we can reuse the buffer. fd_t fd = openrv; // Fill the file with kShadowRodata. const uptr kMarkerSize = 512 * 1024 / sizeof(u64); InternalScopedBuffer marker(kMarkerSize); // volatile to prevent insertion of memset for (volatile u64 *p = marker.data(); p < marker.data() + kMarkerSize; p++) *p = kShadowRodata; internal_write(fd, marker.data(), marker.size()); // Map the file into memory. uptr page = internal_mmap(0, GetPageSizeCached(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, fd, 0); if (internal_iserror(page)) { internal_close(fd); return; } // Map the file into shadow of .rodata sections. MemoryMappingLayout proc_maps(/*cache_enabled*/true); uptr start, end, offset, prot; // Reusing the buffer 'name'. while (proc_maps.Next(&start, &end, &offset, name, ARRAY_SIZE(name), &prot)) { if (name[0] != 0 && name[0] != '[' && (prot & MemoryMappingLayout::kProtectionRead) && (prot & MemoryMappingLayout::kProtectionExecute) && !(prot & MemoryMappingLayout::kProtectionWrite) && IsAppMem(start)) { // Assume it's .rodata char *shadow_start = (char*)MemToShadow(start); char *shadow_end = (char*)MemToShadow(end); for (char *p = shadow_start; p < shadow_end; p += marker.size()) { internal_mmap(p, Min(marker.size(), shadow_end - p), PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, 0); } } } internal_close(fd); } void InitializeShadowMemoryPlatform() { MapRodata(); } #endif // #if !SANITIZER_GO void InitializePlatformEarly() { #ifdef TSAN_RUNTIME_VMA vmaSize = (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1); #if defined(__aarch64__) if (vmaSize != 39 && vmaSize != 42 && vmaSize != 48) { Printf("FATAL: ThreadSanitizer: unsupported VMA range\n"); Printf("FATAL: Found %d - Supported 39, 42 and 48\n", vmaSize); Die(); } #elif defined(__powerpc64__) if (vmaSize != 44 && vmaSize != 46) { Printf("FATAL: ThreadSanitizer: unsupported VMA range\n"); Printf("FATAL: Found %d - Supported 44 and 46\n", vmaSize); Die(); } #endif #endif } void InitializePlatform() { DisableCoreDumperIfNecessary(); // Go maps shadow memory lazily and works fine with limited address space. // Unlimited stack is not a problem as well, because the executable // is not compiled with -pie. if (!SANITIZER_GO) { bool reexec = false; // TSan doesn't play well with unlimited stack size (as stack // overlaps with shadow memory). If we detect unlimited stack size, // we re-exec the program with limited stack size as a best effort. if (StackSizeIsUnlimited()) { const uptr kMaxStackSize = 32 * 1024 * 1024; VReport(1, "Program is run with unlimited stack size, which wouldn't " "work with ThreadSanitizer.\n" "Re-execing with stack size limited to %zd bytes.\n", kMaxStackSize); SetStackSizeLimitInBytes(kMaxStackSize); reexec = true; } if (!AddressSpaceIsUnlimited()) { Report("WARNING: Program is run with limited virtual address space," " which wouldn't work with ThreadSanitizer.\n"); Report("Re-execing with unlimited virtual address space.\n"); SetAddressSpaceUnlimited(); reexec = true; } #if SANITIZER_LINUX && defined(__aarch64__) // After patch "arm64: mm: support ARCH_MMAP_RND_BITS." is introduced in // linux kernel, the random gap between stack and mapped area is increased // from 128M to 36G on 39-bit aarch64. As it is almost impossible to cover // this big range, we should disable randomized virtual space on aarch64. int old_personality = personality(0xffffffff); if (old_personality != -1 && (old_personality & ADDR_NO_RANDOMIZE) == 0) { VReport(1, "WARNING: Program is run with randomized virtual address " "space, which wouldn't work with ThreadSanitizer.\n" "Re-execing with fixed virtual address space.\n"); CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1); reexec = true; } // Initialize the guard pointer used in {sig}{set,long}jump. InitializeGuardPtr(); #endif if (reexec) ReExec(); } #if !SANITIZER_GO CheckAndProtect(); InitTlsSize(); #endif } #if !SANITIZER_GO // Extract file descriptors passed to glibc internal __res_iclose function. // This is required to properly "close" the fds, because we do not see internal // closes within glibc. The code is a pure hack. int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX && !SANITIZER_ANDROID int cnt = 0; __res_state *statp = (__res_state*)state; for (int i = 0; i < MAXNS && cnt < nfd; i++) { if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) fds[cnt++] = statp->_u._ext.nssocks[i]; } return cnt; #else return 0; #endif } // Extract file descriptors passed via UNIX domain sockets. // This is requried to properly handle "open" of these fds. // see 'man recvmsg' and 'man 3 cmsg'. int ExtractRecvmsgFDs(void *msgp, int *fds, int nfd) { int res = 0; msghdr *msg = (msghdr*)msgp; struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg); for (; cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) { if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) continue; int n = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(fds[0]); for (int i = 0; i < n; i++) { fds[res++] = ((int*)CMSG_DATA(cmsg))[i]; if (res == nfd) return res; } } return res; } // Note: this function runs with async signals enabled, // so it must not touch any tsan state. int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, void *abstime), void *c, void *m, void *abstime, void(*cleanup)(void *arg), void *arg) { // pthread_cleanup_push/pop are hardcore macros mess. // We can't intercept nor call them w/o including pthread.h. int res; pthread_cleanup_push(cleanup, arg); res = fn(c, m, abstime); pthread_cleanup_pop(0); return res; } #endif #if !SANITIZER_GO void ReplaceSystemMalloc() { } #endif #if !SANITIZER_GO #if SANITIZER_ANDROID #if defined(__aarch64__) # define __get_tls() \ ({ void** __val; __asm__("mrs %0, tpidr_el0" : "=r"(__val)); __val; }) #elif defined(__x86_64__) # define __get_tls() \ ({ void** __val; __asm__("mov %%fs:0, %0" : "=r"(__val)); __val; }) #else #error unsupported architecture #endif // On Android, __thread is not supported. So we store the pointer to ThreadState // in TLS_SLOT_TSAN, which is the tls slot allocated by Android bionic for tsan. static const int TLS_SLOT_TSAN = 8; // On Android, one thread can call intercepted functions after // DestroyThreadState(), so add a fake thread state for "dead" threads. static ThreadState *dead_thread_state = nullptr; ThreadState *cur_thread() { ThreadState* thr = (ThreadState*)__get_tls()[TLS_SLOT_TSAN]; if (thr == nullptr) { __sanitizer_sigset_t emptyset; internal_sigfillset(&emptyset); __sanitizer_sigset_t oldset; CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, &emptyset, &oldset)); thr = reinterpret_cast(__get_tls()[TLS_SLOT_TSAN]); if (thr == nullptr) { thr = reinterpret_cast(MmapOrDie(sizeof(ThreadState), "ThreadState")); __get_tls()[TLS_SLOT_TSAN] = thr; if (dead_thread_state == nullptr) { dead_thread_state = reinterpret_cast( MmapOrDie(sizeof(ThreadState), "ThreadState")); dead_thread_state->fast_state.SetIgnoreBit(); dead_thread_state->ignore_interceptors = 1; dead_thread_state->is_dead = true; *const_cast(&dead_thread_state->tid) = -1; CHECK_EQ(0, internal_mprotect(dead_thread_state, sizeof(ThreadState), PROT_READ)); } } CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, &oldset, nullptr)); } return thr; } void cur_thread_finalize() { __sanitizer_sigset_t emptyset; internal_sigfillset(&emptyset); __sanitizer_sigset_t oldset; CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, &emptyset, &oldset)); ThreadState* thr = (ThreadState*)__get_tls()[TLS_SLOT_TSAN]; if (thr != dead_thread_state) { __get_tls()[TLS_SLOT_TSAN] = dead_thread_state; UnmapOrDie(thr, sizeof(ThreadState)); } CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, &oldset, nullptr)); } #endif // SANITIZER_ANDROID #endif // if !SANITIZER_GO } // namespace __tsan #endif // SANITIZER_LINUX || SANITIZER_FREEBSD golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interceptors.cc0000664000175000017500000024334712754517560027623 0ustar mwhudsonmwhudson//===-- tsan_interceptors.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // FIXME: move as many interceptors as possible into // sanitizer_common/sanitizer_common_interceptors.inc //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "interception/interception.h" #include "tsan_interceptors.h" #include "tsan_interface.h" #include "tsan_platform.h" #include "tsan_suppressions.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "tsan_fd.h" #if SANITIZER_POSIX #include "sanitizer_common/sanitizer_posix.h" #endif using namespace __tsan; // NOLINT #if SANITIZER_FREEBSD || SANITIZER_MAC #define __errno_location __error #define stdout __stdoutp #define stderr __stderrp #endif #if SANITIZER_ANDROID #define __errno_location __errno #define mallopt(a, b) #endif #if SANITIZER_LINUX || SANITIZER_FREEBSD #define PTHREAD_CREATE_DETACHED 1 #elif SANITIZER_MAC #define PTHREAD_CREATE_DETACHED 2 #endif #ifdef __mips__ const int kSigCount = 129; #else const int kSigCount = 65; #endif struct my_siginfo_t { // The size is determined by looking at sizeof of real siginfo_t on linux. u64 opaque[128 / sizeof(u64)]; }; #ifdef __mips__ struct ucontext_t { u64 opaque[768 / sizeof(u64) + 1]; }; #else struct ucontext_t { // The size is determined by looking at sizeof of real ucontext_t on linux. u64 opaque[936 / sizeof(u64) + 1]; }; #endif #if defined(__x86_64__) || defined(__mips__) || SANITIZER_PPC64V1 #define PTHREAD_ABI_BASE "GLIBC_2.3.2" #elif defined(__aarch64__) || SANITIZER_PPC64V2 #define PTHREAD_ABI_BASE "GLIBC_2.17" #endif extern "C" int pthread_attr_init(void *attr); extern "C" int pthread_attr_destroy(void *attr); DECLARE_REAL(int, pthread_attr_getdetachstate, void *, void *) extern "C" int pthread_attr_setstacksize(void *attr, uptr stacksize); extern "C" int pthread_key_create(unsigned *key, void (*destructor)(void* v)); extern "C" int pthread_setspecific(unsigned key, const void *v); DECLARE_REAL(int, pthread_mutexattr_gettype, void *, void *) DECLARE_REAL(int, fflush, __sanitizer_FILE *fp) DECLARE_REAL_AND_INTERCEPTOR(void *, malloc, uptr size) DECLARE_REAL_AND_INTERCEPTOR(void, free, void *ptr) extern "C" void *pthread_self(); extern "C" void _exit(int status); extern "C" int *__errno_location(); extern "C" int fileno_unlocked(void *stream); extern "C" int dirfd(void *dirp); #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID extern "C" int mallopt(int param, int value); #endif extern __sanitizer_FILE *stdout, *stderr; #if !SANITIZER_FREEBSD && !SANITIZER_MAC const int PTHREAD_MUTEX_RECURSIVE = 1; const int PTHREAD_MUTEX_RECURSIVE_NP = 1; #else const int PTHREAD_MUTEX_RECURSIVE = 2; const int PTHREAD_MUTEX_RECURSIVE_NP = 2; #endif const int EINVAL = 22; const int EBUSY = 16; const int EOWNERDEAD = 130; #if !SANITIZER_FREEBSD && !SANITIZER_MAC const int EPOLL_CTL_ADD = 1; #endif const int SIGILL = 4; const int SIGABRT = 6; const int SIGFPE = 8; const int SIGSEGV = 11; const int SIGPIPE = 13; const int SIGTERM = 15; #if defined(__mips__) || SANITIZER_FREEBSD || SANITIZER_MAC const int SIGBUS = 10; const int SIGSYS = 12; #else const int SIGBUS = 7; const int SIGSYS = 31; #endif void *const MAP_FAILED = (void*)-1; #if !SANITIZER_MAC const int PTHREAD_BARRIER_SERIAL_THREAD = -1; #endif const int MAP_FIXED = 0x10; typedef long long_t; // NOLINT // From /usr/include/unistd.h # define F_ULOCK 0 /* Unlock a previously locked region. */ # define F_LOCK 1 /* Lock a region for exclusive use. */ # define F_TLOCK 2 /* Test and lock a region for exclusive use. */ # define F_TEST 3 /* Test a region for other processes locks. */ #define errno (*__errno_location()) typedef void (*sighandler_t)(int sig); typedef void (*sigactionhandler_t)(int sig, my_siginfo_t *siginfo, void *uctx); #if SANITIZER_ANDROID struct sigaction_t { u32 sa_flags; union { sighandler_t sa_handler; sigactionhandler_t sa_sigaction; }; __sanitizer_sigset_t sa_mask; void (*sa_restorer)(); }; #else struct sigaction_t { #ifdef __mips__ u32 sa_flags; #endif union { sighandler_t sa_handler; sigactionhandler_t sa_sigaction; }; #if SANITIZER_FREEBSD int sa_flags; __sanitizer_sigset_t sa_mask; #elif SANITIZER_MAC __sanitizer_sigset_t sa_mask; int sa_flags; #else __sanitizer_sigset_t sa_mask; #ifndef __mips__ int sa_flags; #endif void (*sa_restorer)(); #endif }; #endif const sighandler_t SIG_DFL = (sighandler_t)0; const sighandler_t SIG_IGN = (sighandler_t)1; const sighandler_t SIG_ERR = (sighandler_t)-1; #if SANITIZER_FREEBSD || SANITIZER_MAC const int SA_SIGINFO = 0x40; const int SIG_SETMASK = 3; #elif defined(__mips__) const int SA_SIGINFO = 8; const int SIG_SETMASK = 3; #else const int SA_SIGINFO = 4; const int SIG_SETMASK = 2; #endif #define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED \ (!cur_thread()->is_inited) static sigaction_t sigactions[kSigCount]; namespace __tsan { struct SignalDesc { bool armed; bool sigaction; my_siginfo_t siginfo; ucontext_t ctx; }; struct ThreadSignalContext { int int_signal_send; atomic_uintptr_t in_blocking_func; atomic_uintptr_t have_pending_signals; SignalDesc pending_signals[kSigCount]; // emptyset and oldset are too big for stack. __sanitizer_sigset_t emptyset; __sanitizer_sigset_t oldset; }; // The object is 64-byte aligned, because we want hot data to be located in // a single cache line if possible (it's accessed in every interceptor). static ALIGNED(64) char libignore_placeholder[sizeof(LibIgnore)]; static LibIgnore *libignore() { return reinterpret_cast(&libignore_placeholder[0]); } void InitializeLibIgnore() { const SuppressionContext &supp = *Suppressions(); const uptr n = supp.SuppressionCount(); for (uptr i = 0; i < n; i++) { const Suppression *s = supp.SuppressionAt(i); if (0 == internal_strcmp(s->type, kSuppressionLib)) libignore()->AddIgnoredLibrary(s->templ); } libignore()->OnLibraryLoaded(0); } } // namespace __tsan static ThreadSignalContext *SigCtx(ThreadState *thr) { ThreadSignalContext *ctx = (ThreadSignalContext*)thr->signal_ctx; if (ctx == 0 && !thr->is_dead) { ctx = (ThreadSignalContext*)MmapOrDie(sizeof(*ctx), "ThreadSignalContext"); MemoryResetRange(thr, (uptr)&SigCtx, (uptr)ctx, sizeof(*ctx)); thr->signal_ctx = ctx; } return ctx; } #if !SANITIZER_MAC static unsigned g_thread_finalize_key; #endif ScopedInterceptor::ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc) : thr_(thr) , pc_(pc) , in_ignored_lib_(false) { Initialize(thr); if (!thr_->is_inited) return; if (!thr_->ignore_interceptors) FuncEntry(thr, pc); DPrintf("#%d: intercept %s()\n", thr_->tid, fname); if (!thr_->in_ignored_lib && libignore()->IsIgnored(pc)) { in_ignored_lib_ = true; thr_->in_ignored_lib = true; ThreadIgnoreBegin(thr_, pc_); } if (flags()->ignore_interceptors_accesses) ThreadIgnoreBegin(thr_, pc_); } ScopedInterceptor::~ScopedInterceptor() { if (!thr_->is_inited) return; if (flags()->ignore_interceptors_accesses) ThreadIgnoreEnd(thr_, pc_); if (in_ignored_lib_) { thr_->in_ignored_lib = false; ThreadIgnoreEnd(thr_, pc_); } if (!thr_->ignore_interceptors) { ProcessPendingSignals(thr_); FuncExit(thr_); CheckNoLocks(thr_); } } void ScopedInterceptor::UserCallbackStart() { if (flags()->ignore_interceptors_accesses) ThreadIgnoreEnd(thr_, pc_); if (in_ignored_lib_) { thr_->in_ignored_lib = false; ThreadIgnoreEnd(thr_, pc_); } } void ScopedInterceptor::UserCallbackEnd() { if (in_ignored_lib_) { thr_->in_ignored_lib = true; ThreadIgnoreBegin(thr_, pc_); } if (flags()->ignore_interceptors_accesses) ThreadIgnoreBegin(thr_, pc_); } #define TSAN_INTERCEPT(func) INTERCEPT_FUNCTION(func) #if SANITIZER_FREEBSD # define TSAN_INTERCEPT_VER(func, ver) INTERCEPT_FUNCTION(func) #else # define TSAN_INTERCEPT_VER(func, ver) INTERCEPT_FUNCTION_VER(func, ver) #endif #define READ_STRING_OF_LEN(thr, pc, s, len, n) \ MemoryAccessRange((thr), (pc), (uptr)(s), \ common_flags()->strict_string_checks ? (len) + 1 : (n), false) #define READ_STRING(thr, pc, s, n) \ READ_STRING_OF_LEN((thr), (pc), (s), internal_strlen(s), (n)) #define BLOCK_REAL(name) (BlockingCall(thr), REAL(name)) struct BlockingCall { explicit BlockingCall(ThreadState *thr) : thr(thr) , ctx(SigCtx(thr)) { for (;;) { atomic_store(&ctx->in_blocking_func, 1, memory_order_relaxed); if (atomic_load(&ctx->have_pending_signals, memory_order_relaxed) == 0) break; atomic_store(&ctx->in_blocking_func, 0, memory_order_relaxed); ProcessPendingSignals(thr); } // When we are in a "blocking call", we process signals asynchronously // (right when they arrive). In this context we do not expect to be // executing any user/runtime code. The known interceptor sequence when // this is not true is: pthread_join -> munmap(stack). It's fine // to ignore munmap in this case -- we handle stack shadow separately. thr->ignore_interceptors++; } ~BlockingCall() { thr->ignore_interceptors--; atomic_store(&ctx->in_blocking_func, 0, memory_order_relaxed); } ThreadState *thr; ThreadSignalContext *ctx; }; TSAN_INTERCEPTOR(unsigned, sleep, unsigned sec) { SCOPED_TSAN_INTERCEPTOR(sleep, sec); unsigned res = BLOCK_REAL(sleep)(sec); AfterSleep(thr, pc); return res; } TSAN_INTERCEPTOR(int, usleep, long_t usec) { SCOPED_TSAN_INTERCEPTOR(usleep, usec); int res = BLOCK_REAL(usleep)(usec); AfterSleep(thr, pc); return res; } TSAN_INTERCEPTOR(int, nanosleep, void *req, void *rem) { SCOPED_TSAN_INTERCEPTOR(nanosleep, req, rem); int res = BLOCK_REAL(nanosleep)(req, rem); AfterSleep(thr, pc); return res; } // The sole reason tsan wraps atexit callbacks is to establish synchronization // between callback setup and callback execution. struct AtExitCtx { void (*f)(); void *arg; }; static void at_exit_wrapper(void *arg) { ThreadState *thr = cur_thread(); uptr pc = 0; Acquire(thr, pc, (uptr)arg); AtExitCtx *ctx = (AtExitCtx*)arg; ((void(*)(void *arg))ctx->f)(ctx->arg); InternalFree(ctx); } static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(), void *arg, void *dso); #if !SANITIZER_ANDROID TSAN_INTERCEPTOR(int, atexit, void (*f)()) { if (cur_thread()->in_symbolizer) return 0; // We want to setup the atexit callback even if we are in ignored lib // or after fork. SCOPED_INTERCEPTOR_RAW(atexit, f); return setup_at_exit_wrapper(thr, pc, (void(*)())f, 0, 0); } #endif TSAN_INTERCEPTOR(int, __cxa_atexit, void (*f)(void *a), void *arg, void *dso) { if (cur_thread()->in_symbolizer) return 0; SCOPED_TSAN_INTERCEPTOR(__cxa_atexit, f, arg, dso); return setup_at_exit_wrapper(thr, pc, (void(*)())f, arg, dso); } static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(), void *arg, void *dso) { AtExitCtx *ctx = (AtExitCtx*)InternalAlloc(sizeof(AtExitCtx)); ctx->f = f; ctx->arg = arg; Release(thr, pc, (uptr)ctx); // Memory allocation in __cxa_atexit will race with free during exit, // because we do not see synchronization around atexit callback list. ThreadIgnoreBegin(thr, pc); int res = REAL(__cxa_atexit)(at_exit_wrapper, ctx, dso); ThreadIgnoreEnd(thr, pc); return res; } #if !SANITIZER_MAC static void on_exit_wrapper(int status, void *arg) { ThreadState *thr = cur_thread(); uptr pc = 0; Acquire(thr, pc, (uptr)arg); AtExitCtx *ctx = (AtExitCtx*)arg; ((void(*)(int status, void *arg))ctx->f)(status, ctx->arg); InternalFree(ctx); } TSAN_INTERCEPTOR(int, on_exit, void(*f)(int, void*), void *arg) { if (cur_thread()->in_symbolizer) return 0; SCOPED_TSAN_INTERCEPTOR(on_exit, f, arg); AtExitCtx *ctx = (AtExitCtx*)InternalAlloc(sizeof(AtExitCtx)); ctx->f = (void(*)())f; ctx->arg = arg; Release(thr, pc, (uptr)ctx); // Memory allocation in __cxa_atexit will race with free during exit, // because we do not see synchronization around atexit callback list. ThreadIgnoreBegin(thr, pc); int res = REAL(on_exit)(on_exit_wrapper, ctx); ThreadIgnoreEnd(thr, pc); return res; } #endif // Cleanup old bufs. static void JmpBufGarbageCollect(ThreadState *thr, uptr sp) { for (uptr i = 0; i < thr->jmp_bufs.Size(); i++) { JmpBuf *buf = &thr->jmp_bufs[i]; if (buf->sp <= sp) { uptr sz = thr->jmp_bufs.Size(); internal_memcpy(buf, &thr->jmp_bufs[sz - 1], sizeof(*buf)); thr->jmp_bufs.PopBack(); i--; } } } static void SetJmp(ThreadState *thr, uptr sp, uptr mangled_sp) { if (!thr->is_inited) // called from libc guts during bootstrap return; // Cleanup old bufs. JmpBufGarbageCollect(thr, sp); // Remember the buf. JmpBuf *buf = thr->jmp_bufs.PushBack(); buf->sp = sp; buf->mangled_sp = mangled_sp; buf->shadow_stack_pos = thr->shadow_stack_pos; ThreadSignalContext *sctx = SigCtx(thr); buf->int_signal_send = sctx ? sctx->int_signal_send : 0; buf->in_blocking_func = sctx ? atomic_load(&sctx->in_blocking_func, memory_order_relaxed) : false; buf->in_signal_handler = atomic_load(&thr->in_signal_handler, memory_order_relaxed); } static void LongJmp(ThreadState *thr, uptr *env) { #ifdef __powerpc__ uptr mangled_sp = env[0]; #elif SANITIZER_FREEBSD || SANITIZER_MAC uptr mangled_sp = env[2]; #elif defined(SANITIZER_LINUX) # ifdef __aarch64__ uptr mangled_sp = env[13]; # elif defined(__mips64) uptr mangled_sp = env[1]; # else uptr mangled_sp = env[6]; # endif #endif // Find the saved buf by mangled_sp. for (uptr i = 0; i < thr->jmp_bufs.Size(); i++) { JmpBuf *buf = &thr->jmp_bufs[i]; if (buf->mangled_sp == mangled_sp) { CHECK_GE(thr->shadow_stack_pos, buf->shadow_stack_pos); // Unwind the stack. while (thr->shadow_stack_pos > buf->shadow_stack_pos) FuncExit(thr); ThreadSignalContext *sctx = SigCtx(thr); if (sctx) { sctx->int_signal_send = buf->int_signal_send; atomic_store(&sctx->in_blocking_func, buf->in_blocking_func, memory_order_relaxed); } atomic_store(&thr->in_signal_handler, buf->in_signal_handler, memory_order_relaxed); JmpBufGarbageCollect(thr, buf->sp - 1); // do not collect buf->sp return; } } Printf("ThreadSanitizer: can't find longjmp buf\n"); CHECK(0); } // FIXME: put everything below into a common extern "C" block? extern "C" void __tsan_setjmp(uptr sp, uptr mangled_sp) { SetJmp(cur_thread(), sp, mangled_sp); } #if SANITIZER_MAC TSAN_INTERCEPTOR(int, setjmp, void *env); TSAN_INTERCEPTOR(int, _setjmp, void *env); TSAN_INTERCEPTOR(int, sigsetjmp, void *env); #else // SANITIZER_MAC // Not called. Merely to satisfy TSAN_INTERCEPT(). extern "C" SANITIZER_INTERFACE_ATTRIBUTE int __interceptor_setjmp(void *env); extern "C" int __interceptor_setjmp(void *env) { CHECK(0); return 0; } // FIXME: any reason to have a separate declaration? extern "C" SANITIZER_INTERFACE_ATTRIBUTE int __interceptor__setjmp(void *env); extern "C" int __interceptor__setjmp(void *env) { CHECK(0); return 0; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE int __interceptor_sigsetjmp(void *env); extern "C" int __interceptor_sigsetjmp(void *env) { CHECK(0); return 0; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE int __interceptor___sigsetjmp(void *env); extern "C" int __interceptor___sigsetjmp(void *env) { CHECK(0); return 0; } extern "C" int setjmp(void *env); extern "C" int _setjmp(void *env); extern "C" int sigsetjmp(void *env); extern "C" int __sigsetjmp(void *env); DEFINE_REAL(int, setjmp, void *env) DEFINE_REAL(int, _setjmp, void *env) DEFINE_REAL(int, sigsetjmp, void *env) DEFINE_REAL(int, __sigsetjmp, void *env) #endif // SANITIZER_MAC TSAN_INTERCEPTOR(void, longjmp, uptr *env, int val) { // Note: if we call REAL(longjmp) in the context of ScopedInterceptor, // bad things will happen. We will jump over ScopedInterceptor dtor and can // leave thr->in_ignored_lib set. { SCOPED_INTERCEPTOR_RAW(longjmp, env, val); } LongJmp(cur_thread(), env); REAL(longjmp)(env, val); } TSAN_INTERCEPTOR(void, siglongjmp, uptr *env, int val) { { SCOPED_INTERCEPTOR_RAW(siglongjmp, env, val); } LongJmp(cur_thread(), env); REAL(siglongjmp)(env, val); } #if !SANITIZER_MAC TSAN_INTERCEPTOR(void*, malloc, uptr size) { if (cur_thread()->in_symbolizer) return InternalAlloc(size); void *p = 0; { SCOPED_INTERCEPTOR_RAW(malloc, size); p = user_alloc(thr, pc, size); } invoke_malloc_hook(p, size); return p; } TSAN_INTERCEPTOR(void*, __libc_memalign, uptr align, uptr sz) { SCOPED_TSAN_INTERCEPTOR(__libc_memalign, align, sz); return user_alloc(thr, pc, sz, align); } TSAN_INTERCEPTOR(void*, calloc, uptr size, uptr n) { if (cur_thread()->in_symbolizer) return InternalCalloc(size, n); void *p = 0; { SCOPED_INTERCEPTOR_RAW(calloc, size, n); p = user_calloc(thr, pc, size, n); } invoke_malloc_hook(p, n * size); return p; } TSAN_INTERCEPTOR(void*, realloc, void *p, uptr size) { if (cur_thread()->in_symbolizer) return InternalRealloc(p, size); if (p) invoke_free_hook(p); { SCOPED_INTERCEPTOR_RAW(realloc, p, size); p = user_realloc(thr, pc, p, size); } invoke_malloc_hook(p, size); return p; } TSAN_INTERCEPTOR(void, free, void *p) { if (p == 0) return; if (cur_thread()->in_symbolizer) return InternalFree(p); invoke_free_hook(p); SCOPED_INTERCEPTOR_RAW(free, p); user_free(thr, pc, p); } TSAN_INTERCEPTOR(void, cfree, void *p) { if (p == 0) return; if (cur_thread()->in_symbolizer) return InternalFree(p); invoke_free_hook(p); SCOPED_INTERCEPTOR_RAW(cfree, p); user_free(thr, pc, p); } TSAN_INTERCEPTOR(uptr, malloc_usable_size, void *p) { SCOPED_INTERCEPTOR_RAW(malloc_usable_size, p); return user_alloc_usable_size(p); } #endif TSAN_INTERCEPTOR(char*, strcpy, char *dst, const char *src) { // NOLINT SCOPED_TSAN_INTERCEPTOR(strcpy, dst, src); // NOLINT uptr srclen = internal_strlen(src); MemoryAccessRange(thr, pc, (uptr)dst, srclen + 1, true); MemoryAccessRange(thr, pc, (uptr)src, srclen + 1, false); return REAL(strcpy)(dst, src); // NOLINT } TSAN_INTERCEPTOR(char*, strncpy, char *dst, char *src, uptr n) { SCOPED_TSAN_INTERCEPTOR(strncpy, dst, src, n); uptr srclen = internal_strnlen(src, n); MemoryAccessRange(thr, pc, (uptr)dst, n, true); MemoryAccessRange(thr, pc, (uptr)src, min(srclen + 1, n), false); return REAL(strncpy)(dst, src, n); } TSAN_INTERCEPTOR(char*, strdup, const char *str) { SCOPED_TSAN_INTERCEPTOR(strdup, str); // strdup will call malloc, so no instrumentation is required here. return REAL(strdup)(str); } static bool fix_mmap_addr(void **addr, long_t sz, int flags) { if (*addr) { if (!IsAppMem((uptr)*addr) || !IsAppMem((uptr)*addr + sz - 1)) { if (flags & MAP_FIXED) { errno = EINVAL; return false; } else { *addr = 0; } } } return true; } TSAN_INTERCEPTOR(void *, mmap, void *addr, SIZE_T sz, int prot, int flags, int fd, OFF_T off) { SCOPED_TSAN_INTERCEPTOR(mmap, addr, sz, prot, flags, fd, off); if (!fix_mmap_addr(&addr, sz, flags)) return MAP_FAILED; void *res = REAL(mmap)(addr, sz, prot, flags, fd, off); if (res != MAP_FAILED) { if (fd > 0) FdAccess(thr, pc, fd); if (thr->ignore_reads_and_writes == 0) MemoryRangeImitateWrite(thr, pc, (uptr)res, sz); else MemoryResetRange(thr, pc, (uptr)res, sz); } return res; } #if SANITIZER_LINUX TSAN_INTERCEPTOR(void *, mmap64, void *addr, SIZE_T sz, int prot, int flags, int fd, OFF64_T off) { SCOPED_TSAN_INTERCEPTOR(mmap64, addr, sz, prot, flags, fd, off); if (!fix_mmap_addr(&addr, sz, flags)) return MAP_FAILED; void *res = REAL(mmap64)(addr, sz, prot, flags, fd, off); if (res != MAP_FAILED) { if (fd > 0) FdAccess(thr, pc, fd); if (thr->ignore_reads_and_writes == 0) MemoryRangeImitateWrite(thr, pc, (uptr)res, sz); else MemoryResetRange(thr, pc, (uptr)res, sz); } return res; } #define TSAN_MAYBE_INTERCEPT_MMAP64 TSAN_INTERCEPT(mmap64) #else #define TSAN_MAYBE_INTERCEPT_MMAP64 #endif TSAN_INTERCEPTOR(int, munmap, void *addr, long_t sz) { SCOPED_TSAN_INTERCEPTOR(munmap, addr, sz); if (sz != 0) { // If sz == 0, munmap will return EINVAL and don't unmap any memory. DontNeedShadowFor((uptr)addr, sz); ScopedGlobalProcessor sgp; ctx->metamap.ResetRange(thr->proc(), (uptr)addr, (uptr)sz); } int res = REAL(munmap)(addr, sz); return res; } #if SANITIZER_LINUX TSAN_INTERCEPTOR(void*, memalign, uptr align, uptr sz) { SCOPED_INTERCEPTOR_RAW(memalign, align, sz); return user_alloc(thr, pc, sz, align); } #define TSAN_MAYBE_INTERCEPT_MEMALIGN TSAN_INTERCEPT(memalign) #else #define TSAN_MAYBE_INTERCEPT_MEMALIGN #endif #if !SANITIZER_MAC TSAN_INTERCEPTOR(void*, aligned_alloc, uptr align, uptr sz) { SCOPED_INTERCEPTOR_RAW(memalign, align, sz); return user_alloc(thr, pc, sz, align); } TSAN_INTERCEPTOR(void*, valloc, uptr sz) { SCOPED_INTERCEPTOR_RAW(valloc, sz); return user_alloc(thr, pc, sz, GetPageSizeCached()); } #endif #if SANITIZER_LINUX TSAN_INTERCEPTOR(void*, pvalloc, uptr sz) { SCOPED_INTERCEPTOR_RAW(pvalloc, sz); sz = RoundUp(sz, GetPageSizeCached()); return user_alloc(thr, pc, sz, GetPageSizeCached()); } #define TSAN_MAYBE_INTERCEPT_PVALLOC TSAN_INTERCEPT(pvalloc) #else #define TSAN_MAYBE_INTERCEPT_PVALLOC #endif #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, posix_memalign, void **memptr, uptr align, uptr sz) { SCOPED_INTERCEPTOR_RAW(posix_memalign, memptr, align, sz); *memptr = user_alloc(thr, pc, sz, align); return 0; } #endif // __cxa_guard_acquire and friends need to be intercepted in a special way - // regular interceptors will break statically-linked libstdc++. Linux // interceptors are especially defined as weak functions (so that they don't // cause link errors when user defines them as well). So they silently // auto-disable themselves when such symbol is already present in the binary. If // we link libstdc++ statically, it will bring own __cxa_guard_acquire which // will silently replace our interceptor. That's why on Linux we simply export // these interceptors with INTERFACE_ATTRIBUTE. // On OS X, we don't support statically linking, so we just use a regular // interceptor. #if SANITIZER_MAC #define STDCXX_INTERCEPTOR TSAN_INTERCEPTOR #else #define STDCXX_INTERCEPTOR(rettype, name, ...) \ extern "C" rettype INTERFACE_ATTRIBUTE name(__VA_ARGS__) #endif // Used in thread-safe function static initialization. STDCXX_INTERCEPTOR(int, __cxa_guard_acquire, atomic_uint32_t *g) { SCOPED_INTERCEPTOR_RAW(__cxa_guard_acquire, g); for (;;) { u32 cmp = atomic_load(g, memory_order_acquire); if (cmp == 0) { if (atomic_compare_exchange_strong(g, &cmp, 1<<16, memory_order_relaxed)) return 1; } else if (cmp == 1) { Acquire(thr, pc, (uptr)g); return 0; } else { internal_sched_yield(); } } } STDCXX_INTERCEPTOR(void, __cxa_guard_release, atomic_uint32_t *g) { SCOPED_INTERCEPTOR_RAW(__cxa_guard_release, g); Release(thr, pc, (uptr)g); atomic_store(g, 1, memory_order_release); } STDCXX_INTERCEPTOR(void, __cxa_guard_abort, atomic_uint32_t *g) { SCOPED_INTERCEPTOR_RAW(__cxa_guard_abort, g); atomic_store(g, 0, memory_order_relaxed); } namespace __tsan { void DestroyThreadState() { ThreadState *thr = cur_thread(); Processor *proc = thr->proc(); ThreadFinish(thr); ProcUnwire(proc, thr); ProcDestroy(proc); ThreadSignalContext *sctx = thr->signal_ctx; if (sctx) { thr->signal_ctx = 0; UnmapOrDie(sctx, sizeof(*sctx)); } DTLS_Destroy(); cur_thread_finalize(); } } // namespace __tsan #if !SANITIZER_MAC static void thread_finalize(void *v) { uptr iter = (uptr)v; if (iter > 1) { if (pthread_setspecific(g_thread_finalize_key, (void*)(iter - 1))) { Printf("ThreadSanitizer: failed to set thread key\n"); Die(); } return; } DestroyThreadState(); } #endif struct ThreadParam { void* (*callback)(void *arg); void *param; atomic_uintptr_t tid; }; extern "C" void *__tsan_thread_start_func(void *arg) { ThreadParam *p = (ThreadParam*)arg; void* (*callback)(void *arg) = p->callback; void *param = p->param; int tid = 0; { ThreadState *thr = cur_thread(); // Thread-local state is not initialized yet. ScopedIgnoreInterceptors ignore; #if !SANITIZER_MAC ThreadIgnoreBegin(thr, 0); if (pthread_setspecific(g_thread_finalize_key, (void *)GetPthreadDestructorIterations())) { Printf("ThreadSanitizer: failed to set thread key\n"); Die(); } ThreadIgnoreEnd(thr, 0); #endif while ((tid = atomic_load(&p->tid, memory_order_acquire)) == 0) internal_sched_yield(); Processor *proc = ProcCreate(); ProcWire(proc, thr); ThreadStart(thr, tid, GetTid()); atomic_store(&p->tid, 0, memory_order_release); } void *res = callback(param); // Prevent the callback from being tail called, // it mixes up stack traces. volatile int foo = 42; foo++; return res; } TSAN_INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*), void * param) { SCOPED_INTERCEPTOR_RAW(pthread_create, th, attr, callback, param); if (ctx->after_multithreaded_fork) { if (flags()->die_after_fork) { Report("ThreadSanitizer: starting new threads after multi-threaded " "fork is not supported. Dying (set die_after_fork=0 to override)\n"); Die(); } else { VPrintf(1, "ThreadSanitizer: starting new threads after multi-threaded " "fork is not supported (pid %d). Continuing because of " "die_after_fork=0, but you are on your own\n", internal_getpid()); } } __sanitizer_pthread_attr_t myattr; if (attr == 0) { pthread_attr_init(&myattr); attr = &myattr; } int detached = 0; REAL(pthread_attr_getdetachstate)(attr, &detached); AdjustStackSize(attr); ThreadParam p; p.callback = callback; p.param = param; atomic_store(&p.tid, 0, memory_order_relaxed); int res = -1; { // Otherwise we see false positives in pthread stack manipulation. ScopedIgnoreInterceptors ignore; ThreadIgnoreBegin(thr, pc); res = REAL(pthread_create)(th, attr, __tsan_thread_start_func, &p); ThreadIgnoreEnd(thr, pc); } if (res == 0) { int tid = ThreadCreate(thr, pc, *(uptr*)th, detached == PTHREAD_CREATE_DETACHED); CHECK_NE(tid, 0); // Synchronization on p.tid serves two purposes: // 1. ThreadCreate must finish before the new thread starts. // Otherwise the new thread can call pthread_detach, but the pthread_t // identifier is not yet registered in ThreadRegistry by ThreadCreate. // 2. ThreadStart must finish before this thread continues. // Otherwise, this thread can call pthread_detach and reset thr->sync // before the new thread got a chance to acquire from it in ThreadStart. atomic_store(&p.tid, tid, memory_order_release); while (atomic_load(&p.tid, memory_order_acquire) != 0) internal_sched_yield(); } if (attr == &myattr) pthread_attr_destroy(&myattr); return res; } TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) { SCOPED_INTERCEPTOR_RAW(pthread_join, th, ret); int tid = ThreadTid(thr, pc, (uptr)th); ThreadIgnoreBegin(thr, pc); int res = BLOCK_REAL(pthread_join)(th, ret); ThreadIgnoreEnd(thr, pc); if (res == 0) { ThreadJoin(thr, pc, tid); } return res; } DEFINE_REAL_PTHREAD_FUNCTIONS TSAN_INTERCEPTOR(int, pthread_detach, void *th) { SCOPED_TSAN_INTERCEPTOR(pthread_detach, th); int tid = ThreadTid(thr, pc, (uptr)th); int res = REAL(pthread_detach)(th); if (res == 0) { ThreadDetach(thr, pc, tid); } return res; } // Problem: // NPTL implementation of pthread_cond has 2 versions (2.2.5 and 2.3.2). // pthread_cond_t has different size in the different versions. // If call new REAL functions for old pthread_cond_t, they will corrupt memory // after pthread_cond_t (old cond is smaller). // If we call old REAL functions for new pthread_cond_t, we will lose some // functionality (e.g. old functions do not support waiting against // CLOCK_REALTIME). // Proper handling would require to have 2 versions of interceptors as well. // But this is messy, in particular requires linker scripts when sanitizer // runtime is linked into a shared library. // Instead we assume we don't have dynamic libraries built against old // pthread (2.2.5 is dated by 2002). And provide legacy_pthread_cond flag // that allows to work with old libraries (but this mode does not support // some features, e.g. pthread_condattr_getpshared). static void *init_cond(void *c, bool force = false) { // sizeof(pthread_cond_t) >= sizeof(uptr) in both versions. // So we allocate additional memory on the side large enough to hold // any pthread_cond_t object. Always call new REAL functions, but pass // the aux object to them. // Note: the code assumes that PTHREAD_COND_INITIALIZER initializes // first word of pthread_cond_t to zero. // It's all relevant only for linux. if (!common_flags()->legacy_pthread_cond) return c; atomic_uintptr_t *p = (atomic_uintptr_t*)c; uptr cond = atomic_load(p, memory_order_acquire); if (!force && cond != 0) return (void*)cond; void *newcond = WRAP(malloc)(pthread_cond_t_sz); internal_memset(newcond, 0, pthread_cond_t_sz); if (atomic_compare_exchange_strong(p, &cond, (uptr)newcond, memory_order_acq_rel)) return newcond; WRAP(free)(newcond); return (void*)cond; } struct CondMutexUnlockCtx { ScopedInterceptor *si; ThreadState *thr; uptr pc; void *m; }; static void cond_mutex_unlock(CondMutexUnlockCtx *arg) { // pthread_cond_wait interceptor has enabled async signal delivery // (see BlockingCall below). Disable async signals since we are running // tsan code. Also ScopedInterceptor and BlockingCall destructors won't run // since the thread is cancelled, so we have to manually execute them // (the thread still can run some user code due to pthread_cleanup_push). ThreadSignalContext *ctx = SigCtx(arg->thr); CHECK_EQ(atomic_load(&ctx->in_blocking_func, memory_order_relaxed), 1); atomic_store(&ctx->in_blocking_func, 0, memory_order_relaxed); MutexLock(arg->thr, arg->pc, (uptr)arg->m); // Undo BlockingCall ctor effects. arg->thr->ignore_interceptors--; arg->si->~ScopedInterceptor(); } INTERCEPTOR(int, pthread_cond_init, void *c, void *a) { void *cond = init_cond(c, true); SCOPED_TSAN_INTERCEPTOR(pthread_cond_init, cond, a); MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), true); return REAL(pthread_cond_init)(cond, a); } static int cond_wait(ThreadState *thr, uptr pc, ScopedInterceptor *si, int (*fn)(void *c, void *m, void *abstime), void *c, void *m, void *t) { MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), false); MutexUnlock(thr, pc, (uptr)m); CondMutexUnlockCtx arg = {si, thr, pc, m}; int res = 0; // This ensures that we handle mutex lock even in case of pthread_cancel. // See test/tsan/cond_cancel.cc. { // Enable signal delivery while the thread is blocked. BlockingCall bc(thr); res = call_pthread_cancel_with_cleanup( fn, c, m, t, (void (*)(void *arg))cond_mutex_unlock, &arg); } if (res == errno_EOWNERDEAD) MutexRepair(thr, pc, (uptr)m); MutexLock(thr, pc, (uptr)m); return res; } INTERCEPTOR(int, pthread_cond_wait, void *c, void *m) { void *cond = init_cond(c); SCOPED_TSAN_INTERCEPTOR(pthread_cond_wait, cond, m); return cond_wait(thr, pc, &si, (int (*)(void *c, void *m, void *abstime))REAL( pthread_cond_wait), cond, m, 0); } INTERCEPTOR(int, pthread_cond_timedwait, void *c, void *m, void *abstime) { void *cond = init_cond(c); SCOPED_TSAN_INTERCEPTOR(pthread_cond_timedwait, cond, m, abstime); return cond_wait(thr, pc, &si, REAL(pthread_cond_timedwait), cond, m, abstime); } #if SANITIZER_MAC INTERCEPTOR(int, pthread_cond_timedwait_relative_np, void *c, void *m, void *reltime) { void *cond = init_cond(c); SCOPED_TSAN_INTERCEPTOR(pthread_cond_timedwait_relative_np, cond, m, reltime); return cond_wait(thr, pc, &si, REAL(pthread_cond_timedwait_relative_np), cond, m, reltime); } #endif INTERCEPTOR(int, pthread_cond_signal, void *c) { void *cond = init_cond(c); SCOPED_TSAN_INTERCEPTOR(pthread_cond_signal, cond); MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), false); return REAL(pthread_cond_signal)(cond); } INTERCEPTOR(int, pthread_cond_broadcast, void *c) { void *cond = init_cond(c); SCOPED_TSAN_INTERCEPTOR(pthread_cond_broadcast, cond); MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), false); return REAL(pthread_cond_broadcast)(cond); } INTERCEPTOR(int, pthread_cond_destroy, void *c) { void *cond = init_cond(c); SCOPED_TSAN_INTERCEPTOR(pthread_cond_destroy, cond); MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), true); int res = REAL(pthread_cond_destroy)(cond); if (common_flags()->legacy_pthread_cond) { // Free our aux cond and zero the pointer to not leave dangling pointers. WRAP(free)(cond); atomic_store((atomic_uintptr_t*)c, 0, memory_order_relaxed); } return res; } TSAN_INTERCEPTOR(int, pthread_mutex_init, void *m, void *a) { SCOPED_TSAN_INTERCEPTOR(pthread_mutex_init, m, a); int res = REAL(pthread_mutex_init)(m, a); if (res == 0) { bool recursive = false; if (a) { int type = 0; if (REAL(pthread_mutexattr_gettype)(a, &type) == 0) recursive = (type == PTHREAD_MUTEX_RECURSIVE || type == PTHREAD_MUTEX_RECURSIVE_NP); } MutexCreate(thr, pc, (uptr)m, false, recursive, false); } return res; } TSAN_INTERCEPTOR(int, pthread_mutex_destroy, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_mutex_destroy, m); int res = REAL(pthread_mutex_destroy)(m); if (res == 0 || res == EBUSY) { MutexDestroy(thr, pc, (uptr)m); } return res; } TSAN_INTERCEPTOR(int, pthread_mutex_trylock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_mutex_trylock, m); int res = REAL(pthread_mutex_trylock)(m); if (res == EOWNERDEAD) MutexRepair(thr, pc, (uptr)m); if (res == 0 || res == EOWNERDEAD) MutexLock(thr, pc, (uptr)m, /*rec=*/1, /*try_lock=*/true); return res; } #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, pthread_mutex_timedlock, void *m, void *abstime) { SCOPED_TSAN_INTERCEPTOR(pthread_mutex_timedlock, m, abstime); int res = REAL(pthread_mutex_timedlock)(m, abstime); if (res == 0) { MutexLock(thr, pc, (uptr)m); } return res; } #endif #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, pthread_spin_init, void *m, int pshared) { SCOPED_TSAN_INTERCEPTOR(pthread_spin_init, m, pshared); int res = REAL(pthread_spin_init)(m, pshared); if (res == 0) { MutexCreate(thr, pc, (uptr)m, false, false, false); } return res; } TSAN_INTERCEPTOR(int, pthread_spin_destroy, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_spin_destroy, m); int res = REAL(pthread_spin_destroy)(m); if (res == 0) { MutexDestroy(thr, pc, (uptr)m); } return res; } TSAN_INTERCEPTOR(int, pthread_spin_lock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_spin_lock, m); int res = REAL(pthread_spin_lock)(m); if (res == 0) { MutexLock(thr, pc, (uptr)m); } return res; } TSAN_INTERCEPTOR(int, pthread_spin_trylock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_spin_trylock, m); int res = REAL(pthread_spin_trylock)(m); if (res == 0) { MutexLock(thr, pc, (uptr)m, /*rec=*/1, /*try_lock=*/true); } return res; } TSAN_INTERCEPTOR(int, pthread_spin_unlock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_spin_unlock, m); MutexUnlock(thr, pc, (uptr)m); int res = REAL(pthread_spin_unlock)(m); return res; } #endif TSAN_INTERCEPTOR(int, pthread_rwlock_init, void *m, void *a) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_init, m, a); int res = REAL(pthread_rwlock_init)(m, a); if (res == 0) { MutexCreate(thr, pc, (uptr)m, true, false, false); } return res; } TSAN_INTERCEPTOR(int, pthread_rwlock_destroy, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_destroy, m); int res = REAL(pthread_rwlock_destroy)(m); if (res == 0) { MutexDestroy(thr, pc, (uptr)m); } return res; } TSAN_INTERCEPTOR(int, pthread_rwlock_rdlock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_rdlock, m); int res = REAL(pthread_rwlock_rdlock)(m); if (res == 0) { MutexReadLock(thr, pc, (uptr)m); } return res; } TSAN_INTERCEPTOR(int, pthread_rwlock_tryrdlock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_tryrdlock, m); int res = REAL(pthread_rwlock_tryrdlock)(m); if (res == 0) { MutexReadLock(thr, pc, (uptr)m, /*try_lock=*/true); } return res; } #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, pthread_rwlock_timedrdlock, void *m, void *abstime) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_timedrdlock, m, abstime); int res = REAL(pthread_rwlock_timedrdlock)(m, abstime); if (res == 0) { MutexReadLock(thr, pc, (uptr)m); } return res; } #endif TSAN_INTERCEPTOR(int, pthread_rwlock_wrlock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_wrlock, m); int res = REAL(pthread_rwlock_wrlock)(m); if (res == 0) { MutexLock(thr, pc, (uptr)m); } return res; } TSAN_INTERCEPTOR(int, pthread_rwlock_trywrlock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_trywrlock, m); int res = REAL(pthread_rwlock_trywrlock)(m); if (res == 0) { MutexLock(thr, pc, (uptr)m, /*rec=*/1, /*try_lock=*/true); } return res; } #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, pthread_rwlock_timedwrlock, void *m, void *abstime) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_timedwrlock, m, abstime); int res = REAL(pthread_rwlock_timedwrlock)(m, abstime); if (res == 0) { MutexLock(thr, pc, (uptr)m); } return res; } #endif TSAN_INTERCEPTOR(int, pthread_rwlock_unlock, void *m) { SCOPED_TSAN_INTERCEPTOR(pthread_rwlock_unlock, m); MutexReadOrWriteUnlock(thr, pc, (uptr)m); int res = REAL(pthread_rwlock_unlock)(m); return res; } #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, pthread_barrier_init, void *b, void *a, unsigned count) { SCOPED_TSAN_INTERCEPTOR(pthread_barrier_init, b, a, count); MemoryWrite(thr, pc, (uptr)b, kSizeLog1); int res = REAL(pthread_barrier_init)(b, a, count); return res; } TSAN_INTERCEPTOR(int, pthread_barrier_destroy, void *b) { SCOPED_TSAN_INTERCEPTOR(pthread_barrier_destroy, b); MemoryWrite(thr, pc, (uptr)b, kSizeLog1); int res = REAL(pthread_barrier_destroy)(b); return res; } TSAN_INTERCEPTOR(int, pthread_barrier_wait, void *b) { SCOPED_TSAN_INTERCEPTOR(pthread_barrier_wait, b); Release(thr, pc, (uptr)b); MemoryRead(thr, pc, (uptr)b, kSizeLog1); int res = REAL(pthread_barrier_wait)(b); MemoryRead(thr, pc, (uptr)b, kSizeLog1); if (res == 0 || res == PTHREAD_BARRIER_SERIAL_THREAD) { Acquire(thr, pc, (uptr)b); } return res; } #endif TSAN_INTERCEPTOR(int, pthread_once, void *o, void (*f)()) { SCOPED_INTERCEPTOR_RAW(pthread_once, o, f); if (o == 0 || f == 0) return EINVAL; atomic_uint32_t *a; if (!SANITIZER_MAC) a = static_cast(o); else // On OS X, pthread_once_t has a header with a long-sized signature. a = static_cast((void *)((char *)o + sizeof(long_t))); u32 v = atomic_load(a, memory_order_acquire); if (v == 0 && atomic_compare_exchange_strong(a, &v, 1, memory_order_relaxed)) { (*f)(); if (!thr->in_ignored_lib) Release(thr, pc, (uptr)o); atomic_store(a, 2, memory_order_release); } else { while (v != 2) { internal_sched_yield(); v = atomic_load(a, memory_order_acquire); } if (!thr->in_ignored_lib) Acquire(thr, pc, (uptr)o); } return 0; } #if SANITIZER_LINUX && !SANITIZER_ANDROID TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) { SCOPED_TSAN_INTERCEPTOR(__fxstat, version, fd, buf); if (fd > 0) FdAccess(thr, pc, fd); return REAL(__fxstat)(version, fd, buf); } #define TSAN_MAYBE_INTERCEPT___FXSTAT TSAN_INTERCEPT(__fxstat) #else #define TSAN_MAYBE_INTERCEPT___FXSTAT #endif TSAN_INTERCEPTOR(int, fstat, int fd, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_ANDROID SCOPED_TSAN_INTERCEPTOR(fstat, fd, buf); if (fd > 0) FdAccess(thr, pc, fd); return REAL(fstat)(fd, buf); #else SCOPED_TSAN_INTERCEPTOR(__fxstat, 0, fd, buf); if (fd > 0) FdAccess(thr, pc, fd); return REAL(__fxstat)(0, fd, buf); #endif } #if SANITIZER_LINUX && !SANITIZER_ANDROID TSAN_INTERCEPTOR(int, __fxstat64, int version, int fd, void *buf) { SCOPED_TSAN_INTERCEPTOR(__fxstat64, version, fd, buf); if (fd > 0) FdAccess(thr, pc, fd); return REAL(__fxstat64)(version, fd, buf); } #define TSAN_MAYBE_INTERCEPT___FXSTAT64 TSAN_INTERCEPT(__fxstat64) #else #define TSAN_MAYBE_INTERCEPT___FXSTAT64 #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID TSAN_INTERCEPTOR(int, fstat64, int fd, void *buf) { SCOPED_TSAN_INTERCEPTOR(__fxstat64, 0, fd, buf); if (fd > 0) FdAccess(thr, pc, fd); return REAL(__fxstat64)(0, fd, buf); } #define TSAN_MAYBE_INTERCEPT_FSTAT64 TSAN_INTERCEPT(fstat64) #else #define TSAN_MAYBE_INTERCEPT_FSTAT64 #endif TSAN_INTERCEPTOR(int, open, const char *name, int flags, int mode) { SCOPED_TSAN_INTERCEPTOR(open, name, flags, mode); READ_STRING(thr, pc, name, 0); int fd = REAL(open)(name, flags, mode); if (fd >= 0) FdFileCreate(thr, pc, fd); return fd; } #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, open64, const char *name, int flags, int mode) { SCOPED_TSAN_INTERCEPTOR(open64, name, flags, mode); READ_STRING(thr, pc, name, 0); int fd = REAL(open64)(name, flags, mode); if (fd >= 0) FdFileCreate(thr, pc, fd); return fd; } #define TSAN_MAYBE_INTERCEPT_OPEN64 TSAN_INTERCEPT(open64) #else #define TSAN_MAYBE_INTERCEPT_OPEN64 #endif TSAN_INTERCEPTOR(int, creat, const char *name, int mode) { SCOPED_TSAN_INTERCEPTOR(creat, name, mode); READ_STRING(thr, pc, name, 0); int fd = REAL(creat)(name, mode); if (fd >= 0) FdFileCreate(thr, pc, fd); return fd; } #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, creat64, const char *name, int mode) { SCOPED_TSAN_INTERCEPTOR(creat64, name, mode); READ_STRING(thr, pc, name, 0); int fd = REAL(creat64)(name, mode); if (fd >= 0) FdFileCreate(thr, pc, fd); return fd; } #define TSAN_MAYBE_INTERCEPT_CREAT64 TSAN_INTERCEPT(creat64) #else #define TSAN_MAYBE_INTERCEPT_CREAT64 #endif TSAN_INTERCEPTOR(int, dup, int oldfd) { SCOPED_TSAN_INTERCEPTOR(dup, oldfd); int newfd = REAL(dup)(oldfd); if (oldfd >= 0 && newfd >= 0 && newfd != oldfd) FdDup(thr, pc, oldfd, newfd, true); return newfd; } TSAN_INTERCEPTOR(int, dup2, int oldfd, int newfd) { SCOPED_TSAN_INTERCEPTOR(dup2, oldfd, newfd); int newfd2 = REAL(dup2)(oldfd, newfd); if (oldfd >= 0 && newfd2 >= 0 && newfd2 != oldfd) FdDup(thr, pc, oldfd, newfd2, false); return newfd2; } #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, dup3, int oldfd, int newfd, int flags) { SCOPED_TSAN_INTERCEPTOR(dup3, oldfd, newfd, flags); int newfd2 = REAL(dup3)(oldfd, newfd, flags); if (oldfd >= 0 && newfd2 >= 0 && newfd2 != oldfd) FdDup(thr, pc, oldfd, newfd2, false); return newfd2; } #endif #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, eventfd, unsigned initval, int flags) { SCOPED_TSAN_INTERCEPTOR(eventfd, initval, flags); int fd = REAL(eventfd)(initval, flags); if (fd >= 0) FdEventCreate(thr, pc, fd); return fd; } #define TSAN_MAYBE_INTERCEPT_EVENTFD TSAN_INTERCEPT(eventfd) #else #define TSAN_MAYBE_INTERCEPT_EVENTFD #endif #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, signalfd, int fd, void *mask, int flags) { SCOPED_TSAN_INTERCEPTOR(signalfd, fd, mask, flags); if (fd >= 0) FdClose(thr, pc, fd); fd = REAL(signalfd)(fd, mask, flags); if (fd >= 0) FdSignalCreate(thr, pc, fd); return fd; } #define TSAN_MAYBE_INTERCEPT_SIGNALFD TSAN_INTERCEPT(signalfd) #else #define TSAN_MAYBE_INTERCEPT_SIGNALFD #endif #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, inotify_init, int fake) { SCOPED_TSAN_INTERCEPTOR(inotify_init, fake); int fd = REAL(inotify_init)(fake); if (fd >= 0) FdInotifyCreate(thr, pc, fd); return fd; } #define TSAN_MAYBE_INTERCEPT_INOTIFY_INIT TSAN_INTERCEPT(inotify_init) #else #define TSAN_MAYBE_INTERCEPT_INOTIFY_INIT #endif #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, inotify_init1, int flags) { SCOPED_TSAN_INTERCEPTOR(inotify_init1, flags); int fd = REAL(inotify_init1)(flags); if (fd >= 0) FdInotifyCreate(thr, pc, fd); return fd; } #define TSAN_MAYBE_INTERCEPT_INOTIFY_INIT1 TSAN_INTERCEPT(inotify_init1) #else #define TSAN_MAYBE_INTERCEPT_INOTIFY_INIT1 #endif TSAN_INTERCEPTOR(int, socket, int domain, int type, int protocol) { SCOPED_TSAN_INTERCEPTOR(socket, domain, type, protocol); int fd = REAL(socket)(domain, type, protocol); if (fd >= 0) FdSocketCreate(thr, pc, fd); return fd; } TSAN_INTERCEPTOR(int, socketpair, int domain, int type, int protocol, int *fd) { SCOPED_TSAN_INTERCEPTOR(socketpair, domain, type, protocol, fd); int res = REAL(socketpair)(domain, type, protocol, fd); if (res == 0 && fd[0] >= 0 && fd[1] >= 0) FdPipeCreate(thr, pc, fd[0], fd[1]); return res; } TSAN_INTERCEPTOR(int, connect, int fd, void *addr, unsigned addrlen) { SCOPED_TSAN_INTERCEPTOR(connect, fd, addr, addrlen); FdSocketConnecting(thr, pc, fd); int res = REAL(connect)(fd, addr, addrlen); if (res == 0 && fd >= 0) FdSocketConnect(thr, pc, fd); return res; } TSAN_INTERCEPTOR(int, bind, int fd, void *addr, unsigned addrlen) { SCOPED_TSAN_INTERCEPTOR(bind, fd, addr, addrlen); int res = REAL(bind)(fd, addr, addrlen); if (fd > 0 && res == 0) FdAccess(thr, pc, fd); return res; } TSAN_INTERCEPTOR(int, listen, int fd, int backlog) { SCOPED_TSAN_INTERCEPTOR(listen, fd, backlog); int res = REAL(listen)(fd, backlog); if (fd > 0 && res == 0) FdAccess(thr, pc, fd); return res; } TSAN_INTERCEPTOR(int, close, int fd) { SCOPED_TSAN_INTERCEPTOR(close, fd); if (fd >= 0) FdClose(thr, pc, fd); return REAL(close)(fd); } #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, __close, int fd) { SCOPED_TSAN_INTERCEPTOR(__close, fd); if (fd >= 0) FdClose(thr, pc, fd); return REAL(__close)(fd); } #define TSAN_MAYBE_INTERCEPT___CLOSE TSAN_INTERCEPT(__close) #else #define TSAN_MAYBE_INTERCEPT___CLOSE #endif // glibc guts #if SANITIZER_LINUX && !SANITIZER_ANDROID TSAN_INTERCEPTOR(void, __res_iclose, void *state, bool free_addr) { SCOPED_TSAN_INTERCEPTOR(__res_iclose, state, free_addr); int fds[64]; int cnt = ExtractResolvFDs(state, fds, ARRAY_SIZE(fds)); for (int i = 0; i < cnt; i++) { if (fds[i] > 0) FdClose(thr, pc, fds[i]); } REAL(__res_iclose)(state, free_addr); } #define TSAN_MAYBE_INTERCEPT___RES_ICLOSE TSAN_INTERCEPT(__res_iclose) #else #define TSAN_MAYBE_INTERCEPT___RES_ICLOSE #endif TSAN_INTERCEPTOR(int, pipe, int *pipefd) { SCOPED_TSAN_INTERCEPTOR(pipe, pipefd); int res = REAL(pipe)(pipefd); if (res == 0 && pipefd[0] >= 0 && pipefd[1] >= 0) FdPipeCreate(thr, pc, pipefd[0], pipefd[1]); return res; } #if !SANITIZER_MAC TSAN_INTERCEPTOR(int, pipe2, int *pipefd, int flags) { SCOPED_TSAN_INTERCEPTOR(pipe2, pipefd, flags); int res = REAL(pipe2)(pipefd, flags); if (res == 0 && pipefd[0] >= 0 && pipefd[1] >= 0) FdPipeCreate(thr, pc, pipefd[0], pipefd[1]); return res; } #endif TSAN_INTERCEPTOR(int, unlink, char *path) { SCOPED_TSAN_INTERCEPTOR(unlink, path); Release(thr, pc, File2addr(path)); int res = REAL(unlink)(path); return res; } TSAN_INTERCEPTOR(void*, tmpfile, int fake) { SCOPED_TSAN_INTERCEPTOR(tmpfile, fake); void *res = REAL(tmpfile)(fake); if (res) { int fd = fileno_unlocked(res); if (fd >= 0) FdFileCreate(thr, pc, fd); } return res; } #if SANITIZER_LINUX TSAN_INTERCEPTOR(void*, tmpfile64, int fake) { SCOPED_TSAN_INTERCEPTOR(tmpfile64, fake); void *res = REAL(tmpfile64)(fake); if (res) { int fd = fileno_unlocked(res); if (fd >= 0) FdFileCreate(thr, pc, fd); } return res; } #define TSAN_MAYBE_INTERCEPT_TMPFILE64 TSAN_INTERCEPT(tmpfile64) #else #define TSAN_MAYBE_INTERCEPT_TMPFILE64 #endif TSAN_INTERCEPTOR(uptr, fread, void *ptr, uptr size, uptr nmemb, void *f) { // libc file streams can call user-supplied functions, see fopencookie. { SCOPED_TSAN_INTERCEPTOR(fread, ptr, size, nmemb, f); MemoryAccessRange(thr, pc, (uptr)ptr, size * nmemb, true); } return REAL(fread)(ptr, size, nmemb, f); } TSAN_INTERCEPTOR(uptr, fwrite, const void *p, uptr size, uptr nmemb, void *f) { // libc file streams can call user-supplied functions, see fopencookie. { SCOPED_TSAN_INTERCEPTOR(fwrite, p, size, nmemb, f); MemoryAccessRange(thr, pc, (uptr)p, size * nmemb, false); } return REAL(fwrite)(p, size, nmemb, f); } static void FlushStreams() { // Flushing all the streams here may freeze the process if a child thread is // performing file stream operations at the same time. REAL(fflush)(stdout); REAL(fflush)(stderr); } TSAN_INTERCEPTOR(void, abort, int fake) { SCOPED_TSAN_INTERCEPTOR(abort, fake); FlushStreams(); REAL(abort)(fake); } TSAN_INTERCEPTOR(int, puts, const char *s) { SCOPED_TSAN_INTERCEPTOR(puts, s); MemoryAccessRange(thr, pc, (uptr)s, internal_strlen(s), false); return REAL(puts)(s); } TSAN_INTERCEPTOR(int, rmdir, char *path) { SCOPED_TSAN_INTERCEPTOR(rmdir, path); Release(thr, pc, Dir2addr(path)); int res = REAL(rmdir)(path); return res; } TSAN_INTERCEPTOR(int, closedir, void *dirp) { SCOPED_TSAN_INTERCEPTOR(closedir, dirp); if (dirp) { int fd = dirfd(dirp); FdClose(thr, pc, fd); } return REAL(closedir)(dirp); } #if SANITIZER_LINUX TSAN_INTERCEPTOR(int, epoll_create, int size) { SCOPED_TSAN_INTERCEPTOR(epoll_create, size); int fd = REAL(epoll_create)(size); if (fd >= 0) FdPollCreate(thr, pc, fd); return fd; } TSAN_INTERCEPTOR(int, epoll_create1, int flags) { SCOPED_TSAN_INTERCEPTOR(epoll_create1, flags); int fd = REAL(epoll_create1)(flags); if (fd >= 0) FdPollCreate(thr, pc, fd); return fd; } TSAN_INTERCEPTOR(int, epoll_ctl, int epfd, int op, int fd, void *ev) { SCOPED_TSAN_INTERCEPTOR(epoll_ctl, epfd, op, fd, ev); if (epfd >= 0) FdAccess(thr, pc, epfd); if (epfd >= 0 && fd >= 0) FdAccess(thr, pc, fd); if (op == EPOLL_CTL_ADD && epfd >= 0) FdRelease(thr, pc, epfd); int res = REAL(epoll_ctl)(epfd, op, fd, ev); return res; } TSAN_INTERCEPTOR(int, epoll_wait, int epfd, void *ev, int cnt, int timeout) { SCOPED_TSAN_INTERCEPTOR(epoll_wait, epfd, ev, cnt, timeout); if (epfd >= 0) FdAccess(thr, pc, epfd); int res = BLOCK_REAL(epoll_wait)(epfd, ev, cnt, timeout); if (res > 0 && epfd >= 0) FdAcquire(thr, pc, epfd); return res; } TSAN_INTERCEPTOR(int, epoll_pwait, int epfd, void *ev, int cnt, int timeout, void *sigmask) { SCOPED_TSAN_INTERCEPTOR(epoll_pwait, epfd, ev, cnt, timeout, sigmask); if (epfd >= 0) FdAccess(thr, pc, epfd); int res = BLOCK_REAL(epoll_pwait)(epfd, ev, cnt, timeout, sigmask); if (res > 0 && epfd >= 0) FdAcquire(thr, pc, epfd); return res; } #define TSAN_MAYBE_INTERCEPT_EPOLL \ TSAN_INTERCEPT(epoll_create); \ TSAN_INTERCEPT(epoll_create1); \ TSAN_INTERCEPT(epoll_ctl); \ TSAN_INTERCEPT(epoll_wait); \ TSAN_INTERCEPT(epoll_pwait) #else #define TSAN_MAYBE_INTERCEPT_EPOLL #endif // The following functions are intercepted merely to process pending signals. // If program blocks signal X, we must deliver the signal before the function // returns. Similarly, if program unblocks a signal (or returns from sigsuspend) // it's better to deliver the signal straight away. TSAN_INTERCEPTOR(int, sigsuspend, const __sanitizer_sigset_t *mask) { SCOPED_TSAN_INTERCEPTOR(sigsuspend, mask); return REAL(sigsuspend)(mask); } TSAN_INTERCEPTOR(int, sigblock, int mask) { SCOPED_TSAN_INTERCEPTOR(sigblock, mask); return REAL(sigblock)(mask); } TSAN_INTERCEPTOR(int, sigsetmask, int mask) { SCOPED_TSAN_INTERCEPTOR(sigsetmask, mask); return REAL(sigsetmask)(mask); } TSAN_INTERCEPTOR(int, pthread_sigmask, int how, const __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) { SCOPED_TSAN_INTERCEPTOR(pthread_sigmask, how, set, oldset); return REAL(pthread_sigmask)(how, set, oldset); } namespace __tsan { static void CallUserSignalHandler(ThreadState *thr, bool sync, bool acquire, bool sigact, int sig, my_siginfo_t *info, void *uctx) { if (acquire) Acquire(thr, 0, (uptr)&sigactions[sig]); // Signals are generally asynchronous, so if we receive a signals when // ignores are enabled we should disable ignores. This is critical for sync // and interceptors, because otherwise we can miss syncronization and report // false races. int ignore_reads_and_writes = thr->ignore_reads_and_writes; int ignore_interceptors = thr->ignore_interceptors; int ignore_sync = thr->ignore_sync; if (!ctx->after_multithreaded_fork) { thr->ignore_reads_and_writes = 0; thr->fast_state.ClearIgnoreBit(); thr->ignore_interceptors = 0; thr->ignore_sync = 0; } // Ensure that the handler does not spoil errno. const int saved_errno = errno; errno = 99; // This code races with sigaction. Be careful to not read sa_sigaction twice. // Also need to remember pc for reporting before the call, // because the handler can reset it. volatile uptr pc = sigact ? (uptr)sigactions[sig].sa_sigaction : (uptr)sigactions[sig].sa_handler; if (pc != (uptr)SIG_DFL && pc != (uptr)SIG_IGN) { if (sigact) ((sigactionhandler_t)pc)(sig, info, uctx); else ((sighandler_t)pc)(sig); } if (!ctx->after_multithreaded_fork) { thr->ignore_reads_and_writes = ignore_reads_and_writes; if (ignore_reads_and_writes) thr->fast_state.SetIgnoreBit(); thr->ignore_interceptors = ignore_interceptors; thr->ignore_sync = ignore_sync; } // We do not detect errno spoiling for SIGTERM, // because some SIGTERM handlers do spoil errno but reraise SIGTERM, // tsan reports false positive in such case. // It's difficult to properly detect this situation (reraise), // because in async signal processing case (when handler is called directly // from rtl_generic_sighandler) we have not yet received the reraised // signal; and it looks too fragile to intercept all ways to reraise a signal. if (flags()->report_bugs && !sync && sig != SIGTERM && errno != 99) { VarSizeStackTrace stack; // StackTrace::GetNestInstructionPc(pc) is used because return address is // expected, OutputReport() will undo this. ObtainCurrentStack(thr, StackTrace::GetNextInstructionPc(pc), &stack); ThreadRegistryLock l(ctx->thread_registry); ScopedReport rep(ReportTypeErrnoInSignal); if (!IsFiredSuppression(ctx, ReportTypeErrnoInSignal, stack)) { rep.AddStack(stack, true); OutputReport(thr, rep); } } errno = saved_errno; } void ProcessPendingSignals(ThreadState *thr) { ThreadSignalContext *sctx = SigCtx(thr); if (sctx == 0 || atomic_load(&sctx->have_pending_signals, memory_order_relaxed) == 0) return; atomic_store(&sctx->have_pending_signals, 0, memory_order_relaxed); atomic_fetch_add(&thr->in_signal_handler, 1, memory_order_relaxed); internal_sigfillset(&sctx->emptyset); int res = REAL(pthread_sigmask)(SIG_SETMASK, &sctx->emptyset, &sctx->oldset); CHECK_EQ(res, 0); for (int sig = 0; sig < kSigCount; sig++) { SignalDesc *signal = &sctx->pending_signals[sig]; if (signal->armed) { signal->armed = false; CallUserSignalHandler(thr, false, true, signal->sigaction, sig, &signal->siginfo, &signal->ctx); } } res = REAL(pthread_sigmask)(SIG_SETMASK, &sctx->oldset, 0); CHECK_EQ(res, 0); atomic_fetch_add(&thr->in_signal_handler, -1, memory_order_relaxed); } } // namespace __tsan static bool is_sync_signal(ThreadSignalContext *sctx, int sig) { return sig == SIGSEGV || sig == SIGBUS || sig == SIGILL || sig == SIGABRT || sig == SIGFPE || sig == SIGPIPE || sig == SIGSYS || // If we are sending signal to ourselves, we must process it now. (sctx && sig == sctx->int_signal_send); } void ALWAYS_INLINE rtl_generic_sighandler(bool sigact, int sig, my_siginfo_t *info, void *ctx) { ThreadState *thr = cur_thread(); ThreadSignalContext *sctx = SigCtx(thr); if (sig < 0 || sig >= kSigCount) { VPrintf(1, "ThreadSanitizer: ignoring signal %d\n", sig); return; } // Don't mess with synchronous signals. const bool sync = is_sync_signal(sctx, sig); if (sync || // If we are in blocking function, we can safely process it now // (but check if we are in a recursive interceptor, // i.e. pthread_join()->munmap()). (sctx && atomic_load(&sctx->in_blocking_func, memory_order_relaxed))) { atomic_fetch_add(&thr->in_signal_handler, 1, memory_order_relaxed); if (sctx && atomic_load(&sctx->in_blocking_func, memory_order_relaxed)) { atomic_store(&sctx->in_blocking_func, 0, memory_order_relaxed); CallUserSignalHandler(thr, sync, true, sigact, sig, info, ctx); atomic_store(&sctx->in_blocking_func, 1, memory_order_relaxed); } else { // Be very conservative with when we do acquire in this case. // It's unsafe to do acquire in async handlers, because ThreadState // can be in inconsistent state. // SIGSYS looks relatively safe -- it's synchronous and can actually // need some global state. bool acq = (sig == SIGSYS); CallUserSignalHandler(thr, sync, acq, sigact, sig, info, ctx); } atomic_fetch_add(&thr->in_signal_handler, -1, memory_order_relaxed); return; } if (sctx == 0) return; SignalDesc *signal = &sctx->pending_signals[sig]; if (signal->armed == false) { signal->armed = true; signal->sigaction = sigact; if (info) internal_memcpy(&signal->siginfo, info, sizeof(*info)); if (ctx) internal_memcpy(&signal->ctx, ctx, sizeof(signal->ctx)); atomic_store(&sctx->have_pending_signals, 1, memory_order_relaxed); } } static void rtl_sighandler(int sig) { rtl_generic_sighandler(false, sig, 0, 0); } static void rtl_sigaction(int sig, my_siginfo_t *info, void *ctx) { rtl_generic_sighandler(true, sig, info, ctx); } TSAN_INTERCEPTOR(int, sigaction, int sig, sigaction_t *act, sigaction_t *old) { // Note: if we call REAL(sigaction) directly for any reason without proxying // the signal handler through rtl_sigaction, very bad things will happen. // The handler will run synchronously and corrupt tsan per-thread state. SCOPED_INTERCEPTOR_RAW(sigaction, sig, act, old); if (old) internal_memcpy(old, &sigactions[sig], sizeof(*old)); if (act == 0) return 0; // Copy act into sigactions[sig]. // Can't use struct copy, because compiler can emit call to memcpy. // Can't use internal_memcpy, because it copies byte-by-byte, // and signal handler reads the sa_handler concurrently. It it can read // some bytes from old value and some bytes from new value. // Use volatile to prevent insertion of memcpy. sigactions[sig].sa_handler = *(volatile sighandler_t*)&act->sa_handler; sigactions[sig].sa_flags = *(volatile int*)&act->sa_flags; internal_memcpy(&sigactions[sig].sa_mask, &act->sa_mask, sizeof(sigactions[sig].sa_mask)); #if !SANITIZER_FREEBSD && !SANITIZER_MAC sigactions[sig].sa_restorer = act->sa_restorer; #endif sigaction_t newact; internal_memcpy(&newact, act, sizeof(newact)); internal_sigfillset(&newact.sa_mask); if (act->sa_handler != SIG_IGN && act->sa_handler != SIG_DFL) { if (newact.sa_flags & SA_SIGINFO) newact.sa_sigaction = rtl_sigaction; else newact.sa_handler = rtl_sighandler; } ReleaseStore(thr, pc, (uptr)&sigactions[sig]); int res = REAL(sigaction)(sig, &newact, 0); return res; } TSAN_INTERCEPTOR(sighandler_t, signal, int sig, sighandler_t h) { sigaction_t act; act.sa_handler = h; internal_memset(&act.sa_mask, -1, sizeof(act.sa_mask)); act.sa_flags = 0; sigaction_t old; int res = sigaction(sig, &act, &old); if (res) return SIG_ERR; return old.sa_handler; } TSAN_INTERCEPTOR(int, raise, int sig) { SCOPED_TSAN_INTERCEPTOR(raise, sig); ThreadSignalContext *sctx = SigCtx(thr); CHECK_NE(sctx, 0); int prev = sctx->int_signal_send; sctx->int_signal_send = sig; int res = REAL(raise)(sig); CHECK_EQ(sctx->int_signal_send, sig); sctx->int_signal_send = prev; return res; } TSAN_INTERCEPTOR(int, kill, int pid, int sig) { SCOPED_TSAN_INTERCEPTOR(kill, pid, sig); ThreadSignalContext *sctx = SigCtx(thr); CHECK_NE(sctx, 0); int prev = sctx->int_signal_send; if (pid == (int)internal_getpid()) { sctx->int_signal_send = sig; } int res = REAL(kill)(pid, sig); if (pid == (int)internal_getpid()) { CHECK_EQ(sctx->int_signal_send, sig); sctx->int_signal_send = prev; } return res; } TSAN_INTERCEPTOR(int, pthread_kill, void *tid, int sig) { SCOPED_TSAN_INTERCEPTOR(pthread_kill, tid, sig); ThreadSignalContext *sctx = SigCtx(thr); CHECK_NE(sctx, 0); int prev = sctx->int_signal_send; if (tid == pthread_self()) { sctx->int_signal_send = sig; } int res = REAL(pthread_kill)(tid, sig); if (tid == pthread_self()) { CHECK_EQ(sctx->int_signal_send, sig); sctx->int_signal_send = prev; } return res; } TSAN_INTERCEPTOR(int, gettimeofday, void *tv, void *tz) { SCOPED_TSAN_INTERCEPTOR(gettimeofday, tv, tz); // It's intercepted merely to process pending signals. return REAL(gettimeofday)(tv, tz); } TSAN_INTERCEPTOR(int, getaddrinfo, void *node, void *service, void *hints, void *rv) { SCOPED_TSAN_INTERCEPTOR(getaddrinfo, node, service, hints, rv); // We miss atomic synchronization in getaddrinfo, // and can report false race between malloc and free // inside of getaddrinfo. So ignore memory accesses. ThreadIgnoreBegin(thr, pc); int res = REAL(getaddrinfo)(node, service, hints, rv); ThreadIgnoreEnd(thr, pc); return res; } TSAN_INTERCEPTOR(int, fork, int fake) { if (cur_thread()->in_symbolizer) return REAL(fork)(fake); SCOPED_INTERCEPTOR_RAW(fork, fake); ForkBefore(thr, pc); int pid; { // On OS X, REAL(fork) can call intercepted functions (OSSpinLockLock), and // we'll assert in CheckNoLocks() unless we ignore interceptors. ScopedIgnoreInterceptors ignore; pid = REAL(fork)(fake); } if (pid == 0) { // child ForkChildAfter(thr, pc); FdOnFork(thr, pc); } else if (pid > 0) { // parent ForkParentAfter(thr, pc); } else { // error ForkParentAfter(thr, pc); } return pid; } TSAN_INTERCEPTOR(int, vfork, int fake) { // Some programs (e.g. openjdk) call close for all file descriptors // in the child process. Under tsan it leads to false positives, because // address space is shared, so the parent process also thinks that // the descriptors are closed (while they are actually not). // This leads to false positives due to missed synchronization. // Strictly saying this is undefined behavior, because vfork child is not // allowed to call any functions other than exec/exit. But this is what // openjdk does, so we want to handle it. // We could disable interceptors in the child process. But it's not possible // to simply intercept and wrap vfork, because vfork child is not allowed // to return from the function that calls vfork, and that's exactly what // we would do. So this would require some assembly trickery as well. // Instead we simply turn vfork into fork. return WRAP(fork)(fake); } #if !SANITIZER_MAC && !SANITIZER_ANDROID typedef int (*dl_iterate_phdr_cb_t)(__sanitizer_dl_phdr_info *info, SIZE_T size, void *data); struct dl_iterate_phdr_data { ThreadState *thr; uptr pc; dl_iterate_phdr_cb_t cb; void *data; }; static bool IsAppNotRodata(uptr addr) { return IsAppMem(addr) && *(u64*)MemToShadow(addr) != kShadowRodata; } static int dl_iterate_phdr_cb(__sanitizer_dl_phdr_info *info, SIZE_T size, void *data) { dl_iterate_phdr_data *cbdata = (dl_iterate_phdr_data *)data; // dlopen/dlclose allocate/free dynamic-linker-internal memory, which is later // accessible in dl_iterate_phdr callback. But we don't see synchronization // inside of dynamic linker, so we "unpoison" it here in order to not // produce false reports. Ignoring malloc/free in dlopen/dlclose is not enough // because some libc functions call __libc_dlopen. if (info && IsAppNotRodata((uptr)info->dlpi_name)) MemoryResetRange(cbdata->thr, cbdata->pc, (uptr)info->dlpi_name, internal_strlen(info->dlpi_name)); int res = cbdata->cb(info, size, cbdata->data); // Perform the check one more time in case info->dlpi_name was overwritten // by user callback. if (info && IsAppNotRodata((uptr)info->dlpi_name)) MemoryResetRange(cbdata->thr, cbdata->pc, (uptr)info->dlpi_name, internal_strlen(info->dlpi_name)); return res; } TSAN_INTERCEPTOR(int, dl_iterate_phdr, dl_iterate_phdr_cb_t cb, void *data) { SCOPED_TSAN_INTERCEPTOR(dl_iterate_phdr, cb, data); dl_iterate_phdr_data cbdata; cbdata.thr = thr; cbdata.pc = pc; cbdata.cb = cb; cbdata.data = data; int res = REAL(dl_iterate_phdr)(dl_iterate_phdr_cb, &cbdata); return res; } #endif static int OnExit(ThreadState *thr) { int status = Finalize(thr); FlushStreams(); return status; } struct TsanInterceptorContext { ThreadState *thr; const uptr caller_pc; const uptr pc; }; #if !SANITIZER_MAC static void HandleRecvmsg(ThreadState *thr, uptr pc, __sanitizer_msghdr *msg) { int fds[64]; int cnt = ExtractRecvmsgFDs(msg, fds, ARRAY_SIZE(fds)); for (int i = 0; i < cnt; i++) FdEventCreate(thr, pc, fds[i]); } #endif #include "sanitizer_common/sanitizer_platform_interceptors.h" // Causes interceptor recursion (getaddrinfo() and fopen()) #undef SANITIZER_INTERCEPT_GETADDRINFO // There interceptors do not seem to be strictly necessary for tsan. // But we see cases where the interceptors consume 70% of execution time. // Memory blocks passed to fgetgrent_r are "written to" by tsan several times. // First, there is some recursion (getgrnam_r calls fgetgrent_r), and each // function "writes to" the buffer. Then, the same memory is "written to" // twice, first as buf and then as pwbufp (both of them refer to the same // addresses). #undef SANITIZER_INTERCEPT_GETPWENT #undef SANITIZER_INTERCEPT_GETPWENT_R #undef SANITIZER_INTERCEPT_FGETPWENT #undef SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS #undef SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS // We define our own. #if SANITIZER_INTERCEPT_TLS_GET_ADDR #define NEED_TLS_GET_ADDR #endif #undef SANITIZER_INTERCEPT_TLS_GET_ADDR #define COMMON_INTERCEPT_FUNCTION(name) INTERCEPT_FUNCTION(name) #define COMMON_INTERCEPT_FUNCTION_VER(name, ver) \ INTERCEPT_FUNCTION_VER(name, ver) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ MemoryAccessRange(((TsanInterceptorContext *)ctx)->thr, \ ((TsanInterceptorContext *)ctx)->pc, (uptr)ptr, size, \ true) #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ MemoryAccessRange(((TsanInterceptorContext *) ctx)->thr, \ ((TsanInterceptorContext *) ctx)->pc, (uptr) ptr, size, \ false) #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \ SCOPED_TSAN_INTERCEPTOR(func, __VA_ARGS__); \ TsanInterceptorContext _ctx = {thr, caller_pc, pc}; \ ctx = (void *)&_ctx; \ (void) ctx; #define COMMON_INTERCEPTOR_ENTER_NOIGNORE(ctx, func, ...) \ SCOPED_INTERCEPTOR_RAW(func, __VA_ARGS__); \ TsanInterceptorContext _ctx = {thr, caller_pc, pc}; \ ctx = (void *)&_ctx; \ (void) ctx; #define COMMON_INTERCEPTOR_FILE_OPEN(ctx, file, path) \ Acquire(thr, pc, File2addr(path)); \ if (file) { \ int fd = fileno_unlocked(file); \ if (fd >= 0) FdFileCreate(thr, pc, fd); \ } #define COMMON_INTERCEPTOR_FILE_CLOSE(ctx, file) \ if (file) { \ int fd = fileno_unlocked(file); \ if (fd >= 0) FdClose(thr, pc, fd); \ } #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \ libignore()->OnLibraryLoaded(filename) #define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() \ libignore()->OnLibraryUnloaded() #define COMMON_INTERCEPTOR_ACQUIRE(ctx, u) \ Acquire(((TsanInterceptorContext *) ctx)->thr, pc, u) #define COMMON_INTERCEPTOR_RELEASE(ctx, u) \ Release(((TsanInterceptorContext *) ctx)->thr, pc, u) #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \ Acquire(((TsanInterceptorContext *) ctx)->thr, pc, Dir2addr(path)) #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \ FdAcquire(((TsanInterceptorContext *) ctx)->thr, pc, fd) #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \ FdRelease(((TsanInterceptorContext *) ctx)->thr, pc, fd) #define COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd) \ FdAccess(((TsanInterceptorContext *) ctx)->thr, pc, fd) #define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \ FdSocketAccept(((TsanInterceptorContext *) ctx)->thr, pc, fd, newfd) #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \ ThreadSetName(((TsanInterceptorContext *) ctx)->thr, name) #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \ __tsan::ctx->thread_registry->SetThreadNameByUserId(thread, name) #define COMMON_INTERCEPTOR_BLOCK_REAL(name) BLOCK_REAL(name) #define COMMON_INTERCEPTOR_ON_EXIT(ctx) \ OnExit(((TsanInterceptorContext *) ctx)->thr) #define COMMON_INTERCEPTOR_MUTEX_LOCK(ctx, m) \ MutexLock(((TsanInterceptorContext *)ctx)->thr, \ ((TsanInterceptorContext *)ctx)->pc, (uptr)m) #define COMMON_INTERCEPTOR_MUTEX_UNLOCK(ctx, m) \ MutexUnlock(((TsanInterceptorContext *)ctx)->thr, \ ((TsanInterceptorContext *)ctx)->pc, (uptr)m) #define COMMON_INTERCEPTOR_MUTEX_REPAIR(ctx, m) \ MutexRepair(((TsanInterceptorContext *)ctx)->thr, \ ((TsanInterceptorContext *)ctx)->pc, (uptr)m) #define COMMON_INTERCEPTOR_MUTEX_INVALID(ctx, m) \ MutexInvalidAccess(((TsanInterceptorContext *)ctx)->thr, \ ((TsanInterceptorContext *)ctx)->pc, (uptr)m) #if !SANITIZER_MAC #define COMMON_INTERCEPTOR_HANDLE_RECVMSG(ctx, msg) \ HandleRecvmsg(((TsanInterceptorContext *)ctx)->thr, \ ((TsanInterceptorContext *)ctx)->pc, msg) #endif #define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end) \ if (TsanThread *t = GetCurrentThread()) { \ *begin = t->tls_begin(); \ *end = t->tls_end(); \ } else { \ *begin = *end = 0; \ } #define COMMON_INTERCEPTOR_USER_CALLBACK_START() \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START() #define COMMON_INTERCEPTOR_USER_CALLBACK_END() \ SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END() #include "sanitizer_common/sanitizer_common_interceptors.inc" #define TSAN_SYSCALL() \ ThreadState *thr = cur_thread(); \ if (thr->ignore_interceptors) \ return; \ ScopedSyscall scoped_syscall(thr) \ /**/ struct ScopedSyscall { ThreadState *thr; explicit ScopedSyscall(ThreadState *thr) : thr(thr) { Initialize(thr); } ~ScopedSyscall() { ProcessPendingSignals(thr); } }; #if !SANITIZER_FREEBSD && !SANITIZER_MAC static void syscall_access_range(uptr pc, uptr p, uptr s, bool write) { TSAN_SYSCALL(); MemoryAccessRange(thr, pc, p, s, write); } static void syscall_acquire(uptr pc, uptr addr) { TSAN_SYSCALL(); Acquire(thr, pc, addr); DPrintf("syscall_acquire(%p)\n", addr); } static void syscall_release(uptr pc, uptr addr) { TSAN_SYSCALL(); DPrintf("syscall_release(%p)\n", addr); Release(thr, pc, addr); } static void syscall_fd_close(uptr pc, int fd) { TSAN_SYSCALL(); FdClose(thr, pc, fd); } static USED void syscall_fd_acquire(uptr pc, int fd) { TSAN_SYSCALL(); FdAcquire(thr, pc, fd); DPrintf("syscall_fd_acquire(%p)\n", fd); } static USED void syscall_fd_release(uptr pc, int fd) { TSAN_SYSCALL(); DPrintf("syscall_fd_release(%p)\n", fd); FdRelease(thr, pc, fd); } static void syscall_pre_fork(uptr pc) { TSAN_SYSCALL(); ForkBefore(thr, pc); } static void syscall_post_fork(uptr pc, int pid) { TSAN_SYSCALL(); if (pid == 0) { // child ForkChildAfter(thr, pc); FdOnFork(thr, pc); } else if (pid > 0) { // parent ForkParentAfter(thr, pc); } else { // error ForkParentAfter(thr, pc); } } #endif #define COMMON_SYSCALL_PRE_READ_RANGE(p, s) \ syscall_access_range(GET_CALLER_PC(), (uptr)(p), (uptr)(s), false) #define COMMON_SYSCALL_PRE_WRITE_RANGE(p, s) \ syscall_access_range(GET_CALLER_PC(), (uptr)(p), (uptr)(s), true) #define COMMON_SYSCALL_POST_READ_RANGE(p, s) \ do { \ (void)(p); \ (void)(s); \ } while (false) #define COMMON_SYSCALL_POST_WRITE_RANGE(p, s) \ do { \ (void)(p); \ (void)(s); \ } while (false) #define COMMON_SYSCALL_ACQUIRE(addr) \ syscall_acquire(GET_CALLER_PC(), (uptr)(addr)) #define COMMON_SYSCALL_RELEASE(addr) \ syscall_release(GET_CALLER_PC(), (uptr)(addr)) #define COMMON_SYSCALL_FD_CLOSE(fd) syscall_fd_close(GET_CALLER_PC(), fd) #define COMMON_SYSCALL_FD_ACQUIRE(fd) syscall_fd_acquire(GET_CALLER_PC(), fd) #define COMMON_SYSCALL_FD_RELEASE(fd) syscall_fd_release(GET_CALLER_PC(), fd) #define COMMON_SYSCALL_PRE_FORK() \ syscall_pre_fork(GET_CALLER_PC()) #define COMMON_SYSCALL_POST_FORK(res) \ syscall_post_fork(GET_CALLER_PC(), res) #include "sanitizer_common/sanitizer_common_syscalls.inc" #ifdef NEED_TLS_GET_ADDR // Define own interceptor instead of sanitizer_common's for three reasons: // 1. It must not process pending signals. // Signal handlers may contain MOVDQA instruction (see below). // 2. It must be as simple as possible to not contain MOVDQA. // 3. Sanitizer_common version uses COMMON_INTERCEPTOR_INITIALIZE_RANGE which // is empty for tsan (meant only for msan). // Note: __tls_get_addr can be called with mis-aligned stack due to: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 // So the interceptor must work with mis-aligned stack, in particular, does not // execute MOVDQA with stack addresses. TSAN_INTERCEPTOR(void *, __tls_get_addr, void *arg) { void *res = REAL(__tls_get_addr)(arg); ThreadState *thr = cur_thread(); if (!thr) return res; DTLS::DTV *dtv = DTLS_on_tls_get_addr(arg, res, thr->tls_addr, thr->tls_size); if (!dtv) return res; // New DTLS block has been allocated. MemoryResetRange(thr, 0, dtv->beg, dtv->size); return res; } #endif namespace __tsan { static void finalize(void *arg) { ThreadState *thr = cur_thread(); int status = Finalize(thr); // Make sure the output is not lost. FlushStreams(); if (status) Die(); } #if !SANITIZER_MAC && !SANITIZER_ANDROID static void unreachable() { Report("FATAL: ThreadSanitizer: unreachable called\n"); Die(); } #endif void InitializeInterceptors() { #if !SANITIZER_MAC // We need to setup it early, because functions like dlsym() can call it. REAL(memset) = internal_memset; REAL(memcpy) = internal_memcpy; #endif // Instruct libc malloc to consume less memory. #if SANITIZER_LINUX mallopt(1, 0); // M_MXFAST mallopt(-3, 32*1024); // M_MMAP_THRESHOLD #endif InitializeCommonInterceptors(); #if !SANITIZER_MAC // We can not use TSAN_INTERCEPT to get setjmp addr, // because it does &setjmp and setjmp is not present in some versions of libc. using __interception::GetRealFunctionAddress; GetRealFunctionAddress("setjmp", (uptr*)&REAL(setjmp), 0, 0); GetRealFunctionAddress("_setjmp", (uptr*)&REAL(_setjmp), 0, 0); GetRealFunctionAddress("sigsetjmp", (uptr*)&REAL(sigsetjmp), 0, 0); GetRealFunctionAddress("__sigsetjmp", (uptr*)&REAL(__sigsetjmp), 0, 0); #endif TSAN_INTERCEPT(longjmp); TSAN_INTERCEPT(siglongjmp); TSAN_INTERCEPT(malloc); TSAN_INTERCEPT(__libc_memalign); TSAN_INTERCEPT(calloc); TSAN_INTERCEPT(realloc); TSAN_INTERCEPT(free); TSAN_INTERCEPT(cfree); TSAN_INTERCEPT(mmap); TSAN_MAYBE_INTERCEPT_MMAP64; TSAN_INTERCEPT(munmap); TSAN_MAYBE_INTERCEPT_MEMALIGN; TSAN_INTERCEPT(valloc); TSAN_MAYBE_INTERCEPT_PVALLOC; TSAN_INTERCEPT(posix_memalign); TSAN_INTERCEPT(strcpy); // NOLINT TSAN_INTERCEPT(strncpy); TSAN_INTERCEPT(strdup); TSAN_INTERCEPT(pthread_create); TSAN_INTERCEPT(pthread_join); TSAN_INTERCEPT(pthread_detach); TSAN_INTERCEPT_VER(pthread_cond_init, PTHREAD_ABI_BASE); TSAN_INTERCEPT_VER(pthread_cond_signal, PTHREAD_ABI_BASE); TSAN_INTERCEPT_VER(pthread_cond_broadcast, PTHREAD_ABI_BASE); TSAN_INTERCEPT_VER(pthread_cond_wait, PTHREAD_ABI_BASE); TSAN_INTERCEPT_VER(pthread_cond_timedwait, PTHREAD_ABI_BASE); TSAN_INTERCEPT_VER(pthread_cond_destroy, PTHREAD_ABI_BASE); TSAN_INTERCEPT(pthread_mutex_init); TSAN_INTERCEPT(pthread_mutex_destroy); TSAN_INTERCEPT(pthread_mutex_trylock); TSAN_INTERCEPT(pthread_mutex_timedlock); TSAN_INTERCEPT(pthread_spin_init); TSAN_INTERCEPT(pthread_spin_destroy); TSAN_INTERCEPT(pthread_spin_lock); TSAN_INTERCEPT(pthread_spin_trylock); TSAN_INTERCEPT(pthread_spin_unlock); TSAN_INTERCEPT(pthread_rwlock_init); TSAN_INTERCEPT(pthread_rwlock_destroy); TSAN_INTERCEPT(pthread_rwlock_rdlock); TSAN_INTERCEPT(pthread_rwlock_tryrdlock); TSAN_INTERCEPT(pthread_rwlock_timedrdlock); TSAN_INTERCEPT(pthread_rwlock_wrlock); TSAN_INTERCEPT(pthread_rwlock_trywrlock); TSAN_INTERCEPT(pthread_rwlock_timedwrlock); TSAN_INTERCEPT(pthread_rwlock_unlock); TSAN_INTERCEPT(pthread_barrier_init); TSAN_INTERCEPT(pthread_barrier_destroy); TSAN_INTERCEPT(pthread_barrier_wait); TSAN_INTERCEPT(pthread_once); TSAN_INTERCEPT(fstat); TSAN_MAYBE_INTERCEPT___FXSTAT; TSAN_MAYBE_INTERCEPT_FSTAT64; TSAN_MAYBE_INTERCEPT___FXSTAT64; TSAN_INTERCEPT(open); TSAN_MAYBE_INTERCEPT_OPEN64; TSAN_INTERCEPT(creat); TSAN_MAYBE_INTERCEPT_CREAT64; TSAN_INTERCEPT(dup); TSAN_INTERCEPT(dup2); TSAN_INTERCEPT(dup3); TSAN_MAYBE_INTERCEPT_EVENTFD; TSAN_MAYBE_INTERCEPT_SIGNALFD; TSAN_MAYBE_INTERCEPT_INOTIFY_INIT; TSAN_MAYBE_INTERCEPT_INOTIFY_INIT1; TSAN_INTERCEPT(socket); TSAN_INTERCEPT(socketpair); TSAN_INTERCEPT(connect); TSAN_INTERCEPT(bind); TSAN_INTERCEPT(listen); TSAN_MAYBE_INTERCEPT_EPOLL; TSAN_INTERCEPT(close); TSAN_MAYBE_INTERCEPT___CLOSE; TSAN_MAYBE_INTERCEPT___RES_ICLOSE; TSAN_INTERCEPT(pipe); TSAN_INTERCEPT(pipe2); TSAN_INTERCEPT(unlink); TSAN_INTERCEPT(tmpfile); TSAN_MAYBE_INTERCEPT_TMPFILE64; TSAN_INTERCEPT(fread); TSAN_INTERCEPT(fwrite); TSAN_INTERCEPT(abort); TSAN_INTERCEPT(puts); TSAN_INTERCEPT(rmdir); TSAN_INTERCEPT(closedir); TSAN_INTERCEPT(sigaction); TSAN_INTERCEPT(signal); TSAN_INTERCEPT(sigsuspend); TSAN_INTERCEPT(sigblock); TSAN_INTERCEPT(sigsetmask); TSAN_INTERCEPT(pthread_sigmask); TSAN_INTERCEPT(raise); TSAN_INTERCEPT(kill); TSAN_INTERCEPT(pthread_kill); TSAN_INTERCEPT(sleep); TSAN_INTERCEPT(usleep); TSAN_INTERCEPT(nanosleep); TSAN_INTERCEPT(gettimeofday); TSAN_INTERCEPT(getaddrinfo); TSAN_INTERCEPT(fork); TSAN_INTERCEPT(vfork); #if !SANITIZER_ANDROID TSAN_INTERCEPT(dl_iterate_phdr); #endif TSAN_INTERCEPT(on_exit); TSAN_INTERCEPT(__cxa_atexit); TSAN_INTERCEPT(_exit); #ifdef NEED_TLS_GET_ADDR TSAN_INTERCEPT(__tls_get_addr); #endif #if !SANITIZER_MAC && !SANITIZER_ANDROID // Need to setup it, because interceptors check that the function is resolved. // But atexit is emitted directly into the module, so can't be resolved. REAL(atexit) = (int(*)(void(*)()))unreachable; #endif if (REAL(__cxa_atexit)(&finalize, 0, 0)) { Printf("ThreadSanitizer: failed to setup atexit callback\n"); Die(); } #if !SANITIZER_MAC if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) { Printf("ThreadSanitizer: failed to create thread key\n"); Die(); } #endif FdInit(); } } // namespace __tsan // Invisible barrier for tests. // There were several unsuccessful iterations for this functionality: // 1. Initially it was implemented in user code using // REAL(pthread_barrier_wait). But pthread_barrier_wait is not supported on // MacOS. Futexes are linux-specific for this matter. // 2. Then we switched to atomics+usleep(10). But usleep produced parasitic // "as-if synchronized via sleep" messages in reports which failed some // output tests. // 3. Then we switched to atomics+sched_yield. But this produced tons of tsan- // visible events, which lead to "failed to restore stack trace" failures. // Note that no_sanitize_thread attribute does not turn off atomic interception // so attaching it to the function defined in user code does not help. // That's why we now have what we have. extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __tsan_testonly_barrier_init(u64 *barrier, u32 count) { if (count >= (1 << 8)) { Printf("barrier_init: count is too large (%d)\n", count); Die(); } // 8 lsb is thread count, the remaining are count of entered threads. *barrier = count; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __tsan_testonly_barrier_wait(u64 *barrier) { unsigned old = __atomic_fetch_add(barrier, 1 << 8, __ATOMIC_RELAXED); unsigned old_epoch = (old >> 8) / (old & 0xff); for (;;) { unsigned cur = __atomic_load_n(barrier, __ATOMIC_RELAXED); unsigned cur_epoch = (cur >> 8) / (cur & 0xff); if (cur_epoch != old_epoch) return; internal_sched_yield(); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_proc.cc0000664000175000017500000000320513004730632026673 0ustar mwhudsonmwhudson//===-- tsan_rtl_proc.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_placement_new.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "tsan_flags.h" namespace __tsan { Processor *ProcCreate() { void *mem = InternalAlloc(sizeof(Processor)); internal_memset(mem, 0, sizeof(Processor)); Processor *proc = new(mem) Processor; proc->thr = nullptr; #if !SANITIZER_GO AllocatorProcStart(proc); #endif if (common_flags()->detect_deadlocks) proc->dd_pt = ctx->dd->CreatePhysicalThread(); return proc; } void ProcDestroy(Processor *proc) { CHECK_EQ(proc->thr, nullptr); #if !SANITIZER_GO AllocatorProcFinish(proc); #endif ctx->clock_alloc.FlushCache(&proc->clock_cache); ctx->metamap.OnProcIdle(proc); if (common_flags()->detect_deadlocks) ctx->dd->DestroyPhysicalThread(proc->dd_pt); proc->~Processor(); InternalFree(proc); } void ProcWire(Processor *proc, ThreadState *thr) { CHECK_EQ(thr->proc1, nullptr); CHECK_EQ(proc->thr, nullptr); thr->proc1 = proc; proc->thr = thr; } void ProcUnwire(Processor *proc, ThreadState *thr) { CHECK_EQ(thr->proc1, proc); CHECK_EQ(proc->thr, thr); thr->proc1 = nullptr; proc->thr = nullptr; } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_symbolize.cc0000664000175000017500000000475312632350553027103 0ustar mwhudsonmwhudson//===-- tsan_symbolize.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_symbolize.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include "tsan_flags.h" #include "tsan_report.h" #include "tsan_rtl.h" namespace __tsan { void EnterSymbolizer() { ThreadState *thr = cur_thread(); CHECK(!thr->in_symbolizer); thr->in_symbolizer = true; thr->ignore_interceptors++; } void ExitSymbolizer() { ThreadState *thr = cur_thread(); CHECK(thr->in_symbolizer); thr->in_symbolizer = false; thr->ignore_interceptors--; } // May be overriden by JIT/JAVA/etc, // whatever produces PCs marked with kExternalPCBit. SANITIZER_WEAK_DEFAULT_IMPL bool __tsan_symbolize_external(uptr pc, char *func_buf, uptr func_siz, char *file_buf, uptr file_siz, int *line, int *col) { return false; } SymbolizedStack *SymbolizeCode(uptr addr) { // Check if PC comes from non-native land. if (addr & kExternalPCBit) { // Declare static to not consume too much stack space. // We symbolize reports in a single thread, so this is fine. static char func_buf[1024]; static char file_buf[1024]; int line, col; SymbolizedStack *frame = SymbolizedStack::New(addr); if (__tsan_symbolize_external(addr, func_buf, sizeof(func_buf), file_buf, sizeof(file_buf), &line, &col)) { frame->info.function = internal_strdup(func_buf); frame->info.file = internal_strdup(file_buf); frame->info.line = line; frame->info.column = col; } return frame; } return Symbolizer::GetOrInit()->SymbolizePC(addr); } ReportLocation *SymbolizeData(uptr addr) { DataInfo info; if (!Symbolizer::GetOrInit()->SymbolizeData(addr, &info)) return 0; ReportLocation *ent = ReportLocation::New(ReportLocationGlobal); internal_memcpy(&ent->global, &info, sizeof(info)); return ent; } void SymbolizeFlush() { Symbolizer::GetOrInit()->Flush(); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_md5.cc0000664000175000017500000001550512431231573025545 0ustar mwhudsonmwhudson//===-- tsan_md5.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_defs.h" namespace __tsan { #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define STEP(f, a, b, c, d, x, t, s) \ (a) += f((b), (c), (d)) + (x) + (t); \ (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ (a) += (b); #define SET(n) \ (*(const MD5_u32plus *)&ptr[(n) * 4]) #define GET(n) \ SET(n) typedef unsigned int MD5_u32plus; typedef unsigned long ulong_t; // NOLINT typedef struct { MD5_u32plus lo, hi; MD5_u32plus a, b, c, d; unsigned char buffer[64]; MD5_u32plus block[16]; } MD5_CTX; static const void *body(MD5_CTX *ctx, const void *data, ulong_t size) { const unsigned char *ptr = (const unsigned char *)data; MD5_u32plus a, b, c, d; MD5_u32plus saved_a, saved_b, saved_c, saved_d; a = ctx->a; b = ctx->b; c = ctx->c; d = ctx->d; do { saved_a = a; saved_b = b; saved_c = c; saved_d = d; STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) STEP(F, c, d, a, b, SET(2), 0x242070db, 17) STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) STEP(G, d, a, b, c, GET(10), 0x02441453, 9) STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) STEP(H, d, a, b, c, GET(8), 0x8771f681, 11) STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23) STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11) STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23) STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11) STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) STEP(H, b, c, d, a, GET(6), 0x04881d05, 23) STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11) STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23) STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) a += saved_a; b += saved_b; c += saved_c; d += saved_d; ptr += 64; } while (size -= 64); ctx->a = a; ctx->b = b; ctx->c = c; ctx->d = d; return ptr; } void MD5_Init(MD5_CTX *ctx) { ctx->a = 0x67452301; ctx->b = 0xefcdab89; ctx->c = 0x98badcfe; ctx->d = 0x10325476; ctx->lo = 0; ctx->hi = 0; } void MD5_Update(MD5_CTX *ctx, const void *data, ulong_t size) { MD5_u32plus saved_lo; ulong_t used, free; saved_lo = ctx->lo; if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) ctx->hi++; ctx->hi += size >> 29; used = saved_lo & 0x3f; if (used) { free = 64 - used; if (size < free) { internal_memcpy(&ctx->buffer[used], data, size); return; } internal_memcpy(&ctx->buffer[used], data, free); data = (const unsigned char *)data + free; size -= free; body(ctx, ctx->buffer, 64); } if (size >= 64) { data = body(ctx, data, size & ~(ulong_t)0x3f); size &= 0x3f; } internal_memcpy(ctx->buffer, data, size); } void MD5_Final(unsigned char *result, MD5_CTX *ctx) { ulong_t used, free; used = ctx->lo & 0x3f; ctx->buffer[used++] = 0x80; free = 64 - used; if (free < 8) { internal_memset(&ctx->buffer[used], 0, free); body(ctx, ctx->buffer, 64); used = 0; free = 64; } internal_memset(&ctx->buffer[used], 0, free - 8); ctx->lo <<= 3; ctx->buffer[56] = ctx->lo; ctx->buffer[57] = ctx->lo >> 8; ctx->buffer[58] = ctx->lo >> 16; ctx->buffer[59] = ctx->lo >> 24; ctx->buffer[60] = ctx->hi; ctx->buffer[61] = ctx->hi >> 8; ctx->buffer[62] = ctx->hi >> 16; ctx->buffer[63] = ctx->hi >> 24; body(ctx, ctx->buffer, 64); result[0] = ctx->a; result[1] = ctx->a >> 8; result[2] = ctx->a >> 16; result[3] = ctx->a >> 24; result[4] = ctx->b; result[5] = ctx->b >> 8; result[6] = ctx->b >> 16; result[7] = ctx->b >> 24; result[8] = ctx->c; result[9] = ctx->c >> 8; result[10] = ctx->c >> 16; result[11] = ctx->c >> 24; result[12] = ctx->d; result[13] = ctx->d >> 8; result[14] = ctx->d >> 16; result[15] = ctx->d >> 24; internal_memset(ctx, 0, sizeof(*ctx)); } MD5Hash md5_hash(const void *data, uptr size) { MD5Hash res; MD5_CTX ctx; MD5_Init(&ctx); MD5_Update(&ctx, data, size); MD5_Final((unsigned char*)&res.hash[0], &ctx); return res; } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_ppc64.S0000664000175000017500000002026612632043106026506 0ustar mwhudsonmwhudson#include "tsan_ppc_regs.h" .section .text .hidden __tsan_setjmp .globl _setjmp .type _setjmp, @function .align 4 #if _CALL_ELF == 2 _setjmp: #else .section ".opd","aw" .align 3 _setjmp: .quad .L._setjmp,.TOC.@tocbase,0 .previous #endif .L._setjmp: mflr r0 stdu r1,-48(r1) std r2,24(r1) std r3,32(r1) std r0,40(r1) // r3 is the original stack pointer. addi r3,r1,48 // r4 is the mangled stack pointer (see glibc) ld r4,-28696(r13) xor r4,r3,r4 // Materialize a TOC in case we were called from libc. // For big-endian, we load the TOC from the OPD. For little- // endian, we use the .TOC. symbol to find it. nop bcl 20,31,0f 0: mflr r2 #if _CALL_ELF == 2 addis r2,r2,.TOC.-0b@ha addi r2,r2,.TOC.-0b@l #else addis r2,r2,_setjmp-0b@ha addi r2,r2,_setjmp-0b@l ld r2,8(r2) #endif // Call the interceptor. bl __tsan_setjmp nop // Restore regs needed for setjmp. ld r3,32(r1) ld r0,40(r1) // Emulate the real setjmp function. We do this because we can't // perform a sibcall: The real setjmp function trashes the TOC // pointer, and with a sibcall we have no way to restore it. // This way we can make sure our caller's stack pointer and // link register are saved correctly in the jmpbuf. ld r6,-28696(r13) addi r5,r1,48 // original stack ptr of caller xor r5,r6,r5 std r5,0(r3) // mangled stack ptr of caller ld r5,24(r1) std r5,8(r3) // caller's saved TOC pointer xor r0,r6,r0 std r0,16(r3) // caller's mangled return address mfcr r0 // Nonvolatiles. std r14,24(r3) stfd f14,176(r3) stw r0,172(r3) // CR std r15,32(r3) stfd f15,184(r3) std r16,40(r3) stfd f16,192(r3) std r17,48(r3) stfd f17,200(r3) std r18,56(r3) stfd f18,208(r3) std r19,64(r3) stfd f19,216(r3) std r20,72(r3) stfd f20,224(r3) std r21,80(r3) stfd f21,232(r3) std r22,88(r3) stfd f22,240(r3) std r23,96(r3) stfd f23,248(r3) std r24,104(r3) stfd f24,256(r3) std r25,112(r3) stfd f25,264(r3) std r26,120(r3) stfd f26,272(r3) std r27,128(r3) stfd f27,280(r3) std r28,136(r3) stfd f28,288(r3) std r29,144(r3) stfd f29,296(r3) std r30,152(r3) stfd f30,304(r3) std r31,160(r3) stfd f31,312(r3) addi r5,r3,320 mfspr r0,256 stw r0,168(r3) // VRSAVE addi r6,r5,16 stvx v20,0,r5 addi r5,r5,32 stvx v21,0,r6 addi r6,r6,32 stvx v22,0,r5 addi r5,r5,32 stvx v23,0,r6 addi r6,r6,32 stvx v24,0,r5 addi r5,r5,32 stvx v25,0,r6 addi r6,r6,32 stvx v26,0,r5 addi r5,r5,32 stvx v27,0,r6 addi r6,r6,32 stvx v28,0,r5 addi r5,r5,32 stvx v29,0,r6 addi r6,r6,32 stvx v30,0,r5 stvx v31,0,r6 // Clear the "mask-saved" slot. li r4,0 stw r4,512(r3) // Restore TOC, LR, and stack and return to caller. ld r2,24(r1) ld r0,40(r1) addi r1,r1,48 li r3,0 // This is the setjmp return path mtlr r0 blr .size _setjmp, .-.L._setjmp .globl setjmp .type setjmp, @function .align 4 setjmp: b _setjmp .size setjmp, .-setjmp // sigsetjmp is like setjmp, except that the mask in r4 needs // to be saved at offset 512 of the jump buffer. .globl __sigsetjmp .type __sigsetjmp, @function .align 4 #if _CALL_ELF == 2 __sigsetjmp: #else .section ".opd","aw" .align 3 __sigsetjmp: .quad .L.__sigsetjmp,.TOC.@tocbase,0 .previous #endif .L.__sigsetjmp: mflr r0 stdu r1,-64(r1) std r2,24(r1) std r3,32(r1) std r4,40(r1) std r0,48(r1) // r3 is the original stack pointer. addi r3,r1,64 // r4 is the mangled stack pointer (see glibc) ld r4,-28696(r13) xor r4,r3,r4 // Materialize a TOC in case we were called from libc. // For big-endian, we load the TOC from the OPD. For little- // endian, we use the .TOC. symbol to find it. nop bcl 20,31,1f 1: mflr r2 #if _CALL_ELF == 2 addis r2,r2,.TOC.-1b@ha addi r2,r2,.TOC.-1b@l #else addis r2,r2,_setjmp-1b@ha addi r2,r2,_setjmp-1b@l ld r2,8(r2) #endif // Call the interceptor. bl __tsan_setjmp nop // Restore regs needed for __sigsetjmp. ld r3,32(r1) ld r4,40(r1) ld r0,48(r1) // Emulate the real sigsetjmp function. We do this because we can't // perform a sibcall: The real sigsetjmp function trashes the TOC // pointer, and with a sibcall we have no way to restore it. // This way we can make sure our caller's stack pointer and // link register are saved correctly in the jmpbuf. ld r6,-28696(r13) addi r5,r1,64 // original stack ptr of caller xor r5,r6,r5 std r5,0(r3) // mangled stack ptr of caller ld r5,24(r1) std r5,8(r3) // caller's saved TOC pointer xor r0,r6,r0 std r0,16(r3) // caller's mangled return address mfcr r0 // Nonvolatiles. std r14,24(r3) stfd f14,176(r3) stw r0,172(r3) // CR std r15,32(r3) stfd f15,184(r3) std r16,40(r3) stfd f16,192(r3) std r17,48(r3) stfd f17,200(r3) std r18,56(r3) stfd f18,208(r3) std r19,64(r3) stfd f19,216(r3) std r20,72(r3) stfd f20,224(r3) std r21,80(r3) stfd f21,232(r3) std r22,88(r3) stfd f22,240(r3) std r23,96(r3) stfd f23,248(r3) std r24,104(r3) stfd f24,256(r3) std r25,112(r3) stfd f25,264(r3) std r26,120(r3) stfd f26,272(r3) std r27,128(r3) stfd f27,280(r3) std r28,136(r3) stfd f28,288(r3) std r29,144(r3) stfd f29,296(r3) std r30,152(r3) stfd f30,304(r3) std r31,160(r3) stfd f31,312(r3) addi r5,r3,320 mfspr r0,256 stw r0,168(r3) // VRSAVE addi r6,r5,16 stvx v20,0,r5 addi r5,r5,32 stvx v21,0,r6 addi r6,r6,32 stvx v22,0,r5 addi r5,r5,32 stvx v23,0,r6 addi r6,r6,32 stvx v24,0,r5 addi r5,r5,32 stvx v25,0,r6 addi r6,r6,32 stvx v26,0,r5 addi r5,r5,32 stvx v27,0,r6 addi r6,r6,32 stvx v28,0,r5 addi r5,r5,32 stvx v29,0,r6 addi r6,r6,32 stvx v30,0,r5 stvx v31,0,r6 // Save into the "mask-saved" slot. stw r4,512(r3) // Restore TOC, LR, and stack and return to caller. ld r2,24(r1) ld r0,48(r1) addi r1,r1,64 li r3,0 // This is the sigsetjmp return path mtlr r0 blr .size __sigsetjmp, .-.L.__sigsetjmp .globl sigsetjmp .type sigsetjmp, @function .align 4 sigsetjmp: b __sigsetjmp .size sigsetjmp, .-sigsetjmp golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface_java.h0000664000175000017500000000765312445764030027674 0ustar mwhudsonmwhudson//===-- tsan_interface_java.h -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Interface for verification of Java or mixed Java/C++ programs. // The interface is intended to be used from within a JVM and notify TSan // about such events like Java locks and GC memory compaction. // // For plain memory accesses and function entry/exit a JVM is intended to use // C++ interfaces: __tsan_readN/writeN and __tsan_func_enter/exit. // // For volatile memory accesses and atomic operations JVM is intended to use // standard atomics API: __tsan_atomicN_load/store/etc. // // For usage examples see lit_tests/java_*.cc //===----------------------------------------------------------------------===// #ifndef TSAN_INTERFACE_JAVA_H #define TSAN_INTERFACE_JAVA_H #ifndef INTERFACE_ATTRIBUTE # define INTERFACE_ATTRIBUTE __attribute__((visibility("default"))) #endif #ifdef __cplusplus extern "C" { #endif typedef unsigned long jptr; // NOLINT // Must be called before any other callback from Java. void __tsan_java_init(jptr heap_begin, jptr heap_size) INTERFACE_ATTRIBUTE; // Must be called when the application exits. // Not necessary the last callback (concurrently running threads are OK). // Returns exit status or 0 if tsan does not want to override it. int __tsan_java_fini() INTERFACE_ATTRIBUTE; // Callback for memory allocations. // May be omitted for allocations that are not subject to data races // nor contain synchronization objects (e.g. String). void __tsan_java_alloc(jptr ptr, jptr size) INTERFACE_ATTRIBUTE; // Callback for memory free. // Can be aggregated for several objects (preferably). void __tsan_java_free(jptr ptr, jptr size) INTERFACE_ATTRIBUTE; // Callback for memory move by GC. // Can be aggregated for several objects (preferably). // The ranges can overlap. void __tsan_java_move(jptr src, jptr dst, jptr size) INTERFACE_ATTRIBUTE; // This function must be called on the finalizer thread // before executing a batch of finalizers. // It ensures necessary synchronization between // java object creation and finalization. void __tsan_java_finalize() INTERFACE_ATTRIBUTE; // Mutex lock. // Addr is any unique address associated with the mutex. // Can be called on recursive reentry. void __tsan_java_mutex_lock(jptr addr) INTERFACE_ATTRIBUTE; // Mutex unlock. void __tsan_java_mutex_unlock(jptr addr) INTERFACE_ATTRIBUTE; // Mutex read lock. void __tsan_java_mutex_read_lock(jptr addr) INTERFACE_ATTRIBUTE; // Mutex read unlock. void __tsan_java_mutex_read_unlock(jptr addr) INTERFACE_ATTRIBUTE; // Recursive mutex lock, intended for handling of Object.wait(). // The 'rec' value must be obtained from the previous // __tsan_java_mutex_unlock_rec(). void __tsan_java_mutex_lock_rec(jptr addr, int rec) INTERFACE_ATTRIBUTE; // Recursive mutex unlock, intended for handling of Object.wait(). // The return value says how many times this thread called lock() // w/o a pairing unlock() (i.e. how many recursive levels it unlocked). // It must be passed back to __tsan_java_mutex_lock_rec() to restore // the same recursion level. int __tsan_java_mutex_unlock_rec(jptr addr) INTERFACE_ATTRIBUTE; // Raw acquire/release primitives. // Can be used to establish happens-before edges on volatile/final fields, // in atomic operations, etc. release_store is the same as release, but it // breaks release sequence on addr (see C++ standard 1.10/7 for details). void __tsan_java_acquire(jptr addr) INTERFACE_ATTRIBUTE; void __tsan_java_release(jptr addr) INTERFACE_ATTRIBUTE; void __tsan_java_release_store(jptr addr) INTERFACE_ATTRIBUTE; #ifdef __cplusplus } // extern "C" #endif #undef INTERFACE_ATTRIBUTE #endif // #ifndef TSAN_INTERFACE_JAVA_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_clock.h0000664000175000017500000000601112614736157026020 0ustar mwhudsonmwhudson//===-- tsan_clock.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_CLOCK_H #define TSAN_CLOCK_H #include "tsan_defs.h" #include "tsan_dense_alloc.h" namespace __tsan { struct ClockElem { u64 epoch : kClkBits; u64 reused : 64 - kClkBits; }; struct ClockBlock { static const uptr kSize = 512; static const uptr kTableSize = kSize / sizeof(u32); static const uptr kClockCount = kSize / sizeof(ClockElem); union { u32 table[kTableSize]; ClockElem clock[kClockCount]; }; ClockBlock() { } }; typedef DenseSlabAlloc ClockAlloc; typedef DenseSlabAllocCache ClockCache; // The clock that lives in sync variables (mutexes, atomics, etc). class SyncClock { public: SyncClock(); ~SyncClock(); uptr size() const { return size_; } u64 get(unsigned tid) const { return elem(tid).epoch; } void Resize(ClockCache *c, uptr nclk); void Reset(ClockCache *c); void DebugDump(int(*printf)(const char *s, ...)); private: friend struct ThreadClock; static const uptr kDirtyTids = 2; unsigned release_store_tid_; unsigned release_store_reused_; unsigned dirty_tids_[kDirtyTids]; // tab_ contains indirect pointer to a 512b block using DenseSlabAlloc. // If size_ <= 64, then tab_ points to an array with 64 ClockElem's. // Otherwise, tab_ points to an array with 128 u32 elements, // each pointing to the second-level 512b block with 64 ClockElem's. ClockBlock *tab_; u32 tab_idx_; u32 size_; ClockElem &elem(unsigned tid) const; }; // The clock that lives in threads. struct ThreadClock { public: typedef DenseSlabAllocCache Cache; explicit ThreadClock(unsigned tid, unsigned reused = 0); u64 get(unsigned tid) const { DCHECK_LT(tid, kMaxTidInClock); return clk_[tid].epoch; } void set(unsigned tid, u64 v); void set(u64 v) { DCHECK_GE(v, clk_[tid_].epoch); clk_[tid_].epoch = v; } void tick() { clk_[tid_].epoch++; } uptr size() const { return nclk_; } void acquire(ClockCache *c, const SyncClock *src); void release(ClockCache *c, SyncClock *dst) const; void acq_rel(ClockCache *c, SyncClock *dst); void ReleaseStore(ClockCache *c, SyncClock *dst) const; void DebugReset(); void DebugDump(int(*printf)(const char *s, ...)); private: static const uptr kDirtyTids = SyncClock::kDirtyTids; const unsigned tid_; const unsigned reused_; u64 last_acquire_; uptr nclk_; ClockElem clk_[kMaxTidInClock]; bool IsAlreadyAcquired(const SyncClock *src) const; void UpdateCurrentThread(SyncClock *dst) const; }; } // namespace __tsan #endif // TSAN_CLOCK_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_malloc_mac.cc0000664000175000017500000000530512725337207027153 0ustar mwhudsonmwhudson//===-- tsan_malloc_mac.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Mac-specific malloc interception. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "tsan_interceptors.h" #include "tsan_stack_trace.h" using namespace __tsan; #define COMMON_MALLOC_ZONE_NAME "tsan" #define COMMON_MALLOC_ENTER() #define COMMON_MALLOC_SANITIZER_INITIALIZED (cur_thread()->is_inited) #define COMMON_MALLOC_FORCE_LOCK() #define COMMON_MALLOC_FORCE_UNLOCK() #define COMMON_MALLOC_MEMALIGN(alignment, size) \ void *p = \ user_alloc(cur_thread(), StackTrace::GetCurrentPc(), size, alignment) #define COMMON_MALLOC_MALLOC(size) \ if (cur_thread()->in_symbolizer) return InternalAlloc(size); \ SCOPED_INTERCEPTOR_RAW(malloc, size); \ void *p = user_alloc(thr, pc, size) #define COMMON_MALLOC_REALLOC(ptr, size) \ if (cur_thread()->in_symbolizer) return InternalRealloc(ptr, size); \ SCOPED_INTERCEPTOR_RAW(realloc, ptr, size); \ void *p = user_realloc(thr, pc, ptr, size) #define COMMON_MALLOC_CALLOC(count, size) \ if (cur_thread()->in_symbolizer) return InternalCalloc(count, size); \ SCOPED_INTERCEPTOR_RAW(calloc, size, count); \ void *p = user_calloc(thr, pc, size, count) #define COMMON_MALLOC_VALLOC(size) \ if (cur_thread()->in_symbolizer) \ return InternalAlloc(size, nullptr, GetPageSizeCached()); \ SCOPED_INTERCEPTOR_RAW(valloc, size); \ void *p = user_alloc(thr, pc, size, GetPageSizeCached()) #define COMMON_MALLOC_FREE(ptr) \ if (cur_thread()->in_symbolizer) return InternalFree(ptr); \ SCOPED_INTERCEPTOR_RAW(free, ptr); \ user_free(thr, pc, ptr) #define COMMON_MALLOC_SIZE(ptr) uptr size = user_alloc_usable_size(ptr); #define COMMON_MALLOC_FILL_STATS(zone, stats) #define COMMON_MALLOC_REPORT_UNKNOWN_REALLOC(ptr, zone_ptr, zone_name) \ (void)zone_name; \ Report("mz_realloc(%p) -- attempting to realloc unallocated memory.\n", ptr); #define COMMON_MALLOC_NAMESPACE __tsan #include "sanitizer_common/sanitizer_malloc_mac.inc" #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface_java.cc0000664000175000017500000001632612710130370030014 0ustar mwhudsonmwhudson//===-- tsan_interface_java.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_interface_java.h" #include "tsan_rtl.h" #include "tsan_mutex.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_procmaps.h" using namespace __tsan; // NOLINT const jptr kHeapAlignment = 8; namespace __tsan { struct JavaContext { const uptr heap_begin; const uptr heap_size; JavaContext(jptr heap_begin, jptr heap_size) : heap_begin(heap_begin) , heap_size(heap_size) { } }; class ScopedJavaFunc { public: ScopedJavaFunc(ThreadState *thr, uptr pc) : thr_(thr) { Initialize(thr_); FuncEntry(thr, pc); } ~ScopedJavaFunc() { FuncExit(thr_); // FIXME(dvyukov): process pending signals. } private: ThreadState *thr_; }; static u64 jctx_buf[sizeof(JavaContext) / sizeof(u64) + 1]; static JavaContext *jctx; } // namespace __tsan #define SCOPED_JAVA_FUNC(func) \ ThreadState *thr = cur_thread(); \ const uptr caller_pc = GET_CALLER_PC(); \ const uptr pc = StackTrace::GetCurrentPc(); \ (void)pc; \ ScopedJavaFunc scoped(thr, caller_pc); \ /**/ void __tsan_java_init(jptr heap_begin, jptr heap_size) { SCOPED_JAVA_FUNC(__tsan_java_init); DPrintf("#%d: java_init(%p, %p)\n", thr->tid, heap_begin, heap_size); CHECK_EQ(jctx, 0); CHECK_GT(heap_begin, 0); CHECK_GT(heap_size, 0); CHECK_EQ(heap_begin % kHeapAlignment, 0); CHECK_EQ(heap_size % kHeapAlignment, 0); CHECK_LT(heap_begin, heap_begin + heap_size); jctx = new(jctx_buf) JavaContext(heap_begin, heap_size); } int __tsan_java_fini() { SCOPED_JAVA_FUNC(__tsan_java_fini); DPrintf("#%d: java_fini()\n", thr->tid); CHECK_NE(jctx, 0); // FIXME(dvyukov): this does not call atexit() callbacks. int status = Finalize(thr); DPrintf("#%d: java_fini() = %d\n", thr->tid, status); return status; } void __tsan_java_alloc(jptr ptr, jptr size) { SCOPED_JAVA_FUNC(__tsan_java_alloc); DPrintf("#%d: java_alloc(%p, %p)\n", thr->tid, ptr, size); CHECK_NE(jctx, 0); CHECK_NE(size, 0); CHECK_EQ(ptr % kHeapAlignment, 0); CHECK_EQ(size % kHeapAlignment, 0); CHECK_GE(ptr, jctx->heap_begin); CHECK_LE(ptr + size, jctx->heap_begin + jctx->heap_size); OnUserAlloc(thr, pc, ptr, size, false); } void __tsan_java_free(jptr ptr, jptr size) { SCOPED_JAVA_FUNC(__tsan_java_free); DPrintf("#%d: java_free(%p, %p)\n", thr->tid, ptr, size); CHECK_NE(jctx, 0); CHECK_NE(size, 0); CHECK_EQ(ptr % kHeapAlignment, 0); CHECK_EQ(size % kHeapAlignment, 0); CHECK_GE(ptr, jctx->heap_begin); CHECK_LE(ptr + size, jctx->heap_begin + jctx->heap_size); ctx->metamap.FreeRange(thr->proc(), ptr, size); } void __tsan_java_move(jptr src, jptr dst, jptr size) { SCOPED_JAVA_FUNC(__tsan_java_move); DPrintf("#%d: java_move(%p, %p, %p)\n", thr->tid, src, dst, size); CHECK_NE(jctx, 0); CHECK_NE(size, 0); CHECK_EQ(src % kHeapAlignment, 0); CHECK_EQ(dst % kHeapAlignment, 0); CHECK_EQ(size % kHeapAlignment, 0); CHECK_GE(src, jctx->heap_begin); CHECK_LE(src + size, jctx->heap_begin + jctx->heap_size); CHECK_GE(dst, jctx->heap_begin); CHECK_LE(dst + size, jctx->heap_begin + jctx->heap_size); CHECK_NE(dst, src); CHECK_NE(size, 0); // Assuming it's not running concurrently with threads that do // memory accesses and mutex operations (stop-the-world phase). ctx->metamap.MoveMemory(src, dst, size); // Move shadow. u64 *s = (u64*)MemToShadow(src); u64 *d = (u64*)MemToShadow(dst); u64 *send = (u64*)MemToShadow(src + size); uptr inc = 1; if (dst > src) { s = (u64*)MemToShadow(src + size) - 1; d = (u64*)MemToShadow(dst + size) - 1; send = (u64*)MemToShadow(src) - 1; inc = -1; } for (; s != send; s += inc, d += inc) { *d = *s; *s = 0; } } void __tsan_java_finalize() { SCOPED_JAVA_FUNC(__tsan_java_finalize); DPrintf("#%d: java_mutex_finalize()\n", thr->tid); AcquireGlobal(thr, 0); } void __tsan_java_mutex_lock(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_mutex_lock); DPrintf("#%d: java_mutex_lock(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); MutexCreate(thr, pc, addr, true, true, true); MutexLock(thr, pc, addr); } void __tsan_java_mutex_unlock(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_mutex_unlock); DPrintf("#%d: java_mutex_unlock(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); MutexUnlock(thr, pc, addr); } void __tsan_java_mutex_read_lock(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_mutex_read_lock); DPrintf("#%d: java_mutex_read_lock(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); MutexCreate(thr, pc, addr, true, true, true); MutexReadLock(thr, pc, addr); } void __tsan_java_mutex_read_unlock(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_mutex_read_unlock); DPrintf("#%d: java_mutex_read_unlock(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); MutexReadUnlock(thr, pc, addr); } void __tsan_java_mutex_lock_rec(jptr addr, int rec) { SCOPED_JAVA_FUNC(__tsan_java_mutex_lock_rec); DPrintf("#%d: java_mutex_lock_rec(%p, %d)\n", thr->tid, addr, rec); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); CHECK_GT(rec, 0); MutexCreate(thr, pc, addr, true, true, true); MutexLock(thr, pc, addr, rec); } int __tsan_java_mutex_unlock_rec(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_mutex_unlock_rec); DPrintf("#%d: java_mutex_unlock_rec(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); return MutexUnlock(thr, pc, addr, true); } void __tsan_java_acquire(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_acquire); DPrintf("#%d: java_acquire(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); Acquire(thr, caller_pc, addr); } void __tsan_java_release(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_release); DPrintf("#%d: java_release(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); Release(thr, caller_pc, addr); } void __tsan_java_release_store(jptr addr) { SCOPED_JAVA_FUNC(__tsan_java_release); DPrintf("#%d: java_release_store(%p)\n", thr->tid, addr); CHECK_NE(jctx, 0); CHECK_GE(addr, jctx->heap_begin); CHECK_LT(addr, jctx->heap_begin + jctx->heap_size); ReleaseStore(thr, caller_pc, addr); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_flags.h0000664000175000017500000000202312453077750026016 0ustar mwhudsonmwhudson//===-- tsan_flags.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // NOTE: This file may be included into user code. //===----------------------------------------------------------------------===// #ifndef TSAN_FLAGS_H #define TSAN_FLAGS_H #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_deadlock_detector_interface.h" namespace __tsan { struct Flags : DDFlags { #define TSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "tsan_flags.inc" #undef TSAN_FLAG void SetDefaults(); void ParseFromString(const char *str); }; Flags *flags(); void InitializeFlags(Flags *flags, const char *env); } // namespace __tsan #endif // TSAN_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_stat.h0000664000175000017500000000770512713170772025706 0ustar mwhudsonmwhudson//===-- tsan_stat.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_STAT_H #define TSAN_STAT_H namespace __tsan { enum StatType { // Memory access processing related stuff. StatMop, StatMopRead, StatMopWrite, StatMop1, // These must be consequtive. StatMop2, StatMop4, StatMop8, StatMopSame, StatMopIgnored, StatMopRange, StatMopRodata, StatMopRangeRodata, StatShadowProcessed, StatShadowZero, StatShadowNonZero, // Derived. StatShadowSameSize, StatShadowIntersect, StatShadowNotIntersect, StatShadowSameThread, StatShadowAnotherThread, StatShadowReplace, // Func processing. StatFuncEnter, StatFuncExit, // Trace processing. StatEvents, // Threads. StatThreadCreate, StatThreadFinish, StatThreadReuse, StatThreadMaxTid, StatThreadMaxAlive, // Mutexes. StatMutexCreate, StatMutexDestroy, StatMutexLock, StatMutexUnlock, StatMutexRecLock, StatMutexRecUnlock, StatMutexReadLock, StatMutexReadUnlock, // Synchronization. StatSyncCreated, StatSyncDestroyed, StatSyncAcquire, StatSyncRelease, // Clocks - acquire. StatClockAcquire, StatClockAcquireEmpty, StatClockAcquireFastRelease, StatClockAcquireLarge, StatClockAcquireRepeat, StatClockAcquireFull, StatClockAcquiredSomething, // Clocks - release. StatClockRelease, StatClockReleaseResize, StatClockReleaseFast1, StatClockReleaseFast2, StatClockReleaseSlow, StatClockReleaseFull, StatClockReleaseAcquired, StatClockReleaseClearTail, // Clocks - release store. StatClockStore, StatClockStoreResize, StatClockStoreFast, StatClockStoreFull, StatClockStoreTail, // Clocks - acquire-release. StatClockAcquireRelease, // Atomics. StatAtomic, StatAtomicLoad, StatAtomicStore, StatAtomicExchange, StatAtomicFetchAdd, StatAtomicFetchSub, StatAtomicFetchAnd, StatAtomicFetchOr, StatAtomicFetchXor, StatAtomicFetchNand, StatAtomicCAS, StatAtomicFence, StatAtomicRelaxed, StatAtomicConsume, StatAtomicAcquire, StatAtomicRelease, StatAtomicAcq_Rel, StatAtomicSeq_Cst, StatAtomic1, StatAtomic2, StatAtomic4, StatAtomic8, StatAtomic16, // Dynamic annotations. StatAnnotation, StatAnnotateHappensBefore, StatAnnotateHappensAfter, StatAnnotateCondVarSignal, StatAnnotateCondVarSignalAll, StatAnnotateMutexIsNotPHB, StatAnnotateCondVarWait, StatAnnotateRWLockCreate, StatAnnotateRWLockCreateStatic, StatAnnotateRWLockDestroy, StatAnnotateRWLockAcquired, StatAnnotateRWLockReleased, StatAnnotateTraceMemory, StatAnnotateFlushState, StatAnnotateNewMemory, StatAnnotateNoOp, StatAnnotateFlushExpectedRaces, StatAnnotateEnableRaceDetection, StatAnnotateMutexIsUsedAsCondVar, StatAnnotatePCQGet, StatAnnotatePCQPut, StatAnnotatePCQDestroy, StatAnnotatePCQCreate, StatAnnotateExpectRace, StatAnnotateBenignRaceSized, StatAnnotateBenignRace, StatAnnotateIgnoreReadsBegin, StatAnnotateIgnoreReadsEnd, StatAnnotateIgnoreWritesBegin, StatAnnotateIgnoreWritesEnd, StatAnnotateIgnoreSyncBegin, StatAnnotateIgnoreSyncEnd, StatAnnotatePublishMemoryRange, StatAnnotateUnpublishMemoryRange, StatAnnotateThreadName, // Internal mutex contentionz. StatMtxTotal, StatMtxTrace, StatMtxThreads, StatMtxReport, StatMtxSyncVar, StatMtxSyncTab, StatMtxSlab, StatMtxAnnotations, StatMtxAtExit, StatMtxMBlock, StatMtxDeadlockDetector, StatMtxFired, StatMtxRacy, StatMtxFD, StatMtxGlobalProc, // This must be the last. StatCnt }; } // namespace __tsan #endif // TSAN_STAT_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_stack_trace.cc0000664000175000017500000000252012426000160027322 0ustar mwhudsonmwhudson//===-- tsan_stack_trace.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_stack_trace.h" #include "tsan_rtl.h" #include "tsan_mman.h" namespace __tsan { VarSizeStackTrace::VarSizeStackTrace() : StackTrace(nullptr, 0), trace_buffer(nullptr) {} VarSizeStackTrace::~VarSizeStackTrace() { ResizeBuffer(0); } void VarSizeStackTrace::ResizeBuffer(uptr new_size) { if (trace_buffer) { internal_free(trace_buffer); } trace_buffer = (new_size > 0) ? (uptr *)internal_alloc(MBlockStackTrace, new_size * sizeof(trace_buffer[0])) : nullptr; trace = trace_buffer; size = new_size; } void VarSizeStackTrace::Init(const uptr *pcs, uptr cnt, uptr extra_top_pc) { ResizeBuffer(cnt + !!extra_top_pc); internal_memcpy(trace_buffer, pcs, cnt * sizeof(trace_buffer[0])); if (extra_top_pc) trace_buffer[cnt] = extra_top_pc; } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_suppressions.cc0000664000175000017500000001331313004730632027625 0ustar mwhudsonmwhudson//===-- tsan_suppressions.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_suppressions.h" #include "tsan_suppressions.h" #include "tsan_rtl.h" #include "tsan_flags.h" #include "tsan_mman.h" #include "tsan_platform.h" #if !SANITIZER_GO // Suppressions for true/false positives in standard libraries. static const char *const std_suppressions = // Libstdc++ 4.4 has data races in std::string. // See http://crbug.com/181502 for an example. "race:^_M_rep$\n" "race:^_M_is_leaked$\n" // False positive when using std . // Happens because we miss atomic synchronization in libstdc++. // See http://llvm.org/bugs/show_bug.cgi?id=17066 for details. "race:std::_Sp_counted_ptr_inplaceParseFromFile(flags()->suppressions); #if !SANITIZER_GO suppression_ctx->Parse(__tsan_default_suppressions()); suppression_ctx->Parse(std_suppressions); #endif } SuppressionContext *Suppressions() { CHECK(suppression_ctx); return suppression_ctx; } static const char *conv(ReportType typ) { if (typ == ReportTypeRace) return kSuppressionRace; else if (typ == ReportTypeVptrRace) return kSuppressionRace; else if (typ == ReportTypeUseAfterFree) return kSuppressionRace; else if (typ == ReportTypeVptrUseAfterFree) return kSuppressionRace; else if (typ == ReportTypeThreadLeak) return kSuppressionThread; else if (typ == ReportTypeMutexDestroyLocked) return kSuppressionMutex; else if (typ == ReportTypeMutexDoubleLock) return kSuppressionMutex; else if (typ == ReportTypeMutexInvalidAccess) return kSuppressionMutex; else if (typ == ReportTypeMutexBadUnlock) return kSuppressionMutex; else if (typ == ReportTypeMutexBadReadLock) return kSuppressionMutex; else if (typ == ReportTypeMutexBadReadUnlock) return kSuppressionMutex; else if (typ == ReportTypeSignalUnsafe) return kSuppressionSignal; else if (typ == ReportTypeErrnoInSignal) return kSuppressionNone; else if (typ == ReportTypeDeadlock) return kSuppressionDeadlock; Printf("ThreadSanitizer: unknown report type %d\n", typ); Die(); } static uptr IsSuppressed(const char *stype, const AddressInfo &info, Suppression **sp) { if (suppression_ctx->Match(info.function, stype, sp) || suppression_ctx->Match(info.file, stype, sp) || suppression_ctx->Match(info.module, stype, sp)) { VPrintf(2, "ThreadSanitizer: matched suppression '%s'\n", (*sp)->templ); atomic_fetch_add(&(*sp)->hit_count, 1, memory_order_relaxed); return info.address; } return 0; } uptr IsSuppressed(ReportType typ, const ReportStack *stack, Suppression **sp) { CHECK(suppression_ctx); if (!suppression_ctx->SuppressionCount() || stack == 0 || !stack->suppressable) return 0; const char *stype = conv(typ); if (0 == internal_strcmp(stype, kSuppressionNone)) return 0; for (const SymbolizedStack *frame = stack->frames; frame; frame = frame->next) { uptr pc = IsSuppressed(stype, frame->info, sp); if (pc != 0) return pc; } if (0 == internal_strcmp(stype, kSuppressionRace) && stack->frames != nullptr) return IsSuppressed(kSuppressionRaceTop, stack->frames->info, sp); return 0; } uptr IsSuppressed(ReportType typ, const ReportLocation *loc, Suppression **sp) { CHECK(suppression_ctx); if (!suppression_ctx->SuppressionCount() || loc == 0 || loc->type != ReportLocationGlobal || !loc->suppressable) return 0; const char *stype = conv(typ); if (0 == internal_strcmp(stype, kSuppressionNone)) return 0; Suppression *s; const DataInfo &global = loc->global; if (suppression_ctx->Match(global.name, stype, &s) || suppression_ctx->Match(global.module, stype, &s)) { VPrintf(2, "ThreadSanitizer: matched suppression '%s'\n", s->templ); atomic_fetch_add(&s->hit_count, 1, memory_order_relaxed); *sp = s; return global.start; } return 0; } void PrintMatchedSuppressions() { InternalMmapVector matched(1); CHECK(suppression_ctx); suppression_ctx->GetMatched(&matched); if (!matched.size()) return; int hit_count = 0; for (uptr i = 0; i < matched.size(); i++) hit_count += atomic_load_relaxed(&matched[i]->hit_count); Printf("ThreadSanitizer: Matched %d suppressions (pid=%d):\n", hit_count, (int)internal_getpid()); for (uptr i = 0; i < matched.size(); i++) { Printf("%d %s:%s\n", atomic_load_relaxed(&matched[i]->hit_count), matched[i]->type, matched[i]->templ); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_ppc_regs.h0000664000175000017500000000254412631653112026522 0ustar mwhudsonmwhudson#define r0 0 #define r1 1 #define r2 2 #define r3 3 #define r4 4 #define r5 5 #define r6 6 #define r7 7 #define r8 8 #define r9 9 #define r10 10 #define r11 11 #define r12 12 #define r13 13 #define r14 14 #define r15 15 #define r16 16 #define r17 17 #define r18 18 #define r19 19 #define r20 20 #define r21 21 #define r22 22 #define r23 23 #define r24 24 #define r25 25 #define r26 26 #define r27 27 #define r28 28 #define r29 29 #define r30 30 #define r31 31 #define f0 0 #define f1 1 #define f2 2 #define f3 3 #define f4 4 #define f5 5 #define f6 6 #define f7 7 #define f8 8 #define f9 9 #define f10 10 #define f11 11 #define f12 12 #define f13 13 #define f14 14 #define f15 15 #define f16 16 #define f17 17 #define f18 18 #define f19 19 #define f20 20 #define f21 21 #define f22 22 #define f23 23 #define f24 24 #define f25 25 #define f26 26 #define f27 27 #define f28 28 #define f29 29 #define f30 30 #define f31 31 #define v0 0 #define v1 1 #define v2 2 #define v3 3 #define v4 4 #define v5 5 #define v6 6 #define v7 7 #define v8 8 #define v9 9 #define v10 10 #define v11 11 #define v12 12 #define v13 13 #define v14 14 #define v15 15 #define v16 16 #define v17 17 #define v18 18 #define v19 19 #define v20 20 #define v21 21 #define v22 22 #define v23 23 #define v24 24 #define v25 25 #define v26 26 #define v27 27 #define v28 28 #define v29 29 #define v30 30 #define v31 31 golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_mutex.cc0000664000175000017500000001755612713170772026240 0ustar mwhudsonmwhudson//===-- tsan_mutex.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_libc.h" #include "tsan_mutex.h" #include "tsan_platform.h" #include "tsan_rtl.h" namespace __tsan { // Simple reader-writer spin-mutex. Optimized for not-so-contended case. // Readers have preference, can possibly starvate writers. // The table fixes what mutexes can be locked under what mutexes. // E.g. if the row for MutexTypeThreads contains MutexTypeReport, // then Report mutex can be locked while under Threads mutex. // The leaf mutexes can be locked under any other mutexes. // Recursive locking is not supported. #if SANITIZER_DEBUG && !SANITIZER_GO const MutexType MutexTypeLeaf = (MutexType)-1; static MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = { /*0 MutexTypeInvalid*/ {}, /*1 MutexTypeTrace*/ {MutexTypeLeaf}, /*2 MutexTypeThreads*/ {MutexTypeReport}, /*3 MutexTypeReport*/ {MutexTypeSyncVar, MutexTypeMBlock, MutexTypeJavaMBlock}, /*4 MutexTypeSyncVar*/ {MutexTypeDDetector}, /*5 MutexTypeSyncTab*/ {}, // unused /*6 MutexTypeSlab*/ {MutexTypeLeaf}, /*7 MutexTypeAnnotations*/ {}, /*8 MutexTypeAtExit*/ {MutexTypeSyncVar}, /*9 MutexTypeMBlock*/ {MutexTypeSyncVar}, /*10 MutexTypeJavaMBlock*/ {MutexTypeSyncVar}, /*11 MutexTypeDDetector*/ {}, /*12 MutexTypeFired*/ {MutexTypeLeaf}, /*13 MutexTypeRacy*/ {MutexTypeLeaf}, /*14 MutexTypeGlobalProc*/ {}, }; static bool CanLockAdj[MutexTypeCount][MutexTypeCount]; #endif void InitializeMutex() { #if SANITIZER_DEBUG && !SANITIZER_GO // Build the "can lock" adjacency matrix. // If [i][j]==true, then one can lock mutex j while under mutex i. const int N = MutexTypeCount; int cnt[N] = {}; bool leaf[N] = {}; for (int i = 1; i < N; i++) { for (int j = 0; j < N; j++) { MutexType z = CanLockTab[i][j]; if (z == MutexTypeInvalid) continue; if (z == MutexTypeLeaf) { CHECK(!leaf[i]); leaf[i] = true; continue; } CHECK(!CanLockAdj[i][(int)z]); CanLockAdj[i][(int)z] = true; cnt[i]++; } } for (int i = 0; i < N; i++) { CHECK(!leaf[i] || cnt[i] == 0); } // Add leaf mutexes. for (int i = 0; i < N; i++) { if (!leaf[i]) continue; for (int j = 0; j < N; j++) { if (i == j || leaf[j] || j == MutexTypeInvalid) continue; CHECK(!CanLockAdj[j][i]); CanLockAdj[j][i] = true; } } // Build the transitive closure. bool CanLockAdj2[MutexTypeCount][MutexTypeCount]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { CanLockAdj2[i][j] = CanLockAdj[i][j]; } } for (int k = 0; k < N; k++) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (CanLockAdj2[i][k] && CanLockAdj2[k][j]) { CanLockAdj2[i][j] = true; } } } } #if 0 Printf("Can lock graph:\n"); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { Printf("%d ", CanLockAdj[i][j]); } Printf("\n"); } Printf("Can lock graph closure:\n"); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { Printf("%d ", CanLockAdj2[i][j]); } Printf("\n"); } #endif // Verify that the graph is acyclic. for (int i = 0; i < N; i++) { if (CanLockAdj2[i][i]) { Printf("Mutex %d participates in a cycle\n", i); Die(); } } #endif } InternalDeadlockDetector::InternalDeadlockDetector() { // Rely on zero initialization because some mutexes can be locked before ctor. } #if SANITIZER_DEBUG && !SANITIZER_GO void InternalDeadlockDetector::Lock(MutexType t) { // Printf("LOCK %d @%zu\n", t, seq_ + 1); CHECK_GT(t, MutexTypeInvalid); CHECK_LT(t, MutexTypeCount); u64 max_seq = 0; u64 max_idx = MutexTypeInvalid; for (int i = 0; i != MutexTypeCount; i++) { if (locked_[i] == 0) continue; CHECK_NE(locked_[i], max_seq); if (max_seq < locked_[i]) { max_seq = locked_[i]; max_idx = i; } } locked_[t] = ++seq_; if (max_idx == MutexTypeInvalid) return; // Printf(" last %d @%zu\n", max_idx, max_seq); if (!CanLockAdj[max_idx][t]) { Printf("ThreadSanitizer: internal deadlock detected\n"); Printf("ThreadSanitizer: can't lock %d while under %zu\n", t, (uptr)max_idx); CHECK(0); } } void InternalDeadlockDetector::Unlock(MutexType t) { // Printf("UNLO %d @%zu #%zu\n", t, seq_, locked_[t]); CHECK(locked_[t]); locked_[t] = 0; } void InternalDeadlockDetector::CheckNoLocks() { for (int i = 0; i != MutexTypeCount; i++) { CHECK_EQ(locked_[i], 0); } } #endif void CheckNoLocks(ThreadState *thr) { #if SANITIZER_DEBUG && !SANITIZER_GO thr->internal_deadlock_detector.CheckNoLocks(); #endif } const uptr kUnlocked = 0; const uptr kWriteLock = 1; const uptr kReadLock = 2; class Backoff { public: Backoff() : iter_() { } bool Do() { if (iter_++ < kActiveSpinIters) proc_yield(kActiveSpinCnt); else internal_sched_yield(); return true; } u64 Contention() const { u64 active = iter_ % kActiveSpinIters; u64 passive = iter_ - active; return active + 10 * passive; } private: int iter_; static const int kActiveSpinIters = 10; static const int kActiveSpinCnt = 20; }; Mutex::Mutex(MutexType type, StatType stat_type) { CHECK_GT(type, MutexTypeInvalid); CHECK_LT(type, MutexTypeCount); #if SANITIZER_DEBUG type_ = type; #endif #if TSAN_COLLECT_STATS stat_type_ = stat_type; #endif atomic_store(&state_, kUnlocked, memory_order_relaxed); } Mutex::~Mutex() { CHECK_EQ(atomic_load(&state_, memory_order_relaxed), kUnlocked); } void Mutex::Lock() { #if SANITIZER_DEBUG && !SANITIZER_GO cur_thread()->internal_deadlock_detector.Lock(type_); #endif uptr cmp = kUnlocked; if (atomic_compare_exchange_strong(&state_, &cmp, kWriteLock, memory_order_acquire)) return; for (Backoff backoff; backoff.Do();) { if (atomic_load(&state_, memory_order_relaxed) == kUnlocked) { cmp = kUnlocked; if (atomic_compare_exchange_weak(&state_, &cmp, kWriteLock, memory_order_acquire)) { #if TSAN_COLLECT_STATS && !SANITIZER_GO StatInc(cur_thread(), stat_type_, backoff.Contention()); #endif return; } } } } void Mutex::Unlock() { uptr prev = atomic_fetch_sub(&state_, kWriteLock, memory_order_release); (void)prev; DCHECK_NE(prev & kWriteLock, 0); #if SANITIZER_DEBUG && !SANITIZER_GO cur_thread()->internal_deadlock_detector.Unlock(type_); #endif } void Mutex::ReadLock() { #if SANITIZER_DEBUG && !SANITIZER_GO cur_thread()->internal_deadlock_detector.Lock(type_); #endif uptr prev = atomic_fetch_add(&state_, kReadLock, memory_order_acquire); if ((prev & kWriteLock) == 0) return; for (Backoff backoff; backoff.Do();) { prev = atomic_load(&state_, memory_order_acquire); if ((prev & kWriteLock) == 0) { #if TSAN_COLLECT_STATS && !SANITIZER_GO StatInc(cur_thread(), stat_type_, backoff.Contention()); #endif return; } } } void Mutex::ReadUnlock() { uptr prev = atomic_fetch_sub(&state_, kReadLock, memory_order_release); (void)prev; DCHECK_EQ(prev & kWriteLock, 0); DCHECK_GT(prev & ~kWriteLock, 0); #if SANITIZER_DEBUG && !SANITIZER_GO cur_thread()->internal_deadlock_detector.Unlock(type_); #endif } void Mutex::CheckLocked() { CHECK_NE(atomic_load(&state_, memory_order_relaxed), 0); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_platform.h0000664000175000017500000006216513004730632026547 0ustar mwhudsonmwhudson//===-- tsan_platform.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Platform-specific code. //===----------------------------------------------------------------------===// #ifndef TSAN_PLATFORM_H #define TSAN_PLATFORM_H #if !defined(__LP64__) && !defined(_WIN64) # error "Only 64-bit is supported" #endif #include "tsan_defs.h" #include "tsan_trace.h" namespace __tsan { #if !SANITIZER_GO #if defined(__x86_64__) /* C/C++ on linux/x86_64 and freebsd/x86_64 0000 0000 1000 - 0080 0000 0000: main binary and/or MAP_32BIT mappings (512GB) 0040 0000 0000 - 0100 0000 0000: - 0100 0000 0000 - 2000 0000 0000: shadow 2000 0000 0000 - 3000 0000 0000: - 3000 0000 0000 - 4000 0000 0000: metainfo (memory blocks and sync objects) 4000 0000 0000 - 5500 0000 0000: - 5500 0000 0000 - 5680 0000 0000: pie binaries without ASLR or on 4.1+ kernels 5680 0000 0000 - 6000 0000 0000: - 6000 0000 0000 - 6200 0000 0000: traces 6200 0000 0000 - 7d00 0000 0000: - 7b00 0000 0000 - 7c00 0000 0000: heap 7c00 0000 0000 - 7e80 0000 0000: - 7e80 0000 0000 - 8000 0000 0000: modules and main thread stack */ struct Mapping { static const uptr kMetaShadowBeg = 0x300000000000ull; static const uptr kMetaShadowEnd = 0x340000000000ull; static const uptr kTraceMemBeg = 0x600000000000ull; static const uptr kTraceMemEnd = 0x620000000000ull; static const uptr kShadowBeg = 0x010000000000ull; static const uptr kShadowEnd = 0x200000000000ull; static const uptr kHeapMemBeg = 0x7b0000000000ull; static const uptr kHeapMemEnd = 0x7c0000000000ull; static const uptr kLoAppMemBeg = 0x000000001000ull; static const uptr kLoAppMemEnd = 0x008000000000ull; static const uptr kMidAppMemBeg = 0x550000000000ull; static const uptr kMidAppMemEnd = 0x568000000000ull; static const uptr kHiAppMemBeg = 0x7e8000000000ull; static const uptr kHiAppMemEnd = 0x800000000000ull; static const uptr kAppMemMsk = 0x780000000000ull; static const uptr kAppMemXor = 0x040000000000ull; static const uptr kVdsoBeg = 0xf000000000000000ull; }; #define TSAN_MID_APP_RANGE 1 #elif defined(__mips64) /* C/C++ on linux/mips64 0100 0000 00 - 0200 0000 00: main binary 0200 0000 00 - 1400 0000 00: - 1400 0000 00 - 2400 0000 00: shadow 2400 0000 00 - 3000 0000 00: - 3000 0000 00 - 4000 0000 00: metainfo (memory blocks and sync objects) 4000 0000 00 - 6000 0000 00: - 6000 0000 00 - 6200 0000 00: traces 6200 0000 00 - fe00 0000 00: - fe00 0000 00 - ff00 0000 00: heap ff00 0000 00 - ff80 0000 00: - ff80 0000 00 - ffff ffff ff: modules and main thread stack */ struct Mapping { static const uptr kMetaShadowBeg = 0x4000000000ull; static const uptr kMetaShadowEnd = 0x5000000000ull; static const uptr kTraceMemBeg = 0xb000000000ull; static const uptr kTraceMemEnd = 0xb200000000ull; static const uptr kShadowBeg = 0x2400000000ull; static const uptr kShadowEnd = 0x4000000000ull; static const uptr kHeapMemBeg = 0xfe00000000ull; static const uptr kHeapMemEnd = 0xff00000000ull; static const uptr kLoAppMemBeg = 0x0100000000ull; static const uptr kLoAppMemEnd = 0x0200000000ull; static const uptr kMidAppMemBeg = 0xaa00000000ull; static const uptr kMidAppMemEnd = 0xab00000000ull; static const uptr kHiAppMemBeg = 0xff80000000ull; static const uptr kHiAppMemEnd = 0xffffffffffull; static const uptr kAppMemMsk = 0xf800000000ull; static const uptr kAppMemXor = 0x0800000000ull; static const uptr kVdsoBeg = 0xfffff00000ull; }; #define TSAN_MID_APP_RANGE 1 #elif defined(__aarch64__) // AArch64 supports multiple VMA which leads to multiple address transformation // functions. To support these multiple VMAS transformations and mappings TSAN // runtime for AArch64 uses an external memory read (vmaSize) to select which // mapping to use. Although slower, it make a same instrumented binary run on // multiple kernels. /* C/C++ on linux/aarch64 (39-bit VMA) 0000 0010 00 - 0100 0000 00: main binary 0100 0000 00 - 0800 0000 00: - 0800 0000 00 - 2000 0000 00: shadow memory 2000 0000 00 - 3100 0000 00: - 3100 0000 00 - 3400 0000 00: metainfo 3400 0000 00 - 5500 0000 00: - 5500 0000 00 - 5600 0000 00: main binary (PIE) 5600 0000 00 - 6000 0000 00: - 6000 0000 00 - 6200 0000 00: traces 6200 0000 00 - 7d00 0000 00: - 7c00 0000 00 - 7d00 0000 00: heap 7d00 0000 00 - 7fff ffff ff: modules and main thread stack */ struct Mapping39 { static const uptr kLoAppMemBeg = 0x0000001000ull; static const uptr kLoAppMemEnd = 0x0100000000ull; static const uptr kShadowBeg = 0x0800000000ull; static const uptr kShadowEnd = 0x2000000000ull; static const uptr kMetaShadowBeg = 0x3100000000ull; static const uptr kMetaShadowEnd = 0x3400000000ull; static const uptr kMidAppMemBeg = 0x5500000000ull; static const uptr kMidAppMemEnd = 0x5600000000ull; static const uptr kTraceMemBeg = 0x6000000000ull; static const uptr kTraceMemEnd = 0x6200000000ull; static const uptr kHeapMemBeg = 0x7c00000000ull; static const uptr kHeapMemEnd = 0x7d00000000ull; static const uptr kHiAppMemBeg = 0x7e00000000ull; static const uptr kHiAppMemEnd = 0x7fffffffffull; static const uptr kAppMemMsk = 0x7800000000ull; static const uptr kAppMemXor = 0x0200000000ull; static const uptr kVdsoBeg = 0x7f00000000ull; }; /* C/C++ on linux/aarch64 (42-bit VMA) 00000 0010 00 - 01000 0000 00: main binary 01000 0000 00 - 10000 0000 00: - 10000 0000 00 - 20000 0000 00: shadow memory 20000 0000 00 - 26000 0000 00: - 26000 0000 00 - 28000 0000 00: metainfo 28000 0000 00 - 2aa00 0000 00: - 2aa00 0000 00 - 2ab00 0000 00: main binary (PIE) 2ab00 0000 00 - 36200 0000 00: - 36200 0000 00 - 36240 0000 00: traces 36240 0000 00 - 3e000 0000 00: - 3e000 0000 00 - 3f000 0000 00: heap 3f000 0000 00 - 3ffff ffff ff: modules and main thread stack */ struct Mapping42 { static const uptr kLoAppMemBeg = 0x00000001000ull; static const uptr kLoAppMemEnd = 0x01000000000ull; static const uptr kShadowBeg = 0x10000000000ull; static const uptr kShadowEnd = 0x20000000000ull; static const uptr kMetaShadowBeg = 0x26000000000ull; static const uptr kMetaShadowEnd = 0x28000000000ull; static const uptr kMidAppMemBeg = 0x2aa00000000ull; static const uptr kMidAppMemEnd = 0x2ab00000000ull; static const uptr kTraceMemBeg = 0x36200000000ull; static const uptr kTraceMemEnd = 0x36400000000ull; static const uptr kHeapMemBeg = 0x3e000000000ull; static const uptr kHeapMemEnd = 0x3f000000000ull; static const uptr kHiAppMemBeg = 0x3f000000000ull; static const uptr kHiAppMemEnd = 0x3ffffffffffull; static const uptr kAppMemMsk = 0x3c000000000ull; static const uptr kAppMemXor = 0x04000000000ull; static const uptr kVdsoBeg = 0x37f00000000ull; }; struct Mapping48 { static const uptr kLoAppMemBeg = 0x0000000001000ull; static const uptr kLoAppMemEnd = 0x0000200000000ull; static const uptr kShadowBeg = 0x0002000000000ull; static const uptr kShadowEnd = 0x0004000000000ull; static const uptr kMetaShadowBeg = 0x0005000000000ull; static const uptr kMetaShadowEnd = 0x0006000000000ull; static const uptr kMidAppMemBeg = 0x0aaaa00000000ull; static const uptr kMidAppMemEnd = 0x0aaaf00000000ull; static const uptr kTraceMemBeg = 0x0f06000000000ull; static const uptr kTraceMemEnd = 0x0f06200000000ull; static const uptr kHeapMemBeg = 0x0ffff00000000ull; static const uptr kHeapMemEnd = 0x0ffff00000000ull; static const uptr kHiAppMemBeg = 0x0ffff00000000ull; static const uptr kHiAppMemEnd = 0x1000000000000ull; static const uptr kAppMemMsk = 0x0fff800000000ull; static const uptr kAppMemXor = 0x0000800000000ull; static const uptr kVdsoBeg = 0xffff000000000ull; }; // Indicates the runtime will define the memory regions at runtime. #define TSAN_RUNTIME_VMA 1 // Indicates that mapping defines a mid range memory segment. #define TSAN_MID_APP_RANGE 1 #elif defined(__powerpc64__) // PPC64 supports multiple VMA which leads to multiple address transformation // functions. To support these multiple VMAS transformations and mappings TSAN // runtime for PPC64 uses an external memory read (vmaSize) to select which // mapping to use. Although slower, it make a same instrumented binary run on // multiple kernels. /* C/C++ on linux/powerpc64 (44-bit VMA) 0000 0000 0100 - 0001 0000 0000: main binary 0001 0000 0000 - 0001 0000 0000: - 0001 0000 0000 - 0b00 0000 0000: shadow 0b00 0000 0000 - 0b00 0000 0000: - 0b00 0000 0000 - 0d00 0000 0000: metainfo (memory blocks and sync objects) 0d00 0000 0000 - 0d00 0000 0000: - 0d00 0000 0000 - 0f00 0000 0000: traces 0f00 0000 0000 - 0f00 0000 0000: - 0f00 0000 0000 - 0f50 0000 0000: heap 0f50 0000 0000 - 0f60 0000 0000: - 0f60 0000 0000 - 1000 0000 0000: modules and main thread stack */ struct Mapping44 { static const uptr kMetaShadowBeg = 0x0b0000000000ull; static const uptr kMetaShadowEnd = 0x0d0000000000ull; static const uptr kTraceMemBeg = 0x0d0000000000ull; static const uptr kTraceMemEnd = 0x0f0000000000ull; static const uptr kShadowBeg = 0x000100000000ull; static const uptr kShadowEnd = 0x0b0000000000ull; static const uptr kLoAppMemBeg = 0x000000000100ull; static const uptr kLoAppMemEnd = 0x000100000000ull; static const uptr kHeapMemBeg = 0x0f0000000000ull; static const uptr kHeapMemEnd = 0x0f5000000000ull; static const uptr kHiAppMemBeg = 0x0f6000000000ull; static const uptr kHiAppMemEnd = 0x100000000000ull; // 44 bits static const uptr kAppMemMsk = 0x0f0000000000ull; static const uptr kAppMemXor = 0x002100000000ull; static const uptr kVdsoBeg = 0x3c0000000000000ull; }; /* C/C++ on linux/powerpc64 (46-bit VMA) 0000 0000 1000 - 0100 0000 0000: main binary 0100 0000 0000 - 0200 0000 0000: - 0100 0000 0000 - 1000 0000 0000: shadow 1000 0000 0000 - 1000 0000 0000: - 1000 0000 0000 - 2000 0000 0000: metainfo (memory blocks and sync objects) 2000 0000 0000 - 2000 0000 0000: - 2000 0000 0000 - 2200 0000 0000: traces 2200 0000 0000 - 3d00 0000 0000: - 3d00 0000 0000 - 3e00 0000 0000: heap 3e00 0000 0000 - 3e80 0000 0000: - 3e80 0000 0000 - 4000 0000 0000: modules and main thread stack */ struct Mapping46 { static const uptr kMetaShadowBeg = 0x100000000000ull; static const uptr kMetaShadowEnd = 0x200000000000ull; static const uptr kTraceMemBeg = 0x200000000000ull; static const uptr kTraceMemEnd = 0x220000000000ull; static const uptr kShadowBeg = 0x010000000000ull; static const uptr kShadowEnd = 0x100000000000ull; static const uptr kHeapMemBeg = 0x3d0000000000ull; static const uptr kHeapMemEnd = 0x3e0000000000ull; static const uptr kLoAppMemBeg = 0x000000001000ull; static const uptr kLoAppMemEnd = 0x010000000000ull; static const uptr kHiAppMemBeg = 0x3e8000000000ull; static const uptr kHiAppMemEnd = 0x400000000000ull; // 46 bits static const uptr kAppMemMsk = 0x3c0000000000ull; static const uptr kAppMemXor = 0x020000000000ull; static const uptr kVdsoBeg = 0x7800000000000000ull; }; // Indicates the runtime will define the memory regions at runtime. #define TSAN_RUNTIME_VMA 1 #endif #elif SANITIZER_GO && !SANITIZER_WINDOWS /* Go on linux, darwin and freebsd 0000 0000 1000 - 0000 1000 0000: executable 0000 1000 0000 - 00c0 0000 0000: - 00c0 0000 0000 - 00e0 0000 0000: heap 00e0 0000 0000 - 2000 0000 0000: - 2000 0000 0000 - 2380 0000 0000: shadow 2380 0000 0000 - 3000 0000 0000: - 3000 0000 0000 - 4000 0000 0000: metainfo (memory blocks and sync objects) 4000 0000 0000 - 6000 0000 0000: - 6000 0000 0000 - 6200 0000 0000: traces 6200 0000 0000 - 8000 0000 0000: - */ struct Mapping { static const uptr kMetaShadowBeg = 0x300000000000ull; static const uptr kMetaShadowEnd = 0x400000000000ull; static const uptr kTraceMemBeg = 0x600000000000ull; static const uptr kTraceMemEnd = 0x620000000000ull; static const uptr kShadowBeg = 0x200000000000ull; static const uptr kShadowEnd = 0x238000000000ull; static const uptr kAppMemBeg = 0x000000001000ull; static const uptr kAppMemEnd = 0x00e000000000ull; }; #elif SANITIZER_GO && SANITIZER_WINDOWS /* Go on windows 0000 0000 1000 - 0000 1000 0000: executable 0000 1000 0000 - 00f8 0000 0000: - 00c0 0000 0000 - 00e0 0000 0000: heap 00e0 0000 0000 - 0100 0000 0000: - 0100 0000 0000 - 0500 0000 0000: shadow 0500 0000 0000 - 0560 0000 0000: - 0560 0000 0000 - 0760 0000 0000: traces 0760 0000 0000 - 07d0 0000 0000: metainfo (memory blocks and sync objects) 07d0 0000 0000 - 8000 0000 0000: - */ struct Mapping { static const uptr kMetaShadowBeg = 0x076000000000ull; static const uptr kMetaShadowEnd = 0x07d000000000ull; static const uptr kTraceMemBeg = 0x056000000000ull; static const uptr kTraceMemEnd = 0x076000000000ull; static const uptr kShadowBeg = 0x010000000000ull; static const uptr kShadowEnd = 0x050000000000ull; static const uptr kAppMemBeg = 0x000000001000ull; static const uptr kAppMemEnd = 0x00e000000000ull; }; #else # error "Unknown platform" #endif #ifdef TSAN_RUNTIME_VMA extern uptr vmaSize; #endif enum MappingType { MAPPING_LO_APP_BEG, MAPPING_LO_APP_END, MAPPING_HI_APP_BEG, MAPPING_HI_APP_END, #ifdef TSAN_MID_APP_RANGE MAPPING_MID_APP_BEG, MAPPING_MID_APP_END, #endif MAPPING_HEAP_BEG, MAPPING_HEAP_END, MAPPING_APP_BEG, MAPPING_APP_END, MAPPING_SHADOW_BEG, MAPPING_SHADOW_END, MAPPING_META_SHADOW_BEG, MAPPING_META_SHADOW_END, MAPPING_TRACE_BEG, MAPPING_TRACE_END, MAPPING_VDSO_BEG, }; template uptr MappingImpl(void) { switch (Type) { #if !SANITIZER_GO case MAPPING_LO_APP_BEG: return Mapping::kLoAppMemBeg; case MAPPING_LO_APP_END: return Mapping::kLoAppMemEnd; # ifdef TSAN_MID_APP_RANGE case MAPPING_MID_APP_BEG: return Mapping::kMidAppMemBeg; case MAPPING_MID_APP_END: return Mapping::kMidAppMemEnd; # endif case MAPPING_HI_APP_BEG: return Mapping::kHiAppMemBeg; case MAPPING_HI_APP_END: return Mapping::kHiAppMemEnd; case MAPPING_HEAP_BEG: return Mapping::kHeapMemBeg; case MAPPING_HEAP_END: return Mapping::kHeapMemEnd; case MAPPING_VDSO_BEG: return Mapping::kVdsoBeg; #else case MAPPING_APP_BEG: return Mapping::kAppMemBeg; case MAPPING_APP_END: return Mapping::kAppMemEnd; #endif case MAPPING_SHADOW_BEG: return Mapping::kShadowBeg; case MAPPING_SHADOW_END: return Mapping::kShadowEnd; case MAPPING_META_SHADOW_BEG: return Mapping::kMetaShadowBeg; case MAPPING_META_SHADOW_END: return Mapping::kMetaShadowEnd; case MAPPING_TRACE_BEG: return Mapping::kTraceMemBeg; case MAPPING_TRACE_END: return Mapping::kTraceMemEnd; } } template uptr MappingArchImpl(void) { #ifdef __aarch64__ switch (vmaSize) { case 39: return MappingImpl(); case 42: return MappingImpl(); case 48: return MappingImpl(); } DCHECK(0); return 0; #elif defined(__powerpc64__) if (vmaSize == 44) return MappingImpl(); else return MappingImpl(); DCHECK(0); #else return MappingImpl(); #endif } #if !SANITIZER_GO ALWAYS_INLINE uptr LoAppMemBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr LoAppMemEnd(void) { return MappingArchImpl(); } #ifdef TSAN_MID_APP_RANGE ALWAYS_INLINE uptr MidAppMemBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr MidAppMemEnd(void) { return MappingArchImpl(); } #endif ALWAYS_INLINE uptr HeapMemBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr HeapMemEnd(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr HiAppMemBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr HiAppMemEnd(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr VdsoBeg(void) { return MappingArchImpl(); } #else ALWAYS_INLINE uptr AppMemBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr AppMemEnd(void) { return MappingArchImpl(); } #endif static inline bool GetUserRegion(int i, uptr *start, uptr *end) { switch (i) { default: return false; #if !SANITIZER_GO case 0: *start = LoAppMemBeg(); *end = LoAppMemEnd(); return true; case 1: *start = HiAppMemBeg(); *end = HiAppMemEnd(); return true; case 2: *start = HeapMemBeg(); *end = HeapMemEnd(); return true; # ifdef TSAN_MID_APP_RANGE case 3: *start = MidAppMemBeg(); *end = MidAppMemEnd(); return true; # endif #else case 0: *start = AppMemBeg(); *end = AppMemEnd(); return true; #endif } } ALWAYS_INLINE uptr ShadowBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr ShadowEnd(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr MetaShadowBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr MetaShadowEnd(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr TraceMemBeg(void) { return MappingArchImpl(); } ALWAYS_INLINE uptr TraceMemEnd(void) { return MappingArchImpl(); } template bool IsAppMemImpl(uptr mem) { #if !SANITIZER_GO return (mem >= Mapping::kHeapMemBeg && mem < Mapping::kHeapMemEnd) || # ifdef TSAN_MID_APP_RANGE (mem >= Mapping::kMidAppMemBeg && mem < Mapping::kMidAppMemEnd) || # endif (mem >= Mapping::kLoAppMemBeg && mem < Mapping::kLoAppMemEnd) || (mem >= Mapping::kHiAppMemBeg && mem < Mapping::kHiAppMemEnd); #else return mem >= Mapping::kAppMemBeg && mem < Mapping::kAppMemEnd; #endif } ALWAYS_INLINE bool IsAppMem(uptr mem) { #ifdef __aarch64__ switch (vmaSize) { case 39: return IsAppMemImpl(mem); case 42: return IsAppMemImpl(mem); case 48: return IsAppMemImpl(mem); } DCHECK(0); return false; #elif defined(__powerpc64__) if (vmaSize == 44) return IsAppMemImpl(mem); else return IsAppMemImpl(mem); DCHECK(0); #else return IsAppMemImpl(mem); #endif } template bool IsShadowMemImpl(uptr mem) { return mem >= Mapping::kShadowBeg && mem <= Mapping::kShadowEnd; } ALWAYS_INLINE bool IsShadowMem(uptr mem) { #ifdef __aarch64__ switch (vmaSize) { case 39: return IsShadowMemImpl(mem); case 42: return IsShadowMemImpl(mem); case 48: return IsShadowMemImpl(mem); } DCHECK(0); return false; #elif defined(__powerpc64__) if (vmaSize == 44) return IsShadowMemImpl(mem); else return IsShadowMemImpl(mem); DCHECK(0); #else return IsShadowMemImpl(mem); #endif } template bool IsMetaMemImpl(uptr mem) { return mem >= Mapping::kMetaShadowBeg && mem <= Mapping::kMetaShadowEnd; } ALWAYS_INLINE bool IsMetaMem(uptr mem) { #ifdef __aarch64__ switch (vmaSize) { case 39: return IsMetaMemImpl(mem); case 42: return IsMetaMemImpl(mem); case 48: return IsMetaMemImpl(mem); } DCHECK(0); return false; #elif defined(__powerpc64__) if (vmaSize == 44) return IsMetaMemImpl(mem); else return IsMetaMemImpl(mem); DCHECK(0); #else return IsMetaMemImpl(mem); #endif } template uptr MemToShadowImpl(uptr x) { DCHECK(IsAppMem(x)); #if !SANITIZER_GO return (((x) & ~(Mapping::kAppMemMsk | (kShadowCell - 1))) ^ Mapping::kAppMemXor) * kShadowCnt; #else # ifndef SANITIZER_WINDOWS return ((x & ~(kShadowCell - 1)) * kShadowCnt) | Mapping::kShadowBeg; # else return ((x & ~(kShadowCell - 1)) * kShadowCnt) + Mapping::kShadowBeg; # endif #endif } ALWAYS_INLINE uptr MemToShadow(uptr x) { #ifdef __aarch64__ switch (vmaSize) { case 39: return MemToShadowImpl(x); case 42: return MemToShadowImpl(x); case 48: return MemToShadowImpl(x); } DCHECK(0); return 0; #elif defined(__powerpc64__) if (vmaSize == 44) return MemToShadowImpl(x); else return MemToShadowImpl(x); DCHECK(0); #else return MemToShadowImpl(x); #endif } template u32 *MemToMetaImpl(uptr x) { DCHECK(IsAppMem(x)); #if !SANITIZER_GO return (u32*)(((((x) & ~(Mapping::kAppMemMsk | (kMetaShadowCell - 1)))) / kMetaShadowCell * kMetaShadowSize) | Mapping::kMetaShadowBeg); #else # ifndef SANITIZER_WINDOWS return (u32*)(((x & ~(kMetaShadowCell - 1)) / \ kMetaShadowCell * kMetaShadowSize) | Mapping::kMetaShadowBeg); # else return (u32*)(((x & ~(kMetaShadowCell - 1)) / \ kMetaShadowCell * kMetaShadowSize) + Mapping::kMetaShadowBeg); # endif #endif } ALWAYS_INLINE u32 *MemToMeta(uptr x) { #ifdef __aarch64__ switch (vmaSize) { case 39: return MemToMetaImpl(x); case 42: return MemToMetaImpl(x); case 48: return MemToMetaImpl(x); } DCHECK(0); return 0; #elif defined(__powerpc64__) if (vmaSize == 44) return MemToMetaImpl(x); else return MemToMetaImpl(x); DCHECK(0); #else return MemToMetaImpl(x); #endif } template uptr ShadowToMemImpl(uptr s) { DCHECK(IsShadowMem(s)); #if !SANITIZER_GO // The shadow mapping is non-linear and we've lost some bits, so we don't have // an easy way to restore the original app address. But the mapping is a // bijection, so we try to restore the address as belonging to low/mid/high // range consecutively and see if shadow->app->shadow mapping gives us the // same address. uptr p = (s / kShadowCnt) ^ Mapping::kAppMemXor; if (p >= Mapping::kLoAppMemBeg && p < Mapping::kLoAppMemEnd && MemToShadow(p) == s) return p; # ifdef TSAN_MID_APP_RANGE p = ((s / kShadowCnt) ^ Mapping::kAppMemXor) + (Mapping::kMidAppMemBeg & Mapping::kAppMemMsk); if (p >= Mapping::kMidAppMemBeg && p < Mapping::kMidAppMemEnd && MemToShadow(p) == s) return p; # endif return ((s / kShadowCnt) ^ Mapping::kAppMemXor) | Mapping::kAppMemMsk; #else // #if !SANITIZER_GO # ifndef SANITIZER_WINDOWS return (s & ~Mapping::kShadowBeg) / kShadowCnt; # else return (s - Mapping::kShadowBeg) / kShadowCnt; # endif // SANITIZER_WINDOWS #endif } ALWAYS_INLINE uptr ShadowToMem(uptr s) { #ifdef __aarch64__ switch (vmaSize) { case 39: return ShadowToMemImpl(s); case 42: return ShadowToMemImpl(s); case 48: return ShadowToMemImpl(s); } DCHECK(0); return 0; #elif defined(__powerpc64__) if (vmaSize == 44) return ShadowToMemImpl(s); else return ShadowToMemImpl(s); DCHECK(0); #else return ShadowToMemImpl(s); #endif } // The additional page is to catch shadow stack overflow as paging fault. // Windows wants 64K alignment for mmaps. const uptr kTotalTraceSize = (kTraceSize * sizeof(Event) + sizeof(Trace) + (64 << 10) + (64 << 10) - 1) & ~((64 << 10) - 1); template uptr GetThreadTraceImpl(int tid) { uptr p = Mapping::kTraceMemBeg + (uptr)tid * kTotalTraceSize; DCHECK_LT(p, Mapping::kTraceMemEnd); return p; } ALWAYS_INLINE uptr GetThreadTrace(int tid) { #ifdef __aarch64__ switch (vmaSize) { case 39: return GetThreadTraceImpl(tid); case 42: return GetThreadTraceImpl(tid); case 48: return GetThreadTraceImpl(tid); } DCHECK(0); return 0; #elif defined(__powerpc64__) if (vmaSize == 44) return GetThreadTraceImpl(tid); else return GetThreadTraceImpl(tid); DCHECK(0); #else return GetThreadTraceImpl(tid); #endif } template uptr GetThreadTraceHeaderImpl(int tid) { uptr p = Mapping::kTraceMemBeg + (uptr)tid * kTotalTraceSize + kTraceSize * sizeof(Event); DCHECK_LT(p, Mapping::kTraceMemEnd); return p; } ALWAYS_INLINE uptr GetThreadTraceHeader(int tid) { #ifdef __aarch64__ switch (vmaSize) { case 39: return GetThreadTraceHeaderImpl(tid); case 42: return GetThreadTraceHeaderImpl(tid); case 48: return GetThreadTraceHeaderImpl(tid); } DCHECK(0); return 0; #elif defined(__powerpc64__) if (vmaSize == 44) return GetThreadTraceHeaderImpl(tid); else return GetThreadTraceHeaderImpl(tid); DCHECK(0); #else return GetThreadTraceHeaderImpl(tid); #endif } void InitializePlatform(); void InitializePlatformEarly(); void CheckAndProtect(); void InitializeShadowMemoryPlatform(); void FlushShadowMemory(); void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive); int ExtractResolvFDs(void *state, int *fds, int nfd); int ExtractRecvmsgFDs(void *msg, int *fds, int nfd); int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, void *abstime), void *c, void *m, void *abstime, void(*cleanup)(void *arg), void *arg); void DestroyThreadState(); } // namespace __tsan #endif // TSAN_PLATFORM_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_new_delete.cc0000664000175000017500000000533112725337207027176 0ustar mwhudsonmwhudson//===-- tsan_new_delete.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Interceptors for operators new and delete. //===----------------------------------------------------------------------===// #include "interception/interception.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "tsan_interceptors.h" using namespace __tsan; // NOLINT namespace std { struct nothrow_t {}; } // namespace std DECLARE_REAL(void *, malloc, uptr size) DECLARE_REAL(void, free, void *ptr) #define OPERATOR_NEW_BODY(mangled_name) \ if (cur_thread()->in_symbolizer) \ return InternalAlloc(size); \ void *p = 0; \ { \ SCOPED_INTERCEPTOR_RAW(mangled_name, size); \ p = user_alloc(thr, pc, size); \ } \ invoke_malloc_hook(p, size); \ return p; SANITIZER_INTERFACE_ATTRIBUTE void *operator new(__sanitizer::uptr size); void *operator new(__sanitizer::uptr size) { OPERATOR_NEW_BODY(_Znwm); } SANITIZER_INTERFACE_ATTRIBUTE void *operator new[](__sanitizer::uptr size); void *operator new[](__sanitizer::uptr size) { OPERATOR_NEW_BODY(_Znam); } SANITIZER_INTERFACE_ATTRIBUTE void *operator new(__sanitizer::uptr size, std::nothrow_t const&); void *operator new(__sanitizer::uptr size, std::nothrow_t const&) { OPERATOR_NEW_BODY(_ZnwmRKSt9nothrow_t); } SANITIZER_INTERFACE_ATTRIBUTE void *operator new[](__sanitizer::uptr size, std::nothrow_t const&); void *operator new[](__sanitizer::uptr size, std::nothrow_t const&) { OPERATOR_NEW_BODY(_ZnamRKSt9nothrow_t); } #define OPERATOR_DELETE_BODY(mangled_name) \ if (ptr == 0) return; \ if (cur_thread()->in_symbolizer) \ return InternalFree(ptr); \ invoke_free_hook(ptr); \ SCOPED_INTERCEPTOR_RAW(mangled_name, ptr); \ user_free(thr, pc, ptr); SANITIZER_INTERFACE_ATTRIBUTE void operator delete(void *ptr) NOEXCEPT; void operator delete(void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY(_ZdlPv); } SANITIZER_INTERFACE_ATTRIBUTE void operator delete[](void *ptr) NOEXCEPT; void operator delete[](void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY(_ZdaPv); } SANITIZER_INTERFACE_ATTRIBUTE void operator delete(void *ptr, std::nothrow_t const&); void operator delete(void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY(_ZdlPvRKSt9nothrow_t); } SANITIZER_INTERFACE_ATTRIBUTE void operator delete[](void *ptr, std::nothrow_t const&); void operator delete[](void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY(_ZdaPvRKSt9nothrow_t); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_platform_windows.cc0000664000175000017500000000166112625602327030460 0ustar mwhudsonmwhudson//===-- tsan_platform_windows.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Windows-specific code. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_WINDOWS #include "tsan_platform.h" #include namespace __tsan { uptr GetShadowMemoryConsumption() { return 0; } void FlushShadowMemory() { } void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive) { } void InitializePlatformEarly() { } void InitializePlatform() { } } // namespace __tsan #endif // SANITIZER_WINDOWS golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface_inl.h0000664000175000017500000000614012635007610027516 0ustar mwhudsonmwhudson//===-- tsan_interface_inl.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_interface.h" #include "tsan_rtl.h" #define CALLERPC ((uptr)__builtin_return_address(0)) using namespace __tsan; // NOLINT void __tsan_read1(void *addr) { MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog1); } void __tsan_read2(void *addr) { MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog2); } void __tsan_read4(void *addr) { MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog4); } void __tsan_read8(void *addr) { MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog8); } void __tsan_write1(void *addr) { MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog1); } void __tsan_write2(void *addr) { MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog2); } void __tsan_write4(void *addr) { MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog4); } void __tsan_write8(void *addr) { MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog8); } void __tsan_read1_pc(void *addr, void *pc) { MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog1); } void __tsan_read2_pc(void *addr, void *pc) { MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog2); } void __tsan_read4_pc(void *addr, void *pc) { MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog4); } void __tsan_read8_pc(void *addr, void *pc) { MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog8); } void __tsan_write1_pc(void *addr, void *pc) { MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog1); } void __tsan_write2_pc(void *addr, void *pc) { MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog2); } void __tsan_write4_pc(void *addr, void *pc) { MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog4); } void __tsan_write8_pc(void *addr, void *pc) { MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog8); } void __tsan_vptr_update(void **vptr_p, void *new_val) { CHECK_EQ(sizeof(vptr_p), 8); if (*vptr_p != new_val) { ThreadState *thr = cur_thread(); thr->is_vptr_access = true; MemoryWrite(thr, CALLERPC, (uptr)vptr_p, kSizeLog8); thr->is_vptr_access = false; } } void __tsan_vptr_read(void **vptr_p) { CHECK_EQ(sizeof(vptr_p), 8); ThreadState *thr = cur_thread(); thr->is_vptr_access = true; MemoryRead(thr, CALLERPC, (uptr)vptr_p, kSizeLog8); thr->is_vptr_access = false; } void __tsan_func_entry(void *pc) { FuncEntry(cur_thread(), (uptr)pc); } void __tsan_func_exit() { FuncExit(cur_thread()); } void __tsan_read_range(void *addr, uptr size) { MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, false); } void __tsan_write_range(void *addr, uptr size) { MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, true); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_update_shadow_word_inl.h0000664000175000017500000000427212517746252031457 0ustar mwhudsonmwhudson//===-- tsan_update_shadow_word_inl.h ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Body of the hottest inner loop. // If we wrap this body into a function, compilers (both gcc and clang) // produce sligtly less efficient code. //===----------------------------------------------------------------------===// do { StatInc(thr, StatShadowProcessed); const unsigned kAccessSize = 1 << kAccessSizeLog; u64 *sp = &shadow_mem[idx]; old = LoadShadow(sp); if (old.IsZero()) { StatInc(thr, StatShadowZero); if (store_word) StoreIfNotYetStored(sp, &store_word); // The above StoreIfNotYetStored could be done unconditionally // and it even shows 4% gain on synthetic benchmarks (r4307). break; } // is the memory access equal to the previous? if (Shadow::Addr0AndSizeAreEqual(cur, old)) { StatInc(thr, StatShadowSameSize); // same thread? if (Shadow::TidsAreEqual(old, cur)) { StatInc(thr, StatShadowSameThread); if (old.IsRWWeakerOrEqual(kAccessIsWrite, kIsAtomic)) StoreIfNotYetStored(sp, &store_word); break; } StatInc(thr, StatShadowAnotherThread); if (HappensBefore(old, thr)) { if (old.IsRWWeakerOrEqual(kAccessIsWrite, kIsAtomic)) StoreIfNotYetStored(sp, &store_word); break; } if (old.IsBothReadsOrAtomic(kAccessIsWrite, kIsAtomic)) break; goto RACE; } // Do the memory access intersect? if (Shadow::TwoRangesIntersect(old, cur, kAccessSize)) { StatInc(thr, StatShadowIntersect); if (Shadow::TidsAreEqual(old, cur)) { StatInc(thr, StatShadowSameThread); break; } StatInc(thr, StatShadowAnotherThread); if (old.IsBothReadsOrAtomic(kAccessIsWrite, kIsAtomic)) break; if (HappensBefore(old, thr)) break; goto RACE; } // The accesses do not intersect. StatInc(thr, StatShadowNotIntersect); break; } while (0); golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_mutexset.h0000664000175000017500000000355013004730632026572 0ustar mwhudsonmwhudson//===-- tsan_mutexset.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // MutexSet holds the set of mutexes currently held by a thread. //===----------------------------------------------------------------------===// #ifndef TSAN_MUTEXSET_H #define TSAN_MUTEXSET_H #include "tsan_defs.h" namespace __tsan { class MutexSet { public: // Holds limited number of mutexes. // The oldest mutexes are discarded on overflow. static const uptr kMaxSize = 16; struct Desc { u64 id; u64 epoch; int count; bool write; }; MutexSet(); // The 'id' is obtained from SyncVar::GetId(). void Add(u64 id, bool write, u64 epoch); void Del(u64 id, bool write); void Remove(u64 id); // Removes the mutex completely (if it's destroyed). uptr Size() const; Desc Get(uptr i) const; void operator=(const MutexSet &other) { internal_memcpy(this, &other, sizeof(*this)); } private: #if !SANITIZER_GO uptr size_; Desc descs_[kMaxSize]; #endif void RemovePos(uptr i); MutexSet(const MutexSet&); }; // Go does not have mutexes, so do not spend memory and time. // (Go sync.Mutex is actually a semaphore -- can be unlocked // in different goroutine). #if SANITIZER_GO MutexSet::MutexSet() {} void MutexSet::Add(u64 id, bool write, u64 epoch) {} void MutexSet::Del(u64 id, bool write) {} void MutexSet::Remove(u64 id) {} void MutexSet::RemovePos(uptr i) {} uptr MutexSet::Size() const { return 0; } MutexSet::Desc MutexSet::Get(uptr i) const { return Desc(); } #endif } // namespace __tsan #endif // TSAN_MUTEXSET_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_trace.h0000664000175000017500000000352113004730632026010 0ustar mwhudsonmwhudson//===-- tsan_trace.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_TRACE_H #define TSAN_TRACE_H #include "tsan_defs.h" #include "tsan_mutex.h" #include "tsan_stack_trace.h" #include "tsan_mutexset.h" namespace __tsan { const int kTracePartSizeBits = 13; const int kTracePartSize = 1 << kTracePartSizeBits; const int kTraceParts = 2 * 1024 * 1024 / kTracePartSize; const int kTraceSize = kTracePartSize * kTraceParts; // Must fit into 3 bits. enum EventType { EventTypeMop, EventTypeFuncEnter, EventTypeFuncExit, EventTypeLock, EventTypeUnlock, EventTypeRLock, EventTypeRUnlock }; // Represents a thread event (from most significant bit): // u64 typ : 3; // EventType. // u64 addr : 61; // Associated pc. typedef u64 Event; struct TraceHeader { #if !SANITIZER_GO BufferedStackTrace stack0; // Start stack for the trace. #else VarSizeStackTrace stack0; #endif u64 epoch0; // Start epoch for the trace. MutexSet mset0; TraceHeader() : stack0(), epoch0() {} }; struct Trace { Mutex mtx; #if !SANITIZER_GO // Must be last to catch overflow as paging fault. // Go shadow stack is dynamically allocated. uptr shadow_stack[kShadowStackSize]; #endif // Must be the last field, because we unmap the unused part in // CreateThreadContext. TraceHeader headers[kTraceParts]; Trace() : mtx(MutexTypeTrace, StatMtxTrace) { } }; } // namespace __tsan #endif // TSAN_TRACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_amd64.S0000664000175000017500000002042712627054366026502 0ustar mwhudsonmwhudson#include "sanitizer_common/sanitizer_asm.h" #if !defined(__APPLE__) .section .text #else .section __TEXT,__text #endif ASM_HIDDEN(__tsan_trace_switch) .globl ASM_TSAN_SYMBOL(__tsan_trace_switch_thunk) ASM_TSAN_SYMBOL(__tsan_trace_switch_thunk): CFI_STARTPROC # Save scratch registers. push %rax CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rax, 0) push %rcx CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rcx, 0) push %rdx CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdx, 0) push %rsi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rsi, 0) push %rdi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdi, 0) push %r8 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r8, 0) push %r9 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r9, 0) push %r10 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r10, 0) push %r11 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r11, 0) # Align stack frame. push %rbx # non-scratch CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rbx, 0) mov %rsp, %rbx # save current rsp CFI_DEF_CFA_REGISTER(%rbx) shr $4, %rsp # clear 4 lsb, align to 16 shl $4, %rsp call ASM_TSAN_SYMBOL(__tsan_trace_switch) # Unalign stack frame back. mov %rbx, %rsp # restore the original rsp CFI_DEF_CFA_REGISTER(%rsp) pop %rbx CFI_ADJUST_CFA_OFFSET(-8) # Restore scratch registers. pop %r11 CFI_ADJUST_CFA_OFFSET(-8) pop %r10 CFI_ADJUST_CFA_OFFSET(-8) pop %r9 CFI_ADJUST_CFA_OFFSET(-8) pop %r8 CFI_ADJUST_CFA_OFFSET(-8) pop %rdi CFI_ADJUST_CFA_OFFSET(-8) pop %rsi CFI_ADJUST_CFA_OFFSET(-8) pop %rdx CFI_ADJUST_CFA_OFFSET(-8) pop %rcx CFI_ADJUST_CFA_OFFSET(-8) pop %rax CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rax) CFI_RESTORE(%rbx) CFI_RESTORE(%rcx) CFI_RESTORE(%rdx) CFI_RESTORE(%rsi) CFI_RESTORE(%rdi) CFI_RESTORE(%r8) CFI_RESTORE(%r9) CFI_RESTORE(%r10) CFI_RESTORE(%r11) ret CFI_ENDPROC ASM_HIDDEN(__tsan_report_race) .globl ASM_TSAN_SYMBOL(__tsan_report_race_thunk) ASM_TSAN_SYMBOL(__tsan_report_race_thunk): CFI_STARTPROC # Save scratch registers. push %rax CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rax, 0) push %rcx CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rcx, 0) push %rdx CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdx, 0) push %rsi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rsi, 0) push %rdi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdi, 0) push %r8 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r8, 0) push %r9 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r9, 0) push %r10 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r10, 0) push %r11 CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%r11, 0) # Align stack frame. push %rbx # non-scratch CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rbx, 0) mov %rsp, %rbx # save current rsp CFI_DEF_CFA_REGISTER(%rbx) shr $4, %rsp # clear 4 lsb, align to 16 shl $4, %rsp call ASM_TSAN_SYMBOL(__tsan_report_race) # Unalign stack frame back. mov %rbx, %rsp # restore the original rsp CFI_DEF_CFA_REGISTER(%rsp) pop %rbx CFI_ADJUST_CFA_OFFSET(-8) # Restore scratch registers. pop %r11 CFI_ADJUST_CFA_OFFSET(-8) pop %r10 CFI_ADJUST_CFA_OFFSET(-8) pop %r9 CFI_ADJUST_CFA_OFFSET(-8) pop %r8 CFI_ADJUST_CFA_OFFSET(-8) pop %rdi CFI_ADJUST_CFA_OFFSET(-8) pop %rsi CFI_ADJUST_CFA_OFFSET(-8) pop %rdx CFI_ADJUST_CFA_OFFSET(-8) pop %rcx CFI_ADJUST_CFA_OFFSET(-8) pop %rax CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rax) CFI_RESTORE(%rbx) CFI_RESTORE(%rcx) CFI_RESTORE(%rdx) CFI_RESTORE(%rsi) CFI_RESTORE(%rdi) CFI_RESTORE(%r8) CFI_RESTORE(%r9) CFI_RESTORE(%r10) CFI_RESTORE(%r11) ret CFI_ENDPROC ASM_HIDDEN(__tsan_setjmp) #if !defined(__APPLE__) .comm _ZN14__interception11real_setjmpE,8,8 #endif .globl ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp) ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp)) ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp): CFI_STARTPROC // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdi, 0) // obtain %rsp #if defined(__FreeBSD__) lea 8(%rsp), %rdi mov %rdi, %rsi #elif defined(__APPLE__) lea 16(%rsp), %rdi mov %rdi, %rsi #elif defined(__linux__) lea 16(%rsp), %rdi mov %rdi, %rsi xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp) rol $0x11, %rsi #else # error "Unknown platform" #endif // call tsan interceptor call ASM_TSAN_SYMBOL(__tsan_setjmp) // restore env parameter pop %rdi CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rdi) // tail jump to libc setjmp movl $0, %eax #if !defined(__APPLE__) movq _ZN14__interception11real_setjmpE@GOTPCREL(%rip), %rdx jmp *(%rdx) #else jmp ASM_TSAN_SYMBOL(setjmp) #endif CFI_ENDPROC ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp)) .comm _ZN14__interception12real__setjmpE,8,8 .globl ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp) ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp)) ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp): CFI_STARTPROC // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdi, 0) // obtain %rsp #if defined(__FreeBSD__) lea 8(%rsp), %rdi mov %rdi, %rsi #elif defined(__APPLE__) lea 16(%rsp), %rdi mov %rdi, %rsi #elif defined(__linux__) lea 16(%rsp), %rdi mov %rdi, %rsi xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp) rol $0x11, %rsi #else # error "Unknown platform" #endif // call tsan interceptor call ASM_TSAN_SYMBOL(__tsan_setjmp) // restore env parameter pop %rdi CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rdi) // tail jump to libc setjmp movl $0, %eax #if !defined(__APPLE__) movq _ZN14__interception12real__setjmpE@GOTPCREL(%rip), %rdx jmp *(%rdx) #else jmp ASM_TSAN_SYMBOL(_setjmp) #endif CFI_ENDPROC ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp)) .comm _ZN14__interception14real_sigsetjmpE,8,8 .globl ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp) ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp)) ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp): CFI_STARTPROC // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdi, 0) // save savesigs parameter push %rsi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rsi, 0) // align stack frame sub $8, %rsp CFI_ADJUST_CFA_OFFSET(8) // obtain %rsp #if defined(__FreeBSD__) lea 24(%rsp), %rdi mov %rdi, %rsi #elif defined(__APPLE__) lea 32(%rsp), %rdi mov %rdi, %rsi #elif defined(__linux__) lea 32(%rsp), %rdi mov %rdi, %rsi xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp) rol $0x11, %rsi #else # error "Unknown platform" #endif // call tsan interceptor call ASM_TSAN_SYMBOL(__tsan_setjmp) // unalign stack frame add $8, %rsp CFI_ADJUST_CFA_OFFSET(-8) // restore savesigs parameter pop %rsi CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rsi) // restore env parameter pop %rdi CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rdi) // tail jump to libc sigsetjmp movl $0, %eax #if !defined(__APPLE__) movq _ZN14__interception14real_sigsetjmpE@GOTPCREL(%rip), %rdx jmp *(%rdx) #else jmp ASM_TSAN_SYMBOL(sigsetjmp) #endif CFI_ENDPROC ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp)) #if !defined(__APPLE__) .comm _ZN14__interception16real___sigsetjmpE,8,8 .globl ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp) ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)) ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp): CFI_STARTPROC // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rdi, 0) // save savesigs parameter push %rsi CFI_ADJUST_CFA_OFFSET(8) CFI_REL_OFFSET(%rsi, 0) // align stack frame sub $8, %rsp CFI_ADJUST_CFA_OFFSET(8) // obtain %rsp #if defined(__FreeBSD__) lea 24(%rsp), %rdi mov %rdi, %rsi #else lea 32(%rsp), %rdi mov %rdi, %rsi xor %fs:0x30, %rsi // magic mangling of rsp (see libc setjmp) rol $0x11, %rsi #endif // call tsan interceptor call ASM_TSAN_SYMBOL(__tsan_setjmp) // unalign stack frame add $8, %rsp CFI_ADJUST_CFA_OFFSET(-8) // restore savesigs parameter pop %rsi CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rsi) // restore env parameter pop %rdi CFI_ADJUST_CFA_OFFSET(-8) CFI_RESTORE(%rdi) // tail jump to libc sigsetjmp movl $0, %eax movq _ZN14__interception16real___sigsetjmpE@GOTPCREL(%rip), %rdx jmp *(%rdx) CFI_ENDPROC ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)) #endif // !defined(__APPLE__) #if defined(__FreeBSD__) || defined(__linux__) /* We do not need executable stack. */ .section .note.GNU-stack,"",@progbits #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_sync.h0000664000175000017500000000610512746647757025722 0ustar mwhudsonmwhudson//===-- tsan_sync.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_SYNC_H #define TSAN_SYNC_H #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_deadlock_detector_interface.h" #include "tsan_defs.h" #include "tsan_clock.h" #include "tsan_mutex.h" #include "tsan_dense_alloc.h" namespace __tsan { struct SyncVar { SyncVar(); static const int kInvalidTid = -1; uptr addr; // overwritten by DenseSlabAlloc freelist Mutex mtx; u64 uid; // Globally unique id. u32 creation_stack_id; int owner_tid; // Set only by exclusive owners. u64 last_lock; int recursion; bool is_rw; bool is_recursive; bool is_broken; bool is_linker_init; u32 next; // in MetaMap DDMutex dd; SyncClock read_clock; // Used for rw mutexes only. // The clock is placed last, so that it is situated on a different cache line // with the mtx. This reduces contention for hot sync objects. SyncClock clock; void Init(ThreadState *thr, uptr pc, uptr addr, u64 uid); void Reset(Processor *proc); u64 GetId() const { // 48 lsb is addr, then 14 bits is low part of uid, then 2 zero bits. return GetLsb((u64)addr | (uid << 48), 60); } bool CheckId(u64 uid) const { CHECK_EQ(uid, GetLsb(uid, 14)); return GetLsb(this->uid, 14) == uid; } static uptr SplitId(u64 id, u64 *uid) { *uid = id >> 48; return (uptr)GetLsb(id, 48); } }; /* MetaMap allows to map arbitrary user pointers onto various descriptors. Currently it maps pointers to heap block descriptors and sync var descs. It uses 1/2 direct shadow, see tsan_platform.h. */ class MetaMap { public: MetaMap(); void AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz); uptr FreeBlock(Processor *proc, uptr p); bool FreeRange(Processor *proc, uptr p, uptr sz); void ResetRange(Processor *proc, uptr p, uptr sz); MBlock* GetBlock(uptr p); SyncVar* GetOrCreateAndLock(ThreadState *thr, uptr pc, uptr addr, bool write_lock); SyncVar* GetIfExistsAndLock(uptr addr, bool write_lock); void MoveMemory(uptr src, uptr dst, uptr sz); void OnProcIdle(Processor *proc); private: static const u32 kFlagMask = 3u << 30; static const u32 kFlagBlock = 1u << 30; static const u32 kFlagSync = 2u << 30; typedef DenseSlabAlloc BlockAlloc; typedef DenseSlabAlloc SyncAlloc; BlockAlloc block_alloc_; SyncAlloc sync_alloc_; atomic_uint64_t uid_gen_; SyncVar* GetAndLock(ThreadState *thr, uptr pc, uptr addr, bool write_lock, bool create); }; } // namespace __tsan #endif // TSAN_SYNC_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_flags.cc0000664000175000017500000000671213004730632026151 0ustar mwhudsonmwhudson//===-- tsan_flags.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_libc.h" #include "tsan_flags.h" #include "tsan_rtl.h" #include "tsan_mman.h" #include "ubsan/ubsan_flags.h" namespace __tsan { Flags *flags() { return &ctx->flags; } // Can be overriden in frontend. #ifdef TSAN_EXTERNAL_HOOKS extern "C" const char* __tsan_default_options(); #else SANITIZER_WEAK_DEFAULT_IMPL const char *__tsan_default_options() { return ""; } #endif void Flags::SetDefaults() { #define TSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "tsan_flags.inc" #undef TSAN_FLAG // DDFlags second_deadlock_stack = false; } void RegisterTsanFlags(FlagParser *parser, Flags *f) { #define TSAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "tsan_flags.inc" #undef TSAN_FLAG // DDFlags RegisterFlag(parser, "second_deadlock_stack", "Report where each mutex is locked in deadlock reports", &f->second_deadlock_stack); } void InitializeFlags(Flags *f, const char *env) { SetCommonFlagsDefaults(); { // Override some common flags defaults. CommonFlags cf; cf.CopyFrom(*common_flags()); cf.allow_addr2line = true; if (SANITIZER_GO) { // Does not work as expected for Go: runtime handles SIGABRT and crashes. cf.abort_on_error = false; // Go does not have mutexes. } else { cf.detect_deadlocks = true; } cf.print_suppressions = false; cf.stack_trace_format = " #%n %f %S %M"; cf.exitcode = 66; cf.intercept_tls_get_addr = true; OverrideCommonFlags(cf); } f->SetDefaults(); FlagParser parser; RegisterTsanFlags(&parser, f); RegisterCommonFlags(&parser); #if TSAN_CONTAINS_UBSAN __ubsan::Flags *uf = __ubsan::flags(); uf->SetDefaults(); FlagParser ubsan_parser; __ubsan::RegisterUbsanFlags(&ubsan_parser, uf); RegisterCommonFlags(&ubsan_parser); #endif // Let a frontend override. parser.ParseString(__tsan_default_options()); #if TSAN_CONTAINS_UBSAN const char *ubsan_default_options = __ubsan::MaybeCallUbsanDefaultOptions(); ubsan_parser.ParseString(ubsan_default_options); #endif // Override from command line. parser.ParseString(env); #if TSAN_CONTAINS_UBSAN ubsan_parser.ParseString(GetEnv("UBSAN_OPTIONS")); #endif // Sanity check. if (!f->report_bugs) { f->report_thread_leaks = false; f->report_destroy_locked = false; f->report_signal_unsafe = false; } InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) parser.PrintFlagDescriptions(); if (f->history_size < 0 || f->history_size > 7) { Printf("ThreadSanitizer: incorrect value for history_size" " (must be [0..7])\n"); Die(); } if (f->io_sync < 0 || f->io_sync > 2) { Printf("ThreadSanitizer: incorrect value for io_sync" " (must be [0..2])\n"); Die(); } } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_ignoreset.h0000664000175000017500000000164212245353724026724 0ustar mwhudsonmwhudson//===-- tsan_ignoreset.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // IgnoreSet holds a set of stack traces where ignores were enabled. //===----------------------------------------------------------------------===// #ifndef TSAN_IGNORESET_H #define TSAN_IGNORESET_H #include "tsan_defs.h" namespace __tsan { class IgnoreSet { public: static const uptr kMaxSize = 16; IgnoreSet(); void Add(u32 stack_id); void Reset(); uptr Size() const; u32 At(uptr i) const; private: uptr size_; u32 stacks_[kMaxSize]; }; } // namespace __tsan #endif // TSAN_IGNORESET_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_vector.h0000664000175000017500000000476412341635476026243 0ustar mwhudsonmwhudson//===-- tsan_vector.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// // Low-fat STL-like vector container. #ifndef TSAN_VECTOR_H #define TSAN_VECTOR_H #include "tsan_defs.h" #include "tsan_mman.h" namespace __tsan { template class Vector { public: explicit Vector(MBlockType typ) : typ_(typ) , begin_() , end_() , last_() { } ~Vector() { if (begin_) internal_free(begin_); } void Reset() { if (begin_) internal_free(begin_); begin_ = 0; end_ = 0; last_ = 0; } uptr Size() const { return end_ - begin_; } T &operator[](uptr i) { DCHECK_LT(i, end_ - begin_); return begin_[i]; } const T &operator[](uptr i) const { DCHECK_LT(i, end_ - begin_); return begin_[i]; } T *PushBack() { EnsureSize(Size() + 1); T *p = &end_[-1]; internal_memset(p, 0, sizeof(*p)); return p; } T *PushBack(const T& v) { EnsureSize(Size() + 1); T *p = &end_[-1]; internal_memcpy(p, &v, sizeof(*p)); return p; } void PopBack() { DCHECK_GT(end_, begin_); end_--; } void Resize(uptr size) { if (size == 0) { end_ = begin_; return; } uptr old_size = Size(); EnsureSize(size); if (old_size < size) { for (uptr i = old_size; i < size; i++) internal_memset(&begin_[i], 0, sizeof(begin_[i])); } } private: const MBlockType typ_; T *begin_; T *end_; T *last_; void EnsureSize(uptr size) { if (size <= Size()) return; if (size <= (uptr)(last_ - begin_)) { end_ = begin_ + size; return; } uptr cap0 = last_ - begin_; uptr cap = cap0 * 5 / 4; // 25% growth if (cap == 0) cap = 16; if (cap < size) cap = size; T *p = (T*)internal_alloc(typ_, cap * sizeof(T)); if (cap0) { internal_memcpy(p, begin_, cap0 * sizeof(T)); internal_free(begin_); } begin_ = p; end_ = begin_ + size; last_ = begin_ + cap; } Vector(const Vector&); void operator=(const Vector&); }; } // namespace __tsan #endif // #ifndef TSAN_VECTOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_dense_alloc.h0000664000175000017500000000737612632073552027205 0ustar mwhudsonmwhudson//===-- tsan_dense_alloc.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // A DenseSlabAlloc is a freelist-based allocator of fixed-size objects. // DenseSlabAllocCache is a thread-local cache for DenseSlabAlloc. // The only difference with traditional slab allocators is that DenseSlabAlloc // allocates/free indices of objects and provide a functionality to map // the index onto the real pointer. The index is u32, that is, 2 times smaller // than uptr (hense the Dense prefix). //===----------------------------------------------------------------------===// #ifndef TSAN_DENSE_ALLOC_H #define TSAN_DENSE_ALLOC_H #include "sanitizer_common/sanitizer_common.h" #include "tsan_defs.h" #include "tsan_mutex.h" namespace __tsan { class DenseSlabAllocCache { static const uptr kSize = 128; typedef u32 IndexT; uptr pos; IndexT cache[kSize]; template friend class DenseSlabAlloc; }; template class DenseSlabAlloc { public: typedef DenseSlabAllocCache Cache; typedef typename Cache::IndexT IndexT; DenseSlabAlloc() { // Check that kL1Size and kL2Size are sane. CHECK_EQ(kL1Size & (kL1Size - 1), 0); CHECK_EQ(kL2Size & (kL2Size - 1), 0); CHECK_GE(1ull << (sizeof(IndexT) * 8), kL1Size * kL2Size); // Check that it makes sense to use the dense alloc. CHECK_GE(sizeof(T), sizeof(IndexT)); internal_memset(map_, 0, sizeof(map_)); freelist_ = 0; fillpos_ = 0; } ~DenseSlabAlloc() { for (uptr i = 0; i < kL1Size; i++) { if (map_[i] != 0) UnmapOrDie(map_[i], kL2Size * sizeof(T)); } } IndexT Alloc(Cache *c) { if (c->pos == 0) Refill(c); return c->cache[--c->pos]; } void Free(Cache *c, IndexT idx) { DCHECK_NE(idx, 0); if (c->pos == Cache::kSize) Drain(c); c->cache[c->pos++] = idx; } T *Map(IndexT idx) { DCHECK_NE(idx, 0); DCHECK_LE(idx, kL1Size * kL2Size); return &map_[idx / kL2Size][idx % kL2Size]; } void FlushCache(Cache *c) { SpinMutexLock lock(&mtx_); while (c->pos) { IndexT idx = c->cache[--c->pos]; *(IndexT*)Map(idx) = freelist_; freelist_ = idx; } } void InitCache(Cache *c) { c->pos = 0; internal_memset(c->cache, 0, sizeof(c->cache)); } private: T *map_[kL1Size]; SpinMutex mtx_; IndexT freelist_; uptr fillpos_; void Refill(Cache *c) { SpinMutexLock lock(&mtx_); if (freelist_ == 0) { if (fillpos_ == kL1Size) { Printf("ThreadSanitizer: DenseSlabAllocator overflow. Dying.\n"); Die(); } T *batch = (T*)MmapOrDie(kL2Size * sizeof(T), "DenseSlabAllocator"); // Reserve 0 as invalid index. IndexT start = fillpos_ == 0 ? 1 : 0; for (IndexT i = start; i < kL2Size; i++) { new(batch + i) T; *(IndexT*)(batch + i) = i + 1 + fillpos_ * kL2Size; } *(IndexT*)(batch + kL2Size - 1) = 0; freelist_ = fillpos_ * kL2Size + start; map_[fillpos_++] = batch; } for (uptr i = 0; i < Cache::kSize / 2 && freelist_ != 0; i++) { IndexT idx = freelist_; c->cache[c->pos++] = idx; freelist_ = *(IndexT*)Map(idx); } } void Drain(Cache *c) { SpinMutexLock lock(&mtx_); for (uptr i = 0; i < Cache::kSize / 2; i++) { IndexT idx = c->cache[--c->pos]; *(IndexT*)Map(idx) = freelist_; freelist_ = idx; } } }; } // namespace __tsan #endif // TSAN_DENSE_ALLOC_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_ignoreset.cc0000664000175000017500000000201512245353724027055 0ustar mwhudsonmwhudson//===-- tsan_ignoreset.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_ignoreset.h" namespace __tsan { const uptr IgnoreSet::kMaxSize; IgnoreSet::IgnoreSet() : size_() { } void IgnoreSet::Add(u32 stack_id) { if (size_ == kMaxSize) return; for (uptr i = 0; i < size_; i++) { if (stacks_[i] == stack_id) return; } stacks_[size_++] = stack_id; } void IgnoreSet::Reset() { size_ = 0; } uptr IgnoreSet::Size() const { return size_; } u32 IgnoreSet::At(uptr i) const { CHECK_LT(i, size_); CHECK_LE(size_, kMaxSize); return stacks_[i]; } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_mman.cc0000664000175000017500000002042512773316446026021 0ustar mwhudsonmwhudson//===-- tsan_mman.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator_interface.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "tsan_mman.h" #include "tsan_rtl.h" #include "tsan_report.h" #include "tsan_flags.h" // May be overriden by front-end. SANITIZER_WEAK_DEFAULT_IMPL void __sanitizer_malloc_hook(void *ptr, uptr size) { (void)ptr; (void)size; } SANITIZER_WEAK_DEFAULT_IMPL void __sanitizer_free_hook(void *ptr) { (void)ptr; } namespace __tsan { struct MapUnmapCallback { void OnMap(uptr p, uptr size) const { } void OnUnmap(uptr p, uptr size) const { // We are about to unmap a chunk of user memory. // Mark the corresponding shadow memory as not needed. DontNeedShadowFor(p, size); // Mark the corresponding meta shadow memory as not needed. // Note the block does not contain any meta info at this point // (this happens after free). const uptr kMetaRatio = kMetaShadowCell / kMetaShadowSize; const uptr kPageSize = GetPageSizeCached() * kMetaRatio; // Block came from LargeMmapAllocator, so must be large. // We rely on this in the calculations below. CHECK_GE(size, 2 * kPageSize); uptr diff = RoundUp(p, kPageSize) - p; if (diff != 0) { p += diff; size -= diff; } diff = p + size - RoundDown(p + size, kPageSize); if (diff != 0) size -= diff; ReleaseMemoryToOS((uptr)MemToMeta(p), size / kMetaRatio); } }; static char allocator_placeholder[sizeof(Allocator)] ALIGNED(64); Allocator *allocator() { return reinterpret_cast(&allocator_placeholder); } struct GlobalProc { Mutex mtx; Processor *proc; GlobalProc() : mtx(MutexTypeGlobalProc, StatMtxGlobalProc) , proc(ProcCreate()) { } }; static char global_proc_placeholder[sizeof(GlobalProc)] ALIGNED(64); GlobalProc *global_proc() { return reinterpret_cast(&global_proc_placeholder); } ScopedGlobalProcessor::ScopedGlobalProcessor() { GlobalProc *gp = global_proc(); ThreadState *thr = cur_thread(); if (thr->proc()) return; // If we don't have a proc, use the global one. // There are currently only two known case where this path is triggered: // __interceptor_free // __nptl_deallocate_tsd // start_thread // clone // and: // ResetRange // __interceptor_munmap // __deallocate_stack // start_thread // clone // Ideally, we destroy thread state (and unwire proc) when a thread actually // exits (i.e. when we join/wait it). Then we would not need the global proc gp->mtx.Lock(); ProcWire(gp->proc, thr); } ScopedGlobalProcessor::~ScopedGlobalProcessor() { GlobalProc *gp = global_proc(); ThreadState *thr = cur_thread(); if (thr->proc() != gp->proc) return; ProcUnwire(gp->proc, thr); gp->mtx.Unlock(); } void InitializeAllocator() { allocator()->Init(common_flags()->allocator_may_return_null); } void InitializeAllocatorLate() { new(global_proc()) GlobalProc(); } void AllocatorProcStart(Processor *proc) { allocator()->InitCache(&proc->alloc_cache); internal_allocator()->InitCache(&proc->internal_alloc_cache); } void AllocatorProcFinish(Processor *proc) { allocator()->DestroyCache(&proc->alloc_cache); internal_allocator()->DestroyCache(&proc->internal_alloc_cache); } void AllocatorPrintStats() { allocator()->PrintStats(); } static void SignalUnsafeCall(ThreadState *thr, uptr pc) { if (atomic_load_relaxed(&thr->in_signal_handler) == 0 || !flags()->report_signal_unsafe) return; VarSizeStackTrace stack; ObtainCurrentStack(thr, pc, &stack); if (IsFiredSuppression(ctx, ReportTypeSignalUnsafe, stack)) return; ThreadRegistryLock l(ctx->thread_registry); ScopedReport rep(ReportTypeSignalUnsafe); rep.AddStack(stack, true); OutputReport(thr, rep); } void *user_alloc(ThreadState *thr, uptr pc, uptr sz, uptr align, bool signal) { if ((sz >= (1ull << 40)) || (align >= (1ull << 40))) return allocator()->ReturnNullOrDieOnBadRequest(); void *p = allocator()->Allocate(&thr->proc()->alloc_cache, sz, align); if (p == 0) return 0; if (ctx && ctx->initialized) OnUserAlloc(thr, pc, (uptr)p, sz, true); if (signal) SignalUnsafeCall(thr, pc); return p; } void *user_calloc(ThreadState *thr, uptr pc, uptr size, uptr n) { if (CallocShouldReturnNullDueToOverflow(size, n)) return allocator()->ReturnNullOrDieOnBadRequest(); void *p = user_alloc(thr, pc, n * size); if (p) internal_memset(p, 0, n * size); return p; } void user_free(ThreadState *thr, uptr pc, void *p, bool signal) { ScopedGlobalProcessor sgp; if (ctx && ctx->initialized) OnUserFree(thr, pc, (uptr)p, true); allocator()->Deallocate(&thr->proc()->alloc_cache, p); if (signal) SignalUnsafeCall(thr, pc); } void OnUserAlloc(ThreadState *thr, uptr pc, uptr p, uptr sz, bool write) { DPrintf("#%d: alloc(%zu) = %p\n", thr->tid, sz, p); ctx->metamap.AllocBlock(thr, pc, p, sz); if (write && thr->ignore_reads_and_writes == 0) MemoryRangeImitateWrite(thr, pc, (uptr)p, sz); else MemoryResetRange(thr, pc, (uptr)p, sz); } void OnUserFree(ThreadState *thr, uptr pc, uptr p, bool write) { CHECK_NE(p, (void*)0); uptr sz = ctx->metamap.FreeBlock(thr->proc(), p); DPrintf("#%d: free(%p, %zu)\n", thr->tid, p, sz); if (write && thr->ignore_reads_and_writes == 0) MemoryRangeFreed(thr, pc, (uptr)p, sz); } void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz) { // FIXME: Handle "shrinking" more efficiently, // it seems that some software actually does this. void *p2 = user_alloc(thr, pc, sz); if (p2 == 0) return 0; if (p) { uptr oldsz = user_alloc_usable_size(p); internal_memcpy(p2, p, min(oldsz, sz)); user_free(thr, pc, p); } return p2; } uptr user_alloc_usable_size(const void *p) { if (p == 0) return 0; MBlock *b = ctx->metamap.GetBlock((uptr)p); if (!b) return 0; // Not a valid pointer. if (b->siz == 0) return 1; // Zero-sized allocations are actually 1 byte. return b->siz; } void invoke_malloc_hook(void *ptr, uptr size) { ThreadState *thr = cur_thread(); if (ctx == 0 || !ctx->initialized || thr->ignore_interceptors) return; __sanitizer_malloc_hook(ptr, size); RunMallocHooks(ptr, size); } void invoke_free_hook(void *ptr) { ThreadState *thr = cur_thread(); if (ctx == 0 || !ctx->initialized || thr->ignore_interceptors) return; __sanitizer_free_hook(ptr); RunFreeHooks(ptr); } void *internal_alloc(MBlockType typ, uptr sz) { ThreadState *thr = cur_thread(); if (thr->nomalloc) { thr->nomalloc = 0; // CHECK calls internal_malloc(). CHECK(0); } return InternalAlloc(sz, &thr->proc()->internal_alloc_cache); } void internal_free(void *p) { ThreadState *thr = cur_thread(); if (thr->nomalloc) { thr->nomalloc = 0; // CHECK calls internal_malloc(). CHECK(0); } InternalFree(p, &thr->proc()->internal_alloc_cache); } } // namespace __tsan using namespace __tsan; extern "C" { uptr __sanitizer_get_current_allocated_bytes() { uptr stats[AllocatorStatCount]; allocator()->GetStats(stats); return stats[AllocatorStatAllocated]; } uptr __sanitizer_get_heap_size() { uptr stats[AllocatorStatCount]; allocator()->GetStats(stats); return stats[AllocatorStatMapped]; } uptr __sanitizer_get_free_bytes() { return 1; } uptr __sanitizer_get_unmapped_bytes() { return 1; } uptr __sanitizer_get_estimated_allocated_size(uptr size) { return size; } int __sanitizer_get_ownership(const void *p) { return allocator()->GetBlockBegin(p) != 0; } uptr __sanitizer_get_allocated_size(const void *p) { return user_alloc_usable_size(p); } void __tsan_on_thread_idle() { ThreadState *thr = cur_thread(); allocator()->SwallowCache(&thr->proc()->alloc_cache); internal_allocator()->SwallowCache(&thr->proc()->internal_alloc_cache); ctx->metamap.OnProcIdle(thr->proc()); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_suppressions.h0000664000175000017500000000245212544254147027503 0ustar mwhudsonmwhudson//===-- tsan_suppressions.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_SUPPRESSIONS_H #define TSAN_SUPPRESSIONS_H #include "sanitizer_common/sanitizer_suppressions.h" #include "tsan_report.h" namespace __tsan { const char kSuppressionNone[] = "none"; const char kSuppressionRace[] = "race"; const char kSuppressionRaceTop[] = "race_top"; const char kSuppressionMutex[] = "mutex"; const char kSuppressionThread[] = "thread"; const char kSuppressionSignal[] = "signal"; const char kSuppressionLib[] = "called_from_lib"; const char kSuppressionDeadlock[] = "deadlock"; void InitializeSuppressions(); SuppressionContext *Suppressions(); void PrintMatchedSuppressions(); uptr IsSuppressed(ReportType typ, const ReportStack *stack, Suppression **sp); uptr IsSuppressed(ReportType typ, const ReportLocation *loc, Suppression **sp); } // namespace __tsan #endif // TSAN_SUPPRESSIONS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_mman.h0000664000175000017500000000421012713170772025647 0ustar mwhudsonmwhudson//===-- tsan_mman.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_MMAN_H #define TSAN_MMAN_H #include "tsan_defs.h" namespace __tsan { const uptr kDefaultAlignment = 16; void InitializeAllocator(); void InitializeAllocatorLate(); void ReplaceSystemMalloc(); void AllocatorProcStart(Processor *proc); void AllocatorProcFinish(Processor *proc); void AllocatorPrintStats(); // For user allocations. void *user_alloc(ThreadState *thr, uptr pc, uptr sz, uptr align = kDefaultAlignment, bool signal = true); void *user_calloc(ThreadState *thr, uptr pc, uptr sz, uptr n); // Does not accept NULL. void user_free(ThreadState *thr, uptr pc, void *p, bool signal = true); void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz); void *user_alloc_aligned(ThreadState *thr, uptr pc, uptr sz, uptr align); uptr user_alloc_usable_size(const void *p); // Invoking malloc/free hooks that may be installed by the user. void invoke_malloc_hook(void *ptr, uptr size); void invoke_free_hook(void *ptr); enum MBlockType { MBlockScopedBuf, MBlockString, MBlockStackTrace, MBlockShadowStack, MBlockSync, MBlockClock, MBlockThreadContex, MBlockDeadInfo, MBlockRacyStacks, MBlockRacyAddresses, MBlockAtExit, MBlockFlag, MBlockReport, MBlockReportMop, MBlockReportThread, MBlockReportMutex, MBlockReportLoc, MBlockReportStack, MBlockSuppression, MBlockExpectRace, MBlockSignal, MBlockJmpBuf, // This must be the last. MBlockTypeCount }; // For internal data structures. void *internal_alloc(MBlockType typ, uptr sz); void internal_free(void *p); template void DestroyAndFree(T *&p) { p->~T(); internal_free(p); p = 0; } } // namespace __tsan #endif // TSAN_MMAN_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_symbolize.h0000664000175000017500000000154512542525314026740 0ustar mwhudsonmwhudson//===-- tsan_symbolize.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_SYMBOLIZE_H #define TSAN_SYMBOLIZE_H #include "tsan_defs.h" #include "tsan_report.h" namespace __tsan { void EnterSymbolizer(); void ExitSymbolizer(); SymbolizedStack *SymbolizeCode(uptr addr); ReportLocation *SymbolizeData(uptr addr); void SymbolizeFlush(); ReportStack *NewReportStackEntry(uptr addr); } // namespace __tsan #endif // TSAN_SYMBOLIZE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl.h0000664000175000017500000006226613004730632025526 0ustar mwhudsonmwhudson//===-- tsan_rtl.h ----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Main internal TSan header file. // // Ground rules: // - C++ run-time should not be used (static CTORs, RTTI, exceptions, static // function-scope locals) // - All functions/classes/etc reside in namespace __tsan, except for those // declared in tsan_interface.h. // - Platform-specific files should be used instead of ifdefs (*). // - No system headers included in header files (*). // - Platform specific headres included only into platform-specific files (*). // // (*) Except when inlining is critical for performance. //===----------------------------------------------------------------------===// #ifndef TSAN_RTL_H #define TSAN_RTL_H #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_asm.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_deadlock_detector_interface.h" #include "sanitizer_common/sanitizer_libignore.h" #include "sanitizer_common/sanitizer_suppressions.h" #include "sanitizer_common/sanitizer_thread_registry.h" #include "tsan_clock.h" #include "tsan_defs.h" #include "tsan_flags.h" #include "tsan_sync.h" #include "tsan_trace.h" #include "tsan_vector.h" #include "tsan_report.h" #include "tsan_platform.h" #include "tsan_mutexset.h" #include "tsan_ignoreset.h" #include "tsan_stack_trace.h" #if SANITIZER_WORDSIZE != 64 # error "ThreadSanitizer is supported only on 64-bit platforms" #endif namespace __tsan { #if !SANITIZER_GO struct MapUnmapCallback; #if defined(__mips64) || defined(__aarch64__) || defined(__powerpc__) static const uptr kAllocatorSpace = 0; static const uptr kAllocatorSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kAllocatorRegionSizeLog = 20; static const uptr kAllocatorNumRegions = kAllocatorSize >> kAllocatorRegionSizeLog; typedef TwoLevelByteMap<(kAllocatorNumRegions >> 12), 1 << 12, MapUnmapCallback> ByteMap; typedef SizeClassAllocator32 PrimaryAllocator; #else struct AP64 { // Allocator64 parameters. Deliberately using a short name. static const uptr kSpaceBeg = Mapping::kHeapMemBeg; static const uptr kSpaceSize = Mapping::kHeapMemEnd - Mapping::kHeapMemBeg; static const uptr kMetadataSize = 0; typedef DefaultSizeClassMap SizeClassMap; typedef __tsan::MapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; typedef SizeClassAllocator64 PrimaryAllocator; #endif typedef SizeClassAllocatorLocalCache AllocatorCache; typedef LargeMmapAllocator SecondaryAllocator; typedef CombinedAllocator Allocator; Allocator *allocator(); #endif void TsanCheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2); const u64 kShadowRodata = (u64)-1; // .rodata shadow marker // FastState (from most significant bit): // ignore : 1 // tid : kTidBits // unused : - // history_size : 3 // epoch : kClkBits class FastState { public: FastState(u64 tid, u64 epoch) { x_ = tid << kTidShift; x_ |= epoch; DCHECK_EQ(tid, this->tid()); DCHECK_EQ(epoch, this->epoch()); DCHECK_EQ(GetIgnoreBit(), false); } explicit FastState(u64 x) : x_(x) { } u64 raw() const { return x_; } u64 tid() const { u64 res = (x_ & ~kIgnoreBit) >> kTidShift; return res; } u64 TidWithIgnore() const { u64 res = x_ >> kTidShift; return res; } u64 epoch() const { u64 res = x_ & ((1ull << kClkBits) - 1); return res; } void IncrementEpoch() { u64 old_epoch = epoch(); x_ += 1; DCHECK_EQ(old_epoch + 1, epoch()); (void)old_epoch; } void SetIgnoreBit() { x_ |= kIgnoreBit; } void ClearIgnoreBit() { x_ &= ~kIgnoreBit; } bool GetIgnoreBit() const { return (s64)x_ < 0; } void SetHistorySize(int hs) { CHECK_GE(hs, 0); CHECK_LE(hs, 7); x_ = (x_ & ~(kHistoryMask << kHistoryShift)) | (u64(hs) << kHistoryShift); } ALWAYS_INLINE int GetHistorySize() const { return (int)((x_ >> kHistoryShift) & kHistoryMask); } void ClearHistorySize() { SetHistorySize(0); } ALWAYS_INLINE u64 GetTracePos() const { const int hs = GetHistorySize(); // When hs == 0, the trace consists of 2 parts. const u64 mask = (1ull << (kTracePartSizeBits + hs + 1)) - 1; return epoch() & mask; } private: friend class Shadow; static const int kTidShift = 64 - kTidBits - 1; static const u64 kIgnoreBit = 1ull << 63; static const u64 kFreedBit = 1ull << 63; static const u64 kHistoryShift = kClkBits; static const u64 kHistoryMask = 7; u64 x_; }; // Shadow (from most significant bit): // freed : 1 // tid : kTidBits // is_atomic : 1 // is_read : 1 // size_log : 2 // addr0 : 3 // epoch : kClkBits class Shadow : public FastState { public: explicit Shadow(u64 x) : FastState(x) { } explicit Shadow(const FastState &s) : FastState(s.x_) { ClearHistorySize(); } void SetAddr0AndSizeLog(u64 addr0, unsigned kAccessSizeLog) { DCHECK_EQ((x_ >> kClkBits) & 31, 0); DCHECK_LE(addr0, 7); DCHECK_LE(kAccessSizeLog, 3); x_ |= ((kAccessSizeLog << 3) | addr0) << kClkBits; DCHECK_EQ(kAccessSizeLog, size_log()); DCHECK_EQ(addr0, this->addr0()); } void SetWrite(unsigned kAccessIsWrite) { DCHECK_EQ(x_ & kReadBit, 0); if (!kAccessIsWrite) x_ |= kReadBit; DCHECK_EQ(kAccessIsWrite, IsWrite()); } void SetAtomic(bool kIsAtomic) { DCHECK(!IsAtomic()); if (kIsAtomic) x_ |= kAtomicBit; DCHECK_EQ(IsAtomic(), kIsAtomic); } bool IsAtomic() const { return x_ & kAtomicBit; } bool IsZero() const { return x_ == 0; } static inline bool TidsAreEqual(const Shadow s1, const Shadow s2) { u64 shifted_xor = (s1.x_ ^ s2.x_) >> kTidShift; DCHECK_EQ(shifted_xor == 0, s1.TidWithIgnore() == s2.TidWithIgnore()); return shifted_xor == 0; } static ALWAYS_INLINE bool Addr0AndSizeAreEqual(const Shadow s1, const Shadow s2) { u64 masked_xor = ((s1.x_ ^ s2.x_) >> kClkBits) & 31; return masked_xor == 0; } static ALWAYS_INLINE bool TwoRangesIntersect(Shadow s1, Shadow s2, unsigned kS2AccessSize) { bool res = false; u64 diff = s1.addr0() - s2.addr0(); if ((s64)diff < 0) { // s1.addr0 < s2.addr0 // NOLINT // if (s1.addr0() + size1) > s2.addr0()) return true; if (s1.size() > -diff) res = true; } else { // if (s2.addr0() + kS2AccessSize > s1.addr0()) return true; if (kS2AccessSize > diff) res = true; } DCHECK_EQ(res, TwoRangesIntersectSlow(s1, s2)); DCHECK_EQ(res, TwoRangesIntersectSlow(s2, s1)); return res; } u64 ALWAYS_INLINE addr0() const { return (x_ >> kClkBits) & 7; } u64 ALWAYS_INLINE size() const { return 1ull << size_log(); } bool ALWAYS_INLINE IsWrite() const { return !IsRead(); } bool ALWAYS_INLINE IsRead() const { return x_ & kReadBit; } // The idea behind the freed bit is as follows. // When the memory is freed (or otherwise unaccessible) we write to the shadow // values with tid/epoch related to the free and the freed bit set. // During memory accesses processing the freed bit is considered // as msb of tid. So any access races with shadow with freed bit set // (it is as if write from a thread with which we never synchronized before). // This allows us to detect accesses to freed memory w/o additional // overheads in memory access processing and at the same time restore // tid/epoch of free. void MarkAsFreed() { x_ |= kFreedBit; } bool IsFreed() const { return x_ & kFreedBit; } bool GetFreedAndReset() { bool res = x_ & kFreedBit; x_ &= ~kFreedBit; return res; } bool ALWAYS_INLINE IsBothReadsOrAtomic(bool kIsWrite, bool kIsAtomic) const { bool v = x_ & ((u64(kIsWrite ^ 1) << kReadShift) | (u64(kIsAtomic) << kAtomicShift)); DCHECK_EQ(v, (!IsWrite() && !kIsWrite) || (IsAtomic() && kIsAtomic)); return v; } bool ALWAYS_INLINE IsRWNotWeaker(bool kIsWrite, bool kIsAtomic) const { bool v = ((x_ >> kReadShift) & 3) <= u64((kIsWrite ^ 1) | (kIsAtomic << 1)); DCHECK_EQ(v, (IsAtomic() < kIsAtomic) || (IsAtomic() == kIsAtomic && !IsWrite() <= !kIsWrite)); return v; } bool ALWAYS_INLINE IsRWWeakerOrEqual(bool kIsWrite, bool kIsAtomic) const { bool v = ((x_ >> kReadShift) & 3) >= u64((kIsWrite ^ 1) | (kIsAtomic << 1)); DCHECK_EQ(v, (IsAtomic() > kIsAtomic) || (IsAtomic() == kIsAtomic && !IsWrite() >= !kIsWrite)); return v; } private: static const u64 kReadShift = 5 + kClkBits; static const u64 kReadBit = 1ull << kReadShift; static const u64 kAtomicShift = 6 + kClkBits; static const u64 kAtomicBit = 1ull << kAtomicShift; u64 size_log() const { return (x_ >> (3 + kClkBits)) & 3; } static bool TwoRangesIntersectSlow(const Shadow s1, const Shadow s2) { if (s1.addr0() == s2.addr0()) return true; if (s1.addr0() < s2.addr0() && s1.addr0() + s1.size() > s2.addr0()) return true; if (s2.addr0() < s1.addr0() && s2.addr0() + s2.size() > s1.addr0()) return true; return false; } }; struct ThreadSignalContext; struct JmpBuf { uptr sp; uptr mangled_sp; int int_signal_send; bool in_blocking_func; uptr in_signal_handler; uptr *shadow_stack_pos; }; // A Processor represents a physical thread, or a P for Go. // It is used to store internal resources like allocate cache, and does not // participate in race-detection logic (invisible to end user). // In C++ it is tied to an OS thread just like ThreadState, however ideally // it should be tied to a CPU (this way we will have fewer allocator caches). // In Go it is tied to a P, so there are significantly fewer Processor's than // ThreadState's (which are tied to Gs). // A ThreadState must be wired with a Processor to handle events. struct Processor { ThreadState *thr; // currently wired thread, or nullptr #if !SANITIZER_GO AllocatorCache alloc_cache; InternalAllocatorCache internal_alloc_cache; #endif DenseSlabAllocCache block_cache; DenseSlabAllocCache sync_cache; DenseSlabAllocCache clock_cache; DDPhysicalThread *dd_pt; }; #if !SANITIZER_GO // ScopedGlobalProcessor temporary setups a global processor for the current // thread, if it does not have one. Intended for interceptors that can run // at the very thread end, when we already destroyed the thread processor. struct ScopedGlobalProcessor { ScopedGlobalProcessor(); ~ScopedGlobalProcessor(); }; #endif // This struct is stored in TLS. struct ThreadState { FastState fast_state; // Synch epoch represents the threads's epoch before the last synchronization // action. It allows to reduce number of shadow state updates. // For example, fast_synch_epoch=100, last write to addr X was at epoch=150, // if we are processing write to X from the same thread at epoch=200, // we do nothing, because both writes happen in the same 'synch epoch'. // That is, if another memory access does not race with the former write, // it does not race with the latter as well. // QUESTION: can we can squeeze this into ThreadState::Fast? // E.g. ThreadState::Fast is a 44-bit, 32 are taken by synch_epoch and 12 are // taken by epoch between synchs. // This way we can save one load from tls. u64 fast_synch_epoch; // This is a slow path flag. On fast path, fast_state.GetIgnoreBit() is read. // We do not distinguish beteween ignoring reads and writes // for better performance. int ignore_reads_and_writes; int ignore_sync; // Go does not support ignores. #if !SANITIZER_GO IgnoreSet mop_ignore_set; IgnoreSet sync_ignore_set; #endif // C/C++ uses fixed size shadow stack embed into Trace. // Go uses malloc-allocated shadow stack with dynamic size. uptr *shadow_stack; uptr *shadow_stack_end; uptr *shadow_stack_pos; u64 *racy_shadow_addr; u64 racy_state[2]; MutexSet mset; ThreadClock clock; #if !SANITIZER_GO Vector jmp_bufs; int ignore_interceptors; #endif #if TSAN_COLLECT_STATS u64 stat[StatCnt]; #endif const int tid; const int unique_id; bool in_symbolizer; bool in_ignored_lib; bool is_inited; bool is_dead; bool is_freeing; bool is_vptr_access; const uptr stk_addr; const uptr stk_size; const uptr tls_addr; const uptr tls_size; ThreadContext *tctx; #if SANITIZER_DEBUG && !SANITIZER_GO InternalDeadlockDetector internal_deadlock_detector; #endif DDLogicalThread *dd_lt; // Current wired Processor, or nullptr. Required to handle any events. Processor *proc1; #if !SANITIZER_GO Processor *proc() { return proc1; } #else Processor *proc(); #endif atomic_uintptr_t in_signal_handler; ThreadSignalContext *signal_ctx; #if !SANITIZER_GO u32 last_sleep_stack_id; ThreadClock last_sleep_clock; #endif // Set in regions of runtime that must be signal-safe and fork-safe. // If set, malloc must not be called. int nomalloc; const ReportDesc *current_report; explicit ThreadState(Context *ctx, int tid, int unique_id, u64 epoch, unsigned reuse_count, uptr stk_addr, uptr stk_size, uptr tls_addr, uptr tls_size); }; #if !SANITIZER_GO #if SANITIZER_MAC || SANITIZER_ANDROID ThreadState *cur_thread(); void cur_thread_finalize(); #else __attribute__((tls_model("initial-exec"))) extern THREADLOCAL char cur_thread_placeholder[]; INLINE ThreadState *cur_thread() { return reinterpret_cast(&cur_thread_placeholder); } INLINE void cur_thread_finalize() { } #endif // SANITIZER_MAC || SANITIZER_ANDROID #endif // SANITIZER_GO class ThreadContext : public ThreadContextBase { public: explicit ThreadContext(int tid); ~ThreadContext(); ThreadState *thr; u32 creation_stack_id; SyncClock sync; // Epoch at which the thread had started. // If we see an event from the thread stamped by an older epoch, // the event is from a dead thread that shared tid with this thread. u64 epoch0; u64 epoch1; // Override superclass callbacks. void OnDead() override; void OnJoined(void *arg) override; void OnFinished() override; void OnStarted(void *arg) override; void OnCreated(void *arg) override; void OnReset() override; void OnDetached(void *arg) override; }; struct RacyStacks { MD5Hash hash[2]; bool operator==(const RacyStacks &other) const { if (hash[0] == other.hash[0] && hash[1] == other.hash[1]) return true; if (hash[0] == other.hash[1] && hash[1] == other.hash[0]) return true; return false; } }; struct RacyAddress { uptr addr_min; uptr addr_max; }; struct FiredSuppression { ReportType type; uptr pc_or_addr; Suppression *supp; }; struct Context { Context(); bool initialized; bool after_multithreaded_fork; MetaMap metamap; Mutex report_mtx; int nreported; int nmissed_expected; atomic_uint64_t last_symbolize_time_ns; void *background_thread; atomic_uint32_t stop_background_thread; ThreadRegistry *thread_registry; Mutex racy_mtx; Vector racy_stacks; Vector racy_addresses; // Number of fired suppressions may be large enough. Mutex fired_suppressions_mtx; InternalMmapVector fired_suppressions; DDetector *dd; ClockAlloc clock_alloc; Flags flags; u64 stat[StatCnt]; u64 int_alloc_cnt[MBlockTypeCount]; u64 int_alloc_siz[MBlockTypeCount]; }; extern Context *ctx; // The one and the only global runtime context. struct ScopedIgnoreInterceptors { ScopedIgnoreInterceptors() { #if !SANITIZER_GO cur_thread()->ignore_interceptors++; #endif } ~ScopedIgnoreInterceptors() { #if !SANITIZER_GO cur_thread()->ignore_interceptors--; #endif } }; class ScopedReport { public: explicit ScopedReport(ReportType typ); ~ScopedReport(); void AddMemoryAccess(uptr addr, Shadow s, StackTrace stack, const MutexSet *mset); void AddStack(StackTrace stack, bool suppressable = false); void AddThread(const ThreadContext *tctx, bool suppressable = false); void AddThread(int unique_tid, bool suppressable = false); void AddUniqueTid(int unique_tid); void AddMutex(const SyncVar *s); u64 AddMutex(u64 id); void AddLocation(uptr addr, uptr size); void AddSleep(u32 stack_id); void SetCount(int count); const ReportDesc *GetReport() const; private: ReportDesc *rep_; // Symbolizer makes lots of intercepted calls. If we try to process them, // at best it will cause deadlocks on internal mutexes. ScopedIgnoreInterceptors ignore_interceptors_; void AddDeadMutex(u64 id); ScopedReport(const ScopedReport&); void operator = (const ScopedReport&); }; void RestoreStack(int tid, const u64 epoch, VarSizeStackTrace *stk, MutexSet *mset); template void ObtainCurrentStack(ThreadState *thr, uptr toppc, StackTraceTy *stack) { uptr size = thr->shadow_stack_pos - thr->shadow_stack; uptr start = 0; if (size + !!toppc > kStackTraceMax) { start = size + !!toppc - kStackTraceMax; size = kStackTraceMax - !!toppc; } stack->Init(&thr->shadow_stack[start], size, toppc); } #if TSAN_COLLECT_STATS void StatAggregate(u64 *dst, u64 *src); void StatOutput(u64 *stat); #endif void ALWAYS_INLINE StatInc(ThreadState *thr, StatType typ, u64 n = 1) { #if TSAN_COLLECT_STATS thr->stat[typ] += n; #endif } void ALWAYS_INLINE StatSet(ThreadState *thr, StatType typ, u64 n) { #if TSAN_COLLECT_STATS thr->stat[typ] = n; #endif } void MapShadow(uptr addr, uptr size); void MapThreadTrace(uptr addr, uptr size, const char *name); void DontNeedShadowFor(uptr addr, uptr size); void InitializeShadowMemory(); void InitializeInterceptors(); void InitializeLibIgnore(); void InitializeDynamicAnnotations(); void ForkBefore(ThreadState *thr, uptr pc); void ForkParentAfter(ThreadState *thr, uptr pc); void ForkChildAfter(ThreadState *thr, uptr pc); void ReportRace(ThreadState *thr); bool OutputReport(ThreadState *thr, const ScopedReport &srep); bool IsFiredSuppression(Context *ctx, ReportType type, StackTrace trace); bool IsExpectedReport(uptr addr, uptr size); void PrintMatchedBenignRaces(); #if defined(TSAN_DEBUG_OUTPUT) && TSAN_DEBUG_OUTPUT >= 1 # define DPrintf Printf #else # define DPrintf(...) #endif #if defined(TSAN_DEBUG_OUTPUT) && TSAN_DEBUG_OUTPUT >= 2 # define DPrintf2 Printf #else # define DPrintf2(...) #endif u32 CurrentStackId(ThreadState *thr, uptr pc); ReportStack *SymbolizeStackId(u32 stack_id); void PrintCurrentStack(ThreadState *thr, uptr pc); void PrintCurrentStackSlow(uptr pc); // uses libunwind void Initialize(ThreadState *thr); int Finalize(ThreadState *thr); void OnUserAlloc(ThreadState *thr, uptr pc, uptr p, uptr sz, bool write); void OnUserFree(ThreadState *thr, uptr pc, uptr p, bool write); void MemoryAccess(ThreadState *thr, uptr pc, uptr addr, int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic); void MemoryAccessImpl(ThreadState *thr, uptr addr, int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic, u64 *shadow_mem, Shadow cur); void MemoryAccessRange(ThreadState *thr, uptr pc, uptr addr, uptr size, bool is_write); void MemoryAccessRangeStep(ThreadState *thr, uptr pc, uptr addr, uptr size, uptr step, bool is_write); void UnalignedMemoryAccess(ThreadState *thr, uptr pc, uptr addr, int size, bool kAccessIsWrite, bool kIsAtomic); const int kSizeLog1 = 0; const int kSizeLog2 = 1; const int kSizeLog4 = 2; const int kSizeLog8 = 3; void ALWAYS_INLINE MemoryRead(ThreadState *thr, uptr pc, uptr addr, int kAccessSizeLog) { MemoryAccess(thr, pc, addr, kAccessSizeLog, false, false); } void ALWAYS_INLINE MemoryWrite(ThreadState *thr, uptr pc, uptr addr, int kAccessSizeLog) { MemoryAccess(thr, pc, addr, kAccessSizeLog, true, false); } void ALWAYS_INLINE MemoryReadAtomic(ThreadState *thr, uptr pc, uptr addr, int kAccessSizeLog) { MemoryAccess(thr, pc, addr, kAccessSizeLog, false, true); } void ALWAYS_INLINE MemoryWriteAtomic(ThreadState *thr, uptr pc, uptr addr, int kAccessSizeLog) { MemoryAccess(thr, pc, addr, kAccessSizeLog, true, true); } void MemoryResetRange(ThreadState *thr, uptr pc, uptr addr, uptr size); void MemoryRangeFreed(ThreadState *thr, uptr pc, uptr addr, uptr size); void MemoryRangeImitateWrite(ThreadState *thr, uptr pc, uptr addr, uptr size); void ThreadIgnoreBegin(ThreadState *thr, uptr pc); void ThreadIgnoreEnd(ThreadState *thr, uptr pc); void ThreadIgnoreSyncBegin(ThreadState *thr, uptr pc); void ThreadIgnoreSyncEnd(ThreadState *thr, uptr pc); void FuncEntry(ThreadState *thr, uptr pc); void FuncExit(ThreadState *thr); int ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached); void ThreadStart(ThreadState *thr, int tid, uptr os_id); void ThreadFinish(ThreadState *thr); int ThreadTid(ThreadState *thr, uptr pc, uptr uid); void ThreadJoin(ThreadState *thr, uptr pc, int tid); void ThreadDetach(ThreadState *thr, uptr pc, int tid); void ThreadFinalize(ThreadState *thr); void ThreadSetName(ThreadState *thr, const char *name); int ThreadCount(ThreadState *thr); void ProcessPendingSignals(ThreadState *thr); Processor *ProcCreate(); void ProcDestroy(Processor *proc); void ProcWire(Processor *proc, ThreadState *thr); void ProcUnwire(Processor *proc, ThreadState *thr); void MutexCreate(ThreadState *thr, uptr pc, uptr addr, bool rw, bool recursive, bool linker_init); void MutexDestroy(ThreadState *thr, uptr pc, uptr addr); void MutexLock(ThreadState *thr, uptr pc, uptr addr, int rec = 1, bool try_lock = false); int MutexUnlock(ThreadState *thr, uptr pc, uptr addr, bool all = false); void MutexReadLock(ThreadState *thr, uptr pc, uptr addr, bool try_lock = false); void MutexReadUnlock(ThreadState *thr, uptr pc, uptr addr); void MutexReadOrWriteUnlock(ThreadState *thr, uptr pc, uptr addr); void MutexRepair(ThreadState *thr, uptr pc, uptr addr); // call on EOWNERDEAD void MutexInvalidAccess(ThreadState *thr, uptr pc, uptr addr); void Acquire(ThreadState *thr, uptr pc, uptr addr); // AcquireGlobal synchronizes the current thread with all other threads. // In terms of happens-before relation, it draws a HB edge from all threads // (where they happen to execute right now) to the current thread. We use it to // handle Go finalizers. Namely, finalizer goroutine executes AcquireGlobal // right before executing finalizers. This provides a coarse, but simple // approximation of the actual required synchronization. void AcquireGlobal(ThreadState *thr, uptr pc); void Release(ThreadState *thr, uptr pc, uptr addr); void ReleaseStore(ThreadState *thr, uptr pc, uptr addr); void AfterSleep(ThreadState *thr, uptr pc); void AcquireImpl(ThreadState *thr, uptr pc, SyncClock *c); void ReleaseImpl(ThreadState *thr, uptr pc, SyncClock *c); void ReleaseStoreImpl(ThreadState *thr, uptr pc, SyncClock *c); void AcquireReleaseImpl(ThreadState *thr, uptr pc, SyncClock *c); // The hacky call uses custom calling convention and an assembly thunk. // It is considerably faster that a normal call for the caller // if it is not executed (it is intended for slow paths from hot functions). // The trick is that the call preserves all registers and the compiler // does not treat it as a call. // If it does not work for you, use normal call. #if !SANITIZER_DEBUG && defined(__x86_64__) && !SANITIZER_MAC // The caller may not create the stack frame for itself at all, // so we create a reserve stack frame for it (1024b must be enough). #define HACKY_CALL(f) \ __asm__ __volatile__("sub $1024, %%rsp;" \ CFI_INL_ADJUST_CFA_OFFSET(1024) \ ".hidden " #f "_thunk;" \ "call " #f "_thunk;" \ "add $1024, %%rsp;" \ CFI_INL_ADJUST_CFA_OFFSET(-1024) \ ::: "memory", "cc"); #else #define HACKY_CALL(f) f() #endif void TraceSwitch(ThreadState *thr); uptr TraceTopPC(ThreadState *thr); uptr TraceSize(); uptr TraceParts(); Trace *ThreadTrace(int tid); extern "C" void __tsan_trace_switch(); void ALWAYS_INLINE TraceAddEvent(ThreadState *thr, FastState fs, EventType typ, u64 addr) { if (!kCollectHistory) return; DCHECK_GE((int)typ, 0); DCHECK_LE((int)typ, 7); DCHECK_EQ(GetLsb(addr, 61), addr); StatInc(thr, StatEvents); u64 pos = fs.GetTracePos(); if (UNLIKELY((pos % kTracePartSize) == 0)) { #if !SANITIZER_GO HACKY_CALL(__tsan_trace_switch); #else TraceSwitch(thr); #endif } Event *trace = (Event*)GetThreadTrace(fs.tid()); Event *evp = &trace[pos]; Event ev = (u64)addr | ((u64)typ << 61); *evp = ev; } #if !SANITIZER_GO uptr ALWAYS_INLINE HeapEnd() { return HeapMemEnd() + PrimaryAllocator::AdditionalSize(); } #endif } // namespace __tsan #endif // TSAN_RTL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_report.h0000664000175000017500000000512112706164165026235 0ustar mwhudsonmwhudson//===-- tsan_report.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_REPORT_H #define TSAN_REPORT_H #include "sanitizer_common/sanitizer_symbolizer.h" #include "tsan_defs.h" #include "tsan_vector.h" namespace __tsan { enum ReportType { ReportTypeRace, ReportTypeVptrRace, ReportTypeUseAfterFree, ReportTypeVptrUseAfterFree, ReportTypeThreadLeak, ReportTypeMutexDestroyLocked, ReportTypeMutexDoubleLock, ReportTypeMutexInvalidAccess, ReportTypeMutexBadUnlock, ReportTypeMutexBadReadLock, ReportTypeMutexBadReadUnlock, ReportTypeSignalUnsafe, ReportTypeErrnoInSignal, ReportTypeDeadlock }; struct ReportStack { SymbolizedStack *frames; bool suppressable; static ReportStack *New(); private: ReportStack(); }; struct ReportMopMutex { u64 id; bool write; }; struct ReportMop { int tid; uptr addr; int size; bool write; bool atomic; Vector mset; ReportStack *stack; ReportMop(); }; enum ReportLocationType { ReportLocationGlobal, ReportLocationHeap, ReportLocationStack, ReportLocationTLS, ReportLocationFD }; struct ReportLocation { ReportLocationType type; DataInfo global; uptr heap_chunk_start; uptr heap_chunk_size; int tid; int fd; bool suppressable; ReportStack *stack; static ReportLocation *New(ReportLocationType type); private: explicit ReportLocation(ReportLocationType type); }; struct ReportThread { int id; uptr os_id; bool running; char *name; int parent_tid; ReportStack *stack; }; struct ReportMutex { u64 id; uptr addr; bool destroyed; ReportStack *stack; }; class ReportDesc { public: ReportType typ; Vector stacks; Vector mops; Vector locs; Vector mutexes; Vector threads; Vector unique_tids; ReportStack *sleep; int count; ReportDesc(); ~ReportDesc(); private: ReportDesc(const ReportDesc&); void operator = (const ReportDesc&); }; // Format and output the report to the console/log. No additional logic. void PrintReport(const ReportDesc *rep); void PrintStack(const ReportStack *stack); } // namespace __tsan #endif // TSAN_REPORT_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_rtl_report.cc0000664000175000017500000005377213004730632027261 0ustar mwhudsonmwhudson//===-- tsan_rtl_report.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "tsan_platform.h" #include "tsan_rtl.h" #include "tsan_suppressions.h" #include "tsan_symbolize.h" #include "tsan_report.h" #include "tsan_sync.h" #include "tsan_mman.h" #include "tsan_flags.h" #include "tsan_fd.h" namespace __tsan { using namespace __sanitizer; // NOLINT static ReportStack *SymbolizeStack(StackTrace trace); void TsanCheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) { // There is high probability that interceptors will check-fail as well, // on the other hand there is no sense in processing interceptors // since we are going to die soon. ScopedIgnoreInterceptors ignore; #if !SANITIZER_GO cur_thread()->ignore_sync++; cur_thread()->ignore_reads_and_writes++; #endif Printf("FATAL: ThreadSanitizer CHECK failed: " "%s:%d \"%s\" (0x%zx, 0x%zx)\n", file, line, cond, (uptr)v1, (uptr)v2); PrintCurrentStackSlow(StackTrace::GetCurrentPc()); Die(); } // Can be overriden by an application/test to intercept reports. #ifdef TSAN_EXTERNAL_HOOKS bool OnReport(const ReportDesc *rep, bool suppressed); #else SANITIZER_WEAK_CXX_DEFAULT_IMPL bool OnReport(const ReportDesc *rep, bool suppressed) { (void)rep; return suppressed; } #endif SANITIZER_WEAK_DEFAULT_IMPL void __tsan_on_report(const ReportDesc *rep) { (void)rep; } static void StackStripMain(SymbolizedStack *frames) { SymbolizedStack *last_frame = nullptr; SymbolizedStack *last_frame2 = nullptr; for (SymbolizedStack *cur = frames; cur; cur = cur->next) { last_frame2 = last_frame; last_frame = cur; } if (last_frame2 == 0) return; #if !SANITIZER_GO const char *last = last_frame->info.function; const char *last2 = last_frame2->info.function; // Strip frame above 'main' if (last2 && 0 == internal_strcmp(last2, "main")) { last_frame->ClearAll(); last_frame2->next = nullptr; // Strip our internal thread start routine. } else if (last && 0 == internal_strcmp(last, "__tsan_thread_start_func")) { last_frame->ClearAll(); last_frame2->next = nullptr; // Strip global ctors init. } else if (last && 0 == internal_strcmp(last, "__do_global_ctors_aux")) { last_frame->ClearAll(); last_frame2->next = nullptr; // If both are 0, then we probably just failed to symbolize. } else if (last || last2) { // Ensure that we recovered stack completely. Trimmed stack // can actually happen if we do not instrument some code, // so it's only a debug print. However we must try hard to not miss it // due to our fault. DPrintf("Bottom stack frame is missed\n"); } #else // The last frame always point into runtime (gosched0, goexit0, runtime.main). last_frame->ClearAll(); last_frame2->next = nullptr; #endif } ReportStack *SymbolizeStackId(u32 stack_id) { if (stack_id == 0) return 0; StackTrace stack = StackDepotGet(stack_id); if (stack.trace == nullptr) return nullptr; return SymbolizeStack(stack); } static ReportStack *SymbolizeStack(StackTrace trace) { if (trace.size == 0) return 0; SymbolizedStack *top = nullptr; for (uptr si = 0; si < trace.size; si++) { const uptr pc = trace.trace[si]; uptr pc1 = pc; // We obtain the return address, but we're interested in the previous // instruction. if ((pc & kExternalPCBit) == 0) pc1 = StackTrace::GetPreviousInstructionPc(pc); SymbolizedStack *ent = SymbolizeCode(pc1); CHECK_NE(ent, 0); SymbolizedStack *last = ent; while (last->next) { last->info.address = pc; // restore original pc for report last = last->next; } last->info.address = pc; // restore original pc for report last->next = top; top = ent; } StackStripMain(top); ReportStack *stack = ReportStack::New(); stack->frames = top; return stack; } ScopedReport::ScopedReport(ReportType typ) { ctx->thread_registry->CheckLocked(); void *mem = internal_alloc(MBlockReport, sizeof(ReportDesc)); rep_ = new(mem) ReportDesc; rep_->typ = typ; ctx->report_mtx.Lock(); CommonSanitizerReportMutex.Lock(); } ScopedReport::~ScopedReport() { CommonSanitizerReportMutex.Unlock(); ctx->report_mtx.Unlock(); DestroyAndFree(rep_); } void ScopedReport::AddStack(StackTrace stack, bool suppressable) { ReportStack **rs = rep_->stacks.PushBack(); *rs = SymbolizeStack(stack); (*rs)->suppressable = suppressable; } void ScopedReport::AddMemoryAccess(uptr addr, Shadow s, StackTrace stack, const MutexSet *mset) { void *mem = internal_alloc(MBlockReportMop, sizeof(ReportMop)); ReportMop *mop = new(mem) ReportMop; rep_->mops.PushBack(mop); mop->tid = s.tid(); mop->addr = addr + s.addr0(); mop->size = s.size(); mop->write = s.IsWrite(); mop->atomic = s.IsAtomic(); mop->stack = SymbolizeStack(stack); if (mop->stack) mop->stack->suppressable = true; for (uptr i = 0; i < mset->Size(); i++) { MutexSet::Desc d = mset->Get(i); u64 mid = this->AddMutex(d.id); ReportMopMutex mtx = {mid, d.write}; mop->mset.PushBack(mtx); } } void ScopedReport::AddUniqueTid(int unique_tid) { rep_->unique_tids.PushBack(unique_tid); } void ScopedReport::AddThread(const ThreadContext *tctx, bool suppressable) { for (uptr i = 0; i < rep_->threads.Size(); i++) { if ((u32)rep_->threads[i]->id == tctx->tid) return; } void *mem = internal_alloc(MBlockReportThread, sizeof(ReportThread)); ReportThread *rt = new(mem) ReportThread; rep_->threads.PushBack(rt); rt->id = tctx->tid; rt->os_id = tctx->os_id; rt->running = (tctx->status == ThreadStatusRunning); rt->name = internal_strdup(tctx->name); rt->parent_tid = tctx->parent_tid; rt->stack = 0; rt->stack = SymbolizeStackId(tctx->creation_stack_id); if (rt->stack) rt->stack->suppressable = suppressable; } #if !SANITIZER_GO static bool FindThreadByUidLockedCallback(ThreadContextBase *tctx, void *arg) { int unique_id = *(int *)arg; return tctx->unique_id == (u32)unique_id; } static ThreadContext *FindThreadByUidLocked(int unique_id) { ctx->thread_registry->CheckLocked(); return static_cast( ctx->thread_registry->FindThreadContextLocked( FindThreadByUidLockedCallback, &unique_id)); } static ThreadContext *FindThreadByTidLocked(int tid) { ctx->thread_registry->CheckLocked(); return static_cast( ctx->thread_registry->GetThreadLocked(tid)); } static bool IsInStackOrTls(ThreadContextBase *tctx_base, void *arg) { uptr addr = (uptr)arg; ThreadContext *tctx = static_cast(tctx_base); if (tctx->status != ThreadStatusRunning) return false; ThreadState *thr = tctx->thr; CHECK(thr); return ((addr >= thr->stk_addr && addr < thr->stk_addr + thr->stk_size) || (addr >= thr->tls_addr && addr < thr->tls_addr + thr->tls_size)); } ThreadContext *IsThreadStackOrTls(uptr addr, bool *is_stack) { ctx->thread_registry->CheckLocked(); ThreadContext *tctx = static_cast( ctx->thread_registry->FindThreadContextLocked(IsInStackOrTls, (void*)addr)); if (!tctx) return 0; ThreadState *thr = tctx->thr; CHECK(thr); *is_stack = (addr >= thr->stk_addr && addr < thr->stk_addr + thr->stk_size); return tctx; } #endif void ScopedReport::AddThread(int unique_tid, bool suppressable) { #if !SANITIZER_GO if (const ThreadContext *tctx = FindThreadByUidLocked(unique_tid)) AddThread(tctx, suppressable); #endif } void ScopedReport::AddMutex(const SyncVar *s) { for (uptr i = 0; i < rep_->mutexes.Size(); i++) { if (rep_->mutexes[i]->id == s->uid) return; } void *mem = internal_alloc(MBlockReportMutex, sizeof(ReportMutex)); ReportMutex *rm = new(mem) ReportMutex; rep_->mutexes.PushBack(rm); rm->id = s->uid; rm->addr = s->addr; rm->destroyed = false; rm->stack = SymbolizeStackId(s->creation_stack_id); } u64 ScopedReport::AddMutex(u64 id) { u64 uid = 0; u64 mid = id; uptr addr = SyncVar::SplitId(id, &uid); SyncVar *s = ctx->metamap.GetIfExistsAndLock(addr, true); // Check that the mutex is still alive. // Another mutex can be created at the same address, // so check uid as well. if (s && s->CheckId(uid)) { mid = s->uid; AddMutex(s); } else { AddDeadMutex(id); } if (s) s->mtx.Unlock(); return mid; } void ScopedReport::AddDeadMutex(u64 id) { for (uptr i = 0; i < rep_->mutexes.Size(); i++) { if (rep_->mutexes[i]->id == id) return; } void *mem = internal_alloc(MBlockReportMutex, sizeof(ReportMutex)); ReportMutex *rm = new(mem) ReportMutex; rep_->mutexes.PushBack(rm); rm->id = id; rm->addr = 0; rm->destroyed = true; rm->stack = 0; } void ScopedReport::AddLocation(uptr addr, uptr size) { if (addr == 0) return; #if !SANITIZER_GO int fd = -1; int creat_tid = -1; u32 creat_stack = 0; if (FdLocation(addr, &fd, &creat_tid, &creat_stack)) { ReportLocation *loc = ReportLocation::New(ReportLocationFD); loc->fd = fd; loc->tid = creat_tid; loc->stack = SymbolizeStackId(creat_stack); rep_->locs.PushBack(loc); ThreadContext *tctx = FindThreadByUidLocked(creat_tid); if (tctx) AddThread(tctx); return; } MBlock *b = 0; Allocator *a = allocator(); if (a->PointerIsMine((void*)addr)) { void *block_begin = a->GetBlockBegin((void*)addr); if (block_begin) b = ctx->metamap.GetBlock((uptr)block_begin); } if (b != 0) { ThreadContext *tctx = FindThreadByTidLocked(b->tid); ReportLocation *loc = ReportLocation::New(ReportLocationHeap); loc->heap_chunk_start = (uptr)allocator()->GetBlockBegin((void *)addr); loc->heap_chunk_size = b->siz; loc->tid = tctx ? tctx->tid : b->tid; loc->stack = SymbolizeStackId(b->stk); rep_->locs.PushBack(loc); if (tctx) AddThread(tctx); return; } bool is_stack = false; if (ThreadContext *tctx = IsThreadStackOrTls(addr, &is_stack)) { ReportLocation *loc = ReportLocation::New(is_stack ? ReportLocationStack : ReportLocationTLS); loc->tid = tctx->tid; rep_->locs.PushBack(loc); AddThread(tctx); } #endif if (ReportLocation *loc = SymbolizeData(addr)) { loc->suppressable = true; rep_->locs.PushBack(loc); return; } } #if !SANITIZER_GO void ScopedReport::AddSleep(u32 stack_id) { rep_->sleep = SymbolizeStackId(stack_id); } #endif void ScopedReport::SetCount(int count) { rep_->count = count; } const ReportDesc *ScopedReport::GetReport() const { return rep_; } void RestoreStack(int tid, const u64 epoch, VarSizeStackTrace *stk, MutexSet *mset) { // This function restores stack trace and mutex set for the thread/epoch. // It does so by getting stack trace and mutex set at the beginning of // trace part, and then replaying the trace till the given epoch. Trace* trace = ThreadTrace(tid); ReadLock l(&trace->mtx); const int partidx = (epoch / kTracePartSize) % TraceParts(); TraceHeader* hdr = &trace->headers[partidx]; if (epoch < hdr->epoch0 || epoch >= hdr->epoch0 + kTracePartSize) return; CHECK_EQ(RoundDown(epoch, kTracePartSize), hdr->epoch0); const u64 epoch0 = RoundDown(epoch, TraceSize()); const u64 eend = epoch % TraceSize(); const u64 ebegin = RoundDown(eend, kTracePartSize); DPrintf("#%d: RestoreStack epoch=%zu ebegin=%zu eend=%zu partidx=%d\n", tid, (uptr)epoch, (uptr)ebegin, (uptr)eend, partidx); Vector stack(MBlockReportStack); stack.Resize(hdr->stack0.size + 64); for (uptr i = 0; i < hdr->stack0.size; i++) { stack[i] = hdr->stack0.trace[i]; DPrintf2(" #%02zu: pc=%zx\n", i, stack[i]); } if (mset) *mset = hdr->mset0; uptr pos = hdr->stack0.size; Event *events = (Event*)GetThreadTrace(tid); for (uptr i = ebegin; i <= eend; i++) { Event ev = events[i]; EventType typ = (EventType)(ev >> 61); uptr pc = (uptr)(ev & ((1ull << 61) - 1)); DPrintf2(" %zu typ=%d pc=%zx\n", i, typ, pc); if (typ == EventTypeMop) { stack[pos] = pc; } else if (typ == EventTypeFuncEnter) { if (stack.Size() < pos + 2) stack.Resize(pos + 2); stack[pos++] = pc; } else if (typ == EventTypeFuncExit) { if (pos > 0) pos--; } if (mset) { if (typ == EventTypeLock) { mset->Add(pc, true, epoch0 + i); } else if (typ == EventTypeUnlock) { mset->Del(pc, true); } else if (typ == EventTypeRLock) { mset->Add(pc, false, epoch0 + i); } else if (typ == EventTypeRUnlock) { mset->Del(pc, false); } } for (uptr j = 0; j <= pos; j++) DPrintf2(" #%zu: %zx\n", j, stack[j]); } if (pos == 0 && stack[0] == 0) return; pos++; stk->Init(&stack[0], pos); } static bool HandleRacyStacks(ThreadState *thr, VarSizeStackTrace traces[2], uptr addr_min, uptr addr_max) { bool equal_stack = false; RacyStacks hash; bool equal_address = false; RacyAddress ra0 = {addr_min, addr_max}; { ReadLock lock(&ctx->racy_mtx); if (flags()->suppress_equal_stacks) { hash.hash[0] = md5_hash(traces[0].trace, traces[0].size * sizeof(uptr)); hash.hash[1] = md5_hash(traces[1].trace, traces[1].size * sizeof(uptr)); for (uptr i = 0; i < ctx->racy_stacks.Size(); i++) { if (hash == ctx->racy_stacks[i]) { VPrintf(2, "ThreadSanitizer: suppressing report as doubled (stack)\n"); equal_stack = true; break; } } } if (flags()->suppress_equal_addresses) { for (uptr i = 0; i < ctx->racy_addresses.Size(); i++) { RacyAddress ra2 = ctx->racy_addresses[i]; uptr maxbeg = max(ra0.addr_min, ra2.addr_min); uptr minend = min(ra0.addr_max, ra2.addr_max); if (maxbeg < minend) { VPrintf(2, "ThreadSanitizer: suppressing report as doubled (addr)\n"); equal_address = true; break; } } } } if (!equal_stack && !equal_address) return false; if (!equal_stack) { Lock lock(&ctx->racy_mtx); ctx->racy_stacks.PushBack(hash); } if (!equal_address) { Lock lock(&ctx->racy_mtx); ctx->racy_addresses.PushBack(ra0); } return true; } static void AddRacyStacks(ThreadState *thr, VarSizeStackTrace traces[2], uptr addr_min, uptr addr_max) { Lock lock(&ctx->racy_mtx); if (flags()->suppress_equal_stacks) { RacyStacks hash; hash.hash[0] = md5_hash(traces[0].trace, traces[0].size * sizeof(uptr)); hash.hash[1] = md5_hash(traces[1].trace, traces[1].size * sizeof(uptr)); ctx->racy_stacks.PushBack(hash); } if (flags()->suppress_equal_addresses) { RacyAddress ra0 = {addr_min, addr_max}; ctx->racy_addresses.PushBack(ra0); } } bool OutputReport(ThreadState *thr, const ScopedReport &srep) { if (!flags()->report_bugs) return false; atomic_store_relaxed(&ctx->last_symbolize_time_ns, NanoTime()); const ReportDesc *rep = srep.GetReport(); CHECK_EQ(thr->current_report, nullptr); thr->current_report = rep; Suppression *supp = 0; uptr pc_or_addr = 0; for (uptr i = 0; pc_or_addr == 0 && i < rep->mops.Size(); i++) pc_or_addr = IsSuppressed(rep->typ, rep->mops[i]->stack, &supp); for (uptr i = 0; pc_or_addr == 0 && i < rep->stacks.Size(); i++) pc_or_addr = IsSuppressed(rep->typ, rep->stacks[i], &supp); for (uptr i = 0; pc_or_addr == 0 && i < rep->threads.Size(); i++) pc_or_addr = IsSuppressed(rep->typ, rep->threads[i]->stack, &supp); for (uptr i = 0; pc_or_addr == 0 && i < rep->locs.Size(); i++) pc_or_addr = IsSuppressed(rep->typ, rep->locs[i], &supp); if (pc_or_addr != 0) { Lock lock(&ctx->fired_suppressions_mtx); FiredSuppression s = {srep.GetReport()->typ, pc_or_addr, supp}; ctx->fired_suppressions.push_back(s); } { bool old_is_freeing = thr->is_freeing; thr->is_freeing = false; bool suppressed = OnReport(rep, pc_or_addr != 0); thr->is_freeing = old_is_freeing; if (suppressed) { thr->current_report = nullptr; return false; } } PrintReport(rep); __tsan_on_report(rep); ctx->nreported++; if (flags()->halt_on_error) Die(); thr->current_report = nullptr; return true; } bool IsFiredSuppression(Context *ctx, ReportType type, StackTrace trace) { ReadLock lock(&ctx->fired_suppressions_mtx); for (uptr k = 0; k < ctx->fired_suppressions.size(); k++) { if (ctx->fired_suppressions[k].type != type) continue; for (uptr j = 0; j < trace.size; j++) { FiredSuppression *s = &ctx->fired_suppressions[k]; if (trace.trace[j] == s->pc_or_addr) { if (s->supp) atomic_fetch_add(&s->supp->hit_count, 1, memory_order_relaxed); return true; } } } return false; } static bool IsFiredSuppression(Context *ctx, ReportType type, uptr addr) { ReadLock lock(&ctx->fired_suppressions_mtx); for (uptr k = 0; k < ctx->fired_suppressions.size(); k++) { if (ctx->fired_suppressions[k].type != type) continue; FiredSuppression *s = &ctx->fired_suppressions[k]; if (addr == s->pc_or_addr) { if (s->supp) atomic_fetch_add(&s->supp->hit_count, 1, memory_order_relaxed); return true; } } return false; } static bool RaceBetweenAtomicAndFree(ThreadState *thr) { Shadow s0(thr->racy_state[0]); Shadow s1(thr->racy_state[1]); CHECK(!(s0.IsAtomic() && s1.IsAtomic())); if (!s0.IsAtomic() && !s1.IsAtomic()) return true; if (s0.IsAtomic() && s1.IsFreed()) return true; if (s1.IsAtomic() && thr->is_freeing) return true; return false; } void ReportRace(ThreadState *thr) { CheckNoLocks(thr); // Symbolizer makes lots of intercepted calls. If we try to process them, // at best it will cause deadlocks on internal mutexes. ScopedIgnoreInterceptors ignore; if (!flags()->report_bugs) return; if (!flags()->report_atomic_races && !RaceBetweenAtomicAndFree(thr)) return; bool freed = false; { Shadow s(thr->racy_state[1]); freed = s.GetFreedAndReset(); thr->racy_state[1] = s.raw(); } uptr addr = ShadowToMem((uptr)thr->racy_shadow_addr); uptr addr_min = 0; uptr addr_max = 0; { uptr a0 = addr + Shadow(thr->racy_state[0]).addr0(); uptr a1 = addr + Shadow(thr->racy_state[1]).addr0(); uptr e0 = a0 + Shadow(thr->racy_state[0]).size(); uptr e1 = a1 + Shadow(thr->racy_state[1]).size(); addr_min = min(a0, a1); addr_max = max(e0, e1); if (IsExpectedReport(addr_min, addr_max - addr_min)) return; } ReportType typ = ReportTypeRace; if (thr->is_vptr_access && freed) typ = ReportTypeVptrUseAfterFree; else if (thr->is_vptr_access) typ = ReportTypeVptrRace; else if (freed) typ = ReportTypeUseAfterFree; if (IsFiredSuppression(ctx, typ, addr)) return; const uptr kMop = 2; VarSizeStackTrace traces[kMop]; const uptr toppc = TraceTopPC(thr); ObtainCurrentStack(thr, toppc, &traces[0]); if (IsFiredSuppression(ctx, typ, traces[0])) return; // MutexSet is too large to live on stack. Vector mset_buffer(MBlockScopedBuf); mset_buffer.Resize(sizeof(MutexSet) / sizeof(u64) + 1); MutexSet *mset2 = new(&mset_buffer[0]) MutexSet(); Shadow s2(thr->racy_state[1]); RestoreStack(s2.tid(), s2.epoch(), &traces[1], mset2); if (IsFiredSuppression(ctx, typ, traces[1])) return; if (HandleRacyStacks(thr, traces, addr_min, addr_max)) return; ThreadRegistryLock l0(ctx->thread_registry); ScopedReport rep(typ); for (uptr i = 0; i < kMop; i++) { Shadow s(thr->racy_state[i]); rep.AddMemoryAccess(addr, s, traces[i], i == 0 ? &thr->mset : mset2); } for (uptr i = 0; i < kMop; i++) { FastState s(thr->racy_state[i]); ThreadContext *tctx = static_cast( ctx->thread_registry->GetThreadLocked(s.tid())); if (s.epoch() < tctx->epoch0 || s.epoch() > tctx->epoch1) continue; rep.AddThread(tctx); } rep.AddLocation(addr_min, addr_max - addr_min); #if !SANITIZER_GO { // NOLINT Shadow s(thr->racy_state[1]); if (s.epoch() <= thr->last_sleep_clock.get(s.tid())) rep.AddSleep(thr->last_sleep_stack_id); } #endif if (!OutputReport(thr, rep)) return; AddRacyStacks(thr, traces, addr_min, addr_max); } void PrintCurrentStack(ThreadState *thr, uptr pc) { VarSizeStackTrace trace; ObtainCurrentStack(thr, pc, &trace); PrintStack(SymbolizeStack(trace)); } // Always inlining PrintCurrentStackSlow, because LocatePcInTrace assumes // __sanitizer_print_stack_trace exists in the actual unwinded stack, but // tail-call to PrintCurrentStackSlow breaks this assumption because // __sanitizer_print_stack_trace disappears after tail-call. // However, this solution is not reliable enough, please see dvyukov's comment // http://reviews.llvm.org/D19148#406208 // Also see PR27280 comment 2 and 3 for breaking examples and analysis. ALWAYS_INLINE void PrintCurrentStackSlow(uptr pc) { #if !SANITIZER_GO BufferedStackTrace *ptrace = new(internal_alloc(MBlockStackTrace, sizeof(BufferedStackTrace))) BufferedStackTrace(); ptrace->Unwind(kStackTraceMax, pc, 0, 0, 0, 0, false); for (uptr i = 0; i < ptrace->size / 2; i++) { uptr tmp = ptrace->trace_buffer[i]; ptrace->trace_buffer[i] = ptrace->trace_buffer[ptrace->size - i - 1]; ptrace->trace_buffer[ptrace->size - i - 1] = tmp; } PrintStack(SymbolizeStack(*ptrace)); #endif } } // namespace __tsan using namespace __tsan; extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_print_stack_trace() { PrintCurrentStackSlow(StackTrace::GetCurrentPc()); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_flags.inc0000664000175000017500000001007413004730632026331 0ustar mwhudsonmwhudson//===-- tsan_flags.inc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // TSan runtime flags. // //===----------------------------------------------------------------------===// #ifndef TSAN_FLAG # error "Define TSAN_FLAG prior to including this file!" #endif // TSAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. TSAN_FLAG(bool, enable_annotations, true, "Enable dynamic annotations, otherwise they are no-ops.") // Suppress a race report if we've already output another race report // with the same stack. TSAN_FLAG(bool, suppress_equal_stacks, true, "Suppress a race report if we've already output another race report " "with the same stack.") TSAN_FLAG(bool, suppress_equal_addresses, true, "Suppress a race report if we've already output another race report " "on the same address.") TSAN_FLAG(bool, report_bugs, true, "Turns off bug reporting entirely (useful for benchmarking).") TSAN_FLAG(bool, report_thread_leaks, true, "Report thread leaks at exit?") TSAN_FLAG(bool, report_destroy_locked, true, "Report destruction of a locked mutex?") TSAN_FLAG(bool, report_mutex_bugs, true, "Report incorrect usages of mutexes and mutex annotations?") TSAN_FLAG(bool, report_signal_unsafe, true, "Report violations of async signal-safety " "(e.g. malloc() call from a signal handler).") TSAN_FLAG(bool, report_atomic_races, true, "Report races between atomic and plain memory accesses.") TSAN_FLAG( bool, force_seq_cst_atomics, false, "If set, all atomics are effectively sequentially consistent (seq_cst), " "regardless of what user actually specified.") TSAN_FLAG(bool, print_benign, false, "Print matched \"benign\" races at exit.") TSAN_FLAG(bool, halt_on_error, false, "Exit after first reported error.") TSAN_FLAG(int, atexit_sleep_ms, 1000, "Sleep in main thread before exiting for that many ms " "(useful to catch \"at exit\" races).") TSAN_FLAG(const char *, profile_memory, "", "If set, periodically write memory profile to that file.") TSAN_FLAG(int, flush_memory_ms, 0, "Flush shadow memory every X ms.") TSAN_FLAG(int, flush_symbolizer_ms, 5000, "Flush symbolizer caches every X ms.") TSAN_FLAG( int, memory_limit_mb, 0, "Resident memory limit in MB to aim at." "If the process consumes more memory, then TSan will flush shadow memory.") TSAN_FLAG(bool, stop_on_start, false, "Stops on start until __tsan_resume() is called (for debugging).") TSAN_FLAG(bool, running_on_valgrind, false, "Controls whether RunningOnValgrind() returns true or false.") // There are a lot of goroutines in Go, so we use smaller history. TSAN_FLAG( int, history_size, SANITIZER_GO ? 1 : 3, "Per-thread history size, controls how many previous memory accesses " "are remembered per thread. Possible values are [0..7]. " "history_size=0 amounts to 32K memory accesses. Each next value doubles " "the amount of memory accesses, up to history_size=7 that amounts to " "4M memory accesses. The default value is 2 (128K memory accesses).") TSAN_FLAG(int, io_sync, 1, "Controls level of synchronization implied by IO operations. " "0 - no synchronization " "1 - reasonable level of synchronization (write->read)" "2 - global synchronization of all IO operations.") TSAN_FLAG(bool, die_after_fork, true, "Die after multi-threaded fork if the child creates new threads.") TSAN_FLAG(const char *, suppressions, "", "Suppressions file name.") TSAN_FLAG(bool, ignore_interceptors_accesses, false, "Ignore reads and writes from all interceptors.") TSAN_FLAG(bool, shared_ptr_interceptor, true, "Track atomic reference counting in libc++ shared_ptr and weak_ptr.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_platform_mac.cc0000664000175000017500000001520313004730632027514 0ustar mwhudsonmwhudson//===-- tsan_platform_mac.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // // Mac-specific code. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_posix.h" #include "sanitizer_common/sanitizer_procmaps.h" #include "tsan_platform.h" #include "tsan_rtl.h" #include "tsan_flags.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace __tsan { #if !SANITIZER_GO static void *SignalSafeGetOrAllocate(uptr *dst, uptr size) { atomic_uintptr_t *a = (atomic_uintptr_t *)dst; void *val = (void *)atomic_load_relaxed(a); atomic_signal_fence(memory_order_acquire); // Turns the previous load into // acquire wrt signals. if (UNLIKELY(val == nullptr)) { val = (void *)internal_mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); CHECK(val); void *cmp = nullptr; if (!atomic_compare_exchange_strong(a, (uintptr_t *)&cmp, (uintptr_t)val, memory_order_acq_rel)) { internal_munmap(val, size); val = cmp; } } return val; } // On OS X, accessing TLVs via __thread or manually by using pthread_key_* is // problematic, because there are several places where interceptors are called // when TLVs are not accessible (early process startup, thread cleanup, ...). // The following provides a "poor man's TLV" implementation, where we use the // shadow memory of the pointer returned by pthread_self() to store a pointer to // the ThreadState object. The main thread's ThreadState is stored separately // in a static variable, because we need to access it even before the // shadow memory is set up. static uptr main_thread_identity = 0; ALIGNED(64) static char main_thread_state[sizeof(ThreadState)]; ThreadState *cur_thread() { uptr thread_identity = (uptr)pthread_self(); if (thread_identity == main_thread_identity || main_thread_identity == 0) { return (ThreadState *)&main_thread_state; } ThreadState **fake_tls = (ThreadState **)MemToShadow(thread_identity); ThreadState *thr = (ThreadState *)SignalSafeGetOrAllocate( (uptr *)fake_tls, sizeof(ThreadState)); return thr; } // TODO(kuba.brecka): This is not async-signal-safe. In particular, we call // munmap first and then clear `fake_tls`; if we receive a signal in between, // handler will try to access the unmapped ThreadState. void cur_thread_finalize() { uptr thread_identity = (uptr)pthread_self(); if (thread_identity == main_thread_identity) { // Calling dispatch_main() or xpc_main() actually invokes pthread_exit to // exit the main thread. Let's keep the main thread's ThreadState. return; } ThreadState **fake_tls = (ThreadState **)MemToShadow(thread_identity); internal_munmap(*fake_tls, sizeof(ThreadState)); *fake_tls = nullptr; } #endif uptr GetShadowMemoryConsumption() { return 0; } void FlushShadowMemory() { } void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive) { } #if !SANITIZER_GO void InitializeShadowMemoryPlatform() { } // On OS X, GCD worker threads are created without a call to pthread_create. We // need to properly register these threads with ThreadCreate and ThreadStart. // These threads don't have a parent thread, as they are created "spuriously". // We're using a libpthread API that notifies us about a newly created thread. // The `thread == pthread_self()` check indicates this is actually a worker // thread. If it's just a regular thread, this hook is called on the parent // thread. typedef void (*pthread_introspection_hook_t)(unsigned int event, pthread_t thread, void *addr, size_t size); extern "C" pthread_introspection_hook_t pthread_introspection_hook_install( pthread_introspection_hook_t hook); static const uptr PTHREAD_INTROSPECTION_THREAD_CREATE = 1; static const uptr PTHREAD_INTROSPECTION_THREAD_TERMINATE = 3; static pthread_introspection_hook_t prev_pthread_introspection_hook; static void my_pthread_introspection_hook(unsigned int event, pthread_t thread, void *addr, size_t size) { if (event == PTHREAD_INTROSPECTION_THREAD_CREATE) { if (thread == pthread_self()) { // The current thread is a newly created GCD worker thread. ThreadState *thr = cur_thread(); Processor *proc = ProcCreate(); ProcWire(proc, thr); ThreadState *parent_thread_state = nullptr; // No parent. int tid = ThreadCreate(parent_thread_state, 0, (uptr)thread, true); CHECK_NE(tid, 0); ThreadStart(thr, tid, GetTid()); } } else if (event == PTHREAD_INTROSPECTION_THREAD_TERMINATE) { if (thread == pthread_self()) { ThreadState *thr = cur_thread(); if (thr->tctx) { DestroyThreadState(); } } } if (prev_pthread_introspection_hook != nullptr) prev_pthread_introspection_hook(event, thread, addr, size); } #endif void InitializePlatformEarly() { } void InitializePlatform() { DisableCoreDumperIfNecessary(); #if !SANITIZER_GO CheckAndProtect(); CHECK_EQ(main_thread_identity, 0); main_thread_identity = (uptr)pthread_self(); prev_pthread_introspection_hook = pthread_introspection_hook_install(&my_pthread_introspection_hook); #endif } #if !SANITIZER_GO // Note: this function runs with async signals enabled, // so it must not touch any tsan state. int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, void *abstime), void *c, void *m, void *abstime, void(*cleanup)(void *arg), void *arg) { // pthread_cleanup_push/pop are hardcore macros mess. // We can't intercept nor call them w/o including pthread.h. int res; pthread_cleanup_push(cleanup, arg); res = fn(c, m, abstime); pthread_cleanup_pop(0); return res; } #endif } // namespace __tsan #endif // SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan.syms.extra0000664000175000017500000000032112517560142026520 0ustar mwhudsonmwhudson__tsan_init __tsan_read* __tsan_write* __tsan_vptr* __tsan_func* __tsan_atomic* __tsan_java* __tsan_unaligned* __tsan_release __tsan_acquire __ubsan_* Annotate* WTFAnnotate* RunningOnValgrind ValgrindSlowdown golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_clock.cc0000664000175000017500000003315413004730632026150 0ustar mwhudsonmwhudson//===-- tsan_clock.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_clock.h" #include "tsan_rtl.h" #include "sanitizer_common/sanitizer_placement_new.h" // SyncClock and ThreadClock implement vector clocks for sync variables // (mutexes, atomic variables, file descriptors, etc) and threads, respectively. // ThreadClock contains fixed-size vector clock for maximum number of threads. // SyncClock contains growable vector clock for currently necessary number of // threads. // Together they implement very simple model of operations, namely: // // void ThreadClock::acquire(const SyncClock *src) { // for (int i = 0; i < kMaxThreads; i++) // clock[i] = max(clock[i], src->clock[i]); // } // // void ThreadClock::release(SyncClock *dst) const { // for (int i = 0; i < kMaxThreads; i++) // dst->clock[i] = max(dst->clock[i], clock[i]); // } // // void ThreadClock::ReleaseStore(SyncClock *dst) const { // for (int i = 0; i < kMaxThreads; i++) // dst->clock[i] = clock[i]; // } // // void ThreadClock::acq_rel(SyncClock *dst) { // acquire(dst); // release(dst); // } // // Conformance to this model is extensively verified in tsan_clock_test.cc. // However, the implementation is significantly more complex. The complexity // allows to implement important classes of use cases in O(1) instead of O(N). // // The use cases are: // 1. Singleton/once atomic that has a single release-store operation followed // by zillions of acquire-loads (the acquire-load is O(1)). // 2. Thread-local mutex (both lock and unlock can be O(1)). // 3. Leaf mutex (unlock is O(1)). // 4. A mutex shared by 2 threads (both lock and unlock can be O(1)). // 5. An atomic with a single writer (writes can be O(1)). // The implementation dynamically adopts to workload. So if an atomic is in // read-only phase, these reads will be O(1); if it later switches to read/write // phase, the implementation will correctly handle that by switching to O(N). // // Thread-safety note: all const operations on SyncClock's are conducted under // a shared lock; all non-const operations on SyncClock's are conducted under // an exclusive lock; ThreadClock's are private to respective threads and so // do not need any protection. // // Description of ThreadClock state: // clk_ - fixed size vector clock. // nclk_ - effective size of the vector clock (the rest is zeros). // tid_ - index of the thread associated with he clock ("current thread"). // last_acquire_ - current thread time when it acquired something from // other threads. // // Description of SyncClock state: // clk_ - variable size vector clock, low kClkBits hold timestamp, // the remaining bits hold "acquired" flag (the actual value is thread's // reused counter); // if acquried == thr->reused_, then the respective thread has already // acquired this clock (except possibly dirty_tids_). // dirty_tids_ - holds up to two indeces in the vector clock that other threads // need to acquire regardless of "acquired" flag value; // release_store_tid_ - denotes that the clock state is a result of // release-store operation by the thread with release_store_tid_ index. // release_store_reused_ - reuse count of release_store_tid_. // We don't have ThreadState in these methods, so this is an ugly hack that // works only in C++. #if !SANITIZER_GO # define CPP_STAT_INC(typ) StatInc(cur_thread(), typ) #else # define CPP_STAT_INC(typ) (void)0 #endif namespace __tsan { ThreadClock::ThreadClock(unsigned tid, unsigned reused) : tid_(tid) , reused_(reused + 1) { // 0 has special meaning CHECK_LT(tid, kMaxTidInClock); CHECK_EQ(reused_, ((u64)reused_ << kClkBits) >> kClkBits); nclk_ = tid_ + 1; last_acquire_ = 0; internal_memset(clk_, 0, sizeof(clk_)); clk_[tid_].reused = reused_; } void ThreadClock::acquire(ClockCache *c, const SyncClock *src) { DCHECK_LE(nclk_, kMaxTid); DCHECK_LE(src->size_, kMaxTid); CPP_STAT_INC(StatClockAcquire); // Check if it's empty -> no need to do anything. const uptr nclk = src->size_; if (nclk == 0) { CPP_STAT_INC(StatClockAcquireEmpty); return; } // Check if we've already acquired src after the last release operation on src bool acquired = false; if (nclk > tid_) { CPP_STAT_INC(StatClockAcquireLarge); if (src->elem(tid_).reused == reused_) { CPP_STAT_INC(StatClockAcquireRepeat); for (unsigned i = 0; i < kDirtyTids; i++) { unsigned tid = src->dirty_tids_[i]; if (tid != kInvalidTid) { u64 epoch = src->elem(tid).epoch; if (clk_[tid].epoch < epoch) { clk_[tid].epoch = epoch; acquired = true; } } } if (acquired) { CPP_STAT_INC(StatClockAcquiredSomething); last_acquire_ = clk_[tid_].epoch; } return; } } // O(N) acquire. CPP_STAT_INC(StatClockAcquireFull); nclk_ = max(nclk_, nclk); for (uptr i = 0; i < nclk; i++) { u64 epoch = src->elem(i).epoch; if (clk_[i].epoch < epoch) { clk_[i].epoch = epoch; acquired = true; } } // Remember that this thread has acquired this clock. if (nclk > tid_) src->elem(tid_).reused = reused_; if (acquired) { CPP_STAT_INC(StatClockAcquiredSomething); last_acquire_ = clk_[tid_].epoch; } } void ThreadClock::release(ClockCache *c, SyncClock *dst) const { DCHECK_LE(nclk_, kMaxTid); DCHECK_LE(dst->size_, kMaxTid); if (dst->size_ == 0) { // ReleaseStore will correctly set release_store_tid_, // which can be important for future operations. ReleaseStore(c, dst); return; } CPP_STAT_INC(StatClockRelease); // Check if we need to resize dst. if (dst->size_ < nclk_) dst->Resize(c, nclk_); // Check if we had not acquired anything from other threads // since the last release on dst. If so, we need to update // only dst->elem(tid_). if (dst->elem(tid_).epoch > last_acquire_) { UpdateCurrentThread(dst); if (dst->release_store_tid_ != tid_ || dst->release_store_reused_ != reused_) dst->release_store_tid_ = kInvalidTid; return; } // O(N) release. CPP_STAT_INC(StatClockReleaseFull); // First, remember whether we've acquired dst. bool acquired = IsAlreadyAcquired(dst); if (acquired) CPP_STAT_INC(StatClockReleaseAcquired); // Update dst->clk_. for (uptr i = 0; i < nclk_; i++) { ClockElem &ce = dst->elem(i); ce.epoch = max(ce.epoch, clk_[i].epoch); ce.reused = 0; } // Clear 'acquired' flag in the remaining elements. if (nclk_ < dst->size_) CPP_STAT_INC(StatClockReleaseClearTail); for (uptr i = nclk_; i < dst->size_; i++) dst->elem(i).reused = 0; for (unsigned i = 0; i < kDirtyTids; i++) dst->dirty_tids_[i] = kInvalidTid; dst->release_store_tid_ = kInvalidTid; dst->release_store_reused_ = 0; // If we've acquired dst, remember this fact, // so that we don't need to acquire it on next acquire. if (acquired) dst->elem(tid_).reused = reused_; } void ThreadClock::ReleaseStore(ClockCache *c, SyncClock *dst) const { DCHECK_LE(nclk_, kMaxTid); DCHECK_LE(dst->size_, kMaxTid); CPP_STAT_INC(StatClockStore); // Check if we need to resize dst. if (dst->size_ < nclk_) dst->Resize(c, nclk_); if (dst->release_store_tid_ == tid_ && dst->release_store_reused_ == reused_ && dst->elem(tid_).epoch > last_acquire_) { CPP_STAT_INC(StatClockStoreFast); UpdateCurrentThread(dst); return; } // O(N) release-store. CPP_STAT_INC(StatClockStoreFull); for (uptr i = 0; i < nclk_; i++) { ClockElem &ce = dst->elem(i); ce.epoch = clk_[i].epoch; ce.reused = 0; } // Clear the tail of dst->clk_. if (nclk_ < dst->size_) { for (uptr i = nclk_; i < dst->size_; i++) { ClockElem &ce = dst->elem(i); ce.epoch = 0; ce.reused = 0; } CPP_STAT_INC(StatClockStoreTail); } for (unsigned i = 0; i < kDirtyTids; i++) dst->dirty_tids_[i] = kInvalidTid; dst->release_store_tid_ = tid_; dst->release_store_reused_ = reused_; // Rememeber that we don't need to acquire it in future. dst->elem(tid_).reused = reused_; } void ThreadClock::acq_rel(ClockCache *c, SyncClock *dst) { CPP_STAT_INC(StatClockAcquireRelease); acquire(c, dst); ReleaseStore(c, dst); } // Updates only single element related to the current thread in dst->clk_. void ThreadClock::UpdateCurrentThread(SyncClock *dst) const { // Update the threads time, but preserve 'acquired' flag. dst->elem(tid_).epoch = clk_[tid_].epoch; for (unsigned i = 0; i < kDirtyTids; i++) { if (dst->dirty_tids_[i] == tid_) { CPP_STAT_INC(StatClockReleaseFast1); return; } if (dst->dirty_tids_[i] == kInvalidTid) { CPP_STAT_INC(StatClockReleaseFast2); dst->dirty_tids_[i] = tid_; return; } } // Reset all 'acquired' flags, O(N). CPP_STAT_INC(StatClockReleaseSlow); for (uptr i = 0; i < dst->size_; i++) dst->elem(i).reused = 0; for (unsigned i = 0; i < kDirtyTids; i++) dst->dirty_tids_[i] = kInvalidTid; } // Checks whether the current threads has already acquired src. bool ThreadClock::IsAlreadyAcquired(const SyncClock *src) const { if (src->elem(tid_).reused != reused_) return false; for (unsigned i = 0; i < kDirtyTids; i++) { unsigned tid = src->dirty_tids_[i]; if (tid != kInvalidTid) { if (clk_[tid].epoch < src->elem(tid).epoch) return false; } } return true; } void SyncClock::Resize(ClockCache *c, uptr nclk) { CPP_STAT_INC(StatClockReleaseResize); if (RoundUpTo(nclk, ClockBlock::kClockCount) <= RoundUpTo(size_, ClockBlock::kClockCount)) { // Growing within the same block. // Memory is already allocated, just increase the size. size_ = nclk; return; } if (nclk <= ClockBlock::kClockCount) { // Grow from 0 to one-level table. CHECK_EQ(size_, 0); CHECK_EQ(tab_, 0); CHECK_EQ(tab_idx_, 0); size_ = nclk; tab_idx_ = ctx->clock_alloc.Alloc(c); tab_ = ctx->clock_alloc.Map(tab_idx_); internal_memset(tab_, 0, sizeof(*tab_)); return; } // Growing two-level table. if (size_ == 0) { // Allocate first level table. tab_idx_ = ctx->clock_alloc.Alloc(c); tab_ = ctx->clock_alloc.Map(tab_idx_); internal_memset(tab_, 0, sizeof(*tab_)); } else if (size_ <= ClockBlock::kClockCount) { // Transform one-level table to two-level table. u32 old = tab_idx_; tab_idx_ = ctx->clock_alloc.Alloc(c); tab_ = ctx->clock_alloc.Map(tab_idx_); internal_memset(tab_, 0, sizeof(*tab_)); tab_->table[0] = old; } // At this point we have first level table allocated. // Add second level tables as necessary. for (uptr i = RoundUpTo(size_, ClockBlock::kClockCount); i < nclk; i += ClockBlock::kClockCount) { u32 idx = ctx->clock_alloc.Alloc(c); ClockBlock *cb = ctx->clock_alloc.Map(idx); internal_memset(cb, 0, sizeof(*cb)); CHECK_EQ(tab_->table[i/ClockBlock::kClockCount], 0); tab_->table[i/ClockBlock::kClockCount] = idx; } size_ = nclk; } // Sets a single element in the vector clock. // This function is called only from weird places like AcquireGlobal. void ThreadClock::set(unsigned tid, u64 v) { DCHECK_LT(tid, kMaxTid); DCHECK_GE(v, clk_[tid].epoch); clk_[tid].epoch = v; if (nclk_ <= tid) nclk_ = tid + 1; last_acquire_ = clk_[tid_].epoch; } void ThreadClock::DebugDump(int(*printf)(const char *s, ...)) { printf("clock=["); for (uptr i = 0; i < nclk_; i++) printf("%s%llu", i == 0 ? "" : ",", clk_[i].epoch); printf("] reused=["); for (uptr i = 0; i < nclk_; i++) printf("%s%llu", i == 0 ? "" : ",", clk_[i].reused); printf("] tid=%u/%u last_acq=%llu", tid_, reused_, last_acquire_); } SyncClock::SyncClock() : release_store_tid_(kInvalidTid) , release_store_reused_() , tab_() , tab_idx_() , size_() { for (uptr i = 0; i < kDirtyTids; i++) dirty_tids_[i] = kInvalidTid; } SyncClock::~SyncClock() { // Reset must be called before dtor. CHECK_EQ(size_, 0); CHECK_EQ(tab_, 0); CHECK_EQ(tab_idx_, 0); } void SyncClock::Reset(ClockCache *c) { if (size_ == 0) { // nothing } else if (size_ <= ClockBlock::kClockCount) { // One-level table. ctx->clock_alloc.Free(c, tab_idx_); } else { // Two-level table. for (uptr i = 0; i < size_; i += ClockBlock::kClockCount) ctx->clock_alloc.Free(c, tab_->table[i / ClockBlock::kClockCount]); ctx->clock_alloc.Free(c, tab_idx_); } tab_ = 0; tab_idx_ = 0; size_ = 0; release_store_tid_ = kInvalidTid; release_store_reused_ = 0; for (uptr i = 0; i < kDirtyTids; i++) dirty_tids_[i] = kInvalidTid; } ClockElem &SyncClock::elem(unsigned tid) const { DCHECK_LT(tid, size_); if (size_ <= ClockBlock::kClockCount) return tab_->clock[tid]; u32 idx = tab_->table[tid / ClockBlock::kClockCount]; ClockBlock *cb = ctx->clock_alloc.Map(idx); return cb->clock[tid % ClockBlock::kClockCount]; } void SyncClock::DebugDump(int(*printf)(const char *s, ...)) { printf("clock=["); for (uptr i = 0; i < size_; i++) printf("%s%llu", i == 0 ? "" : ",", elem(i).epoch); printf("] reused=["); for (uptr i = 0; i < size_; i++) printf("%s%llu", i == 0 ? "" : ",", elem(i).reused); printf("] release_store_tid=%d/%d dirty_tids=%d/%d", release_store_tid_, release_store_reused_, dirty_tids_[0], dirty_tids_[1]); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_sync.cc0000664000175000017500000002053513004730632026030 0ustar mwhudsonmwhudson//===-- tsan_sync.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_placement_new.h" #include "tsan_sync.h" #include "tsan_rtl.h" #include "tsan_mman.h" namespace __tsan { void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s); SyncVar::SyncVar() : mtx(MutexTypeSyncVar, StatMtxSyncVar) { Reset(0); } void SyncVar::Init(ThreadState *thr, uptr pc, uptr addr, u64 uid) { this->addr = addr; this->uid = uid; this->next = 0; creation_stack_id = 0; if (!SANITIZER_GO) // Go does not use them creation_stack_id = CurrentStackId(thr, pc); if (common_flags()->detect_deadlocks) DDMutexInit(thr, pc, this); } void SyncVar::Reset(Processor *proc) { uid = 0; creation_stack_id = 0; owner_tid = kInvalidTid; last_lock = 0; recursion = 0; is_rw = 0; is_recursive = 0; is_broken = 0; is_linker_init = 0; if (proc == 0) { CHECK_EQ(clock.size(), 0); CHECK_EQ(read_clock.size(), 0); } else { clock.Reset(&proc->clock_cache); read_clock.Reset(&proc->clock_cache); } } MetaMap::MetaMap() { atomic_store(&uid_gen_, 0, memory_order_relaxed); } void MetaMap::AllocBlock(ThreadState *thr, uptr pc, uptr p, uptr sz) { u32 idx = block_alloc_.Alloc(&thr->proc()->block_cache); MBlock *b = block_alloc_.Map(idx); b->siz = sz; b->tid = thr->tid; b->stk = CurrentStackId(thr, pc); u32 *meta = MemToMeta(p); DCHECK_EQ(*meta, 0); *meta = idx | kFlagBlock; } uptr MetaMap::FreeBlock(Processor *proc, uptr p) { MBlock* b = GetBlock(p); if (b == 0) return 0; uptr sz = RoundUpTo(b->siz, kMetaShadowCell); FreeRange(proc, p, sz); return sz; } bool MetaMap::FreeRange(Processor *proc, uptr p, uptr sz) { bool has_something = false; u32 *meta = MemToMeta(p); u32 *end = MemToMeta(p + sz); if (end == meta) end++; for (; meta < end; meta++) { u32 idx = *meta; if (idx == 0) { // Note: don't write to meta in this case -- the block can be huge. continue; } *meta = 0; has_something = true; while (idx != 0) { if (idx & kFlagBlock) { block_alloc_.Free(&proc->block_cache, idx & ~kFlagMask); break; } else if (idx & kFlagSync) { DCHECK(idx & kFlagSync); SyncVar *s = sync_alloc_.Map(idx & ~kFlagMask); u32 next = s->next; s->Reset(proc); sync_alloc_.Free(&proc->sync_cache, idx & ~kFlagMask); idx = next; } else { CHECK(0); } } } return has_something; } // ResetRange removes all meta objects from the range. // It is called for large mmap-ed regions. The function is best-effort wrt // freeing of meta objects, because we don't want to page in the whole range // which can be huge. The function probes pages one-by-one until it finds a page // without meta objects, at this point it stops freeing meta objects. Because // thread stacks grow top-down, we do the same starting from end as well. void MetaMap::ResetRange(Processor *proc, uptr p, uptr sz) { if (SANITIZER_GO) { // UnmapOrDie/MmapFixedNoReserve does not work on Windows, // so we do the optimization only for C/C++. FreeRange(proc, p, sz); return; } const uptr kMetaRatio = kMetaShadowCell / kMetaShadowSize; const uptr kPageSize = GetPageSizeCached() * kMetaRatio; if (sz <= 4 * kPageSize) { // If the range is small, just do the normal free procedure. FreeRange(proc, p, sz); return; } // First, round both ends of the range to page size. uptr diff = RoundUp(p, kPageSize) - p; if (diff != 0) { FreeRange(proc, p, diff); p += diff; sz -= diff; } diff = p + sz - RoundDown(p + sz, kPageSize); if (diff != 0) { FreeRange(proc, p + sz - diff, diff); sz -= diff; } // Now we must have a non-empty page-aligned range. CHECK_GT(sz, 0); CHECK_EQ(p, RoundUp(p, kPageSize)); CHECK_EQ(sz, RoundUp(sz, kPageSize)); const uptr p0 = p; const uptr sz0 = sz; // Probe start of the range. for (uptr checked = 0; sz > 0; checked += kPageSize) { bool has_something = FreeRange(proc, p, kPageSize); p += kPageSize; sz -= kPageSize; if (!has_something && checked > (128 << 10)) break; } // Probe end of the range. for (uptr checked = 0; sz > 0; checked += kPageSize) { bool has_something = FreeRange(proc, p + sz - kPageSize, kPageSize); sz -= kPageSize; // Stacks grow down, so sync object are most likely at the end of the region // (if it is a stack). The very end of the stack is TLS and tsan increases // TLS by at least 256K, so check at least 512K. if (!has_something && checked > (512 << 10)) break; } // Finally, page out the whole range (including the parts that we've just // freed). Note: we can't simply madvise, because we need to leave a zeroed // range (otherwise __tsan_java_move can crash if it encounters a left-over // meta objects in java heap). uptr metap = (uptr)MemToMeta(p0); uptr metasz = sz0 / kMetaRatio; UnmapOrDie((void*)metap, metasz); MmapFixedNoReserve(metap, metasz); } MBlock* MetaMap::GetBlock(uptr p) { u32 *meta = MemToMeta(p); u32 idx = *meta; for (;;) { if (idx == 0) return 0; if (idx & kFlagBlock) return block_alloc_.Map(idx & ~kFlagMask); DCHECK(idx & kFlagSync); SyncVar * s = sync_alloc_.Map(idx & ~kFlagMask); idx = s->next; } } SyncVar* MetaMap::GetOrCreateAndLock(ThreadState *thr, uptr pc, uptr addr, bool write_lock) { return GetAndLock(thr, pc, addr, write_lock, true); } SyncVar* MetaMap::GetIfExistsAndLock(uptr addr, bool write_lock) { return GetAndLock(0, 0, addr, write_lock, false); } SyncVar* MetaMap::GetAndLock(ThreadState *thr, uptr pc, uptr addr, bool write_lock, bool create) { u32 *meta = MemToMeta(addr); u32 idx0 = *meta; u32 myidx = 0; SyncVar *mys = 0; for (;;) { u32 idx = idx0; for (;;) { if (idx == 0) break; if (idx & kFlagBlock) break; DCHECK(idx & kFlagSync); SyncVar * s = sync_alloc_.Map(idx & ~kFlagMask); if (s->addr == addr) { if (myidx != 0) { mys->Reset(thr->proc()); sync_alloc_.Free(&thr->proc()->sync_cache, myidx); } if (write_lock) s->mtx.Lock(); else s->mtx.ReadLock(); return s; } idx = s->next; } if (!create) return 0; if (*meta != idx0) { idx0 = *meta; continue; } if (myidx == 0) { const u64 uid = atomic_fetch_add(&uid_gen_, 1, memory_order_relaxed); myidx = sync_alloc_.Alloc(&thr->proc()->sync_cache); mys = sync_alloc_.Map(myidx); mys->Init(thr, pc, addr, uid); } mys->next = idx0; if (atomic_compare_exchange_strong((atomic_uint32_t*)meta, &idx0, myidx | kFlagSync, memory_order_release)) { if (write_lock) mys->mtx.Lock(); else mys->mtx.ReadLock(); return mys; } } } void MetaMap::MoveMemory(uptr src, uptr dst, uptr sz) { // src and dst can overlap, // there are no concurrent accesses to the regions (e.g. stop-the-world). CHECK_NE(src, dst); CHECK_NE(sz, 0); uptr diff = dst - src; u32 *src_meta = MemToMeta(src); u32 *dst_meta = MemToMeta(dst); u32 *src_meta_end = MemToMeta(src + sz); uptr inc = 1; if (dst > src) { src_meta = MemToMeta(src + sz) - 1; dst_meta = MemToMeta(dst + sz) - 1; src_meta_end = MemToMeta(src) - 1; inc = -1; } for (; src_meta != src_meta_end; src_meta += inc, dst_meta += inc) { CHECK_EQ(*dst_meta, 0); u32 idx = *src_meta; *src_meta = 0; *dst_meta = idx; // Patch the addresses in sync objects. while (idx != 0) { if (idx & kFlagBlock) break; CHECK(idx & kFlagSync); SyncVar *s = sync_alloc_.Map(idx & ~kFlagMask); s->addr += diff; idx = s->next; } } } void MetaMap::OnProcIdle(Processor *proc) { block_alloc_.FlushCache(&proc->block_cache); sync_alloc_.FlushCache(&proc->sync_cache); } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_interface_atomic.cc0000664000175000017500000006166013004730632030354 0ustar mwhudsonmwhudson//===-- tsan_interface_atomic.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// // ThreadSanitizer atomic operations are based on C++11/C1x standards. // For background see C++11 standard. A slightly older, publicly // available draft of the standard (not entirely up-to-date, but close enough // for casual browsing) is available here: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf // The following page contains more background information: // http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/ #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_mutex.h" #include "tsan_flags.h" #include "tsan_interface.h" #include "tsan_rtl.h" using namespace __tsan; // NOLINT #if !SANITIZER_GO && __TSAN_HAS_INT128 // Protects emulation of 128-bit atomic operations. static StaticSpinMutex mutex128; #endif static bool IsLoadOrder(morder mo) { return mo == mo_relaxed || mo == mo_consume || mo == mo_acquire || mo == mo_seq_cst; } static bool IsStoreOrder(morder mo) { return mo == mo_relaxed || mo == mo_release || mo == mo_seq_cst; } static bool IsReleaseOrder(morder mo) { return mo == mo_release || mo == mo_acq_rel || mo == mo_seq_cst; } static bool IsAcquireOrder(morder mo) { return mo == mo_consume || mo == mo_acquire || mo == mo_acq_rel || mo == mo_seq_cst; } static bool IsAcqRelOrder(morder mo) { return mo == mo_acq_rel || mo == mo_seq_cst; } template T func_xchg(volatile T *v, T op) { T res = __sync_lock_test_and_set(v, op); // __sync_lock_test_and_set does not contain full barrier. __sync_synchronize(); return res; } template T func_add(volatile T *v, T op) { return __sync_fetch_and_add(v, op); } template T func_sub(volatile T *v, T op) { return __sync_fetch_and_sub(v, op); } template T func_and(volatile T *v, T op) { return __sync_fetch_and_and(v, op); } template T func_or(volatile T *v, T op) { return __sync_fetch_and_or(v, op); } template T func_xor(volatile T *v, T op) { return __sync_fetch_and_xor(v, op); } template T func_nand(volatile T *v, T op) { // clang does not support __sync_fetch_and_nand. T cmp = *v; for (;;) { T newv = ~(cmp & op); T cur = __sync_val_compare_and_swap(v, cmp, newv); if (cmp == cur) return cmp; cmp = cur; } } template T func_cas(volatile T *v, T cmp, T xch) { return __sync_val_compare_and_swap(v, cmp, xch); } // clang does not support 128-bit atomic ops. // Atomic ops are executed under tsan internal mutex, // here we assume that the atomic variables are not accessed // from non-instrumented code. #if !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) && !SANITIZER_GO \ && __TSAN_HAS_INT128 a128 func_xchg(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = op; return cmp; } a128 func_add(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = cmp + op; return cmp; } a128 func_sub(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = cmp - op; return cmp; } a128 func_and(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = cmp & op; return cmp; } a128 func_or(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = cmp | op; return cmp; } a128 func_xor(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = cmp ^ op; return cmp; } a128 func_nand(volatile a128 *v, a128 op) { SpinMutexLock lock(&mutex128); a128 cmp = *v; *v = ~(cmp & op); return cmp; } a128 func_cas(volatile a128 *v, a128 cmp, a128 xch) { SpinMutexLock lock(&mutex128); a128 cur = *v; if (cur == cmp) *v = xch; return cur; } #endif template static int SizeLog() { if (sizeof(T) <= 1) return kSizeLog1; else if (sizeof(T) <= 2) return kSizeLog2; else if (sizeof(T) <= 4) return kSizeLog4; else return kSizeLog8; // For 16-byte atomics we also use 8-byte memory access, // this leads to false negatives only in very obscure cases. } #if !SANITIZER_GO static atomic_uint8_t *to_atomic(const volatile a8 *a) { return reinterpret_cast(const_cast(a)); } static atomic_uint16_t *to_atomic(const volatile a16 *a) { return reinterpret_cast(const_cast(a)); } #endif static atomic_uint32_t *to_atomic(const volatile a32 *a) { return reinterpret_cast(const_cast(a)); } static atomic_uint64_t *to_atomic(const volatile a64 *a) { return reinterpret_cast(const_cast(a)); } static memory_order to_mo(morder mo) { switch (mo) { case mo_relaxed: return memory_order_relaxed; case mo_consume: return memory_order_consume; case mo_acquire: return memory_order_acquire; case mo_release: return memory_order_release; case mo_acq_rel: return memory_order_acq_rel; case mo_seq_cst: return memory_order_seq_cst; } CHECK(0); return memory_order_seq_cst; } template static T NoTsanAtomicLoad(const volatile T *a, morder mo) { return atomic_load(to_atomic(a), to_mo(mo)); } #if __TSAN_HAS_INT128 && !SANITIZER_GO static a128 NoTsanAtomicLoad(const volatile a128 *a, morder mo) { SpinMutexLock lock(&mutex128); return *a; } #endif template static T AtomicLoad(ThreadState *thr, uptr pc, const volatile T *a, morder mo) { CHECK(IsLoadOrder(mo)); // This fast-path is critical for performance. // Assume the access is atomic. if (!IsAcquireOrder(mo)) { MemoryReadAtomic(thr, pc, (uptr)a, SizeLog()); return NoTsanAtomicLoad(a, mo); } SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, (uptr)a, false); AcquireImpl(thr, pc, &s->clock); T v = NoTsanAtomicLoad(a, mo); s->mtx.ReadUnlock(); MemoryReadAtomic(thr, pc, (uptr)a, SizeLog()); return v; } template static void NoTsanAtomicStore(volatile T *a, T v, morder mo) { atomic_store(to_atomic(a), v, to_mo(mo)); } #if __TSAN_HAS_INT128 && !SANITIZER_GO static void NoTsanAtomicStore(volatile a128 *a, a128 v, morder mo) { SpinMutexLock lock(&mutex128); *a = v; } #endif template static void AtomicStore(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { CHECK(IsStoreOrder(mo)); MemoryWriteAtomic(thr, pc, (uptr)a, SizeLog()); // This fast-path is critical for performance. // Assume the access is atomic. // Strictly saying even relaxed store cuts off release sequence, // so must reset the clock. if (!IsReleaseOrder(mo)) { NoTsanAtomicStore(a, v, mo); return; } __sync_synchronize(); SyncVar *s = ctx->metamap.GetOrCreateAndLock(thr, pc, (uptr)a, true); thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); ReleaseImpl(thr, pc, &s->clock); NoTsanAtomicStore(a, v, mo); s->mtx.Unlock(); } template static T AtomicRMW(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { MemoryWriteAtomic(thr, pc, (uptr)a, SizeLog()); SyncVar *s = 0; if (mo != mo_relaxed) { s = ctx->metamap.GetOrCreateAndLock(thr, pc, (uptr)a, true); thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); if (IsAcqRelOrder(mo)) AcquireReleaseImpl(thr, pc, &s->clock); else if (IsReleaseOrder(mo)) ReleaseImpl(thr, pc, &s->clock); else if (IsAcquireOrder(mo)) AcquireImpl(thr, pc, &s->clock); } v = F(a, v); if (s) s->mtx.Unlock(); return v; } template static T NoTsanAtomicExchange(volatile T *a, T v, morder mo) { return func_xchg(a, v); } template static T NoTsanAtomicFetchAdd(volatile T *a, T v, morder mo) { return func_add(a, v); } template static T NoTsanAtomicFetchSub(volatile T *a, T v, morder mo) { return func_sub(a, v); } template static T NoTsanAtomicFetchAnd(volatile T *a, T v, morder mo) { return func_and(a, v); } template static T NoTsanAtomicFetchOr(volatile T *a, T v, morder mo) { return func_or(a, v); } template static T NoTsanAtomicFetchXor(volatile T *a, T v, morder mo) { return func_xor(a, v); } template static T NoTsanAtomicFetchNand(volatile T *a, T v, morder mo) { return func_nand(a, v); } template static T AtomicExchange(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static T AtomicFetchAdd(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static T AtomicFetchSub(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static T AtomicFetchAnd(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static T AtomicFetchOr(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static T AtomicFetchXor(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static T AtomicFetchNand(ThreadState *thr, uptr pc, volatile T *a, T v, morder mo) { return AtomicRMW(thr, pc, a, v, mo); } template static bool NoTsanAtomicCAS(volatile T *a, T *c, T v, morder mo, morder fmo) { return atomic_compare_exchange_strong(to_atomic(a), c, v, to_mo(mo)); } #if __TSAN_HAS_INT128 static bool NoTsanAtomicCAS(volatile a128 *a, a128 *c, a128 v, morder mo, morder fmo) { a128 old = *c; a128 cur = func_cas(a, old, v); if (cur == old) return true; *c = cur; return false; } #endif template static T NoTsanAtomicCAS(volatile T *a, T c, T v, morder mo, morder fmo) { NoTsanAtomicCAS(a, &c, v, mo, fmo); return c; } template static bool AtomicCAS(ThreadState *thr, uptr pc, volatile T *a, T *c, T v, morder mo, morder fmo) { (void)fmo; // Unused because llvm does not pass it yet. MemoryWriteAtomic(thr, pc, (uptr)a, SizeLog()); SyncVar *s = 0; bool write_lock = mo != mo_acquire && mo != mo_consume; if (mo != mo_relaxed) { s = ctx->metamap.GetOrCreateAndLock(thr, pc, (uptr)a, write_lock); thr->fast_state.IncrementEpoch(); // Can't increment epoch w/o writing to the trace as well. TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0); if (IsAcqRelOrder(mo)) AcquireReleaseImpl(thr, pc, &s->clock); else if (IsReleaseOrder(mo)) ReleaseImpl(thr, pc, &s->clock); else if (IsAcquireOrder(mo)) AcquireImpl(thr, pc, &s->clock); } T cc = *c; T pr = func_cas(a, cc, v); if (s) { if (write_lock) s->mtx.Unlock(); else s->mtx.ReadUnlock(); } if (pr == cc) return true; *c = pr; return false; } template static T AtomicCAS(ThreadState *thr, uptr pc, volatile T *a, T c, T v, morder mo, morder fmo) { AtomicCAS(thr, pc, a, &c, v, mo, fmo); return c; } #if !SANITIZER_GO static void NoTsanAtomicFence(morder mo) { __sync_synchronize(); } static void AtomicFence(ThreadState *thr, uptr pc, morder mo) { // FIXME(dvyukov): not implemented. __sync_synchronize(); } #endif // Interface functions follow. #if !SANITIZER_GO // C/C++ #define SCOPED_ATOMIC(func, ...) \ const uptr callpc = (uptr)__builtin_return_address(0); \ uptr pc = StackTrace::GetCurrentPc(); \ mo = flags()->force_seq_cst_atomics ? (morder)mo_seq_cst : mo; \ ThreadState *const thr = cur_thread(); \ if (thr->ignore_interceptors) \ return NoTsanAtomic##func(__VA_ARGS__); \ AtomicStatInc(thr, sizeof(*a), mo, StatAtomic##func); \ ScopedAtomic sa(thr, callpc, a, mo, __func__); \ return Atomic##func(thr, pc, __VA_ARGS__); \ /**/ class ScopedAtomic { public: ScopedAtomic(ThreadState *thr, uptr pc, const volatile void *a, morder mo, const char *func) : thr_(thr) { FuncEntry(thr_, pc); DPrintf("#%d: %s(%p, %d)\n", thr_->tid, func, a, mo); } ~ScopedAtomic() { ProcessPendingSignals(thr_); FuncExit(thr_); } private: ThreadState *thr_; }; static void AtomicStatInc(ThreadState *thr, uptr size, morder mo, StatType t) { StatInc(thr, StatAtomic); StatInc(thr, t); StatInc(thr, size == 1 ? StatAtomic1 : size == 2 ? StatAtomic2 : size == 4 ? StatAtomic4 : size == 8 ? StatAtomic8 : StatAtomic16); StatInc(thr, mo == mo_relaxed ? StatAtomicRelaxed : mo == mo_consume ? StatAtomicConsume : mo == mo_acquire ? StatAtomicAcquire : mo == mo_release ? StatAtomicRelease : mo == mo_acq_rel ? StatAtomicAcq_Rel : StatAtomicSeq_Cst); } extern "C" { SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_load(const volatile a8 *a, morder mo) { SCOPED_ATOMIC(Load, a, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_load(const volatile a16 *a, morder mo) { SCOPED_ATOMIC(Load, a, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_load(const volatile a32 *a, morder mo) { SCOPED_ATOMIC(Load, a, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_load(const volatile a64 *a, morder mo) { SCOPED_ATOMIC(Load, a, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_load(const volatile a128 *a, morder mo) { SCOPED_ATOMIC(Load, a, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic8_store(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(Store, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic16_store(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(Store, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic32_store(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(Store, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic64_store(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(Store, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic128_store(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(Store, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_exchange(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(Exchange, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_exchange(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(Exchange, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_exchange(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(Exchange, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_exchange(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(Exchange, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_exchange(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(Exchange, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_add(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(FetchAdd, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_add(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(FetchAdd, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_add(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(FetchAdd, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_add(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(FetchAdd, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_add(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(FetchAdd, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_sub(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(FetchSub, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_sub(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(FetchSub, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_sub(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(FetchSub, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_sub(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(FetchSub, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_sub(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(FetchSub, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_and(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(FetchAnd, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_and(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(FetchAnd, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_and(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(FetchAnd, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_and(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(FetchAnd, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_and(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(FetchAnd, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_or(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(FetchOr, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_or(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(FetchOr, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_or(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(FetchOr, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_or(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(FetchOr, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_or(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(FetchOr, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_xor(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(FetchXor, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_xor(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(FetchXor, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_xor(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(FetchXor, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_xor(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(FetchXor, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_xor(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(FetchXor, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_fetch_nand(volatile a8 *a, a8 v, morder mo) { SCOPED_ATOMIC(FetchNand, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_fetch_nand(volatile a16 *a, a16 v, morder mo) { SCOPED_ATOMIC(FetchNand, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_fetch_nand(volatile a32 *a, a32 v, morder mo) { SCOPED_ATOMIC(FetchNand, a, v, mo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_fetch_nand(volatile a64 *a, a64 v, morder mo) { SCOPED_ATOMIC(FetchNand, a, v, mo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_fetch_nand(volatile a128 *a, a128 v, morder mo) { SCOPED_ATOMIC(FetchNand, a, v, mo); } #endif SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic8_compare_exchange_strong(volatile a8 *a, a8 *c, a8 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic16_compare_exchange_strong(volatile a16 *a, a16 *c, a16 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic32_compare_exchange_strong(volatile a32 *a, a32 *c, a32 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic64_compare_exchange_strong(volatile a64 *a, a64 *c, a64 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic128_compare_exchange_strong(volatile a128 *a, a128 *c, a128 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } #endif SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic8_compare_exchange_weak(volatile a8 *a, a8 *c, a8 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic16_compare_exchange_weak(volatile a16 *a, a16 *c, a16 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic32_compare_exchange_weak(volatile a32 *a, a32 *c, a32 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic64_compare_exchange_weak(volatile a64 *a, a64 *c, a64 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE int __tsan_atomic128_compare_exchange_weak(volatile a128 *a, a128 *c, a128 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } #endif SANITIZER_INTERFACE_ATTRIBUTE a8 __tsan_atomic8_compare_exchange_val(volatile a8 *a, a8 c, a8 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE a16 __tsan_atomic16_compare_exchange_val(volatile a16 *a, a16 c, a16 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE a32 __tsan_atomic32_compare_exchange_val(volatile a32 *a, a32 c, a32 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } SANITIZER_INTERFACE_ATTRIBUTE a64 __tsan_atomic64_compare_exchange_val(volatile a64 *a, a64 c, a64 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } #if __TSAN_HAS_INT128 SANITIZER_INTERFACE_ATTRIBUTE a128 __tsan_atomic128_compare_exchange_val(volatile a128 *a, a128 c, a128 v, morder mo, morder fmo) { SCOPED_ATOMIC(CAS, a, c, v, mo, fmo); } #endif SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic_thread_fence(morder mo) { char* a = 0; SCOPED_ATOMIC(Fence, mo); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic_signal_fence(morder mo) { } } // extern "C" #else // #if !SANITIZER_GO // Go #define ATOMIC(func, ...) \ if (thr->ignore_sync) { \ NoTsanAtomic##func(__VA_ARGS__); \ } else { \ FuncEntry(thr, cpc); \ Atomic##func(thr, pc, __VA_ARGS__); \ FuncExit(thr); \ } \ /**/ #define ATOMIC_RET(func, ret, ...) \ if (thr->ignore_sync) { \ (ret) = NoTsanAtomic##func(__VA_ARGS__); \ } else { \ FuncEntry(thr, cpc); \ (ret) = Atomic##func(thr, pc, __VA_ARGS__); \ FuncExit(thr); \ } \ /**/ extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC_RET(Load, *(a32*)(a+8), *(a32**)a, mo_acquire); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_load(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC_RET(Load, *(a64*)(a+8), *(a64**)a, mo_acquire); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC(Store, *(a32**)a, *(a32*)(a+8), mo_release); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_store(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC(Store, *(a64**)a, *(a64*)(a+8), mo_release); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC_RET(FetchAdd, *(a32*)(a+16), *(a32**)a, *(a32*)(a+8), mo_acq_rel); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_fetch_add(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC_RET(FetchAdd, *(a64*)(a+16), *(a64**)a, *(a64*)(a+8), mo_acq_rel); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC_RET(Exchange, *(a32*)(a+16), *(a32**)a, *(a32*)(a+8), mo_acq_rel); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_exchange(ThreadState *thr, uptr cpc, uptr pc, u8 *a) { ATOMIC_RET(Exchange, *(a64*)(a+16), *(a64**)a, *(a64*)(a+8), mo_acq_rel); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic32_compare_exchange( ThreadState *thr, uptr cpc, uptr pc, u8 *a) { a32 cur = 0; a32 cmp = *(a32*)(a+8); ATOMIC_RET(CAS, cur, *(a32**)a, cmp, *(a32*)(a+12), mo_acq_rel, mo_acquire); *(bool*)(a+16) = (cur == cmp); } SANITIZER_INTERFACE_ATTRIBUTE void __tsan_go_atomic64_compare_exchange( ThreadState *thr, uptr cpc, uptr pc, u8 *a) { a64 cur = 0; a64 cmp = *(a64*)(a+8); ATOMIC_RET(CAS, cur, *(a64**)a, cmp, *(a64*)(a+16), mo_acq_rel, mo_acquire); *(bool*)(a+24) = (cur == cmp); } } // extern "C" #endif // #if !SANITIZER_GO golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_stat.cc0000664000175000017500000002723012713170772026037 0ustar mwhudsonmwhudson//===-- tsan_stat.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_stat.h" #include "tsan_rtl.h" namespace __tsan { #if TSAN_COLLECT_STATS void StatAggregate(u64 *dst, u64 *src) { for (int i = 0; i < StatCnt; i++) dst[i] += src[i]; } void StatOutput(u64 *stat) { stat[StatShadowNonZero] = stat[StatShadowProcessed] - stat[StatShadowZero]; static const char *name[StatCnt] = {}; name[StatMop] = "Memory accesses "; name[StatMopRead] = " Including reads "; name[StatMopWrite] = " writes "; name[StatMop1] = " Including size 1 "; name[StatMop2] = " size 2 "; name[StatMop4] = " size 4 "; name[StatMop8] = " size 8 "; name[StatMopSame] = " Including same "; name[StatMopIgnored] = " Including ignored "; name[StatMopRange] = " Including range "; name[StatMopRodata] = " Including .rodata "; name[StatMopRangeRodata] = " Including .rodata range "; name[StatShadowProcessed] = "Shadow processed "; name[StatShadowZero] = " Including empty "; name[StatShadowNonZero] = " Including non empty "; name[StatShadowSameSize] = " Including same size "; name[StatShadowIntersect] = " intersect "; name[StatShadowNotIntersect] = " not intersect "; name[StatShadowSameThread] = " Including same thread "; name[StatShadowAnotherThread] = " another thread "; name[StatShadowReplace] = " Including evicted "; name[StatFuncEnter] = "Function entries "; name[StatFuncExit] = "Function exits "; name[StatEvents] = "Events collected "; name[StatThreadCreate] = "Total threads created "; name[StatThreadFinish] = " threads finished "; name[StatThreadReuse] = " threads reused "; name[StatThreadMaxTid] = " max tid "; name[StatThreadMaxAlive] = " max alive threads "; name[StatMutexCreate] = "Mutexes created "; name[StatMutexDestroy] = " destroyed "; name[StatMutexLock] = " lock "; name[StatMutexUnlock] = " unlock "; name[StatMutexRecLock] = " recursive lock "; name[StatMutexRecUnlock] = " recursive unlock "; name[StatMutexReadLock] = " read lock "; name[StatMutexReadUnlock] = " read unlock "; name[StatSyncCreated] = "Sync objects created "; name[StatSyncDestroyed] = " destroyed "; name[StatSyncAcquire] = " acquired "; name[StatSyncRelease] = " released "; name[StatClockAcquire] = "Clock acquire "; name[StatClockAcquireEmpty] = " empty clock "; name[StatClockAcquireFastRelease] = " fast from release-store "; name[StatClockAcquireLarge] = " contains my tid "; name[StatClockAcquireRepeat] = " repeated (fast) "; name[StatClockAcquireFull] = " full (slow) "; name[StatClockAcquiredSomething] = " acquired something "; name[StatClockRelease] = "Clock release "; name[StatClockReleaseResize] = " resize "; name[StatClockReleaseFast1] = " fast1 "; name[StatClockReleaseFast2] = " fast2 "; name[StatClockReleaseSlow] = " dirty overflow (slow) "; name[StatClockReleaseFull] = " full (slow) "; name[StatClockReleaseAcquired] = " was acquired "; name[StatClockReleaseClearTail] = " clear tail "; name[StatClockStore] = "Clock release store "; name[StatClockStoreResize] = " resize "; name[StatClockStoreFast] = " fast "; name[StatClockStoreFull] = " slow "; name[StatClockStoreTail] = " clear tail "; name[StatClockAcquireRelease] = "Clock acquire-release "; name[StatAtomic] = "Atomic operations "; name[StatAtomicLoad] = " Including load "; name[StatAtomicStore] = " store "; name[StatAtomicExchange] = " exchange "; name[StatAtomicFetchAdd] = " fetch_add "; name[StatAtomicFetchSub] = " fetch_sub "; name[StatAtomicFetchAnd] = " fetch_and "; name[StatAtomicFetchOr] = " fetch_or "; name[StatAtomicFetchXor] = " fetch_xor "; name[StatAtomicFetchNand] = " fetch_nand "; name[StatAtomicCAS] = " compare_exchange "; name[StatAtomicFence] = " fence "; name[StatAtomicRelaxed] = " Including relaxed "; name[StatAtomicConsume] = " consume "; name[StatAtomicAcquire] = " acquire "; name[StatAtomicRelease] = " release "; name[StatAtomicAcq_Rel] = " acq_rel "; name[StatAtomicSeq_Cst] = " seq_cst "; name[StatAtomic1] = " Including size 1 "; name[StatAtomic2] = " size 2 "; name[StatAtomic4] = " size 4 "; name[StatAtomic8] = " size 8 "; name[StatAtomic16] = " size 16 "; name[StatAnnotation] = "Dynamic annotations "; name[StatAnnotateHappensBefore] = " HappensBefore "; name[StatAnnotateHappensAfter] = " HappensAfter "; name[StatAnnotateCondVarSignal] = " CondVarSignal "; name[StatAnnotateCondVarSignalAll] = " CondVarSignalAll "; name[StatAnnotateMutexIsNotPHB] = " MutexIsNotPHB "; name[StatAnnotateCondVarWait] = " CondVarWait "; name[StatAnnotateRWLockCreate] = " RWLockCreate "; name[StatAnnotateRWLockCreateStatic] = " StatAnnotateRWLockCreateStatic "; name[StatAnnotateRWLockDestroy] = " RWLockDestroy "; name[StatAnnotateRWLockAcquired] = " RWLockAcquired "; name[StatAnnotateRWLockReleased] = " RWLockReleased "; name[StatAnnotateTraceMemory] = " TraceMemory "; name[StatAnnotateFlushState] = " FlushState "; name[StatAnnotateNewMemory] = " NewMemory "; name[StatAnnotateNoOp] = " NoOp "; name[StatAnnotateFlushExpectedRaces] = " FlushExpectedRaces "; name[StatAnnotateEnableRaceDetection] = " EnableRaceDetection "; name[StatAnnotateMutexIsUsedAsCondVar] = " MutexIsUsedAsCondVar "; name[StatAnnotatePCQGet] = " PCQGet "; name[StatAnnotatePCQPut] = " PCQPut "; name[StatAnnotatePCQDestroy] = " PCQDestroy "; name[StatAnnotatePCQCreate] = " PCQCreate "; name[StatAnnotateExpectRace] = " ExpectRace "; name[StatAnnotateBenignRaceSized] = " BenignRaceSized "; name[StatAnnotateBenignRace] = " BenignRace "; name[StatAnnotateIgnoreReadsBegin] = " IgnoreReadsBegin "; name[StatAnnotateIgnoreReadsEnd] = " IgnoreReadsEnd "; name[StatAnnotateIgnoreWritesBegin] = " IgnoreWritesBegin "; name[StatAnnotateIgnoreWritesEnd] = " IgnoreWritesEnd "; name[StatAnnotateIgnoreSyncBegin] = " IgnoreSyncBegin "; name[StatAnnotateIgnoreSyncEnd] = " IgnoreSyncEnd "; name[StatAnnotatePublishMemoryRange] = " PublishMemoryRange "; name[StatAnnotateUnpublishMemoryRange] = " UnpublishMemoryRange "; name[StatAnnotateThreadName] = " ThreadName "; name[StatMtxTotal] = "Contentionz "; name[StatMtxTrace] = " Trace "; name[StatMtxThreads] = " Threads "; name[StatMtxReport] = " Report "; name[StatMtxSyncVar] = " SyncVar "; name[StatMtxSyncTab] = " SyncTab "; name[StatMtxSlab] = " Slab "; name[StatMtxAtExit] = " Atexit "; name[StatMtxAnnotations] = " Annotations "; name[StatMtxMBlock] = " MBlock "; name[StatMtxDeadlockDetector] = " DeadlockDetector "; name[StatMtxFired] = " FiredSuppressions "; name[StatMtxRacy] = " RacyStacks "; name[StatMtxFD] = " FD "; name[StatMtxGlobalProc] = " GlobalProc "; Printf("Statistics:\n"); for (int i = 0; i < StatCnt; i++) Printf("%s: %16zu\n", name[i], (uptr)stat[i]); } #endif } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_mutex.h0000664000175000017500000000362612713170772026073 0ustar mwhudsonmwhudson//===-- tsan_mutex.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #ifndef TSAN_MUTEX_H #define TSAN_MUTEX_H #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_mutex.h" #include "tsan_defs.h" namespace __tsan { enum MutexType { MutexTypeInvalid, MutexTypeTrace, MutexTypeThreads, MutexTypeReport, MutexTypeSyncVar, MutexTypeSyncTab, MutexTypeSlab, MutexTypeAnnotations, MutexTypeAtExit, MutexTypeMBlock, MutexTypeJavaMBlock, MutexTypeDDetector, MutexTypeFired, MutexTypeRacy, MutexTypeGlobalProc, // This must be the last. MutexTypeCount }; class Mutex { public: explicit Mutex(MutexType type, StatType stat_type); ~Mutex(); void Lock(); void Unlock(); void ReadLock(); void ReadUnlock(); void CheckLocked(); private: atomic_uintptr_t state_; #if SANITIZER_DEBUG MutexType type_; #endif #if TSAN_COLLECT_STATS StatType stat_type_; #endif Mutex(const Mutex&); void operator = (const Mutex&); }; typedef GenericScopedLock Lock; typedef GenericScopedReadLock ReadLock; class InternalDeadlockDetector { public: InternalDeadlockDetector(); void Lock(MutexType t); void Unlock(MutexType t); void CheckNoLocks(); private: u64 seq_; u64 locked_[MutexTypeCount]; }; void InitializeMutex(); // Checks that the current thread does not hold any runtime locks // (e.g. when returning from an interceptor). void CheckNoLocks(ThreadState *thr); } // namespace __tsan #endif // TSAN_MUTEX_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_mutexset.cc0000664000175000017500000000375512060106217026734 0ustar mwhudsonmwhudson//===-- tsan_mutexset.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_mutexset.h" #include "tsan_rtl.h" namespace __tsan { const uptr MutexSet::kMaxSize; MutexSet::MutexSet() { size_ = 0; internal_memset(&descs_, 0, sizeof(descs_)); } void MutexSet::Add(u64 id, bool write, u64 epoch) { // Look up existing mutex with the same id. for (uptr i = 0; i < size_; i++) { if (descs_[i].id == id) { descs_[i].count++; descs_[i].epoch = epoch; return; } } // On overflow, find the oldest mutex and drop it. if (size_ == kMaxSize) { u64 minepoch = (u64)-1; u64 mini = (u64)-1; for (uptr i = 0; i < size_; i++) { if (descs_[i].epoch < minepoch) { minepoch = descs_[i].epoch; mini = i; } } RemovePos(mini); CHECK_EQ(size_, kMaxSize - 1); } // Add new mutex descriptor. descs_[size_].id = id; descs_[size_].write = write; descs_[size_].epoch = epoch; descs_[size_].count = 1; size_++; } void MutexSet::Del(u64 id, bool write) { for (uptr i = 0; i < size_; i++) { if (descs_[i].id == id) { if (--descs_[i].count == 0) RemovePos(i); return; } } } void MutexSet::Remove(u64 id) { for (uptr i = 0; i < size_; i++) { if (descs_[i].id == id) { RemovePos(i); return; } } } void MutexSet::RemovePos(uptr i) { CHECK_LT(i, size_); descs_[i] = descs_[size_ - 1]; size_--; } uptr MutexSet::Size() const { return size_; } MutexSet::Desc MutexSet::Get(uptr i) const { CHECK_LT(i, size_); return descs_[i]; } } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/rtl/tsan_report.cc0000664000175000017500000003521413004730632026367 0ustar mwhudsonmwhudson//===-- tsan_report.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer (TSan), a race detector. // //===----------------------------------------------------------------------===// #include "tsan_report.h" #include "tsan_platform.h" #include "tsan_rtl.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_report_decorator.h" #include "sanitizer_common/sanitizer_stacktrace_printer.h" namespace __tsan { ReportStack::ReportStack() : frames(nullptr), suppressable(false) {} ReportStack *ReportStack::New() { void *mem = internal_alloc(MBlockReportStack, sizeof(ReportStack)); return new(mem) ReportStack(); } ReportLocation::ReportLocation(ReportLocationType type) : type(type), global(), heap_chunk_start(0), heap_chunk_size(0), tid(0), fd(0), suppressable(false), stack(nullptr) {} ReportLocation *ReportLocation::New(ReportLocationType type) { void *mem = internal_alloc(MBlockReportStack, sizeof(ReportLocation)); return new(mem) ReportLocation(type); } class Decorator: public __sanitizer::SanitizerCommonDecorator { public: Decorator() : SanitizerCommonDecorator() { } const char *Warning() { return Red(); } const char *EndWarning() { return Default(); } const char *Access() { return Blue(); } const char *EndAccess() { return Default(); } const char *ThreadDescription() { return Cyan(); } const char *EndThreadDescription() { return Default(); } const char *Location() { return Green(); } const char *EndLocation() { return Default(); } const char *Sleep() { return Yellow(); } const char *EndSleep() { return Default(); } const char *Mutex() { return Magenta(); } const char *EndMutex() { return Default(); } }; ReportDesc::ReportDesc() : stacks(MBlockReportStack) , mops(MBlockReportMop) , locs(MBlockReportLoc) , mutexes(MBlockReportMutex) , threads(MBlockReportThread) , unique_tids(MBlockReportThread) , sleep() , count() { } ReportMop::ReportMop() : mset(MBlockReportMutex) { } ReportDesc::~ReportDesc() { // FIXME(dvyukov): it must be leaking a lot of memory. } #if !SANITIZER_GO const int kThreadBufSize = 32; const char *thread_name(char *buf, int tid) { if (tid == 0) return "main thread"; internal_snprintf(buf, kThreadBufSize, "thread T%d", tid); return buf; } static const char *ReportTypeString(ReportType typ) { if (typ == ReportTypeRace) return "data race"; if (typ == ReportTypeVptrRace) return "data race on vptr (ctor/dtor vs virtual call)"; if (typ == ReportTypeUseAfterFree) return "heap-use-after-free"; if (typ == ReportTypeVptrUseAfterFree) return "heap-use-after-free (virtual call vs free)"; if (typ == ReportTypeThreadLeak) return "thread leak"; if (typ == ReportTypeMutexDestroyLocked) return "destroy of a locked mutex"; if (typ == ReportTypeMutexDoubleLock) return "double lock of a mutex"; if (typ == ReportTypeMutexInvalidAccess) return "use of an invalid mutex (e.g. uninitialized or destroyed)"; if (typ == ReportTypeMutexBadUnlock) return "unlock of an unlocked mutex (or by a wrong thread)"; if (typ == ReportTypeMutexBadReadLock) return "read lock of a write locked mutex"; if (typ == ReportTypeMutexBadReadUnlock) return "read unlock of a write locked mutex"; if (typ == ReportTypeSignalUnsafe) return "signal-unsafe call inside of a signal"; if (typ == ReportTypeErrnoInSignal) return "signal handler spoils errno"; if (typ == ReportTypeDeadlock) return "lock-order-inversion (potential deadlock)"; return ""; } #if SANITIZER_MAC static const char *const kInterposedFunctionPrefix = "wrap_"; #else static const char *const kInterposedFunctionPrefix = "__interceptor_"; #endif void PrintStack(const ReportStack *ent) { if (ent == 0 || ent->frames == 0) { Printf(" [failed to restore the stack]\n\n"); return; } SymbolizedStack *frame = ent->frames; for (int i = 0; frame && frame->info.address; frame = frame->next, i++) { InternalScopedString res(2 * GetPageSizeCached()); RenderFrame(&res, common_flags()->stack_trace_format, i, frame->info, common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix, kInterposedFunctionPrefix); Printf("%s\n", res.data()); } Printf("\n"); } static void PrintMutexSet(Vector const& mset) { for (uptr i = 0; i < mset.Size(); i++) { if (i == 0) Printf(" (mutexes:"); const ReportMopMutex m = mset[i]; Printf(" %s M%llu", m.write ? "write" : "read", m.id); Printf(i == mset.Size() - 1 ? ")" : ","); } } static const char *MopDesc(bool first, bool write, bool atomic) { return atomic ? (first ? (write ? "Atomic write" : "Atomic read") : (write ? "Previous atomic write" : "Previous atomic read")) : (first ? (write ? "Write" : "Read") : (write ? "Previous write" : "Previous read")); } static void PrintMop(const ReportMop *mop, bool first) { Decorator d; char thrbuf[kThreadBufSize]; Printf("%s", d.Access()); Printf(" %s of size %d at %p by %s", MopDesc(first, mop->write, mop->atomic), mop->size, (void*)mop->addr, thread_name(thrbuf, mop->tid)); PrintMutexSet(mop->mset); Printf(":\n"); Printf("%s", d.EndAccess()); PrintStack(mop->stack); } static void PrintLocation(const ReportLocation *loc) { Decorator d; char thrbuf[kThreadBufSize]; bool print_stack = false; Printf("%s", d.Location()); if (loc->type == ReportLocationGlobal) { const DataInfo &global = loc->global; if (global.size != 0) Printf(" Location is global '%s' of size %zu at %p (%s+%p)\n\n", global.name, global.size, global.start, StripModuleName(global.module), global.module_offset); else Printf(" Location is global '%s' at %p (%s+%p)\n\n", global.name, global.start, StripModuleName(global.module), global.module_offset); } else if (loc->type == ReportLocationHeap) { char thrbuf[kThreadBufSize]; Printf(" Location is heap block of size %zu at %p allocated by %s:\n", loc->heap_chunk_size, loc->heap_chunk_start, thread_name(thrbuf, loc->tid)); print_stack = true; } else if (loc->type == ReportLocationStack) { Printf(" Location is stack of %s.\n\n", thread_name(thrbuf, loc->tid)); } else if (loc->type == ReportLocationTLS) { Printf(" Location is TLS of %s.\n\n", thread_name(thrbuf, loc->tid)); } else if (loc->type == ReportLocationFD) { Printf(" Location is file descriptor %d created by %s at:\n", loc->fd, thread_name(thrbuf, loc->tid)); print_stack = true; } Printf("%s", d.EndLocation()); if (print_stack) PrintStack(loc->stack); } static void PrintMutexShort(const ReportMutex *rm, const char *after) { Decorator d; Printf("%sM%zd%s%s", d.Mutex(), rm->id, d.EndMutex(), after); } static void PrintMutexShortWithAddress(const ReportMutex *rm, const char *after) { Decorator d; Printf("%sM%zd (%p)%s%s", d.Mutex(), rm->id, rm->addr, d.EndMutex(), after); } static void PrintMutex(const ReportMutex *rm) { Decorator d; if (rm->destroyed) { Printf("%s", d.Mutex()); Printf(" Mutex M%llu is already destroyed.\n\n", rm->id); Printf("%s", d.EndMutex()); } else { Printf("%s", d.Mutex()); Printf(" Mutex M%llu (%p) created at:\n", rm->id, rm->addr); Printf("%s", d.EndMutex()); PrintStack(rm->stack); } } static void PrintThread(const ReportThread *rt) { Decorator d; if (rt->id == 0) // Little sense in describing the main thread. return; Printf("%s", d.ThreadDescription()); Printf(" Thread T%d", rt->id); if (rt->name && rt->name[0] != '\0') Printf(" '%s'", rt->name); char thrbuf[kThreadBufSize]; Printf(" (tid=%zu, %s) created by %s", rt->os_id, rt->running ? "running" : "finished", thread_name(thrbuf, rt->parent_tid)); if (rt->stack) Printf(" at:"); Printf("\n"); Printf("%s", d.EndThreadDescription()); PrintStack(rt->stack); } static void PrintSleep(const ReportStack *s) { Decorator d; Printf("%s", d.Sleep()); Printf(" As if synchronized via sleep:\n"); Printf("%s", d.EndSleep()); PrintStack(s); } static ReportStack *ChooseSummaryStack(const ReportDesc *rep) { if (rep->mops.Size()) return rep->mops[0]->stack; if (rep->stacks.Size()) return rep->stacks[0]; if (rep->mutexes.Size()) return rep->mutexes[0]->stack; if (rep->threads.Size()) return rep->threads[0]->stack; return 0; } static bool FrameIsInternal(const SymbolizedStack *frame) { if (frame == 0) return false; const char *file = frame->info.file; const char *module = frame->info.module; if (file != 0 && (internal_strstr(file, "tsan_interceptors.cc") || internal_strstr(file, "sanitizer_common_interceptors.inc") || internal_strstr(file, "tsan_interface_"))) return true; if (module != 0 && (internal_strstr(module, "libclang_rt.tsan_"))) return true; return false; } static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) { while (FrameIsInternal(frames) && frames->next) frames = frames->next; return frames; } void PrintReport(const ReportDesc *rep) { Decorator d; Printf("==================\n"); const char *rep_typ_str = ReportTypeString(rep->typ); Printf("%s", d.Warning()); Printf("WARNING: ThreadSanitizer: %s (pid=%d)\n", rep_typ_str, (int)internal_getpid()); Printf("%s", d.EndWarning()); if (rep->typ == ReportTypeDeadlock) { char thrbuf[kThreadBufSize]; Printf(" Cycle in lock order graph: "); for (uptr i = 0; i < rep->mutexes.Size(); i++) PrintMutexShortWithAddress(rep->mutexes[i], " => "); PrintMutexShort(rep->mutexes[0], "\n\n"); CHECK_GT(rep->mutexes.Size(), 0U); CHECK_EQ(rep->mutexes.Size() * (flags()->second_deadlock_stack ? 2 : 1), rep->stacks.Size()); for (uptr i = 0; i < rep->mutexes.Size(); i++) { Printf(" Mutex "); PrintMutexShort(rep->mutexes[(i + 1) % rep->mutexes.Size()], " acquired here while holding mutex "); PrintMutexShort(rep->mutexes[i], " in "); Printf("%s", d.ThreadDescription()); Printf("%s:\n", thread_name(thrbuf, rep->unique_tids[i])); Printf("%s", d.EndThreadDescription()); if (flags()->second_deadlock_stack) { PrintStack(rep->stacks[2*i]); Printf(" Mutex "); PrintMutexShort(rep->mutexes[i], " previously acquired by the same thread here:\n"); PrintStack(rep->stacks[2*i+1]); } else { PrintStack(rep->stacks[i]); if (i == 0) Printf(" Hint: use TSAN_OPTIONS=second_deadlock_stack=1 " "to get more informative warning message\n\n"); } } } else { for (uptr i = 0; i < rep->stacks.Size(); i++) { if (i) Printf(" and:\n"); PrintStack(rep->stacks[i]); } } for (uptr i = 0; i < rep->mops.Size(); i++) PrintMop(rep->mops[i], i == 0); if (rep->sleep) PrintSleep(rep->sleep); for (uptr i = 0; i < rep->locs.Size(); i++) PrintLocation(rep->locs[i]); if (rep->typ != ReportTypeDeadlock) { for (uptr i = 0; i < rep->mutexes.Size(); i++) PrintMutex(rep->mutexes[i]); } for (uptr i = 0; i < rep->threads.Size(); i++) PrintThread(rep->threads[i]); if (rep->typ == ReportTypeThreadLeak && rep->count > 1) Printf(" And %d more similar thread leaks.\n\n", rep->count - 1); if (ReportStack *stack = ChooseSummaryStack(rep)) { if (SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames)) ReportErrorSummary(rep_typ_str, frame->info); } Printf("==================\n"); } #else // #if !SANITIZER_GO const int kMainThreadId = 1; void PrintStack(const ReportStack *ent) { if (ent == 0 || ent->frames == 0) { Printf(" [failed to restore the stack]\n"); return; } SymbolizedStack *frame = ent->frames; for (int i = 0; frame; frame = frame->next, i++) { const AddressInfo &info = frame->info; Printf(" %s()\n %s:%d +0x%zx\n", info.function, StripPathPrefix(info.file, common_flags()->strip_path_prefix), info.line, (void *)info.module_offset); } } static void PrintMop(const ReportMop *mop, bool first) { Printf("\n"); Printf("%s at %p by ", (first ? (mop->write ? "Write" : "Read") : (mop->write ? "Previous write" : "Previous read")), mop->addr); if (mop->tid == kMainThreadId) Printf("main goroutine:\n"); else Printf("goroutine %d:\n", mop->tid); PrintStack(mop->stack); } static void PrintLocation(const ReportLocation *loc) { switch (loc->type) { case ReportLocationHeap: { Printf("\n"); Printf("Heap block of size %zu at %p allocated by ", loc->heap_chunk_size, loc->heap_chunk_start); if (loc->tid == kMainThreadId) Printf("main goroutine:\n"); else Printf("goroutine %d:\n", loc->tid); PrintStack(loc->stack); break; } case ReportLocationGlobal: { Printf("\n"); Printf("Global var %s of size %zu at %p declared at %s:%zu\n", loc->global.name, loc->global.size, loc->global.start, loc->global.file, loc->global.line); break; } default: break; } } static void PrintThread(const ReportThread *rt) { if (rt->id == kMainThreadId) return; Printf("\n"); Printf("Goroutine %d (%s) created at:\n", rt->id, rt->running ? "running" : "finished"); PrintStack(rt->stack); } void PrintReport(const ReportDesc *rep) { Printf("==================\n"); if (rep->typ == ReportTypeRace) { Printf("WARNING: DATA RACE"); for (uptr i = 0; i < rep->mops.Size(); i++) PrintMop(rep->mops[i], i == 0); for (uptr i = 0; i < rep->locs.Size(); i++) PrintLocation(rep->locs[i]); for (uptr i = 0; i < rep->threads.Size(); i++) PrintThread(rep->threads[i]); } else if (rep->typ == ReportTypeDeadlock) { Printf("WARNING: DEADLOCK\n"); for (uptr i = 0; i < rep->mutexes.Size(); i++) { Printf("Goroutine %d lock mutex %d while holding mutex %d:\n", 999, rep->mutexes[i]->id, rep->mutexes[(i+1) % rep->mutexes.Size()]->id); PrintStack(rep->stacks[2*i]); Printf("\n"); Printf("Mutex %d was previously locked here:\n", rep->mutexes[(i+1) % rep->mutexes.Size()]->id); PrintStack(rep->stacks[2*i + 1]); Printf("\n"); } } Printf("==================\n"); } #endif } // namespace __tsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/tsan/analyze_libtsan.sh0000775000175000017500000000272112631364652026444 0ustar mwhudsonmwhudson#!/bin/bash # # Script that prints information about generated code in TSan runtime. set -e set -u if [[ "$#" != 1 ]]; then echo "Usage: $0 /path/to/binary/built/with/tsan" exit 1 fi get_asm() { grep __tsan_$1.: -A 10000 ${OBJDUMP_CONTENTS} | \ awk "/[^:]$/ {print;} />:/ {c++; if (c == 2) {exit}}" } list="write1 \ write2 \ write4 \ write8 \ read1 \ read2 \ read4 \ read8 \ func_entry \ func_exit" BIN=$1 OUTPUT_DIR=$(mktemp -t -d analyze_libtsan_out.XXXXXXXX) OBJDUMP_CONTENTS=${OUTPUT_DIR}/libtsan_objdump NM_CONTENTS=${OUTPUT_DIR}/libtsan_nm objdump -d $BIN > ${OBJDUMP_CONTENTS} nm -S $BIN | grep "__tsan_" > ${NM_CONTENTS} for f in $list; do file=${OUTPUT_DIR}/asm_$f.s get_asm $f > $file tot=$(wc -l < $file) size=$(grep __tsan_$f$ ${NM_CONTENTS} | awk --non-decimal-data '{print ("0x"$2)+0}') rsp=$(grep '(%rsp)' $file | wc -l) push=$(grep 'push' $file | wc -l) pop=$(grep 'pop' $file | wc -l) call=$(grep 'call' $file | wc -l) load=$(egrep 'mov .*\,.*\(.*\)|cmp .*\,.*\(.*\)' $file | wc -l) store=$(egrep 'mov .*\(.*\),' $file | wc -l) mov=$(grep 'mov' $file | wc -l) lea=$(grep 'lea' $file | wc -l) sh=$(grep 'shr\|shl' $file | wc -l) cmp=$(grep 'cmp\|test' $file | wc -l) printf "%10s tot %3d; size %4d; rsp %d; push %d; pop %d; call %d; load %2d; store %2d; sh %3d; mov %3d; lea %3d; cmp %3d\n" \ $f $tot $size $rsp $push $pop $call $load $store $sh $mov $lea $cmp; done golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/0000775000175000017500000000000013040224626023041 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan.cc0000664000175000017500000003661612757622737024502 0ustar mwhudsonmwhudson//===-- dfsan.cc ----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of DataFlowSanitizer. // // DataFlowSanitizer runtime. This file defines the public interface to // DataFlowSanitizer as well as the definition of certain runtime functions // called automatically by the compiler (specifically the instrumentation pass // in llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp). // // The public interface is defined in include/sanitizer/dfsan_interface.h whose // functions are prefixed dfsan_ while the compiler interface functions are // prefixed __dfsan_. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_libc.h" #include "dfsan/dfsan.h" using namespace __dfsan; typedef atomic_uint16_t atomic_dfsan_label; static const dfsan_label kInitializingLabel = -1; static const uptr kNumLabels = 1 << (sizeof(dfsan_label) * 8); static atomic_dfsan_label __dfsan_last_label; static dfsan_label_info __dfsan_label_info[kNumLabels]; Flags __dfsan::flags_data; SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL dfsan_label __dfsan_retval_tls; SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL dfsan_label __dfsan_arg_tls[64]; SANITIZER_INTERFACE_ATTRIBUTE uptr __dfsan_shadow_ptr_mask; // On Linux/x86_64, memory is laid out as follows: // // +--------------------+ 0x800000000000 (top of memory) // | application memory | // +--------------------+ 0x700000008000 (kAppAddr) // | | // | unused | // | | // +--------------------+ 0x200200000000 (kUnusedAddr) // | union table | // +--------------------+ 0x200000000000 (kUnionTableAddr) // | shadow memory | // +--------------------+ 0x000000010000 (kShadowAddr) // | reserved by kernel | // +--------------------+ 0x000000000000 // // To derive a shadow memory address from an application memory address, // bits 44-46 are cleared to bring the address into the range // [0x000000008000,0x100000000000). Then the address is shifted left by 1 to // account for the double byte representation of shadow labels and move the // address into the shadow memory range. See the function shadow_for below. // On Linux/MIPS64, memory is laid out as follows: // // +--------------------+ 0x10000000000 (top of memory) // | application memory | // +--------------------+ 0xF000008000 (kAppAddr) // | | // | unused | // | | // +--------------------+ 0x2200000000 (kUnusedAddr) // | union table | // +--------------------+ 0x2000000000 (kUnionTableAddr) // | shadow memory | // +--------------------+ 0x0000010000 (kShadowAddr) // | reserved by kernel | // +--------------------+ 0x0000000000 // On Linux/AArch64 (39-bit VMA), memory is laid out as follow: // // +--------------------+ 0x8000000000 (top of memory) // | application memory | // +--------------------+ 0x7000008000 (kAppAddr) // | | // | unused | // | | // +--------------------+ 0x1200000000 (kUnusedAddr) // | union table | // +--------------------+ 0x1000000000 (kUnionTableAddr) // | shadow memory | // +--------------------+ 0x0000010000 (kShadowAddr) // | reserved by kernel | // +--------------------+ 0x0000000000 // On Linux/AArch64 (42-bit VMA), memory is laid out as follow: // // +--------------------+ 0x40000000000 (top of memory) // | application memory | // +--------------------+ 0x3ff00008000 (kAppAddr) // | | // | unused | // | | // +--------------------+ 0x1200000000 (kUnusedAddr) // | union table | // +--------------------+ 0x8000000000 (kUnionTableAddr) // | shadow memory | // +--------------------+ 0x0000010000 (kShadowAddr) // | reserved by kernel | // +--------------------+ 0x0000000000 // On Linux/AArch64 (48-bit VMA), memory is laid out as follow: // // +--------------------+ 0x1000000000000 (top of memory) // | application memory | // +--------------------+ 0xffff00008000 (kAppAddr) // | unused | // +--------------------+ 0xaaaab0000000 (top of PIE address) // | application PIE | // +--------------------+ 0xaaaaa0000000 (top of PIE address) // | | // | unused | // | | // +--------------------+ 0x1200000000 (kUnusedAddr) // | union table | // +--------------------+ 0x8000000000 (kUnionTableAddr) // | shadow memory | // +--------------------+ 0x0000010000 (kShadowAddr) // | reserved by kernel | // +--------------------+ 0x0000000000 typedef atomic_dfsan_label dfsan_union_table_t[kNumLabels][kNumLabels]; #ifdef DFSAN_RUNTIME_VMA // Runtime detected VMA size. int __dfsan::vmaSize; #endif static uptr UnusedAddr() { return MappingArchImpl() + sizeof(dfsan_union_table_t); } static atomic_dfsan_label *union_table(dfsan_label l1, dfsan_label l2) { return &(*(dfsan_union_table_t *) UnionTableAddr())[l1][l2]; } // Checks we do not run out of labels. static void dfsan_check_label(dfsan_label label) { if (label == kInitializingLabel) { Report("FATAL: DataFlowSanitizer: out of labels\n"); Die(); } } // Resolves the union of two unequal labels. Nonequality is a precondition for // this function (the instrumentation pass inlines the equality test). extern "C" SANITIZER_INTERFACE_ATTRIBUTE dfsan_label __dfsan_union(dfsan_label l1, dfsan_label l2) { DCHECK_NE(l1, l2); if (l1 == 0) return l2; if (l2 == 0) return l1; if (l1 > l2) Swap(l1, l2); atomic_dfsan_label *table_ent = union_table(l1, l2); // We need to deal with the case where two threads concurrently request // a union of the same pair of labels. If the table entry is uninitialized, // (i.e. 0) use a compare-exchange to set the entry to kInitializingLabel // (i.e. -1) to mark that we are initializing it. dfsan_label label = 0; if (atomic_compare_exchange_strong(table_ent, &label, kInitializingLabel, memory_order_acquire)) { // Check whether l2 subsumes l1. We don't need to check whether l1 // subsumes l2 because we are guaranteed here that l1 < l2, and (at least // in the cases we are interested in) a label may only subsume labels // created earlier (i.e. with a lower numerical value). if (__dfsan_label_info[l2].l1 == l1 || __dfsan_label_info[l2].l2 == l1) { label = l2; } else { label = atomic_fetch_add(&__dfsan_last_label, 1, memory_order_relaxed) + 1; dfsan_check_label(label); __dfsan_label_info[label].l1 = l1; __dfsan_label_info[label].l2 = l2; } atomic_store(table_ent, label, memory_order_release); } else if (label == kInitializingLabel) { // Another thread is initializing the entry. Wait until it is finished. do { internal_sched_yield(); label = atomic_load(table_ent, memory_order_acquire); } while (label == kInitializingLabel); } return label; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE dfsan_label __dfsan_union_load(const dfsan_label *ls, uptr n) { dfsan_label label = ls[0]; for (uptr i = 1; i != n; ++i) { dfsan_label next_label = ls[i]; if (label != next_label) label = __dfsan_union(label, next_label); } return label; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __dfsan_unimplemented(char *fname) { if (flags().warn_unimplemented) Report("WARNING: DataFlowSanitizer: call to uninstrumented function %s\n", fname); } // Use '-mllvm -dfsan-debug-nonzero-labels' and break on this function // to try to figure out where labels are being introduced in a nominally // label-free program. extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __dfsan_nonzero_label() { if (flags().warn_nonzero_labels) Report("WARNING: DataFlowSanitizer: saw nonzero label\n"); } // Indirect call to an uninstrumented vararg function. We don't have a way of // handling these at the moment. extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __dfsan_vararg_wrapper(const char *fname) { Report("FATAL: DataFlowSanitizer: unsupported indirect call to vararg " "function %s\n", fname); Die(); } // Like __dfsan_union, but for use from the client or custom functions. Hence // the equality comparison is done here before calling __dfsan_union. SANITIZER_INTERFACE_ATTRIBUTE dfsan_label dfsan_union(dfsan_label l1, dfsan_label l2) { if (l1 == l2) return l1; return __dfsan_union(l1, l2); } extern "C" SANITIZER_INTERFACE_ATTRIBUTE dfsan_label dfsan_create_label(const char *desc, void *userdata) { dfsan_label label = atomic_fetch_add(&__dfsan_last_label, 1, memory_order_relaxed) + 1; dfsan_check_label(label); __dfsan_label_info[label].l1 = __dfsan_label_info[label].l2 = 0; __dfsan_label_info[label].desc = desc; __dfsan_label_info[label].userdata = userdata; return label; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __dfsan_set_label(dfsan_label label, void *addr, uptr size) { for (dfsan_label *labelp = shadow_for(addr); size != 0; --size, ++labelp) { // Don't write the label if it is already the value we need it to be. // In a program where most addresses are not labeled, it is common that // a page of shadow memory is entirely zeroed. The Linux copy-on-write // implementation will share all of the zeroed pages, making a copy of a // page when any value is written. The un-sharing will happen even if // the value written does not change the value in memory. Avoiding the // write when both |label| and |*labelp| are zero dramatically reduces // the amount of real memory used by large programs. if (label == *labelp) continue; *labelp = label; } } SANITIZER_INTERFACE_ATTRIBUTE void dfsan_set_label(dfsan_label label, void *addr, uptr size) { __dfsan_set_label(label, addr, size); } SANITIZER_INTERFACE_ATTRIBUTE void dfsan_add_label(dfsan_label label, void *addr, uptr size) { for (dfsan_label *labelp = shadow_for(addr); size != 0; --size, ++labelp) if (*labelp != label) *labelp = __dfsan_union(*labelp, label); } // Unlike the other dfsan interface functions the behavior of this function // depends on the label of one of its arguments. Hence it is implemented as a // custom function. extern "C" SANITIZER_INTERFACE_ATTRIBUTE dfsan_label __dfsw_dfsan_get_label(long data, dfsan_label data_label, dfsan_label *ret_label) { *ret_label = 0; return data_label; } SANITIZER_INTERFACE_ATTRIBUTE dfsan_label dfsan_read_label(const void *addr, uptr size) { if (size == 0) return 0; return __dfsan_union_load(shadow_for(addr), size); } extern "C" SANITIZER_INTERFACE_ATTRIBUTE const struct dfsan_label_info *dfsan_get_label_info(dfsan_label label) { return &__dfsan_label_info[label]; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE int dfsan_has_label(dfsan_label label, dfsan_label elem) { if (label == elem) return true; const dfsan_label_info *info = dfsan_get_label_info(label); if (info->l1 != 0) { return dfsan_has_label(info->l1, elem) || dfsan_has_label(info->l2, elem); } else { return false; } } extern "C" SANITIZER_INTERFACE_ATTRIBUTE dfsan_label dfsan_has_label_with_desc(dfsan_label label, const char *desc) { const dfsan_label_info *info = dfsan_get_label_info(label); if (info->l1 != 0) { return dfsan_has_label_with_desc(info->l1, desc) || dfsan_has_label_with_desc(info->l2, desc); } else { return internal_strcmp(desc, info->desc) == 0; } } extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr dfsan_get_label_count(void) { dfsan_label max_label_allocated = atomic_load(&__dfsan_last_label, memory_order_relaxed); return static_cast(max_label_allocated); } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void dfsan_dump_labels(int fd) { dfsan_label last_label = atomic_load(&__dfsan_last_label, memory_order_relaxed); for (uptr l = 1; l <= last_label; ++l) { char buf[64]; internal_snprintf(buf, sizeof(buf), "%u %u %u ", l, __dfsan_label_info[l].l1, __dfsan_label_info[l].l2); WriteToFile(fd, buf, internal_strlen(buf)); if (__dfsan_label_info[l].l1 == 0 && __dfsan_label_info[l].desc) { WriteToFile(fd, __dfsan_label_info[l].desc, internal_strlen(__dfsan_label_info[l].desc)); } WriteToFile(fd, "\n", 1); } } void Flags::SetDefaults() { #define DFSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "dfsan_flags.inc" #undef DFSAN_FLAG } static void RegisterDfsanFlags(FlagParser *parser, Flags *f) { #define DFSAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "dfsan_flags.inc" #undef DFSAN_FLAG } static void InitializeFlags() { SetCommonFlagsDefaults(); flags().SetDefaults(); FlagParser parser; RegisterCommonFlags(&parser); RegisterDfsanFlags(&parser, &flags()); parser.ParseString(GetEnv("DFSAN_OPTIONS")); InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) parser.PrintFlagDescriptions(); } static void InitializePlatformEarly() { AvoidCVE_2016_2143(); #ifdef DFSAN_RUNTIME_VMA __dfsan::vmaSize = (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1); if (__dfsan::vmaSize == 39 || __dfsan::vmaSize == 42 || __dfsan::vmaSize == 48) { __dfsan_shadow_ptr_mask = ShadowMask(); } else { Printf("FATAL: DataFlowSanitizer: unsupported VMA range\n"); Printf("FATAL: Found %d - Supported 39, 42, and 48\n", __dfsan::vmaSize); Die(); } #endif } static void dfsan_fini() { if (internal_strcmp(flags().dump_labels_at_exit, "") != 0) { fd_t fd = OpenFile(flags().dump_labels_at_exit, WrOnly); if (fd == kInvalidFd) { Report("WARNING: DataFlowSanitizer: unable to open output file %s\n", flags().dump_labels_at_exit); return; } Report("INFO: DataFlowSanitizer: dumping labels to %s\n", flags().dump_labels_at_exit); dfsan_dump_labels(fd); CloseFile(fd); } } static void dfsan_init(int argc, char **argv, char **envp) { InitializeFlags(); InitializePlatformEarly(); MmapFixedNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr()); // Protect the region of memory we don't use, to preserve the one-to-one // mapping from application to shadow memory. But if ASLR is disabled, Linux // will load our executable in the middle of our unused region. This mostly // works so long as the program doesn't use too much memory. We support this // case by disabling memory protection when ASLR is disabled. uptr init_addr = (uptr)&dfsan_init; if (!(init_addr >= UnusedAddr() && init_addr < AppAddr())) MmapFixedNoAccess(UnusedAddr(), AppAddr() - UnusedAddr()); InitializeInterceptors(); // Register the fini callback to run when the program terminates successfully // or it is killed by the runtime. Atexit(dfsan_fini); AddDieCallback(dfsan_fini); __dfsan_label_info[kInitializingLabel].desc = ""; } #if SANITIZER_CAN_USE_PREINIT_ARRAY __attribute__((section(".preinit_array"), used)) static void (*dfsan_init_ptr)(int, char **, char **) = dfsan_init; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/scripts/0000775000175000017500000000000013040224626024530 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/scripts/check_custom_wrappers.sh0000775000175000017500000000310012522514236031456 0ustar mwhudsonmwhudson#!/bin/sh DFSAN_DIR=$(dirname "$0")/../ DFSAN_CUSTOM_TESTS=${DFSAN_DIR}/../../test/dfsan/custom.cc DFSAN_CUSTOM_WRAPPERS=${DFSAN_DIR}/dfsan_custom.cc DFSAN_ABI_LIST=${DFSAN_DIR}/done_abilist.txt DIFFOUT=$(mktemp -q /tmp/tmp.XXXXXXXXXX) ERRORLOG=$(mktemp -q /tmp/tmp.XXXXXXXXXX) DIFF_A=$(mktemp -q /tmp/tmp.XXXXXXXXXX) DIFF_B=$(mktemp -q /tmp/tmp.XXXXXXXXXX) on_exit() { rm -f ${DIFFOUT} 2> /dev/null rm -f ${ERRORLOG} 2> /dev/null rm -f ${DIFF_A} 2> /dev/null rm -f ${DIFF_B} 2> /dev/null } # Ignore __sanitizer_cov_trace* because they are implemented elsewhere. trap on_exit EXIT grep -E "^fun:.*=custom" ${DFSAN_ABI_LIST} \ | grep -v "dfsan_get_label\|__sanitizer_cov_trace" \ | sed "s/^fun:\(.*\)=custom.*/\1/" | sort > $DIFF_A grep -E "__dfsw.*\(" ${DFSAN_CUSTOM_WRAPPERS} \ | sed "s/.*__dfsw_\(.*\)(.*/\1/" | sort > $DIFF_B diff -u $DIFF_A $DIFF_B > ${DIFFOUT} if [ $? -ne 0 ] then echo -n "The following differences between the ABI list and ">> ${ERRORLOG} echo "the implemented custom wrappers have been found:" >> ${ERRORLOG} cat ${DIFFOUT} >> ${ERRORLOG} fi grep -E __dfsw_ ${DFSAN_CUSTOM_WRAPPERS} \ | sed "s/.*__dfsw_\([^(]*\).*/\1/" | sort > $DIFF_A grep -E "^[[:space:]]*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} \ | sed "s/.*test_\(.*\)();/\1/" | sort > $DIFF_B diff -u $DIFF_A $DIFF_B > ${DIFFOUT} if [ $? -ne 0 ] then echo -n "The following differences between the implemented " >> ${ERRORLOG} echo "custom wrappers and the tests have been found:" >> ${ERRORLOG} cat ${DIFFOUT} >> ${ERRORLOG} fi if [ -s ${ERRORLOG} ] then cat ${ERRORLOG} exit 1 fi golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/scripts/build-libc-list.py0000775000175000017500000000640712426456200030075 0ustar mwhudsonmwhudson#!/usr/bin/env python #===- lib/dfsan/scripts/build-libc-list.py ---------------------------------===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===------------------------------------------------------------------------===# # The purpose of this script is to identify every function symbol in a set of # libraries (in this case, libc and libgcc) so that they can be marked as # uninstrumented, thus allowing the instrumentation pass to treat calls to those # functions correctly. import os import subprocess import sys from optparse import OptionParser def defined_function_list(object): functions = [] readelf_proc = subprocess.Popen(['readelf', '-s', '-W', object], stdout=subprocess.PIPE) readelf = readelf_proc.communicate()[0].split('\n') if readelf_proc.returncode != 0: raise subprocess.CalledProcessError(readelf_proc.returncode, 'readelf') for line in readelf: if (line[31:35] == 'FUNC' or line[31:36] == 'IFUNC') and \ line[39:44] != 'LOCAL' and \ line[55:58] != 'UND': function_name = line[59:].split('@')[0] functions.append(function_name) return functions p = OptionParser() p.add_option('--libc-dso-path', metavar='PATH', help='path to libc DSO directory', default='/lib/x86_64-linux-gnu') p.add_option('--libc-archive-path', metavar='PATH', help='path to libc archive directory', default='/usr/lib/x86_64-linux-gnu') p.add_option('--libgcc-dso-path', metavar='PATH', help='path to libgcc DSO directory', default='/lib/x86_64-linux-gnu') p.add_option('--libgcc-archive-path', metavar='PATH', help='path to libgcc archive directory', default='/usr/lib/gcc/x86_64-linux-gnu/4.6') p.add_option('--with-libstdcxx', action='store_true', dest='with_libstdcxx', help='include libstdc++ in the list (inadvisable)') p.add_option('--libstdcxx-dso-path', metavar='PATH', help='path to libstdc++ DSO directory', default='/usr/lib/x86_64-linux-gnu') (options, args) = p.parse_args() libs = [os.path.join(options.libc_dso_path, name) for name in ['ld-linux-x86-64.so.2', 'libanl.so.1', 'libBrokenLocale.so.1', 'libcidn.so.1', 'libcrypt.so.1', 'libc.so.6', 'libdl.so.2', 'libm.so.6', 'libnsl.so.1', 'libpthread.so.0', 'libresolv.so.2', 'librt.so.1', 'libthread_db.so.1', 'libutil.so.1']] libs += [os.path.join(options.libc_archive_path, name) for name in ['libc_nonshared.a', 'libpthread_nonshared.a']] libs.append(os.path.join(options.libgcc_dso_path, 'libgcc_s.so.1')) libs.append(os.path.join(options.libgcc_archive_path, 'libgcc.a')) if options.with_libstdcxx: libs.append(os.path.join(options.libstdcxx_dso_path, 'libstdc++.so.6')) functions = [] for l in libs: if os.path.exists(l): functions += defined_function_list(l) else: print >> sys.stderr, 'warning: library %s not found' % l functions = list(set(functions)) functions.sort() for f in functions: print 'fun:%s=uninstrumented' % f golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan_custom.cc0000664000175000017500000011164412603076275026055 0ustar mwhudsonmwhudson//===-- dfsan.cc ----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of DataFlowSanitizer. // // This file defines the custom functions listed in done_abilist.txt. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_linux.h" #include "dfsan/dfsan.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace __dfsan; #define CALL_WEAK_INTERCEPTOR_HOOK(f, ...) \ do { \ if (f) \ f(__VA_ARGS__); \ } while (false) #define DECLARE_WEAK_INTERCEPTOR_HOOK(f, ...) \ SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void f(__VA_ARGS__); extern "C" { SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_stat(const char *path, struct stat *buf, dfsan_label path_label, dfsan_label buf_label, dfsan_label *ret_label) { int ret = stat(path, buf); if (ret == 0) dfsan_set_label(0, buf, sizeof(struct stat)); *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_fstat(int fd, struct stat *buf, dfsan_label fd_label, dfsan_label buf_label, dfsan_label *ret_label) { int ret = fstat(fd, buf); if (ret == 0) dfsan_set_label(0, buf, sizeof(struct stat)); *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_strchr(const char *s, int c, dfsan_label s_label, dfsan_label c_label, dfsan_label *ret_label) { for (size_t i = 0;; ++i) { if (s[i] == c || s[i] == 0) { if (flags().strict_data_dependencies) { *ret_label = s_label; } else { *ret_label = dfsan_union(dfsan_read_label(s, i + 1), dfsan_union(s_label, c_label)); } return s[i] == 0 ? nullptr : const_cast(s+i); } } } DECLARE_WEAK_INTERCEPTOR_HOOK(dfsan_weak_hook_memcmp, uptr caller_pc, const void *s1, const void *s2, size_t n, dfsan_label s1_label, dfsan_label s2_label, dfsan_label n_label) SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_memcmp(const void *s1, const void *s2, size_t n, dfsan_label s1_label, dfsan_label s2_label, dfsan_label n_label, dfsan_label *ret_label) { CALL_WEAK_INTERCEPTOR_HOOK(dfsan_weak_hook_memcmp, GET_CALLER_PC(), s1, s2, n, s1_label, s2_label, n_label); const char *cs1 = (const char *) s1, *cs2 = (const char *) s2; for (size_t i = 0; i != n; ++i) { if (cs1[i] != cs2[i]) { if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_union(dfsan_read_label(cs1, i + 1), dfsan_read_label(cs2, i + 1)); } return cs1[i] - cs2[i]; } } if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_union(dfsan_read_label(cs1, n), dfsan_read_label(cs2, n)); } return 0; } DECLARE_WEAK_INTERCEPTOR_HOOK(dfsan_weak_hook_strcmp, uptr caller_pc, const char *s1, const char *s2, dfsan_label s1_label, dfsan_label s2_label) SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_strcmp(const char *s1, const char *s2, dfsan_label s1_label, dfsan_label s2_label, dfsan_label *ret_label) { CALL_WEAK_INTERCEPTOR_HOOK(dfsan_weak_hook_strcmp, GET_CALLER_PC(), s1, s2, s1_label, s2_label); for (size_t i = 0;; ++i) { if (s1[i] != s2[i] || s1[i] == 0 || s2[i] == 0) { if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_union(dfsan_read_label(s1, i + 1), dfsan_read_label(s2, i + 1)); } return s1[i] - s2[i]; } } return 0; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_strcasecmp(const char *s1, const char *s2, dfsan_label s1_label, dfsan_label s2_label, dfsan_label *ret_label) { for (size_t i = 0;; ++i) { if (tolower(s1[i]) != tolower(s2[i]) || s1[i] == 0 || s2[i] == 0) { if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_union(dfsan_read_label(s1, i + 1), dfsan_read_label(s2, i + 1)); } return s1[i] - s2[i]; } } return 0; } DECLARE_WEAK_INTERCEPTOR_HOOK(dfsan_weak_hook_strncmp, uptr caller_pc, const char *s1, const char *s2, size_t n, dfsan_label s1_label, dfsan_label s2_label, dfsan_label n_label) SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_strncmp(const char *s1, const char *s2, size_t n, dfsan_label s1_label, dfsan_label s2_label, dfsan_label n_label, dfsan_label *ret_label) { if (n == 0) { *ret_label = 0; return 0; } CALL_WEAK_INTERCEPTOR_HOOK(dfsan_weak_hook_strncmp, GET_CALLER_PC(), s1, s2, n, s1_label, s2_label, n_label); for (size_t i = 0;; ++i) { if (s1[i] != s2[i] || s1[i] == 0 || s2[i] == 0 || i == n - 1) { if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_union(dfsan_read_label(s1, i + 1), dfsan_read_label(s2, i + 1)); } return s1[i] - s2[i]; } } return 0; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_strncasecmp(const char *s1, const char *s2, size_t n, dfsan_label s1_label, dfsan_label s2_label, dfsan_label n_label, dfsan_label *ret_label) { if (n == 0) { *ret_label = 0; return 0; } for (size_t i = 0;; ++i) { if (tolower(s1[i]) != tolower(s2[i]) || s1[i] == 0 || s2[i] == 0 || i == n - 1) { if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_union(dfsan_read_label(s1, i + 1), dfsan_read_label(s2, i + 1)); } return s1[i] - s2[i]; } } return 0; } SANITIZER_INTERFACE_ATTRIBUTE void *__dfsw_calloc(size_t nmemb, size_t size, dfsan_label nmemb_label, dfsan_label size_label, dfsan_label *ret_label) { void *p = calloc(nmemb, size); dfsan_set_label(0, p, nmemb * size); *ret_label = 0; return p; } SANITIZER_INTERFACE_ATTRIBUTE size_t __dfsw_strlen(const char *s, dfsan_label s_label, dfsan_label *ret_label) { size_t ret = strlen(s); if (flags().strict_data_dependencies) { *ret_label = 0; } else { *ret_label = dfsan_read_label(s, ret + 1); } return ret; } static void *dfsan_memcpy(void *dest, const void *src, size_t n) { dfsan_label *sdest = shadow_for(dest); const dfsan_label *ssrc = shadow_for(src); internal_memcpy((void *)sdest, (const void *)ssrc, n * sizeof(dfsan_label)); return internal_memcpy(dest, src, n); } static void dfsan_memset(void *s, int c, dfsan_label c_label, size_t n) { internal_memset(s, c, n); dfsan_set_label(c_label, s, n); } SANITIZER_INTERFACE_ATTRIBUTE void *__dfsw_memcpy(void *dest, const void *src, size_t n, dfsan_label dest_label, dfsan_label src_label, dfsan_label n_label, dfsan_label *ret_label) { *ret_label = dest_label; return dfsan_memcpy(dest, src, n); } SANITIZER_INTERFACE_ATTRIBUTE void *__dfsw_memset(void *s, int c, size_t n, dfsan_label s_label, dfsan_label c_label, dfsan_label n_label, dfsan_label *ret_label) { dfsan_memset(s, c, c_label, n); *ret_label = s_label; return s; } SANITIZER_INTERFACE_ATTRIBUTE char * __dfsw_strdup(const char *s, dfsan_label s_label, dfsan_label *ret_label) { size_t len = strlen(s); void *p = malloc(len+1); dfsan_memcpy(p, s, len+1); *ret_label = 0; return static_cast(p); } SANITIZER_INTERFACE_ATTRIBUTE char * __dfsw_strncpy(char *s1, const char *s2, size_t n, dfsan_label s1_label, dfsan_label s2_label, dfsan_label n_label, dfsan_label *ret_label) { size_t len = strlen(s2); if (len < n) { dfsan_memcpy(s1, s2, len+1); dfsan_memset(s1+len+1, 0, 0, n-len-1); } else { dfsan_memcpy(s1, s2, n); } *ret_label = s1_label; return s1; } SANITIZER_INTERFACE_ATTRIBUTE ssize_t __dfsw_pread(int fd, void *buf, size_t count, off_t offset, dfsan_label fd_label, dfsan_label buf_label, dfsan_label count_label, dfsan_label offset_label, dfsan_label *ret_label) { ssize_t ret = pread(fd, buf, count, offset); if (ret > 0) dfsan_set_label(0, buf, ret); *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE ssize_t __dfsw_read(int fd, void *buf, size_t count, dfsan_label fd_label, dfsan_label buf_label, dfsan_label count_label, dfsan_label *ret_label) { ssize_t ret = read(fd, buf, count); if (ret > 0) dfsan_set_label(0, buf, ret); *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_clock_gettime(clockid_t clk_id, struct timespec *tp, dfsan_label clk_id_label, dfsan_label tp_label, dfsan_label *ret_label) { int ret = clock_gettime(clk_id, tp); if (ret == 0) dfsan_set_label(0, tp, sizeof(struct timespec)); *ret_label = 0; return ret; } static void unpoison(const void *ptr, uptr size) { dfsan_set_label(0, const_cast(ptr), size); } // dlopen() ultimately calls mmap() down inside the loader, which generally // doesn't participate in dynamic symbol resolution. Therefore we won't // intercept its calls to mmap, and we have to hook it here. SANITIZER_INTERFACE_ATTRIBUTE void * __dfsw_dlopen(const char *filename, int flag, dfsan_label filename_label, dfsan_label flag_label, dfsan_label *ret_label) { void *handle = dlopen(filename, flag); link_map *map = GET_LINK_MAP_BY_DLOPEN_HANDLE(handle); if (map) ForEachMappedRegion(map, unpoison); *ret_label = 0; return handle; } struct pthread_create_info { void *(*start_routine_trampoline)(void *, void *, dfsan_label, dfsan_label *); void *start_routine; void *arg; }; static void *pthread_create_cb(void *p) { pthread_create_info pci(*(pthread_create_info *)p); free(p); dfsan_label ret_label; return pci.start_routine_trampoline(pci.start_routine, pci.arg, 0, &ret_label); } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_pthread_create( pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine_trampoline)(void *, void *, dfsan_label, dfsan_label *), void *start_routine, void *arg, dfsan_label thread_label, dfsan_label attr_label, dfsan_label start_routine_label, dfsan_label arg_label, dfsan_label *ret_label) { pthread_create_info *pci = (pthread_create_info *)malloc(sizeof(pthread_create_info)); pci->start_routine_trampoline = start_routine_trampoline; pci->start_routine = start_routine; pci->arg = arg; int rv = pthread_create(thread, attr, pthread_create_cb, (void *)pci); if (rv != 0) free(pci); *ret_label = 0; return rv; } struct dl_iterate_phdr_info { int (*callback_trampoline)(void *callback, struct dl_phdr_info *info, size_t size, void *data, dfsan_label info_label, dfsan_label size_label, dfsan_label data_label, dfsan_label *ret_label); void *callback; void *data; }; int dl_iterate_phdr_cb(struct dl_phdr_info *info, size_t size, void *data) { dl_iterate_phdr_info *dipi = (dl_iterate_phdr_info *)data; dfsan_set_label(0, *info); dfsan_set_label(0, const_cast(info->dlpi_name), strlen(info->dlpi_name) + 1); dfsan_set_label( 0, const_cast(reinterpret_cast(info->dlpi_phdr)), sizeof(*info->dlpi_phdr) * info->dlpi_phnum); dfsan_label ret_label; return dipi->callback_trampoline(dipi->callback, info, size, dipi->data, 0, 0, 0, &ret_label); } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_dl_iterate_phdr( int (*callback_trampoline)(void *callback, struct dl_phdr_info *info, size_t size, void *data, dfsan_label info_label, dfsan_label size_label, dfsan_label data_label, dfsan_label *ret_label), void *callback, void *data, dfsan_label callback_label, dfsan_label data_label, dfsan_label *ret_label) { dl_iterate_phdr_info dipi = { callback_trampoline, callback, data }; *ret_label = 0; return dl_iterate_phdr(dl_iterate_phdr_cb, &dipi); } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_ctime_r(const time_t *timep, char *buf, dfsan_label timep_label, dfsan_label buf_label, dfsan_label *ret_label) { char *ret = ctime_r(timep, buf); if (ret) { dfsan_set_label(dfsan_read_label(timep, sizeof(time_t)), buf, strlen(buf) + 1); *ret_label = buf_label; } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_fgets(char *s, int size, FILE *stream, dfsan_label s_label, dfsan_label size_label, dfsan_label stream_label, dfsan_label *ret_label) { char *ret = fgets(s, size, stream); if (ret) { dfsan_set_label(0, ret, strlen(ret) + 1); *ret_label = s_label; } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_getcwd(char *buf, size_t size, dfsan_label buf_label, dfsan_label size_label, dfsan_label *ret_label) { char *ret = getcwd(buf, size); if (ret) { dfsan_set_label(0, ret, strlen(ret) + 1); *ret_label = buf_label; } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_get_current_dir_name(dfsan_label *ret_label) { char *ret = get_current_dir_name(); if (ret) { dfsan_set_label(0, ret, strlen(ret) + 1); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_gethostname(char *name, size_t len, dfsan_label name_label, dfsan_label len_label, dfsan_label *ret_label) { int ret = gethostname(name, len); if (ret == 0) { dfsan_set_label(0, name, strlen(name) + 1); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_getrlimit(int resource, struct rlimit *rlim, dfsan_label resource_label, dfsan_label rlim_label, dfsan_label *ret_label) { int ret = getrlimit(resource, rlim); if (ret == 0) { dfsan_set_label(0, rlim, sizeof(struct rlimit)); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_getrusage(int who, struct rusage *usage, dfsan_label who_label, dfsan_label usage_label, dfsan_label *ret_label) { int ret = getrusage(who, usage); if (ret == 0) { dfsan_set_label(0, usage, sizeof(struct rusage)); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_strcpy(char *dest, const char *src, dfsan_label dst_label, dfsan_label src_label, dfsan_label *ret_label) { char *ret = strcpy(dest, src); if (ret) { internal_memcpy(shadow_for(dest), shadow_for(src), sizeof(dfsan_label) * (strlen(src) + 1)); } *ret_label = dst_label; return ret; } SANITIZER_INTERFACE_ATTRIBUTE long int __dfsw_strtol(const char *nptr, char **endptr, int base, dfsan_label nptr_label, dfsan_label endptr_label, dfsan_label base_label, dfsan_label *ret_label) { char *tmp_endptr; long int ret = strtol(nptr, &tmp_endptr, base); if (endptr) { *endptr = tmp_endptr; } if (tmp_endptr > nptr) { // If *tmp_endptr is '\0' include its label as well. *ret_label = dfsan_union( base_label, dfsan_read_label(nptr, tmp_endptr - nptr + (*tmp_endptr ? 0 : 1))); } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE double __dfsw_strtod(const char *nptr, char **endptr, dfsan_label nptr_label, dfsan_label endptr_label, dfsan_label *ret_label) { char *tmp_endptr; double ret = strtod(nptr, &tmp_endptr); if (endptr) { *endptr = tmp_endptr; } if (tmp_endptr > nptr) { // If *tmp_endptr is '\0' include its label as well. *ret_label = dfsan_read_label( nptr, tmp_endptr - nptr + (*tmp_endptr ? 0 : 1)); } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE long long int __dfsw_strtoll(const char *nptr, char **endptr, int base, dfsan_label nptr_label, dfsan_label endptr_label, dfsan_label base_label, dfsan_label *ret_label) { char *tmp_endptr; long long int ret = strtoll(nptr, &tmp_endptr, base); if (endptr) { *endptr = tmp_endptr; } if (tmp_endptr > nptr) { // If *tmp_endptr is '\0' include its label as well. *ret_label = dfsan_union( base_label, dfsan_read_label(nptr, tmp_endptr - nptr + (*tmp_endptr ? 0 : 1))); } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE unsigned long int __dfsw_strtoul(const char *nptr, char **endptr, int base, dfsan_label nptr_label, dfsan_label endptr_label, dfsan_label base_label, dfsan_label *ret_label) { char *tmp_endptr; unsigned long int ret = strtoul(nptr, &tmp_endptr, base); if (endptr) { *endptr = tmp_endptr; } if (tmp_endptr > nptr) { // If *tmp_endptr is '\0' include its label as well. *ret_label = dfsan_union( base_label, dfsan_read_label(nptr, tmp_endptr - nptr + (*tmp_endptr ? 0 : 1))); } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE long long unsigned int __dfsw_strtoull(const char *nptr, char **endptr, dfsan_label nptr_label, int base, dfsan_label endptr_label, dfsan_label base_label, dfsan_label *ret_label) { char *tmp_endptr; long long unsigned int ret = strtoull(nptr, &tmp_endptr, base); if (endptr) { *endptr = tmp_endptr; } if (tmp_endptr > nptr) { // If *tmp_endptr is '\0' include its label as well. *ret_label = dfsan_union( base_label, dfsan_read_label(nptr, tmp_endptr - nptr + (*tmp_endptr ? 0 : 1))); } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE time_t __dfsw_time(time_t *t, dfsan_label t_label, dfsan_label *ret_label) { time_t ret = time(t); if (ret != (time_t) -1 && t) { dfsan_set_label(0, t, sizeof(time_t)); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_inet_pton(int af, const char *src, void *dst, dfsan_label af_label, dfsan_label src_label, dfsan_label dst_label, dfsan_label *ret_label) { int ret = inet_pton(af, src, dst); if (ret == 1) { dfsan_set_label(dfsan_read_label(src, strlen(src) + 1), dst, af == AF_INET ? sizeof(struct in_addr) : sizeof(in6_addr)); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE struct tm *__dfsw_localtime_r(const time_t *timep, struct tm *result, dfsan_label timep_label, dfsan_label result_label, dfsan_label *ret_label) { struct tm *ret = localtime_r(timep, result); if (ret) { dfsan_set_label(dfsan_read_label(timep, sizeof(time_t)), result, sizeof(struct tm)); *ret_label = result_label; } else { *ret_label = 0; } return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_getpwuid_r(id_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result, dfsan_label uid_label, dfsan_label pwd_label, dfsan_label buf_label, dfsan_label buflen_label, dfsan_label result_label, dfsan_label *ret_label) { // Store the data in pwd, the strings referenced from pwd in buf, and the // address of pwd in *result. On failure, NULL is stored in *result. int ret = getpwuid_r(uid, pwd, buf, buflen, result); if (ret == 0) { dfsan_set_label(0, pwd, sizeof(struct passwd)); dfsan_set_label(0, buf, strlen(buf) + 1); } *ret_label = 0; dfsan_set_label(0, result, sizeof(struct passwd*)); return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_poll(struct pollfd *fds, nfds_t nfds, int timeout, dfsan_label dfs_label, dfsan_label nfds_label, dfsan_label timeout_label, dfsan_label *ret_label) { int ret = poll(fds, nfds, timeout); if (ret >= 0) { for (; nfds > 0; --nfds) { dfsan_set_label(0, &fds[nfds - 1].revents, sizeof(fds[nfds - 1].revents)); } } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout, dfsan_label nfds_label, dfsan_label readfds_label, dfsan_label writefds_label, dfsan_label exceptfds_label, dfsan_label timeout_label, dfsan_label *ret_label) { int ret = select(nfds, readfds, writefds, exceptfds, timeout); // Clear everything (also on error) since their content is either set or // undefined. if (readfds) { dfsan_set_label(0, readfds, sizeof(fd_set)); } if (writefds) { dfsan_set_label(0, writefds, sizeof(fd_set)); } if (exceptfds) { dfsan_set_label(0, exceptfds, sizeof(fd_set)); } dfsan_set_label(0, timeout, sizeof(struct timeval)); *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask, dfsan_label pid_label, dfsan_label cpusetsize_label, dfsan_label mask_label, dfsan_label *ret_label) { int ret = sched_getaffinity(pid, cpusetsize, mask); if (ret == 0) { dfsan_set_label(0, mask, cpusetsize); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_sigemptyset(sigset_t *set, dfsan_label set_label, dfsan_label *ret_label) { int ret = sigemptyset(set); dfsan_set_label(0, set, sizeof(sigset_t)); return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact, dfsan_label signum_label, dfsan_label act_label, dfsan_label oldact_label, dfsan_label *ret_label) { int ret = sigaction(signum, act, oldact); if (oldact) { dfsan_set_label(0, oldact, sizeof(struct sigaction)); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_gettimeofday(struct timeval *tv, struct timezone *tz, dfsan_label tv_label, dfsan_label tz_label, dfsan_label *ret_label) { int ret = gettimeofday(tv, tz); if (tv) { dfsan_set_label(0, tv, sizeof(struct timeval)); } if (tz) { dfsan_set_label(0, tz, sizeof(struct timezone)); } *ret_label = 0; return ret; } SANITIZER_INTERFACE_ATTRIBUTE void *__dfsw_memchr(void *s, int c, size_t n, dfsan_label s_label, dfsan_label c_label, dfsan_label n_label, dfsan_label *ret_label) { void *ret = memchr(s, c, n); if (flags().strict_data_dependencies) { *ret_label = ret ? s_label : 0; } else { size_t len = ret ? reinterpret_cast(ret) - reinterpret_cast(s) + 1 : n; *ret_label = dfsan_union(dfsan_read_label(s, len), dfsan_union(s_label, c_label)); } return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_strrchr(char *s, int c, dfsan_label s_label, dfsan_label c_label, dfsan_label *ret_label) { char *ret = strrchr(s, c); if (flags().strict_data_dependencies) { *ret_label = ret ? s_label : 0; } else { *ret_label = dfsan_union(dfsan_read_label(s, strlen(s) + 1), dfsan_union(s_label, c_label)); } return ret; } SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_strstr(char *haystack, char *needle, dfsan_label haystack_label, dfsan_label needle_label, dfsan_label *ret_label) { char *ret = strstr(haystack, needle); if (flags().strict_data_dependencies) { *ret_label = ret ? haystack_label : 0; } else { size_t len = ret ? ret + strlen(needle) - haystack : strlen(haystack) + 1; *ret_label = dfsan_union(dfsan_read_label(haystack, len), dfsan_union(dfsan_read_label(needle, strlen(needle) + 1), dfsan_union(haystack_label, needle_label))); } return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_nanosleep(const struct timespec *req, struct timespec *rem, dfsan_label req_label, dfsan_label rem_label, dfsan_label *ret_label) { int ret = nanosleep(req, rem); *ret_label = 0; if (ret == -1) { // Interrupted by a signal, rem is filled with the remaining time. dfsan_set_label(0, rem, sizeof(struct timespec)); } return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_socketpair(int domain, int type, int protocol, int sv[2], dfsan_label domain_label, dfsan_label type_label, dfsan_label protocol_label, dfsan_label sv_label, dfsan_label *ret_label) { int ret = socketpair(domain, type, protocol, sv); *ret_label = 0; if (ret == 0) { dfsan_set_label(0, sv, sizeof(*sv) * 2); } return ret; } // Type of the trampoline function passed to the custom version of // dfsan_set_write_callback. typedef void (*write_trampoline_t)( void *callback, int fd, const void *buf, ssize_t count, dfsan_label fd_label, dfsan_label buf_label, dfsan_label count_label); // Calls to dfsan_set_write_callback() set the values in this struct. // Calls to the custom version of write() read (and invoke) them. static struct { write_trampoline_t write_callback_trampoline = nullptr; void *write_callback = nullptr; } write_callback_info; SANITIZER_INTERFACE_ATTRIBUTE void __dfsw_dfsan_set_write_callback( write_trampoline_t write_callback_trampoline, void *write_callback, dfsan_label write_callback_label, dfsan_label *ret_label) { write_callback_info.write_callback_trampoline = write_callback_trampoline; write_callback_info.write_callback = write_callback; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_write(int fd, const void *buf, size_t count, dfsan_label fd_label, dfsan_label buf_label, dfsan_label count_label, dfsan_label *ret_label) { if (write_callback_info.write_callback) { write_callback_info.write_callback_trampoline( write_callback_info.write_callback, fd, buf, count, fd_label, buf_label, count_label); } *ret_label = 0; return write(fd, buf, count); } } // namespace __dfsan // Type used to extract a dfsan_label with va_arg() typedef int dfsan_label_va; // Formats a chunk either a constant string or a single format directive (e.g., // '%.3f'). struct Formatter { Formatter(char *str_, const char *fmt_, size_t size_) : str(str_), str_off(0), size(size_), fmt_start(fmt_), fmt_cur(fmt_), width(-1) {} int format() { char *tmp_fmt = build_format_string(); int retval = snprintf(str + str_off, str_off < size ? size - str_off : 0, tmp_fmt, 0 /* used only to avoid warnings */); free(tmp_fmt); return retval; } template int format(T arg) { char *tmp_fmt = build_format_string(); int retval; if (width >= 0) { retval = snprintf(str + str_off, str_off < size ? size - str_off : 0, tmp_fmt, width, arg); } else { retval = snprintf(str + str_off, str_off < size ? size - str_off : 0, tmp_fmt, arg); } free(tmp_fmt); return retval; } char *build_format_string() { size_t fmt_size = fmt_cur - fmt_start + 1; char *new_fmt = (char *)malloc(fmt_size + 1); assert(new_fmt); internal_memcpy(new_fmt, fmt_start, fmt_size); new_fmt[fmt_size] = '\0'; return new_fmt; } char *str_cur() { return str + str_off; } size_t num_written_bytes(int retval) { if (retval < 0) { return 0; } size_t num_avail = str_off < size ? size - str_off : 0; if (num_avail == 0) { return 0; } size_t num_written = retval; // A return value of {v,}snprintf of size or more means that the output was // truncated. if (num_written >= num_avail) { num_written -= num_avail; } return num_written; } char *str; size_t str_off; size_t size; const char *fmt_start; const char *fmt_cur; int width; }; // Formats the input and propagates the input labels to the output. The output // is stored in 'str'. 'size' bounds the number of output bytes. 'format' and // 'ap' are the format string and the list of arguments for formatting. Returns // the return value vsnprintf would return. // // The function tokenizes the format string in chunks representing either a // constant string or a single format directive (e.g., '%.3f') and formats each // chunk independently into the output string. This approach allows to figure // out which bytes of the output string depends on which argument and thus to // propagate labels more precisely. // // WARNING: This implementation does not support conversion specifiers with // positional arguments. static int format_buffer(char *str, size_t size, const char *fmt, dfsan_label *va_labels, dfsan_label *ret_label, va_list ap) { Formatter formatter(str, fmt, size); while (*formatter.fmt_cur) { formatter.fmt_start = formatter.fmt_cur; formatter.width = -1; int retval = 0; if (*formatter.fmt_cur != '%') { // Ordinary character. Consume all the characters until a '%' or the end // of the string. for (; *(formatter.fmt_cur + 1) && *(formatter.fmt_cur + 1) != '%'; ++formatter.fmt_cur) {} retval = formatter.format(); dfsan_set_label(0, formatter.str_cur(), formatter.num_written_bytes(retval)); } else { // Conversion directive. Consume all the characters until a conversion // specifier or the end of the string. bool end_fmt = false; for (; *formatter.fmt_cur && !end_fmt; ) { switch (*++formatter.fmt_cur) { case 'd': case 'i': case 'o': case 'u': case 'x': case 'X': switch (*(formatter.fmt_cur - 1)) { case 'h': // Also covers the 'hh' case (since the size of the arg is still // an int). retval = formatter.format(va_arg(ap, int)); break; case 'l': if (formatter.fmt_cur - formatter.fmt_start >= 2 && *(formatter.fmt_cur - 2) == 'l') { retval = formatter.format(va_arg(ap, long long int)); } else { retval = formatter.format(va_arg(ap, long int)); } break; case 'q': retval = formatter.format(va_arg(ap, long long int)); break; case 'j': retval = formatter.format(va_arg(ap, intmax_t)); break; case 'z': case 't': retval = formatter.format(va_arg(ap, size_t)); break; default: retval = formatter.format(va_arg(ap, int)); } dfsan_set_label(*va_labels++, formatter.str_cur(), formatter.num_written_bytes(retval)); end_fmt = true; break; case 'a': case 'A': case 'e': case 'E': case 'f': case 'F': case 'g': case 'G': if (*(formatter.fmt_cur - 1) == 'L') { retval = formatter.format(va_arg(ap, long double)); } else { retval = formatter.format(va_arg(ap, double)); } dfsan_set_label(*va_labels++, formatter.str_cur(), formatter.num_written_bytes(retval)); end_fmt = true; break; case 'c': retval = formatter.format(va_arg(ap, int)); dfsan_set_label(*va_labels++, formatter.str_cur(), formatter.num_written_bytes(retval)); end_fmt = true; break; case 's': { char *arg = va_arg(ap, char *); retval = formatter.format(arg); va_labels++; internal_memcpy(shadow_for(formatter.str_cur()), shadow_for(arg), sizeof(dfsan_label) * formatter.num_written_bytes(retval)); end_fmt = true; break; } case 'p': retval = formatter.format(va_arg(ap, void *)); dfsan_set_label(*va_labels++, formatter.str_cur(), formatter.num_written_bytes(retval)); end_fmt = true; break; case 'n': { int *ptr = va_arg(ap, int *); *ptr = (int)formatter.str_off; va_labels++; dfsan_set_label(0, ptr, sizeof(ptr)); end_fmt = true; break; } case '%': retval = formatter.format(); dfsan_set_label(0, formatter.str_cur(), formatter.num_written_bytes(retval)); end_fmt = true; break; case '*': formatter.width = va_arg(ap, int); va_labels++; break; default: break; } } } if (retval < 0) { return retval; } formatter.fmt_cur++; formatter.str_off += retval; } *ret_label = 0; // Number of bytes written in total. return formatter.str_off; } extern "C" { SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_sprintf(char *str, const char *format, dfsan_label str_label, dfsan_label format_label, dfsan_label *va_labels, dfsan_label *ret_label, ...) { va_list ap; va_start(ap, ret_label); int ret = format_buffer(str, ~0ul, format, va_labels, ret_label, ap); va_end(ap); return ret; } SANITIZER_INTERFACE_ATTRIBUTE int __dfsw_snprintf(char *str, size_t size, const char *format, dfsan_label str_label, dfsan_label size_label, dfsan_label format_label, dfsan_label *va_labels, dfsan_label *ret_label, ...) { va_list ap; va_start(ap, ret_label); int ret = format_buffer(str, size, format, va_labels, ret_label, ap); va_end(ap); return ret; } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/done_abilist.txt0000664000175000017500000002152612755207017026253 0ustar mwhudsonmwhudsonfun:main=uninstrumented fun:main=discard ############################################################################### # DFSan interface functions ############################################################################### fun:dfsan_union=uninstrumented fun:dfsan_union=discard fun:dfsan_create_label=uninstrumented fun:dfsan_create_label=discard fun:dfsan_set_label=uninstrumented fun:dfsan_set_label=discard fun:dfsan_add_label=uninstrumented fun:dfsan_add_label=discard fun:dfsan_get_label=uninstrumented fun:dfsan_get_label=custom fun:dfsan_read_label=uninstrumented fun:dfsan_read_label=discard fun:dfsan_get_label_count=uninstrumented fun:dfsan_get_label_count=discard fun:dfsan_get_label_info=uninstrumented fun:dfsan_get_label_info=discard fun:dfsan_has_label=uninstrumented fun:dfsan_has_label=discard fun:dfsan_has_label_with_desc=uninstrumented fun:dfsan_has_label_with_desc=discard fun:dfsan_set_write_callback=uninstrumented fun:dfsan_set_write_callback=custom ############################################################################### # glibc ############################################################################### fun:malloc=discard fun:realloc=discard fun:free=discard # Functions that return a value that depends on the input, but the output might # not be necessarily data-dependent on the input. fun:isalpha=functional fun:isdigit=functional fun:isprint=functional fun:isxdigit=functional fun:isalnum=functional fun:ispunct=functional fun:isspace=functional fun:tolower=functional fun:toupper=functional # Functions that return a value that is data-dependent on the input. fun:btowc=functional fun:exp=functional fun:exp2=functional fun:fabs=functional fun:finite=functional fun:floor=functional fun:fmod=functional fun:isinf=functional fun:isnan=functional fun:log=functional fun:modf=functional fun:pow=functional fun:round=functional fun:sqrt=functional fun:wctob=functional # Functions that produce an output that does not depend on the input (shadow is # zeroed automatically). fun:__assert_fail=discard fun:__ctype_b_loc=discard fun:__cxa_atexit=discard fun:__errno_location=discard fun:__newlocale=discard fun:__sbrk=discard fun:__sigsetjmp=discard fun:__uselocale=discard fun:__wctype_l=discard fun:access=discard fun:alarm=discard fun:atexit=discard fun:bind=discard fun:chdir=discard fun:close=discard fun:closedir=discard fun:connect=discard fun:dladdr=discard fun:dlclose=discard fun:fclose=discard fun:feof=discard fun:ferror=discard fun:fflush=discard fun:fileno=discard fun:fopen=discard fun:fprintf=discard fun:fputc=discard fun:fputc=discard fun:fputs=discard fun:fputs=discard fun:fseek=discard fun:ftell=discard fun:fwrite=discard fun:getenv=discard fun:getuid=discard fun:geteuid=discard fun:getpagesize=discard fun:getpid=discard fun:kill=discard fun:listen=discard fun:lseek=discard fun:mkdir=discard fun:mmap=discard fun:munmap=discard fun:open=discard fun:pipe=discard fun:posix_fadvise=discard fun:posix_memalign=discard fun:prctl=discard fun:printf=discard fun:pthread_sigmask=discard fun:putc=discard fun:putchar=discard fun:puts=discard fun:rand=discard fun:random=discard fun:remove=discard fun:sched_getcpu=discard fun:sched_get_priority_max=discard fun:sched_setaffinity=discard fun:sched_yield=discard fun:sem_destroy=discard fun:sem_init=discard fun:sem_post=discard fun:sem_wait=discard fun:send=discard fun:sendmsg=discard fun:sendto=discard fun:setsockopt=discard fun:shutdown=discard fun:sleep=discard fun:socket=discard fun:strerror=discard fun:strspn=discard fun:strcspn=discard fun:symlink=discard fun:syscall=discard fun:unlink=discard fun:uselocale=discard # Functions that produce output does not depend on the input (need to zero the # shadow manually). fun:calloc=custom fun:clock_gettime=custom fun:dlopen=custom fun:fgets=custom fun:fstat=custom fun:getcwd=custom fun:get_current_dir_name=custom fun:gethostname=custom fun:getrlimit=custom fun:getrusage=custom fun:nanosleep=custom fun:pread=custom fun:read=custom fun:socketpair=custom fun:stat=custom fun:time=custom # Functions that produce an output that depend on the input (propagate the # shadow manually). fun:ctime_r=custom fun:inet_pton=custom fun:localtime_r=custom fun:memcpy=custom fun:memset=custom fun:strcpy=custom fun:strdup=custom fun:strncpy=custom fun:strtod=custom fun:strtol=custom fun:strtoll=custom fun:strtoul=custom fun:strtoull=custom # Functions that produce an output that is computed from the input, but is not # necessarily data dependent. fun:memchr=custom fun:memcmp=custom fun:strcasecmp=custom fun:strchr=custom fun:strcmp=custom fun:strlen=custom fun:strncasecmp=custom fun:strncmp=custom fun:strrchr=custom fun:strstr=custom # Functions which take action based on global state, such as running a callback # set by a sepperate function. fun:write=custom # Functions that take a callback (wrap the callback manually). fun:dl_iterate_phdr=custom fun:getpwuid_r=custom fun:poll=custom fun:sched_getaffinity=custom fun:select=custom fun:sigemptyset=custom fun:sigaction=custom fun:gettimeofday=custom # sprintf-like fun:sprintf=custom fun:snprintf=custom # TODO: custom fun:asprintf=discard fun:qsort=discard ############################################################################### # pthread ############################################################################### fun:pthread_equal=discard fun:pthread_getspecific=discard fun:pthread_key_create=discard fun:pthread_key_delete=discard fun:pthread_mutex_destroy=discard fun:pthread_mutex_init=discard fun:pthread_mutex_lock=discard fun:pthread_mutex_trylock=discard fun:pthread_mutex_unlock=discard fun:pthread_mutexattr_destroy=discard fun:pthread_mutexattr_init=discard fun:pthread_mutexattr_settype=discard fun:pthread_once=discard fun:pthread_self=discard fun:pthread_setspecific=discard # Functions that take a callback (wrap the callback manually). fun:pthread_create=custom ############################################################################### # libffi/libgo ############################################################################### # Functions that are written in asm or are called from asm. fun:ffi_call_unix64=uninstrumented fun:ffi_call_unix64=discard fun:ffi_closure_unix64_inner=uninstrumented fun:ffi_closure_unix64_inner=discard fun:ffi_closure_unix64=uninstrumented fun:ffi_closure_unix64=discard fun:__go_get_closure=uninstrumented fun:__go_get_closure=discard fun:__go_makefunc_can_recover=uninstrumented fun:__go_makefunc_can_recover=discard fun:__go_makefunc_returning=uninstrumented fun:__go_makefunc_returning=discard fun:reflect.MakeFuncStubGo=uninstrumented fun:reflect.MakeFuncStubGo=discard fun:reflect.makeFuncStub=uninstrumented fun:reflect.makeFuncStub=discard ############################################################################### # lib/Fuzzer ############################################################################### # Replaces __sanitizer_cov_trace_cmp with __dfsw___sanitizer_cov_trace_cmp fun:__sanitizer_cov_trace_cmp=custom fun:__sanitizer_cov_trace_cmp=uninstrumented fun:__sanitizer_cov_trace_cmp1=custom fun:__sanitizer_cov_trace_cmp1=uninstrumented fun:__sanitizer_cov_trace_cmp2=custom fun:__sanitizer_cov_trace_cmp2=uninstrumented fun:__sanitizer_cov_trace_cmp4=custom fun:__sanitizer_cov_trace_cmp4=uninstrumented fun:__sanitizer_cov_trace_cmp8=custom fun:__sanitizer_cov_trace_cmp8=uninstrumented # Similar for __sanitizer_cov_trace_switch fun:__sanitizer_cov_trace_switch=custom fun:__sanitizer_cov_trace_switch=uninstrumented # Ignores all other __sanitizer callbacks. fun:__sanitizer_cov=uninstrumented fun:__sanitizer_cov=discard fun:__sanitizer_cov_module_init=uninstrumented fun:__sanitizer_cov_module_init=discard fun:__sanitizer_cov_with_check=uninstrumented fun:__sanitizer_cov_with_check=discard fun:__sanitizer_cov_indir_call16=uninstrumented fun:__sanitizer_cov_indir_call16=discard fun:__sanitizer_cov_indir_call16=uninstrumented fun:__sanitizer_cov_indir_call16=discard fun:__sanitizer_reset_coverage=uninstrumented fun:__sanitizer_reset_coverage=discard fun:__sanitizer_set_death_callback=uninstrumented fun:__sanitizer_set_death_callback=discard fun:__sanitizer_get_coverage_guards=uninstrumented fun:__sanitizer_get_coverage_guards=discard fun:__sanitizer_get_number_of_counters=uninstrumented fun:__sanitizer_get_number_of_counters=discard fun:__sanitizer_update_counter_bitset_and_clear_counters=uninstrumented fun:__sanitizer_update_counter_bitset_and_clear_counters=discard fun:__sanitizer_get_total_unique_coverage=uninstrumented fun:__sanitizer_get_total_unique_coverage=discard fun:__sanitizer_get_total_unique_coverage=uninstrumented fun:__sanitizer_get_total_unique_coverage=discard fun:__sanitizer_update_counter_bitset_and_clear_counters=uninstrumented fun:__sanitizer_update_counter_bitset_and_clear_counters=discard # Ignores the dfsan wrappers. fun:__dfsw_*=uninstrumented fun:__dfsw_*=discard # Don't add extra parameters to the Fuzzer callback. fun:LLVMFuzzerTestOneInput=uninstrumented golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/.clang-format0000664000175000017500000000002512623444376025425 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/libc_ubuntu1404_abilist.txt0000664000175000017500000032612512426456202030152 0ustar mwhudsonmwhudsonfun:_Exit=uninstrumented fun:_IO_adjust_column=uninstrumented fun:_IO_adjust_wcolumn=uninstrumented fun:_IO_default_doallocate=uninstrumented fun:_IO_default_finish=uninstrumented fun:_IO_default_pbackfail=uninstrumented fun:_IO_default_uflow=uninstrumented fun:_IO_default_xsgetn=uninstrumented fun:_IO_default_xsputn=uninstrumented fun:_IO_do_write=uninstrumented fun:_IO_doallocbuf=uninstrumented fun:_IO_fclose=uninstrumented fun:_IO_fdopen=uninstrumented fun:_IO_feof=uninstrumented fun:_IO_ferror=uninstrumented fun:_IO_fflush=uninstrumented fun:_IO_fgetpos=uninstrumented fun:_IO_fgetpos64=uninstrumented fun:_IO_fgets=uninstrumented fun:_IO_file_attach=uninstrumented fun:_IO_file_close=uninstrumented fun:_IO_file_close_it=uninstrumented fun:_IO_file_doallocate=uninstrumented fun:_IO_file_finish=uninstrumented fun:_IO_file_fopen=uninstrumented fun:_IO_file_init=uninstrumented fun:_IO_file_open=uninstrumented fun:_IO_file_overflow=uninstrumented fun:_IO_file_read=uninstrumented fun:_IO_file_seek=uninstrumented fun:_IO_file_seekoff=uninstrumented fun:_IO_file_setbuf=uninstrumented fun:_IO_file_stat=uninstrumented fun:_IO_file_sync=uninstrumented fun:_IO_file_underflow=uninstrumented fun:_IO_file_write=uninstrumented fun:_IO_file_xsputn=uninstrumented fun:_IO_flockfile=uninstrumented fun:_IO_flush_all=uninstrumented fun:_IO_flush_all_linebuffered=uninstrumented fun:_IO_fopen=uninstrumented fun:_IO_fprintf=uninstrumented fun:_IO_fputs=uninstrumented fun:_IO_fread=uninstrumented fun:_IO_free_backup_area=uninstrumented fun:_IO_free_wbackup_area=uninstrumented fun:_IO_fsetpos=uninstrumented fun:_IO_fsetpos64=uninstrumented fun:_IO_ftell=uninstrumented fun:_IO_ftrylockfile=uninstrumented fun:_IO_funlockfile=uninstrumented fun:_IO_fwrite=uninstrumented fun:_IO_getc=uninstrumented fun:_IO_getline=uninstrumented fun:_IO_getline_info=uninstrumented fun:_IO_gets=uninstrumented fun:_IO_init=uninstrumented fun:_IO_init_marker=uninstrumented fun:_IO_init_wmarker=uninstrumented fun:_IO_iter_begin=uninstrumented fun:_IO_iter_end=uninstrumented fun:_IO_iter_file=uninstrumented fun:_IO_iter_next=uninstrumented fun:_IO_least_wmarker=uninstrumented fun:_IO_link_in=uninstrumented fun:_IO_list_lock=uninstrumented fun:_IO_list_resetlock=uninstrumented fun:_IO_list_unlock=uninstrumented fun:_IO_marker_delta=uninstrumented fun:_IO_marker_difference=uninstrumented fun:_IO_padn=uninstrumented fun:_IO_peekc_locked=uninstrumented fun:_IO_popen=uninstrumented fun:_IO_printf=uninstrumented fun:_IO_proc_close=uninstrumented fun:_IO_proc_open=uninstrumented fun:_IO_putc=uninstrumented fun:_IO_puts=uninstrumented fun:_IO_remove_marker=uninstrumented fun:_IO_seekmark=uninstrumented fun:_IO_seekoff=uninstrumented fun:_IO_seekpos=uninstrumented fun:_IO_seekwmark=uninstrumented fun:_IO_setb=uninstrumented fun:_IO_setbuffer=uninstrumented fun:_IO_setvbuf=uninstrumented fun:_IO_sgetn=uninstrumented fun:_IO_sprintf=uninstrumented fun:_IO_sputbackc=uninstrumented fun:_IO_sputbackwc=uninstrumented fun:_IO_sscanf=uninstrumented fun:_IO_str_init_readonly=uninstrumented fun:_IO_str_init_static=uninstrumented fun:_IO_str_overflow=uninstrumented fun:_IO_str_pbackfail=uninstrumented fun:_IO_str_seekoff=uninstrumented fun:_IO_str_underflow=uninstrumented fun:_IO_sungetc=uninstrumented fun:_IO_sungetwc=uninstrumented fun:_IO_switch_to_get_mode=uninstrumented fun:_IO_switch_to_main_wget_area=uninstrumented fun:_IO_switch_to_wbackup_area=uninstrumented fun:_IO_switch_to_wget_mode=uninstrumented fun:_IO_un_link=uninstrumented fun:_IO_ungetc=uninstrumented fun:_IO_unsave_markers=uninstrumented fun:_IO_unsave_wmarkers=uninstrumented fun:_IO_vfprintf=uninstrumented fun:_IO_vfscanf=uninstrumented fun:_IO_vsprintf=uninstrumented fun:_IO_wdefault_doallocate=uninstrumented fun:_IO_wdefault_finish=uninstrumented fun:_IO_wdefault_pbackfail=uninstrumented fun:_IO_wdefault_uflow=uninstrumented fun:_IO_wdefault_xsgetn=uninstrumented fun:_IO_wdefault_xsputn=uninstrumented fun:_IO_wdo_write=uninstrumented fun:_IO_wdoallocbuf=uninstrumented fun:_IO_wfile_overflow=uninstrumented fun:_IO_wfile_seekoff=uninstrumented fun:_IO_wfile_sync=uninstrumented fun:_IO_wfile_underflow=uninstrumented fun:_IO_wfile_xsputn=uninstrumented fun:_IO_wmarker_delta=uninstrumented fun:_IO_wsetb=uninstrumented fun:_Unwind_Backtrace=uninstrumented fun:_Unwind_DeleteException=uninstrumented fun:_Unwind_FindEnclosingFunction=uninstrumented fun:_Unwind_Find_FDE=uninstrumented fun:_Unwind_ForcedUnwind=uninstrumented fun:_Unwind_GetCFA=uninstrumented fun:_Unwind_GetDataRelBase=uninstrumented fun:_Unwind_GetGR=uninstrumented fun:_Unwind_GetIP=uninstrumented fun:_Unwind_GetIPInfo=uninstrumented fun:_Unwind_GetLanguageSpecificData=uninstrumented fun:_Unwind_GetRegionStart=uninstrumented fun:_Unwind_GetTextRelBase=uninstrumented fun:_Unwind_RaiseException=uninstrumented fun:_Unwind_Resume=uninstrumented fun:_Unwind_Resume_or_Rethrow=uninstrumented fun:_Unwind_SetGR=uninstrumented fun:_Unwind_SetIP=uninstrumented fun:__absvdi2=uninstrumented fun:__absvsi2=uninstrumented fun:__absvti2=uninstrumented fun:__acos_finite=uninstrumented fun:__acosf_finite=uninstrumented fun:__acosh_finite=uninstrumented fun:__acoshf_finite=uninstrumented fun:__acoshl_finite=uninstrumented fun:__acosl_finite=uninstrumented fun:__addtf3=uninstrumented fun:__addvdi3=uninstrumented fun:__addvsi3=uninstrumented fun:__addvti3=uninstrumented fun:__adjtimex=uninstrumented fun:__arch_prctl=uninstrumented fun:__argz_count=uninstrumented fun:__argz_next=uninstrumented fun:__argz_stringify=uninstrumented fun:__ashlti3=uninstrumented fun:__ashrti3=uninstrumented fun:__asin_finite=uninstrumented fun:__asinf_finite=uninstrumented fun:__asinl_finite=uninstrumented fun:__asprintf=uninstrumented fun:__asprintf_chk=uninstrumented fun:__assert=uninstrumented fun:__assert_fail=uninstrumented fun:__assert_perror_fail=uninstrumented fun:__atan2_finite=uninstrumented fun:__atan2f_finite=uninstrumented fun:__atan2l_finite=uninstrumented fun:__atanh_finite=uninstrumented fun:__atanhf_finite=uninstrumented fun:__atanhl_finite=uninstrumented fun:__b64_ntop=uninstrumented fun:__b64_pton=uninstrumented fun:__backtrace=uninstrumented fun:__backtrace_symbols=uninstrumented fun:__backtrace_symbols_fd=uninstrumented fun:__bid128_abs=uninstrumented fun:__bid128_add=uninstrumented fun:__bid128_class=uninstrumented fun:__bid128_copy=uninstrumented fun:__bid128_copySign=uninstrumented fun:__bid128_div=uninstrumented fun:__bid128_fma=uninstrumented fun:__bid128_from_int32=uninstrumented fun:__bid128_from_int64=uninstrumented fun:__bid128_from_uint32=uninstrumented fun:__bid128_from_uint64=uninstrumented fun:__bid128_isCanonical=uninstrumented fun:__bid128_isFinite=uninstrumented fun:__bid128_isInf=uninstrumented fun:__bid128_isNaN=uninstrumented fun:__bid128_isNormal=uninstrumented fun:__bid128_isSignaling=uninstrumented fun:__bid128_isSigned=uninstrumented fun:__bid128_isSubnormal=uninstrumented fun:__bid128_isZero=uninstrumented fun:__bid128_mul=uninstrumented fun:__bid128_negate=uninstrumented fun:__bid128_quiet_equal=uninstrumented fun:__bid128_quiet_greater=uninstrumented fun:__bid128_quiet_greater_equal=uninstrumented fun:__bid128_quiet_greater_unordered=uninstrumented fun:__bid128_quiet_less=uninstrumented fun:__bid128_quiet_less_equal=uninstrumented fun:__bid128_quiet_less_unordered=uninstrumented fun:__bid128_quiet_not_equal=uninstrumented fun:__bid128_quiet_not_greater=uninstrumented fun:__bid128_quiet_not_less=uninstrumented fun:__bid128_quiet_ordered=uninstrumented fun:__bid128_quiet_unordered=uninstrumented fun:__bid128_radix=uninstrumented fun:__bid128_sameQuantum=uninstrumented fun:__bid128_signaling_greater=uninstrumented fun:__bid128_signaling_greater_equal=uninstrumented fun:__bid128_signaling_greater_unordered=uninstrumented fun:__bid128_signaling_less=uninstrumented fun:__bid128_signaling_less_equal=uninstrumented fun:__bid128_signaling_less_unordered=uninstrumented fun:__bid128_signaling_not_greater=uninstrumented fun:__bid128_signaling_not_less=uninstrumented fun:__bid128_sub=uninstrumented fun:__bid128_to_bid32=uninstrumented fun:__bid128_to_bid64=uninstrumented fun:__bid128_to_binary128=uninstrumented fun:__bid128_to_binary32=uninstrumented fun:__bid128_to_binary64=uninstrumented fun:__bid128_to_binary80=uninstrumented fun:__bid128_to_int32_ceil=uninstrumented fun:__bid128_to_int32_floor=uninstrumented fun:__bid128_to_int32_int=uninstrumented fun:__bid128_to_int32_rnint=uninstrumented fun:__bid128_to_int32_rninta=uninstrumented fun:__bid128_to_int32_xceil=uninstrumented fun:__bid128_to_int32_xfloor=uninstrumented fun:__bid128_to_int32_xint=uninstrumented fun:__bid128_to_int32_xrnint=uninstrumented fun:__bid128_to_int32_xrninta=uninstrumented fun:__bid128_to_int64_ceil=uninstrumented fun:__bid128_to_int64_floor=uninstrumented fun:__bid128_to_int64_int=uninstrumented fun:__bid128_to_int64_rnint=uninstrumented fun:__bid128_to_int64_rninta=uninstrumented fun:__bid128_to_int64_xceil=uninstrumented fun:__bid128_to_int64_xfloor=uninstrumented fun:__bid128_to_int64_xint=uninstrumented fun:__bid128_to_int64_xrnint=uninstrumented fun:__bid128_to_int64_xrninta=uninstrumented fun:__bid128_to_uint32_ceil=uninstrumented fun:__bid128_to_uint32_floor=uninstrumented fun:__bid128_to_uint32_int=uninstrumented fun:__bid128_to_uint32_rnint=uninstrumented fun:__bid128_to_uint32_rninta=uninstrumented fun:__bid128_to_uint32_xceil=uninstrumented fun:__bid128_to_uint32_xfloor=uninstrumented fun:__bid128_to_uint32_xint=uninstrumented fun:__bid128_to_uint32_xrnint=uninstrumented fun:__bid128_to_uint32_xrninta=uninstrumented fun:__bid128_to_uint64_ceil=uninstrumented fun:__bid128_to_uint64_floor=uninstrumented fun:__bid128_to_uint64_int=uninstrumented fun:__bid128_to_uint64_rnint=uninstrumented fun:__bid128_to_uint64_rninta=uninstrumented fun:__bid128_to_uint64_xceil=uninstrumented fun:__bid128_to_uint64_xfloor=uninstrumented fun:__bid128_to_uint64_xint=uninstrumented fun:__bid128_to_uint64_xrnint=uninstrumented fun:__bid128_to_uint64_xrninta=uninstrumented fun:__bid128_totalOrder=uninstrumented fun:__bid128_totalOrderMag=uninstrumented fun:__bid128dd_add=uninstrumented fun:__bid128dd_div=uninstrumented fun:__bid128dd_mul=uninstrumented fun:__bid128dd_sub=uninstrumented fun:__bid128ddd_fma=uninstrumented fun:__bid128ddq_fma=uninstrumented fun:__bid128dq_add=uninstrumented fun:__bid128dq_div=uninstrumented fun:__bid128dq_mul=uninstrumented fun:__bid128dq_sub=uninstrumented fun:__bid128dqd_fma=uninstrumented fun:__bid128dqq_fma=uninstrumented fun:__bid128qd_add=uninstrumented fun:__bid128qd_div=uninstrumented fun:__bid128qd_mul=uninstrumented fun:__bid128qd_sub=uninstrumented fun:__bid128qdd_fma=uninstrumented fun:__bid128qdq_fma=uninstrumented fun:__bid128qqd_fma=uninstrumented fun:__bid32_to_bid128=uninstrumented fun:__bid32_to_bid64=uninstrumented fun:__bid32_to_binary128=uninstrumented fun:__bid32_to_binary32=uninstrumented fun:__bid32_to_binary64=uninstrumented fun:__bid32_to_binary80=uninstrumented fun:__bid64_abs=uninstrumented fun:__bid64_add=uninstrumented fun:__bid64_class=uninstrumented fun:__bid64_copy=uninstrumented fun:__bid64_copySign=uninstrumented fun:__bid64_div=uninstrumented fun:__bid64_from_int32=uninstrumented fun:__bid64_from_int64=uninstrumented fun:__bid64_from_uint32=uninstrumented fun:__bid64_from_uint64=uninstrumented fun:__bid64_isCanonical=uninstrumented fun:__bid64_isFinite=uninstrumented fun:__bid64_isInf=uninstrumented fun:__bid64_isNaN=uninstrumented fun:__bid64_isNormal=uninstrumented fun:__bid64_isSignaling=uninstrumented fun:__bid64_isSigned=uninstrumented fun:__bid64_isSubnormal=uninstrumented fun:__bid64_isZero=uninstrumented fun:__bid64_mul=uninstrumented fun:__bid64_negate=uninstrumented fun:__bid64_quiet_equal=uninstrumented fun:__bid64_quiet_greater=uninstrumented fun:__bid64_quiet_greater_equal=uninstrumented fun:__bid64_quiet_greater_unordered=uninstrumented fun:__bid64_quiet_less=uninstrumented fun:__bid64_quiet_less_equal=uninstrumented fun:__bid64_quiet_less_unordered=uninstrumented fun:__bid64_quiet_not_equal=uninstrumented fun:__bid64_quiet_not_greater=uninstrumented fun:__bid64_quiet_not_less=uninstrumented fun:__bid64_quiet_ordered=uninstrumented fun:__bid64_quiet_unordered=uninstrumented fun:__bid64_radix=uninstrumented fun:__bid64_sameQuantum=uninstrumented fun:__bid64_signaling_greater=uninstrumented fun:__bid64_signaling_greater_equal=uninstrumented fun:__bid64_signaling_greater_unordered=uninstrumented fun:__bid64_signaling_less=uninstrumented fun:__bid64_signaling_less_equal=uninstrumented fun:__bid64_signaling_less_unordered=uninstrumented fun:__bid64_signaling_not_greater=uninstrumented fun:__bid64_signaling_not_less=uninstrumented fun:__bid64_sub=uninstrumented fun:__bid64_to_bid128=uninstrumented fun:__bid64_to_bid32=uninstrumented fun:__bid64_to_binary128=uninstrumented fun:__bid64_to_binary32=uninstrumented fun:__bid64_to_binary64=uninstrumented fun:__bid64_to_binary80=uninstrumented fun:__bid64_to_int32_ceil=uninstrumented fun:__bid64_to_int32_floor=uninstrumented fun:__bid64_to_int32_int=uninstrumented fun:__bid64_to_int32_rnint=uninstrumented fun:__bid64_to_int32_rninta=uninstrumented fun:__bid64_to_int32_xceil=uninstrumented fun:__bid64_to_int32_xfloor=uninstrumented fun:__bid64_to_int32_xint=uninstrumented fun:__bid64_to_int32_xrnint=uninstrumented fun:__bid64_to_int32_xrninta=uninstrumented fun:__bid64_to_int64_ceil=uninstrumented fun:__bid64_to_int64_floor=uninstrumented fun:__bid64_to_int64_int=uninstrumented fun:__bid64_to_int64_rnint=uninstrumented fun:__bid64_to_int64_rninta=uninstrumented fun:__bid64_to_int64_xceil=uninstrumented fun:__bid64_to_int64_xfloor=uninstrumented fun:__bid64_to_int64_xint=uninstrumented fun:__bid64_to_int64_xrnint=uninstrumented fun:__bid64_to_int64_xrninta=uninstrumented fun:__bid64_to_uint32_ceil=uninstrumented fun:__bid64_to_uint32_floor=uninstrumented fun:__bid64_to_uint32_int=uninstrumented fun:__bid64_to_uint32_rnint=uninstrumented fun:__bid64_to_uint32_rninta=uninstrumented fun:__bid64_to_uint32_xceil=uninstrumented fun:__bid64_to_uint32_xfloor=uninstrumented fun:__bid64_to_uint32_xint=uninstrumented fun:__bid64_to_uint32_xrnint=uninstrumented fun:__bid64_to_uint32_xrninta=uninstrumented fun:__bid64_to_uint64_ceil=uninstrumented fun:__bid64_to_uint64_floor=uninstrumented fun:__bid64_to_uint64_int=uninstrumented fun:__bid64_to_uint64_rnint=uninstrumented fun:__bid64_to_uint64_rninta=uninstrumented fun:__bid64_to_uint64_xceil=uninstrumented fun:__bid64_to_uint64_xfloor=uninstrumented fun:__bid64_to_uint64_xint=uninstrumented fun:__bid64_to_uint64_xrnint=uninstrumented fun:__bid64_to_uint64_xrninta=uninstrumented fun:__bid64_totalOrder=uninstrumented fun:__bid64_totalOrderMag=uninstrumented fun:__bid64ddq_fma=uninstrumented fun:__bid64dq_add=uninstrumented fun:__bid64dq_div=uninstrumented fun:__bid64dq_mul=uninstrumented fun:__bid64dq_sub=uninstrumented fun:__bid64dqd_fma=uninstrumented fun:__bid64dqq_fma=uninstrumented fun:__bid64qd_add=uninstrumented fun:__bid64qd_div=uninstrumented fun:__bid64qd_mul=uninstrumented fun:__bid64qd_sub=uninstrumented fun:__bid64qdd_fma=uninstrumented fun:__bid64qdq_fma=uninstrumented fun:__bid64qq_add=uninstrumented fun:__bid64qq_div=uninstrumented fun:__bid64qq_mul=uninstrumented fun:__bid64qq_sub=uninstrumented fun:__bid64qqd_fma=uninstrumented fun:__bid64qqq_fma=uninstrumented fun:__bid_adddd3=uninstrumented fun:__bid_addsd3=uninstrumented fun:__bid_addtd3=uninstrumented fun:__bid_divdd3=uninstrumented fun:__bid_divsd3=uninstrumented fun:__bid_divtd3=uninstrumented fun:__bid_eqdd2=uninstrumented fun:__bid_eqsd2=uninstrumented fun:__bid_eqtd2=uninstrumented fun:__bid_extendddtd2=uninstrumented fun:__bid_extendddtf=uninstrumented fun:__bid_extendddxf=uninstrumented fun:__bid_extenddfdd=uninstrumented fun:__bid_extenddftd=uninstrumented fun:__bid_extendsddd2=uninstrumented fun:__bid_extendsddf=uninstrumented fun:__bid_extendsdtd2=uninstrumented fun:__bid_extendsdtf=uninstrumented fun:__bid_extendsdxf=uninstrumented fun:__bid_extendsfdd=uninstrumented fun:__bid_extendsfsd=uninstrumented fun:__bid_extendsftd=uninstrumented fun:__bid_extendtftd=uninstrumented fun:__bid_extendxftd=uninstrumented fun:__bid_fixdddi=uninstrumented fun:__bid_fixddsi=uninstrumented fun:__bid_fixsddi=uninstrumented fun:__bid_fixsdsi=uninstrumented fun:__bid_fixtddi=uninstrumented fun:__bid_fixtdsi=uninstrumented fun:__bid_fixunsdddi=uninstrumented fun:__bid_fixunsddsi=uninstrumented fun:__bid_fixunssddi=uninstrumented fun:__bid_fixunssdsi=uninstrumented fun:__bid_fixunstddi=uninstrumented fun:__bid_fixunstdsi=uninstrumented fun:__bid_floatdidd=uninstrumented fun:__bid_floatdisd=uninstrumented fun:__bid_floatditd=uninstrumented fun:__bid_floatsidd=uninstrumented fun:__bid_floatsisd=uninstrumented fun:__bid_floatsitd=uninstrumented fun:__bid_floatunsdidd=uninstrumented fun:__bid_floatunsdisd=uninstrumented fun:__bid_floatunsditd=uninstrumented fun:__bid_floatunssidd=uninstrumented fun:__bid_floatunssisd=uninstrumented fun:__bid_floatunssitd=uninstrumented fun:__bid_gedd2=uninstrumented fun:__bid_gesd2=uninstrumented fun:__bid_getd2=uninstrumented fun:__bid_gtdd2=uninstrumented fun:__bid_gtsd2=uninstrumented fun:__bid_gttd2=uninstrumented fun:__bid_ledd2=uninstrumented fun:__bid_lesd2=uninstrumented fun:__bid_letd2=uninstrumented fun:__bid_ltdd2=uninstrumented fun:__bid_ltsd2=uninstrumented fun:__bid_lttd2=uninstrumented fun:__bid_muldd3=uninstrumented fun:__bid_mulsd3=uninstrumented fun:__bid_multd3=uninstrumented fun:__bid_nedd2=uninstrumented fun:__bid_nesd2=uninstrumented fun:__bid_netd2=uninstrumented fun:__bid_round128_19_38=uninstrumented fun:__bid_round192_39_57=uninstrumented fun:__bid_round256_58_76=uninstrumented fun:__bid_round64_2_18=uninstrumented fun:__bid_subdd3=uninstrumented fun:__bid_subsd3=uninstrumented fun:__bid_subtd3=uninstrumented fun:__bid_truncdddf=uninstrumented fun:__bid_truncddsd2=uninstrumented fun:__bid_truncddsf=uninstrumented fun:__bid_truncdfsd=uninstrumented fun:__bid_truncsdsf=uninstrumented fun:__bid_trunctddd2=uninstrumented fun:__bid_trunctddf=uninstrumented fun:__bid_trunctdsd2=uninstrumented fun:__bid_trunctdsf=uninstrumented fun:__bid_trunctdtf=uninstrumented fun:__bid_trunctdxf=uninstrumented fun:__bid_trunctfdd=uninstrumented fun:__bid_trunctfsd=uninstrumented fun:__bid_truncxfdd=uninstrumented fun:__bid_truncxfsd=uninstrumented fun:__bid_unorddd2=uninstrumented fun:__bid_unordsd2=uninstrumented fun:__bid_unordtd2=uninstrumented fun:__binary128_to_bid128=uninstrumented fun:__binary128_to_bid32=uninstrumented fun:__binary128_to_bid64=uninstrumented fun:__binary32_to_bid128=uninstrumented fun:__binary32_to_bid32=uninstrumented fun:__binary32_to_bid64=uninstrumented fun:__binary64_to_bid128=uninstrumented fun:__binary64_to_bid32=uninstrumented fun:__binary64_to_bid64=uninstrumented fun:__binary80_to_bid128=uninstrumented fun:__binary80_to_bid32=uninstrumented fun:__binary80_to_bid64=uninstrumented fun:__bsd_getpgrp=uninstrumented fun:__bswapdi2=uninstrumented fun:__bswapsi2=uninstrumented fun:__bzero=uninstrumented fun:__call_tls_dtors=uninstrumented fun:__chk_fail=uninstrumented fun:__clear_cache=uninstrumented fun:__clock_getcpuclockid=uninstrumented fun:__clock_getres=uninstrumented fun:__clock_gettime=uninstrumented fun:__clock_nanosleep=uninstrumented fun:__clock_settime=uninstrumented fun:__clog10=uninstrumented fun:__clog10f=uninstrumented fun:__clog10l=uninstrumented fun:__clone=uninstrumented fun:__close=uninstrumented fun:__clrsbdi2=uninstrumented fun:__clrsbti2=uninstrumented fun:__clzdi2=uninstrumented fun:__clzti2=uninstrumented fun:__cmpti2=uninstrumented fun:__cmsg_nxthdr=uninstrumented fun:__confstr_chk=uninstrumented fun:__connect=uninstrumented fun:__cosh_finite=uninstrumented fun:__coshf_finite=uninstrumented fun:__coshl_finite=uninstrumented fun:__cpu_indicator_init=uninstrumented fun:__create_ib_request=uninstrumented fun:__ctype_b_loc=uninstrumented fun:__ctype_get_mb_cur_max=uninstrumented fun:__ctype_init=uninstrumented fun:__ctype_tolower_loc=uninstrumented fun:__ctype_toupper_loc=uninstrumented fun:__ctzdi2=uninstrumented fun:__ctzti2=uninstrumented fun:__cxa_at_quick_exit=uninstrumented fun:__cxa_atexit=uninstrumented fun:__cxa_finalize=uninstrumented fun:__cxa_thread_atexit_impl=uninstrumented fun:__cyg_profile_func_enter=uninstrumented fun:__cyg_profile_func_exit=uninstrumented fun:__dcgettext=uninstrumented fun:__default_morecore=uninstrumented fun:__deregister_frame=uninstrumented fun:__deregister_frame_info=uninstrumented fun:__deregister_frame_info_bases=uninstrumented fun:__dfp_clear_except=uninstrumented fun:__dfp_get_round=uninstrumented fun:__dfp_raise_except=uninstrumented fun:__dfp_set_round=uninstrumented fun:__dfp_test_except=uninstrumented fun:__dgettext=uninstrumented fun:__divdc3=uninstrumented fun:__divsc3=uninstrumented fun:__divtc3=uninstrumented fun:__divtf3=uninstrumented fun:__divti3=uninstrumented fun:__divxc3=uninstrumented fun:__dn_comp=uninstrumented fun:__dn_count_labels=uninstrumented fun:__dn_expand=uninstrumented fun:__dn_skipname=uninstrumented fun:__do_niscall3=uninstrumented fun:__dprintf_chk=uninstrumented fun:__dup2=uninstrumented fun:__duplocale=uninstrumented fun:__emutls_get_address=uninstrumented fun:__emutls_register_common=uninstrumented fun:__enable_execute_stack=uninstrumented fun:__endmntent=uninstrumented fun:__eprintf=uninstrumented fun:__eqtf2=uninstrumented fun:__errno_location=uninstrumented fun:__exp10_finite=uninstrumented fun:__exp10f_finite=uninstrumented fun:__exp10l_finite=uninstrumented fun:__exp2_finite=uninstrumented fun:__exp2f_finite=uninstrumented fun:__exp2l_finite=uninstrumented fun:__exp_finite=uninstrumented fun:__expf_finite=uninstrumented fun:__expl_finite=uninstrumented fun:__extenddftf2=uninstrumented fun:__extendsftf2=uninstrumented fun:__extendxftf2=uninstrumented fun:__fbufsize=uninstrumented fun:__fcntl=uninstrumented fun:__fdelt_chk=uninstrumented fun:__fdelt_warn=uninstrumented fun:__fentry__=uninstrumented fun:__ffs=uninstrumented fun:__ffsdi2=uninstrumented fun:__ffsti2=uninstrumented fun:__fgets_chk=uninstrumented fun:__fgets_unlocked_chk=uninstrumented fun:__fgetws_chk=uninstrumented fun:__fgetws_unlocked_chk=uninstrumented fun:__finite=uninstrumented fun:__finitef=uninstrumented fun:__finitel=uninstrumented fun:__fixdfti=uninstrumented fun:__fixsfti=uninstrumented fun:__fixtfdi=uninstrumented fun:__fixtfsi=uninstrumented fun:__fixtfti=uninstrumented fun:__fixunsdfdi=uninstrumented fun:__fixunsdfti=uninstrumented fun:__fixunssfdi=uninstrumented fun:__fixunssfti=uninstrumented fun:__fixunstfdi=uninstrumented fun:__fixunstfsi=uninstrumented fun:__fixunstfti=uninstrumented fun:__fixunsxfdi=uninstrumented fun:__fixunsxfti=uninstrumented fun:__fixxfti=uninstrumented fun:__flbf=uninstrumented fun:__floatditf=uninstrumented fun:__floatsitf=uninstrumented fun:__floattidf=uninstrumented fun:__floattisf=uninstrumented fun:__floattitf=uninstrumented fun:__floattixf=uninstrumented fun:__floatunditf=uninstrumented fun:__floatunsitf=uninstrumented fun:__floatuntidf=uninstrumented fun:__floatuntisf=uninstrumented fun:__floatuntitf=uninstrumented fun:__floatuntixf=uninstrumented fun:__fmod_finite=uninstrumented fun:__fmodf_finite=uninstrumented fun:__fmodl_finite=uninstrumented fun:__follow_path=uninstrumented fun:__fork=uninstrumented fun:__fortify_fail=uninstrumented fun:__fp_nquery=uninstrumented fun:__fp_query=uninstrumented fun:__fp_resstat=uninstrumented fun:__fpclassify=uninstrumented fun:__fpclassifyf=uninstrumented fun:__fpclassifyl=uninstrumented fun:__fpending=uninstrumented fun:__fprintf_chk=uninstrumented fun:__fpurge=uninstrumented fun:__fread_chk=uninstrumented fun:__fread_unlocked_chk=uninstrumented fun:__freadable=uninstrumented fun:__freading=uninstrumented fun:__free_fdresult=uninstrumented fun:__freelocale=uninstrumented fun:__fsetlocking=uninstrumented fun:__fstat=uninstrumented fun:__fwprintf_chk=uninstrumented fun:__fwritable=uninstrumented fun:__fwriting=uninstrumented fun:__fxstat=uninstrumented fun:__fxstat64=uninstrumented fun:__fxstatat=uninstrumented fun:__fxstatat64=uninstrumented fun:__gai_sigqueue=uninstrumented fun:__gamma_r_finite=uninstrumented fun:__gammaf_r_finite=uninstrumented fun:__gammal_r_finite=uninstrumented fun:__gcc_bcmp=uninstrumented fun:__gcc_personality_v0=uninstrumented fun:__gconv_get_alias_db=uninstrumented fun:__gconv_get_cache=uninstrumented fun:__gconv_get_modules_db=uninstrumented fun:__generic_findstack=uninstrumented fun:__generic_morestack=uninstrumented fun:__generic_morestack_set_initial_sp=uninstrumented fun:__generic_releasestack=uninstrumented fun:__get_cpu_features=uninstrumented fun:__getauxval=uninstrumented fun:__getcwd_chk=uninstrumented fun:__getdelim=uninstrumented fun:__getdomainname_chk=uninstrumented fun:__getf2=uninstrumented fun:__getgroups_chk=uninstrumented fun:__gethostname_chk=uninstrumented fun:__getlogin_r_chk=uninstrumented fun:__getmntent_r=uninstrumented fun:__getpagesize=uninstrumented fun:__getpgid=uninstrumented fun:__getpid=uninstrumented fun:__gets_chk=uninstrumented fun:__gettimeofday=uninstrumented fun:__getwd_chk=uninstrumented fun:__gmtime_r=uninstrumented fun:__gttf2=uninstrumented fun:__h_errno_location=uninstrumented fun:__hostalias=uninstrumented fun:__hypot_finite=uninstrumented fun:__hypotf_finite=uninstrumented fun:__hypotl_finite=uninstrumented fun:__internal_endnetgrent=uninstrumented fun:__internal_getnetgrent_r=uninstrumented fun:__internal_setnetgrent=uninstrumented fun:__isalnum_l=uninstrumented fun:__isalpha_l=uninstrumented fun:__isascii_l=uninstrumented fun:__isblank_l=uninstrumented fun:__iscntrl_l=uninstrumented fun:__isctype=uninstrumented fun:__isdigit_l=uninstrumented fun:__isgraph_l=uninstrumented fun:__isinf=uninstrumented fun:__isinff=uninstrumented fun:__isinfl=uninstrumented fun:__islower_l=uninstrumented fun:__isnan=uninstrumented fun:__isnanf=uninstrumented fun:__isnanl=uninstrumented fun:__isoc99_fscanf=uninstrumented fun:__isoc99_fwscanf=uninstrumented fun:__isoc99_scanf=uninstrumented fun:__isoc99_sscanf=uninstrumented fun:__isoc99_swscanf=uninstrumented fun:__isoc99_vfscanf=uninstrumented fun:__isoc99_vfwscanf=uninstrumented fun:__isoc99_vscanf=uninstrumented fun:__isoc99_vsscanf=uninstrumented fun:__isoc99_vswscanf=uninstrumented fun:__isoc99_vwscanf=uninstrumented fun:__isoc99_wscanf=uninstrumented fun:__isprint_l=uninstrumented fun:__ispunct_l=uninstrumented fun:__issignaling=uninstrumented fun:__issignalingf=uninstrumented fun:__issignalingl=uninstrumented fun:__isspace_l=uninstrumented fun:__isupper_l=uninstrumented fun:__iswalnum_l=uninstrumented fun:__iswalpha_l=uninstrumented fun:__iswblank_l=uninstrumented fun:__iswcntrl_l=uninstrumented fun:__iswctype=uninstrumented fun:__iswctype_l=uninstrumented fun:__iswdigit_l=uninstrumented fun:__iswgraph_l=uninstrumented fun:__iswlower_l=uninstrumented fun:__iswprint_l=uninstrumented fun:__iswpunct_l=uninstrumented fun:__iswspace_l=uninstrumented fun:__iswupper_l=uninstrumented fun:__iswxdigit_l=uninstrumented fun:__isxdigit_l=uninstrumented fun:__ivaliduser=uninstrumented fun:__j0_finite=uninstrumented fun:__j0f_finite=uninstrumented fun:__j0l_finite=uninstrumented fun:__j1_finite=uninstrumented fun:__j1f_finite=uninstrumented fun:__j1l_finite=uninstrumented fun:__jn_finite=uninstrumented fun:__jnf_finite=uninstrumented fun:__jnl_finite=uninstrumented fun:__letf2=uninstrumented fun:__lgamma_r_finite=uninstrumented fun:__lgammaf_r_finite=uninstrumented fun:__lgammal_r_finite=uninstrumented fun:__libc_alloca_cutoff=uninstrumented fun:__libc_allocate_rtsig=uninstrumented fun:__libc_allocate_rtsig_private=uninstrumented fun:__libc_calloc=uninstrumented fun:__libc_clntudp_bufcreate=uninstrumented fun:__libc_csu_fini=uninstrumented fun:__libc_csu_init=uninstrumented fun:__libc_current_sigrtmax=uninstrumented fun:__libc_current_sigrtmax_private=uninstrumented fun:__libc_current_sigrtmin=uninstrumented fun:__libc_current_sigrtmin_private=uninstrumented fun:__libc_dl_error_tsd=uninstrumented fun:__libc_dlclose=uninstrumented fun:__libc_dlopen_mode=uninstrumented fun:__libc_dlsym=uninstrumented fun:__libc_fatal=uninstrumented fun:__libc_fork=uninstrumented fun:__libc_free=uninstrumented fun:__libc_freeres=uninstrumented fun:__libc_ifunc_impl_list=uninstrumented fun:__libc_init_first=uninstrumented fun:__libc_longjmp=uninstrumented fun:__libc_mallinfo=uninstrumented fun:__libc_malloc=uninstrumented fun:__libc_mallopt=uninstrumented fun:__libc_memalign=uninstrumented fun:__libc_pthread_init=uninstrumented fun:__libc_pvalloc=uninstrumented fun:__libc_pwrite=uninstrumented fun:__libc_realloc=uninstrumented fun:__libc_res_nquery=uninstrumented fun:__libc_res_nsearch=uninstrumented fun:__libc_rpc_getport=uninstrumented fun:__libc_sa_len=uninstrumented fun:__libc_secure_getenv=uninstrumented fun:__libc_siglongjmp=uninstrumented fun:__libc_start_main=uninstrumented fun:__libc_system=uninstrumented fun:__libc_thread_freeres=uninstrumented fun:__libc_valloc=uninstrumented fun:__loc_aton=uninstrumented fun:__loc_ntoa=uninstrumented fun:__log10_finite=uninstrumented fun:__log10f_finite=uninstrumented fun:__log10l_finite=uninstrumented fun:__log2_finite=uninstrumented fun:__log2f_finite=uninstrumented fun:__log2l_finite=uninstrumented fun:__log_finite=uninstrumented fun:__logf_finite=uninstrumented fun:__logl_finite=uninstrumented fun:__longjmp_chk=uninstrumented fun:__lseek=uninstrumented fun:__lshrti3=uninstrumented fun:__lstat=uninstrumented fun:__lttf2=uninstrumented fun:__lxstat=uninstrumented fun:__lxstat64=uninstrumented fun:__madvise=uninstrumented fun:__mbrlen=uninstrumented fun:__mbrtowc=uninstrumented fun:__mbsnrtowcs_chk=uninstrumented fun:__mbsrtowcs_chk=uninstrumented fun:__mbstowcs_chk=uninstrumented fun:__memcpy_chk=uninstrumented fun:__memmove_chk=uninstrumented fun:__mempcpy=uninstrumented fun:__mempcpy_chk=uninstrumented fun:__mempcpy_small=uninstrumented fun:__memset_chk=uninstrumented fun:__mknod=uninstrumented fun:__mktemp=uninstrumented fun:__modti3=uninstrumented fun:__monstartup=uninstrumented fun:__morestack=uninstrumented fun:__morestack_allocate_stack_space=uninstrumented fun:__morestack_block_signals=uninstrumented fun:__morestack_fail=uninstrumented fun:__morestack_get_guard=uninstrumented fun:__morestack_large_model=uninstrumented fun:__morestack_load_mmap=uninstrumented fun:__morestack_make_guard=uninstrumented fun:__morestack_non_split=uninstrumented fun:__morestack_release_segments=uninstrumented fun:__morestack_set_guard=uninstrumented fun:__morestack_unblock_signals=uninstrumented fun:__mq_open_2=uninstrumented fun:__muldc3=uninstrumented fun:__mulsc3=uninstrumented fun:__multc3=uninstrumented fun:__multf3=uninstrumented fun:__multi3=uninstrumented fun:__mulvdi3=uninstrumented fun:__mulvsi3=uninstrumented fun:__mulvti3=uninstrumented fun:__mulxc3=uninstrumented fun:__nanosleep=uninstrumented fun:__negtf2=uninstrumented fun:__negti2=uninstrumented fun:__negvdi2=uninstrumented fun:__negvsi2=uninstrumented fun:__negvti2=uninstrumented fun:__netf2=uninstrumented fun:__newlocale=uninstrumented fun:__nis_default_access=uninstrumented fun:__nis_default_group=uninstrumented fun:__nis_default_owner=uninstrumented fun:__nis_default_ttl=uninstrumented fun:__nis_finddirectory=uninstrumented fun:__nis_hash=uninstrumented fun:__nisbind_connect=uninstrumented fun:__nisbind_create=uninstrumented fun:__nisbind_destroy=uninstrumented fun:__nisbind_next=uninstrumented fun:__nl_langinfo_l=uninstrumented fun:__ns_get16=uninstrumented fun:__ns_get32=uninstrumented fun:__ns_name_ntop=uninstrumented fun:__ns_name_unpack=uninstrumented fun:__nss_configure_lookup=uninstrumented fun:__nss_database_lookup=uninstrumented fun:__nss_disable_nscd=uninstrumented fun:__nss_group_lookup=uninstrumented fun:__nss_group_lookup2=uninstrumented fun:__nss_hostname_digits_dots=uninstrumented fun:__nss_hosts_lookup=uninstrumented fun:__nss_hosts_lookup2=uninstrumented fun:__nss_lookup=uninstrumented fun:__nss_lookup_function=uninstrumented fun:__nss_next=uninstrumented fun:__nss_next2=uninstrumented fun:__nss_passwd_lookup=uninstrumented fun:__nss_passwd_lookup2=uninstrumented fun:__nss_services_lookup2=uninstrumented fun:__obstack_printf_chk=uninstrumented fun:__obstack_vprintf_chk=uninstrumented fun:__open=uninstrumented fun:__open64=uninstrumented fun:__open64_2=uninstrumented fun:__open_2=uninstrumented fun:__open_catalog=uninstrumented fun:__openat64_2=uninstrumented fun:__openat_2=uninstrumented fun:__overflow=uninstrumented fun:__p_cdname=uninstrumented fun:__p_cdnname=uninstrumented fun:__p_class=uninstrumented fun:__p_fqname=uninstrumented fun:__p_fqnname=uninstrumented fun:__p_option=uninstrumented fun:__p_query=uninstrumented fun:__p_rcode=uninstrumented fun:__p_secstodate=uninstrumented fun:__p_time=uninstrumented fun:__p_type=uninstrumented fun:__paritydi2=uninstrumented fun:__parityti2=uninstrumented fun:__pipe=uninstrumented fun:__poll=uninstrumented fun:__poll_chk=uninstrumented fun:__popcountdi2=uninstrumented fun:__popcountti2=uninstrumented fun:__posix_getopt=uninstrumented fun:__pow_finite=uninstrumented fun:__powf_finite=uninstrumented fun:__powidf2=uninstrumented fun:__powisf2=uninstrumented fun:__powitf2=uninstrumented fun:__powixf2=uninstrumented fun:__powl_finite=uninstrumented fun:__ppoll_chk=uninstrumented fun:__pread64=uninstrumented fun:__pread64_chk=uninstrumented fun:__pread_chk=uninstrumented fun:__prepare_niscall=uninstrumented fun:__printf_chk=uninstrumented fun:__printf_fp=uninstrumented fun:__profile_frequency=uninstrumented fun:__pthread_atfork=uninstrumented fun:__pthread_cleanup_routine=uninstrumented fun:__pthread_clock_gettime=uninstrumented fun:__pthread_clock_settime=uninstrumented fun:__pthread_get_minstack=uninstrumented fun:__pthread_getspecific=uninstrumented fun:__pthread_initialize_minimal=uninstrumented fun:__pthread_key_create=uninstrumented fun:__pthread_mutex_destroy=uninstrumented fun:__pthread_mutex_init=uninstrumented fun:__pthread_mutex_lock=uninstrumented fun:__pthread_mutex_trylock=uninstrumented fun:__pthread_mutex_unlock=uninstrumented fun:__pthread_mutexattr_destroy=uninstrumented fun:__pthread_mutexattr_init=uninstrumented fun:__pthread_mutexattr_settype=uninstrumented fun:__pthread_once=uninstrumented fun:__pthread_register_cancel=uninstrumented fun:__pthread_register_cancel_defer=uninstrumented fun:__pthread_rwlock_destroy=uninstrumented fun:__pthread_rwlock_init=uninstrumented fun:__pthread_rwlock_rdlock=uninstrumented fun:__pthread_rwlock_tryrdlock=uninstrumented fun:__pthread_rwlock_trywrlock=uninstrumented fun:__pthread_rwlock_unlock=uninstrumented fun:__pthread_rwlock_wrlock=uninstrumented fun:__pthread_setspecific=uninstrumented fun:__pthread_unregister_cancel=uninstrumented fun:__pthread_unregister_cancel_restore=uninstrumented fun:__pthread_unwind=uninstrumented fun:__pthread_unwind_next=uninstrumented fun:__ptsname_r_chk=uninstrumented fun:__putlong=uninstrumented fun:__putshort=uninstrumented fun:__pwrite64=uninstrumented fun:__rawmemchr=uninstrumented fun:__read=uninstrumented fun:__read_chk=uninstrumented fun:__readlink_chk=uninstrumented fun:__readlinkat_chk=uninstrumented fun:__realpath_chk=uninstrumented fun:__recv_chk=uninstrumented fun:__recvfrom_chk=uninstrumented fun:__register_atfork=uninstrumented fun:__register_frame=uninstrumented fun:__register_frame_info=uninstrumented fun:__register_frame_info_bases=uninstrumented fun:__register_frame_info_table=uninstrumented fun:__register_frame_info_table_bases=uninstrumented fun:__register_frame_table=uninstrumented fun:__remainder_finite=uninstrumented fun:__remainderf_finite=uninstrumented fun:__remainderl_finite=uninstrumented fun:__res_close=uninstrumented fun:__res_dnok=uninstrumented fun:__res_hnok=uninstrumented fun:__res_hostalias=uninstrumented fun:__res_iclose=uninstrumented fun:__res_init=uninstrumented fun:__res_isourserver=uninstrumented fun:__res_mailok=uninstrumented fun:__res_maybe_init=uninstrumented fun:__res_mkquery=uninstrumented fun:__res_nameinquery=uninstrumented fun:__res_nclose=uninstrumented fun:__res_ninit=uninstrumented fun:__res_nmkquery=uninstrumented fun:__res_nquery=uninstrumented fun:__res_nquerydomain=uninstrumented fun:__res_nsearch=uninstrumented fun:__res_nsend=uninstrumented fun:__res_ownok=uninstrumented fun:__res_queriesmatch=uninstrumented fun:__res_query=uninstrumented fun:__res_querydomain=uninstrumented fun:__res_randomid=uninstrumented fun:__res_search=uninstrumented fun:__res_send=uninstrumented fun:__res_state=uninstrumented fun:__rpc_thread_createerr=uninstrumented fun:__rpc_thread_svc_fdset=uninstrumented fun:__rpc_thread_svc_max_pollfd=uninstrumented fun:__rpc_thread_svc_pollfd=uninstrumented fun:__sbrk=uninstrumented fun:__scalb_finite=uninstrumented fun:__scalbf_finite=uninstrumented fun:__scalbl_finite=uninstrumented fun:__sched_cpualloc=uninstrumented fun:__sched_cpucount=uninstrumented fun:__sched_cpufree=uninstrumented fun:__sched_get_priority_max=uninstrumented fun:__sched_get_priority_min=uninstrumented fun:__sched_getparam=uninstrumented fun:__sched_getscheduler=uninstrumented fun:__sched_setscheduler=uninstrumented fun:__sched_yield=uninstrumented fun:__secure_getenv=uninstrumented fun:__select=uninstrumented fun:__send=uninstrumented fun:__sendmmsg=uninstrumented fun:__setmntent=uninstrumented fun:__setpgid=uninstrumented fun:__sfp_handle_exceptions=uninstrumented fun:__sigaction=uninstrumented fun:__sigaddset=uninstrumented fun:__sigdelset=uninstrumented fun:__sigismember=uninstrumented fun:__signbit=uninstrumented fun:__signbitf=uninstrumented fun:__signbitl=uninstrumented fun:__sigpause=uninstrumented fun:__sigsetjmp=uninstrumented fun:__sigsuspend=uninstrumented fun:__sinh_finite=uninstrumented fun:__sinhf_finite=uninstrumented fun:__sinhl_finite=uninstrumented fun:__snprintf_chk=uninstrumented fun:__splitstack_block_signals=uninstrumented fun:__splitstack_block_signals_context=uninstrumented fun:__splitstack_find=uninstrumented fun:__splitstack_find_context=uninstrumented fun:__splitstack_getcontext=uninstrumented fun:__splitstack_makecontext=uninstrumented fun:__splitstack_releasecontext=uninstrumented fun:__splitstack_resetcontext=uninstrumented fun:__splitstack_setcontext=uninstrumented fun:__sprintf_chk=uninstrumented fun:__sqrt_finite=uninstrumented fun:__sqrtf_finite=uninstrumented fun:__sqrtl_finite=uninstrumented fun:__stack_chk_fail=uninstrumented fun:__stack_chk_fail_local=uninstrumented fun:__stack_split_initialize=uninstrumented fun:__stat=uninstrumented fun:__statfs=uninstrumented fun:__stpcpy=uninstrumented fun:__stpcpy_chk=uninstrumented fun:__stpcpy_small=uninstrumented fun:__stpncpy=uninstrumented fun:__stpncpy_chk=uninstrumented fun:__strcasecmp=uninstrumented fun:__strcasecmp_l=uninstrumented fun:__strcasestr=uninstrumented fun:__strcat_chk=uninstrumented fun:__strcoll_l=uninstrumented fun:__strcpy_chk=uninstrumented fun:__strcpy_small=uninstrumented fun:__strcspn_c1=uninstrumented fun:__strcspn_c2=uninstrumented fun:__strcspn_c3=uninstrumented fun:__strdup=uninstrumented fun:__strerror_r=uninstrumented fun:__strfmon_l=uninstrumented fun:__strftime_l=uninstrumented fun:__strncasecmp_l=uninstrumented fun:__strncat_chk=uninstrumented fun:__strncpy_chk=uninstrumented fun:__strndup=uninstrumented fun:__strpbrk_c2=uninstrumented fun:__strpbrk_c3=uninstrumented fun:__strsep_1c=uninstrumented fun:__strsep_2c=uninstrumented fun:__strsep_3c=uninstrumented fun:__strsep_g=uninstrumented fun:__strspn_c1=uninstrumented fun:__strspn_c2=uninstrumented fun:__strspn_c3=uninstrumented fun:__strtod_internal=uninstrumented fun:__strtod_l=uninstrumented fun:__strtof_internal=uninstrumented fun:__strtof_l=uninstrumented fun:__strtok_r=uninstrumented fun:__strtok_r_1c=uninstrumented fun:__strtol_internal=uninstrumented fun:__strtol_l=uninstrumented fun:__strtold_internal=uninstrumented fun:__strtold_l=uninstrumented fun:__strtoll_internal=uninstrumented fun:__strtoll_l=uninstrumented fun:__strtoul_internal=uninstrumented fun:__strtoul_l=uninstrumented fun:__strtoull_internal=uninstrumented fun:__strtoull_l=uninstrumented fun:__strverscmp=uninstrumented fun:__strxfrm_l=uninstrumented fun:__subtf3=uninstrumented fun:__subvdi3=uninstrumented fun:__subvsi3=uninstrumented fun:__subvti3=uninstrumented fun:__swprintf_chk=uninstrumented fun:__sym_ntop=uninstrumented fun:__sym_ntos=uninstrumented fun:__sym_ston=uninstrumented fun:__sysconf=uninstrumented fun:__sysctl=uninstrumented fun:__syslog_chk=uninstrumented fun:__sysv_signal=uninstrumented fun:__tls_get_addr=uninstrumented fun:__toascii_l=uninstrumented fun:__tolower_l=uninstrumented fun:__toupper_l=uninstrumented fun:__towctrans=uninstrumented fun:__towctrans_l=uninstrumented fun:__towlower_l=uninstrumented fun:__towupper_l=uninstrumented fun:__trunctfdf2=uninstrumented fun:__trunctfsf2=uninstrumented fun:__trunctfxf2=uninstrumented fun:__ttyname_r_chk=uninstrumented fun:__ucmpti2=uninstrumented fun:__udiv_w_sdiv=uninstrumented fun:__udivmodti4=uninstrumented fun:__udivti3=uninstrumented fun:__uflow=uninstrumented fun:__umodti3=uninstrumented fun:__underflow=uninstrumented fun:__unordtf2=uninstrumented fun:__uselocale=uninstrumented fun:__vasprintf_chk=uninstrumented fun:__vdprintf_chk=uninstrumented fun:__vfork=uninstrumented fun:__vfprintf_chk=uninstrumented fun:__vfscanf=uninstrumented fun:__vfwprintf_chk=uninstrumented fun:__vprintf_chk=uninstrumented fun:__vsnprintf=uninstrumented fun:__vsnprintf_chk=uninstrumented fun:__vsprintf_chk=uninstrumented fun:__vsscanf=uninstrumented fun:__vswprintf_chk=uninstrumented fun:__vsyslog_chk=uninstrumented fun:__vwprintf_chk=uninstrumented fun:__wait=uninstrumented fun:__waitpid=uninstrumented fun:__warn_memset_zero_len=uninstrumented fun:__wcpcpy_chk=uninstrumented fun:__wcpncpy_chk=uninstrumented fun:__wcrtomb_chk=uninstrumented fun:__wcscasecmp_l=uninstrumented fun:__wcscat_chk=uninstrumented fun:__wcscoll_l=uninstrumented fun:__wcscpy_chk=uninstrumented fun:__wcsftime_l=uninstrumented fun:__wcsncasecmp_l=uninstrumented fun:__wcsncat_chk=uninstrumented fun:__wcsncpy_chk=uninstrumented fun:__wcsnrtombs_chk=uninstrumented fun:__wcsrtombs_chk=uninstrumented fun:__wcstod_internal=uninstrumented fun:__wcstod_l=uninstrumented fun:__wcstof_internal=uninstrumented fun:__wcstof_l=uninstrumented fun:__wcstol_internal=uninstrumented fun:__wcstol_l=uninstrumented fun:__wcstold_internal=uninstrumented fun:__wcstold_l=uninstrumented fun:__wcstoll_internal=uninstrumented fun:__wcstoll_l=uninstrumented fun:__wcstombs_chk=uninstrumented fun:__wcstoul_internal=uninstrumented fun:__wcstoul_l=uninstrumented fun:__wcstoull_internal=uninstrumented fun:__wcstoull_l=uninstrumented fun:__wcsxfrm_l=uninstrumented fun:__wctomb_chk=uninstrumented fun:__wctrans_l=uninstrumented fun:__wctype_l=uninstrumented fun:__wmemcpy_chk=uninstrumented fun:__wmemmove_chk=uninstrumented fun:__wmempcpy_chk=uninstrumented fun:__wmemset_chk=uninstrumented fun:__woverflow=uninstrumented fun:__wprintf_chk=uninstrumented fun:__wrap_pthread_create=uninstrumented fun:__write=uninstrumented fun:__wuflow=uninstrumented fun:__wunderflow=uninstrumented fun:__xmknod=uninstrumented fun:__xmknodat=uninstrumented fun:__xpg_basename=uninstrumented fun:__xpg_sigpause=uninstrumented fun:__xpg_strerror_r=uninstrumented fun:__xstat=uninstrumented fun:__xstat64=uninstrumented fun:__y0_finite=uninstrumented fun:__y0f_finite=uninstrumented fun:__y0l_finite=uninstrumented fun:__y1_finite=uninstrumented fun:__y1f_finite=uninstrumented fun:__y1l_finite=uninstrumented fun:__yn_finite=uninstrumented fun:__ynf_finite=uninstrumented fun:__ynl_finite=uninstrumented fun:__yp_check=uninstrumented fun:_authenticate=uninstrumented fun:_dl_addr=uninstrumented fun:_dl_allocate_tls=uninstrumented fun:_dl_allocate_tls_init=uninstrumented fun:_dl_deallocate_tls=uninstrumented fun:_dl_debug_state=uninstrumented fun:_dl_find_dso_for_object=uninstrumented fun:_dl_get_tls_static_info=uninstrumented fun:_dl_make_stack_executable=uninstrumented fun:_dl_mcount=uninstrumented fun:_dl_mcount_wrapper=uninstrumented fun:_dl_mcount_wrapper_check=uninstrumented fun:_dl_rtld_di_serinfo=uninstrumented fun:_dl_sym=uninstrumented fun:_dl_tls_setup=uninstrumented fun:_dl_vsym=uninstrumented fun:_exit=uninstrumented fun:_flushlbf=uninstrumented fun:_gethtbyaddr=uninstrumented fun:_gethtbyname=uninstrumented fun:_gethtbyname2=uninstrumented fun:_gethtent=uninstrumented fun:_getlong=uninstrumented fun:_getshort=uninstrumented fun:_longjmp=uninstrumented fun:_mcleanup=uninstrumented fun:_mcount=uninstrumented fun:_nsl_default_nss=uninstrumented fun:_nss_files_parse_grent=uninstrumented fun:_nss_files_parse_pwent=uninstrumented fun:_nss_files_parse_sgent=uninstrumented fun:_nss_files_parse_spent=uninstrumented fun:_obstack_allocated_p=uninstrumented fun:_obstack_begin=uninstrumented fun:_obstack_begin_1=uninstrumented fun:_obstack_free=uninstrumented fun:_obstack_memory_used=uninstrumented fun:_obstack_newchunk=uninstrumented fun:_pthread_cleanup_pop=uninstrumented fun:_pthread_cleanup_pop_restore=uninstrumented fun:_pthread_cleanup_push=uninstrumented fun:_pthread_cleanup_push_defer=uninstrumented fun:_rpc_dtablesize=uninstrumented fun:_seterr_reply=uninstrumented fun:_sethtent=uninstrumented fun:_setjmp=uninstrumented fun:_tolower=uninstrumented fun:_toupper=uninstrumented fun:_xdr_ib_request=uninstrumented fun:_xdr_nis_result=uninstrumented fun:a64l=uninstrumented fun:abort=uninstrumented fun:abs=uninstrumented fun:accept=uninstrumented fun:accept4=uninstrumented fun:access=uninstrumented fun:acct=uninstrumented fun:acos=uninstrumented fun:acosf=uninstrumented fun:acosh=uninstrumented fun:acoshf=uninstrumented fun:acoshl=uninstrumented fun:acosl=uninstrumented fun:addmntent=uninstrumented fun:addseverity=uninstrumented fun:adjtime=uninstrumented fun:adjtimex=uninstrumented fun:advance=uninstrumented fun:aio_cancel=uninstrumented fun:aio_cancel64=uninstrumented fun:aio_error=uninstrumented fun:aio_error64=uninstrumented fun:aio_fsync=uninstrumented fun:aio_fsync64=uninstrumented fun:aio_init=uninstrumented fun:aio_read=uninstrumented fun:aio_read64=uninstrumented fun:aio_return=uninstrumented fun:aio_return64=uninstrumented fun:aio_suspend=uninstrumented fun:aio_suspend64=uninstrumented fun:aio_write=uninstrumented fun:aio_write64=uninstrumented fun:alarm=uninstrumented fun:aligned_alloc=uninstrumented fun:alphasort=uninstrumented fun:alphasort64=uninstrumented fun:arch_prctl=uninstrumented fun:argp_error=uninstrumented fun:argp_failure=uninstrumented fun:argp_help=uninstrumented fun:argp_parse=uninstrumented fun:argp_state_help=uninstrumented fun:argp_usage=uninstrumented fun:argz_add=uninstrumented fun:argz_add_sep=uninstrumented fun:argz_append=uninstrumented fun:argz_count=uninstrumented fun:argz_create=uninstrumented fun:argz_create_sep=uninstrumented fun:argz_delete=uninstrumented fun:argz_extract=uninstrumented fun:argz_insert=uninstrumented fun:argz_next=uninstrumented fun:argz_replace=uninstrumented fun:argz_stringify=uninstrumented fun:asctime=uninstrumented fun:asctime_r=uninstrumented fun:asin=uninstrumented fun:asinf=uninstrumented fun:asinh=uninstrumented fun:asinhf=uninstrumented fun:asinhl=uninstrumented fun:asinl=uninstrumented fun:asprintf=uninstrumented fun:at_quick_exit=uninstrumented fun:atan=uninstrumented fun:atan2=uninstrumented fun:atan2f=uninstrumented fun:atan2l=uninstrumented fun:atanf=uninstrumented fun:atanh=uninstrumented fun:atanhf=uninstrumented fun:atanhl=uninstrumented fun:atanl=uninstrumented fun:atexit=uninstrumented fun:atof=uninstrumented fun:atoi=uninstrumented fun:atol=uninstrumented fun:atoll=uninstrumented fun:authdes_create=uninstrumented fun:authdes_getucred=uninstrumented fun:authdes_pk_create=uninstrumented fun:authnone_create=uninstrumented fun:authunix_create=uninstrumented fun:authunix_create_default=uninstrumented fun:backtrace=uninstrumented fun:backtrace_symbols=uninstrumented fun:backtrace_symbols_fd=uninstrumented fun:basename=uninstrumented fun:bcmp=uninstrumented fun:bcopy=uninstrumented fun:bdflush=uninstrumented fun:bind=uninstrumented fun:bind_textdomain_codeset=uninstrumented fun:bindresvport=uninstrumented fun:bindtextdomain=uninstrumented fun:brk=uninstrumented fun:bsd_signal=uninstrumented fun:bsearch=uninstrumented fun:btowc=uninstrumented fun:bzero=uninstrumented fun:c16rtomb=uninstrumented fun:c32rtomb=uninstrumented fun:cabs=uninstrumented fun:cabsf=uninstrumented fun:cabsl=uninstrumented fun:cacos=uninstrumented fun:cacosf=uninstrumented fun:cacosh=uninstrumented fun:cacoshf=uninstrumented fun:cacoshl=uninstrumented fun:cacosl=uninstrumented fun:calloc=uninstrumented fun:callrpc=uninstrumented fun:canonicalize_file_name=uninstrumented fun:capget=uninstrumented fun:capset=uninstrumented fun:carg=uninstrumented fun:cargf=uninstrumented fun:cargl=uninstrumented fun:casin=uninstrumented fun:casinf=uninstrumented fun:casinh=uninstrumented fun:casinhf=uninstrumented fun:casinhl=uninstrumented fun:casinl=uninstrumented fun:catan=uninstrumented fun:catanf=uninstrumented fun:catanh=uninstrumented fun:catanhf=uninstrumented fun:catanhl=uninstrumented fun:catanl=uninstrumented fun:catclose=uninstrumented fun:catgets=uninstrumented fun:catopen=uninstrumented fun:cbc_crypt=uninstrumented fun:cbrt=uninstrumented fun:cbrtf=uninstrumented fun:cbrtl=uninstrumented fun:ccos=uninstrumented fun:ccosf=uninstrumented fun:ccosh=uninstrumented fun:ccoshf=uninstrumented fun:ccoshl=uninstrumented fun:ccosl=uninstrumented fun:ceil=uninstrumented fun:ceilf=uninstrumented fun:ceill=uninstrumented fun:cexp=uninstrumented fun:cexpf=uninstrumented fun:cexpl=uninstrumented fun:cfgetispeed=uninstrumented fun:cfgetospeed=uninstrumented fun:cfmakeraw=uninstrumented fun:cfree=uninstrumented fun:cfsetispeed=uninstrumented fun:cfsetospeed=uninstrumented fun:cfsetspeed=uninstrumented fun:chdir=uninstrumented fun:chflags=uninstrumented fun:chmod=uninstrumented fun:chown=uninstrumented fun:chroot=uninstrumented fun:cimag=uninstrumented fun:cimagf=uninstrumented fun:cimagl=uninstrumented fun:clearenv=uninstrumented fun:clearerr=uninstrumented fun:clearerr_unlocked=uninstrumented fun:clnt_broadcast=uninstrumented fun:clnt_create=uninstrumented fun:clnt_pcreateerror=uninstrumented fun:clnt_perrno=uninstrumented fun:clnt_perror=uninstrumented fun:clnt_spcreateerror=uninstrumented fun:clnt_sperrno=uninstrumented fun:clnt_sperror=uninstrumented fun:clntraw_create=uninstrumented fun:clnttcp_create=uninstrumented fun:clntudp_bufcreate=uninstrumented fun:clntudp_create=uninstrumented fun:clntunix_create=uninstrumented fun:clock=uninstrumented fun:clock_adjtime=uninstrumented fun:clock_getcpuclockid=uninstrumented fun:clock_getres=uninstrumented fun:clock_gettime=uninstrumented fun:clock_nanosleep=uninstrumented fun:clock_settime=uninstrumented fun:clog=uninstrumented fun:clog10=uninstrumented fun:clog10f=uninstrumented fun:clog10l=uninstrumented fun:clogf=uninstrumented fun:clogl=uninstrumented fun:clone=uninstrumented fun:close=uninstrumented fun:closedir=uninstrumented fun:closelog=uninstrumented fun:confstr=uninstrumented fun:conj=uninstrumented fun:conjf=uninstrumented fun:conjl=uninstrumented fun:connect=uninstrumented fun:copysign=uninstrumented fun:copysignf=uninstrumented fun:copysignl=uninstrumented fun:cos=uninstrumented fun:cosf=uninstrumented fun:cosh=uninstrumented fun:coshf=uninstrumented fun:coshl=uninstrumented fun:cosl=uninstrumented fun:cpow=uninstrumented fun:cpowf=uninstrumented fun:cpowl=uninstrumented fun:cproj=uninstrumented fun:cprojf=uninstrumented fun:cprojl=uninstrumented fun:creal=uninstrumented fun:crealf=uninstrumented fun:creall=uninstrumented fun:creat=uninstrumented fun:creat64=uninstrumented fun:create_module=uninstrumented fun:crypt=uninstrumented fun:crypt_r=uninstrumented fun:csin=uninstrumented fun:csinf=uninstrumented fun:csinh=uninstrumented fun:csinhf=uninstrumented fun:csinhl=uninstrumented fun:csinl=uninstrumented fun:csqrt=uninstrumented fun:csqrtf=uninstrumented fun:csqrtl=uninstrumented fun:ctan=uninstrumented fun:ctanf=uninstrumented fun:ctanh=uninstrumented fun:ctanhf=uninstrumented fun:ctanhl=uninstrumented fun:ctanl=uninstrumented fun:ctermid=uninstrumented fun:ctime=uninstrumented fun:ctime_r=uninstrumented fun:cuserid=uninstrumented fun:daemon=uninstrumented fun:dcgettext=uninstrumented fun:dcngettext=uninstrumented fun:delete_module=uninstrumented fun:des_setparity=uninstrumented fun:dgettext=uninstrumented fun:difftime=uninstrumented fun:dirfd=uninstrumented fun:dirname=uninstrumented fun:div=uninstrumented fun:dl_iterate_phdr=uninstrumented fun:dladdr=uninstrumented fun:dladdr1=uninstrumented fun:dlclose=uninstrumented fun:dlerror=uninstrumented fun:dlinfo=uninstrumented fun:dlmopen=uninstrumented fun:dlopen=uninstrumented fun:dlsym=uninstrumented fun:dlvsym=uninstrumented fun:dngettext=uninstrumented fun:dprintf=uninstrumented fun:drand48=uninstrumented fun:drand48_r=uninstrumented fun:drem=uninstrumented fun:dremf=uninstrumented fun:dreml=uninstrumented fun:dup=uninstrumented fun:dup2=uninstrumented fun:dup3=uninstrumented fun:duplocale=uninstrumented fun:dysize=uninstrumented fun:eaccess=uninstrumented fun:ecb_crypt=uninstrumented fun:ecvt=uninstrumented fun:ecvt_r=uninstrumented fun:encrypt=uninstrumented fun:encrypt_r=uninstrumented fun:endaliasent=uninstrumented fun:endfsent=uninstrumented fun:endgrent=uninstrumented fun:endhostent=uninstrumented fun:endmntent=uninstrumented fun:endnetent=uninstrumented fun:endnetgrent=uninstrumented fun:endprotoent=uninstrumented fun:endpwent=uninstrumented fun:endrpcent=uninstrumented fun:endservent=uninstrumented fun:endsgent=uninstrumented fun:endspent=uninstrumented fun:endttyent=uninstrumented fun:endusershell=uninstrumented fun:endutent=uninstrumented fun:endutxent=uninstrumented fun:envz_add=uninstrumented fun:envz_entry=uninstrumented fun:envz_get=uninstrumented fun:envz_merge=uninstrumented fun:envz_remove=uninstrumented fun:envz_strip=uninstrumented fun:epoll_create=uninstrumented fun:epoll_create1=uninstrumented fun:epoll_ctl=uninstrumented fun:epoll_pwait=uninstrumented fun:epoll_wait=uninstrumented fun:erand48=uninstrumented fun:erand48_r=uninstrumented fun:erf=uninstrumented fun:erfc=uninstrumented fun:erfcf=uninstrumented fun:erfcl=uninstrumented fun:erff=uninstrumented fun:erfl=uninstrumented fun:err=uninstrumented fun:error=uninstrumented fun:error_at_line=uninstrumented fun:errx=uninstrumented fun:ether_aton=uninstrumented fun:ether_aton_r=uninstrumented fun:ether_hostton=uninstrumented fun:ether_line=uninstrumented fun:ether_ntoa=uninstrumented fun:ether_ntoa_r=uninstrumented fun:ether_ntohost=uninstrumented fun:euidaccess=uninstrumented fun:eventfd=uninstrumented fun:eventfd_read=uninstrumented fun:eventfd_write=uninstrumented fun:execl=uninstrumented fun:execle=uninstrumented fun:execlp=uninstrumented fun:execv=uninstrumented fun:execve=uninstrumented fun:execvp=uninstrumented fun:execvpe=uninstrumented fun:exit=uninstrumented fun:exp=uninstrumented fun:exp10=uninstrumented fun:exp10f=uninstrumented fun:exp10l=uninstrumented fun:exp2=uninstrumented fun:exp2f=uninstrumented fun:exp2l=uninstrumented fun:expf=uninstrumented fun:expl=uninstrumented fun:expm1=uninstrumented fun:expm1f=uninstrumented fun:expm1l=uninstrumented fun:fabs=uninstrumented fun:fabsf=uninstrumented fun:fabsl=uninstrumented fun:faccessat=uninstrumented fun:fallocate=uninstrumented fun:fallocate64=uninstrumented fun:fanotify_init=uninstrumented fun:fanotify_mark=uninstrumented fun:fattach=uninstrumented fun:fchdir=uninstrumented fun:fchflags=uninstrumented fun:fchmod=uninstrumented fun:fchmodat=uninstrumented fun:fchown=uninstrumented fun:fchownat=uninstrumented fun:fclose=uninstrumented fun:fcloseall=uninstrumented fun:fcntl=uninstrumented fun:fcrypt=uninstrumented fun:fcvt=uninstrumented fun:fcvt_r=uninstrumented fun:fdatasync=uninstrumented fun:fdetach=uninstrumented fun:fdim=uninstrumented fun:fdimf=uninstrumented fun:fdiml=uninstrumented fun:fdopen=uninstrumented fun:fdopendir=uninstrumented fun:feclearexcept=uninstrumented fun:fedisableexcept=uninstrumented fun:feenableexcept=uninstrumented fun:fegetenv=uninstrumented fun:fegetexcept=uninstrumented fun:fegetexceptflag=uninstrumented fun:fegetround=uninstrumented fun:feholdexcept=uninstrumented fun:feof=uninstrumented fun:feof_unlocked=uninstrumented fun:feraiseexcept=uninstrumented fun:ferror=uninstrumented fun:ferror_unlocked=uninstrumented fun:fesetenv=uninstrumented fun:fesetexceptflag=uninstrumented fun:fesetround=uninstrumented fun:fetestexcept=uninstrumented fun:feupdateenv=uninstrumented fun:fexecve=uninstrumented fun:fflush=uninstrumented fun:fflush_unlocked=uninstrumented fun:ffs=uninstrumented fun:ffsl=uninstrumented fun:ffsll=uninstrumented fun:fgetc=uninstrumented fun:fgetc_unlocked=uninstrumented fun:fgetgrent=uninstrumented fun:fgetgrent_r=uninstrumented fun:fgetpos=uninstrumented fun:fgetpos64=uninstrumented fun:fgetpwent=uninstrumented fun:fgetpwent_r=uninstrumented fun:fgets=uninstrumented fun:fgets_unlocked=uninstrumented fun:fgetsgent=uninstrumented fun:fgetsgent_r=uninstrumented fun:fgetspent=uninstrumented fun:fgetspent_r=uninstrumented fun:fgetwc=uninstrumented fun:fgetwc_unlocked=uninstrumented fun:fgetws=uninstrumented fun:fgetws_unlocked=uninstrumented fun:fgetxattr=uninstrumented fun:fileno=uninstrumented fun:fileno_unlocked=uninstrumented fun:finite=uninstrumented fun:finitef=uninstrumented fun:finitel=uninstrumented fun:flistxattr=uninstrumented fun:flock=uninstrumented fun:flockfile=uninstrumented fun:floor=uninstrumented fun:floorf=uninstrumented fun:floorl=uninstrumented fun:fma=uninstrumented fun:fmaf=uninstrumented fun:fmal=uninstrumented fun:fmax=uninstrumented fun:fmaxf=uninstrumented fun:fmaxl=uninstrumented fun:fmemopen=uninstrumented fun:fmin=uninstrumented fun:fminf=uninstrumented fun:fminl=uninstrumented fun:fmod=uninstrumented fun:fmodf=uninstrumented fun:fmodl=uninstrumented fun:fmtmsg=uninstrumented fun:fnmatch=uninstrumented fun:fopen=uninstrumented fun:fopen64=uninstrumented fun:fopencookie=uninstrumented fun:fork=uninstrumented fun:forkpty=uninstrumented fun:fpathconf=uninstrumented fun:fprintf=uninstrumented fun:fputc=uninstrumented fun:fputc_unlocked=uninstrumented fun:fputs=uninstrumented fun:fputs_unlocked=uninstrumented fun:fputwc=uninstrumented fun:fputwc_unlocked=uninstrumented fun:fputws=uninstrumented fun:fputws_unlocked=uninstrumented fun:fread=uninstrumented fun:fread_unlocked=uninstrumented fun:free=uninstrumented fun:freeaddrinfo=uninstrumented fun:freeifaddrs=uninstrumented fun:freelocale=uninstrumented fun:fremovexattr=uninstrumented fun:freopen=uninstrumented fun:freopen64=uninstrumented fun:frexp=uninstrumented fun:frexpf=uninstrumented fun:frexpl=uninstrumented fun:fscanf=uninstrumented fun:fseek=uninstrumented fun:fseeko=uninstrumented fun:fseeko64=uninstrumented fun:fsetpos=uninstrumented fun:fsetpos64=uninstrumented fun:fsetxattr=uninstrumented fun:fstat=uninstrumented fun:fstat64=uninstrumented fun:fstatat=uninstrumented fun:fstatat64=uninstrumented fun:fstatfs=uninstrumented fun:fstatfs64=uninstrumented fun:fstatvfs=uninstrumented fun:fstatvfs64=uninstrumented fun:fsync=uninstrumented fun:ftell=uninstrumented fun:ftello=uninstrumented fun:ftello64=uninstrumented fun:ftime=uninstrumented fun:ftok=uninstrumented fun:ftruncate=uninstrumented fun:ftruncate64=uninstrumented fun:ftrylockfile=uninstrumented fun:fts_children=uninstrumented fun:fts_close=uninstrumented fun:fts_open=uninstrumented fun:fts_read=uninstrumented fun:fts_set=uninstrumented fun:ftw=uninstrumented fun:ftw64=uninstrumented fun:funlockfile=uninstrumented fun:futimens=uninstrumented fun:futimes=uninstrumented fun:futimesat=uninstrumented fun:fwide=uninstrumented fun:fwprintf=uninstrumented fun:fwrite=uninstrumented fun:fwrite_unlocked=uninstrumented fun:fwscanf=uninstrumented fun:gai_cancel=uninstrumented fun:gai_error=uninstrumented fun:gai_strerror=uninstrumented fun:gai_suspend=uninstrumented fun:gamma=uninstrumented fun:gammaf=uninstrumented fun:gammal=uninstrumented fun:gcvt=uninstrumented fun:get_avphys_pages=uninstrumented fun:get_current_dir_name=uninstrumented fun:get_kernel_syms=uninstrumented fun:get_myaddress=uninstrumented fun:get_nprocs=uninstrumented fun:get_nprocs_conf=uninstrumented fun:get_phys_pages=uninstrumented fun:getaddrinfo=uninstrumented fun:getaddrinfo_a=uninstrumented fun:getaliasbyname=uninstrumented fun:getaliasbyname_r=uninstrumented fun:getaliasent=uninstrumented fun:getaliasent_r=uninstrumented fun:getauxval=uninstrumented fun:getc=uninstrumented fun:getc_unlocked=uninstrumented fun:getchar=uninstrumented fun:getchar_unlocked=uninstrumented fun:getcontext=uninstrumented fun:getcwd=uninstrumented fun:getdate=uninstrumented fun:getdate_r=uninstrumented fun:getdelim=uninstrumented fun:getdirentries=uninstrumented fun:getdirentries64=uninstrumented fun:getdomainname=uninstrumented fun:getdtablesize=uninstrumented fun:getegid=uninstrumented fun:getenv=uninstrumented fun:geteuid=uninstrumented fun:getfsent=uninstrumented fun:getfsfile=uninstrumented fun:getfsspec=uninstrumented fun:getgid=uninstrumented fun:getgrent=uninstrumented fun:getgrent_r=uninstrumented fun:getgrgid=uninstrumented fun:getgrgid_r=uninstrumented fun:getgrnam=uninstrumented fun:getgrnam_r=uninstrumented fun:getgrouplist=uninstrumented fun:getgroups=uninstrumented fun:gethostbyaddr=uninstrumented fun:gethostbyaddr_r=uninstrumented fun:gethostbyname=uninstrumented fun:gethostbyname2=uninstrumented fun:gethostbyname2_r=uninstrumented fun:gethostbyname_r=uninstrumented fun:gethostent=uninstrumented fun:gethostent_r=uninstrumented fun:gethostid=uninstrumented fun:gethostname=uninstrumented fun:getifaddrs=uninstrumented fun:getipv4sourcefilter=uninstrumented fun:getitimer=uninstrumented fun:getline=uninstrumented fun:getloadavg=uninstrumented fun:getlogin=uninstrumented fun:getlogin_r=uninstrumented fun:getmntent=uninstrumented fun:getmntent_r=uninstrumented fun:getmsg=uninstrumented fun:getnameinfo=uninstrumented fun:getnetbyaddr=uninstrumented fun:getnetbyaddr_r=uninstrumented fun:getnetbyname=uninstrumented fun:getnetbyname_r=uninstrumented fun:getnetent=uninstrumented fun:getnetent_r=uninstrumented fun:getnetgrent=uninstrumented fun:getnetgrent_r=uninstrumented fun:getnetname=uninstrumented fun:getopt=uninstrumented fun:getopt_long=uninstrumented fun:getopt_long_only=uninstrumented fun:getpagesize=uninstrumented fun:getpass=uninstrumented fun:getpeername=uninstrumented fun:getpgid=uninstrumented fun:getpgrp=uninstrumented fun:getpid=uninstrumented fun:getpmsg=uninstrumented fun:getppid=uninstrumented fun:getpriority=uninstrumented fun:getprotobyname=uninstrumented fun:getprotobyname_r=uninstrumented fun:getprotobynumber=uninstrumented fun:getprotobynumber_r=uninstrumented fun:getprotoent=uninstrumented fun:getprotoent_r=uninstrumented fun:getpt=uninstrumented fun:getpublickey=uninstrumented fun:getpw=uninstrumented fun:getpwent=uninstrumented fun:getpwent_r=uninstrumented fun:getpwnam=uninstrumented fun:getpwnam_r=uninstrumented fun:getpwuid=uninstrumented fun:getpwuid_r=uninstrumented fun:getresgid=uninstrumented fun:getresuid=uninstrumented fun:getrlimit=uninstrumented fun:getrlimit64=uninstrumented fun:getrpcbyname=uninstrumented fun:getrpcbyname_r=uninstrumented fun:getrpcbynumber=uninstrumented fun:getrpcbynumber_r=uninstrumented fun:getrpcent=uninstrumented fun:getrpcent_r=uninstrumented fun:getrpcport=uninstrumented fun:getrusage=uninstrumented fun:gets=uninstrumented fun:getsecretkey=uninstrumented fun:getservbyname=uninstrumented fun:getservbyname_r=uninstrumented fun:getservbyport=uninstrumented fun:getservbyport_r=uninstrumented fun:getservent=uninstrumented fun:getservent_r=uninstrumented fun:getsgent=uninstrumented fun:getsgent_r=uninstrumented fun:getsgnam=uninstrumented fun:getsgnam_r=uninstrumented fun:getsid=uninstrumented fun:getsockname=uninstrumented fun:getsockopt=uninstrumented fun:getsourcefilter=uninstrumented fun:getspent=uninstrumented fun:getspent_r=uninstrumented fun:getspnam=uninstrumented fun:getspnam_r=uninstrumented fun:getsubopt=uninstrumented fun:gettext=uninstrumented fun:gettimeofday=uninstrumented fun:getttyent=uninstrumented fun:getttynam=uninstrumented fun:getuid=uninstrumented fun:getusershell=uninstrumented fun:getutent=uninstrumented fun:getutent_r=uninstrumented fun:getutid=uninstrumented fun:getutid_r=uninstrumented fun:getutline=uninstrumented fun:getutline_r=uninstrumented fun:getutmp=uninstrumented fun:getutmpx=uninstrumented fun:getutxent=uninstrumented fun:getutxid=uninstrumented fun:getutxline=uninstrumented fun:getw=uninstrumented fun:getwc=uninstrumented fun:getwc_unlocked=uninstrumented fun:getwchar=uninstrumented fun:getwchar_unlocked=uninstrumented fun:getwd=uninstrumented fun:getxattr=uninstrumented fun:glob=uninstrumented fun:glob64=uninstrumented fun:glob_pattern_p=uninstrumented fun:globfree=uninstrumented fun:globfree64=uninstrumented fun:gmtime=uninstrumented fun:gmtime_r=uninstrumented fun:gnu_dev_major=uninstrumented fun:gnu_dev_makedev=uninstrumented fun:gnu_dev_minor=uninstrumented fun:gnu_get_libc_release=uninstrumented fun:gnu_get_libc_version=uninstrumented fun:grantpt=uninstrumented fun:group_member=uninstrumented fun:gsignal=uninstrumented fun:gtty=uninstrumented fun:hasmntopt=uninstrumented fun:hcreate=uninstrumented fun:hcreate_r=uninstrumented fun:hdestroy=uninstrumented fun:hdestroy_r=uninstrumented fun:herror=uninstrumented fun:host2netname=uninstrumented fun:hsearch=uninstrumented fun:hsearch_r=uninstrumented fun:hstrerror=uninstrumented fun:htonl=uninstrumented fun:htons=uninstrumented fun:hypot=uninstrumented fun:hypotf=uninstrumented fun:hypotl=uninstrumented fun:iconv=uninstrumented fun:iconv_close=uninstrumented fun:iconv_open=uninstrumented fun:idna_to_ascii_lz=uninstrumented fun:idna_to_unicode_lzlz=uninstrumented fun:if_freenameindex=uninstrumented fun:if_indextoname=uninstrumented fun:if_nameindex=uninstrumented fun:if_nametoindex=uninstrumented fun:ilogb=uninstrumented fun:ilogbf=uninstrumented fun:ilogbl=uninstrumented fun:imaxabs=uninstrumented fun:imaxdiv=uninstrumented fun:index=uninstrumented fun:inet6_opt_append=uninstrumented fun:inet6_opt_find=uninstrumented fun:inet6_opt_finish=uninstrumented fun:inet6_opt_get_val=uninstrumented fun:inet6_opt_init=uninstrumented fun:inet6_opt_next=uninstrumented fun:inet6_opt_set_val=uninstrumented fun:inet6_option_alloc=uninstrumented fun:inet6_option_append=uninstrumented fun:inet6_option_find=uninstrumented fun:inet6_option_init=uninstrumented fun:inet6_option_next=uninstrumented fun:inet6_option_space=uninstrumented fun:inet6_rth_add=uninstrumented fun:inet6_rth_getaddr=uninstrumented fun:inet6_rth_init=uninstrumented fun:inet6_rth_reverse=uninstrumented fun:inet6_rth_segments=uninstrumented fun:inet6_rth_space=uninstrumented fun:inet_addr=uninstrumented fun:inet_aton=uninstrumented fun:inet_lnaof=uninstrumented fun:inet_makeaddr=uninstrumented fun:inet_net_ntop=uninstrumented fun:inet_net_pton=uninstrumented fun:inet_neta=uninstrumented fun:inet_netof=uninstrumented fun:inet_network=uninstrumented fun:inet_nsap_addr=uninstrumented fun:inet_nsap_ntoa=uninstrumented fun:inet_ntoa=uninstrumented fun:inet_ntop=uninstrumented fun:inet_pton=uninstrumented fun:init_module=uninstrumented fun:initgroups=uninstrumented fun:initstate=uninstrumented fun:initstate_r=uninstrumented fun:innetgr=uninstrumented fun:inotify_add_watch=uninstrumented fun:inotify_init=uninstrumented fun:inotify_init1=uninstrumented fun:inotify_rm_watch=uninstrumented fun:insque=uninstrumented fun:ioctl=uninstrumented fun:ioperm=uninstrumented fun:iopl=uninstrumented fun:iruserok=uninstrumented fun:iruserok_af=uninstrumented fun:isalnum=uninstrumented fun:isalnum_l=uninstrumented fun:isalpha=uninstrumented fun:isalpha_l=uninstrumented fun:isascii=uninstrumented fun:isastream=uninstrumented fun:isatty=uninstrumented fun:isblank=uninstrumented fun:isblank_l=uninstrumented fun:iscntrl=uninstrumented fun:iscntrl_l=uninstrumented fun:isctype=uninstrumented fun:isdigit=uninstrumented fun:isdigit_l=uninstrumented fun:isfdtype=uninstrumented fun:isgraph=uninstrumented fun:isgraph_l=uninstrumented fun:isinf=uninstrumented fun:isinfd128=uninstrumented fun:isinfd32=uninstrumented fun:isinfd64=uninstrumented fun:isinff=uninstrumented fun:isinfl=uninstrumented fun:islower=uninstrumented fun:islower_l=uninstrumented fun:isnan=uninstrumented fun:isnanf=uninstrumented fun:isnanl=uninstrumented fun:isprint=uninstrumented fun:isprint_l=uninstrumented fun:ispunct=uninstrumented fun:ispunct_l=uninstrumented fun:isspace=uninstrumented fun:isspace_l=uninstrumented fun:isupper=uninstrumented fun:isupper_l=uninstrumented fun:iswalnum=uninstrumented fun:iswalnum_l=uninstrumented fun:iswalpha=uninstrumented fun:iswalpha_l=uninstrumented fun:iswblank=uninstrumented fun:iswblank_l=uninstrumented fun:iswcntrl=uninstrumented fun:iswcntrl_l=uninstrumented fun:iswctype=uninstrumented fun:iswctype_l=uninstrumented fun:iswdigit=uninstrumented fun:iswdigit_l=uninstrumented fun:iswgraph=uninstrumented fun:iswgraph_l=uninstrumented fun:iswlower=uninstrumented fun:iswlower_l=uninstrumented fun:iswprint=uninstrumented fun:iswprint_l=uninstrumented fun:iswpunct=uninstrumented fun:iswpunct_l=uninstrumented fun:iswspace=uninstrumented fun:iswspace_l=uninstrumented fun:iswupper=uninstrumented fun:iswupper_l=uninstrumented fun:iswxdigit=uninstrumented fun:iswxdigit_l=uninstrumented fun:isxdigit=uninstrumented fun:isxdigit_l=uninstrumented fun:j0=uninstrumented fun:j0f=uninstrumented fun:j0l=uninstrumented fun:j1=uninstrumented fun:j1f=uninstrumented fun:j1l=uninstrumented fun:jn=uninstrumented fun:jnf=uninstrumented fun:jnl=uninstrumented fun:jrand48=uninstrumented fun:jrand48_r=uninstrumented fun:key_decryptsession=uninstrumented fun:key_decryptsession_pk=uninstrumented fun:key_encryptsession=uninstrumented fun:key_encryptsession_pk=uninstrumented fun:key_gendes=uninstrumented fun:key_get_conv=uninstrumented fun:key_secretkey_is_set=uninstrumented fun:key_setnet=uninstrumented fun:key_setsecret=uninstrumented fun:kill=uninstrumented fun:killpg=uninstrumented fun:klogctl=uninstrumented fun:l64a=uninstrumented fun:labs=uninstrumented fun:lchmod=uninstrumented fun:lchown=uninstrumented fun:lckpwdf=uninstrumented fun:lcong48=uninstrumented fun:lcong48_r=uninstrumented fun:ldexp=uninstrumented fun:ldexpf=uninstrumented fun:ldexpl=uninstrumented fun:ldiv=uninstrumented fun:lfind=uninstrumented fun:lgamma=uninstrumented fun:lgamma_r=uninstrumented fun:lgammaf=uninstrumented fun:lgammaf_r=uninstrumented fun:lgammal=uninstrumented fun:lgammal_r=uninstrumented fun:lgetxattr=uninstrumented fun:link=uninstrumented fun:linkat=uninstrumented fun:lio_listio=uninstrumented fun:lio_listio64=uninstrumented fun:listen=uninstrumented fun:listxattr=uninstrumented fun:llabs=uninstrumented fun:lldiv=uninstrumented fun:llistxattr=uninstrumented fun:llrint=uninstrumented fun:llrintf=uninstrumented fun:llrintl=uninstrumented fun:llround=uninstrumented fun:llroundf=uninstrumented fun:llroundl=uninstrumented fun:llseek=uninstrumented fun:localeconv=uninstrumented fun:localtime=uninstrumented fun:localtime_r=uninstrumented fun:lockf=uninstrumented fun:lockf64=uninstrumented fun:log=uninstrumented fun:log10=uninstrumented fun:log10f=uninstrumented fun:log10l=uninstrumented fun:log1p=uninstrumented fun:log1pf=uninstrumented fun:log1pl=uninstrumented fun:log2=uninstrumented fun:log2f=uninstrumented fun:log2l=uninstrumented fun:logb=uninstrumented fun:logbf=uninstrumented fun:logbl=uninstrumented fun:logf=uninstrumented fun:login=uninstrumented fun:login_tty=uninstrumented fun:logl=uninstrumented fun:logout=uninstrumented fun:logwtmp=uninstrumented fun:longjmp=uninstrumented fun:lrand48=uninstrumented fun:lrand48_r=uninstrumented fun:lremovexattr=uninstrumented fun:lrint=uninstrumented fun:lrintf=uninstrumented fun:lrintl=uninstrumented fun:lround=uninstrumented fun:lroundf=uninstrumented fun:lroundl=uninstrumented fun:lsearch=uninstrumented fun:lseek=uninstrumented fun:lseek64=uninstrumented fun:lsetxattr=uninstrumented fun:lstat=uninstrumented fun:lstat64=uninstrumented fun:lutimes=uninstrumented fun:madvise=uninstrumented fun:makecontext=uninstrumented fun:mallinfo=uninstrumented fun:malloc=uninstrumented fun:malloc_get_state=uninstrumented fun:malloc_info=uninstrumented fun:malloc_set_state=uninstrumented fun:malloc_stats=uninstrumented fun:malloc_trim=uninstrumented fun:malloc_usable_size=uninstrumented fun:mallopt=uninstrumented fun:matherr=uninstrumented fun:mblen=uninstrumented fun:mbrlen=uninstrumented fun:mbrtoc16=uninstrumented fun:mbrtoc32=uninstrumented fun:mbrtowc=uninstrumented fun:mbsinit=uninstrumented fun:mbsnrtowcs=uninstrumented fun:mbsrtowcs=uninstrumented fun:mbstowcs=uninstrumented fun:mbtowc=uninstrumented fun:mcheck=uninstrumented fun:mcheck_check_all=uninstrumented fun:mcheck_pedantic=uninstrumented fun:mcount=uninstrumented fun:memalign=uninstrumented fun:memccpy=uninstrumented fun:memchr=uninstrumented fun:memcmp=uninstrumented fun:memcpy=uninstrumented fun:memfrob=uninstrumented fun:memmem=uninstrumented fun:memmove=uninstrumented fun:mempcpy=uninstrumented fun:memrchr=uninstrumented fun:memset=uninstrumented fun:mincore=uninstrumented fun:mkdir=uninstrumented fun:mkdirat=uninstrumented fun:mkdtemp=uninstrumented fun:mkfifo=uninstrumented fun:mkfifoat=uninstrumented fun:mknod=uninstrumented fun:mknodat=uninstrumented fun:mkostemp=uninstrumented fun:mkostemp64=uninstrumented fun:mkostemps=uninstrumented fun:mkostemps64=uninstrumented fun:mkstemp=uninstrumented fun:mkstemp64=uninstrumented fun:mkstemps=uninstrumented fun:mkstemps64=uninstrumented fun:mktemp=uninstrumented fun:mktime=uninstrumented fun:mlock=uninstrumented fun:mlockall=uninstrumented fun:mmap=uninstrumented fun:mmap64=uninstrumented fun:modf=uninstrumented fun:modff=uninstrumented fun:modfl=uninstrumented fun:modify_ldt=uninstrumented fun:moncontrol=uninstrumented fun:monstartup=uninstrumented fun:mount=uninstrumented fun:mprobe=uninstrumented fun:mprotect=uninstrumented fun:mq_close=uninstrumented fun:mq_getattr=uninstrumented fun:mq_notify=uninstrumented fun:mq_open=uninstrumented fun:mq_receive=uninstrumented fun:mq_send=uninstrumented fun:mq_setattr=uninstrumented fun:mq_timedreceive=uninstrumented fun:mq_timedsend=uninstrumented fun:mq_unlink=uninstrumented fun:mrand48=uninstrumented fun:mrand48_r=uninstrumented fun:mremap=uninstrumented fun:msgctl=uninstrumented fun:msgget=uninstrumented fun:msgrcv=uninstrumented fun:msgsnd=uninstrumented fun:msync=uninstrumented fun:mtrace=uninstrumented fun:munlock=uninstrumented fun:munlockall=uninstrumented fun:munmap=uninstrumented fun:muntrace=uninstrumented fun:name_to_handle_at=uninstrumented fun:nan=uninstrumented fun:nanf=uninstrumented fun:nanl=uninstrumented fun:nanosleep=uninstrumented fun:nearbyint=uninstrumented fun:nearbyintf=uninstrumented fun:nearbyintl=uninstrumented fun:netname2host=uninstrumented fun:netname2user=uninstrumented fun:newlocale=uninstrumented fun:nextafter=uninstrumented fun:nextafterf=uninstrumented fun:nextafterl=uninstrumented fun:nexttoward=uninstrumented fun:nexttowardf=uninstrumented fun:nexttowardl=uninstrumented fun:nfsservctl=uninstrumented fun:nftw=uninstrumented fun:nftw64=uninstrumented fun:ngettext=uninstrumented fun:nice=uninstrumented fun:nis_add=uninstrumented fun:nis_add_entry=uninstrumented fun:nis_addmember=uninstrumented fun:nis_checkpoint=uninstrumented fun:nis_clone_directory=uninstrumented fun:nis_clone_object=uninstrumented fun:nis_clone_result=uninstrumented fun:nis_creategroup=uninstrumented fun:nis_destroy_object=uninstrumented fun:nis_destroygroup=uninstrumented fun:nis_dir_cmp=uninstrumented fun:nis_domain_of=uninstrumented fun:nis_domain_of_r=uninstrumented fun:nis_first_entry=uninstrumented fun:nis_free_directory=uninstrumented fun:nis_free_object=uninstrumented fun:nis_free_request=uninstrumented fun:nis_freenames=uninstrumented fun:nis_freeresult=uninstrumented fun:nis_freeservlist=uninstrumented fun:nis_freetags=uninstrumented fun:nis_getnames=uninstrumented fun:nis_getservlist=uninstrumented fun:nis_ismember=uninstrumented fun:nis_leaf_of=uninstrumented fun:nis_leaf_of_r=uninstrumented fun:nis_lerror=uninstrumented fun:nis_list=uninstrumented fun:nis_local_directory=uninstrumented fun:nis_local_group=uninstrumented fun:nis_local_host=uninstrumented fun:nis_local_principal=uninstrumented fun:nis_lookup=uninstrumented fun:nis_mkdir=uninstrumented fun:nis_modify=uninstrumented fun:nis_modify_entry=uninstrumented fun:nis_name_of=uninstrumented fun:nis_name_of_r=uninstrumented fun:nis_next_entry=uninstrumented fun:nis_perror=uninstrumented fun:nis_ping=uninstrumented fun:nis_print_directory=uninstrumented fun:nis_print_entry=uninstrumented fun:nis_print_group=uninstrumented fun:nis_print_group_entry=uninstrumented fun:nis_print_link=uninstrumented fun:nis_print_object=uninstrumented fun:nis_print_result=uninstrumented fun:nis_print_rights=uninstrumented fun:nis_print_table=uninstrumented fun:nis_read_obj=uninstrumented fun:nis_remove=uninstrumented fun:nis_remove_entry=uninstrumented fun:nis_removemember=uninstrumented fun:nis_rmdir=uninstrumented fun:nis_servstate=uninstrumented fun:nis_sperrno=uninstrumented fun:nis_sperror=uninstrumented fun:nis_sperror_r=uninstrumented fun:nis_stats=uninstrumented fun:nis_verifygroup=uninstrumented fun:nis_write_obj=uninstrumented fun:nl_langinfo=uninstrumented fun:nl_langinfo_l=uninstrumented fun:nrand48=uninstrumented fun:nrand48_r=uninstrumented fun:ns_datetosecs=uninstrumented fun:ns_format_ttl=uninstrumented fun:ns_get16=uninstrumented fun:ns_get32=uninstrumented fun:ns_initparse=uninstrumented fun:ns_makecanon=uninstrumented fun:ns_msg_getflag=uninstrumented fun:ns_name_compress=uninstrumented fun:ns_name_ntol=uninstrumented fun:ns_name_ntop=uninstrumented fun:ns_name_pack=uninstrumented fun:ns_name_pton=uninstrumented fun:ns_name_rollback=uninstrumented fun:ns_name_skip=uninstrumented fun:ns_name_uncompress=uninstrumented fun:ns_name_unpack=uninstrumented fun:ns_parse_ttl=uninstrumented fun:ns_parserr=uninstrumented fun:ns_put16=uninstrumented fun:ns_put32=uninstrumented fun:ns_samedomain=uninstrumented fun:ns_samename=uninstrumented fun:ns_skiprr=uninstrumented fun:ns_sprintrr=uninstrumented fun:ns_sprintrrf=uninstrumented fun:ns_subdomain=uninstrumented fun:ntohl=uninstrumented fun:ntohs=uninstrumented fun:ntp_adjtime=uninstrumented fun:ntp_gettime=uninstrumented fun:ntp_gettimex=uninstrumented fun:obstack_free=uninstrumented fun:obstack_printf=uninstrumented fun:obstack_vprintf=uninstrumented fun:on_exit=uninstrumented fun:open=uninstrumented fun:open64=uninstrumented fun:open_by_handle_at=uninstrumented fun:open_memstream=uninstrumented fun:open_wmemstream=uninstrumented fun:openat=uninstrumented fun:openat64=uninstrumented fun:opendir=uninstrumented fun:openlog=uninstrumented fun:openpty=uninstrumented fun:parse_printf_format=uninstrumented fun:passwd2des=uninstrumented fun:pathconf=uninstrumented fun:pause=uninstrumented fun:pclose=uninstrumented fun:perror=uninstrumented fun:personality=uninstrumented fun:pipe=uninstrumented fun:pipe2=uninstrumented fun:pivot_root=uninstrumented fun:pmap_getmaps=uninstrumented fun:pmap_getport=uninstrumented fun:pmap_rmtcall=uninstrumented fun:pmap_set=uninstrumented fun:pmap_unset=uninstrumented fun:poll=uninstrumented fun:popen=uninstrumented fun:posix_fadvise=uninstrumented fun:posix_fadvise64=uninstrumented fun:posix_fallocate=uninstrumented fun:posix_fallocate64=uninstrumented fun:posix_madvise=uninstrumented fun:posix_memalign=uninstrumented fun:posix_openpt=uninstrumented fun:posix_spawn=uninstrumented fun:posix_spawn_file_actions_addclose=uninstrumented fun:posix_spawn_file_actions_adddup2=uninstrumented fun:posix_spawn_file_actions_addopen=uninstrumented fun:posix_spawn_file_actions_destroy=uninstrumented fun:posix_spawn_file_actions_init=uninstrumented fun:posix_spawnattr_destroy=uninstrumented fun:posix_spawnattr_getflags=uninstrumented fun:posix_spawnattr_getpgroup=uninstrumented fun:posix_spawnattr_getschedparam=uninstrumented fun:posix_spawnattr_getschedpolicy=uninstrumented fun:posix_spawnattr_getsigdefault=uninstrumented fun:posix_spawnattr_getsigmask=uninstrumented fun:posix_spawnattr_init=uninstrumented fun:posix_spawnattr_setflags=uninstrumented fun:posix_spawnattr_setpgroup=uninstrumented fun:posix_spawnattr_setschedparam=uninstrumented fun:posix_spawnattr_setschedpolicy=uninstrumented fun:posix_spawnattr_setsigdefault=uninstrumented fun:posix_spawnattr_setsigmask=uninstrumented fun:posix_spawnp=uninstrumented fun:pow=uninstrumented fun:pow10=uninstrumented fun:pow10f=uninstrumented fun:pow10l=uninstrumented fun:powf=uninstrumented fun:powl=uninstrumented fun:ppoll=uninstrumented fun:prctl=uninstrumented fun:pread=uninstrumented fun:pread64=uninstrumented fun:preadv=uninstrumented fun:preadv64=uninstrumented fun:printf=uninstrumented fun:printf_size=uninstrumented fun:printf_size_info=uninstrumented fun:prlimit=uninstrumented fun:prlimit64=uninstrumented fun:process_vm_readv=uninstrumented fun:process_vm_writev=uninstrumented fun:profil=uninstrumented fun:pselect=uninstrumented fun:psiginfo=uninstrumented fun:psignal=uninstrumented fun:pthread_atfork=uninstrumented fun:pthread_attr_destroy=uninstrumented fun:pthread_attr_getaffinity_np=uninstrumented fun:pthread_attr_getdetachstate=uninstrumented fun:pthread_attr_getguardsize=uninstrumented fun:pthread_attr_getinheritsched=uninstrumented fun:pthread_attr_getschedparam=uninstrumented fun:pthread_attr_getschedpolicy=uninstrumented fun:pthread_attr_getscope=uninstrumented fun:pthread_attr_getstack=uninstrumented fun:pthread_attr_getstackaddr=uninstrumented fun:pthread_attr_getstacksize=uninstrumented fun:pthread_attr_init=uninstrumented fun:pthread_attr_setaffinity_np=uninstrumented fun:pthread_attr_setdetachstate=uninstrumented fun:pthread_attr_setguardsize=uninstrumented fun:pthread_attr_setinheritsched=uninstrumented fun:pthread_attr_setschedparam=uninstrumented fun:pthread_attr_setschedpolicy=uninstrumented fun:pthread_attr_setscope=uninstrumented fun:pthread_attr_setstack=uninstrumented fun:pthread_attr_setstackaddr=uninstrumented fun:pthread_attr_setstacksize=uninstrumented fun:pthread_barrier_destroy=uninstrumented fun:pthread_barrier_init=uninstrumented fun:pthread_barrier_wait=uninstrumented fun:pthread_barrierattr_destroy=uninstrumented fun:pthread_barrierattr_getpshared=uninstrumented fun:pthread_barrierattr_init=uninstrumented fun:pthread_barrierattr_setpshared=uninstrumented fun:pthread_cancel=uninstrumented fun:pthread_cond_broadcast=uninstrumented fun:pthread_cond_destroy=uninstrumented fun:pthread_cond_init=uninstrumented fun:pthread_cond_signal=uninstrumented fun:pthread_cond_timedwait=uninstrumented fun:pthread_cond_wait=uninstrumented fun:pthread_condattr_destroy=uninstrumented fun:pthread_condattr_getclock=uninstrumented fun:pthread_condattr_getpshared=uninstrumented fun:pthread_condattr_init=uninstrumented fun:pthread_condattr_setclock=uninstrumented fun:pthread_condattr_setpshared=uninstrumented fun:pthread_create=uninstrumented fun:pthread_detach=uninstrumented fun:pthread_equal=uninstrumented fun:pthread_exit=uninstrumented fun:pthread_getaffinity_np=uninstrumented fun:pthread_getattr_default_np=uninstrumented fun:pthread_getattr_np=uninstrumented fun:pthread_getconcurrency=uninstrumented fun:pthread_getcpuclockid=uninstrumented fun:pthread_getname_np=uninstrumented fun:pthread_getschedparam=uninstrumented fun:pthread_getspecific=uninstrumented fun:pthread_join=uninstrumented fun:pthread_key_create=uninstrumented fun:pthread_key_delete=uninstrumented fun:pthread_kill=uninstrumented fun:pthread_kill_other_threads_np=uninstrumented fun:pthread_mutex_consistent=uninstrumented fun:pthread_mutex_consistent_np=uninstrumented fun:pthread_mutex_destroy=uninstrumented fun:pthread_mutex_getprioceiling=uninstrumented fun:pthread_mutex_init=uninstrumented fun:pthread_mutex_lock=uninstrumented fun:pthread_mutex_setprioceiling=uninstrumented fun:pthread_mutex_timedlock=uninstrumented fun:pthread_mutex_trylock=uninstrumented fun:pthread_mutex_unlock=uninstrumented fun:pthread_mutexattr_destroy=uninstrumented fun:pthread_mutexattr_getkind_np=uninstrumented fun:pthread_mutexattr_getprioceiling=uninstrumented fun:pthread_mutexattr_getprotocol=uninstrumented fun:pthread_mutexattr_getpshared=uninstrumented fun:pthread_mutexattr_getrobust=uninstrumented fun:pthread_mutexattr_getrobust_np=uninstrumented fun:pthread_mutexattr_gettype=uninstrumented fun:pthread_mutexattr_init=uninstrumented fun:pthread_mutexattr_setkind_np=uninstrumented fun:pthread_mutexattr_setprioceiling=uninstrumented fun:pthread_mutexattr_setprotocol=uninstrumented fun:pthread_mutexattr_setpshared=uninstrumented fun:pthread_mutexattr_setrobust=uninstrumented fun:pthread_mutexattr_setrobust_np=uninstrumented fun:pthread_mutexattr_settype=uninstrumented fun:pthread_once=uninstrumented fun:pthread_rwlock_destroy=uninstrumented fun:pthread_rwlock_init=uninstrumented fun:pthread_rwlock_rdlock=uninstrumented fun:pthread_rwlock_timedrdlock=uninstrumented fun:pthread_rwlock_timedwrlock=uninstrumented fun:pthread_rwlock_tryrdlock=uninstrumented fun:pthread_rwlock_trywrlock=uninstrumented fun:pthread_rwlock_unlock=uninstrumented fun:pthread_rwlock_wrlock=uninstrumented fun:pthread_rwlockattr_destroy=uninstrumented fun:pthread_rwlockattr_getkind_np=uninstrumented fun:pthread_rwlockattr_getpshared=uninstrumented fun:pthread_rwlockattr_init=uninstrumented fun:pthread_rwlockattr_setkind_np=uninstrumented fun:pthread_rwlockattr_setpshared=uninstrumented fun:pthread_self=uninstrumented fun:pthread_setaffinity_np=uninstrumented fun:pthread_setattr_default_np=uninstrumented fun:pthread_setcancelstate=uninstrumented fun:pthread_setcanceltype=uninstrumented fun:pthread_setconcurrency=uninstrumented fun:pthread_setname_np=uninstrumented fun:pthread_setschedparam=uninstrumented fun:pthread_setschedprio=uninstrumented fun:pthread_setspecific=uninstrumented fun:pthread_sigmask=uninstrumented fun:pthread_sigqueue=uninstrumented fun:pthread_spin_destroy=uninstrumented fun:pthread_spin_init=uninstrumented fun:pthread_spin_lock=uninstrumented fun:pthread_spin_trylock=uninstrumented fun:pthread_spin_unlock=uninstrumented fun:pthread_testcancel=uninstrumented fun:pthread_timedjoin_np=uninstrumented fun:pthread_tryjoin_np=uninstrumented fun:pthread_yield=uninstrumented fun:ptrace=uninstrumented fun:ptsname=uninstrumented fun:ptsname_r=uninstrumented fun:putc=uninstrumented fun:putc_unlocked=uninstrumented fun:putchar=uninstrumented fun:putchar_unlocked=uninstrumented fun:putenv=uninstrumented fun:putgrent=uninstrumented fun:putmsg=uninstrumented fun:putpmsg=uninstrumented fun:putpwent=uninstrumented fun:puts=uninstrumented fun:putsgent=uninstrumented fun:putspent=uninstrumented fun:pututline=uninstrumented fun:pututxline=uninstrumented fun:putw=uninstrumented fun:putwc=uninstrumented fun:putwc_unlocked=uninstrumented fun:putwchar=uninstrumented fun:putwchar_unlocked=uninstrumented fun:pvalloc=uninstrumented fun:pwrite=uninstrumented fun:pwrite64=uninstrumented fun:pwritev=uninstrumented fun:pwritev64=uninstrumented fun:qecvt=uninstrumented fun:qecvt_r=uninstrumented fun:qfcvt=uninstrumented fun:qfcvt_r=uninstrumented fun:qgcvt=uninstrumented fun:qsort=uninstrumented fun:qsort_r=uninstrumented fun:query_module=uninstrumented fun:quick_exit=uninstrumented fun:quotactl=uninstrumented fun:raise=uninstrumented fun:rand=uninstrumented fun:rand_r=uninstrumented fun:random=uninstrumented fun:random_r=uninstrumented fun:rawmemchr=uninstrumented fun:rcmd=uninstrumented fun:rcmd_af=uninstrumented fun:re_comp=uninstrumented fun:re_compile_fastmap=uninstrumented fun:re_compile_pattern=uninstrumented fun:re_exec=uninstrumented fun:re_match=uninstrumented fun:re_match_2=uninstrumented fun:re_search=uninstrumented fun:re_search_2=uninstrumented fun:re_set_registers=uninstrumented fun:re_set_syntax=uninstrumented fun:read=uninstrumented fun:readColdStartFile=uninstrumented fun:readahead=uninstrumented fun:readdir=uninstrumented fun:readdir64=uninstrumented fun:readdir64_r=uninstrumented fun:readdir_r=uninstrumented fun:readlink=uninstrumented fun:readlinkat=uninstrumented fun:readv=uninstrumented fun:realloc=uninstrumented fun:realpath=uninstrumented fun:reboot=uninstrumented fun:recv=uninstrumented fun:recvfrom=uninstrumented fun:recvmmsg=uninstrumented fun:recvmsg=uninstrumented fun:regcomp=uninstrumented fun:regerror=uninstrumented fun:regexec=uninstrumented fun:regfree=uninstrumented fun:register_printf_function=uninstrumented fun:register_printf_modifier=uninstrumented fun:register_printf_specifier=uninstrumented fun:register_printf_type=uninstrumented fun:registerrpc=uninstrumented fun:remainder=uninstrumented fun:remainderf=uninstrumented fun:remainderl=uninstrumented fun:remap_file_pages=uninstrumented fun:remove=uninstrumented fun:removexattr=uninstrumented fun:remque=uninstrumented fun:remquo=uninstrumented fun:remquof=uninstrumented fun:remquol=uninstrumented fun:rename=uninstrumented fun:renameat=uninstrumented fun:res_gethostbyaddr=uninstrumented fun:res_gethostbyname=uninstrumented fun:res_gethostbyname2=uninstrumented fun:res_send_setqhook=uninstrumented fun:res_send_setrhook=uninstrumented fun:revoke=uninstrumented fun:rewind=uninstrumented fun:rewinddir=uninstrumented fun:rexec=uninstrumented fun:rexec_af=uninstrumented fun:rindex=uninstrumented fun:rint=uninstrumented fun:rintf=uninstrumented fun:rintl=uninstrumented fun:rmdir=uninstrumented fun:round=uninstrumented fun:roundf=uninstrumented fun:roundl=uninstrumented fun:rpmatch=uninstrumented fun:rresvport=uninstrumented fun:rresvport_af=uninstrumented fun:rtime=uninstrumented fun:ruserok=uninstrumented fun:ruserok_af=uninstrumented fun:ruserpass=uninstrumented fun:sbrk=uninstrumented fun:scalb=uninstrumented fun:scalbf=uninstrumented fun:scalbl=uninstrumented fun:scalbln=uninstrumented fun:scalblnf=uninstrumented fun:scalblnl=uninstrumented fun:scalbn=uninstrumented fun:scalbnf=uninstrumented fun:scalbnl=uninstrumented fun:scandir=uninstrumented fun:scandir64=uninstrumented fun:scandirat=uninstrumented fun:scandirat64=uninstrumented fun:scanf=uninstrumented fun:sched_get_priority_max=uninstrumented fun:sched_get_priority_min=uninstrumented fun:sched_getaffinity=uninstrumented fun:sched_getcpu=uninstrumented fun:sched_getparam=uninstrumented fun:sched_getscheduler=uninstrumented fun:sched_rr_get_interval=uninstrumented fun:sched_setaffinity=uninstrumented fun:sched_setparam=uninstrumented fun:sched_setscheduler=uninstrumented fun:sched_yield=uninstrumented fun:secure_getenv=uninstrumented fun:seed48=uninstrumented fun:seed48_r=uninstrumented fun:seekdir=uninstrumented fun:select=uninstrumented fun:sem_close=uninstrumented fun:sem_destroy=uninstrumented fun:sem_getvalue=uninstrumented fun:sem_init=uninstrumented fun:sem_open=uninstrumented fun:sem_post=uninstrumented fun:sem_timedwait=uninstrumented fun:sem_trywait=uninstrumented fun:sem_unlink=uninstrumented fun:sem_wait=uninstrumented fun:semctl=uninstrumented fun:semget=uninstrumented fun:semop=uninstrumented fun:semtimedop=uninstrumented fun:send=uninstrumented fun:sendfile=uninstrumented fun:sendfile64=uninstrumented fun:sendmmsg=uninstrumented fun:sendmsg=uninstrumented fun:sendto=uninstrumented fun:setaliasent=uninstrumented fun:setbuf=uninstrumented fun:setbuffer=uninstrumented fun:setcontext=uninstrumented fun:setdomainname=uninstrumented fun:setegid=uninstrumented fun:setenv=uninstrumented fun:seteuid=uninstrumented fun:setfsent=uninstrumented fun:setfsgid=uninstrumented fun:setfsuid=uninstrumented fun:setgid=uninstrumented fun:setgrent=uninstrumented fun:setgroups=uninstrumented fun:sethostent=uninstrumented fun:sethostid=uninstrumented fun:sethostname=uninstrumented fun:setipv4sourcefilter=uninstrumented fun:setitimer=uninstrumented fun:setjmp=uninstrumented fun:setkey=uninstrumented fun:setkey_r=uninstrumented fun:setlinebuf=uninstrumented fun:setlocale=uninstrumented fun:setlogin=uninstrumented fun:setlogmask=uninstrumented fun:setmntent=uninstrumented fun:setnetent=uninstrumented fun:setnetgrent=uninstrumented fun:setns=uninstrumented fun:setpgid=uninstrumented fun:setpgrp=uninstrumented fun:setpriority=uninstrumented fun:setprotoent=uninstrumented fun:setpwent=uninstrumented fun:setregid=uninstrumented fun:setresgid=uninstrumented fun:setresuid=uninstrumented fun:setreuid=uninstrumented fun:setrlimit=uninstrumented fun:setrlimit64=uninstrumented fun:setrpcent=uninstrumented fun:setservent=uninstrumented fun:setsgent=uninstrumented fun:setsid=uninstrumented fun:setsockopt=uninstrumented fun:setsourcefilter=uninstrumented fun:setspent=uninstrumented fun:setstate=uninstrumented fun:setstate_r=uninstrumented fun:settimeofday=uninstrumented fun:setttyent=uninstrumented fun:setuid=uninstrumented fun:setusershell=uninstrumented fun:setutent=uninstrumented fun:setutxent=uninstrumented fun:setvbuf=uninstrumented fun:setxattr=uninstrumented fun:sgetsgent=uninstrumented fun:sgetsgent_r=uninstrumented fun:sgetspent=uninstrumented fun:sgetspent_r=uninstrumented fun:shm_open=uninstrumented fun:shm_unlink=uninstrumented fun:shmat=uninstrumented fun:shmctl=uninstrumented fun:shmdt=uninstrumented fun:shmget=uninstrumented fun:shutdown=uninstrumented fun:sigaction=uninstrumented fun:sigaddset=uninstrumented fun:sigaltstack=uninstrumented fun:sigandset=uninstrumented fun:sigblock=uninstrumented fun:sigdelset=uninstrumented fun:sigemptyset=uninstrumented fun:sigfillset=uninstrumented fun:siggetmask=uninstrumented fun:sighold=uninstrumented fun:sigignore=uninstrumented fun:siginterrupt=uninstrumented fun:sigisemptyset=uninstrumented fun:sigismember=uninstrumented fun:siglongjmp=uninstrumented fun:signal=uninstrumented fun:signalfd=uninstrumented fun:significand=uninstrumented fun:significandf=uninstrumented fun:significandl=uninstrumented fun:sigorset=uninstrumented fun:sigpause=uninstrumented fun:sigpending=uninstrumented fun:sigprocmask=uninstrumented fun:sigqueue=uninstrumented fun:sigrelse=uninstrumented fun:sigreturn=uninstrumented fun:sigset=uninstrumented fun:sigsetmask=uninstrumented fun:sigstack=uninstrumented fun:sigsuspend=uninstrumented fun:sigtimedwait=uninstrumented fun:sigvec=uninstrumented fun:sigwait=uninstrumented fun:sigwaitinfo=uninstrumented fun:sin=uninstrumented fun:sincos=uninstrumented fun:sincosf=uninstrumented fun:sincosl=uninstrumented fun:sinf=uninstrumented fun:sinh=uninstrumented fun:sinhf=uninstrumented fun:sinhl=uninstrumented fun:sinl=uninstrumented fun:sleep=uninstrumented fun:snprintf=uninstrumented fun:sockatmark=uninstrumented fun:socket=uninstrumented fun:socketpair=uninstrumented fun:splice=uninstrumented fun:sprintf=uninstrumented fun:sprofil=uninstrumented fun:sqrt=uninstrumented fun:sqrtf=uninstrumented fun:sqrtl=uninstrumented fun:srand=uninstrumented fun:srand48=uninstrumented fun:srand48_r=uninstrumented fun:srandom=uninstrumented fun:srandom_r=uninstrumented fun:sscanf=uninstrumented fun:ssignal=uninstrumented fun:sstk=uninstrumented fun:stat=uninstrumented fun:stat64=uninstrumented fun:statfs=uninstrumented fun:statfs64=uninstrumented fun:statvfs=uninstrumented fun:statvfs64=uninstrumented fun:step=uninstrumented fun:stime=uninstrumented fun:stpcpy=uninstrumented fun:stpncpy=uninstrumented fun:strcasecmp=uninstrumented fun:strcasecmp_l=uninstrumented fun:strcasestr=uninstrumented fun:strcat=uninstrumented fun:strchr=uninstrumented fun:strchrnul=uninstrumented fun:strcmp=uninstrumented fun:strcoll=uninstrumented fun:strcoll_l=uninstrumented fun:strcpy=uninstrumented fun:strcspn=uninstrumented fun:strdup=uninstrumented fun:strerror=uninstrumented fun:strerror_l=uninstrumented fun:strerror_r=uninstrumented fun:strfmon=uninstrumented fun:strfmon_l=uninstrumented fun:strfry=uninstrumented fun:strftime=uninstrumented fun:strftime_l=uninstrumented fun:strlen=uninstrumented fun:strncasecmp=uninstrumented fun:strncasecmp_l=uninstrumented fun:strncat=uninstrumented fun:strncmp=uninstrumented fun:strncpy=uninstrumented fun:strndup=uninstrumented fun:strnlen=uninstrumented fun:strpbrk=uninstrumented fun:strptime=uninstrumented fun:strptime_l=uninstrumented fun:strrchr=uninstrumented fun:strsep=uninstrumented fun:strsignal=uninstrumented fun:strspn=uninstrumented fun:strstr=uninstrumented fun:strtod=uninstrumented fun:strtod_l=uninstrumented fun:strtof=uninstrumented fun:strtof_l=uninstrumented fun:strtoimax=uninstrumented fun:strtok=uninstrumented fun:strtok_r=uninstrumented fun:strtol=uninstrumented fun:strtol_l=uninstrumented fun:strtold=uninstrumented fun:strtold_l=uninstrumented fun:strtoll=uninstrumented fun:strtoll_l=uninstrumented fun:strtoq=uninstrumented fun:strtoul=uninstrumented fun:strtoul_l=uninstrumented fun:strtoull=uninstrumented fun:strtoull_l=uninstrumented fun:strtoumax=uninstrumented fun:strtouq=uninstrumented fun:strverscmp=uninstrumented fun:strxfrm=uninstrumented fun:strxfrm_l=uninstrumented fun:stty=uninstrumented fun:svc_exit=uninstrumented fun:svc_getreq=uninstrumented fun:svc_getreq_common=uninstrumented fun:svc_getreq_poll=uninstrumented fun:svc_getreqset=uninstrumented fun:svc_register=uninstrumented fun:svc_run=uninstrumented fun:svc_sendreply=uninstrumented fun:svc_unregister=uninstrumented fun:svcerr_auth=uninstrumented fun:svcerr_decode=uninstrumented fun:svcerr_noproc=uninstrumented fun:svcerr_noprog=uninstrumented fun:svcerr_progvers=uninstrumented fun:svcerr_systemerr=uninstrumented fun:svcerr_weakauth=uninstrumented fun:svcfd_create=uninstrumented fun:svcraw_create=uninstrumented fun:svctcp_create=uninstrumented fun:svcudp_bufcreate=uninstrumented fun:svcudp_create=uninstrumented fun:svcudp_enablecache=uninstrumented fun:svcunix_create=uninstrumented fun:svcunixfd_create=uninstrumented fun:swab=uninstrumented fun:swapcontext=uninstrumented fun:swapoff=uninstrumented fun:swapon=uninstrumented fun:swprintf=uninstrumented fun:swscanf=uninstrumented fun:symlink=uninstrumented fun:symlinkat=uninstrumented fun:sync=uninstrumented fun:sync_file_range=uninstrumented fun:syncfs=uninstrumented fun:syscall=uninstrumented fun:sysconf=uninstrumented fun:sysctl=uninstrumented fun:sysinfo=uninstrumented fun:syslog=uninstrumented fun:system=uninstrumented fun:sysv_signal=uninstrumented fun:tan=uninstrumented fun:tanf=uninstrumented fun:tanh=uninstrumented fun:tanhf=uninstrumented fun:tanhl=uninstrumented fun:tanl=uninstrumented fun:tcdrain=uninstrumented fun:tcflow=uninstrumented fun:tcflush=uninstrumented fun:tcgetattr=uninstrumented fun:tcgetpgrp=uninstrumented fun:tcgetsid=uninstrumented fun:tcsendbreak=uninstrumented fun:tcsetattr=uninstrumented fun:tcsetpgrp=uninstrumented fun:td_init=uninstrumented fun:td_log=uninstrumented fun:td_symbol_list=uninstrumented fun:td_ta_clear_event=uninstrumented fun:td_ta_delete=uninstrumented fun:td_ta_enable_stats=uninstrumented fun:td_ta_event_addr=uninstrumented fun:td_ta_event_getmsg=uninstrumented fun:td_ta_get_nthreads=uninstrumented fun:td_ta_get_ph=uninstrumented fun:td_ta_get_stats=uninstrumented fun:td_ta_map_id2thr=uninstrumented fun:td_ta_map_lwp2thr=uninstrumented fun:td_ta_new=uninstrumented fun:td_ta_reset_stats=uninstrumented fun:td_ta_set_event=uninstrumented fun:td_ta_setconcurrency=uninstrumented fun:td_ta_thr_iter=uninstrumented fun:td_ta_tsd_iter=uninstrumented fun:td_thr_clear_event=uninstrumented fun:td_thr_dbresume=uninstrumented fun:td_thr_dbsuspend=uninstrumented fun:td_thr_event_enable=uninstrumented fun:td_thr_event_getmsg=uninstrumented fun:td_thr_get_info=uninstrumented fun:td_thr_getfpregs=uninstrumented fun:td_thr_getgregs=uninstrumented fun:td_thr_getxregs=uninstrumented fun:td_thr_getxregsize=uninstrumented fun:td_thr_set_event=uninstrumented fun:td_thr_setfpregs=uninstrumented fun:td_thr_setgregs=uninstrumented fun:td_thr_setprio=uninstrumented fun:td_thr_setsigpending=uninstrumented fun:td_thr_setxregs=uninstrumented fun:td_thr_sigsetmask=uninstrumented fun:td_thr_tls_get_addr=uninstrumented fun:td_thr_tlsbase=uninstrumented fun:td_thr_tsd=uninstrumented fun:td_thr_validate=uninstrumented fun:tdelete=uninstrumented fun:tdestroy=uninstrumented fun:tee=uninstrumented fun:telldir=uninstrumented fun:tempnam=uninstrumented fun:textdomain=uninstrumented fun:tfind=uninstrumented fun:tgamma=uninstrumented fun:tgammaf=uninstrumented fun:tgammal=uninstrumented fun:time=uninstrumented fun:timegm=uninstrumented fun:timelocal=uninstrumented fun:timer_create=uninstrumented fun:timer_delete=uninstrumented fun:timer_getoverrun=uninstrumented fun:timer_gettime=uninstrumented fun:timer_settime=uninstrumented fun:timerfd_create=uninstrumented fun:timerfd_gettime=uninstrumented fun:timerfd_settime=uninstrumented fun:times=uninstrumented fun:timespec_get=uninstrumented fun:tmpfile=uninstrumented fun:tmpfile64=uninstrumented fun:tmpnam=uninstrumented fun:tmpnam_r=uninstrumented fun:toascii=uninstrumented fun:tolower=uninstrumented fun:tolower_l=uninstrumented fun:toupper=uninstrumented fun:toupper_l=uninstrumented fun:towctrans=uninstrumented fun:towctrans_l=uninstrumented fun:towlower=uninstrumented fun:towlower_l=uninstrumented fun:towupper=uninstrumented fun:towupper_l=uninstrumented fun:tr_break=uninstrumented fun:trunc=uninstrumented fun:truncate=uninstrumented fun:truncate64=uninstrumented fun:truncf=uninstrumented fun:truncl=uninstrumented fun:tsearch=uninstrumented fun:ttyname=uninstrumented fun:ttyname_r=uninstrumented fun:ttyslot=uninstrumented fun:twalk=uninstrumented fun:tzset=uninstrumented fun:ualarm=uninstrumented fun:ulckpwdf=uninstrumented fun:ulimit=uninstrumented fun:umask=uninstrumented fun:umount=uninstrumented fun:umount2=uninstrumented fun:uname=uninstrumented fun:ungetc=uninstrumented fun:ungetwc=uninstrumented fun:unlink=uninstrumented fun:unlinkat=uninstrumented fun:unlockpt=uninstrumented fun:unsetenv=uninstrumented fun:unshare=uninstrumented fun:updwtmp=uninstrumented fun:updwtmpx=uninstrumented fun:uselib=uninstrumented fun:uselocale=uninstrumented fun:user2netname=uninstrumented fun:usleep=uninstrumented fun:ustat=uninstrumented fun:utime=uninstrumented fun:utimensat=uninstrumented fun:utimes=uninstrumented fun:utmpname=uninstrumented fun:utmpxname=uninstrumented fun:valloc=uninstrumented fun:vasprintf=uninstrumented fun:vdprintf=uninstrumented fun:verr=uninstrumented fun:verrx=uninstrumented fun:versionsort=uninstrumented fun:versionsort64=uninstrumented fun:vfork=uninstrumented fun:vfprintf=uninstrumented fun:vfscanf=uninstrumented fun:vfwprintf=uninstrumented fun:vfwscanf=uninstrumented fun:vhangup=uninstrumented fun:vlimit=uninstrumented fun:vmsplice=uninstrumented fun:vprintf=uninstrumented fun:vscanf=uninstrumented fun:vsnprintf=uninstrumented fun:vsprintf=uninstrumented fun:vsscanf=uninstrumented fun:vswprintf=uninstrumented fun:vswscanf=uninstrumented fun:vsyslog=uninstrumented fun:vtimes=uninstrumented fun:vwarn=uninstrumented fun:vwarnx=uninstrumented fun:vwprintf=uninstrumented fun:vwscanf=uninstrumented fun:wait=uninstrumented fun:wait3=uninstrumented fun:wait4=uninstrumented fun:waitid=uninstrumented fun:waitpid=uninstrumented fun:warn=uninstrumented fun:warnx=uninstrumented fun:wcpcpy=uninstrumented fun:wcpncpy=uninstrumented fun:wcrtomb=uninstrumented fun:wcscasecmp=uninstrumented fun:wcscasecmp_l=uninstrumented fun:wcscat=uninstrumented fun:wcschr=uninstrumented fun:wcschrnul=uninstrumented fun:wcscmp=uninstrumented fun:wcscoll=uninstrumented fun:wcscoll_l=uninstrumented fun:wcscpy=uninstrumented fun:wcscspn=uninstrumented fun:wcsdup=uninstrumented fun:wcsftime=uninstrumented fun:wcsftime_l=uninstrumented fun:wcslen=uninstrumented fun:wcsncasecmp=uninstrumented fun:wcsncasecmp_l=uninstrumented fun:wcsncat=uninstrumented fun:wcsncmp=uninstrumented fun:wcsncpy=uninstrumented fun:wcsnlen=uninstrumented fun:wcsnrtombs=uninstrumented fun:wcspbrk=uninstrumented fun:wcsrchr=uninstrumented fun:wcsrtombs=uninstrumented fun:wcsspn=uninstrumented fun:wcsstr=uninstrumented fun:wcstod=uninstrumented fun:wcstod_l=uninstrumented fun:wcstof=uninstrumented fun:wcstof_l=uninstrumented fun:wcstoimax=uninstrumented fun:wcstok=uninstrumented fun:wcstol=uninstrumented fun:wcstol_l=uninstrumented fun:wcstold=uninstrumented fun:wcstold_l=uninstrumented fun:wcstoll=uninstrumented fun:wcstoll_l=uninstrumented fun:wcstombs=uninstrumented fun:wcstoq=uninstrumented fun:wcstoul=uninstrumented fun:wcstoul_l=uninstrumented fun:wcstoull=uninstrumented fun:wcstoull_l=uninstrumented fun:wcstoumax=uninstrumented fun:wcstouq=uninstrumented fun:wcswcs=uninstrumented fun:wcswidth=uninstrumented fun:wcsxfrm=uninstrumented fun:wcsxfrm_l=uninstrumented fun:wctob=uninstrumented fun:wctomb=uninstrumented fun:wctrans=uninstrumented fun:wctrans_l=uninstrumented fun:wctype=uninstrumented fun:wctype_l=uninstrumented fun:wcwidth=uninstrumented fun:wmemchr=uninstrumented fun:wmemcmp=uninstrumented fun:wmemcpy=uninstrumented fun:wmemmove=uninstrumented fun:wmempcpy=uninstrumented fun:wmemset=uninstrumented fun:wordexp=uninstrumented fun:wordfree=uninstrumented fun:wprintf=uninstrumented fun:write=uninstrumented fun:writeColdStartFile=uninstrumented fun:writev=uninstrumented fun:wscanf=uninstrumented fun:xdecrypt=uninstrumented fun:xdr_accepted_reply=uninstrumented fun:xdr_array=uninstrumented fun:xdr_authdes_cred=uninstrumented fun:xdr_authdes_verf=uninstrumented fun:xdr_authunix_parms=uninstrumented fun:xdr_bool=uninstrumented fun:xdr_bytes=uninstrumented fun:xdr_callhdr=uninstrumented fun:xdr_callmsg=uninstrumented fun:xdr_cback_data=uninstrumented fun:xdr_char=uninstrumented fun:xdr_cryptkeyarg=uninstrumented fun:xdr_cryptkeyarg2=uninstrumented fun:xdr_cryptkeyres=uninstrumented fun:xdr_des_block=uninstrumented fun:xdr_domainname=uninstrumented fun:xdr_double=uninstrumented fun:xdr_enum=uninstrumented fun:xdr_float=uninstrumented fun:xdr_free=uninstrumented fun:xdr_getcredres=uninstrumented fun:xdr_hyper=uninstrumented fun:xdr_int=uninstrumented fun:xdr_int16_t=uninstrumented fun:xdr_int32_t=uninstrumented fun:xdr_int64_t=uninstrumented fun:xdr_int8_t=uninstrumented fun:xdr_key_netstarg=uninstrumented fun:xdr_key_netstres=uninstrumented fun:xdr_keybuf=uninstrumented fun:xdr_keydat=uninstrumented fun:xdr_keystatus=uninstrumented fun:xdr_long=uninstrumented fun:xdr_longlong_t=uninstrumented fun:xdr_mapname=uninstrumented fun:xdr_netnamestr=uninstrumented fun:xdr_netobj=uninstrumented fun:xdr_obj_p=uninstrumented fun:xdr_opaque=uninstrumented fun:xdr_opaque_auth=uninstrumented fun:xdr_peername=uninstrumented fun:xdr_pmap=uninstrumented fun:xdr_pmaplist=uninstrumented fun:xdr_pointer=uninstrumented fun:xdr_quad_t=uninstrumented fun:xdr_reference=uninstrumented fun:xdr_rejected_reply=uninstrumented fun:xdr_replymsg=uninstrumented fun:xdr_rmtcall_args=uninstrumented fun:xdr_rmtcallres=uninstrumented fun:xdr_short=uninstrumented fun:xdr_sizeof=uninstrumented fun:xdr_string=uninstrumented fun:xdr_u_char=uninstrumented fun:xdr_u_hyper=uninstrumented fun:xdr_u_int=uninstrumented fun:xdr_u_long=uninstrumented fun:xdr_u_longlong_t=uninstrumented fun:xdr_u_quad_t=uninstrumented fun:xdr_u_short=uninstrumented fun:xdr_uint16_t=uninstrumented fun:xdr_uint32_t=uninstrumented fun:xdr_uint64_t=uninstrumented fun:xdr_uint8_t=uninstrumented fun:xdr_union=uninstrumented fun:xdr_unixcred=uninstrumented fun:xdr_valdat=uninstrumented fun:xdr_vector=uninstrumented fun:xdr_void=uninstrumented fun:xdr_wrapstring=uninstrumented fun:xdr_yp_buf=uninstrumented fun:xdr_ypall=uninstrumented fun:xdr_ypbind_binding=uninstrumented fun:xdr_ypbind_resp=uninstrumented fun:xdr_ypbind_resptype=uninstrumented fun:xdr_ypbind_setdom=uninstrumented fun:xdr_ypdelete_args=uninstrumented fun:xdr_ypmap_parms=uninstrumented fun:xdr_ypmaplist=uninstrumented fun:xdr_yppush_status=uninstrumented fun:xdr_yppushresp_xfr=uninstrumented fun:xdr_ypreq_key=uninstrumented fun:xdr_ypreq_nokey=uninstrumented fun:xdr_ypreq_xfr=uninstrumented fun:xdr_ypresp_all=uninstrumented fun:xdr_ypresp_key_val=uninstrumented fun:xdr_ypresp_maplist=uninstrumented fun:xdr_ypresp_master=uninstrumented fun:xdr_ypresp_order=uninstrumented fun:xdr_ypresp_val=uninstrumented fun:xdr_ypresp_xfr=uninstrumented fun:xdr_ypstat=uninstrumented fun:xdr_ypupdate_args=uninstrumented fun:xdr_ypxfrstat=uninstrumented fun:xdrmem_create=uninstrumented fun:xdrrec_create=uninstrumented fun:xdrrec_endofrecord=uninstrumented fun:xdrrec_eof=uninstrumented fun:xdrrec_skiprecord=uninstrumented fun:xdrstdio_create=uninstrumented fun:xencrypt=uninstrumented fun:xprt_register=uninstrumented fun:xprt_unregister=uninstrumented fun:y0=uninstrumented fun:y0f=uninstrumented fun:y0l=uninstrumented fun:y1=uninstrumented fun:y1f=uninstrumented fun:y1l=uninstrumented fun:yn=uninstrumented fun:ynf=uninstrumented fun:ynl=uninstrumented fun:yp_all=uninstrumented fun:yp_bind=uninstrumented fun:yp_first=uninstrumented fun:yp_get_default_domain=uninstrumented fun:yp_maplist=uninstrumented fun:yp_master=uninstrumented fun:yp_match=uninstrumented fun:yp_next=uninstrumented fun:yp_order=uninstrumented fun:yp_unbind=uninstrumented fun:yp_update=uninstrumented fun:ypbinderr_string=uninstrumented fun:yperr_string=uninstrumented fun:ypprot_err=uninstrumented golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/CMakeLists.txt0000664000175000017500000000326412760126006025607 0ustar mwhudsonmwhudsoninclude_directories(..) # Runtime library sources and build flags. set(DFSAN_RTL_SOURCES dfsan.cc dfsan_custom.cc dfsan_interceptors.cc) set(DFSAN_COMMON_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF DFSAN_COMMON_CFLAGS) # Prevent clang from generating libc calls. append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding DFSAN_COMMON_CFLAGS) # Static runtime library. add_compiler_rt_component(dfsan) foreach(arch ${DFSAN_SUPPORTED_ARCH}) set(DFSAN_CFLAGS ${DFSAN_COMMON_CFLAGS}) append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE DFSAN_CFLAGS) add_compiler_rt_runtime(clang_rt.dfsan STATIC ARCHS ${arch} SOURCES ${DFSAN_RTL_SOURCES} $ $ $ CFLAGS ${DFSAN_CFLAGS} PARENT_TARGET dfsan) add_sanitizer_rt_symbols(clang_rt.dfsan ARCHS ${arch} EXTRA dfsan.syms.extra) add_dependencies(dfsan clang_rt.dfsan-${arch}-symbols) endforeach() set(dfsan_abilist_filename ${COMPILER_RT_OUTPUT_DIR}/dfsan_abilist.txt) add_custom_target(dfsan_abilist ALL DEPENDS ${dfsan_abilist_filename}) add_custom_command(OUTPUT ${dfsan_abilist_filename} VERBATIM COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/done_abilist.txt ${CMAKE_CURRENT_SOURCE_DIR}/libc_ubuntu1404_abilist.txt > ${dfsan_abilist_filename} DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) add_dependencies(dfsan dfsan_abilist) install(FILES ${dfsan_abilist_filename} DESTINATION ${COMPILER_RT_INSTALL_PATH}) golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan_platform.h0000664000175000017500000000566012757622737026243 0ustar mwhudsonmwhudson//===-- dfsan_platform.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of DataFlowSanitizer. // // Platform specific information for DFSan. //===----------------------------------------------------------------------===// #ifndef DFSAN_PLATFORM_H #define DFSAN_PLATFORM_H namespace __dfsan { #if defined(__x86_64__) struct Mapping { static const uptr kShadowAddr = 0x10000; static const uptr kUnionTableAddr = 0x200000000000; static const uptr kAppAddr = 0x700000008000; static const uptr kShadowMask = ~0x700000000000; }; #elif defined(__mips64) struct Mapping { static const uptr kShadowAddr = 0x10000; static const uptr kUnionTableAddr = 0x2000000000; static const uptr kAppAddr = 0xF000008000; static const uptr kShadowMask = ~0xF000000000; }; #elif defined(__aarch64__) struct Mapping39 { static const uptr kShadowAddr = 0x10000; static const uptr kUnionTableAddr = 0x1000000000; static const uptr kAppAddr = 0x7000008000; static const uptr kShadowMask = ~0x7800000000; }; struct Mapping42 { static const uptr kShadowAddr = 0x10000; static const uptr kUnionTableAddr = 0x8000000000; static const uptr kAppAddr = 0x3ff00008000; static const uptr kShadowMask = ~0x3c000000000; }; struct Mapping48 { static const uptr kShadowAddr = 0x10000; static const uptr kUnionTableAddr = 0x8000000000; static const uptr kAppAddr = 0xffff00008000; static const uptr kShadowMask = ~0xfffff0000000; }; extern int vmaSize; # define DFSAN_RUNTIME_VMA 1 #else # error "DFSan not supported for this platform!" #endif enum MappingType { MAPPING_SHADOW_ADDR, MAPPING_UNION_TABLE_ADDR, MAPPING_APP_ADDR, MAPPING_SHADOW_MASK }; template uptr MappingImpl(void) { switch (Type) { case MAPPING_SHADOW_ADDR: return Mapping::kShadowAddr; case MAPPING_UNION_TABLE_ADDR: return Mapping::kUnionTableAddr; case MAPPING_APP_ADDR: return Mapping::kAppAddr; case MAPPING_SHADOW_MASK: return Mapping::kShadowMask; } } template uptr MappingArchImpl(void) { #ifdef __aarch64__ switch (vmaSize) { case 39: return MappingImpl(); case 42: return MappingImpl(); case 48: return MappingImpl(); } DCHECK(0); return 0; #else return MappingImpl(); #endif } ALWAYS_INLINE uptr ShadowAddr() { return MappingArchImpl(); } ALWAYS_INLINE uptr UnionTableAddr() { return MappingArchImpl(); } ALWAYS_INLINE uptr AppAddr() { return MappingArchImpl(); } ALWAYS_INLINE uptr ShadowMask() { return MappingArchImpl(); } } // namespace __dfsan #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan.syms.extra0000664000175000017500000000003312207747734026205 0ustar mwhudsonmwhudsondfsan_* __dfsan_* __dfsw_* golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan_flags.inc0000664000175000017500000000264412453077750026024 0ustar mwhudsonmwhudson//===-- dfsan_flags.inc -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // DFSan runtime flags. // //===----------------------------------------------------------------------===// #ifndef DFSAN_FLAG # error "Define DFSAN_FLAG prior to including this file!" #endif // DFSAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. DFSAN_FLAG(bool, warn_unimplemented, true, "Whether to warn on unimplemented functions.") DFSAN_FLAG(bool, warn_nonzero_labels, false, "Whether to warn on unimplemented functions.") DFSAN_FLAG( bool, strict_data_dependencies, true, "Whether to propagate labels only when there is an obvious data dependency" "(e.g., when comparing strings, ignore the fact that the output of the" "comparison might be data-dependent on the content of the strings). This" "applies only to the custom functions defined in 'custom.c'.") DFSAN_FLAG(const char *, dump_labels_at_exit, "", "The path of the file where " "to dump the labels when the " "program terminates.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan_interceptors.cc0000664000175000017500000000262312766606132027261 0ustar mwhudsonmwhudson//===-- dfsan_interceptors.cc ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of DataFlowSanitizer. // // Interceptors for standard library functions. //===----------------------------------------------------------------------===// #include "dfsan/dfsan.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" using namespace __sanitizer; INTERCEPTOR(void *, mmap, void *addr, SIZE_T length, int prot, int flags, int fd, OFF_T offset) { void *res = REAL(mmap)(addr, length, prot, flags, fd, offset); if (res != (void*)-1) dfsan_set_label(0, res, RoundUpTo(length, GetPageSize())); return res; } INTERCEPTOR(void *, mmap64, void *addr, SIZE_T length, int prot, int flags, int fd, OFF64_T offset) { void *res = REAL(mmap64)(addr, length, prot, flags, fd, offset); if (res != (void*)-1) dfsan_set_label(0, res, RoundUpTo(length, GetPageSize())); return res; } namespace __dfsan { void InitializeInterceptors() { static int inited = 0; CHECK_EQ(inited, 0); INTERCEPT_FUNCTION(mmap); INTERCEPT_FUNCTION(mmap64); inited = 1; } } // namespace __dfsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/dfsan/dfsan.h0000664000175000017500000000344012766606132024320 0ustar mwhudsonmwhudson//===-- dfsan.h -------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of DataFlowSanitizer. // // Private DFSan header. //===----------------------------------------------------------------------===// #ifndef DFSAN_H #define DFSAN_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "dfsan_platform.h" using __sanitizer::uptr; using __sanitizer::u16; // Copy declarations from public sanitizer/dfsan_interface.h header here. typedef u16 dfsan_label; struct dfsan_label_info { dfsan_label l1; dfsan_label l2; const char *desc; void *userdata; }; extern "C" { void dfsan_add_label(dfsan_label label, void *addr, uptr size); void dfsan_set_label(dfsan_label label, void *addr, uptr size); dfsan_label dfsan_read_label(const void *addr, uptr size); dfsan_label dfsan_union(dfsan_label l1, dfsan_label l2); } // extern "C" template void dfsan_set_label(dfsan_label label, T &data) { // NOLINT dfsan_set_label(label, (void *)&data, sizeof(T)); } namespace __dfsan { void InitializeInterceptors(); inline dfsan_label *shadow_for(void *ptr) { return (dfsan_label *) ((((uptr) ptr) & ShadowMask()) << 1); } inline const dfsan_label *shadow_for(const void *ptr) { return shadow_for(const_cast(ptr)); } struct Flags { #define DFSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "dfsan_flags.inc" #undef DFSAN_FLAG void SetDefaults(); }; extern Flags flags_data; inline Flags &flags() { return flags_data; } } // namespace __dfsan #endif // DFSAN_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/0000775000175000017500000000000013040224627022671 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_preinit.cc0000664000175000017500000000175112431376544025671 0ustar mwhudsonmwhudson//===-- asan_preinit.cc ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Call __asan_init at the very early stage of process startup. //===----------------------------------------------------------------------===// #include "asan_internal.h" using namespace __asan; #if SANITIZER_CAN_USE_PREINIT_ARRAY // The symbol is called __local_asan_preinit, because it's not intended to be // exported. // This code linked into the main executable when -fsanitize=address is in // the link flags. It can only use exported interface functions. __attribute__((section(".preinit_array"), used)) void (*__local_asan_preinit)(void) = __asan_init; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_flags.h0000664000175000017500000000265612466772632025170 0ustar mwhudsonmwhudson//===-- asan_flags.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan runtime flags. //===----------------------------------------------------------------------===// #ifndef ASAN_FLAGS_H #define ASAN_FLAGS_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_flag_parser.h" // ASan flag values can be defined in four ways: // 1) initialized with default values at startup. // 2) overriden during compilation of ASan runtime by providing // compile definition ASAN_DEFAULT_OPTIONS. // 3) overriden from string returned by user-specified function // __asan_default_options(). // 4) overriden from env variable ASAN_OPTIONS. // 5) overriden during ASan activation (for now used on Android only). namespace __asan { struct Flags { #define ASAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "asan_flags.inc" #undef ASAN_FLAG void SetDefaults(); }; extern Flags asan_flags_dont_use_directly; inline Flags *flags() { return &asan_flags_dont_use_directly; } void InitializeFlags(); } // namespace __asan #endif // ASAN_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_report.h0000664000175000017500000000714512764617350025401 0ustar mwhudsonmwhudson//===-- asan_report.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for error reporting functions. //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_internal.h" #include "asan_thread.h" namespace __asan { struct StackVarDescr { uptr beg; uptr size; const char *name_pos; uptr name_len; }; // Returns the number of globals close to the provided address and copies // them to "globals" array. int GetGlobalsForAddress(uptr addr, __asan_global *globals, u32 *reg_sites, int max_globals); const char *MaybeDemangleGlobalName(const char *name); void PrintGlobalNameIfASCII(InternalScopedString *str, const __asan_global &g); void PrintGlobalLocation(InternalScopedString *str, const __asan_global &g); void PrintMemoryByte(InternalScopedString *str, const char *before, u8 byte, bool in_shadow, const char *after = "\n"); // The following functions prints address description depending // on the memory type (shadow/heap/stack/global). bool ParseFrameDescription(const char *frame_descr, InternalMmapVector *vars); // Different kinds of error reports. void ReportGenericError(uptr pc, uptr bp, uptr sp, uptr addr, bool is_write, uptr access_size, u32 exp, bool fatal); void ReportStackOverflow(const SignalContext &sig); void ReportDeadlySignal(int signo, const SignalContext &sig); void ReportNewDeleteSizeMismatch(uptr addr, uptr delete_size, BufferedStackTrace *free_stack); void ReportDoubleFree(uptr addr, BufferedStackTrace *free_stack); void ReportFreeNotMalloced(uptr addr, BufferedStackTrace *free_stack); void ReportAllocTypeMismatch(uptr addr, BufferedStackTrace *free_stack, AllocType alloc_type, AllocType dealloc_type); void ReportMallocUsableSizeNotOwned(uptr addr, BufferedStackTrace *stack); void ReportSanitizerGetAllocatedSizeNotOwned(uptr addr, BufferedStackTrace *stack); void ReportStringFunctionMemoryRangesOverlap(const char *function, const char *offset1, uptr length1, const char *offset2, uptr length2, BufferedStackTrace *stack); void ReportStringFunctionSizeOverflow(uptr offset, uptr size, BufferedStackTrace *stack); void ReportBadParamsToAnnotateContiguousContainer(uptr beg, uptr end, uptr old_mid, uptr new_mid, BufferedStackTrace *stack); void ReportODRViolation(const __asan_global *g1, u32 stack_id1, const __asan_global *g2, u32 stack_id2); // Mac-specific errors and warnings. void ReportMacMzReallocUnknown(uptr addr, uptr zone_ptr, const char *zone_name, BufferedStackTrace *stack); void ReportMacCfReallocUnknown(uptr addr, uptr zone_ptr, const char *zone_name, BufferedStackTrace *stack); } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_posix.cc0000664000175000017500000001043512764263572025365 0ustar mwhudsonmwhudson//===-- asan_posix.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Posix-specific details. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_POSIX #include "asan_internal.h" #include "asan_interceptors.h" #include "asan_mapping.h" #include "asan_report.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_posix.h" #include "sanitizer_common/sanitizer_procmaps.h" #include #include #include #include #include #include namespace __asan { const char *DescribeSignalOrException(int signo) { switch (signo) { case SIGFPE: return "FPE"; case SIGILL: return "ILL"; case SIGABRT: return "ABRT"; default: return "SEGV"; } } void AsanOnDeadlySignal(int signo, void *siginfo, void *context) { ScopedDeadlySignal signal_scope(GetCurrentThread()); int code = (int)((siginfo_t*)siginfo)->si_code; // Write the first message using fd=2, just in case. // It may actually fail to write in case stderr is closed. internal_write(2, "ASAN:DEADLYSIGNAL\n", 18); SignalContext sig = SignalContext::Create(siginfo, context); // Access at a reasonable offset above SP, or slightly below it (to account // for x86_64 or PowerPC redzone, ARM push of multiple registers, etc) is // probably a stack overflow. #ifdef __s390__ // On s390, the fault address in siginfo points to start of the page, not // to the precise word that was accessed. Mask off the low bits of sp to // take it into account. bool IsStackAccess = sig.addr >= (sig.sp & ~0xFFF) && sig.addr < sig.sp + 0xFFFF; #else bool IsStackAccess = sig.addr + 512 > sig.sp && sig.addr < sig.sp + 0xFFFF; #endif #if __powerpc__ // Large stack frames can be allocated with e.g. // lis r0,-10000 // stdux r1,r1,r0 # store sp to [sp-10000] and update sp by -10000 // If the store faults then sp will not have been updated, so test above // will not work, becase the fault address will be more than just "slightly" // below sp. if (!IsStackAccess && IsAccessibleMemoryRange(sig.pc, 4)) { u32 inst = *(unsigned *)sig.pc; u32 ra = (inst >> 16) & 0x1F; u32 opcd = inst >> 26; u32 xo = (inst >> 1) & 0x3FF; // Check for store-with-update to sp. The instructions we accept are: // stbu rs,d(ra) stbux rs,ra,rb // sthu rs,d(ra) sthux rs,ra,rb // stwu rs,d(ra) stwux rs,ra,rb // stdu rs,ds(ra) stdux rs,ra,rb // where ra is r1 (the stack pointer). if (ra == 1 && (opcd == 39 || opcd == 45 || opcd == 37 || opcd == 62 || (opcd == 31 && (xo == 247 || xo == 439 || xo == 183 || xo == 181)))) IsStackAccess = true; } #endif // __powerpc__ // We also check si_code to filter out SEGV caused by something else other // then hitting the guard page or unmapped memory, like, for example, // unaligned memory access. if (IsStackAccess && (code == si_SEGV_MAPERR || code == si_SEGV_ACCERR)) ReportStackOverflow(sig); else ReportDeadlySignal(signo, sig); } // ---------------------- TSD ---------------- {{{1 static pthread_key_t tsd_key; static bool tsd_key_inited = false; void AsanTSDInit(void (*destructor)(void *tsd)) { CHECK(!tsd_key_inited); tsd_key_inited = true; CHECK_EQ(0, pthread_key_create(&tsd_key, destructor)); } void *AsanTSDGet() { CHECK(tsd_key_inited); return pthread_getspecific(tsd_key); } void AsanTSDSet(void *tsd) { CHECK(tsd_key_inited); pthread_setspecific(tsd_key, tsd); } void PlatformTSDDtor(void *tsd) { AsanThreadContext *context = (AsanThreadContext*)tsd; if (context->destructor_iterations > 1) { context->destructor_iterations--; CHECK_EQ(0, pthread_setspecific(tsd_key, tsd)); return; } AsanThread::TSDDtor(tsd); } } // namespace __asan #endif // SANITIZER_POSIX golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_suppressions.cc0000664000175000017500000000750212711722550026765 0ustar mwhudsonmwhudson//===-- asan_suppressions.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Issue suppression and suppression-related functions. //===----------------------------------------------------------------------===// #include "asan_suppressions.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_suppressions.h" #include "sanitizer_common/sanitizer_symbolizer.h" namespace __asan { ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)]; static SuppressionContext *suppression_ctx = nullptr; static const char kInterceptorName[] = "interceptor_name"; static const char kInterceptorViaFunction[] = "interceptor_via_fun"; static const char kInterceptorViaLibrary[] = "interceptor_via_lib"; static const char kODRViolation[] = "odr_violation"; static const char *kSuppressionTypes[] = { kInterceptorName, kInterceptorViaFunction, kInterceptorViaLibrary, kODRViolation}; extern "C" { #if SANITIZER_SUPPORTS_WEAK_HOOKS SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *__asan_default_suppressions(); #else // No week hooks, provide empty implementation. const char *__asan_default_suppressions() { return ""; } #endif // SANITIZER_SUPPORTS_WEAK_HOOKS } // extern "C" void InitializeSuppressions() { CHECK_EQ(nullptr, suppression_ctx); suppression_ctx = new (suppression_placeholder) // NOLINT SuppressionContext(kSuppressionTypes, ARRAY_SIZE(kSuppressionTypes)); suppression_ctx->ParseFromFile(flags()->suppressions); if (&__asan_default_suppressions) suppression_ctx->Parse(__asan_default_suppressions()); } bool IsInterceptorSuppressed(const char *interceptor_name) { CHECK(suppression_ctx); Suppression *s; // Match "interceptor_name" suppressions. return suppression_ctx->Match(interceptor_name, kInterceptorName, &s); } bool HaveStackTraceBasedSuppressions() { CHECK(suppression_ctx); return suppression_ctx->HasSuppressionType(kInterceptorViaFunction) || suppression_ctx->HasSuppressionType(kInterceptorViaLibrary); } bool IsODRViolationSuppressed(const char *global_var_name) { CHECK(suppression_ctx); Suppression *s; // Match "odr_violation" suppressions. return suppression_ctx->Match(global_var_name, kODRViolation, &s); } bool IsStackTraceSuppressed(const StackTrace *stack) { if (!HaveStackTraceBasedSuppressions()) return false; CHECK(suppression_ctx); Symbolizer *symbolizer = Symbolizer::GetOrInit(); Suppression *s; for (uptr i = 0; i < stack->size && stack->trace[i]; i++) { uptr addr = stack->trace[i]; if (suppression_ctx->HasSuppressionType(kInterceptorViaLibrary)) { // Match "interceptor_via_lib" suppressions. if (const char *module_name = symbolizer->GetModuleNameForPc(addr)) if (suppression_ctx->Match(module_name, kInterceptorViaLibrary, &s)) return true; } if (suppression_ctx->HasSuppressionType(kInterceptorViaFunction)) { SymbolizedStack *frames = symbolizer->SymbolizePC(addr); CHECK(frames); for (SymbolizedStack *cur = frames; cur; cur = cur->next) { const char *function_name = cur->info.function; if (!function_name) { continue; } // Match "interceptor_via_fun" suppressions. if (suppression_ctx->Match(function_name, kInterceptorViaFunction, &s)) { frames->ClearAll(); return true; } } frames->ClearAll(); } } return false; } } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_win.cc0000664000175000017500000003016712773522466025024 0ustar mwhudsonmwhudson//===-- asan_win.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Windows-specific details. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_WINDOWS #define WIN32_LEAN_AND_MEAN #include #include #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_report.h" #include "asan_stack.h" #include "asan_thread.h" #include "asan_mapping.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_mutex.h" using namespace __asan; // NOLINT extern "C" { SANITIZER_INTERFACE_ATTRIBUTE int __asan_should_detect_stack_use_after_return() { __asan_init(); return __asan_option_detect_stack_use_after_return; } SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_shadow_memory_dynamic_address() { __asan_init(); return __asan_shadow_memory_dynamic_address; } // -------------------- A workaround for the absence of weak symbols ----- {{{ // We don't have a direct equivalent of weak symbols when using MSVC, but we can // use the /alternatename directive to tell the linker to default a specific // symbol to a specific value, which works nicely for allocator hooks and // __asan_default_options(). void __sanitizer_default_malloc_hook(void *ptr, uptr size) { } void __sanitizer_default_free_hook(void *ptr) { } const char* __asan_default_default_options() { return ""; } const char* __asan_default_default_suppressions() { return ""; } void __asan_default_on_error() {} // 64-bit msvc will not prepend an underscore for symbols. #ifdef _WIN64 #pragma comment(linker, "/alternatename:__sanitizer_malloc_hook=__sanitizer_default_malloc_hook") // NOLINT #pragma comment(linker, "/alternatename:__sanitizer_free_hook=__sanitizer_default_free_hook") // NOLINT #pragma comment(linker, "/alternatename:__asan_default_options=__asan_default_default_options") // NOLINT #pragma comment(linker, "/alternatename:__asan_default_suppressions=__asan_default_default_suppressions") // NOLINT #pragma comment(linker, "/alternatename:__asan_on_error=__asan_default_on_error") // NOLINT #else #pragma comment(linker, "/alternatename:___sanitizer_malloc_hook=___sanitizer_default_malloc_hook") // NOLINT #pragma comment(linker, "/alternatename:___sanitizer_free_hook=___sanitizer_default_free_hook") // NOLINT #pragma comment(linker, "/alternatename:___asan_default_options=___asan_default_default_options") // NOLINT #pragma comment(linker, "/alternatename:___asan_default_suppressions=___asan_default_default_suppressions") // NOLINT #pragma comment(linker, "/alternatename:___asan_on_error=___asan_default_on_error") // NOLINT #endif // }}} } // extern "C" // ---------------------- Windows-specific interceptors ---------------- {{{ INTERCEPTOR_WINAPI(void, RtlRaiseException, EXCEPTION_RECORD *ExceptionRecord) { CHECK(REAL(RtlRaiseException)); // This is a noreturn function, unless it's one of the exceptions raised to // communicate with the debugger, such as the one from OutputDebugString. if (ExceptionRecord->ExceptionCode != DBG_PRINTEXCEPTION_C) __asan_handle_no_return(); REAL(RtlRaiseException)(ExceptionRecord); } INTERCEPTOR_WINAPI(void, RaiseException, void *a, void *b, void *c, void *d) { CHECK(REAL(RaiseException)); __asan_handle_no_return(); REAL(RaiseException)(a, b, c, d); } #ifdef _WIN64 INTERCEPTOR_WINAPI(int, __C_specific_handler, void *a, void *b, void *c, void *d) { // NOLINT CHECK(REAL(__C_specific_handler)); __asan_handle_no_return(); return REAL(__C_specific_handler)(a, b, c, d); } #else INTERCEPTOR(int, _except_handler3, void *a, void *b, void *c, void *d) { CHECK(REAL(_except_handler3)); __asan_handle_no_return(); return REAL(_except_handler3)(a, b, c, d); } #if ASAN_DYNAMIC // This handler is named differently in -MT and -MD CRTs. #define _except_handler4 _except_handler4_common #endif INTERCEPTOR(int, _except_handler4, void *a, void *b, void *c, void *d) { CHECK(REAL(_except_handler4)); __asan_handle_no_return(); return REAL(_except_handler4)(a, b, c, d); } #endif static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) { AsanThread *t = (AsanThread*)arg; SetCurrentThread(t); return t->ThreadStart(GetTid(), /* signal_thread_is_registered */ nullptr); } INTERCEPTOR_WINAPI(DWORD, CreateThread, void* security, uptr stack_size, DWORD (__stdcall *start_routine)(void*), void* arg, DWORD thr_flags, void* tid) { // Strict init-order checking is thread-hostile. if (flags()->strict_init_order) StopInitOrderChecking(); GET_STACK_TRACE_THREAD; // FIXME: The CreateThread interceptor is not the same as a pthread_create // one. This is a bandaid fix for PR22025. bool detached = false; // FIXME: how can we determine it on Windows? u32 current_tid = GetCurrentTidOrInvalid(); AsanThread *t = AsanThread::Create(start_routine, arg, current_tid, &stack, detached); return REAL(CreateThread)(security, stack_size, asan_thread_start, t, thr_flags, tid); } // }}} namespace __asan { void InitializePlatformInterceptors() { ASAN_INTERCEPT_FUNC(CreateThread); #ifdef _WIN64 ASAN_INTERCEPT_FUNC(__C_specific_handler); #else ASAN_INTERCEPT_FUNC(_except_handler3); ASAN_INTERCEPT_FUNC(_except_handler4); #endif // Try to intercept kernel32!RaiseException, and if that fails, intercept // ntdll!RtlRaiseException instead. if (!::__interception::OverrideFunction("RaiseException", (uptr)WRAP(RaiseException), (uptr *)&REAL(RaiseException))) { CHECK(::__interception::OverrideFunction("RtlRaiseException", (uptr)WRAP(RtlRaiseException), (uptr *)&REAL(RtlRaiseException))); } } void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { UNIMPLEMENTED(); } // ---------------------- TSD ---------------- {{{ static bool tsd_key_inited = false; static __declspec(thread) void *fake_tsd = 0; void AsanTSDInit(void (*destructor)(void *tsd)) { // FIXME: we're ignoring the destructor for now. tsd_key_inited = true; } void *AsanTSDGet() { CHECK(tsd_key_inited); return fake_tsd; } void AsanTSDSet(void *tsd) { CHECK(tsd_key_inited); fake_tsd = tsd; } void PlatformTSDDtor(void *tsd) { AsanThread::TSDDtor(tsd); } // }}} // ---------------------- Various stuff ---------------- {{{ void *AsanDoesNotSupportStaticLinkage() { #if defined(_DEBUG) #error Please build the runtime with a non-debug CRT: /MD or /MT #endif return 0; } void AsanCheckDynamicRTPrereqs() {} void AsanCheckIncompatibleRT() {} void ReadContextStack(void *context, uptr *stack, uptr *ssize) { UNIMPLEMENTED(); } void AsanOnDeadlySignal(int, void *siginfo, void *context) { UNIMPLEMENTED(); } #if SANITIZER_WINDOWS64 // Exception handler for dealing with shadow memory. static LONG CALLBACK ShadowExceptionHandler(PEXCEPTION_POINTERS exception_pointers) { uptr page_size = GetPageSizeCached(); // Only handle access violations. if (exception_pointers->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) { return EXCEPTION_CONTINUE_SEARCH; } // Only handle access violations that land within the shadow memory. uptr addr = (uptr)(exception_pointers->ExceptionRecord->ExceptionInformation[1]); // Check valid shadow range. if (!AddrIsInShadow(addr)) return EXCEPTION_CONTINUE_SEARCH; // This is an access violation while trying to read from the shadow. Commit // the relevant page and let execution continue. // Determine the address of the page that is being accessed. uptr page = RoundDownTo(addr, page_size); // Query the existing page. MEMORY_BASIC_INFORMATION mem_info = {}; if (::VirtualQuery((LPVOID)page, &mem_info, sizeof(mem_info)) == 0) return EXCEPTION_CONTINUE_SEARCH; // Commit the page. uptr result = (uptr)::VirtualAlloc((LPVOID)page, page_size, MEM_COMMIT, PAGE_READWRITE); if (result != page) return EXCEPTION_CONTINUE_SEARCH; // The page mapping succeeded, so continue execution as usual. return EXCEPTION_CONTINUE_EXECUTION; } #endif void InitializePlatformExceptionHandlers() { #if SANITIZER_WINDOWS64 // On Win64, we map memory on demand with access violation handler. // Install our exception handler. CHECK(AddVectoredExceptionHandler(TRUE, &ShadowExceptionHandler)); #endif } static LPTOP_LEVEL_EXCEPTION_FILTER default_seh_handler; // Check based on flags if we should report this exception. static bool ShouldReportDeadlyException(unsigned code) { switch (code) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_IN_PAGE_ERROR: return common_flags()->handle_segv; case EXCEPTION_BREAKPOINT: case EXCEPTION_ILLEGAL_INSTRUCTION: { return common_flags()->handle_sigill; } } return false; } // Return the textual name for this exception. const char *DescribeSignalOrException(int signo) { unsigned code = signo; // Get the string description of the exception if this is a known deadly // exception. switch (code) { case EXCEPTION_ACCESS_VIOLATION: return "access-violation"; case EXCEPTION_IN_PAGE_ERROR: return "in-page-error"; case EXCEPTION_BREAKPOINT: return "breakpoint"; case EXCEPTION_ILLEGAL_INSTRUCTION: return "illegal-instruction"; } return nullptr; } static long WINAPI SEHHandler(EXCEPTION_POINTERS *info) { EXCEPTION_RECORD *exception_record = info->ExceptionRecord; CONTEXT *context = info->ContextRecord; if (ShouldReportDeadlyException(exception_record->ExceptionCode)) { SignalContext sig = SignalContext::Create(exception_record, context); ReportDeadlySignal(exception_record->ExceptionCode, sig); } // FIXME: Handle EXCEPTION_STACK_OVERFLOW here. return default_seh_handler(info); } // We want to install our own exception handler (EH) to print helpful reports // on access violations and whatnot. Unfortunately, the CRT initializers assume // they are run before any user code and drop any previously-installed EHs on // the floor, so we can't install our handler inside __asan_init. // (See crt0dat.c in the CRT sources for the details) // // Things get even more complicated with the dynamic runtime, as it finishes its // initialization before the .exe module CRT begins to initialize. // // For the static runtime (-MT), it's enough to put a callback to // __asan_set_seh_filter in the last section for C initializers. // // For the dynamic runtime (-MD), we want link the same // asan_dynamic_runtime_thunk.lib to all the modules, thus __asan_set_seh_filter // will be called for each instrumented module. This ensures that at least one // __asan_set_seh_filter call happens after the .exe module CRT is initialized. extern "C" SANITIZER_INTERFACE_ATTRIBUTE int __asan_set_seh_filter() { // We should only store the previous handler if it's not our own handler in // order to avoid loops in the EH chain. auto prev_seh_handler = SetUnhandledExceptionFilter(SEHHandler); if (prev_seh_handler != &SEHHandler) default_seh_handler = prev_seh_handler; return 0; } #if !ASAN_DYNAMIC // The CRT runs initializers in this order: // - C initializers, from XIA to XIZ // - C++ initializers, from XCA to XCZ // Prior to 2015, the CRT set the unhandled exception filter at priority XIY, // near the end of C initialization. Starting in 2015, it was moved to the // beginning of C++ initialization. We set our priority to XCAB to run // immediately after the CRT runs. This way, our exception filter is called // first and we can delegate to their filter if appropriate. #pragma section(".CRT$XCAB", long, read) // NOLINT __declspec(allocate(".CRT$XCAB")) int (*__intercept_seh)() = __asan_set_seh_filter; #endif // }}} } // namespace __asan #endif // _WIN32 golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_malloc_linux.cc0000664000175000017500000001520212772154051026674 0ustar mwhudsonmwhudson//===-- asan_malloc_linux.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Linux-specific malloc interception. // We simply define functions like malloc, free, realloc, etc. // They will replace the corresponding libc functions automagically. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "asan_allocator.h" #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_stack.h" // ---------------------- Replacement functions ---------------- {{{1 using namespace __asan; // NOLINT static uptr allocated_for_dlsym; static const uptr kDlsymAllocPoolSize = 1024; static uptr alloc_memory_for_dlsym[kDlsymAllocPoolSize]; static bool IsInDlsymAllocPool(const void *ptr) { uptr off = (uptr)ptr - (uptr)alloc_memory_for_dlsym; return off < sizeof(alloc_memory_for_dlsym); } static void *AllocateFromLocalPool(uptr size_in_bytes) { uptr size_in_words = RoundUpTo(size_in_bytes, kWordSize) / kWordSize; void *mem = (void*)&alloc_memory_for_dlsym[allocated_for_dlsym]; allocated_for_dlsym += size_in_words; CHECK_LT(allocated_for_dlsym, kDlsymAllocPoolSize); return mem; } INTERCEPTOR(void, free, void *ptr) { GET_STACK_TRACE_FREE; if (UNLIKELY(IsInDlsymAllocPool(ptr))) return; asan_free(ptr, &stack, FROM_MALLOC); } INTERCEPTOR(void, cfree, void *ptr) { GET_STACK_TRACE_FREE; if (UNLIKELY(IsInDlsymAllocPool(ptr))) return; asan_free(ptr, &stack, FROM_MALLOC); } INTERCEPTOR(void*, malloc, uptr size) { if (UNLIKELY(!asan_inited)) // Hack: dlsym calls malloc before REAL(malloc) is retrieved from dlsym. return AllocateFromLocalPool(size); GET_STACK_TRACE_MALLOC; return asan_malloc(size, &stack); } INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { if (UNLIKELY(!asan_inited)) // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. return AllocateFromLocalPool(nmemb * size); GET_STACK_TRACE_MALLOC; return asan_calloc(nmemb, size, &stack); } INTERCEPTOR(void*, realloc, void *ptr, uptr size) { GET_STACK_TRACE_MALLOC; if (UNLIKELY(IsInDlsymAllocPool(ptr))) { uptr offset = (uptr)ptr - (uptr)alloc_memory_for_dlsym; uptr copy_size = Min(size, kDlsymAllocPoolSize - offset); void *new_ptr; if (UNLIKELY(!asan_inited)) { new_ptr = AllocateFromLocalPool(size); } else { copy_size = size; new_ptr = asan_malloc(copy_size, &stack); } internal_memcpy(new_ptr, ptr, copy_size); return new_ptr; } return asan_realloc(ptr, size, &stack); } INTERCEPTOR(void*, memalign, uptr boundary, uptr size) { GET_STACK_TRACE_MALLOC; return asan_memalign(boundary, size, &stack, FROM_MALLOC); } INTERCEPTOR(void*, aligned_alloc, uptr boundary, uptr size) { GET_STACK_TRACE_MALLOC; return asan_memalign(boundary, size, &stack, FROM_MALLOC); } INTERCEPTOR(void*, __libc_memalign, uptr boundary, uptr size) { GET_STACK_TRACE_MALLOC; void *res = asan_memalign(boundary, size, &stack, FROM_MALLOC); DTLS_on_libc_memalign(res, size); return res; } INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { GET_CURRENT_PC_BP_SP; (void)sp; return asan_malloc_usable_size(ptr, pc, bp); } // We avoid including malloc.h for portability reasons. // man mallinfo says the fields are "long", but the implementation uses int. // It doesn't matter much -- we just need to make sure that the libc's mallinfo // is not called. struct fake_mallinfo { int x[10]; }; INTERCEPTOR(struct fake_mallinfo, mallinfo, void) { struct fake_mallinfo res; REAL(memset)(&res, 0, sizeof(res)); return res; } INTERCEPTOR(int, mallopt, int cmd, int value) { return -1; } INTERCEPTOR(int, posix_memalign, void **memptr, uptr alignment, uptr size) { GET_STACK_TRACE_MALLOC; // Printf("posix_memalign: %zx %zu\n", alignment, size); return asan_posix_memalign(memptr, alignment, size, &stack); } INTERCEPTOR(void*, valloc, uptr size) { GET_STACK_TRACE_MALLOC; return asan_valloc(size, &stack); } INTERCEPTOR(void*, pvalloc, uptr size) { GET_STACK_TRACE_MALLOC; return asan_pvalloc(size, &stack); } INTERCEPTOR(void, malloc_stats, void) { __asan_print_accumulated_stats(); } #if SANITIZER_ANDROID // Format of __libc_malloc_dispatch has changed in Android L. // While we are moving towards a solution that does not depend on bionic // internals, here is something to support both K* and L releases. struct MallocDebugK { void *(*malloc)(uptr bytes); void (*free)(void *mem); void *(*calloc)(uptr n_elements, uptr elem_size); void *(*realloc)(void *oldMem, uptr bytes); void *(*memalign)(uptr alignment, uptr bytes); uptr (*malloc_usable_size)(void *mem); }; struct MallocDebugL { void *(*calloc)(uptr n_elements, uptr elem_size); void (*free)(void *mem); fake_mallinfo (*mallinfo)(void); void *(*malloc)(uptr bytes); uptr (*malloc_usable_size)(void *mem); void *(*memalign)(uptr alignment, uptr bytes); int (*posix_memalign)(void **memptr, uptr alignment, uptr size); void* (*pvalloc)(uptr size); void *(*realloc)(void *oldMem, uptr bytes); void* (*valloc)(uptr size); }; ALIGNED(32) const MallocDebugK asan_malloc_dispatch_k = { WRAP(malloc), WRAP(free), WRAP(calloc), WRAP(realloc), WRAP(memalign), WRAP(malloc_usable_size)}; ALIGNED(32) const MallocDebugL asan_malloc_dispatch_l = { WRAP(calloc), WRAP(free), WRAP(mallinfo), WRAP(malloc), WRAP(malloc_usable_size), WRAP(memalign), WRAP(posix_memalign), WRAP(pvalloc), WRAP(realloc), WRAP(valloc)}; namespace __asan { void ReplaceSystemMalloc() { void **__libc_malloc_dispatch_p = (void **)AsanDlSymNext("__libc_malloc_dispatch"); if (__libc_malloc_dispatch_p) { // Decide on K vs L dispatch format by the presence of // __libc_malloc_default_dispatch export in libc. void *default_dispatch_p = AsanDlSymNext("__libc_malloc_default_dispatch"); if (default_dispatch_p) *__libc_malloc_dispatch_p = (void *)&asan_malloc_dispatch_k; else *__libc_malloc_dispatch_p = (void *)&asan_malloc_dispatch_l; } } } // namespace __asan #else // SANITIZER_ANDROID namespace __asan { void ReplaceSystemMalloc() { } } // namespace __asan #endif // SANITIZER_ANDROID #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/README.txt0000664000175000017500000000163412630347544024403 0ustar mwhudsonmwhudsonAddressSanitizer RT ================================ This directory contains sources of the AddressSanitizer (ASan) runtime library. Directory structure: README.txt : This file. Makefile.mk : File for make-based build. CMakeLists.txt : File for cmake-based build. asan_*.{cc,h} : Sources of the asan runtime library. scripts/* : Helper scripts. tests/* : ASan unit tests. Also ASan runtime needs the following libraries: lib/interception/ : Machinery used to intercept function calls. lib/sanitizer_common/ : Code shared between various sanitizers. ASan runtime currently also embeds part of LeakSanitizer runtime for leak detection (lib/lsan/lsan_common.{cc,h}). ASan runtime can only be built by CMake. You can run ASan tests from the root of your CMake build tree: make check-asan For more instructions see: https://github.com/google/sanitizers/wiki/AddressSanitizerHowToBuild golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_mapping.h0000664000175000017500000003044012775261667025523 0ustar mwhudsonmwhudson//===-- asan_mapping.h ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Defines ASan memory mapping. //===----------------------------------------------------------------------===// #ifndef ASAN_MAPPING_H #define ASAN_MAPPING_H #include "asan_internal.h" // The full explanation of the memory mapping could be found here: // https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm // // Typical shadow mapping on Linux/x86_64 with SHADOW_OFFSET == 0x00007fff8000: // || `[0x10007fff8000, 0x7fffffffffff]` || HighMem || // || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow || // || `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap || // || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow || // || `[0x000000000000, 0x00007fff7fff]` || LowMem || // // When SHADOW_OFFSET is zero (-pie): // || `[0x100000000000, 0x7fffffffffff]` || HighMem || // || `[0x020000000000, 0x0fffffffffff]` || HighShadow || // || `[0x000000040000, 0x01ffffffffff]` || ShadowGap || // // Special case when something is already mapped between // 0x003000000000 and 0x005000000000 (e.g. when prelink is installed): // || `[0x10007fff8000, 0x7fffffffffff]` || HighMem || // || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow || // || `[0x005000000000, 0x02008fff6fff]` || ShadowGap3 || // || `[0x003000000000, 0x004fffffffff]` || MidMem || // || `[0x000a7fff8000, 0x002fffffffff]` || ShadowGap2 || // || `[0x00067fff8000, 0x000a7fff7fff]` || MidShadow || // || `[0x00008fff7000, 0x00067fff7fff]` || ShadowGap || // || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow || // || `[0x000000000000, 0x00007fff7fff]` || LowMem || // // Default Linux/i386 mapping on x86_64 machine: // || `[0x40000000, 0xffffffff]` || HighMem || // || `[0x28000000, 0x3fffffff]` || HighShadow || // || `[0x24000000, 0x27ffffff]` || ShadowGap || // || `[0x20000000, 0x23ffffff]` || LowShadow || // || `[0x00000000, 0x1fffffff]` || LowMem || // // Default Linux/i386 mapping on i386 machine // (addresses starting with 0xc0000000 are reserved // for kernel and thus not sanitized): // || `[0x38000000, 0xbfffffff]` || HighMem || // || `[0x27000000, 0x37ffffff]` || HighShadow || // || `[0x24000000, 0x26ffffff]` || ShadowGap || // || `[0x20000000, 0x23ffffff]` || LowShadow || // || `[0x00000000, 0x1fffffff]` || LowMem || // // Default Linux/MIPS32 mapping: // || `[0x2aaa0000, 0xffffffff]` || HighMem || // || `[0x0fff4000, 0x2aa9ffff]` || HighShadow || // || `[0x0bff4000, 0x0fff3fff]` || ShadowGap || // || `[0x0aaa0000, 0x0bff3fff]` || LowShadow || // || `[0x00000000, 0x0aa9ffff]` || LowMem || // // Default Linux/MIPS64 mapping: // || `[0x4000000000, 0xffffffffff]` || HighMem || // || `[0x2800000000, 0x3fffffffff]` || HighShadow || // || `[0x2400000000, 0x27ffffffff]` || ShadowGap || // || `[0x2000000000, 0x23ffffffff]` || LowShadow || // || `[0x0000000000, 0x1fffffffff]` || LowMem || // // Default Linux/AArch64 (39-bit VMA) mapping: // || `[0x2000000000, 0x7fffffffff]` || highmem || // || `[0x1400000000, 0x1fffffffff]` || highshadow || // || `[0x1200000000, 0x13ffffffff]` || shadowgap || // || `[0x1000000000, 0x11ffffffff]` || lowshadow || // || `[0x0000000000, 0x0fffffffff]` || lowmem || // // Default Linux/AArch64 (42-bit VMA) mapping: // || `[0x10000000000, 0x3ffffffffff]` || highmem || // || `[0x0a000000000, 0x0ffffffffff]` || highshadow || // || `[0x09000000000, 0x09fffffffff]` || shadowgap || // || `[0x08000000000, 0x08fffffffff]` || lowshadow || // || `[0x00000000000, 0x07fffffffff]` || lowmem || // // Default Linux/S390 mapping: // || `[0x30000000, 0x7fffffff]` || HighMem || // || `[0x26000000, 0x2fffffff]` || HighShadow || // || `[0x24000000, 0x25ffffff]` || ShadowGap || // || `[0x20000000, 0x23ffffff]` || LowShadow || // || `[0x00000000, 0x1fffffff]` || LowMem || // // Default Linux/SystemZ mapping: // || `[0x14000000000000, 0x1fffffffffffff]` || HighMem || // || `[0x12800000000000, 0x13ffffffffffff]` || HighShadow || // || `[0x12000000000000, 0x127fffffffffff]` || ShadowGap || // || `[0x10000000000000, 0x11ffffffffffff]` || LowShadow || // || `[0x00000000000000, 0x0fffffffffffff]` || LowMem || // // Shadow mapping on FreeBSD/x86-64 with SHADOW_OFFSET == 0x400000000000: // || `[0x500000000000, 0x7fffffffffff]` || HighMem || // || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow || // || `[0x480000000000, 0x49ffffffffff]` || ShadowGap || // || `[0x400000000000, 0x47ffffffffff]` || LowShadow || // || `[0x000000000000, 0x3fffffffffff]` || LowMem || // // Shadow mapping on FreeBSD/i386 with SHADOW_OFFSET == 0x40000000: // || `[0x60000000, 0xffffffff]` || HighMem || // || `[0x4c000000, 0x5fffffff]` || HighShadow || // || `[0x48000000, 0x4bffffff]` || ShadowGap || // || `[0x40000000, 0x47ffffff]` || LowShadow || // || `[0x00000000, 0x3fffffff]` || LowMem || // // Default Windows/i386 mapping: // (the exact location of HighShadow/HighMem may vary depending // on WoW64, /LARGEADDRESSAWARE, etc). // || `[0x50000000, 0xffffffff]` || HighMem || // || `[0x3a000000, 0x4fffffff]` || HighShadow || // || `[0x36000000, 0x39ffffff]` || ShadowGap || // || `[0x30000000, 0x35ffffff]` || LowShadow || // || `[0x00000000, 0x2fffffff]` || LowMem || static const u64 kDefaultShadowScale = 3; static const u64 kDefaultShadowSentinel = ~(uptr)0; static const u64 kDefaultShadowOffset32 = 1ULL << 29; // 0x20000000 static const u64 kDefaultShadowOffset64 = 1ULL << 44; static const u64 kDefaultShort64bitShadowOffset = 0x7FFF8000; // < 2G. static const u64 kIosShadowOffset32 = 1ULL << 30; // 0x40000000 static const u64 kIosShadowOffset64 = 0x120200000; static const u64 kIosSimShadowOffset32 = 1ULL << 30; static const u64 kIosSimShadowOffset64 = kDefaultShadowOffset64; static const u64 kAArch64_ShadowOffset64 = 1ULL << 36; static const u64 kMIPS32_ShadowOffset32 = 0x0aaa0000; static const u64 kMIPS64_ShadowOffset64 = 1ULL << 37; static const u64 kPPC64_ShadowOffset64 = 1ULL << 41; static const u64 kSystemZ_ShadowOffset64 = 1ULL << 52; static const u64 kFreeBSD_ShadowOffset32 = 1ULL << 30; // 0x40000000 static const u64 kFreeBSD_ShadowOffset64 = 1ULL << 46; // 0x400000000000 static const u64 kWindowsShadowOffset32 = 3ULL << 28; // 0x30000000 #define SHADOW_SCALE kDefaultShadowScale #if SANITIZER_WORDSIZE == 32 # if SANITIZER_ANDROID # define SHADOW_OFFSET (0) # elif defined(__mips__) # define SHADOW_OFFSET kMIPS32_ShadowOffset32 # elif SANITIZER_FREEBSD # define SHADOW_OFFSET kFreeBSD_ShadowOffset32 # elif SANITIZER_WINDOWS # define SHADOW_OFFSET kWindowsShadowOffset32 # elif SANITIZER_IOS # if SANITIZER_IOSSIM # define SHADOW_OFFSET kIosSimShadowOffset32 # else # define SHADOW_OFFSET kIosShadowOffset32 # endif # else # define SHADOW_OFFSET kDefaultShadowOffset32 # endif #else # if SANITIZER_IOS # if SANITIZER_IOSSIM # define SHADOW_OFFSET kIosSimShadowOffset64 # else # define SHADOW_OFFSET __asan_shadow_memory_dynamic_address # endif # elif defined(__aarch64__) # define SHADOW_OFFSET kAArch64_ShadowOffset64 # elif defined(__powerpc64__) # define SHADOW_OFFSET kPPC64_ShadowOffset64 # elif defined(__s390x__) # define SHADOW_OFFSET kSystemZ_ShadowOffset64 # elif SANITIZER_FREEBSD # define SHADOW_OFFSET kFreeBSD_ShadowOffset64 # elif SANITIZER_MAC # define SHADOW_OFFSET kDefaultShadowOffset64 # elif defined(__mips64) # define SHADOW_OFFSET kMIPS64_ShadowOffset64 # elif SANITIZER_WINDOWS64 # define SHADOW_OFFSET __asan_shadow_memory_dynamic_address # else # define SHADOW_OFFSET kDefaultShort64bitShadowOffset # endif #endif #define SHADOW_GRANULARITY (1ULL << SHADOW_SCALE) #define MEM_TO_SHADOW(mem) (((mem) >> SHADOW_SCALE) + (SHADOW_OFFSET)) #define SHADOW_TO_MEM(shadow) (((shadow) - SHADOW_OFFSET) << SHADOW_SCALE) #define kLowMemBeg 0 #define kLowMemEnd (SHADOW_OFFSET ? SHADOW_OFFSET - 1 : 0) #define kLowShadowBeg SHADOW_OFFSET #define kLowShadowEnd MEM_TO_SHADOW(kLowMemEnd) #define kHighMemBeg (MEM_TO_SHADOW(kHighMemEnd) + 1) #define kHighShadowBeg MEM_TO_SHADOW(kHighMemBeg) #define kHighShadowEnd MEM_TO_SHADOW(kHighMemEnd) # define kMidShadowBeg MEM_TO_SHADOW(kMidMemBeg) # define kMidShadowEnd MEM_TO_SHADOW(kMidMemEnd) // With the zero shadow base we can not actually map pages starting from 0. // This constant is somewhat arbitrary. #define kZeroBaseShadowStart 0 #define kZeroBaseMaxShadowStart (1 << 18) #define kShadowGapBeg (kLowShadowEnd ? kLowShadowEnd + 1 \ : kZeroBaseShadowStart) #define kShadowGapEnd ((kMidMemBeg ? kMidShadowBeg : kHighShadowBeg) - 1) #define kShadowGap2Beg (kMidMemBeg ? kMidShadowEnd + 1 : 0) #define kShadowGap2End (kMidMemBeg ? kMidMemBeg - 1 : 0) #define kShadowGap3Beg (kMidMemBeg ? kMidMemEnd + 1 : 0) #define kShadowGap3End (kMidMemBeg ? kHighShadowBeg - 1 : 0) #define DO_ASAN_MAPPING_PROFILE 0 // Set to 1 to profile the functions below. #if DO_ASAN_MAPPING_PROFILE # define PROFILE_ASAN_MAPPING() AsanMappingProfile[__LINE__]++; #else # define PROFILE_ASAN_MAPPING() #endif // If 1, all shadow boundaries are constants. // Don't set to 1 other than for testing. #define ASAN_FIXED_MAPPING 0 namespace __asan { extern uptr AsanMappingProfile[]; #if ASAN_FIXED_MAPPING // Fixed mapping for 64-bit Linux. Mostly used for performance comparison // with non-fixed mapping. As of r175253 (Feb 2013) the performance // difference between fixed and non-fixed mapping is below the noise level. static uptr kHighMemEnd = 0x7fffffffffffULL; static uptr kMidMemBeg = 0x3000000000ULL; static uptr kMidMemEnd = 0x4fffffffffULL; #else extern uptr kHighMemEnd, kMidMemBeg, kMidMemEnd; // Initialized in __asan_init. #endif static inline bool AddrIsInLowMem(uptr a) { PROFILE_ASAN_MAPPING(); return a < kLowMemEnd; } static inline bool AddrIsInLowShadow(uptr a) { PROFILE_ASAN_MAPPING(); return a >= kLowShadowBeg && a <= kLowShadowEnd; } static inline bool AddrIsInHighMem(uptr a) { PROFILE_ASAN_MAPPING(); return a >= kHighMemBeg && a <= kHighMemEnd; } static inline bool AddrIsInMidMem(uptr a) { PROFILE_ASAN_MAPPING(); return kMidMemBeg && a >= kMidMemBeg && a <= kMidMemEnd; } static inline bool AddrIsInShadowGap(uptr a) { PROFILE_ASAN_MAPPING(); if (kMidMemBeg) { if (a <= kShadowGapEnd) return SHADOW_OFFSET == 0 || a >= kShadowGapBeg; return (a >= kShadowGap2Beg && a <= kShadowGap2End) || (a >= kShadowGap3Beg && a <= kShadowGap3End); } // In zero-based shadow mode we treat addresses near zero as addresses // in shadow gap as well. if (SHADOW_OFFSET == 0) return a <= kShadowGapEnd; return a >= kShadowGapBeg && a <= kShadowGapEnd; } static inline bool AddrIsInMem(uptr a) { PROFILE_ASAN_MAPPING(); return AddrIsInLowMem(a) || AddrIsInMidMem(a) || AddrIsInHighMem(a) || (flags()->protect_shadow_gap == 0 && AddrIsInShadowGap(a)); } static inline uptr MemToShadow(uptr p) { PROFILE_ASAN_MAPPING(); CHECK(AddrIsInMem(p)); return MEM_TO_SHADOW(p); } static inline bool AddrIsInHighShadow(uptr a) { PROFILE_ASAN_MAPPING(); return a >= kHighShadowBeg && a <= kHighMemEnd; } static inline bool AddrIsInMidShadow(uptr a) { PROFILE_ASAN_MAPPING(); return kMidMemBeg && a >= kMidShadowBeg && a <= kMidMemEnd; } static inline bool AddrIsInShadow(uptr a) { PROFILE_ASAN_MAPPING(); return AddrIsInLowShadow(a) || AddrIsInMidShadow(a) || AddrIsInHighShadow(a); } static inline bool AddrIsAlignedByGranularity(uptr a) { PROFILE_ASAN_MAPPING(); return (a & (SHADOW_GRANULARITY - 1)) == 0; } static inline bool AddressIsPoisoned(uptr a) { PROFILE_ASAN_MAPPING(); const uptr kAccessSize = 1; u8 *shadow_address = (u8*)MEM_TO_SHADOW(a); s8 shadow_value = *shadow_address; if (shadow_value) { u8 last_accessed_byte = (a & (SHADOW_GRANULARITY - 1)) + kAccessSize - 1; return (last_accessed_byte >= shadow_value); } return false; } // Must be after all calls to PROFILE_ASAN_MAPPING(). static const uptr kAsanMappingProfileSize = __LINE__; } // namespace __asan #endif // ASAN_MAPPING_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/scripts/0000775000175000017500000000000013040224626024357 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/scripts/asan_device_setup0000775000175000017500000003052412766076350030007 0ustar mwhudsonmwhudson#!/bin/bash #===- lib/asan/scripts/asan_device_setup -----------------------------------===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # # Prepare Android device to run ASan applications. # #===------------------------------------------------------------------------===# set -e HERE="$(cd "$(dirname "$0")" && pwd)" revert=no extra_options= device= lib= use_su=0 function usage { echo "usage: $0 [--revert] [--device device-id] [--lib path] [--extra-options options]" echo " --revert: Uninstall ASan from the device." echo " --lib: Path to ASan runtime library." echo " --extra-options: Extra ASAN_OPTIONS." echo " --device: Install to the given device. Use 'adb devices' to find" echo " device-id." echo " --use-su: Use 'su -c' prefix for every adb command instead of using" echo " 'adb root' once." echo exit 1 } function adb_push { if [ $use_su -eq 0 ]; then $ADB push "$1" "$2" else local FILENAME=$(basename $1) $ADB push "$1" "/data/local/tmp/$FILENAME" $ADB shell su -c "rm \\\"$2/$FILENAME\\\"" >&/dev/null $ADB shell su -c "cat \\\"/data/local/tmp/$FILENAME\\\" > \\\"$2/$FILENAME\\\"" $ADB shell su -c "rm \\\"/data/local/tmp/$FILENAME\\\"" fi } function adb_remount { if [ $use_su -eq 0 ]; then $ADB remount else local STORAGE=`$ADB shell mount | grep /system | cut -d ' ' -f1` if [ "$STORAGE" != "" ]; then echo Remounting $STORAGE at /system $ADB shell su -c "mount -o remount,rw $STORAGE /system" else echo Failed to get storage device name for "/system" mount point fi fi } function adb_shell { if [ $use_su -eq 0 ]; then $ADB shell $@ else $ADB shell su -c "$*" fi } function adb_root { if [ $use_su -eq 0 ]; then $ADB root fi } function adb_wait_for_device { $ADB wait-for-device } function adb_pull { if [ $use_su -eq 0 ]; then $ADB pull "$1" "$2" else local FILENAME=$(basename $1) $ADB shell rm "/data/local/tmp/$FILENAME" >&/dev/null $ADB shell su -c "[ -f \\\"$1\\\" ] && cat \\\"$1\\\" > \\\"/data/local/tmp/$FILENAME\\\" && chown root.shell \\\"/data/local/tmp/$FILENAME\\\" && chmod 755 \\\"/data/local/tmp/$FILENAME\\\"" && $ADB pull "/data/local/tmp/$FILENAME" "$2" >&/dev/null && $ADB shell "rm \"/data/local/tmp/$FILENAME\"" fi } function get_device_arch { # OUT OUT64 local _outvar=$1 local _outvar64=$2 local _ABI=$(adb_shell getprop ro.product.cpu.abi) local _ARCH= local _ARCH64= if [[ $_ABI == x86* ]]; then _ARCH=i686 elif [[ $_ABI == armeabi* ]]; then _ARCH=arm elif [[ $_ABI == arm64-v8a* ]]; then _ARCH=arm _ARCH64=aarch64 else echo "Unrecognized device ABI: $_ABI" exit 1 fi eval $_outvar=\$_ARCH eval $_outvar64=\$_ARCH64 } while [[ $# > 0 ]]; do case $1 in --revert) revert=yes ;; --extra-options) shift if [[ $# == 0 ]]; then echo "--extra-options requires an argument." exit 1 fi extra_options="$1" ;; --lib) shift if [[ $# == 0 ]]; then echo "--lib requires an argument." exit 1 fi lib="$1" ;; --device) shift if [[ $# == 0 ]]; then echo "--device requires an argument." exit 1 fi device="$1" ;; --use-su) use_su=1 ;; *) usage ;; esac shift done ADB=${ADB:-adb} if [[ x$device != x ]]; then ADB="$ADB -s $device" fi if [ $use_su -eq 1 ]; then # Test if 'su' is present on the device SU_TEST_OUT=`$ADB shell su -c "echo foo" 2>&1 | sed 's/\r$//'` if [ $? != 0 -o "$SU_TEST_OUT" != "foo" ]; then echo "ERROR: Cannot use 'su -c':" echo "$ adb shell su -c \"echo foo\"" echo $SU_TEST_OUT echo "Check that 'su' binary is correctly installed on the device or omit" echo " --use-su flag" exit 1 fi fi echo '>> Remounting /system rw' adb_wait_for_device adb_root adb_wait_for_device adb_remount adb_wait_for_device get_device_arch ARCH ARCH64 echo "Target architecture: $ARCH" ASAN_RT="libclang_rt.asan-$ARCH-android.so" if [[ -n $ARCH64 ]]; then echo "Target architecture: $ARCH64" ASAN_RT64="libclang_rt.asan-$ARCH64-android.so" fi if [[ x$revert == xyes ]]; then echo '>> Uninstalling ASan' if ! adb_shell ls -l /system/bin/app_process | grep -o '\->.*app_process' >&/dev/null; then echo '>> Pre-L device detected.' adb_shell mv /system/bin/app_process.real /system/bin/app_process adb_shell rm /system/bin/asanwrapper elif ! adb_shell ls -l /system/bin/app_process64.real | grep -o 'No such file or directory' >&/dev/null; then # 64-bit installation. adb_shell mv /system/bin/app_process32.real /system/bin/app_process32 adb_shell mv /system/bin/app_process64.real /system/bin/app_process64 adb_shell rm /system/bin/asanwrapper adb_shell rm /system/bin/asanwrapper64 else # 32-bit installation. adb_shell rm /system/bin/app_process.wrap adb_shell rm /system/bin/asanwrapper adb_shell rm /system/bin/app_process adb_shell ln -s /system/bin/app_process32 /system/bin/app_process fi echo '>> Restarting shell' adb_shell stop adb_shell start # Remove the library on the last step to give a chance to the 'su' binary to # be executed without problem. adb_shell rm /system/lib/$ASAN_RT echo '>> Done' exit 0 fi if [[ -d "$lib" ]]; then ASAN_RT_PATH="$lib" elif [[ -f "$lib" && "$lib" == *"$ASAN_RT" ]]; then ASAN_RT_PATH=$(dirname "$lib") elif [[ -f "$HERE/$ASAN_RT" ]]; then ASAN_RT_PATH="$HERE" elif [[ $(basename "$HERE") == "bin" ]]; then # We could be in the toolchain's base directory. # Consider ../lib, ../lib/asan, ../lib/linux, # ../lib/clang/$VERSION/lib/linux, and ../lib64/clang/$VERSION/lib/linux. P=$(ls "$HERE"/../lib/"$ASAN_RT" \ "$HERE"/../lib/asan/"$ASAN_RT" \ "$HERE"/../lib/linux/"$ASAN_RT" \ "$HERE"/../lib/clang/*/lib/linux/"$ASAN_RT" \ "$HERE"/../lib64/clang/*/lib/linux/"$ASAN_RT" 2>/dev/null | sort | tail -1) if [[ -n "$P" ]]; then ASAN_RT_PATH="$(dirname "$P")" fi fi if [[ -z "$ASAN_RT_PATH" || ! -f "$ASAN_RT_PATH/$ASAN_RT" ]]; then echo ">> ASan runtime library not found" exit 1 fi if [[ -n "$ASAN_RT64" ]]; then if [[ -z "$ASAN_RT_PATH" || ! -f "$ASAN_RT_PATH/$ASAN_RT64" ]]; then echo ">> ASan runtime library not found" exit 1 fi fi TMPDIRBASE=$(mktemp -d) TMPDIROLD="$TMPDIRBASE/old" TMPDIR="$TMPDIRBASE/new" mkdir "$TMPDIROLD" RELEASE=$(adb_shell getprop ro.build.version.release) PRE_L=0 if echo "$RELEASE" | grep '^4\.' >&/dev/null; then PRE_L=1 fi if ! adb_shell ls -l /system/bin/app_process | grep -o '\->.*app_process' >&/dev/null; then if adb_pull /system/bin/app_process.real /dev/null >&/dev/null; then echo '>> Old-style ASan installation detected. Reverting.' adb_shell mv /system/bin/app_process.real /system/bin/app_process fi echo '>> Pre-L device detected. Setting up app_process symlink.' adb_shell mv /system/bin/app_process /system/bin/app_process32 adb_shell ln -s /system/bin/app_process32 /system/bin/app_process fi echo '>> Copying files from the device' if [[ -n "$ASAN_RT64" ]]; then adb_pull /system/lib/"$ASAN_RT" "$TMPDIROLD" || true adb_pull /system/lib64/"$ASAN_RT64" "$TMPDIROLD" || true adb_pull /system/bin/app_process32 "$TMPDIROLD" || true adb_pull /system/bin/app_process32.real "$TMPDIROLD" || true adb_pull /system/bin/app_process64 "$TMPDIROLD" || true adb_pull /system/bin/app_process64.real "$TMPDIROLD" || true adb_pull /system/bin/asanwrapper "$TMPDIROLD" || true adb_pull /system/bin/asanwrapper64 "$TMPDIROLD" || true else adb_pull /system/lib/"$ASAN_RT" "$TMPDIROLD" || true adb_pull /system/bin/app_process32 "$TMPDIROLD" || true adb_pull /system/bin/app_process.wrap "$TMPDIROLD" || true adb_pull /system/bin/asanwrapper "$TMPDIROLD" || true fi cp -r "$TMPDIROLD" "$TMPDIR" if [[ -f "$TMPDIR/app_process.wrap" || -f "$TMPDIR/app_process64.real" ]]; then echo ">> Previous installation detected" else echo ">> New installation" fi echo '>> Generating wrappers' cp "$ASAN_RT_PATH/$ASAN_RT" "$TMPDIR/" if [[ -n "$ASAN_RT64" ]]; then cp "$ASAN_RT_PATH/$ASAN_RT64" "$TMPDIR/" fi ASAN_OPTIONS=start_deactivated=1,malloc_context_size=0 function generate_zygote_wrapper { # from, to, asan_rt local _from=$1 local _to=$2 local _asan_rt=$3 if [[ PRE_L -eq 0 ]]; then # LD_PRELOAD parsing is broken in N if it starts with ":". Luckily, it is # unset in the system environment since L. local _ld_preload=$_asan_rt else local _ld_preload=\$LD_PRELOAD:$_asan_rt fi cat <"$TMPDIR/$_from" #!/system/bin/sh-from-zygote ASAN_OPTIONS=$ASAN_OPTIONS \\ ASAN_ACTIVATION_OPTIONS=include_if_exists=/data/local/tmp/asan.options.%b \\ LD_PRELOAD=$_ld_preload \\ exec $_to \$@ EOF } # On Android-L not allowing user segv handler breaks some applications. if [[ PRE_L -eq 0 ]]; then ASAN_OPTIONS="$ASAN_OPTIONS,allow_user_segv_handler=1" fi if [[ x$extra_options != x ]] ; then ASAN_OPTIONS="$ASAN_OPTIONS,$extra_options" fi # Zygote wrapper. if [[ -f "$TMPDIR/app_process64" ]]; then # A 64-bit device. if [[ ! -f "$TMPDIR/app_process64.real" ]]; then # New installation. mv "$TMPDIR/app_process32" "$TMPDIR/app_process32.real" mv "$TMPDIR/app_process64" "$TMPDIR/app_process64.real" fi generate_zygote_wrapper "app_process32" "/system/bin/app_process32.real" "$ASAN_RT" generate_zygote_wrapper "app_process64" "/system/bin/app_process64.real" "$ASAN_RT64" else # A 32-bit device. generate_zygote_wrapper "app_process.wrap" "/system/bin/app_process32" "$ASAN_RT" fi # General command-line tool wrapper (use for anything that's not started as # zygote). cat <"$TMPDIR/asanwrapper" #!/system/bin/sh LD_PRELOAD=$ASAN_RT \\ exec \$@ EOF if [[ -n "$ASAN_RT64" ]]; then cat <"$TMPDIR/asanwrapper64" #!/system/bin/sh LD_PRELOAD=$ASAN_RT64 \\ exec \$@ EOF fi function install { # from, to, chmod, chcon local _from=$1 local _to=$2 local _mode=$3 local _context=$4 local _basename="$(basename "$_from")" echo "Installing $_to/$_basename $_mode $_context" adb_push "$_from" "$_to/$_basename" adb_shell chown root.shell "$_to/$_basename" if [[ -n "$_mode" ]]; then adb_shell chmod "$_mode" "$_to/$_basename" fi if [[ -n "$_context" ]]; then adb_shell chcon "$_context" "$_to/$_basename" fi } if ! ( cd "$TMPDIRBASE" && diff -qr old/ new/ ) ; then # Make SELinux happy by keeping app_process wrapper and the shell # it runs on in zygote domain. ENFORCING=0 if adb_shell getenforce | grep Enforcing >/dev/null; then # Sometimes shell is not allowed to change file contexts. # Temporarily switch to permissive. ENFORCING=1 adb_shell setenforce 0 fi if [[ PRE_L -eq 1 ]]; then CTX=u:object_r:system_file:s0 else CTX=u:object_r:zygote_exec:s0 fi echo '>> Pushing files to the device' if [[ -n "$ASAN_RT64" ]]; then install "$TMPDIR/$ASAN_RT" /system/lib 644 install "$TMPDIR/$ASAN_RT64" /system/lib64 644 install "$TMPDIR/app_process32" /system/bin 755 $CTX install "$TMPDIR/app_process32.real" /system/bin 755 $CTX install "$TMPDIR/app_process64" /system/bin 755 $CTX install "$TMPDIR/app_process64.real" /system/bin 755 $CTX install "$TMPDIR/asanwrapper" /system/bin 755 install "$TMPDIR/asanwrapper64" /system/bin 755 else install "$TMPDIR/$ASAN_RT" /system/lib 644 install "$TMPDIR/app_process32" /system/bin 755 $CTX install "$TMPDIR/app_process.wrap" /system/bin 755 $CTX install "$TMPDIR/asanwrapper" /system/bin 755 $CTX adb_shell rm /system/bin/app_process adb_shell ln -s /system/bin/app_process.wrap /system/bin/app_process fi adb_shell cp /system/bin/sh /system/bin/sh-from-zygote adb_shell chcon $CTX /system/bin/sh-from-zygote if [ $ENFORCING == 1 ]; then adb_shell setenforce 1 fi echo '>> Restarting shell (asynchronous)' adb_shell stop adb_shell start echo '>> Please wait until the device restarts' else echo '>> Device is up to date' fi rm -r "$TMPDIRBASE" golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/scripts/CMakeLists.txt0000664000175000017500000000015312303575104027117 0ustar mwhudsonmwhudsonif(ANDROID) add_compiler_rt_script(asan_device_setup) add_dependencies(asan asan_device_setup) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/scripts/asan_symbolize.py0000775000175000017500000004133612640576342027774 0ustar mwhudsonmwhudson#!/usr/bin/env python #===- lib/asan/scripts/asan_symbolize.py -----------------------------------===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===------------------------------------------------------------------------===# import argparse import bisect import getopt import os import re import subprocess import sys symbolizers = {} DEBUG = False demangle = False binutils_prefix = None sysroot_path = None binary_name_filter = None fix_filename_patterns = None logfile = sys.stdin allow_system_symbolizer = True # FIXME: merge the code that calls fix_filename(). def fix_filename(file_name): if fix_filename_patterns: for path_to_cut in fix_filename_patterns: file_name = re.sub('.*' + path_to_cut, '', file_name) file_name = re.sub('.*asan_[a-z_]*.cc:[0-9]*', '_asan_rtl_', file_name) file_name = re.sub('.*crtstuff.c:0', '???:0', file_name) return file_name def sysroot_path_filter(binary_name): return sysroot_path + binary_name def guess_arch(addr): # Guess which arch we're running. 10 = len('0x') + 8 hex digits. if len(addr) > 10: return 'x86_64' else: return 'i386' class Symbolizer(object): def __init__(self): pass def symbolize(self, addr, binary, offset): """Symbolize the given address (pair of binary and offset). Overriden in subclasses. Args: addr: virtual address of an instruction. binary: path to executable/shared object containing this instruction. offset: instruction offset in the @binary. Returns: list of strings (one string for each inlined frame) describing the code locations for this instruction (that is, function name, file name, line and column numbers). """ return None class LLVMSymbolizer(Symbolizer): def __init__(self, symbolizer_path, default_arch, system, dsym_hints=[]): super(LLVMSymbolizer, self).__init__() self.symbolizer_path = symbolizer_path self.default_arch = default_arch self.system = system self.dsym_hints = dsym_hints self.pipe = self.open_llvm_symbolizer() def open_llvm_symbolizer(self): cmd = [self.symbolizer_path, '--use-symbol-table=true', '--demangle=%s' % demangle, '--functions=linkage', '--inlining=true', '--default-arch=%s' % self.default_arch] if self.system == 'Darwin': for hint in self.dsym_hints: cmd.append('--dsym-hint=%s' % hint) if DEBUG: print ' '.join(cmd) try: result = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) except OSError: result = None return result def symbolize(self, addr, binary, offset): """Overrides Symbolizer.symbolize.""" if not self.pipe: return None result = [] try: symbolizer_input = '"%s" %s' % (binary, offset) if DEBUG: print symbolizer_input print >> self.pipe.stdin, symbolizer_input while True: function_name = self.pipe.stdout.readline().rstrip() if not function_name: break file_name = self.pipe.stdout.readline().rstrip() file_name = fix_filename(file_name) if (not function_name.startswith('??') or not file_name.startswith('??')): # Append only non-trivial frames. result.append('%s in %s %s' % (addr, function_name, file_name)) except Exception: result = [] if not result: result = None return result def LLVMSymbolizerFactory(system, default_arch, dsym_hints=[]): symbolizer_path = os.getenv('LLVM_SYMBOLIZER_PATH') if not symbolizer_path: symbolizer_path = os.getenv('ASAN_SYMBOLIZER_PATH') if not symbolizer_path: # Assume llvm-symbolizer is in PATH. symbolizer_path = 'llvm-symbolizer' return LLVMSymbolizer(symbolizer_path, default_arch, system, dsym_hints) class Addr2LineSymbolizer(Symbolizer): def __init__(self, binary): super(Addr2LineSymbolizer, self).__init__() self.binary = binary self.pipe = self.open_addr2line() self.output_terminator = -1 def open_addr2line(self): addr2line_tool = 'addr2line' if binutils_prefix: addr2line_tool = binutils_prefix + addr2line_tool cmd = [addr2line_tool, '-fi'] if demangle: cmd += ['--demangle'] cmd += ['-e', self.binary] if DEBUG: print ' '.join(cmd) return subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) def symbolize(self, addr, binary, offset): """Overrides Symbolizer.symbolize.""" if self.binary != binary: return None lines = [] try: print >> self.pipe.stdin, offset print >> self.pipe.stdin, self.output_terminator is_first_frame = True while True: function_name = self.pipe.stdout.readline().rstrip() file_name = self.pipe.stdout.readline().rstrip() if is_first_frame: is_first_frame = False elif function_name in ['', '??']: assert file_name == function_name break lines.append((function_name, file_name)); except Exception: lines.append(('??', '??:0')) return ['%s in %s %s' % (addr, function, fix_filename(file)) for (function, file) in lines] class UnbufferedLineConverter(object): """ Wrap a child process that responds to each line of input with one line of output. Uses pty to trick the child into providing unbuffered output. """ def __init__(self, args, close_stderr=False): # Local imports so that the script can start on Windows. import pty import termios pid, fd = pty.fork() if pid == 0: # We're the child. Transfer control to command. if close_stderr: dev_null = os.open('/dev/null', 0) os.dup2(dev_null, 2) os.execvp(args[0], args) else: # Disable echoing. attr = termios.tcgetattr(fd) attr[3] = attr[3] & ~termios.ECHO termios.tcsetattr(fd, termios.TCSANOW, attr) # Set up a file()-like interface to the child process self.r = os.fdopen(fd, "r", 1) self.w = os.fdopen(os.dup(fd), "w", 1) def convert(self, line): self.w.write(line + "\n") return self.readline() def readline(self): return self.r.readline().rstrip() class DarwinSymbolizer(Symbolizer): def __init__(self, addr, binary): super(DarwinSymbolizer, self).__init__() self.binary = binary self.arch = guess_arch(addr) self.open_atos() def open_atos(self): if DEBUG: print 'atos -o %s -arch %s' % (self.binary, self.arch) cmdline = ['atos', '-o', self.binary, '-arch', self.arch] self.atos = UnbufferedLineConverter(cmdline, close_stderr=True) def symbolize(self, addr, binary, offset): """Overrides Symbolizer.symbolize.""" if self.binary != binary: return None atos_line = self.atos.convert('0x%x' % int(offset, 16)) while "got symbolicator for" in atos_line: atos_line = self.atos.readline() # A well-formed atos response looks like this: # foo(type1, type2) (in object.name) (filename.cc:80) match = re.match('^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line) if DEBUG: print 'atos_line: ', atos_line if match: function_name = match.group(1) function_name = re.sub('\(.*?\)', '', function_name) file_name = fix_filename(match.group(3)) return ['%s in %s %s' % (addr, function_name, file_name)] else: return ['%s in %s' % (addr, atos_line)] # Chain several symbolizers so that if one symbolizer fails, we fall back # to the next symbolizer in chain. class ChainSymbolizer(Symbolizer): def __init__(self, symbolizer_list): super(ChainSymbolizer, self).__init__() self.symbolizer_list = symbolizer_list def symbolize(self, addr, binary, offset): """Overrides Symbolizer.symbolize.""" for symbolizer in self.symbolizer_list: if symbolizer: result = symbolizer.symbolize(addr, binary, offset) if result: return result return None def append_symbolizer(self, symbolizer): self.symbolizer_list.append(symbolizer) def BreakpadSymbolizerFactory(binary): suffix = os.getenv('BREAKPAD_SUFFIX') if suffix: filename = binary + suffix if os.access(filename, os.F_OK): return BreakpadSymbolizer(filename) return None def SystemSymbolizerFactory(system, addr, binary): if system == 'Darwin': return DarwinSymbolizer(addr, binary) elif system == 'Linux' or system == 'FreeBSD': return Addr2LineSymbolizer(binary) class BreakpadSymbolizer(Symbolizer): def __init__(self, filename): super(BreakpadSymbolizer, self).__init__() self.filename = filename lines = file(filename).readlines() self.files = [] self.symbols = {} self.address_list = [] self.addresses = {} # MODULE mac x86_64 A7001116478B33F18FF9BEDE9F615F190 t fragments = lines[0].rstrip().split() self.arch = fragments[2] self.debug_id = fragments[3] self.binary = ' '.join(fragments[4:]) self.parse_lines(lines[1:]) def parse_lines(self, lines): cur_function_addr = '' for line in lines: fragments = line.split() if fragments[0] == 'FILE': assert int(fragments[1]) == len(self.files) self.files.append(' '.join(fragments[2:])) elif fragments[0] == 'PUBLIC': self.symbols[int(fragments[1], 16)] = ' '.join(fragments[3:]) elif fragments[0] in ['CFI', 'STACK']: pass elif fragments[0] == 'FUNC': cur_function_addr = int(fragments[1], 16) if not cur_function_addr in self.symbols.keys(): self.symbols[cur_function_addr] = ' '.join(fragments[4:]) else: # Line starting with an address. addr = int(fragments[0], 16) self.address_list.append(addr) # Tuple of symbol address, size, line, file number. self.addresses[addr] = (cur_function_addr, int(fragments[1], 16), int(fragments[2]), int(fragments[3])) self.address_list.sort() def get_sym_file_line(self, addr): key = None if addr in self.addresses.keys(): key = addr else: index = bisect.bisect_left(self.address_list, addr) if index == 0: return None else: key = self.address_list[index - 1] sym_id, size, line_no, file_no = self.addresses[key] symbol = self.symbols[sym_id] filename = self.files[file_no] if addr < key + size: return symbol, filename, line_no else: return None def symbolize(self, addr, binary, offset): if self.binary != binary: return None res = self.get_sym_file_line(int(offset, 16)) if res: function_name, file_name, line_no = res result = ['%s in %s %s:%d' % ( addr, function_name, file_name, line_no)] print result return result else: return None class SymbolizationLoop(object): def __init__(self, binary_name_filter=None, dsym_hint_producer=None): if sys.platform == 'win32': # ASan on Windows uses dbghelp.dll to symbolize in-process, which works # even in sandboxed processes. Nothing needs to be done here. self.process_line = self.process_line_echo else: # Used by clients who may want to supply a different binary name. # E.g. in Chrome several binaries may share a single .dSYM. self.binary_name_filter = binary_name_filter self.dsym_hint_producer = dsym_hint_producer self.system = os.uname()[0] if self.system not in ['Linux', 'Darwin', 'FreeBSD']: raise Exception('Unknown system') self.llvm_symbolizers = {} self.last_llvm_symbolizer = None self.dsym_hints = set([]) self.frame_no = 0 self.process_line = self.process_line_posix def symbolize_address(self, addr, binary, offset): # On non-Darwin (i.e. on platforms without .dSYM debug info) always use # a single symbolizer binary. # On Darwin, if the dsym hint producer is present: # 1. check whether we've seen this binary already; if so, # use |llvm_symbolizers[binary]|, which has already loaded the debug # info for this binary (might not be the case for # |last_llvm_symbolizer|); # 2. otherwise check if we've seen all the hints for this binary already; # if so, reuse |last_llvm_symbolizer| which has the full set of hints; # 3. otherwise create a new symbolizer and pass all currently known # .dSYM hints to it. if not binary in self.llvm_symbolizers: use_new_symbolizer = True if self.system == 'Darwin' and self.dsym_hint_producer: dsym_hints_for_binary = set(self.dsym_hint_producer(binary)) use_new_symbolizer = bool(dsym_hints_for_binary - self.dsym_hints) self.dsym_hints |= dsym_hints_for_binary if self.last_llvm_symbolizer and not use_new_symbolizer: self.llvm_symbolizers[binary] = self.last_llvm_symbolizer else: self.last_llvm_symbolizer = LLVMSymbolizerFactory( self.system, guess_arch(addr), self.dsym_hints) self.llvm_symbolizers[binary] = self.last_llvm_symbolizer # Use the chain of symbolizers: # Breakpad symbolizer -> LLVM symbolizer -> addr2line/atos # (fall back to next symbolizer if the previous one fails). if not binary in symbolizers: symbolizers[binary] = ChainSymbolizer( [BreakpadSymbolizerFactory(binary), self.llvm_symbolizers[binary]]) result = symbolizers[binary].symbolize(addr, binary, offset) if result is None: if not allow_system_symbolizer: raise Exception('Failed to launch or use llvm-symbolizer.') # Initialize system symbolizer only if other symbolizers failed. symbolizers[binary].append_symbolizer( SystemSymbolizerFactory(self.system, addr, binary)) result = symbolizers[binary].symbolize(addr, binary, offset) # The system symbolizer must produce some result. assert result return result def get_symbolized_lines(self, symbolized_lines): if not symbolized_lines: return [self.current_line] else: result = [] for symbolized_frame in symbolized_lines: result.append(' #%s %s' % (str(self.frame_no), symbolized_frame.rstrip())) self.frame_no += 1 return result def process_logfile(self): self.frame_no = 0 for line in logfile: processed = self.process_line(line) print '\n'.join(processed) def process_line_echo(self, line): return [line.rstrip()] def process_line_posix(self, line): self.current_line = line.rstrip() #0 0x7f6e35cf2e45 (/blah/foo.so+0x11fe45) stack_trace_line_format = ( '^( *#([0-9]+) *)(0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)') match = re.match(stack_trace_line_format, line) if not match: return [self.current_line] if DEBUG: print line _, frameno_str, addr, binary, offset = match.groups() if frameno_str == '0': # Assume that frame #0 is the first frame of new stack trace. self.frame_no = 0 original_binary = binary if self.binary_name_filter: binary = self.binary_name_filter(binary) symbolized_line = self.symbolize_address(addr, binary, offset) if not symbolized_line: if original_binary != binary: symbolized_line = self.symbolize_address(addr, binary, offset) return self.get_symbolized_lines(symbolized_line) if __name__ == '__main__': parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description='ASan symbolization script', epilog='Example of use:\n' 'asan_symbolize.py -c "$HOME/opt/cross/bin/arm-linux-gnueabi-" ' '-s "$HOME/SymbolFiles" < asan.log') parser.add_argument('path_to_cut', nargs='*', help='pattern to be cut from the result file path ') parser.add_argument('-d','--demangle', action='store_true', help='demangle function names') parser.add_argument('-s', metavar='SYSROOT', help='set path to sysroot for sanitized binaries') parser.add_argument('-c', metavar='CROSS_COMPILE', help='set prefix for binutils') parser.add_argument('-l','--logfile', default=sys.stdin, type=argparse.FileType('r'), help='set log file name to parse, default is stdin') args = parser.parse_args() if args.path_to_cut: fix_filename_patterns = args.path_to_cut if args.demangle: demangle = True if args.s: binary_name_filter = sysroot_path_filter sysroot_path = args.s if args.c: binutils_prefix = args.c if args.logfile: logfile = args.logfile else: logfile = sys.stdin loop = SymbolizationLoop(binary_name_filter) loop.process_logfile() golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_debugging.cc0000664000175000017500000001123212764617350026147 0ustar mwhudsonmwhudson//===-- asan_debugging.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This file contains various functions that are generally useful to call when // using a debugger (LLDB, GDB). //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_descriptions.h" #include "asan_flags.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_report.h" #include "asan_thread.h" namespace { using namespace __asan; static void FindInfoForStackVar(uptr addr, const char *frame_descr, uptr offset, char *name, uptr name_size, uptr ®ion_address, uptr ®ion_size) { InternalMmapVector vars(16); if (!ParseFrameDescription(frame_descr, &vars)) { return; } for (uptr i = 0; i < vars.size(); i++) { if (offset <= vars[i].beg + vars[i].size) { // We use name_len + 1 because strlcpy will guarantee a \0 at the end, so // if we're limiting the copy due to name_len, we add 1 to ensure we copy // the whole name and then terminate with '\0'. internal_strlcpy(name, vars[i].name_pos, Min(name_size, vars[i].name_len + 1)); region_address = addr - (offset - vars[i].beg); region_size = vars[i].size; return; } } } uptr AsanGetStack(uptr addr, uptr *trace, u32 size, u32 *thread_id, bool alloc_stack) { AsanChunkView chunk = FindHeapChunkByAddress(addr); if (!chunk.IsValid()) return 0; StackTrace stack(nullptr, 0); if (alloc_stack) { if (chunk.AllocTid() == kInvalidTid) return 0; stack = chunk.GetAllocStack(); if (thread_id) *thread_id = chunk.AllocTid(); } else { if (chunk.FreeTid() == kInvalidTid) return 0; stack = chunk.GetFreeStack(); if (thread_id) *thread_id = chunk.FreeTid(); } if (trace && size) { size = Min(size, Min(stack.size, kStackTraceMax)); for (uptr i = 0; i < size; i++) trace[i] = StackTrace::GetPreviousInstructionPc(stack.trace[i]); return size; } return 0; } } // namespace SANITIZER_INTERFACE_ATTRIBUTE const char *__asan_locate_address(uptr addr, char *name, uptr name_size, uptr *region_address_ptr, uptr *region_size_ptr) { AddressDescription descr(addr); uptr region_address = 0; uptr region_size = 0; const char *region_kind = nullptr; if (name && name_size > 0) name[0] = 0; if (auto shadow = descr.AsShadow()) { // region_{address,size} are already 0 switch (shadow->kind) { case kShadowKindLow: region_kind = "low shadow"; break; case kShadowKindGap: region_kind = "shadow gap"; break; case kShadowKindHigh: region_kind = "high shadow"; break; } } else if (auto heap = descr.AsHeap()) { region_kind = "heap"; region_address = heap->chunk_access.chunk_begin; region_size = heap->chunk_access.chunk_size; } else if (auto stack = descr.AsStack()) { region_kind = "stack"; if (!stack->frame_descr) { // region_{address,size} are already 0 } else { FindInfoForStackVar(addr, stack->frame_descr, stack->offset, name, name_size, region_address, region_size); } } else if (auto global = descr.AsGlobal()) { region_kind = "global"; auto &g = global->globals[0]; internal_strlcpy(name, g.name, name_size); region_address = g.beg; region_size = g.size; } else { // region_{address,size} are already 0 region_kind = "heap-invalid"; } CHECK(region_kind); if (region_address_ptr) *region_address_ptr = region_address; if (region_size_ptr) *region_size_ptr = region_size; return region_kind; } SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_alloc_stack(uptr addr, uptr *trace, uptr size, u32 *thread_id) { return AsanGetStack(addr, trace, size, thread_id, /* alloc_stack */ true); } SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_free_stack(uptr addr, uptr *trace, uptr size, u32 *thread_id) { return AsanGetStack(addr, trace, size, thread_id, /* alloc_stack */ false); } SANITIZER_INTERFACE_ATTRIBUTE void __asan_get_shadow_mapping(uptr *shadow_scale, uptr *shadow_offset) { if (shadow_scale) *shadow_scale = SHADOW_SCALE; if (shadow_offset) *shadow_offset = SHADOW_OFFSET; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_rtl.cc0000664000175000017500000006410212777535125025024 0ustar mwhudsonmwhudson//===-- asan_rtl.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Main file of the ASan run-time library. //===----------------------------------------------------------------------===// #include "asan_activation.h" #include "asan_allocator.h" #include "asan_interceptors.h" #include "asan_interface_internal.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_poisoning.h" #include "asan_report.h" #include "asan_stack.h" #include "asan_stats.h" #include "asan_suppressions.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include "lsan/lsan_common.h" #include "ubsan/ubsan_init.h" #include "ubsan/ubsan_platform.h" uptr __asan_shadow_memory_dynamic_address; // Global interface symbol. int __asan_option_detect_stack_use_after_return; // Global interface symbol. uptr *__asan_test_only_reported_buggy_pointer; // Used only for testing asan. namespace __asan { uptr AsanMappingProfile[kAsanMappingProfileSize]; static void AsanDie() { static atomic_uint32_t num_calls; if (atomic_fetch_add(&num_calls, 1, memory_order_relaxed) != 0) { // Don't die twice - run a busy loop. while (1) { } } if (flags()->sleep_before_dying) { Report("Sleeping for %d second(s)\n", flags()->sleep_before_dying); SleepForSeconds(flags()->sleep_before_dying); } if (flags()->unmap_shadow_on_exit) { if (kMidMemBeg) { UnmapOrDie((void*)kLowShadowBeg, kMidMemBeg - kLowShadowBeg); UnmapOrDie((void*)kMidMemEnd, kHighShadowEnd - kMidMemEnd); } else { UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg); } } } static void AsanCheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) { Report("AddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n", file, line, cond, (uptr)v1, (uptr)v2); // FIXME: check for infinite recursion without a thread-local counter here. PRINT_CURRENT_STACK_CHECK(); Die(); } // -------------------------- Globals --------------------- {{{1 int asan_inited; bool asan_init_is_running; #if !ASAN_FIXED_MAPPING uptr kHighMemEnd, kMidMemBeg, kMidMemEnd; #endif // -------------------------- Misc ---------------- {{{1 void ShowStatsAndAbort() { __asan_print_accumulated_stats(); Die(); } // ---------------------- mmap -------------------- {{{1 // Reserve memory range [beg, end]. // We need to use inclusive range because end+1 may not be representable. void ReserveShadowMemoryRange(uptr beg, uptr end, const char *name) { CHECK_EQ((beg % GetMmapGranularity()), 0); CHECK_EQ(((end + 1) % GetMmapGranularity()), 0); uptr size = end - beg + 1; DecreaseTotalMmap(size); // Don't count the shadow against mmap_limit_mb. void *res = MmapFixedNoReserve(beg, size, name); if (res != (void*)beg) { Report("ReserveShadowMemoryRange failed while trying to map 0x%zx bytes. " "Perhaps you're using ulimit -v\n", size); Abort(); } if (common_flags()->no_huge_pages_for_shadow) NoHugePagesInRegion(beg, size); if (common_flags()->use_madv_dontdump) DontDumpShadowMemory(beg, size); } // --------------- LowLevelAllocateCallbac ---------- {{{1 static void OnLowLevelAllocate(uptr ptr, uptr size) { PoisonShadow(ptr, size, kAsanInternalHeapMagic); } // -------------------------- Run-time entry ------------------- {{{1 // exported functions #define ASAN_REPORT_ERROR(type, is_write, size) \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_report_ ## type ## size(uptr addr) { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, 0, true); \ } \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_report_exp_ ## type ## size(uptr addr, u32 exp) { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, exp, true); \ } \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_report_ ## type ## size ## _noabort(uptr addr) { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, 0, false); \ } \ ASAN_REPORT_ERROR(load, false, 1) ASAN_REPORT_ERROR(load, false, 2) ASAN_REPORT_ERROR(load, false, 4) ASAN_REPORT_ERROR(load, false, 8) ASAN_REPORT_ERROR(load, false, 16) ASAN_REPORT_ERROR(store, true, 1) ASAN_REPORT_ERROR(store, true, 2) ASAN_REPORT_ERROR(store, true, 4) ASAN_REPORT_ERROR(store, true, 8) ASAN_REPORT_ERROR(store, true, 16) #define ASAN_REPORT_ERROR_N(type, is_write) \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_report_ ## type ## _n(uptr addr, uptr size) { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, 0, true); \ } \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_report_exp_ ## type ## _n(uptr addr, uptr size, u32 exp) { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, exp, true); \ } \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_report_ ## type ## _n_noabort(uptr addr, uptr size) { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, 0, false); \ } \ ASAN_REPORT_ERROR_N(load, false) ASAN_REPORT_ERROR_N(store, true) #define ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, exp_arg, fatal) \ uptr sp = MEM_TO_SHADOW(addr); \ uptr s = size <= SHADOW_GRANULARITY ? *reinterpret_cast(sp) \ : *reinterpret_cast(sp); \ if (UNLIKELY(s)) { \ if (UNLIKELY(size >= SHADOW_GRANULARITY || \ ((s8)((addr & (SHADOW_GRANULARITY - 1)) + size - 1)) >= \ (s8)s)) { \ if (__asan_test_only_reported_buggy_pointer) { \ *__asan_test_only_reported_buggy_pointer = addr; \ } else { \ GET_CALLER_PC_BP_SP; \ ReportGenericError(pc, bp, sp, addr, is_write, size, exp_arg, \ fatal); \ } \ } \ } #define ASAN_MEMORY_ACCESS_CALLBACK(type, is_write, size) \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_##type##size(uptr addr) { \ ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, 0, true) \ } \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_exp_##type##size(uptr addr, u32 exp) { \ ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, exp, true) \ } \ extern "C" NOINLINE INTERFACE_ATTRIBUTE \ void __asan_##type##size ## _noabort(uptr addr) { \ ASAN_MEMORY_ACCESS_CALLBACK_BODY(type, is_write, size, 0, false) \ } \ ASAN_MEMORY_ACCESS_CALLBACK(load, false, 1) ASAN_MEMORY_ACCESS_CALLBACK(load, false, 2) ASAN_MEMORY_ACCESS_CALLBACK(load, false, 4) ASAN_MEMORY_ACCESS_CALLBACK(load, false, 8) ASAN_MEMORY_ACCESS_CALLBACK(load, false, 16) ASAN_MEMORY_ACCESS_CALLBACK(store, true, 1) ASAN_MEMORY_ACCESS_CALLBACK(store, true, 2) ASAN_MEMORY_ACCESS_CALLBACK(store, true, 4) ASAN_MEMORY_ACCESS_CALLBACK(store, true, 8) ASAN_MEMORY_ACCESS_CALLBACK(store, true, 16) extern "C" NOINLINE INTERFACE_ATTRIBUTE void __asan_loadN(uptr addr, uptr size) { if (__asan_region_is_poisoned(addr, size)) { GET_CALLER_PC_BP_SP; ReportGenericError(pc, bp, sp, addr, false, size, 0, true); } } extern "C" NOINLINE INTERFACE_ATTRIBUTE void __asan_exp_loadN(uptr addr, uptr size, u32 exp) { if (__asan_region_is_poisoned(addr, size)) { GET_CALLER_PC_BP_SP; ReportGenericError(pc, bp, sp, addr, false, size, exp, true); } } extern "C" NOINLINE INTERFACE_ATTRIBUTE void __asan_loadN_noabort(uptr addr, uptr size) { if (__asan_region_is_poisoned(addr, size)) { GET_CALLER_PC_BP_SP; ReportGenericError(pc, bp, sp, addr, false, size, 0, false); } } extern "C" NOINLINE INTERFACE_ATTRIBUTE void __asan_storeN(uptr addr, uptr size) { if (__asan_region_is_poisoned(addr, size)) { GET_CALLER_PC_BP_SP; ReportGenericError(pc, bp, sp, addr, true, size, 0, true); } } extern "C" NOINLINE INTERFACE_ATTRIBUTE void __asan_exp_storeN(uptr addr, uptr size, u32 exp) { if (__asan_region_is_poisoned(addr, size)) { GET_CALLER_PC_BP_SP; ReportGenericError(pc, bp, sp, addr, true, size, exp, true); } } extern "C" NOINLINE INTERFACE_ATTRIBUTE void __asan_storeN_noabort(uptr addr, uptr size) { if (__asan_region_is_poisoned(addr, size)) { GET_CALLER_PC_BP_SP; ReportGenericError(pc, bp, sp, addr, true, size, 0, false); } } // Force the linker to keep the symbols for various ASan interface functions. // We want to keep those in the executable in order to let the instrumented // dynamic libraries access the symbol even if it is not used by the executable // itself. This should help if the build system is removing dead code at link // time. static NOINLINE void force_interface_symbols() { volatile int fake_condition = 0; // prevent dead condition elimination. // __asan_report_* functions are noreturn, so we need a switch to prevent // the compiler from removing any of them. // clang-format off switch (fake_condition) { case 1: __asan_report_load1(0); break; case 2: __asan_report_load2(0); break; case 3: __asan_report_load4(0); break; case 4: __asan_report_load8(0); break; case 5: __asan_report_load16(0); break; case 6: __asan_report_load_n(0, 0); break; case 7: __asan_report_store1(0); break; case 8: __asan_report_store2(0); break; case 9: __asan_report_store4(0); break; case 10: __asan_report_store8(0); break; case 11: __asan_report_store16(0); break; case 12: __asan_report_store_n(0, 0); break; case 13: __asan_report_exp_load1(0, 0); break; case 14: __asan_report_exp_load2(0, 0); break; case 15: __asan_report_exp_load4(0, 0); break; case 16: __asan_report_exp_load8(0, 0); break; case 17: __asan_report_exp_load16(0, 0); break; case 18: __asan_report_exp_load_n(0, 0, 0); break; case 19: __asan_report_exp_store1(0, 0); break; case 20: __asan_report_exp_store2(0, 0); break; case 21: __asan_report_exp_store4(0, 0); break; case 22: __asan_report_exp_store8(0, 0); break; case 23: __asan_report_exp_store16(0, 0); break; case 24: __asan_report_exp_store_n(0, 0, 0); break; case 25: __asan_register_globals(nullptr, 0); break; case 26: __asan_unregister_globals(nullptr, 0); break; case 27: __asan_set_death_callback(nullptr); break; case 28: __asan_set_error_report_callback(nullptr); break; case 29: __asan_handle_no_return(); break; case 30: __asan_address_is_poisoned(nullptr); break; case 31: __asan_poison_memory_region(nullptr, 0); break; case 32: __asan_unpoison_memory_region(nullptr, 0); break; case 34: __asan_before_dynamic_init(nullptr); break; case 35: __asan_after_dynamic_init(); break; case 36: __asan_poison_stack_memory(0, 0); break; case 37: __asan_unpoison_stack_memory(0, 0); break; case 38: __asan_region_is_poisoned(0, 0); break; case 39: __asan_describe_address(0); break; case 40: __asan_set_shadow_00(0, 0); break; case 41: __asan_set_shadow_f1(0, 0); break; case 42: __asan_set_shadow_f2(0, 0); break; case 43: __asan_set_shadow_f3(0, 0); break; case 44: __asan_set_shadow_f5(0, 0); break; case 45: __asan_set_shadow_f8(0, 0); break; } // clang-format on } static void asan_atexit() { Printf("AddressSanitizer exit stats:\n"); __asan_print_accumulated_stats(); // Print AsanMappingProfile. for (uptr i = 0; i < kAsanMappingProfileSize; i++) { if (AsanMappingProfile[i] == 0) continue; Printf("asan_mapping.h:%zd -- %zd\n", i, AsanMappingProfile[i]); } } static void InitializeHighMemEnd() { #if !ASAN_FIXED_MAPPING kHighMemEnd = GetMaxVirtualAddress(); // Increase kHighMemEnd to make sure it's properly // aligned together with kHighMemBeg: kHighMemEnd |= SHADOW_GRANULARITY * GetMmapGranularity() - 1; #endif // !ASAN_FIXED_MAPPING CHECK_EQ((kHighMemBeg % GetMmapGranularity()), 0); } static void ProtectGap(uptr addr, uptr size) { if (!flags()->protect_shadow_gap) { // The shadow gap is unprotected, so there is a chance that someone // is actually using this memory. Which means it needs a shadow... uptr GapShadowBeg = RoundDownTo(MEM_TO_SHADOW(addr), GetPageSizeCached()); uptr GapShadowEnd = RoundUpTo(MEM_TO_SHADOW(addr + size), GetPageSizeCached()) - 1; if (Verbosity()) Printf("protect_shadow_gap=0:" " not protecting shadow gap, allocating gap's shadow\n" "|| `[%p, %p]` || ShadowGap's shadow ||\n", GapShadowBeg, GapShadowEnd); ReserveShadowMemoryRange(GapShadowBeg, GapShadowEnd, "unprotected gap shadow"); return; } void *res = MmapFixedNoAccess(addr, size, "shadow gap"); if (addr == (uptr)res) return; // A few pages at the start of the address space can not be protected. // But we really want to protect as much as possible, to prevent this memory // being returned as a result of a non-FIXED mmap(). if (addr == kZeroBaseShadowStart) { uptr step = GetMmapGranularity(); while (size > step && addr < kZeroBaseMaxShadowStart) { addr += step; size -= step; void *res = MmapFixedNoAccess(addr, size, "shadow gap"); if (addr == (uptr)res) return; } } Report("ERROR: Failed to protect the shadow gap. " "ASan cannot proceed correctly. ABORTING.\n"); DumpProcessMap(); Die(); } static void PrintAddressSpaceLayout() { Printf("|| `[%p, %p]` || HighMem ||\n", (void*)kHighMemBeg, (void*)kHighMemEnd); Printf("|| `[%p, %p]` || HighShadow ||\n", (void*)kHighShadowBeg, (void*)kHighShadowEnd); if (kMidMemBeg) { Printf("|| `[%p, %p]` || ShadowGap3 ||\n", (void*)kShadowGap3Beg, (void*)kShadowGap3End); Printf("|| `[%p, %p]` || MidMem ||\n", (void*)kMidMemBeg, (void*)kMidMemEnd); Printf("|| `[%p, %p]` || ShadowGap2 ||\n", (void*)kShadowGap2Beg, (void*)kShadowGap2End); Printf("|| `[%p, %p]` || MidShadow ||\n", (void*)kMidShadowBeg, (void*)kMidShadowEnd); } Printf("|| `[%p, %p]` || ShadowGap ||\n", (void*)kShadowGapBeg, (void*)kShadowGapEnd); if (kLowShadowBeg) { Printf("|| `[%p, %p]` || LowShadow ||\n", (void*)kLowShadowBeg, (void*)kLowShadowEnd); Printf("|| `[%p, %p]` || LowMem ||\n", (void*)kLowMemBeg, (void*)kLowMemEnd); } Printf("MemToShadow(shadow): %p %p %p %p", (void*)MEM_TO_SHADOW(kLowShadowBeg), (void*)MEM_TO_SHADOW(kLowShadowEnd), (void*)MEM_TO_SHADOW(kHighShadowBeg), (void*)MEM_TO_SHADOW(kHighShadowEnd)); if (kMidMemBeg) { Printf(" %p %p", (void*)MEM_TO_SHADOW(kMidShadowBeg), (void*)MEM_TO_SHADOW(kMidShadowEnd)); } Printf("\n"); Printf("redzone=%zu\n", (uptr)flags()->redzone); Printf("max_redzone=%zu\n", (uptr)flags()->max_redzone); Printf("quarantine_size_mb=%zuM\n", (uptr)flags()->quarantine_size_mb); Printf("malloc_context_size=%zu\n", (uptr)common_flags()->malloc_context_size); Printf("SHADOW_SCALE: %d\n", (int)SHADOW_SCALE); Printf("SHADOW_GRANULARITY: %d\n", (int)SHADOW_GRANULARITY); Printf("SHADOW_OFFSET: 0x%zx\n", (uptr)SHADOW_OFFSET); CHECK(SHADOW_SCALE >= 3 && SHADOW_SCALE <= 7); if (kMidMemBeg) CHECK(kMidShadowBeg > kLowShadowEnd && kMidMemBeg > kMidShadowEnd && kHighShadowBeg > kMidMemEnd); } static void AsanInitInternal() { if (LIKELY(asan_inited)) return; SanitizerToolName = "AddressSanitizer"; CHECK(!asan_init_is_running && "ASan init calls itself!"); asan_init_is_running = true; CacheBinaryName(); // Initialize flags. This must be done early, because most of the // initialization steps look at flags(). InitializeFlags(); AsanCheckIncompatibleRT(); AsanCheckDynamicRTPrereqs(); AvoidCVE_2016_2143(); SetCanPoisonMemory(flags()->poison_heap); SetMallocContextSize(common_flags()->malloc_context_size); InitializePlatformExceptionHandlers(); InitializeHighMemEnd(); // Make sure we are not statically linked. AsanDoesNotSupportStaticLinkage(); // Install tool-specific callbacks in sanitizer_common. AddDieCallback(AsanDie); SetCheckFailedCallback(AsanCheckFailed); SetPrintfAndReportCallback(AppendToErrorMessageBuffer); __sanitizer_set_report_path(common_flags()->log_path); __asan_option_detect_stack_use_after_return = flags()->detect_stack_use_after_return; // Re-exec ourselves if we need to set additional env or command line args. MaybeReexec(); // Setup internal allocator callback. SetLowLevelAllocateCallback(OnLowLevelAllocate); InitializeAsanInterceptors(); // Enable system log ("adb logcat") on Android. // Doing this before interceptors are initialized crashes in: // AsanInitInternal -> android_log_write -> __interceptor_strcmp AndroidLogInit(); ReplaceSystemMalloc(); // Set the shadow memory address to uninitialized. __asan_shadow_memory_dynamic_address = kDefaultShadowSentinel; uptr shadow_start = kLowShadowBeg; // Detect if a dynamic shadow address must used and find a available location // when necessary. When dynamic address is used, the macro |kLowShadowBeg| // expands to |__asan_shadow_memory_dynamic_address| which is // |kDefaultShadowSentinel|. if (shadow_start == kDefaultShadowSentinel) { __asan_shadow_memory_dynamic_address = 0; CHECK_EQ(0, kLowShadowBeg); uptr granularity = GetMmapGranularity(); uptr alignment = 8 * granularity; uptr left_padding = granularity; uptr space_size = kHighShadowEnd + left_padding; shadow_start = FindAvailableMemoryRange(space_size, alignment, granularity); CHECK_NE((uptr)0, shadow_start); CHECK(IsAligned(shadow_start, alignment)); } // Update the shadow memory address (potentially) used by instrumentation. __asan_shadow_memory_dynamic_address = shadow_start; if (kLowShadowBeg) shadow_start -= GetMmapGranularity(); bool full_shadow_is_available = MemoryRangeIsAvailable(shadow_start, kHighShadowEnd); #if SANITIZER_LINUX && defined(__x86_64__) && defined(_LP64) && \ !ASAN_FIXED_MAPPING if (!full_shadow_is_available) { kMidMemBeg = kLowMemEnd < 0x3000000000ULL ? 0x3000000000ULL : 0; kMidMemEnd = kLowMemEnd < 0x3000000000ULL ? 0x4fffffffffULL : 0; } #endif if (Verbosity()) PrintAddressSpaceLayout(); DisableCoreDumperIfNecessary(); if (full_shadow_is_available) { // mmap the low shadow plus at least one page at the left. if (kLowShadowBeg) ReserveShadowMemoryRange(shadow_start, kLowShadowEnd, "low shadow"); // mmap the high shadow. ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd, "high shadow"); // protect the gap. ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1); CHECK_EQ(kShadowGapEnd, kHighShadowBeg - 1); } else if (kMidMemBeg && MemoryRangeIsAvailable(shadow_start, kMidMemBeg - 1) && MemoryRangeIsAvailable(kMidMemEnd + 1, kHighShadowEnd)) { CHECK(kLowShadowBeg != kLowShadowEnd); // mmap the low shadow plus at least one page at the left. ReserveShadowMemoryRange(shadow_start, kLowShadowEnd, "low shadow"); // mmap the mid shadow. ReserveShadowMemoryRange(kMidShadowBeg, kMidShadowEnd, "mid shadow"); // mmap the high shadow. ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd, "high shadow"); // protect the gaps. ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1); ProtectGap(kShadowGap2Beg, kShadowGap2End - kShadowGap2Beg + 1); ProtectGap(kShadowGap3Beg, kShadowGap3End - kShadowGap3Beg + 1); } else { Report("Shadow memory range interleaves with an existing memory mapping. " "ASan cannot proceed correctly. ABORTING.\n"); Report("ASan shadow was supposed to be located in the [%p-%p] range.\n", shadow_start, kHighShadowEnd); DumpProcessMap(); Die(); } AsanTSDInit(PlatformTSDDtor); InstallDeadlySignalHandlers(AsanOnDeadlySignal); AllocatorOptions allocator_options; allocator_options.SetFrom(flags(), common_flags()); InitializeAllocator(allocator_options); MaybeStartBackgroudThread(); SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback); // On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited // should be set to 1 prior to initializing the threads. asan_inited = 1; asan_init_is_running = false; if (flags()->atexit) Atexit(asan_atexit); InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir); // Now that ASan runtime is (mostly) initialized, deactivate it if // necessary, so that it can be re-activated when requested. if (flags()->start_deactivated) AsanDeactivate(); // interceptors InitTlsSize(); // Create main thread. AsanThread *main_thread = AsanThread::Create( /* start_routine */ nullptr, /* arg */ nullptr, /* parent_tid */ 0, /* stack */ nullptr, /* detached */ true); CHECK_EQ(0, main_thread->tid()); SetCurrentThread(main_thread); main_thread->ThreadStart(internal_getpid(), /* signal_thread_is_registered */ nullptr); force_interface_symbols(); // no-op. SanitizerInitializeUnwinder(); if (CAN_SANITIZE_LEAKS) { __lsan::InitCommonLsan(); if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) { Atexit(__lsan::DoLeakCheck); } } #if CAN_SANITIZE_UB __ubsan::InitAsPlugin(); #endif InitializeSuppressions(); if (CAN_SANITIZE_LEAKS) { // LateInitialize() calls dlsym, which can allocate an error string buffer // in the TLS. Let's ignore the allocation to avoid reporting a leak. __lsan::ScopedInterceptorDisabler disabler; Symbolizer::LateInitialize(); } else { Symbolizer::LateInitialize(); } VReport(1, "AddressSanitizer Init done\n"); } // Initialize as requested from some part of ASan runtime library (interceptors, // allocator, etc). void AsanInitFromRtl() { AsanInitInternal(); } #if ASAN_DYNAMIC // Initialize runtime in case it's LD_PRELOAD-ed into unsanitized executable // (and thus normal initializers from .preinit_array or modules haven't run). class AsanInitializer { public: // NOLINT AsanInitializer() { AsanInitFromRtl(); } }; static AsanInitializer asan_initializer; #endif // ASAN_DYNAMIC } // namespace __asan // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT void NOINLINE __asan_handle_no_return() { if (asan_init_is_running) return; int local_stack; AsanThread *curr_thread = GetCurrentThread(); uptr PageSize = GetPageSizeCached(); uptr top, bottom; if (curr_thread) { top = curr_thread->stack_top(); bottom = ((uptr)&local_stack - PageSize) & ~(PageSize - 1); } else { // If we haven't seen this thread, try asking the OS for stack bounds. uptr tls_addr, tls_size, stack_size; GetThreadStackAndTls(/*main=*/false, &bottom, &stack_size, &tls_addr, &tls_size); top = bottom + stack_size; } static const uptr kMaxExpectedCleanupSize = 64 << 20; // 64M if (top - bottom > kMaxExpectedCleanupSize) { static bool reported_warning = false; if (reported_warning) return; reported_warning = true; Report("WARNING: ASan is ignoring requested __asan_handle_no_return: " "stack top: %p; bottom %p; size: %p (%zd)\n" "False positive error reports may follow\n" "For details see " "https://github.com/google/sanitizers/issues/189\n", top, bottom, top - bottom, top - bottom); return; } PoisonShadow(bottom, top - bottom, 0); if (curr_thread && curr_thread->has_fake_stack()) curr_thread->fake_stack()->HandleNoReturn(); } void NOINLINE __asan_set_death_callback(void (*callback)(void)) { SetUserDieCallback(callback); } // Initialize as requested from instrumented application code. // We use this call as a trigger to wake up ASan from deactivated state. void __asan_init() { AsanActivate(); AsanInitInternal(); } void __asan_version_mismatch_check() { // Do nothing. } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_interceptors.cc0000664000175000017500000007233012750411034026725 0ustar mwhudsonmwhudson//===-- asan_interceptors.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Intercept various libc functions. //===----------------------------------------------------------------------===// #include "asan_interceptors.h" #include "asan_allocator.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_poisoning.h" #include "asan_report.h" #include "asan_stack.h" #include "asan_stats.h" #include "asan_suppressions.h" #include "lsan/lsan_common.h" #include "sanitizer_common/sanitizer_libc.h" #if SANITIZER_POSIX #include "sanitizer_common/sanitizer_posix.h" #endif #if defined(__i386) && SANITIZER_LINUX #define ASAN_PTHREAD_CREATE_VERSION "GLIBC_2.1" #elif defined(__mips__) && SANITIZER_LINUX #define ASAN_PTHREAD_CREATE_VERSION "GLIBC_2.2" #endif namespace __asan { // Return true if we can quickly decide that the region is unpoisoned. static inline bool QuickCheckForUnpoisonedRegion(uptr beg, uptr size) { if (size == 0) return true; if (size <= 32) return !AddressIsPoisoned(beg) && !AddressIsPoisoned(beg + size - 1) && !AddressIsPoisoned(beg + size / 2); return false; } struct AsanInterceptorContext { const char *interceptor_name; }; // We implement ACCESS_MEMORY_RANGE, ASAN_READ_RANGE, // and ASAN_WRITE_RANGE as macro instead of function so // that no extra frames are created, and stack trace contains // relevant information only. // We check all shadow bytes. #define ACCESS_MEMORY_RANGE(ctx, offset, size, isWrite) do { \ uptr __offset = (uptr)(offset); \ uptr __size = (uptr)(size); \ uptr __bad = 0; \ if (__offset > __offset + __size) { \ GET_STACK_TRACE_FATAL_HERE; \ ReportStringFunctionSizeOverflow(__offset, __size, &stack); \ } \ if (!QuickCheckForUnpoisonedRegion(__offset, __size) && \ (__bad = __asan_region_is_poisoned(__offset, __size))) { \ AsanInterceptorContext *_ctx = (AsanInterceptorContext *)ctx; \ bool suppressed = false; \ if (_ctx) { \ suppressed = IsInterceptorSuppressed(_ctx->interceptor_name); \ if (!suppressed && HaveStackTraceBasedSuppressions()) { \ GET_STACK_TRACE_FATAL_HERE; \ suppressed = IsStackTraceSuppressed(&stack); \ } \ } \ if (!suppressed) { \ GET_CURRENT_PC_BP_SP; \ ReportGenericError(pc, bp, sp, __bad, isWrite, __size, 0, false);\ } \ } \ } while (0) #define ASAN_READ_RANGE(ctx, offset, size) \ ACCESS_MEMORY_RANGE(ctx, offset, size, false) #define ASAN_WRITE_RANGE(ctx, offset, size) \ ACCESS_MEMORY_RANGE(ctx, offset, size, true) #define ASAN_READ_STRING_OF_LEN(ctx, s, len, n) \ ASAN_READ_RANGE((ctx), (s), \ common_flags()->strict_string_checks ? (len) + 1 : (n)) #define ASAN_READ_STRING(ctx, s, n) \ ASAN_READ_STRING_OF_LEN((ctx), (s), REAL(strlen)(s), (n)) // Behavior of functions like "memcpy" or "strcpy" is undefined // if memory intervals overlap. We report error in this case. // Macro is used to avoid creation of new frames. static inline bool RangesOverlap(const char *offset1, uptr length1, const char *offset2, uptr length2) { return !((offset1 + length1 <= offset2) || (offset2 + length2 <= offset1)); } #define CHECK_RANGES_OVERLAP(name, _offset1, length1, _offset2, length2) do { \ const char *offset1 = (const char*)_offset1; \ const char *offset2 = (const char*)_offset2; \ if (RangesOverlap(offset1, length1, offset2, length2)) { \ GET_STACK_TRACE_FATAL_HERE; \ ReportStringFunctionMemoryRangesOverlap(name, offset1, length1, \ offset2, length2, &stack); \ } \ } while (0) static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) { #if SANITIZER_INTERCEPT_STRNLEN if (REAL(strnlen)) { return REAL(strnlen)(s, maxlen); } #endif return internal_strnlen(s, maxlen); } void SetThreadName(const char *name) { AsanThread *t = GetCurrentThread(); if (t) asanThreadRegistry().SetThreadName(t->tid(), name); } int OnExit() { // FIXME: ask frontend whether we need to return failure. return 0; } } // namespace __asan // ---------------------- Wrappers ---------------- {{{1 using namespace __asan; // NOLINT DECLARE_REAL_AND_INTERCEPTOR(void *, malloc, uptr) DECLARE_REAL_AND_INTERCEPTOR(void, free, void *) #define ASAN_INTERCEPTOR_ENTER(ctx, func) \ AsanInterceptorContext _ctx = {#func}; \ ctx = (void *)&_ctx; \ (void) ctx; \ #define COMMON_INTERCEPT_FUNCTION(name) ASAN_INTERCEPT_FUNC(name) #define COMMON_INTERCEPT_FUNCTION_VER(name, ver) \ ASAN_INTERCEPT_FUNC_VER(name, ver) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ ASAN_WRITE_RANGE(ctx, ptr, size) #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ ASAN_READ_RANGE(ctx, ptr, size) #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \ ASAN_INTERCEPTOR_ENTER(ctx, func); \ do { \ if (asan_init_is_running) \ return REAL(func)(__VA_ARGS__); \ if (SANITIZER_MAC && UNLIKELY(!asan_inited)) \ return REAL(func)(__VA_ARGS__); \ ENSURE_ASAN_INITED(); \ } while (false) #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \ do { \ } while (false) #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \ do { \ } while (false) #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \ do { \ } while (false) #define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \ do { \ } while (false) #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) SetThreadName(name) // Should be asanThreadRegistry().SetThreadNameByUserId(thread, name) // But asan does not remember UserId's for threads (pthread_t); // and remembers all ever existed threads, so the linear search by UserId // can be slow. #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \ do { \ } while (false) #define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name) // Strict init-order checking is dlopen-hostile: // https://github.com/google/sanitizers/issues/178 #define COMMON_INTERCEPTOR_ON_DLOPEN(filename, flag) \ if (flags()->strict_init_order) { \ StopInitOrderChecking(); \ } #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit() #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \ CoverageUpdateMapping() #define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() CoverageUpdateMapping() #define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED (!asan_inited) #define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end) \ if (AsanThread *t = GetCurrentThread()) { \ *begin = t->tls_begin(); \ *end = t->tls_end(); \ } else { \ *begin = *end = 0; \ } // Asan needs custom handling of these: #undef SANITIZER_INTERCEPT_MEMSET #undef SANITIZER_INTERCEPT_MEMMOVE #undef SANITIZER_INTERCEPT_MEMCPY #include "sanitizer_common/sanitizer_common_interceptors.inc" // Syscall interceptors don't have contexts, we don't support suppressions // for them. #define COMMON_SYSCALL_PRE_READ_RANGE(p, s) ASAN_READ_RANGE(nullptr, p, s) #define COMMON_SYSCALL_PRE_WRITE_RANGE(p, s) ASAN_WRITE_RANGE(nullptr, p, s) #define COMMON_SYSCALL_POST_READ_RANGE(p, s) \ do { \ (void)(p); \ (void)(s); \ } while (false) #define COMMON_SYSCALL_POST_WRITE_RANGE(p, s) \ do { \ (void)(p); \ (void)(s); \ } while (false) #include "sanitizer_common/sanitizer_common_syscalls.inc" struct ThreadStartParam { atomic_uintptr_t t; atomic_uintptr_t is_registered; }; #if ASAN_INTERCEPT_PTHREAD_CREATE static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) { ThreadStartParam *param = reinterpret_cast(arg); AsanThread *t = nullptr; while ((t = reinterpret_cast( atomic_load(¶m->t, memory_order_acquire))) == nullptr) internal_sched_yield(); SetCurrentThread(t); return t->ThreadStart(GetTid(), ¶m->is_registered); } INTERCEPTOR(int, pthread_create, void *thread, void *attr, void *(*start_routine)(void*), void *arg) { EnsureMainThreadIDIsCorrect(); // Strict init-order checking is thread-hostile. if (flags()->strict_init_order) StopInitOrderChecking(); GET_STACK_TRACE_THREAD; int detached = 0; if (attr) REAL(pthread_attr_getdetachstate)(attr, &detached); ThreadStartParam param; atomic_store(¶m.t, 0, memory_order_relaxed); atomic_store(¶m.is_registered, 0, memory_order_relaxed); int result; { // Ignore all allocations made by pthread_create: thread stack/TLS may be // stored by pthread for future reuse even after thread destruction, and // the linked list it's stored in doesn't even hold valid pointers to the // objects, the latter are calculated by obscure pointer arithmetic. #if CAN_SANITIZE_LEAKS __lsan::ScopedInterceptorDisabler disabler; #endif result = REAL(pthread_create)(thread, attr, asan_thread_start, ¶m); } if (result == 0) { u32 current_tid = GetCurrentTidOrInvalid(); AsanThread *t = AsanThread::Create(start_routine, arg, current_tid, &stack, detached); atomic_store(¶m.t, reinterpret_cast(t), memory_order_release); // Wait until the AsanThread object is initialized and the ThreadRegistry // entry is in "started" state. One reason for this is that after this // interceptor exits, the child thread's stack may be the only thing holding // the |arg| pointer. This may cause LSan to report a leak if leak checking // happens at a point when the interceptor has already exited, but the stack // range for the child thread is not yet known. while (atomic_load(¶m.is_registered, memory_order_acquire) == 0) internal_sched_yield(); } return result; } INTERCEPTOR(int, pthread_join, void *t, void **arg) { return real_pthread_join(t, arg); } DEFINE_REAL_PTHREAD_FUNCTIONS #endif // ASAN_INTERCEPT_PTHREAD_CREATE #if ASAN_INTERCEPT_SIGNAL_AND_SIGACTION #if SANITIZER_ANDROID INTERCEPTOR(void*, bsd_signal, int signum, void *handler) { if (!IsHandledDeadlySignal(signum) || common_flags()->allow_user_segv_handler) { return REAL(bsd_signal)(signum, handler); } return 0; } #endif INTERCEPTOR(void*, signal, int signum, void *handler) { if (!IsHandledDeadlySignal(signum) || common_flags()->allow_user_segv_handler) { return REAL(signal)(signum, handler); } return nullptr; } INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) { if (!IsHandledDeadlySignal(signum) || common_flags()->allow_user_segv_handler) { return REAL(sigaction)(signum, act, oldact); } return 0; } namespace __sanitizer { int real_sigaction(int signum, const void *act, void *oldact) { return REAL(sigaction)(signum, (const struct sigaction *)act, (struct sigaction *)oldact); } } // namespace __sanitizer #elif SANITIZER_POSIX // We need to have defined REAL(sigaction) on posix systems. DEFINE_REAL(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) #endif // ASAN_INTERCEPT_SIGNAL_AND_SIGACTION #if ASAN_INTERCEPT_SWAPCONTEXT static void ClearShadowMemoryForContextStack(uptr stack, uptr ssize) { // Align to page size. uptr PageSize = GetPageSizeCached(); uptr bottom = stack & ~(PageSize - 1); ssize += stack - bottom; ssize = RoundUpTo(ssize, PageSize); static const uptr kMaxSaneContextStackSize = 1 << 22; // 4 Mb if (AddrIsInMem(bottom) && ssize && ssize <= kMaxSaneContextStackSize) { PoisonShadow(bottom, ssize, 0); } } INTERCEPTOR(int, swapcontext, struct ucontext_t *oucp, struct ucontext_t *ucp) { static bool reported_warning = false; if (!reported_warning) { Report("WARNING: ASan doesn't fully support makecontext/swapcontext " "functions and may produce false positives in some cases!\n"); reported_warning = true; } // Clear shadow memory for new context (it may share stack // with current context). uptr stack, ssize; ReadContextStack(ucp, &stack, &ssize); ClearShadowMemoryForContextStack(stack, ssize); int res = REAL(swapcontext)(oucp, ucp); // swapcontext technically does not return, but program may swap context to // "oucp" later, that would look as if swapcontext() returned 0. // We need to clear shadow for ucp once again, as it may be in arbitrary // state. ClearShadowMemoryForContextStack(stack, ssize); return res; } #endif // ASAN_INTERCEPT_SWAPCONTEXT INTERCEPTOR(void, longjmp, void *env, int val) { __asan_handle_no_return(); REAL(longjmp)(env, val); } #if ASAN_INTERCEPT__LONGJMP INTERCEPTOR(void, _longjmp, void *env, int val) { __asan_handle_no_return(); REAL(_longjmp)(env, val); } #endif #if ASAN_INTERCEPT_SIGLONGJMP INTERCEPTOR(void, siglongjmp, void *env, int val) { __asan_handle_no_return(); REAL(siglongjmp)(env, val); } #endif #if ASAN_INTERCEPT___CXA_THROW INTERCEPTOR(void, __cxa_throw, void *a, void *b, void *c) { CHECK(REAL(__cxa_throw)); __asan_handle_no_return(); REAL(__cxa_throw)(a, b, c); } #endif // memcpy is called during __asan_init() from the internals of printf(...). // We do not treat memcpy with to==from as a bug. // See http://llvm.org/bugs/show_bug.cgi?id=11763. #define ASAN_MEMCPY_IMPL(ctx, to, from, size) do { \ if (UNLIKELY(!asan_inited)) return internal_memcpy(to, from, size); \ if (asan_init_is_running) { \ return REAL(memcpy)(to, from, size); \ } \ ENSURE_ASAN_INITED(); \ if (flags()->replace_intrin) { \ if (to != from) { \ CHECK_RANGES_OVERLAP("memcpy", to, size, from, size); \ } \ ASAN_READ_RANGE(ctx, from, size); \ ASAN_WRITE_RANGE(ctx, to, size); \ } \ return REAL(memcpy)(to, from, size); \ } while (0) void *__asan_memcpy(void *to, const void *from, uptr size) { ASAN_MEMCPY_IMPL(nullptr, to, from, size); } // memset is called inside Printf. #define ASAN_MEMSET_IMPL(ctx, block, c, size) do { \ if (UNLIKELY(!asan_inited)) return internal_memset(block, c, size); \ if (asan_init_is_running) { \ return REAL(memset)(block, c, size); \ } \ ENSURE_ASAN_INITED(); \ if (flags()->replace_intrin) { \ ASAN_WRITE_RANGE(ctx, block, size); \ } \ return REAL(memset)(block, c, size); \ } while (0) void *__asan_memset(void *block, int c, uptr size) { ASAN_MEMSET_IMPL(nullptr, block, c, size); } #define ASAN_MEMMOVE_IMPL(ctx, to, from, size) do { \ if (UNLIKELY(!asan_inited)) \ return internal_memmove(to, from, size); \ ENSURE_ASAN_INITED(); \ if (flags()->replace_intrin) { \ ASAN_READ_RANGE(ctx, from, size); \ ASAN_WRITE_RANGE(ctx, to, size); \ } \ return internal_memmove(to, from, size); \ } while (0) void *__asan_memmove(void *to, const void *from, uptr size) { ASAN_MEMMOVE_IMPL(nullptr, to, from, size); } INTERCEPTOR(void*, memmove, void *to, const void *from, uptr size) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, memmove); ASAN_MEMMOVE_IMPL(ctx, to, from, size); } INTERCEPTOR(void*, memcpy, void *to, const void *from, uptr size) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, memcpy); #if !SANITIZER_MAC ASAN_MEMCPY_IMPL(ctx, to, from, size); #else // At least on 10.7 and 10.8 both memcpy() and memmove() are being replaced // with WRAP(memcpy). As a result, false positives are reported for memmove() // calls. If we just disable error reporting with // ASAN_OPTIONS=replace_intrin=0, memmove() is still replaced with // internal_memcpy(), which may lead to crashes, see // http://llvm.org/bugs/show_bug.cgi?id=16362. ASAN_MEMMOVE_IMPL(ctx, to, from, size); #endif // !SANITIZER_MAC } INTERCEPTOR(void*, memset, void *block, int c, uptr size) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, memset); ASAN_MEMSET_IMPL(ctx, block, c, size); } #if ASAN_INTERCEPT_INDEX # if ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX INTERCEPTOR(char*, index, const char *string, int c) ALIAS(WRAPPER_NAME(strchr)); # else # if SANITIZER_MAC DECLARE_REAL(char*, index, const char *string, int c) OVERRIDE_FUNCTION(index, strchr); # else DEFINE_REAL(char*, index, const char *string, int c) # endif # endif #endif // ASAN_INTERCEPT_INDEX // For both strcat() and strncat() we need to check the validity of |to| // argument irrespective of the |from| length. INTERCEPTOR(char*, strcat, char *to, const char *from) { // NOLINT void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strcat); // NOLINT ENSURE_ASAN_INITED(); if (flags()->replace_str) { uptr from_length = REAL(strlen)(from); ASAN_READ_RANGE(ctx, from, from_length + 1); uptr to_length = REAL(strlen)(to); ASAN_READ_STRING_OF_LEN(ctx, to, to_length, to_length); ASAN_WRITE_RANGE(ctx, to + to_length, from_length + 1); // If the copying actually happens, the |from| string should not overlap // with the resulting string starting at |to|, which has a length of // to_length + from_length + 1. if (from_length > 0) { CHECK_RANGES_OVERLAP("strcat", to, from_length + to_length + 1, from, from_length + 1); } } return REAL(strcat)(to, from); // NOLINT } INTERCEPTOR(char*, strncat, char *to, const char *from, uptr size) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strncat); ENSURE_ASAN_INITED(); if (flags()->replace_str) { uptr from_length = MaybeRealStrnlen(from, size); uptr copy_length = Min(size, from_length + 1); ASAN_READ_RANGE(ctx, from, copy_length); uptr to_length = REAL(strlen)(to); ASAN_READ_STRING_OF_LEN(ctx, to, to_length, to_length); ASAN_WRITE_RANGE(ctx, to + to_length, from_length + 1); if (from_length > 0) { CHECK_RANGES_OVERLAP("strncat", to, to_length + copy_length + 1, from, copy_length); } } return REAL(strncat)(to, from, size); } INTERCEPTOR(char*, strcpy, char *to, const char *from) { // NOLINT void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strcpy); // NOLINT #if SANITIZER_MAC if (UNLIKELY(!asan_inited)) return REAL(strcpy)(to, from); // NOLINT #endif // strcpy is called from malloc_default_purgeable_zone() // in __asan::ReplaceSystemAlloc() on Mac. if (asan_init_is_running) { return REAL(strcpy)(to, from); // NOLINT } ENSURE_ASAN_INITED(); if (flags()->replace_str) { uptr from_size = REAL(strlen)(from) + 1; CHECK_RANGES_OVERLAP("strcpy", to, from_size, from, from_size); ASAN_READ_RANGE(ctx, from, from_size); ASAN_WRITE_RANGE(ctx, to, from_size); } return REAL(strcpy)(to, from); // NOLINT } INTERCEPTOR(char*, strdup, const char *s) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strdup); if (UNLIKELY(!asan_inited)) return internal_strdup(s); ENSURE_ASAN_INITED(); uptr length = REAL(strlen)(s); if (flags()->replace_str) { ASAN_READ_RANGE(ctx, s, length + 1); } GET_STACK_TRACE_MALLOC; void *new_mem = asan_malloc(length + 1, &stack); REAL(memcpy)(new_mem, s, length + 1); return reinterpret_cast(new_mem); } #if ASAN_INTERCEPT___STRDUP INTERCEPTOR(char*, __strdup, const char *s) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strdup); if (UNLIKELY(!asan_inited)) return internal_strdup(s); ENSURE_ASAN_INITED(); uptr length = REAL(strlen)(s); if (flags()->replace_str) { ASAN_READ_RANGE(ctx, s, length + 1); } GET_STACK_TRACE_MALLOC; void *new_mem = asan_malloc(length + 1, &stack); REAL(memcpy)(new_mem, s, length + 1); return reinterpret_cast(new_mem); } #endif // ASAN_INTERCEPT___STRDUP INTERCEPTOR(SIZE_T, wcslen, const wchar_t *s) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, wcslen); SIZE_T length = internal_wcslen(s); if (!asan_init_is_running) { ENSURE_ASAN_INITED(); ASAN_READ_RANGE(ctx, s, (length + 1) * sizeof(wchar_t)); } return length; } INTERCEPTOR(char*, strncpy, char *to, const char *from, uptr size) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strncpy); ENSURE_ASAN_INITED(); if (flags()->replace_str) { uptr from_size = Min(size, MaybeRealStrnlen(from, size) + 1); CHECK_RANGES_OVERLAP("strncpy", to, from_size, from, from_size); ASAN_READ_RANGE(ctx, from, from_size); ASAN_WRITE_RANGE(ctx, to, size); } return REAL(strncpy)(to, from, size); } INTERCEPTOR(long, strtol, const char *nptr, // NOLINT char **endptr, int base) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strtol); ENSURE_ASAN_INITED(); if (!flags()->replace_str) { return REAL(strtol)(nptr, endptr, base); } char *real_endptr; long result = REAL(strtol)(nptr, &real_endptr, base); // NOLINT StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base); return result; } INTERCEPTOR(int, atoi, const char *nptr) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, atoi); #if SANITIZER_MAC if (UNLIKELY(!asan_inited)) return REAL(atoi)(nptr); #endif ENSURE_ASAN_INITED(); if (!flags()->replace_str) { return REAL(atoi)(nptr); } char *real_endptr; // "man atoi" tells that behavior of atoi(nptr) is the same as // strtol(nptr, 0, 10), i.e. it sets errno to ERANGE if the // parsed integer can't be stored in *long* type (even if it's // different from int). So, we just imitate this behavior. int result = REAL(strtol)(nptr, &real_endptr, 10); FixRealStrtolEndptr(nptr, &real_endptr); ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1); return result; } INTERCEPTOR(long, atol, const char *nptr) { // NOLINT void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, atol); #if SANITIZER_MAC if (UNLIKELY(!asan_inited)) return REAL(atol)(nptr); #endif ENSURE_ASAN_INITED(); if (!flags()->replace_str) { return REAL(atol)(nptr); } char *real_endptr; long result = REAL(strtol)(nptr, &real_endptr, 10); // NOLINT FixRealStrtolEndptr(nptr, &real_endptr); ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1); return result; } #if ASAN_INTERCEPT_ATOLL_AND_STRTOLL INTERCEPTOR(long long, strtoll, const char *nptr, // NOLINT char **endptr, int base) { void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, strtoll); ENSURE_ASAN_INITED(); if (!flags()->replace_str) { return REAL(strtoll)(nptr, endptr, base); } char *real_endptr; long long result = REAL(strtoll)(nptr, &real_endptr, base); // NOLINT StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base); return result; } INTERCEPTOR(long long, atoll, const char *nptr) { // NOLINT void *ctx; ASAN_INTERCEPTOR_ENTER(ctx, atoll); ENSURE_ASAN_INITED(); if (!flags()->replace_str) { return REAL(atoll)(nptr); } char *real_endptr; long long result = REAL(strtoll)(nptr, &real_endptr, 10); // NOLINT FixRealStrtolEndptr(nptr, &real_endptr); ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1); return result; } #endif // ASAN_INTERCEPT_ATOLL_AND_STRTOLL #if ASAN_INTERCEPT___CXA_ATEXIT static void AtCxaAtexit(void *unused) { (void)unused; StopInitOrderChecking(); } INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg, void *dso_handle) { #if SANITIZER_MAC if (UNLIKELY(!asan_inited)) return REAL(__cxa_atexit)(func, arg, dso_handle); #endif ENSURE_ASAN_INITED(); int res = REAL(__cxa_atexit)(func, arg, dso_handle); REAL(__cxa_atexit)(AtCxaAtexit, nullptr, nullptr); return res; } #endif // ASAN_INTERCEPT___CXA_ATEXIT #if ASAN_INTERCEPT_FORK INTERCEPTOR(int, fork, void) { ENSURE_ASAN_INITED(); if (common_flags()->coverage) CovBeforeFork(); int pid = REAL(fork)(); if (common_flags()->coverage) CovAfterFork(pid); return pid; } #endif // ASAN_INTERCEPT_FORK // ---------------------- InitializeAsanInterceptors ---------------- {{{1 namespace __asan { void InitializeAsanInterceptors() { static bool was_called_once; CHECK(!was_called_once); was_called_once = true; InitializeCommonInterceptors(); // Intercept mem* functions. ASAN_INTERCEPT_FUNC(memmove); ASAN_INTERCEPT_FUNC(memset); if (PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE) { // In asan, REAL(memmove) is not used, but it is used in msan. ASAN_INTERCEPT_FUNC(memcpy); } else { ASSIGN_REAL(memcpy, memmove); } CHECK(REAL(memcpy)); // Intercept str* functions. ASAN_INTERCEPT_FUNC(strcat); // NOLINT ASAN_INTERCEPT_FUNC(strcpy); // NOLINT ASAN_INTERCEPT_FUNC(wcslen); ASAN_INTERCEPT_FUNC(strncat); ASAN_INTERCEPT_FUNC(strncpy); ASAN_INTERCEPT_FUNC(strdup); #if ASAN_INTERCEPT___STRDUP ASAN_INTERCEPT_FUNC(__strdup); #endif #if ASAN_INTERCEPT_INDEX && ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX ASAN_INTERCEPT_FUNC(index); #endif ASAN_INTERCEPT_FUNC(atoi); ASAN_INTERCEPT_FUNC(atol); ASAN_INTERCEPT_FUNC(strtol); #if ASAN_INTERCEPT_ATOLL_AND_STRTOLL ASAN_INTERCEPT_FUNC(atoll); ASAN_INTERCEPT_FUNC(strtoll); #endif // Intecept signal- and jump-related functions. ASAN_INTERCEPT_FUNC(longjmp); #if ASAN_INTERCEPT_SIGNAL_AND_SIGACTION ASAN_INTERCEPT_FUNC(sigaction); #if SANITIZER_ANDROID ASAN_INTERCEPT_FUNC(bsd_signal); #endif ASAN_INTERCEPT_FUNC(signal); #endif #if ASAN_INTERCEPT_SWAPCONTEXT ASAN_INTERCEPT_FUNC(swapcontext); #endif #if ASAN_INTERCEPT__LONGJMP ASAN_INTERCEPT_FUNC(_longjmp); #endif #if ASAN_INTERCEPT_SIGLONGJMP ASAN_INTERCEPT_FUNC(siglongjmp); #endif // Intercept exception handling functions. #if ASAN_INTERCEPT___CXA_THROW ASAN_INTERCEPT_FUNC(__cxa_throw); #endif // Intercept threading-related functions #if ASAN_INTERCEPT_PTHREAD_CREATE #if defined(ASAN_PTHREAD_CREATE_VERSION) ASAN_INTERCEPT_FUNC_VER(pthread_create, ASAN_PTHREAD_CREATE_VERSION); #else ASAN_INTERCEPT_FUNC(pthread_create); #endif ASAN_INTERCEPT_FUNC(pthread_join); #endif // Intercept atexit function. #if ASAN_INTERCEPT___CXA_ATEXIT ASAN_INTERCEPT_FUNC(__cxa_atexit); #endif #if ASAN_INTERCEPT_FORK ASAN_INTERCEPT_FUNC(fork); #endif InitializePlatformInterceptors(); VReport(1, "AddressSanitizer: libc interceptors initialized\n"); } } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_win_dynamic_runtime_thunk.cc0000664000175000017500000001061613003463542031463 0ustar mwhudsonmwhudson//===-- asan_win_dynamic_runtime_thunk.cc ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This file defines things that need to be present in the application modules // to interact with the ASan DLL runtime correctly and can't be implemented // using the default "import library" generated when linking the DLL RTL. // // This includes: // - forwarding the detect_stack_use_after_return runtime option // - working around deficiencies of the MD runtime // - installing a custom SEH handler // //===----------------------------------------------------------------------===// // Only compile this code when building asan_dynamic_runtime_thunk.lib // Using #ifdef rather than relying on Makefiles etc. // simplifies the build procedure. #ifdef ASAN_DYNAMIC_RUNTIME_THUNK #define WIN32_LEAN_AND_MEAN #include // First, declare CRT sections we'll be using in this file #pragma section(".CRT$XID", long, read) // NOLINT #pragma section(".CRT$XCAB", long, read) // NOLINT #pragma section(".CRT$XTW", long, read) // NOLINT #pragma section(".CRT$XTY", long, read) // NOLINT //////////////////////////////////////////////////////////////////////////////// // Define a copy of __asan_option_detect_stack_use_after_return that should be // used when linking an MD runtime with a set of object files on Windows. // // The ASan MD runtime dllexports '__asan_option_detect_stack_use_after_return', // so normally we would just dllimport it. Unfortunately, the dllimport // attribute adds __imp_ prefix to the symbol name of a variable. // Since in general we don't know if a given TU is going to be used // with a MT or MD runtime and we don't want to use ugly __imp_ names on Windows // just to work around this issue, let's clone the variable that is constant // after initialization anyways. extern "C" { __declspec(dllimport) int __asan_should_detect_stack_use_after_return(); int __asan_option_detect_stack_use_after_return = __asan_should_detect_stack_use_after_return(); __declspec(dllimport) void* __asan_get_shadow_memory_dynamic_address(); void* __asan_shadow_memory_dynamic_address = __asan_get_shadow_memory_dynamic_address(); } //////////////////////////////////////////////////////////////////////////////// // For some reason, the MD CRT doesn't call the C/C++ terminators during on DLL // unload or on exit. ASan relies on LLVM global_dtors to call // __asan_unregister_globals on these events, which unfortunately doesn't work // with the MD runtime, see PR22545 for the details. // To work around this, for each DLL we schedule a call to UnregisterGlobals // using atexit() that calls a small subset of C terminators // where LLVM global_dtors is placed. Fingers crossed, no other C terminators // are there. extern "C" int __cdecl atexit(void (__cdecl *f)(void)); extern "C" void __cdecl _initterm(void *a, void *b); namespace { __declspec(allocate(".CRT$XTW")) void* before_global_dtors = 0; __declspec(allocate(".CRT$XTY")) void* after_global_dtors = 0; void UnregisterGlobals() { _initterm(&before_global_dtors, &after_global_dtors); } int ScheduleUnregisterGlobals() { return atexit(UnregisterGlobals); } } // namespace // We need to call 'atexit(UnregisterGlobals);' as early as possible, but after // atexit() is initialized (.CRT$XIC). As this is executed before C++ // initializers (think ctors for globals), UnregisterGlobals gets executed after // dtors for C++ globals. __declspec(allocate(".CRT$XID")) int (*__asan_schedule_unregister_globals)() = ScheduleUnregisterGlobals; //////////////////////////////////////////////////////////////////////////////// // ASan SEH handling. // We need to set the ASan-specific SEH handler at the end of CRT initialization // of each module (see also asan_win.cc). extern "C" { __declspec(dllimport) int __asan_set_seh_filter(); static int SetSEHFilter() { return __asan_set_seh_filter(); } // Unfortunately, putting a pointer to __asan_set_seh_filter into // __asan_intercept_seh gets optimized out, so we have to use an extra function. __declspec(allocate(".CRT$XCAB")) int (*__asan_seh_interceptor)() = SetSEHFilter; } #endif // ASAN_DYNAMIC_RUNTIME_THUNK golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_flags.inc0000664000175000017500000001521512766076350025502 0ustar mwhudsonmwhudson//===-- asan_flags.inc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // ASan runtime flags. // //===----------------------------------------------------------------------===// #ifndef ASAN_FLAG # error "Define ASAN_FLAG prior to including this file!" #endif // ASAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. ASAN_FLAG(int, quarantine_size, -1, "Deprecated, please use quarantine_size_mb.") ASAN_FLAG(int, quarantine_size_mb, -1, "Size (in Mb) of quarantine used to detect use-after-free " "errors. Lower value may reduce memory usage but increase the " "chance of false negatives.") ASAN_FLAG(int, redzone, 16, "Minimal size (in bytes) of redzones around heap objects. " "Requirement: redzone >= 16, is a power of two.") ASAN_FLAG(int, max_redzone, 2048, "Maximal size (in bytes) of redzones around heap objects.") ASAN_FLAG( bool, debug, false, "If set, prints some debugging information and does additional checks.") ASAN_FLAG( int, report_globals, 1, "Controls the way to handle globals (0 - don't detect buffer overflow on " "globals, 1 - detect buffer overflow, 2 - print data about registered " "globals).") ASAN_FLAG(bool, check_initialization_order, false, "If set, attempts to catch initialization order issues.") ASAN_FLAG( bool, replace_str, true, "If set, uses custom wrappers and replacements for libc string functions " "to find more errors.") ASAN_FLAG(bool, replace_intrin, true, "If set, uses custom wrappers for memset/memcpy/memmove intrinsics.") ASAN_FLAG(bool, detect_stack_use_after_return, false, "Enables stack-use-after-return checking at run-time.") ASAN_FLAG(int, min_uar_stack_size_log, 16, // We can't do smaller anyway. "Minimum fake stack size log.") ASAN_FLAG(int, max_uar_stack_size_log, 20, // 1Mb per size class, i.e. ~11Mb per thread "Maximum fake stack size log.") ASAN_FLAG(bool, uar_noreserve, false, "Use mmap with 'noreserve' flag to allocate fake stack.") ASAN_FLAG( int, max_malloc_fill_size, 0x1000, // By default, fill only the first 4K. "ASan allocator flag. max_malloc_fill_size is the maximal amount of " "bytes that will be filled with malloc_fill_byte on malloc.") ASAN_FLAG(int, malloc_fill_byte, 0xbe, "Value used to fill the newly allocated memory.") ASAN_FLAG(bool, allow_user_poisoning, true, "If set, user may manually mark memory regions as poisoned or " "unpoisoned.") ASAN_FLAG( int, sleep_before_dying, 0, "Number of seconds to sleep between printing an error report and " "terminating the program. Useful for debugging purposes (e.g. when one " "needs to attach gdb).") ASAN_FLAG(bool, check_malloc_usable_size, true, "Allows the users to work around the bug in Nvidia drivers prior to " "295.*.") ASAN_FLAG(bool, unmap_shadow_on_exit, false, "If set, explicitly unmaps the (huge) shadow at exit.") ASAN_FLAG(bool, protect_shadow_gap, true, "If set, mprotect the shadow gap") ASAN_FLAG(bool, print_stats, false, "Print various statistics after printing an error message or if " "atexit=1.") ASAN_FLAG(bool, print_legend, true, "Print the legend for the shadow bytes.") ASAN_FLAG(bool, print_scariness, false, "Print the scariness score. Experimental.") ASAN_FLAG(bool, atexit, false, "If set, prints ASan exit stats even after program terminates " "successfully.") ASAN_FLAG( bool, print_full_thread_history, true, "If set, prints thread creation stacks for the threads involved in the " "report and their ancestors up to the main thread.") ASAN_FLAG( bool, poison_heap, true, "Poison (or not) the heap memory on [de]allocation. Zero value is useful " "for benchmarking the allocator or instrumentator.") ASAN_FLAG(bool, poison_partial, true, "If true, poison partially addressable 8-byte aligned words " "(default=true). This flag affects heap and global buffers, but not " "stack buffers.") ASAN_FLAG(bool, poison_array_cookie, true, "Poison (or not) the array cookie after operator new[].") // Turn off alloc/dealloc mismatch checker on Mac and Windows for now. // https://github.com/google/sanitizers/issues/131 // https://github.com/google/sanitizers/issues/309 // TODO(glider,timurrrr): Fix known issues and enable this back. ASAN_FLAG(bool, alloc_dealloc_mismatch, !SANITIZER_MAC && !SANITIZER_WINDOWS && !SANITIZER_ANDROID, "Report errors on malloc/delete, new/free, new/delete[], etc.") ASAN_FLAG(bool, new_delete_type_mismatch, true, "Report errors on mismatch between size of new and delete.") ASAN_FLAG( bool, strict_init_order, false, "If true, assume that dynamic initializers can never access globals from " "other modules, even if the latter are already initialized.") ASAN_FLAG( bool, start_deactivated, false, "If true, ASan tweaks a bunch of other flags (quarantine, redzone, heap " "poisoning) to reduce memory consumption as much as possible, and " "restores them to original values when the first instrumented module is " "loaded into the process. This is mainly intended to be used on " "Android. ") ASAN_FLAG( int, detect_invalid_pointer_pairs, 0, "If non-zero, try to detect operations like <, <=, >, >= and - on " "invalid pointer pairs (e.g. when pointers belong to different objects). " "The bigger the value the harder we try.") ASAN_FLAG( bool, detect_container_overflow, true, "If true, honor the container overflow annotations. See " "https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow") ASAN_FLAG(int, detect_odr_violation, 2, "If >=2, detect violation of One-Definition-Rule (ODR); " "If ==1, detect ODR-violation only if the two variables " "have different sizes") ASAN_FLAG(bool, dump_instruction_bytes, false, "If true, dump 16 bytes starting at the instruction that caused SEGV") ASAN_FLAG(const char *, suppressions, "", "Suppressions file name.") ASAN_FLAG(bool, halt_on_error, true, "Crash the program after printing the first error report " "(WARNING: USE AT YOUR OWN RISK!)") ASAN_FLAG(bool, use_odr_indicator, false, "Use special ODR indicator symbol for ODR violation detection") golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_allocator.h0000664000175000017500000001547612766321651026052 0ustar mwhudsonmwhudson//===-- asan_allocator.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_allocator.cc. //===----------------------------------------------------------------------===// #ifndef ASAN_ALLOCATOR_H #define ASAN_ALLOCATOR_H #include "asan_flags.h" #include "asan_internal.h" #include "asan_interceptors.h" #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_list.h" namespace __asan { enum AllocType { FROM_MALLOC = 1, // Memory block came from malloc, calloc, realloc, etc. FROM_NEW = 2, // Memory block came from operator new. FROM_NEW_BR = 3 // Memory block came from operator new [ ] }; struct AsanChunk; struct AllocatorOptions { u32 quarantine_size_mb; u16 min_redzone; u16 max_redzone; u8 may_return_null; u8 alloc_dealloc_mismatch; void SetFrom(const Flags *f, const CommonFlags *cf); void CopyTo(Flags *f, CommonFlags *cf); }; void InitializeAllocator(const AllocatorOptions &options); void ReInitializeAllocator(const AllocatorOptions &options); void GetAllocatorOptions(AllocatorOptions *options); class AsanChunkView { public: explicit AsanChunkView(AsanChunk *chunk) : chunk_(chunk) {} bool IsValid(); // Checks if AsanChunkView points to a valid allocated // or quarantined chunk. bool IsAllocated(); // Checks if the memory is currently allocated. uptr Beg(); // First byte of user memory. uptr End(); // Last byte of user memory. uptr UsedSize(); // Size requested by the user. uptr AllocTid(); uptr FreeTid(); bool Eq(const AsanChunkView &c) const { return chunk_ == c.chunk_; } u32 GetAllocStackId(); u32 GetFreeStackId(); StackTrace GetAllocStack(); StackTrace GetFreeStack(); AllocType GetAllocType(); bool AddrIsInside(uptr addr, uptr access_size, sptr *offset) { if (addr >= Beg() && (addr + access_size) <= End()) { *offset = addr - Beg(); return true; } return false; } bool AddrIsAtLeft(uptr addr, uptr access_size, sptr *offset) { (void)access_size; if (addr < Beg()) { *offset = Beg() - addr; return true; } return false; } bool AddrIsAtRight(uptr addr, uptr access_size, sptr *offset) { if (addr + access_size > End()) { *offset = addr - End(); return true; } return false; } private: AsanChunk *const chunk_; }; AsanChunkView FindHeapChunkByAddress(uptr address); AsanChunkView FindHeapChunkByAllocBeg(uptr address); // List of AsanChunks with total size. class AsanChunkFifoList: public IntrusiveList { public: explicit AsanChunkFifoList(LinkerInitialized) { } AsanChunkFifoList() { clear(); } void Push(AsanChunk *n); void PushList(AsanChunkFifoList *q); AsanChunk *Pop(); uptr size() { return size_; } void clear() { IntrusiveList::clear(); size_ = 0; } private: uptr size_; }; struct AsanMapUnmapCallback { void OnMap(uptr p, uptr size) const; void OnUnmap(uptr p, uptr size) const; }; #if SANITIZER_CAN_USE_ALLOCATOR64 # if defined(__powerpc64__) const uptr kAllocatorSpace = 0xa0000000000ULL; const uptr kAllocatorSize = 0x20000000000ULL; // 2T. typedef DefaultSizeClassMap SizeClassMap; # elif defined(__aarch64__) && SANITIZER_ANDROID const uptr kAllocatorSpace = 0x3000000000ULL; const uptr kAllocatorSize = 0x2000000000ULL; // 128G. typedef VeryCompactSizeClassMap SizeClassMap; # elif defined(__aarch64__) // AArch64/SANITIZER_CAN_USER_ALLOCATOR64 is only for 42-bit VMA // so no need to different values for different VMA. const uptr kAllocatorSpace = 0x10000000000ULL; const uptr kAllocatorSize = 0x10000000000ULL; // 3T. typedef DefaultSizeClassMap SizeClassMap; # elif SANITIZER_WINDOWS const uptr kAllocatorSpace = ~(uptr)0; const uptr kAllocatorSize = 0x8000000000ULL; // 500G typedef DefaultSizeClassMap SizeClassMap; # else const uptr kAllocatorSpace = 0x600000000000ULL; const uptr kAllocatorSize = 0x40000000000ULL; // 4T. typedef DefaultSizeClassMap SizeClassMap; # endif struct AP64 { // Allocator64 parameters. Deliberately using a short name. static const uptr kSpaceBeg = kAllocatorSpace; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 0; typedef __asan::SizeClassMap SizeClassMap; typedef AsanMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; typedef SizeClassAllocator64 PrimaryAllocator; #else // Fallback to SizeClassAllocator32. static const uptr kRegionSizeLog = 20; static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; # if SANITIZER_WORDSIZE == 32 typedef FlatByteMap ByteMap; # elif SANITIZER_WORDSIZE == 64 typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; # endif typedef CompactSizeClassMap SizeClassMap; typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, 16, SizeClassMap, kRegionSizeLog, ByteMap, AsanMapUnmapCallback> PrimaryAllocator; #endif // SANITIZER_CAN_USE_ALLOCATOR64 static const uptr kNumberOfSizeClasses = SizeClassMap::kNumClasses; typedef SizeClassAllocatorLocalCache AllocatorCache; typedef LargeMmapAllocator SecondaryAllocator; typedef CombinedAllocator AsanAllocator; struct AsanThreadLocalMallocStorage { uptr quarantine_cache[16]; AllocatorCache allocator_cache; void CommitBack(); private: // These objects are allocated via mmap() and are zero-initialized. AsanThreadLocalMallocStorage() {} }; void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, AllocType alloc_type); void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type); void asan_sized_free(void *ptr, uptr size, BufferedStackTrace *stack, AllocType alloc_type); void *asan_malloc(uptr size, BufferedStackTrace *stack); void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack); void *asan_realloc(void *p, uptr size, BufferedStackTrace *stack); void *asan_valloc(uptr size, BufferedStackTrace *stack); void *asan_pvalloc(uptr size, BufferedStackTrace *stack); int asan_posix_memalign(void **memptr, uptr alignment, uptr size, BufferedStackTrace *stack); uptr asan_malloc_usable_size(const void *ptr, uptr pc, uptr bp); uptr asan_mz_size(const void *ptr); void asan_mz_force_lock(); void asan_mz_force_unlock(); void PrintInternalAllocatorStats(); void AsanSoftRssLimitExceededCallback(bool exceeded); } // namespace __asan #endif // ASAN_ALLOCATOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_stats.h0000664000175000017500000000403012543322552025202 0ustar mwhudsonmwhudson//===-- asan_stats.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for statistics. //===----------------------------------------------------------------------===// #ifndef ASAN_STATS_H #define ASAN_STATS_H #include "asan_allocator.h" #include "asan_internal.h" namespace __asan { // AsanStats struct is NOT thread-safe. // Each AsanThread has its own AsanStats, which are sometimes flushed // to the accumulated AsanStats. struct AsanStats { // AsanStats must be a struct consisting of uptr fields only. // When merging two AsanStats structs, we treat them as arrays of uptr. uptr mallocs; uptr malloced; uptr malloced_redzones; uptr frees; uptr freed; uptr real_frees; uptr really_freed; uptr reallocs; uptr realloced; uptr mmaps; uptr mmaped; uptr munmaps; uptr munmaped; uptr malloc_large; uptr malloced_by_size[kNumberOfSizeClasses]; // Ctor for global AsanStats (accumulated stats for dead threads). explicit AsanStats(LinkerInitialized) { } // Creates empty stats. AsanStats(); void Print(); // Prints formatted stats to stderr. void Clear(); void MergeFrom(const AsanStats *stats); }; // Returns stats for GetCurrentThread(), or stats for fake "unknown thread" // if GetCurrentThread() returns 0. AsanStats &GetCurrentThreadStats(); // Flushes a given stats into accumulated stats of dead threads. void FlushToDeadThreadStats(AsanStats *stats); // A cross-platform equivalent of malloc_statistics_t on Mac OS. struct AsanMallocStats { uptr blocks_in_use; uptr size_in_use; uptr max_size_in_use; uptr size_allocated; }; void FillMallocStatistics(AsanMallocStats *malloc_stats); } // namespace __asan #endif // ASAN_STATS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_interceptors.h0000664000175000017500000000773212706003203026567 0ustar mwhudsonmwhudson//===-- asan_interceptors.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_interceptors.cc //===----------------------------------------------------------------------===// #ifndef ASAN_INTERCEPTORS_H #define ASAN_INTERCEPTORS_H #include "asan_internal.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_platform_interceptors.h" // Use macro to describe if specific function should be // intercepted on a given platform. #if !SANITIZER_WINDOWS # define ASAN_INTERCEPT_ATOLL_AND_STRTOLL 1 # define ASAN_INTERCEPT__LONGJMP 1 # define ASAN_INTERCEPT_INDEX 1 # define ASAN_INTERCEPT_PTHREAD_CREATE 1 # define ASAN_INTERCEPT_FORK 1 #else # define ASAN_INTERCEPT_ATOLL_AND_STRTOLL 0 # define ASAN_INTERCEPT__LONGJMP 0 # define ASAN_INTERCEPT_INDEX 0 # define ASAN_INTERCEPT_PTHREAD_CREATE 0 # define ASAN_INTERCEPT_FORK 0 #endif #if SANITIZER_FREEBSD || SANITIZER_LINUX # define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 1 #else # define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 0 #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID # define ASAN_INTERCEPT_SWAPCONTEXT 1 #else # define ASAN_INTERCEPT_SWAPCONTEXT 0 #endif #if !SANITIZER_WINDOWS # define ASAN_INTERCEPT_SIGNAL_AND_SIGACTION 1 #else # define ASAN_INTERCEPT_SIGNAL_AND_SIGACTION 0 #endif #if !SANITIZER_WINDOWS # define ASAN_INTERCEPT_SIGLONGJMP 1 #else # define ASAN_INTERCEPT_SIGLONGJMP 0 #endif // Android bug: https://code.google.com/p/android/issues/detail?id=61799 #if ASAN_HAS_EXCEPTIONS && !SANITIZER_WINDOWS && \ !(SANITIZER_ANDROID && defined(__i386)) # define ASAN_INTERCEPT___CXA_THROW 1 #else # define ASAN_INTERCEPT___CXA_THROW 0 #endif #if !SANITIZER_WINDOWS # define ASAN_INTERCEPT___CXA_ATEXIT 1 #else # define ASAN_INTERCEPT___CXA_ATEXIT 0 #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID # define ASAN_INTERCEPT___STRDUP 1 #else # define ASAN_INTERCEPT___STRDUP 0 #endif DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size) DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size) DECLARE_REAL(void*, memset, void *block, int c, uptr size) DECLARE_REAL(char*, strchr, const char *str, int c) DECLARE_REAL(SIZE_T, strlen, const char *s) DECLARE_REAL(char*, strncpy, char *to, const char *from, uptr size) DECLARE_REAL(uptr, strnlen, const char *s, uptr maxlen) DECLARE_REAL(char*, strstr, const char *s1, const char *s2) struct sigaction; DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) #if !SANITIZER_MAC #define ASAN_INTERCEPT_FUNC(name) \ do { \ if ((!INTERCEPT_FUNCTION(name) || !REAL(name))) \ VReport(1, "AddressSanitizer: failed to intercept '" #name "'\n"); \ } while (0) #define ASAN_INTERCEPT_FUNC_VER(name, ver) \ do { \ if ((!INTERCEPT_FUNCTION_VER(name, ver) || !REAL(name))) \ VReport( \ 1, "AddressSanitizer: failed to intercept '" #name "@@" #ver "'\n"); \ } while (0) #else // OS X interceptors don't need to be initialized with INTERCEPT_FUNCTION. #define ASAN_INTERCEPT_FUNC(name) #endif // SANITIZER_MAC namespace __asan { void InitializeAsanInterceptors(); void InitializePlatformInterceptors(); #define ENSURE_ASAN_INITED() do { \ CHECK(!asan_init_is_running); \ if (UNLIKELY(!asan_inited)) { \ AsanInitFromRtl(); \ } \ } while (0) } // namespace __asan #endif // ASAN_INTERCEPTORS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_activation.h0000664000175000017500000000130412445106051026201 0ustar mwhudsonmwhudson//===-- asan_activation.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan activation/deactivation logic. //===----------------------------------------------------------------------===// #ifndef ASAN_ACTIVATION_H #define ASAN_ACTIVATION_H namespace __asan { void AsanDeactivate(); void AsanActivate(); } // namespace __asan #endif // ASAN_ACTIVATION_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_descriptions.h0000664000175000017500000001674212770565412026575 0ustar mwhudsonmwhudson//===-- asan_descriptions.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_descriptions.cc. // TODO(filcab): Most struct definitions should move to the interface headers. //===----------------------------------------------------------------------===// #ifndef ASAN_DESCRIPTIONS_H #define ASAN_DESCRIPTIONS_H #include "asan_allocator.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_report_decorator.h" namespace __asan { void DescribeThread(AsanThreadContext *context); static inline void DescribeThread(AsanThread *t) { if (t) DescribeThread(t->context()); } const char *ThreadNameWithParenthesis(AsanThreadContext *t, char buff[], uptr buff_len); const char *ThreadNameWithParenthesis(u32 tid, char buff[], uptr buff_len); class Decorator : public __sanitizer::SanitizerCommonDecorator { public: Decorator() : SanitizerCommonDecorator() {} const char *Access() { return Blue(); } const char *EndAccess() { return Default(); } const char *Location() { return Green(); } const char *EndLocation() { return Default(); } const char *Allocation() { return Magenta(); } const char *EndAllocation() { return Default(); } const char *ShadowByte(u8 byte) { switch (byte) { case kAsanHeapLeftRedzoneMagic: case kAsanArrayCookieMagic: return Red(); case kAsanHeapFreeMagic: return Magenta(); case kAsanStackLeftRedzoneMagic: case kAsanStackMidRedzoneMagic: case kAsanStackRightRedzoneMagic: return Red(); case kAsanStackAfterReturnMagic: return Magenta(); case kAsanInitializationOrderMagic: return Cyan(); case kAsanUserPoisonedMemoryMagic: case kAsanContiguousContainerOOBMagic: case kAsanAllocaLeftMagic: case kAsanAllocaRightMagic: return Blue(); case kAsanStackUseAfterScopeMagic: return Magenta(); case kAsanGlobalRedzoneMagic: return Red(); case kAsanInternalHeapMagic: return Yellow(); case kAsanIntraObjectRedzone: return Yellow(); default: return Default(); } } const char *EndShadowByte() { return Default(); } const char *MemoryByte() { return Magenta(); } const char *EndMemoryByte() { return Default(); } }; enum ShadowKind : u8 { kShadowKindLow, kShadowKindGap, kShadowKindHigh, }; static const char *const ShadowNames[] = {"low shadow", "shadow gap", "high shadow"}; struct ShadowAddressDescription { uptr addr; ShadowKind kind; u8 shadow_byte; void Print() const; }; bool GetShadowAddressInformation(uptr addr, ShadowAddressDescription *descr); bool DescribeAddressIfShadow(uptr addr); enum AccessType { kAccessTypeLeft, kAccessTypeRight, kAccessTypeInside, kAccessTypeUnknown, // This means we have an AddressSanitizer bug! }; struct ChunkAccess { uptr bad_addr; sptr offset; uptr chunk_begin; uptr chunk_size; u32 access_type : 2; u32 alloc_type : 2; }; struct HeapAddressDescription { uptr addr; uptr alloc_tid; uptr free_tid; u32 alloc_stack_id; u32 free_stack_id; ChunkAccess chunk_access; void Print() const; }; bool GetHeapAddressInformation(uptr addr, uptr access_size, HeapAddressDescription *descr); bool DescribeAddressIfHeap(uptr addr, uptr access_size = 1); struct StackAddressDescription { uptr addr; uptr tid; uptr offset; uptr frame_pc; uptr access_size; const char *frame_descr; void Print() const; }; bool GetStackAddressInformation(uptr addr, uptr access_size, StackAddressDescription *descr); struct GlobalAddressDescription { uptr addr; // Assume address is close to at most four globals. static const int kMaxGlobals = 4; __asan_global globals[kMaxGlobals]; u32 reg_sites[kMaxGlobals]; uptr access_size; u8 size; void Print(const char *bug_type = "") const; }; bool GetGlobalAddressInformation(uptr addr, uptr access_size, GlobalAddressDescription *descr); bool DescribeAddressIfGlobal(uptr addr, uptr access_size, const char *bug_type); // General function to describe an address. Will try to describe the address as // a shadow, global (variable), stack, or heap address. // bug_type is optional and is used for checking if we're reporting an // initialization-order-fiasco // The proper access_size should be passed for stack, global, and heap // addresses. Defaults to 1. // Each of the *AddressDescription functions has its own Print() member, which // may take access_size and bug_type parameters if needed. void PrintAddressDescription(uptr addr, uptr access_size = 1, const char *bug_type = ""); enum AddressKind { kAddressKindWild, kAddressKindShadow, kAddressKindHeap, kAddressKindStack, kAddressKindGlobal, }; class AddressDescription { struct AddressDescriptionData { AddressKind kind; union { ShadowAddressDescription shadow; HeapAddressDescription heap; StackAddressDescription stack; GlobalAddressDescription global; uptr addr; }; }; AddressDescriptionData data; public: AddressDescription() = default; // shouldLockThreadRegistry allows us to skip locking if we're sure we already // have done it. AddressDescription(uptr addr, bool shouldLockThreadRegistry = true) : AddressDescription(addr, 1, shouldLockThreadRegistry) {} AddressDescription(uptr addr, uptr access_size, bool shouldLockThreadRegistry = true); uptr Address() const { switch (data.kind) { case kAddressKindWild: return data.addr; case kAddressKindShadow: return data.shadow.addr; case kAddressKindHeap: return data.heap.addr; case kAddressKindStack: return data.stack.addr; case kAddressKindGlobal: return data.global.addr; } UNREACHABLE("AddressInformation kind is invalid"); } void Print(const char *bug_descr = nullptr) const { switch (data.kind) { case kAddressKindWild: Printf("Address %p is a wild pointer.\n", data.addr); return; case kAddressKindShadow: return data.shadow.Print(); case kAddressKindHeap: return data.heap.Print(); case kAddressKindStack: return data.stack.Print(); case kAddressKindGlobal: // initialization-order-fiasco has a special Print() return data.global.Print(bug_descr); } UNREACHABLE("AddressInformation kind is invalid"); } void StoreTo(AddressDescriptionData *dst) const { *dst = data; } const ShadowAddressDescription *AsShadow() const { return data.kind == kAddressKindShadow ? &data.shadow : nullptr; } const HeapAddressDescription *AsHeap() const { return data.kind == kAddressKindHeap ? &data.heap : nullptr; } const StackAddressDescription *AsStack() const { return data.kind == kAddressKindStack ? &data.stack : nullptr; } const GlobalAddressDescription *AsGlobal() const { return data.kind == kAddressKindGlobal ? &data.global : nullptr; } }; } // namespace __asan #endif // ASAN_DESCRIPTIONS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_stack.cc0000664000175000017500000000214712443704567025327 0ustar mwhudsonmwhudson//===-- asan_stack.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Code for ASan stack trace. //===----------------------------------------------------------------------===// #include "asan_internal.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_atomic.h" namespace __asan { static atomic_uint32_t malloc_context_size; void SetMallocContextSize(u32 size) { atomic_store(&malloc_context_size, size, memory_order_release); } u32 GetMallocContextSize() { return atomic_load(&malloc_context_size, memory_order_acquire); } } // namespace __asan // ------------------ Interface -------------- {{{1 extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_print_stack_trace() { using namespace __asan; PRINT_CURRENT_STACK(); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_descriptions.cc0000664000175000017500000004025612770316416026726 0ustar mwhudsonmwhudson//===-- asan_descriptions.cc ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan functions for getting information about an address and/or printing it. //===----------------------------------------------------------------------===// #include "asan_descriptions.h" #include "asan_mapping.h" #include "asan_report.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_stackdepot.h" namespace __asan { // Return " (thread_name) " or an empty string if the name is empty. const char *ThreadNameWithParenthesis(AsanThreadContext *t, char buff[], uptr buff_len) { const char *name = t->name; if (name[0] == '\0') return ""; buff[0] = 0; internal_strncat(buff, " (", 3); internal_strncat(buff, name, buff_len - 4); internal_strncat(buff, ")", 2); return buff; } const char *ThreadNameWithParenthesis(u32 tid, char buff[], uptr buff_len) { if (tid == kInvalidTid) return ""; asanThreadRegistry().CheckLocked(); AsanThreadContext *t = GetThreadContextByTidLocked(tid); return ThreadNameWithParenthesis(t, buff, buff_len); } void DescribeThread(AsanThreadContext *context) { CHECK(context); asanThreadRegistry().CheckLocked(); // No need to announce the main thread. if (context->tid == 0 || context->announced) { return; } context->announced = true; char tname[128]; InternalScopedString str(1024); str.append("Thread T%d%s", context->tid, ThreadNameWithParenthesis(context->tid, tname, sizeof(tname))); if (context->parent_tid == kInvalidTid) { str.append(" created by unknown thread\n"); Printf("%s", str.data()); return; } str.append( " created by T%d%s here:\n", context->parent_tid, ThreadNameWithParenthesis(context->parent_tid, tname, sizeof(tname))); Printf("%s", str.data()); StackDepotGet(context->stack_id).Print(); // Recursively described parent thread if needed. if (flags()->print_full_thread_history) { AsanThreadContext *parent_context = GetThreadContextByTidLocked(context->parent_tid); DescribeThread(parent_context); } } // Shadow descriptions static bool GetShadowKind(uptr addr, ShadowKind *shadow_kind) { CHECK(!AddrIsInMem(addr)); if (AddrIsInShadowGap(addr)) { *shadow_kind = kShadowKindGap; } else if (AddrIsInHighShadow(addr)) { *shadow_kind = kShadowKindHigh; } else if (AddrIsInLowShadow(addr)) { *shadow_kind = kShadowKindLow; } else { CHECK(0 && "Address is not in memory and not in shadow?"); return false; } return true; } bool DescribeAddressIfShadow(uptr addr) { ShadowAddressDescription descr; if (!GetShadowAddressInformation(addr, &descr)) return false; descr.Print(); return true; } bool GetShadowAddressInformation(uptr addr, ShadowAddressDescription *descr) { if (AddrIsInMem(addr)) return false; ShadowKind shadow_kind; if (!GetShadowKind(addr, &shadow_kind)) return false; if (shadow_kind != kShadowKindGap) descr->shadow_byte = *(u8 *)addr; descr->addr = addr; descr->kind = shadow_kind; return true; } // Heap descriptions static void GetAccessToHeapChunkInformation(ChunkAccess *descr, AsanChunkView chunk, uptr addr, uptr access_size) { descr->bad_addr = addr; if (chunk.AddrIsAtLeft(addr, access_size, &descr->offset)) { descr->access_type = kAccessTypeLeft; } else if (chunk.AddrIsAtRight(addr, access_size, &descr->offset)) { descr->access_type = kAccessTypeRight; if (descr->offset < 0) { descr->bad_addr -= descr->offset; descr->offset = 0; } } else if (chunk.AddrIsInside(addr, access_size, &descr->offset)) { descr->access_type = kAccessTypeInside; } else { descr->access_type = kAccessTypeUnknown; } descr->chunk_begin = chunk.Beg(); descr->chunk_size = chunk.UsedSize(); descr->alloc_type = chunk.GetAllocType(); } static void PrintHeapChunkAccess(uptr addr, const ChunkAccess &descr) { Decorator d; InternalScopedString str(4096); str.append("%s", d.Location()); switch (descr.access_type) { case kAccessTypeLeft: str.append("%p is located %zd bytes to the left of", (void *)descr.bad_addr, descr.offset); break; case kAccessTypeRight: str.append("%p is located %zd bytes to the right of", (void *)descr.bad_addr, descr.offset); break; case kAccessTypeInside: str.append("%p is located %zd bytes inside of", (void *)descr.bad_addr, descr.offset); break; case kAccessTypeUnknown: str.append( "%p is located somewhere around (this is AddressSanitizer bug!)", (void *)descr.bad_addr); } str.append(" %zu-byte region [%p,%p)\n", descr.chunk_size, (void *)descr.chunk_begin, (void *)(descr.chunk_begin + descr.chunk_size)); str.append("%s", d.EndLocation()); Printf("%s", str.data()); } bool GetHeapAddressInformation(uptr addr, uptr access_size, HeapAddressDescription *descr) { AsanChunkView chunk = FindHeapChunkByAddress(addr); if (!chunk.IsValid()) { return false; } descr->addr = addr; GetAccessToHeapChunkInformation(&descr->chunk_access, chunk, addr, access_size); CHECK_NE(chunk.AllocTid(), kInvalidTid); descr->alloc_tid = chunk.AllocTid(); descr->alloc_stack_id = chunk.GetAllocStackId(); descr->free_tid = chunk.FreeTid(); if (descr->free_tid != kInvalidTid) descr->free_stack_id = chunk.GetFreeStackId(); return true; } static StackTrace GetStackTraceFromId(u32 id) { CHECK(id); StackTrace res = StackDepotGet(id); CHECK(res.trace); return res; } bool DescribeAddressIfHeap(uptr addr, uptr access_size) { HeapAddressDescription descr; if (!GetHeapAddressInformation(addr, access_size, &descr)) { Printf( "AddressSanitizer can not describe address in more detail " "(wild memory access suspected).\n"); return false; } descr.Print(); return true; } // Stack descriptions bool GetStackAddressInformation(uptr addr, uptr access_size, StackAddressDescription *descr) { AsanThread *t = FindThreadByStackAddress(addr); if (!t) return false; descr->addr = addr; descr->tid = t->tid(); // Try to fetch precise stack frame for this access. AsanThread::StackFrameAccess access; if (!t->GetStackFrameAccessByAddr(addr, &access)) { descr->frame_descr = nullptr; return true; } descr->offset = access.offset; descr->access_size = access_size; descr->frame_pc = access.frame_pc; descr->frame_descr = access.frame_descr; #if SANITIZER_PPC64V1 // On PowerPC64 ELFv1, the address of a function actually points to a // three-doubleword data structure with the first field containing // the address of the function's code. descr->frame_pc = *reinterpret_cast(descr->frame_pc); #endif descr->frame_pc += 16; return true; } static void PrintAccessAndVarIntersection(const StackVarDescr &var, uptr addr, uptr access_size, uptr prev_var_end, uptr next_var_beg) { uptr var_end = var.beg + var.size; uptr addr_end = addr + access_size; const char *pos_descr = nullptr; // If the variable [var.beg, var_end) is the nearest variable to the // current memory access, indicate it in the log. if (addr >= var.beg) { if (addr_end <= var_end) pos_descr = "is inside"; // May happen if this is a use-after-return. else if (addr < var_end) pos_descr = "partially overflows"; else if (addr_end <= next_var_beg && next_var_beg - addr_end >= addr - var_end) pos_descr = "overflows"; } else { if (addr_end > var.beg) pos_descr = "partially underflows"; else if (addr >= prev_var_end && addr - prev_var_end >= var.beg - addr_end) pos_descr = "underflows"; } InternalScopedString str(1024); str.append(" [%zd, %zd)", var.beg, var_end); // Render variable name. str.append(" '"); for (uptr i = 0; i < var.name_len; ++i) { str.append("%c", var.name_pos[i]); } str.append("'"); if (pos_descr) { Decorator d; // FIXME: we may want to also print the size of the access here, // but in case of accesses generated by memset it may be confusing. str.append("%s <== Memory access at offset %zd %s this variable%s\n", d.Location(), addr, pos_descr, d.EndLocation()); } else { str.append("\n"); } Printf("%s", str.data()); } bool DescribeAddressIfStack(uptr addr, uptr access_size) { StackAddressDescription descr; if (!GetStackAddressInformation(addr, access_size, &descr)) return false; descr.Print(); return true; } // Global descriptions static void DescribeAddressRelativeToGlobal(uptr addr, uptr access_size, const __asan_global &g) { InternalScopedString str(4096); Decorator d; str.append("%s", d.Location()); if (addr < g.beg) { str.append("%p is located %zd bytes to the left", (void *)addr, g.beg - addr); } else if (addr + access_size > g.beg + g.size) { if (addr < g.beg + g.size) addr = g.beg + g.size; str.append("%p is located %zd bytes to the right", (void *)addr, addr - (g.beg + g.size)); } else { // Can it happen? str.append("%p is located %zd bytes inside", (void *)addr, addr - g.beg); } str.append(" of global variable '%s' defined in '", MaybeDemangleGlobalName(g.name)); PrintGlobalLocation(&str, g); str.append("' (0x%zx) of size %zu\n", g.beg, g.size); str.append("%s", d.EndLocation()); PrintGlobalNameIfASCII(&str, g); Printf("%s", str.data()); } bool GetGlobalAddressInformation(uptr addr, uptr access_size, GlobalAddressDescription *descr) { descr->addr = addr; int globals_num = GetGlobalsForAddress(addr, descr->globals, descr->reg_sites, ARRAY_SIZE(descr->globals)); descr->size = globals_num; descr->access_size = access_size; return globals_num != 0; } bool DescribeAddressIfGlobal(uptr addr, uptr access_size, const char *bug_type) { GlobalAddressDescription descr; if (!GetGlobalAddressInformation(addr, access_size, &descr)) return false; descr.Print(bug_type); return true; } void ShadowAddressDescription::Print() const { Printf("Address %p is located in the %s area.\n", addr, ShadowNames[kind]); } void GlobalAddressDescription::Print(const char *bug_type) const { for (int i = 0; i < size; i++) { DescribeAddressRelativeToGlobal(addr, access_size, globals[i]); if (bug_type && 0 == internal_strcmp(bug_type, "initialization-order-fiasco") && reg_sites[i]) { Printf(" registered at:\n"); StackDepotGet(reg_sites[i]).Print(); } } } void StackAddressDescription::Print() const { Decorator d; char tname[128]; Printf("%s", d.Location()); Printf("Address %p is located in stack of thread T%d%s", addr, tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); if (!frame_descr) { Printf("%s\n", d.EndLocation()); return; } Printf(" at offset %zu in frame%s\n", offset, d.EndLocation()); // Now we print the frame where the alloca has happened. // We print this frame as a stack trace with one element. // The symbolizer may print more than one frame if inlining was involved. // The frame numbers may be different than those in the stack trace printed // previously. That's unfortunate, but I have no better solution, // especially given that the alloca may be from entirely different place // (e.g. use-after-scope, or different thread's stack). Printf("%s", d.EndLocation()); StackTrace alloca_stack(&frame_pc, 1); alloca_stack.Print(); InternalMmapVector vars(16); if (!ParseFrameDescription(frame_descr, &vars)) { Printf( "AddressSanitizer can't parse the stack frame " "descriptor: |%s|\n", frame_descr); // 'addr' is a stack address, so return true even if we can't parse frame return; } uptr n_objects = vars.size(); // Report the number of stack objects. Printf(" This frame has %zu object(s):\n", n_objects); // Report all objects in this frame. for (uptr i = 0; i < n_objects; i++) { uptr prev_var_end = i ? vars[i - 1].beg + vars[i - 1].size : 0; uptr next_var_beg = i + 1 < n_objects ? vars[i + 1].beg : ~(0UL); PrintAccessAndVarIntersection(vars[i], offset, access_size, prev_var_end, next_var_beg); } Printf( "HINT: this may be a false positive if your program uses " "some custom stack unwind mechanism or swapcontext\n"); if (SANITIZER_WINDOWS) Printf(" (longjmp, SEH and C++ exceptions *are* supported)\n"); else Printf(" (longjmp and C++ exceptions *are* supported)\n"); DescribeThread(GetThreadContextByTidLocked(tid)); } void HeapAddressDescription::Print() const { PrintHeapChunkAccess(addr, chunk_access); asanThreadRegistry().CheckLocked(); AsanThreadContext *alloc_thread = GetThreadContextByTidLocked(alloc_tid); StackTrace alloc_stack = GetStackTraceFromId(alloc_stack_id); char tname[128]; Decorator d; AsanThreadContext *free_thread = nullptr; if (free_tid != kInvalidTid) { free_thread = GetThreadContextByTidLocked(free_tid); Printf("%sfreed by thread T%d%s here:%s\n", d.Allocation(), free_thread->tid, ThreadNameWithParenthesis(free_thread, tname, sizeof(tname)), d.EndAllocation()); StackTrace free_stack = GetStackTraceFromId(free_stack_id); free_stack.Print(); Printf("%spreviously allocated by thread T%d%s here:%s\n", d.Allocation(), alloc_thread->tid, ThreadNameWithParenthesis(alloc_thread, tname, sizeof(tname)), d.EndAllocation()); } else { Printf("%sallocated by thread T%d%s here:%s\n", d.Allocation(), alloc_thread->tid, ThreadNameWithParenthesis(alloc_thread, tname, sizeof(tname)), d.EndAllocation()); } alloc_stack.Print(); DescribeThread(GetCurrentThread()); if (free_thread) DescribeThread(free_thread); DescribeThread(alloc_thread); } AddressDescription::AddressDescription(uptr addr, uptr access_size, bool shouldLockThreadRegistry) { if (GetShadowAddressInformation(addr, &data.shadow)) { data.kind = kAddressKindShadow; return; } if (GetHeapAddressInformation(addr, access_size, &data.heap)) { data.kind = kAddressKindHeap; return; } bool isStackMemory = false; if (shouldLockThreadRegistry) { ThreadRegistryLock l(&asanThreadRegistry()); isStackMemory = GetStackAddressInformation(addr, access_size, &data.stack); } else { isStackMemory = GetStackAddressInformation(addr, access_size, &data.stack); } if (isStackMemory) { data.kind = kAddressKindStack; return; } if (GetGlobalAddressInformation(addr, access_size, &data.global)) { data.kind = kAddressKindGlobal; return; } data.kind = kAddressKindWild; addr = 0; } void PrintAddressDescription(uptr addr, uptr access_size, const char *bug_type) { ShadowAddressDescription shadow_descr; if (GetShadowAddressInformation(addr, &shadow_descr)) { shadow_descr.Print(); return; } GlobalAddressDescription global_descr; if (GetGlobalAddressInformation(addr, access_size, &global_descr)) { global_descr.Print(bug_type); return; } StackAddressDescription stack_descr; if (GetStackAddressInformation(addr, access_size, &stack_descr)) { stack_descr.Print(); return; } HeapAddressDescription heap_descr; if (GetHeapAddressInformation(addr, access_size, &heap_descr)) { heap_descr.Print(); return; } // We exhausted our possibilities. Bail out. Printf( "AddressSanitizer can not describe address in more detail " "(wild memory access suspected).\n"); } } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_globals.cc0000664000175000017500000003551112763261640025641 0ustar mwhudsonmwhudson//===-- asan_globals.cc ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Handle globals. //===----------------------------------------------------------------------===// #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_poisoning.h" #include "asan_report.h" #include "asan_stack.h" #include "asan_stats.h" #include "asan_suppressions.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_mutex.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_symbolizer.h" namespace __asan { typedef __asan_global Global; struct ListOfGlobals { const Global *g; ListOfGlobals *next; }; static BlockingMutex mu_for_globals(LINKER_INITIALIZED); static LowLevelAllocator allocator_for_globals; static ListOfGlobals *list_of_all_globals; static const int kDynamicInitGlobalsInitialCapacity = 512; struct DynInitGlobal { Global g; bool initialized; }; typedef InternalMmapVector VectorOfGlobals; // Lazy-initialized and never deleted. static VectorOfGlobals *dynamic_init_globals; // We want to remember where a certain range of globals was registered. struct GlobalRegistrationSite { u32 stack_id; Global *g_first, *g_last; }; typedef InternalMmapVector GlobalRegistrationSiteVector; static GlobalRegistrationSiteVector *global_registration_site_vector; ALWAYS_INLINE void PoisonShadowForGlobal(const Global *g, u8 value) { FastPoisonShadow(g->beg, g->size_with_redzone, value); } ALWAYS_INLINE void PoisonRedZones(const Global &g) { uptr aligned_size = RoundUpTo(g.size, SHADOW_GRANULARITY); FastPoisonShadow(g.beg + aligned_size, g.size_with_redzone - aligned_size, kAsanGlobalRedzoneMagic); if (g.size != aligned_size) { FastPoisonShadowPartialRightRedzone( g.beg + RoundDownTo(g.size, SHADOW_GRANULARITY), g.size % SHADOW_GRANULARITY, SHADOW_GRANULARITY, kAsanGlobalRedzoneMagic); } } const uptr kMinimalDistanceFromAnotherGlobal = 64; static bool IsAddressNearGlobal(uptr addr, const __asan_global &g) { if (addr <= g.beg - kMinimalDistanceFromAnotherGlobal) return false; if (addr >= g.beg + g.size_with_redzone) return false; return true; } static void ReportGlobal(const Global &g, const char *prefix) { Report("%s Global[%p]: beg=%p size=%zu/%zu name=%s module=%s dyn_init=%zu\n", prefix, &g, (void *)g.beg, g.size, g.size_with_redzone, g.name, g.module_name, g.has_dynamic_init); if (g.location) { Report(" location (%p): name=%s[%p], %d %d\n", g.location, g.location->filename, g.location->filename, g.location->line_no, g.location->column_no); } } static u32 FindRegistrationSite(const Global *g) { mu_for_globals.CheckLocked(); CHECK(global_registration_site_vector); for (uptr i = 0, n = global_registration_site_vector->size(); i < n; i++) { GlobalRegistrationSite &grs = (*global_registration_site_vector)[i]; if (g >= grs.g_first && g <= grs.g_last) return grs.stack_id; } return 0; } int GetGlobalsForAddress(uptr addr, Global *globals, u32 *reg_sites, int max_globals) { if (!flags()->report_globals) return 0; BlockingMutexLock lock(&mu_for_globals); int res = 0; for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) { const Global &g = *l->g; if (flags()->report_globals >= 2) ReportGlobal(g, "Search"); if (IsAddressNearGlobal(addr, g)) { globals[res] = g; if (reg_sites) reg_sites[res] = FindRegistrationSite(&g); res++; if (res == max_globals) break; } } return res; } enum GlobalSymbolState { UNREGISTERED = 0, REGISTERED = 1 }; // Check ODR violation for given global G via special ODR indicator. We use // this method in case compiler instruments global variables through their // local aliases. static void CheckODRViolationViaIndicator(const Global *g) { u8 *odr_indicator = reinterpret_cast(g->odr_indicator); if (*odr_indicator == UNREGISTERED) { *odr_indicator = REGISTERED; return; } // If *odr_indicator is DEFINED, some module have already registered // externally visible symbol with the same name. This is an ODR violation. for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) { if (g->odr_indicator == l->g->odr_indicator && (flags()->detect_odr_violation >= 2 || g->size != l->g->size) && !IsODRViolationSuppressed(g->name)) ReportODRViolation(g, FindRegistrationSite(g), l->g, FindRegistrationSite(l->g)); } } // Check ODR violation for given global G by checking if it's already poisoned. // We use this method in case compiler doesn't use private aliases for global // variables. static void CheckODRViolationViaPoisoning(const Global *g) { if (__asan_region_is_poisoned(g->beg, g->size_with_redzone)) { // This check may not be enough: if the first global is much larger // the entire redzone of the second global may be within the first global. for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) { if (g->beg == l->g->beg && (flags()->detect_odr_violation >= 2 || g->size != l->g->size) && !IsODRViolationSuppressed(g->name)) ReportODRViolation(g, FindRegistrationSite(g), l->g, FindRegistrationSite(l->g)); } } } // Clang provides two different ways for global variables protection: // it can poison the global itself or its private alias. In former // case we may poison same symbol multiple times, that can help us to // cheaply detect ODR violation: if we try to poison an already poisoned // global, we have ODR violation error. // In latter case, we poison each symbol exactly once, so we use special // indicator symbol to perform similar check. // In either case, compiler provides a special odr_indicator field to Global // structure, that can contain two kinds of values: // 1) Non-zero value. In this case, odr_indicator is an address of // corresponding indicator variable for given global. // 2) Zero. This means that we don't use private aliases for global variables // and can freely check ODR violation with the first method. // // This routine chooses between two different methods of ODR violation // detection. static inline bool UseODRIndicator(const Global *g) { // Use ODR indicator method iff use_odr_indicator flag is set and // indicator symbol address is not 0. return flags()->use_odr_indicator && g->odr_indicator > 0; } // Register a global variable. // This function may be called more than once for every global // so we store the globals in a map. static void RegisterGlobal(const Global *g) { CHECK(asan_inited); if (flags()->report_globals >= 2) ReportGlobal(*g, "Added"); CHECK(flags()->report_globals); CHECK(AddrIsInMem(g->beg)); if (!AddrIsAlignedByGranularity(g->beg)) { Report("The following global variable is not properly aligned.\n"); Report("This may happen if another global with the same name\n"); Report("resides in another non-instrumented module.\n"); Report("Or the global comes from a C file built w/o -fno-common.\n"); Report("In either case this is likely an ODR violation bug,\n"); Report("but AddressSanitizer can not provide more details.\n"); ReportODRViolation(g, FindRegistrationSite(g), g, FindRegistrationSite(g)); CHECK(AddrIsAlignedByGranularity(g->beg)); } CHECK(AddrIsAlignedByGranularity(g->size_with_redzone)); if (flags()->detect_odr_violation) { // Try detecting ODR (One Definition Rule) violation, i.e. the situation // where two globals with the same name are defined in different modules. if (UseODRIndicator(g)) CheckODRViolationViaIndicator(g); else CheckODRViolationViaPoisoning(g); } if (CanPoisonMemory()) PoisonRedZones(*g); ListOfGlobals *l = new(allocator_for_globals) ListOfGlobals; l->g = g; l->next = list_of_all_globals; list_of_all_globals = l; if (g->has_dynamic_init) { if (!dynamic_init_globals) { dynamic_init_globals = new(allocator_for_globals) VectorOfGlobals(kDynamicInitGlobalsInitialCapacity); } DynInitGlobal dyn_global = { *g, false }; dynamic_init_globals->push_back(dyn_global); } } static void UnregisterGlobal(const Global *g) { CHECK(asan_inited); if (flags()->report_globals >= 2) ReportGlobal(*g, "Removed"); CHECK(flags()->report_globals); CHECK(AddrIsInMem(g->beg)); CHECK(AddrIsAlignedByGranularity(g->beg)); CHECK(AddrIsAlignedByGranularity(g->size_with_redzone)); if (CanPoisonMemory()) PoisonShadowForGlobal(g, 0); // We unpoison the shadow memory for the global but we do not remove it from // the list because that would require O(n^2) time with the current list // implementation. It might not be worth doing anyway. // Release ODR indicator. if (UseODRIndicator(g)) { u8 *odr_indicator = reinterpret_cast(g->odr_indicator); *odr_indicator = UNREGISTERED; } } void StopInitOrderChecking() { BlockingMutexLock lock(&mu_for_globals); if (!flags()->check_initialization_order || !dynamic_init_globals) return; flags()->check_initialization_order = false; for (uptr i = 0, n = dynamic_init_globals->size(); i < n; ++i) { DynInitGlobal &dyn_g = (*dynamic_init_globals)[i]; const Global *g = &dyn_g.g; // Unpoison the whole global. PoisonShadowForGlobal(g, 0); // Poison redzones back. PoisonRedZones(*g); } } static bool IsASCII(unsigned char c) { return /*0x00 <= c &&*/ c <= 0x7F; } const char *MaybeDemangleGlobalName(const char *name) { // We can spoil names of globals with C linkage, so use an heuristic // approach to check if the name should be demangled. bool should_demangle = false; if (name[0] == '_' && name[1] == 'Z') should_demangle = true; else if (SANITIZER_WINDOWS && name[0] == '\01' && name[1] == '?') should_demangle = true; return should_demangle ? Symbolizer::GetOrInit()->Demangle(name) : name; } // Check if the global is a zero-terminated ASCII string. If so, print it. void PrintGlobalNameIfASCII(InternalScopedString *str, const __asan_global &g) { for (uptr p = g.beg; p < g.beg + g.size - 1; p++) { unsigned char c = *(unsigned char *)p; if (c == '\0' || !IsASCII(c)) return; } if (*(char *)(g.beg + g.size - 1) != '\0') return; str->append(" '%s' is ascii string '%s'\n", MaybeDemangleGlobalName(g.name), (char *)g.beg); } static const char *GlobalFilename(const __asan_global &g) { const char *res = g.module_name; // Prefer the filename from source location, if is available. if (g.location) res = g.location->filename; CHECK(res); return res; } void PrintGlobalLocation(InternalScopedString *str, const __asan_global &g) { str->append("%s", GlobalFilename(g)); if (!g.location) return; if (g.location->line_no) str->append(":%d", g.location->line_no); if (g.location->column_no) str->append(":%d", g.location->column_no); } } // namespace __asan // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT // Apply __asan_register_globals to all globals found in the same loaded // executable or shared library as `flag'. The flag tracks whether globals have // already been registered or not for this image. void __asan_register_image_globals(uptr *flag) { if (*flag) return; AsanApplyToGlobals(__asan_register_globals, flag); *flag = 1; } // This mirrors __asan_register_image_globals. void __asan_unregister_image_globals(uptr *flag) { if (!*flag) return; AsanApplyToGlobals(__asan_unregister_globals, flag); *flag = 0; } // Register an array of globals. void __asan_register_globals(__asan_global *globals, uptr n) { if (!flags()->report_globals) return; GET_STACK_TRACE_MALLOC; u32 stack_id = StackDepotPut(stack); BlockingMutexLock lock(&mu_for_globals); if (!global_registration_site_vector) global_registration_site_vector = new(allocator_for_globals) GlobalRegistrationSiteVector(128); GlobalRegistrationSite site = {stack_id, &globals[0], &globals[n - 1]}; global_registration_site_vector->push_back(site); if (flags()->report_globals >= 2) { PRINT_CURRENT_STACK(); Printf("=== ID %d; %p %p\n", stack_id, &globals[0], &globals[n - 1]); } for (uptr i = 0; i < n; i++) { RegisterGlobal(&globals[i]); } } // Unregister an array of globals. // We must do this when a shared objects gets dlclosed. void __asan_unregister_globals(__asan_global *globals, uptr n) { if (!flags()->report_globals) return; BlockingMutexLock lock(&mu_for_globals); for (uptr i = 0; i < n; i++) { UnregisterGlobal(&globals[i]); } } // This method runs immediately prior to dynamic initialization in each TU, // when all dynamically initialized globals are unpoisoned. This method // poisons all global variables not defined in this TU, so that a dynamic // initializer can only touch global variables in the same TU. void __asan_before_dynamic_init(const char *module_name) { if (!flags()->check_initialization_order || !CanPoisonMemory() || !dynamic_init_globals) return; bool strict_init_order = flags()->strict_init_order; CHECK(module_name); CHECK(asan_inited); BlockingMutexLock lock(&mu_for_globals); if (flags()->report_globals >= 3) Printf("DynInitPoison module: %s\n", module_name); for (uptr i = 0, n = dynamic_init_globals->size(); i < n; ++i) { DynInitGlobal &dyn_g = (*dynamic_init_globals)[i]; const Global *g = &dyn_g.g; if (dyn_g.initialized) continue; if (g->module_name != module_name) PoisonShadowForGlobal(g, kAsanInitializationOrderMagic); else if (!strict_init_order) dyn_g.initialized = true; } } // This method runs immediately after dynamic initialization in each TU, when // all dynamically initialized globals except for those defined in the current // TU are poisoned. It simply unpoisons all dynamically initialized globals. void __asan_after_dynamic_init() { if (!flags()->check_initialization_order || !CanPoisonMemory() || !dynamic_init_globals) return; CHECK(asan_inited); BlockingMutexLock lock(&mu_for_globals); // FIXME: Optionally report that we're unpoisoning globals from a module. for (uptr i = 0, n = dynamic_init_globals->size(); i < n; ++i) { DynInitGlobal &dyn_g = (*dynamic_init_globals)[i]; const Global *g = &dyn_g.g; if (!dyn_g.initialized) { // Unpoison the whole global. PoisonShadowForGlobal(g, 0); // Poison redzones back. PoisonRedZones(*g); } } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_report.cc0000664000175000017500000004223412770565412025533 0ustar mwhudsonmwhudson//===-- asan_report.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This file contains error reporting code. //===----------------------------------------------------------------------===// #include "asan_errors.h" #include "asan_flags.h" #include "asan_descriptions.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_report.h" #include "asan_scariness_score.h" #include "asan_stack.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_report_decorator.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_symbolizer.h" namespace __asan { // -------------------- User-specified callbacks ----------------- {{{1 static void (*error_report_callback)(const char*); static char *error_message_buffer = nullptr; static uptr error_message_buffer_pos = 0; static BlockingMutex error_message_buf_mutex(LINKER_INITIALIZED); static const unsigned kAsanBuggyPcPoolSize = 25; static __sanitizer::atomic_uintptr_t AsanBuggyPcPool[kAsanBuggyPcPoolSize]; void AppendToErrorMessageBuffer(const char *buffer) { BlockingMutexLock l(&error_message_buf_mutex); if (!error_message_buffer) { error_message_buffer = (char*)MmapOrDieQuietly(kErrorMessageBufferSize, __func__); error_message_buffer_pos = 0; } uptr length = internal_strlen(buffer); RAW_CHECK(kErrorMessageBufferSize >= error_message_buffer_pos); uptr remaining = kErrorMessageBufferSize - error_message_buffer_pos; internal_strncpy(error_message_buffer + error_message_buffer_pos, buffer, remaining); error_message_buffer[kErrorMessageBufferSize - 1] = '\0'; // FIXME: reallocate the buffer instead of truncating the message. error_message_buffer_pos += Min(remaining, length); } // ---------------------- Helper functions ----------------------- {{{1 void PrintMemoryByte(InternalScopedString *str, const char *before, u8 byte, bool in_shadow, const char *after) { Decorator d; str->append("%s%s%x%x%s%s", before, in_shadow ? d.ShadowByte(byte) : d.MemoryByte(), byte >> 4, byte & 15, in_shadow ? d.EndShadowByte() : d.EndMemoryByte(), after); } static void PrintZoneForPointer(uptr ptr, uptr zone_ptr, const char *zone_name) { if (zone_ptr) { if (zone_name) { Printf("malloc_zone_from_ptr(%p) = %p, which is %s\n", ptr, zone_ptr, zone_name); } else { Printf("malloc_zone_from_ptr(%p) = %p, which doesn't have a name\n", ptr, zone_ptr); } } else { Printf("malloc_zone_from_ptr(%p) = 0\n", ptr); } } // ---------------------- Address Descriptions ------------------- {{{1 bool ParseFrameDescription(const char *frame_descr, InternalMmapVector *vars) { CHECK(frame_descr); char *p; // This string is created by the compiler and has the following form: // "n alloc_1 alloc_2 ... alloc_n" // where alloc_i looks like "offset size len ObjectName". uptr n_objects = (uptr)internal_simple_strtoll(frame_descr, &p, 10); if (n_objects == 0) return false; for (uptr i = 0; i < n_objects; i++) { uptr beg = (uptr)internal_simple_strtoll(p, &p, 10); uptr size = (uptr)internal_simple_strtoll(p, &p, 10); uptr len = (uptr)internal_simple_strtoll(p, &p, 10); if (beg == 0 || size == 0 || *p != ' ') { return false; } p++; StackVarDescr var = {beg, size, p, len}; vars->push_back(var); p += len; } return true; } // -------------------- Different kinds of reports ----------------- {{{1 // Use ScopedInErrorReport to run common actions just before and // immediately after printing error report. class ScopedInErrorReport { public: explicit ScopedInErrorReport(bool fatal = false) { halt_on_error_ = fatal || flags()->halt_on_error; if (lock_.TryLock()) { StartReporting(); return; } // ASan found two bugs in different threads simultaneously. u32 current_tid = GetCurrentTidOrInvalid(); if (reporting_thread_tid_ == current_tid || reporting_thread_tid_ == kInvalidTid) { // This is either asynch signal or nested error during error reporting. // Fail simple to avoid deadlocks in Report(). // Can't use Report() here because of potential deadlocks // in nested signal handlers. const char msg[] = "AddressSanitizer: nested bug in the same thread, " "aborting.\n"; WriteToFile(kStderrFd, msg, sizeof(msg)); internal__exit(common_flags()->exitcode); } if (halt_on_error_) { // Do not print more than one report, otherwise they will mix up. // Error reporting functions shouldn't return at this situation, as // they are effectively no-returns. Report("AddressSanitizer: while reporting a bug found another one. " "Ignoring.\n"); // Sleep long enough to make sure that the thread which started // to print an error report will finish doing it. SleepForSeconds(Max(100, flags()->sleep_before_dying + 1)); // If we're still not dead for some reason, use raw _exit() instead of // Die() to bypass any additional checks. internal__exit(common_flags()->exitcode); } else { // The other thread will eventually finish reporting // so it's safe to wait lock_.Lock(); } StartReporting(); } ~ScopedInErrorReport() { ASAN_ON_ERROR(); if (current_error_.IsValid()) current_error_.Print(); // Make sure the current thread is announced. DescribeThread(GetCurrentThread()); // We may want to grab this lock again when printing stats. asanThreadRegistry().Unlock(); // Print memory stats. if (flags()->print_stats) __asan_print_accumulated_stats(); if (common_flags()->print_cmdline) PrintCmdline(); // Copy the message buffer so that we could start logging without holding a // lock that gets aquired during printing. InternalScopedBuffer buffer_copy(kErrorMessageBufferSize); { BlockingMutexLock l(&error_message_buf_mutex); internal_memcpy(buffer_copy.data(), error_message_buffer, kErrorMessageBufferSize); } LogFullErrorReport(buffer_copy.data()); if (error_report_callback) { error_report_callback(buffer_copy.data()); } // In halt_on_error = false mode, reset the current error object (before // unlocking). if (!halt_on_error_) internal_memset(¤t_error_, 0, sizeof(current_error_)); CommonSanitizerReportMutex.Unlock(); reporting_thread_tid_ = kInvalidTid; lock_.Unlock(); if (halt_on_error_) { Report("ABORTING\n"); Die(); } } void ReportError(const ErrorDescription &description) { // Can only report one error per ScopedInErrorReport. CHECK_EQ(current_error_.kind, kErrorKindInvalid); current_error_ = description; } static ErrorDescription &CurrentError() { return current_error_; } private: void StartReporting() { // Make sure the registry and sanitizer report mutexes are locked while // we're printing an error report. // We can lock them only here to avoid self-deadlock in case of // recursive reports. asanThreadRegistry().Lock(); CommonSanitizerReportMutex.Lock(); reporting_thread_tid_ = GetCurrentTidOrInvalid(); Printf("====================================================" "=============\n"); } static StaticSpinMutex lock_; static u32 reporting_thread_tid_; // Error currently being reported. This enables the destructor to interact // with the debugger and point it to an error description. static ErrorDescription current_error_; bool halt_on_error_; }; StaticSpinMutex ScopedInErrorReport::lock_; u32 ScopedInErrorReport::reporting_thread_tid_ = kInvalidTid; ErrorDescription ScopedInErrorReport::current_error_; void ReportStackOverflow(const SignalContext &sig) { ScopedInErrorReport in_report(/*fatal*/ true); ErrorStackOverflow error(GetCurrentTidOrInvalid(), sig); in_report.ReportError(error); } void ReportDeadlySignal(int signo, const SignalContext &sig) { ScopedInErrorReport in_report(/*fatal*/ true); ErrorDeadlySignal error(GetCurrentTidOrInvalid(), sig, signo); in_report.ReportError(error); } void ReportDoubleFree(uptr addr, BufferedStackTrace *free_stack) { ScopedInErrorReport in_report; ErrorDoubleFree error(GetCurrentTidOrInvalid(), free_stack, addr); in_report.ReportError(error); } void ReportNewDeleteSizeMismatch(uptr addr, uptr delete_size, BufferedStackTrace *free_stack) { ScopedInErrorReport in_report; ErrorNewDeleteSizeMismatch error(GetCurrentTidOrInvalid(), free_stack, addr, delete_size); in_report.ReportError(error); } void ReportFreeNotMalloced(uptr addr, BufferedStackTrace *free_stack) { ScopedInErrorReport in_report; ErrorFreeNotMalloced error(GetCurrentTidOrInvalid(), free_stack, addr); in_report.ReportError(error); } void ReportAllocTypeMismatch(uptr addr, BufferedStackTrace *free_stack, AllocType alloc_type, AllocType dealloc_type) { ScopedInErrorReport in_report; ErrorAllocTypeMismatch error(GetCurrentTidOrInvalid(), free_stack, addr, alloc_type, dealloc_type); in_report.ReportError(error); } void ReportMallocUsableSizeNotOwned(uptr addr, BufferedStackTrace *stack) { ScopedInErrorReport in_report; ErrorMallocUsableSizeNotOwned error(GetCurrentTidOrInvalid(), stack, addr); in_report.ReportError(error); } void ReportSanitizerGetAllocatedSizeNotOwned(uptr addr, BufferedStackTrace *stack) { ScopedInErrorReport in_report; ErrorSanitizerGetAllocatedSizeNotOwned error(GetCurrentTidOrInvalid(), stack, addr); in_report.ReportError(error); } void ReportStringFunctionMemoryRangesOverlap(const char *function, const char *offset1, uptr length1, const char *offset2, uptr length2, BufferedStackTrace *stack) { ScopedInErrorReport in_report; ErrorStringFunctionMemoryRangesOverlap error( GetCurrentTidOrInvalid(), stack, (uptr)offset1, length1, (uptr)offset2, length2, function); in_report.ReportError(error); } void ReportStringFunctionSizeOverflow(uptr offset, uptr size, BufferedStackTrace *stack) { ScopedInErrorReport in_report; ErrorStringFunctionSizeOverflow error(GetCurrentTidOrInvalid(), stack, offset, size); in_report.ReportError(error); } void ReportBadParamsToAnnotateContiguousContainer(uptr beg, uptr end, uptr old_mid, uptr new_mid, BufferedStackTrace *stack) { ScopedInErrorReport in_report; ErrorBadParamsToAnnotateContiguousContainer error( GetCurrentTidOrInvalid(), stack, beg, end, old_mid, new_mid); in_report.ReportError(error); } void ReportODRViolation(const __asan_global *g1, u32 stack_id1, const __asan_global *g2, u32 stack_id2) { ScopedInErrorReport in_report; ErrorODRViolation error(GetCurrentTidOrInvalid(), g1, stack_id1, g2, stack_id2); in_report.ReportError(error); } // ----------------------- CheckForInvalidPointerPair ----------- {{{1 static NOINLINE void ReportInvalidPointerPair(uptr pc, uptr bp, uptr sp, uptr a1, uptr a2) { ScopedInErrorReport in_report; ErrorInvalidPointerPair error(GetCurrentTidOrInvalid(), pc, bp, sp, a1, a2); in_report.ReportError(error); } static INLINE void CheckForInvalidPointerPair(void *p1, void *p2) { if (!flags()->detect_invalid_pointer_pairs) return; uptr a1 = reinterpret_cast(p1); uptr a2 = reinterpret_cast(p2); AsanChunkView chunk1 = FindHeapChunkByAddress(a1); AsanChunkView chunk2 = FindHeapChunkByAddress(a2); bool valid1 = chunk1.IsAllocated(); bool valid2 = chunk2.IsAllocated(); if (!valid1 || !valid2 || !chunk1.Eq(chunk2)) { GET_CALLER_PC_BP_SP; return ReportInvalidPointerPair(pc, bp, sp, a1, a2); } } // ----------------------- Mac-specific reports ----------------- {{{1 void ReportMacMzReallocUnknown(uptr addr, uptr zone_ptr, const char *zone_name, BufferedStackTrace *stack) { ScopedInErrorReport in_report; Printf("mz_realloc(%p) -- attempting to realloc unallocated memory.\n" "This is an unrecoverable problem, exiting now.\n", addr); PrintZoneForPointer(addr, zone_ptr, zone_name); stack->Print(); DescribeAddressIfHeap(addr); } // -------------- SuppressErrorReport -------------- {{{1 // Avoid error reports duplicating for ASan recover mode. static bool SuppressErrorReport(uptr pc) { if (!common_flags()->suppress_equal_pcs) return false; for (unsigned i = 0; i < kAsanBuggyPcPoolSize; i++) { uptr cmp = atomic_load_relaxed(&AsanBuggyPcPool[i]); if (cmp == 0 && atomic_compare_exchange_strong(&AsanBuggyPcPool[i], &cmp, pc, memory_order_relaxed)) return false; if (cmp == pc) return true; } Die(); } void ReportGenericError(uptr pc, uptr bp, uptr sp, uptr addr, bool is_write, uptr access_size, u32 exp, bool fatal) { if (!fatal && SuppressErrorReport(pc)) return; ENABLE_FRAME_POINTER; // Optimization experiments. // The experiments can be used to evaluate potential optimizations that remove // instrumentation (assess false negatives). Instead of completely removing // some instrumentation, compiler can emit special calls into runtime // (e.g. __asan_report_exp_load1 instead of __asan_report_load1) and pass // mask of experiments (exp). // The reaction to a non-zero value of exp is to be defined. (void)exp; ScopedInErrorReport in_report(fatal); ErrorGeneric error(GetCurrentTidOrInvalid(), pc, bp, sp, addr, is_write, access_size); in_report.ReportError(error); } } // namespace __asan // --------------------------- Interface --------------------- {{{1 using namespace __asan; // NOLINT void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, int is_write, uptr access_size, u32 exp) { ENABLE_FRAME_POINTER; bool fatal = flags()->halt_on_error; ReportGenericError(pc, bp, sp, addr, is_write, access_size, exp, fatal); } void NOINLINE __asan_set_error_report_callback(void (*callback)(const char*)) { BlockingMutexLock l(&error_message_buf_mutex); error_report_callback = callback; } void __asan_describe_address(uptr addr) { // Thread registry must be locked while we're describing an address. asanThreadRegistry().Lock(); PrintAddressDescription(addr, 1, ""); asanThreadRegistry().Unlock(); } int __asan_report_present() { return ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric; } uptr __asan_get_report_pc() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError().Generic.pc; return 0; } uptr __asan_get_report_bp() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError().Generic.bp; return 0; } uptr __asan_get_report_sp() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError().Generic.sp; return 0; } uptr __asan_get_report_address() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError() .Generic.addr_description.Address(); return 0; } int __asan_get_report_access_type() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError().Generic.is_write; return 0; } uptr __asan_get_report_access_size() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError().Generic.access_size; return 0; } const char *__asan_get_report_description() { if (ScopedInErrorReport::CurrentError().kind == kErrorKindGeneric) return ScopedInErrorReport::CurrentError().Generic.bug_descr; return nullptr; } extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_ptr_sub(void *a, void *b) { CheckForInvalidPointerPair(a, b); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_ptr_cmp(void *a, void *b) { CheckForInvalidPointerPair(a, b); } } // extern "C" #if !SANITIZER_SUPPORTS_WEAK_HOOKS // Provide default implementation of __asan_on_error that does nothing // and may be overriden by user. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE void __asan_on_error() {} #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_internal.h0000664000175000017500000001242712764260147025677 0ustar mwhudsonmwhudson//===-- asan_internal.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header which defines various general utilities. //===----------------------------------------------------------------------===// #ifndef ASAN_INTERNAL_H #define ASAN_INTERNAL_H #include "asan_flags.h" #include "asan_interface_internal.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_libc.h" #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) # error "The AddressSanitizer run-time should not be" " instrumented by AddressSanitizer" #endif // Build-time configuration options. // If set, asan will intercept C++ exception api call(s). #ifndef ASAN_HAS_EXCEPTIONS # define ASAN_HAS_EXCEPTIONS 1 #endif // If set, values like allocator chunk size, as well as defaults for some flags // will be changed towards less memory overhead. #ifndef ASAN_LOW_MEMORY # if SANITIZER_IOS || (SANITIZER_WORDSIZE == 32) # define ASAN_LOW_MEMORY 1 # else # define ASAN_LOW_MEMORY 0 # endif #endif #ifndef ASAN_DYNAMIC # ifdef PIC # define ASAN_DYNAMIC 1 # else # define ASAN_DYNAMIC 0 # endif #endif // All internal functions in asan reside inside the __asan namespace // to avoid namespace collisions with the user programs. // Separate namespace also makes it simpler to distinguish the asan run-time // functions from the instrumented user code in a profile. namespace __asan { class AsanThread; using __sanitizer::StackTrace; void AsanInitFromRtl(); // asan_win.cc void InitializePlatformExceptionHandlers(); // asan_win.cc / asan_posix.cc const char *DescribeSignalOrException(int signo); // asan_rtl.cc void NORETURN ShowStatsAndAbort(); // asan_malloc_linux.cc / asan_malloc_mac.cc void ReplaceSystemMalloc(); // asan_linux.cc / asan_mac.cc / asan_win.cc void *AsanDoesNotSupportStaticLinkage(); void AsanCheckDynamicRTPrereqs(); void AsanCheckIncompatibleRT(); // Support function for __asan_(un)register_image_globals. Searches for the // loaded image containing `needle' and then enumerates all global metadata // structures declared in that image, applying `op' (e.g., // __asan_(un)register_globals) to them. typedef void (*globals_op_fptr)(__asan_global *, uptr); void AsanApplyToGlobals(globals_op_fptr op, const void *needle); void AsanOnDeadlySignal(int, void *siginfo, void *context); void ReadContextStack(void *context, uptr *stack, uptr *ssize); void StopInitOrderChecking(); // Wrapper for TLS/TSD. void AsanTSDInit(void (*destructor)(void *tsd)); void *AsanTSDGet(); void AsanTSDSet(void *tsd); void PlatformTSDDtor(void *tsd); void AppendToErrorMessageBuffer(const char *buffer); void *AsanDlSymNext(const char *sym); void ReserveShadowMemoryRange(uptr beg, uptr end, const char *name); // Platform-specific options. #if SANITIZER_MAC bool PlatformHasDifferentMemcpyAndMemmove(); # define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE \ (PlatformHasDifferentMemcpyAndMemmove()) #elif SANITIZER_WINDOWS64 # define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE false #else # define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE true #endif // SANITIZER_MAC // Add convenient macro for interface functions that may be represented as // weak hooks. #define ASAN_MALLOC_HOOK(ptr, size) \ do { \ if (&__sanitizer_malloc_hook) __sanitizer_malloc_hook(ptr, size); \ RunMallocHooks(ptr, size); \ } while (false) #define ASAN_FREE_HOOK(ptr) \ do { \ if (&__sanitizer_free_hook) __sanitizer_free_hook(ptr); \ RunFreeHooks(ptr); \ } while (false) #define ASAN_ON_ERROR() \ if (&__asan_on_error) __asan_on_error() extern int asan_inited; // Used to avoid infinite recursion in __asan_init(). extern bool asan_init_is_running; extern void (*death_callback)(void); // These magic values are written to shadow for better error reporting. const int kAsanHeapLeftRedzoneMagic = 0xfa; const int kAsanHeapFreeMagic = 0xfd; const int kAsanStackLeftRedzoneMagic = 0xf1; const int kAsanStackMidRedzoneMagic = 0xf2; const int kAsanStackRightRedzoneMagic = 0xf3; const int kAsanStackAfterReturnMagic = 0xf5; const int kAsanInitializationOrderMagic = 0xf6; const int kAsanUserPoisonedMemoryMagic = 0xf7; const int kAsanContiguousContainerOOBMagic = 0xfc; const int kAsanStackUseAfterScopeMagic = 0xf8; const int kAsanGlobalRedzoneMagic = 0xf9; const int kAsanInternalHeapMagic = 0xfe; const int kAsanArrayCookieMagic = 0xac; const int kAsanIntraObjectRedzone = 0xbb; const int kAsanAllocaLeftMagic = 0xca; const int kAsanAllocaRightMagic = 0xcb; static const uptr kCurrentStackFrameMagic = 0x41B58AB3; static const uptr kRetiredStackFrameMagic = 0x45E0360E; } // namespace __asan #endif // ASAN_INTERNAL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_fake_stack.h0000664000175000017500000001556012751157644026162 0ustar mwhudsonmwhudson//===-- asan_fake_stack.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_fake_stack.cc, implements FakeStack. //===----------------------------------------------------------------------===// #ifndef ASAN_FAKE_STACK_H #define ASAN_FAKE_STACK_H #include "sanitizer_common/sanitizer_common.h" namespace __asan { // Fake stack frame contains local variables of one function. struct FakeFrame { uptr magic; // Modified by the instrumented code. uptr descr; // Modified by the instrumented code. uptr pc; // Modified by the instrumented code. uptr real_stack; }; // For each thread we create a fake stack and place stack objects on this fake // stack instead of the real stack. The fake stack is not really a stack but // a fast malloc-like allocator so that when a function exits the fake stack // is not popped but remains there for quite some time until gets used again. // So, we poison the objects on the fake stack when function returns. // It helps us find use-after-return bugs. // // The FakeStack objects is allocated by a single mmap call and has no other // pointers. The size of the fake stack depends on the actual thread stack size // and thus can not be a constant. // stack_size is a power of two greater or equal to the thread's stack size; // we store it as its logarithm (stack_size_log). // FakeStack has kNumberOfSizeClasses (11) size classes, each size class // is a power of two, starting from 64 bytes. Each size class occupies // stack_size bytes and thus can allocate // NumberOfFrames=(stack_size/BytesInSizeClass) fake frames (also a power of 2). // For each size class we have NumberOfFrames allocation flags, // each flag indicates whether the given frame is currently allocated. // All flags for size classes 0 .. 10 are stored in a single contiguous region // followed by another contiguous region which contains the actual memory for // size classes. The addresses are computed by GetFlags and GetFrame without // any memory accesses solely based on 'this' and stack_size_log. // Allocate() flips the appropriate allocation flag atomically, thus achieving // async-signal safety. // This allocator does not have quarantine per se, but it tries to allocate the // frames in round robin fashion to maximize the delay between a deallocation // and the next allocation. class FakeStack { static const uptr kMinStackFrameSizeLog = 6; // Min frame is 64B. static const uptr kMaxStackFrameSizeLog = 16; // Max stack frame is 64K. public: static const uptr kNumberOfSizeClasses = kMaxStackFrameSizeLog - kMinStackFrameSizeLog + 1; // CTOR: create the FakeStack as a single mmap-ed object. static FakeStack *Create(uptr stack_size_log); void Destroy(int tid); // stack_size_log is at least 15 (stack_size >= 32K). static uptr SizeRequiredForFlags(uptr stack_size_log) { return ((uptr)1) << (stack_size_log + 1 - kMinStackFrameSizeLog); } // Each size class occupies stack_size bytes. static uptr SizeRequiredForFrames(uptr stack_size_log) { return (((uptr)1) << stack_size_log) * kNumberOfSizeClasses; } // Number of bytes requires for the whole object. static uptr RequiredSize(uptr stack_size_log) { return kFlagsOffset + SizeRequiredForFlags(stack_size_log) + SizeRequiredForFrames(stack_size_log); } // Offset of the given flag from the first flag. // The flags for class 0 begin at offset 000000000 // The flags for class 1 begin at offset 100000000 // ....................2................ 110000000 // ....................3................ 111000000 // and so on. static uptr FlagsOffset(uptr stack_size_log, uptr class_id) { uptr t = kNumberOfSizeClasses - 1 - class_id; const uptr all_ones = (((uptr)1) << (kNumberOfSizeClasses - 1)) - 1; return ((all_ones >> t) << t) << (stack_size_log - 15); } static uptr NumberOfFrames(uptr stack_size_log, uptr class_id) { return ((uptr)1) << (stack_size_log - kMinStackFrameSizeLog - class_id); } // Divide n by the number of frames in size class. static uptr ModuloNumberOfFrames(uptr stack_size_log, uptr class_id, uptr n) { return n & (NumberOfFrames(stack_size_log, class_id) - 1); } // The pointer to the flags of the given class_id. u8 *GetFlags(uptr stack_size_log, uptr class_id) { return reinterpret_cast(this) + kFlagsOffset + FlagsOffset(stack_size_log, class_id); } // Get frame by class_id and pos. u8 *GetFrame(uptr stack_size_log, uptr class_id, uptr pos) { return reinterpret_cast(this) + kFlagsOffset + SizeRequiredForFlags(stack_size_log) + (((uptr)1) << stack_size_log) * class_id + BytesInSizeClass(class_id) * pos; } // Allocate the fake frame. FakeFrame *Allocate(uptr stack_size_log, uptr class_id, uptr real_stack); // Deallocate the fake frame: read the saved flag address and write 0 there. static void Deallocate(uptr x, uptr class_id) { **SavedFlagPtr(x, class_id) = 0; } // Poison the entire FakeStack's shadow with the magic value. void PoisonAll(u8 magic); // Return the beginning of the FakeFrame or 0 if the address is not ours. uptr AddrIsInFakeStack(uptr addr, uptr *frame_beg, uptr *frame_end); USED uptr AddrIsInFakeStack(uptr addr) { uptr t1, t2; return AddrIsInFakeStack(addr, &t1, &t2); } // Number of bytes in a fake frame of this size class. static uptr BytesInSizeClass(uptr class_id) { return ((uptr)1) << (class_id + kMinStackFrameSizeLog); } // The fake frame is guaranteed to have a right redzone. // We use the last word of that redzone to store the address of the flag // that corresponds to the current frame to make faster deallocation. static u8 **SavedFlagPtr(uptr x, uptr class_id) { return reinterpret_cast(x + BytesInSizeClass(class_id) - sizeof(x)); } uptr stack_size_log() const { return stack_size_log_; } void HandleNoReturn(); void GC(uptr real_stack); void ForEachFakeFrame(RangeIteratorCallback callback, void *arg); private: FakeStack() { } static const uptr kFlagsOffset = 4096; // This is were the flags begin. // Must match the number of uses of DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID COMPILER_CHECK(kNumberOfSizeClasses == 11); static const uptr kMaxStackMallocSize = ((uptr)1) << kMaxStackFrameSizeLog; uptr hint_position_[kNumberOfSizeClasses]; uptr stack_size_log_; // a bit is set if something was allocated from the corresponding size class. bool needs_gc_; }; FakeStack *GetTLSFakeStack(); void SetTLSFakeStack(FakeStack *fs); } // namespace __asan #endif // ASAN_FAKE_STACK_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/0000775000175000017500000000000013040224627024033 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_test_utils.h0000664000175000017500000000510112334416470027406 0ustar mwhudsonmwhudson//===-- asan_test_utils.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #ifndef ASAN_TEST_UTILS_H #define ASAN_TEST_UTILS_H #if !defined(SANITIZER_EXTERNAL_TEST_CONFIG) # define INCLUDED_FROM_ASAN_TEST_UTILS_H # include "asan_test_config.h" # undef INCLUDED_FROM_ASAN_TEST_UTILS_H #endif #include "sanitizer_test_utils.h" #include "sanitizer_pthread_wrappers.h" #include #include #include #include #include #include #include #if !defined(_WIN32) # include # include # include #endif #ifdef __linux__ # include # include # include # include #include #endif #if !defined(__APPLE__) && !defined(__FreeBSD__) #include #endif #if ASAN_HAS_EXCEPTIONS # define ASAN_THROW(x) throw (x) #else # define ASAN_THROW(x) #endif typedef uint8_t U1; typedef uint16_t U2; typedef uint32_t U4; typedef uint64_t U8; static const int kPageSize = 4096; const size_t kLargeMalloc = 1 << 24; extern void free_aaa(void *p); extern void *malloc_aaa(size_t size); template NOINLINE void asan_write(T *a) { *a = 0; } string RightOOBErrorMessage(int oob_distance, bool is_write); string RightOOBWriteMessage(int oob_distance); string RightOOBReadMessage(int oob_distance); string LeftOOBErrorMessage(int oob_distance, bool is_write); string LeftOOBWriteMessage(int oob_distance); string LeftOOBReadMessage(int oob_distance); string LeftOOBAccessMessage(int oob_distance); char* MallocAndMemsetString(size_t size, char ch); char* MallocAndMemsetString(size_t size); extern char glob1[1]; extern char glob2[2]; extern char glob3[3]; extern char glob4[4]; extern char glob5[5]; extern char glob6[6]; extern char glob7[7]; extern char glob8[8]; extern char glob9[9]; extern char glob10[10]; extern char glob11[11]; extern char glob12[12]; extern char glob13[13]; extern char glob14[14]; extern char glob15[15]; extern char glob16[16]; extern char glob17[17]; extern char glob1000[1000]; extern char glob10000[10000]; extern char glob100000[100000]; extern int GlobalsTest(int x); #endif // ASAN_TEST_UTILS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_interface_test.cc0000664000175000017500000003513412764324553030364 0ustar mwhudsonmwhudson//===-- asan_interface_test.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" #include #include TEST(AddressSanitizerInterface, GetEstimatedAllocatedSize) { EXPECT_EQ(0U, __sanitizer_get_estimated_allocated_size(0)); const size_t sizes[] = { 1, 30, 1<<30 }; for (size_t i = 0; i < 3; i++) { EXPECT_EQ(sizes[i], __sanitizer_get_estimated_allocated_size(sizes[i])); } } static const char* kGetAllocatedSizeErrorMsg = "attempting to call __sanitizer_get_allocated_size"; TEST(AddressSanitizerInterface, GetAllocatedSizeAndOwnershipTest) { const size_t kArraySize = 100; char *array = Ident((char*)malloc(kArraySize)); int *int_ptr = Ident(new int); // Allocated memory is owned by allocator. Allocated size should be // equal to requested size. EXPECT_EQ(true, __sanitizer_get_ownership(array)); EXPECT_EQ(kArraySize, __sanitizer_get_allocated_size(array)); EXPECT_EQ(true, __sanitizer_get_ownership(int_ptr)); EXPECT_EQ(sizeof(int), __sanitizer_get_allocated_size(int_ptr)); // We cannot call GetAllocatedSize from the memory we didn't map, // and from the interior pointers (not returned by previous malloc). void *wild_addr = (void*)0x1; EXPECT_FALSE(__sanitizer_get_ownership(wild_addr)); EXPECT_DEATH(__sanitizer_get_allocated_size(wild_addr), kGetAllocatedSizeErrorMsg); EXPECT_FALSE(__sanitizer_get_ownership(array + kArraySize / 2)); EXPECT_DEATH(__sanitizer_get_allocated_size(array + kArraySize / 2), kGetAllocatedSizeErrorMsg); // NULL is not owned, but is a valid argument for // __sanitizer_get_allocated_size(). EXPECT_FALSE(__sanitizer_get_ownership(NULL)); EXPECT_EQ(0U, __sanitizer_get_allocated_size(NULL)); // When memory is freed, it's not owned, and call to GetAllocatedSize // is forbidden. free(array); EXPECT_FALSE(__sanitizer_get_ownership(array)); EXPECT_DEATH(__sanitizer_get_allocated_size(array), kGetAllocatedSizeErrorMsg); delete int_ptr; void *zero_alloc = Ident(malloc(0)); if (zero_alloc != 0) { // If malloc(0) is not null, this pointer is owned and should have valid // allocated size. EXPECT_TRUE(__sanitizer_get_ownership(zero_alloc)); // Allocated size is 0 or 1 depending on the allocator used. EXPECT_LT(__sanitizer_get_allocated_size(zero_alloc), 2U); } free(zero_alloc); } TEST(AddressSanitizerInterface, GetCurrentAllocatedBytesTest) { size_t before_malloc, after_malloc, after_free; char *array; const size_t kMallocSize = 100; before_malloc = __sanitizer_get_current_allocated_bytes(); array = Ident((char*)malloc(kMallocSize)); after_malloc = __sanitizer_get_current_allocated_bytes(); EXPECT_EQ(before_malloc + kMallocSize, after_malloc); free(array); after_free = __sanitizer_get_current_allocated_bytes(); EXPECT_EQ(before_malloc, after_free); } TEST(AddressSanitizerInterface, GetHeapSizeTest) { // ASan allocator does not keep huge chunks in free list, but unmaps them. // The chunk should be greater than the quarantine size, // otherwise it will be stuck in quarantine instead of being unmaped. static const size_t kLargeMallocSize = (1 << 28) + 1; // 256M free(Ident(malloc(kLargeMallocSize))); // Drain quarantine. size_t old_heap_size = __sanitizer_get_heap_size(); for (int i = 0; i < 3; i++) { // fprintf(stderr, "allocating %zu bytes:\n", kLargeMallocSize); free(Ident(malloc(kLargeMallocSize))); EXPECT_EQ(old_heap_size, __sanitizer_get_heap_size()); } } #ifndef __powerpc64__ // FIXME: This has not reliably worked on powerpc since r279664. Re-enable // this once the problem is tracked down and fixed. static const size_t kManyThreadsMallocSizes[] = {5, 1UL<<10, 1UL<<14, 357}; static const size_t kManyThreadsIterations = 250; static const size_t kManyThreadsNumThreads = (SANITIZER_WORDSIZE == 32) ? 40 : 200; static void *ManyThreadsWithStatsWorker(void *arg) { (void)arg; for (size_t iter = 0; iter < kManyThreadsIterations; iter++) { for (size_t size_index = 0; size_index < 4; size_index++) { free(Ident(malloc(kManyThreadsMallocSizes[size_index]))); } } // Just one large allocation. free(Ident(malloc(1 << 20))); return 0; } TEST(AddressSanitizerInterface, ManyThreadsWithStatsStressTest) { size_t before_test, after_test, i; pthread_t threads[kManyThreadsNumThreads]; before_test = __sanitizer_get_current_allocated_bytes(); for (i = 0; i < kManyThreadsNumThreads; i++) { PTHREAD_CREATE(&threads[i], 0, (void* (*)(void *x))ManyThreadsWithStatsWorker, (void*)i); } for (i = 0; i < kManyThreadsNumThreads; i++) { PTHREAD_JOIN(threads[i], 0); } after_test = __sanitizer_get_current_allocated_bytes(); // ASan stats also reflect memory usage of internal ASan RTL structs, // so we can't check for equality here. EXPECT_LT(after_test, before_test + (1UL<<20)); } #endif static void DoDoubleFree() { int *x = Ident(new int); delete Ident(x); delete Ident(x); } static void MyDeathCallback() { fprintf(stderr, "MyDeathCallback\n"); fflush(0); // On Windows, stderr doesn't flush on crash. } TEST(AddressSanitizerInterface, DeathCallbackTest) { __asan_set_death_callback(MyDeathCallback); EXPECT_DEATH(DoDoubleFree(), "MyDeathCallback"); __asan_set_death_callback(NULL); } static const char* kUseAfterPoisonErrorMessage = "use-after-poison"; #define GOOD_ACCESS(ptr, offset) \ EXPECT_FALSE(__asan_address_is_poisoned(ptr + offset)) #define BAD_ACCESS(ptr, offset) \ EXPECT_TRUE(__asan_address_is_poisoned(ptr + offset)) TEST(AddressSanitizerInterface, SimplePoisonMemoryRegionTest) { char *array = Ident((char*)malloc(120)); // poison array[40..80) __asan_poison_memory_region(array + 40, 40); GOOD_ACCESS(array, 39); GOOD_ACCESS(array, 80); BAD_ACCESS(array, 40); BAD_ACCESS(array, 60); BAD_ACCESS(array, 79); char value; EXPECT_DEATH(value = Ident(array[40]), kUseAfterPoisonErrorMessage); __asan_unpoison_memory_region(array + 40, 40); // access previously poisoned memory. GOOD_ACCESS(array, 40); GOOD_ACCESS(array, 79); free(array); } TEST(AddressSanitizerInterface, OverlappingPoisonMemoryRegionTest) { char *array = Ident((char*)malloc(120)); // Poison [0..40) and [80..120) __asan_poison_memory_region(array, 40); __asan_poison_memory_region(array + 80, 40); BAD_ACCESS(array, 20); GOOD_ACCESS(array, 60); BAD_ACCESS(array, 100); // Poison whole array - [0..120) __asan_poison_memory_region(array, 120); BAD_ACCESS(array, 60); // Unpoison [24..96) __asan_unpoison_memory_region(array + 24, 72); BAD_ACCESS(array, 23); GOOD_ACCESS(array, 24); GOOD_ACCESS(array, 60); GOOD_ACCESS(array, 95); BAD_ACCESS(array, 96); free(array); } TEST(AddressSanitizerInterface, PushAndPopWithPoisoningTest) { // Vector of capacity 20 char *vec = Ident((char*)malloc(20)); __asan_poison_memory_region(vec, 20); for (size_t i = 0; i < 7; i++) { // Simulate push_back. __asan_unpoison_memory_region(vec + i, 1); GOOD_ACCESS(vec, i); BAD_ACCESS(vec, i + 1); } for (size_t i = 7; i > 0; i--) { // Simulate pop_back. __asan_poison_memory_region(vec + i - 1, 1); BAD_ACCESS(vec, i - 1); if (i > 1) GOOD_ACCESS(vec, i - 2); } free(vec); } // Make sure that each aligned block of size "2^granularity" doesn't have // "true" value before "false" value. static void MakeShadowValid(bool *shadow, int length, int granularity) { bool can_be_poisoned = true; for (int i = length - 1; i >= 0; i--) { if (!shadow[i]) can_be_poisoned = false; if (!can_be_poisoned) shadow[i] = false; if (i % (1 << granularity) == 0) { can_be_poisoned = true; } } } TEST(AddressSanitizerInterface, PoisoningStressTest) { const size_t kSize = 24; bool expected[kSize]; char *arr = Ident((char*)malloc(kSize)); for (size_t l1 = 0; l1 < kSize; l1++) { for (size_t s1 = 1; l1 + s1 <= kSize; s1++) { for (size_t l2 = 0; l2 < kSize; l2++) { for (size_t s2 = 1; l2 + s2 <= kSize; s2++) { // Poison [l1, l1+s1), [l2, l2+s2) and check result. __asan_unpoison_memory_region(arr, kSize); __asan_poison_memory_region(arr + l1, s1); __asan_poison_memory_region(arr + l2, s2); memset(expected, false, kSize); memset(expected + l1, true, s1); MakeShadowValid(expected, kSize, /*granularity*/ 3); memset(expected + l2, true, s2); MakeShadowValid(expected, kSize, /*granularity*/ 3); for (size_t i = 0; i < kSize; i++) { ASSERT_EQ(expected[i], __asan_address_is_poisoned(arr + i)); } // Unpoison [l1, l1+s1) and [l2, l2+s2) and check result. __asan_poison_memory_region(arr, kSize); __asan_unpoison_memory_region(arr + l1, s1); __asan_unpoison_memory_region(arr + l2, s2); memset(expected, true, kSize); memset(expected + l1, false, s1); MakeShadowValid(expected, kSize, /*granularity*/ 3); memset(expected + l2, false, s2); MakeShadowValid(expected, kSize, /*granularity*/ 3); for (size_t i = 0; i < kSize; i++) { ASSERT_EQ(expected[i], __asan_address_is_poisoned(arr + i)); } } } } } free(arr); } TEST(AddressSanitizerInterface, GlobalRedzones) { GOOD_ACCESS(glob1, 1 - 1); GOOD_ACCESS(glob2, 2 - 1); GOOD_ACCESS(glob3, 3 - 1); GOOD_ACCESS(glob4, 4 - 1); GOOD_ACCESS(glob5, 5 - 1); GOOD_ACCESS(glob6, 6 - 1); GOOD_ACCESS(glob7, 7 - 1); GOOD_ACCESS(glob8, 8 - 1); GOOD_ACCESS(glob9, 9 - 1); GOOD_ACCESS(glob10, 10 - 1); GOOD_ACCESS(glob11, 11 - 1); GOOD_ACCESS(glob12, 12 - 1); GOOD_ACCESS(glob13, 13 - 1); GOOD_ACCESS(glob14, 14 - 1); GOOD_ACCESS(glob15, 15 - 1); GOOD_ACCESS(glob16, 16 - 1); GOOD_ACCESS(glob17, 17 - 1); GOOD_ACCESS(glob1000, 1000 - 1); GOOD_ACCESS(glob10000, 10000 - 1); GOOD_ACCESS(glob100000, 100000 - 1); BAD_ACCESS(glob1, 1); BAD_ACCESS(glob2, 2); BAD_ACCESS(glob3, 3); BAD_ACCESS(glob4, 4); BAD_ACCESS(glob5, 5); BAD_ACCESS(glob6, 6); BAD_ACCESS(glob7, 7); BAD_ACCESS(glob8, 8); BAD_ACCESS(glob9, 9); BAD_ACCESS(glob10, 10); BAD_ACCESS(glob11, 11); BAD_ACCESS(glob12, 12); BAD_ACCESS(glob13, 13); BAD_ACCESS(glob14, 14); BAD_ACCESS(glob15, 15); BAD_ACCESS(glob16, 16); BAD_ACCESS(glob17, 17); BAD_ACCESS(glob1000, 1000); BAD_ACCESS(glob1000, 1100); // Redzone is at least 101 bytes. BAD_ACCESS(glob10000, 10000); BAD_ACCESS(glob10000, 11000); // Redzone is at least 1001 bytes. BAD_ACCESS(glob100000, 100000); BAD_ACCESS(glob100000, 110000); // Redzone is at least 10001 bytes. } TEST(AddressSanitizerInterface, PoisonedRegion) { size_t rz = 16; for (size_t size = 1; size <= 64; size++) { char *p = new char[size]; for (size_t beg = 0; beg < size + rz; beg++) { for (size_t end = beg; end < size + rz; end++) { void *first_poisoned = __asan_region_is_poisoned(p + beg, end - beg); if (beg == end) { EXPECT_FALSE(first_poisoned); } else if (beg < size && end <= size) { EXPECT_FALSE(first_poisoned); } else if (beg >= size) { EXPECT_EQ(p + beg, first_poisoned); } else { EXPECT_GT(end, size); EXPECT_EQ(p + size, first_poisoned); } } } delete [] p; } } // This is a performance benchmark for manual runs. // asan's memset interceptor calls mem_is_zero for the entire shadow region. // the profile should look like this: // 89.10% [.] __memset_sse2 // 10.50% [.] __sanitizer::mem_is_zero // I.e. mem_is_zero should consume ~ SHADOW_GRANULARITY less CPU cycles // than memset itself. TEST(AddressSanitizerInterface, DISABLED_StressLargeMemset) { size_t size = 1 << 20; char *x = new char[size]; for (int i = 0; i < 100000; i++) Ident(memset)(x, 0, size); delete [] x; } // Same here, but we run memset with small sizes. TEST(AddressSanitizerInterface, DISABLED_StressSmallMemset) { size_t size = 32; char *x = new char[size]; for (int i = 0; i < 100000000; i++) Ident(memset)(x, 0, size); delete [] x; } static const char *kInvalidPoisonMessage = "invalid-poison-memory-range"; static const char *kInvalidUnpoisonMessage = "invalid-unpoison-memory-range"; TEST(AddressSanitizerInterface, DISABLED_InvalidPoisonAndUnpoisonCallsTest) { char *array = Ident((char*)malloc(120)); __asan_unpoison_memory_region(array, 120); // Try to unpoison not owned memory EXPECT_DEATH(__asan_unpoison_memory_region(array, 121), kInvalidUnpoisonMessage); EXPECT_DEATH(__asan_unpoison_memory_region(array - 1, 120), kInvalidUnpoisonMessage); __asan_poison_memory_region(array, 120); // Try to poison not owned memory. EXPECT_DEATH(__asan_poison_memory_region(array, 121), kInvalidPoisonMessage); EXPECT_DEATH(__asan_poison_memory_region(array - 1, 120), kInvalidPoisonMessage); free(array); } #if !defined(_WIN32) // FIXME: This should really be a lit test. static void ErrorReportCallbackOneToZ(const char *report) { int report_len = strlen(report); ASSERT_EQ(6, write(2, "ABCDEF", 6)); ASSERT_EQ(report_len, write(2, report, report_len)); ASSERT_EQ(6, write(2, "ABCDEF", 6)); _exit(1); } TEST(AddressSanitizerInterface, SetErrorReportCallbackTest) { __asan_set_error_report_callback(ErrorReportCallbackOneToZ); EXPECT_DEATH(__asan_report_error(0, 0, 0, 0, true, 1), ASAN_PCRE_DOTALL "ABCDEF.*AddressSanitizer.*WRITE.*ABCDEF"); __asan_set_error_report_callback(NULL); } #endif TEST(AddressSanitizerInterface, GetOwnershipStressTest) { std::vector pointers; std::vector sizes; const size_t kNumMallocs = 1 << 9; for (size_t i = 0; i < kNumMallocs; i++) { size_t size = i * 100 + 1; pointers.push_back((char*)malloc(size)); sizes.push_back(size); } for (size_t i = 0; i < 4000000; i++) { EXPECT_FALSE(__sanitizer_get_ownership(&pointers)); EXPECT_FALSE(__sanitizer_get_ownership((void*)0x1234)); size_t idx = i % kNumMallocs; EXPECT_TRUE(__sanitizer_get_ownership(pointers[idx])); EXPECT_EQ(sizes[idx], __sanitizer_get_allocated_size(pointers[idx])); } for (size_t i = 0, n = pointers.size(); i < n; i++) free(pointers[i]); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_mac_test.h0000664000175000017500000000115112003255276027005 0ustar mwhudsonmwhudsonextern "C" { void *CFAllocatorDefaultDoubleFree(void *unused); void CFAllocatorSystemDefaultDoubleFree(); void CFAllocatorMallocDoubleFree(); void CFAllocatorMallocZoneDoubleFree(); void CallFreeOnWorkqueue(void *mem); void TestGCDDispatchAsync(); void TestGCDDispatchSync(); void TestGCDReuseWqthreadsAsync(); void TestGCDReuseWqthreadsSync(); void TestGCDDispatchAfter(); void TestGCDInTSDDestructor(); void TestGCDSourceEvent(); void TestGCDSourceCancel(); void TestGCDGroupAsync(); void TestOOBNSObjects(); void TestNSURLDeallocation(); void TestPassCFMemoryToAnotherThread(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_test.cc0000664000175000017500000011063212741206705026332 0ustar mwhudsonmwhudson//===-- asan_test.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" NOINLINE void *malloc_fff(size_t size) { void *res = malloc/**/(size); break_optimization(0); return res;} NOINLINE void *malloc_eee(size_t size) { void *res = malloc_fff(size); break_optimization(0); return res;} NOINLINE void *malloc_ddd(size_t size) { void *res = malloc_eee(size); break_optimization(0); return res;} NOINLINE void *malloc_ccc(size_t size) { void *res = malloc_ddd(size); break_optimization(0); return res;} NOINLINE void *malloc_bbb(size_t size) { void *res = malloc_ccc(size); break_optimization(0); return res;} NOINLINE void *malloc_aaa(size_t size) { void *res = malloc_bbb(size); break_optimization(0); return res;} NOINLINE void free_ccc(void *p) { free(p); break_optimization(0);} NOINLINE void free_bbb(void *p) { free_ccc(p); break_optimization(0);} NOINLINE void free_aaa(void *p) { free_bbb(p); break_optimization(0);} template NOINLINE void uaf_test(int size, int off) { void *p = malloc_aaa(size); free_aaa(p); for (int i = 1; i < 100; i++) free_aaa(malloc_aaa(i)); fprintf(stderr, "writing %ld byte(s) at %p with offset %d\n", (long)sizeof(T), p, off); asan_write((T *)((char *)p + off)); } TEST(AddressSanitizer, HasFeatureAddressSanitizerTest) { #if defined(__has_feature) && __has_feature(address_sanitizer) bool asan = 1; #elif defined(__SANITIZE_ADDRESS__) bool asan = 1; #else bool asan = 0; #endif EXPECT_EQ(true, asan); } TEST(AddressSanitizer, SimpleDeathTest) { EXPECT_DEATH(exit(1), ""); } TEST(AddressSanitizer, VariousMallocsTest) { int *a = (int*)malloc(100 * sizeof(int)); a[50] = 0; free(a); int *r = (int*)malloc(10); r = (int*)realloc(r, 2000 * sizeof(int)); r[1000] = 0; free(r); int *b = new int[100]; b[50] = 0; delete [] b; int *c = new int; *c = 0; delete c; #if SANITIZER_TEST_HAS_POSIX_MEMALIGN int *pm; int pm_res = posix_memalign((void**)&pm, kPageSize, kPageSize); EXPECT_EQ(0, pm_res); free(pm); #endif // SANITIZER_TEST_HAS_POSIX_MEMALIGN #if SANITIZER_TEST_HAS_MEMALIGN int *ma = (int*)memalign(kPageSize, kPageSize); EXPECT_EQ(0U, (uintptr_t)ma % kPageSize); ma[123] = 0; free(ma); #endif // SANITIZER_TEST_HAS_MEMALIGN } TEST(AddressSanitizer, CallocTest) { int *a = (int*)calloc(100, sizeof(int)); EXPECT_EQ(0, a[10]); free(a); } TEST(AddressSanitizer, CallocReturnsZeroMem) { size_t sizes[] = {16, 1000, 10000, 100000, 2100000}; for (size_t s = 0; s < sizeof(sizes)/sizeof(sizes[0]); s++) { size_t size = sizes[s]; for (size_t iter = 0; iter < 5; iter++) { char *x = Ident((char*)calloc(1, size)); EXPECT_EQ(x[0], 0); EXPECT_EQ(x[size - 1], 0); EXPECT_EQ(x[size / 2], 0); EXPECT_EQ(x[size / 3], 0); EXPECT_EQ(x[size / 4], 0); memset(x, 0x42, size); free(Ident(x)); #if !defined(_WIN32) // FIXME: OOM on Windows. We should just make this a lit test // with quarantine size set to 1. free(Ident(malloc(Ident(1 << 27)))); // Try to drain the quarantine. #endif } } } // No valloc on Windows or Android. #if !defined(_WIN32) && !defined(__ANDROID__) TEST(AddressSanitizer, VallocTest) { void *a = valloc(100); EXPECT_EQ(0U, (uintptr_t)a % kPageSize); free(a); } #endif #if SANITIZER_TEST_HAS_PVALLOC TEST(AddressSanitizer, PvallocTest) { char *a = (char*)pvalloc(kPageSize + 100); EXPECT_EQ(0U, (uintptr_t)a % kPageSize); a[kPageSize + 101] = 1; // we should not report an error here. free(a); a = (char*)pvalloc(0); // pvalloc(0) should allocate at least one page. EXPECT_EQ(0U, (uintptr_t)a % kPageSize); a[101] = 1; // we should not report an error here. free(a); } #endif // SANITIZER_TEST_HAS_PVALLOC #if !defined(_WIN32) // FIXME: Use an equivalent of pthread_setspecific on Windows. void *TSDWorker(void *test_key) { if (test_key) { pthread_setspecific(*(pthread_key_t*)test_key, (void*)0xfeedface); } return NULL; } void TSDDestructor(void *tsd) { // Spawning a thread will check that the current thread id is not -1. pthread_t th; PTHREAD_CREATE(&th, NULL, TSDWorker, NULL); PTHREAD_JOIN(th, NULL); } // This tests triggers the thread-specific data destruction fiasco which occurs // if we don't manage the TSD destructors ourselves. We create a new pthread // key with a non-NULL destructor which is likely to be put after the destructor // of AsanThread in the list of destructors. // In this case the TSD for AsanThread will be destroyed before TSDDestructor // is called for the child thread, and a CHECK will fail when we call // pthread_create() to spawn the grandchild. TEST(AddressSanitizer, DISABLED_TSDTest) { pthread_t th; pthread_key_t test_key; pthread_key_create(&test_key, TSDDestructor); PTHREAD_CREATE(&th, NULL, TSDWorker, &test_key); PTHREAD_JOIN(th, NULL); pthread_key_delete(test_key); } #endif TEST(AddressSanitizer, UAF_char) { const char *uaf_string = "AddressSanitizer:.*heap-use-after-free"; EXPECT_DEATH(uaf_test(1, 0), uaf_string); EXPECT_DEATH(uaf_test(10, 0), uaf_string); EXPECT_DEATH(uaf_test(10, 10), uaf_string); EXPECT_DEATH(uaf_test(kLargeMalloc, 0), uaf_string); EXPECT_DEATH(uaf_test(kLargeMalloc, kLargeMalloc / 2), uaf_string); } TEST(AddressSanitizer, UAF_long_double) { if (sizeof(long double) == sizeof(double)) return; long double *p = Ident(new long double[10]); EXPECT_DEATH(Ident(p)[12] = 0, "WRITE of size 1[026]"); EXPECT_DEATH(Ident(p)[0] = Ident(p)[12], "READ of size 1[026]"); delete [] Ident(p); } #if !defined(_WIN32) struct Packed5 { int x; char c; } __attribute__((packed)); #else # pragma pack(push, 1) struct Packed5 { int x; char c; }; # pragma pack(pop) #endif TEST(AddressSanitizer, UAF_Packed5) { static_assert(sizeof(Packed5) == 5, "Please check the keywords used"); Packed5 *p = Ident(new Packed5[2]); EXPECT_DEATH(p[0] = p[3], "READ of size 5"); EXPECT_DEATH(p[3] = p[0], "WRITE of size 5"); delete [] Ident(p); } #if ASAN_HAS_BLACKLIST TEST(AddressSanitizer, IgnoreTest) { int *x = Ident(new int); delete Ident(x); *x = 0; } #endif // ASAN_HAS_BLACKLIST struct StructWithBitField { int bf1:1; int bf2:1; int bf3:1; int bf4:29; }; TEST(AddressSanitizer, BitFieldPositiveTest) { StructWithBitField *x = new StructWithBitField; delete Ident(x); EXPECT_DEATH(x->bf1 = 0, "use-after-free"); EXPECT_DEATH(x->bf2 = 0, "use-after-free"); EXPECT_DEATH(x->bf3 = 0, "use-after-free"); EXPECT_DEATH(x->bf4 = 0, "use-after-free"); } struct StructWithBitFields_8_24 { int a:8; int b:24; }; TEST(AddressSanitizer, BitFieldNegativeTest) { StructWithBitFields_8_24 *x = Ident(new StructWithBitFields_8_24); x->a = 0; x->b = 0; delete Ident(x); } #if ASAN_NEEDS_SEGV namespace { const char kSEGVCrash[] = "AddressSanitizer: SEGV on unknown address"; const char kOverriddenHandler[] = "ASan signal handler has been overridden\n"; TEST(AddressSanitizer, WildAddressTest) { char *c = (char*)0x123; EXPECT_DEATH(*c = 0, kSEGVCrash); } void my_sigaction_sighandler(int, siginfo_t*, void*) { fprintf(stderr, kOverriddenHandler); exit(1); } void my_signal_sighandler(int signum) { fprintf(stderr, kOverriddenHandler); exit(1); } TEST(AddressSanitizer, SignalTest) { struct sigaction sigact; memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = my_sigaction_sighandler; sigact.sa_flags = SA_SIGINFO; // ASan should silently ignore sigaction()... EXPECT_EQ(0, sigaction(SIGSEGV, &sigact, 0)); #ifdef __APPLE__ EXPECT_EQ(0, sigaction(SIGBUS, &sigact, 0)); #endif char *c = (char*)0x123; EXPECT_DEATH(*c = 0, kSEGVCrash); // ... and signal(). EXPECT_EQ(0, signal(SIGSEGV, my_signal_sighandler)); EXPECT_DEATH(*c = 0, kSEGVCrash); } } // namespace #endif static void TestLargeMalloc(size_t size) { char buff[1024]; sprintf(buff, "is located 1 bytes to the left of %lu-byte", (long)size); EXPECT_DEATH(Ident((char*)malloc(size))[-1] = 0, buff); } TEST(AddressSanitizer, LargeMallocTest) { const int max_size = (SANITIZER_WORDSIZE == 32) ? 1 << 26 : 1 << 28; for (int i = 113; i < max_size; i = i * 2 + 13) { TestLargeMalloc(i); } } #if !GTEST_USES_SIMPLE_RE TEST(AddressSanitizer, HugeMallocTest) { if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return; size_t n_megs = 4100; EXPECT_DEATH(Ident((char*)malloc(n_megs << 20))[-1] = 0, "is located 1 bytes to the left|" "AddressSanitizer failed to allocate"); } #endif #if SANITIZER_TEST_HAS_MEMALIGN void MemalignRun(size_t align, size_t size, int idx) { char *p = (char *)memalign(align, size); Ident(p)[idx] = 0; free(p); } TEST(AddressSanitizer, memalign) { for (int align = 16; align <= (1 << 23); align *= 2) { size_t size = align * 5; EXPECT_DEATH(MemalignRun(align, size, -1), "is located 1 bytes to the left"); EXPECT_DEATH(MemalignRun(align, size, size + 1), "is located 1 bytes to the right"); } } #endif // SANITIZER_TEST_HAS_MEMALIGN void *ManyThreadsWorker(void *a) { for (int iter = 0; iter < 100; iter++) { for (size_t size = 100; size < 2000; size *= 2) { free(Ident(malloc(size))); } } return 0; } #if !defined(__aarch64__) // FIXME: Infinite loop in AArch64 (PR24389). TEST(AddressSanitizer, ManyThreadsTest) { const size_t kNumThreads = (SANITIZER_WORDSIZE == 32 || ASAN_AVOID_EXPENSIVE_TESTS) ? 30 : 1000; pthread_t t[kNumThreads]; for (size_t i = 0; i < kNumThreads; i++) { PTHREAD_CREATE(&t[i], 0, ManyThreadsWorker, (void*)i); } for (size_t i = 0; i < kNumThreads; i++) { PTHREAD_JOIN(t[i], 0); } } #endif TEST(AddressSanitizer, ReallocTest) { const int kMinElem = 5; int *ptr = (int*)malloc(sizeof(int) * kMinElem); ptr[3] = 3; for (int i = 0; i < 10000; i++) { ptr = (int*)realloc(ptr, (my_rand() % 1000 + kMinElem) * sizeof(int)); EXPECT_EQ(3, ptr[3]); } free(ptr); // Realloc pointer returned by malloc(0). int *ptr2 = Ident((int*)malloc(0)); ptr2 = Ident((int*)realloc(ptr2, sizeof(*ptr2))); *ptr2 = 42; EXPECT_EQ(42, *ptr2); free(ptr2); } TEST(AddressSanitizer, ReallocFreedPointerTest) { void *ptr = Ident(malloc(42)); ASSERT_TRUE(NULL != ptr); free(ptr); EXPECT_DEATH(ptr = realloc(ptr, 77), "attempting double-free"); } TEST(AddressSanitizer, ReallocInvalidPointerTest) { void *ptr = Ident(malloc(42)); EXPECT_DEATH(ptr = realloc((int*)ptr + 1, 77), "attempting free.*not malloc"); free(ptr); } TEST(AddressSanitizer, ZeroSizeMallocTest) { // Test that malloc(0) and similar functions don't return NULL. void *ptr = Ident(malloc(0)); EXPECT_TRUE(NULL != ptr); free(ptr); #if SANITIZER_TEST_HAS_POSIX_MEMALIGN int pm_res = posix_memalign(&ptr, 1<<20, 0); EXPECT_EQ(0, pm_res); EXPECT_TRUE(NULL != ptr); free(ptr); #endif // SANITIZER_TEST_HAS_POSIX_MEMALIGN int *int_ptr = new int[0]; int *int_ptr2 = new int[0]; EXPECT_TRUE(NULL != int_ptr); EXPECT_TRUE(NULL != int_ptr2); EXPECT_NE(int_ptr, int_ptr2); delete[] int_ptr; delete[] int_ptr2; } #if SANITIZER_TEST_HAS_MALLOC_USABLE_SIZE static const char *kMallocUsableSizeErrorMsg = "AddressSanitizer: attempting to call malloc_usable_size()"; TEST(AddressSanitizer, MallocUsableSizeTest) { const size_t kArraySize = 100; char *array = Ident((char*)malloc(kArraySize)); int *int_ptr = Ident(new int); EXPECT_EQ(0U, malloc_usable_size(NULL)); EXPECT_EQ(kArraySize, malloc_usable_size(array)); EXPECT_EQ(sizeof(int), malloc_usable_size(int_ptr)); EXPECT_DEATH(malloc_usable_size((void*)0x123), kMallocUsableSizeErrorMsg); EXPECT_DEATH(malloc_usable_size(array + kArraySize / 2), kMallocUsableSizeErrorMsg); free(array); EXPECT_DEATH(malloc_usable_size(array), kMallocUsableSizeErrorMsg); delete int_ptr; } #endif // SANITIZER_TEST_HAS_MALLOC_USABLE_SIZE void WrongFree() { int *x = (int*)malloc(100 * sizeof(int)); // Use the allocated memory, otherwise Clang will optimize it out. Ident(x); free(x + 1); } #if !defined(_WIN32) // FIXME: This should be a lit test. TEST(AddressSanitizer, WrongFreeTest) { EXPECT_DEATH(WrongFree(), ASAN_PCRE_DOTALL "ERROR: AddressSanitizer: attempting free.*not malloc" ".*is located 4 bytes inside of 400-byte region" ".*allocated by thread"); } #endif void DoubleFree() { int *x = (int*)malloc(100 * sizeof(int)); fprintf(stderr, "DoubleFree: x=%p\n", (void *)x); free(x); free(x); fprintf(stderr, "should have failed in the second free(%p)\n", (void *)x); abort(); } #if !defined(_WIN32) // FIXME: This should be a lit test. TEST(AddressSanitizer, DoubleFreeTest) { EXPECT_DEATH(DoubleFree(), ASAN_PCRE_DOTALL "ERROR: AddressSanitizer: attempting double-free" ".*is located 0 bytes inside of 400-byte region" ".*freed by thread T0 here" ".*previously allocated by thread T0 here"); } #endif template NOINLINE void SizedStackTest() { char a[kSize]; char *A = Ident((char*)&a); const char *expected_death = "AddressSanitizer: stack-buffer-"; for (size_t i = 0; i < kSize; i++) A[i] = i; EXPECT_DEATH(A[-1] = 0, expected_death); EXPECT_DEATH(A[-5] = 0, expected_death); EXPECT_DEATH(A[kSize] = 0, expected_death); EXPECT_DEATH(A[kSize + 1] = 0, expected_death); EXPECT_DEATH(A[kSize + 5] = 0, expected_death); if (kSize > 16) EXPECT_DEATH(A[kSize + 31] = 0, expected_death); } TEST(AddressSanitizer, SimpleStackTest) { SizedStackTest<1>(); SizedStackTest<2>(); SizedStackTest<3>(); SizedStackTest<4>(); SizedStackTest<5>(); SizedStackTest<6>(); SizedStackTest<7>(); SizedStackTest<16>(); SizedStackTest<25>(); SizedStackTest<34>(); SizedStackTest<43>(); SizedStackTest<51>(); SizedStackTest<62>(); SizedStackTest<64>(); SizedStackTest<128>(); } #if !defined(_WIN32) // FIXME: It's a bit hard to write multi-line death test expectations // in a portable way. Anyways, this should just be turned into a lit test. TEST(AddressSanitizer, ManyStackObjectsTest) { char XXX[10]; char YYY[20]; char ZZZ[30]; Ident(XXX); Ident(YYY); EXPECT_DEATH(Ident(ZZZ)[-1] = 0, ASAN_PCRE_DOTALL "XXX.*YYY.*ZZZ"); } #endif #if 0 // This test requires online symbolizer. // Moved to lit_tests/stack-oob-frames.cc. // Reenable here once we have online symbolizer by default. NOINLINE static void Frame0(int frame, char *a, char *b, char *c) { char d[4] = {0}; char *D = Ident(d); switch (frame) { case 3: a[5]++; break; case 2: b[5]++; break; case 1: c[5]++; break; case 0: D[5]++; break; } } NOINLINE static void Frame1(int frame, char *a, char *b) { char c[4] = {0}; Frame0(frame, a, b, c); break_optimization(0); } NOINLINE static void Frame2(int frame, char *a) { char b[4] = {0}; Frame1(frame, a, b); break_optimization(0); } NOINLINE static void Frame3(int frame) { char a[4] = {0}; Frame2(frame, a); break_optimization(0); } TEST(AddressSanitizer, GuiltyStackFrame0Test) { EXPECT_DEATH(Frame3(0), "located .*in frame <.*Frame0"); } TEST(AddressSanitizer, GuiltyStackFrame1Test) { EXPECT_DEATH(Frame3(1), "located .*in frame <.*Frame1"); } TEST(AddressSanitizer, GuiltyStackFrame2Test) { EXPECT_DEATH(Frame3(2), "located .*in frame <.*Frame2"); } TEST(AddressSanitizer, GuiltyStackFrame3Test) { EXPECT_DEATH(Frame3(3), "located .*in frame <.*Frame3"); } #endif NOINLINE void LongJmpFunc1(jmp_buf buf) { // create three red zones for these two stack objects. int a; int b; int *A = Ident(&a); int *B = Ident(&b); *A = *B; longjmp(buf, 1); } NOINLINE void TouchStackFunc() { int a[100]; // long array will intersect with redzones from LongJmpFunc1. int *A = Ident(a); for (int i = 0; i < 100; i++) A[i] = i*i; } // Test that we handle longjmp and do not report false positives on stack. TEST(AddressSanitizer, LongJmpTest) { static jmp_buf buf; if (!setjmp(buf)) { LongJmpFunc1(buf); } else { TouchStackFunc(); } } #if !defined(_WIN32) // Only basic longjmp is available on Windows. NOINLINE void UnderscopeLongJmpFunc1(jmp_buf buf) { // create three red zones for these two stack objects. int a; int b; int *A = Ident(&a); int *B = Ident(&b); *A = *B; _longjmp(buf, 1); } NOINLINE void SigLongJmpFunc1(sigjmp_buf buf) { // create three red zones for these two stack objects. int a; int b; int *A = Ident(&a); int *B = Ident(&b); *A = *B; siglongjmp(buf, 1); } #if !defined(__ANDROID__) && !defined(__arm__) && \ !defined(__aarch64__) && !defined(__mips__) && \ !defined(__mips64) && !defined(__s390__) NOINLINE void BuiltinLongJmpFunc1(jmp_buf buf) { // create three red zones for these two stack objects. int a; int b; int *A = Ident(&a); int *B = Ident(&b); *A = *B; __builtin_longjmp((void**)buf, 1); } // Does not work on ARM: // https://github.com/google/sanitizers/issues/185 TEST(AddressSanitizer, BuiltinLongJmpTest) { static jmp_buf buf; if (!__builtin_setjmp((void**)buf)) { BuiltinLongJmpFunc1(buf); } else { TouchStackFunc(); } } #endif // !defined(__ANDROID__) && !defined(__arm__) && // !defined(__aarch64__) && !defined(__mips__) // !defined(__mips64) && !defined(__s390__) TEST(AddressSanitizer, UnderscopeLongJmpTest) { static jmp_buf buf; if (!_setjmp(buf)) { UnderscopeLongJmpFunc1(buf); } else { TouchStackFunc(); } } TEST(AddressSanitizer, SigLongJmpTest) { static sigjmp_buf buf; if (!sigsetjmp(buf, 1)) { SigLongJmpFunc1(buf); } else { TouchStackFunc(); } } #endif // FIXME: Why does clang-cl define __EXCEPTIONS? #if defined(__EXCEPTIONS) && !defined(_WIN32) NOINLINE void ThrowFunc() { // create three red zones for these two stack objects. int a; int b; int *A = Ident(&a); int *B = Ident(&b); *A = *B; ASAN_THROW(1); } TEST(AddressSanitizer, CxxExceptionTest) { if (ASAN_UAR) return; // TODO(kcc): this test crashes on 32-bit for some reason... if (SANITIZER_WORDSIZE == 32) return; try { ThrowFunc(); } catch(...) {} TouchStackFunc(); } #endif void *ThreadStackReuseFunc1(void *unused) { // create three red zones for these two stack objects. int a; int b; int *A = Ident(&a); int *B = Ident(&b); *A = *B; pthread_exit(0); return 0; } void *ThreadStackReuseFunc2(void *unused) { TouchStackFunc(); return 0; } TEST(AddressSanitizer, ThreadStackReuseTest) { pthread_t t; PTHREAD_CREATE(&t, 0, ThreadStackReuseFunc1, 0); PTHREAD_JOIN(t, 0); PTHREAD_CREATE(&t, 0, ThreadStackReuseFunc2, 0); PTHREAD_JOIN(t, 0); } #if defined(__i686__) || defined(__x86_64__) #include TEST(AddressSanitizer, Store128Test) { char *a = Ident((char*)malloc(Ident(12))); char *p = a; if (((uintptr_t)a % 16) != 0) p = a + 8; assert(((uintptr_t)p % 16) == 0); __m128i value_wide = _mm_set1_epi16(0x1234); EXPECT_DEATH(_mm_store_si128((__m128i*)p, value_wide), "AddressSanitizer: heap-buffer-overflow"); EXPECT_DEATH(_mm_store_si128((__m128i*)p, value_wide), "WRITE of size 16"); EXPECT_DEATH(_mm_store_si128((__m128i*)p, value_wide), "located 0 bytes to the right of 12-byte"); free(a); } #endif // FIXME: All tests that use this function should be turned into lit tests. string RightOOBErrorMessage(int oob_distance, bool is_write) { assert(oob_distance >= 0); char expected_str[100]; sprintf(expected_str, ASAN_PCRE_DOTALL #if !GTEST_USES_SIMPLE_RE "buffer-overflow.*%s.*" #endif "located %d bytes to the right", #if !GTEST_USES_SIMPLE_RE is_write ? "WRITE" : "READ", #endif oob_distance); return string(expected_str); } string RightOOBWriteMessage(int oob_distance) { return RightOOBErrorMessage(oob_distance, /*is_write*/true); } string RightOOBReadMessage(int oob_distance) { return RightOOBErrorMessage(oob_distance, /*is_write*/false); } // FIXME: All tests that use this function should be turned into lit tests. string LeftOOBErrorMessage(int oob_distance, bool is_write) { assert(oob_distance > 0); char expected_str[100]; sprintf(expected_str, #if !GTEST_USES_SIMPLE_RE ASAN_PCRE_DOTALL "%s.*" #endif "located %d bytes to the left", #if !GTEST_USES_SIMPLE_RE is_write ? "WRITE" : "READ", #endif oob_distance); return string(expected_str); } string LeftOOBWriteMessage(int oob_distance) { return LeftOOBErrorMessage(oob_distance, /*is_write*/true); } string LeftOOBReadMessage(int oob_distance) { return LeftOOBErrorMessage(oob_distance, /*is_write*/false); } string LeftOOBAccessMessage(int oob_distance) { assert(oob_distance > 0); char expected_str[100]; sprintf(expected_str, "located %d bytes to the left", oob_distance); return string(expected_str); } char* MallocAndMemsetString(size_t size, char ch) { char *s = Ident((char*)malloc(size)); memset(s, ch, size); return s; } char* MallocAndMemsetString(size_t size) { return MallocAndMemsetString(size, 'z'); } #if defined(__linux__) && !defined(__ANDROID__) #define READ_TEST(READ_N_BYTES) \ char *x = new char[10]; \ int fd = open("/proc/self/stat", O_RDONLY); \ ASSERT_GT(fd, 0); \ EXPECT_DEATH(READ_N_BYTES, \ ASAN_PCRE_DOTALL \ "AddressSanitizer: heap-buffer-overflow" \ ".* is located 0 bytes to the right of 10-byte region"); \ close(fd); \ delete [] x; \ TEST(AddressSanitizer, pread) { READ_TEST(pread(fd, x, 15, 0)); } TEST(AddressSanitizer, pread64) { READ_TEST(pread64(fd, x, 15, 0)); } TEST(AddressSanitizer, read) { READ_TEST(read(fd, x, 15)); } #endif // defined(__linux__) && !defined(__ANDROID__) // This test case fails // Clang optimizes memcpy/memset calls which lead to unaligned access TEST(AddressSanitizer, DISABLED_MemIntrinsicUnalignedAccessTest) { int size = Ident(4096); char *s = Ident((char*)malloc(size)); EXPECT_DEATH(memset(s + size - 1, 0, 2), RightOOBWriteMessage(0)); free(s); } NOINLINE static int LargeFunction(bool do_bad_access) { int *x = new int[100]; x[0]++; x[1]++; x[2]++; x[3]++; x[4]++; x[5]++; x[6]++; x[7]++; x[8]++; x[9]++; x[do_bad_access ? 100 : 0]++; int res = __LINE__; x[10]++; x[11]++; x[12]++; x[13]++; x[14]++; x[15]++; x[16]++; x[17]++; x[18]++; x[19]++; delete[] x; return res; } // Test the we have correct debug info for the failing instruction. // This test requires the in-process symbolizer to be enabled by default. TEST(AddressSanitizer, DISABLED_LargeFunctionSymbolizeTest) { int failing_line = LargeFunction(false); char expected_warning[128]; sprintf(expected_warning, "LargeFunction.*asan_test.*:%d", failing_line); EXPECT_DEATH(LargeFunction(true), expected_warning); } // Check that we unwind and symbolize correctly. TEST(AddressSanitizer, DISABLED_MallocFreeUnwindAndSymbolizeTest) { int *a = (int*)malloc_aaa(sizeof(int)); *a = 1; free_aaa(a); EXPECT_DEATH(*a = 1, "free_ccc.*free_bbb.*free_aaa.*" "malloc_fff.*malloc_eee.*malloc_ddd"); } static bool TryToSetThreadName(const char *name) { #if defined(__linux__) && defined(PR_SET_NAME) return 0 == prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); #else return false; #endif } void *ThreadedTestAlloc(void *a) { EXPECT_EQ(true, TryToSetThreadName("AllocThr")); int **p = (int**)a; *p = new int; return 0; } void *ThreadedTestFree(void *a) { EXPECT_EQ(true, TryToSetThreadName("FreeThr")); int **p = (int**)a; delete *p; return 0; } void *ThreadedTestUse(void *a) { EXPECT_EQ(true, TryToSetThreadName("UseThr")); int **p = (int**)a; **p = 1; return 0; } void ThreadedTestSpawn() { pthread_t t; int *x; PTHREAD_CREATE(&t, 0, ThreadedTestAlloc, &x); PTHREAD_JOIN(t, 0); PTHREAD_CREATE(&t, 0, ThreadedTestFree, &x); PTHREAD_JOIN(t, 0); PTHREAD_CREATE(&t, 0, ThreadedTestUse, &x); PTHREAD_JOIN(t, 0); } #if !defined(_WIN32) // FIXME: This should be a lit test. TEST(AddressSanitizer, ThreadedTest) { EXPECT_DEATH(ThreadedTestSpawn(), ASAN_PCRE_DOTALL "Thread T.*created" ".*Thread T.*created" ".*Thread T.*created"); } #endif void *ThreadedTestFunc(void *unused) { // Check if prctl(PR_SET_NAME) is supported. Return if not. if (!TryToSetThreadName("TestFunc")) return 0; EXPECT_DEATH(ThreadedTestSpawn(), ASAN_PCRE_DOTALL "WRITE .*thread T. .UseThr." ".*freed by thread T. .FreeThr. here:" ".*previously allocated by thread T. .AllocThr. here:" ".*Thread T. .UseThr. created by T.*TestFunc" ".*Thread T. .FreeThr. created by T" ".*Thread T. .AllocThr. created by T" ""); return 0; } TEST(AddressSanitizer, ThreadNamesTest) { // Run ThreadedTestFunc in a separate thread because it tries to set a // thread name and we don't want to change the main thread's name. pthread_t t; PTHREAD_CREATE(&t, 0, ThreadedTestFunc, 0); PTHREAD_JOIN(t, 0); } #if ASAN_NEEDS_SEGV TEST(AddressSanitizer, ShadowGapTest) { #if SANITIZER_WORDSIZE == 32 char *addr = (char*)0x22000000; #else # if defined(__powerpc64__) char *addr = (char*)0x024000800000; # elif defined(__s390x__) char *addr = (char*)0x11000000000000; # else char *addr = (char*)0x0000100000080000; # endif #endif EXPECT_DEATH(*addr = 1, "AddressSanitizer: SEGV on unknown"); } #endif // ASAN_NEEDS_SEGV extern "C" { NOINLINE static void UseThenFreeThenUse() { char *x = Ident((char*)malloc(8)); *x = 1; free_aaa(x); *x = 2; } } TEST(AddressSanitizer, UseThenFreeThenUseTest) { EXPECT_DEATH(UseThenFreeThenUse(), "freed by thread"); } TEST(AddressSanitizer, StrDupTest) { free(strdup(Ident("123"))); } // Currently we create and poison redzone at right of global variables. static char static110[110]; const char ConstGlob[7] = {1, 2, 3, 4, 5, 6, 7}; static const char StaticConstGlob[3] = {9, 8, 7}; TEST(AddressSanitizer, GlobalTest) { static char func_static15[15]; static char fs1[10]; static char fs2[10]; static char fs3[10]; glob5[Ident(0)] = 0; glob5[Ident(1)] = 0; glob5[Ident(2)] = 0; glob5[Ident(3)] = 0; glob5[Ident(4)] = 0; EXPECT_DEATH(glob5[Ident(5)] = 0, "0 bytes to the right of global variable.*glob5.* size 5"); EXPECT_DEATH(glob5[Ident(5+6)] = 0, "6 bytes to the right of global variable.*glob5.* size 5"); Ident(static110); // avoid optimizations static110[Ident(0)] = 0; static110[Ident(109)] = 0; EXPECT_DEATH(static110[Ident(110)] = 0, "0 bytes to the right of global variable"); EXPECT_DEATH(static110[Ident(110+7)] = 0, "7 bytes to the right of global variable"); Ident(func_static15); // avoid optimizations func_static15[Ident(0)] = 0; EXPECT_DEATH(func_static15[Ident(15)] = 0, "0 bytes to the right of global variable"); EXPECT_DEATH(func_static15[Ident(15 + 9)] = 0, "9 bytes to the right of global variable"); Ident(fs1); Ident(fs2); Ident(fs3); // We don't create left redzones, so this is not 100% guaranteed to fail. // But most likely will. EXPECT_DEATH(fs2[Ident(-1)] = 0, "is located.*of global variable"); EXPECT_DEATH(Ident(Ident(ConstGlob)[8]), "is located 1 bytes to the right of .*ConstGlob"); EXPECT_DEATH(Ident(Ident(StaticConstGlob)[5]), "is located 2 bytes to the right of .*StaticConstGlob"); // call stuff from another file. GlobalsTest(0); } TEST(AddressSanitizer, GlobalStringConstTest) { static const char *zoo = "FOOBAR123"; const char *p = Ident(zoo); EXPECT_DEATH(Ident(p[15]), "is ascii string 'FOOBAR123'"); } TEST(AddressSanitizer, FileNameInGlobalReportTest) { static char zoo[10]; const char *p = Ident(zoo); // The file name should be present in the report. EXPECT_DEATH(Ident(p[15]), "zoo.*asan_test."); } int *ReturnsPointerToALocalObject() { int a = 0; return Ident(&a); } #if ASAN_UAR == 1 TEST(AddressSanitizer, LocalReferenceReturnTest) { int *(*f)() = Ident(ReturnsPointerToALocalObject); int *p = f(); // Call 'f' a few more times, 'p' should still be poisoned. for (int i = 0; i < 32; i++) f(); EXPECT_DEATH(*p = 1, "AddressSanitizer: stack-use-after-return"); EXPECT_DEATH(*p = 1, "is located.*in frame .*ReturnsPointerToALocal"); } #endif template NOINLINE static void FuncWithStack() { char x[kSize]; Ident(x)[0] = 0; Ident(x)[kSize-1] = 0; } static void LotsOfStackReuse() { int LargeStack[10000]; Ident(LargeStack)[0] = 0; for (int i = 0; i < 10000; i++) { FuncWithStack<128 * 1>(); FuncWithStack<128 * 2>(); FuncWithStack<128 * 4>(); FuncWithStack<128 * 8>(); FuncWithStack<128 * 16>(); FuncWithStack<128 * 32>(); FuncWithStack<128 * 64>(); FuncWithStack<128 * 128>(); FuncWithStack<128 * 256>(); FuncWithStack<128 * 512>(); Ident(LargeStack)[0] = 0; } } TEST(AddressSanitizer, StressStackReuseTest) { LotsOfStackReuse(); } TEST(AddressSanitizer, ThreadedStressStackReuseTest) { const int kNumThreads = 20; pthread_t t[kNumThreads]; for (int i = 0; i < kNumThreads; i++) { PTHREAD_CREATE(&t[i], 0, (void* (*)(void *x))LotsOfStackReuse, 0); } for (int i = 0; i < kNumThreads; i++) { PTHREAD_JOIN(t[i], 0); } } static void *PthreadExit(void *a) { pthread_exit(0); return 0; } TEST(AddressSanitizer, PthreadExitTest) { pthread_t t; for (int i = 0; i < 1000; i++) { PTHREAD_CREATE(&t, 0, PthreadExit, 0); PTHREAD_JOIN(t, 0); } } // FIXME: Why does clang-cl define __EXCEPTIONS? #if defined(__EXCEPTIONS) && !defined(_WIN32) NOINLINE static void StackReuseAndException() { int large_stack[1000]; Ident(large_stack); ASAN_THROW(1); } // TODO(kcc): support exceptions with use-after-return. TEST(AddressSanitizer, DISABLED_StressStackReuseAndExceptionsTest) { for (int i = 0; i < 10000; i++) { try { StackReuseAndException(); } catch(...) { } } } #endif #if !defined(_WIN32) TEST(AddressSanitizer, MlockTest) { EXPECT_EQ(0, mlockall(MCL_CURRENT)); EXPECT_EQ(0, mlock((void*)0x12345, 0x5678)); EXPECT_EQ(0, munlockall()); EXPECT_EQ(0, munlock((void*)0x987, 0x654)); } #endif struct LargeStruct { int foo[100]; }; // Test for bug http://llvm.org/bugs/show_bug.cgi?id=11763. // Struct copy should not cause asan warning even if lhs == rhs. TEST(AddressSanitizer, LargeStructCopyTest) { LargeStruct a; *Ident(&a) = *Ident(&a); } ATTRIBUTE_NO_SANITIZE_ADDRESS static void NoSanitizeAddress() { char *foo = new char[10]; Ident(foo)[10] = 0; delete [] foo; } TEST(AddressSanitizer, AttributeNoSanitizeAddressTest) { Ident(NoSanitizeAddress)(); } // The new/delete/etc mismatch checks don't work on Android, // as calls to new/delete go through malloc/free. // OS X support is tracked here: // https://github.com/google/sanitizers/issues/131 // Windows support is tracked here: // https://github.com/google/sanitizers/issues/309 #if !defined(__ANDROID__) && \ !defined(__APPLE__) && \ !defined(_WIN32) static string MismatchStr(const string &str) { return string("AddressSanitizer: alloc-dealloc-mismatch \\(") + str; } static string MismatchOrNewDeleteTypeStr(const string &mismatch_str) { return "(" + MismatchStr(mismatch_str) + ")|(AddressSanitizer: new-delete-type-mismatch)"; } TEST(AddressSanitizer, AllocDeallocMismatch) { EXPECT_DEATH(free(Ident(new int)), MismatchStr("operator new vs free")); EXPECT_DEATH(free(Ident(new int[2])), MismatchStr("operator new \\[\\] vs free")); EXPECT_DEATH( delete (Ident(new int[2])), MismatchOrNewDeleteTypeStr("operator new \\[\\] vs operator delete")); EXPECT_DEATH(delete (Ident((int *)malloc(2 * sizeof(int)))), MismatchOrNewDeleteTypeStr("malloc vs operator delete")); EXPECT_DEATH(delete [] (Ident(new int)), MismatchStr("operator new vs operator delete \\[\\]")); EXPECT_DEATH(delete [] (Ident((int*)malloc(2 * sizeof(int)))), MismatchStr("malloc vs operator delete \\[\\]")); } #endif // ------------------ demo tests; run each one-by-one ------------- // e.g. --gtest_filter=*DemoOOBLeftHigh --gtest_also_run_disabled_tests TEST(AddressSanitizer, DISABLED_DemoThreadedTest) { ThreadedTestSpawn(); } void *SimpleBugOnSTack(void *x = 0) { char a[20]; Ident(a)[20] = 0; return 0; } TEST(AddressSanitizer, DISABLED_DemoStackTest) { SimpleBugOnSTack(); } TEST(AddressSanitizer, DISABLED_DemoThreadStackTest) { pthread_t t; PTHREAD_CREATE(&t, 0, SimpleBugOnSTack, 0); PTHREAD_JOIN(t, 0); } TEST(AddressSanitizer, DISABLED_DemoUAFLowIn) { uaf_test(10, 0); } TEST(AddressSanitizer, DISABLED_DemoUAFLowLeft) { uaf_test(10, -2); } TEST(AddressSanitizer, DISABLED_DemoUAFLowRight) { uaf_test(10, 10); } TEST(AddressSanitizer, DISABLED_DemoUAFHigh) { uaf_test(kLargeMalloc, 0); } TEST(AddressSanitizer, DISABLED_DemoOOM) { size_t size = SANITIZER_WORDSIZE == 64 ? (size_t)(1ULL << 40) : (0xf0000000); printf("%p\n", malloc(size)); } TEST(AddressSanitizer, DISABLED_DemoDoubleFreeTest) { DoubleFree(); } TEST(AddressSanitizer, DISABLED_DemoNullDerefTest) { int *a = 0; Ident(a)[10] = 0; } TEST(AddressSanitizer, DISABLED_DemoFunctionStaticTest) { static char a[100]; static char b[100]; static char c[100]; Ident(a); Ident(b); Ident(c); Ident(a)[5] = 0; Ident(b)[105] = 0; Ident(a)[5] = 0; } TEST(AddressSanitizer, DISABLED_DemoTooMuchMemoryTest) { const size_t kAllocSize = (1 << 28) - 1024; size_t total_size = 0; while (true) { void *x = malloc(kAllocSize); memset(x, 0, kAllocSize); total_size += kAllocSize; fprintf(stderr, "total: %ldM %p\n", (long)total_size >> 20, x); } } // https://github.com/google/sanitizers/issues/66 TEST(AddressSanitizer, BufferOverflowAfterManyFrees) { for (int i = 0; i < 1000000; i++) { delete [] (Ident(new char [8644])); } char *x = new char[8192]; EXPECT_DEATH(x[Ident(8192)] = 0, "AddressSanitizer: heap-buffer-overflow"); delete [] Ident(x); } // Test that instrumentation of stack allocations takes into account // AllocSize of a type, and not its StoreSize (16 vs 10 bytes for long double). // See http://llvm.org/bugs/show_bug.cgi?id=12047 for more details. TEST(AddressSanitizer, LongDoubleNegativeTest) { long double a, b; static long double c; memcpy(Ident(&a), Ident(&b), sizeof(long double)); memcpy(Ident(&c), Ident(&b), sizeof(long double)); } #if !defined(_WIN32) TEST(AddressSanitizer, pthread_getschedparam) { int policy; struct sched_param param; EXPECT_DEATH( pthread_getschedparam(pthread_self(), &policy, Ident(¶m) + 2), "AddressSanitizer: stack-buffer-.*flow"); EXPECT_DEATH( pthread_getschedparam(pthread_self(), Ident(&policy) - 1, ¶m), "AddressSanitizer: stack-buffer-.*flow"); int res = pthread_getschedparam(pthread_self(), &policy, ¶m); ASSERT_EQ(0, res); } #endif #if SANITIZER_TEST_HAS_PRINTF_L static int vsnprintf_l_wrapper(char *s, size_t n, locale_t l, const char *format, ...) { va_list va; va_start(va, format); int res = vsnprintf_l(s, n , l, format, va); va_end(va); return res; } TEST(AddressSanitizer, snprintf_l) { char buff[5]; // Check that snprintf_l() works fine with Asan. int res = snprintf_l(buff, 5, _LIBCPP_GET_C_LOCALE, "%s", "snprintf_l()"); EXPECT_EQ(12, res); // Check that vsnprintf_l() works fine with Asan. res = vsnprintf_l_wrapper(buff, 5, _LIBCPP_GET_C_LOCALE, "%s", "vsnprintf_l()"); EXPECT_EQ(13, res); EXPECT_DEATH(snprintf_l(buff, 10, _LIBCPP_GET_C_LOCALE, "%s", "snprintf_l()"), "AddressSanitizer: stack-buffer-overflow"); EXPECT_DEATH(vsnprintf_l_wrapper(buff, 10, _LIBCPP_GET_C_LOCALE, "%s", "vsnprintf_l()"), "AddressSanitizer: stack-buffer-overflow"); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_benchmarks_test.cc0000664000175000017500000000414612031313367030524 0ustar mwhudsonmwhudson//===-- asan_benchmarks_test.cc ----------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Some benchmarks for the instrumented code. //===----------------------------------------------------------------------===// #include "asan_test_utils.h" template __attribute__((noinline)) static void ManyAccessFunc(T *x, size_t n_elements, size_t n_iter) { for (size_t iter = 0; iter < n_iter; iter++) { break_optimization(0); // hand unroll the loop to stress the reg alloc. for (size_t i = 0; i <= n_elements - 16; i += 16) { x[i + 0] = i; x[i + 1] = i; x[i + 2] = i; x[i + 3] = i; x[i + 4] = i; x[i + 5] = i; x[i + 6] = i; x[i + 7] = i; x[i + 8] = i; x[i + 9] = i; x[i + 10] = i; x[i + 11] = i; x[i + 12] = i; x[i + 13] = i; x[i + 14] = i; x[i + 15] = i; } } } TEST(AddressSanitizer, ManyAccessBenchmark) { size_t kLen = 1024; int *int_array = new int[kLen]; ManyAccessFunc(int_array, kLen, 1 << 24); delete [] int_array; } // access 7 char elements in a 7 byte array (i.e. on the border). __attribute__((noinline)) static void BorderAccessFunc(char *x, size_t n_iter) { for (size_t iter = 0; iter < n_iter; iter++) { break_optimization(x); x[0] = 0; x[1] = 0; x[2] = 0; x[3] = 0; x[4] = 0; x[5] = 0; x[6] = 0; } } TEST(AddressSanitizer, BorderAccessBenchmark) { char *char_7_array = new char[7]; BorderAccessFunc(char_7_array, 1 << 30); delete [] char_7_array; } static void FunctionWithLargeStack() { int stack[1000]; Ident(stack); } TEST(AddressSanitizer, FakeStackBenchmark) { for (int i = 0; i < 10000000; i++) Ident(&FunctionWithLargeStack)(); } int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_oob_test.cc0000664000175000017500000001003412337633206027165 0ustar mwhudsonmwhudson//===-- asan_oob_test.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" NOINLINE void asan_write_sized_aligned(uint8_t *p, size_t size) { EXPECT_EQ(0U, ((uintptr_t)p % size)); if (size == 1) asan_write((uint8_t*)p); else if (size == 2) asan_write((uint16_t*)p); else if (size == 4) asan_write((uint32_t*)p); else if (size == 8) asan_write((uint64_t*)p); } template NOINLINE void oob_test(int size, int off) { char *p = (char*)malloc_aaa(size); // fprintf(stderr, "writing %d byte(s) into [%p,%p) with offset %d\n", // sizeof(T), p, p + size, off); asan_write((T*)(p + off)); free_aaa(p); } template void OOBTest() { char expected_str[100]; for (int size = sizeof(T); size < 20; size += 5) { for (int i = -5; i < 0; i++) { const char *str = "is located.*%d byte.*to the left"; sprintf(expected_str, str, abs(i)); EXPECT_DEATH(oob_test(size, i), expected_str); } for (int i = 0; i < (int)(size - sizeof(T) + 1); i++) oob_test(size, i); for (int i = size - sizeof(T) + 1; i <= (int)(size + 2 * sizeof(T)); i++) { const char *str = "is located.*%d byte.*to the right"; int off = i >= size ? (i - size) : 0; // we don't catch unaligned partially OOB accesses. if (i % sizeof(T)) continue; sprintf(expected_str, str, off); EXPECT_DEATH(oob_test(size, i), expected_str); } } EXPECT_DEATH(oob_test(kLargeMalloc, -1), "is located.*1 byte.*to the left"); EXPECT_DEATH(oob_test(kLargeMalloc, kLargeMalloc), "is located.*0 byte.*to the right"); } // TODO(glider): the following tests are EXTREMELY slow on Darwin: // AddressSanitizer.OOB_char (125503 ms) // AddressSanitizer.OOB_int (126890 ms) // AddressSanitizer.OOBRightTest (315605 ms) // AddressSanitizer.SimpleStackTest (366559 ms) TEST(AddressSanitizer, OOB_char) { OOBTest(); } TEST(AddressSanitizer, OOB_int) { OOBTest(); } TEST(AddressSanitizer, OOBRightTest) { size_t max_access_size = SANITIZER_WORDSIZE == 64 ? 8 : 4; for (size_t access_size = 1; access_size <= max_access_size; access_size *= 2) { for (size_t alloc_size = 1; alloc_size <= 8; alloc_size++) { for (size_t offset = 0; offset <= 8; offset += access_size) { void *p = malloc(alloc_size); // allocated: [p, p + alloc_size) // accessed: [p + offset, p + offset + access_size) uint8_t *addr = (uint8_t*)p + offset; if (offset + access_size <= alloc_size) { asan_write_sized_aligned(addr, access_size); } else { int outside_bytes = offset > alloc_size ? (offset - alloc_size) : 0; const char *str = "is located.%d *byte.*to the right"; char expected_str[100]; sprintf(expected_str, str, outside_bytes); EXPECT_DEATH(asan_write_sized_aligned(addr, access_size), expected_str); } free(p); } } } } TEST(AddressSanitizer, LargeOOBRightTest) { size_t large_power_of_two = 1 << 19; for (size_t i = 16; i <= 256; i *= 2) { size_t size = large_power_of_two - i; char *p = Ident(new char[size]); EXPECT_DEATH(p[size] = 0, "is located 0 bytes to the right"); delete [] p; } } TEST(AddressSanitizer, DISABLED_DemoOOBLeftLow) { oob_test(10, -1); } TEST(AddressSanitizer, DISABLED_DemoOOBLeftHigh) { oob_test(kLargeMalloc, -1); } TEST(AddressSanitizer, DISABLED_DemoOOBRightLow) { oob_test(10, 10); } TEST(AddressSanitizer, DISABLED_DemoOOBRightHigh) { oob_test(kLargeMalloc, kLargeMalloc); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_mem_test.cc0000664000175000017500000002006412303370723027163 0ustar mwhudsonmwhudson//===-- asan_mem_test.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" template void MemSetOOBTestTemplate(size_t length) { if (length == 0) return; size_t size = Ident(sizeof(T) * length); T *array = Ident((T*)malloc(size)); int element = Ident(42); int zero = Ident(0); void *(*MEMSET)(void *s, int c, size_t n) = Ident(memset); // memset interval inside array MEMSET(array, element, size); MEMSET(array, element, size - 1); MEMSET(array + length - 1, element, sizeof(T)); MEMSET(array, element, 1); // memset 0 bytes MEMSET(array - 10, element, zero); MEMSET(array - 1, element, zero); MEMSET(array, element, zero); MEMSET(array + length, 0, zero); MEMSET(array + length + 1, 0, zero); // try to memset bytes to the right of array EXPECT_DEATH(MEMSET(array, 0, size + 1), RightOOBWriteMessage(0)); EXPECT_DEATH(MEMSET((char*)(array + length) - 1, element, 6), RightOOBWriteMessage(0)); EXPECT_DEATH(MEMSET(array + 1, element, size + sizeof(T)), RightOOBWriteMessage(0)); // whole interval is to the right EXPECT_DEATH(MEMSET(array + length + 1, 0, 10), RightOOBWriteMessage(sizeof(T))); // try to memset bytes to the left of array EXPECT_DEATH(MEMSET((char*)array - 1, element, size), LeftOOBWriteMessage(1)); EXPECT_DEATH(MEMSET((char*)array - 5, 0, 6), LeftOOBWriteMessage(5)); if (length >= 100) { // Large OOB, we find it only if the redzone is large enough. EXPECT_DEATH(memset(array - 5, element, size + 5 * sizeof(T)), LeftOOBWriteMessage(5 * sizeof(T))); } // whole interval is to the left EXPECT_DEATH(MEMSET(array - 2, 0, sizeof(T)), LeftOOBWriteMessage(2 * sizeof(T))); // try to memset bytes both to the left & to the right EXPECT_DEATH(MEMSET((char*)array - 2, element, size + 4), LeftOOBWriteMessage(2)); free(array); } TEST(AddressSanitizer, MemSetOOBTest) { MemSetOOBTestTemplate(100); MemSetOOBTestTemplate(5); MemSetOOBTestTemplate(256); // We can test arrays of structres/classes here, but what for? } // Try to allocate two arrays of 'size' bytes that are near each other. // Strictly speaking we are not guaranteed to find such two pointers, // but given the structure of asan's allocator we will. static bool AllocateTwoAdjacentArrays(char **x1, char **x2, size_t size) { vector v; bool res = false; for (size_t i = 0; i < 1000U && !res; i++) { v.push_back(reinterpret_cast(new char[size])); if (i == 0) continue; sort(v.begin(), v.end()); for (size_t j = 1; j < v.size(); j++) { assert(v[j] > v[j-1]); if ((size_t)(v[j] - v[j-1]) < size * 2) { *x2 = reinterpret_cast(v[j]); *x1 = reinterpret_cast(v[j-1]); res = true; break; } } } for (size_t i = 0; i < v.size(); i++) { char *p = reinterpret_cast(v[i]); if (res && p == *x1) continue; if (res && p == *x2) continue; delete [] p; } return res; } TEST(AddressSanitizer, LargeOOBInMemset) { for (size_t size = 200; size < 100000; size += size / 2) { char *x1, *x2; if (!Ident(AllocateTwoAdjacentArrays)(&x1, &x2, size)) continue; // fprintf(stderr, " large oob memset: %p %p %zd\n", x1, x2, size); // Do a memset on x1 with huge out-of-bound access that will end up in x2. EXPECT_DEATH(Ident(memset)(x1, 0, size * 2), "is located 0 bytes to the right"); delete [] x1; delete [] x2; return; } assert(0 && "Did not find two adjacent malloc-ed pointers"); } // Same test for memcpy and memmove functions template void MemTransferOOBTestTemplate(size_t length) { if (length == 0) return; size_t size = Ident(sizeof(T) * length); T *src = Ident((T*)malloc(size)); T *dest = Ident((T*)malloc(size)); int zero = Ident(0); // valid transfer of bytes between arrays M::transfer(dest, src, size); M::transfer(dest + 1, src, size - sizeof(T)); M::transfer(dest, src + length - 1, sizeof(T)); M::transfer(dest, src, 1); // transfer zero bytes M::transfer(dest - 1, src, 0); M::transfer(dest + length, src, zero); M::transfer(dest, src - 1, zero); M::transfer(dest, src, zero); // try to change mem to the right of dest EXPECT_DEATH(M::transfer(dest + 1, src, size), RightOOBWriteMessage(0)); EXPECT_DEATH(M::transfer((char*)(dest + length) - 1, src, 5), RightOOBWriteMessage(0)); // try to change mem to the left of dest EXPECT_DEATH(M::transfer(dest - 2, src, size), LeftOOBWriteMessage(2 * sizeof(T))); EXPECT_DEATH(M::transfer((char*)dest - 3, src, 4), LeftOOBWriteMessage(3)); // try to access mem to the right of src EXPECT_DEATH(M::transfer(dest, src + 2, size), RightOOBReadMessage(0)); EXPECT_DEATH(M::transfer(dest, (char*)(src + length) - 3, 6), RightOOBReadMessage(0)); // try to access mem to the left of src EXPECT_DEATH(M::transfer(dest, src - 1, size), LeftOOBReadMessage(sizeof(T))); EXPECT_DEATH(M::transfer(dest, (char*)src - 6, 7), LeftOOBReadMessage(6)); // Generally we don't need to test cases where both accessing src and writing // to dest address to poisoned memory. T *big_src = Ident((T*)malloc(size * 2)); T *big_dest = Ident((T*)malloc(size * 2)); // try to change mem to both sides of dest EXPECT_DEATH(M::transfer(dest - 1, big_src, size * 2), LeftOOBWriteMessage(sizeof(T))); // try to access mem to both sides of src EXPECT_DEATH(M::transfer(big_dest, src - 2, size * 2), LeftOOBReadMessage(2 * sizeof(T))); free(src); free(dest); free(big_src); free(big_dest); } class MemCpyWrapper { public: static void* transfer(void *to, const void *from, size_t size) { return Ident(memcpy)(to, from, size); } }; TEST(AddressSanitizer, MemCpyOOBTest) { MemTransferOOBTestTemplate(100); MemTransferOOBTestTemplate(1024); } class MemMoveWrapper { public: static void* transfer(void *to, const void *from, size_t size) { return Ident(memmove)(to, from, size); } }; TEST(AddressSanitizer, MemMoveOOBTest) { MemTransferOOBTestTemplate(100); MemTransferOOBTestTemplate(1024); } TEST(AddressSanitizer, MemCmpOOBTest) { size_t size = Ident(100); char *s1 = MallocAndMemsetString(size); char *s2 = MallocAndMemsetString(size); // Normal memcmp calls. Ident(memcmp(s1, s2, size)); Ident(memcmp(s1 + size - 1, s2 + size - 1, 1)); Ident(memcmp(s1 - 1, s2 - 1, 0)); // One of arguments points to not allocated memory. EXPECT_DEATH(Ident(memcmp)(s1 - 1, s2, 1), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(memcmp)(s1, s2 - 1, 1), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(memcmp)(s1 + size, s2, 1), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(memcmp)(s1, s2 + size, 1), RightOOBReadMessage(0)); // Hit unallocated memory and die. EXPECT_DEATH(Ident(memcmp)(s1 + 1, s2 + 1, size), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(memcmp)(s1 + size - 1, s2, 2), RightOOBReadMessage(0)); // Zero bytes are not terminators and don't prevent from OOB. s1[size - 1] = '\0'; s2[size - 1] = '\0'; EXPECT_DEATH(Ident(memcmp)(s1, s2, size + 1), RightOOBReadMessage(0)); // Even if the buffers differ in the first byte, we still assume that // memcmp may access the whole buffer and thus reporting the overflow here: s1[0] = 1; s2[0] = 123; EXPECT_DEATH(Ident(memcmp)(s1, s2, size + 1), RightOOBReadMessage(0)); free(s1); free(s2); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_exceptions_test.cc0000664000175000017500000000110711667226456030602 0ustar mwhudsonmwhudson// See http://llvm.org/bugs/show_bug.cgi?id=11468 #include #include class Action { public: Action() {} void PrintString(const std::string& msg) const { fprintf(stderr, "%s\n", msg.c_str()); } void Throw(const char& arg) const { PrintString("PrintString called!"); // this line is important throw arg; } }; int main() { const Action a; fprintf(stderr, "&a before = %p\n", &a); try { a.Throw('c'); } catch(const char&) { fprintf(stderr, "&a in catch = %p\n", &a); } fprintf(stderr, "&a final = %p\n", &a); return 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_internal_interface_test.cc0000664000175000017500000000255712756735704032270 0ustar mwhudsonmwhudson//===-- asan_internal_interface_test.cc -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_interface_internal.h" #include "asan_test_utils.h" TEST(AddressSanitizerInternalInterface, SetShadow) { std::vector buffer(17, 0xff); __asan_set_shadow_00((uptr)buffer.data(), buffer.size()); EXPECT_EQ(std::vector(buffer.size(), 0x00), buffer); __asan_set_shadow_f1((uptr)buffer.data(), buffer.size()); EXPECT_EQ(std::vector(buffer.size(), 0xf1), buffer); __asan_set_shadow_f2((uptr)buffer.data(), buffer.size()); EXPECT_EQ(std::vector(buffer.size(), 0xf2), buffer); __asan_set_shadow_f3((uptr)buffer.data(), buffer.size()); EXPECT_EQ(std::vector(buffer.size(), 0xf3), buffer); __asan_set_shadow_f5((uptr)buffer.data(), buffer.size()); EXPECT_EQ(std::vector(buffer.size(), 0xf5), buffer); __asan_set_shadow_f8((uptr)buffer.data(), buffer.size()); EXPECT_EQ(std::vector(buffer.size(), 0xf8), buffer); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/CMakeLists.txt0000664000175000017500000003073512771255661026617 0ustar mwhudsonmwhudson# Testing rules for AddressSanitizer. # # These are broken into two buckets. One set of tests directly interacts with # the runtime library and checks its functionality. These are the # no-instrumentation tests. # # Another group of tests relies upon the ability to compile the test with # address sanitizer instrumentation pass. These tests form "integration" tests # and have some elements of version skew -- they test the *host* compiler's # instrumentation against the just-built runtime library. include(CheckCXXCompilerFlag) include(CompilerRTCompile) include_directories(..) include_directories(../..) set(ASAN_UNITTEST_HEADERS asan_mac_test.h asan_test_config.h asan_test_utils.h) set(ASAN_UNITTEST_COMMON_CFLAGS ${COMPILER_RT_UNITTEST_CFLAGS} ${COMPILER_RT_GTEST_CFLAGS} -I${COMPILER_RT_SOURCE_DIR}/include -I${COMPILER_RT_SOURCE_DIR}/lib -I${COMPILER_RT_SOURCE_DIR}/lib/asan -I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/tests -fno-rtti -O2 -Wno-format -Werror=sign-compare -Wno-non-virtual-dtor) append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros ASAN_UNITTEST_COMMON_CFLAGS) # This will ensure the target linker is used # during cross compilation set(ASAN_UNITTEST_COMMON_LINKFLAGS ${COMPILER_RT_UNITTEST_LINKFLAGS}) # -gline-tables-only must be enough for ASan, so use it if possible. if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang") list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -gline-tables-only) else() list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -g) endif() if(MSVC) list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -gcodeview) endif() list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -g) # Use -D instead of definitions to please custom compile command. list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -DASAN_HAS_BLACKLIST=1 -DASAN_HAS_EXCEPTIONS=1 -DASAN_UAR=0) if(APPLE) list(APPEND ASAN_UNITTEST_COMMON_CFLAGS ${DARWIN_osx_CFLAGS}) list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS ${DARWIN_osx_LINKFLAGS}) endif() if(MSVC) # Disable exceptions on Windows until they work reliably. list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -fno-exceptions -DGTEST_HAS_SEH=0) endif() set(ASAN_BLACKLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/asan_test.ignore") set(ASAN_UNITTEST_INSTRUMENTED_CFLAGS ${ASAN_UNITTEST_COMMON_CFLAGS} -fsanitize=address "-fsanitize-blacklist=${ASAN_BLACKLIST_FILE}" ) if(CAN_TARGET_x86_64 OR CAN_TARGET_i386) list(APPEND ASAN_UNITTEST_INSTRUMENTED_CFLAGS -mllvm -asan-instrument-assembly) endif() if(NOT MSVC) list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS --driver-mode=g++) endif() # x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests. if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE") list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS "-lc++") endif() # Unit tests on Mac depend on Foundation. if(APPLE) list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -framework Foundation) endif() if(ANDROID) list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -pie) endif() set(ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS ${ASAN_UNITTEST_COMMON_LINKFLAGS}) list(APPEND ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS -fsanitize=address) set(ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS} -shared-libasan) set(ASAN_UNITTEST_INSTRUMENTED_LIBS) # NDK r10 requires -latomic almost always. append_list_if(ANDROID atomic ASAN_UNITTEST_INSTRUMENTED_LIBS) set(ASAN_UNITTEST_NOINST_LINKFLAGS ${ASAN_UNITTEST_COMMON_LINKFLAGS}) if(NOT APPLE) append_list_if(COMPILER_RT_HAS_LIBM -lm ASAN_UNITTEST_NOINST_LINKFLAGS) append_list_if(COMPILER_RT_HAS_LIBDL -ldl ASAN_UNITTEST_NOINST_LINKFLAGS) append_list_if(COMPILER_RT_HAS_LIBRT -lrt ASAN_UNITTEST_NOINST_LINKFLAGS) append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_UNITTEST_NOINST_LINKFLAGS) append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS) endif() # TODO(eugenis): move all -l flags above to _LIBS? set(ASAN_UNITTEST_NOINST_LIBS) append_list_if(COMPILER_RT_HAS_LIBLOG log ASAN_UNITTEST_NOINST_LIBS) # NDK r10 requires -latomic almost always. append_list_if(ANDROID atomic ASAN_UNITTEST_NOINST_LIBS) # Compile source for the given architecture, using compiler # options in ${ARGN}, and add it to the object list. macro(asan_compile obj_list source arch kind) get_filename_component(basename ${source} NAME) if(CMAKE_CONFIGURATION_TYPES) set(output_obj "${CMAKE_CFG_INTDIR}/${obj_list}.${basename}.${arch}${kind}.o") else() set(output_obj "${obj_list}.${basename}.${arch}${kind}.o") endif() get_target_flags_for_arch(${arch} TARGET_CFLAGS) set(COMPILE_DEPS ${ASAN_UNITTEST_HEADERS} ${ASAN_BLACKLIST_FILE}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND COMPILE_DEPS gtest asan) endif() clang_compile(${output_obj} ${source} CFLAGS ${ARGN} ${TARGET_CFLAGS} DEPS ${COMPILE_DEPS}) list(APPEND ${obj_list} ${output_obj}) endmacro() # Link ASan unit test for a given architecture from a set # of objects in with given linker flags. macro(add_asan_test test_suite test_name arch kind) cmake_parse_arguments(TEST "WITH_TEST_RUNTIME" "" "OBJECTS;LINKFLAGS;SUBDIR" ${ARGN}) get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) set(TEST_DEPS ${TEST_OBJECTS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TEST_DEPS asan) endif() if(TEST_WITH_TEST_RUNTIME) list(APPEND TEST_DEPS ${ASAN_TEST_RUNTIME}) if(CMAKE_CONFIGURATION_TYPES) set(configuration_path "${CMAKE_CFG_INTDIR}/") else() set(configuration_path "") endif() if(NOT MSVC) set(asan_test_runtime_path ${configuration_path}lib${ASAN_TEST_RUNTIME}.a) else() set(asan_test_runtime_path ${configuration_path}${ASAN_TEST_RUNTIME}.lib) endif() list(APPEND TEST_OBJECTS ${asan_test_runtime_path}) endif() add_compiler_rt_test(${test_suite} ${test_name} SUBDIR ${TEST_SUBDIR} OBJECTS ${TEST_OBJECTS} DEPS ${TEST_DEPS} LINK_FLAGS ${TEST_LINKFLAGS} ${TARGET_LINK_FLAGS}) endmacro() # Main AddressSanitizer unit tests. add_custom_target(AsanUnitTests) set_target_properties(AsanUnitTests PROPERTIES FOLDER "Compiler-RT Tests") # AddressSanitizer unit tests with dynamic runtime (on platforms where it's # not the default). add_custom_target(AsanDynamicUnitTests) set_target_properties(AsanDynamicUnitTests PROPERTIES FOLDER "Compiler-RT Tests") # ASan benchmarks (not actively used now). add_custom_target(AsanBenchmarks) set_target_properties(AsanBenchmarks PROPERTIES FOLDER "Compiler-RT Tests") set(ASAN_NOINST_TEST_SOURCES ${COMPILER_RT_GTEST_SOURCE} asan_fake_stack_test.cc asan_noinst_test.cc asan_test_main.cc) set(ASAN_INST_TEST_SOURCES ${COMPILER_RT_GTEST_SOURCE} asan_asm_test.cc asan_globals_test.cc asan_interface_test.cc asan_internal_interface_test.cc asan_test.cc asan_oob_test.cc asan_mem_test.cc asan_str_test.cc asan_test_main.cc) if(APPLE) list(APPEND ASAN_INST_TEST_SOURCES asan_mac_test.cc) endif() set(ASAN_BENCHMARKS_SOURCES ${COMPILER_RT_GTEST_SOURCE} asan_benchmarks_test.cc) # Adds ASan unit tests and benchmarks for architecture. macro(add_asan_tests_for_arch_and_kind arch kind) # Instrumented tests. set(ASAN_INST_TEST_OBJECTS) foreach(src ${ASAN_INST_TEST_SOURCES}) asan_compile(ASAN_INST_TEST_OBJECTS ${src} ${arch} ${kind} ${ASAN_UNITTEST_INSTRUMENTED_CFLAGS} ${ARGN}) endforeach() if (APPLE) # Add Mac-specific helper. asan_compile(ASAN_INST_TEST_OBJECTS asan_mac_test_helpers.mm ${arch} ${kind} ${ASAN_UNITTEST_INSTRUMENTED_CFLAGS} -ObjC ${ARGN}) endif() # Create the 'default' folder where ASAN tests are produced. if(CMAKE_CONFIGURATION_TYPES) foreach(build_mode ${CMAKE_CONFIGURATION_TYPES}) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/default/${build_mode}") endforeach() else() file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/default") endif() add_asan_test(AsanUnitTests "Asan-${arch}${kind}-Test" ${arch} ${kind} SUBDIR "default" OBJECTS ${ASAN_INST_TEST_OBJECTS} LINKFLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS}) if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) # Create the 'dynamic' folder where ASAN tests are produced. if(CMAKE_CONFIGURATION_TYPES) foreach(build_mode ${CMAKE_CONFIGURATION_TYPES}) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dynamic/${build_mode}") endforeach() else() file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dynamic") endif() add_asan_test(AsanDynamicUnitTests "Asan-${arch}${kind}-Dynamic-Test" ${arch} ${kind} SUBDIR "dynamic" OBJECTS ${ASAN_INST_TEST_OBJECTS} LINKFLAGS ${ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINKFLAGS}) endif() # Add static ASan runtime that will be linked with uninstrumented tests. set(ASAN_TEST_RUNTIME RTAsanTest.${arch}${kind}) if(APPLE) set(ASAN_TEST_RUNTIME_OBJECTS $ $ $ $ $ $) else() set(ASAN_TEST_RUNTIME_OBJECTS $ $ $ $ $ $ $ $) endif() add_library(${ASAN_TEST_RUNTIME} STATIC ${ASAN_TEST_RUNTIME_OBJECTS}) set_target_properties(${ASAN_TEST_RUNTIME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} FOLDER "Compiler-RT Runtime tests") # Uninstrumented tests. set(ASAN_NOINST_TEST_OBJECTS) foreach(src ${ASAN_NOINST_TEST_SOURCES}) asan_compile(ASAN_NOINST_TEST_OBJECTS ${src} ${arch} ${kind} ${ASAN_UNITTEST_COMMON_CFLAGS} ${ARGN}) endforeach() add_asan_test(AsanUnitTests "Asan-${arch}${kind}-Noinst-Test" ${arch} ${kind} SUBDIR "default" OBJECTS ${ASAN_NOINST_TEST_OBJECTS} LINKFLAGS ${ASAN_UNITTEST_NOINST_LINKFLAGS} WITH_TEST_RUNTIME) # Benchmarks. set(ASAN_BENCHMARKS_OBJECTS) foreach(src ${ASAN_BENCHMARKS_SOURCES}) asan_compile(ASAN_BENCHMARKS_OBJECTS ${src} ${arch} ${kind} ${ASAN_UNITTEST_INSTRUMENTED_CFLAGS} ${ARGN}) endforeach() add_asan_test(AsanBenchmarks "Asan-${arch}${kind}-Benchmark" ${arch} ${kind} SUBDIR "default" OBJECTS ${ASAN_BENCHMARKS_OBJECTS} LINKFLAGS ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS}) endmacro() if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID) set(ASAN_TEST_ARCH ${ASAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH) endif() foreach(arch ${ASAN_TEST_ARCH}) add_asan_tests_for_arch_and_kind(${arch} "-inline") add_asan_tests_for_arch_and_kind(${arch} "-with-calls" -mllvm -asan-instrumentation-with-call-threshold=0) endforeach() endif() if(ANDROID) foreach(arch ${ASAN_SUPPORTED_ARCH}) # Test w/o ASan instrumentation. Link it with ASan statically. add_executable(AsanNoinstTest # FIXME: .arch? $ $ $ $ $ $ ${COMPILER_RT_GTEST_SOURCE} ${ASAN_NOINST_TEST_SOURCES}) set_target_compile_flags(AsanNoinstTest ${ASAN_UNITTEST_COMMON_CFLAGS}) set_target_link_flags(AsanNoinstTest ${ASAN_UNITTEST_NOINST_LINKFLAGS}) target_link_libraries(AsanNoinstTest ${ASAN_UNITTEST_NOINST_LIBS}) # Test with ASan instrumentation. Link with ASan dynamic runtime. add_executable(AsanTest ${COMPILER_RT_GTEST_SOURCE} ${ASAN_INST_TEST_SOURCES}) set_target_compile_flags(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_CFLAGS}) set_target_link_flags(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_LINKFLAGS}) target_link_libraries(AsanTest ${ASAN_UNITTEST_INSTRUMENTED_LIBS}) # Setup correct output directory and link flags. set_target_properties(AsanNoinstTest AsanTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # Add unit tests to the test suite. add_dependencies(AsanUnitTests AsanNoinstTest AsanTest) endforeach() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_globals_test.cc0000664000175000017500000000211612100207233030014 0ustar mwhudsonmwhudson//===-- asan_globals_test.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Some globals in a separate file. //===----------------------------------------------------------------------===// #include "asan_test_utils.h" char glob1[1]; char glob2[2]; char glob3[3]; char glob4[4]; char glob5[5]; char glob6[6]; char glob7[7]; char glob8[8]; char glob9[9]; char glob10[10]; char glob11[11]; char glob12[12]; char glob13[13]; char glob14[14]; char glob15[15]; char glob16[16]; char glob17[17]; char glob1000[1000]; char glob10000[10000]; char glob100000[100000]; static char static10[10]; int GlobalsTest(int zero) { static char func_static15[15]; glob5[zero] = 0; static10[zero] = 0; func_static15[zero] = 0; return glob5[1] + func_static15[2]; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_asm_test.cc0000664000175000017500000002200512572405364027172 0ustar mwhudsonmwhudson//===-- asan_asm_test.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" #if defined(__linux__) // Assembly instrumentation is broken on x86 Android (x86 + PIC + shared runtime // library). See https://github.com/google/sanitizers/issues/353 #if defined(__x86_64__) || \ (defined(__i386__) && defined(__SSE2__) && !defined(__ANDROID__)) #include namespace { template void asm_write(T *ptr, T val); template T asm_read(T *ptr); template void asm_rep_movs(T *dst, T *src, size_t n); } // End of anonymous namespace #endif // defined(__x86_64__) || (defined(__i386__) && defined(__SSE2__)) #if defined(__x86_64__) namespace { #define DECLARE_ASM_WRITE(Type, Size, Mov, Reg) \ template<> void asm_write(Type *ptr, Type val) { \ __asm__( \ Mov " %[val], (%[ptr]) \n\t" \ : \ : [ptr] "r" (ptr), [val] Reg (val) \ : "memory" \ ); \ } #define DECLARE_ASM_READ(Type, Size, Mov, Reg) \ template<> Type asm_read(Type *ptr) { \ Type res; \ __asm__( \ Mov " (%[ptr]), %[res] \n\t" \ : [res] Reg (res) \ : [ptr] "r" (ptr) \ : "memory" \ ); \ return res; \ } #define DECLARE_ASM_REP_MOVS(Type, Movs) \ template <> void asm_rep_movs(Type * dst, Type * src, size_t size) { \ __asm__("rep " Movs " \n\t" \ : \ : "D"(dst), "S"(src), "c"(size) \ : "rsi", "rdi", "rcx", "memory"); \ } DECLARE_ASM_WRITE(U8, "8", "movq", "r"); DECLARE_ASM_READ(U8, "8", "movq", "=r"); DECLARE_ASM_REP_MOVS(U8, "movsq"); } // End of anonymous namespace #endif // defined(__x86_64__) #if defined(__i386__) && defined(__SSE2__) && !defined(__ANDROID__) namespace { #define DECLARE_ASM_WRITE(Type, Size, Mov, Reg) \ template<> void asm_write(Type *ptr, Type val) { \ __asm__( \ Mov " %[val], (%[ptr]) \n\t" \ : \ : [ptr] "r" (ptr), [val] Reg (val) \ : "memory" \ ); \ } #define DECLARE_ASM_READ(Type, Size, Mov, Reg) \ template<> Type asm_read(Type *ptr) { \ Type res; \ __asm__( \ Mov " (%[ptr]), %[res] \n\t" \ : [res] Reg (res) \ : [ptr] "r" (ptr) \ : "memory" \ ); \ return res; \ } #define DECLARE_ASM_REP_MOVS(Type, Movs) \ template <> void asm_rep_movs(Type * dst, Type * src, size_t size) { \ __asm__("rep " Movs " \n\t" \ : \ : "D"(dst), "S"(src), "c"(size) \ : "esi", "edi", "ecx", "memory"); \ } } // End of anonymous namespace #endif // defined(__i386__) && defined(__SSE2__) #if defined(__x86_64__) || \ (defined(__i386__) && defined(__SSE2__) && !defined(__ANDROID__)) namespace { DECLARE_ASM_WRITE(U1, "1", "movb", "r"); DECLARE_ASM_WRITE(U2, "2", "movw", "r"); DECLARE_ASM_WRITE(U4, "4", "movl", "r"); DECLARE_ASM_WRITE(__m128i, "16", "movaps", "x"); DECLARE_ASM_READ(U1, "1", "movb", "=r"); DECLARE_ASM_READ(U2, "2", "movw", "=r"); DECLARE_ASM_READ(U4, "4", "movl", "=r"); DECLARE_ASM_READ(__m128i, "16", "movaps", "=x"); DECLARE_ASM_REP_MOVS(U1, "movsb"); DECLARE_ASM_REP_MOVS(U2, "movsw"); DECLARE_ASM_REP_MOVS(U4, "movsl"); template void TestAsmWrite(const char *DeathPattern) { T *buf = new T; EXPECT_DEATH(asm_write(&buf[1], static_cast(0)), DeathPattern); T var = 0x12; asm_write(&var, static_cast(0x21)); ASSERT_EQ(static_cast(0x21), var); delete buf; } template<> void TestAsmWrite<__m128i>(const char *DeathPattern) { char *buf = new char[16]; char *p = buf + 16; if (((uintptr_t) p % 16) != 0) p = buf + 8; assert(((uintptr_t) p % 16) == 0); __m128i val = _mm_set1_epi16(0x1234); EXPECT_DEATH(asm_write<__m128i>((__m128i*) p, val), DeathPattern); __m128i var = _mm_set1_epi16(0x4321); asm_write(&var, val); ASSERT_EQ(0x1234, _mm_extract_epi16(var, 0)); delete [] buf; } template void TestAsmRead(const char *DeathPattern) { T *buf = new T; EXPECT_DEATH(asm_read(&buf[1]), DeathPattern); T var = 0x12; ASSERT_EQ(static_cast(0x12), asm_read(&var)); delete buf; } template<> void TestAsmRead<__m128i>(const char *DeathPattern) { char *buf = new char[16]; char *p = buf + 16; if (((uintptr_t) p % 16) != 0) p = buf + 8; assert(((uintptr_t) p % 16) == 0); EXPECT_DEATH(asm_read<__m128i>((__m128i*) p), DeathPattern); __m128i val = _mm_set1_epi16(0x1234); ASSERT_EQ(0x1234, _mm_extract_epi16(asm_read(&val), 0)); delete [] buf; } U4 AsmLoad(U4 *a) { U4 r; __asm__("movl (%[a]), %[r] \n\t" : [r] "=r" (r) : [a] "r" (a) : "memory"); return r; } void AsmStore(U4 r, U4 *a) { __asm__("movl %[r], (%[a]) \n\t" : : [a] "r" (a), [r] "r" (r) : "memory"); } template void TestAsmRepMovs(const char *DeathPatternRead, const char *DeathPatternWrite) { T src_good[4] = { 0x0, 0x1, 0x2, 0x3 }; T dst_good[4] = {}; asm_rep_movs(dst_good, src_good, 4); ASSERT_EQ(static_cast(0x0), dst_good[0]); ASSERT_EQ(static_cast(0x1), dst_good[1]); ASSERT_EQ(static_cast(0x2), dst_good[2]); ASSERT_EQ(static_cast(0x3), dst_good[3]); T dst_bad[3]; EXPECT_DEATH(asm_rep_movs(dst_bad, src_good, 4), DeathPatternWrite); T src_bad[3] = { 0x0, 0x1, 0x2 }; EXPECT_DEATH(asm_rep_movs(dst_good, src_bad, 4), DeathPatternRead); T* dp = dst_bad + 4; T* sp = src_bad + 4; asm_rep_movs(dp, sp, 0); } } // End of anonymous namespace TEST(AddressSanitizer, asm_load_store) { U4* buf = new U4[2]; EXPECT_DEATH(AsmLoad(&buf[3]), "READ of size 4"); EXPECT_DEATH(AsmStore(0x1234, &buf[3]), "WRITE of size 4"); delete [] buf; } TEST(AddressSanitizer, asm_rw) { TestAsmWrite("WRITE of size 1"); TestAsmWrite("WRITE of size 2"); TestAsmWrite("WRITE of size 4"); #if defined(__x86_64__) TestAsmWrite("WRITE of size 8"); #endif // defined(__x86_64__) TestAsmWrite<__m128i>("WRITE of size 16"); TestAsmRead("READ of size 1"); TestAsmRead("READ of size 2"); TestAsmRead("READ of size 4"); #if defined(__x86_64__) TestAsmRead("READ of size 8"); #endif // defined(__x86_64__) TestAsmRead<__m128i>("READ of size 16"); } TEST(AddressSanitizer, asm_flags) { long magic = 0x1234; long r = 0x0; #if defined(__x86_64__) && !defined(__ILP32__) __asm__("xorq %%rax, %%rax \n\t" "movq (%[p]), %%rax \n\t" "sete %%al \n\t" "movzbq %%al, %[r] \n\t" : [r] "=r"(r) : [p] "r"(&magic) : "rax", "memory"); #else __asm__("xorl %%eax, %%eax \n\t" "movl (%[p]), %%eax \n\t" "sete %%al \n\t" "movzbl %%al, %[r] \n\t" : [r] "=r"(r) : [p] "r"(&magic) : "eax", "memory"); #endif // defined(__x86_64__) && !defined(__ILP32__) ASSERT_EQ(0x1, r); } TEST(AddressSanitizer, asm_rep_movs) { TestAsmRepMovs("READ of size 1", "WRITE of size 1"); TestAsmRepMovs("READ of size 2", "WRITE of size 2"); TestAsmRepMovs("READ of size 4", "WRITE of size 4"); #if defined(__x86_64__) TestAsmRepMovs("READ of size 8", "WRITE of size 8"); #endif // defined(__x86_64__) } #endif // defined(__x86_64__) || (defined(__i386__) && defined(__SSE2__)) #endif // defined(__linux__) golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_test_config.h0000664000175000017500000000235612334416470027524 0ustar mwhudsonmwhudson//===-- asan_test_config.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #if !defined(INCLUDED_FROM_ASAN_TEST_UTILS_H) # error "This file should be included into asan_test_utils.h only" #endif #ifndef ASAN_TEST_CONFIG_H #define ASAN_TEST_CONFIG_H #include #include #include using std::string; using std::vector; using std::map; #ifndef ASAN_UAR # error "please define ASAN_UAR" #endif #ifndef ASAN_HAS_EXCEPTIONS # error "please define ASAN_HAS_EXCEPTIONS" #endif #ifndef ASAN_HAS_BLACKLIST # error "please define ASAN_HAS_BLACKLIST" #endif #ifndef ASAN_NEEDS_SEGV # if defined(_WIN32) # define ASAN_NEEDS_SEGV 0 # else # define ASAN_NEEDS_SEGV 1 # endif #endif #ifndef ASAN_AVOID_EXPENSIVE_TESTS # define ASAN_AVOID_EXPENSIVE_TESTS 0 #endif #define ASAN_PCRE_DOTALL "" #endif // ASAN_TEST_CONFIG_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_test_main.cc0000664000175000017500000000246412672466305027350 0ustar mwhudsonmwhudson//===-- asan_test_main.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" #include "sanitizer_common/sanitizer_platform.h" // Default ASAN_OPTIONS for the unit tests. Let's turn symbolication off to // speed up testing (unit tests don't use it anyway). extern "C" const char* __asan_default_options() { #if SANITIZER_MAC // On Darwin, we default to `abort_on_error=1`, which would make tests run // much slower. Let's override this and run lit tests with 'abort_on_error=0'. // Also, make sure we do not overwhelm the syslog while testing. return "symbolize=false:abort_on_error=0:log_to_syslog=0"; #else return "symbolize=false"; #endif } namespace __sanitizer { bool ReexecDisabled() { return true; } } int main(int argc, char **argv) { testing::GTEST_FLAG(death_test_style) = "threadsafe"; testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_test.ignore0000664000175000017500000000013512040270470027214 0ustar mwhudsonmwhudson# blacklisted functions for instrumented ASan unit test fun:*IgnoreTest* fun:*SomeOtherFunc* golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_mac_test_helpers.mm0000664000175000017500000001705712220304261030713 0ustar mwhudsonmwhudson// Mac OS X 10.6 or higher only. #include #include // for pthread_yield_np() #include #include #include #include #import #import #import // This is a (void*)(void*) function so it can be passed to pthread_create. void *CFAllocatorDefaultDoubleFree(void *unused) { void *mem = CFAllocatorAllocate(kCFAllocatorDefault, 5, 0); CFAllocatorDeallocate(kCFAllocatorDefault, mem); CFAllocatorDeallocate(kCFAllocatorDefault, mem); return 0; } void CFAllocatorSystemDefaultDoubleFree() { void *mem = CFAllocatorAllocate(kCFAllocatorSystemDefault, 5, 0); CFAllocatorDeallocate(kCFAllocatorSystemDefault, mem); CFAllocatorDeallocate(kCFAllocatorSystemDefault, mem); } void CFAllocatorMallocDoubleFree() { void *mem = CFAllocatorAllocate(kCFAllocatorMalloc, 5, 0); CFAllocatorDeallocate(kCFAllocatorMalloc, mem); CFAllocatorDeallocate(kCFAllocatorMalloc, mem); } void CFAllocatorMallocZoneDoubleFree() { void *mem = CFAllocatorAllocate(kCFAllocatorMallocZone, 5, 0); CFAllocatorDeallocate(kCFAllocatorMallocZone, mem); CFAllocatorDeallocate(kCFAllocatorMallocZone, mem); } __attribute__((noinline)) void access_memory(char *a) { *a = 0; } // Test the +load instrumentation. // Because the +load methods are invoked before anything else is initialized, // it makes little sense to wrap the code below into a gTest test case. // If AddressSanitizer doesn't instrument the +load method below correctly, // everything will just crash. char kStartupStr[] = "If your test didn't crash, AddressSanitizer is instrumenting " "the +load methods correctly."; @interface LoadSomething : NSObject { } @end @implementation LoadSomething +(void) load { for (size_t i = 0; i < strlen(kStartupStr); i++) { access_memory(&kStartupStr[i]); // make sure no optimizations occur. } // Don't print anything here not to interfere with the death tests. } @end void worker_do_alloc(int size) { char * volatile mem = (char * volatile)malloc(size); mem[0] = 0; // Ok free(mem); } void worker_do_crash(int size) { char * volatile mem = (char * volatile)malloc(size); access_memory(&mem[size]); // BOOM free(mem); } // Used by the GCD tests to avoid a race between the worker thread reporting a // memory error and the main thread which may exit with exit code 0 before // that. void wait_forever() { volatile bool infinite = true; while (infinite) pthread_yield_np(); } // Tests for the Grand Central Dispatch. See // http://developer.apple.com/library/mac/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html // for the reference. void TestGCDDispatchAsync() { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_block_t block = ^{ worker_do_crash(1024); }; // dispatch_async() runs the task on a worker thread that does not go through // pthread_create(). We need to verify that AddressSanitizer notices that the // thread has started. dispatch_async(queue, block); wait_forever(); } void TestGCDDispatchSync() { dispatch_queue_t queue = dispatch_get_global_queue(2, 0); dispatch_block_t block = ^{ worker_do_crash(1024); }; // dispatch_sync() runs the task on a worker thread that does not go through // pthread_create(). We need to verify that AddressSanitizer notices that the // thread has started. dispatch_sync(queue, block); wait_forever(); } // libdispatch spawns a rather small number of threads and reuses them. We need // to make sure AddressSanitizer handles the reusing correctly. void TestGCDReuseWqthreadsAsync() { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_block_t block_alloc = ^{ worker_do_alloc(1024); }; dispatch_block_t block_crash = ^{ worker_do_crash(1024); }; for (int i = 0; i < 100; i++) { dispatch_async(queue, block_alloc); } dispatch_async(queue, block_crash); wait_forever(); } // Try to trigger abnormal behaviour of dispatch_sync() being unhandled by us. void TestGCDReuseWqthreadsSync() { dispatch_queue_t queue[4]; queue[0] = dispatch_get_global_queue(2, 0); queue[1] = dispatch_get_global_queue(0, 0); queue[2] = dispatch_get_global_queue(-2, 0); queue[3] = dispatch_queue_create("my_queue", NULL); dispatch_block_t block_alloc = ^{ worker_do_alloc(1024); }; dispatch_block_t block_crash = ^{ worker_do_crash(1024); }; for (int i = 0; i < 1000; i++) { dispatch_sync(queue[i % 4], block_alloc); } dispatch_sync(queue[3], block_crash); wait_forever(); } void TestGCDDispatchAfter() { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_block_t block_crash = ^{ worker_do_crash(1024); }; // Schedule the event one second from the current time. dispatch_time_t milestone = dispatch_time(DISPATCH_TIME_NOW, 1LL * NSEC_PER_SEC); dispatch_after(milestone, queue, block_crash); wait_forever(); } void worker_do_deallocate(void *ptr) { free(ptr); } void CallFreeOnWorkqueue(void *tsd) { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_block_t block_dealloc = ^{ worker_do_deallocate(tsd); }; dispatch_async(queue, block_dealloc); // Do not wait for the worker to free the memory -- nobody is going to touch // it. } void TestGCDSourceEvent() { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); // Schedule the timer one second from the current time. dispatch_time_t milestone = dispatch_time(DISPATCH_TIME_NOW, 1LL * NSEC_PER_SEC); dispatch_source_set_timer(timer, milestone, DISPATCH_TIME_FOREVER, 0); char * volatile mem = (char * volatile)malloc(10); dispatch_source_set_event_handler(timer, ^{ access_memory(&mem[10]); }); dispatch_resume(timer); wait_forever(); } void TestGCDSourceCancel() { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); // Schedule the timer one second from the current time. dispatch_time_t milestone = dispatch_time(DISPATCH_TIME_NOW, 1LL * NSEC_PER_SEC); dispatch_source_set_timer(timer, milestone, DISPATCH_TIME_FOREVER, 0); char * volatile mem = (char * volatile)malloc(10); // Both dispatch_source_set_cancel_handler() and // dispatch_source_set_event_handler() use dispatch_barrier_async_f(). // It's tricky to test dispatch_source_set_cancel_handler() separately, // so we test both here. dispatch_source_set_event_handler(timer, ^{ dispatch_source_cancel(timer); }); dispatch_source_set_cancel_handler(timer, ^{ access_memory(&mem[10]); }); dispatch_resume(timer); wait_forever(); } void TestGCDGroupAsync() { dispatch_queue_t queue = dispatch_get_global_queue(0, 0); dispatch_group_t group = dispatch_group_create(); char * volatile mem = (char * volatile)malloc(10); dispatch_group_async(group, queue, ^{ access_memory(&mem[10]); }); dispatch_group_wait(group, DISPATCH_TIME_FOREVER); wait_forever(); } @interface FixedArray : NSObject { int items[10]; } @end @implementation FixedArray -(int) access: (int)index { return items[index]; } @end void TestOOBNSObjects() { id anObject = [FixedArray new]; [anObject access:1]; [anObject access:11]; [anObject release]; } void TestNSURLDeallocation() { NSURL *base = [[NSURL alloc] initWithString:@"file://localhost/Users/glider/Library/"]; volatile NSURL *u = [[NSURL alloc] initWithString:@"Saved Application State" relativeToURL:base]; [u release]; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_fake_stack_test.cc0000664000175000017500000001311312334157555030507 0ustar mwhudsonmwhudson//===-- asan_fake_stack_test.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Tests for FakeStack. // This test file should be compiled w/o asan instrumentation. //===----------------------------------------------------------------------===// #include "asan_fake_stack.h" #include "asan_test_utils.h" #include "sanitizer_common/sanitizer_common.h" #include #include #include #include namespace __asan { TEST(FakeStack, FlagsSize) { EXPECT_EQ(FakeStack::SizeRequiredForFlags(10), 1U << 5); EXPECT_EQ(FakeStack::SizeRequiredForFlags(11), 1U << 6); EXPECT_EQ(FakeStack::SizeRequiredForFlags(20), 1U << 15); } TEST(FakeStack, RequiredSize) { // for (int i = 15; i < 20; i++) { // uptr alloc_size = FakeStack::RequiredSize(i); // printf("%zdK ==> %zd\n", 1 << (i - 10), alloc_size); // } EXPECT_EQ(FakeStack::RequiredSize(15), 365568U); EXPECT_EQ(FakeStack::RequiredSize(16), 727040U); EXPECT_EQ(FakeStack::RequiredSize(17), 1449984U); EXPECT_EQ(FakeStack::RequiredSize(18), 2895872U); EXPECT_EQ(FakeStack::RequiredSize(19), 5787648U); } TEST(FakeStack, FlagsOffset) { for (uptr stack_size_log = 15; stack_size_log <= 20; stack_size_log++) { uptr stack_size = 1UL << stack_size_log; uptr offset = 0; for (uptr class_id = 0; class_id < FakeStack::kNumberOfSizeClasses; class_id++) { uptr frame_size = FakeStack::BytesInSizeClass(class_id); uptr num_flags = stack_size / frame_size; EXPECT_EQ(offset, FakeStack::FlagsOffset(stack_size_log, class_id)); // printf("%zd: %zd => %zd %zd\n", stack_size_log, class_id, offset, // FakeStack::FlagsOffset(stack_size_log, class_id)); offset += num_flags; } } } #if !defined(_WIN32) // FIXME: Fails due to OOM on Windows. TEST(FakeStack, CreateDestroy) { for (int i = 0; i < 1000; i++) { for (uptr stack_size_log = 20; stack_size_log <= 22; stack_size_log++) { FakeStack *fake_stack = FakeStack::Create(stack_size_log); fake_stack->Destroy(0); } } } #endif TEST(FakeStack, ModuloNumberOfFrames) { EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, 0), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<15)), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<10)), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<9)), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<8)), 1U<<8); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<15) + 1), 1U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 0), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 1<<9), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 1<<8), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 1<<7), 1U<<7); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 0), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 1), 1U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 15), 15U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 16), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 17), 1U); } TEST(FakeStack, GetFrame) { const uptr stack_size_log = 20; const uptr stack_size = 1 << stack_size_log; FakeStack *fs = FakeStack::Create(stack_size_log); u8 *base = fs->GetFrame(stack_size_log, 0, 0); EXPECT_EQ(base, reinterpret_cast(fs) + fs->SizeRequiredForFlags(stack_size_log) + 4096); EXPECT_EQ(base + 0*stack_size + 64 * 7, fs->GetFrame(stack_size_log, 0, 7U)); EXPECT_EQ(base + 1*stack_size + 128 * 3, fs->GetFrame(stack_size_log, 1, 3U)); EXPECT_EQ(base + 2*stack_size + 256 * 5, fs->GetFrame(stack_size_log, 2, 5U)); fs->Destroy(0); } TEST(FakeStack, Allocate) { const uptr stack_size_log = 19; FakeStack *fs = FakeStack::Create(stack_size_log); std::map s; for (int iter = 0; iter < 2; iter++) { s.clear(); for (uptr cid = 0; cid < FakeStack::kNumberOfSizeClasses; cid++) { uptr n = FakeStack::NumberOfFrames(stack_size_log, cid); uptr bytes_in_class = FakeStack::BytesInSizeClass(cid); for (uptr j = 0; j < n; j++) { FakeFrame *ff = fs->Allocate(stack_size_log, cid, 0); uptr x = reinterpret_cast(ff); EXPECT_TRUE(s.insert(std::make_pair(ff, cid)).second); EXPECT_EQ(x, fs->AddrIsInFakeStack(x)); EXPECT_EQ(x, fs->AddrIsInFakeStack(x + 1)); EXPECT_EQ(x, fs->AddrIsInFakeStack(x + bytes_in_class - 1)); EXPECT_NE(x, fs->AddrIsInFakeStack(x + bytes_in_class)); } // We are out of fake stack, so Allocate should return 0. EXPECT_EQ(0UL, fs->Allocate(stack_size_log, cid, 0)); } for (std::map::iterator it = s.begin(); it != s.end(); ++it) { fs->Deallocate(reinterpret_cast(it->first), it->second); } } fs->Destroy(0); } static void RecursiveFunction(FakeStack *fs, int depth) { uptr class_id = depth / 3; FakeFrame *ff = fs->Allocate(fs->stack_size_log(), class_id, 0); if (depth) { RecursiveFunction(fs, depth - 1); RecursiveFunction(fs, depth - 1); } fs->Deallocate(reinterpret_cast(ff), class_id); } TEST(FakeStack, RecursiveStressTest) { const uptr stack_size_log = 16; FakeStack *fs = FakeStack::Create(stack_size_log); RecursiveFunction(fs, 22); // with 26 runs for 2-3 seconds. fs->Destroy(0); } } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_noinst_test.cc0000664000175000017500000001716512766606132027740 0ustar mwhudsonmwhudson//===-- asan_noinst_test.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This test file should be compiled w/o asan instrumentation. //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_test_utils.h" #include #include #include #include #include // for memset() #include #include #include using namespace __sanitizer; // ATTENTION! // Please don't call intercepted functions (including malloc() and friends) // in this test. The static runtime library is linked explicitly (without // -fsanitize=address), thus the interceptors do not work correctly on OS X. // Make sure __asan_init is called before any test case is run. struct AsanInitCaller { AsanInitCaller() { __asan_init(); } }; static AsanInitCaller asan_init_caller; TEST(AddressSanitizer, InternalSimpleDeathTest) { EXPECT_DEATH(exit(1), ""); } static void MallocStress(size_t n) { u32 seed = my_rand(); BufferedStackTrace stack1; stack1.trace_buffer[0] = 0xa123; stack1.trace_buffer[1] = 0xa456; stack1.size = 2; BufferedStackTrace stack2; stack2.trace_buffer[0] = 0xb123; stack2.trace_buffer[1] = 0xb456; stack2.size = 2; BufferedStackTrace stack3; stack3.trace_buffer[0] = 0xc123; stack3.trace_buffer[1] = 0xc456; stack3.size = 2; std::vector vec; for (size_t i = 0; i < n; i++) { if ((i % 3) == 0) { if (vec.empty()) continue; size_t idx = my_rand_r(&seed) % vec.size(); void *ptr = vec[idx]; vec[idx] = vec.back(); vec.pop_back(); __asan::asan_free(ptr, &stack1, __asan::FROM_MALLOC); } else { size_t size = my_rand_r(&seed) % 1000 + 1; switch ((my_rand_r(&seed) % 128)) { case 0: size += 1024; break; case 1: size += 2048; break; case 2: size += 4096; break; } size_t alignment = 1 << (my_rand_r(&seed) % 10 + 1); char *ptr = (char*)__asan::asan_memalign(alignment, size, &stack2, __asan::FROM_MALLOC); EXPECT_EQ(size, __asan::asan_malloc_usable_size(ptr, 0, 0)); vec.push_back(ptr); ptr[0] = 0; ptr[size-1] = 0; ptr[size/2] = 0; } } for (size_t i = 0; i < vec.size(); i++) __asan::asan_free(vec[i], &stack3, __asan::FROM_MALLOC); } TEST(AddressSanitizer, NoInstMallocTest) { MallocStress(ASAN_LOW_MEMORY ? 300000 : 1000000); } TEST(AddressSanitizer, ThreadedMallocStressTest) { const int kNumThreads = 4; const int kNumIterations = (ASAN_LOW_MEMORY) ? 10000 : 100000; pthread_t t[kNumThreads]; for (int i = 0; i < kNumThreads; i++) { PTHREAD_CREATE(&t[i], 0, (void* (*)(void *x))MallocStress, (void*)kNumIterations); } for (int i = 0; i < kNumThreads; i++) { PTHREAD_JOIN(t[i], 0); } } static void PrintShadow(const char *tag, uptr ptr, size_t size) { fprintf(stderr, "%s shadow: %lx size % 3ld: ", tag, (long)ptr, (long)size); uptr prev_shadow = 0; for (sptr i = -32; i < (sptr)size + 32; i++) { uptr shadow = __asan::MemToShadow(ptr + i); if (i == 0 || i == (sptr)size) fprintf(stderr, "."); if (shadow != prev_shadow) { prev_shadow = shadow; fprintf(stderr, "%02x", (int)*(u8*)shadow); } } fprintf(stderr, "\n"); } TEST(AddressSanitizer, DISABLED_InternalPrintShadow) { for (size_t size = 1; size <= 513; size++) { char *ptr = new char[size]; PrintShadow("m", (uptr)ptr, size); delete [] ptr; PrintShadow("f", (uptr)ptr, size); } } TEST(AddressSanitizer, QuarantineTest) { BufferedStackTrace stack; stack.trace_buffer[0] = 0x890; stack.size = 1; const int size = 1024; void *p = __asan::asan_malloc(size, &stack); __asan::asan_free(p, &stack, __asan::FROM_MALLOC); size_t i; size_t max_i = 1 << 30; for (i = 0; i < max_i; i++) { void *p1 = __asan::asan_malloc(size, &stack); __asan::asan_free(p1, &stack, __asan::FROM_MALLOC); if (p1 == p) break; } EXPECT_GE(i, 10000U); EXPECT_LT(i, max_i); } void *ThreadedQuarantineTestWorker(void *unused) { (void)unused; u32 seed = my_rand(); BufferedStackTrace stack; stack.trace_buffer[0] = 0x890; stack.size = 1; for (size_t i = 0; i < 1000; i++) { void *p = __asan::asan_malloc(1 + (my_rand_r(&seed) % 4000), &stack); __asan::asan_free(p, &stack, __asan::FROM_MALLOC); } return NULL; } // Check that the thread local allocators are flushed when threads are // destroyed. TEST(AddressSanitizer, ThreadedQuarantineTest) { const int n_threads = 3000; size_t mmaped1 = __sanitizer_get_heap_size(); for (int i = 0; i < n_threads; i++) { pthread_t t; PTHREAD_CREATE(&t, NULL, ThreadedQuarantineTestWorker, 0); PTHREAD_JOIN(t, 0); size_t mmaped2 = __sanitizer_get_heap_size(); EXPECT_LT(mmaped2 - mmaped1, 320U * (1 << 20)); } } void *ThreadedOneSizeMallocStress(void *unused) { (void)unused; BufferedStackTrace stack; stack.trace_buffer[0] = 0x890; stack.size = 1; const size_t kNumMallocs = 1000; for (int iter = 0; iter < 1000; iter++) { void *p[kNumMallocs]; for (size_t i = 0; i < kNumMallocs; i++) { p[i] = __asan::asan_malloc(32, &stack); } for (size_t i = 0; i < kNumMallocs; i++) { __asan::asan_free(p[i], &stack, __asan::FROM_MALLOC); } } return NULL; } TEST(AddressSanitizer, ThreadedOneSizeMallocStressTest) { const int kNumThreads = 4; pthread_t t[kNumThreads]; for (int i = 0; i < kNumThreads; i++) { PTHREAD_CREATE(&t[i], 0, ThreadedOneSizeMallocStress, 0); } for (int i = 0; i < kNumThreads; i++) { PTHREAD_JOIN(t[i], 0); } } TEST(AddressSanitizer, ShadowRegionIsPoisonedTest) { using __asan::kHighMemEnd; // Check that __asan_region_is_poisoned works for shadow regions. uptr ptr = kLowShadowBeg + 200; EXPECT_EQ(ptr, __asan_region_is_poisoned(ptr, 100)); ptr = kShadowGapBeg + 200; EXPECT_EQ(ptr, __asan_region_is_poisoned(ptr, 100)); ptr = kHighShadowBeg + 200; EXPECT_EQ(ptr, __asan_region_is_poisoned(ptr, 100)); } // Test __asan_load1 & friends. TEST(AddressSanitizer, LoadStoreCallbacks) { typedef void (*CB)(uptr p); CB cb[2][5] = { { __asan_load1, __asan_load2, __asan_load4, __asan_load8, __asan_load16, }, { __asan_store1, __asan_store2, __asan_store4, __asan_store8, __asan_store16, } }; uptr buggy_ptr; __asan_test_only_reported_buggy_pointer = &buggy_ptr; BufferedStackTrace stack; stack.trace_buffer[0] = 0x890; stack.size = 1; for (uptr len = 16; len <= 32; len++) { char *ptr = (char*) __asan::asan_malloc(len, &stack); uptr p = reinterpret_cast(ptr); for (uptr is_write = 0; is_write <= 1; is_write++) { for (uptr size_log = 0; size_log <= 4; size_log++) { uptr size = 1 << size_log; CB call = cb[is_write][size_log]; // Iterate only size-aligned offsets. for (uptr offset = 0; offset <= len; offset += size) { buggy_ptr = 0; call(p + offset); if (offset + size <= len) EXPECT_EQ(buggy_ptr, 0U); else EXPECT_EQ(buggy_ptr, p + offset); } } } __asan::asan_free(ptr, &stack, __asan::FROM_MALLOC); } __asan_test_only_reported_buggy_pointer = 0; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_mac_test.cc0000664000175000017500000001631012630347544027154 0ustar mwhudsonmwhudson//===-- asan_test_mac.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" #include "asan_mac_test.h" #include #include // For MAC_OS_X_VERSION_* #include TEST(AddressSanitizerMac, CFAllocatorDefaultDoubleFree) { EXPECT_DEATH( CFAllocatorDefaultDoubleFree(NULL), "attempting double-free"); } void CFAllocator_DoubleFreeOnPthread() { pthread_t child; PTHREAD_CREATE(&child, NULL, CFAllocatorDefaultDoubleFree, NULL); PTHREAD_JOIN(child, NULL); // Shouldn't be reached. } TEST(AddressSanitizerMac, CFAllocatorDefaultDoubleFree_ChildPhread) { EXPECT_DEATH(CFAllocator_DoubleFreeOnPthread(), "attempting double-free"); } namespace { void *GLOB; void *CFAllocatorAllocateToGlob(void *unused) { GLOB = CFAllocatorAllocate(NULL, 100, /*hint*/0); return NULL; } void *CFAllocatorDeallocateFromGlob(void *unused) { char *p = (char*)GLOB; p[100] = 'A'; // ASan should report an error here. CFAllocatorDeallocate(NULL, GLOB); return NULL; } void CFAllocator_PassMemoryToAnotherThread() { pthread_t th1, th2; PTHREAD_CREATE(&th1, NULL, CFAllocatorAllocateToGlob, NULL); PTHREAD_JOIN(th1, NULL); PTHREAD_CREATE(&th2, NULL, CFAllocatorDeallocateFromGlob, NULL); PTHREAD_JOIN(th2, NULL); } TEST(AddressSanitizerMac, CFAllocator_PassMemoryToAnotherThread) { EXPECT_DEATH(CFAllocator_PassMemoryToAnotherThread(), "heap-buffer-overflow"); } } // namespace // TODO(glider): figure out whether we still need these tests. Is it correct // to intercept the non-default CFAllocators? TEST(AddressSanitizerMac, DISABLED_CFAllocatorSystemDefaultDoubleFree) { EXPECT_DEATH( CFAllocatorSystemDefaultDoubleFree(), "attempting double-free"); } // We're intercepting malloc, so kCFAllocatorMalloc is routed to ASan. TEST(AddressSanitizerMac, CFAllocatorMallocDoubleFree) { EXPECT_DEATH(CFAllocatorMallocDoubleFree(), "attempting double-free"); } TEST(AddressSanitizerMac, DISABLED_CFAllocatorMallocZoneDoubleFree) { EXPECT_DEATH(CFAllocatorMallocZoneDoubleFree(), "attempting double-free"); } // For libdispatch tests below we check that ASan got to the shadow byte // legend, i.e. managed to print the thread stacks (this almost certainly // means that the libdispatch task creation has been intercepted correctly). TEST(AddressSanitizerMac, GCDDispatchAsync) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDDispatchAsync(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDDispatchSync) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDDispatchSync(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDReuseWqthreadsAsync) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDReuseWqthreadsAsync(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDReuseWqthreadsSync) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDReuseWqthreadsSync(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDDispatchAfter) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDDispatchAfter(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDSourceEvent) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDSourceEvent(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDSourceCancel) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDSourceCancel(), "Shadow byte legend"); } TEST(AddressSanitizerMac, GCDGroupAsync) { // Make sure the whole ASan report is printed, i.e. that we don't die // on a CHECK. EXPECT_DEATH(TestGCDGroupAsync(), "Shadow byte legend"); } void *MallocIntrospectionLockWorker(void *_) { const int kNumPointers = 100; int i; void *pointers[kNumPointers]; for (i = 0; i < kNumPointers; i++) { pointers[i] = malloc(i + 1); } for (i = 0; i < kNumPointers; i++) { free(pointers[i]); } return NULL; } void *MallocIntrospectionLockForker(void *_) { pid_t result = fork(); if (result == -1) { perror("fork"); } assert(result != -1); if (result == 0) { // Call malloc in the child process to make sure we won't deadlock. void *ptr = malloc(42); free(ptr); exit(0); } else { // Return in the parent process. return NULL; } } TEST(AddressSanitizerMac, MallocIntrospectionLock) { // Incorrect implementation of force_lock and force_unlock in our malloc zone // will cause forked processes to deadlock. // TODO(glider): need to detect that none of the child processes deadlocked. const int kNumWorkers = 5, kNumIterations = 100; int i, iter; for (iter = 0; iter < kNumIterations; iter++) { pthread_t workers[kNumWorkers], forker; for (i = 0; i < kNumWorkers; i++) { PTHREAD_CREATE(&workers[i], 0, MallocIntrospectionLockWorker, 0); } PTHREAD_CREATE(&forker, 0, MallocIntrospectionLockForker, 0); for (i = 0; i < kNumWorkers; i++) { PTHREAD_JOIN(workers[i], 0); } PTHREAD_JOIN(forker, 0); } } void *TSDAllocWorker(void *test_key) { if (test_key) { void *mem = malloc(10); pthread_setspecific(*(pthread_key_t*)test_key, mem); } return NULL; } TEST(AddressSanitizerMac, DISABLED_TSDWorkqueueTest) { pthread_t th; pthread_key_t test_key; pthread_key_create(&test_key, CallFreeOnWorkqueue); PTHREAD_CREATE(&th, NULL, TSDAllocWorker, &test_key); PTHREAD_JOIN(th, NULL); pthread_key_delete(test_key); } // Test that CFStringCreateCopy does not copy constant strings. TEST(AddressSanitizerMac, CFStringCreateCopy) { CFStringRef str = CFSTR("Hello world!\n"); CFStringRef str2 = CFStringCreateCopy(0, str); EXPECT_EQ(str, str2); } TEST(AddressSanitizerMac, NSObjectOOB) { // Make sure that our allocators are used for NSObjects. EXPECT_DEATH(TestOOBNSObjects(), "heap-buffer-overflow"); } // Make sure that correct pointer is passed to free() when deallocating a // NSURL object. // See https://github.com/google/sanitizers/issues/70. TEST(AddressSanitizerMac, NSURLDeallocation) { TestNSURLDeallocation(); } // See https://github.com/google/sanitizers/issues/109. TEST(AddressSanitizerMac, Mstats) { malloc_statistics_t stats1, stats2; malloc_zone_statistics(/*all zones*/NULL, &stats1); const size_t kMallocSize = 100000; void *alloc = Ident(malloc(kMallocSize)); malloc_zone_statistics(/*all zones*/NULL, &stats2); EXPECT_GT(stats2.blocks_in_use, stats1.blocks_in_use); EXPECT_GE(stats2.size_in_use - stats1.size_in_use, kMallocSize); free(alloc); // Even the default OSX allocator may not change the stats after free(). } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_racy_double_free_test.cc0000664000175000017500000000113112303447622031673 0ustar mwhudsonmwhudson#include #include #include const int N = 1000; void *x[N]; void *Thread1(void *unused) { for (int i = 0; i < N; i++) { fprintf(stderr, "%s %d\n", __func__, i); free(x[i]); } return NULL; } void *Thread2(void *unused) { for (int i = 0; i < N; i++) { fprintf(stderr, "%s %d\n", __func__, i); free(x[i]); } return NULL; } int main() { for (int i = 0; i < N; i++) x[i] = malloc(128); pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); pthread_create(&t[1], 0, Thread2, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/tests/asan_str_test.cc0000664000175000017500000005056012746157166027240 0ustar mwhudsonmwhudson//=-- asan_str_test.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // //===----------------------------------------------------------------------===// #include "asan_test_utils.h" #if defined(__APPLE__) #include // For MAC_OS_X_VERSION_* #endif // Used for string functions tests static char global_string[] = "global"; static size_t global_string_length = 6; const char kStackReadUnderflow[] = #if !GTEST_USES_SIMPLE_RE ASAN_PCRE_DOTALL "READ.*" #endif "underflows this variable"; const char kStackReadOverflow[] = #if !GTEST_USES_SIMPLE_RE ASAN_PCRE_DOTALL "READ.*" #endif "overflows this variable"; namespace { enum class OOBKind { Heap, Stack, Global, }; string LeftOOBReadMessage(OOBKind oob_kind, int oob_distance) { return oob_kind == OOBKind::Stack ? kStackReadUnderflow : ::LeftOOBReadMessage(oob_distance); } string RightOOBReadMessage(OOBKind oob_kind, int oob_distance) { return oob_kind == OOBKind::Stack ? kStackReadOverflow : ::RightOOBReadMessage(oob_distance); } } // namespace // Input to a test is a zero-terminated string str with given length // Accesses to the bytes to the left and to the right of str // are presumed to produce OOB errors void StrLenOOBTestTemplate(char *str, size_t length, OOBKind oob_kind) { // Normal strlen calls EXPECT_EQ(strlen(str), length); if (length > 0) { EXPECT_EQ(length - 1, strlen(str + 1)); EXPECT_EQ(0U, strlen(str + length)); } // Arg of strlen is not malloced, OOB access if (oob_kind != OOBKind::Global) { // We don't insert RedZones to the left of global variables EXPECT_DEATH(Ident(strlen(str - 1)), LeftOOBReadMessage(oob_kind, 1)); EXPECT_DEATH(Ident(strlen(str - 5)), LeftOOBReadMessage(oob_kind, 5)); } EXPECT_DEATH(Ident(strlen(str + length + 1)), RightOOBReadMessage(oob_kind, 0)); // Overwrite terminator str[length] = 'a'; // String is not zero-terminated, strlen will lead to OOB access EXPECT_DEATH(Ident(strlen(str)), RightOOBReadMessage(oob_kind, 0)); EXPECT_DEATH(Ident(strlen(str + length)), RightOOBReadMessage(oob_kind, 0)); // Restore terminator str[length] = 0; } TEST(AddressSanitizer, StrLenOOBTest) { // Check heap-allocated string size_t length = Ident(10); char *heap_string = Ident((char*)malloc(length + 1)); char stack_string[10 + 1]; break_optimization(&stack_string); for (size_t i = 0; i < length; i++) { heap_string[i] = 'a'; stack_string[i] = 'b'; } heap_string[length] = 0; stack_string[length] = 0; StrLenOOBTestTemplate(heap_string, length, OOBKind::Heap); StrLenOOBTestTemplate(stack_string, length, OOBKind::Stack); StrLenOOBTestTemplate(global_string, global_string_length, OOBKind::Global); free(heap_string); } TEST(AddressSanitizer, WcsLenTest) { EXPECT_EQ(0U, wcslen(Ident(L""))); size_t hello_len = 13; size_t hello_size = (hello_len + 1) * sizeof(wchar_t); EXPECT_EQ(hello_len, wcslen(Ident(L"Hello, World!"))); wchar_t *heap_string = Ident((wchar_t*)malloc(hello_size)); memcpy(heap_string, L"Hello, World!", hello_size); EXPECT_EQ(hello_len, Ident(wcslen(heap_string))); EXPECT_DEATH(Ident(wcslen(heap_string + 14)), RightOOBReadMessage(0)); free(heap_string); } #if SANITIZER_TEST_HAS_STRNLEN TEST(AddressSanitizer, StrNLenOOBTest) { size_t size = Ident(123); char *str = MallocAndMemsetString(size); // Normal strnlen calls. Ident(strnlen(str - 1, 0)); Ident(strnlen(str, size)); Ident(strnlen(str + size - 1, 1)); str[size - 1] = '\0'; Ident(strnlen(str, 2 * size)); // Argument points to not allocated memory. EXPECT_DEATH(Ident(strnlen(str - 1, 1)), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(strnlen(str + size, 1)), RightOOBReadMessage(0)); // Overwrite the terminating '\0' and hit unallocated memory. str[size - 1] = 'z'; EXPECT_DEATH(Ident(strnlen(str, size + 1)), RightOOBReadMessage(0)); free(str); } #endif // SANITIZER_TEST_HAS_STRNLEN TEST(AddressSanitizer, StrDupOOBTest) { size_t size = Ident(42); char *str = MallocAndMemsetString(size); char *new_str; // Normal strdup calls. str[size - 1] = '\0'; new_str = strdup(str); free(new_str); new_str = strdup(str + size - 1); free(new_str); // Argument points to not allocated memory. EXPECT_DEATH(Ident(strdup(str - 1)), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(strdup(str + size)), RightOOBReadMessage(0)); // Overwrite the terminating '\0' and hit unallocated memory. str[size - 1] = 'z'; EXPECT_DEATH(Ident(strdup(str)), RightOOBReadMessage(0)); free(str); } TEST(AddressSanitizer, StrCpyOOBTest) { size_t to_size = Ident(30); size_t from_size = Ident(6); // less than to_size char *to = Ident((char*)malloc(to_size)); char *from = Ident((char*)malloc(from_size)); // Normal strcpy calls. strcpy(from, "hello"); strcpy(to, from); strcpy(to + to_size - from_size, from); // Length of "from" is too small. EXPECT_DEATH(Ident(strcpy(from, "hello2")), RightOOBWriteMessage(0)); // "to" or "from" points to not allocated memory. EXPECT_DEATH(Ident(strcpy(to - 1, from)), LeftOOBWriteMessage(1)); EXPECT_DEATH(Ident(strcpy(to, from - 1)), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(strcpy(to, from + from_size)), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(strcpy(to + to_size, from)), RightOOBWriteMessage(0)); // Overwrite the terminating '\0' character and hit unallocated memory. from[from_size - 1] = '!'; EXPECT_DEATH(Ident(strcpy(to, from)), RightOOBReadMessage(0)); free(to); free(from); } TEST(AddressSanitizer, StrNCpyOOBTest) { size_t to_size = Ident(20); size_t from_size = Ident(6); // less than to_size char *to = Ident((char*)malloc(to_size)); // From is a zero-terminated string "hello\0" of length 6 char *from = Ident((char*)malloc(from_size)); strcpy(from, "hello"); // copy 0 bytes strncpy(to, from, 0); strncpy(to - 1, from - 1, 0); // normal strncpy calls strncpy(to, from, from_size); strncpy(to, from, to_size); strncpy(to, from + from_size - 1, to_size); strncpy(to + to_size - 1, from, 1); // One of {to, from} points to not allocated memory EXPECT_DEATH(Ident(strncpy(to, from - 1, from_size)), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(strncpy(to - 1, from, from_size)), LeftOOBWriteMessage(1)); EXPECT_DEATH(Ident(strncpy(to, from + from_size, 1)), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(strncpy(to + to_size, from, 1)), RightOOBWriteMessage(0)); // Length of "to" is too small EXPECT_DEATH(Ident(strncpy(to + to_size - from_size + 1, from, from_size)), RightOOBWriteMessage(0)); EXPECT_DEATH(Ident(strncpy(to + 1, from, to_size)), RightOOBWriteMessage(0)); // Overwrite terminator in from from[from_size - 1] = '!'; // normal strncpy call strncpy(to, from, from_size); // Length of "from" is too small EXPECT_DEATH(Ident(strncpy(to, from, to_size)), RightOOBReadMessage(0)); free(to); free(from); } // Users may have different definitions of "strchr" and "index", so provide // function pointer typedefs and overload RunStrChrTest implementation. // We can't use macro for RunStrChrTest body here, as this macro would // confuse EXPECT_DEATH gtest macro. typedef char*(*PointerToStrChr1)(const char*, int); typedef char*(*PointerToStrChr2)(char*, int); template static void RunStrChrTestImpl(StrChrFn *StrChr) { size_t size = Ident(100); char *str = MallocAndMemsetString(size); str[10] = 'q'; str[11] = '\0'; EXPECT_EQ(str, StrChr(str, 'z')); EXPECT_EQ(str + 10, StrChr(str, 'q')); EXPECT_EQ(NULL, StrChr(str, 'a')); // StrChr argument points to not allocated memory. EXPECT_DEATH(Ident(StrChr(str - 1, 'z')), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(StrChr(str + size, 'z')), RightOOBReadMessage(0)); // Overwrite the terminator and hit not allocated memory. str[11] = 'z'; EXPECT_DEATH(Ident(StrChr(str, 'a')), RightOOBReadMessage(0)); free(str); } // Prefer to use the standard signature if both are available. UNUSED static void RunStrChrTest(PointerToStrChr1 StrChr, ...) { RunStrChrTestImpl(StrChr); } UNUSED static void RunStrChrTest(PointerToStrChr2 StrChr, int) { RunStrChrTestImpl(StrChr); } TEST(AddressSanitizer, StrChrAndIndexOOBTest) { RunStrChrTest(&strchr, 0); // No index() on Windows and on Android L. #if !defined(_WIN32) && !defined(__ANDROID__) RunStrChrTest(&index, 0); #endif } TEST(AddressSanitizer, StrCmpAndFriendsLogicTest) { // strcmp EXPECT_EQ(0, strcmp("", "")); EXPECT_EQ(0, strcmp("abcd", "abcd")); EXPECT_GT(0, strcmp("ab", "ac")); EXPECT_GT(0, strcmp("abc", "abcd")); EXPECT_LT(0, strcmp("acc", "abc")); EXPECT_LT(0, strcmp("abcd", "abc")); // strncmp EXPECT_EQ(0, strncmp("a", "b", 0)); EXPECT_EQ(0, strncmp("abcd", "abcd", 10)); EXPECT_EQ(0, strncmp("abcd", "abcef", 3)); EXPECT_GT(0, strncmp("abcde", "abcfa", 4)); EXPECT_GT(0, strncmp("a", "b", 5)); EXPECT_GT(0, strncmp("bc", "bcde", 4)); EXPECT_LT(0, strncmp("xyz", "xyy", 10)); EXPECT_LT(0, strncmp("baa", "aaa", 1)); EXPECT_LT(0, strncmp("zyx", "", 2)); #if !defined(_WIN32) // no str[n]casecmp on Windows. // strcasecmp EXPECT_EQ(0, strcasecmp("", "")); EXPECT_EQ(0, strcasecmp("zzz", "zzz")); EXPECT_EQ(0, strcasecmp("abCD", "ABcd")); EXPECT_GT(0, strcasecmp("aB", "Ac")); EXPECT_GT(0, strcasecmp("ABC", "ABCd")); EXPECT_LT(0, strcasecmp("acc", "abc")); EXPECT_LT(0, strcasecmp("ABCd", "abc")); // strncasecmp EXPECT_EQ(0, strncasecmp("a", "b", 0)); EXPECT_EQ(0, strncasecmp("abCD", "ABcd", 10)); EXPECT_EQ(0, strncasecmp("abCd", "ABcef", 3)); EXPECT_GT(0, strncasecmp("abcde", "ABCfa", 4)); EXPECT_GT(0, strncasecmp("a", "B", 5)); EXPECT_GT(0, strncasecmp("bc", "BCde", 4)); EXPECT_LT(0, strncasecmp("xyz", "xyy", 10)); EXPECT_LT(0, strncasecmp("Baa", "aaa", 1)); EXPECT_LT(0, strncasecmp("zyx", "", 2)); #endif // memcmp EXPECT_EQ(0, memcmp("a", "b", 0)); EXPECT_EQ(0, memcmp("ab\0c", "ab\0c", 4)); EXPECT_GT(0, memcmp("\0ab", "\0ac", 3)); EXPECT_GT(0, memcmp("abb\0", "abba", 4)); EXPECT_LT(0, memcmp("ab\0cd", "ab\0c\0", 5)); EXPECT_LT(0, memcmp("zza", "zyx", 3)); } typedef int(*PointerToStrCmp)(const char*, const char*); void RunStrCmpTest(PointerToStrCmp StrCmp) { size_t size = Ident(100); int fill = 'o'; char *s1 = MallocAndMemsetString(size, fill); char *s2 = MallocAndMemsetString(size, fill); s1[size - 1] = '\0'; s2[size - 1] = '\0'; // Normal StrCmp calls Ident(StrCmp(s1, s2)); Ident(StrCmp(s1, s2 + size - 1)); Ident(StrCmp(s1 + size - 1, s2 + size - 1)); // One of arguments points to not allocated memory. EXPECT_DEATH(Ident(StrCmp)(s1 - 1, s2), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(StrCmp)(s1, s2 - 1), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(StrCmp)(s1 + size, s2), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(StrCmp)(s1, s2 + size), RightOOBReadMessage(0)); // Hit unallocated memory and die. s1[size - 1] = fill; EXPECT_DEATH(Ident(StrCmp)(s1, s1), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(StrCmp)(s1 + size - 1, s2), RightOOBReadMessage(0)); free(s1); free(s2); } TEST(AddressSanitizer, StrCmpOOBTest) { RunStrCmpTest(&strcmp); } #if !defined(_WIN32) // no str[n]casecmp on Windows. TEST(AddressSanitizer, StrCaseCmpOOBTest) { RunStrCmpTest(&strcasecmp); } #endif typedef int(*PointerToStrNCmp)(const char*, const char*, size_t); void RunStrNCmpTest(PointerToStrNCmp StrNCmp) { size_t size = Ident(100); char *s1 = MallocAndMemsetString(size); char *s2 = MallocAndMemsetString(size); s1[size - 1] = '\0'; s2[size - 1] = '\0'; // Normal StrNCmp calls Ident(StrNCmp(s1, s2, size + 2)); s1[size - 1] = 'z'; s2[size - 1] = 'x'; Ident(StrNCmp(s1 + size - 2, s2 + size - 2, size)); s2[size - 1] = 'z'; Ident(StrNCmp(s1 - 1, s2 - 1, 0)); Ident(StrNCmp(s1 + size - 1, s2 + size - 1, 1)); // One of arguments points to not allocated memory. EXPECT_DEATH(Ident(StrNCmp)(s1 - 1, s2, 1), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(StrNCmp)(s1, s2 - 1, 1), LeftOOBReadMessage(1)); EXPECT_DEATH(Ident(StrNCmp)(s1 + size, s2, 1), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(StrNCmp)(s1, s2 + size, 1), RightOOBReadMessage(0)); // Hit unallocated memory and die. EXPECT_DEATH(Ident(StrNCmp)(s1 + 1, s2 + 1, size), RightOOBReadMessage(0)); EXPECT_DEATH(Ident(StrNCmp)(s1 + size - 1, s2, 2), RightOOBReadMessage(0)); free(s1); free(s2); } TEST(AddressSanitizer, StrNCmpOOBTest) { RunStrNCmpTest(&strncmp); } #if !defined(_WIN32) // no str[n]casecmp on Windows. TEST(AddressSanitizer, StrNCaseCmpOOBTest) { RunStrNCmpTest(&strncasecmp); } #endif TEST(AddressSanitizer, StrCatOOBTest) { // strcat() reads strlen(to) bytes from |to| before concatenating. size_t to_size = Ident(100); char *to = MallocAndMemsetString(to_size); to[0] = '\0'; size_t from_size = Ident(20); char *from = MallocAndMemsetString(from_size); from[from_size - 1] = '\0'; // Normal strcat calls. strcat(to, from); strcat(to, from); strcat(to + from_size, from + from_size - 2); // Passing an invalid pointer is an error even when concatenating an empty // string. EXPECT_DEATH(strcat(to - 1, from + from_size - 1), LeftOOBAccessMessage(1)); // One of arguments points to not allocated memory. EXPECT_DEATH(strcat(to - 1, from), LeftOOBAccessMessage(1)); EXPECT_DEATH(strcat(to, from - 1), LeftOOBReadMessage(1)); EXPECT_DEATH(strcat(to, from + from_size), RightOOBReadMessage(0)); // "from" is not zero-terminated. from[from_size - 1] = 'z'; EXPECT_DEATH(strcat(to, from), RightOOBReadMessage(0)); from[from_size - 1] = '\0'; // "to" is too short to fit "from". memset(to, 'z', to_size); to[to_size - from_size + 1] = '\0'; EXPECT_DEATH(strcat(to, from), RightOOBWriteMessage(0)); // length of "to" is just enough. strcat(to, from + 1); free(to); free(from); } TEST(AddressSanitizer, StrNCatOOBTest) { // strncat() reads strlen(to) bytes from |to| before concatenating. size_t to_size = Ident(100); char *to = MallocAndMemsetString(to_size); to[0] = '\0'; size_t from_size = Ident(20); char *from = MallocAndMemsetString(from_size); // Normal strncat calls. strncat(to, from, 0); strncat(to, from, from_size); from[from_size - 1] = '\0'; strncat(to, from, 2 * from_size); // Catenating empty string with an invalid string is still an error. EXPECT_DEATH(strncat(to - 1, from, 0), LeftOOBAccessMessage(1)); strncat(to, from + from_size - 1, 10); // One of arguments points to not allocated memory. EXPECT_DEATH(strncat(to - 1, from, 2), LeftOOBAccessMessage(1)); EXPECT_DEATH(strncat(to, from - 1, 2), LeftOOBReadMessage(1)); EXPECT_DEATH(strncat(to, from + from_size, 2), RightOOBReadMessage(0)); memset(from, 'z', from_size); memset(to, 'z', to_size); to[0] = '\0'; // "from" is too short. EXPECT_DEATH(strncat(to, from, from_size + 1), RightOOBReadMessage(0)); // "to" is too short to fit "from". to[0] = 'z'; to[to_size - from_size + 1] = '\0'; EXPECT_DEATH(strncat(to, from, from_size - 1), RightOOBWriteMessage(0)); // "to" is just enough. strncat(to, from, from_size - 2); free(to); free(from); } static string OverlapErrorMessage(const string &func) { return func + "-param-overlap"; } TEST(AddressSanitizer, StrArgsOverlapTest) { size_t size = Ident(100); char *str = Ident((char*)malloc(size)); // Do not check memcpy() on OS X 10.7 and later, where it actually aliases // memmove(). #if !defined(__APPLE__) || !defined(MAC_OS_X_VERSION_10_7) || \ (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) // Check "memcpy". Use Ident() to avoid inlining. #if PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE memset(str, 'z', size); Ident(memcpy)(str + 1, str + 11, 10); Ident(memcpy)(str, str, 0); EXPECT_DEATH(Ident(memcpy)(str, str + 14, 15), OverlapErrorMessage("memcpy")); EXPECT_DEATH(Ident(memcpy)(str + 14, str, 15), OverlapErrorMessage("memcpy")); #endif #endif // We do not treat memcpy with to==from as a bug. // See http://llvm.org/bugs/show_bug.cgi?id=11763. // EXPECT_DEATH(Ident(memcpy)(str + 20, str + 20, 1), // OverlapErrorMessage("memcpy")); // Check "strcpy". memset(str, 'z', size); str[9] = '\0'; strcpy(str + 10, str); EXPECT_DEATH(strcpy(str + 9, str), OverlapErrorMessage("strcpy")); EXPECT_DEATH(strcpy(str, str + 4), OverlapErrorMessage("strcpy")); strcpy(str, str + 5); // Check "strncpy". memset(str, 'z', size); strncpy(str, str + 10, 10); EXPECT_DEATH(strncpy(str, str + 9, 10), OverlapErrorMessage("strncpy")); EXPECT_DEATH(strncpy(str + 9, str, 10), OverlapErrorMessage("strncpy")); str[10] = '\0'; strncpy(str + 11, str, 20); EXPECT_DEATH(strncpy(str + 10, str, 20), OverlapErrorMessage("strncpy")); // Check "strcat". memset(str, 'z', size); str[10] = '\0'; str[20] = '\0'; strcat(str, str + 10); EXPECT_DEATH(strcat(str, str + 11), OverlapErrorMessage("strcat")); str[10] = '\0'; strcat(str + 11, str); EXPECT_DEATH(strcat(str, str + 9), OverlapErrorMessage("strcat")); EXPECT_DEATH(strcat(str + 9, str), OverlapErrorMessage("strcat")); EXPECT_DEATH(strcat(str + 10, str), OverlapErrorMessage("strcat")); // Check "strncat". memset(str, 'z', size); str[10] = '\0'; strncat(str, str + 10, 10); // from is empty EXPECT_DEATH(strncat(str, str + 11, 10), OverlapErrorMessage("strncat")); str[10] = '\0'; str[20] = '\0'; strncat(str + 5, str, 5); str[10] = '\0'; EXPECT_DEATH(strncat(str + 5, str, 6), OverlapErrorMessage("strncat")); EXPECT_DEATH(strncat(str, str + 9, 10), OverlapErrorMessage("strncat")); free(str); } typedef void(*PointerToCallAtoi)(const char*); void RunAtoiOOBTest(PointerToCallAtoi Atoi) { char *array = MallocAndMemsetString(10, '1'); // Invalid pointer to the string. EXPECT_DEATH(Atoi(array + 11), RightOOBReadMessage(1)); EXPECT_DEATH(Atoi(array - 1), LeftOOBReadMessage(1)); // Die if a buffer doesn't have terminating NULL. EXPECT_DEATH(Atoi(array), RightOOBReadMessage(0)); // Make last symbol a terminating NULL array[9] = '\0'; Atoi(array); // Sometimes we need to detect overflow if no digits are found. memset(array, ' ', 10); EXPECT_DEATH(Atoi(array), RightOOBReadMessage(0)); array[9] = '-'; EXPECT_DEATH(Atoi(array), RightOOBReadMessage(0)); EXPECT_DEATH(Atoi(array + 9), RightOOBReadMessage(0)); free(array); } #if !defined(_WIN32) // FIXME: Fix and enable on Windows. void CallAtoi(const char *nptr) { Ident(atoi(nptr)); } void CallAtol(const char *nptr) { Ident(atol(nptr)); } void CallAtoll(const char *nptr) { Ident(atoll(nptr)); } TEST(AddressSanitizer, AtoiAndFriendsOOBTest) { RunAtoiOOBTest(&CallAtoi); RunAtoiOOBTest(&CallAtol); RunAtoiOOBTest(&CallAtoll); } #endif typedef void(*PointerToCallStrtol)(const char*, char**, int); void RunStrtolOOBTest(PointerToCallStrtol Strtol) { char *array = MallocAndMemsetString(3); array[0] = '1'; array[1] = '2'; array[2] = '3'; // Invalid pointer to the string. EXPECT_DEATH(Strtol(array + 3, NULL, 0), RightOOBReadMessage(0)); EXPECT_DEATH(Strtol(array - 1, NULL, 0), LeftOOBReadMessage(1)); // Buffer overflow if there is no terminating null (depends on base). EXPECT_DEATH(Strtol(array, NULL, 0), RightOOBReadMessage(0)); array[2] = 'z'; EXPECT_DEATH(Strtol(array, NULL, 36), RightOOBReadMessage(0)); // Add terminating zero to get rid of overflow. array[2] = '\0'; Strtol(array, NULL, 36); // Sometimes we need to detect overflow if no digits are found. array[0] = array[1] = array[2] = ' '; EXPECT_DEATH(Strtol(array, NULL, 0), RightOOBReadMessage(0)); array[2] = '+'; EXPECT_DEATH(Strtol(array, NULL, 0), RightOOBReadMessage(0)); array[2] = '-'; EXPECT_DEATH(Strtol(array, NULL, 0), RightOOBReadMessage(0)); free(array); } #if !defined(_WIN32) // FIXME: Fix and enable on Windows. void CallStrtol(const char *nptr, char **endptr, int base) { Ident(strtol(nptr, endptr, base)); } void CallStrtoll(const char *nptr, char **endptr, int base) { Ident(strtoll(nptr, endptr, base)); } TEST(AddressSanitizer, StrtollOOBTest) { RunStrtolOOBTest(&CallStrtoll); } TEST(AddressSanitizer, StrtolOOBTest) { RunStrtolOOBTest(&CallStrtol); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/.clang-format0000664000175000017500000000002512623444376025254 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_thread.cc0000664000175000017500000003705612772733540025476 0ustar mwhudsonmwhudson//===-- asan_thread.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Thread-related code. //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_interceptors.h" #include "asan_poisoning.h" #include "asan_stack.h" #include "asan_thread.h" #include "asan_mapping.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "lsan/lsan_common.h" namespace __asan { // AsanThreadContext implementation. struct CreateThreadContextArgs { AsanThread *thread; StackTrace *stack; }; void AsanThreadContext::OnCreated(void *arg) { CreateThreadContextArgs *args = static_cast(arg); if (args->stack) stack_id = StackDepotPut(*args->stack); thread = args->thread; thread->set_context(this); } void AsanThreadContext::OnFinished() { // Drop the link to the AsanThread object. thread = nullptr; } // MIPS requires aligned address static ALIGNED(16) char thread_registry_placeholder[sizeof(ThreadRegistry)]; static ThreadRegistry *asan_thread_registry; static BlockingMutex mu_for_thread_context(LINKER_INITIALIZED); static LowLevelAllocator allocator_for_thread_context; static ThreadContextBase *GetAsanThreadContext(u32 tid) { BlockingMutexLock lock(&mu_for_thread_context); return new(allocator_for_thread_context) AsanThreadContext(tid); } ThreadRegistry &asanThreadRegistry() { static bool initialized; // Don't worry about thread_safety - this should be called when there is // a single thread. if (!initialized) { // Never reuse ASan threads: we store pointer to AsanThreadContext // in TSD and can't reliably tell when no more TSD destructors will // be called. It would be wrong to reuse AsanThreadContext for another // thread before all TSD destructors will be called for it. asan_thread_registry = new(thread_registry_placeholder) ThreadRegistry( GetAsanThreadContext, kMaxNumberOfThreads, kMaxNumberOfThreads); initialized = true; } return *asan_thread_registry; } AsanThreadContext *GetThreadContextByTidLocked(u32 tid) { return static_cast( asanThreadRegistry().GetThreadLocked(tid)); } // AsanThread implementation. AsanThread *AsanThread::Create(thread_callback_t start_routine, void *arg, u32 parent_tid, StackTrace *stack, bool detached) { uptr PageSize = GetPageSizeCached(); uptr size = RoundUpTo(sizeof(AsanThread), PageSize); AsanThread *thread = (AsanThread*)MmapOrDie(size, __func__); thread->start_routine_ = start_routine; thread->arg_ = arg; CreateThreadContextArgs args = { thread, stack }; asanThreadRegistry().CreateThread(*reinterpret_cast(thread), detached, parent_tid, &args); return thread; } void AsanThread::TSDDtor(void *tsd) { AsanThreadContext *context = (AsanThreadContext*)tsd; VReport(1, "T%d TSDDtor\n", context->tid); if (context->thread) context->thread->Destroy(); } void AsanThread::Destroy() { int tid = this->tid(); VReport(1, "T%d exited\n", tid); malloc_storage().CommitBack(); if (common_flags()->use_sigaltstack) UnsetAlternateSignalStack(); asanThreadRegistry().FinishThread(tid); FlushToDeadThreadStats(&stats_); // We also clear the shadow on thread destruction because // some code may still be executing in later TSD destructors // and we don't want it to have any poisoned stack. ClearShadowForThreadStackAndTLS(); DeleteFakeStack(tid); uptr size = RoundUpTo(sizeof(AsanThread), GetPageSizeCached()); UnmapOrDie(this, size); DTLS_Destroy(); } void AsanThread::StartSwitchFiber(FakeStack **fake_stack_save, uptr bottom, uptr size) { if (atomic_load(&stack_switching_, memory_order_relaxed)) { Report("ERROR: starting fiber switch while in fiber switch\n"); Die(); } next_stack_bottom_ = bottom; next_stack_top_ = bottom + size; atomic_store(&stack_switching_, 1, memory_order_release); FakeStack *current_fake_stack = fake_stack_; if (fake_stack_save) *fake_stack_save = fake_stack_; fake_stack_ = nullptr; SetTLSFakeStack(nullptr); // if fake_stack_save is null, the fiber will die, delete the fakestack if (!fake_stack_save && current_fake_stack) current_fake_stack->Destroy(this->tid()); } void AsanThread::FinishSwitchFiber(FakeStack *fake_stack_save, uptr *bottom_old, uptr *size_old) { if (!atomic_load(&stack_switching_, memory_order_relaxed)) { Report("ERROR: finishing a fiber switch that has not started\n"); Die(); } if (fake_stack_save) { SetTLSFakeStack(fake_stack_save); fake_stack_ = fake_stack_save; } if (bottom_old) *bottom_old = stack_bottom_; if (size_old) *size_old = stack_top_ - stack_bottom_; stack_bottom_ = next_stack_bottom_; stack_top_ = next_stack_top_; atomic_store(&stack_switching_, 0, memory_order_release); next_stack_top_ = 0; next_stack_bottom_ = 0; } inline AsanThread::StackBounds AsanThread::GetStackBounds() const { if (!atomic_load(&stack_switching_, memory_order_acquire)) return StackBounds{stack_bottom_, stack_top_}; // NOLINT char local; const uptr cur_stack = (uptr)&local; // Note: need to check next stack first, because FinishSwitchFiber // may be in process of overwriting stack_top_/bottom_. But in such case // we are already on the next stack. if (cur_stack >= next_stack_bottom_ && cur_stack < next_stack_top_) return StackBounds{next_stack_bottom_, next_stack_top_}; // NOLINT return StackBounds{stack_bottom_, stack_top_}; // NOLINT } uptr AsanThread::stack_top() { return GetStackBounds().top; } uptr AsanThread::stack_bottom() { return GetStackBounds().bottom; } uptr AsanThread::stack_size() { const auto bounds = GetStackBounds(); return bounds.top - bounds.bottom; } // We want to create the FakeStack lazyly on the first use, but not eralier // than the stack size is known and the procedure has to be async-signal safe. FakeStack *AsanThread::AsyncSignalSafeLazyInitFakeStack() { uptr stack_size = this->stack_size(); if (stack_size == 0) // stack_size is not yet available, don't use FakeStack. return nullptr; uptr old_val = 0; // fake_stack_ has 3 states: // 0 -- not initialized // 1 -- being initialized // ptr -- initialized // This CAS checks if the state was 0 and if so changes it to state 1, // if that was successful, it initializes the pointer. if (atomic_compare_exchange_strong( reinterpret_cast(&fake_stack_), &old_val, 1UL, memory_order_relaxed)) { uptr stack_size_log = Log2(RoundUpToPowerOfTwo(stack_size)); CHECK_LE(flags()->min_uar_stack_size_log, flags()->max_uar_stack_size_log); stack_size_log = Min(stack_size_log, static_cast(flags()->max_uar_stack_size_log)); stack_size_log = Max(stack_size_log, static_cast(flags()->min_uar_stack_size_log)); fake_stack_ = FakeStack::Create(stack_size_log); SetTLSFakeStack(fake_stack_); return fake_stack_; } return nullptr; } void AsanThread::Init() { next_stack_top_ = next_stack_bottom_ = 0; atomic_store(&stack_switching_, false, memory_order_release); fake_stack_ = nullptr; // Will be initialized lazily if needed. CHECK_EQ(this->stack_size(), 0U); SetThreadStackAndTls(); CHECK_GT(this->stack_size(), 0U); CHECK(AddrIsInMem(stack_bottom_)); CHECK(AddrIsInMem(stack_top_ - 1)); ClearShadowForThreadStackAndTLS(); int local = 0; VReport(1, "T%d: stack [%p,%p) size 0x%zx; local=%p\n", tid(), (void *)stack_bottom_, (void *)stack_top_, stack_top_ - stack_bottom_, &local); } thread_return_t AsanThread::ThreadStart( uptr os_id, atomic_uintptr_t *signal_thread_is_registered) { Init(); asanThreadRegistry().StartThread(tid(), os_id, nullptr); if (signal_thread_is_registered) atomic_store(signal_thread_is_registered, 1, memory_order_release); if (common_flags()->use_sigaltstack) SetAlternateSignalStack(); if (!start_routine_) { // start_routine_ == 0 if we're on the main thread or on one of the // OS X libdispatch worker threads. But nobody is supposed to call // ThreadStart() for the worker threads. CHECK_EQ(tid(), 0); return 0; } thread_return_t res = start_routine_(arg_); // On POSIX systems we defer this to the TSD destructor. LSan will consider // the thread's memory as non-live from the moment we call Destroy(), even // though that memory might contain pointers to heap objects which will be // cleaned up by a user-defined TSD destructor. Thus, calling Destroy() before // the TSD destructors have run might cause false positives in LSan. if (!SANITIZER_POSIX) this->Destroy(); return res; } void AsanThread::SetThreadStackAndTls() { uptr tls_size = 0; uptr stack_size = 0; GetThreadStackAndTls(tid() == 0, const_cast(&stack_bottom_), const_cast(&stack_size), &tls_begin_, &tls_size); stack_top_ = stack_bottom_ + stack_size; tls_end_ = tls_begin_ + tls_size; dtls_ = DTLS_Get(); int local; CHECK(AddrIsInStack((uptr)&local)); } void AsanThread::ClearShadowForThreadStackAndTLS() { PoisonShadow(stack_bottom_, stack_top_ - stack_bottom_, 0); if (tls_begin_ != tls_end_) PoisonShadow(tls_begin_, tls_end_ - tls_begin_, 0); } bool AsanThread::GetStackFrameAccessByAddr(uptr addr, StackFrameAccess *access) { uptr bottom = 0; if (AddrIsInStack(addr)) { bottom = stack_bottom(); } else if (has_fake_stack()) { bottom = fake_stack()->AddrIsInFakeStack(addr); CHECK(bottom); access->offset = addr - bottom; access->frame_pc = ((uptr*)bottom)[2]; access->frame_descr = (const char *)((uptr*)bottom)[1]; return true; } uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1); // align addr. u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr); u8 *shadow_bottom = (u8*)MemToShadow(bottom); while (shadow_ptr >= shadow_bottom && *shadow_ptr != kAsanStackLeftRedzoneMagic) { shadow_ptr--; } while (shadow_ptr >= shadow_bottom && *shadow_ptr == kAsanStackLeftRedzoneMagic) { shadow_ptr--; } if (shadow_ptr < shadow_bottom) { return false; } uptr* ptr = (uptr*)SHADOW_TO_MEM((uptr)(shadow_ptr + 1)); CHECK(ptr[0] == kCurrentStackFrameMagic); access->offset = addr - (uptr)ptr; access->frame_pc = ptr[2]; access->frame_descr = (const char*)ptr[1]; return true; } bool AsanThread::AddrIsInStack(uptr addr) { const auto bounds = GetStackBounds(); return addr >= bounds.bottom && addr < bounds.top; } static bool ThreadStackContainsAddress(ThreadContextBase *tctx_base, void *addr) { AsanThreadContext *tctx = static_cast(tctx_base); AsanThread *t = tctx->thread; if (!t) return false; if (t->AddrIsInStack((uptr)addr)) return true; if (t->has_fake_stack() && t->fake_stack()->AddrIsInFakeStack((uptr)addr)) return true; return false; } AsanThread *GetCurrentThread() { AsanThreadContext *context = reinterpret_cast(AsanTSDGet()); if (!context) { if (SANITIZER_ANDROID) { // On Android, libc constructor is called _after_ asan_init, and cleans up // TSD. Try to figure out if this is still the main thread by the stack // address. We are not entirely sure that we have correct main thread // limits, so only do this magic on Android, and only if the found thread // is the main thread. AsanThreadContext *tctx = GetThreadContextByTidLocked(0); if (tctx && ThreadStackContainsAddress(tctx, &context)) { SetCurrentThread(tctx->thread); return tctx->thread; } } return nullptr; } return context->thread; } void SetCurrentThread(AsanThread *t) { CHECK(t->context()); VReport(2, "SetCurrentThread: %p for thread %p\n", t->context(), (void *)GetThreadSelf()); // Make sure we do not reset the current AsanThread. CHECK_EQ(0, AsanTSDGet()); AsanTSDSet(t->context()); CHECK_EQ(t->context(), AsanTSDGet()); } u32 GetCurrentTidOrInvalid() { AsanThread *t = GetCurrentThread(); return t ? t->tid() : kInvalidTid; } AsanThread *FindThreadByStackAddress(uptr addr) { asanThreadRegistry().CheckLocked(); AsanThreadContext *tctx = static_cast( asanThreadRegistry().FindThreadContextLocked(ThreadStackContainsAddress, (void *)addr)); return tctx ? tctx->thread : nullptr; } void EnsureMainThreadIDIsCorrect() { AsanThreadContext *context = reinterpret_cast(AsanTSDGet()); if (context && (context->tid == 0)) context->os_id = GetTid(); } __asan::AsanThread *GetAsanThreadByOsIDLocked(uptr os_id) { __asan::AsanThreadContext *context = static_cast<__asan::AsanThreadContext *>( __asan::asanThreadRegistry().FindThreadContextByOsIDLocked(os_id)); if (!context) return nullptr; return context->thread; } } // namespace __asan // --- Implementation of LSan-specific functions --- {{{1 namespace __lsan { bool GetThreadRangesLocked(uptr os_id, uptr *stack_begin, uptr *stack_end, uptr *tls_begin, uptr *tls_end, uptr *cache_begin, uptr *cache_end, DTLS **dtls) { __asan::AsanThread *t = __asan::GetAsanThreadByOsIDLocked(os_id); if (!t) return false; *stack_begin = t->stack_bottom(); *stack_end = t->stack_top(); *tls_begin = t->tls_begin(); *tls_end = t->tls_end(); // ASan doesn't keep allocator caches in TLS, so these are unused. *cache_begin = 0; *cache_end = 0; *dtls = t->dtls(); return true; } void ForEachExtraStackRange(uptr os_id, RangeIteratorCallback callback, void *arg) { __asan::AsanThread *t = __asan::GetAsanThreadByOsIDLocked(os_id); if (t && t->has_fake_stack()) t->fake_stack()->ForEachFakeFrame(callback, arg); } void LockThreadRegistry() { __asan::asanThreadRegistry().Lock(); } void UnlockThreadRegistry() { __asan::asanThreadRegistry().Unlock(); } void EnsureMainThreadIDIsCorrect() { __asan::EnsureMainThreadIDIsCorrect(); } } // namespace __lsan // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_start_switch_fiber(void **fakestacksave, const void *bottom, uptr size) { AsanThread *t = GetCurrentThread(); if (!t) { VReport(1, "__asan_start_switch_fiber called from unknown thread\n"); return; } t->StartSwitchFiber((FakeStack**)fakestacksave, (uptr)bottom, size); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_finish_switch_fiber(void* fakestack, const void **bottom_old, uptr *size_old) { AsanThread *t = GetCurrentThread(); if (!t) { VReport(1, "__asan_finish_switch_fiber called from unknown thread\n"); return; } t->FinishSwitchFiber((FakeStack*)fakestack, (uptr*)bottom_old, (uptr*)size_old); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_new_delete.cc0000664000175000017500000001477712770324656026351 0ustar mwhudsonmwhudson//===-- asan_interceptors.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Interceptors for operators new and delete. //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_internal.h" #include "asan_stack.h" #include "interception/interception.h" #include // C++ operators can't have dllexport attributes on Windows. We export them // anyway by passing extra -export flags to the linker, which is exactly that // dllexport would normally do. We need to export them in order to make the // VS2015 dynamic CRT (MD) work. #if SANITIZER_WINDOWS # define CXX_OPERATOR_ATTRIBUTE # ifdef _WIN64 # pragma comment(linker, "/export:??2@YAPEAX_K@Z") // operator new # pragma comment(linker, "/export:??3@YAXPEAX@Z") // operator delete # pragma comment(linker, "/export:??3@YAXPEAX_K@Z") // sized operator delete # pragma comment(linker, "/export:??_U@YAPEAX_K@Z") // operator new[] # pragma comment(linker, "/export:??_V@YAXPEAX@Z") // operator delete[] # else # pragma comment(linker, "/export:??2@YAPAXI@Z") // operator new # pragma comment(linker, "/export:??3@YAXPAX@Z") // operator delete # pragma comment(linker, "/export:??3@YAXPAXI@Z") // sized operator delete # pragma comment(linker, "/export:??_U@YAPAXI@Z") // operator new[] # pragma comment(linker, "/export:??_V@YAXPAX@Z") // operator delete[] # endif #else # define CXX_OPERATOR_ATTRIBUTE INTERCEPTOR_ATTRIBUTE #endif using namespace __asan; // NOLINT // FreeBSD prior v9.2 have wrong definition of 'size_t'. // http://svnweb.freebsd.org/base?view=revision&revision=232261 #if SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 32 #include #if __FreeBSD_version <= 902001 // v9.2 #define size_t unsigned #endif // __FreeBSD_version #endif // SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 32 // This code has issues on OSX. // See https://github.com/google/sanitizers/issues/131. // Fake std::nothrow_t and std::align_val_t to avoid including . namespace std { struct nothrow_t {}; enum class align_val_t: size_t {}; } // namespace std #define OPERATOR_NEW_BODY(type) \ GET_STACK_TRACE_MALLOC;\ return asan_memalign(0, size, &stack, type); #define OPERATOR_NEW_BODY_ALIGN(type) \ GET_STACK_TRACE_MALLOC;\ return asan_memalign((uptr)align, size, &stack, type); // On OS X it's not enough to just provide our own 'operator new' and // 'operator delete' implementations, because they're going to be in the // runtime dylib, and the main executable will depend on both the runtime // dylib and libstdc++, each of those'll have its implementation of new and // delete. // To make sure that C++ allocation/deallocation operators are overridden on // OS X we need to intercept them using their mangled names. #if !SANITIZER_MAC CXX_OPERATOR_ATTRIBUTE void *operator new(size_t size) { OPERATOR_NEW_BODY(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void *operator new[](size_t size) { OPERATOR_NEW_BODY(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void *operator new(size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void *operator new[](size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void *operator new(size_t size, std::align_val_t align) { OPERATOR_NEW_BODY_ALIGN(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void *operator new[](size_t size, std::align_val_t align) { OPERATOR_NEW_BODY_ALIGN(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void *operator new(size_t size, std::align_val_t align, std::nothrow_t const&) { OPERATOR_NEW_BODY_ALIGN(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void *operator new[](size_t size, std::align_val_t align, std::nothrow_t const&) { OPERATOR_NEW_BODY_ALIGN(FROM_NEW_BR); } #else // SANITIZER_MAC INTERCEPTOR(void *, _Znwm, size_t size) { OPERATOR_NEW_BODY(FROM_NEW); } INTERCEPTOR(void *, _Znam, size_t size) { OPERATOR_NEW_BODY(FROM_NEW_BR); } INTERCEPTOR(void *, _ZnwmRKSt9nothrow_t, size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY(FROM_NEW); } INTERCEPTOR(void *, _ZnamRKSt9nothrow_t, size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY(FROM_NEW_BR); } #endif #define OPERATOR_DELETE_BODY(type) \ GET_STACK_TRACE_FREE;\ asan_free(ptr, &stack, type); #if !SANITIZER_MAC CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, size_t size) NOEXCEPT { GET_STACK_TRACE_FREE; asan_sized_free(ptr, size, &stack, FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, size_t size) NOEXCEPT { GET_STACK_TRACE_FREE; asan_sized_free(ptr, size, &stack, FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, std::align_val_t) NOEXCEPT { OPERATOR_DELETE_BODY(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, std::align_val_t) NOEXCEPT { OPERATOR_DELETE_BODY(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, std::align_val_t, std::nothrow_t const&) { OPERATOR_DELETE_BODY(FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, std::align_val_t, std::nothrow_t const&) { OPERATOR_DELETE_BODY(FROM_NEW_BR); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, size_t size, std::align_val_t) NOEXCEPT { GET_STACK_TRACE_FREE; asan_sized_free(ptr, size, &stack, FROM_NEW); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, size_t size, std::align_val_t) NOEXCEPT { GET_STACK_TRACE_FREE; asan_sized_free(ptr, size, &stack, FROM_NEW_BR); } #else // SANITIZER_MAC INTERCEPTOR(void, _ZdlPv, void *ptr) { OPERATOR_DELETE_BODY(FROM_NEW); } INTERCEPTOR(void, _ZdaPv, void *ptr) { OPERATOR_DELETE_BODY(FROM_NEW_BR); } INTERCEPTOR(void, _ZdlPvRKSt9nothrow_t, void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY(FROM_NEW); } INTERCEPTOR(void, _ZdaPvRKSt9nothrow_t, void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY(FROM_NEW_BR); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_malloc_mac.cc0000664000175000017500000000441412630336263026300 0ustar mwhudsonmwhudson//===-- asan_malloc_mac.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Mac-specific malloc interception. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "asan_interceptors.h" #include "asan_report.h" #include "asan_stack.h" #include "asan_stats.h" using namespace __asan; #define COMMON_MALLOC_ZONE_NAME "asan" #define COMMON_MALLOC_ENTER() ENSURE_ASAN_INITED() #define COMMON_MALLOC_SANITIZER_INITIALIZED asan_inited #define COMMON_MALLOC_FORCE_LOCK() asan_mz_force_lock() #define COMMON_MALLOC_FORCE_UNLOCK() asan_mz_force_unlock() #define COMMON_MALLOC_MEMALIGN(alignment, size) \ GET_STACK_TRACE_MALLOC; \ void *p = asan_memalign(alignment, size, &stack, FROM_MALLOC) #define COMMON_MALLOC_MALLOC(size) \ GET_STACK_TRACE_MALLOC; \ void *p = asan_malloc(size, &stack) #define COMMON_MALLOC_REALLOC(ptr, size) \ GET_STACK_TRACE_MALLOC; \ void *p = asan_realloc(ptr, size, &stack); #define COMMON_MALLOC_CALLOC(count, size) \ GET_STACK_TRACE_MALLOC; \ void *p = asan_calloc(count, size, &stack); #define COMMON_MALLOC_VALLOC(size) \ GET_STACK_TRACE_MALLOC; \ void *p = asan_memalign(GetPageSizeCached(), size, &stack, FROM_MALLOC); #define COMMON_MALLOC_FREE(ptr) \ GET_STACK_TRACE_FREE; \ asan_free(ptr, &stack, FROM_MALLOC); #define COMMON_MALLOC_SIZE(ptr) \ uptr size = asan_mz_size(ptr); #define COMMON_MALLOC_FILL_STATS(zone, stats) \ AsanMallocStats malloc_stats; \ FillMallocStatistics(&malloc_stats); \ CHECK(sizeof(malloc_statistics_t) == sizeof(AsanMallocStats)); \ internal_memcpy(stats, &malloc_stats, sizeof(malloc_statistics_t)); #define COMMON_MALLOC_REPORT_UNKNOWN_REALLOC(ptr, zone_ptr, zone_name) \ GET_STACK_TRACE_FREE; \ ReportMacMzReallocUnknown((uptr)ptr, (uptr)zone_ptr, zone_name, &stack); #define COMMON_MALLOC_NAMESPACE __asan #include "sanitizer_common/sanitizer_malloc_mac.inc" #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_memory_profile.cc0000664000175000017500000000605712757111137027247 0ustar mwhudsonmwhudson//===-- asan_memory_profile.cc.cc -----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This file implements __sanitizer_print_memory_profile. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_stoptheworld.h" #include "lsan/lsan_common.h" #include "asan/asan_allocator.h" #if CAN_SANITIZE_LEAKS namespace __asan { struct AllocationSite { u32 id; uptr total_size; uptr count; }; class HeapProfile { public: HeapProfile() : allocations_(1024) {} void Insert(u32 id, uptr size) { total_allocated_ += size; total_count_++; // Linear lookup will be good enough for most cases (although not all). for (uptr i = 0; i < allocations_.size(); i++) { if (allocations_[i].id == id) { allocations_[i].total_size += size; allocations_[i].count++; return; } } allocations_.push_back({id, size, 1}); } void Print(uptr top_percent) { InternalSort(&allocations_, allocations_.size(), [](const AllocationSite &a, const AllocationSite &b) { return a.total_size > b.total_size; }); CHECK(total_allocated_); uptr total_shown = 0; Printf("Live Heap Allocations: %zd bytes from %zd allocations; " "showing top %zd%%\n", total_allocated_, total_count_, top_percent); for (uptr i = 0; i < allocations_.size(); i++) { auto &a = allocations_[i]; Printf("%zd byte(s) (%zd%%) in %zd allocation(s)\n", a.total_size, a.total_size * 100 / total_allocated_, a.count); StackDepotGet(a.id).Print(); total_shown += a.total_size; if (total_shown * 100 / total_allocated_ > top_percent) break; } } private: uptr total_allocated_ = 0; uptr total_count_ = 0; InternalMmapVector allocations_; }; static void ChunkCallback(uptr chunk, void *arg) { HeapProfile *hp = reinterpret_cast(arg); AsanChunkView cv = FindHeapChunkByAllocBeg(chunk); if (!cv.IsAllocated()) return; u32 id = cv.GetAllocStackId(); if (!id) return; hp->Insert(id, cv.UsedSize()); } static void MemoryProfileCB(const SuspendedThreadsList &suspended_threads_list, void *argument) { HeapProfile hp; __lsan::ForEachChunk(ChunkCallback, &hp); hp.Print(reinterpret_cast(argument)); } } // namespace __asan extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_print_memory_profile(uptr top_percent) { __sanitizer::StopTheWorld(__asan::MemoryProfileCB, (void*)top_percent); } } // extern "C" #endif // CAN_SANITIZE_LEAKS golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan.syms.extra0000664000175000017500000000003412231766366025663 0ustar mwhudsonmwhudson__asan_* __lsan_* __ubsan_* golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_activation_flags.inc0000664000175000017500000000242112457453120027705 0ustar mwhudsonmwhudson//===-- asan_activation_flags.inc -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // A subset of ASan (and common) runtime flags supported at activation time. // //===----------------------------------------------------------------------===// #ifndef ASAN_ACTIVATION_FLAG # error "Define ASAN_ACTIVATION_FLAG prior to including this file!" #endif #ifndef COMMON_ACTIVATION_FLAG # error "Define COMMON_ACTIVATION_FLAG prior to including this file!" #endif // ASAN_ACTIVATION_FLAG(Type, Name) // See COMMON_FLAG in sanitizer_flags.inc for more details. ASAN_ACTIVATION_FLAG(int, redzone) ASAN_ACTIVATION_FLAG(int, max_redzone) ASAN_ACTIVATION_FLAG(int, quarantine_size_mb) ASAN_ACTIVATION_FLAG(bool, alloc_dealloc_mismatch) ASAN_ACTIVATION_FLAG(bool, poison_heap) COMMON_ACTIVATION_FLAG(bool, allocator_may_return_null) COMMON_ACTIVATION_FLAG(int, malloc_context_size) COMMON_ACTIVATION_FLAG(bool, coverage) COMMON_ACTIVATION_FLAG(const char *, coverage_dir) COMMON_ACTIVATION_FLAG(int, verbosity) COMMON_ACTIVATION_FLAG(bool, help) golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/CMakeLists.txt0000664000175000017500000001670612767022363025453 0ustar mwhudsonmwhudson# Build for the AddressSanitizer runtime support library. set(ASAN_SOURCES asan_allocator.cc asan_activation.cc asan_debugging.cc asan_descriptions.cc asan_errors.cc asan_fake_stack.cc asan_flags.cc asan_globals.cc asan_interceptors.cc asan_linux.cc asan_mac.cc asan_malloc_linux.cc asan_malloc_mac.cc asan_malloc_win.cc asan_memory_profile.cc asan_poisoning.cc asan_posix.cc asan_report.cc asan_rtl.cc asan_stack.cc asan_stats.cc asan_suppressions.cc asan_thread.cc asan_win.cc) set(ASAN_CXX_SOURCES asan_new_delete.cc) set(ASAN_PREINIT_SOURCES asan_preinit.cc) include_directories(..) set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF ASAN_CFLAGS) set(ASAN_DYNAMIC_LINK_FLAGS) if(ANDROID) list(APPEND ASAN_COMMON_DEFINITIONS ASAN_LOW_MEMORY=1) # On Android, -z global does not do what it is documented to do. # On Android, -z global moves the library ahead in the lookup order, # placing it right after the LD_PRELOADs. This is used to compensate for the fact # that Android linker does not look at the dependencies of the main executable # that aren't dependencies of the current DSO when resolving symbols from said DSO. # As a net result, this allows running ASan executables without LD_PRELOAD-ing the # ASan runtime library. # The above is applicable to L MR1 or newer. if (COMPILER_RT_HAS_Z_GLOBAL) list(APPEND ASAN_DYNAMIC_LINK_FLAGS -Wl,-z,global) endif() endif() set(ASAN_DYNAMIC_DEFINITIONS ${ASAN_COMMON_DEFINITIONS} ASAN_DYNAMIC=1) append_list_if(WIN32 INTERCEPTION_DYNAMIC_CRT ASAN_DYNAMIC_DEFINITIONS) set(ASAN_DYNAMIC_CFLAGS ${ASAN_CFLAGS}) append_list_if(COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC -ftls-model=initial-exec ASAN_DYNAMIC_CFLAGS) append_list_if(MSVC /DEBUG ASAN_DYNAMIC_LINK_FLAGS) append_list_if(COMPILER_RT_HAS_LIBC c ASAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBDL dl ASAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBRT rt ASAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBM m ASAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread ASAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBSTDCXX stdc++ ASAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBLOG log ASAN_DYNAMIC_LIBS) # Compile ASan sources into an object library. add_compiler_rt_object_libraries(RTAsan_dynamic OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${ASAN_SUPPORTED_ARCH} SOURCES ${ASAN_SOURCES} ${ASAN_CXX_SOURCES} CFLAGS ${ASAN_DYNAMIC_CFLAGS} DEFS ${ASAN_DYNAMIC_DEFINITIONS}) if(NOT APPLE) add_compiler_rt_object_libraries(RTAsan ARCHS ${ASAN_SUPPORTED_ARCH} SOURCES ${ASAN_SOURCES} CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS}) add_compiler_rt_object_libraries(RTAsan_cxx ARCHS ${ASAN_SUPPORTED_ARCH} SOURCES ${ASAN_CXX_SOURCES} CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS}) add_compiler_rt_object_libraries(RTAsan_preinit ARCHS ${ASAN_SUPPORTED_ARCH} SOURCES ${ASAN_PREINIT_SOURCES} CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS}) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc "") add_compiler_rt_object_libraries(RTAsan_dynamic_version_script_dummy ARCHS ${ASAN_SUPPORTED_ARCH} SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc CFLAGS ${ASAN_DYNAMIC_CFLAGS} DEFS ${ASAN_DYNAMIC_DEFINITIONS}) endif() # Build ASan runtimes shipped with Clang. add_compiler_rt_component(asan) if(APPLE) add_compiler_rt_runtime(clang_rt.asan SHARED OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${ASAN_SUPPORTED_ARCH} OBJECT_LIBS RTAsan_dynamic RTInterception RTSanitizerCommon RTSanitizerCommonLibc RTLSanCommon RTUbsan CFLAGS ${ASAN_DYNAMIC_CFLAGS} DEFS ${ASAN_DYNAMIC_DEFINITIONS} PARENT_TARGET asan) else() # Build separate libraries for each target. set(ASAN_COMMON_RUNTIME_OBJECT_LIBS RTInterception RTSanitizerCommon RTSanitizerCommonLibc RTLSanCommon RTUbsan) add_compiler_rt_runtime(clang_rt.asan STATIC ARCHS ${ASAN_SUPPORTED_ARCH} OBJECT_LIBS RTAsan_preinit RTAsan ${ASAN_COMMON_RUNTIME_OBJECT_LIBS} CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} PARENT_TARGET asan) add_compiler_rt_runtime(clang_rt.asan_cxx STATIC ARCHS ${ASAN_SUPPORTED_ARCH} OBJECT_LIBS RTAsan_cxx RTUbsan_cxx CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} PARENT_TARGET asan) add_compiler_rt_runtime(clang_rt.asan-preinit STATIC ARCHS ${ASAN_SUPPORTED_ARCH} OBJECT_LIBS RTAsan_preinit CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} PARENT_TARGET asan) foreach(arch ${ASAN_SUPPORTED_ARCH}) if (UNIX AND NOT ${arch} MATCHES "i386|i686") add_sanitizer_rt_version_list(clang_rt.asan-dynamic-${arch} LIBS clang_rt.asan-${arch} clang_rt.asan_cxx-${arch} EXTRA asan.syms.extra) set(VERSION_SCRIPT_FLAG -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) else() set(VERSION_SCRIPT_FLAG) endif() add_compiler_rt_runtime(clang_rt.asan SHARED ARCHS ${arch} OBJECT_LIBS ${ASAN_COMMON_RUNTIME_OBJECT_LIBS} RTAsan_dynamic # The only purpose of RTAsan_dynamic_version_script_dummy is to carry # a dependency of the shared runtime on the version script. With CMake # 3.1 or later it can be replaced with a straightforward # add_dependencies(clang_rt.asan-dynamic-${arch} clang_rt.asan-dynamic-${arch}-version-list) RTAsan_dynamic_version_script_dummy RTUbsan_cxx CFLAGS ${ASAN_DYNAMIC_CFLAGS} LINKFLAGS ${ASAN_DYNAMIC_LINK_FLAGS} ${VERSION_SCRIPT_FLAG} LINK_LIBS ${ASAN_DYNAMIC_LIBS} DEFS ${ASAN_DYNAMIC_DEFINITIONS} PARENT_TARGET asan) if (UNIX AND NOT ${arch} MATCHES "i386|i686") add_sanitizer_rt_symbols(clang_rt.asan_cxx ARCHS ${arch}) add_dependencies(asan clang_rt.asan_cxx-${arch}-symbols) add_sanitizer_rt_symbols(clang_rt.asan ARCHS ${arch} EXTRA asan.syms.extra) add_dependencies(asan clang_rt.asan-${arch}-symbols) endif() if (WIN32) add_compiler_rt_runtime(clang_rt.asan_dll_thunk STATIC ARCHS ${arch} SOURCES asan_win_dll_thunk.cc $ CFLAGS ${ASAN_CFLAGS} -DASAN_DLL_THUNK DEFS ${ASAN_COMMON_DEFINITIONS} PARENT_TARGET asan) set(DYNAMIC_RUNTIME_THUNK_CFLAGS "-DASAN_DYNAMIC_RUNTIME_THUNK") if(MSVC) list(APPEND DYNAMIC_RUNTIME_THUNK_CFLAGS "-Zl") elseif(CMAKE_C_COMPILER_ID MATCHES Clang) list(APPEND DYNAMIC_RUNTIME_THUNK_CFLAGS "-nodefaultlibs") endif() add_compiler_rt_runtime(clang_rt.asan_dynamic_runtime_thunk STATIC ARCHS ${arch} SOURCES asan_win_dynamic_runtime_thunk.cc CFLAGS ${ASAN_CFLAGS} ${DYNAMIC_RUNTIME_THUNK_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} PARENT_TARGET asan) endif() endforeach() endif() add_compiler_rt_resource_file(asan_blacklist asan_blacklist.txt asan) add_subdirectory(scripts) if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_errors.cc0000664000175000017500000004342212770565412025534 0ustar mwhudsonmwhudson//===-- asan_errors.cc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan implementation for error structures. //===----------------------------------------------------------------------===// #include "asan_errors.h" #include #include "asan_descriptions.h" #include "asan_mapping.h" #include "asan_report.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_stackdepot.h" namespace __asan { void ErrorStackOverflow::Print() { Decorator d; Printf("%s", d.Warning()); Report( "ERROR: AddressSanitizer: stack-overflow on address %p" " (pc %p bp %p sp %p T%d)\n", (void *)addr, (void *)pc, (void *)bp, (void *)sp, tid); Printf("%s", d.EndWarning()); scariness.Print(); BufferedStackTrace stack; GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, context, common_flags()->fast_unwind_on_fatal); stack.Print(); ReportErrorSummary("stack-overflow", &stack); } static void MaybeDumpInstructionBytes(uptr pc) { if (!flags()->dump_instruction_bytes || (pc < GetPageSizeCached())) return; InternalScopedString str(1024); str.append("First 16 instruction bytes at pc: "); if (IsAccessibleMemoryRange(pc, 16)) { for (int i = 0; i < 16; ++i) { PrintMemoryByte(&str, "", ((u8 *)pc)[i], /*in_shadow*/ false, " "); } str.append("\n"); } else { str.append("unaccessible\n"); } Report("%s", str.data()); } void ErrorDeadlySignal::Print() { Decorator d; Printf("%s", d.Warning()); const char *description = DescribeSignalOrException(signo); Report( "ERROR: AddressSanitizer: %s on unknown address %p (pc %p bp %p sp %p " "T%d)\n", description, (void *)addr, (void *)pc, (void *)bp, (void *)sp, tid); Printf("%s", d.EndWarning()); if (pc < GetPageSizeCached()) Report("Hint: pc points to the zero page.\n"); if (is_memory_access) { const char *access_type = write_flag == SignalContext::WRITE ? "WRITE" : (write_flag == SignalContext::READ ? "READ" : "UNKNOWN"); Report("The signal is caused by a %s memory access.\n", access_type); if (addr < GetPageSizeCached()) Report("Hint: address points to the zero page.\n"); } scariness.Print(); BufferedStackTrace stack; GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, context, common_flags()->fast_unwind_on_fatal); stack.Print(); MaybeDumpInstructionBytes(pc); Printf("AddressSanitizer can not provide additional info.\n"); ReportErrorSummary(description, &stack); } void ErrorDoubleFree::Print() { Decorator d; Printf("%s", d.Warning()); char tname[128]; Report( "ERROR: AddressSanitizer: attempting double-free on %p in " "thread T%d%s:\n", addr_description.addr, tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); Printf("%s", d.EndWarning()); scariness.Print(); GET_STACK_TRACE_FATAL(second_free_stack->trace[0], second_free_stack->top_frame_bp); stack.Print(); addr_description.Print(); ReportErrorSummary("double-free", &stack); } void ErrorNewDeleteSizeMismatch::Print() { Decorator d; Printf("%s", d.Warning()); char tname[128]; Report( "ERROR: AddressSanitizer: new-delete-type-mismatch on %p in thread " "T%d%s:\n", addr_description.addr, tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); Printf("%s object passed to delete has wrong type:\n", d.EndWarning()); Printf( " size of the allocated type: %zd bytes;\n" " size of the deallocated type: %zd bytes.\n", addr_description.chunk_access.chunk_size, delete_size); CHECK_GT(free_stack->size, 0); scariness.Print(); GET_STACK_TRACE_FATAL(free_stack->trace[0], free_stack->top_frame_bp); stack.Print(); addr_description.Print(); ReportErrorSummary("new-delete-type-mismatch", &stack); Report( "HINT: if you don't care about these errors you may set " "ASAN_OPTIONS=new_delete_type_mismatch=0\n"); } void ErrorFreeNotMalloced::Print() { Decorator d; Printf("%s", d.Warning()); char tname[128]; Report( "ERROR: AddressSanitizer: attempting free on address " "which was not malloc()-ed: %p in thread T%d%s\n", addr_description.Address(), tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); Printf("%s", d.EndWarning()); CHECK_GT(free_stack->size, 0); scariness.Print(); GET_STACK_TRACE_FATAL(free_stack->trace[0], free_stack->top_frame_bp); stack.Print(); addr_description.Print(); ReportErrorSummary("bad-free", &stack); } void ErrorAllocTypeMismatch::Print() { static const char *alloc_names[] = {"INVALID", "malloc", "operator new", "operator new []"}; static const char *dealloc_names[] = {"INVALID", "free", "operator delete", "operator delete []"}; CHECK_NE(alloc_type, dealloc_type); Decorator d; Printf("%s", d.Warning()); Report("ERROR: AddressSanitizer: alloc-dealloc-mismatch (%s vs %s) on %p\n", alloc_names[alloc_type], dealloc_names[dealloc_type], addr_description.addr); Printf("%s", d.EndWarning()); CHECK_GT(dealloc_stack->size, 0); scariness.Print(); GET_STACK_TRACE_FATAL(dealloc_stack->trace[0], dealloc_stack->top_frame_bp); stack.Print(); addr_description.Print(); ReportErrorSummary("alloc-dealloc-mismatch", &stack); Report( "HINT: if you don't care about these errors you may set " "ASAN_OPTIONS=alloc_dealloc_mismatch=0\n"); } void ErrorMallocUsableSizeNotOwned::Print() { Decorator d; Printf("%s", d.Warning()); Report( "ERROR: AddressSanitizer: attempting to call malloc_usable_size() for " "pointer which is not owned: %p\n", addr_description.Address()); Printf("%s", d.EndWarning()); stack->Print(); addr_description.Print(); ReportErrorSummary("bad-malloc_usable_size", stack); } void ErrorSanitizerGetAllocatedSizeNotOwned::Print() { Decorator d; Printf("%s", d.Warning()); Report( "ERROR: AddressSanitizer: attempting to call " "__sanitizer_get_allocated_size() for pointer which is not owned: %p\n", addr_description.Address()); Printf("%s", d.EndWarning()); stack->Print(); addr_description.Print(); ReportErrorSummary("bad-__sanitizer_get_allocated_size", stack); } void ErrorStringFunctionMemoryRangesOverlap::Print() { Decorator d; char bug_type[100]; internal_snprintf(bug_type, sizeof(bug_type), "%s-param-overlap", function); Printf("%s", d.Warning()); Report( "ERROR: AddressSanitizer: %s: memory ranges [%p,%p) and [%p, %p) " "overlap\n", bug_type, addr1_description.Address(), addr1_description.Address() + length1, addr2_description.Address(), addr2_description.Address() + length2); Printf("%s", d.EndWarning()); scariness.Print(); stack->Print(); addr1_description.Print(); addr2_description.Print(); ReportErrorSummary(bug_type, stack); } void ErrorStringFunctionSizeOverflow::Print() { Decorator d; Printf("%s", d.Warning()); const char *bug_type = "negative-size-param"; Report("ERROR: AddressSanitizer: %s: (size=%zd)\n", bug_type, size); Printf("%s", d.EndWarning()); scariness.Print(); stack->Print(); addr_description.Print(); ReportErrorSummary(bug_type, stack); } void ErrorBadParamsToAnnotateContiguousContainer::Print() { Report( "ERROR: AddressSanitizer: bad parameters to " "__sanitizer_annotate_contiguous_container:\n" " beg : %p\n" " end : %p\n" " old_mid : %p\n" " new_mid : %p\n", beg, end, old_mid, new_mid); uptr granularity = SHADOW_GRANULARITY; if (!IsAligned(beg, granularity)) Report("ERROR: beg is not aligned by %d\n", granularity); stack->Print(); ReportErrorSummary("bad-__sanitizer_annotate_contiguous_container", stack); } void ErrorODRViolation::Print() { Decorator d; Printf("%s", d.Warning()); Report("ERROR: AddressSanitizer: odr-violation (%p):\n", global1.beg); Printf("%s", d.EndWarning()); InternalScopedString g1_loc(256), g2_loc(256); PrintGlobalLocation(&g1_loc, global1); PrintGlobalLocation(&g2_loc, global2); Printf(" [1] size=%zd '%s' %s\n", global1.size, MaybeDemangleGlobalName(global1.name), g1_loc.data()); Printf(" [2] size=%zd '%s' %s\n", global2.size, MaybeDemangleGlobalName(global2.name), g2_loc.data()); if (stack_id1 && stack_id2) { Printf("These globals were registered at these points:\n"); Printf(" [1]:\n"); StackDepotGet(stack_id1).Print(); Printf(" [2]:\n"); StackDepotGet(stack_id2).Print(); } Report( "HINT: if you don't care about these errors you may set " "ASAN_OPTIONS=detect_odr_violation=0\n"); InternalScopedString error_msg(256); error_msg.append("odr-violation: global '%s' at %s", MaybeDemangleGlobalName(global1.name), g1_loc.data()); ReportErrorSummary(error_msg.data()); } void ErrorInvalidPointerPair::Print() { const char *bug_type = "invalid-pointer-pair"; Decorator d; Printf("%s", d.Warning()); Report("ERROR: AddressSanitizer: invalid-pointer-pair: %p %p\n", addr1_description.Address(), addr2_description.Address()); Printf("%s", d.EndWarning()); GET_STACK_TRACE_FATAL(pc, bp); stack.Print(); addr1_description.Print(); addr2_description.Print(); ReportErrorSummary(bug_type, &stack); } static bool AdjacentShadowValuesAreFullyPoisoned(u8 *s) { return s[-1] > 127 && s[1] > 127; } ErrorGeneric::ErrorGeneric(u32 tid, uptr pc_, uptr bp_, uptr sp_, uptr addr, bool is_write_, uptr access_size_) : ErrorBase(tid), addr_description(addr, access_size_, /*shouldLockThreadRegistry=*/false), pc(pc_), bp(bp_), sp(sp_), access_size(access_size_), is_write(is_write_), shadow_val(0) { scariness.Clear(); if (access_size) { if (access_size <= 9) { char desr[] = "?-byte"; desr[0] = '0' + access_size; scariness.Scare(access_size + access_size / 2, desr); } else if (access_size >= 10) { scariness.Scare(15, "multi-byte"); } is_write ? scariness.Scare(20, "write") : scariness.Scare(1, "read"); // Determine the error type. bug_descr = "unknown-crash"; if (AddrIsInMem(addr)) { u8 *shadow_addr = (u8 *)MemToShadow(addr); // If we are accessing 16 bytes, look at the second shadow byte. if (*shadow_addr == 0 && access_size > SHADOW_GRANULARITY) shadow_addr++; // If we are in the partial right redzone, look at the next shadow byte. if (*shadow_addr > 0 && *shadow_addr < 128) shadow_addr++; bool far_from_bounds = false; shadow_val = *shadow_addr; int bug_type_score = 0; // For use-after-frees reads are almost as bad as writes. int read_after_free_bonus = 0; switch (shadow_val) { case kAsanHeapLeftRedzoneMagic: case kAsanArrayCookieMagic: bug_descr = "heap-buffer-overflow"; bug_type_score = 10; far_from_bounds = AdjacentShadowValuesAreFullyPoisoned(shadow_addr); break; case kAsanHeapFreeMagic: bug_descr = "heap-use-after-free"; bug_type_score = 20; if (!is_write) read_after_free_bonus = 18; break; case kAsanStackLeftRedzoneMagic: bug_descr = "stack-buffer-underflow"; bug_type_score = 25; far_from_bounds = AdjacentShadowValuesAreFullyPoisoned(shadow_addr); break; case kAsanInitializationOrderMagic: bug_descr = "initialization-order-fiasco"; bug_type_score = 1; break; case kAsanStackMidRedzoneMagic: case kAsanStackRightRedzoneMagic: bug_descr = "stack-buffer-overflow"; bug_type_score = 25; far_from_bounds = AdjacentShadowValuesAreFullyPoisoned(shadow_addr); break; case kAsanStackAfterReturnMagic: bug_descr = "stack-use-after-return"; bug_type_score = 30; if (!is_write) read_after_free_bonus = 18; break; case kAsanUserPoisonedMemoryMagic: bug_descr = "use-after-poison"; bug_type_score = 20; break; case kAsanContiguousContainerOOBMagic: bug_descr = "container-overflow"; bug_type_score = 10; break; case kAsanStackUseAfterScopeMagic: bug_descr = "stack-use-after-scope"; bug_type_score = 10; break; case kAsanGlobalRedzoneMagic: bug_descr = "global-buffer-overflow"; bug_type_score = 10; far_from_bounds = AdjacentShadowValuesAreFullyPoisoned(shadow_addr); break; case kAsanIntraObjectRedzone: bug_descr = "intra-object-overflow"; bug_type_score = 10; break; case kAsanAllocaLeftMagic: case kAsanAllocaRightMagic: bug_descr = "dynamic-stack-buffer-overflow"; bug_type_score = 25; far_from_bounds = AdjacentShadowValuesAreFullyPoisoned(shadow_addr); break; } scariness.Scare(bug_type_score + read_after_free_bonus, bug_descr); if (far_from_bounds) scariness.Scare(10, "far-from-bounds"); } } } static void PrintContainerOverflowHint() { Printf("HINT: if you don't care about these errors you may set " "ASAN_OPTIONS=detect_container_overflow=0.\n" "If you suspect a false positive see also: " "https://github.com/google/sanitizers/wiki/" "AddressSanitizerContainerOverflow.\n"); } static void PrintShadowByte(InternalScopedString *str, const char *before, u8 byte, const char *after = "\n") { PrintMemoryByte(str, before, byte, /*in_shadow*/true, after); } static void PrintLegend(InternalScopedString *str) { str->append( "Shadow byte legend (one shadow byte represents %d " "application bytes):\n", (int)SHADOW_GRANULARITY); PrintShadowByte(str, " Addressable: ", 0); str->append(" Partially addressable: "); for (u8 i = 1; i < SHADOW_GRANULARITY; i++) PrintShadowByte(str, "", i, " "); str->append("\n"); PrintShadowByte(str, " Heap left redzone: ", kAsanHeapLeftRedzoneMagic); PrintShadowByte(str, " Freed heap region: ", kAsanHeapFreeMagic); PrintShadowByte(str, " Stack left redzone: ", kAsanStackLeftRedzoneMagic); PrintShadowByte(str, " Stack mid redzone: ", kAsanStackMidRedzoneMagic); PrintShadowByte(str, " Stack right redzone: ", kAsanStackRightRedzoneMagic); PrintShadowByte(str, " Stack after return: ", kAsanStackAfterReturnMagic); PrintShadowByte(str, " Stack use after scope: ", kAsanStackUseAfterScopeMagic); PrintShadowByte(str, " Global redzone: ", kAsanGlobalRedzoneMagic); PrintShadowByte(str, " Global init order: ", kAsanInitializationOrderMagic); PrintShadowByte(str, " Poisoned by user: ", kAsanUserPoisonedMemoryMagic); PrintShadowByte(str, " Container overflow: ", kAsanContiguousContainerOOBMagic); PrintShadowByte(str, " Array cookie: ", kAsanArrayCookieMagic); PrintShadowByte(str, " Intra object redzone: ", kAsanIntraObjectRedzone); PrintShadowByte(str, " ASan internal: ", kAsanInternalHeapMagic); PrintShadowByte(str, " Left alloca redzone: ", kAsanAllocaLeftMagic); PrintShadowByte(str, " Right alloca redzone: ", kAsanAllocaRightMagic); } static void PrintShadowBytes(InternalScopedString *str, const char *before, u8 *bytes, u8 *guilty, uptr n) { Decorator d; if (before) str->append("%s%p:", before, bytes); for (uptr i = 0; i < n; i++) { u8 *p = bytes + i; const char *before = p == guilty ? "[" : (p - 1 == guilty && i != 0) ? "" : " "; const char *after = p == guilty ? "]" : ""; PrintShadowByte(str, before, *p, after); } str->append("\n"); } static void PrintShadowMemoryForAddress(uptr addr) { if (!AddrIsInMem(addr)) return; uptr shadow_addr = MemToShadow(addr); const uptr n_bytes_per_row = 16; uptr aligned_shadow = shadow_addr & ~(n_bytes_per_row - 1); InternalScopedString str(4096 * 8); str.append("Shadow bytes around the buggy address:\n"); for (int i = -5; i <= 5; i++) { const char *prefix = (i == 0) ? "=>" : " "; PrintShadowBytes(&str, prefix, (u8 *)(aligned_shadow + i * n_bytes_per_row), (u8 *)shadow_addr, n_bytes_per_row); } if (flags()->print_legend) PrintLegend(&str); Printf("%s", str.data()); } void ErrorGeneric::Print() { Decorator d; Printf("%s", d.Warning()); uptr addr = addr_description.Address(); Report("ERROR: AddressSanitizer: %s on address %p at pc %p bp %p sp %p\n", bug_descr, (void *)addr, pc, bp, sp); Printf("%s", d.EndWarning()); char tname[128]; Printf("%s%s of size %zu at %p thread T%d%s%s\n", d.Access(), access_size ? (is_write ? "WRITE" : "READ") : "ACCESS", access_size, (void *)addr, tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname)), d.EndAccess()); scariness.Print(); GET_STACK_TRACE_FATAL(pc, bp); stack.Print(); // Pass bug_descr because we have a special case for // initialization-order-fiasco addr_description.Print(bug_descr); if (shadow_val == kAsanContiguousContainerOOBMagic) PrintContainerOverflowHint(); ReportErrorSummary(bug_descr, &stack); PrintShadowMemoryForAddress(addr); } } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_poisoning.h0000664000175000017500000000674312760153662026073 0ustar mwhudsonmwhudson//===-- asan_poisoning.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Shadow memory poisoning by ASan RTL and by user application. //===----------------------------------------------------------------------===// #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_mapping.h" #include "sanitizer_common/sanitizer_flags.h" namespace __asan { // Enable/disable memory poisoning. void SetCanPoisonMemory(bool value); bool CanPoisonMemory(); // Poisons the shadow memory for "size" bytes starting from "addr". void PoisonShadow(uptr addr, uptr size, u8 value); // Poisons the shadow memory for "redzone_size" bytes starting from // "addr + size". void PoisonShadowPartialRightRedzone(uptr addr, uptr size, uptr redzone_size, u8 value); // Fast versions of PoisonShadow and PoisonShadowPartialRightRedzone that // assume that memory addresses are properly aligned. Use in // performance-critical code with care. ALWAYS_INLINE void FastPoisonShadow(uptr aligned_beg, uptr aligned_size, u8 value) { DCHECK(CanPoisonMemory()); uptr shadow_beg = MEM_TO_SHADOW(aligned_beg); uptr shadow_end = MEM_TO_SHADOW( aligned_beg + aligned_size - SHADOW_GRANULARITY) + 1; // FIXME: Page states are different on Windows, so using the same interface // for mapping shadow and zeroing out pages doesn't "just work", so we should // probably provide higher-level interface for these operations. // For now, just memset on Windows. if (value || SANITIZER_WINDOWS == 1 || shadow_end - shadow_beg < common_flags()->clear_shadow_mmap_threshold) { REAL(memset)((void*)shadow_beg, value, shadow_end - shadow_beg); } else { uptr page_size = GetPageSizeCached(); uptr page_beg = RoundUpTo(shadow_beg, page_size); uptr page_end = RoundDownTo(shadow_end, page_size); if (page_beg >= page_end) { REAL(memset)((void *)shadow_beg, 0, shadow_end - shadow_beg); } else { if (page_beg != shadow_beg) { REAL(memset)((void *)shadow_beg, 0, page_beg - shadow_beg); } if (page_end != shadow_end) { REAL(memset)((void *)page_end, 0, shadow_end - page_end); } ReserveShadowMemoryRange(page_beg, page_end - 1, nullptr); } } } ALWAYS_INLINE void FastPoisonShadowPartialRightRedzone( uptr aligned_addr, uptr size, uptr redzone_size, u8 value) { DCHECK(CanPoisonMemory()); bool poison_partial = flags()->poison_partial; u8 *shadow = (u8*)MEM_TO_SHADOW(aligned_addr); for (uptr i = 0; i < redzone_size; i += SHADOW_GRANULARITY, shadow++) { if (i + SHADOW_GRANULARITY <= size) { *shadow = 0; // fully addressable } else if (i >= size) { *shadow = (SHADOW_GRANULARITY == 128) ? 0xff : value; // unaddressable } else { // first size-i bytes are addressable *shadow = poison_partial ? static_cast(size - i) : 0; } } } // Calls __sanitizer::ReleaseMemoryToOS() on // [MemToShadow(p), MemToShadow(p+size)] with proper rounding. void FlushUnneededASanShadowMemory(uptr p, uptr size); } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_stack.h0000664000175000017500000001224112717003426025153 0ustar mwhudsonmwhudson//===-- asan_stack.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_stack.cc. //===----------------------------------------------------------------------===// #ifndef ASAN_STACK_H #define ASAN_STACK_H #include "asan_flags.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_stacktrace.h" namespace __asan { static const u32 kDefaultMallocContextSize = 30; void SetMallocContextSize(u32 size); u32 GetMallocContextSize(); // Get the stack trace with the given pc and bp. // The pc will be in the position 0 of the resulting stack trace. // The bp may refer to the current frame or to the caller's frame. ALWAYS_INLINE void GetStackTraceWithPcBpAndContext(BufferedStackTrace *stack, uptr max_depth, uptr pc, uptr bp, void *context, bool fast) { #if SANITIZER_WINDOWS stack->Unwind(max_depth, pc, bp, context, 0, 0, fast); #else AsanThread *t; stack->size = 0; if (LIKELY(asan_inited)) { if ((t = GetCurrentThread()) && !t->isUnwinding()) { // On FreeBSD the slow unwinding that leverages _Unwind_Backtrace() // yields the call stack of the signal's handler and not of the code // that raised the signal (as it does on Linux). if (SANITIZER_FREEBSD && t->isInDeadlySignal()) fast = true; uptr stack_top = t->stack_top(); uptr stack_bottom = t->stack_bottom(); ScopedUnwinding unwind_scope(t); if (!SANITIZER_MIPS || IsValidFrame(bp, stack_top, stack_bottom)) { stack->Unwind(max_depth, pc, bp, context, stack_top, stack_bottom, fast); } } else if (!t && !fast) { /* If GetCurrentThread() has failed, try to do slow unwind anyways. */ stack->Unwind(max_depth, pc, bp, context, 0, 0, false); } } #endif // SANITIZER_WINDOWS } } // namespace __asan // NOTE: A Rule of thumb is to retrieve stack trace in the interceptors // as early as possible (in functions exposed to the user), as we generally // don't want stack trace to contain functions from ASan internals. #define GET_STACK_TRACE(max_size, fast) \ BufferedStackTrace stack; \ if (max_size <= 2) { \ stack.size = max_size; \ if (max_size > 0) { \ stack.top_frame_bp = GET_CURRENT_FRAME(); \ stack.trace_buffer[0] = StackTrace::GetCurrentPc(); \ if (max_size > 1) \ stack.trace_buffer[1] = GET_CALLER_PC(); \ } \ } else { \ GetStackTraceWithPcBpAndContext(&stack, max_size, \ StackTrace::GetCurrentPc(), \ GET_CURRENT_FRAME(), 0, fast); \ } #define GET_STACK_TRACE_FATAL(pc, bp) \ BufferedStackTrace stack; \ GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, 0, \ common_flags()->fast_unwind_on_fatal) #define GET_STACK_TRACE_SIGNAL(sig) \ BufferedStackTrace stack; \ GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, \ (sig).pc, (sig).bp, (sig).context, \ common_flags()->fast_unwind_on_fatal) #define GET_STACK_TRACE_FATAL_HERE \ GET_STACK_TRACE(kStackTraceMax, common_flags()->fast_unwind_on_fatal) #define GET_STACK_TRACE_CHECK_HERE \ GET_STACK_TRACE(kStackTraceMax, common_flags()->fast_unwind_on_check) #define GET_STACK_TRACE_THREAD \ GET_STACK_TRACE(kStackTraceMax, true) #define GET_STACK_TRACE_MALLOC \ GET_STACK_TRACE(GetMallocContextSize(), common_flags()->fast_unwind_on_malloc) #define GET_STACK_TRACE_FREE GET_STACK_TRACE_MALLOC #define PRINT_CURRENT_STACK() \ { \ GET_STACK_TRACE_FATAL_HERE; \ stack.Print(); \ } #define PRINT_CURRENT_STACK_CHECK() \ { \ GET_STACK_TRACE_CHECK_HERE; \ stack.Print(); \ } #endif // ASAN_STACK_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_poisoning.cc0000664000175000017500000003770412761067013026225 0ustar mwhudsonmwhudson//===-- asan_poisoning.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Shadow memory poisoning by ASan RTL and by user application. //===----------------------------------------------------------------------===// #include "asan_poisoning.h" #include "asan_report.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_flags.h" namespace __asan { static atomic_uint8_t can_poison_memory; void SetCanPoisonMemory(bool value) { atomic_store(&can_poison_memory, value, memory_order_release); } bool CanPoisonMemory() { return atomic_load(&can_poison_memory, memory_order_acquire); } void PoisonShadow(uptr addr, uptr size, u8 value) { if (!CanPoisonMemory()) return; CHECK(AddrIsAlignedByGranularity(addr)); CHECK(AddrIsInMem(addr)); CHECK(AddrIsAlignedByGranularity(addr + size)); CHECK(AddrIsInMem(addr + size - SHADOW_GRANULARITY)); CHECK(REAL(memset)); FastPoisonShadow(addr, size, value); } void PoisonShadowPartialRightRedzone(uptr addr, uptr size, uptr redzone_size, u8 value) { if (!CanPoisonMemory()) return; CHECK(AddrIsAlignedByGranularity(addr)); CHECK(AddrIsInMem(addr)); FastPoisonShadowPartialRightRedzone(addr, size, redzone_size, value); } struct ShadowSegmentEndpoint { u8 *chunk; s8 offset; // in [0, SHADOW_GRANULARITY) s8 value; // = *chunk; explicit ShadowSegmentEndpoint(uptr address) { chunk = (u8*)MemToShadow(address); offset = address & (SHADOW_GRANULARITY - 1); value = *chunk; } }; void FlushUnneededASanShadowMemory(uptr p, uptr size) { // Since asan's mapping is compacting, the shadow chunk may be // not page-aligned, so we only flush the page-aligned portion. uptr page_size = GetPageSizeCached(); uptr shadow_beg = RoundUpTo(MemToShadow(p), page_size); uptr shadow_end = RoundDownTo(MemToShadow(p + size), page_size); ReleaseMemoryToOS(shadow_beg, shadow_end - shadow_beg); } void AsanPoisonOrUnpoisonIntraObjectRedzone(uptr ptr, uptr size, bool poison) { uptr end = ptr + size; if (Verbosity()) { Printf("__asan_%spoison_intra_object_redzone [%p,%p) %zd\n", poison ? "" : "un", ptr, end, size); if (Verbosity() >= 2) PRINT_CURRENT_STACK(); } CHECK(size); CHECK_LE(size, 4096); CHECK(IsAligned(end, SHADOW_GRANULARITY)); if (!IsAligned(ptr, SHADOW_GRANULARITY)) { *(u8 *)MemToShadow(ptr) = poison ? static_cast(ptr % SHADOW_GRANULARITY) : 0; ptr |= SHADOW_GRANULARITY - 1; ptr++; } for (; ptr < end; ptr += SHADOW_GRANULARITY) *(u8*)MemToShadow(ptr) = poison ? kAsanIntraObjectRedzone : 0; } } // namespace __asan // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT // Current implementation of __asan_(un)poison_memory_region doesn't check // that user program (un)poisons the memory it owns. It poisons memory // conservatively, and unpoisons progressively to make sure asan shadow // mapping invariant is preserved (see detailed mapping description here: // https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm). // // * if user asks to poison region [left, right), the program poisons // at least [left, AlignDown(right)). // * if user asks to unpoison region [left, right), the program unpoisons // at most [AlignDown(left), right). void __asan_poison_memory_region(void const volatile *addr, uptr size) { if (!flags()->allow_user_poisoning || size == 0) return; uptr beg_addr = (uptr)addr; uptr end_addr = beg_addr + size; VPrintf(3, "Trying to poison memory region [%p, %p)\n", (void *)beg_addr, (void *)end_addr); ShadowSegmentEndpoint beg(beg_addr); ShadowSegmentEndpoint end(end_addr); if (beg.chunk == end.chunk) { CHECK_LT(beg.offset, end.offset); s8 value = beg.value; CHECK_EQ(value, end.value); // We can only poison memory if the byte in end.offset is unaddressable. // No need to re-poison memory if it is poisoned already. if (value > 0 && value <= end.offset) { if (beg.offset > 0) { *beg.chunk = Min(value, beg.offset); } else { *beg.chunk = kAsanUserPoisonedMemoryMagic; } } return; } CHECK_LT(beg.chunk, end.chunk); if (beg.offset > 0) { // Mark bytes from beg.offset as unaddressable. if (beg.value == 0) { *beg.chunk = beg.offset; } else { *beg.chunk = Min(beg.value, beg.offset); } beg.chunk++; } REAL(memset)(beg.chunk, kAsanUserPoisonedMemoryMagic, end.chunk - beg.chunk); // Poison if byte in end.offset is unaddressable. if (end.value > 0 && end.value <= end.offset) { *end.chunk = kAsanUserPoisonedMemoryMagic; } } void __asan_unpoison_memory_region(void const volatile *addr, uptr size) { if (!flags()->allow_user_poisoning || size == 0) return; uptr beg_addr = (uptr)addr; uptr end_addr = beg_addr + size; VPrintf(3, "Trying to unpoison memory region [%p, %p)\n", (void *)beg_addr, (void *)end_addr); ShadowSegmentEndpoint beg(beg_addr); ShadowSegmentEndpoint end(end_addr); if (beg.chunk == end.chunk) { CHECK_LT(beg.offset, end.offset); s8 value = beg.value; CHECK_EQ(value, end.value); // We unpoison memory bytes up to enbytes up to end.offset if it is not // unpoisoned already. if (value != 0) { *beg.chunk = Max(value, end.offset); } return; } CHECK_LT(beg.chunk, end.chunk); if (beg.offset > 0) { *beg.chunk = 0; beg.chunk++; } REAL(memset)(beg.chunk, 0, end.chunk - beg.chunk); if (end.offset > 0 && end.value != 0) { *end.chunk = Max(end.value, end.offset); } } int __asan_address_is_poisoned(void const volatile *addr) { return __asan::AddressIsPoisoned((uptr)addr); } uptr __asan_region_is_poisoned(uptr beg, uptr size) { if (!size) return 0; uptr end = beg + size; if (!AddrIsInMem(beg)) return beg; if (!AddrIsInMem(end)) return end; CHECK_LT(beg, end); uptr aligned_b = RoundUpTo(beg, SHADOW_GRANULARITY); uptr aligned_e = RoundDownTo(end, SHADOW_GRANULARITY); uptr shadow_beg = MemToShadow(aligned_b); uptr shadow_end = MemToShadow(aligned_e); // First check the first and the last application bytes, // then check the SHADOW_GRANULARITY-aligned region by calling // mem_is_zero on the corresponding shadow. if (!__asan::AddressIsPoisoned(beg) && !__asan::AddressIsPoisoned(end - 1) && (shadow_end <= shadow_beg || __sanitizer::mem_is_zero((const char *)shadow_beg, shadow_end - shadow_beg))) return 0; // The fast check failed, so we have a poisoned byte somewhere. // Find it slowly. for (; beg < end; beg++) if (__asan::AddressIsPoisoned(beg)) return beg; UNREACHABLE("mem_is_zero returned false, but poisoned byte was not found"); return 0; } #define CHECK_SMALL_REGION(p, size, isWrite) \ do { \ uptr __p = reinterpret_cast(p); \ uptr __size = size; \ if (UNLIKELY(__asan::AddressIsPoisoned(__p) || \ __asan::AddressIsPoisoned(__p + __size - 1))) { \ GET_CURRENT_PC_BP_SP; \ uptr __bad = __asan_region_is_poisoned(__p, __size); \ __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0);\ } \ } while (false); \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE u16 __sanitizer_unaligned_load16(const uu16 *p) { CHECK_SMALL_REGION(p, sizeof(*p), false); return *p; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE u32 __sanitizer_unaligned_load32(const uu32 *p) { CHECK_SMALL_REGION(p, sizeof(*p), false); return *p; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE u64 __sanitizer_unaligned_load64(const uu64 *p) { CHECK_SMALL_REGION(p, sizeof(*p), false); return *p; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store16(uu16 *p, u16 x) { CHECK_SMALL_REGION(p, sizeof(*p), true); *p = x; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store32(uu32 *p, u32 x) { CHECK_SMALL_REGION(p, sizeof(*p), true); *p = x; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store64(uu64 *p, u64 x) { CHECK_SMALL_REGION(p, sizeof(*p), true); *p = x; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __asan_poison_cxx_array_cookie(uptr p) { if (SANITIZER_WORDSIZE != 64) return; if (!flags()->poison_array_cookie) return; uptr s = MEM_TO_SHADOW(p); *reinterpret_cast(s) = kAsanArrayCookieMagic; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_load_cxx_array_cookie(uptr *p) { if (SANITIZER_WORDSIZE != 64) return *p; if (!flags()->poison_array_cookie) return *p; uptr s = MEM_TO_SHADOW(reinterpret_cast(p)); u8 sval = *reinterpret_cast(s); if (sval == kAsanArrayCookieMagic) return *p; // If sval is not kAsanArrayCookieMagic it can only be freed memory, // which means that we are going to get double-free. So, return 0 to avoid // infinite loop of destructors. We don't want to report a double-free here // though, so print a warning just in case. // CHECK_EQ(sval, kAsanHeapFreeMagic); if (sval == kAsanHeapFreeMagic) { Report("AddressSanitizer: loaded array cookie from free-d memory; " "expect a double-free report\n"); return 0; } // The cookie may remain unpoisoned if e.g. it comes from a custom // operator new defined inside a class. return *p; } // This is a simplified version of __asan_(un)poison_memory_region, which // assumes that left border of region to be poisoned is properly aligned. static void PoisonAlignedStackMemory(uptr addr, uptr size, bool do_poison) { if (size == 0) return; uptr aligned_size = size & ~(SHADOW_GRANULARITY - 1); PoisonShadow(addr, aligned_size, do_poison ? kAsanStackUseAfterScopeMagic : 0); if (size == aligned_size) return; s8 end_offset = (s8)(size - aligned_size); s8* shadow_end = (s8*)MemToShadow(addr + aligned_size); s8 end_value = *shadow_end; if (do_poison) { // If possible, mark all the bytes mapping to last shadow byte as // unaddressable. if (end_value > 0 && end_value <= end_offset) *shadow_end = (s8)kAsanStackUseAfterScopeMagic; } else { // If necessary, mark few first bytes mapping to last shadow byte // as addressable if (end_value != 0) *shadow_end = Max(end_value, end_offset); } } void __asan_set_shadow_00(uptr addr, uptr size) { REAL(memset)((void *)addr, 0, size); } void __asan_set_shadow_f1(uptr addr, uptr size) { REAL(memset)((void *)addr, 0xf1, size); } void __asan_set_shadow_f2(uptr addr, uptr size) { REAL(memset)((void *)addr, 0xf2, size); } void __asan_set_shadow_f3(uptr addr, uptr size) { REAL(memset)((void *)addr, 0xf3, size); } void __asan_set_shadow_f5(uptr addr, uptr size) { REAL(memset)((void *)addr, 0xf5, size); } void __asan_set_shadow_f8(uptr addr, uptr size) { REAL(memset)((void *)addr, 0xf8, size); } void __asan_poison_stack_memory(uptr addr, uptr size) { VReport(1, "poisoning: %p %zx\n", (void *)addr, size); PoisonAlignedStackMemory(addr, size, true); } void __asan_unpoison_stack_memory(uptr addr, uptr size) { VReport(1, "unpoisoning: %p %zx\n", (void *)addr, size); PoisonAlignedStackMemory(addr, size, false); } void __sanitizer_annotate_contiguous_container(const void *beg_p, const void *end_p, const void *old_mid_p, const void *new_mid_p) { if (!flags()->detect_container_overflow) return; VPrintf(2, "contiguous_container: %p %p %p %p\n", beg_p, end_p, old_mid_p, new_mid_p); uptr beg = reinterpret_cast(beg_p); uptr end = reinterpret_cast(end_p); uptr old_mid = reinterpret_cast(old_mid_p); uptr new_mid = reinterpret_cast(new_mid_p); uptr granularity = SHADOW_GRANULARITY; if (!(beg <= old_mid && beg <= new_mid && old_mid <= end && new_mid <= end && IsAligned(beg, granularity))) { GET_STACK_TRACE_FATAL_HERE; ReportBadParamsToAnnotateContiguousContainer(beg, end, old_mid, new_mid, &stack); } CHECK_LE(end - beg, FIRST_32_SECOND_64(1UL << 30, 1ULL << 34)); // Sanity check. uptr a = RoundDownTo(Min(old_mid, new_mid), granularity); uptr c = RoundUpTo(Max(old_mid, new_mid), granularity); uptr d1 = RoundDownTo(old_mid, granularity); // uptr d2 = RoundUpTo(old_mid, granularity); // Currently we should be in this state: // [a, d1) is good, [d2, c) is bad, [d1, d2) is partially good. // Make a quick sanity check that we are indeed in this state. // // FIXME: Two of these three checks are disabled until we fix // https://github.com/google/sanitizers/issues/258. // if (d1 != d2) // CHECK_EQ(*(u8*)MemToShadow(d1), old_mid - d1); if (a + granularity <= d1) CHECK_EQ(*(u8*)MemToShadow(a), 0); // if (d2 + granularity <= c && c <= end) // CHECK_EQ(*(u8 *)MemToShadow(c - granularity), // kAsanContiguousContainerOOBMagic); uptr b1 = RoundDownTo(new_mid, granularity); uptr b2 = RoundUpTo(new_mid, granularity); // New state: // [a, b1) is good, [b2, c) is bad, [b1, b2) is partially good. PoisonShadow(a, b1 - a, 0); PoisonShadow(b2, c - b2, kAsanContiguousContainerOOBMagic); if (b1 != b2) { CHECK_EQ(b2 - b1, granularity); *(u8*)MemToShadow(b1) = static_cast(new_mid - b1); } } const void *__sanitizer_contiguous_container_find_bad_address( const void *beg_p, const void *mid_p, const void *end_p) { if (!flags()->detect_container_overflow) return nullptr; uptr beg = reinterpret_cast(beg_p); uptr end = reinterpret_cast(end_p); uptr mid = reinterpret_cast(mid_p); CHECK_LE(beg, mid); CHECK_LE(mid, end); // Check some bytes starting from beg, some bytes around mid, and some bytes // ending with end. uptr kMaxRangeToCheck = 32; uptr r1_beg = beg; uptr r1_end = Min(end + kMaxRangeToCheck, mid); uptr r2_beg = Max(beg, mid - kMaxRangeToCheck); uptr r2_end = Min(end, mid + kMaxRangeToCheck); uptr r3_beg = Max(end - kMaxRangeToCheck, mid); uptr r3_end = end; for (uptr i = r1_beg; i < r1_end; i++) if (AddressIsPoisoned(i)) return reinterpret_cast(i); for (uptr i = r2_beg; i < mid; i++) if (AddressIsPoisoned(i)) return reinterpret_cast(i); for (uptr i = mid; i < r2_end; i++) if (!AddressIsPoisoned(i)) return reinterpret_cast(i); for (uptr i = r3_beg; i < r3_end; i++) if (!AddressIsPoisoned(i)) return reinterpret_cast(i); return nullptr; } int __sanitizer_verify_contiguous_container(const void *beg_p, const void *mid_p, const void *end_p) { return __sanitizer_contiguous_container_find_bad_address(beg_p, mid_p, end_p) == nullptr; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __asan_poison_intra_object_redzone(uptr ptr, uptr size) { AsanPoisonOrUnpoisonIntraObjectRedzone(ptr, size, true); } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __asan_unpoison_intra_object_redzone(uptr ptr, uptr size) { AsanPoisonOrUnpoisonIntraObjectRedzone(ptr, size, false); } // --- Implementation of LSan-specific functions --- {{{1 namespace __lsan { bool WordIsPoisoned(uptr addr) { return (__asan_region_is_poisoned(addr, sizeof(uptr)) != 0); } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_win_dll_thunk.cc0000664000175000017500000004715512777531134027071 0ustar mwhudsonmwhudson//===-- asan_win_dll_thunk.cc ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This file defines a family of thunks that should be statically linked into // the DLLs that have ASan instrumentation in order to delegate the calls to the // shared runtime that lives in the main binary. // See https://github.com/google/sanitizers/issues/209 for the details. //===----------------------------------------------------------------------===// // Only compile this code when building asan_dll_thunk.lib // Using #ifdef rather than relying on Makefiles etc. // simplifies the build procedure. #ifdef ASAN_DLL_THUNK #include "asan_init_version.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_platform_interceptors.h" // ---------- Function interception helper functions and macros ----------- {{{1 extern "C" { void *__stdcall GetModuleHandleA(const char *module_name); void *__stdcall GetProcAddress(void *module, const char *proc_name); void abort(); } using namespace __sanitizer; static uptr getRealProcAddressOrDie(const char *name) { uptr ret = __interception::InternalGetProcAddress((void *)GetModuleHandleA(0), name); if (!ret) abort(); return ret; } // We need to intercept some functions (e.g. ASan interface, memory allocator -- // let's call them "hooks") exported by the DLL thunk and forward the hooks to // the runtime in the main module. // However, we don't want to keep two lists of these hooks. // To avoid that, the list of hooks should be defined using the // INTERCEPT_WHEN_POSSIBLE macro. Then, all these hooks can be intercepted // at once by calling INTERCEPT_HOOKS(). // Use macro+template magic to automatically generate the list of hooks. // Each hook at line LINE defines a template class with a static // FunctionInterceptor::Execute() method intercepting the hook. // The default implementation of FunctionInterceptor is to call // the Execute() method corresponding to the previous line. template struct FunctionInterceptor { static void Execute() { FunctionInterceptor::Execute(); } }; // There shouldn't be any hooks with negative definition line number. template<> struct FunctionInterceptor<0> { static void Execute() {} }; #define INTERCEPT_WHEN_POSSIBLE(main_function, dll_function) \ template <> struct FunctionInterceptor<__LINE__> { \ static void Execute() { \ uptr wrapper = getRealProcAddressOrDie(main_function); \ if (!__interception::OverrideFunction((uptr)dll_function, wrapper, 0)) \ abort(); \ FunctionInterceptor<__LINE__ - 1>::Execute(); \ } \ }; // Special case of hooks -- ASan own interface functions. Those are only called // after __asan_init, thus an empty implementation is sufficient. #define INTERFACE_FUNCTION(name) \ extern "C" __declspec(noinline) void name() { \ volatile int prevent_icf = (__LINE__ << 8); (void)prevent_icf; \ __debugbreak(); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name) // INTERCEPT_HOOKS must be used after the last INTERCEPT_WHEN_POSSIBLE. #define INTERCEPT_HOOKS FunctionInterceptor<__LINE__>::Execute // We can't define our own version of strlen etc. because that would lead to // link-time or even type mismatch errors. Instead, we can declare a function // just to be able to get its address. Me may miss the first few calls to the // functions since it can be called before __asan_init, but that would lead to // false negatives in the startup code before user's global initializers, which // isn't a big deal. #define INTERCEPT_LIBRARY_FUNCTION(name) \ extern "C" void name(); \ INTERCEPT_WHEN_POSSIBLE(WRAPPER_NAME(name), name) // Disable compiler warnings that show up if we declare our own version // of a compiler intrinsic (e.g. strlen). #pragma warning(disable: 4391) #pragma warning(disable: 4392) static void InterceptHooks(); // }}} // ---------- Function wrapping helpers ----------------------------------- {{{1 #define WRAP_V_V(name) \ extern "C" void name() { \ typedef void (*fntype)(); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ fn(); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_V_W(name) \ extern "C" void name(void *arg) { \ typedef void (*fntype)(void *arg); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ fn(arg); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_V_WW(name) \ extern "C" void name(void *arg1, void *arg2) { \ typedef void (*fntype)(void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ fn(arg1, arg2); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_V_WWW(name) \ extern "C" void name(void *arg1, void *arg2, void *arg3) { \ typedef void *(*fntype)(void *, void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ fn(arg1, arg2, arg3); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_V(name) \ extern "C" void *name() { \ typedef void *(*fntype)(); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_W(name) \ extern "C" void *name(void *arg) { \ typedef void *(*fntype)(void *arg); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(arg); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_WW(name) \ extern "C" void *name(void *arg1, void *arg2) { \ typedef void *(*fntype)(void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(arg1, arg2); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_WWW(name) \ extern "C" void *name(void *arg1, void *arg2, void *arg3) { \ typedef void *(*fntype)(void *, void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(arg1, arg2, arg3); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_WWWW(name) \ extern "C" void *name(void *arg1, void *arg2, void *arg3, void *arg4) { \ typedef void *(*fntype)(void *, void *, void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(arg1, arg2, arg3, arg4); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_WWWWW(name) \ extern "C" void *name(void *arg1, void *arg2, void *arg3, void *arg4, \ void *arg5) { \ typedef void *(*fntype)(void *, void *, void *, void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(arg1, arg2, arg3, arg4, arg5); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); #define WRAP_W_WWWWWW(name) \ extern "C" void *name(void *arg1, void *arg2, void *arg3, void *arg4, \ void *arg5, void *arg6) { \ typedef void *(*fntype)(void *, void *, void *, void *, void *, void *); \ static fntype fn = (fntype)getRealProcAddressOrDie(#name); \ return fn(arg1, arg2, arg3, arg4, arg5, arg6); \ } \ INTERCEPT_WHEN_POSSIBLE(#name, name); // }}} // ----------------- ASan own interface functions -------------------- // Don't use the INTERFACE_FUNCTION machinery for this function as we actually // want to call it in the __asan_init interceptor. WRAP_W_V(__asan_should_detect_stack_use_after_return) WRAP_W_V(__asan_get_shadow_memory_dynamic_address) extern "C" { int __asan_option_detect_stack_use_after_return; uptr __asan_shadow_memory_dynamic_address; // Manually wrap __asan_init as we need to initialize // __asan_option_detect_stack_use_after_return afterwards. void __asan_init() { typedef void (*fntype)(); static fntype fn = 0; // __asan_init is expected to be called by only one thread. if (fn) return; fn = (fntype)getRealProcAddressOrDie("__asan_init"); fn(); __asan_option_detect_stack_use_after_return = (__asan_should_detect_stack_use_after_return() != 0); __asan_shadow_memory_dynamic_address = (uptr)__asan_get_shadow_memory_dynamic_address(); InterceptHooks(); } } extern "C" void __asan_version_mismatch_check() { // Do nothing. } INTERFACE_FUNCTION(__asan_handle_no_return) INTERFACE_FUNCTION(__asan_report_store1) INTERFACE_FUNCTION(__asan_report_store2) INTERFACE_FUNCTION(__asan_report_store4) INTERFACE_FUNCTION(__asan_report_store8) INTERFACE_FUNCTION(__asan_report_store16) INTERFACE_FUNCTION(__asan_report_store_n) INTERFACE_FUNCTION(__asan_report_load1) INTERFACE_FUNCTION(__asan_report_load2) INTERFACE_FUNCTION(__asan_report_load4) INTERFACE_FUNCTION(__asan_report_load8) INTERFACE_FUNCTION(__asan_report_load16) INTERFACE_FUNCTION(__asan_report_load_n) INTERFACE_FUNCTION(__asan_store1) INTERFACE_FUNCTION(__asan_store2) INTERFACE_FUNCTION(__asan_store4) INTERFACE_FUNCTION(__asan_store8) INTERFACE_FUNCTION(__asan_store16) INTERFACE_FUNCTION(__asan_storeN) INTERFACE_FUNCTION(__asan_load1) INTERFACE_FUNCTION(__asan_load2) INTERFACE_FUNCTION(__asan_load4) INTERFACE_FUNCTION(__asan_load8) INTERFACE_FUNCTION(__asan_load16) INTERFACE_FUNCTION(__asan_loadN) INTERFACE_FUNCTION(__asan_memcpy); INTERFACE_FUNCTION(__asan_memset); INTERFACE_FUNCTION(__asan_memmove); INTERFACE_FUNCTION(__asan_set_shadow_00); INTERFACE_FUNCTION(__asan_set_shadow_f1); INTERFACE_FUNCTION(__asan_set_shadow_f2); INTERFACE_FUNCTION(__asan_set_shadow_f3); INTERFACE_FUNCTION(__asan_set_shadow_f5); INTERFACE_FUNCTION(__asan_set_shadow_f8); INTERFACE_FUNCTION(__asan_alloca_poison); INTERFACE_FUNCTION(__asan_allocas_unpoison); INTERFACE_FUNCTION(__asan_register_globals) INTERFACE_FUNCTION(__asan_unregister_globals) INTERFACE_FUNCTION(__asan_before_dynamic_init) INTERFACE_FUNCTION(__asan_after_dynamic_init) INTERFACE_FUNCTION(__asan_poison_stack_memory) INTERFACE_FUNCTION(__asan_unpoison_stack_memory) INTERFACE_FUNCTION(__asan_poison_memory_region) INTERFACE_FUNCTION(__asan_unpoison_memory_region) INTERFACE_FUNCTION(__asan_address_is_poisoned) INTERFACE_FUNCTION(__asan_region_is_poisoned) INTERFACE_FUNCTION(__asan_get_current_fake_stack) INTERFACE_FUNCTION(__asan_addr_is_in_fake_stack) INTERFACE_FUNCTION(__asan_stack_malloc_0) INTERFACE_FUNCTION(__asan_stack_malloc_1) INTERFACE_FUNCTION(__asan_stack_malloc_2) INTERFACE_FUNCTION(__asan_stack_malloc_3) INTERFACE_FUNCTION(__asan_stack_malloc_4) INTERFACE_FUNCTION(__asan_stack_malloc_5) INTERFACE_FUNCTION(__asan_stack_malloc_6) INTERFACE_FUNCTION(__asan_stack_malloc_7) INTERFACE_FUNCTION(__asan_stack_malloc_8) INTERFACE_FUNCTION(__asan_stack_malloc_9) INTERFACE_FUNCTION(__asan_stack_malloc_10) INTERFACE_FUNCTION(__asan_stack_free_0) INTERFACE_FUNCTION(__asan_stack_free_1) INTERFACE_FUNCTION(__asan_stack_free_2) INTERFACE_FUNCTION(__asan_stack_free_4) INTERFACE_FUNCTION(__asan_stack_free_5) INTERFACE_FUNCTION(__asan_stack_free_6) INTERFACE_FUNCTION(__asan_stack_free_7) INTERFACE_FUNCTION(__asan_stack_free_8) INTERFACE_FUNCTION(__asan_stack_free_9) INTERFACE_FUNCTION(__asan_stack_free_10) // FIXME: we might want to have a sanitizer_win_dll_thunk? INTERFACE_FUNCTION(__sanitizer_annotate_contiguous_container) INTERFACE_FUNCTION(__sanitizer_contiguous_container_find_bad_address) INTERFACE_FUNCTION(__sanitizer_cov) INTERFACE_FUNCTION(__sanitizer_cov_dump) INTERFACE_FUNCTION(__sanitizer_cov_indir_call16) INTERFACE_FUNCTION(__sanitizer_cov_init) INTERFACE_FUNCTION(__sanitizer_cov_module_init) INTERFACE_FUNCTION(__sanitizer_cov_trace_basic_block) INTERFACE_FUNCTION(__sanitizer_cov_trace_func_enter) INTERFACE_FUNCTION(__sanitizer_cov_with_check) INTERFACE_FUNCTION(__sanitizer_get_allocated_size) INTERFACE_FUNCTION(__sanitizer_get_coverage_guards) INTERFACE_FUNCTION(__sanitizer_get_current_allocated_bytes) INTERFACE_FUNCTION(__sanitizer_get_estimated_allocated_size) INTERFACE_FUNCTION(__sanitizer_get_free_bytes) INTERFACE_FUNCTION(__sanitizer_get_heap_size) INTERFACE_FUNCTION(__sanitizer_get_ownership) INTERFACE_FUNCTION(__sanitizer_get_total_unique_caller_callee_pairs) INTERFACE_FUNCTION(__sanitizer_get_total_unique_coverage) INTERFACE_FUNCTION(__sanitizer_get_unmapped_bytes) INTERFACE_FUNCTION(__sanitizer_maybe_open_cov_file) INTERFACE_FUNCTION(__sanitizer_print_stack_trace) INTERFACE_FUNCTION(__sanitizer_symbolize_pc) INTERFACE_FUNCTION(__sanitizer_symbolize_global) INTERFACE_FUNCTION(__sanitizer_ptr_cmp) INTERFACE_FUNCTION(__sanitizer_ptr_sub) INTERFACE_FUNCTION(__sanitizer_report_error_summary) INTERFACE_FUNCTION(__sanitizer_reset_coverage) INTERFACE_FUNCTION(__sanitizer_get_number_of_counters) INTERFACE_FUNCTION(__sanitizer_update_counter_bitset_and_clear_counters) INTERFACE_FUNCTION(__sanitizer_sandbox_on_notify) INTERFACE_FUNCTION(__sanitizer_set_death_callback) INTERFACE_FUNCTION(__sanitizer_set_report_path) INTERFACE_FUNCTION(__sanitizer_set_report_fd) INTERFACE_FUNCTION(__sanitizer_unaligned_load16) INTERFACE_FUNCTION(__sanitizer_unaligned_load32) INTERFACE_FUNCTION(__sanitizer_unaligned_load64) INTERFACE_FUNCTION(__sanitizer_unaligned_store16) INTERFACE_FUNCTION(__sanitizer_unaligned_store32) INTERFACE_FUNCTION(__sanitizer_unaligned_store64) INTERFACE_FUNCTION(__sanitizer_verify_contiguous_container) INTERFACE_FUNCTION(__sanitizer_install_malloc_and_free_hooks) INTERFACE_FUNCTION(__sanitizer_start_switch_fiber) INTERFACE_FUNCTION(__sanitizer_finish_switch_fiber) // TODO(timurrrr): Add more interface functions on the as-needed basis. // ----------------- Memory allocation functions --------------------- WRAP_V_W(free) WRAP_V_W(_free_base) WRAP_V_WW(_free_dbg) WRAP_W_W(malloc) WRAP_W_W(_malloc_base) WRAP_W_WWWW(_malloc_dbg) WRAP_W_WW(calloc) WRAP_W_WW(_calloc_base) WRAP_W_WWWWW(_calloc_dbg) WRAP_W_WWW(_calloc_impl) WRAP_W_WW(realloc) WRAP_W_WW(_realloc_base) WRAP_W_WWW(_realloc_dbg) WRAP_W_WWW(_recalloc) WRAP_W_WWW(_recalloc_base) WRAP_W_W(_msize) WRAP_W_W(_expand) WRAP_W_W(_expand_dbg) // TODO(timurrrr): Might want to add support for _aligned_* allocation // functions to detect a bit more bugs. Those functions seem to wrap malloc(). // TODO(timurrrr): Do we need to add _Crt* stuff here? (see asan_malloc_win.cc). INTERCEPT_LIBRARY_FUNCTION(atoi); INTERCEPT_LIBRARY_FUNCTION(atol); #ifdef _WIN64 INTERCEPT_LIBRARY_FUNCTION(__C_specific_handler); #else INTERCEPT_LIBRARY_FUNCTION(_except_handler3); // _except_handler4 checks -GS cookie which is different for each module, so we // can't use INTERCEPT_LIBRARY_FUNCTION(_except_handler4). INTERCEPTOR(int, _except_handler4, void *a, void *b, void *c, void *d) { __asan_handle_no_return(); return REAL(_except_handler4)(a, b, c, d); } #endif INTERCEPT_LIBRARY_FUNCTION(frexp); INTERCEPT_LIBRARY_FUNCTION(longjmp); #if SANITIZER_INTERCEPT_MEMCHR INTERCEPT_LIBRARY_FUNCTION(memchr); #endif INTERCEPT_LIBRARY_FUNCTION(memcmp); INTERCEPT_LIBRARY_FUNCTION(memcpy); INTERCEPT_LIBRARY_FUNCTION(memmove); INTERCEPT_LIBRARY_FUNCTION(memset); INTERCEPT_LIBRARY_FUNCTION(strcat); // NOLINT INTERCEPT_LIBRARY_FUNCTION(strchr); INTERCEPT_LIBRARY_FUNCTION(strcmp); INTERCEPT_LIBRARY_FUNCTION(strcpy); // NOLINT INTERCEPT_LIBRARY_FUNCTION(strcspn); INTERCEPT_LIBRARY_FUNCTION(strdup); INTERCEPT_LIBRARY_FUNCTION(strlen); INTERCEPT_LIBRARY_FUNCTION(strncat); INTERCEPT_LIBRARY_FUNCTION(strncmp); INTERCEPT_LIBRARY_FUNCTION(strncpy); INTERCEPT_LIBRARY_FUNCTION(strnlen); INTERCEPT_LIBRARY_FUNCTION(strpbrk); INTERCEPT_LIBRARY_FUNCTION(strrchr); INTERCEPT_LIBRARY_FUNCTION(strspn); INTERCEPT_LIBRARY_FUNCTION(strstr); INTERCEPT_LIBRARY_FUNCTION(strtol); INTERCEPT_LIBRARY_FUNCTION(wcslen); // Must be after all the interceptor declarations due to the way INTERCEPT_HOOKS // is defined. void InterceptHooks() { INTERCEPT_HOOKS(); #ifndef _WIN64 INTERCEPT_FUNCTION(_except_handler4); #endif } // We want to call __asan_init before C/C++ initializers/constructors are // executed, otherwise functions like memset might be invoked. // For some strange reason, merely linking in asan_preinit.cc doesn't work // as the callback is never called... Is link.exe doing something too smart? // In DLLs, the callbacks are expected to return 0, // otherwise CRT initialization fails. static int call_asan_init() { __asan_init(); return 0; } #pragma section(".CRT$XIB", long, read) // NOLINT __declspec(allocate(".CRT$XIB")) int (*__asan_preinit)() = call_asan_init; #endif // ASAN_DLL_THUNK golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_thread.h0000664000175000017500000001375712772733540025342 0ustar mwhudsonmwhudson//===-- asan_thread.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_thread.cc. //===----------------------------------------------------------------------===// #ifndef ASAN_THREAD_H #define ASAN_THREAD_H #include "asan_allocator.h" #include "asan_internal.h" #include "asan_fake_stack.h" #include "asan_stats.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_thread_registry.h" namespace __sanitizer { struct DTLS; } // namespace __sanitizer namespace __asan { const u32 kInvalidTid = 0xffffff; // Must fit into 24 bits. const u32 kMaxNumberOfThreads = (1 << 22); // 4M class AsanThread; // These objects are created for every thread and are never deleted, // so we can find them by tid even if the thread is long dead. class AsanThreadContext : public ThreadContextBase { public: explicit AsanThreadContext(int tid) : ThreadContextBase(tid), announced(false), destructor_iterations(GetPthreadDestructorIterations()), stack_id(0), thread(nullptr) {} bool announced; u8 destructor_iterations; u32 stack_id; AsanThread *thread; void OnCreated(void *arg) override; void OnFinished() override; }; // AsanThreadContext objects are never freed, so we need many of them. COMPILER_CHECK(sizeof(AsanThreadContext) <= 256); // AsanThread are stored in TSD and destroyed when the thread dies. class AsanThread { public: static AsanThread *Create(thread_callback_t start_routine, void *arg, u32 parent_tid, StackTrace *stack, bool detached); static void TSDDtor(void *tsd); void Destroy(); void Init(); // Should be called from the thread itself. thread_return_t ThreadStart(uptr os_id, atomic_uintptr_t *signal_thread_is_registered); uptr stack_top(); uptr stack_bottom(); uptr stack_size(); uptr tls_begin() { return tls_begin_; } uptr tls_end() { return tls_end_; } DTLS *dtls() { return dtls_; } u32 tid() { return context_->tid; } AsanThreadContext *context() { return context_; } void set_context(AsanThreadContext *context) { context_ = context; } struct StackFrameAccess { uptr offset; uptr frame_pc; const char *frame_descr; }; bool GetStackFrameAccessByAddr(uptr addr, StackFrameAccess *access); bool AddrIsInStack(uptr addr); void DeleteFakeStack(int tid) { if (!fake_stack_) return; FakeStack *t = fake_stack_; fake_stack_ = nullptr; SetTLSFakeStack(nullptr); t->Destroy(tid); } void StartSwitchFiber(FakeStack **fake_stack_save, uptr bottom, uptr size); void FinishSwitchFiber(FakeStack *fake_stack_save, uptr *bottom_old, uptr *size_old); bool has_fake_stack() { return !atomic_load(&stack_switching_, memory_order_relaxed) && (reinterpret_cast(fake_stack_) > 1); } FakeStack *fake_stack() { if (!__asan_option_detect_stack_use_after_return) return nullptr; if (atomic_load(&stack_switching_, memory_order_relaxed)) return nullptr; if (!has_fake_stack()) return AsyncSignalSafeLazyInitFakeStack(); return fake_stack_; } // True is this thread is currently unwinding stack (i.e. collecting a stack // trace). Used to prevent deadlocks on platforms where libc unwinder calls // malloc internally. See PR17116 for more details. bool isUnwinding() const { return unwinding_; } void setUnwinding(bool b) { unwinding_ = b; } // True if we are in a deadly signal handler. bool isInDeadlySignal() const { return in_deadly_signal_; } void setInDeadlySignal(bool b) { in_deadly_signal_ = b; } AsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; } AsanStats &stats() { return stats_; } private: // NOTE: There is no AsanThread constructor. It is allocated // via mmap() and *must* be valid in zero-initialized state. void SetThreadStackAndTls(); void ClearShadowForThreadStackAndTLS(); FakeStack *AsyncSignalSafeLazyInitFakeStack(); struct StackBounds { uptr bottom; uptr top; }; StackBounds GetStackBounds() const; AsanThreadContext *context_; thread_callback_t start_routine_; void *arg_; uptr stack_top_; uptr stack_bottom_; // these variables are used when the thread is about to switch stack uptr next_stack_top_; uptr next_stack_bottom_; // true if switching is in progress atomic_uint8_t stack_switching_; uptr tls_begin_; uptr tls_end_; DTLS *dtls_; FakeStack *fake_stack_; AsanThreadLocalMallocStorage malloc_storage_; AsanStats stats_; bool unwinding_; bool in_deadly_signal_; }; // ScopedUnwinding is a scope for stacktracing member of a context class ScopedUnwinding { public: explicit ScopedUnwinding(AsanThread *t) : thread(t) { t->setUnwinding(true); } ~ScopedUnwinding() { thread->setUnwinding(false); } private: AsanThread *thread; }; // ScopedDeadlySignal is a scope for handling deadly signals. class ScopedDeadlySignal { public: explicit ScopedDeadlySignal(AsanThread *t) : thread(t) { if (thread) thread->setInDeadlySignal(true); } ~ScopedDeadlySignal() { if (thread) thread->setInDeadlySignal(false); } private: AsanThread *thread; }; // Returns a single instance of registry. ThreadRegistry &asanThreadRegistry(); // Must be called under ThreadRegistryLock. AsanThreadContext *GetThreadContextByTidLocked(u32 tid); // Get the current thread. May return 0. AsanThread *GetCurrentThread(); void SetCurrentThread(AsanThread *t); u32 GetCurrentTidOrInvalid(); AsanThread *FindThreadByStackAddress(uptr addr); // Used to handle fork(). void EnsureMainThreadIDIsCorrect(); } // namespace __asan #endif // ASAN_THREAD_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_malloc_win.cc0000664000175000017500000001745712777271011026351 0ustar mwhudsonmwhudson//===-- asan_malloc_win.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Windows-specific malloc interception. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_WINDOWS #define WIN32_LEAN_AND_MEAN #include #include "asan_allocator.h" #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_stack.h" #include "interception/interception.h" #include using namespace __asan; // NOLINT // MT: Simply defining functions with the same signature in *.obj // files overrides the standard functions in the CRT. // MD: Memory allocation functions are defined in the CRT .dll, // so we have to intercept them before they are called for the first time. #if ASAN_DYNAMIC # define ALLOCATION_FUNCTION_ATTRIBUTE #else # define ALLOCATION_FUNCTION_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE #endif extern "C" { ALLOCATION_FUNCTION_ATTRIBUTE void free(void *ptr) { GET_STACK_TRACE_FREE; return asan_free(ptr, &stack, FROM_MALLOC); } ALLOCATION_FUNCTION_ATTRIBUTE void _free_dbg(void *ptr, int) { free(ptr); } ALLOCATION_FUNCTION_ATTRIBUTE void _free_base(void *ptr) { free(ptr); } ALLOCATION_FUNCTION_ATTRIBUTE void cfree(void *ptr) { CHECK(!"cfree() should not be used on Windows"); } ALLOCATION_FUNCTION_ATTRIBUTE void *malloc(size_t size) { GET_STACK_TRACE_MALLOC; return asan_malloc(size, &stack); } ALLOCATION_FUNCTION_ATTRIBUTE void *_malloc_base(size_t size) { return malloc(size); } ALLOCATION_FUNCTION_ATTRIBUTE void *_malloc_dbg(size_t size, int, const char *, int) { return malloc(size); } ALLOCATION_FUNCTION_ATTRIBUTE void *calloc(size_t nmemb, size_t size) { GET_STACK_TRACE_MALLOC; return asan_calloc(nmemb, size, &stack); } ALLOCATION_FUNCTION_ATTRIBUTE void *_calloc_base(size_t nmemb, size_t size) { return calloc(nmemb, size); } ALLOCATION_FUNCTION_ATTRIBUTE void *_calloc_dbg(size_t nmemb, size_t size, int, const char *, int) { return calloc(nmemb, size); } ALLOCATION_FUNCTION_ATTRIBUTE void *_calloc_impl(size_t nmemb, size_t size, int *errno_tmp) { return calloc(nmemb, size); } ALLOCATION_FUNCTION_ATTRIBUTE void *realloc(void *ptr, size_t size) { GET_STACK_TRACE_MALLOC; return asan_realloc(ptr, size, &stack); } ALLOCATION_FUNCTION_ATTRIBUTE void *_realloc_dbg(void *ptr, size_t size, int) { CHECK(!"_realloc_dbg should not exist!"); return 0; } ALLOCATION_FUNCTION_ATTRIBUTE void *_realloc_base(void *ptr, size_t size) { return realloc(ptr, size); } ALLOCATION_FUNCTION_ATTRIBUTE void *_recalloc(void *p, size_t n, size_t elem_size) { if (!p) return calloc(n, elem_size); const size_t size = n * elem_size; if (elem_size != 0 && size / elem_size != n) return 0; return realloc(p, size); } ALLOCATION_FUNCTION_ATTRIBUTE void *_recalloc_base(void *p, size_t n, size_t elem_size) { return _recalloc(p, n, elem_size); } ALLOCATION_FUNCTION_ATTRIBUTE size_t _msize(const void *ptr) { GET_CURRENT_PC_BP_SP; (void)sp; return asan_malloc_usable_size(ptr, pc, bp); } ALLOCATION_FUNCTION_ATTRIBUTE void *_expand(void *memblock, size_t size) { // _expand is used in realloc-like functions to resize the buffer if possible. // We don't want memory to stand still while resizing buffers, so return 0. return 0; } ALLOCATION_FUNCTION_ATTRIBUTE void *_expand_dbg(void *memblock, size_t size) { return _expand(memblock, size); } // TODO(timurrrr): Might want to add support for _aligned_* allocation // functions to detect a bit more bugs. Those functions seem to wrap malloc(). int _CrtDbgReport(int, const char*, int, const char*, const char*, ...) { ShowStatsAndAbort(); } int _CrtDbgReportW(int reportType, const wchar_t*, int, const wchar_t*, const wchar_t*, ...) { ShowStatsAndAbort(); } int _CrtSetReportMode(int, int) { return 0; } } // extern "C" INTERCEPTOR_WINAPI(LPVOID, HeapAlloc, HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes) { GET_STACK_TRACE_MALLOC; void *p = asan_malloc(dwBytes, &stack); // Reading MSDN suggests that the *entire* usable allocation is zeroed out. // Otherwise it is difficult to HeapReAlloc with HEAP_ZERO_MEMORY. // https://blogs.msdn.microsoft.com/oldnewthing/20120316-00/?p=8083 if (dwFlags == HEAP_ZERO_MEMORY) internal_memset(p, 0, asan_mz_size(p)); else CHECK(dwFlags == 0 && "unsupported heap flags"); return p; } INTERCEPTOR_WINAPI(BOOL, HeapFree, HANDLE hHeap, DWORD dwFlags, LPVOID lpMem) { CHECK(dwFlags == 0 && "unsupported heap flags"); GET_STACK_TRACE_FREE; asan_free(lpMem, &stack, FROM_MALLOC); return true; } INTERCEPTOR_WINAPI(LPVOID, HeapReAlloc, HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes) { GET_STACK_TRACE_MALLOC; // Realloc should never reallocate in place. if (dwFlags & HEAP_REALLOC_IN_PLACE_ONLY) return nullptr; CHECK(dwFlags == 0 && "unsupported heap flags"); return asan_realloc(lpMem, dwBytes, &stack); } INTERCEPTOR_WINAPI(SIZE_T, HeapSize, HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem) { CHECK(dwFlags == 0 && "unsupported heap flags"); GET_CURRENT_PC_BP_SP; (void)sp; return asan_malloc_usable_size(lpMem, pc, bp); } namespace __asan { static void TryToOverrideFunction(const char *fname, uptr new_func) { // Failure here is not fatal. The CRT may not be present, and different CRT // versions use different symbols. if (!__interception::OverrideFunction(fname, new_func)) VPrintf(2, "Failed to override function %s\n", fname); } void ReplaceSystemMalloc() { #if defined(ASAN_DYNAMIC) TryToOverrideFunction("free", (uptr)free); TryToOverrideFunction("_free_base", (uptr)free); TryToOverrideFunction("malloc", (uptr)malloc); TryToOverrideFunction("_malloc_base", (uptr)malloc); TryToOverrideFunction("_malloc_crt", (uptr)malloc); TryToOverrideFunction("calloc", (uptr)calloc); TryToOverrideFunction("_calloc_base", (uptr)calloc); TryToOverrideFunction("_calloc_crt", (uptr)calloc); TryToOverrideFunction("realloc", (uptr)realloc); TryToOverrideFunction("_realloc_base", (uptr)realloc); TryToOverrideFunction("_realloc_crt", (uptr)realloc); TryToOverrideFunction("_recalloc", (uptr)_recalloc); TryToOverrideFunction("_recalloc_base", (uptr)_recalloc); TryToOverrideFunction("_recalloc_crt", (uptr)_recalloc); TryToOverrideFunction("_msize", (uptr)_msize); TryToOverrideFunction("_expand", (uptr)_expand); TryToOverrideFunction("_expand_base", (uptr)_expand); // Recent versions of ucrtbase.dll appear to be built with PGO and LTCG, which // enable cross-module inlining. This means our _malloc_base hook won't catch // all CRT allocations. This code here patches the import table of // ucrtbase.dll so that all attempts to use the lower-level win32 heap // allocation API will be directed to ASan's heap. We don't currently // intercept all calls to HeapAlloc. If we did, we would have to check on // HeapFree whether the pointer came from ASan of from the system. #define INTERCEPT_UCRT_FUNCTION(func) \ if (!INTERCEPT_FUNCTION_DLLIMPORT("ucrtbase.dll", \ "api-ms-win-core-heap-l1-1-0.dll", func)) \ VPrintf(2, "Failed to intercept ucrtbase.dll import %s\n", #func); INTERCEPT_UCRT_FUNCTION(HeapAlloc); INTERCEPT_UCRT_FUNCTION(HeapFree); INTERCEPT_UCRT_FUNCTION(HeapReAlloc); INTERCEPT_UCRT_FUNCTION(HeapSize); #undef INTERCEPT_UCRT_FUNCTION #endif } } // namespace __asan #endif // _WIN32 golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_blacklist.txt0000664000175000017500000000100112332442727026402 0ustar mwhudsonmwhudson# Blacklist for AddressSanitizer. Turns off instrumentation of particular # functions or sources. Use with care. You may set location of blacklist # at compile-time using -fsanitize-blacklist= flag. # Example usage: # fun:*bad_function_name* # src:file_with_tricky_code.cc # global:*global_with_bad_access_or_initialization* # global:*global_with_initialization_issues*=init # type:*Namespace::ClassName*=init # Stack buffer overflow in VC/INCLUDE/xlocnum, see http://goo.gl/L4qqUG fun:*_Find_elem@*@std* golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_stats.cc0000664000175000017500000001314612543322552025350 0ustar mwhudsonmwhudson//===-- asan_stats.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Code related to statistics collected by AddressSanitizer. //===----------------------------------------------------------------------===// #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_stats.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_allocator_interface.h" #include "sanitizer_common/sanitizer_mutex.h" #include "sanitizer_common/sanitizer_stackdepot.h" namespace __asan { AsanStats::AsanStats() { Clear(); } void AsanStats::Clear() { CHECK(REAL(memset)); REAL(memset)(this, 0, sizeof(AsanStats)); } static void PrintMallocStatsArray(const char *prefix, uptr (&array)[kNumberOfSizeClasses]) { Printf("%s", prefix); for (uptr i = 0; i < kNumberOfSizeClasses; i++) { if (!array[i]) continue; Printf("%zu:%zu; ", i, array[i]); } Printf("\n"); } void AsanStats::Print() { Printf("Stats: %zuM malloced (%zuM for red zones) by %zu calls\n", malloced>>20, malloced_redzones>>20, mallocs); Printf("Stats: %zuM realloced by %zu calls\n", realloced>>20, reallocs); Printf("Stats: %zuM freed by %zu calls\n", freed>>20, frees); Printf("Stats: %zuM really freed by %zu calls\n", really_freed>>20, real_frees); Printf("Stats: %zuM (%zuM-%zuM) mmaped; %zu maps, %zu unmaps\n", (mmaped-munmaped)>>20, mmaped>>20, munmaped>>20, mmaps, munmaps); PrintMallocStatsArray(" mallocs by size class: ", malloced_by_size); Printf("Stats: malloc large: %zu\n", malloc_large); } void AsanStats::MergeFrom(const AsanStats *stats) { uptr *dst_ptr = reinterpret_cast(this); const uptr *src_ptr = reinterpret_cast(stats); uptr num_fields = sizeof(*this) / sizeof(uptr); for (uptr i = 0; i < num_fields; i++) dst_ptr[i] += src_ptr[i]; } static BlockingMutex print_lock(LINKER_INITIALIZED); static AsanStats unknown_thread_stats(LINKER_INITIALIZED); static AsanStats dead_threads_stats(LINKER_INITIALIZED); static BlockingMutex dead_threads_stats_lock(LINKER_INITIALIZED); // Required for malloc_zone_statistics() on OS X. This can't be stored in // per-thread AsanStats. static uptr max_malloced_memory; static void MergeThreadStats(ThreadContextBase *tctx_base, void *arg) { AsanStats *accumulated_stats = reinterpret_cast(arg); AsanThreadContext *tctx = static_cast(tctx_base); if (AsanThread *t = tctx->thread) accumulated_stats->MergeFrom(&t->stats()); } static void GetAccumulatedStats(AsanStats *stats) { stats->Clear(); { ThreadRegistryLock l(&asanThreadRegistry()); asanThreadRegistry() .RunCallbackForEachThreadLocked(MergeThreadStats, stats); } stats->MergeFrom(&unknown_thread_stats); { BlockingMutexLock lock(&dead_threads_stats_lock); stats->MergeFrom(&dead_threads_stats); } // This is not very accurate: we may miss allocation peaks that happen // between two updates of accumulated_stats_. For more accurate bookkeeping // the maximum should be updated on every malloc(), which is unacceptable. if (max_malloced_memory < stats->malloced) { max_malloced_memory = stats->malloced; } } void FlushToDeadThreadStats(AsanStats *stats) { BlockingMutexLock lock(&dead_threads_stats_lock); dead_threads_stats.MergeFrom(stats); stats->Clear(); } void FillMallocStatistics(AsanMallocStats *malloc_stats) { AsanStats stats; GetAccumulatedStats(&stats); malloc_stats->blocks_in_use = stats.mallocs; malloc_stats->size_in_use = stats.malloced; malloc_stats->max_size_in_use = max_malloced_memory; malloc_stats->size_allocated = stats.mmaped; } AsanStats &GetCurrentThreadStats() { AsanThread *t = GetCurrentThread(); return (t) ? t->stats() : unknown_thread_stats; } static void PrintAccumulatedStats() { AsanStats stats; GetAccumulatedStats(&stats); // Use lock to keep reports from mixing up. BlockingMutexLock lock(&print_lock); stats.Print(); StackDepotStats *stack_depot_stats = StackDepotGetStats(); Printf("Stats: StackDepot: %zd ids; %zdM allocated\n", stack_depot_stats->n_uniq_ids, stack_depot_stats->allocated >> 20); PrintInternalAllocatorStats(); } } // namespace __asan // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT uptr __sanitizer_get_current_allocated_bytes() { AsanStats stats; GetAccumulatedStats(&stats); uptr malloced = stats.malloced; uptr freed = stats.freed; // Return sane value if malloced < freed due to racy // way we update accumulated stats. return (malloced > freed) ? malloced - freed : 1; } uptr __sanitizer_get_heap_size() { AsanStats stats; GetAccumulatedStats(&stats); return stats.mmaped - stats.munmaped; } uptr __sanitizer_get_free_bytes() { AsanStats stats; GetAccumulatedStats(&stats); uptr total_free = stats.mmaped - stats.munmaped + stats.really_freed; uptr total_used = stats.malloced + stats.malloced_redzones; // Return sane value if total_free < total_used due to racy // way we update accumulated stats. return (total_free > total_used) ? total_free - total_used : 1; } uptr __sanitizer_get_unmapped_bytes() { return 0; } void __asan_print_accumulated_stats() { PrintAccumulatedStats(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_mac.cc0000664000175000017500000002416112741011153024741 0ustar mwhudsonmwhudson//===-- asan_mac.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Mac-specific details. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_mapping.h" #include "asan_stack.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_mac.h" #include #include #include #include #include #include #include #include // for free() #include #include #include #include #include // from , but we don't have that file on iOS extern "C" { extern char ***_NSGetArgv(void); extern char ***_NSGetEnviron(void); } namespace __asan { void InitializePlatformInterceptors() {} void InitializePlatformExceptionHandlers() {} bool PlatformHasDifferentMemcpyAndMemmove() { // On OS X 10.7 memcpy() and memmove() are both resolved // into memmove$VARIANT$sse42. // See also https://github.com/google/sanitizers/issues/34. // TODO(glider): need to check dynamically that memcpy() and memmove() are // actually the same function. return GetMacosVersion() == MACOS_VERSION_SNOW_LEOPARD; } // No-op. Mac does not support static linkage anyway. void *AsanDoesNotSupportStaticLinkage() { return 0; } // No-op. Mac does not support static linkage anyway. void AsanCheckDynamicRTPrereqs() {} // No-op. Mac does not support static linkage anyway. void AsanCheckIncompatibleRT() {} void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { // Find the Mach-O header for the image containing the needle Dl_info info; int err = dladdr(needle, &info); if (err == 0) return; #if __LP64__ const struct mach_header_64 *mh = (struct mach_header_64 *)info.dli_fbase; #else const struct mach_header *mh = (struct mach_header *)info.dli_fbase; #endif // Look up the __asan_globals section in that image and register its globals unsigned long size = 0; __asan_global *globals = (__asan_global *)getsectiondata( mh, "__DATA", "__asan_globals", &size); if (!globals) return; if (size % sizeof(__asan_global) != 0) return; op(globals, size / sizeof(__asan_global)); } void ReadContextStack(void *context, uptr *stack, uptr *ssize) { UNIMPLEMENTED(); } // Support for the following functions from libdispatch on Mac OS: // dispatch_async_f() // dispatch_async() // dispatch_sync_f() // dispatch_sync() // dispatch_after_f() // dispatch_after() // dispatch_group_async_f() // dispatch_group_async() // TODO(glider): libdispatch API contains other functions that we don't support // yet. // // dispatch_sync() and dispatch_sync_f() are synchronous, although chances are // they can cause jobs to run on a thread different from the current one. // TODO(glider): if so, we need a test for this (otherwise we should remove // them). // // The following functions use dispatch_barrier_async_f() (which isn't a library // function but is exported) and are thus supported: // dispatch_source_set_cancel_handler_f() // dispatch_source_set_cancel_handler() // dispatch_source_set_event_handler_f() // dispatch_source_set_event_handler() // // The reference manual for Grand Central Dispatch is available at // http://developer.apple.com/library/mac/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html // The implementation details are at // http://libdispatch.macosforge.org/trac/browser/trunk/src/queue.c typedef void* dispatch_group_t; typedef void* dispatch_queue_t; typedef void* dispatch_source_t; typedef u64 dispatch_time_t; typedef void (*dispatch_function_t)(void *block); typedef void* (*worker_t)(void *block); // A wrapper for the ObjC blocks used to support libdispatch. typedef struct { void *block; dispatch_function_t func; u32 parent_tid; } asan_block_context_t; ALWAYS_INLINE void asan_register_worker_thread(int parent_tid, StackTrace *stack) { AsanThread *t = GetCurrentThread(); if (!t) { t = AsanThread::Create(/* start_routine */ nullptr, /* arg */ nullptr, parent_tid, stack, /* detached */ true); t->Init(); asanThreadRegistry().StartThread(t->tid(), 0, 0); SetCurrentThread(t); } } // For use by only those functions that allocated the context via // alloc_asan_context(). extern "C" void asan_dispatch_call_block_and_release(void *block) { GET_STACK_TRACE_THREAD; asan_block_context_t *context = (asan_block_context_t*)block; VReport(2, "asan_dispatch_call_block_and_release(): " "context: %p, pthread_self: %p\n", block, pthread_self()); asan_register_worker_thread(context->parent_tid, &stack); // Call the original dispatcher for the block. context->func(context->block); asan_free(context, &stack, FROM_MALLOC); } } // namespace __asan using namespace __asan; // NOLINT // Wrap |ctxt| and |func| into an asan_block_context_t. // The caller retains control of the allocated context. extern "C" asan_block_context_t *alloc_asan_context(void *ctxt, dispatch_function_t func, BufferedStackTrace *stack) { asan_block_context_t *asan_ctxt = (asan_block_context_t*) asan_malloc(sizeof(asan_block_context_t), stack); asan_ctxt->block = ctxt; asan_ctxt->func = func; asan_ctxt->parent_tid = GetCurrentTidOrInvalid(); return asan_ctxt; } // Define interceptor for dispatch_*_f function with the three most common // parameters: dispatch_queue_t, context, dispatch_function_t. #define INTERCEPT_DISPATCH_X_F_3(dispatch_x_f) \ INTERCEPTOR(void, dispatch_x_f, dispatch_queue_t dq, void *ctxt, \ dispatch_function_t func) { \ GET_STACK_TRACE_THREAD; \ asan_block_context_t *asan_ctxt = alloc_asan_context(ctxt, func, &stack); \ if (Verbosity() >= 2) { \ Report(#dispatch_x_f "(): context: %p, pthread_self: %p\n", \ asan_ctxt, pthread_self()); \ PRINT_CURRENT_STACK(); \ } \ return REAL(dispatch_x_f)(dq, (void*)asan_ctxt, \ asan_dispatch_call_block_and_release); \ } INTERCEPT_DISPATCH_X_F_3(dispatch_async_f) INTERCEPT_DISPATCH_X_F_3(dispatch_sync_f) INTERCEPT_DISPATCH_X_F_3(dispatch_barrier_async_f) INTERCEPTOR(void, dispatch_after_f, dispatch_time_t when, dispatch_queue_t dq, void *ctxt, dispatch_function_t func) { GET_STACK_TRACE_THREAD; asan_block_context_t *asan_ctxt = alloc_asan_context(ctxt, func, &stack); if (Verbosity() >= 2) { Report("dispatch_after_f: %p\n", asan_ctxt); PRINT_CURRENT_STACK(); } return REAL(dispatch_after_f)(when, dq, (void*)asan_ctxt, asan_dispatch_call_block_and_release); } INTERCEPTOR(void, dispatch_group_async_f, dispatch_group_t group, dispatch_queue_t dq, void *ctxt, dispatch_function_t func) { GET_STACK_TRACE_THREAD; asan_block_context_t *asan_ctxt = alloc_asan_context(ctxt, func, &stack); if (Verbosity() >= 2) { Report("dispatch_group_async_f(): context: %p, pthread_self: %p\n", asan_ctxt, pthread_self()); PRINT_CURRENT_STACK(); } REAL(dispatch_group_async_f)(group, dq, (void*)asan_ctxt, asan_dispatch_call_block_and_release); } #if !defined(MISSING_BLOCKS_SUPPORT) extern "C" { void dispatch_async(dispatch_queue_t dq, void(^work)(void)); void dispatch_group_async(dispatch_group_t dg, dispatch_queue_t dq, void(^work)(void)); void dispatch_after(dispatch_time_t when, dispatch_queue_t queue, void(^work)(void)); void dispatch_source_set_cancel_handler(dispatch_source_t ds, void(^work)(void)); void dispatch_source_set_event_handler(dispatch_source_t ds, void(^work)(void)); } #define GET_ASAN_BLOCK(work) \ void (^asan_block)(void); \ int parent_tid = GetCurrentTidOrInvalid(); \ asan_block = ^(void) { \ GET_STACK_TRACE_THREAD; \ asan_register_worker_thread(parent_tid, &stack); \ work(); \ } INTERCEPTOR(void, dispatch_async, dispatch_queue_t dq, void(^work)(void)) { ENABLE_FRAME_POINTER; GET_ASAN_BLOCK(work); REAL(dispatch_async)(dq, asan_block); } INTERCEPTOR(void, dispatch_group_async, dispatch_group_t dg, dispatch_queue_t dq, void(^work)(void)) { ENABLE_FRAME_POINTER; GET_ASAN_BLOCK(work); REAL(dispatch_group_async)(dg, dq, asan_block); } INTERCEPTOR(void, dispatch_after, dispatch_time_t when, dispatch_queue_t queue, void(^work)(void)) { ENABLE_FRAME_POINTER; GET_ASAN_BLOCK(work); REAL(dispatch_after)(when, queue, asan_block); } INTERCEPTOR(void, dispatch_source_set_cancel_handler, dispatch_source_t ds, void(^work)(void)) { if (!work) { REAL(dispatch_source_set_cancel_handler)(ds, work); return; } ENABLE_FRAME_POINTER; GET_ASAN_BLOCK(work); REAL(dispatch_source_set_cancel_handler)(ds, asan_block); } INTERCEPTOR(void, dispatch_source_set_event_handler, dispatch_source_t ds, void(^work)(void)) { ENABLE_FRAME_POINTER; GET_ASAN_BLOCK(work); REAL(dispatch_source_set_event_handler)(ds, asan_block); } #endif #endif // SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_suppressions.h0000664000175000017500000000175312473216010026623 0ustar mwhudsonmwhudson//===-- asan_suppressions.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_suppressions.cc. //===----------------------------------------------------------------------===// #ifndef ASAN_SUPPRESSIONS_H #define ASAN_SUPPRESSIONS_H #include "asan_internal.h" #include "sanitizer_common/sanitizer_stacktrace.h" namespace __asan { void InitializeSuppressions(); bool IsInterceptorSuppressed(const char *interceptor_name); bool HaveStackTraceBasedSuppressions(); bool IsStackTraceSuppressed(const StackTrace *stack); bool IsODRViolationSuppressed(const char *global_var_name); } // namespace __asan #endif // ASAN_SUPPRESSIONS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_interface_internal.h0000664000175000017500000002466012773522466027726 0ustar mwhudsonmwhudson//===-- asan_interface_internal.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This header declares the AddressSanitizer runtime interface functions. // The runtime library has to define these functions so the instrumented program // could call them. // // See also include/sanitizer/asan_interface.h //===----------------------------------------------------------------------===// #ifndef ASAN_INTERFACE_INTERNAL_H #define ASAN_INTERFACE_INTERNAL_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "asan_init_version.h" using __sanitizer::uptr; using __sanitizer::u64; using __sanitizer::u32; extern "C" { // This function should be called at the very beginning of the process, // before any instrumented code is executed and before any call to malloc. SANITIZER_INTERFACE_ATTRIBUTE void __asan_init(); // This function exists purely to get a linker/loader error when using // incompatible versions of instrumentation and runtime library. Please note // that __asan_version_mismatch_check is a macro that is replaced with // __asan_version_mismatch_check_vXXX at compile-time. SANITIZER_INTERFACE_ATTRIBUTE void __asan_version_mismatch_check(); // This structure is used to describe the source location of a place where // global was defined. struct __asan_global_source_location { const char *filename; int line_no; int column_no; }; // This structure describes an instrumented global variable. struct __asan_global { uptr beg; // The address of the global. uptr size; // The original size of the global. uptr size_with_redzone; // The size with the redzone. const char *name; // Name as a C string. const char *module_name; // Module name as a C string. This pointer is a // unique identifier of a module. uptr has_dynamic_init; // Non-zero if the global has dynamic initializer. __asan_global_source_location *location; // Source location of a global, // or NULL if it is unknown. uptr odr_indicator; // The address of the ODR indicator symbol. }; // These functions can be called on some platforms to find globals in the same // loaded image as `flag' and apply __asan_(un)register_globals to them, // filtering out redundant calls. SANITIZER_INTERFACE_ATTRIBUTE void __asan_register_image_globals(uptr *flag); SANITIZER_INTERFACE_ATTRIBUTE void __asan_unregister_image_globals(uptr *flag); // These two functions should be called by the instrumented code. // 'globals' is an array of structures describing 'n' globals. SANITIZER_INTERFACE_ATTRIBUTE void __asan_register_globals(__asan_global *globals, uptr n); SANITIZER_INTERFACE_ATTRIBUTE void __asan_unregister_globals(__asan_global *globals, uptr n); // These two functions should be called before and after dynamic initializers // of a single module run, respectively. SANITIZER_INTERFACE_ATTRIBUTE void __asan_before_dynamic_init(const char *module_name); SANITIZER_INTERFACE_ATTRIBUTE void __asan_after_dynamic_init(); // Sets bytes of the given range of the shadow memory into specific value. SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_shadow_00(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_shadow_f1(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_shadow_f2(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_shadow_f3(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_shadow_f5(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_shadow_f8(uptr addr, uptr size); // These two functions are used by instrumented code in the // use-after-scope mode. They mark memory for local variables as // unaddressable when they leave scope and addressable before the // function exits. SANITIZER_INTERFACE_ATTRIBUTE void __asan_poison_stack_memory(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_unpoison_stack_memory(uptr addr, uptr size); // Performs cleanup before a NoReturn function. Must be called before things // like _exit and execl to avoid false positives on stack. SANITIZER_INTERFACE_ATTRIBUTE void __asan_handle_no_return(); SANITIZER_INTERFACE_ATTRIBUTE void __asan_poison_memory_region(void const volatile *addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_unpoison_memory_region(void const volatile *addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE int __asan_address_is_poisoned(void const volatile *addr); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_region_is_poisoned(uptr beg, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_describe_address(uptr addr); SANITIZER_INTERFACE_ATTRIBUTE int __asan_report_present(); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_report_pc(); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_report_bp(); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_report_sp(); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_report_address(); SANITIZER_INTERFACE_ATTRIBUTE int __asan_get_report_access_type(); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_report_access_size(); SANITIZER_INTERFACE_ATTRIBUTE const char * __asan_get_report_description(); SANITIZER_INTERFACE_ATTRIBUTE const char * __asan_locate_address(uptr addr, char *name, uptr name_size, uptr *region_address, uptr *region_size); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_alloc_stack(uptr addr, uptr *trace, uptr size, u32 *thread_id); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_get_free_stack(uptr addr, uptr *trace, uptr size, u32 *thread_id); SANITIZER_INTERFACE_ATTRIBUTE void __asan_get_shadow_mapping(uptr *shadow_scale, uptr *shadow_offset); SANITIZER_INTERFACE_ATTRIBUTE void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, int is_write, uptr access_size, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_death_callback(void (*callback)(void)); SANITIZER_INTERFACE_ATTRIBUTE void __asan_set_error_report_callback(void (*callback)(const char*)); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE /* OPTIONAL */ void __asan_on_error(); SANITIZER_INTERFACE_ATTRIBUTE void __asan_print_accumulated_stats(); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE /* OPTIONAL */ const char* __asan_default_options(); SANITIZER_INTERFACE_ATTRIBUTE extern uptr __asan_shadow_memory_dynamic_address; // Global flag, copy of ASAN_OPTIONS=detect_stack_use_after_return SANITIZER_INTERFACE_ATTRIBUTE extern int __asan_option_detect_stack_use_after_return; SANITIZER_INTERFACE_ATTRIBUTE extern uptr *__asan_test_only_reported_buggy_pointer; SANITIZER_INTERFACE_ATTRIBUTE void __asan_load1(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load2(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load4(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load8(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load16(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store1(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store2(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store4(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store8(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store16(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_loadN(uptr p, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_storeN(uptr p, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load1_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load2_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load4_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load8_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_load16_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store1_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store2_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store4_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store8_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_store16_noabort(uptr p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_loadN_noabort(uptr p, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_storeN_noabort(uptr p, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load1(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load2(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load4(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load8(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load16(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store1(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store2(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store4(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store8(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store16(uptr p, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_loadN(uptr p, uptr size, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_storeN(uptr p, uptr size, u32 exp); SANITIZER_INTERFACE_ATTRIBUTE void* __asan_memcpy(void *dst, const void *src, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void* __asan_memset(void *s, int c, uptr n); SANITIZER_INTERFACE_ATTRIBUTE void* __asan_memmove(void* dest, const void* src, uptr n); SANITIZER_INTERFACE_ATTRIBUTE void __asan_poison_cxx_array_cookie(uptr p); SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_load_cxx_array_cookie(uptr *p); SANITIZER_INTERFACE_ATTRIBUTE void __asan_poison_intra_object_redzone(uptr p, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_unpoison_intra_object_redzone(uptr p, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_alloca_poison(uptr addr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __asan_allocas_unpoison(uptr top, uptr bottom); } // extern "C" #endif // ASAN_INTERFACE_INTERNAL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_linux.cc0000664000175000017500000001176112741011153025342 0ustar mwhudsonmwhudson//===-- asan_linux.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Linux-specific details. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_freebsd.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_procmaps.h" #include #include #include #include #include #include #include #include #include #include #include #if SANITIZER_FREEBSD #include #endif #if SANITIZER_ANDROID || SANITIZER_FREEBSD #include extern "C" void* _DYNAMIC; #else #include #include #endif // x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in // 32-bit mode. #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \ __FreeBSD_version <= 902001 // v9.2 #define ucontext_t xucontext_t #endif typedef enum { ASAN_RT_VERSION_UNDEFINED = 0, ASAN_RT_VERSION_DYNAMIC, ASAN_RT_VERSION_STATIC, } asan_rt_version_t; // FIXME: perhaps also store abi version here? extern "C" { SANITIZER_INTERFACE_ATTRIBUTE asan_rt_version_t __asan_rt_version; } namespace __asan { void InitializePlatformInterceptors() {} void InitializePlatformExceptionHandlers() {} void *AsanDoesNotSupportStaticLinkage() { // This will fail to link with -static. return &_DYNAMIC; // defined in link.h } void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { UNIMPLEMENTED(); } #if SANITIZER_ANDROID // FIXME: should we do anything for Android? void AsanCheckDynamicRTPrereqs() {} void AsanCheckIncompatibleRT() {} #else static int FindFirstDSOCallback(struct dl_phdr_info *info, size_t size, void *data) { // Continue until the first dynamic library is found if (!info->dlpi_name || info->dlpi_name[0] == 0) return 0; // Ignore vDSO if (internal_strncmp(info->dlpi_name, "linux-", sizeof("linux-") - 1) == 0) return 0; *(const char **)data = info->dlpi_name; return 1; } static bool IsDynamicRTName(const char *libname) { return internal_strstr(libname, "libclang_rt.asan") || internal_strstr(libname, "libasan.so"); } static void ReportIncompatibleRT() { Report("Your application is linked against incompatible ASan runtimes.\n"); Die(); } void AsanCheckDynamicRTPrereqs() { if (!ASAN_DYNAMIC) return; // Ensure that dynamic RT is the first DSO in the list const char *first_dso_name = nullptr; dl_iterate_phdr(FindFirstDSOCallback, &first_dso_name); if (first_dso_name && !IsDynamicRTName(first_dso_name)) { Report("ASan runtime does not come first in initial library list; " "you should either link runtime to your application or " "manually preload it with LD_PRELOAD.\n"); Die(); } } void AsanCheckIncompatibleRT() { if (ASAN_DYNAMIC) { if (__asan_rt_version == ASAN_RT_VERSION_UNDEFINED) { __asan_rt_version = ASAN_RT_VERSION_DYNAMIC; } else if (__asan_rt_version != ASAN_RT_VERSION_DYNAMIC) { ReportIncompatibleRT(); } } else { if (__asan_rt_version == ASAN_RT_VERSION_UNDEFINED) { // Ensure that dynamic runtime is not present. We should detect it // as early as possible, otherwise ASan interceptors could bind to // the functions in dynamic ASan runtime instead of the functions in // system libraries, causing crashes later in ASan initialization. MemoryMappingLayout proc_maps(/*cache_enabled*/true); char filename[128]; while (proc_maps.Next(nullptr, nullptr, nullptr, filename, sizeof(filename), nullptr)) { if (IsDynamicRTName(filename)) { Report("Your application is linked against " "incompatible ASan runtimes.\n"); Die(); } } __asan_rt_version = ASAN_RT_VERSION_STATIC; } else if (__asan_rt_version != ASAN_RT_VERSION_STATIC) { ReportIncompatibleRT(); } } } #endif // SANITIZER_ANDROID #if !SANITIZER_ANDROID void ReadContextStack(void *context, uptr *stack, uptr *ssize) { ucontext_t *ucp = (ucontext_t*)context; *stack = (uptr)ucp->uc_stack.ss_sp; *ssize = ucp->uc_stack.ss_size; } #else void ReadContextStack(void *context, uptr *stack, uptr *ssize) { UNIMPLEMENTED(); } #endif void *AsanDlSymNext(const char *sym) { return dlsym(RTLD_NEXT, sym); } } // namespace __asan #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_scariness_score.h0000664000175000017500000000434012761336637027250 0ustar mwhudsonmwhudson//===-- asan_scariness_score.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Compute the level of scariness of the error message. // Don't expect any deep science here, just a set of heuristics that suggest // that e.g. 1-byte-read-global-buffer-overflow is less scary than // 8-byte-write-stack-use-after-return. // // Every error report has one or more features, such as memory access size, // type (read or write), type of accessed memory (e.g. free-d heap, or a global // redzone), etc. Every such feature has an int score and a string description. // The overall score is the sum of all feature scores and the description // is a concatenation of feature descriptions. // Examples: // 17 (4-byte-read-heap-buffer-overflow) // 65 (multi-byte-write-stack-use-after-return) // 10 (null-deref) // //===----------------------------------------------------------------------===// #ifndef ASAN_SCARINESS_SCORE_H #define ASAN_SCARINESS_SCORE_H #include "asan_flags.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" namespace __asan { struct ScarinessScoreBase { void Clear() { descr[0] = 0; score = 0; } void Scare(int add_to_score, const char *reason) { if (descr[0]) internal_strlcat(descr, "-", sizeof(descr)); internal_strlcat(descr, reason, sizeof(descr)); score += add_to_score; }; int GetScore() const { return score; } const char *GetDescription() const { return descr; } void Print() { if (score && flags()->print_scariness) Printf("SCARINESS: %d (%s)\n", score, descr); } static void PrintSimple(int score, const char *descr) { ScarinessScoreBase SSB; SSB.Clear(); SSB.Scare(score, descr); SSB.Print(); } private: int score; char descr[1024]; }; struct ScarinessScore : ScarinessScoreBase { ScarinessScore() { Clear(); } }; } // namespace __asan #endif // ASAN_SCARINESS_SCORE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_lock.h0000664000175000017500000000000012074734413024767 0ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_fake_stack.cc0000664000175000017500000002537712751157644026327 0ustar mwhudsonmwhudson//===-- asan_fake_stack.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // FakeStack is used to detect use-after-return bugs. //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_poisoning.h" #include "asan_thread.h" namespace __asan { static const u64 kMagic1 = kAsanStackAfterReturnMagic; static const u64 kMagic2 = (kMagic1 << 8) | kMagic1; static const u64 kMagic4 = (kMagic2 << 16) | kMagic2; static const u64 kMagic8 = (kMagic4 << 32) | kMagic4; static const u64 kAllocaRedzoneSize = 32UL; static const u64 kAllocaRedzoneMask = 31UL; // For small size classes inline PoisonShadow for better performance. ALWAYS_INLINE void SetShadow(uptr ptr, uptr size, uptr class_id, u64 magic) { CHECK_EQ(SHADOW_SCALE, 3); // This code expects SHADOW_SCALE=3. u64 *shadow = reinterpret_cast(MemToShadow(ptr)); if (class_id <= 6) { for (uptr i = 0; i < (((uptr)1) << class_id); i++) { shadow[i] = magic; // Make sure this does not become memset. SanitizerBreakOptimization(nullptr); } } else { // The size class is too big, it's cheaper to poison only size bytes. PoisonShadow(ptr, size, static_cast(magic)); } } FakeStack *FakeStack::Create(uptr stack_size_log) { static uptr kMinStackSizeLog = 16; static uptr kMaxStackSizeLog = FIRST_32_SECOND_64(24, 28); if (stack_size_log < kMinStackSizeLog) stack_size_log = kMinStackSizeLog; if (stack_size_log > kMaxStackSizeLog) stack_size_log = kMaxStackSizeLog; uptr size = RequiredSize(stack_size_log); FakeStack *res = reinterpret_cast( flags()->uar_noreserve ? MmapNoReserveOrDie(size, "FakeStack") : MmapOrDie(size, "FakeStack")); res->stack_size_log_ = stack_size_log; u8 *p = reinterpret_cast(res); VReport(1, "T%d: FakeStack created: %p -- %p stack_size_log: %zd; " "mmapped %zdK, noreserve=%d \n", GetCurrentTidOrInvalid(), p, p + FakeStack::RequiredSize(stack_size_log), stack_size_log, size >> 10, flags()->uar_noreserve); return res; } void FakeStack::Destroy(int tid) { PoisonAll(0); if (Verbosity() >= 2) { InternalScopedString str(kNumberOfSizeClasses * 50); for (uptr class_id = 0; class_id < kNumberOfSizeClasses; class_id++) str.append("%zd: %zd/%zd; ", class_id, hint_position_[class_id], NumberOfFrames(stack_size_log(), class_id)); Report("T%d: FakeStack destroyed: %s\n", tid, str.data()); } uptr size = RequiredSize(stack_size_log_); FlushUnneededASanShadowMemory(reinterpret_cast(this), size); UnmapOrDie(this, size); } void FakeStack::PoisonAll(u8 magic) { PoisonShadow(reinterpret_cast(this), RequiredSize(stack_size_log()), magic); } #if !defined(_MSC_VER) || defined(__clang__) ALWAYS_INLINE USED #endif FakeFrame *FakeStack::Allocate(uptr stack_size_log, uptr class_id, uptr real_stack) { CHECK_LT(class_id, kNumberOfSizeClasses); if (needs_gc_) GC(real_stack); uptr &hint_position = hint_position_[class_id]; const int num_iter = NumberOfFrames(stack_size_log, class_id); u8 *flags = GetFlags(stack_size_log, class_id); for (int i = 0; i < num_iter; i++) { uptr pos = ModuloNumberOfFrames(stack_size_log, class_id, hint_position++); // This part is tricky. On one hand, checking and setting flags[pos] // should be atomic to ensure async-signal safety. But on the other hand, // if the signal arrives between checking and setting flags[pos], the // signal handler's fake stack will start from a different hint_position // and so will not touch this particular byte. So, it is safe to do this // with regular non-atomic load and store (at least I was not able to make // this code crash). if (flags[pos]) continue; flags[pos] = 1; FakeFrame *res = reinterpret_cast( GetFrame(stack_size_log, class_id, pos)); res->real_stack = real_stack; *SavedFlagPtr(reinterpret_cast(res), class_id) = &flags[pos]; return res; } return nullptr; // We are out of fake stack. } uptr FakeStack::AddrIsInFakeStack(uptr ptr, uptr *frame_beg, uptr *frame_end) { uptr stack_size_log = this->stack_size_log(); uptr beg = reinterpret_cast(GetFrame(stack_size_log, 0, 0)); uptr end = reinterpret_cast(this) + RequiredSize(stack_size_log); if (ptr < beg || ptr >= end) return 0; uptr class_id = (ptr - beg) >> stack_size_log; uptr base = beg + (class_id << stack_size_log); CHECK_LE(base, ptr); CHECK_LT(ptr, base + (((uptr)1) << stack_size_log)); uptr pos = (ptr - base) >> (kMinStackFrameSizeLog + class_id); uptr res = base + pos * BytesInSizeClass(class_id); *frame_end = res + BytesInSizeClass(class_id); *frame_beg = res + sizeof(FakeFrame); return res; } void FakeStack::HandleNoReturn() { needs_gc_ = true; } // When throw, longjmp or some such happens we don't call OnFree() and // as the result may leak one or more fake frames, but the good news is that // we are notified about all such events by HandleNoReturn(). // If we recently had such no-return event we need to collect garbage frames. // We do it based on their 'real_stack' values -- everything that is lower // than the current real_stack is garbage. NOINLINE void FakeStack::GC(uptr real_stack) { uptr collected = 0; for (uptr class_id = 0; class_id < kNumberOfSizeClasses; class_id++) { u8 *flags = GetFlags(stack_size_log(), class_id); for (uptr i = 0, n = NumberOfFrames(stack_size_log(), class_id); i < n; i++) { if (flags[i] == 0) continue; // not allocated. FakeFrame *ff = reinterpret_cast( GetFrame(stack_size_log(), class_id, i)); if (ff->real_stack < real_stack) { flags[i] = 0; collected++; } } } needs_gc_ = false; } void FakeStack::ForEachFakeFrame(RangeIteratorCallback callback, void *arg) { for (uptr class_id = 0; class_id < kNumberOfSizeClasses; class_id++) { u8 *flags = GetFlags(stack_size_log(), class_id); for (uptr i = 0, n = NumberOfFrames(stack_size_log(), class_id); i < n; i++) { if (flags[i] == 0) continue; // not allocated. FakeFrame *ff = reinterpret_cast( GetFrame(stack_size_log(), class_id, i)); uptr begin = reinterpret_cast(ff); callback(begin, begin + FakeStack::BytesInSizeClass(class_id), arg); } } } #if SANITIZER_LINUX && !SANITIZER_ANDROID static THREADLOCAL FakeStack *fake_stack_tls; FakeStack *GetTLSFakeStack() { return fake_stack_tls; } void SetTLSFakeStack(FakeStack *fs) { fake_stack_tls = fs; } #else FakeStack *GetTLSFakeStack() { return 0; } void SetTLSFakeStack(FakeStack *fs) { } #endif // SANITIZER_LINUX && !SANITIZER_ANDROID static FakeStack *GetFakeStack() { AsanThread *t = GetCurrentThread(); if (!t) return nullptr; return t->fake_stack(); } static FakeStack *GetFakeStackFast() { if (FakeStack *fs = GetTLSFakeStack()) return fs; if (!__asan_option_detect_stack_use_after_return) return nullptr; return GetFakeStack(); } ALWAYS_INLINE uptr OnMalloc(uptr class_id, uptr size) { FakeStack *fs = GetFakeStackFast(); if (!fs) return 0; uptr local_stack; uptr real_stack = reinterpret_cast(&local_stack); FakeFrame *ff = fs->Allocate(fs->stack_size_log(), class_id, real_stack); if (!ff) return 0; // Out of fake stack. uptr ptr = reinterpret_cast(ff); SetShadow(ptr, size, class_id, 0); return ptr; } ALWAYS_INLINE void OnFree(uptr ptr, uptr class_id, uptr size) { FakeStack::Deallocate(ptr, class_id); SetShadow(ptr, size, class_id, kMagic8); } } // namespace __asan // ---------------------- Interface ---------------- {{{1 using namespace __asan; #define DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(class_id) \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr \ __asan_stack_malloc_##class_id(uptr size) { \ return OnMalloc(class_id, size); \ } \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __asan_stack_free_##class_id( \ uptr ptr, uptr size) { \ OnFree(ptr, class_id, size); \ } DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(0) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(1) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(2) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(3) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(4) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(5) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(6) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(7) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(8) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(9) DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(10) extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void *__asan_get_current_fake_stack() { return GetFakeStackFast(); } SANITIZER_INTERFACE_ATTRIBUTE void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg, void **end) { FakeStack *fs = reinterpret_cast(fake_stack); if (!fs) return nullptr; uptr frame_beg, frame_end; FakeFrame *frame = reinterpret_cast(fs->AddrIsInFakeStack( reinterpret_cast(addr), &frame_beg, &frame_end)); if (!frame) return nullptr; if (frame->magic != kCurrentStackFrameMagic) return nullptr; if (beg) *beg = reinterpret_cast(frame_beg); if (end) *end = reinterpret_cast(frame_end); return reinterpret_cast(frame->real_stack); } SANITIZER_INTERFACE_ATTRIBUTE void __asan_alloca_poison(uptr addr, uptr size) { uptr LeftRedzoneAddr = addr - kAllocaRedzoneSize; uptr PartialRzAddr = addr + size; uptr RightRzAddr = (PartialRzAddr + kAllocaRedzoneMask) & ~kAllocaRedzoneMask; uptr PartialRzAligned = PartialRzAddr & ~(SHADOW_GRANULARITY - 1); FastPoisonShadow(LeftRedzoneAddr, kAllocaRedzoneSize, kAsanAllocaLeftMagic); FastPoisonShadowPartialRightRedzone( PartialRzAligned, PartialRzAddr % SHADOW_GRANULARITY, RightRzAddr - PartialRzAligned, kAsanAllocaRightMagic); FastPoisonShadow(RightRzAddr, kAllocaRedzoneSize, kAsanAllocaRightMagic); } SANITIZER_INTERFACE_ATTRIBUTE void __asan_allocas_unpoison(uptr top, uptr bottom) { if ((!top) || (top > bottom)) return; REAL(memset)(reinterpret_cast(MemToShadow(top)), 0, (bottom - top) / SHADOW_GRANULARITY); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_init_version.h0000664000175000017500000000317012676311741026565 0ustar mwhudsonmwhudson//===-- asan_init_version.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // This header defines a versioned __asan_init function to be called at the // startup of the instrumented program. //===----------------------------------------------------------------------===// #ifndef ASAN_INIT_VERSION_H #define ASAN_INIT_VERSION_H extern "C" { // Every time the ASan ABI changes we also change the version number in the // __asan_init function name. Objects built with incompatible ASan ABI // versions will not link with run-time. // // Changes between ABI versions: // v1=>v2: added 'module_name' to __asan_global // v2=>v3: stack frame description (created by the compiler) // contains the function PC as the 3rd field (see // DescribeAddressIfStack) // v3=>v4: added '__asan_global_source_location' to __asan_global // v4=>v5: changed the semantics and format of __asan_stack_malloc_ and // __asan_stack_free_ functions // v5=>v6: changed the name of the version check symbol // v6=>v7: added 'odr_indicator' to __asan_global // v7=>v8: added '__asan_(un)register_image_globals' functions for dead // stripping support on Mach-O platforms #define __asan_version_mismatch_check __asan_version_mismatch_check_v8 } #endif // ASAN_INIT_VERSION_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_errors.h0000664000175000017500000003134512770565412025377 0ustar mwhudsonmwhudson//===-- asan_errors.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for error structures. //===----------------------------------------------------------------------===// #ifndef ASAN_ERRORS_H #define ASAN_ERRORS_H #include "asan_descriptions.h" #include "asan_scariness_score.h" #include "sanitizer_common/sanitizer_common.h" namespace __asan { struct ErrorBase { ErrorBase() = default; explicit ErrorBase(u32 tid_) : tid(tid_) {} ScarinessScoreBase scariness; u32 tid; }; struct ErrorStackOverflow : ErrorBase { uptr addr, pc, bp, sp; // ErrorStackOverflow never owns the context. void *context; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorStackOverflow() = default; ErrorStackOverflow(u32 tid, const SignalContext &sig) : ErrorBase(tid), addr(sig.addr), pc(sig.pc), bp(sig.bp), sp(sig.sp), context(sig.context) { scariness.Clear(); scariness.Scare(10, "stack-overflow"); } void Print(); }; struct ErrorDeadlySignal : ErrorBase { uptr addr, pc, bp, sp; // ErrorDeadlySignal never owns the context. void *context; int signo; SignalContext::WriteFlag write_flag; bool is_memory_access; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorDeadlySignal() = default; ErrorDeadlySignal(u32 tid, const SignalContext &sig, int signo_) : ErrorBase(tid), addr(sig.addr), pc(sig.pc), bp(sig.bp), sp(sig.sp), context(sig.context), signo(signo_), write_flag(sig.write_flag), is_memory_access(sig.is_memory_access) { scariness.Clear(); if (is_memory_access) { if (addr < GetPageSizeCached()) { scariness.Scare(10, "null-deref"); } else if (addr == pc) { scariness.Scare(60, "wild-jump"); } else if (write_flag == SignalContext::WRITE) { scariness.Scare(30, "wild-addr-write"); } else if (write_flag == SignalContext::READ) { scariness.Scare(20, "wild-addr-read"); } else { scariness.Scare(25, "wild-addr"); } } else { scariness.Scare(10, "signal"); } } void Print(); }; struct ErrorDoubleFree : ErrorBase { // ErrorDoubleFree doesn't own the stack trace. const BufferedStackTrace *second_free_stack; HeapAddressDescription addr_description; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorDoubleFree() = default; ErrorDoubleFree(u32 tid, BufferedStackTrace *stack, uptr addr) : ErrorBase(tid), second_free_stack(stack) { CHECK_GT(second_free_stack->size, 0); GetHeapAddressInformation(addr, 1, &addr_description); scariness.Clear(); scariness.Scare(42, "double-free"); } void Print(); }; struct ErrorNewDeleteSizeMismatch : ErrorBase { // ErrorNewDeleteSizeMismatch doesn't own the stack trace. const BufferedStackTrace *free_stack; HeapAddressDescription addr_description; uptr delete_size; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorNewDeleteSizeMismatch() = default; ErrorNewDeleteSizeMismatch(u32 tid, BufferedStackTrace *stack, uptr addr, uptr delete_size_) : ErrorBase(tid), free_stack(stack), delete_size(delete_size_) { GetHeapAddressInformation(addr, 1, &addr_description); scariness.Clear(); scariness.Scare(10, "new-delete-type-mismatch"); } void Print(); }; struct ErrorFreeNotMalloced : ErrorBase { // ErrorFreeNotMalloced doesn't own the stack trace. const BufferedStackTrace *free_stack; AddressDescription addr_description; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorFreeNotMalloced() = default; ErrorFreeNotMalloced(u32 tid, BufferedStackTrace *stack, uptr addr) : ErrorBase(tid), free_stack(stack), addr_description(addr, /*shouldLockThreadRegistry=*/false) { scariness.Clear(); scariness.Scare(40, "bad-free"); } void Print(); }; struct ErrorAllocTypeMismatch : ErrorBase { // ErrorAllocTypeMismatch doesn't own the stack trace. const BufferedStackTrace *dealloc_stack; HeapAddressDescription addr_description; AllocType alloc_type, dealloc_type; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorAllocTypeMismatch() = default; ErrorAllocTypeMismatch(u32 tid, BufferedStackTrace *stack, uptr addr, AllocType alloc_type_, AllocType dealloc_type_) : ErrorBase(tid), dealloc_stack(stack), alloc_type(alloc_type_), dealloc_type(dealloc_type_) { GetHeapAddressInformation(addr, 1, &addr_description); scariness.Clear(); scariness.Scare(10, "alloc-dealloc-mismatch"); }; void Print(); }; struct ErrorMallocUsableSizeNotOwned : ErrorBase { // ErrorMallocUsableSizeNotOwned doesn't own the stack trace. const BufferedStackTrace *stack; AddressDescription addr_description; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorMallocUsableSizeNotOwned() = default; ErrorMallocUsableSizeNotOwned(u32 tid, BufferedStackTrace *stack_, uptr addr) : ErrorBase(tid), stack(stack_), addr_description(addr, /*shouldLockThreadRegistry=*/false) { scariness.Clear(); } void Print(); }; struct ErrorSanitizerGetAllocatedSizeNotOwned : ErrorBase { // ErrorSanitizerGetAllocatedSizeNotOwned doesn't own the stack trace. const BufferedStackTrace *stack; AddressDescription addr_description; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorSanitizerGetAllocatedSizeNotOwned() = default; ErrorSanitizerGetAllocatedSizeNotOwned(u32 tid, BufferedStackTrace *stack_, uptr addr) : ErrorBase(tid), stack(stack_), addr_description(addr, /*shouldLockThreadRegistry=*/false) { scariness.Clear(); } void Print(); }; struct ErrorStringFunctionMemoryRangesOverlap : ErrorBase { // ErrorStringFunctionMemoryRangesOverlap doesn't own the stack trace. const BufferedStackTrace *stack; uptr length1, length2; AddressDescription addr1_description; AddressDescription addr2_description; const char *function; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorStringFunctionMemoryRangesOverlap() = default; ErrorStringFunctionMemoryRangesOverlap(u32 tid, BufferedStackTrace *stack_, uptr addr1, uptr length1_, uptr addr2, uptr length2_, const char *function_) : ErrorBase(tid), stack(stack_), length1(length1_), length2(length2_), addr1_description(addr1, length1, /*shouldLockThreadRegistry=*/false), addr2_description(addr2, length2, /*shouldLockThreadRegistry=*/false), function(function_) { char bug_type[100]; internal_snprintf(bug_type, sizeof(bug_type), "%s-param-overlap", function); scariness.Clear(); scariness.Scare(10, bug_type); } void Print(); }; struct ErrorStringFunctionSizeOverflow : ErrorBase { // ErrorStringFunctionSizeOverflow doesn't own the stack trace. const BufferedStackTrace *stack; AddressDescription addr_description; uptr size; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorStringFunctionSizeOverflow() = default; ErrorStringFunctionSizeOverflow(u32 tid, BufferedStackTrace *stack_, uptr addr, uptr size_) : ErrorBase(tid), stack(stack_), addr_description(addr, /*shouldLockThreadRegistry=*/false), size(size_) { scariness.Clear(); scariness.Scare(10, "negative-size-param"); } void Print(); }; struct ErrorBadParamsToAnnotateContiguousContainer : ErrorBase { // ErrorBadParamsToAnnotateContiguousContainer doesn't own the stack trace. const BufferedStackTrace *stack; uptr beg, end, old_mid, new_mid; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorBadParamsToAnnotateContiguousContainer() = default; // PS4: Do we want an AddressDescription for beg? ErrorBadParamsToAnnotateContiguousContainer(u32 tid, BufferedStackTrace *stack_, uptr beg_, uptr end_, uptr old_mid_, uptr new_mid_) : ErrorBase(tid), stack(stack_), beg(beg_), end(end_), old_mid(old_mid_), new_mid(new_mid_) {} void Print(); }; struct ErrorODRViolation : ErrorBase { __asan_global global1, global2; u32 stack_id1, stack_id2; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorODRViolation() = default; ErrorODRViolation(u32 tid, const __asan_global *g1, u32 stack_id1_, const __asan_global *g2, u32 stack_id2_) : ErrorBase(tid), global1(*g1), global2(*g2), stack_id1(stack_id1_), stack_id2(stack_id2_) {} void Print(); }; struct ErrorInvalidPointerPair : ErrorBase { uptr pc, bp, sp; AddressDescription addr1_description; AddressDescription addr2_description; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorInvalidPointerPair() = default; ErrorInvalidPointerPair(u32 tid, uptr pc_, uptr bp_, uptr sp_, uptr p1, uptr p2) : ErrorBase(tid), pc(pc_), bp(bp_), sp(sp_), addr1_description(p1, 1, /*shouldLockThreadRegistry=*/false), addr2_description(p2, 1, /*shouldLockThreadRegistry=*/false) {} void Print(); }; struct ErrorGeneric : ErrorBase { AddressDescription addr_description; uptr pc, bp, sp; uptr access_size; const char *bug_descr; bool is_write; u8 shadow_val; // VS2013 doesn't implement unrestricted unions, so we need a trivial default // constructor ErrorGeneric() = default; ErrorGeneric(u32 tid, uptr addr, uptr pc_, uptr bp_, uptr sp_, bool is_write_, uptr access_size_); void Print(); }; // clang-format off #define ASAN_FOR_EACH_ERROR_KIND(macro) \ macro(StackOverflow) \ macro(DeadlySignal) \ macro(DoubleFree) \ macro(NewDeleteSizeMismatch) \ macro(FreeNotMalloced) \ macro(AllocTypeMismatch) \ macro(MallocUsableSizeNotOwned) \ macro(SanitizerGetAllocatedSizeNotOwned) \ macro(StringFunctionMemoryRangesOverlap) \ macro(StringFunctionSizeOverflow) \ macro(BadParamsToAnnotateContiguousContainer) \ macro(ODRViolation) \ macro(InvalidPointerPair) \ macro(Generic) // clang-format on #define ASAN_DEFINE_ERROR_KIND(name) kErrorKind##name, #define ASAN_ERROR_DESCRIPTION_MEMBER(name) Error##name name; #define ASAN_ERROR_DESCRIPTION_CONSTRUCTOR(name) \ ErrorDescription(Error##name const &e) : kind(kErrorKind##name), name(e) {} #define ASAN_ERROR_DESCRIPTION_PRINT(name) \ case kErrorKind##name: \ return name.Print(); enum ErrorKind { kErrorKindInvalid = 0, ASAN_FOR_EACH_ERROR_KIND(ASAN_DEFINE_ERROR_KIND) }; struct ErrorDescription { ErrorKind kind; // We're using a tagged union because it allows us to have a trivially // copiable type and use the same structures as the public interface. // // We can add a wrapper around it to make it "more c++-like", but that would // add a lot of code and the benefit wouldn't be that big. union { ASAN_FOR_EACH_ERROR_KIND(ASAN_ERROR_DESCRIPTION_MEMBER) }; ErrorDescription() { internal_memset(this, 0, sizeof(*this)); } ASAN_FOR_EACH_ERROR_KIND(ASAN_ERROR_DESCRIPTION_CONSTRUCTOR) bool IsValid() { return kind != kErrorKindInvalid; } void Print() { switch (kind) { ASAN_FOR_EACH_ERROR_KIND(ASAN_ERROR_DESCRIPTION_PRINT) case kErrorKindInvalid: CHECK(0); } CHECK(0); } }; #undef ASAN_FOR_EACH_ERROR_KIND #undef ASAN_DEFINE_ERROR_KIND #undef ASAN_ERROR_DESCRIPTION_MEMBER #undef ASAN_ERROR_DESCRIPTION_CONSTRUCTOR #undef ASAN_ERROR_DESCRIPTION_PRINT } // namespace __asan #endif // ASAN_ERRORS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_allocator.cc0000664000175000017500000010264712773316446026211 0ustar mwhudsonmwhudson//===-- asan_allocator.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Implementation of ASan's memory allocator, 2-nd version. // This variant uses the allocator from sanitizer_common, i.e. the one shared // with ThreadSanitizer and MemorySanitizer. // //===----------------------------------------------------------------------===// #include "asan_allocator.h" #include "asan_mapping.h" #include "asan_poisoning.h" #include "asan_report.h" #include "asan_stack.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_allocator_interface.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_list.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_quarantine.h" #include "lsan/lsan_common.h" namespace __asan { // Valid redzone sizes are 16, 32, 64, ... 2048, so we encode them in 3 bits. // We use adaptive redzones: for larger allocation larger redzones are used. static u32 RZLog2Size(u32 rz_log) { CHECK_LT(rz_log, 8); return 16 << rz_log; } static u32 RZSize2Log(u32 rz_size) { CHECK_GE(rz_size, 16); CHECK_LE(rz_size, 2048); CHECK(IsPowerOfTwo(rz_size)); u32 res = Log2(rz_size) - 4; CHECK_EQ(rz_size, RZLog2Size(res)); return res; } static AsanAllocator &get_allocator(); // The memory chunk allocated from the underlying allocator looks like this: // L L L L L L H H U U U U U U R R // L -- left redzone words (0 or more bytes) // H -- ChunkHeader (16 bytes), which is also a part of the left redzone. // U -- user memory. // R -- right redzone (0 or more bytes) // ChunkBase consists of ChunkHeader and other bytes that overlap with user // memory. // If the left redzone is greater than the ChunkHeader size we store a magic // value in the first uptr word of the memory block and store the address of // ChunkBase in the next uptr. // M B L L L L L L L L L H H U U U U U U // | ^ // ---------------------| // M -- magic value kAllocBegMagic // B -- address of ChunkHeader pointing to the first 'H' static const uptr kAllocBegMagic = 0xCC6E96B9; struct ChunkHeader { // 1-st 8 bytes. u32 chunk_state : 8; // Must be first. u32 alloc_tid : 24; u32 free_tid : 24; u32 from_memalign : 1; u32 alloc_type : 2; u32 rz_log : 3; u32 lsan_tag : 2; // 2-nd 8 bytes // This field is used for small sizes. For large sizes it is equal to // SizeClassMap::kMaxSize and the actual size is stored in the // SecondaryAllocator's metadata. u32 user_requested_size; u32 alloc_context_id; }; struct ChunkBase : ChunkHeader { // Header2, intersects with user memory. u32 free_context_id; }; static const uptr kChunkHeaderSize = sizeof(ChunkHeader); static const uptr kChunkHeader2Size = sizeof(ChunkBase) - kChunkHeaderSize; COMPILER_CHECK(kChunkHeaderSize == 16); COMPILER_CHECK(kChunkHeader2Size <= 16); // Every chunk of memory allocated by this allocator can be in one of 3 states: // CHUNK_AVAILABLE: the chunk is in the free list and ready to be allocated. // CHUNK_ALLOCATED: the chunk is allocated and not yet freed. // CHUNK_QUARANTINE: the chunk was freed and put into quarantine zone. enum { CHUNK_AVAILABLE = 0, // 0 is the default value even if we didn't set it. CHUNK_ALLOCATED = 2, CHUNK_QUARANTINE = 3 }; struct AsanChunk: ChunkBase { uptr Beg() { return reinterpret_cast(this) + kChunkHeaderSize; } uptr UsedSize(bool locked_version = false) { if (user_requested_size != SizeClassMap::kMaxSize) return user_requested_size; return *reinterpret_cast( get_allocator().GetMetaData(AllocBeg(locked_version))); } void *AllocBeg(bool locked_version = false) { if (from_memalign) { if (locked_version) return get_allocator().GetBlockBeginFastLocked( reinterpret_cast(this)); return get_allocator().GetBlockBegin(reinterpret_cast(this)); } return reinterpret_cast(Beg() - RZLog2Size(rz_log)); } bool AddrIsInside(uptr addr, bool locked_version = false) { return (addr >= Beg()) && (addr < Beg() + UsedSize(locked_version)); } }; struct QuarantineCallback { explicit QuarantineCallback(AllocatorCache *cache) : cache_(cache) { } void Recycle(AsanChunk *m) { CHECK_EQ(m->chunk_state, CHUNK_QUARANTINE); atomic_store((atomic_uint8_t*)m, CHUNK_AVAILABLE, memory_order_relaxed); CHECK_NE(m->alloc_tid, kInvalidTid); CHECK_NE(m->free_tid, kInvalidTid); PoisonShadow(m->Beg(), RoundUpTo(m->UsedSize(), SHADOW_GRANULARITY), kAsanHeapLeftRedzoneMagic); void *p = reinterpret_cast(m->AllocBeg()); if (p != m) { uptr *alloc_magic = reinterpret_cast(p); CHECK_EQ(alloc_magic[0], kAllocBegMagic); // Clear the magic value, as allocator internals may overwrite the // contents of deallocated chunk, confusing GetAsanChunk lookup. alloc_magic[0] = 0; CHECK_EQ(alloc_magic[1], reinterpret_cast(m)); } // Statistics. AsanStats &thread_stats = GetCurrentThreadStats(); thread_stats.real_frees++; thread_stats.really_freed += m->UsedSize(); get_allocator().Deallocate(cache_, p); } void *Allocate(uptr size) { return get_allocator().Allocate(cache_, size, 1, false); } void Deallocate(void *p) { get_allocator().Deallocate(cache_, p); } AllocatorCache *cache_; }; typedef Quarantine AsanQuarantine; typedef AsanQuarantine::Cache QuarantineCache; void AsanMapUnmapCallback::OnMap(uptr p, uptr size) const { PoisonShadow(p, size, kAsanHeapLeftRedzoneMagic); // Statistics. AsanStats &thread_stats = GetCurrentThreadStats(); thread_stats.mmaps++; thread_stats.mmaped += size; } void AsanMapUnmapCallback::OnUnmap(uptr p, uptr size) const { PoisonShadow(p, size, 0); // We are about to unmap a chunk of user memory. // Mark the corresponding shadow memory as not needed. FlushUnneededASanShadowMemory(p, size); // Statistics. AsanStats &thread_stats = GetCurrentThreadStats(); thread_stats.munmaps++; thread_stats.munmaped += size; } // We can not use THREADLOCAL because it is not supported on some of the // platforms we care about (OSX 10.6, Android). // static THREADLOCAL AllocatorCache cache; AllocatorCache *GetAllocatorCache(AsanThreadLocalMallocStorage *ms) { CHECK(ms); return &ms->allocator_cache; } QuarantineCache *GetQuarantineCache(AsanThreadLocalMallocStorage *ms) { CHECK(ms); CHECK_LE(sizeof(QuarantineCache), sizeof(ms->quarantine_cache)); return reinterpret_cast(ms->quarantine_cache); } void AllocatorOptions::SetFrom(const Flags *f, const CommonFlags *cf) { quarantine_size_mb = f->quarantine_size_mb; min_redzone = f->redzone; max_redzone = f->max_redzone; may_return_null = cf->allocator_may_return_null; alloc_dealloc_mismatch = f->alloc_dealloc_mismatch; } void AllocatorOptions::CopyTo(Flags *f, CommonFlags *cf) { f->quarantine_size_mb = quarantine_size_mb; f->redzone = min_redzone; f->max_redzone = max_redzone; cf->allocator_may_return_null = may_return_null; f->alloc_dealloc_mismatch = alloc_dealloc_mismatch; } struct Allocator { static const uptr kMaxAllowedMallocSize = FIRST_32_SECOND_64(3UL << 30, 1ULL << 40); static const uptr kMaxThreadLocalQuarantine = FIRST_32_SECOND_64(1 << 18, 1 << 20); AsanAllocator allocator; AsanQuarantine quarantine; StaticSpinMutex fallback_mutex; AllocatorCache fallback_allocator_cache; QuarantineCache fallback_quarantine_cache; // ------------------- Options -------------------------- atomic_uint16_t min_redzone; atomic_uint16_t max_redzone; atomic_uint8_t alloc_dealloc_mismatch; // ------------------- Initialization ------------------------ explicit Allocator(LinkerInitialized) : quarantine(LINKER_INITIALIZED), fallback_quarantine_cache(LINKER_INITIALIZED) {} void CheckOptions(const AllocatorOptions &options) const { CHECK_GE(options.min_redzone, 16); CHECK_GE(options.max_redzone, options.min_redzone); CHECK_LE(options.max_redzone, 2048); CHECK(IsPowerOfTwo(options.min_redzone)); CHECK(IsPowerOfTwo(options.max_redzone)); } void SharedInitCode(const AllocatorOptions &options) { CheckOptions(options); quarantine.Init((uptr)options.quarantine_size_mb << 20, kMaxThreadLocalQuarantine); atomic_store(&alloc_dealloc_mismatch, options.alloc_dealloc_mismatch, memory_order_release); atomic_store(&min_redzone, options.min_redzone, memory_order_release); atomic_store(&max_redzone, options.max_redzone, memory_order_release); } void Initialize(const AllocatorOptions &options) { allocator.Init(options.may_return_null); SharedInitCode(options); } void RePoisonChunk(uptr chunk) { // This could a user-facing chunk (with redzones), or some internal // housekeeping chunk, like TransferBatch. Start by assuming the former. AsanChunk *ac = GetAsanChunk((void *)chunk); uptr allocated_size = allocator.GetActuallyAllocatedSize((void *)ac); uptr beg = ac->Beg(); uptr end = ac->Beg() + ac->UsedSize(true); uptr chunk_end = chunk + allocated_size; if (chunk < beg && beg < end && end <= chunk_end) { // Looks like a valid AsanChunk. Or maybe not. Be conservative and only // poison the redzones. PoisonShadow(chunk, beg - chunk, kAsanHeapLeftRedzoneMagic); uptr end_aligned_down = RoundDownTo(end, SHADOW_GRANULARITY); FastPoisonShadowPartialRightRedzone( end_aligned_down, end - end_aligned_down, chunk_end - end_aligned_down, kAsanHeapLeftRedzoneMagic); } else { // This can not be an AsanChunk. Poison everything. It may be reused as // AsanChunk later. PoisonShadow(chunk, allocated_size, kAsanHeapLeftRedzoneMagic); } } void ReInitialize(const AllocatorOptions &options) { allocator.SetMayReturnNull(options.may_return_null); SharedInitCode(options); // Poison all existing allocation's redzones. if (CanPoisonMemory()) { allocator.ForceLock(); allocator.ForEachChunk( [](uptr chunk, void *alloc) { ((Allocator *)alloc)->RePoisonChunk(chunk); }, this); allocator.ForceUnlock(); } } void GetOptions(AllocatorOptions *options) const { options->quarantine_size_mb = quarantine.GetSize() >> 20; options->min_redzone = atomic_load(&min_redzone, memory_order_acquire); options->max_redzone = atomic_load(&max_redzone, memory_order_acquire); options->may_return_null = allocator.MayReturnNull(); options->alloc_dealloc_mismatch = atomic_load(&alloc_dealloc_mismatch, memory_order_acquire); } // -------------------- Helper methods. ------------------------- uptr ComputeRZLog(uptr user_requested_size) { u32 rz_log = user_requested_size <= 64 - 16 ? 0 : user_requested_size <= 128 - 32 ? 1 : user_requested_size <= 512 - 64 ? 2 : user_requested_size <= 4096 - 128 ? 3 : user_requested_size <= (1 << 14) - 256 ? 4 : user_requested_size <= (1 << 15) - 512 ? 5 : user_requested_size <= (1 << 16) - 1024 ? 6 : 7; u32 min_rz = atomic_load(&min_redzone, memory_order_acquire); u32 max_rz = atomic_load(&max_redzone, memory_order_acquire); return Min(Max(rz_log, RZSize2Log(min_rz)), RZSize2Log(max_rz)); } // We have an address between two chunks, and we want to report just one. AsanChunk *ChooseChunk(uptr addr, AsanChunk *left_chunk, AsanChunk *right_chunk) { // Prefer an allocated chunk over freed chunk and freed chunk // over available chunk. if (left_chunk->chunk_state != right_chunk->chunk_state) { if (left_chunk->chunk_state == CHUNK_ALLOCATED) return left_chunk; if (right_chunk->chunk_state == CHUNK_ALLOCATED) return right_chunk; if (left_chunk->chunk_state == CHUNK_QUARANTINE) return left_chunk; if (right_chunk->chunk_state == CHUNK_QUARANTINE) return right_chunk; } // Same chunk_state: choose based on offset. sptr l_offset = 0, r_offset = 0; CHECK(AsanChunkView(left_chunk).AddrIsAtRight(addr, 1, &l_offset)); CHECK(AsanChunkView(right_chunk).AddrIsAtLeft(addr, 1, &r_offset)); if (l_offset < r_offset) return left_chunk; return right_chunk; } // -------------------- Allocation/Deallocation routines --------------- void *Allocate(uptr size, uptr alignment, BufferedStackTrace *stack, AllocType alloc_type, bool can_fill) { if (UNLIKELY(!asan_inited)) AsanInitFromRtl(); Flags &fl = *flags(); CHECK(stack); const uptr min_alignment = SHADOW_GRANULARITY; if (alignment < min_alignment) alignment = min_alignment; if (size == 0) { // We'd be happy to avoid allocating memory for zero-size requests, but // some programs/tests depend on this behavior and assume that malloc // would not return NULL even for zero-size allocations. Moreover, it // looks like operator new should never return NULL, and results of // consecutive "new" calls must be different even if the allocated size // is zero. size = 1; } CHECK(IsPowerOfTwo(alignment)); uptr rz_log = ComputeRZLog(size); uptr rz_size = RZLog2Size(rz_log); uptr rounded_size = RoundUpTo(Max(size, kChunkHeader2Size), alignment); uptr needed_size = rounded_size + rz_size; if (alignment > min_alignment) needed_size += alignment; bool using_primary_allocator = true; // If we are allocating from the secondary allocator, there will be no // automatic right redzone, so add the right redzone manually. if (!PrimaryAllocator::CanAllocate(needed_size, alignment)) { needed_size += rz_size; using_primary_allocator = false; } CHECK(IsAligned(needed_size, min_alignment)); if (size > kMaxAllowedMallocSize || needed_size > kMaxAllowedMallocSize) { Report("WARNING: AddressSanitizer failed to allocate 0x%zx bytes\n", (void*)size); return allocator.ReturnNullOrDieOnBadRequest(); } AsanThread *t = GetCurrentThread(); void *allocated; bool check_rss_limit = true; if (t) { AllocatorCache *cache = GetAllocatorCache(&t->malloc_storage()); allocated = allocator.Allocate(cache, needed_size, 8, false, check_rss_limit); } else { SpinMutexLock l(&fallback_mutex); AllocatorCache *cache = &fallback_allocator_cache; allocated = allocator.Allocate(cache, needed_size, 8, false, check_rss_limit); } if (!allocated) return allocator.ReturnNullOrDieOnOOM(); if (*(u8 *)MEM_TO_SHADOW((uptr)allocated) == 0 && CanPoisonMemory()) { // Heap poisoning is enabled, but the allocator provides an unpoisoned // chunk. This is possible if CanPoisonMemory() was false for some // time, for example, due to flags()->start_disabled. // Anyway, poison the block before using it for anything else. uptr allocated_size = allocator.GetActuallyAllocatedSize(allocated); PoisonShadow((uptr)allocated, allocated_size, kAsanHeapLeftRedzoneMagic); } uptr alloc_beg = reinterpret_cast(allocated); uptr alloc_end = alloc_beg + needed_size; uptr beg_plus_redzone = alloc_beg + rz_size; uptr user_beg = beg_plus_redzone; if (!IsAligned(user_beg, alignment)) user_beg = RoundUpTo(user_beg, alignment); uptr user_end = user_beg + size; CHECK_LE(user_end, alloc_end); uptr chunk_beg = user_beg - kChunkHeaderSize; AsanChunk *m = reinterpret_cast(chunk_beg); m->alloc_type = alloc_type; m->rz_log = rz_log; u32 alloc_tid = t ? t->tid() : 0; m->alloc_tid = alloc_tid; CHECK_EQ(alloc_tid, m->alloc_tid); // Does alloc_tid fit into the bitfield? m->free_tid = kInvalidTid; m->from_memalign = user_beg != beg_plus_redzone; if (alloc_beg != chunk_beg) { CHECK_LE(alloc_beg+ 2 * sizeof(uptr), chunk_beg); reinterpret_cast(alloc_beg)[0] = kAllocBegMagic; reinterpret_cast(alloc_beg)[1] = chunk_beg; } if (using_primary_allocator) { CHECK(size); m->user_requested_size = size; CHECK(allocator.FromPrimary(allocated)); } else { CHECK(!allocator.FromPrimary(allocated)); m->user_requested_size = SizeClassMap::kMaxSize; uptr *meta = reinterpret_cast(allocator.GetMetaData(allocated)); meta[0] = size; meta[1] = chunk_beg; } m->alloc_context_id = StackDepotPut(*stack); uptr size_rounded_down_to_granularity = RoundDownTo(size, SHADOW_GRANULARITY); // Unpoison the bulk of the memory region. if (size_rounded_down_to_granularity) PoisonShadow(user_beg, size_rounded_down_to_granularity, 0); // Deal with the end of the region if size is not aligned to granularity. if (size != size_rounded_down_to_granularity && CanPoisonMemory()) { u8 *shadow = (u8 *)MemToShadow(user_beg + size_rounded_down_to_granularity); *shadow = fl.poison_partial ? (size & (SHADOW_GRANULARITY - 1)) : 0; } AsanStats &thread_stats = GetCurrentThreadStats(); thread_stats.mallocs++; thread_stats.malloced += size; thread_stats.malloced_redzones += needed_size - size; if (needed_size > SizeClassMap::kMaxSize) thread_stats.malloc_large++; else thread_stats.malloced_by_size[SizeClassMap::ClassID(needed_size)]++; void *res = reinterpret_cast(user_beg); if (can_fill && fl.max_malloc_fill_size) { uptr fill_size = Min(size, (uptr)fl.max_malloc_fill_size); REAL(memset)(res, fl.malloc_fill_byte, fill_size); } #if CAN_SANITIZE_LEAKS m->lsan_tag = __lsan::DisabledInThisThread() ? __lsan::kIgnored : __lsan::kDirectlyLeaked; #endif // Must be the last mutation of metadata in this function. atomic_store((atomic_uint8_t *)m, CHUNK_ALLOCATED, memory_order_release); ASAN_MALLOC_HOOK(res, size); return res; } // Set quarantine flag if chunk is allocated, issue ASan error report on // available and quarantined chunks. Return true on success, false otherwise. bool AtomicallySetQuarantineFlagIfAllocated(AsanChunk *m, void *ptr, BufferedStackTrace *stack) { u8 old_chunk_state = CHUNK_ALLOCATED; // Flip the chunk_state atomically to avoid race on double-free. if (!atomic_compare_exchange_strong((atomic_uint8_t *)m, &old_chunk_state, CHUNK_QUARANTINE, memory_order_acquire)) { ReportInvalidFree(ptr, old_chunk_state, stack); // It's not safe to push a chunk in quarantine on invalid free. return false; } CHECK_EQ(CHUNK_ALLOCATED, old_chunk_state); return true; } // Expects the chunk to already be marked as quarantined by using // AtomicallySetQuarantineFlagIfAllocated. void QuarantineChunk(AsanChunk *m, void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { CHECK_EQ(m->chunk_state, CHUNK_QUARANTINE); CHECK_GE(m->alloc_tid, 0); if (SANITIZER_WORDSIZE == 64) // On 32-bits this resides in user area. CHECK_EQ(m->free_tid, kInvalidTid); AsanThread *t = GetCurrentThread(); m->free_tid = t ? t->tid() : 0; m->free_context_id = StackDepotPut(*stack); // Poison the region. PoisonShadow(m->Beg(), RoundUpTo(m->UsedSize(), SHADOW_GRANULARITY), kAsanHeapFreeMagic); AsanStats &thread_stats = GetCurrentThreadStats(); thread_stats.frees++; thread_stats.freed += m->UsedSize(); // Push into quarantine. if (t) { AsanThreadLocalMallocStorage *ms = &t->malloc_storage(); AllocatorCache *ac = GetAllocatorCache(ms); quarantine.Put(GetQuarantineCache(ms), QuarantineCallback(ac), m, m->UsedSize()); } else { SpinMutexLock l(&fallback_mutex); AllocatorCache *ac = &fallback_allocator_cache; quarantine.Put(&fallback_quarantine_cache, QuarantineCallback(ac), m, m->UsedSize()); } } void Deallocate(void *ptr, uptr delete_size, BufferedStackTrace *stack, AllocType alloc_type) { uptr p = reinterpret_cast(ptr); if (p == 0) return; uptr chunk_beg = p - kChunkHeaderSize; AsanChunk *m = reinterpret_cast(chunk_beg); ASAN_FREE_HOOK(ptr); // Must mark the chunk as quarantined before any changes to its metadata. // Do not quarantine given chunk if we failed to set CHUNK_QUARANTINE flag. if (!AtomicallySetQuarantineFlagIfAllocated(m, ptr, stack)) return; if (m->alloc_type != alloc_type) { if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire)) { ReportAllocTypeMismatch((uptr)ptr, stack, (AllocType)m->alloc_type, (AllocType)alloc_type); } } if (delete_size && flags()->new_delete_type_mismatch && delete_size != m->UsedSize()) { ReportNewDeleteSizeMismatch(p, delete_size, stack); } QuarantineChunk(m, ptr, stack, alloc_type); } void *Reallocate(void *old_ptr, uptr new_size, BufferedStackTrace *stack) { CHECK(old_ptr && new_size); uptr p = reinterpret_cast(old_ptr); uptr chunk_beg = p - kChunkHeaderSize; AsanChunk *m = reinterpret_cast(chunk_beg); AsanStats &thread_stats = GetCurrentThreadStats(); thread_stats.reallocs++; thread_stats.realloced += new_size; void *new_ptr = Allocate(new_size, 8, stack, FROM_MALLOC, true); if (new_ptr) { u8 chunk_state = m->chunk_state; if (chunk_state != CHUNK_ALLOCATED) ReportInvalidFree(old_ptr, chunk_state, stack); CHECK_NE(REAL(memcpy), nullptr); uptr memcpy_size = Min(new_size, m->UsedSize()); // If realloc() races with free(), we may start copying freed memory. // However, we will report racy double-free later anyway. REAL(memcpy)(new_ptr, old_ptr, memcpy_size); Deallocate(old_ptr, 0, stack, FROM_MALLOC); } return new_ptr; } void *Calloc(uptr nmemb, uptr size, BufferedStackTrace *stack) { if (CallocShouldReturnNullDueToOverflow(size, nmemb)) return allocator.ReturnNullOrDieOnBadRequest(); void *ptr = Allocate(nmemb * size, 8, stack, FROM_MALLOC, false); // If the memory comes from the secondary allocator no need to clear it // as it comes directly from mmap. if (ptr && allocator.FromPrimary(ptr)) REAL(memset)(ptr, 0, nmemb * size); return ptr; } void ReportInvalidFree(void *ptr, u8 chunk_state, BufferedStackTrace *stack) { if (chunk_state == CHUNK_QUARANTINE) ReportDoubleFree((uptr)ptr, stack); else ReportFreeNotMalloced((uptr)ptr, stack); } void CommitBack(AsanThreadLocalMallocStorage *ms) { AllocatorCache *ac = GetAllocatorCache(ms); quarantine.Drain(GetQuarantineCache(ms), QuarantineCallback(ac)); allocator.SwallowCache(ac); } // -------------------------- Chunk lookup ---------------------- // Assumes alloc_beg == allocator.GetBlockBegin(alloc_beg). AsanChunk *GetAsanChunk(void *alloc_beg) { if (!alloc_beg) return nullptr; if (!allocator.FromPrimary(alloc_beg)) { uptr *meta = reinterpret_cast(allocator.GetMetaData(alloc_beg)); AsanChunk *m = reinterpret_cast(meta[1]); return m; } uptr *alloc_magic = reinterpret_cast(alloc_beg); if (alloc_magic[0] == kAllocBegMagic) return reinterpret_cast(alloc_magic[1]); return reinterpret_cast(alloc_beg); } AsanChunk *GetAsanChunkByAddr(uptr p) { void *alloc_beg = allocator.GetBlockBegin(reinterpret_cast(p)); return GetAsanChunk(alloc_beg); } // Allocator must be locked when this function is called. AsanChunk *GetAsanChunkByAddrFastLocked(uptr p) { void *alloc_beg = allocator.GetBlockBeginFastLocked(reinterpret_cast(p)); return GetAsanChunk(alloc_beg); } uptr AllocationSize(uptr p) { AsanChunk *m = GetAsanChunkByAddr(p); if (!m) return 0; if (m->chunk_state != CHUNK_ALLOCATED) return 0; if (m->Beg() != p) return 0; return m->UsedSize(); } AsanChunkView FindHeapChunkByAddress(uptr addr) { AsanChunk *m1 = GetAsanChunkByAddr(addr); if (!m1) return AsanChunkView(m1); sptr offset = 0; if (AsanChunkView(m1).AddrIsAtLeft(addr, 1, &offset)) { // The address is in the chunk's left redzone, so maybe it is actually // a right buffer overflow from the other chunk to the left. // Search a bit to the left to see if there is another chunk. AsanChunk *m2 = nullptr; for (uptr l = 1; l < GetPageSizeCached(); l++) { m2 = GetAsanChunkByAddr(addr - l); if (m2 == m1) continue; // Still the same chunk. break; } if (m2 && AsanChunkView(m2).AddrIsAtRight(addr, 1, &offset)) m1 = ChooseChunk(addr, m2, m1); } return AsanChunkView(m1); } void PrintStats() { allocator.PrintStats(); } void ForceLock() { allocator.ForceLock(); fallback_mutex.Lock(); } void ForceUnlock() { fallback_mutex.Unlock(); allocator.ForceUnlock(); } void ReleaseToOS() { allocator.ReleaseToOS(); } }; static Allocator instance(LINKER_INITIALIZED); static AsanAllocator &get_allocator() { return instance.allocator; } bool AsanChunkView::IsValid() { return chunk_ && chunk_->chunk_state != CHUNK_AVAILABLE; } bool AsanChunkView::IsAllocated() { return chunk_ && chunk_->chunk_state == CHUNK_ALLOCATED; } uptr AsanChunkView::Beg() { return chunk_->Beg(); } uptr AsanChunkView::End() { return Beg() + UsedSize(); } uptr AsanChunkView::UsedSize() { return chunk_->UsedSize(); } uptr AsanChunkView::AllocTid() { return chunk_->alloc_tid; } uptr AsanChunkView::FreeTid() { return chunk_->free_tid; } AllocType AsanChunkView::GetAllocType() { return (AllocType)chunk_->alloc_type; } static StackTrace GetStackTraceFromId(u32 id) { CHECK(id); StackTrace res = StackDepotGet(id); CHECK(res.trace); return res; } u32 AsanChunkView::GetAllocStackId() { return chunk_->alloc_context_id; } u32 AsanChunkView::GetFreeStackId() { return chunk_->free_context_id; } StackTrace AsanChunkView::GetAllocStack() { return GetStackTraceFromId(GetAllocStackId()); } StackTrace AsanChunkView::GetFreeStack() { return GetStackTraceFromId(GetFreeStackId()); } void ReleaseToOS() { instance.ReleaseToOS(); } void InitializeAllocator(const AllocatorOptions &options) { instance.Initialize(options); SetAllocatorReleaseToOSCallback(ReleaseToOS); } void ReInitializeAllocator(const AllocatorOptions &options) { instance.ReInitialize(options); } void GetAllocatorOptions(AllocatorOptions *options) { instance.GetOptions(options); } AsanChunkView FindHeapChunkByAddress(uptr addr) { return instance.FindHeapChunkByAddress(addr); } AsanChunkView FindHeapChunkByAllocBeg(uptr addr) { return AsanChunkView(instance.GetAsanChunk(reinterpret_cast(addr))); } void AsanThreadLocalMallocStorage::CommitBack() { instance.CommitBack(this); } void PrintInternalAllocatorStats() { instance.PrintStats(); } void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, AllocType alloc_type) { return instance.Allocate(size, alignment, stack, alloc_type, true); } void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { instance.Deallocate(ptr, 0, stack, alloc_type); } void asan_sized_free(void *ptr, uptr size, BufferedStackTrace *stack, AllocType alloc_type) { instance.Deallocate(ptr, size, stack, alloc_type); } void *asan_malloc(uptr size, BufferedStackTrace *stack) { return instance.Allocate(size, 8, stack, FROM_MALLOC, true); } void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack) { return instance.Calloc(nmemb, size, stack); } void *asan_realloc(void *p, uptr size, BufferedStackTrace *stack) { if (!p) return instance.Allocate(size, 8, stack, FROM_MALLOC, true); if (size == 0) { instance.Deallocate(p, 0, stack, FROM_MALLOC); return nullptr; } return instance.Reallocate(p, size, stack); } void *asan_valloc(uptr size, BufferedStackTrace *stack) { return instance.Allocate(size, GetPageSizeCached(), stack, FROM_MALLOC, true); } void *asan_pvalloc(uptr size, BufferedStackTrace *stack) { uptr PageSize = GetPageSizeCached(); size = RoundUpTo(size, PageSize); if (size == 0) { // pvalloc(0) should allocate one page. size = PageSize; } return instance.Allocate(size, PageSize, stack, FROM_MALLOC, true); } int asan_posix_memalign(void **memptr, uptr alignment, uptr size, BufferedStackTrace *stack) { void *ptr = instance.Allocate(size, alignment, stack, FROM_MALLOC, true); CHECK(IsAligned((uptr)ptr, alignment)); *memptr = ptr; return 0; } uptr asan_malloc_usable_size(const void *ptr, uptr pc, uptr bp) { if (!ptr) return 0; uptr usable_size = instance.AllocationSize(reinterpret_cast(ptr)); if (flags()->check_malloc_usable_size && (usable_size == 0)) { GET_STACK_TRACE_FATAL(pc, bp); ReportMallocUsableSizeNotOwned((uptr)ptr, &stack); } return usable_size; } uptr asan_mz_size(const void *ptr) { return instance.AllocationSize(reinterpret_cast(ptr)); } void asan_mz_force_lock() { instance.ForceLock(); } void asan_mz_force_unlock() { instance.ForceUnlock(); } void AsanSoftRssLimitExceededCallback(bool exceeded) { instance.allocator.SetRssLimitIsExceeded(exceeded); } } // namespace __asan // --- Implementation of LSan-specific functions --- {{{1 namespace __lsan { void LockAllocator() { __asan::get_allocator().ForceLock(); } void UnlockAllocator() { __asan::get_allocator().ForceUnlock(); } void GetAllocatorGlobalRange(uptr *begin, uptr *end) { *begin = (uptr)&__asan::get_allocator(); *end = *begin + sizeof(__asan::get_allocator()); } uptr PointsIntoChunk(void* p) { uptr addr = reinterpret_cast(p); __asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddrFastLocked(addr); if (!m) return 0; uptr chunk = m->Beg(); if (m->chunk_state != __asan::CHUNK_ALLOCATED) return 0; if (m->AddrIsInside(addr, /*locked_version=*/true)) return chunk; if (IsSpecialCaseOfOperatorNew0(chunk, m->UsedSize(/*locked_version*/ true), addr)) return chunk; return 0; } uptr GetUserBegin(uptr chunk) { __asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddrFastLocked(chunk); CHECK(m); return m->Beg(); } LsanMetadata::LsanMetadata(uptr chunk) { metadata_ = reinterpret_cast(chunk - __asan::kChunkHeaderSize); } bool LsanMetadata::allocated() const { __asan::AsanChunk *m = reinterpret_cast<__asan::AsanChunk *>(metadata_); return m->chunk_state == __asan::CHUNK_ALLOCATED; } ChunkTag LsanMetadata::tag() const { __asan::AsanChunk *m = reinterpret_cast<__asan::AsanChunk *>(metadata_); return static_cast(m->lsan_tag); } void LsanMetadata::set_tag(ChunkTag value) { __asan::AsanChunk *m = reinterpret_cast<__asan::AsanChunk *>(metadata_); m->lsan_tag = value; } uptr LsanMetadata::requested_size() const { __asan::AsanChunk *m = reinterpret_cast<__asan::AsanChunk *>(metadata_); return m->UsedSize(/*locked_version=*/true); } u32 LsanMetadata::stack_trace_id() const { __asan::AsanChunk *m = reinterpret_cast<__asan::AsanChunk *>(metadata_); return m->alloc_context_id; } void ForEachChunk(ForEachChunkCallback callback, void *arg) { __asan::get_allocator().ForEachChunk(callback, arg); } IgnoreObjectResult IgnoreObjectLocked(const void *p) { uptr addr = reinterpret_cast(p); __asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddr(addr); if (!m) return kIgnoreObjectInvalid; if ((m->chunk_state == __asan::CHUNK_ALLOCATED) && m->AddrIsInside(addr)) { if (m->lsan_tag == kIgnored) return kIgnoreObjectAlreadyIgnored; m->lsan_tag = __lsan::kIgnored; return kIgnoreObjectSuccess; } else { return kIgnoreObjectInvalid; } } } // namespace __lsan // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT // ASan allocator doesn't reserve extra bytes, so normally we would // just return "size". We don't want to expose our redzone sizes, etc here. uptr __sanitizer_get_estimated_allocated_size(uptr size) { return size; } int __sanitizer_get_ownership(const void *p) { uptr ptr = reinterpret_cast(p); return instance.AllocationSize(ptr) > 0; } uptr __sanitizer_get_allocated_size(const void *p) { if (!p) return 0; uptr ptr = reinterpret_cast(p); uptr allocated_size = instance.AllocationSize(ptr); // Die if p is not malloced or if it is already freed. if (allocated_size == 0) { GET_STACK_TRACE_FATAL_HERE; ReportSanitizerGetAllocatedSizeNotOwned(ptr, &stack); } return allocated_size; } #if !SANITIZER_SUPPORTS_WEAK_HOOKS // Provide default (no-op) implementation of malloc hooks. extern "C" { SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_malloc_hook(void *ptr, uptr size) { (void)ptr; (void)size; } SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_free_hook(void *ptr) { (void)ptr; } } // extern "C" #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_activation.cc0000664000175000017500000001045612674057500026357 0ustar mwhudsonmwhudson//===-- asan_activation.cc --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan activation/deactivation logic. //===----------------------------------------------------------------------===// #include "asan_activation.h" #include "asan_allocator.h" #include "asan_flags.h" #include "asan_internal.h" #include "asan_poisoning.h" #include "asan_stack.h" #include "sanitizer_common/sanitizer_flags.h" namespace __asan { static struct AsanDeactivatedFlags { AllocatorOptions allocator_options; int malloc_context_size; bool poison_heap; bool coverage; const char *coverage_dir; void RegisterActivationFlags(FlagParser *parser, Flags *f, CommonFlags *cf) { #define ASAN_ACTIVATION_FLAG(Type, Name) \ RegisterFlag(parser, #Name, "", &f->Name); #define COMMON_ACTIVATION_FLAG(Type, Name) \ RegisterFlag(parser, #Name, "", &cf->Name); #include "asan_activation_flags.inc" #undef ASAN_ACTIVATION_FLAG #undef COMMON_ACTIVATION_FLAG RegisterIncludeFlags(parser, cf); } void OverrideFromActivationFlags() { Flags f; CommonFlags cf; FlagParser parser; RegisterActivationFlags(&parser, &f, &cf); cf.SetDefaults(); // Copy the current activation flags. allocator_options.CopyTo(&f, &cf); cf.malloc_context_size = malloc_context_size; f.poison_heap = poison_heap; cf.coverage = coverage; cf.coverage_dir = coverage_dir; cf.verbosity = Verbosity(); cf.help = false; // this is activation-specific help // Check if activation flags need to be overriden. if (const char *env = GetEnv("ASAN_ACTIVATION_OPTIONS")) { parser.ParseString(env); } InitializeCommonFlags(&cf); if (Verbosity()) ReportUnrecognizedFlags(); if (cf.help) parser.PrintFlagDescriptions(); allocator_options.SetFrom(&f, &cf); malloc_context_size = cf.malloc_context_size; poison_heap = f.poison_heap; coverage = cf.coverage; coverage_dir = cf.coverage_dir; } void Print() { Report( "quarantine_size_mb %d, max_redzone %d, poison_heap %d, " "malloc_context_size %d, alloc_dealloc_mismatch %d, " "allocator_may_return_null %d, coverage %d, coverage_dir %s\n", allocator_options.quarantine_size_mb, allocator_options.max_redzone, poison_heap, malloc_context_size, allocator_options.alloc_dealloc_mismatch, allocator_options.may_return_null, coverage, coverage_dir); } } asan_deactivated_flags; static bool asan_is_deactivated; void AsanDeactivate() { CHECK(!asan_is_deactivated); VReport(1, "Deactivating ASan\n"); // Stash runtime state. GetAllocatorOptions(&asan_deactivated_flags.allocator_options); asan_deactivated_flags.malloc_context_size = GetMallocContextSize(); asan_deactivated_flags.poison_heap = CanPoisonMemory(); asan_deactivated_flags.coverage = common_flags()->coverage; asan_deactivated_flags.coverage_dir = common_flags()->coverage_dir; // Deactivate the runtime. SetCanPoisonMemory(false); SetMallocContextSize(1); ReInitializeCoverage(false, nullptr); AllocatorOptions disabled = asan_deactivated_flags.allocator_options; disabled.quarantine_size_mb = 0; disabled.min_redzone = 16; // Redzone must be at least 16 bytes long. disabled.max_redzone = 16; disabled.alloc_dealloc_mismatch = false; disabled.may_return_null = true; ReInitializeAllocator(disabled); asan_is_deactivated = true; } void AsanActivate() { if (!asan_is_deactivated) return; VReport(1, "Activating ASan\n"); UpdateProcessName(); asan_deactivated_flags.OverrideFromActivationFlags(); SetCanPoisonMemory(asan_deactivated_flags.poison_heap); SetMallocContextSize(asan_deactivated_flags.malloc_context_size); ReInitializeCoverage(asan_deactivated_flags.coverage, asan_deactivated_flags.coverage_dir); ReInitializeAllocator(asan_deactivated_flags.allocator_options); asan_is_deactivated = false; if (Verbosity()) { Report("Activated with flags:\n"); asan_deactivated_flags.Print(); } } } // namespace __asan golang-1.8-race-detector-runtime_0.0+svn285455/lib/asan/asan_flags.cc0000664000175000017500000001330212674064521025304 0ustar mwhudsonmwhudson//===-- asan_flags.cc -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan flag parsing logic. //===----------------------------------------------------------------------===// #include "asan_activation.h" #include "asan_flags.h" #include "asan_interface_internal.h" #include "asan_stack.h" #include "lsan/lsan_common.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "ubsan/ubsan_flags.h" #include "ubsan/ubsan_platform.h" namespace __asan { Flags asan_flags_dont_use_directly; // use via flags(). static const char *MaybeCallAsanDefaultOptions() { return (&__asan_default_options) ? __asan_default_options() : ""; } static const char *MaybeUseAsanDefaultOptionsCompileDefinition() { #ifdef ASAN_DEFAULT_OPTIONS // Stringize the macro value. # define ASAN_STRINGIZE(x) #x # define ASAN_STRINGIZE_OPTIONS(options) ASAN_STRINGIZE(options) return ASAN_STRINGIZE_OPTIONS(ASAN_DEFAULT_OPTIONS); #else return ""; #endif } void Flags::SetDefaults() { #define ASAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "asan_flags.inc" #undef ASAN_FLAG } static void RegisterAsanFlags(FlagParser *parser, Flags *f) { #define ASAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "asan_flags.inc" #undef ASAN_FLAG } void InitializeFlags() { // Set the default values and prepare for parsing ASan and common flags. SetCommonFlagsDefaults(); { CommonFlags cf; cf.CopyFrom(*common_flags()); cf.detect_leaks = CAN_SANITIZE_LEAKS; cf.external_symbolizer_path = GetEnv("ASAN_SYMBOLIZER_PATH"); cf.malloc_context_size = kDefaultMallocContextSize; cf.intercept_tls_get_addr = true; cf.exitcode = 1; OverrideCommonFlags(cf); } Flags *f = flags(); f->SetDefaults(); FlagParser asan_parser; RegisterAsanFlags(&asan_parser, f); RegisterCommonFlags(&asan_parser); // Set the default values and prepare for parsing LSan and UBSan flags // (which can also overwrite common flags). #if CAN_SANITIZE_LEAKS __lsan::Flags *lf = __lsan::flags(); lf->SetDefaults(); FlagParser lsan_parser; __lsan::RegisterLsanFlags(&lsan_parser, lf); RegisterCommonFlags(&lsan_parser); #endif #if CAN_SANITIZE_UB __ubsan::Flags *uf = __ubsan::flags(); uf->SetDefaults(); FlagParser ubsan_parser; __ubsan::RegisterUbsanFlags(&ubsan_parser, uf); RegisterCommonFlags(&ubsan_parser); #endif // Override from ASan compile definition. const char *asan_compile_def = MaybeUseAsanDefaultOptionsCompileDefinition(); asan_parser.ParseString(asan_compile_def); // Override from user-specified string. const char *asan_default_options = MaybeCallAsanDefaultOptions(); asan_parser.ParseString(asan_default_options); #if CAN_SANITIZE_UB const char *ubsan_default_options = __ubsan::MaybeCallUbsanDefaultOptions(); ubsan_parser.ParseString(ubsan_default_options); #endif // Override from command line. asan_parser.ParseString(GetEnv("ASAN_OPTIONS")); #if CAN_SANITIZE_LEAKS lsan_parser.ParseString(GetEnv("LSAN_OPTIONS")); #endif #if CAN_SANITIZE_UB ubsan_parser.ParseString(GetEnv("UBSAN_OPTIONS")); #endif InitializeCommonFlags(); // TODO(eugenis): dump all flags at verbosity>=2? if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) { // TODO(samsonov): print all of the flags (ASan, LSan, common). asan_parser.PrintFlagDescriptions(); } // Flag validation: if (!CAN_SANITIZE_LEAKS && common_flags()->detect_leaks) { Report("%s: detect_leaks is not supported on this platform.\n", SanitizerToolName); Die(); } // Make "strict_init_order" imply "check_initialization_order". // TODO(samsonov): Use a single runtime flag for an init-order checker. if (f->strict_init_order) { f->check_initialization_order = true; } CHECK_LE((uptr)common_flags()->malloc_context_size, kStackTraceMax); CHECK_LE(f->min_uar_stack_size_log, f->max_uar_stack_size_log); CHECK_GE(f->redzone, 16); CHECK_GE(f->max_redzone, f->redzone); CHECK_LE(f->max_redzone, 2048); CHECK(IsPowerOfTwo(f->redzone)); CHECK(IsPowerOfTwo(f->max_redzone)); // quarantine_size is deprecated but we still honor it. // quarantine_size can not be used together with quarantine_size_mb. if (f->quarantine_size >= 0 && f->quarantine_size_mb >= 0) { Report("%s: please use either 'quarantine_size' (deprecated) or " "quarantine_size_mb, but not both\n", SanitizerToolName); Die(); } if (f->quarantine_size >= 0) f->quarantine_size_mb = f->quarantine_size >> 20; if (f->quarantine_size_mb < 0) { const int kDefaultQuarantineSizeMb = (ASAN_LOW_MEMORY) ? 1UL << 6 : 1UL << 8; f->quarantine_size_mb = kDefaultQuarantineSizeMb; } if (!f->replace_str && common_flags()->intercept_strlen) { Report("WARNING: strlen interceptor is enabled even though replace_str=0. " "Use intercept_strlen=0 to disable it."); } if (!f->replace_str && common_flags()->intercept_strchr) { Report("WARNING: strchr* interceptors are enabled even though " "replace_str=0. Use intercept_strchr=0 to disable them."); } } } // namespace __asan #if !SANITIZER_SUPPORTS_WEAK_HOOKS extern "C" { SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char* __asan_default_options() { return ""; } } // extern "C" #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/0000775000175000017500000000000013040224626023063 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_utils.h0000664000175000017500000000264512750225541025604 0ustar mwhudsonmwhudson//===-- scudo_utils.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Header for scudo_utils.cpp. /// //===----------------------------------------------------------------------===// #ifndef SCUDO_UTILS_H_ #define SCUDO_UTILS_H_ #include #include "sanitizer_common/sanitizer_common.h" namespace __scudo { template inline Dest bit_cast(const Source& source) { static_assert(sizeof(Dest) == sizeof(Source), "Sizes are not equal!"); Dest dest; memcpy(&dest, &source, sizeof(dest)); return dest; } void NORETURN dieWithMessage(const char *Format, ...); enum CPUFeature { SSE4_2 = 0, ENUM_CPUFEATURE_MAX }; bool testCPUFeature(CPUFeature feature); // Tiny PRNG based on https://en.wikipedia.org/wiki/Xorshift#xorshift.2B // The state (128 bits) will be stored in thread local storage. struct Xorshift128Plus { public: Xorshift128Plus(); u64 Next() { u64 x = State_0_; const u64 y = State_1_; State_0_ = y; x ^= x << 23; State_1_ = x ^ y ^ (x >> 17) ^ (y >> 26); return State_1_ + y; } private: u64 State_0_; u64 State_1_; }; } // namespace __scudo #endif // SCUDO_UTILS_H_ golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_flags.inc0000664000175000017500000000256712725420532026064 0ustar mwhudsonmwhudson//===-- scudo_flags.inc -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Hardened Allocator runtime flags. /// //===----------------------------------------------------------------------===// #ifndef SCUDO_FLAG # error "Define SCUDO_FLAG prior to including this file!" #endif SCUDO_FLAG(int, QuarantineSizeMb, 64, "Size (in Mb) of quarantine used to delay the actual deallocation " "of chunks. Lower value may reduce memory usage but decrease the " "effectiveness of the mitigation.") SCUDO_FLAG(int, ThreadLocalQuarantineSizeKb, 1024, "Size (in Kb) of per-thread cache used to offload the global " "quarantine. Lower value may reduce memory usage but might increase " "the contention on the global quarantine.") SCUDO_FLAG(bool, DeallocationTypeMismatch, true, "Report errors on malloc/delete, new/free, new/delete[], etc.") SCUDO_FLAG(bool, DeleteSizeMismatch, true, "Report errors on mismatch between size of new and delete.") SCUDO_FLAG(bool, ZeroContents, false, "Zero chunk contents on allocation and deallocation.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_new_delete.cpp0000664000175000017500000000357012725420532027107 0ustar mwhudsonmwhudson//===-- scudo_new_delete.cpp ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Interceptors for operators new and delete. /// //===----------------------------------------------------------------------===// #include "scudo_allocator.h" #include "interception/interception.h" #include using namespace __scudo; #define CXX_OPERATOR_ATTRIBUTE INTERCEPTOR_ATTRIBUTE // Fake std::nothrow_t to avoid including . namespace std { struct nothrow_t {}; } // namespace std CXX_OPERATOR_ATTRIBUTE void *operator new(size_t size) { return scudoMalloc(size, FromNew); } CXX_OPERATOR_ATTRIBUTE void *operator new[](size_t size) { return scudoMalloc(size, FromNewArray); } CXX_OPERATOR_ATTRIBUTE void *operator new(size_t size, std::nothrow_t const&) { return scudoMalloc(size, FromNew); } CXX_OPERATOR_ATTRIBUTE void *operator new[](size_t size, std::nothrow_t const&) { return scudoMalloc(size, FromNewArray); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr) NOEXCEPT { return scudoFree(ptr, FromNew); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr) NOEXCEPT { return scudoFree(ptr, FromNewArray); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, std::nothrow_t const&) NOEXCEPT { return scudoFree(ptr, FromNew); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, std::nothrow_t const&) NOEXCEPT { return scudoFree(ptr, FromNewArray); } CXX_OPERATOR_ATTRIBUTE void operator delete(void *ptr, size_t size) NOEXCEPT { scudoSizedFree(ptr, size, FromNew); } CXX_OPERATOR_ATTRIBUTE void operator delete[](void *ptr, size_t size) NOEXCEPT { scudoSizedFree(ptr, size, FromNewArray); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_allocator.h0000664000175000017500000001064313004153372026414 0ustar mwhudsonmwhudson//===-- scudo_allocator.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Header for scudo_allocator.cpp. /// //===----------------------------------------------------------------------===// #ifndef SCUDO_ALLOCATOR_H_ #define SCUDO_ALLOCATOR_H_ #ifndef __x86_64__ # error "The Scudo hardened allocator currently only supports x86_64." #endif #include "scudo_flags.h" #include "sanitizer_common/sanitizer_allocator.h" #include namespace __scudo { enum AllocType : u8 { FromMalloc = 0, // Memory block came from malloc, realloc, calloc, etc. FromNew = 1, // Memory block came from operator new. FromNewArray = 2, // Memory block came from operator new []. FromMemalign = 3, // Memory block came from memalign, posix_memalign, etc. }; enum ChunkState : u8 { ChunkAvailable = 0, ChunkAllocated = 1, ChunkQuarantine = 2 }; #if SANITIZER_WORDSIZE == 64 // Our header requires 128 bits of storage on 64-bit platforms, which fits // nicely with the alignment requirements. Having the offset saves us from // using functions such as GetBlockBegin, that is fairly costly. Our first // implementation used the MetaData as well, which offers the advantage of // being stored away from the chunk itself, but accessing it was costly as // well. The header will be atomically loaded and stored using the 16-byte // primitives offered by the platform (likely requires cmpxchg16b support). typedef unsigned __int128 PackedHeader; struct UnpackedHeader { u16 Checksum : 16; uptr RequestedSize : 40; // Needed for reallocation purposes. u8 State : 2; // available, allocated, or quarantined u8 AllocType : 2; // malloc, new, new[], or memalign u8 Unused_0_ : 4; uptr Offset : 12; // Offset from the beginning of the backend // allocation to the beginning of the chunk itself, // in multiples of MinAlignment. See comment about // its maximum value and test in init(). u64 Unused_1_ : 36; u16 Salt : 16; }; #elif SANITIZER_WORDSIZE == 32 // On 32-bit platforms, our header requires 64 bits. typedef u64 PackedHeader; struct UnpackedHeader { u16 Checksum : 12; uptr RequestedSize : 32; // Needed for reallocation purposes. u8 State : 2; // available, allocated, or quarantined u8 AllocType : 2; // malloc, new, new[], or memalign uptr Offset : 12; // Offset from the beginning of the backend // allocation to the beginning of the chunk itself, // in multiples of MinAlignment. See comment about // its maximum value and test in Allocator::init(). u16 Salt : 4; }; #else # error "Unsupported SANITIZER_WORDSIZE." #endif // SANITIZER_WORDSIZE typedef std::atomic AtomicPackedHeader; COMPILER_CHECK(sizeof(UnpackedHeader) == sizeof(PackedHeader)); const uptr ChunkHeaderSize = sizeof(PackedHeader); // Minimum alignment of 8 bytes for 32-bit, 16 for 64-bit const uptr MinAlignmentLog = FIRST_32_SECOND_64(3, 4); const uptr MaxAlignmentLog = 24; // 16 MB const uptr MinAlignment = 1 << MinAlignmentLog; const uptr MaxAlignment = 1 << MaxAlignmentLog; struct AllocatorOptions { u32 QuarantineSizeMb; u32 ThreadLocalQuarantineSizeKb; bool MayReturnNull; bool DeallocationTypeMismatch; bool DeleteSizeMismatch; bool ZeroContents; void setFrom(const Flags *f, const CommonFlags *cf); void copyTo(Flags *f, CommonFlags *cf) const; }; void initAllocator(const AllocatorOptions &options); void drainQuarantine(); void *scudoMalloc(uptr Size, AllocType Type); void scudoFree(void *Ptr, AllocType Type); void scudoSizedFree(void *Ptr, uptr Size, AllocType Type); void *scudoRealloc(void *Ptr, uptr Size); void *scudoCalloc(uptr NMemB, uptr Size); void *scudoMemalign(uptr Alignment, uptr Size); void *scudoValloc(uptr Size); void *scudoPvalloc(uptr Size); int scudoPosixMemalign(void **MemPtr, uptr Alignment, uptr Size); void *scudoAlignedAlloc(uptr Alignment, uptr Size); uptr scudoMallocUsableSize(void *Ptr); #include "scudo_allocator_secondary.h" } // namespace __scudo #endif // SCUDO_ALLOCATOR_H_ golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_termination.cpp0000664000175000017500000000252612750216742027331 0ustar mwhudsonmwhudson//===-- scudo_termination.cpp -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// This file contains bare-bones termination functions to replace the /// __sanitizer ones, in order to avoid any potential abuse of the callbacks /// functionality. /// //===----------------------------------------------------------------------===// #include "scudo_utils.h" #include "sanitizer_common/sanitizer_common.h" namespace __sanitizer { bool AddDieCallback(DieCallbackType Callback) { return true; } bool RemoveDieCallback(DieCallbackType Callback) { return true; } void SetUserDieCallback(DieCallbackType Callback) {} void NORETURN Die() { if (common_flags()->abort_on_error) Abort(); internal__exit(common_flags()->exitcode); } void SetCheckFailedCallback(CheckFailedCallbackType callback) {} void NORETURN CheckFailed(const char *File, int Line, const char *Condition, u64 Value1, u64 Value2) { __scudo::dieWithMessage("Scudo CHECK failed: %s:%d %s (%lld, %lld)\n", File, Line, Condition, Value1, Value2); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_interceptors.cpp0000664000175000017500000000344712725420532027520 0ustar mwhudsonmwhudson//===-- scudo_interceptors.cpp ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Linux specific malloc interception functions. /// //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX #include "scudo_allocator.h" #include "interception/interception.h" using namespace __scudo; INTERCEPTOR(void, free, void *ptr) { scudoFree(ptr, FromMalloc); } INTERCEPTOR(void, cfree, void *ptr) { scudoFree(ptr, FromMalloc); } INTERCEPTOR(void*, malloc, uptr size) { return scudoMalloc(size, FromMalloc); } INTERCEPTOR(void*, realloc, void *ptr, uptr size) { return scudoRealloc(ptr, size); } INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { return scudoCalloc(nmemb, size); } INTERCEPTOR(void*, valloc, uptr size) { return scudoValloc(size); } INTERCEPTOR(void*, memalign, uptr alignment, uptr size) { return scudoMemalign(alignment, size); } INTERCEPTOR(void*, __libc_memalign, uptr alignment, uptr size) { return scudoMemalign(alignment, size); } INTERCEPTOR(void*, pvalloc, uptr size) { return scudoPvalloc(size); } INTERCEPTOR(void*, aligned_alloc, uptr alignment, uptr size) { return scudoAlignedAlloc(alignment, size); } INTERCEPTOR(int, posix_memalign, void **memptr, uptr alignment, uptr size) { return scudoPosixMemalign(memptr, alignment, size); } INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { return scudoMallocUsableSize(ptr); } INTERCEPTOR(int, mallopt, int cmd, int value) { return -1; } #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/CMakeLists.txt0000664000175000017500000000140412760126006025623 0ustar mwhudsonmwhudsonadd_compiler_rt_component(scudo) include_directories(..) set(SCUDO_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF SCUDO_CFLAGS) list(APPEND SCUDO_CFLAGS -msse4.2 -mcx16) set(SCUDO_SOURCES scudo_allocator.cpp scudo_flags.cpp scudo_interceptors.cpp scudo_new_delete.cpp scudo_termination.cpp scudo_utils.cpp) if(COMPILER_RT_HAS_SCUDO) foreach(arch ${SCUDO_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.scudo STATIC ARCHS ${arch} SOURCES ${SCUDO_SOURCES} $ $ $ CFLAGS ${SCUDO_CFLAGS} PARENT_TARGET scudo) endforeach() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_allocator_secondary.h0000664000175000017500000001322213004153372030457 0ustar mwhudsonmwhudson//===-- scudo_allocator_secondary.h -----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Scudo Secondary Allocator. /// This services allocation that are too large to be serviced by the Primary /// Allocator. It is directly backed by the memory mapping functions of the /// operating system. /// //===----------------------------------------------------------------------===// #ifndef SCUDO_ALLOCATOR_SECONDARY_H_ #define SCUDO_ALLOCATOR_SECONDARY_H_ #ifndef SCUDO_ALLOCATOR_H_ # error "This file must be included inside scudo_allocator.h." #endif class ScudoLargeMmapAllocator { public: void Init(bool AllocatorMayReturnNull) { PageSize = GetPageSizeCached(); atomic_store(&MayReturnNull, AllocatorMayReturnNull, memory_order_relaxed); } void *Allocate(AllocatorStats *Stats, uptr Size, uptr Alignment) { // The Scudo frontend prevents us from allocating more than // MaxAllowedMallocSize, so integer overflow checks would be superfluous. uptr HeadersSize = sizeof(SecondaryHeader) + ChunkHeaderSize; uptr MapSize = RoundUpTo(Size + sizeof(SecondaryHeader), PageSize); // Account for 2 guard pages, one before and one after the chunk. MapSize += 2 * PageSize; // Adding an extra Alignment is not required, it was done by the frontend. uptr MapBeg = reinterpret_cast(MmapNoAccess(MapSize)); if (MapBeg == ~static_cast(0)) return ReturnNullOrDieOnOOM(); // A page-aligned pointer is assumed after that, so check it now. CHECK(IsAligned(MapBeg, PageSize)); uptr MapEnd = MapBeg + MapSize; uptr UserBeg = MapBeg + PageSize + HeadersSize; // In the event of larger alignments, we will attempt to fit the mmap area // better and unmap extraneous memory. This will also ensure that the // offset field of the header stays small (it will always be 0). if (Alignment > MinAlignment) { if (UserBeg & (Alignment - 1)) UserBeg += Alignment - (UserBeg & (Alignment - 1)); CHECK_GE(UserBeg, MapBeg); uptr NewMapBeg = UserBeg - HeadersSize; NewMapBeg = (NewMapBeg & ~(PageSize - 1)) - PageSize; CHECK_GE(NewMapBeg, MapBeg); uptr NewMapSize = MapEnd - NewMapBeg; uptr Diff = NewMapBeg - MapBeg; // Unmap the extra memory if it's large enough. if (Diff > PageSize) UnmapOrDie(reinterpret_cast(MapBeg), Diff); MapBeg = NewMapBeg; MapSize = NewMapSize; } uptr UserEnd = UserBeg - ChunkHeaderSize + Size; // For larger alignments, Alignment was added by the frontend to Size. if (Alignment > MinAlignment) UserEnd -= Alignment; CHECK_LE(UserEnd, MapEnd - PageSize); CHECK_EQ(MapBeg + PageSize, reinterpret_cast( MmapFixedOrDie(MapBeg + PageSize, MapSize - 2 * PageSize))); uptr Ptr = UserBeg - ChunkHeaderSize; SecondaryHeader *Header = getHeader(Ptr); Header->MapBeg = MapBeg; Header->MapSize = MapSize; Stats->Add(AllocatorStatAllocated, MapSize - 2 * PageSize); Stats->Add(AllocatorStatMapped, MapSize - 2 * PageSize); CHECK(IsAligned(UserBeg, Alignment)); return reinterpret_cast(UserBeg); } void *ReturnNullOrDieOnBadRequest() { if (atomic_load(&MayReturnNull, memory_order_acquire)) return nullptr; ReportAllocatorCannotReturnNull(false); } void *ReturnNullOrDieOnOOM() { if (atomic_load(&MayReturnNull, memory_order_acquire)) return nullptr; ReportAllocatorCannotReturnNull(true); } void SetMayReturnNull(bool AllocatorMayReturnNull) { atomic_store(&MayReturnNull, AllocatorMayReturnNull, memory_order_release); } void Deallocate(AllocatorStats *Stats, void *Ptr) { SecondaryHeader *Header = getHeader(Ptr); Stats->Sub(AllocatorStatAllocated, Header->MapSize); Stats->Sub(AllocatorStatMapped, Header->MapSize); UnmapOrDie(reinterpret_cast(Header->MapBeg), Header->MapSize); } uptr TotalMemoryUsed() { UNIMPLEMENTED(); } bool PointerIsMine(const void *Ptr) { UNIMPLEMENTED(); } uptr GetActuallyAllocatedSize(void *Ptr) { SecondaryHeader *Header = getHeader(Ptr); // Deduct PageSize as MapEnd includes the trailing guard page. uptr MapEnd = Header->MapBeg + Header->MapSize - PageSize; return MapEnd - reinterpret_cast(Ptr); } void *GetMetaData(const void *Ptr) { UNIMPLEMENTED(); } void *GetBlockBegin(const void *Ptr) { UNIMPLEMENTED(); } void *GetBlockBeginFastLocked(void *Ptr) { UNIMPLEMENTED(); } void PrintStats() { UNIMPLEMENTED(); } void ForceLock() { UNIMPLEMENTED(); } void ForceUnlock() { UNIMPLEMENTED(); } void ForEachChunk(ForEachChunkCallback Callback, void *Arg) { UNIMPLEMENTED(); } private: // A Secondary allocated chunk header contains the base of the mapping and // its size. Currently, the base is always a page before the header, but // we might want to extend that number in the future based on the size of // the allocation. struct SecondaryHeader { uptr MapBeg; uptr MapSize; }; // Check that sizeof(SecondaryHeader) is a multiple of 16. COMPILER_CHECK((sizeof(SecondaryHeader) & 0xf) == 0); SecondaryHeader *getHeader(uptr Ptr) { return reinterpret_cast(Ptr - sizeof(SecondaryHeader)); } SecondaryHeader *getHeader(const void *Ptr) { return getHeader(reinterpret_cast(Ptr)); } uptr PageSize; atomic_uint8_t MayReturnNull; }; #endif // SCUDO_ALLOCATOR_SECONDARY_H_ golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_flags.h0000664000175000017500000000141012725420532025524 0ustar mwhudsonmwhudson//===-- scudo_flags.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Header for scudo_flags.cpp. /// //===----------------------------------------------------------------------===// #ifndef SCUDO_FLAGS_H_ #define SCUDO_FLAGS_H_ namespace __scudo { struct Flags { #define SCUDO_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "scudo_flags.inc" #undef SCUDO_FLAG void setDefaults(); }; Flags *getFlags(); void initFlags(); } // namespace __scudo #endif // SCUDO_FLAGS_H_ golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_allocator.cpp0000664000175000017500000005420513004153372026751 0ustar mwhudsonmwhudson//===-- scudo_allocator.cpp -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Scudo Hardened Allocator implementation. /// It uses the sanitizer_common allocator as a base and aims at mitigating /// heap corruption vulnerabilities. It provides a checksum-guarded chunk /// header, a delayed free list, and additional sanity checks. /// //===----------------------------------------------------------------------===// #include "scudo_allocator.h" #include "scudo_utils.h" #include "sanitizer_common/sanitizer_allocator_interface.h" #include "sanitizer_common/sanitizer_quarantine.h" #include #include #include #include namespace __scudo { struct AP { static const uptr kSpaceBeg = ~0ULL; static const uptr kSpaceSize = 0x10000000000ULL; static const uptr kMetadataSize = 0; typedef DefaultSizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = SizeClassAllocator64FlagMasks::kRandomShuffleChunks; }; typedef SizeClassAllocator64 PrimaryAllocator; typedef SizeClassAllocatorLocalCache AllocatorCache; typedef ScudoLargeMmapAllocator SecondaryAllocator; typedef CombinedAllocator ScudoAllocator; static ScudoAllocator &getAllocator(); static thread_local Xorshift128Plus Prng; // Global static cookie, initialized at start-up. static u64 Cookie; struct ScudoChunk : UnpackedHeader { // We can't use the offset member of the chunk itself, as we would double // fetch it without any warranty that it wouldn't have been tampered. To // prevent this, we work with a local copy of the header. void *getAllocBeg(UnpackedHeader *Header) { return reinterpret_cast( reinterpret_cast(this) - (Header->Offset << MinAlignmentLog)); } // CRC32 checksum of the Chunk pointer and its ChunkHeader. // It currently uses the Intel Nehalem SSE4.2 crc32 64-bit instruction. u16 computeChecksum(UnpackedHeader *Header) const { u64 HeaderHolder[2]; memcpy(HeaderHolder, Header, sizeof(HeaderHolder)); u64 Crc = _mm_crc32_u64(Cookie, reinterpret_cast(this)); // This is somewhat of a shortcut. The checksum is stored in the 16 least // significant bits of the first 8 bytes of the header, hence zero-ing // those bits out. It would be more valid to zero the checksum field of the // UnpackedHeader, but would require holding an additional copy of it. Crc = _mm_crc32_u64(Crc, HeaderHolder[0] & 0xffffffffffff0000ULL); Crc = _mm_crc32_u64(Crc, HeaderHolder[1]); return static_cast(Crc); } // Loads and unpacks the header, verifying the checksum in the process. void loadHeader(UnpackedHeader *NewUnpackedHeader) const { const AtomicPackedHeader *AtomicHeader = reinterpret_cast(this); PackedHeader NewPackedHeader = AtomicHeader->load(std::memory_order_relaxed); *NewUnpackedHeader = bit_cast(NewPackedHeader); if ((NewUnpackedHeader->Unused_0_ != 0) || (NewUnpackedHeader->Unused_1_ != 0) || (NewUnpackedHeader->Checksum != computeChecksum(NewUnpackedHeader))) { dieWithMessage("ERROR: corrupted chunk header at address %p\n", this); } } // Packs and stores the header, computing the checksum in the process. void storeHeader(UnpackedHeader *NewUnpackedHeader) { NewUnpackedHeader->Checksum = computeChecksum(NewUnpackedHeader); PackedHeader NewPackedHeader = bit_cast(*NewUnpackedHeader); AtomicPackedHeader *AtomicHeader = reinterpret_cast(this); AtomicHeader->store(NewPackedHeader, std::memory_order_relaxed); } // Packs and stores the header, computing the checksum in the process. We // compare the current header with the expected provided one to ensure that // we are not being raced by a corruption occurring in another thread. void compareExchangeHeader(UnpackedHeader *NewUnpackedHeader, UnpackedHeader *OldUnpackedHeader) { NewUnpackedHeader->Checksum = computeChecksum(NewUnpackedHeader); PackedHeader NewPackedHeader = bit_cast(*NewUnpackedHeader); PackedHeader OldPackedHeader = bit_cast(*OldUnpackedHeader); AtomicPackedHeader *AtomicHeader = reinterpret_cast(this); if (!AtomicHeader->compare_exchange_strong(OldPackedHeader, NewPackedHeader, std::memory_order_relaxed, std::memory_order_relaxed)) { dieWithMessage("ERROR: race on chunk header at address %p\n", this); } } }; static bool ScudoInitIsRunning = false; static pthread_once_t GlobalInited = PTHREAD_ONCE_INIT; static pthread_key_t pkey; static thread_local bool ThreadInited = false; static thread_local bool ThreadTornDown = false; static thread_local AllocatorCache Cache; static void teardownThread(void *p) { uptr v = reinterpret_cast(p); // The glibc POSIX thread-local-storage deallocation routine calls user // provided destructors in a loop of PTHREAD_DESTRUCTOR_ITERATIONS. // We want to be called last since other destructors might call free and the // like, so we wait until PTHREAD_DESTRUCTOR_ITERATIONS before draining the // quarantine and swallowing the cache. if (v < PTHREAD_DESTRUCTOR_ITERATIONS) { pthread_setspecific(pkey, reinterpret_cast(v + 1)); return; } drainQuarantine(); getAllocator().DestroyCache(&Cache); ThreadTornDown = true; } static void initInternal() { SanitizerToolName = "Scudo"; CHECK(!ScudoInitIsRunning && "Scudo init calls itself!"); ScudoInitIsRunning = true; initFlags(); AllocatorOptions Options; Options.setFrom(getFlags(), common_flags()); initAllocator(Options); MaybeStartBackgroudThread(); ScudoInitIsRunning = false; } static void initGlobal() { pthread_key_create(&pkey, teardownThread); initInternal(); } static void NOINLINE initThread() { pthread_once(&GlobalInited, initGlobal); pthread_setspecific(pkey, reinterpret_cast(1)); getAllocator().InitCache(&Cache); ThreadInited = true; } struct QuarantineCallback { explicit QuarantineCallback(AllocatorCache *Cache) : Cache_(Cache) {} // Chunk recycling function, returns a quarantined chunk to the backend. void Recycle(ScudoChunk *Chunk) { UnpackedHeader Header; Chunk->loadHeader(&Header); if (Header.State != ChunkQuarantine) { dieWithMessage("ERROR: invalid chunk state when recycling address %p\n", Chunk); } void *Ptr = Chunk->getAllocBeg(&Header); getAllocator().Deallocate(Cache_, Ptr); } /// Internal quarantine allocation and deallocation functions. void *Allocate(uptr Size) { // The internal quarantine memory cannot be protected by us. But the only // structures allocated are QuarantineBatch, that are 8KB for x64. So we // will use mmap for those, and given that Deallocate doesn't pass a size // in, we enforce the size of the allocation to be sizeof(QuarantineBatch). // TODO(kostyak): switching to mmap impacts greatly performances, we have // to find another solution // CHECK_EQ(Size, sizeof(QuarantineBatch)); // return MmapOrDie(Size, "QuarantineBatch"); return getAllocator().Allocate(Cache_, Size, 1, false); } void Deallocate(void *Ptr) { // UnmapOrDie(Ptr, sizeof(QuarantineBatch)); getAllocator().Deallocate(Cache_, Ptr); } AllocatorCache *Cache_; }; typedef Quarantine ScudoQuarantine; typedef ScudoQuarantine::Cache QuarantineCache; static thread_local QuarantineCache ThreadQuarantineCache; void AllocatorOptions::setFrom(const Flags *f, const CommonFlags *cf) { MayReturnNull = cf->allocator_may_return_null; QuarantineSizeMb = f->QuarantineSizeMb; ThreadLocalQuarantineSizeKb = f->ThreadLocalQuarantineSizeKb; DeallocationTypeMismatch = f->DeallocationTypeMismatch; DeleteSizeMismatch = f->DeleteSizeMismatch; ZeroContents = f->ZeroContents; } void AllocatorOptions::copyTo(Flags *f, CommonFlags *cf) const { cf->allocator_may_return_null = MayReturnNull; f->QuarantineSizeMb = QuarantineSizeMb; f->ThreadLocalQuarantineSizeKb = ThreadLocalQuarantineSizeKb; f->DeallocationTypeMismatch = DeallocationTypeMismatch; f->DeleteSizeMismatch = DeleteSizeMismatch; f->ZeroContents = ZeroContents; } struct Allocator { static const uptr MaxAllowedMallocSize = FIRST_32_SECOND_64(2UL << 30, 1ULL << 40); ScudoAllocator BackendAllocator; ScudoQuarantine AllocatorQuarantine; // The fallback caches are used when the thread local caches have been // 'detroyed' on thread tear-down. They are protected by a Mutex as they can // be accessed by different threads. StaticSpinMutex FallbackMutex; AllocatorCache FallbackAllocatorCache; QuarantineCache FallbackQuarantineCache; bool DeallocationTypeMismatch; bool ZeroContents; bool DeleteSizeMismatch; explicit Allocator(LinkerInitialized) : AllocatorQuarantine(LINKER_INITIALIZED), FallbackQuarantineCache(LINKER_INITIALIZED) {} void init(const AllocatorOptions &Options) { // Currently SSE 4.2 support is required. This might change later. CHECK(testCPUFeature(SSE4_2)); // for crc32 // Verify that the header offset field can hold the maximum offset. In the // case of the Secondary allocator, it takes care of alignment and the // offset will always be 0. In the case of the Primary, the worst case // scenario happens in the last size class, when the backend allocation // would already be aligned on the requested alignment, which would happen // to be the maximum alignment that would fit in that size class. As a // result, the maximum offset will be at most the maximum alignment for the // last size class minus the header size, in multiples of MinAlignment. UnpackedHeader Header = {}; uptr MaxPrimaryAlignment = 1 << MostSignificantSetBitIndex( PrimaryAllocator::SizeClassMap::kMaxSize - MinAlignment); uptr MaximumOffset = (MaxPrimaryAlignment - ChunkHeaderSize) >> MinAlignmentLog; Header.Offset = MaximumOffset; if (Header.Offset != MaximumOffset) { dieWithMessage("ERROR: the maximum possible offset doesn't fit in the " "header\n"); } DeallocationTypeMismatch = Options.DeallocationTypeMismatch; DeleteSizeMismatch = Options.DeleteSizeMismatch; ZeroContents = Options.ZeroContents; BackendAllocator.Init(Options.MayReturnNull); AllocatorQuarantine.Init( static_cast(Options.QuarantineSizeMb) << 20, static_cast(Options.ThreadLocalQuarantineSizeKb) << 10); BackendAllocator.InitCache(&FallbackAllocatorCache); Cookie = Prng.Next(); } // Allocates a chunk. void *allocate(uptr Size, uptr Alignment, AllocType Type) { if (UNLIKELY(!ThreadInited)) initThread(); if (!IsPowerOfTwo(Alignment)) { dieWithMessage("ERROR: alignment is not a power of 2\n"); } if (Alignment > MaxAlignment) return BackendAllocator.ReturnNullOrDieOnBadRequest(); if (Alignment < MinAlignment) Alignment = MinAlignment; if (Size == 0) Size = 1; if (Size >= MaxAllowedMallocSize) return BackendAllocator.ReturnNullOrDieOnBadRequest(); uptr RoundedSize = RoundUpTo(Size, MinAlignment); uptr NeededSize = RoundedSize + ChunkHeaderSize; if (Alignment > MinAlignment) NeededSize += Alignment; if (NeededSize >= MaxAllowedMallocSize) return BackendAllocator.ReturnNullOrDieOnBadRequest(); bool FromPrimary = PrimaryAllocator::CanAllocate(NeededSize, MinAlignment); void *Ptr; if (LIKELY(!ThreadTornDown)) { Ptr = BackendAllocator.Allocate(&Cache, NeededSize, FromPrimary ? MinAlignment : Alignment); } else { SpinMutexLock l(&FallbackMutex); Ptr = BackendAllocator.Allocate(&FallbackAllocatorCache, NeededSize, FromPrimary ? MinAlignment : Alignment); } if (!Ptr) return BackendAllocator.ReturnNullOrDieOnOOM(); // If requested, we will zero out the entire contents of the returned chunk. if (ZeroContents && BackendAllocator.FromPrimary(Ptr)) memset(Ptr, 0, BackendAllocator.GetActuallyAllocatedSize(Ptr)); uptr AllocBeg = reinterpret_cast(Ptr); // If the allocation was serviced by the secondary, the returned pointer // accounts for ChunkHeaderSize to pass the alignment check of the combined // allocator. Adjust it here. if (!FromPrimary) AllocBeg -= ChunkHeaderSize; uptr ChunkBeg = AllocBeg + ChunkHeaderSize; if (!IsAligned(ChunkBeg, Alignment)) ChunkBeg = RoundUpTo(ChunkBeg, Alignment); CHECK_LE(ChunkBeg + Size, AllocBeg + NeededSize); ScudoChunk *Chunk = reinterpret_cast(ChunkBeg - ChunkHeaderSize); UnpackedHeader Header = {}; Header.State = ChunkAllocated; Header.Offset = (ChunkBeg - ChunkHeaderSize - AllocBeg) >> MinAlignmentLog; Header.AllocType = Type; Header.RequestedSize = Size; Header.Salt = static_cast(Prng.Next()); Chunk->storeHeader(&Header); void *UserPtr = reinterpret_cast(ChunkBeg); // TODO(kostyak): hooks sound like a terrible idea security wise but might // be needed for things to work properly? // if (&__sanitizer_malloc_hook) __sanitizer_malloc_hook(UserPtr, Size); return UserPtr; } // Deallocates a Chunk, which means adding it to the delayed free list (or // Quarantine). void deallocate(void *UserPtr, uptr DeleteSize, AllocType Type) { if (UNLIKELY(!ThreadInited)) initThread(); // TODO(kostyak): see hook comment above // if (&__sanitizer_free_hook) __sanitizer_free_hook(UserPtr); if (!UserPtr) return; uptr ChunkBeg = reinterpret_cast(UserPtr); if (!IsAligned(ChunkBeg, MinAlignment)) { dieWithMessage("ERROR: attempted to deallocate a chunk not properly " "aligned at address %p\n", UserPtr); } ScudoChunk *Chunk = reinterpret_cast(ChunkBeg - ChunkHeaderSize); UnpackedHeader OldHeader; Chunk->loadHeader(&OldHeader); if (OldHeader.State != ChunkAllocated) { dieWithMessage("ERROR: invalid chunk state when deallocating address " "%p\n", Chunk); } UnpackedHeader NewHeader = OldHeader; NewHeader.State = ChunkQuarantine; Chunk->compareExchangeHeader(&NewHeader, &OldHeader); if (DeallocationTypeMismatch) { // The deallocation type has to match the allocation one. if (NewHeader.AllocType != Type) { // With the exception of memalign'd Chunks, that can be still be free'd. if (NewHeader.AllocType != FromMemalign || Type != FromMalloc) { dieWithMessage("ERROR: allocation type mismatch on address %p\n", Chunk); } } } uptr Size = NewHeader.RequestedSize; if (DeleteSizeMismatch) { if (DeleteSize && DeleteSize != Size) { dieWithMessage("ERROR: invalid sized delete on chunk at address %p\n", Chunk); } } if (LIKELY(!ThreadTornDown)) { AllocatorQuarantine.Put(&ThreadQuarantineCache, QuarantineCallback(&Cache), Chunk, Size); } else { SpinMutexLock l(&FallbackMutex); AllocatorQuarantine.Put(&FallbackQuarantineCache, QuarantineCallback(&FallbackAllocatorCache), Chunk, Size); } } // Returns the actual usable size of a chunk. Since this requires loading the // header, we will return it in the second parameter, as it can be required // by the caller to perform additional processing. uptr getUsableSize(const void *Ptr, UnpackedHeader *Header) { if (UNLIKELY(!ThreadInited)) initThread(); if (!Ptr) return 0; uptr ChunkBeg = reinterpret_cast(Ptr); ScudoChunk *Chunk = reinterpret_cast(ChunkBeg - ChunkHeaderSize); Chunk->loadHeader(Header); // Getting the usable size of a chunk only makes sense if it's allocated. if (Header->State != ChunkAllocated) { dieWithMessage("ERROR: attempted to size a non-allocated chunk at " "address %p\n", Chunk); } uptr Size = BackendAllocator.GetActuallyAllocatedSize(Chunk->getAllocBeg(Header)); // UsableSize works as malloc_usable_size, which is also what (AFAIU) // tcmalloc's MallocExtension::GetAllocatedSize aims at providing. This // means we will return the size of the chunk from the user beginning to // the end of the 'user' allocation, hence us subtracting the header size // and the offset from the size. if (Size == 0) return Size; return Size - ChunkHeaderSize - (Header->Offset << MinAlignmentLog); } // Helper function that doesn't care about the header. uptr getUsableSize(const void *Ptr) { UnpackedHeader Header; return getUsableSize(Ptr, &Header); } // Reallocates a chunk. We can save on a new allocation if the new requested // size still fits in the chunk. void *reallocate(void *OldPtr, uptr NewSize) { if (UNLIKELY(!ThreadInited)) initThread(); UnpackedHeader OldHeader; uptr Size = getUsableSize(OldPtr, &OldHeader); uptr ChunkBeg = reinterpret_cast(OldPtr); ScudoChunk *Chunk = reinterpret_cast(ChunkBeg - ChunkHeaderSize); if (OldHeader.AllocType != FromMalloc) { dieWithMessage("ERROR: invalid chunk type when reallocating address %p\n", Chunk); } UnpackedHeader NewHeader = OldHeader; // The new size still fits in the current chunk. if (NewSize <= Size) { NewHeader.RequestedSize = NewSize; Chunk->compareExchangeHeader(&NewHeader, &OldHeader); return OldPtr; } // Otherwise, we have to allocate a new chunk and copy the contents of the // old one. void *NewPtr = allocate(NewSize, MinAlignment, FromMalloc); if (NewPtr) { uptr OldSize = OldHeader.RequestedSize; memcpy(NewPtr, OldPtr, Min(NewSize, OldSize)); NewHeader.State = ChunkQuarantine; Chunk->compareExchangeHeader(&NewHeader, &OldHeader); if (LIKELY(!ThreadTornDown)) { AllocatorQuarantine.Put(&ThreadQuarantineCache, QuarantineCallback(&Cache), Chunk, OldSize); } else { SpinMutexLock l(&FallbackMutex); AllocatorQuarantine.Put(&FallbackQuarantineCache, QuarantineCallback(&FallbackAllocatorCache), Chunk, OldSize); } } return NewPtr; } void *calloc(uptr NMemB, uptr Size) { if (UNLIKELY(!ThreadInited)) initThread(); uptr Total = NMemB * Size; if (Size != 0 && Total / Size != NMemB) // Overflow check return BackendAllocator.ReturnNullOrDieOnBadRequest(); void *Ptr = allocate(Total, MinAlignment, FromMalloc); // If ZeroContents, the content of the chunk has already been zero'd out. if (!ZeroContents && Ptr && BackendAllocator.FromPrimary(Ptr)) memset(Ptr, 0, getUsableSize(Ptr)); return Ptr; } void drainQuarantine() { AllocatorQuarantine.Drain(&ThreadQuarantineCache, QuarantineCallback(&Cache)); } }; static Allocator Instance(LINKER_INITIALIZED); static ScudoAllocator &getAllocator() { return Instance.BackendAllocator; } void initAllocator(const AllocatorOptions &Options) { Instance.init(Options); } void drainQuarantine() { Instance.drainQuarantine(); } void *scudoMalloc(uptr Size, AllocType Type) { return Instance.allocate(Size, MinAlignment, Type); } void scudoFree(void *Ptr, AllocType Type) { Instance.deallocate(Ptr, 0, Type); } void scudoSizedFree(void *Ptr, uptr Size, AllocType Type) { Instance.deallocate(Ptr, Size, Type); } void *scudoRealloc(void *Ptr, uptr Size) { if (!Ptr) return Instance.allocate(Size, MinAlignment, FromMalloc); if (Size == 0) { Instance.deallocate(Ptr, 0, FromMalloc); return nullptr; } return Instance.reallocate(Ptr, Size); } void *scudoCalloc(uptr NMemB, uptr Size) { return Instance.calloc(NMemB, Size); } void *scudoValloc(uptr Size) { return Instance.allocate(Size, GetPageSizeCached(), FromMemalign); } void *scudoMemalign(uptr Alignment, uptr Size) { return Instance.allocate(Size, Alignment, FromMemalign); } void *scudoPvalloc(uptr Size) { uptr PageSize = GetPageSizeCached(); Size = RoundUpTo(Size, PageSize); if (Size == 0) { // pvalloc(0) should allocate one page. Size = PageSize; } return Instance.allocate(Size, PageSize, FromMemalign); } int scudoPosixMemalign(void **MemPtr, uptr Alignment, uptr Size) { *MemPtr = Instance.allocate(Size, Alignment, FromMemalign); return 0; } void *scudoAlignedAlloc(uptr Alignment, uptr Size) { // size must be a multiple of the alignment. To avoid a division, we first // make sure that alignment is a power of 2. CHECK(IsPowerOfTwo(Alignment)); CHECK_EQ((Size & (Alignment - 1)), 0); return Instance.allocate(Size, Alignment, FromMalloc); } uptr scudoMallocUsableSize(void *Ptr) { return Instance.getUsableSize(Ptr); } } // namespace __scudo using namespace __scudo; // MallocExtension helper functions uptr __sanitizer_get_current_allocated_bytes() { uptr stats[AllocatorStatCount]; getAllocator().GetStats(stats); return stats[AllocatorStatAllocated]; } uptr __sanitizer_get_heap_size() { uptr stats[AllocatorStatCount]; getAllocator().GetStats(stats); return stats[AllocatorStatMapped]; } uptr __sanitizer_get_free_bytes() { return 1; } uptr __sanitizer_get_unmapped_bytes() { return 1; } uptr __sanitizer_get_estimated_allocated_size(uptr size) { return size; } int __sanitizer_get_ownership(const void *p) { return Instance.getUsableSize(p) != 0; } uptr __sanitizer_get_allocated_size(const void *p) { return Instance.getUsableSize(p); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_flags.cpp0000664000175000017500000000522612750216742026074 0ustar mwhudsonmwhudson//===-- scudo_flags.cpp -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Hardened Allocator flag parsing logic. /// //===----------------------------------------------------------------------===// #include "scudo_flags.h" #include "scudo_utils.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char* __scudo_default_options(); namespace __scudo { Flags ScudoFlags; // Use via getFlags(). void Flags::setDefaults() { #define SCUDO_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "scudo_flags.inc" #undef SCUDO_FLAG } static void RegisterScudoFlags(FlagParser *parser, Flags *f) { #define SCUDO_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "scudo_flags.inc" #undef SCUDO_FLAG } static const char *callGetScudoDefaultOptions() { return (&__scudo_default_options) ? __scudo_default_options() : ""; } void initFlags() { SetCommonFlagsDefaults(); { CommonFlags cf; cf.CopyFrom(*common_flags()); cf.exitcode = 1; OverrideCommonFlags(cf); } Flags *f = getFlags(); f->setDefaults(); FlagParser ScudoParser; RegisterScudoFlags(&ScudoParser, f); RegisterCommonFlags(&ScudoParser); // Override from user-specified string. const char *ScudoDefaultOptions = callGetScudoDefaultOptions(); ScudoParser.ParseString(ScudoDefaultOptions); // Override from environment. ScudoParser.ParseString(GetEnv("SCUDO_OPTIONS")); InitializeCommonFlags(); // Sanity checks and default settings for the Quarantine parameters. if (f->QuarantineSizeMb < 0) { const int DefaultQuarantineSizeMb = 64; f->QuarantineSizeMb = DefaultQuarantineSizeMb; } // We enforce an upper limit for the quarantine size of 4Gb. if (f->QuarantineSizeMb > (4 * 1024)) { dieWithMessage("ERROR: the quarantine size is too large\n"); } if (f->ThreadLocalQuarantineSizeKb < 0) { const int DefaultThreadLocalQuarantineSizeKb = 1024; f->ThreadLocalQuarantineSizeKb = DefaultThreadLocalQuarantineSizeKb; } // And an upper limit of 128Mb for the thread quarantine cache. if (f->ThreadLocalQuarantineSizeKb > (128 * 1024)) { dieWithMessage("ERROR: the per thread quarantine cache size is too " "large\n"); } } Flags *getFlags() { return &ScudoFlags; } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/scudo/scudo_utils.cpp0000664000175000017500000000721712773541641026146 0ustar mwhudsonmwhudson//===-- scudo_utils.cpp -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// Platform specific utility functions. /// //===----------------------------------------------------------------------===// #include "scudo_utils.h" #include #include #include #include #include // TODO(kostyak): remove __sanitizer *Printf uses in favor for our own less // complicated string formatting code. The following is a // temporary workaround to be able to use __sanitizer::VSNPrintf. namespace __sanitizer { extern int VSNPrintf(char *buff, int buff_length, const char *format, va_list args); } // namespace __sanitizer namespace __scudo { FORMAT(1, 2) void NORETURN dieWithMessage(const char *Format, ...) { // Our messages are tiny, 256 characters is more than enough. char Message[256]; va_list Args; va_start(Args, Format); __sanitizer::VSNPrintf(Message, sizeof(Message), Format, Args); va_end(Args); RawWrite(Message); Die(); } typedef struct { u32 Eax; u32 Ebx; u32 Ecx; u32 Edx; } CPUIDInfo; static void getCPUID(CPUIDInfo *info, u32 leaf, u32 subleaf) { asm volatile("cpuid" : "=a" (info->Eax), "=b" (info->Ebx), "=c" (info->Ecx), "=d" (info->Edx) : "a" (leaf), "c" (subleaf) ); } // Returns true is the CPU is a "GenuineIntel" or "AuthenticAMD" static bool isSupportedCPU() { CPUIDInfo Info; getCPUID(&Info, 0, 0); if (memcmp(reinterpret_cast(&Info.Ebx), "Genu", 4) == 0 && memcmp(reinterpret_cast(&Info.Edx), "ineI", 4) == 0 && memcmp(reinterpret_cast(&Info.Ecx), "ntel", 4) == 0) { return true; } if (memcmp(reinterpret_cast(&Info.Ebx), "Auth", 4) == 0 && memcmp(reinterpret_cast(&Info.Edx), "enti", 4) == 0 && memcmp(reinterpret_cast(&Info.Ecx), "cAMD", 4) == 0) { return true; } return false; } bool testCPUFeature(CPUFeature feature) { static bool InfoInitialized = false; static CPUIDInfo CPUInfo = {}; if (InfoInitialized == false) { if (isSupportedCPU() == true) getCPUID(&CPUInfo, 1, 0); else UNIMPLEMENTED(); InfoInitialized = true; } switch (feature) { case SSE4_2: return ((CPUInfo.Ecx >> 20) & 0x1) != 0; default: break; } return false; } // readRetry will attempt to read Count bytes from the Fd specified, and if // interrupted will retry to read additional bytes to reach Count. static ssize_t readRetry(int Fd, u8 *Buffer, size_t Count) { ssize_t AmountRead = 0; while (static_cast(AmountRead) < Count) { ssize_t Result = read(Fd, Buffer + AmountRead, Count - AmountRead); if (Result > 0) AmountRead += Result; else if (!Result) break; else if (errno != EINTR) { AmountRead = -1; break; } } return AmountRead; } // Default constructor for Xorshift128Plus seeds the state with /dev/urandom Xorshift128Plus::Xorshift128Plus() { int Fd = open("/dev/urandom", O_RDONLY); bool Success = readRetry(Fd, reinterpret_cast(&State_0_), sizeof(State_0_)) == sizeof(State_0_); Success &= readRetry(Fd, reinterpret_cast(&State_1_), sizeof(State_1_)) == sizeof(State_1_); close(Fd); if (!Success) { dieWithMessage("ERROR: failed to read enough data from /dev/urandom.\n"); } } } // namespace __scudo golang-1.8-race-detector-runtime_0.0+svn285455/lib/CMakeLists.txt0000664000175000017500000000343112755621021024511 0ustar mwhudsonmwhudson# First, add the subdirectories which contain feature-based runtime libraries # and several convenience helper libraries. include(AddCompilerRT) include(SanitizerUtils) # Hoist the building of sanitizer_common on whether we're building either the # sanitizers or xray (or both). # #TODO: Refactor sanitizer_common into smaller pieces (e.g. flag parsing, utils). if (COMPILER_RT_HAS_SANITIZER_COMMON AND (COMPILER_RT_BUILD_SANITIZERS OR COMPILER_RT_BUILD_XRAY)) add_subdirectory(sanitizer_common) endif() if(COMPILER_RT_BUILD_BUILTINS) add_subdirectory(builtins) endif() function(compiler_rt_build_runtime runtime) string(TOUPPER ${runtime} runtime_uppercase) if(COMPILER_RT_HAS_${runtime_uppercase}) add_subdirectory(${runtime}) foreach(directory ${ARGN}) add_subdirectory(${directory}) endforeach() endif() endfunction() function(compiler_rt_build_sanitizer sanitizer) string(TOUPPER ${sanitizer} sanitizer_uppercase) string(TOLOWER ${sanitizer} sanitizer_lowercase) list(FIND COMPILER_RT_SANITIZERS_TO_BUILD ${sanitizer_lowercase} result) if(NOT ${result} EQUAL -1) compiler_rt_build_runtime(${sanitizer} ${ARGN}) endif() endfunction() if(COMPILER_RT_BUILD_SANITIZERS) compiler_rt_build_runtime(interception) if(COMPILER_RT_HAS_SANITIZER_COMMON) add_subdirectory(stats) add_subdirectory(lsan) add_subdirectory(ubsan) endif() compiler_rt_build_sanitizer(asan) compiler_rt_build_sanitizer(dfsan) compiler_rt_build_sanitizer(msan) compiler_rt_build_sanitizer(tsan tsan/dd) compiler_rt_build_sanitizer(safestack) compiler_rt_build_sanitizer(cfi) compiler_rt_build_sanitizer(esan) compiler_rt_build_sanitizer(scudo) compiler_rt_build_runtime(profile) endif() if(COMPILER_RT_BUILD_XRAY) compiler_rt_build_runtime(xray) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/0000775000175000017500000000000013040224627022732 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_inmemory_log.cc0000664000175000017500000002124712775374264027033 0ustar mwhudsonmwhudson//===-- xray_inmemory_log.cc ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // Implementation of a simple in-memory log of XRay events. This defines a // logging function that's compatible with the XRay handler interface, and // routines for exporting data to files. // //===----------------------------------------------------------------------===// #include #include #include #include #include #include #include #include #include #if defined(__x86_64__) #include #elif defined(__arm__) static const int64_t NanosecondsPerSecond = 1000LL * 1000 * 1000; #else #error "Unsupported CPU Architecture" #endif /* CPU architecture */ #include "sanitizer_common/sanitizer_libc.h" #include "xray/xray_records.h" #include "xray_flags.h" #include "xray_interface_internal.h" // __xray_InMemoryRawLog will use a thread-local aligned buffer capped to a // certain size (32kb by default) and use it as if it were a circular buffer for // events. We store simple fixed-sized entries in the log for external analysis. extern "C" { void __xray_InMemoryRawLog(int32_t FuncId, XRayEntryType Type); } namespace __xray { std::mutex LogMutex; static void retryingWriteAll(int Fd, char *Begin, char *End) { if (Begin == End) return; auto TotalBytes = std::distance(Begin, End); while (auto Written = write(Fd, Begin, TotalBytes)) { if (Written < 0) { if (errno == EINTR) continue; // Try again. Report("Failed to write; errno = %d", errno); return; } TotalBytes -= Written; if (TotalBytes == 0) break; Begin += Written; } } #if defined(__x86_64__) static std::pair retryingReadSome(int Fd, char *Begin, char *End) { auto BytesToRead = std::distance(Begin, End); ssize_t BytesRead; ssize_t TotalBytesRead = 0; while (BytesToRead && (BytesRead = read(Fd, Begin, BytesToRead))) { if (BytesRead == -1) { if (errno == EINTR) continue; Report("Read error; errno = %d", errno); return std::make_pair(TotalBytesRead, false); } TotalBytesRead += BytesRead; BytesToRead -= BytesRead; Begin += BytesRead; } return std::make_pair(TotalBytesRead, true); } static bool readValueFromFile(const char *Filename, long long *Value) { int Fd = open(Filename, O_RDONLY | O_CLOEXEC); if (Fd == -1) return false; static constexpr size_t BufSize = 256; char Line[BufSize] = {}; ssize_t BytesRead; bool Success; std::tie(BytesRead, Success) = retryingReadSome(Fd, Line, Line + BufSize); if (!Success) return false; close(Fd); char *End = nullptr; long long Tmp = internal_simple_strtoll(Line, &End, 10); bool Result = false; if (Line[0] != '\0' && (*End == '\n' || *End == '\0')) { *Value = Tmp; Result = true; } return Result; } #endif /* CPU architecture */ class ThreadExitFlusher { int Fd; XRayRecord *Start; size_t &Offset; public: explicit ThreadExitFlusher(int Fd, XRayRecord *Start, size_t &Offset) : Fd(Fd), Start(Start), Offset(Offset) {} ~ThreadExitFlusher() { std::lock_guard L(LogMutex); if (Fd > 0 && Start != nullptr) { retryingWriteAll(Fd, reinterpret_cast(Start), reinterpret_cast(Start + Offset)); // Because this thread's exit could be the last one trying to write to the // file and that we're not able to close out the file properly, we sync // instead and hope that the pending writes are flushed as the thread // exits. fsync(Fd); } } }; } // namespace __xray using namespace __xray; void PrintToStdErr(const char *Buffer) { fprintf(stderr, "%s", Buffer); } void __xray_InMemoryRawLog(int32_t FuncId, XRayEntryType Type) { using Buffer = std::aligned_storage::type; static constexpr size_t BuffLen = 1024; thread_local static Buffer InMemoryBuffer[BuffLen] = {}; thread_local static size_t Offset = 0; static int Fd = [] { // FIXME: Figure out how to make this less stderr-dependent. SetPrintfAndReportCallback(PrintToStdErr); // Open a temporary file once for the log. static char TmpFilename[256] = {}; static char TmpWildcardPattern[] = "XXXXXX"; auto E = internal_strncat(TmpFilename, flags()->xray_logfile_base, sizeof(TmpFilename) - 10); if (static_cast((E + 6) - TmpFilename) > (sizeof(TmpFilename) - 1)) { Report("XRay log file base too long: %s", flags()->xray_logfile_base); return -1; } internal_strncat(TmpFilename, TmpWildcardPattern, sizeof(TmpWildcardPattern) - 1); int Fd = mkstemp(TmpFilename); if (Fd == -1) { Report("XRay: Failed opening temporary file '%s'; not logging events.", TmpFilename); return -1; } if (Verbosity()) fprintf(stderr, "XRay: Log file in '%s'\n", TmpFilename); // Get the cycle frequency from SysFS on Linux. long long CPUFrequency = -1; #if defined(__x86_64__) if (readValueFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &CPUFrequency)) { CPUFrequency *= 1000; } else if (readValueFromFile( "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", &CPUFrequency)) { CPUFrequency *= 1000; } else { Report("Unable to determine CPU frequency for TSC accounting."); } #elif defined(__arm__) // There is no instruction like RDTSCP in user mode on ARM. ARM's CP15 does // not have a constant frequency like TSC on x86(_64), it may go faster // or slower depending on CPU turbo or power saving mode. Furthermore, // to read from CP15 on ARM a kernel modification or a driver is needed. // We can not require this from users of compiler-rt. // So on ARM we use clock_gettime() which gives the result in nanoseconds. // To get the measurements per second, we scale this by the number of // nanoseconds per second, pretending that the TSC frequency is 1GHz and // one TSC tick is 1 nanosecond. CPUFrequency = NanosecondsPerSecond; #else #error "Unsupported CPU Architecture" #endif /* CPU architecture */ // Since we're here, we get to write the header. We set it up so that the // header will only be written once, at the start, and let the threads // logging do writes which just append. XRayFileHeader Header; Header.Version = 1; Header.Type = FileTypes::NAIVE_LOG; Header.CycleFrequency = CPUFrequency == -1 ? 0 : static_cast(CPUFrequency); // FIXME: Actually check whether we have 'constant_tsc' and 'nonstop_tsc' // before setting the values in the header. Header.ConstantTSC = 1; Header.NonstopTSC = 1; retryingWriteAll(Fd, reinterpret_cast(&Header), reinterpret_cast(&Header) + sizeof(Header)); return Fd; }(); if (Fd == -1) return; thread_local __xray::ThreadExitFlusher Flusher( Fd, reinterpret_cast<__xray::XRayRecord *>(InMemoryBuffer), Offset); thread_local pid_t TId = syscall(SYS_gettid); // First we get the useful data, and stuff it into the already aligned buffer // through a pointer offset. auto &R = reinterpret_cast<__xray::XRayRecord *>(InMemoryBuffer)[Offset]; R.RecordType = RecordTypes::NORMAL; #if defined(__x86_64__) { unsigned CPU; R.TSC = __rdtscp(&CPU); R.CPU = CPU; } #elif defined(__arm__) { timespec TS; int result = clock_gettime(CLOCK_REALTIME, &TS); if (result != 0) { Report("clock_gettime() returned %d, errno=%d.", result, int(errno)); TS.tv_sec = 0; TS.tv_nsec = 0; } R.TSC = TS.tv_sec * NanosecondsPerSecond + TS.tv_nsec; R.CPU = 0; } #else #error "Unsupported CPU Architecture" #endif /* CPU architecture */ R.TId = TId; R.Type = Type; R.FuncId = FuncId; ++Offset; if (Offset == BuffLen) { std::lock_guard L(LogMutex); auto RecordBuffer = reinterpret_cast<__xray::XRayRecord *>(InMemoryBuffer); retryingWriteAll(Fd, reinterpret_cast(RecordBuffer), reinterpret_cast(RecordBuffer + Offset)); Offset = 0; } } static auto Unused = [] { if (flags()->xray_naive_log) __xray_set_handler(__xray_InMemoryRawLog); return true; }(); golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_interface.cc0000664000175000017500000001421313000017506026235 0ustar mwhudsonmwhudson//===-- xray_interface.cpp --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // Implementation of the API functions. // //===----------------------------------------------------------------------===// #include "xray_interface_internal.h" #include #include #include #include #include #include #include "sanitizer_common/sanitizer_common.h" namespace __xray { #if defined(__x86_64__) // FIXME: The actual length is 11 bytes. Why was length 12 passed to mprotect() // ? static const int16_t cSledLength = 12; #elif defined(__arm__) static const int16_t cSledLength = 28; #else #error "Unsupported CPU Architecture" #endif /* CPU architecture */ // This is the function to call when we encounter the entry or exit sleds. std::atomic XRayPatchedFunction{nullptr}; // MProtectHelper is an RAII wrapper for calls to mprotect(...) that will undo // any successful mprotect(...) changes. This is used to make a page writeable // and executable, and upon destruction if it was successful in doing so returns // the page into a read-only and executable page. // // This is only used specifically for runtime-patching of the XRay // instrumentation points. This assumes that the executable pages are originally // read-and-execute only. class MProtectHelper { void *PageAlignedAddr; std::size_t MProtectLen; bool MustCleanup; public: explicit MProtectHelper(void *PageAlignedAddr, std::size_t MProtectLen) : PageAlignedAddr(PageAlignedAddr), MProtectLen(MProtectLen), MustCleanup(false) {} int MakeWriteable() { auto R = mprotect(PageAlignedAddr, MProtectLen, PROT_READ | PROT_WRITE | PROT_EXEC); if (R != -1) MustCleanup = true; return R; } ~MProtectHelper() { if (MustCleanup) { mprotect(PageAlignedAddr, MProtectLen, PROT_READ | PROT_EXEC); } } }; } // namespace __xray extern std::atomic XRayInitialized; extern std::atomic<__xray::XRaySledMap> XRayInstrMap; int __xray_set_handler(void (*entry)(int32_t, XRayEntryType)) { if (XRayInitialized.load(std::memory_order_acquire)) { __xray::XRayPatchedFunction.store(entry, std::memory_order_release); return 1; } return 0; } int __xray_remove_handler() { return __xray_set_handler(nullptr); } std::atomic XRayPatching{false}; using namespace __xray; // FIXME: Figure out whether we can move this class to sanitizer_common instead // as a generic "scope guard". template class CleanupInvoker { Function Fn; public: explicit CleanupInvoker(Function Fn) : Fn(Fn) {} CleanupInvoker(const CleanupInvoker &) = default; CleanupInvoker(CleanupInvoker &&) = default; CleanupInvoker &operator=(const CleanupInvoker &) = delete; CleanupInvoker &operator=(CleanupInvoker &&) = delete; ~CleanupInvoker() { Fn(); } }; template CleanupInvoker ScopeCleanup(Function Fn) { return CleanupInvoker{Fn}; } // ControlPatching implements the common internals of the patching/unpatching // implementation. |Enable| defines whether we're enabling or disabling the // runtime XRay instrumentation. XRayPatchingStatus ControlPatching(bool Enable) { if (!XRayInitialized.load(std::memory_order_acquire)) return XRayPatchingStatus::NOT_INITIALIZED; // Not initialized. static bool NotPatching = false; if (!XRayPatching.compare_exchange_strong(NotPatching, true, std::memory_order_acq_rel, std::memory_order_acquire)) { return XRayPatchingStatus::ONGOING; // Already patching. } bool PatchingSuccess = false; auto XRayPatchingStatusResetter = ScopeCleanup([&PatchingSuccess] { if (!PatchingSuccess) { XRayPatching.store(false, std::memory_order_release); } }); // Step 1: Compute the function id, as a unique identifier per function in the // instrumentation map. XRaySledMap InstrMap = XRayInstrMap.load(std::memory_order_acquire); if (InstrMap.Entries == 0) return XRayPatchingStatus::NOT_INITIALIZED; const uint64_t PageSize = GetPageSizeCached(); if ((PageSize == 0) || ((PageSize & (PageSize - 1)) != 0)) { Report("System page size is not a power of two: %lld", PageSize); return XRayPatchingStatus::FAILED; } uint32_t FuncId = 1; uint64_t CurFun = 0; for (std::size_t I = 0; I < InstrMap.Entries; I++) { auto Sled = InstrMap.Sleds[I]; auto F = Sled.Function; if (CurFun == 0) CurFun = F; if (F != CurFun) { ++FuncId; CurFun = F; } // While we're here, we should patch the nop sled. To do that we mprotect // the page containing the function to be writeable. void *PageAlignedAddr = reinterpret_cast(Sled.Address & ~(PageSize - 1)); std::size_t MProtectLen = (Sled.Address + cSledLength) - reinterpret_cast(PageAlignedAddr); MProtectHelper Protector(PageAlignedAddr, MProtectLen); if (Protector.MakeWriteable() == -1) { printf("Failed mprotect: %d\n", errno); return XRayPatchingStatus::FAILED; } bool Success = false; switch (Sled.Kind) { case XRayEntryType::ENTRY: Success = patchFunctionEntry(Enable, FuncId, Sled); break; case XRayEntryType::EXIT: Success = patchFunctionExit(Enable, FuncId, Sled); break; case XRayEntryType::TAIL: Success = patchFunctionTailExit(Enable, FuncId, Sled); break; default: Report("Unsupported sled kind: %d", int(Sled.Kind)); continue; } (void)Success; } XRayPatching.store(false, std::memory_order_release); PatchingSuccess = true; return XRayPatchingStatus::SUCCESS; } XRayPatchingStatus __xray_patch() { return ControlPatching(true); } XRayPatchingStatus __xray_unpatch() { return ControlPatching(false); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_flags.h0000664000175000017500000000171612744076113025254 0ustar mwhudsonmwhudson//===-- xray_flags.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instruementation system. // // XRay runtime flags. //===----------------------------------------------------------------------===// #ifndef XRAY_FLAGS_H #define XRAY_FLAGS_H #include "sanitizer_common/sanitizer_flag_parser.h" namespace __xray { struct Flags { #define XRAY_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "xray_flags.inc" #undef XRAY_FLAG void SetDefaults(); }; extern Flags xray_flags_dont_use_directly; inline Flags *flags() { return &xray_flags_dont_use_directly; } void InitializeFlags(); } // namespace __xray #endif // XRAY_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/CMakeLists.txt0000664000175000017500000000212112770244515025475 0ustar mwhudsonmwhudson# Build for the XRay runtime support library. set(XRAY_SOURCES xray_init.cc xray_interface.cc xray_flags.cc xray_inmemory_log.cc ) set(x86_64_SOURCES xray_x86_64.cc xray_trampoline_x86_64.S ${XRAY_SOURCES}) set(arm_SOURCES xray_arm.cc xray_trampoline_arm.S ${XRAY_SOURCES}) set(armhf_SOURCES ${arm_SOURCES}) include_directories(..) include_directories(../../include) set(XRAY_CFLAGS ${SANITIZER_COMMON_CFLAGS}) set(XRAY_COMMON_DEFINITIONS XRAY_HAS_EXCEPTIONS=1) add_compiler_rt_object_libraries(RTXray ARCHS ${XRAY_SUPPORTED_ARCH} SOURCES ${XRAY_SOURCES} CFLAGS ${XRAY_CFLAGS} DEFS ${XRAY_COMMON_DEFINITIONS}) add_compiler_rt_component(xray) set(XRAY_COMMON_RUNTIME_OBJECT_LIBS RTSanitizerCommon RTSanitizerCommonLibc) foreach (arch ${XRAY_SUPPORTED_ARCH}) if (CAN_TARGET_${arch}) add_compiler_rt_runtime(clang_rt.xray STATIC ARCHS ${arch} SOURCES ${${arch}_SOURCES} CFLAGS ${XRAY_CFLAGS} DEFS ${XRAY_COMMON_DEFINITIONS} OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS} PARENT_TARGET xray) endif () endforeach() golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_trampoline_x86_64.S0000664000175000017500000000536212757762045027336 0ustar mwhudsonmwhudson//===-- xray_trampoline_x86.s -----------------------------------*- ASM -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // This implements the X86-specific assembler for the trampolines. // //===----------------------------------------------------------------------===// .text .file "xray_trampoline_x86.S" .globl __xray_FunctionEntry .align 16, 0x90 .type __xray_FunctionEntry,@function __xray_FunctionEntry: .cfi_startproc // Save caller provided registers before doing any actual work. pushq %rbp .cfi_def_cfa_offset 16 subq $200, %rsp movupd %xmm0, 184(%rsp) movupd %xmm1, 168(%rsp) movupd %xmm2, 152(%rsp) movupd %xmm3, 136(%rsp) movupd %xmm4, 120(%rsp) movupd %xmm5, 104(%rsp) movupd %xmm6, 88(%rsp) movupd %xmm7, 72(%rsp) movq %rdi, 64(%rsp) movq %rax, 56(%rsp) movq %rdx, 48(%rsp) movq %rsi, 40(%rsp) movq %rcx, 32(%rsp) movq %r8, 24(%rsp) movq %r9, 16(%rsp) // de-mangled, that's __xray::XRayPatchedFunction, and we're doing an acquire // load (on x86 is a normal mov instruction). movq _ZN6__xray19XRayPatchedFunctionE(%rip), %rax testq %rax, %rax je .Ltmp0 // assume that %r10d has the function id. movl %r10d, %edi xor %esi,%esi callq *%rax .Ltmp0: // restore the registers movupd 184(%rsp), %xmm0 movupd 168(%rsp), %xmm1 movupd 152(%rsp), %xmm2 movupd 136(%rsp), %xmm3 movupd 120(%rsp), %xmm4 movupd 104(%rsp), %xmm5 movupd 88(%rsp) , %xmm6 movupd 72(%rsp) , %xmm7 movq 64(%rsp), %rdi movq 56(%rsp), %rax movq 48(%rsp), %rdx movq 40(%rsp), %rsi movq 32(%rsp), %rcx movq 24(%rsp), %r8 movq 16(%rsp), %r9 addq $200, %rsp popq %rbp retq .Ltmp1: .size __xray_FunctionEntry, .Ltmp1-__xray_FunctionEntry .cfi_endproc .globl __xray_FunctionExit .align 16, 0x90 .type __xray_FunctionExit,@function __xray_FunctionExit: .cfi_startproc // Save the important registers first. Since we're assuming that this // function is only jumped into, we only preserve the registers for // returning. pushq %rbp .cfi_def_cfa_offset 16 subq $56, %rsp .cfi_def_cfa_offset 32 movupd %xmm0, 40(%rsp) movupd %xmm1, 24(%rsp) movq %rax, 16(%rsp) movq %rdx, 8(%rsp) movq _ZN6__xray19XRayPatchedFunctionE(%rip), %rax testq %rax,%rax je .Ltmp2 movl %r10d, %edi movl $1, %esi callq *%rax .Ltmp2: // Restore the important registers. movupd 40(%rsp), %xmm0 movupd 24(%rsp), %xmm1 movq 16(%rsp), %rax movq 8(%rsp), %rdx addq $56, %rsp popq %rbp retq .Ltmp3: .size __xray_FunctionExit, .Ltmp3-__xray_FunctionExit .cfi_endproc golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_arm.cc0000664000175000017500000001172513000017506025061 0ustar mwhudsonmwhudson//===-- xray_arm.cc ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // Implementation of ARM-specific routines (32-bit). // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "xray_interface_internal.h" #include #include namespace __xray { // The machine codes for some instructions used in runtime patching. enum class PatchOpcodes : uint32_t { PO_PushR0Lr = 0xE92D4001, // PUSH {r0, lr} PO_BlxIp = 0xE12FFF3C, // BLX ip PO_PopR0Lr = 0xE8BD4001, // POP {r0, lr} PO_B20 = 0xEA000005 // B #20 }; // 0xUUUUWXYZ -> 0x000W0XYZ inline static uint32_t getMovwMask(const uint32_t Value) { return (Value & 0xfff) | ((Value & 0xf000) << 4); } // 0xWXYZUUUU -> 0x000W0XYZ inline static uint32_t getMovtMask(const uint32_t Value) { return getMovwMask(Value >> 16); } // Writes the following instructions: // MOVW R, # // MOVT R, # inline static uint32_t *write32bitLoadReg(uint8_t regNo, uint32_t *Address, const uint32_t Value) { // This is a fatal error: we cannot just report it and continue execution. assert(regNo <= 15 && "Register number must be 0 to 15."); // MOVW R, #0xWXYZ in machine code is 0xE30WRXYZ *Address = (0xE3000000 | (uint32_t(regNo) << 12) | getMovwMask(Value)); Address++; // MOVT R, #0xWXYZ in machine code is 0xE34WRXYZ *Address = (0xE3400000 | (uint32_t(regNo) << 12) | getMovtMask(Value)); return Address + 1; } // Writes the following instructions: // MOVW r0, # // MOVT r0, # inline static uint32_t *Write32bitLoadR0(uint32_t *Address, const uint32_t Value) { return write32bitLoadReg(0, Address, Value); } // Writes the following instructions: // MOVW ip, # // MOVT ip, # inline static uint32_t *Write32bitLoadIP(uint32_t *Address, const uint32_t Value) { return write32bitLoadReg(12, Address, Value); } inline static bool patchSled(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled, void (*TracingHook)()) { // When |Enable| == true, // We replace the following compile-time stub (sled): // // xray_sled_n: // B #20 // 6 NOPs (24 bytes) // // With the following runtime patch: // // xray_sled_n: // PUSH {r0, lr} // MOVW r0, # // MOVT r0, # // MOVW ip, # // MOVT ip, # // BLX ip // POP {r0, lr} // // Replacement of the first 4-byte instruction should be the last and atomic // operation, so that the user code which reaches the sled concurrently // either jumps over the whole sled, or executes the whole sled when the // latter is ready. // // When |Enable|==false, we set back the first instruction in the sled to be // B #20 uint32_t *FirstAddress = reinterpret_cast(Sled.Address); if (Enable) { uint32_t *CurAddress = FirstAddress + 1; CurAddress = Write32bitLoadR0(CurAddress, reinterpret_cast(FuncId)); CurAddress = Write32bitLoadIP(CurAddress, reinterpret_cast(TracingHook)); *CurAddress = uint32_t(PatchOpcodes::PO_BlxIp); CurAddress++; *CurAddress = uint32_t(PatchOpcodes::PO_PopR0Lr); std::atomic_store_explicit( reinterpret_cast *>(FirstAddress), uint32_t(PatchOpcodes::PO_PushR0Lr), std::memory_order_release); } else { std::atomic_store_explicit( reinterpret_cast *>(FirstAddress), uint32_t(PatchOpcodes::PO_B20), std::memory_order_release); } return true; } bool patchFunctionEntry(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled) { return patchSled(Enable, FuncId, Sled, __xray_FunctionEntry); } bool patchFunctionExit(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled) { return patchSled(Enable, FuncId, Sled, __xray_FunctionExit); } bool patchFunctionTailExit(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled) { // FIXME: In the future we'd need to distinguish between non-tail exits and // tail exits for better information preservation. return patchSled(Enable, FuncId, Sled, __xray_FunctionExit); } } // namespace __xray golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_init.cc0000664000175000017500000000472412766606132025267 0ustar mwhudsonmwhudson//===-- xray_init.cc --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // XRay initialisation logic. //===----------------------------------------------------------------------===// #include #include #include #include #include "sanitizer_common/sanitizer_common.h" #include "xray_flags.h" #include "xray_interface_internal.h" extern "C" { void __xray_init(); extern const XRaySledEntry __start_xray_instr_map[] __attribute__((weak)); extern const XRaySledEntry __stop_xray_instr_map[] __attribute__((weak)); } using namespace __sanitizer; using namespace __xray; // When set to 'true' this means the XRay runtime has been initialised. We use // the weak symbols defined above (__start_xray_inst_map and // __stop_xray_instr_map) to initialise the instrumentation map that XRay uses // for runtime patching/unpatching of instrumentation points. // // FIXME: Support DSO instrumentation maps too. The current solution only works // for statically linked executables. std::atomic XRayInitialized{false}; // This should always be updated before XRayInitialized is updated. std::atomic<__xray::XRaySledMap> XRayInstrMap{}; // __xray_init() will do the actual loading of the current process' memory map // and then proceed to look for the .xray_instr_map section/segment. void __xray_init() { InitializeFlags(); if (__start_xray_instr_map == nullptr) { Report("XRay instrumentation map missing. Not initializing XRay.\n"); return; } // Now initialize the XRayInstrMap global struct with the address of the // entries, reinterpreted as an array of XRaySledEntry objects. We use the // virtual pointer we have from the section to provide us the correct // information. __xray::XRaySledMap SledMap{}; SledMap.Sleds = __start_xray_instr_map; SledMap.Entries = __stop_xray_instr_map - __start_xray_instr_map; XRayInstrMap.store(SledMap, std::memory_order_release); XRayInitialized.store(true, std::memory_order_release); if (flags()->patch_premain) __xray_patch(); } __attribute__((section(".preinit_array"), used)) void (*__local_xray_preinit)(void) = __xray_init; golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_x86_64.cc0000664000175000017500000001316413000017506025237 0ustar mwhudsonmwhudson#include "sanitizer_common/sanitizer_common.h" #include "xray_interface_internal.h" #include #include #include namespace __xray { static constexpr uint8_t CallOpCode = 0xe8; static constexpr uint16_t MovR10Seq = 0xba41; static constexpr uint16_t Jmp9Seq = 0x09eb; static constexpr uint8_t JmpOpCode = 0xe9; static constexpr uint8_t RetOpCode = 0xc3; static constexpr int64_t MinOffset{std::numeric_limits::min()}; static constexpr int64_t MaxOffset{std::numeric_limits::max()}; bool patchFunctionEntry(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled) { // Here we do the dance of replacing the following sled: // // xray_sled_n: // jmp +9 // <9 byte nop> // // With the following: // // mov r10d, // call // // We need to do this in the following order: // // 1. Put the function id first, 2 bytes from the start of the sled (just // after the 2-byte jmp instruction). // 2. Put the call opcode 6 bytes from the start of the sled. // 3. Put the relative offset 7 bytes from the start of the sled. // 4. Do an atomic write over the jmp instruction for the "mov r10d" // opcode and first operand. // // Prerequisite is to compute the relative offset to the // __xray_FunctionEntry function's address. int64_t TrampolineOffset = reinterpret_cast(__xray_FunctionEntry) - (static_cast(Sled.Address) + 11); if (TrampolineOffset < MinOffset || TrampolineOffset > MaxOffset) { Report("XRay Entry trampoline (%p) too far from sled (%p); distance = " "%ld\n", __xray_FunctionEntry, reinterpret_cast(Sled.Address), TrampolineOffset); return false; } if (Enable) { *reinterpret_cast(Sled.Address + 2) = FuncId; *reinterpret_cast(Sled.Address + 6) = CallOpCode; *reinterpret_cast(Sled.Address + 7) = TrampolineOffset; std::atomic_store_explicit( reinterpret_cast *>(Sled.Address), MovR10Seq, std::memory_order_release); } else { std::atomic_store_explicit( reinterpret_cast *>(Sled.Address), Jmp9Seq, std::memory_order_release); // FIXME: Write out the nops still? } return true; } bool patchFunctionExit(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled) { // Here we do the dance of replacing the following sled: // // xray_sled_n: // ret // <10 byte nop> // // With the following: // // mov r10d, // jmp // // 1. Put the function id first, 2 bytes from the start of the sled (just // after the 1-byte ret instruction). // 2. Put the jmp opcode 6 bytes from the start of the sled. // 3. Put the relative offset 7 bytes from the start of the sled. // 4. Do an atomic write over the jmp instruction for the "mov r10d" // opcode and first operand. // // Prerequisite is to compute the relative offset fo the // __xray_FunctionExit function's address. int64_t TrampolineOffset = reinterpret_cast(__xray_FunctionExit) - (static_cast(Sled.Address) + 11); if (TrampolineOffset < MinOffset || TrampolineOffset > MaxOffset) { Report("XRay Exit trampoline (%p) too far from sled (%p); distance = " "%ld\n", __xray_FunctionExit, reinterpret_cast(Sled.Address), TrampolineOffset); return false; } if (Enable) { *reinterpret_cast(Sled.Address + 2) = FuncId; *reinterpret_cast(Sled.Address + 6) = JmpOpCode; *reinterpret_cast(Sled.Address + 7) = TrampolineOffset; std::atomic_store_explicit( reinterpret_cast *>(Sled.Address), MovR10Seq, std::memory_order_release); } else { std::atomic_store_explicit( reinterpret_cast *>(Sled.Address), RetOpCode, std::memory_order_release); // FIXME: Write out the nops still? } return true; } bool patchFunctionTailExit(const bool Enable, const uint32_t FuncId, const XRaySledEntry &Sled) { // Here we do the dance of replacing the tail call sled with a similar // sequence as the entry sled, but calls the exit sled instead, so we can // treat tail call exits as if they were normal exits. // // FIXME: In the future we'd need to distinguish between non-tail exits and // tail exits for better information preservation. int64_t TrampolineOffset = reinterpret_cast(__xray_FunctionExit) - (static_cast(Sled.Address) + 11); if (TrampolineOffset < MinOffset || TrampolineOffset > MaxOffset) { Report("XRay Exit trampoline (%p) too far from sled (%p); distance = " "%ld\n", __xray_FunctionExit, reinterpret_cast(Sled.Address), TrampolineOffset); return false; } if (Enable) { *reinterpret_cast(Sled.Address + 2) = FuncId; *reinterpret_cast(Sled.Address + 6) = CallOpCode; *reinterpret_cast(Sled.Address + 7) = TrampolineOffset; std::atomic_store_explicit( reinterpret_cast *>(Sled.Address), MovR10Seq, std::memory_order_release); } else { std::atomic_store_explicit( reinterpret_cast *>(Sled.Address), Jmp9Seq, std::memory_order_release); // FIXME: Write out the nops still? } return true; } } // namespace __xray golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_flags.cc0000664000175000017500000000316012744076113025405 0ustar mwhudsonmwhudson//===-- xray_flags.cc -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // XRay flag parsing logic. //===----------------------------------------------------------------------===// #include "xray_flags.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_libc.h" using namespace __sanitizer; namespace __xray { Flags xray_flags_dont_use_directly; // use via flags(). void Flags::SetDefaults() { #define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "xray_flags.inc" #undef XRAY_FLAG } static void RegisterXRayFlags(FlagParser *P, Flags *F) { #define XRAY_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(P, #Name, Description, &F->Name); #include "xray_flags.inc" #undef XRAY_FLAG } void InitializeFlags() { SetCommonFlagsDefaults(); auto *F = flags(); F->SetDefaults(); FlagParser XRayParser; RegisterXRayFlags(&XRayParser, F); RegisterCommonFlags(&XRayParser); // Override from command line. XRayParser.ParseString(GetEnv("XRAY_OPTIONS")); InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) { XRayParser.PrintFlagDescriptions(); } } } // namespace __xray golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_interface_internal.h0000664000175000017500000000350113000017506027771 0ustar mwhudsonmwhudson//===-- xray_interface_internal.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of XRay, a dynamic runtime instrumentation system. // // Implementation of the API functions. See also include/xray/xray_interface.h. // //===----------------------------------------------------------------------===// #ifndef XRAY_INTERFACE_INTERNAL_H #define XRAY_INTERFACE_INTERNAL_H #include "sanitizer_common/sanitizer_platform.h" #include "xray/xray_interface.h" #include #include extern "C" { struct XRaySledEntry { #if SANITIZER_WORDSIZE == 64 uint64_t Address; uint64_t Function; unsigned char Kind; unsigned char AlwaysInstrument; unsigned char Padding[14]; // Need 32 bytes #elif SANITIZER_WORDSIZE == 32 uint32_t Address; uint32_t Function; unsigned char Kind; unsigned char AlwaysInstrument; unsigned char Padding[6]; // Need 16 bytes #else #error "Unsupported word size." #endif }; } namespace __xray { struct XRaySledMap { const XRaySledEntry *Sleds; size_t Entries; }; bool patchFunctionEntry(bool Enable, uint32_t FuncId, const XRaySledEntry &Sled); bool patchFunctionExit(bool Enable, uint32_t FuncId, const XRaySledEntry &Sled); bool patchFunctionTailExit(bool Enable, uint32_t FuncId, const XRaySledEntry &Sled); } // namespace __xray extern "C" { // The following functions have to be defined in assembler, on a per-platform // basis. See xray_trampoline_*.S files for implementations. extern void __xray_FunctionEntry(); extern void __xray_FunctionExit(); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_flags.inc0000664000175000017500000000151112757762045025601 0ustar mwhudsonmwhudson//===-- xray_flags.inc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // XRay runtime flags. // //===----------------------------------------------------------------------===// #ifndef XRAY_FLAG #error "Define XRAY_FLAG prior to including this file!" #endif XRAY_FLAG(bool, patch_premain, true, "Whether to patch instrumentation points before main.") XRAY_FLAG(bool, xray_naive_log, true, "Whether to install the naive log implementation.") XRAY_FLAG(const char *, xray_logfile_base, "xray-log.", "Filename base for the xray logfile.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/xray/xray_trampoline_arm.S0000664000175000017500000000452312770244515027145 0ustar mwhudsonmwhudson .syntax unified .arch armv6t2 .fpu vfpv2 .code 32 .global _ZN6__xray19XRayPatchedFunctionE @ Word-aligned function entry point .p2align 2 @ Let C/C++ see the symbol .global __xray_FunctionEntry @ It preserves all registers except r0, r12(ip), r14(lr) and r15(pc) @ Assume that "q" part of the floating-point registers is not used @ for passing parameters to C/C++ functions. .type __xray_FunctionEntry, %function @ In C++ it is void extern "C" __xray_FunctionEntry(uint32_t FuncId) with @ FuncId passed in r0 register. __xray_FunctionEntry: PUSH {r1-r3,lr} @ Save floating-point parameters of the instrumented function VPUSH {d0-d7} MOVW r1,#:lower16:_ZN6__xray19XRayPatchedFunctionE MOVT r1,#:upper16:_ZN6__xray19XRayPatchedFunctionE LDR r2, [r1] @ Handler address is nullptr if handler is not set CMP r2, #0 BEQ FunctionEntry_restore @ Function ID is already in r0 (the first parameter). @ r1=0 means that we are tracing an entry event MOV r1, #0 @ Call the handler with 2 parameters in r0 and r1 BLX r2 FunctionEntry_restore: @ Restore floating-point parameters of the instrumented function VPOP {d0-d7} POP {r1-r3,pc} @ Word-aligned function entry point .p2align 2 @ Let C/C++ see the symbol .global __xray_FunctionExit @ Assume that d1-d7 are not used for the return value. @ Assume that "q" part of the floating-point registers is not used for the @ return value in C/C++. .type __xray_FunctionExit, %function @ In C++ it is extern "C" void __xray_FunctionExit(uint32_t FuncId) with @ FuncId passed in r0 register. __xray_FunctionExit: PUSH {r1-r3,lr} @ Save the floating-point return value of the instrumented function VPUSH {d0} @ Load the handler address MOVW r1,#:lower16:_ZN6__xray19XRayPatchedFunctionE MOVT r1,#:upper16:_ZN6__xray19XRayPatchedFunctionE LDR r2, [r1] @ Handler address is nullptr if handler is not set CMP r2, #0 BEQ FunctionExit_restore @ Function ID is already in r0 (the first parameter). @ 1 means that we are tracing an exit event MOV r1, #1 @ Call the handler with 2 parameters in r0 and r1 BLX r2 FunctionExit_restore: @ Restore the floating-point return value of the instrumented function VPOP {d0} POP {r1-r3,pc} golang-1.8-race-detector-runtime_0.0+svn285455/lib/cfi/0000775000175000017500000000000013040224626022507 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/cfi/cfi.cc0000664000175000017500000003072612766606132023601 0ustar mwhudsonmwhudson//===-------- cfi.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements the runtime support for the cross-DSO CFI. // //===----------------------------------------------------------------------===// #include #include #include #include #include typedef ElfW(Phdr) Elf_Phdr; typedef ElfW(Ehdr) Elf_Ehdr; #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "ubsan/ubsan_init.h" #include "ubsan/ubsan_flags.h" #ifdef CFI_ENABLE_DIAG #include "ubsan/ubsan_handlers.h" #endif using namespace __sanitizer; namespace __cfi { #define kCfiShadowLimitsStorageSize 4096 // 1 page // Lets hope that the data segment is mapped with 4K pages. // The pointer to the cfi shadow region is stored at the start of this page. // The rest of the page is unused and re-mapped read-only. static union { char space[kCfiShadowLimitsStorageSize]; struct { uptr start; uptr size; } limits; } cfi_shadow_limits_storage __attribute__((aligned(kCfiShadowLimitsStorageSize))); static constexpr uptr kShadowGranularity = 12; static constexpr uptr kShadowAlign = 1UL << kShadowGranularity; // 4096 static constexpr uint16_t kInvalidShadow = 0; static constexpr uint16_t kUncheckedShadow = 0xFFFFU; // Get the start address of the CFI shadow region. uptr GetShadow() { return cfi_shadow_limits_storage.limits.start; } uptr GetShadowSize() { return cfi_shadow_limits_storage.limits.size; } // This will only work while the shadow is not allocated. void SetShadowSize(uptr size) { cfi_shadow_limits_storage.limits.size = size; } uptr MemToShadowOffset(uptr x) { return (x >> kShadowGranularity) << 1; } uint16_t *MemToShadow(uptr x, uptr shadow_base) { return (uint16_t *)(shadow_base + MemToShadowOffset(x)); } typedef int (*CFICheckFn)(u64, void *, void *); // This class reads and decodes the shadow contents. class ShadowValue { uptr addr; uint16_t v; explicit ShadowValue(uptr addr, uint16_t v) : addr(addr), v(v) {} public: bool is_invalid() const { return v == kInvalidShadow; } bool is_unchecked() const { return v == kUncheckedShadow; } CFICheckFn get_cfi_check() const { assert(!is_invalid() && !is_unchecked()); uptr aligned_addr = addr & ~(kShadowAlign - 1); uptr p = aligned_addr - (((uptr)v - 1) << kShadowGranularity); return reinterpret_cast(p); } // Load a shadow value for the given application memory address. static const ShadowValue load(uptr addr) { uptr shadow_base = GetShadow(); uptr shadow_offset = MemToShadowOffset(addr); if (shadow_offset > GetShadowSize()) return ShadowValue(addr, kInvalidShadow); else return ShadowValue( addr, *reinterpret_cast(shadow_base + shadow_offset)); } }; class ShadowBuilder { uptr shadow_; public: // Allocate a new empty shadow (for the entire address space) on the side. void Start(); // Mark the given address range as unchecked. // This is used for uninstrumented libraries like libc. // Any CFI check with a target in that range will pass. void AddUnchecked(uptr begin, uptr end); // Mark the given address range as belonging to a library with the given // cfi_check function. void Add(uptr begin, uptr end, uptr cfi_check); // Finish shadow construction. Atomically switch the current active shadow // region with the newly constructed one and deallocate the former. void Install(); }; void ShadowBuilder::Start() { shadow_ = (uptr)MmapNoReserveOrDie(GetShadowSize(), "CFI shadow"); VReport(1, "CFI: shadow at %zx .. %zx\n", shadow_, shadow_ + GetShadowSize()); } void ShadowBuilder::AddUnchecked(uptr begin, uptr end) { uint16_t *shadow_begin = MemToShadow(begin, shadow_); uint16_t *shadow_end = MemToShadow(end - 1, shadow_) + 1; memset(shadow_begin, kUncheckedShadow, (shadow_end - shadow_begin) * sizeof(*shadow_begin)); } void ShadowBuilder::Add(uptr begin, uptr end, uptr cfi_check) { assert((cfi_check & (kShadowAlign - 1)) == 0); // Don't fill anything below cfi_check. We can not represent those addresses // in the shadow, and must make sure at codegen to place all valid call // targets above cfi_check. begin = Max(begin, cfi_check); uint16_t *s = MemToShadow(begin, shadow_); uint16_t *s_end = MemToShadow(end - 1, shadow_) + 1; uint16_t sv = ((begin - cfi_check) >> kShadowGranularity) + 1; for (; s < s_end; s++, sv++) *s = sv; } #if SANITIZER_LINUX void ShadowBuilder::Install() { MprotectReadOnly(shadow_, GetShadowSize()); uptr main_shadow = GetShadow(); if (main_shadow) { // Update. void *res = mremap((void *)shadow_, GetShadowSize(), GetShadowSize(), MREMAP_MAYMOVE | MREMAP_FIXED, (void *)main_shadow); CHECK(res != MAP_FAILED); } else { // Initial setup. CHECK_EQ(kCfiShadowLimitsStorageSize, GetPageSizeCached()); CHECK_EQ(0, GetShadow()); cfi_shadow_limits_storage.limits.start = shadow_; MprotectReadOnly((uptr)&cfi_shadow_limits_storage, sizeof(cfi_shadow_limits_storage)); CHECK_EQ(shadow_, GetShadow()); } } #else #error not implemented #endif // This is a workaround for a glibc bug: // https://sourceware.org/bugzilla/show_bug.cgi?id=15199 // Other platforms can, hopefully, just do // dlopen(RTLD_NOLOAD | RTLD_LAZY) // dlsym("__cfi_check"). uptr find_cfi_check_in_dso(dl_phdr_info *info) { const ElfW(Dyn) *dynamic = nullptr; for (int i = 0; i < info->dlpi_phnum; ++i) { if (info->dlpi_phdr[i].p_type == PT_DYNAMIC) { dynamic = (const ElfW(Dyn) *)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr); break; } } if (!dynamic) return 0; uptr strtab = 0, symtab = 0; for (const ElfW(Dyn) *p = dynamic; p->d_tag != PT_NULL; ++p) { if (p->d_tag == DT_SYMTAB) symtab = p->d_un.d_ptr; else if (p->d_tag == DT_STRTAB) strtab = p->d_un.d_ptr; } if (symtab > strtab) { VReport(1, "Can not handle: symtab > strtab (%p > %zx)\n", symtab, strtab); return 0; } // Verify that strtab and symtab are inside of the same LOAD segment. // This excludes VDSO, which has (very high) bogus strtab and symtab pointers. int phdr_idx; for (phdr_idx = 0; phdr_idx < info->dlpi_phnum; phdr_idx++) { const Elf_Phdr *phdr = &info->dlpi_phdr[phdr_idx]; if (phdr->p_type == PT_LOAD) { uptr beg = info->dlpi_addr + phdr->p_vaddr; uptr end = beg + phdr->p_memsz; if (strtab >= beg && strtab < end && symtab >= beg && symtab < end) break; } } if (phdr_idx == info->dlpi_phnum) { // Nope, either different segments or just bogus pointers. // Can not handle this. VReport(1, "Can not handle: symtab %p, strtab %zx\n", symtab, strtab); return 0; } for (const ElfW(Sym) *p = (const ElfW(Sym) *)symtab; (ElfW(Addr))p < strtab; ++p) { char *name = (char*)(strtab + p->st_name); if (strcmp(name, "__cfi_check") == 0) { assert(p->st_info == ELF32_ST_INFO(STB_GLOBAL, STT_FUNC)); uptr addr = info->dlpi_addr + p->st_value; return addr; } } return 0; } int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *data) { uptr cfi_check = find_cfi_check_in_dso(info); if (cfi_check) VReport(1, "Module '%s' __cfi_check %zx\n", info->dlpi_name, cfi_check); ShadowBuilder *b = reinterpret_cast(data); for (int i = 0; i < info->dlpi_phnum; i++) { const Elf_Phdr *phdr = &info->dlpi_phdr[i]; if (phdr->p_type == PT_LOAD) { // Jump tables are in the executable segment. // VTables are in the non-executable one. // Need to fill shadow for both. // FIXME: reject writable if vtables are in the r/o segment. Depend on // PT_RELRO? uptr cur_beg = info->dlpi_addr + phdr->p_vaddr; uptr cur_end = cur_beg + phdr->p_memsz; if (cfi_check) { VReport(1, " %zx .. %zx\n", cur_beg, cur_end); b->Add(cur_beg, cur_end, cfi_check); } else { b->AddUnchecked(cur_beg, cur_end); } } } return 0; } // Init or update shadow for the current set of loaded libraries. void UpdateShadow() { ShadowBuilder b; b.Start(); dl_iterate_phdr(dl_iterate_phdr_cb, &b); b.Install(); } void InitShadow() { CHECK_EQ(0, GetShadow()); CHECK_EQ(0, GetShadowSize()); uptr vma = GetMaxVirtualAddress(); // Shadow is 2 -> 2**kShadowGranularity. SetShadowSize((vma >> (kShadowGranularity - 1)) + 1); VReport(1, "CFI: VMA size %zx, shadow size %zx\n", vma, GetShadowSize()); UpdateShadow(); } THREADLOCAL int in_loader; BlockingMutex shadow_update_lock(LINKER_INITIALIZED); void EnterLoader() { if (in_loader == 0) { shadow_update_lock.Lock(); } ++in_loader; } void ExitLoader() { CHECK(in_loader > 0); --in_loader; UpdateShadow(); if (in_loader == 0) { shadow_update_lock.Unlock(); } } ALWAYS_INLINE void CfiSlowPathCommon(u64 CallSiteTypeId, void *Ptr, void *DiagData) { uptr Addr = (uptr)Ptr; VReport(3, "__cfi_slowpath: %llx, %p\n", CallSiteTypeId, Ptr); ShadowValue sv = ShadowValue::load(Addr); if (sv.is_invalid()) { VReport(1, "CFI: invalid memory region for a check target: %p\n", Ptr); #ifdef CFI_ENABLE_DIAG if (DiagData) { __ubsan_handle_cfi_check_fail( reinterpret_cast<__ubsan::CFICheckFailData *>(DiagData), Addr, false); return; } #endif Trap(); } if (sv.is_unchecked()) { VReport(2, "CFI: unchecked call (shadow=FFFF): %p\n", Ptr); return; } CFICheckFn cfi_check = sv.get_cfi_check(); VReport(2, "__cfi_check at %p\n", cfi_check); cfi_check(CallSiteTypeId, Ptr, DiagData); } void InitializeFlags() { SetCommonFlagsDefaults(); #ifdef CFI_ENABLE_DIAG __ubsan::Flags *uf = __ubsan::flags(); uf->SetDefaults(); #endif FlagParser cfi_parser; RegisterCommonFlags(&cfi_parser); cfi_parser.ParseString(GetEnv("CFI_OPTIONS")); #ifdef CFI_ENABLE_DIAG FlagParser ubsan_parser; __ubsan::RegisterUbsanFlags(&ubsan_parser, uf); RegisterCommonFlags(&ubsan_parser); const char *ubsan_default_options = __ubsan::MaybeCallUbsanDefaultOptions(); ubsan_parser.ParseString(ubsan_default_options); ubsan_parser.ParseString(GetEnv("UBSAN_OPTIONS")); #endif InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) { cfi_parser.PrintFlagDescriptions(); } } } // namespace __cfi using namespace __cfi; extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __cfi_slowpath(u64 CallSiteTypeId, void *Ptr) { CfiSlowPathCommon(CallSiteTypeId, Ptr, nullptr); } #ifdef CFI_ENABLE_DIAG extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __cfi_slowpath_diag(u64 CallSiteTypeId, void *Ptr, void *DiagData) { CfiSlowPathCommon(CallSiteTypeId, Ptr, DiagData); } #endif // Setup shadow for dlopen()ed libraries. // The actual shadow setup happens after dlopen() returns, which means that // a library can not be a target of any CFI checks while its constructors are // running. It's unclear how to fix this without some extra help from libc. // In glibc, mmap inside dlopen is not interceptable. // Maybe a seccomp-bpf filter? // We could insert a high-priority constructor into the library, but that would // not help with the uninstrumented libraries. INTERCEPTOR(void*, dlopen, const char *filename, int flag) { EnterLoader(); void *handle = REAL(dlopen)(filename, flag); ExitLoader(); return handle; } INTERCEPTOR(int, dlclose, void *handle) { EnterLoader(); int res = REAL(dlclose)(handle); ExitLoader(); return res; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE #if !SANITIZER_CAN_USE_PREINIT_ARRAY // On ELF platforms, the constructor is invoked using .preinit_array (see below) __attribute__((constructor(0))) #endif void __cfi_init() { SanitizerToolName = "CFI"; InitializeFlags(); InitShadow(); INTERCEPT_FUNCTION(dlopen); INTERCEPT_FUNCTION(dlclose); #ifdef CFI_ENABLE_DIAG __ubsan::InitAsPlugin(); #endif } #if SANITIZER_CAN_USE_PREINIT_ARRAY // On ELF platforms, run cfi initialization before any other constructors. // On other platforms we use the constructor attribute to arrange to run our // initialization early. extern "C" { __attribute__((section(".preinit_array"), used)) void (*__cfi_preinit)(void) = __cfi_init; } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/cfi/CMakeLists.txt0000664000175000017500000000146112760126006025252 0ustar mwhudsonmwhudsonadd_compiler_rt_component(cfi) set(CFI_SOURCES cfi.cc) include_directories(..) set(CFI_CFLAGS ${SANITIZER_COMMON_CFLAGS} ) set(CFI_DIAG_CFLAGS -DCFI_ENABLE_DIAG=1 ) foreach(arch ${CFI_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.cfi STATIC ARCHS ${arch} SOURCES ${CFI_SOURCES} OBJECT_LIBS RTInterception RTSanitizerCommon RTSanitizerCommonLibc CFLAGS ${CFI_CFLAGS} PARENT_TARGET cfi) add_compiler_rt_runtime(clang_rt.cfi_diag STATIC ARCHS ${arch} SOURCES ${CFI_SOURCES} OBJECT_LIBS RTInterception RTSanitizerCommon RTSanitizerCommonLibc RTUbsan CFLAGS ${CFI_CFLAGS} ${CFI_DIAG_CFLAGS} PARENT_TARGET cfi) endforeach() add_compiler_rt_resource_file(cfi_blacklist cfi_blacklist.txt cfi) golang-1.8-race-detector-runtime_0.0+svn285455/lib/cfi/cfi_blacklist.txt0000664000175000017500000000134712571427050026052 0ustar mwhudsonmwhudson# Standard library types. type:std::* # The stdext namespace contains Microsoft standard library extensions. type:stdext::* # Types with a uuid attribute, i.e. COM types. type:attr:uuid # STL allocators (T *allocator::allocate(size_type, const void*)). # The type signature mandates a cast from uninitialized void* to T*. # size_type can either be unsigned int (j) or unsigned long (m). fun:*8allocateEjPKv fun:*8allocateEmPKv # std::get_temporary_buffer, likewise (libstdc++, libc++). fun:_ZSt20get_temporary_buffer* fun:_ZNSt3__120get_temporary_buffer* # STL address-of magic (libstdc++, libc++). fun:*__addressof* fun:_ZNSt3__19addressof* # Windows C++ stdlib headers that contain bad unrelated casts. src:*xmemory0 src:*xstddef golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/0000775000175000017500000000000013040224627022675 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_shadow.h0000664000175000017500000002267612775420063025364 0ustar mwhudsonmwhudson//===-- esan_shadow.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Shadow memory mappings for the esan run-time. //===----------------------------------------------------------------------===// #ifndef ESAN_SHADOW_H #define ESAN_SHADOW_H #include "esan.h" #include #if SANITIZER_WORDSIZE != 64 #error Only 64-bit is supported #endif namespace __esan { struct ApplicationRegion { uptr Start; uptr End; bool ShadowMergedWithPrev; }; #if SANITIZER_LINUX && defined(__x86_64__) // Linux x86_64 // // Application memory falls into these 5 regions (ignoring the corner case // of PIE with a non-zero PT_LOAD base): // // [0x00000000'00000000, 0x00000100'00000000) non-PIE + heap // [0x00005500'00000000, 0x00005700'00000000) PIE // [0x00007e00'00000000, 0x00007fff'ff600000) libraries + stack, part 1 // [0x00007fff'ff601000, 0x00008000'00000000) libraries + stack, part 2 // [0xffffffff'ff600000, 0xffffffff'ff601000) vsyscall // // Although we can ignore the vsyscall for the most part as there are few data // references there (other sanitizers ignore it), we enforce a gap inside the // library region to distinguish the vsyscall's shadow, considering this gap to // be an invalid app region. // We disallow application memory outside of those 5 regions. // Our regions assume that the stack rlimit is less than a terabyte (otherwise // the Linux kernel's default mmap region drops below 0x7e00'), which we enforce // at init time (we can support larger and unlimited sizes for shadow // scaledowns, but it is difficult for 1:1 mappings). // // Our shadow memory is scaled from a 1:1 mapping and supports a scale // specified at library initialization time that can be any power-of-2 // scaledown (1x, 2x, 4x, 8x, 16x, etc.). // // We model our shadow memory after Umbra, a library used by the Dr. Memory // tool: https://github.com/DynamoRIO/drmemory/blob/master/umbra/umbra_x64.c. // We use Umbra's scheme as it was designed to support different // offsets, it supports two different shadow mappings (which we may want to // use for future tools), and it ensures that the shadow of a shadow will // not overlap either shadow memory or application memory. // // This formula translates from application memory to shadow memory: // // shadow(app) = ((app & 0x00000fff'ffffffff) + offset) >> scale // // Where the offset for 1:1 is 0x00001300'00000000. For other scales, the // offset is shifted left by the scale, except for scales of 1 and 2 where // it must be tweaked in order to pass the double-shadow test // (see the "shadow(shadow)" comments below): // scale == 0: 0x00001300'000000000 // scale == 1: 0x00002200'000000000 // scale == 2: 0x00004400'000000000 // scale >= 3: (0x00001300'000000000 << scale) // // Do not pass in the open-ended end value to the formula as it will fail. // // The resulting shadow memory regions for a 0 scaling are: // // [0x00001300'00000000, 0x00001400'00000000) // [0x00001800'00000000, 0x00001a00'00000000) // [0x00002100'00000000, 0x000022ff'ff600000) // [0x000022ff'ff601000, 0x00002300'00000000) // [0x000022ff'ff600000, 0x000022ff'ff601000] // // We also want to ensure that a wild access by the application into the shadow // regions will not corrupt our own shadow memory. shadow(shadow) ends up // disjoint from shadow(app): // // [0x00001600'00000000, 0x00001700'00000000) // [0x00001b00'00000000, 0x00001d00'00000000) // [0x00001400'00000000, 0x000015ff'ff600000] // [0x000015ff'ff601000, 0x00001600'00000000] // [0x000015ff'ff600000, 0x000015ff'ff601000] static const struct ApplicationRegion AppRegions[] = { {0x0000000000000000ull, 0x0000010000000000u, false}, {0x0000550000000000u, 0x0000570000000000u, false}, // We make one shadow mapping to hold the shadow regions for all 3 of these // app regions, as the mappings interleave, and the gap between the 3rd and // 4th scales down below a page. {0x00007e0000000000u, 0x00007fffff600000u, false}, {0x00007fffff601000u, 0x0000800000000000u, true}, {0xffffffffff600000u, 0xffffffffff601000u, true}, }; #elif SANITIZER_LINUX && SANITIZER_MIPS64 // Application memory falls into these 3 regions // // [0x00000001'00000000, 0x00000002'00000000) non-PIE + heap // [0x000000aa'00000000, 0x000000ab'00000000) PIE // [0x000000ff'00000000, 0x000000ff'ffffffff) libraries + stack // // This formula translates from application memory to shadow memory: // // shadow(app) = ((app & 0x00000f'ffffffff) + offset) >> scale // // Where the offset for 1:1 is 0x000013'00000000. For other scales, the // offset is shifted left by the scale, except for scales of 1 and 2 where // it must be tweaked in order to pass the double-shadow test // (see the "shadow(shadow)" comments below): // scale == 0: 0x000013'00000000 // scale == 1: 0x000022'00000000 // scale == 2: 0x000044'00000000 // scale >= 3: (0x000013'00000000 << scale) // // The resulting shadow memory regions for a 0 scaling are: // // [0x00000014'00000000, 0x00000015'00000000) // [0x0000001d'00000000, 0x0000001e'00000000) // [0x00000022'00000000, 0x00000022'ffffffff) // // We also want to ensure that a wild access by the application into the shadow // regions will not corrupt our own shadow memory. shadow(shadow) ends up // disjoint from shadow(app): // // [0x00000017'00000000, 0x00000018'00000000) // [0x00000020'00000000, 0x00000021'00000000) // [0x00000015'00000000, 0x00000015'ffffffff] static const struct ApplicationRegion AppRegions[] = { {0x0100000000u, 0x0200000000u, false}, {0xaa00000000u, 0xab00000000u, false}, {0xff00000000u, 0xffffffffffu, false}, }; #else #error Platform not supported #endif static const u32 NumAppRegions = sizeof(AppRegions)/sizeof(AppRegions[0]); // See the comment above: we do not currently support a stack size rlimit // equal to or larger than 1TB. static const uptr MaxStackSize = (1ULL << 40) - 4096; class ShadowMapping { public: // The scale and offset vary by tool. uptr Scale; uptr Offset; // TODO(sagar.thakur): Try to hardcode the mask as done in the compiler // instrumentation to reduce the runtime cost of appToShadow. struct ShadowMemoryMask40 { static const uptr Mask = 0x0000000fffffffffu; }; struct ShadowMemoryMask47 { static const uptr Mask = 0x00000fffffffffffu; }; void initialize(uptr ShadowScale) { const uptr OffsetArray40[3] = { 0x0000001300000000u, 0x0000002200000000u, 0x0000004400000000u, }; const uptr OffsetArray47[3] = { 0x0000130000000000u, 0x0000220000000000u, 0x0000440000000000u, }; Scale = ShadowScale; switch (VmaSize) { case 40: { if (Scale <= 2) Offset = OffsetArray40[Scale]; else Offset = OffsetArray40[0] << Scale; } break; case 47: { if (Scale <= 2) Offset = OffsetArray47[Scale]; else Offset = OffsetArray47[0] << Scale; } break; default: { Printf("ERROR: %d-bit virtual memory address size not supported\n", VmaSize); Die(); } } } }; extern ShadowMapping Mapping; static inline bool getAppRegion(u32 i, uptr *Start, uptr *End) { if (i >= NumAppRegions) return false; *Start = AppRegions[i].Start; *End = AppRegions[i].End; return true; } ALWAYS_INLINE bool isAppMem(uptr Mem) { for (u32 i = 0; i < NumAppRegions; ++i) { if (Mem >= AppRegions[i].Start && Mem < AppRegions[i].End) return true; } return false; } template uptr appToShadowImpl(uptr App) { return (((App & Params::Mask) + Mapping.Offset) >> Mapping.Scale); } ALWAYS_INLINE uptr appToShadow(uptr App) { switch (VmaSize) { case 40: return appToShadowImpl(App); case 47: return appToShadowImpl(App); default: { Printf("ERROR: %d-bit virtual memory address size not supported\n", VmaSize); Die(); } } } static inline bool getShadowRegion(u32 i, uptr *Start, uptr *End) { if (i >= NumAppRegions) return false; u32 UnmergedShadowCount = 0; u32 AppIdx; for (AppIdx = 0; AppIdx < NumAppRegions; ++AppIdx) { if (!AppRegions[AppIdx].ShadowMergedWithPrev) { if (UnmergedShadowCount == i) break; UnmergedShadowCount++; } } if (AppIdx >= NumAppRegions || UnmergedShadowCount != i) return false; *Start = appToShadow(AppRegions[AppIdx].Start); // The formula fails for the end itself. *End = appToShadow(AppRegions[AppIdx].End - 1) + 1; // Merge with adjacent shadow regions: for (++AppIdx; AppIdx < NumAppRegions; ++AppIdx) { if (!AppRegions[AppIdx].ShadowMergedWithPrev) break; *Start = Min(*Start, appToShadow(AppRegions[AppIdx].Start)); *End = Max(*End, appToShadow(AppRegions[AppIdx].End - 1) + 1); } return true; } ALWAYS_INLINE bool isShadowMem(uptr Mem) { // We assume this is not used on any critical performance path and so there's // no need to hardcode the mapping results. for (uptr i = 0; i < NumAppRegions; ++i) { if (Mem >= appToShadow(AppRegions[i].Start) && Mem < appToShadow(AppRegions[i].End - 1) + 1) return true; } return false; } } // namespace __esan #endif /* ESAN_SHADOW_H */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_interface.cpp0000664000175000017500000000636312743332550026363 0ustar mwhudsonmwhudson//===-- esan_interface.cpp ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // //===----------------------------------------------------------------------===// #include "esan_interface_internal.h" #include "esan.h" #include "sanitizer_common/sanitizer_internal_defs.h" using namespace __esan; // NOLINT void __esan_init(ToolType Tool, void *Ptr) { if (Tool != __esan_which_tool) { Printf("ERROR: tool mismatch: %d vs %d\n", Tool, __esan_which_tool); Die(); } initializeLibrary(Tool); processCompilationUnitInit(Ptr); } void __esan_exit(void *Ptr) { processCompilationUnitExit(Ptr); } void __esan_aligned_load1(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 1, false); } void __esan_aligned_load2(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 2, false); } void __esan_aligned_load4(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 4, false); } void __esan_aligned_load8(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 8, false); } void __esan_aligned_load16(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 16, false); } void __esan_aligned_store1(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 1, true); } void __esan_aligned_store2(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 2, true); } void __esan_aligned_store4(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 4, true); } void __esan_aligned_store8(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 8, true); } void __esan_aligned_store16(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 16, true); } void __esan_unaligned_load2(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 2, false); } void __esan_unaligned_load4(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 4, false); } void __esan_unaligned_load8(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 8, false); } void __esan_unaligned_load16(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 16, false); } void __esan_unaligned_store2(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 2, true); } void __esan_unaligned_store4(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 4, true); } void __esan_unaligned_store8(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 8, true); } void __esan_unaligned_store16(void *Addr) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, 16, true); } void __esan_unaligned_loadN(void *Addr, uptr Size) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, Size, false); } void __esan_unaligned_storeN(void *Addr, uptr Size) { processRangeAccess(GET_CALLER_PC(), (uptr)Addr, Size, true); } // Public interface: extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __esan_report() { reportResults(); } SANITIZER_INTERFACE_ATTRIBUTE unsigned int __esan_get_sample_count() { return getSampleCount(); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_interceptors.cpp0000664000175000017500000005732212776005517027153 0ustar mwhudsonmwhudson//===-- esan_interceptors.cpp ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Interception routines for the esan run-time. //===----------------------------------------------------------------------===// #include "esan.h" #include "esan_shadow.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_stacktrace.h" using namespace __esan; // NOLINT #define CUR_PC() (StackTrace::GetCurrentPc()) //===----------------------------------------------------------------------===// // Interception via sanitizer common interceptors //===----------------------------------------------------------------------===// // Get the per-platform defines for what is possible to intercept #include "sanitizer_common/sanitizer_platform_interceptors.h" // TODO(bruening): tsan disables several interceptors (getpwent, etc.) claiming // that interception is a perf hit: should we do the same? // We have no need to intercept: #undef SANITIZER_INTERCEPT_TLS_GET_ADDR // TODO(bruening): the common realpath interceptor assumes malloc is // intercepted! We should try to parametrize that, though we'll // intercept malloc soon ourselves and can then remove this undef. #undef SANITIZER_INTERCEPT_REALPATH // We provide our own version: #undef SANITIZER_INTERCEPT_SIGPROCMASK #define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED (!EsanIsInitialized) #define COMMON_INTERCEPT_FUNCTION(name) INTERCEPT_FUNCTION(name) #define COMMON_INTERCEPT_FUNCTION_VER(name, ver) \ INTERCEPT_FUNCTION_VER(name, ver) // We must initialize during early interceptors, to support tcmalloc. // This means that for some apps we fully initialize prior to // __esan_init() being called. // We currently do not use ctx. #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \ do { \ if (UNLIKELY(COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)) { \ if (!UNLIKELY(EsanDuringInit)) \ initializeLibrary(__esan_which_tool); \ return REAL(func)(__VA_ARGS__); \ } \ ctx = nullptr; \ (void)ctx; \ } while (false) #define COMMON_INTERCEPTOR_ENTER_NOIGNORE(ctx, func, ...) \ COMMON_INTERCEPTOR_ENTER(ctx, func, __VA_ARGS__) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ processRangeAccess(CUR_PC(), (uptr)ptr, size, true) #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ processRangeAccess(CUR_PC(), (uptr)ptr, size, false) // This is only called if the app explicitly calls exit(), not on // a normal exit. #define COMMON_INTERCEPTOR_ON_EXIT(ctx) finalizeLibrary() #define COMMON_INTERCEPTOR_FILE_OPEN(ctx, file, path) \ do { \ (void)(ctx); \ (void)(file); \ (void)(path); \ } while (false) #define COMMON_INTERCEPTOR_FILE_CLOSE(ctx, file) \ do { \ (void)(ctx); \ (void)(file); \ } while (false) #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \ do { \ (void)(filename); \ (void)(handle); \ } while (false) #define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() \ do { \ } while (false) #define COMMON_INTERCEPTOR_ACQUIRE(ctx, u) \ do { \ (void)(ctx); \ (void)(u); \ } while (false) #define COMMON_INTERCEPTOR_RELEASE(ctx, u) \ do { \ (void)(ctx); \ (void)(u); \ } while (false) #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \ do { \ (void)(ctx); \ (void)(path); \ } while (false) #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \ do { \ (void)(ctx); \ (void)(fd); \ } while (false) #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \ do { \ (void)(ctx); \ (void)(fd); \ } while (false) #define COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd) \ do { \ (void)(ctx); \ (void)(fd); \ } while (false) #define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \ do { \ (void)(ctx); \ (void)(fd); \ (void)(newfd); \ } while (false) #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \ do { \ (void)(ctx); \ (void)(name); \ } while (false) #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \ do { \ (void)(ctx); \ (void)(thread); \ (void)(name); \ } while (false) #define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name) #define COMMON_INTERCEPTOR_MUTEX_LOCK(ctx, m) \ do { \ (void)(ctx); \ (void)(m); \ } while (false) #define COMMON_INTERCEPTOR_MUTEX_UNLOCK(ctx, m) \ do { \ (void)(ctx); \ (void)(m); \ } while (false) #define COMMON_INTERCEPTOR_MUTEX_REPAIR(ctx, m) \ do { \ (void)(ctx); \ (void)(m); \ } while (false) #define COMMON_INTERCEPTOR_HANDLE_RECVMSG(ctx, msg) \ do { \ (void)(ctx); \ (void)(msg); \ } while (false) #define COMMON_INTERCEPTOR_USER_CALLBACK_START() \ do { \ } while (false) #define COMMON_INTERCEPTOR_USER_CALLBACK_END() \ do { \ } while (false) #include "sanitizer_common/sanitizer_common_interceptors.inc" //===----------------------------------------------------------------------===// // Syscall interception //===----------------------------------------------------------------------===// // We want the caller's PC b/c unlike the other function interceptors these // are separate pre and post functions called around the app's syscall(). #define COMMON_SYSCALL_PRE_READ_RANGE(ptr, size) \ processRangeAccess(GET_CALLER_PC(), (uptr)ptr, size, false) #define COMMON_SYSCALL_PRE_WRITE_RANGE(ptr, size) \ do { \ (void)(ptr); \ (void)(size); \ } while (false) #define COMMON_SYSCALL_POST_READ_RANGE(ptr, size) \ do { \ (void)(ptr); \ (void)(size); \ } while (false) // The actual amount written is in post, not pre. #define COMMON_SYSCALL_POST_WRITE_RANGE(ptr, size) \ processRangeAccess(GET_CALLER_PC(), (uptr)ptr, size, true) #define COMMON_SYSCALL_ACQUIRE(addr) \ do { \ (void)(addr); \ } while (false) #define COMMON_SYSCALL_RELEASE(addr) \ do { \ (void)(addr); \ } while (false) #define COMMON_SYSCALL_FD_CLOSE(fd) \ do { \ (void)(fd); \ } while (false) #define COMMON_SYSCALL_FD_ACQUIRE(fd) \ do { \ (void)(fd); \ } while (false) #define COMMON_SYSCALL_FD_RELEASE(fd) \ do { \ (void)(fd); \ } while (false) #define COMMON_SYSCALL_PRE_FORK() \ do { \ } while (false) #define COMMON_SYSCALL_POST_FORK(res) \ do { \ (void)(res); \ } while (false) #include "sanitizer_common/sanitizer_common_syscalls.inc" //===----------------------------------------------------------------------===// // Custom interceptors //===----------------------------------------------------------------------===// // TODO(bruening): move more of these to the common interception pool as they // are shared with tsan and asan. // While our other files match LLVM style, here we match sanitizer style as we // expect to move these to the common pool. INTERCEPTOR(char *, strcpy, char *dst, const char *src) { // NOLINT void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strcpy, dst, src); uptr srclen = internal_strlen(src); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, srclen + 1); COMMON_INTERCEPTOR_READ_RANGE(ctx, src, srclen + 1); return REAL(strcpy)(dst, src); // NOLINT } INTERCEPTOR(char *, strncpy, char *dst, char *src, uptr n) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strncpy, dst, src, n); uptr srclen = internal_strnlen(src, n); uptr copied_size = srclen + 1 > n ? n : srclen + 1; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, copied_size); COMMON_INTERCEPTOR_READ_RANGE(ctx, src, copied_size); return REAL(strncpy)(dst, src, n); } INTERCEPTOR(int, open, const char *name, int flags, int mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, open, name, flags, mode); COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0); return REAL(open)(name, flags, mode); } #if SANITIZER_LINUX INTERCEPTOR(int, open64, const char *name, int flags, int mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, open64, name, flags, mode); COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0); return REAL(open64)(name, flags, mode); } #define ESAN_MAYBE_INTERCEPT_OPEN64 INTERCEPT_FUNCTION(open64) #else #define ESAN_MAYBE_INTERCEPT_OPEN64 #endif INTERCEPTOR(int, creat, const char *name, int mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, creat, name, mode); COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0); return REAL(creat)(name, mode); } #if SANITIZER_LINUX INTERCEPTOR(int, creat64, const char *name, int mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, creat64, name, mode); COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0); return REAL(creat64)(name, mode); } #define ESAN_MAYBE_INTERCEPT_CREAT64 INTERCEPT_FUNCTION(creat64) #else #define ESAN_MAYBE_INTERCEPT_CREAT64 #endif INTERCEPTOR(int, unlink, char *path) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, unlink, path); COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); return REAL(unlink)(path); } INTERCEPTOR(uptr, fread, void *ptr, uptr size, uptr nmemb, void *f) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fread, ptr, size, nmemb, f); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size * nmemb); return REAL(fread)(ptr, size, nmemb, f); } INTERCEPTOR(uptr, fwrite, const void *p, uptr size, uptr nmemb, void *f) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fwrite, p, size, nmemb, f); COMMON_INTERCEPTOR_READ_RANGE(ctx, p, size * nmemb); return REAL(fwrite)(p, size, nmemb, f); } INTERCEPTOR(int, puts, const char *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, puts, s); COMMON_INTERCEPTOR_READ_RANGE(ctx, s, internal_strlen(s)); return REAL(puts)(s); } INTERCEPTOR(int, rmdir, char *path) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, rmdir, path); COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); return REAL(rmdir)(path); } //===----------------------------------------------------------------------===// // Shadow-related interceptors //===----------------------------------------------------------------------===// // These are candidates for sharing with all sanitizers if shadow memory // support is also standardized. INTERCEPTOR(void *, mmap, void *addr, SIZE_T sz, int prot, int flags, int fd, OFF_T off) { if (UNLIKELY(REAL(mmap) == nullptr)) { // With esan init during interceptor init and a static libc preventing // our early-calloc from triggering, we can end up here before our // REAL pointer is set up. return (void *)internal_mmap(addr, sz, prot, flags, fd, off); } void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mmap, addr, sz, prot, flags, fd, off); if (!fixMmapAddr(&addr, sz, flags)) return (void *)-1; void *result = REAL(mmap)(addr, sz, prot, flags, fd, off); return (void *)checkMmapResult((uptr)result, sz); } #if SANITIZER_LINUX INTERCEPTOR(void *, mmap64, void *addr, SIZE_T sz, int prot, int flags, int fd, OFF64_T off) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mmap64, addr, sz, prot, flags, fd, off); if (!fixMmapAddr(&addr, sz, flags)) return (void *)-1; void *result = REAL(mmap64)(addr, sz, prot, flags, fd, off); return (void *)checkMmapResult((uptr)result, sz); } #define ESAN_MAYBE_INTERCEPT_MMAP64 INTERCEPT_FUNCTION(mmap64) #else #define ESAN_MAYBE_INTERCEPT_MMAP64 #endif //===----------------------------------------------------------------------===// // Signal-related interceptors //===----------------------------------------------------------------------===// #if SANITIZER_LINUX typedef void (*signal_handler_t)(int); INTERCEPTOR(signal_handler_t, signal, int signum, signal_handler_t handler) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, signal, signum, handler); signal_handler_t result; if (!processSignal(signum, handler, &result)) return result; else return REAL(signal)(signum, handler); } #define ESAN_MAYBE_INTERCEPT_SIGNAL INTERCEPT_FUNCTION(signal) #else #error Platform not supported #define ESAN_MAYBE_INTERCEPT_SIGNAL #endif #if SANITIZER_LINUX DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigaction, signum, act, oldact); if (!processSigaction(signum, act, oldact)) return 0; else return REAL(sigaction)(signum, act, oldact); } // This is required to properly use internal_sigaction. namespace __sanitizer { int real_sigaction(int signum, const void *act, void *oldact) { if (REAL(sigaction) == nullptr) { // With an instrumented allocator, this is called during interceptor init // and we need a raw syscall solution. return internal_sigaction_syscall(signum, act, oldact); } return REAL(sigaction)(signum, (const struct sigaction *)act, (struct sigaction *)oldact); } } // namespace __sanitizer #define ESAN_MAYBE_INTERCEPT_SIGACTION INTERCEPT_FUNCTION(sigaction) #else #error Platform not supported #define ESAN_MAYBE_INTERCEPT_SIGACTION #endif #if SANITIZER_LINUX INTERCEPTOR(int, sigprocmask, int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigprocmask, how, set, oldset); int res = 0; if (processSigprocmask(how, set, oldset)) res = REAL(sigprocmask)(how, set, oldset); if (!res && oldset) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldset, sizeof(*oldset)); return res; } #define ESAN_MAYBE_INTERCEPT_SIGPROCMASK INTERCEPT_FUNCTION(sigprocmask) #else #define ESAN_MAYBE_INTERCEPT_SIGPROCMASK #endif #if !SANITIZER_WINDOWS INTERCEPTOR(int, pthread_sigmask, int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_sigmask, how, set, oldset); int res = 0; if (processSigprocmask(how, set, oldset)) res = REAL(sigprocmask)(how, set, oldset); if (!res && oldset) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldset, sizeof(*oldset)); return res; } #define ESAN_MAYBE_INTERCEPT_PTHREAD_SIGMASK INTERCEPT_FUNCTION(pthread_sigmask) #else #define ESAN_MAYBE_INTERCEPT_PTHREAD_SIGMASK #endif //===----------------------------------------------------------------------===// // Malloc interceptors //===----------------------------------------------------------------------===// static const uptr early_alloc_buf_size = 4096; static uptr allocated_bytes; static char early_alloc_buf[early_alloc_buf_size]; static bool isInEarlyAllocBuf(const void *ptr) { return ((uptr)ptr >= (uptr)early_alloc_buf && ((uptr)ptr - (uptr)early_alloc_buf) < sizeof(early_alloc_buf)); } static void *handleEarlyAlloc(uptr size) { // If esan is initialized during an interceptor (which happens with some // tcmalloc implementations that call pthread_mutex_lock), the call from // dlsym to calloc will deadlock. // dlsym may also call malloc before REAL(malloc) is retrieved from dlsym. // We work around it by using a static buffer for the early malloc/calloc // requests. // This solution will also allow us to deliberately intercept malloc & family // in the future (to perform tool actions on each allocation, without // replacing the allocator), as it also solves the problem of intercepting // calloc when it will itself be called before its REAL pointer is // initialized. // We do not handle multiple threads here. This only happens at process init // time, and while it's possible for a shared library to create early threads // that race here, we consider that to be a corner case extreme enough that // it's not worth the effort to handle. void *mem = (void *)&early_alloc_buf[allocated_bytes]; allocated_bytes += size; CHECK_LT(allocated_bytes, early_alloc_buf_size); return mem; } INTERCEPTOR(void*, calloc, uptr size, uptr n) { if (EsanDuringInit && REAL(calloc) == nullptr) return handleEarlyAlloc(size * n); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, calloc, size, n); void *res = REAL(calloc)(size, n); // The memory is zeroed and thus is all written. COMMON_INTERCEPTOR_WRITE_RANGE(nullptr, (uptr)res, size * n); return res; } INTERCEPTOR(void*, malloc, uptr size) { if (EsanDuringInit && REAL(malloc) == nullptr) return handleEarlyAlloc(size); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, malloc, size); return REAL(malloc)(size); } INTERCEPTOR(void, free, void *p) { void *ctx; // There are only a few early allocation requests, so we simply skip the free. if (isInEarlyAllocBuf(p)) return; COMMON_INTERCEPTOR_ENTER(ctx, free, p); REAL(free)(p); } namespace __esan { void initializeInterceptors() { InitializeCommonInterceptors(); INTERCEPT_FUNCTION(strcpy); // NOLINT INTERCEPT_FUNCTION(strncpy); INTERCEPT_FUNCTION(open); ESAN_MAYBE_INTERCEPT_OPEN64; INTERCEPT_FUNCTION(creat); ESAN_MAYBE_INTERCEPT_CREAT64; INTERCEPT_FUNCTION(unlink); INTERCEPT_FUNCTION(fread); INTERCEPT_FUNCTION(fwrite); INTERCEPT_FUNCTION(puts); INTERCEPT_FUNCTION(rmdir); INTERCEPT_FUNCTION(mmap); ESAN_MAYBE_INTERCEPT_MMAP64; ESAN_MAYBE_INTERCEPT_SIGNAL; ESAN_MAYBE_INTERCEPT_SIGACTION; ESAN_MAYBE_INTERCEPT_SIGPROCMASK; ESAN_MAYBE_INTERCEPT_PTHREAD_SIGMASK; INTERCEPT_FUNCTION(calloc); INTERCEPT_FUNCTION(malloc); INTERCEPT_FUNCTION(free); // TODO(bruening): intercept routines that other sanitizers intercept that // are not in the common pool or here yet, ideally by adding to the common // pool. Examples include wcslen and bcopy. // TODO(bruening): there are many more libc routines that read or write data // structures that no sanitizer is intercepting: sigaction, strtol, etc. } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/cache_frag.cpp0000664000175000017500000001610512770714046025456 0ustar mwhudsonmwhudson//===-- cache_frag.cpp ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // This file contains cache fragmentation-specific code. //===----------------------------------------------------------------------===// #include "esan.h" #include "esan_flags.h" #include "sanitizer_common/sanitizer_addrhashmap.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include namespace __esan { //===-- Struct field access counter runtime -------------------------------===// // This should be kept consistent with LLVM's EfficiencySanitizer StructInfo. struct StructInfo { const char *StructName; u32 Size; u32 NumFields; u32 *FieldOffset; // auxiliary struct field info. u32 *FieldSize; // auxiliary struct field info. const char **FieldTypeName; // auxiliary struct field info. u64 *FieldCounters; u64 *ArrayCounter; bool hasAuxFieldInfo() { return FieldOffset != nullptr; } }; // This should be kept consistent with LLVM's EfficiencySanitizer CacheFragInfo. // The tool-specific information per compilation unit (module). struct CacheFragInfo { const char *UnitName; u32 NumStructs; StructInfo *Structs; }; struct StructCounter { StructInfo *Struct; u64 Count; // The total access count of the struct. u64 Ratio; // Difference ratio for the struct layout access. }; // We use StructHashMap to keep track of an unique copy of StructCounter. typedef AddrHashMap StructHashMap; struct Context { StructHashMap StructMap; u32 NumStructs; u64 TotalCount; // The total access count of all structs. }; static Context *Ctx; static void reportStructSummary() { // FIXME: provide a better struct field access summary report. Report("%s: total struct field access count = %llu\n", SanitizerToolName, Ctx->TotalCount); } // FIXME: we are still exploring proper ways to evaluate the difference between // struct field counts. Currently, we use a simple formula to calculate the // difference ratio: V1/V2. static inline u64 computeDifferenceRatio(u64 Val1, u64 Val2) { if (Val2 > Val1) { Swap(Val1, Val2); } if (Val2 == 0) Val2 = 1; return (Val1 / Val2); } static void reportStructCounter(StructHashMap::Handle &Handle) { const u32 TypePrintLimit = 512; const char *type, *start, *end; StructInfo *Struct = Handle->Struct; // Union field address calculation is done via bitcast instead of GEP, // so the count for union is always 0. // We skip the union report to avoid confusion. if (strncmp(Struct->StructName, "union.", 6) == 0) return; // Remove the '.' after class/struct during print. if (strncmp(Struct->StructName, "class.", 6) == 0) { type = "class"; start = &Struct->StructName[6]; } else { type = "struct"; start = &Struct->StructName[7]; } // Remove the suffixes with '$' during print. end = strchr(start, '$'); CHECK(end != nullptr); Report(" %s %.*s\n", type, end - start, start); Report(" size = %u, count = %llu, ratio = %llu, array access = %llu\n", Struct->Size, Handle->Count, Handle->Ratio, *Struct->ArrayCounter); if (Struct->hasAuxFieldInfo()) { for (u32 i = 0; i < Struct->NumFields; ++i) { Report(" #%2u: offset = %u,\t size = %u," "\t count = %llu,\t type = %.*s\n", i, Struct->FieldOffset[i], Struct->FieldSize[i], Struct->FieldCounters[i], TypePrintLimit, Struct->FieldTypeName[i]); } } else { for (u32 i = 0; i < Struct->NumFields; ++i) { Report(" #%2u: count = %llu\n", i, Struct->FieldCounters[i]); } } } static void computeStructRatio(StructHashMap::Handle &Handle) { Handle->Ratio = 0; Handle->Count = Handle->Struct->FieldCounters[0]; for (u32 i = 1; i < Handle->Struct->NumFields; ++i) { Handle->Count += Handle->Struct->FieldCounters[i]; Handle->Ratio += computeDifferenceRatio( Handle->Struct->FieldCounters[i - 1], Handle->Struct->FieldCounters[i]); } Ctx->TotalCount += Handle->Count; if (Handle->Ratio >= (u64)getFlags()->report_threshold || (Verbosity() >= 1 && Handle->Count > 0)) reportStructCounter(Handle); } static void registerStructInfo(CacheFragInfo *CacheFrag) { for (u32 i = 0; i < CacheFrag->NumStructs; ++i) { StructInfo *Struct = &CacheFrag->Structs[i]; StructHashMap::Handle H(&Ctx->StructMap, (uptr)Struct->FieldCounters); if (H.created()) { VPrintf(2, " Register %s: %u fields\n", Struct->StructName, Struct->NumFields); H->Struct = Struct; ++Ctx->NumStructs; } else { VPrintf(2, " Duplicated %s: %u fields\n", Struct->StructName, Struct->NumFields); } } } static void unregisterStructInfo(CacheFragInfo *CacheFrag) { // FIXME: if the library is unloaded before finalizeCacheFrag, we should // collect the result for later report. for (u32 i = 0; i < CacheFrag->NumStructs; ++i) { StructInfo *Struct = &CacheFrag->Structs[i]; StructHashMap::Handle H(&Ctx->StructMap, (uptr)Struct->FieldCounters, true); if (H.exists()) { VPrintf(2, " Unregister %s: %u fields\n", Struct->StructName, Struct->NumFields); // FIXME: we should move this call to finalizeCacheFrag once we can // iterate over the hash map there. computeStructRatio(H); --Ctx->NumStructs; } else { VPrintf(2, " Duplicated %s: %u fields\n", Struct->StructName, Struct->NumFields); } } static bool Reported = false; if (Ctx->NumStructs == 0 && !Reported) { Reported = true; reportStructSummary(); } } //===-- Init/exit functions -----------------------------------------------===// void processCacheFragCompilationUnitInit(void *Ptr) { CacheFragInfo *CacheFrag = (CacheFragInfo *)Ptr; VPrintf(2, "in esan::%s: %s with %u class(es)/struct(s)\n", __FUNCTION__, CacheFrag->UnitName, CacheFrag->NumStructs); registerStructInfo(CacheFrag); } void processCacheFragCompilationUnitExit(void *Ptr) { CacheFragInfo *CacheFrag = (CacheFragInfo *)Ptr; VPrintf(2, "in esan::%s: %s with %u class(es)/struct(s)\n", __FUNCTION__, CacheFrag->UnitName, CacheFrag->NumStructs); unregisterStructInfo(CacheFrag); } void initializeCacheFrag() { VPrintf(2, "in esan::%s\n", __FUNCTION__); // We use placement new to initialize Ctx before C++ static initializaion. // We make CtxMem 8-byte aligned for atomic operations in AddrHashMap. static u64 CtxMem[sizeof(Context) / sizeof(u64) + 1]; Ctx = new (CtxMem) Context(); Ctx->NumStructs = 0; } int finalizeCacheFrag() { VPrintf(2, "in esan::%s\n", __FUNCTION__); return 0; } void reportCacheFrag() { VPrintf(2, "in esan::%s\n", __FUNCTION__); // FIXME: Not yet implemented. We need to iterate over all of the // compilation unit data. } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_sideline.h0000664000175000017500000000366212724326317025666 0ustar mwhudsonmwhudson//===-- esan_sideline.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Esan sideline thread support. //===----------------------------------------------------------------------===// #ifndef ESAN_SIDELINE_H #define ESAN_SIDELINE_H #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_internal_defs.h" namespace __esan { typedef void (*SidelineFunc)(void *Arg); // Currently only one sideline thread is supported. // It calls the SidelineFunc passed to launchThread once on each sample at the // given frequency in real time (i.e., wall clock time). class SidelineThread { public: // We cannot initialize any fields in the constructor as it will be called // *after* launchThread for a static instance, as esan.module_ctor is called // before static initializers. SidelineThread() {} ~SidelineThread() {} // To simplify declaration in sanitizer code where we want to avoid // heap allocations, the constructor and destructor do nothing and // launchThread and joinThread do the real work. // They should each be called just once. bool launchThread(SidelineFunc takeSample, void *Arg, u32 FreqMilliSec); bool joinThread(); // Must be called from the sideline thread itself. bool adjustTimer(u32 FreqMilliSec); private: static int runSideline(void *Arg); static void registerSignal(int SigNum); static void handleSidelineSignal(int SigNum, void *SigInfo, void *Ctx); char *Stack; SidelineFunc sampleFunc; void *FuncArg; u32 Freq; uptr SidelineId; atomic_uintptr_t SidelineExit; }; } // namespace __esan #endif // ESAN_SIDELINE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_flags.h0000664000175000017500000000201512717662374025165 0ustar mwhudsonmwhudson//===-- esan_flags.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Esan runtime flags. //===----------------------------------------------------------------------===// #ifndef ESAN_FLAGS_H #define ESAN_FLAGS_H #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_flag_parser.h" namespace __esan { class Flags { public: #define ESAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "esan_flags.inc" #undef ESAN_FLAG void setDefaults(); }; extern Flags EsanFlagsDontUseDirectly; inline Flags *getFlags() { return &EsanFlagsDontUseDirectly; } void initializeFlags(); } // namespace __esan #endif // ESAN_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan.syms.extra0000664000175000017500000000007212721152034025656 0ustar mwhudsonmwhudson__esan_init __esan_exit __esan_aligned* __esan_unaligned* golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_flags.cpp0000664000175000017500000000320212766606132025511 0ustar mwhudsonmwhudson//===-- esan_flags.cc -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Esan flag parsing logic. //===----------------------------------------------------------------------===// #include "esan_flags.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_flags.h" using namespace __sanitizer; namespace __esan { static const char EsanOptsEnv[] = "ESAN_OPTIONS"; Flags EsanFlagsDontUseDirectly; void Flags::setDefaults() { #define ESAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "esan_flags.inc" #undef ESAN_FLAG } static void registerEsanFlags(FlagParser *Parser, Flags *F) { #define ESAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(Parser, #Name, Description, &F->Name); #include "esan_flags.inc" #undef ESAN_FLAG } void initializeFlags() { SetCommonFlagsDefaults(); Flags *F = getFlags(); F->setDefaults(); FlagParser Parser; registerEsanFlags(&Parser, F); RegisterCommonFlags(&Parser); Parser.ParseString(GetEnv(EsanOptsEnv)); InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) Parser.PrintFlagDescriptions(); __sanitizer_set_report_path(common_flags()->log_path); } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_interface_internal.h0000664000175000017500000000670212766606132027726 0ustar mwhudsonmwhudson//===-- esan_interface_internal.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Calls to the functions declared in this header will be inserted by // the instrumentation module. //===----------------------------------------------------------------------===// #ifndef ESAN_INTERFACE_INTERNAL_H #define ESAN_INTERFACE_INTERNAL_H #include // This header should NOT include any other headers. // All functions in this header are extern "C" and start with __esan_. using __sanitizer::uptr; using __sanitizer::u32; extern "C" { // This should be kept consistent with LLVM's EfficiencySanitizerOptions. // The value is passed as a 32-bit integer by the compiler. typedef enum Type : u32 { ESAN_None = 0, ESAN_CacheFrag, ESAN_WorkingSet, ESAN_Max, } ToolType; // To handle interceptors that invoke instrumented code prior to // __esan_init() being called, the instrumentation module creates this // global variable specifying the tool. extern ToolType __esan_which_tool; // This function should be called at the very beginning of the process, // before any instrumented code is executed and before any call to malloc. SANITIZER_INTERFACE_ATTRIBUTE void __esan_init(ToolType Tool, void *Ptr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_exit(void *Ptr); // The instrumentation module will insert a call to one of these routines prior // to each load and store instruction for which we do not have "fastpath" // inlined instrumentation. These calls constitute the "slowpath" for our // tools. We have separate routines for each type of memory access to enable // targeted optimization. SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_load1(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_load2(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_load4(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_load8(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_load16(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_store1(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_store2(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_store4(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_store8(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_aligned_store16(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_load2(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_load4(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_load8(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_load16(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_store2(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_store4(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_store8(void *Addr); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_store16(void *Addr); // These cover unusually-sized accesses. SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_loadN(void *Addr, uptr Size); SANITIZER_INTERFACE_ATTRIBUTE void __esan_unaligned_storeN(void *Addr, uptr Size); } // extern "C" #endif // ESAN_INTERFACE_INTERNAL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/working_set.h0000664000175000017500000000250312743332550025405 0ustar mwhudsonmwhudson//===-- working_set.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Header for working-set-specific code. //===----------------------------------------------------------------------===// #ifndef WORKING_SET_H #define WORKING_SET_H #include "interception/interception.h" #include "sanitizer_common/sanitizer_internal_defs.h" namespace __esan { void initializeWorkingSet(); void initializeShadowWorkingSet(); int finalizeWorkingSet(); void reportWorkingSet(); unsigned int getSampleCountWorkingSet(); void processRangeAccessWorkingSet(uptr PC, uptr Addr, SIZE_T Size, bool IsWrite); // Platform-dependent. void registerMemoryFaultHandler(); bool processWorkingSetSignal(int SigNum, void (*Handler)(int), void (**Result)(int)); bool processWorkingSetSigaction(int SigNum, const void *Act, void *OldAct); bool processWorkingSetSigprocmask(int How, void *Set, void *OldSet); } // namespace __esan #endif // WORKING_SET_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_circular_buffer.h0000664000175000017500000000513112724330006027206 0ustar mwhudsonmwhudson//===-- esan_circular_buffer.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Circular buffer data structure. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" namespace __esan { // A circular buffer for POD data whose memory is allocated using mmap. // There are two usage models: one is to use initialize/free (for global // instances) and the other is to use placement new with the // constructor and to call the destructor or free (they are equivalent). template class CircularBuffer { public: // To support global instances we cannot initialize any field in the // default constructor. explicit CircularBuffer() {} CircularBuffer(uptr BufferCapacity) { initialize(BufferCapacity); WasConstructed = true; } ~CircularBuffer() { if (WasConstructed) // Else caller will call free() explicitly. free(); } void initialize(uptr BufferCapacity) { Capacity = BufferCapacity; // MmapOrDie rounds up to the page size for us. Data = (T *)MmapOrDie(Capacity * sizeof(T), "CircularBuffer"); StartIdx = 0; Count = 0; WasConstructed = false; } void free() { UnmapOrDie(Data, Capacity * sizeof(T)); } T &operator[](uptr Idx) { CHECK_LT(Idx, Count); uptr ArrayIdx = (StartIdx + Idx) % Capacity; return Data[ArrayIdx]; } const T &operator[](uptr Idx) const { CHECK_LT(Idx, Count); uptr ArrayIdx = (StartIdx + Idx) % Capacity; return Data[ArrayIdx]; } void push_back(const T &Item) { CHECK_GT(Capacity, 0); uptr ArrayIdx = (StartIdx + Count) % Capacity; Data[ArrayIdx] = Item; if (Count < Capacity) ++Count; else StartIdx = (StartIdx + 1) % Capacity; } T &back() { CHECK_GT(Count, 0); uptr ArrayIdx = (StartIdx + Count - 1) % Capacity; return Data[ArrayIdx]; } void pop_back() { CHECK_GT(Count, 0); --Count; } uptr size() const { return Count; } void clear() { StartIdx = 0; Count = 0; } bool empty() const { return size() == 0; } private: CircularBuffer(const CircularBuffer&); void operator=(const CircularBuffer&); bool WasConstructed; T *Data; uptr Capacity; uptr StartIdx; uptr Count; }; } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan.cpp0000664000175000017500000002260612775420063024343 0ustar mwhudsonmwhudson//===-- esan.cpp ----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Main file (entry points) for the Esan run-time. //===----------------------------------------------------------------------===// #include "esan.h" #include "esan_flags.h" #include "esan_interface_internal.h" #include "esan_shadow.h" #include "cache_frag.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_flags.h" #include "working_set.h" // See comment below. extern "C" { extern void __cxa_atexit(void (*function)(void)); } namespace __esan { bool EsanIsInitialized; bool EsanDuringInit; ShadowMapping Mapping; // Different tools use different scales within the same shadow mapping scheme. // The scale used here must match that used by the compiler instrumentation. // This array is indexed by the ToolType enum. static const uptr ShadowScale[] = { 0, // ESAN_None. 2, // ESAN_CacheFrag: 4B:1B, so 4 to 1 == >>2. 6, // ESAN_WorkingSet: 64B:1B, so 64 to 1 == >>6. }; // We are combining multiple performance tuning tools under the umbrella of // one EfficiencySanitizer super-tool. Most of our tools have very similar // memory access instrumentation, shadow memory mapping, libc interception, // etc., and there is typically more shared code than distinct code. // // We are not willing to dispatch on tool dynamically in our fastpath // instrumentation: thus, which tool to use is a static option selected // at compile time and passed to __esan_init(). // // We are willing to pay the overhead of tool dispatch in the slowpath to more // easily share code. We expect to only come here rarely. // If this becomes a performance hit, we can add separate interface // routines for each subtool (e.g., __esan_cache_frag_aligned_load_4). // But for libc interceptors, we'll have to do one of the following: // A) Add multiple-include support to sanitizer_common_interceptors.inc, // instantiate it separately for each tool, and call the selected // tool's intercept setup code. // B) Build separate static runtime libraries, one for each tool. // C) Completely split the tools into separate sanitizers. void processRangeAccess(uptr PC, uptr Addr, int Size, bool IsWrite) { VPrintf(3, "in esan::%s %p: %c %p %d\n", __FUNCTION__, PC, IsWrite ? 'w' : 'r', Addr, Size); if (__esan_which_tool == ESAN_CacheFrag) { // TODO(bruening): add shadow mapping and update shadow bits here. // We'll move this to cache_frag.cpp once we have something. } else if (__esan_which_tool == ESAN_WorkingSet) { processRangeAccessWorkingSet(PC, Addr, Size, IsWrite); } } bool processSignal(int SigNum, void (*Handler)(int), void (**Result)(int)) { if (__esan_which_tool == ESAN_WorkingSet) return processWorkingSetSignal(SigNum, Handler, Result); return true; } bool processSigaction(int SigNum, const void *Act, void *OldAct) { if (__esan_which_tool == ESAN_WorkingSet) return processWorkingSetSigaction(SigNum, Act, OldAct); return true; } bool processSigprocmask(int How, void *Set, void *OldSet) { if (__esan_which_tool == ESAN_WorkingSet) return processWorkingSetSigprocmask(How, Set, OldSet); return true; } #if SANITIZER_DEBUG static bool verifyShadowScheme() { // Sanity checks for our shadow mapping scheme. uptr AppStart, AppEnd; if (Verbosity() >= 3) { for (int i = 0; getAppRegion(i, &AppStart, &AppEnd); ++i) { VPrintf(3, "App #%d: [%zx-%zx) (%zuGB)\n", i, AppStart, AppEnd, (AppEnd - AppStart) >> 30); } } for (int Scale = 0; Scale < 8; ++Scale) { Mapping.initialize(Scale); if (Verbosity() >= 3) { VPrintf(3, "\nChecking scale %d\n", Scale); uptr ShadowStart, ShadowEnd; for (int i = 0; getShadowRegion(i, &ShadowStart, &ShadowEnd); ++i) { VPrintf(3, "Shadow #%d: [%zx-%zx) (%zuGB)\n", i, ShadowStart, ShadowEnd, (ShadowEnd - ShadowStart) >> 30); } for (int i = 0; getShadowRegion(i, &ShadowStart, &ShadowEnd); ++i) { VPrintf(3, "Shadow(Shadow) #%d: [%zx-%zx)\n", i, appToShadow(ShadowStart), appToShadow(ShadowEnd - 1)+1); } } for (int i = 0; getAppRegion(i, &AppStart, &AppEnd); ++i) { DCHECK(isAppMem(AppStart)); DCHECK(!isAppMem(AppStart - 1)); DCHECK(isAppMem(AppEnd - 1)); DCHECK(!isAppMem(AppEnd)); DCHECK(!isShadowMem(AppStart)); DCHECK(!isShadowMem(AppEnd - 1)); DCHECK(isShadowMem(appToShadow(AppStart))); DCHECK(isShadowMem(appToShadow(AppEnd - 1))); // Double-shadow checks. DCHECK(!isShadowMem(appToShadow(appToShadow(AppStart)))); DCHECK(!isShadowMem(appToShadow(appToShadow(AppEnd - 1)))); } // Ensure no shadow regions overlap each other. uptr ShadowAStart, ShadowBStart, ShadowAEnd, ShadowBEnd; for (int i = 0; getShadowRegion(i, &ShadowAStart, &ShadowAEnd); ++i) { for (int j = 0; getShadowRegion(j, &ShadowBStart, &ShadowBEnd); ++j) { DCHECK(i == j || ShadowAStart >= ShadowBEnd || ShadowAEnd <= ShadowBStart); } } } return true; } #endif uptr VmaSize; static void initializeShadow() { verifyAddressSpace(); // This is based on the assumption that the intial stack is always allocated // in the topmost segment of the user address space and the assumption // holds true on all the platforms currently supported. VmaSize = (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1); DCHECK(verifyShadowScheme()); Mapping.initialize(ShadowScale[__esan_which_tool]); VPrintf(1, "Shadow scale=%d offset=%p\n", Mapping.Scale, Mapping.Offset); uptr ShadowStart, ShadowEnd; for (int i = 0; getShadowRegion(i, &ShadowStart, &ShadowEnd); ++i) { VPrintf(1, "Shadow #%d: [%zx-%zx) (%zuGB)\n", i, ShadowStart, ShadowEnd, (ShadowEnd - ShadowStart) >> 30); uptr Map; if (__esan_which_tool == ESAN_WorkingSet) { // We want to identify all shadow pages that are touched so we start // out inaccessible. Map = (uptr)MmapFixedNoAccess(ShadowStart, ShadowEnd- ShadowStart, "shadow"); } else { Map = (uptr)MmapFixedNoReserve(ShadowStart, ShadowEnd - ShadowStart, "shadow"); } if (Map != ShadowStart) { Printf("FATAL: EfficiencySanitizer failed to map its shadow memory.\n"); Die(); } if (common_flags()->no_huge_pages_for_shadow) NoHugePagesInRegion(ShadowStart, ShadowEnd - ShadowStart); if (common_flags()->use_madv_dontdump) DontDumpShadowMemory(ShadowStart, ShadowEnd - ShadowStart); // TODO: Call MmapNoAccess() on in-between regions. } } void initializeLibrary(ToolType Tool) { // We assume there is only one thread during init, but we need to // guard against double-init when we're (re-)called from an // early interceptor. if (EsanIsInitialized || EsanDuringInit) return; EsanDuringInit = true; CHECK(Tool == __esan_which_tool); SanitizerToolName = "EfficiencySanitizer"; CacheBinaryName(); initializeFlags(); // Intercepting libc _exit or exit via COMMON_INTERCEPTOR_ON_EXIT only // finalizes on an explicit exit call by the app. To handle a normal // exit we register an atexit handler. ::__cxa_atexit((void (*)())finalizeLibrary); VPrintf(1, "in esan::%s\n", __FUNCTION__); if (__esan_which_tool <= ESAN_None || __esan_which_tool >= ESAN_Max) { Printf("ERROR: unknown tool %d requested\n", __esan_which_tool); Die(); } initializeShadow(); if (__esan_which_tool == ESAN_WorkingSet) initializeShadowWorkingSet(); initializeInterceptors(); if (__esan_which_tool == ESAN_CacheFrag) { initializeCacheFrag(); } else if (__esan_which_tool == ESAN_WorkingSet) { initializeWorkingSet(); } EsanIsInitialized = true; EsanDuringInit = false; } int finalizeLibrary() { VPrintf(1, "in esan::%s\n", __FUNCTION__); if (__esan_which_tool == ESAN_CacheFrag) { return finalizeCacheFrag(); } else if (__esan_which_tool == ESAN_WorkingSet) { return finalizeWorkingSet(); } return 0; } void reportResults() { VPrintf(1, "in esan::%s\n", __FUNCTION__); if (__esan_which_tool == ESAN_CacheFrag) { return reportCacheFrag(); } else if (__esan_which_tool == ESAN_WorkingSet) { return reportWorkingSet(); } } void processCompilationUnitInit(void *Ptr) { VPrintf(2, "in esan::%s\n", __FUNCTION__); if (__esan_which_tool == ESAN_CacheFrag) { DCHECK(Ptr != nullptr); processCacheFragCompilationUnitInit(Ptr); } else { DCHECK(Ptr == nullptr); } } // This is called when the containing module is unloaded. // For the main executable module, this is called after finalizeLibrary. void processCompilationUnitExit(void *Ptr) { VPrintf(2, "in esan::%s\n", __FUNCTION__); if (__esan_which_tool == ESAN_CacheFrag) { DCHECK(Ptr != nullptr); processCacheFragCompilationUnitExit(Ptr); } else { DCHECK(Ptr == nullptr); } } unsigned int getSampleCount() { VPrintf(1, "in esan::%s\n", __FUNCTION__); if (__esan_which_tool == ESAN_WorkingSet) { return getSampleCountWorkingSet(); } return 0; } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/cache_frag.h0000664000175000017500000000152412740074745025124 0ustar mwhudsonmwhudson//===-- cache_frag.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Header for cache-fragmentation-specific code. //===----------------------------------------------------------------------===// #ifndef CACHE_FRAG_H #define CACHE_FRAG_H namespace __esan { void processCacheFragCompilationUnitInit(void *Ptr); void processCacheFragCompilationUnitExit(void *Ptr); void initializeCacheFrag(); int finalizeCacheFrag(); void reportCacheFrag(); } // namespace __esan #endif // CACHE_FRAG_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/CMakeLists.txt0000664000175000017500000000177212760126006025444 0ustar mwhudsonmwhudson# Build for the EfficiencySanitizer runtime support library. add_compiler_rt_component(esan) set(ESAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF ESAN_RTL_CFLAGS) include_directories(..) set(ESAN_SOURCES esan.cpp esan_flags.cpp esan_interface.cpp esan_interceptors.cpp esan_linux.cpp esan_sideline_linux.cpp cache_frag.cpp working_set.cpp working_set_posix.cpp) foreach (arch ${ESAN_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.esan STATIC ARCHS ${arch} SOURCES ${ESAN_SOURCES} $ $ $ CFLAGS ${ESAN_RTL_CFLAGS}) add_sanitizer_rt_symbols(clang_rt.esan ARCHS ${arch} EXTRA esan.syms.extra) add_dependencies(esan clang_rt.esan-${arch} clang_rt.esan-${arch}-symbols) endforeach() if (COMPILER_RT_INCLUDE_TESTS) # TODO(bruening): add tests via add_subdirectory(tests) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/working_set_posix.cpp0000664000175000017500000001204312737271160027164 0ustar mwhudsonmwhudson//===-- working_set_posix.cpp -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // POSIX-specific working set tool code. //===----------------------------------------------------------------------===// #include "working_set.h" #include "esan_flags.h" #include "esan_shadow.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_linux.h" #include #include namespace __esan { // We only support regular POSIX threads with a single signal handler // for the whole process == thread group. // Thus we only need to store one app signal handler. // FIXME: Store and use any alternate stack and signal flags set by // the app. For now we just call the app handler from our handler. static __sanitizer_sigaction AppSigAct; bool processWorkingSetSignal(int SigNum, void (*Handler)(int), void (**Result)(int)) { VPrintf(2, "%s: %d\n", __FUNCTION__, SigNum); if (SigNum == SIGSEGV) { *Result = AppSigAct.handler; AppSigAct.sigaction = (void (*)(int, void*, void*))Handler; return false; // Skip real call. } return true; } bool processWorkingSetSigaction(int SigNum, const void *ActVoid, void *OldActVoid) { VPrintf(2, "%s: %d\n", __FUNCTION__, SigNum); if (SigNum == SIGSEGV) { const struct sigaction *Act = (const struct sigaction *) ActVoid; struct sigaction *OldAct = (struct sigaction *) OldActVoid; if (OldAct) internal_memcpy(OldAct, &AppSigAct, sizeof(OldAct)); if (Act) internal_memcpy(&AppSigAct, Act, sizeof(AppSigAct)); return false; // Skip real call. } return true; } bool processWorkingSetSigprocmask(int How, void *Set, void *OldSet) { VPrintf(2, "%s\n", __FUNCTION__); // All we need to do is ensure that SIGSEGV is not blocked. // FIXME: we are not fully transparent as we do not pretend that // SIGSEGV is still blocked on app queries: that would require // per-thread mask tracking. if (Set && (How == SIG_BLOCK || How == SIG_SETMASK)) { if (internal_sigismember((__sanitizer_sigset_t *)Set, SIGSEGV)) { VPrintf(1, "%s: removing SIGSEGV from the blocked set\n", __FUNCTION__); internal_sigdelset((__sanitizer_sigset_t *)Set, SIGSEGV); } } return true; } static void reinstateDefaultHandler(int SigNum) { __sanitizer_sigaction SigAct; internal_memset(&SigAct, 0, sizeof(SigAct)); SigAct.sigaction = (void (*)(int, void*, void*)) SIG_DFL; int Res = internal_sigaction(SigNum, &SigAct, nullptr); CHECK(Res == 0); VPrintf(1, "Unregistered for %d handler\n", SigNum); } // If this is a shadow fault, we handle it here; otherwise, we pass it to the // app to handle it just as the app would do without our tool in place. static void handleMemoryFault(int SigNum, void *Info, void *Ctx) { if (SigNum == SIGSEGV) { // We rely on si_addr being filled in (thus we do not support old kernels). siginfo_t *SigInfo = (siginfo_t *)Info; uptr Addr = (uptr)SigInfo->si_addr; if (isShadowMem(Addr)) { VPrintf(3, "Shadow fault @%p\n", Addr); uptr PageSize = GetPageSizeCached(); int Res = internal_mprotect((void *)RoundDownTo(Addr, PageSize), PageSize, PROT_READ|PROT_WRITE); CHECK(Res == 0); } else if (AppSigAct.sigaction) { // FIXME: For simplicity we ignore app options including its signal stack // (we just use ours) and all the delivery flags. AppSigAct.sigaction(SigNum, Info, Ctx); } else { // Crash instead of spinning with infinite faults. reinstateDefaultHandler(SigNum); } } else UNREACHABLE("signal not registered"); } void registerMemoryFaultHandler() { // We do not use an alternate signal stack, as doing so would require // setting it up for each app thread. // FIXME: This could result in problems with emulating the app's signal // handling if the app relies on an alternate stack for SIGSEGV. // We require that SIGSEGV is not blocked. We use a sigprocmask // interceptor to ensure that in the future. Here we ensure it for // the current thread. We assume there are no other threads at this // point during initialization, or that at least they do not block // SIGSEGV. __sanitizer_sigset_t SigSet; internal_sigemptyset(&SigSet); internal_sigprocmask(SIG_BLOCK, &SigSet, nullptr); __sanitizer_sigaction SigAct; internal_memset(&SigAct, 0, sizeof(SigAct)); SigAct.sigaction = handleMemoryFault; // We want to handle nested signals b/c we need to handle a // shadow fault in an app signal handler. SigAct.sa_flags = SA_SIGINFO | SA_NODEFER; int Res = internal_sigaction(SIGSEGV, &SigAct, &AppSigAct); CHECK(Res == 0); VPrintf(1, "Registered for SIGSEGV handler\n"); } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_linux.cpp0000664000175000017500000000500112775420063025550 0ustar mwhudsonmwhudson//===-- esan.cpp ----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Linux-specific code for the Esan run-time. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "esan.h" #include "esan_shadow.h" #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" #include #include namespace __esan { void verifyAddressSpace() { #if SANITIZER_LINUX && (defined(__x86_64__) || SANITIZER_MIPS64) // The kernel determines its mmap base from the stack size limit. // Our Linux 64-bit shadow mapping assumes the stack limit is less than a // terabyte, which keeps the mmap region above 0x7e00'. uptr StackLimit = GetStackSizeLimitInBytes(); if (StackSizeIsUnlimited() || StackLimit > MaxStackSize) { VReport(1, "The stack size limit is beyond the maximum supported.\n" "Re-execing with a stack size below 1TB.\n"); SetStackSizeLimitInBytes(MaxStackSize); ReExec(); } #endif } static bool liesWithinSingleAppRegion(uptr Start, SIZE_T Size) { uptr AppStart, AppEnd; for (int i = 0; getAppRegion(i, &AppStart, &AppEnd); ++i) { if (Start >= AppStart && Start + Size - 1 <= AppEnd) { return true; } } return false; } bool fixMmapAddr(void **Addr, SIZE_T Size, int Flags) { if (*Addr) { if (!liesWithinSingleAppRegion((uptr)*Addr, Size)) { VPrintf(1, "mmap conflict: [%p-%p) is not in an app region\n", *Addr, (uptr)*Addr + Size); if (Flags & MAP_FIXED) { errno = EINVAL; return false; } else { *Addr = 0; } } } return true; } uptr checkMmapResult(uptr Addr, SIZE_T Size) { if ((void *)Addr == MAP_FAILED) return Addr; if (!liesWithinSingleAppRegion(Addr, Size)) { // FIXME: attempt to dynamically add this as an app region if it // fits our shadow criteria. // We could also try to remap somewhere else. Printf("ERROR: unsupported mapping at [%p-%p)\n", Addr, Addr+Size); Die(); } return Addr; } } // namespace __esan #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_hashtable.h0000664000175000017500000003127112752141517026020 0ustar mwhudsonmwhudson//===-- esan_hashtable.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Generic resizing hashtable. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_mutex.h" #include namespace __esan { //===----------------------------------------------------------------------===// // Default hash and comparison functions //===----------------------------------------------------------------------===// template struct DefaultHash { size_t operator()(const T &Key) const { return (size_t)Key; } }; template struct DefaultEqual { bool operator()(const T &Key1, const T &Key2) const { return Key1 == Key2; } }; //===----------------------------------------------------------------------===// // HashTable declaration //===----------------------------------------------------------------------===// // A simple resizing and mutex-locked hashtable. // // If the default hash functor is used, KeyTy must have an operator size_t(). // If the default comparison functor is used, KeyTy must have an operator ==. // // By default all operations are internally-synchronized with a mutex, with no // synchronization for payloads once hashtable functions return. If // ExternalLock is set to true, the caller should call the lock() and unlock() // routines around all hashtable operations and subsequent manipulation of // payloads. template , typename EqualFuncTy = DefaultEqual > class HashTable { public: // InitialCapacity must be a power of 2. // ResizeFactor must be between 1 and 99 and indicates the // maximum percentage full that the table should ever be. HashTable(u32 InitialCapacity = 2048, u32 ResizeFactor = 70); ~HashTable(); bool lookup(const KeyTy &Key, DataTy &Payload); // Const except for Mutex. bool add(const KeyTy &Key, const DataTy &Payload); bool remove(const KeyTy &Key); u32 size(); // Const except for Mutex. // If the table is internally-synchronized, this lock must not be held // while a hashtable function is called as it will deadlock: the lock // is not recursive. This is meant for use with externally-synchronized // tables or with an iterator. void lock(); void unlock(); private: struct HashEntry { KeyTy Key; DataTy Payload; HashEntry *Next; }; public: struct HashPair { HashPair(KeyTy Key, DataTy Data) : Key(Key), Data(Data) {} KeyTy Key; DataTy Data; }; // This iterator does not perform any synchronization. // It expects the caller to lock the table across the whole iteration. // Calling HashTable functions while using the iterator is not supported. // The iterator returns copies of the keys and data. class iterator { public: iterator( HashTable *Table); iterator(const iterator &Src) = default; iterator &operator=(const iterator &Src) = default; HashPair operator*(); iterator &operator++(); iterator &operator++(int); bool operator==(const iterator &Cmp) const; bool operator!=(const iterator &Cmp) const; private: iterator( HashTable *Table, int Idx); friend HashTable; HashTable *Table; int Idx; HashTable::HashEntry *Entry; }; // No erase or insert iterator supported iterator begin(); iterator end(); private: void resize(); HashEntry **Table; u32 Capacity; u32 Entries; const u32 ResizeFactor; BlockingMutex Mutex; const HashFuncTy HashFunc; const EqualFuncTy EqualFunc; }; //===----------------------------------------------------------------------===// // Hashtable implementation //===----------------------------------------------------------------------===// template HashTable::HashTable( u32 InitialCapacity, u32 ResizeFactor) : Capacity(InitialCapacity), Entries(0), ResizeFactor(ResizeFactor), HashFunc(HashFuncTy()), EqualFunc(EqualFuncTy()) { CHECK(IsPowerOfTwo(Capacity)); CHECK(ResizeFactor >= 1 && ResizeFactor <= 99); Table = (HashEntry **)InternalAlloc(Capacity * sizeof(HashEntry *)); internal_memset(Table, 0, Capacity * sizeof(HashEntry *)); } template HashTable::~HashTable() { for (u32 i = 0; i < Capacity; ++i) { HashEntry *Entry = Table[i]; while (Entry != nullptr) { HashEntry *Next = Entry->Next; Entry->Payload.~DataTy(); InternalFree(Entry); Entry = Next; } } InternalFree(Table); } template u32 HashTable::size() { u32 Res; if (!ExternalLock) Mutex.Lock(); Res = Entries; if (!ExternalLock) Mutex.Unlock(); return Res; } template bool HashTable::lookup( const KeyTy &Key, DataTy &Payload) { if (!ExternalLock) Mutex.Lock(); bool Found = false; size_t Hash = HashFunc(Key) % Capacity; HashEntry *Entry = Table[Hash]; for (; Entry != nullptr; Entry = Entry->Next) { if (EqualFunc(Entry->Key, Key)) { Payload = Entry->Payload; Found = true; break; } } if (!ExternalLock) Mutex.Unlock(); return Found; } template void HashTable::resize() { if (!ExternalLock) Mutex.CheckLocked(); size_t OldCapacity = Capacity; HashEntry **OldTable = Table; Capacity *= 2; Table = (HashEntry **)InternalAlloc(Capacity * sizeof(HashEntry *)); internal_memset(Table, 0, Capacity * sizeof(HashEntry *)); // Re-hash for (u32 i = 0; i < OldCapacity; ++i) { HashEntry *OldEntry = OldTable[i]; while (OldEntry != nullptr) { HashEntry *Next = OldEntry->Next; size_t Hash = HashFunc(OldEntry->Key) % Capacity; OldEntry->Next = Table[Hash]; Table[Hash] = OldEntry; OldEntry = Next; } } } template bool HashTable::add( const KeyTy &Key, const DataTy &Payload) { if (!ExternalLock) Mutex.Lock(); bool Exists = false; size_t Hash = HashFunc(Key) % Capacity; HashEntry *Entry = Table[Hash]; for (; Entry != nullptr; Entry = Entry->Next) { if (EqualFunc(Entry->Key, Key)) { Exists = true; break; } } if (!Exists) { Entries++; if (Entries * 100 >= Capacity * ResizeFactor) { resize(); Hash = HashFunc(Key) % Capacity; } HashEntry *Add = (HashEntry *)InternalAlloc(sizeof(*Add)); Add->Key = Key; Add->Payload = Payload; Add->Next = Table[Hash]; Table[Hash] = Add; } if (!ExternalLock) Mutex.Unlock(); return !Exists; } template bool HashTable::remove( const KeyTy &Key) { if (!ExternalLock) Mutex.Lock(); bool Found = false; size_t Hash = HashFunc(Key) % Capacity; HashEntry *Entry = Table[Hash]; HashEntry *Prev = nullptr; for (; Entry != nullptr; Prev = Entry, Entry = Entry->Next) { if (EqualFunc(Entry->Key, Key)) { Found = true; Entries--; if (Prev == nullptr) Table[Hash] = Entry->Next; else Prev->Next = Entry->Next; Entry->Payload.~DataTy(); InternalFree(Entry); break; } } if (!ExternalLock) Mutex.Unlock(); return Found; } template void HashTable::lock() { Mutex.Lock(); } template void HashTable::unlock() { Mutex.Unlock(); } //===----------------------------------------------------------------------===// // Iterator implementation //===----------------------------------------------------------------------===// template HashTable::iterator:: iterator( HashTable *Table) : Table(Table), Idx(-1), Entry(nullptr) { operator++(); } template HashTable::iterator:: iterator( HashTable *Table, int Idx) : Table(Table), Idx(Idx), Entry(nullptr) { CHECK(Idx >= (int)Table->Capacity); // Only used to create end(). } template typename HashTable::HashPair HashTable::iterator:: operator*() { CHECK(Idx >= 0 && Idx < (int)Table->Capacity); CHECK(Entry != nullptr); return HashPair(Entry->Key, Entry->Payload); } template typename HashTable::iterator & HashTable::iterator:: operator++() { if (Entry != nullptr) Entry = Entry->Next; while (Entry == nullptr) { ++Idx; if (Idx >= (int)Table->Capacity) break; // At end(). Entry = Table->Table[Idx]; } return *this; } template typename HashTable::iterator & HashTable::iterator:: operator++(int) { iterator Temp(*this); operator++(); return Temp; } template bool HashTable::iterator:: operator==(const iterator &Cmp) const { return Cmp.Table == Table && Cmp.Idx == Idx && Cmp.Entry == Entry; } template bool HashTable::iterator:: operator!=(const iterator &Cmp) const { return Cmp.Table != Table || Cmp.Idx != Idx || Cmp.Entry != Entry; } template typename HashTable::iterator HashTable::begin() { return iterator(this); } template typename HashTable::iterator HashTable::end() { return iterator(this, Capacity); } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan.h0000664000175000017500000000426012775420063024004 0ustar mwhudsonmwhudson//===-- esan.h --------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Main internal esan header file. // // Ground rules: // - C++ run-time should not be used (static CTORs, RTTI, exceptions, static // function-scope locals) // - All functions/classes/etc reside in namespace __esan, except for those // declared in esan_interface_internal.h. // - Platform-specific files should be used instead of ifdefs (*). // - No system headers included in header files (*). // - Platform specific headers included only into platform-specific files (*). // // (*) Except when inlining is critical for performance. //===----------------------------------------------------------------------===// #ifndef ESAN_H #define ESAN_H #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" #include "esan_interface_internal.h" namespace __esan { extern bool EsanIsInitialized; extern bool EsanDuringInit; extern uptr VmaSize; void initializeLibrary(ToolType Tool); int finalizeLibrary(); void reportResults(); unsigned int getSampleCount(); // Esan creates the variable per tool per compilation unit at compile time // and passes its pointer Ptr to the runtime library. void processCompilationUnitInit(void *Ptr); void processCompilationUnitExit(void *Ptr); void processRangeAccess(uptr PC, uptr Addr, int Size, bool IsWrite); void initializeInterceptors(); // Platform-dependent routines. void verifyAddressSpace(); bool fixMmapAddr(void **Addr, SIZE_T Size, int Flags); uptr checkMmapResult(uptr Addr, SIZE_T Size); // The return value indicates whether to call the real version or not. bool processSignal(int SigNum, void (*Handler)(int), void (**Result)(int)); bool processSigaction(int SigNum, const void *Act, void *OldAct); bool processSigprocmask(int How, void *Set, void *OldSet); } // namespace __esan #endif // ESAN_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/working_set.cpp0000664000175000017500000002362012743332550025743 0ustar mwhudsonmwhudson//===-- working_set.cpp ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // This file contains working-set-specific code. //===----------------------------------------------------------------------===// #include "working_set.h" #include "esan.h" #include "esan_circular_buffer.h" #include "esan_flags.h" #include "esan_shadow.h" #include "esan_sideline.h" #include "sanitizer_common/sanitizer_procmaps.h" // We shadow every cache line of app memory with one shadow byte. // - The highest bit of each shadow byte indicates whether the corresponding // cache line has ever been accessed. // - The lowest bit of each shadow byte indicates whether the corresponding // cache line was accessed since the last sample. // - The other bits are used for working set snapshots at successively // lower frequencies, each bit to the left from the lowest bit stepping // down the frequency by 2 to the power of getFlags()->snapshot_step. // Thus we have something like this: // Bit 0: Since last sample // Bit 1: Since last 2^2 samples // Bit 2: Since last 2^4 samples // Bit 3: ... // Bit 7: Ever accessed. // We live with races in accessing each shadow byte. typedef unsigned char byte; namespace __esan { // Our shadow memory assumes that the line size is 64. static const u32 CacheLineSize = 64; // See the shadow byte layout description above. static const u32 TotalWorkingSetBitIdx = 7; // We accumulate to the left until we hit this bit. // We don't need to accumulate to the final bit as it's set on each ref // by the compiler instrumentation. static const u32 MaxAccumBitIdx = 6; static const u32 CurWorkingSetBitIdx = 0; static const byte ShadowAccessedVal = (1 << TotalWorkingSetBitIdx) | (1 << CurWorkingSetBitIdx); static SidelineThread Thread; // If we use real-time-based timer samples this won't overflow in any realistic // scenario, but if we switch to some other unit (such as memory accesses) we // may want to consider a 64-bit int. static u32 SnapshotNum; // We store the wset size for each of 8 different sampling frequencies. static const u32 NumFreq = 8; // One for each bit of our shadow bytes. // We cannot use static objects as the global destructor is called // prior to our finalize routine. // These are each circular buffers, sized up front. CircularBuffer SizePerFreq[NumFreq]; // We cannot rely on static initializers (they may run too late) but // we record the size here for clarity: u32 CircularBufferSizes[NumFreq] = { // These are each mmap-ed so our minimum is one page. 32*1024, 16*1024, 8*1024, 4*1024, 4*1024, 4*1024, 4*1024, 4*1024, }; void processRangeAccessWorkingSet(uptr PC, uptr Addr, SIZE_T Size, bool IsWrite) { if (Size == 0) return; SIZE_T I = 0; uptr LineSize = getFlags()->cache_line_size; // As Addr+Size could overflow at the top of a 32-bit address space, // we avoid the simpler formula that rounds the start and end. SIZE_T NumLines = Size / LineSize + // Add any extra at the start or end adding on an extra line: (LineSize - 1 + Addr % LineSize + Size % LineSize) / LineSize; byte *Shadow = (byte *)appToShadow(Addr); // Write shadow bytes until we're word-aligned. while (I < NumLines && (uptr)Shadow % 4 != 0) { if ((*Shadow & ShadowAccessedVal) != ShadowAccessedVal) *Shadow |= ShadowAccessedVal; ++Shadow; ++I; } // Write whole shadow words at a time. // Using a word-stride loop improves the runtime of a microbenchmark of // memset calls by 10%. u32 WordValue = ShadowAccessedVal | ShadowAccessedVal << 8 | ShadowAccessedVal << 16 | ShadowAccessedVal << 24; while (I + 4 <= NumLines) { if ((*(u32*)Shadow & WordValue) != WordValue) *(u32*)Shadow |= WordValue; Shadow += 4; I += 4; } // Write any trailing shadow bytes. while (I < NumLines) { if ((*Shadow & ShadowAccessedVal) != ShadowAccessedVal) *Shadow |= ShadowAccessedVal; ++Shadow; ++I; } } // This routine will word-align ShadowStart and ShadowEnd prior to scanning. // It does *not* clear for BitIdx==TotalWorkingSetBitIdx, as that top bit // measures the access during the entire execution and should never be cleared. static u32 countAndClearShadowValues(u32 BitIdx, uptr ShadowStart, uptr ShadowEnd) { u32 WorkingSetSize = 0; u32 ByteValue = 0x1 << BitIdx; u32 WordValue = ByteValue | ByteValue << 8 | ByteValue << 16 | ByteValue << 24; // Get word aligned start. ShadowStart = RoundDownTo(ShadowStart, sizeof(u32)); bool Accum = getFlags()->record_snapshots && BitIdx < MaxAccumBitIdx; // Do not clear the bit that measures access during the entire execution. bool Clear = BitIdx < TotalWorkingSetBitIdx; for (u32 *Ptr = (u32 *)ShadowStart; Ptr < (u32 *)ShadowEnd; ++Ptr) { if ((*Ptr & WordValue) != 0) { byte *BytePtr = (byte *)Ptr; for (u32 j = 0; j < sizeof(u32); ++j) { if (BytePtr[j] & ByteValue) { ++WorkingSetSize; if (Accum) { // Accumulate to the lower-frequency bit to the left. BytePtr[j] |= (ByteValue << 1); } } } if (Clear) { // Clear this bit from every shadow byte. *Ptr &= ~WordValue; } } } return WorkingSetSize; } // Scan shadow memory to calculate the number of cache lines being accessed, // i.e., the number of non-zero bits indexed by BitIdx in each shadow byte. // We also clear the lowest bits (most recent working set snapshot). // We do *not* clear for BitIdx==TotalWorkingSetBitIdx, as that top bit // measures the access during the entire execution and should never be cleared. static u32 computeWorkingSizeAndReset(u32 BitIdx) { u32 WorkingSetSize = 0; MemoryMappingLayout MemIter(true/*cache*/); uptr Start, End, Prot; while (MemIter.Next(&Start, &End, nullptr/*offs*/, nullptr/*file*/, 0/*file size*/, &Prot)) { VPrintf(4, "%s: considering %p-%p app=%d shadow=%d prot=%u\n", __FUNCTION__, Start, End, Prot, isAppMem(Start), isShadowMem(Start)); if (isShadowMem(Start) && (Prot & MemoryMappingLayout::kProtectionWrite)) { VPrintf(3, "%s: walking %p-%p\n", __FUNCTION__, Start, End); WorkingSetSize += countAndClearShadowValues(BitIdx, Start, End); } } return WorkingSetSize; } // This is invoked from a signal handler but in a sideline thread doing nothing // else so it is a little less fragile than a typical signal handler. static void takeSample(void *Arg) { u32 BitIdx = CurWorkingSetBitIdx; u32 Freq = 1; ++SnapshotNum; // Simpler to skip 0 whose mod matches everything. while (BitIdx <= MaxAccumBitIdx && (SnapshotNum % Freq) == 0) { u32 NumLines = computeWorkingSizeAndReset(BitIdx); VReport(1, "%s: snapshot #%5d bit %d freq %4d: %8u\n", SanitizerToolName, SnapshotNum, BitIdx, Freq, NumLines); SizePerFreq[BitIdx].push_back(NumLines); Freq = Freq << getFlags()->snapshot_step; BitIdx++; } } unsigned int getSampleCountWorkingSet() { return SnapshotNum; } // Initialization that must be done before any instrumented code is executed. void initializeShadowWorkingSet() { CHECK(getFlags()->cache_line_size == CacheLineSize); registerMemoryFaultHandler(); } void initializeWorkingSet() { if (getFlags()->record_snapshots) { for (u32 i = 0; i < NumFreq; ++i) SizePerFreq[i].initialize(CircularBufferSizes[i]); Thread.launchThread(takeSample, nullptr, getFlags()->sample_freq); } } static u32 getPeriodForPrinting(u32 MilliSec, const char *&Unit) { if (MilliSec > 600000) { Unit = "min"; return MilliSec / 60000; } else if (MilliSec > 10000) { Unit = "sec"; return MilliSec / 1000; } else { Unit = "ms"; return MilliSec; } } static u32 getSizeForPrinting(u32 NumOfCachelines, const char *&Unit) { // We need a constant to avoid software divide support: static const u32 KilobyteCachelines = (0x1 << 10) / CacheLineSize; static const u32 MegabyteCachelines = KilobyteCachelines << 10; if (NumOfCachelines > 10 * MegabyteCachelines) { Unit = "MB"; return NumOfCachelines / MegabyteCachelines; } else if (NumOfCachelines > 10 * KilobyteCachelines) { Unit = "KB"; return NumOfCachelines / KilobyteCachelines; } else { Unit = "Bytes"; return NumOfCachelines * CacheLineSize; } } void reportWorkingSet() { const char *Unit; if (getFlags()->record_snapshots) { u32 Freq = 1; Report(" Total number of samples: %u\n", SnapshotNum); for (u32 i = 0; i < NumFreq; ++i) { u32 Time = getPeriodForPrinting(getFlags()->sample_freq*Freq, Unit); Report(" Samples array #%d at period %u %s\n", i, Time, Unit); // FIXME: report whether we wrapped around and thus whether we // have data on the whole run or just the last N samples. for (u32 j = 0; j < SizePerFreq[i].size(); ++j) { u32 Size = getSizeForPrinting(SizePerFreq[i][j], Unit); Report("#%4d: %8u %s (%9u cache lines)\n", j, Size, Unit, SizePerFreq[i][j]); } Freq = Freq << getFlags()->snapshot_step; } } // Get the working set size for the entire execution. u32 NumOfCachelines = computeWorkingSizeAndReset(TotalWorkingSetBitIdx); u32 Size = getSizeForPrinting(NumOfCachelines, Unit); Report(" %s: the total working set size: %u %s (%u cache lines)\n", SanitizerToolName, Size, Unit, NumOfCachelines); } int finalizeWorkingSet() { if (getFlags()->record_snapshots) Thread.joinThread(); reportWorkingSet(); if (getFlags()->record_snapshots) { for (u32 i = 0; i < NumFreq; ++i) SizePerFreq[i].free(); } return 0; } } // namespace __esan golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_sideline_linux.cpp0000664000175000017500000001444212743332252027432 0ustar mwhudsonmwhudson//===-- esan_sideline_linux.cpp ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Support for a separate or "sideline" tool thread on Linux. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX #include "esan_sideline.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_linux.h" #include #include #include #include #include #include #include namespace __esan { static const int SigAltStackSize = 4*1024; static const int SidelineStackSize = 4*1024; static const uptr SidelineIdUninitialized = 1; // FIXME: we'll need some kind of TLS (can we trust that a pthread key will // work in our non-POSIX thread?) to access our data in our signal handler // with multiple sideline threads. For now we assume there is only one // sideline thread and we use a dirty solution of a global var. static SidelineThread *TheThread; // We aren't passing SA_NODEFER so the same signal is blocked while here. void SidelineThread::handleSidelineSignal(int SigNum, void *SigInfo, void *Ctx) { VPrintf(3, "Sideline signal %d\n", SigNum); CHECK_EQ(SigNum, SIGALRM); // See above about needing TLS to avoid this global var. SidelineThread *Thread = TheThread; if (atomic_load(&Thread->SidelineExit, memory_order_relaxed) != 0) return; Thread->sampleFunc(Thread->FuncArg); } void SidelineThread::registerSignal(int SigNum) { __sanitizer_sigaction SigAct; internal_memset(&SigAct, 0, sizeof(SigAct)); SigAct.sigaction = handleSidelineSignal; // We do not pass SA_NODEFER as we want to block the same signal. SigAct.sa_flags = SA_ONSTACK | SA_SIGINFO; int Res = internal_sigaction(SigNum, &SigAct, nullptr); CHECK_EQ(Res, 0); } int SidelineThread::runSideline(void *Arg) { VPrintf(1, "Sideline thread starting\n"); SidelineThread *Thread = static_cast(Arg); // If the parent dies, we want to exit also. internal_prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); // Set up a signal handler on an alternate stack for safety. InternalScopedBuffer StackMap(SigAltStackSize); struct sigaltstack SigAltStack; SigAltStack.ss_sp = StackMap.data(); SigAltStack.ss_size = SigAltStackSize; SigAltStack.ss_flags = 0; internal_sigaltstack(&SigAltStack, nullptr); // We inherit the signal mask from the app thread. In case // we weren't created at init time, we ensure the mask is empty. __sanitizer_sigset_t SigSet; internal_sigfillset(&SigSet); int Res = internal_sigprocmask(SIG_UNBLOCK, &SigSet, nullptr); CHECK_EQ(Res, 0); registerSignal(SIGALRM); bool TimerSuccess = Thread->adjustTimer(Thread->Freq); CHECK(TimerSuccess); // We loop, doing nothing but handling itimer signals. while (atomic_load(&TheThread->SidelineExit, memory_order_relaxed) == 0) sched_yield(); if (!Thread->adjustTimer(0)) VPrintf(1, "Failed to disable timer\n"); VPrintf(1, "Sideline thread exiting\n"); return 0; } bool SidelineThread::launchThread(SidelineFunc takeSample, void *Arg, u32 FreqMilliSec) { // This can only be called once. However, we can't clear a field in // the constructor and check for that here as the constructor for // a static instance is called *after* our module_ctor and thus after // this routine! Thus we rely on the TheThread check below. CHECK(TheThread == nullptr); // Only one sideline thread is supported. TheThread = this; sampleFunc = takeSample; FuncArg = Arg; Freq = FreqMilliSec; atomic_store(&SidelineExit, 0, memory_order_relaxed); // We do without a guard page. Stack = static_cast(MmapOrDie(SidelineStackSize, "SidelineStack")); // We need to handle the return value from internal_clone() not having been // assigned yet (for our CHECK in adjustTimer()) so we ensure this has a // sentinel value. SidelineId = SidelineIdUninitialized; // By omitting CLONE_THREAD, the child is in its own thread group and will not // receive any of the application's signals. SidelineId = internal_clone( runSideline, Stack + SidelineStackSize, CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_UNTRACED, this, nullptr /* parent_tidptr */, nullptr /* newtls */, nullptr /* child_tidptr */); int ErrCode; if (internal_iserror(SidelineId, &ErrCode)) { Printf("FATAL: EfficiencySanitizer failed to spawn a thread (code %d).\n", ErrCode); Die(); return false; // Not reached. } return true; } bool SidelineThread::joinThread() { VPrintf(1, "Joining sideline thread\n"); bool Res = true; atomic_store(&SidelineExit, 1, memory_order_relaxed); while (true) { uptr Status = internal_waitpid(SidelineId, nullptr, __WALL); int ErrCode; if (!internal_iserror(Status, &ErrCode)) break; if (ErrCode == EINTR) continue; VPrintf(1, "Failed to join sideline thread (errno %d)\n", ErrCode); Res = false; break; } UnmapOrDie(Stack, SidelineStackSize); return Res; } // Must be called from the sideline thread itself. bool SidelineThread::adjustTimer(u32 FreqMilliSec) { // The return value of internal_clone() may not have been assigned yet: CHECK(internal_getpid() == SidelineId || SidelineId == SidelineIdUninitialized); Freq = FreqMilliSec; struct itimerval TimerVal; TimerVal.it_interval.tv_sec = (time_t) Freq / 1000; TimerVal.it_interval.tv_usec = (time_t) (Freq % 1000) * 1000; TimerVal.it_value.tv_sec = (time_t) Freq / 1000; TimerVal.it_value.tv_usec = (time_t) (Freq % 1000) * 1000; // As we're in a different thread group, we cannot use either // ITIMER_PROF or ITIMER_VIRTUAL without taking up scheduled // time ourselves: thus we must use real time. int Res = setitimer(ITIMER_REAL, &TimerVal, nullptr); return (Res == 0); } } // namespace __esan #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/esan/esan_flags.inc0000664000175000017500000000460712724366421025510 0ustar mwhudsonmwhudson//===-- esan_flags.inc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Esan runtime flags. // //===----------------------------------------------------------------------===// #ifndef ESAN_FLAG # error "Define ESAN_FLAG prior to including this file!" #endif // ESAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. //===----------------------------------------------------------------------===// // Cross-tool options //===----------------------------------------------------------------------===// ESAN_FLAG(int, cache_line_size, 64, "The number of bytes in a cache line. For the working-set tool, this " "cannot be changed without also changing the compiler " "instrumentation.") //===----------------------------------------------------------------------===// // Working set tool options //===----------------------------------------------------------------------===// ESAN_FLAG(bool, record_snapshots, true, "Working set tool: whether to sample snapshots during a run.") // Typical profiling uses a 10ms timer. Our snapshots take some work // to scan memory so we reduce to 20ms. // To disable samples, turn off record_snapshots. ESAN_FLAG(int, sample_freq, 20, "Working set tool: sampling frequency in milliseconds.") // This controls the difference in frequency between each successive series // of snapshots. There are 8 in total, with number 0 using sample_freq. // Number N samples number N-1 every (1 << snapshot_step) instance of N-1. ESAN_FLAG(int, snapshot_step, 2, "Working set tool: the log of the sampling " "performed for the next-higher-frequency snapshot series.") //===----------------------------------------------------------------------===// // Cache Fragmentation tool options //===----------------------------------------------------------------------===// // The difference information of a struct is reported if the struct's difference // score is greater than the report_threshold. ESAN_FLAG(int, report_threshold, 1<<10, "Cache-frag tool: the struct difference" " score threshold for reporting.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/0000775000175000017500000000000013040224626025326 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_linux_mips64.S0000664000175000017500000000117412775420063032115 0ustar mwhudsonmwhudson// This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // Avoid being marked as needing an executable stack: #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits #endif // Further contents are mips64 only: #if defined(__linux__) && defined(__mips64) .section .text .set noreorder .globl internal_sigreturn .type internal_sigreturn, @function internal_sigreturn: li $v0,5211 // #5211 is for SYS_rt_sigreturn syscall .size internal_sigreturn, .-internal_sigreturn #endif // defined(__linux__) && defined(__mips64) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_posix_libcdep.cc0000664000175000017500000003043213004730632032552 0ustar mwhudsonmwhudson//===-- sanitizer_posix_libcdep.cc ----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and implements libc-dependent POSIX-specific functions // from sanitizer_libc.h. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_POSIX #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_platform_limits_posix.h" #include "sanitizer_posix.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" #include #include #include #include #include #include #include #include #include #include #include #include #if SANITIZER_FREEBSD // The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before // that, it was never implemented. So just define it to zero. #undef MAP_NORESERVE #define MAP_NORESERVE 0 #endif typedef void (*sa_sigaction_t)(int, siginfo_t *, void *); namespace __sanitizer { u32 GetUid() { return getuid(); } uptr GetThreadSelf() { return (uptr)pthread_self(); } void ReleaseMemoryToOS(uptr addr, uptr size) { madvise((void*)addr, size, MADV_DONTNEED); } void NoHugePagesInRegion(uptr addr, uptr size) { #ifdef MADV_NOHUGEPAGE // May not be defined on old systems. madvise((void *)addr, size, MADV_NOHUGEPAGE); #endif // MADV_NOHUGEPAGE } void DontDumpShadowMemory(uptr addr, uptr length) { #ifdef MADV_DONTDUMP madvise((void *)addr, length, MADV_DONTDUMP); #endif } static rlim_t getlim(int res) { rlimit rlim; CHECK_EQ(0, getrlimit(res, &rlim)); return rlim.rlim_cur; } static void setlim(int res, rlim_t lim) { // The following magic is to prevent clang from replacing it with memset. volatile struct rlimit rlim; rlim.rlim_cur = lim; rlim.rlim_max = lim; if (setrlimit(res, const_cast(&rlim))) { Report("ERROR: %s setrlimit() failed %d\n", SanitizerToolName, errno); Die(); } } void DisableCoreDumperIfNecessary() { if (common_flags()->disable_coredump) { setlim(RLIMIT_CORE, 0); } } bool StackSizeIsUnlimited() { rlim_t stack_size = getlim(RLIMIT_STACK); return (stack_size == RLIM_INFINITY); } uptr GetStackSizeLimitInBytes() { return (uptr)getlim(RLIMIT_STACK); } void SetStackSizeLimitInBytes(uptr limit) { setlim(RLIMIT_STACK, (rlim_t)limit); CHECK(!StackSizeIsUnlimited()); } bool AddressSpaceIsUnlimited() { rlim_t as_size = getlim(RLIMIT_AS); return (as_size == RLIM_INFINITY); } void SetAddressSpaceUnlimited() { setlim(RLIMIT_AS, RLIM_INFINITY); CHECK(AddressSpaceIsUnlimited()); } void SleepForSeconds(int seconds) { sleep(seconds); } void SleepForMillis(int millis) { usleep(millis * 1000); } void Abort() { #if !SANITIZER_GO // If we are handling SIGABRT, unhandle it first. if (IsHandledDeadlySignal(SIGABRT)) { struct sigaction sigact; internal_memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = (sa_sigaction_t)SIG_DFL; internal_sigaction(SIGABRT, &sigact, nullptr); } #endif abort(); } int Atexit(void (*function)(void)) { #if !SANITIZER_GO return atexit(function); #else return 0; #endif } bool SupportsColoredOutput(fd_t fd) { return isatty(fd) != 0; } #if !SANITIZER_GO // TODO(glider): different tools may require different altstack size. static const uptr kAltStackSize = SIGSTKSZ * 4; // SIGSTKSZ is not enough. void SetAlternateSignalStack() { stack_t altstack, oldstack; CHECK_EQ(0, sigaltstack(nullptr, &oldstack)); // If the alternate stack is already in place, do nothing. // Android always sets an alternate stack, but it's too small for us. if (!SANITIZER_ANDROID && !(oldstack.ss_flags & SS_DISABLE)) return; // TODO(glider): the mapped stack should have the MAP_STACK flag in the // future. It is not required by man 2 sigaltstack now (they're using // malloc()). void* base = MmapOrDie(kAltStackSize, __func__); altstack.ss_sp = (char*) base; altstack.ss_flags = 0; altstack.ss_size = kAltStackSize; CHECK_EQ(0, sigaltstack(&altstack, nullptr)); } void UnsetAlternateSignalStack() { stack_t altstack, oldstack; altstack.ss_sp = nullptr; altstack.ss_flags = SS_DISABLE; altstack.ss_size = kAltStackSize; // Some sane value required on Darwin. CHECK_EQ(0, sigaltstack(&altstack, &oldstack)); UnmapOrDie(oldstack.ss_sp, oldstack.ss_size); } static void MaybeInstallSigaction(int signum, SignalHandlerType handler) { if (!IsHandledDeadlySignal(signum)) return; struct sigaction sigact; internal_memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = (sa_sigaction_t)handler; // Do not block the signal from being received in that signal's handler. // Clients are responsible for handling this correctly. sigact.sa_flags = SA_SIGINFO | SA_NODEFER; if (common_flags()->use_sigaltstack) sigact.sa_flags |= SA_ONSTACK; CHECK_EQ(0, internal_sigaction(signum, &sigact, nullptr)); VReport(1, "Installed the sigaction for signal %d\n", signum); } void InstallDeadlySignalHandlers(SignalHandlerType handler) { // Set the alternate signal stack for the main thread. // This will cause SetAlternateSignalStack to be called twice, but the stack // will be actually set only once. if (common_flags()->use_sigaltstack) SetAlternateSignalStack(); MaybeInstallSigaction(SIGSEGV, handler); MaybeInstallSigaction(SIGBUS, handler); MaybeInstallSigaction(SIGABRT, handler); MaybeInstallSigaction(SIGFPE, handler); MaybeInstallSigaction(SIGILL, handler); } #endif // SANITIZER_GO bool IsAccessibleMemoryRange(uptr beg, uptr size) { uptr page_size = GetPageSizeCached(); // Checking too large memory ranges is slow. CHECK_LT(size, page_size * 10); int sock_pair[2]; if (pipe(sock_pair)) return false; uptr bytes_written = internal_write(sock_pair[1], reinterpret_cast(beg), size); int write_errno; bool result; if (internal_iserror(bytes_written, &write_errno)) { CHECK_EQ(EFAULT, write_errno); result = false; } else { result = (bytes_written == size); } internal_close(sock_pair[0]); internal_close(sock_pair[1]); return result; } void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) { // Some kinds of sandboxes may forbid filesystem access, so we won't be able // to read the file mappings from /proc/self/maps. Luckily, neither the // process will be able to load additional libraries, so it's fine to use the // cached mappings. MemoryMappingLayout::CacheMemoryMappings(); // Same for /proc/self/exe in the symbolizer. #if !SANITIZER_GO Symbolizer::GetOrInit()->PrepareForSandboxing(); CovPrepareForSandboxing(args); #endif } #if SANITIZER_ANDROID || SANITIZER_GO int GetNamedMappingFd(const char *name, uptr size) { return -1; } #else int GetNamedMappingFd(const char *name, uptr size) { if (!common_flags()->decorate_proc_maps) return -1; char shmname[200]; CHECK(internal_strlen(name) < sizeof(shmname) - 10); internal_snprintf(shmname, sizeof(shmname), "%zu [%s]", internal_getpid(), name); int fd = shm_open(shmname, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU); CHECK_GE(fd, 0); int res = internal_ftruncate(fd, size); CHECK_EQ(0, res); res = shm_unlink(shmname); CHECK_EQ(0, res); return fd; } #endif void *MmapFixedNoReserve(uptr fixed_addr, uptr size, const char *name) { int fd = name ? GetNamedMappingFd(name, size) : -1; unsigned flags = MAP_PRIVATE | MAP_FIXED | MAP_NORESERVE; if (fd == -1) flags |= MAP_ANON; uptr PageSize = GetPageSizeCached(); uptr p = internal_mmap((void *)(fixed_addr & ~(PageSize - 1)), RoundUpTo(size, PageSize), PROT_READ | PROT_WRITE, flags, fd, 0); int reserrno; if (internal_iserror(p, &reserrno)) Report("ERROR: %s failed to " "allocate 0x%zx (%zd) bytes at address %zx (errno: %d)\n", SanitizerToolName, size, size, fixed_addr, reserrno); IncreaseTotalMmap(size); return (void *)p; } void *MmapFixedNoAccess(uptr fixed_addr, uptr size, const char *name) { int fd = name ? GetNamedMappingFd(name, size) : -1; unsigned flags = MAP_PRIVATE | MAP_FIXED | MAP_NORESERVE; if (fd == -1) flags |= MAP_ANON; return (void *)internal_mmap((void *)fixed_addr, size, PROT_NONE, flags, fd, 0); } void *MmapNoAccess(uptr size) { unsigned flags = MAP_PRIVATE | MAP_ANON | MAP_NORESERVE; return (void *)internal_mmap(nullptr, size, PROT_NONE, flags, -1, 0); } // This function is defined elsewhere if we intercepted pthread_attr_getstack. extern "C" { SANITIZER_WEAK_ATTRIBUTE int real_pthread_attr_getstack(void *attr, void **addr, size_t *size); } // extern "C" int my_pthread_attr_getstack(void *attr, void **addr, uptr *size) { #if !SANITIZER_GO && !SANITIZER_MAC if (&real_pthread_attr_getstack) return real_pthread_attr_getstack((pthread_attr_t *)attr, addr, (size_t *)size); #endif return pthread_attr_getstack((pthread_attr_t *)attr, addr, (size_t *)size); } #if !SANITIZER_GO void AdjustStackSize(void *attr_) { pthread_attr_t *attr = (pthread_attr_t *)attr_; uptr stackaddr = 0; uptr stacksize = 0; my_pthread_attr_getstack(attr, (void**)&stackaddr, &stacksize); // GLibC will return (0 - stacksize) as the stack address in the case when // stacksize is set, but stackaddr is not. bool stack_set = (stackaddr != 0) && (stackaddr + stacksize != 0); // We place a lot of tool data into TLS, account for that. const uptr minstacksize = GetTlsSize() + 128*1024; if (stacksize < minstacksize) { if (!stack_set) { if (stacksize != 0) { VPrintf(1, "Sanitizer: increasing stacksize %zu->%zu\n", stacksize, minstacksize); pthread_attr_setstacksize(attr, minstacksize); } } else { Printf("Sanitizer: pre-allocated stack size is insufficient: " "%zu < %zu\n", stacksize, minstacksize); Printf("Sanitizer: pthread_create is likely to fail.\n"); } } } #endif // !SANITIZER_GO pid_t StartSubprocess(const char *program, const char *const argv[], fd_t stdin_fd, fd_t stdout_fd, fd_t stderr_fd) { auto file_closer = at_scope_exit([&] { if (stdin_fd != kInvalidFd) { internal_close(stdin_fd); } if (stdout_fd != kInvalidFd) { internal_close(stdout_fd); } if (stderr_fd != kInvalidFd) { internal_close(stderr_fd); } }); int pid = internal_fork(); if (pid < 0) { int rverrno; if (internal_iserror(pid, &rverrno)) { Report("WARNING: failed to fork (errno %d)\n", rverrno); } return pid; } if (pid == 0) { // Child subprocess if (stdin_fd != kInvalidFd) { internal_close(STDIN_FILENO); internal_dup2(stdin_fd, STDIN_FILENO); internal_close(stdin_fd); } if (stdout_fd != kInvalidFd) { internal_close(STDOUT_FILENO); internal_dup2(stdout_fd, STDOUT_FILENO); internal_close(stdout_fd); } if (stderr_fd != kInvalidFd) { internal_close(STDERR_FILENO); internal_dup2(stderr_fd, STDERR_FILENO); internal_close(stderr_fd); } for (int fd = sysconf(_SC_OPEN_MAX); fd > 2; fd--) internal_close(fd); execv(program, const_cast(&argv[0])); internal__exit(1); } return pid; } bool IsProcessRunning(pid_t pid) { int process_status; uptr waitpid_status = internal_waitpid(pid, &process_status, WNOHANG); int local_errno; if (internal_iserror(waitpid_status, &local_errno)) { VReport(1, "Waiting on the process failed (errno %d).\n", local_errno); return false; } return waitpid_status == 0; } int WaitForProcess(pid_t pid) { int process_status; uptr waitpid_status = internal_waitpid(pid, &process_status, 0); int local_errno; if (internal_iserror(waitpid_status, &local_errno)) { VReport(1, "Waiting on the process failed (errno %d).\n", local_errno); return -1; } return process_status; } } // namespace __sanitizer #endif // SANITIZER_POSIX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc0000664000175000017500000003336012707642732033626 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_libcdep.cc -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_allocator_internal.h" #include "sanitizer_internal_defs.h" #include "sanitizer_symbolizer_internal.h" namespace __sanitizer { const char *ExtractToken(const char *str, const char *delims, char **result) { uptr prefix_len = internal_strcspn(str, delims); *result = (char*)InternalAlloc(prefix_len + 1); internal_memcpy(*result, str, prefix_len); (*result)[prefix_len] = '\0'; const char *prefix_end = str + prefix_len; if (*prefix_end != '\0') prefix_end++; return prefix_end; } const char *ExtractInt(const char *str, const char *delims, int *result) { char *buff; const char *ret = ExtractToken(str, delims, &buff); if (buff != 0) { *result = (int)internal_atoll(buff); } InternalFree(buff); return ret; } const char *ExtractUptr(const char *str, const char *delims, uptr *result) { char *buff; const char *ret = ExtractToken(str, delims, &buff); if (buff != 0) { *result = (uptr)internal_atoll(buff); } InternalFree(buff); return ret; } const char *ExtractTokenUpToDelimiter(const char *str, const char *delimiter, char **result) { const char *found_delimiter = internal_strstr(str, delimiter); uptr prefix_len = found_delimiter ? found_delimiter - str : internal_strlen(str); *result = (char *)InternalAlloc(prefix_len + 1); internal_memcpy(*result, str, prefix_len); (*result)[prefix_len] = '\0'; const char *prefix_end = str + prefix_len; if (*prefix_end != '\0') prefix_end += internal_strlen(delimiter); return prefix_end; } SymbolizedStack *Symbolizer::SymbolizePC(uptr addr) { BlockingMutexLock l(&mu_); const char *module_name; uptr module_offset; SymbolizedStack *res = SymbolizedStack::New(addr); if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset)) return res; // Always fill data about module name and offset. res->info.FillModuleInfo(module_name, module_offset); for (auto &tool : tools_) { SymbolizerScope sym_scope(this); if (tool.SymbolizePC(addr, res)) { return res; } } return res; } bool Symbolizer::SymbolizeData(uptr addr, DataInfo *info) { BlockingMutexLock l(&mu_); const char *module_name; uptr module_offset; if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset)) return false; info->Clear(); info->module = internal_strdup(module_name); info->module_offset = module_offset; for (auto &tool : tools_) { SymbolizerScope sym_scope(this); if (tool.SymbolizeData(addr, info)) { return true; } } return true; } bool Symbolizer::GetModuleNameAndOffsetForPC(uptr pc, const char **module_name, uptr *module_address) { BlockingMutexLock l(&mu_); const char *internal_module_name = nullptr; if (!FindModuleNameAndOffsetForAddress(pc, &internal_module_name, module_address)) return false; if (module_name) *module_name = module_names_.GetOwnedCopy(internal_module_name); return true; } void Symbolizer::Flush() { BlockingMutexLock l(&mu_); for (auto &tool : tools_) { SymbolizerScope sym_scope(this); tool.Flush(); } } const char *Symbolizer::Demangle(const char *name) { BlockingMutexLock l(&mu_); for (auto &tool : tools_) { SymbolizerScope sym_scope(this); if (const char *demangled = tool.Demangle(name)) return demangled; } return PlatformDemangle(name); } void Symbolizer::PrepareForSandboxing() { BlockingMutexLock l(&mu_); PlatformPrepareForSandboxing(); } bool Symbolizer::FindModuleNameAndOffsetForAddress(uptr address, const char **module_name, uptr *module_offset) { const LoadedModule *module = FindModuleForAddress(address); if (module == nullptr) return false; *module_name = module->full_name(); *module_offset = address - module->base_address(); return true; } const LoadedModule *Symbolizer::FindModuleForAddress(uptr address) { bool modules_were_reloaded = false; if (!modules_fresh_) { modules_.init(); RAW_CHECK(modules_.size() > 0); modules_fresh_ = true; modules_were_reloaded = true; } for (uptr i = 0; i < modules_.size(); i++) { if (modules_[i].containsAddress(address)) { return &modules_[i]; } } // Reload the modules and look up again, if we haven't tried it yet. if (!modules_were_reloaded) { // FIXME: set modules_fresh_ from dlopen()/dlclose() interceptors. // It's too aggressive to reload the list of modules each time we fail // to find a module for a given address. modules_fresh_ = false; return FindModuleForAddress(address); } return 0; } Symbolizer *Symbolizer::GetOrInit() { SpinMutexLock l(&init_mu_); if (symbolizer_) return symbolizer_; symbolizer_ = PlatformInit(); CHECK(symbolizer_); return symbolizer_; } // For now we assume the following protocol: // For each request of the form // // passed to STDIN, external symbolizer prints to STDOUT response: // // :: // // :: // ... // class LLVMSymbolizerProcess : public SymbolizerProcess { public: explicit LLVMSymbolizerProcess(const char *path) : SymbolizerProcess(path) {} private: bool ReachedEndOfOutput(const char *buffer, uptr length) const override { // Empty line marks the end of llvm-symbolizer output. return length >= 2 && buffer[length - 1] == '\n' && buffer[length - 2] == '\n'; } void GetArgV(const char *path_to_binary, const char *(&argv)[kArgVMax]) const override { #if defined(__x86_64h__) const char* const kSymbolizerArch = "--default-arch=x86_64h"; #elif defined(__x86_64__) const char* const kSymbolizerArch = "--default-arch=x86_64"; #elif defined(__i386__) const char* const kSymbolizerArch = "--default-arch=i386"; #elif defined(__aarch64__) const char* const kSymbolizerArch = "--default-arch=arm64"; #elif defined(__arm__) const char* const kSymbolizerArch = "--default-arch=arm"; #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ const char* const kSymbolizerArch = "--default-arch=powerpc64"; #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ const char* const kSymbolizerArch = "--default-arch=powerpc64le"; #elif defined(__s390x__) const char* const kSymbolizerArch = "--default-arch=s390x"; #elif defined(__s390__) const char* const kSymbolizerArch = "--default-arch=s390"; #else const char* const kSymbolizerArch = "--default-arch=unknown"; #endif const char *const inline_flag = common_flags()->symbolize_inline_frames ? "--inlining=true" : "--inlining=false"; int i = 0; argv[i++] = path_to_binary; argv[i++] = inline_flag; argv[i++] = kSymbolizerArch; argv[i++] = nullptr; } }; LLVMSymbolizer::LLVMSymbolizer(const char *path, LowLevelAllocator *allocator) : symbolizer_process_(new(*allocator) LLVMSymbolizerProcess(path)) {} // Parse a :[:] buffer. The file path may contain colons on // Windows, so extract tokens from the right hand side first. The column info is // also optional. static const char *ParseFileLineInfo(AddressInfo *info, const char *str) { char *file_line_info = 0; str = ExtractToken(str, "\n", &file_line_info); CHECK(file_line_info); // Parse the last :, which must be there. char *last_colon = internal_strrchr(file_line_info, ':'); CHECK(last_colon); int line_or_column = internal_atoll(last_colon + 1); // Truncate the string at the last colon and find the next-to-last colon. *last_colon = '\0'; last_colon = internal_strrchr(file_line_info, ':'); if (last_colon && IsDigit(last_colon[1])) { // If the second-to-last colon is followed by a digit, it must be the line // number, and the previous parsed number was a column. info->line = internal_atoll(last_colon + 1); info->column = line_or_column; *last_colon = '\0'; } else { // Otherwise, we have line info but no column info. info->line = line_or_column; info->column = 0; } ExtractToken(file_line_info, "", &info->file); InternalFree(file_line_info); return str; } // Parses one or more two-line strings in the following format: // // :[:] // Used by LLVMSymbolizer, Addr2LinePool and InternalSymbolizer, since all of // them use the same output format. void ParseSymbolizePCOutput(const char *str, SymbolizedStack *res) { bool top_frame = true; SymbolizedStack *last = res; while (true) { char *function_name = 0; str = ExtractToken(str, "\n", &function_name); CHECK(function_name); if (function_name[0] == '\0') { // There are no more frames. InternalFree(function_name); break; } SymbolizedStack *cur; if (top_frame) { cur = res; top_frame = false; } else { cur = SymbolizedStack::New(res->info.address); cur->info.FillModuleInfo(res->info.module, res->info.module_offset); last->next = cur; last = cur; } AddressInfo *info = &cur->info; info->function = function_name; str = ParseFileLineInfo(info, str); // Functions and filenames can be "??", in which case we write 0 // to address info to mark that names are unknown. if (0 == internal_strcmp(info->function, "??")) { InternalFree(info->function); info->function = 0; } if (0 == internal_strcmp(info->file, "??")) { InternalFree(info->file); info->file = 0; } } } // Parses a two-line string in the following format: // // // Used by LLVMSymbolizer and InternalSymbolizer. void ParseSymbolizeDataOutput(const char *str, DataInfo *info) { str = ExtractToken(str, "\n", &info->name); str = ExtractUptr(str, " ", &info->start); str = ExtractUptr(str, "\n", &info->size); } bool LLVMSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) { if (const char *buf = SendCommand(/*is_data*/ false, stack->info.module, stack->info.module_offset)) { ParseSymbolizePCOutput(buf, stack); return true; } return false; } bool LLVMSymbolizer::SymbolizeData(uptr addr, DataInfo *info) { if (const char *buf = SendCommand(/*is_data*/ true, info->module, info->module_offset)) { ParseSymbolizeDataOutput(buf, info); info->start += (addr - info->module_offset); // Add the base address. return true; } return false; } const char *LLVMSymbolizer::SendCommand(bool is_data, const char *module_name, uptr module_offset) { CHECK(module_name); internal_snprintf(buffer_, kBufferSize, "%s\"%s\" 0x%zx\n", is_data ? "DATA " : "", module_name, module_offset); return symbolizer_process_->SendCommand(buffer_); } SymbolizerProcess::SymbolizerProcess(const char *path, bool use_forkpty) : path_(path), input_fd_(kInvalidFd), output_fd_(kInvalidFd), times_restarted_(0), failed_to_start_(false), reported_invalid_path_(false), use_forkpty_(use_forkpty) { CHECK(path_); CHECK_NE(path_[0], '\0'); } const char *SymbolizerProcess::SendCommand(const char *command) { for (; times_restarted_ < kMaxTimesRestarted; times_restarted_++) { // Start or restart symbolizer if we failed to send command to it. if (const char *res = SendCommandImpl(command)) return res; Restart(); } if (!failed_to_start_) { Report("WARNING: Failed to use and restart external symbolizer!\n"); failed_to_start_ = true; } return 0; } const char *SymbolizerProcess::SendCommandImpl(const char *command) { if (input_fd_ == kInvalidFd || output_fd_ == kInvalidFd) return 0; if (!WriteToSymbolizer(command, internal_strlen(command))) return 0; if (!ReadFromSymbolizer(buffer_, kBufferSize)) return 0; return buffer_; } bool SymbolizerProcess::Restart() { if (input_fd_ != kInvalidFd) CloseFile(input_fd_); if (output_fd_ != kInvalidFd) CloseFile(output_fd_); return StartSymbolizerSubprocess(); } bool SymbolizerProcess::ReadFromSymbolizer(char *buffer, uptr max_length) { if (max_length == 0) return true; uptr read_len = 0; while (true) { uptr just_read = 0; bool success = ReadFromFile(input_fd_, buffer + read_len, max_length - read_len - 1, &just_read); // We can't read 0 bytes, as we don't expect external symbolizer to close // its stdout. if (!success || just_read == 0) { Report("WARNING: Can't read from symbolizer at fd %d\n", input_fd_); return false; } read_len += just_read; if (ReachedEndOfOutput(buffer, read_len)) break; } buffer[read_len] = '\0'; return true; } bool SymbolizerProcess::WriteToSymbolizer(const char *buffer, uptr length) { if (length == 0) return true; uptr write_len = 0; bool success = WriteToFile(output_fd_, buffer, length, &write_len); if (!success || write_len != length) { Report("WARNING: Can't write to symbolizer at fd %d\n", output_fd_); return false; } return true; } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/0000775000175000017500000000000013040224626027525 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc0000664000175000017500000001520212773317077034006 0ustar mwhudsonmwhudson//===-- sanitizer_wrappers.cc -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Redirect some functions to sanitizer interceptors. // //===----------------------------------------------------------------------===// #include #include #include #include #include #include #include // Need to match ../sanitizer_common/sanitizer_internal_defs.h #if defined(ARCH_PPC) #define OFF_T unsigned long #else #define OFF_T unsigned long long #endif namespace __sanitizer { unsigned long internal_open(const char *filename, int flags); unsigned long internal_open(const char *filename, int flags, unsigned mode); unsigned long internal_close(int fd); unsigned long internal_stat(const char *path, void *buf); unsigned long internal_lstat(const char *path, void *buf); unsigned long internal_fstat(int fd, void *buf); size_t internal_strlen(const char *s); unsigned long internal_mmap(void *addr, unsigned long length, int prot, int flags, int fd, OFF_T offset); void *internal_memcpy(void *dest, const void *src, unsigned long n); // Used to propagate errno. bool internal_iserror(unsigned long retval, int *rverrno = 0); } // namespace __sanitizer namespace { template struct GetTypes; template struct GetTypes { using Result = R; template struct Arg { using Type = typename std::tuple_element>::type; }; }; #define LLVM_SYMBOLIZER_GET_FUNC(Function) \ ((__interceptor_##Function) \ ? (__interceptor_##Function) \ : reinterpret_cast(dlsym(RTLD_NEXT, #Function))) #define LLVM_SYMBOLIZER_INTERCEPTOR1(Function, ...) \ GetTypes<__VA_ARGS__>::Result __interceptor_##Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type) __attribute__((weak)); \ GetTypes<__VA_ARGS__>::Result Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type arg0) { \ return LLVM_SYMBOLIZER_GET_FUNC(Function)(arg0); \ } #define LLVM_SYMBOLIZER_INTERCEPTOR2(Function, ...) \ GetTypes<__VA_ARGS__>::Result __interceptor_##Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type, \ GetTypes<__VA_ARGS__>::Arg<1>::Type) __attribute__((weak)); \ GetTypes<__VA_ARGS__>::Result Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type arg0, \ GetTypes<__VA_ARGS__>::Arg<1>::Type arg1) { \ return LLVM_SYMBOLIZER_GET_FUNC(Function)(arg0, arg1); \ } #define LLVM_SYMBOLIZER_INTERCEPTOR3(Function, ...) \ GetTypes<__VA_ARGS__>::Result __interceptor_##Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type, \ GetTypes<__VA_ARGS__>::Arg<1>::Type, \ GetTypes<__VA_ARGS__>::Arg<2>::Type) __attribute__((weak)); \ GetTypes<__VA_ARGS__>::Result Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type arg0, \ GetTypes<__VA_ARGS__>::Arg<1>::Type arg1, \ GetTypes<__VA_ARGS__>::Arg<2>::Type arg2) { \ return LLVM_SYMBOLIZER_GET_FUNC(Function)(arg0, arg1, arg2); \ } #define LLVM_SYMBOLIZER_INTERCEPTOR4(Function, ...) \ GetTypes<__VA_ARGS__>::Result __interceptor_##Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type, \ GetTypes<__VA_ARGS__>::Arg<1>::Type, \ GetTypes<__VA_ARGS__>::Arg<2>::Type, \ GetTypes<__VA_ARGS__>::Arg<3>::Type) __attribute__((weak)); \ GetTypes<__VA_ARGS__>::Result Function( \ GetTypes<__VA_ARGS__>::Arg<0>::Type arg0, \ GetTypes<__VA_ARGS__>::Arg<1>::Type arg1, \ GetTypes<__VA_ARGS__>::Arg<2>::Type arg2, \ GetTypes<__VA_ARGS__>::Arg<3>::Type arg3) { \ return LLVM_SYMBOLIZER_GET_FUNC(Function)(arg0, arg1, arg2, arg3); \ } } // namespace // C-style interface around internal sanitizer libc functions. extern "C" { #define RETURN_OR_SET_ERRNO(T, res) \ int rverrno; \ if (__sanitizer::internal_iserror(res, &rverrno)) { \ errno = rverrno; \ return (T)-1; \ } \ return (T)res; int open(const char *filename, int flags, ...) { unsigned long res; if (flags | O_CREAT) { va_list va; va_start(va, flags); unsigned mode = va_arg(va, unsigned); va_end(va); res = __sanitizer::internal_open(filename, flags, mode); } else { res = __sanitizer::internal_open(filename, flags); } RETURN_OR_SET_ERRNO(int, res); } int close(int fd) { unsigned long res = __sanitizer::internal_close(fd); RETURN_OR_SET_ERRNO(int, res); } #define STAT(func, arg, buf) \ unsigned long res = __sanitizer::internal_##func(arg, buf); \ RETURN_OR_SET_ERRNO(int, res); int stat(const char *path, struct stat *buf) { STAT(stat, path, buf); } int lstat(const char *path, struct stat *buf) { STAT(lstat, path, buf); } int fstat(int fd, struct stat *buf) { STAT(fstat, fd, buf); } // Redirect versioned stat functions to the __sanitizer::internal() as well. int __xstat(int version, const char *path, struct stat *buf) { STAT(stat, path, buf); } int __lxstat(int version, const char *path, struct stat *buf) { STAT(lstat, path, buf); } int __fxstat(int version, int fd, struct stat *buf) { STAT(fstat, fd, buf); } size_t strlen(const char *s) { return __sanitizer::internal_strlen(s); } void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { unsigned long res = __sanitizer::internal_mmap( addr, (unsigned long)length, prot, flags, fd, (unsigned long long)offset); RETURN_OR_SET_ERRNO(void *, res); } LLVM_SYMBOLIZER_INTERCEPTOR3(read, ssize_t(int, void *, size_t)) LLVM_SYMBOLIZER_INTERCEPTOR4(pread, ssize_t(int, void *, size_t, off_t)) LLVM_SYMBOLIZER_INTERCEPTOR4(pread64, ssize_t(int, void *, size_t, off64_t)) LLVM_SYMBOLIZER_INTERCEPTOR2(realpath, char *(const char *, char *)) } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/scripts/0000775000175000017500000000000013040224626031214 5ustar mwhudsonmwhudson././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.shgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/scripts/build_symboli0000775000175000017500000001366213003465753034016 0ustar mwhudsonmwhudson#!/bin/bash -eu # # Run as: CLANG=bin/clang ZLIB_SRC=src/zlib \ # build_symbolizer.sh runtime_build/lib/clang/4.0.0/lib/linux/ # zlib can be downloaded from from http://www.zlib.net. # # Script compiles self-contained object file with symbolization code and injects # it into the given set of runtime libraries. Script updates only libraries # which has unresolved __sanitizer_symbolize_* symbols and matches architecture. # Object file is be compiled from LLVM sources with dependencies like libc++ and # zlib. Then it internalizes symbols in the file, so that it can be linked # into arbitrary programs, avoiding conflicts with the program own symbols and # avoiding dependencies on any program symbols. The only acceptable dependencies # are libc and __sanitizer::internal_* from sanitizer runtime. # # Symbols exported by the object file will be used by Sanitizer runtime # libraries to symbolize code/data in-process. # # The script will modify the output directory which is given as the first # argument to the script. # # FIXME: We should really be using a simpler approach to building this object # file, and it should be available as a regular cmake rule. Conceptually, we # want to be doing "ld -r" followed by "objcopy -G" to create a relocatable # object file with only our entry points exposed. However, this does not work at # present, see PR30750. SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SRC_DIR=$(readlink -f $SCRIPT_DIR/..) TARGE_DIR=$(readlink -f $1) LLVM_SRC="${LLVM_SRC:-$SCRIPT_DIR/../../../../../..}" LLVM_SRC=$(readlink -f $LLVM_SRC) if [[ ! -d "${LLVM_SRC}/projects/libcxxabi" || ! -d "${LLVM_SRC}/projects/libcxx" ]]; then echo "Missing or incomplete LLVM_SRC" exit 1 fi if [[ "$ZLIB_SRC" == "" || ! -x "${ZLIB_SRC}/configure" || ! -f "${ZLIB_SRC}/zlib.h" ]]; then echo "Missing or incomplete ZLIB_SRC" exit 1 fi ZLIB_SRC=$(readlink -f $ZLIB_SRC) J="${J:-50}" CLANG="${CLANG:-`which clang`}" CLANG_DIR=$(readlink -f $(dirname "$CLANG")) BUILD_DIR=$(readlink -f ./symbolizer) mkdir -p $BUILD_DIR cd $BUILD_DIR CC=$CLANG_DIR/clang CXX=$CLANG_DIR/clang++ TBLGEN=$CLANG_DIR/llvm-tblgen LINK=$CLANG_DIR/llvm-link OPT=$CLANG_DIR/opt AR=$CLANG_DIR/llvm-ar for F in $CC $CXX $TBLGEN $LINK $OPT $AR; do if [[ ! -x "$F" ]]; then echo "Missing $F" exit 1 fi done ZLIB_BUILD=${BUILD_DIR}/zlib LIBCXX_BUILD=${BUILD_DIR}/libcxx LLVM_BUILD=${BUILD_DIR}/llvm SYMBOLIZER_BUILD=${BUILD_DIR}/symbolizer FLAGS=${FLAGS:-} FLAGS="$FLAGS -fPIC -flto -Os -g0 -DNDEBUG" # Build zlib. mkdir -p ${ZLIB_BUILD} cd ${ZLIB_BUILD} cp -r ${ZLIB_SRC}/* . CC=$CC CFLAGS="$FLAGS" RANLIB=/bin/true ./configure --static make -j${J} libz.a # Build and install libcxxabi and libcxx. if [[ ! -d ${LIBCXX_BUILD} ]]; then mkdir -p ${LIBCXX_BUILD} cd ${LIBCXX_BUILD} LIBCXX_FLAGS="${FLAGS} -Wno-macro-redefined -I${LLVM_SRC}/projects/libcxxabi/include" cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ -DCMAKE_C_FLAGS_RELEASE="${LIBCXX_FLAGS}" \ -DCMAKE_CXX_FLAGS_RELEASE="${LIBCXX_FLAGS}" \ -DLIBCXXABI_ENABLE_ASSERTIONS=OFF \ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ -DLIBCXXABI_ENABLE_SHARED=OFF \ -DLIBCXXABI_ENABLE_THREADS=OFF \ -DLIBCXX_ENABLE_ASSERTIONS=OFF \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ -DLIBCXX_ENABLE_RTTI=OFF \ -DLIBCXX_ENABLE_SHARED=OFF \ -DLIBCXX_ENABLE_THREADS=OFF \ $LLVM_SRC fi cd ${LIBCXX_BUILD} ninja cxx cxxabi FLAGS="${FLAGS} -fno-rtti -fno-exceptions" # Build LLVM. if [[ ! -d ${LLVM_BUILD} ]]; then mkdir -p ${LLVM_BUILD} cd ${LLVM_BUILD} LLVM_FLAGS="${FLAGS} -I${ZLIB_BUILD} -I${LIBCXX_BUILD}/include/c++/v1" cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ -DCMAKE_C_FLAGS_RELEASE="${LLVM_FLAGS}" \ -DCMAKE_CXX_FLAGS_RELEASE="${LLVM_FLAGS}" \ -DLLVM_TABLEGEN=$TBLGEN \ -DLLVM_ENABLE_ZLIB=ON \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_THREADS=OFF \ $LLVM_SRC fi cd ${LLVM_BUILD} ninja LLVMSymbolize LLVMObject LLVMDebugInfoDWARF LLVMSupport LLVMDebugInfoPDB LLVMMC cd ${BUILD_DIR} rm -rf ${SYMBOLIZER_BUILD} mkdir ${SYMBOLIZER_BUILD} cd ${SYMBOLIZER_BUILD} for A in $LIBCXX_BUILD/lib/libc++.a \ $LIBCXX_BUILD/lib/libc++abi.a \ $LLVM_BUILD/lib/libLLVMSymbolize.a \ $LLVM_BUILD/lib/libLLVMObject.a \ $LLVM_BUILD/lib/libLLVMDebugInfoDWARF.a \ $LLVM_BUILD/lib/libLLVMSupport.a \ $LLVM_BUILD/lib/libLLVMDebugInfoPDB.a \ $LLVM_BUILD/lib/libLLVMMC.a \ $ZLIB_BUILD/libz.a ; do for O in $($AR t $A); do $AR x $A $O mv -f $O "$(basename $A).$O" # Rename to avoid collisions between libs. done done echo "Compiling..." SYMBOLIZER_FLAGS="$FLAGS -std=c++11 -I${LLVM_SRC}/include -I${LLVM_BUILD}/include -I${LIBCXX_BUILD}/include/c++/v1" $CXX $SYMBOLIZER_FLAGS ${SRC_DIR}/sanitizer_symbolize.cc ${SRC_DIR}/sanitizer_wrappers.cc -c SYMBOLIZER_API_LIST=__sanitizer_symbolize_code,__sanitizer_symbolize_data,__sanitizer_symbolize_flush,__sanitizer_symbolize_demangle # Merge all the object files together and copy the resulting library back. $LINK *.o -o all.bc echo "Optimizing..." $OPT -internalize -internalize-public-api-list=${SYMBOLIZER_API_LIST} all.bc -o opt.bc $CC $FLAGS -fno-lto -c opt.bc -o symbolizer.o echo "Checking undefined symbols..." nm -f posix -g symbolizer.o | cut -f 1,2 -d \ | LC_COLLATE=C sort -u > undefined.new (diff -u $SCRIPT_DIR/global_symbols.txt undefined.new | grep -E "^\+[^+]") && \ (echo "Failed: unexpected symbols"; exit 1) arch() { objdump -f $1 | grep -m1 -Po "(?<=file format ).*$" } SYMBOLIZER_FORMAT=$(arch symbolizer.o) echo "Injecting $SYMBOLIZER_FORMAT symbolizer..." for A in $TARGE_DIR/libclang_rt.*san*.a; do A_FORMAT=$(arch $A) if [[ "$A_FORMAT" != "$SYMBOLIZER_FORMAT" ]] ; then continue fi (nm -u $A 2>/dev/null | grep -E "__sanitizer_symbolize_code" >/dev/null) || continue echo "$A" $AR rcs $A symbolizer.o done echo "Success!" ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/scripts/global_symbols.txtgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/scripts/global_symbol0000664000175000017500000000356613002225062033767 0ustar mwhudsonmwhudson_GLOBAL_OFFSET_TABLE_ U _ZN11__sanitizer13internal_mmapEPvmiiiy U _ZN11__sanitizer13internal_openEPKcij U _ZN11__sanitizer13internal_statEPKcPv U _ZN11__sanitizer14internal_closeEi U _ZN11__sanitizer14internal_fstatEiPv U _ZN11__sanitizer14internal_lstatEPKcPv U _ZN11__sanitizer15internal_strlenEPKc U _ZN11__sanitizer16internal_iserrorEmPi U _ZN11__sanitizer17internal_snprintfEPcmPKcz U __ctype_b_loc U __ctype_get_mb_cur_max U __cxa_atexit U __divdi3 U __dso_handle U __errno_location U __interceptor_pread w __interceptor_read w __interceptor_realpath w __moddi3 U __sanitizer_symbolize_code T __sanitizer_symbolize_data T __sanitizer_symbolize_demangle T __sanitizer_symbolize_flush T __strdup U __udivdi3 U __umoddi3 U _exit U abort U access U calloc U catclose U catgets U catopen U ceil U clock_gettime U cfgetospeed U dl_iterate_phdr U dlsym U dup2 U environ U execv U exit U fclose U fflush U fileno U fopen U fork U fprintf U fputc U free U freelocale U fwrite U getc U getcwd U getenv U getpagesize U getpid U gettimeofday U ioctl U isatty U isprint U isupper U isxdigit U log10 U lseek U malloc U mbrlen U mbrtowc U mbsnrtowcs U mbsrtowcs U mbtowc U memchr U memcmp U memcpy U memmove U memset U mkdir U munmap U newlocale U perror U posix_spawn U posix_spawn_file_actions_adddup2 U posix_spawn_file_actions_addopen U posix_spawn_file_actions_destroy U posix_spawn_file_actions_init U qsort U rand U readlink U realloc U remove U setvbuf U sigfillset U sigprocmask U snprintf U sprintf U srand U sscanf U stderr U stdin U stdout U strcat U strchr U strcmp U strcpy U strdup U strerror U strerror_r U strftime_l U strncmp U strncpy U strrchr U strsep U strtod_l U strtof_l U strtol U strtold_l U strtoll_l U strtoull_l U tcgetattr U uname U ungetc U unlink U uselocale U vasprintf U vfprintf U vsnprintf U vsscanf U waitpid U wcrtomb U wcslen U wcsnrtombs U wmemcpy U wmemmove U wmemset U write U ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/sanitizer_symbolize.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/symbolizer/sanitizer_symbolize.c0000664000175000017500000000461212773010034033777 0ustar mwhudsonmwhudson//===-- sanitizer_symbolize.cc ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Implementation of weak hooks from sanitizer_symbolizer_posix_libcdep.cc. // //===----------------------------------------------------------------------===// #include #include #include "llvm/DebugInfo/Symbolize/DIPrinter.h" #include "llvm/DebugInfo/Symbolize/Symbolize.h" static llvm::symbolize::LLVMSymbolizer *getDefaultSymbolizer() { static llvm::symbolize::LLVMSymbolizer DefaultSymbolizer; return &DefaultSymbolizer; } namespace __sanitizer { int internal_snprintf(char *buffer, unsigned long length, const char *format, ...); } // namespace __sanitizer extern "C" { typedef uint64_t u64; bool __sanitizer_symbolize_code(const char *ModuleName, uint64_t ModuleOffset, char *Buffer, int MaxLength) { std::string Result; { llvm::raw_string_ostream OS(Result); llvm::symbolize::DIPrinter Printer(OS); auto ResOrErr = getDefaultSymbolizer()->symbolizeInlinedCode(ModuleName, ModuleOffset); Printer << (ResOrErr ? ResOrErr.get() : llvm::DIInliningInfo()); } __sanitizer::internal_snprintf(Buffer, MaxLength, "%s", Result.c_str()); return true; } bool __sanitizer_symbolize_data(const char *ModuleName, uint64_t ModuleOffset, char *Buffer, int MaxLength) { std::string Result; { llvm::raw_string_ostream OS(Result); llvm::symbolize::DIPrinter Printer(OS); auto ResOrErr = getDefaultSymbolizer()->symbolizeData(ModuleName, ModuleOffset); Printer << (ResOrErr ? ResOrErr.get() : llvm::DIGlobal()); } __sanitizer::internal_snprintf(Buffer, MaxLength, "%s", Result.c_str()); return true; } void __sanitizer_symbolize_flush() { getDefaultSymbolizer()->flush(); } int __sanitizer_symbolize_demangle(const char *Name, char *Buffer, int MaxLength) { std::string Result = llvm::symbolize::LLVMSymbolizer::DemangleName(Name, nullptr); __sanitizer::internal_snprintf(Buffer, MaxLength, "%s", Result.c_str()); return static_cast(Result.size() + 1); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_printf.cc0000664000175000017500000002512713004730632031235 0ustar mwhudsonmwhudson//===-- sanitizer_printf.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer. // // Internal printf function, used inside run-time libraries. // We can't use libc printf because we intercept some of the functions used // inside it. //===----------------------------------------------------------------------===// #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_libc.h" #include #include #if SANITIZER_WINDOWS && defined(_MSC_VER) && _MSC_VER < 1800 && \ !defined(va_copy) # define va_copy(dst, src) ((dst) = (src)) #endif namespace __sanitizer { StaticSpinMutex CommonSanitizerReportMutex; static int AppendChar(char **buff, const char *buff_end, char c) { if (*buff < buff_end) { **buff = c; (*buff)++; } return 1; } // Appends number in a given base to buffer. If its length is less than // |minimal_num_length|, it is padded with leading zeroes or spaces, depending // on the value of |pad_with_zero|. static int AppendNumber(char **buff, const char *buff_end, u64 absolute_value, u8 base, u8 minimal_num_length, bool pad_with_zero, bool negative) { uptr const kMaxLen = 30; RAW_CHECK(base == 10 || base == 16); RAW_CHECK(base == 10 || !negative); RAW_CHECK(absolute_value || !negative); RAW_CHECK(minimal_num_length < kMaxLen); int result = 0; if (negative && minimal_num_length) --minimal_num_length; if (negative && pad_with_zero) result += AppendChar(buff, buff_end, '-'); uptr num_buffer[kMaxLen]; int pos = 0; do { RAW_CHECK_MSG((uptr)pos < kMaxLen, "AppendNumber buffer overflow"); num_buffer[pos++] = absolute_value % base; absolute_value /= base; } while (absolute_value > 0); if (pos < minimal_num_length) { // Make sure compiler doesn't insert call to memset here. internal_memset(&num_buffer[pos], 0, sizeof(num_buffer[0]) * (minimal_num_length - pos)); pos = minimal_num_length; } RAW_CHECK(pos > 0); pos--; for (; pos >= 0 && num_buffer[pos] == 0; pos--) { char c = (pad_with_zero || pos == 0) ? '0' : ' '; result += AppendChar(buff, buff_end, c); } if (negative && !pad_with_zero) result += AppendChar(buff, buff_end, '-'); for (; pos >= 0; pos--) { char digit = static_cast(num_buffer[pos]); result += AppendChar(buff, buff_end, (digit < 10) ? '0' + digit : 'a' + digit - 10); } return result; } static int AppendUnsigned(char **buff, const char *buff_end, u64 num, u8 base, u8 minimal_num_length, bool pad_with_zero) { return AppendNumber(buff, buff_end, num, base, minimal_num_length, pad_with_zero, false /* negative */); } static int AppendSignedDecimal(char **buff, const char *buff_end, s64 num, u8 minimal_num_length, bool pad_with_zero) { bool negative = (num < 0); return AppendNumber(buff, buff_end, (u64)(negative ? -num : num), 10, minimal_num_length, pad_with_zero, negative); } static int AppendString(char **buff, const char *buff_end, int precision, const char *s) { if (!s) s = ""; int result = 0; for (; *s; s++) { if (precision >= 0 && result >= precision) break; result += AppendChar(buff, buff_end, *s); } return result; } static int AppendPointer(char **buff, const char *buff_end, u64 ptr_value) { int result = 0; result += AppendString(buff, buff_end, -1, "0x"); result += AppendUnsigned(buff, buff_end, ptr_value, 16, SANITIZER_POINTER_FORMAT_LENGTH, true); return result; } int VSNPrintf(char *buff, int buff_length, const char *format, va_list args) { static const char *kPrintfFormatsHelp = "Supported Printf formats: %([0-9]*)?(z|ll)?{d,u,x}; %p; %(\\.\\*)?s; %c\n"; RAW_CHECK(format); RAW_CHECK(buff_length > 0); const char *buff_end = &buff[buff_length - 1]; const char *cur = format; int result = 0; for (; *cur; cur++) { if (*cur != '%') { result += AppendChar(&buff, buff_end, *cur); continue; } cur++; bool have_width = (*cur >= '0' && *cur <= '9'); bool pad_with_zero = (*cur == '0'); int width = 0; if (have_width) { while (*cur >= '0' && *cur <= '9') { width = width * 10 + *cur++ - '0'; } } bool have_precision = (cur[0] == '.' && cur[1] == '*'); int precision = -1; if (have_precision) { cur += 2; precision = va_arg(args, int); } bool have_z = (*cur == 'z'); cur += have_z; bool have_ll = !have_z && (cur[0] == 'l' && cur[1] == 'l'); cur += have_ll * 2; s64 dval; u64 uval; bool have_flags = have_width | have_z | have_ll; // Only %s supports precision for now CHECK(!(precision >= 0 && *cur != 's')); switch (*cur) { case 'd': { dval = have_ll ? va_arg(args, s64) : have_z ? va_arg(args, sptr) : va_arg(args, int); result += AppendSignedDecimal(&buff, buff_end, dval, width, pad_with_zero); break; } case 'u': case 'x': { uval = have_ll ? va_arg(args, u64) : have_z ? va_arg(args, uptr) : va_arg(args, unsigned); result += AppendUnsigned(&buff, buff_end, uval, (*cur == 'u') ? 10 : 16, width, pad_with_zero); break; } case 'p': { RAW_CHECK_MSG(!have_flags, kPrintfFormatsHelp); result += AppendPointer(&buff, buff_end, va_arg(args, uptr)); break; } case 's': { RAW_CHECK_MSG(!have_flags, kPrintfFormatsHelp); result += AppendString(&buff, buff_end, precision, va_arg(args, char*)); break; } case 'c': { RAW_CHECK_MSG(!have_flags, kPrintfFormatsHelp); result += AppendChar(&buff, buff_end, va_arg(args, int)); break; } case '%' : { RAW_CHECK_MSG(!have_flags, kPrintfFormatsHelp); result += AppendChar(&buff, buff_end, '%'); break; } default: { RAW_CHECK_MSG(false, kPrintfFormatsHelp); } } } RAW_CHECK(buff <= buff_end); AppendChar(&buff, buff_end + 1, '\0'); return result; } static void (*PrintfAndReportCallback)(const char *); void SetPrintfAndReportCallback(void (*callback)(const char *)) { PrintfAndReportCallback = callback; } // Can be overriden in frontend. #if SANITIZER_SUPPORTS_WEAK_HOOKS SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void OnPrint(const char *str) { (void)str; } #elif SANITIZER_GO && defined(TSAN_EXTERNAL_HOOKS) void OnPrint(const char *str); #else void OnPrint(const char *str) { (void)str; } #endif static void CallPrintfAndReportCallback(const char *str) { OnPrint(str); if (PrintfAndReportCallback) PrintfAndReportCallback(str); } static void SharedPrintfCode(bool append_pid, const char *format, va_list args) { va_list args2; va_copy(args2, args); const int kLen = 16 * 1024; // |local_buffer| is small enough not to overflow the stack and/or violate // the stack limit enforced by TSan (-Wframe-larger-than=512). On the other // hand, the bigger the buffer is, the more the chance the error report will // fit into it. char local_buffer[400]; int needed_length; char *buffer = local_buffer; int buffer_size = ARRAY_SIZE(local_buffer); // First try to print a message using a local buffer, and then fall back to // mmaped buffer. for (int use_mmap = 0; use_mmap < 2; use_mmap++) { if (use_mmap) { va_end(args); va_copy(args, args2); buffer = (char*)MmapOrDie(kLen, "Report"); buffer_size = kLen; } needed_length = 0; // Check that data fits into the current buffer. # define CHECK_NEEDED_LENGTH \ if (needed_length >= buffer_size) { \ if (!use_mmap) continue; \ RAW_CHECK_MSG(needed_length < kLen, \ "Buffer in Report is too short!\n"); \ } if (append_pid) { int pid = internal_getpid(); const char *exe_name = GetProcessName(); if (common_flags()->log_exe_name && exe_name) { needed_length += internal_snprintf(buffer, buffer_size, "==%s", exe_name); CHECK_NEEDED_LENGTH } needed_length += internal_snprintf(buffer + needed_length, buffer_size - needed_length, "==%d==", pid); CHECK_NEEDED_LENGTH } needed_length += VSNPrintf(buffer + needed_length, buffer_size - needed_length, format, args); CHECK_NEEDED_LENGTH // If the message fit into the buffer, print it and exit. break; # undef CHECK_NEEDED_LENGTH } RawWrite(buffer); // Remove color sequences from the message. RemoveANSIEscapeSequencesFromString(buffer); CallPrintfAndReportCallback(buffer); LogMessageOnPrintf(buffer); // If we had mapped any memory, clean up. if (buffer != local_buffer) UnmapOrDie((void *)buffer, buffer_size); va_end(args2); } FORMAT(1, 2) void Printf(const char *format, ...) { va_list args; va_start(args, format); SharedPrintfCode(false, format, args); va_end(args); } // Like Printf, but prints the current PID before the output string. FORMAT(1, 2) void Report(const char *format, ...) { va_list args; va_start(args, format); SharedPrintfCode(true, format, args); va_end(args); } // Writes at most "length" symbols to "buffer" (including trailing '\0'). // Returns the number of symbols that should have been written to buffer // (not including trailing '\0'). Thus, the string is truncated // iff return value is not less than "length". FORMAT(3, 4) int internal_snprintf(char *buffer, uptr length, const char *format, ...) { va_list args; va_start(args, format); int needed_length = VSNPrintf(buffer, length, format, args); va_end(args); return needed_length; } FORMAT(2, 3) void InternalScopedString::append(const char *format, ...) { CHECK_LT(length_, size()); va_list args; va_start(args, format); VSNPrintf(data() + length_, size() - length_, format, args); va_end(args); length_ += internal_strlen(data() + length_); CHECK_LT(length_, size()); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_interface.h0000664000175000017500000000334212766344232033603 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_interface.h ------------------------- C++ -----===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Re-declaration of functions from public sanitizer allocator interface. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_INTERFACE_H #define SANITIZER_ALLOCATOR_INTERFACE_H #include "sanitizer_internal_defs.h" using __sanitizer::uptr; extern "C" { SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_estimated_allocated_size(uptr size); SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_get_ownership(const void *p); SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_allocated_size(const void *p); SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_current_allocated_bytes(); SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_heap_size(); SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_free_bytes(); SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_unmapped_bytes(); SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_install_malloc_and_free_hooks( void (*malloc_hook)(const void *, uptr), void (*free_hook)(const void *)); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE /* OPTIONAL */ void __sanitizer_malloc_hook(void *ptr, uptr size); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE /* OPTIONAL */ void __sanitizer_free_hook(void *ptr); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_print_memory_profile(int top_percent); } // extern "C" #endif // SANITIZER_ALLOCATOR_INTERFACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_coverage_libcdep.cc0000664000175000017500000010673612774626626033242 0ustar mwhudsonmwhudson//===-- sanitizer_coverage.cc ---------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Sanitizer Coverage. // This file implements run-time support for a poor man's coverage tool. // // Compiler instrumentation: // For every interesting basic block the compiler injects the following code: // if (Guard < 0) { // __sanitizer_cov(&Guard); // } // At the module start up time __sanitizer_cov_module_init sets the guards // to consecutive negative numbers (-1, -2, -3, ...). // It's fine to call __sanitizer_cov more than once for a given block. // // Run-time: // - __sanitizer_cov(): record that we've executed the PC (GET_CALLER_PC). // and atomically set Guard to -Guard. // - __sanitizer_cov_dump: dump the coverage data to disk. // For every module of the current process that has coverage data // this will create a file module_name.PID.sancov. // // The file format is simple: the first 8 bytes is the magic, // one of 0xC0BFFFFFFFFFFF64 and 0xC0BFFFFFFFFFFF32. The last byte of the // magic defines the size of the following offsets. // The rest of the data is the offsets in the module. // // Eventually, this coverage implementation should be obsoleted by a more // powerful general purpose Clang/LLVM coverage instrumentation. // Consider this implementation as prototype. // // FIXME: support (or at least test with) dlclose. //===----------------------------------------------------------------------===// #include "sanitizer_allocator_internal.h" #include "sanitizer_common.h" #include "sanitizer_libc.h" #include "sanitizer_mutex.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" #include "sanitizer_flags.h" using namespace __sanitizer; static const u64 kMagic64 = 0xC0BFFFFFFFFFFF64ULL; static const u64 kMagic32 = 0xC0BFFFFFFFFFFF32ULL; static const uptr kNumWordsForMagic = SANITIZER_WORDSIZE == 64 ? 1 : 2; static const u64 kMagic = SANITIZER_WORDSIZE == 64 ? kMagic64 : kMagic32; static atomic_uint32_t dump_once_guard; // Ensure that CovDump runs only once. static atomic_uintptr_t coverage_counter; static atomic_uintptr_t caller_callee_counter; static void ResetGlobalCounters() { return atomic_store(&coverage_counter, 0, memory_order_relaxed); return atomic_store(&caller_callee_counter, 0, memory_order_relaxed); } // pc_array is the array containing the covered PCs. // To make the pc_array thread- and async-signal-safe it has to be large enough. // 128M counters "ought to be enough for anybody" (4M on 32-bit). // With coverage_direct=1 in ASAN_OPTIONS, pc_array memory is mapped to a file. // In this mode, __sanitizer_cov_dump does nothing, and CovUpdateMapping() // dump current memory layout to another file. static bool cov_sandboxed = false; static fd_t cov_fd = kInvalidFd; static unsigned int cov_max_block_size = 0; static bool coverage_enabled = false; static const char *coverage_dir; namespace __sanitizer { class CoverageData { public: void Init(); void Enable(); void Disable(); void ReInit(); void BeforeFork(); void AfterFork(int child_pid); void Extend(uptr npcs); void Add(uptr pc, u32 *guard); void IndirCall(uptr caller, uptr callee, uptr callee_cache[], uptr cache_size); void DumpCallerCalleePairs(); void DumpTrace(); void DumpAsBitSet(); void DumpCounters(); void DumpOffsets(); void DumpAll(); ALWAYS_INLINE void TraceBasicBlock(u32 *id); void InitializeGuardArray(s32 *guards); void InitializeGuards(s32 *guards, uptr n, const char *module_name, uptr caller_pc); void InitializeCounters(u8 *counters, uptr n); void ReinitializeGuards(); uptr GetNumberOf8bitCounters(); uptr Update8bitCounterBitsetAndClearCounters(u8 *bitset); uptr *data(); uptr size() const; private: struct NamedPcRange { const char *copied_module_name; uptr beg, end; // elements [beg,end) in pc_array. }; void DirectOpen(); void UpdateModuleNameVec(uptr caller_pc, uptr range_beg, uptr range_end); void GetRangeOffsets(const NamedPcRange& r, Symbolizer* s, InternalMmapVector* offsets) const; // Maximal size pc array may ever grow. // We MmapNoReserve this space to ensure that the array is contiguous. static const uptr kPcArrayMaxSize = FIRST_32_SECOND_64(1 << (SANITIZER_ANDROID ? 24 : 26), 1 << 27); // The amount file mapping for the pc array is grown by. static const uptr kPcArrayMmapSize = 64 * 1024; // pc_array is allocated with MmapNoReserveOrDie and so it uses only as // much RAM as it really needs. uptr *pc_array; // Index of the first available pc_array slot. atomic_uintptr_t pc_array_index; // Array size. atomic_uintptr_t pc_array_size; // Current file mapped size of the pc array. uptr pc_array_mapped_size; // Descriptor of the file mapped pc array. fd_t pc_fd; // Vector of coverage guard arrays, protected by mu. InternalMmapVectorNoCtor guard_array_vec; // Vector of module and compilation unit pc ranges. InternalMmapVectorNoCtor comp_unit_name_vec; InternalMmapVectorNoCtor module_name_vec; struct CounterAndSize { u8 *counters; uptr n; }; InternalMmapVectorNoCtor counters_vec; uptr num_8bit_counters; // Caller-Callee (cc) array, size and current index. static const uptr kCcArrayMaxSize = FIRST_32_SECOND_64(1 << 18, 1 << 24); uptr **cc_array; atomic_uintptr_t cc_array_index; atomic_uintptr_t cc_array_size; // Tracing event array, size and current pointer. // We record all events (basic block entries) in a global buffer of u32 // values. Each such value is the index in pc_array. // So far the tracing is highly experimental: // - not thread-safe; // - does not support long traces; // - not tuned for performance. static const uptr kTrEventArrayMaxSize = FIRST_32_SECOND_64(1 << 22, 1 << 30); u32 *tr_event_array; uptr tr_event_array_size; u32 *tr_event_pointer; static const uptr kTrPcArrayMaxSize = FIRST_32_SECOND_64(1 << 22, 1 << 27); StaticSpinMutex mu; }; static CoverageData coverage_data; void CovUpdateMapping(const char *path, uptr caller_pc = 0); void CoverageData::DirectOpen() { InternalScopedString path(kMaxPathLength); internal_snprintf((char *)path.data(), path.size(), "%s/%zd.sancov.raw", coverage_dir, internal_getpid()); pc_fd = OpenFile(path.data(), RdWr); if (pc_fd == kInvalidFd) { Report("Coverage: failed to open %s for reading/writing\n", path.data()); Die(); } pc_array_mapped_size = 0; CovUpdateMapping(coverage_dir); } void CoverageData::Init() { pc_fd = kInvalidFd; } void CoverageData::Enable() { if (pc_array) return; pc_array = reinterpret_cast( MmapNoReserveOrDie(sizeof(uptr) * kPcArrayMaxSize, "CovInit")); atomic_store(&pc_array_index, 0, memory_order_relaxed); if (common_flags()->coverage_direct) { atomic_store(&pc_array_size, 0, memory_order_relaxed); } else { atomic_store(&pc_array_size, kPcArrayMaxSize, memory_order_relaxed); } cc_array = reinterpret_cast(MmapNoReserveOrDie( sizeof(uptr *) * kCcArrayMaxSize, "CovInit::cc_array")); atomic_store(&cc_array_size, kCcArrayMaxSize, memory_order_relaxed); atomic_store(&cc_array_index, 0, memory_order_relaxed); // Allocate tr_event_array with a guard page at the end. tr_event_array = reinterpret_cast(MmapNoReserveOrDie( sizeof(tr_event_array[0]) * kTrEventArrayMaxSize + GetMmapGranularity(), "CovInit::tr_event_array")); MprotectNoAccess( reinterpret_cast(&tr_event_array[kTrEventArrayMaxSize]), GetMmapGranularity()); tr_event_array_size = kTrEventArrayMaxSize; tr_event_pointer = tr_event_array; num_8bit_counters = 0; } void CoverageData::InitializeGuardArray(s32 *guards) { Enable(); // Make sure coverage is enabled at this point. s32 n = guards[0]; for (s32 j = 1; j <= n; j++) { uptr idx = atomic_load_relaxed(&pc_array_index); atomic_store_relaxed(&pc_array_index, idx + 1); guards[j] = -static_cast(idx + 1); } } void CoverageData::Disable() { if (pc_array) { UnmapOrDie(pc_array, sizeof(uptr) * kPcArrayMaxSize); pc_array = nullptr; } if (cc_array) { UnmapOrDie(cc_array, sizeof(uptr *) * kCcArrayMaxSize); cc_array = nullptr; } if (tr_event_array) { UnmapOrDie(tr_event_array, sizeof(tr_event_array[0]) * kTrEventArrayMaxSize + GetMmapGranularity()); tr_event_array = nullptr; tr_event_pointer = nullptr; } if (pc_fd != kInvalidFd) { CloseFile(pc_fd); pc_fd = kInvalidFd; } } void CoverageData::ReinitializeGuards() { // Assuming single thread. atomic_store(&pc_array_index, 0, memory_order_relaxed); for (uptr i = 0; i < guard_array_vec.size(); i++) InitializeGuardArray(guard_array_vec[i]); } void CoverageData::ReInit() { Disable(); if (coverage_enabled) { if (common_flags()->coverage_direct) { // In memory-mapped mode we must extend the new file to the known array // size. uptr size = atomic_load(&pc_array_size, memory_order_relaxed); uptr npcs = size / sizeof(uptr); Enable(); if (size) Extend(npcs); if (coverage_enabled) CovUpdateMapping(coverage_dir); } else { Enable(); } } // Re-initialize the guards. // We are single-threaded now, no need to grab any lock. CHECK_EQ(atomic_load(&pc_array_index, memory_order_relaxed), 0); ReinitializeGuards(); } void CoverageData::BeforeFork() { mu.Lock(); } void CoverageData::AfterFork(int child_pid) { // We are single-threaded so it's OK to release the lock early. mu.Unlock(); if (child_pid == 0) ReInit(); } // Extend coverage PC array to fit additional npcs elements. void CoverageData::Extend(uptr npcs) { if (!common_flags()->coverage_direct) return; SpinMutexLock l(&mu); uptr size = atomic_load(&pc_array_size, memory_order_relaxed); size += npcs * sizeof(uptr); if (coverage_enabled && size > pc_array_mapped_size) { if (pc_fd == kInvalidFd) DirectOpen(); CHECK_NE(pc_fd, kInvalidFd); uptr new_mapped_size = pc_array_mapped_size; while (size > new_mapped_size) new_mapped_size += kPcArrayMmapSize; CHECK_LE(new_mapped_size, sizeof(uptr) * kPcArrayMaxSize); // Extend the file and map the new space at the end of pc_array. uptr res = internal_ftruncate(pc_fd, new_mapped_size); int err; if (internal_iserror(res, &err)) { Printf("failed to extend raw coverage file: %d\n", err); Die(); } uptr next_map_base = ((uptr)pc_array) + pc_array_mapped_size; void *p = MapWritableFileToMemory((void *)next_map_base, new_mapped_size - pc_array_mapped_size, pc_fd, pc_array_mapped_size); CHECK_EQ((uptr)p, next_map_base); pc_array_mapped_size = new_mapped_size; } atomic_store(&pc_array_size, size, memory_order_release); } void CoverageData::InitializeCounters(u8 *counters, uptr n) { if (!counters) return; CHECK_EQ(reinterpret_cast(counters) % 16, 0); n = RoundUpTo(n, 16); // The compiler must ensure that counters is 16-aligned. SpinMutexLock l(&mu); counters_vec.push_back({counters, n}); num_8bit_counters += n; } void CoverageData::UpdateModuleNameVec(uptr caller_pc, uptr range_beg, uptr range_end) { auto sym = Symbolizer::GetOrInit(); if (!sym) return; const char *module_name = sym->GetModuleNameForPc(caller_pc); if (!module_name) return; if (module_name_vec.empty() || module_name_vec.back().copied_module_name != module_name) module_name_vec.push_back({module_name, range_beg, range_end}); else module_name_vec.back().end = range_end; } void CoverageData::InitializeGuards(s32 *guards, uptr n, const char *comp_unit_name, uptr caller_pc) { // The array 'guards' has n+1 elements, we use the element zero // to store 'n'. CHECK_LT(n, 1 << 30); guards[0] = static_cast(n); InitializeGuardArray(guards); SpinMutexLock l(&mu); uptr range_end = atomic_load(&pc_array_index, memory_order_relaxed); uptr range_beg = range_end - n; comp_unit_name_vec.push_back({comp_unit_name, range_beg, range_end}); guard_array_vec.push_back(guards); UpdateModuleNameVec(caller_pc, range_beg, range_end); } static const uptr kBundleCounterBits = 16; // When coverage_order_pcs==true and SANITIZER_WORDSIZE==64 // we insert the global counter into the first 16 bits of the PC. uptr BundlePcAndCounter(uptr pc, uptr counter) { if (SANITIZER_WORDSIZE != 64 || !common_flags()->coverage_order_pcs) return pc; static const uptr kMaxCounter = (1 << kBundleCounterBits) - 1; if (counter > kMaxCounter) counter = kMaxCounter; CHECK_EQ(0, pc >> (SANITIZER_WORDSIZE - kBundleCounterBits)); return pc | (counter << (SANITIZER_WORDSIZE - kBundleCounterBits)); } uptr UnbundlePc(uptr bundle) { if (SANITIZER_WORDSIZE != 64 || !common_flags()->coverage_order_pcs) return bundle; return (bundle << kBundleCounterBits) >> kBundleCounterBits; } uptr UnbundleCounter(uptr bundle) { if (SANITIZER_WORDSIZE != 64 || !common_flags()->coverage_order_pcs) return 0; return bundle >> (SANITIZER_WORDSIZE - kBundleCounterBits); } // If guard is negative, atomically set it to -guard and store the PC in // pc_array. void CoverageData::Add(uptr pc, u32 *guard) { atomic_uint32_t *atomic_guard = reinterpret_cast(guard); s32 guard_value = atomic_load(atomic_guard, memory_order_relaxed); if (guard_value >= 0) return; atomic_store(atomic_guard, -guard_value, memory_order_relaxed); if (!pc_array) return; uptr idx = -guard_value - 1; if (idx >= atomic_load(&pc_array_index, memory_order_acquire)) return; // May happen after fork when pc_array_index becomes 0. CHECK_LT(idx * sizeof(uptr), atomic_load(&pc_array_size, memory_order_acquire)); uptr counter = atomic_fetch_add(&coverage_counter, 1, memory_order_relaxed); pc_array[idx] = BundlePcAndCounter(pc, counter); } // Registers a pair caller=>callee. // When a given caller is seen for the first time, the callee_cache is added // to the global array cc_array, callee_cache[0] is set to caller and // callee_cache[1] is set to cache_size. // Then we are trying to add callee to callee_cache [2,cache_size) if it is // not there yet. // If the cache is full we drop the callee (may want to fix this later). void CoverageData::IndirCall(uptr caller, uptr callee, uptr callee_cache[], uptr cache_size) { if (!cc_array) return; atomic_uintptr_t *atomic_callee_cache = reinterpret_cast(callee_cache); uptr zero = 0; if (atomic_compare_exchange_strong(&atomic_callee_cache[0], &zero, caller, memory_order_seq_cst)) { uptr idx = atomic_fetch_add(&cc_array_index, 1, memory_order_relaxed); CHECK_LT(idx * sizeof(uptr), atomic_load(&cc_array_size, memory_order_acquire)); callee_cache[1] = cache_size; cc_array[idx] = callee_cache; } CHECK_EQ(atomic_load(&atomic_callee_cache[0], memory_order_relaxed), caller); for (uptr i = 2; i < cache_size; i++) { uptr was = 0; if (atomic_compare_exchange_strong(&atomic_callee_cache[i], &was, callee, memory_order_seq_cst)) { atomic_fetch_add(&caller_callee_counter, 1, memory_order_relaxed); return; } if (was == callee) // Already have this callee. return; } } uptr CoverageData::GetNumberOf8bitCounters() { return num_8bit_counters; } // Map every 8bit counter to a 8-bit bitset and clear the counter. uptr CoverageData::Update8bitCounterBitsetAndClearCounters(u8 *bitset) { uptr num_new_bits = 0; uptr cur = 0; // For better speed we map 8 counters to 8 bytes of bitset at once. static const uptr kBatchSize = 8; CHECK_EQ(reinterpret_cast(bitset) % kBatchSize, 0); for (uptr i = 0, len = counters_vec.size(); i < len; i++) { u8 *c = counters_vec[i].counters; uptr n = counters_vec[i].n; CHECK_EQ(n % 16, 0); CHECK_EQ(cur % kBatchSize, 0); CHECK_EQ(reinterpret_cast(c) % kBatchSize, 0); if (!bitset) { internal_bzero_aligned16(c, n); cur += n; continue; } for (uptr j = 0; j < n; j += kBatchSize, cur += kBatchSize) { CHECK_LT(cur, num_8bit_counters); u64 *pc64 = reinterpret_cast(c + j); u64 *pb64 = reinterpret_cast(bitset + cur); u64 c64 = *pc64; u64 old_bits_64 = *pb64; u64 new_bits_64 = old_bits_64; if (c64) { *pc64 = 0; for (uptr k = 0; k < kBatchSize; k++) { u64 x = (c64 >> (8 * k)) & 0xff; if (x) { u64 bit = 0; /**/ if (x >= 128) bit = 128; else if (x >= 32) bit = 64; else if (x >= 16) bit = 32; else if (x >= 8) bit = 16; else if (x >= 4) bit = 8; else if (x >= 3) bit = 4; else if (x >= 2) bit = 2; else if (x >= 1) bit = 1; u64 mask = bit << (8 * k); if (!(new_bits_64 & mask)) { num_new_bits++; new_bits_64 |= mask; } } } *pb64 = new_bits_64; } } } CHECK_EQ(cur, num_8bit_counters); return num_new_bits; } uptr *CoverageData::data() { return pc_array; } uptr CoverageData::size() const { return atomic_load(&pc_array_index, memory_order_relaxed); } // Block layout for packed file format: header, followed by module name (no // trailing zero), followed by data blob. struct CovHeader { int pid; unsigned int module_name_length; unsigned int data_length; }; static void CovWritePacked(int pid, const char *module, const void *blob, unsigned int blob_size) { if (cov_fd == kInvalidFd) return; unsigned module_name_length = internal_strlen(module); CovHeader header = {pid, module_name_length, blob_size}; if (cov_max_block_size == 0) { // Writing to a file. Just go ahead. WriteToFile(cov_fd, &header, sizeof(header)); WriteToFile(cov_fd, module, module_name_length); WriteToFile(cov_fd, blob, blob_size); } else { // Writing to a socket. We want to split the data into appropriately sized // blocks. InternalScopedBuffer block(cov_max_block_size); CHECK_EQ((uptr)block.data(), (uptr)(CovHeader *)block.data()); uptr header_size_with_module = sizeof(header) + module_name_length; CHECK_LT(header_size_with_module, cov_max_block_size); unsigned int max_payload_size = cov_max_block_size - header_size_with_module; char *block_pos = block.data(); internal_memcpy(block_pos, &header, sizeof(header)); block_pos += sizeof(header); internal_memcpy(block_pos, module, module_name_length); block_pos += module_name_length; char *block_data_begin = block_pos; const char *blob_pos = (const char *)blob; while (blob_size > 0) { unsigned int payload_size = Min(blob_size, max_payload_size); blob_size -= payload_size; internal_memcpy(block_data_begin, blob_pos, payload_size); blob_pos += payload_size; ((CovHeader *)block.data())->data_length = payload_size; WriteToFile(cov_fd, block.data(), header_size_with_module + payload_size); } } } // If packed = false: .. (name = module name). // If packed = true and name == 0: ... // If packed = true and name != 0: .. (name is // user-supplied). static fd_t CovOpenFile(InternalScopedString *path, bool packed, const char *name, const char *extension = "sancov") { path->clear(); if (!packed) { CHECK(name); path->append("%s/%s.%zd.%s", coverage_dir, name, internal_getpid(), extension); } else { if (!name) path->append("%s/%zd.%s.packed", coverage_dir, internal_getpid(), extension); else path->append("%s/%s.%s.packed", coverage_dir, name, extension); } error_t err; fd_t fd = OpenFile(path->data(), WrOnly, &err); if (fd == kInvalidFd) Report("SanitizerCoverage: failed to open %s for writing (reason: %d)\n", path->data(), err); return fd; } // Dump trace PCs and trace events into two separate files. void CoverageData::DumpTrace() { uptr max_idx = tr_event_pointer - tr_event_array; if (!max_idx) return; auto sym = Symbolizer::GetOrInit(); if (!sym) return; InternalScopedString out(32 << 20); for (uptr i = 0, n = size(); i < n; i++) { const char *module_name = ""; uptr module_address = 0; sym->GetModuleNameAndOffsetForPC(UnbundlePc(pc_array[i]), &module_name, &module_address); out.append("%s 0x%zx\n", module_name, module_address); } InternalScopedString path(kMaxPathLength); fd_t fd = CovOpenFile(&path, false, "trace-points"); if (fd == kInvalidFd) return; WriteToFile(fd, out.data(), out.length()); CloseFile(fd); fd = CovOpenFile(&path, false, "trace-compunits"); if (fd == kInvalidFd) return; out.clear(); for (uptr i = 0; i < comp_unit_name_vec.size(); i++) out.append("%s\n", comp_unit_name_vec[i].copied_module_name); WriteToFile(fd, out.data(), out.length()); CloseFile(fd); fd = CovOpenFile(&path, false, "trace-events"); if (fd == kInvalidFd) return; uptr bytes_to_write = max_idx * sizeof(tr_event_array[0]); u8 *event_bytes = reinterpret_cast(tr_event_array); // The trace file could be huge, and may not be written with a single syscall. while (bytes_to_write) { uptr actually_written; if (WriteToFile(fd, event_bytes, bytes_to_write, &actually_written) && actually_written <= bytes_to_write) { bytes_to_write -= actually_written; event_bytes += actually_written; } else { break; } } CloseFile(fd); VReport(1, " CovDump: Trace: %zd PCs written\n", size()); VReport(1, " CovDump: Trace: %zd Events written\n", max_idx); } // This function dumps the caller=>callee pairs into a file as a sequence of // lines like "module_name offset". void CoverageData::DumpCallerCalleePairs() { uptr max_idx = atomic_load(&cc_array_index, memory_order_relaxed); if (!max_idx) return; auto sym = Symbolizer::GetOrInit(); if (!sym) return; InternalScopedString out(32 << 20); uptr total = 0; for (uptr i = 0; i < max_idx; i++) { uptr *cc_cache = cc_array[i]; CHECK(cc_cache); uptr caller = cc_cache[0]; uptr n_callees = cc_cache[1]; const char *caller_module_name = ""; uptr caller_module_address = 0; sym->GetModuleNameAndOffsetForPC(caller, &caller_module_name, &caller_module_address); for (uptr j = 2; j < n_callees; j++) { uptr callee = cc_cache[j]; if (!callee) break; total++; const char *callee_module_name = ""; uptr callee_module_address = 0; sym->GetModuleNameAndOffsetForPC(callee, &callee_module_name, &callee_module_address); out.append("%s 0x%zx\n%s 0x%zx\n", caller_module_name, caller_module_address, callee_module_name, callee_module_address); } } InternalScopedString path(kMaxPathLength); fd_t fd = CovOpenFile(&path, false, "caller-callee"); if (fd == kInvalidFd) return; WriteToFile(fd, out.data(), out.length()); CloseFile(fd); VReport(1, " CovDump: %zd caller-callee pairs written\n", total); } // Record the current PC into the event buffer. // Every event is a u32 value (index in tr_pc_array_index) so we compute // it once and then cache in the provided 'cache' storage. // // This function will eventually be inlined by the compiler. void CoverageData::TraceBasicBlock(u32 *id) { // Will trap here if // 1. coverage is not enabled at run-time. // 2. The array tr_event_array is full. *tr_event_pointer = *id - 1; tr_event_pointer++; } void CoverageData::DumpCounters() { if (!common_flags()->coverage_counters) return; uptr n = coverage_data.GetNumberOf8bitCounters(); if (!n) return; InternalScopedBuffer bitset(n); coverage_data.Update8bitCounterBitsetAndClearCounters(bitset.data()); InternalScopedString path(kMaxPathLength); for (uptr m = 0; m < module_name_vec.size(); m++) { auto r = module_name_vec[m]; CHECK(r.copied_module_name); CHECK_LE(r.beg, r.end); CHECK_LE(r.end, size()); const char *base_name = StripModuleName(r.copied_module_name); fd_t fd = CovOpenFile(&path, /* packed */ false, base_name, "counters-sancov"); if (fd == kInvalidFd) return; WriteToFile(fd, bitset.data() + r.beg, r.end - r.beg); CloseFile(fd); VReport(1, " CovDump: %zd counters written for '%s'\n", r.end - r.beg, base_name); } } void CoverageData::DumpAsBitSet() { if (!common_flags()->coverage_bitset) return; if (!size()) return; InternalScopedBuffer out(size()); InternalScopedString path(kMaxPathLength); for (uptr m = 0; m < module_name_vec.size(); m++) { uptr n_set_bits = 0; auto r = module_name_vec[m]; CHECK(r.copied_module_name); CHECK_LE(r.beg, r.end); CHECK_LE(r.end, size()); for (uptr i = r.beg; i < r.end; i++) { uptr pc = UnbundlePc(pc_array[i]); out[i] = pc ? '1' : '0'; if (pc) n_set_bits++; } const char *base_name = StripModuleName(r.copied_module_name); fd_t fd = CovOpenFile(&path, /* packed */false, base_name, "bitset-sancov"); if (fd == kInvalidFd) return; WriteToFile(fd, out.data() + r.beg, r.end - r.beg); CloseFile(fd); VReport(1, " CovDump: bitset of %zd bits written for '%s', %zd bits are set\n", r.end - r.beg, base_name, n_set_bits); } } void CoverageData::GetRangeOffsets(const NamedPcRange& r, Symbolizer* sym, InternalMmapVector* offsets) const { offsets->clear(); for (uptr i = 0; i < kNumWordsForMagic; i++) offsets->push_back(0); CHECK(r.copied_module_name); CHECK_LE(r.beg, r.end); CHECK_LE(r.end, size()); for (uptr i = r.beg; i < r.end; i++) { uptr pc = UnbundlePc(pc_array[i]); uptr counter = UnbundleCounter(pc_array[i]); if (!pc) continue; // Not visited. uptr offset = 0; sym->GetModuleNameAndOffsetForPC(pc, nullptr, &offset); offsets->push_back(BundlePcAndCounter(offset, counter)); } CHECK_GE(offsets->size(), kNumWordsForMagic); SortArray(offsets->data(), offsets->size()); for (uptr i = 0; i < offsets->size(); i++) (*offsets)[i] = UnbundlePc((*offsets)[i]); } static void GenerateHtmlReport(const InternalMmapVector &cov_files) { if (!common_flags()->html_cov_report) { return; } char *sancov_path = FindPathToBinary(common_flags()->sancov_path); if (sancov_path == nullptr) { return; } InternalMmapVector sancov_argv(cov_files.size() * 2 + 3); sancov_argv.push_back(sancov_path); sancov_argv.push_back(internal_strdup("-html-report")); auto argv_deleter = at_scope_exit([&] { for (uptr i = 0; i < sancov_argv.size(); ++i) { InternalFree(sancov_argv[i]); } }); for (const auto &cov_file : cov_files) { sancov_argv.push_back(internal_strdup(cov_file)); } { ListOfModules modules; modules.init(); for (const LoadedModule &module : modules) { sancov_argv.push_back(internal_strdup(module.full_name())); } } InternalScopedString report_path(kMaxPathLength); fd_t report_fd = CovOpenFile(&report_path, false /* packed */, GetProcessName(), "html"); int pid = StartSubprocess(sancov_argv[0], sancov_argv.data(), kInvalidFd /* stdin */, report_fd /* std_out */); if (pid > 0) { int result = WaitForProcess(pid); if (result == 0) Printf("coverage report generated to %s\n", report_path.data()); } } void CoverageData::DumpOffsets() { auto sym = Symbolizer::GetOrInit(); if (!common_flags()->coverage_pcs) return; CHECK_NE(sym, nullptr); InternalMmapVector offsets(0); InternalScopedString path(kMaxPathLength); InternalMmapVector cov_files(module_name_vec.size()); auto cov_files_deleter = at_scope_exit([&] { for (uptr i = 0; i < cov_files.size(); ++i) { InternalFree(cov_files[i]); } }); for (uptr m = 0; m < module_name_vec.size(); m++) { auto r = module_name_vec[m]; GetRangeOffsets(r, sym, &offsets); uptr num_offsets = offsets.size() - kNumWordsForMagic; u64 *magic_p = reinterpret_cast(offsets.data()); CHECK_EQ(*magic_p, 0ULL); // FIXME: we may want to write 32-bit offsets even in 64-mode // if all the offsets are small enough. *magic_p = kMagic; const char *module_name = StripModuleName(r.copied_module_name); if (cov_sandboxed) { if (cov_fd != kInvalidFd) { CovWritePacked(internal_getpid(), module_name, offsets.data(), offsets.size() * sizeof(offsets[0])); VReport(1, " CovDump: %zd PCs written to packed file\n", num_offsets); } } else { // One file per module per process. fd_t fd = CovOpenFile(&path, false /* packed */, module_name); if (fd == kInvalidFd) continue; WriteToFile(fd, offsets.data(), offsets.size() * sizeof(offsets[0])); CloseFile(fd); cov_files.push_back(internal_strdup(path.data())); VReport(1, " CovDump: %s: %zd PCs written\n", path.data(), num_offsets); } } if (cov_fd != kInvalidFd) CloseFile(cov_fd); GenerateHtmlReport(cov_files); } void CoverageData::DumpAll() { if (!coverage_enabled || common_flags()->coverage_direct) return; if (atomic_fetch_add(&dump_once_guard, 1, memory_order_relaxed)) return; DumpAsBitSet(); DumpCounters(); DumpTrace(); DumpOffsets(); DumpCallerCalleePairs(); } void CovPrepareForSandboxing(__sanitizer_sandbox_arguments *args) { if (!args) return; if (!coverage_enabled) return; cov_sandboxed = args->coverage_sandboxed; if (!cov_sandboxed) return; cov_max_block_size = args->coverage_max_block_size; if (args->coverage_fd >= 0) { cov_fd = (fd_t)args->coverage_fd; } else { InternalScopedString path(kMaxPathLength); // Pre-open the file now. The sandbox won't allow us to do it later. cov_fd = CovOpenFile(&path, true /* packed */, nullptr); } } fd_t MaybeOpenCovFile(const char *name) { CHECK(name); if (!coverage_enabled) return kInvalidFd; InternalScopedString path(kMaxPathLength); return CovOpenFile(&path, true /* packed */, name); } void CovBeforeFork() { coverage_data.BeforeFork(); } void CovAfterFork(int child_pid) { coverage_data.AfterFork(child_pid); } static void MaybeDumpCoverage() { if (common_flags()->coverage) __sanitizer_cov_dump(); } void InitializeCoverage(bool enabled, const char *dir) { if (coverage_enabled) return; // May happen if two sanitizer enable coverage in the same process. coverage_enabled = enabled; coverage_dir = dir; coverage_data.Init(); if (enabled) coverage_data.Enable(); if (!common_flags()->coverage_direct) Atexit(__sanitizer_cov_dump); AddDieCallback(MaybeDumpCoverage); } void ReInitializeCoverage(bool enabled, const char *dir) { coverage_enabled = enabled; coverage_dir = dir; coverage_data.ReInit(); } void CoverageUpdateMapping() { if (coverage_enabled) CovUpdateMapping(coverage_dir); } } // namespace __sanitizer extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov(u32 *guard) { coverage_data.Add(StackTrace::GetPreviousInstructionPc(GET_CALLER_PC()), guard); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_with_check(u32 *guard) { atomic_uint32_t *atomic_guard = reinterpret_cast(guard); if (static_cast( __sanitizer::atomic_load(atomic_guard, memory_order_relaxed)) < 0) __sanitizer_cov(guard); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_indir_call16(uptr callee, uptr callee_cache16[]) { coverage_data.IndirCall(StackTrace::GetPreviousInstructionPc(GET_CALLER_PC()), callee, callee_cache16, 16); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_init() { coverage_enabled = true; coverage_dir = common_flags()->coverage_dir; coverage_data.Init(); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump() { coverage_data.DumpAll(); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_module_init(s32 *guards, uptr npcs, u8 *counters, const char *comp_unit_name) { coverage_data.InitializeGuards(guards, npcs, comp_unit_name, GET_CALLER_PC()); coverage_data.InitializeCounters(counters, npcs); if (!common_flags()->coverage_direct) return; if (SANITIZER_ANDROID && coverage_enabled) { // dlopen/dlclose interceptors do not work on Android, so we rely on // Extend() calls to update .sancov.map. CovUpdateMapping(coverage_dir, GET_CALLER_PC()); } coverage_data.Extend(npcs); } SANITIZER_INTERFACE_ATTRIBUTE sptr __sanitizer_maybe_open_cov_file(const char *name) { return (sptr)MaybeOpenCovFile(name); } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_total_unique_coverage() { return atomic_load(&coverage_counter, memory_order_relaxed); } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_total_unique_caller_callee_pairs() { return atomic_load(&caller_callee_counter, memory_order_relaxed); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_trace_func_enter(u32 *id) { __sanitizer_cov_with_check(id); coverage_data.TraceBasicBlock(id); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_trace_basic_block(u32 *id) { __sanitizer_cov_with_check(id); coverage_data.TraceBasicBlock(id); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_reset_coverage() { ResetGlobalCounters(); coverage_data.ReinitializeGuards(); internal_bzero_aligned16( coverage_data.data(), RoundUpTo(coverage_data.size() * sizeof(coverage_data.data()[0]), 16)); } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_coverage_guards(uptr **data) { *data = coverage_data.data(); return coverage_data.size(); } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_number_of_counters() { return coverage_data.GetNumberOf8bitCounters(); } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_update_counter_bitset_and_clear_counters(u8 *bitset) { return coverage_data.Update8bitCounterBitsetAndClearCounters(bitset); } // Default empty implementations (weak). Users should redefine them. #if !SANITIZER_WINDOWS // weak does not work on Windows. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_cmp() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_cmp1() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_cmp2() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_cmp4() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_cmp8() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_switch() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_div4() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_div8() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_gep() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_pc_guard() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_pc_indir() {} SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_pc_guard_init() {} #endif // !SANITIZER_WINDOWS } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_secondary.h0000664000175000017500000002110712773316446033635 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_secondary.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif // This class can (de)allocate only large chunks of memory using mmap/unmap. // The main purpose of this allocator is to cover large and rare allocation // sizes not covered by more efficient allocators (e.g. SizeClassAllocator64). template class LargeMmapAllocator { public: void InitLinkerInitialized(bool may_return_null) { page_size_ = GetPageSizeCached(); atomic_store(&may_return_null_, may_return_null, memory_order_relaxed); } void Init(bool may_return_null) { internal_memset(this, 0, sizeof(*this)); InitLinkerInitialized(may_return_null); } void *Allocate(AllocatorStats *stat, uptr size, uptr alignment) { CHECK(IsPowerOfTwo(alignment)); uptr map_size = RoundUpMapSize(size); if (alignment > page_size_) map_size += alignment; // Overflow. if (map_size < size) return ReturnNullOrDieOnBadRequest(); uptr map_beg = reinterpret_cast( MmapOrDie(map_size, "LargeMmapAllocator")); CHECK(IsAligned(map_beg, page_size_)); MapUnmapCallback().OnMap(map_beg, map_size); uptr map_end = map_beg + map_size; uptr res = map_beg + page_size_; if (res & (alignment - 1)) // Align. res += alignment - (res & (alignment - 1)); CHECK(IsAligned(res, alignment)); CHECK(IsAligned(res, page_size_)); CHECK_GE(res + size, map_beg); CHECK_LE(res + size, map_end); Header *h = GetHeader(res); h->size = size; h->map_beg = map_beg; h->map_size = map_size; uptr size_log = MostSignificantSetBitIndex(map_size); CHECK_LT(size_log, ARRAY_SIZE(stats.by_size_log)); { SpinMutexLock l(&mutex_); uptr idx = n_chunks_++; chunks_sorted_ = false; CHECK_LT(idx, kMaxNumChunks); h->chunk_idx = idx; chunks_[idx] = h; stats.n_allocs++; stats.currently_allocated += map_size; stats.max_allocated = Max(stats.max_allocated, stats.currently_allocated); stats.by_size_log[size_log]++; stat->Add(AllocatorStatAllocated, map_size); stat->Add(AllocatorStatMapped, map_size); } return reinterpret_cast(res); } bool MayReturnNull() const { return atomic_load(&may_return_null_, memory_order_acquire); } void *ReturnNullOrDieOnBadRequest() { if (MayReturnNull()) return nullptr; ReportAllocatorCannotReturnNull(false); } void *ReturnNullOrDieOnOOM() { if (MayReturnNull()) return nullptr; ReportAllocatorCannotReturnNull(true); } void SetMayReturnNull(bool may_return_null) { atomic_store(&may_return_null_, may_return_null, memory_order_release); } void Deallocate(AllocatorStats *stat, void *p) { Header *h = GetHeader(p); { SpinMutexLock l(&mutex_); uptr idx = h->chunk_idx; CHECK_EQ(chunks_[idx], h); CHECK_LT(idx, n_chunks_); chunks_[idx] = chunks_[n_chunks_ - 1]; chunks_[idx]->chunk_idx = idx; n_chunks_--; chunks_sorted_ = false; stats.n_frees++; stats.currently_allocated -= h->map_size; stat->Sub(AllocatorStatAllocated, h->map_size); stat->Sub(AllocatorStatMapped, h->map_size); } MapUnmapCallback().OnUnmap(h->map_beg, h->map_size); UnmapOrDie(reinterpret_cast(h->map_beg), h->map_size); } uptr TotalMemoryUsed() { SpinMutexLock l(&mutex_); uptr res = 0; for (uptr i = 0; i < n_chunks_; i++) { Header *h = chunks_[i]; CHECK_EQ(h->chunk_idx, i); res += RoundUpMapSize(h->size); } return res; } bool PointerIsMine(const void *p) { return GetBlockBegin(p) != nullptr; } uptr GetActuallyAllocatedSize(void *p) { return RoundUpTo(GetHeader(p)->size, page_size_); } // At least page_size_/2 metadata bytes is available. void *GetMetaData(const void *p) { // Too slow: CHECK_EQ(p, GetBlockBegin(p)); if (!IsAligned(reinterpret_cast(p), page_size_)) { Printf("%s: bad pointer %p\n", SanitizerToolName, p); CHECK(IsAligned(reinterpret_cast(p), page_size_)); } return GetHeader(p) + 1; } void *GetBlockBegin(const void *ptr) { uptr p = reinterpret_cast(ptr); SpinMutexLock l(&mutex_); uptr nearest_chunk = 0; // Cache-friendly linear search. for (uptr i = 0; i < n_chunks_; i++) { uptr ch = reinterpret_cast(chunks_[i]); if (p < ch) continue; // p is at left to this chunk, skip it. if (p - ch < p - nearest_chunk) nearest_chunk = ch; } if (!nearest_chunk) return nullptr; Header *h = reinterpret_cast
(nearest_chunk); CHECK_GE(nearest_chunk, h->map_beg); CHECK_LT(nearest_chunk, h->map_beg + h->map_size); CHECK_LE(nearest_chunk, p); if (h->map_beg + h->map_size <= p) return nullptr; return GetUser(h); } // This function does the same as GetBlockBegin, but is much faster. // Must be called with the allocator locked. void *GetBlockBeginFastLocked(void *ptr) { mutex_.CheckLocked(); uptr p = reinterpret_cast(ptr); uptr n = n_chunks_; if (!n) return nullptr; if (!chunks_sorted_) { // Do one-time sort. chunks_sorted_ is reset in Allocate/Deallocate. SortArray(reinterpret_cast(chunks_), n); for (uptr i = 0; i < n; i++) chunks_[i]->chunk_idx = i; chunks_sorted_ = true; min_mmap_ = reinterpret_cast(chunks_[0]); max_mmap_ = reinterpret_cast(chunks_[n - 1]) + chunks_[n - 1]->map_size; } if (p < min_mmap_ || p >= max_mmap_) return nullptr; uptr beg = 0, end = n - 1; // This loop is a log(n) lower_bound. It does not check for the exact match // to avoid expensive cache-thrashing loads. while (end - beg >= 2) { uptr mid = (beg + end) / 2; // Invariant: mid >= beg + 1 if (p < reinterpret_cast(chunks_[mid])) end = mid - 1; // We are not interested in chunks_[mid]. else beg = mid; // chunks_[mid] may still be what we want. } if (beg < end) { CHECK_EQ(beg + 1, end); // There are 2 chunks left, choose one. if (p >= reinterpret_cast(chunks_[end])) beg = end; } Header *h = chunks_[beg]; if (h->map_beg + h->map_size <= p || p < h->map_beg) return nullptr; return GetUser(h); } void PrintStats() { Printf("Stats: LargeMmapAllocator: allocated %zd times, " "remains %zd (%zd K) max %zd M; by size logs: ", stats.n_allocs, stats.n_allocs - stats.n_frees, stats.currently_allocated >> 10, stats.max_allocated >> 20); for (uptr i = 0; i < ARRAY_SIZE(stats.by_size_log); i++) { uptr c = stats.by_size_log[i]; if (!c) continue; Printf("%zd:%zd; ", i, c); } Printf("\n"); } // ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone // introspection API. void ForceLock() { mutex_.Lock(); } void ForceUnlock() { mutex_.Unlock(); } // Iterate over all existing chunks. // The allocator must be locked when calling this function. void ForEachChunk(ForEachChunkCallback callback, void *arg) { for (uptr i = 0; i < n_chunks_; i++) callback(reinterpret_cast(GetUser(chunks_[i])), arg); } private: static const int kMaxNumChunks = 1 << FIRST_32_SECOND_64(15, 18); struct Header { uptr map_beg; uptr map_size; uptr size; uptr chunk_idx; }; Header *GetHeader(uptr p) { CHECK(IsAligned(p, page_size_)); return reinterpret_cast(p - page_size_); } Header *GetHeader(const void *p) { return GetHeader(reinterpret_cast(p)); } void *GetUser(Header *h) { CHECK(IsAligned((uptr)h, page_size_)); return reinterpret_cast(reinterpret_cast(h) + page_size_); } uptr RoundUpMapSize(uptr size) { return RoundUpTo(size, page_size_) + page_size_; } uptr page_size_; Header *chunks_[kMaxNumChunks]; uptr n_chunks_; uptr min_mmap_, max_mmap_; bool chunks_sorted_; struct Stats { uptr n_allocs, n_frees, currently_allocated, max_allocated, by_size_log[64]; } stats; atomic_uint8_t may_return_null_; SpinMutex mutex_; }; golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_procmaps_linux.cc0000664000175000017500000000544112630351113032770 0ustar mwhudsonmwhudson//===-- sanitizer_procmaps_linux.cc ---------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Information about the process mappings (Linux-specific parts). //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_LINUX #include "sanitizer_common.h" #include "sanitizer_procmaps.h" namespace __sanitizer { void ReadProcMaps(ProcSelfMapsBuff *proc_maps) { CHECK(ReadFileToBuffer("/proc/self/maps", &proc_maps->data, &proc_maps->mmaped_size, &proc_maps->len)); } static bool IsOneOf(char c, char c1, char c2) { return c == c1 || c == c2; } bool MemoryMappingLayout::Next(uptr *start, uptr *end, uptr *offset, char filename[], uptr filename_size, uptr *protection) { char *last = proc_self_maps_.data + proc_self_maps_.len; if (current_ >= last) return false; uptr dummy; if (!start) start = &dummy; if (!end) end = &dummy; if (!offset) offset = &dummy; if (!protection) protection = &dummy; char *next_line = (char*)internal_memchr(current_, '\n', last - current_); if (next_line == 0) next_line = last; // Example: 08048000-08056000 r-xp 00000000 03:0c 64593 /foo/bar *start = ParseHex(¤t_); CHECK_EQ(*current_++, '-'); *end = ParseHex(¤t_); CHECK_EQ(*current_++, ' '); CHECK(IsOneOf(*current_, '-', 'r')); *protection = 0; if (*current_++ == 'r') *protection |= kProtectionRead; CHECK(IsOneOf(*current_, '-', 'w')); if (*current_++ == 'w') *protection |= kProtectionWrite; CHECK(IsOneOf(*current_, '-', 'x')); if (*current_++ == 'x') *protection |= kProtectionExecute; CHECK(IsOneOf(*current_, 's', 'p')); if (*current_++ == 's') *protection |= kProtectionShared; CHECK_EQ(*current_++, ' '); *offset = ParseHex(¤t_); CHECK_EQ(*current_++, ' '); ParseHex(¤t_); CHECK_EQ(*current_++, ':'); ParseHex(¤t_); CHECK_EQ(*current_++, ' '); while (IsDecimal(*current_)) current_++; // Qemu may lack the trailing space. // https://github.com/google/sanitizers/issues/160 // CHECK_EQ(*current_++, ' '); // Skip spaces. while (current_ < next_line && *current_ == ' ') current_++; // Fill in the filename. uptr i = 0; while (current_ < next_line) { if (filename && i < filename_size - 1) filename[i++] = *current_; current_++; } if (filename && i < filename_size) filename[i] = 0; current_ = next_line + 1; return true; } } // namespace __sanitizer #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_combined.h0000664000175000017500000001421212773316446033425 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_combined.h --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif // This class implements a complete memory allocator by using two // internal allocators: // PrimaryAllocator is efficient, but may not allocate some sizes (alignments). // When allocating 2^x bytes it should return 2^x aligned chunk. // PrimaryAllocator is used via a local AllocatorCache. // SecondaryAllocator can allocate anything, but is not efficient. template // NOLINT class CombinedAllocator { public: void InitCommon(bool may_return_null) { primary_.Init(); atomic_store(&may_return_null_, may_return_null, memory_order_relaxed); } void InitLinkerInitialized(bool may_return_null) { secondary_.InitLinkerInitialized(may_return_null); stats_.InitLinkerInitialized(); InitCommon(may_return_null); } void Init(bool may_return_null) { secondary_.Init(may_return_null); stats_.Init(); InitCommon(may_return_null); } void *Allocate(AllocatorCache *cache, uptr size, uptr alignment, bool cleared = false, bool check_rss_limit = false) { // Returning 0 on malloc(0) may break a lot of code. if (size == 0) size = 1; if (size + alignment < size) return ReturnNullOrDieOnBadRequest(); if (check_rss_limit && RssLimitIsExceeded()) return ReturnNullOrDieOnOOM(); if (alignment > 8) size = RoundUpTo(size, alignment); void *res; bool from_primary = primary_.CanAllocate(size, alignment); if (from_primary) res = cache->Allocate(&primary_, primary_.ClassID(size)); else res = secondary_.Allocate(&stats_, size, alignment); if (alignment > 8) CHECK_EQ(reinterpret_cast(res) & (alignment - 1), 0); if (cleared && res && from_primary) internal_bzero_aligned16(res, RoundUpTo(size, 16)); return res; } bool MayReturnNull() const { return atomic_load(&may_return_null_, memory_order_acquire); } void *ReturnNullOrDieOnBadRequest() { if (MayReturnNull()) return nullptr; ReportAllocatorCannotReturnNull(false); } void *ReturnNullOrDieOnOOM() { if (MayReturnNull()) return nullptr; ReportAllocatorCannotReturnNull(true); } void SetMayReturnNull(bool may_return_null) { secondary_.SetMayReturnNull(may_return_null); atomic_store(&may_return_null_, may_return_null, memory_order_release); } bool RssLimitIsExceeded() { return atomic_load(&rss_limit_is_exceeded_, memory_order_acquire); } void SetRssLimitIsExceeded(bool rss_limit_is_exceeded) { atomic_store(&rss_limit_is_exceeded_, rss_limit_is_exceeded, memory_order_release); } void Deallocate(AllocatorCache *cache, void *p) { if (!p) return; if (primary_.PointerIsMine(p)) cache->Deallocate(&primary_, primary_.GetSizeClass(p), p); else secondary_.Deallocate(&stats_, p); } void *Reallocate(AllocatorCache *cache, void *p, uptr new_size, uptr alignment) { if (!p) return Allocate(cache, new_size, alignment); if (!new_size) { Deallocate(cache, p); return nullptr; } CHECK(PointerIsMine(p)); uptr old_size = GetActuallyAllocatedSize(p); uptr memcpy_size = Min(new_size, old_size); void *new_p = Allocate(cache, new_size, alignment); if (new_p) internal_memcpy(new_p, p, memcpy_size); Deallocate(cache, p); return new_p; } bool PointerIsMine(void *p) { if (primary_.PointerIsMine(p)) return true; return secondary_.PointerIsMine(p); } bool FromPrimary(void *p) { return primary_.PointerIsMine(p); } void *GetMetaData(const void *p) { if (primary_.PointerIsMine(p)) return primary_.GetMetaData(p); return secondary_.GetMetaData(p); } void *GetBlockBegin(const void *p) { if (primary_.PointerIsMine(p)) return primary_.GetBlockBegin(p); return secondary_.GetBlockBegin(p); } // This function does the same as GetBlockBegin, but is much faster. // Must be called with the allocator locked. void *GetBlockBeginFastLocked(void *p) { if (primary_.PointerIsMine(p)) return primary_.GetBlockBegin(p); return secondary_.GetBlockBeginFastLocked(p); } uptr GetActuallyAllocatedSize(void *p) { if (primary_.PointerIsMine(p)) return primary_.GetActuallyAllocatedSize(p); return secondary_.GetActuallyAllocatedSize(p); } uptr TotalMemoryUsed() { return primary_.TotalMemoryUsed() + secondary_.TotalMemoryUsed(); } void TestOnlyUnmap() { primary_.TestOnlyUnmap(); } void InitCache(AllocatorCache *cache) { cache->Init(&stats_); } void DestroyCache(AllocatorCache *cache) { cache->Destroy(&primary_, &stats_); } void SwallowCache(AllocatorCache *cache) { cache->Drain(&primary_); } void GetStats(AllocatorStatCounters s) const { stats_.Get(s); } void PrintStats() { primary_.PrintStats(); secondary_.PrintStats(); } // ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone // introspection API. void ForceLock() { primary_.ForceLock(); secondary_.ForceLock(); } void ForceUnlock() { secondary_.ForceUnlock(); primary_.ForceUnlock(); } void ReleaseToOS() { primary_.ReleaseToOS(); } // Iterate over all existing chunks. // The allocator must be locked when calling this function. void ForEachChunk(ForEachChunkCallback callback, void *arg) { primary_.ForEachChunk(callback, arg); secondary_.ForEachChunk(callback, arg); } private: PrimaryAllocator primary_; SecondaryAllocator secondary_; AllocatorGlobalStats stats_; atomic_uint8_t may_return_null_; atomic_uint8_t rss_limit_is_exceeded_; }; golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_atomic_clang.h0000664000175000017500000000623512267751021032221 0ustar mwhudsonmwhudson//===-- sanitizer_atomic_clang.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Not intended for direct inclusion. Include sanitizer_atomic.h. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ATOMIC_CLANG_H #define SANITIZER_ATOMIC_CLANG_H #if defined(__i386__) || defined(__x86_64__) # include "sanitizer_atomic_clang_x86.h" #else # include "sanitizer_atomic_clang_other.h" #endif namespace __sanitizer { // We would like to just use compiler builtin atomic operations // for loads and stores, but they are mostly broken in clang: // - they lead to vastly inefficient code generation // (http://llvm.org/bugs/show_bug.cgi?id=17281) // - 64-bit atomic operations are not implemented on x86_32 // (http://llvm.org/bugs/show_bug.cgi?id=15034) // - they are not implemented on ARM // error: undefined reference to '__atomic_load_4' // See http://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html // for mappings of the memory model to different processors. INLINE void atomic_signal_fence(memory_order) { __asm__ __volatile__("" ::: "memory"); } INLINE void atomic_thread_fence(memory_order) { __sync_synchronize(); } template INLINE typename T::Type atomic_fetch_add(volatile T *a, typename T::Type v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return __sync_fetch_and_add(&a->val_dont_use, v); } template INLINE typename T::Type atomic_fetch_sub(volatile T *a, typename T::Type v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return __sync_fetch_and_add(&a->val_dont_use, -v); } template INLINE typename T::Type atomic_exchange(volatile T *a, typename T::Type v, memory_order mo) { DCHECK(!((uptr)a % sizeof(*a))); if (mo & (memory_order_release | memory_order_acq_rel | memory_order_seq_cst)) __sync_synchronize(); v = __sync_lock_test_and_set(&a->val_dont_use, v); if (mo == memory_order_seq_cst) __sync_synchronize(); return v; } template INLINE bool atomic_compare_exchange_strong(volatile T *a, typename T::Type *cmp, typename T::Type xchg, memory_order mo) { typedef typename T::Type Type; Type cmpv = *cmp; Type prev = __sync_val_compare_and_swap(&a->val_dont_use, cmpv, xchg); if (prev == cmpv) return true; *cmp = prev; return false; } template INLINE bool atomic_compare_exchange_weak(volatile T *a, typename T::Type *cmp, typename T::Type xchg, memory_order mo) { return atomic_compare_exchange_strong(a, cmp, xchg, mo); } } // namespace __sanitizer #undef ATOMIC_ORDER #endif // SANITIZER_ATOMIC_CLANG_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stoptheworld.h0000664000175000017500000000455712476264300032345 0ustar mwhudsonmwhudson//===-- sanitizer_stoptheworld.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Defines the StopTheWorld function which suspends the execution of the current // process and runs the user-supplied callback in the same address space. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_STOPTHEWORLD_H #define SANITIZER_STOPTHEWORLD_H #include "sanitizer_internal_defs.h" #include "sanitizer_common.h" namespace __sanitizer { typedef int SuspendedThreadID; // Holds the list of suspended threads and provides an interface to dump their // register contexts. class SuspendedThreadsList { public: SuspendedThreadsList() : thread_ids_(1024) {} SuspendedThreadID GetThreadID(uptr index) const { CHECK_LT(index, thread_ids_.size()); return thread_ids_[index]; } int GetRegistersAndSP(uptr index, uptr *buffer, uptr *sp) const; // The buffer in GetRegistersAndSP should be at least this big. static uptr RegisterCount(); uptr thread_count() const { return thread_ids_.size(); } bool Contains(SuspendedThreadID thread_id) const { for (uptr i = 0; i < thread_ids_.size(); i++) { if (thread_ids_[i] == thread_id) return true; } return false; } void Append(SuspendedThreadID thread_id) { thread_ids_.push_back(thread_id); } private: InternalMmapVector thread_ids_; // Prohibit copy and assign. SuspendedThreadsList(const SuspendedThreadsList&); void operator=(const SuspendedThreadsList&); }; typedef void (*StopTheWorldCallback)( const SuspendedThreadsList &suspended_threads_list, void *argument); // Suspend all threads in the current process and run the callback on the list // of suspended threads. This function will resume the threads before returning. // The callback should not call any libc functions. The callback must not call // exit() nor _exit() and instead return to the caller. // This function should NOT be called from multiple threads simultaneously. void StopTheWorld(StopTheWorldCallback callback, void *argument); } // namespace __sanitizer #endif // SANITIZER_STOPTHEWORLD_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_atomic.h0000664000175000017500000000357112572026416031057 0ustar mwhudsonmwhudson//===-- sanitizer_atomic.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ATOMIC_H #define SANITIZER_ATOMIC_H #include "sanitizer_internal_defs.h" namespace __sanitizer { enum memory_order { memory_order_relaxed = 1 << 0, memory_order_consume = 1 << 1, memory_order_acquire = 1 << 2, memory_order_release = 1 << 3, memory_order_acq_rel = 1 << 4, memory_order_seq_cst = 1 << 5 }; struct atomic_uint8_t { typedef u8 Type; volatile Type val_dont_use; }; struct atomic_uint16_t { typedef u16 Type; volatile Type val_dont_use; }; struct atomic_uint32_t { typedef u32 Type; volatile Type val_dont_use; }; struct atomic_uint64_t { typedef u64 Type; // On 32-bit platforms u64 is not necessary aligned on 8 bytes. volatile ALIGNED(8) Type val_dont_use; }; struct atomic_uintptr_t { typedef uptr Type; volatile Type val_dont_use; }; } // namespace __sanitizer #if defined(__clang__) || defined(__GNUC__) # include "sanitizer_atomic_clang.h" #elif defined(_MSC_VER) # include "sanitizer_atomic_msvc.h" #else # error "Unsupported compiler" #endif namespace __sanitizer { // Clutter-reducing helpers. template INLINE typename T::Type atomic_load_relaxed(const volatile T *a) { return atomic_load(a, memory_order_relaxed); } template INLINE void atomic_store_relaxed(volatile T *a, typename T::Type v) { atomic_store(a, v, memory_order_relaxed); } } // namespace __sanitizer #endif // SANITIZER_ATOMIC_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_freebsd.h0000664000175000017500000000640312371066125031210 0ustar mwhudsonmwhudson//===-- sanitizer_freebsd.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. It contains FreeBSD-specific // definitions. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_FREEBSD_H #define SANITIZER_FREEBSD_H #include "sanitizer_internal_defs.h" // x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in // 32-bit mode. #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) # include # if __FreeBSD_version <= 902001 // v9.2 # include # include # include namespace __sanitizer { typedef unsigned long long __xuint64_t; typedef __int32_t __xregister_t; typedef struct __xmcontext { __xregister_t mc_onstack; __xregister_t mc_gs; __xregister_t mc_fs; __xregister_t mc_es; __xregister_t mc_ds; __xregister_t mc_edi; __xregister_t mc_esi; __xregister_t mc_ebp; __xregister_t mc_isp; __xregister_t mc_ebx; __xregister_t mc_edx; __xregister_t mc_ecx; __xregister_t mc_eax; __xregister_t mc_trapno; __xregister_t mc_err; __xregister_t mc_eip; __xregister_t mc_cs; __xregister_t mc_eflags; __xregister_t mc_esp; __xregister_t mc_ss; int mc_len; int mc_fpformat; int mc_ownedfp; __xregister_t mc_flags; int mc_fpstate[128] __aligned(16); __xregister_t mc_fsbase; __xregister_t mc_gsbase; __xregister_t mc_xfpustate; __xregister_t mc_xfpustate_len; int mc_spare2[4]; } xmcontext_t; typedef struct __xucontext { sigset_t uc_sigmask; xmcontext_t uc_mcontext; struct __ucontext *uc_link; stack_t uc_stack; int uc_flags; int __spare__[4]; } xucontext_t; struct xkinfo_vmentry { int kve_structsize; int kve_type; __xuint64_t kve_start; __xuint64_t kve_end; __xuint64_t kve_offset; __xuint64_t kve_vn_fileid; __uint32_t kve_vn_fsid; int kve_flags; int kve_resident; int kve_private_resident; int kve_protection; int kve_ref_count; int kve_shadow_count; int kve_vn_type; __xuint64_t kve_vn_size; __uint32_t kve_vn_rdev; __uint16_t kve_vn_mode; __uint16_t kve_status; int _kve_ispare[12]; char kve_path[PATH_MAX]; }; typedef struct { __uint32_t p_type; __uint32_t p_offset; __uint32_t p_vaddr; __uint32_t p_paddr; __uint32_t p_filesz; __uint32_t p_memsz; __uint32_t p_flags; __uint32_t p_align; } XElf32_Phdr; struct xdl_phdr_info { Elf_Addr dlpi_addr; const char *dlpi_name; const XElf32_Phdr *dlpi_phdr; Elf_Half dlpi_phnum; unsigned long long int dlpi_adds; unsigned long long int dlpi_subs; size_t dlpi_tls_modid; void *dlpi_tls_data; }; typedef int (*__xdl_iterate_hdr_callback)(struct xdl_phdr_info*, size_t, void*); typedef int xdl_iterate_phdr_t(__xdl_iterate_hdr_callback, void*); #define xdl_iterate_phdr(callback, param) \ (((xdl_iterate_phdr_t*) dl_iterate_phdr)((callback), (param))) } // namespace __sanitizer # endif // __FreeBSD_version <= 902001 #endif // SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) #endif // SANITIZER_FREEBSD_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stacktrace.h0000664000175000017500000001065512717003426031725 0ustar mwhudsonmwhudson//===-- sanitizer_stacktrace.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #ifndef SANITIZER_STACKTRACE_H #define SANITIZER_STACKTRACE_H #include "sanitizer_internal_defs.h" namespace __sanitizer { static const u32 kStackTraceMax = 256; #if SANITIZER_LINUX && (defined(__sparc__) || defined(__mips__)) # define SANITIZER_CAN_FAST_UNWIND 0 #elif SANITIZER_WINDOWS # define SANITIZER_CAN_FAST_UNWIND 0 #else # define SANITIZER_CAN_FAST_UNWIND 1 #endif // Fast unwind is the only option on Mac for now; we will need to // revisit this macro when slow unwind works on Mac, see // https://github.com/google/sanitizers/issues/137 #if SANITIZER_MAC # define SANITIZER_CAN_SLOW_UNWIND 0 #else # define SANITIZER_CAN_SLOW_UNWIND 1 #endif struct StackTrace { const uptr *trace; u32 size; u32 tag; static const int TAG_UNKNOWN = 0; static const int TAG_ALLOC = 1; static const int TAG_DEALLOC = 2; static const int TAG_CUSTOM = 100; // Tool specific tags start here. StackTrace() : trace(nullptr), size(0), tag(0) {} StackTrace(const uptr *trace, u32 size) : trace(trace), size(size), tag(0) {} StackTrace(const uptr *trace, u32 size, u32 tag) : trace(trace), size(size), tag(tag) {} // Prints a symbolized stacktrace, followed by an empty line. void Print() const; static bool WillUseFastUnwind(bool request_fast_unwind) { if (!SANITIZER_CAN_FAST_UNWIND) return false; else if (!SANITIZER_CAN_SLOW_UNWIND) return true; return request_fast_unwind; } static uptr GetCurrentPc(); static inline uptr GetPreviousInstructionPc(uptr pc); static uptr GetNextInstructionPc(uptr pc); typedef bool (*SymbolizeCallback)(const void *pc, char *out_buffer, int out_size); }; // Performance-critical, must be in the header. ALWAYS_INLINE uptr StackTrace::GetPreviousInstructionPc(uptr pc) { #if defined(__arm__) // Cancel Thumb bit. pc = pc & (~1); #endif #if defined(__powerpc__) || defined(__powerpc64__) // PCs are always 4 byte aligned. return pc - 4; #elif defined(__sparc__) || defined(__mips__) return pc - 8; #else return pc - 1; #endif } // StackTrace that owns the buffer used to store the addresses. struct BufferedStackTrace : public StackTrace { uptr trace_buffer[kStackTraceMax]; uptr top_frame_bp; // Optional bp of a top frame. BufferedStackTrace() : StackTrace(trace_buffer, 0), top_frame_bp(0) {} void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0); void Unwind(u32 max_depth, uptr pc, uptr bp, void *context, uptr stack_top, uptr stack_bottom, bool request_fast_unwind); private: void FastUnwindStack(uptr pc, uptr bp, uptr stack_top, uptr stack_bottom, u32 max_depth); void SlowUnwindStack(uptr pc, u32 max_depth); void SlowUnwindStackWithContext(uptr pc, void *context, u32 max_depth); void PopStackFrames(uptr count); uptr LocatePcInTrace(uptr pc); BufferedStackTrace(const BufferedStackTrace &); void operator=(const BufferedStackTrace &); }; // Check if given pointer points into allocated stack area. static inline bool IsValidFrame(uptr frame, uptr stack_top, uptr stack_bottom) { return frame > stack_bottom && frame < stack_top - 2 * sizeof (uhwptr); } } // namespace __sanitizer // Use this macro if you want to print stack trace with the caller // of the current function in the top frame. #define GET_CALLER_PC_BP_SP \ uptr bp = GET_CURRENT_FRAME(); \ uptr pc = GET_CALLER_PC(); \ uptr local_stack; \ uptr sp = (uptr)&local_stack #define GET_CALLER_PC_BP \ uptr bp = GET_CURRENT_FRAME(); \ uptr pc = GET_CALLER_PC(); // Use this macro if you want to print stack trace with the current // function in the top frame. #define GET_CURRENT_PC_BP_SP \ uptr bp = GET_CURRENT_FRAME(); \ uptr pc = StackTrace::GetCurrentPc(); \ uptr local_stack; \ uptr sp = (uptr)&local_stack #endif // SANITIZER_STACKTRACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_flag_parser.cc0000664000175000017500000001135512553547661032236 0ustar mwhudsonmwhudson//===-- sanitizer_flag_parser.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_flag_parser.h" #include "sanitizer_common.h" #include "sanitizer_libc.h" #include "sanitizer_flags.h" #include "sanitizer_flag_parser.h" namespace __sanitizer { LowLevelAllocator FlagParser::Alloc; class UnknownFlags { static const int kMaxUnknownFlags = 20; const char *unknown_flags_[kMaxUnknownFlags]; int n_unknown_flags_; public: void Add(const char *name) { CHECK_LT(n_unknown_flags_, kMaxUnknownFlags); unknown_flags_[n_unknown_flags_++] = name; } void Report() { if (!n_unknown_flags_) return; Printf("WARNING: found %d unrecognized flag(s):\n", n_unknown_flags_); for (int i = 0; i < n_unknown_flags_; ++i) Printf(" %s\n", unknown_flags_[i]); n_unknown_flags_ = 0; } }; UnknownFlags unknown_flags; void ReportUnrecognizedFlags() { unknown_flags.Report(); } char *FlagParser::ll_strndup(const char *s, uptr n) { uptr len = internal_strnlen(s, n); char *s2 = (char*)Alloc.Allocate(len + 1); internal_memcpy(s2, s, len); s2[len] = 0; return s2; } void FlagParser::PrintFlagDescriptions() { Printf("Available flags for %s:\n", SanitizerToolName); for (int i = 0; i < n_flags_; ++i) Printf("\t%s\n\t\t- %s\n", flags_[i].name, flags_[i].desc); } void FlagParser::fatal_error(const char *err) { Printf("ERROR: %s\n", err); Die(); } bool FlagParser::is_space(char c) { return c == ' ' || c == ',' || c == ':' || c == '\n' || c == '\t' || c == '\r'; } void FlagParser::skip_whitespace() { while (is_space(buf_[pos_])) ++pos_; } void FlagParser::parse_flag() { uptr name_start = pos_; while (buf_[pos_] != 0 && buf_[pos_] != '=' && !is_space(buf_[pos_])) ++pos_; if (buf_[pos_] != '=') fatal_error("expected '='"); char *name = ll_strndup(buf_ + name_start, pos_ - name_start); uptr value_start = ++pos_; char *value; if (buf_[pos_] == '\'' || buf_[pos_] == '"') { char quote = buf_[pos_++]; while (buf_[pos_] != 0 && buf_[pos_] != quote) ++pos_; if (buf_[pos_] == 0) fatal_error("unterminated string"); value = ll_strndup(buf_ + value_start + 1, pos_ - value_start - 1); ++pos_; // consume the closing quote } else { while (buf_[pos_] != 0 && !is_space(buf_[pos_])) ++pos_; if (buf_[pos_] != 0 && !is_space(buf_[pos_])) fatal_error("expected separator or eol"); value = ll_strndup(buf_ + value_start, pos_ - value_start); } bool res = run_handler(name, value); if (!res) fatal_error("Flag parsing failed."); } void FlagParser::parse_flags() { while (true) { skip_whitespace(); if (buf_[pos_] == 0) break; parse_flag(); } // Do a sanity check for certain flags. if (common_flags_dont_use.malloc_context_size < 1) common_flags_dont_use.malloc_context_size = 1; } void FlagParser::ParseString(const char *s) { if (!s) return; // Backup current parser state to allow nested ParseString() calls. const char *old_buf_ = buf_; uptr old_pos_ = pos_; buf_ = s; pos_ = 0; parse_flags(); buf_ = old_buf_; pos_ = old_pos_; } bool FlagParser::ParseFile(const char *path, bool ignore_missing) { static const uptr kMaxIncludeSize = 1 << 15; char *data; uptr data_mapped_size; error_t err; uptr len; if (!ReadFileToBuffer(path, &data, &data_mapped_size, &len, Max(kMaxIncludeSize, GetPageSizeCached()), &err)) { if (ignore_missing) return true; Printf("Failed to read options from '%s': error %d\n", path, err); return false; } ParseString(data); UnmapOrDie(data, data_mapped_size); return true; } bool FlagParser::run_handler(const char *name, const char *value) { for (int i = 0; i < n_flags_; ++i) { if (internal_strcmp(name, flags_[i].name) == 0) return flags_[i].handler->Parse(value); } // Unrecognized flag. This is not a fatal error, we may print a warning later. unknown_flags.Add(name); return true; } void FlagParser::RegisterHandler(const char *name, FlagHandlerBase *handler, const char *desc) { CHECK_LT(n_flags_, kMaxFlags); flags_[n_flags_].name = name; flags_[n_flags_].desc = desc; flags_[n_flags_].handler = handler; ++n_flags_; } FlagParser::FlagParser() : n_flags_(0), buf_(nullptr), pos_(0) { flags_ = (Flag *)Alloc.Allocate(sizeof(Flag) * kMaxFlags); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_primary64.h0000664000175000017500000004552712764626311033512 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_primary64.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif template struct SizeClassAllocator64LocalCache; // SizeClassAllocator64 -- allocator for 64-bit address space. // The template parameter Params is a class containing the actual parameters. // // Space: a portion of address space of kSpaceSize bytes starting at SpaceBeg. // If kSpaceBeg is ~0 then SpaceBeg is chosen dynamically my mmap. // Otherwise SpaceBeg=kSpaceBeg (fixed address). // kSpaceSize is a power of two. // At the beginning the entire space is mprotect-ed, then small parts of it // are mapped on demand. // // Region: a part of Space dedicated to a single size class. // There are kNumClasses Regions of equal size. // // UserChunk: a piece of memory returned to user. // MetaChunk: kMetadataSize bytes of metadata associated with a UserChunk. // FreeArray is an array free-d chunks (stored as 4-byte offsets) // // A Region looks like this: // UserChunk1 ... UserChunkN MetaChunkN ... MetaChunk1 FreeArray struct SizeClassAllocator64FlagMasks { // Bit masks. enum { kRandomShuffleChunks = 1, }; }; template class SizeClassAllocator64 { public: static const uptr kSpaceBeg = Params::kSpaceBeg; static const uptr kSpaceSize = Params::kSpaceSize; static const uptr kMetadataSize = Params::kMetadataSize; typedef typename Params::SizeClassMap SizeClassMap; typedef typename Params::MapUnmapCallback MapUnmapCallback; static const bool kRandomShuffleChunks = Params::kFlags & SizeClassAllocator64FlagMasks::kRandomShuffleChunks; typedef SizeClassAllocator64 ThisT; typedef SizeClassAllocator64LocalCache AllocatorCache; // When we know the size class (the region base) we can represent a pointer // as a 4-byte integer (offset from the region start shifted right by 4). typedef u32 CompactPtrT; static const uptr kCompactPtrScale = 4; CompactPtrT PointerToCompactPtr(uptr base, uptr ptr) { return static_cast((ptr - base) >> kCompactPtrScale); } uptr CompactPtrToPointer(uptr base, CompactPtrT ptr32) { return base + (static_cast(ptr32) << kCompactPtrScale); } void Init() { uptr TotalSpaceSize = kSpaceSize + AdditionalSize(); if (kUsingConstantSpaceBeg) { CHECK_EQ(kSpaceBeg, reinterpret_cast( MmapFixedNoAccess(kSpaceBeg, TotalSpaceSize))); } else { NonConstSpaceBeg = reinterpret_cast(MmapNoAccess(TotalSpaceSize)); CHECK_NE(NonConstSpaceBeg, ~(uptr)0); } MapWithCallback(SpaceEnd(), AdditionalSize()); } void MapWithCallback(uptr beg, uptr size) { CHECK_EQ(beg, reinterpret_cast(MmapFixedOrDie(beg, size))); MapUnmapCallback().OnMap(beg, size); } void UnmapWithCallback(uptr beg, uptr size) { MapUnmapCallback().OnUnmap(beg, size); UnmapOrDie(reinterpret_cast(beg), size); } static bool CanAllocate(uptr size, uptr alignment) { return size <= SizeClassMap::kMaxSize && alignment <= SizeClassMap::kMaxSize; } NOINLINE void ReturnToAllocator(AllocatorStats *stat, uptr class_id, const CompactPtrT *chunks, uptr n_chunks) { RegionInfo *region = GetRegionInfo(class_id); uptr region_beg = GetRegionBeginBySizeClass(class_id); CompactPtrT *free_array = GetFreeArray(region_beg); BlockingMutexLock l(®ion->mutex); uptr old_num_chunks = region->num_freed_chunks; uptr new_num_freed_chunks = old_num_chunks + n_chunks; EnsureFreeArraySpace(region, region_beg, new_num_freed_chunks); for (uptr i = 0; i < n_chunks; i++) free_array[old_num_chunks + i] = chunks[i]; region->num_freed_chunks = new_num_freed_chunks; region->n_freed += n_chunks; } NOINLINE void GetFromAllocator(AllocatorStats *stat, uptr class_id, CompactPtrT *chunks, uptr n_chunks) { RegionInfo *region = GetRegionInfo(class_id); uptr region_beg = GetRegionBeginBySizeClass(class_id); CompactPtrT *free_array = GetFreeArray(region_beg); BlockingMutexLock l(®ion->mutex); if (UNLIKELY(region->num_freed_chunks < n_chunks)) { PopulateFreeArray(stat, class_id, region, n_chunks - region->num_freed_chunks); CHECK_GE(region->num_freed_chunks, n_chunks); } region->num_freed_chunks -= n_chunks; uptr base_idx = region->num_freed_chunks; for (uptr i = 0; i < n_chunks; i++) chunks[i] = free_array[base_idx + i]; region->n_allocated += n_chunks; } bool PointerIsMine(const void *p) { uptr P = reinterpret_cast(p); if (kUsingConstantSpaceBeg && (kSpaceBeg % kSpaceSize) == 0) return P / kSpaceSize == kSpaceBeg / kSpaceSize; return P >= SpaceBeg() && P < SpaceEnd(); } uptr GetRegionBegin(const void *p) { if (kUsingConstantSpaceBeg) return reinterpret_cast(p) & ~(kRegionSize - 1); uptr space_beg = SpaceBeg(); return ((reinterpret_cast(p) - space_beg) & ~(kRegionSize - 1)) + space_beg; } uptr GetRegionBeginBySizeClass(uptr class_id) { return SpaceBeg() + kRegionSize * class_id; } uptr GetSizeClass(const void *p) { if (kUsingConstantSpaceBeg && (kSpaceBeg % kSpaceSize) == 0) return ((reinterpret_cast(p)) / kRegionSize) % kNumClassesRounded; return ((reinterpret_cast(p) - SpaceBeg()) / kRegionSize) % kNumClassesRounded; } void *GetBlockBegin(const void *p) { uptr class_id = GetSizeClass(p); uptr size = ClassIdToSize(class_id); if (!size) return nullptr; uptr chunk_idx = GetChunkIdx((uptr)p, size); uptr reg_beg = GetRegionBegin(p); uptr beg = chunk_idx * size; uptr next_beg = beg + size; if (class_id >= kNumClasses) return nullptr; RegionInfo *region = GetRegionInfo(class_id); if (region->mapped_user >= next_beg) return reinterpret_cast(reg_beg + beg); return nullptr; } uptr GetActuallyAllocatedSize(void *p) { CHECK(PointerIsMine(p)); return ClassIdToSize(GetSizeClass(p)); } uptr ClassID(uptr size) { return SizeClassMap::ClassID(size); } void *GetMetaData(const void *p) { uptr class_id = GetSizeClass(p); uptr size = ClassIdToSize(class_id); uptr chunk_idx = GetChunkIdx(reinterpret_cast(p), size); uptr region_beg = GetRegionBeginBySizeClass(class_id); return reinterpret_cast(GetMetadataEnd(region_beg) - (1 + chunk_idx) * kMetadataSize); } uptr TotalMemoryUsed() { uptr res = 0; for (uptr i = 0; i < kNumClasses; i++) res += GetRegionInfo(i)->allocated_user; return res; } // Test-only. void TestOnlyUnmap() { UnmapWithCallback(SpaceBeg(), kSpaceSize + AdditionalSize()); } static void FillMemoryProfile(uptr start, uptr rss, bool file, uptr *stats, uptr stats_size) { for (uptr class_id = 0; class_id < stats_size; class_id++) if (stats[class_id] == start) stats[class_id] = rss; } void PrintStats(uptr class_id, uptr rss) { RegionInfo *region = GetRegionInfo(class_id); if (region->mapped_user == 0) return; uptr in_use = region->n_allocated - region->n_freed; uptr avail_chunks = region->allocated_user / ClassIdToSize(class_id); Printf( " %02zd (%zd): mapped: %zdK allocs: %zd frees: %zd inuse: %zd " "num_freed_chunks %zd" " avail: %zd rss: %zdK releases: %zd\n", class_id, ClassIdToSize(class_id), region->mapped_user >> 10, region->n_allocated, region->n_freed, in_use, region->num_freed_chunks, avail_chunks, rss >> 10, region->rtoi.num_releases); } void PrintStats() { uptr total_mapped = 0; uptr n_allocated = 0; uptr n_freed = 0; for (uptr class_id = 1; class_id < kNumClasses; class_id++) { RegionInfo *region = GetRegionInfo(class_id); total_mapped += region->mapped_user; n_allocated += region->n_allocated; n_freed += region->n_freed; } Printf("Stats: SizeClassAllocator64: %zdM mapped in %zd allocations; " "remains %zd\n", total_mapped >> 20, n_allocated, n_allocated - n_freed); uptr rss_stats[kNumClasses]; for (uptr class_id = 0; class_id < kNumClasses; class_id++) rss_stats[class_id] = SpaceBeg() + kRegionSize * class_id; GetMemoryProfile(FillMemoryProfile, rss_stats, kNumClasses); for (uptr class_id = 1; class_id < kNumClasses; class_id++) PrintStats(class_id, rss_stats[class_id]); } // ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone // introspection API. void ForceLock() { for (uptr i = 0; i < kNumClasses; i++) { GetRegionInfo(i)->mutex.Lock(); } } void ForceUnlock() { for (int i = (int)kNumClasses - 1; i >= 0; i--) { GetRegionInfo(i)->mutex.Unlock(); } } // Iterate over all existing chunks. // The allocator must be locked when calling this function. void ForEachChunk(ForEachChunkCallback callback, void *arg) { for (uptr class_id = 1; class_id < kNumClasses; class_id++) { RegionInfo *region = GetRegionInfo(class_id); uptr chunk_size = ClassIdToSize(class_id); uptr region_beg = SpaceBeg() + class_id * kRegionSize; for (uptr chunk = region_beg; chunk < region_beg + region->allocated_user; chunk += chunk_size) { // Too slow: CHECK_EQ((void *)chunk, GetBlockBegin((void *)chunk)); callback(chunk, arg); } } } static uptr ClassIdToSize(uptr class_id) { return SizeClassMap::Size(class_id); } static uptr AdditionalSize() { return RoundUpTo(sizeof(RegionInfo) * kNumClassesRounded, GetPageSizeCached()); } void ReleaseToOS() { for (uptr class_id = 1; class_id < kNumClasses; class_id++) ReleaseToOS(class_id); } typedef SizeClassMap SizeClassMapT; static const uptr kNumClasses = SizeClassMap::kNumClasses; static const uptr kNumClassesRounded = SizeClassMap::kNumClassesRounded; private: static const uptr kRegionSize = kSpaceSize / kNumClassesRounded; // FreeArray is the array of free-d chunks (stored as 4-byte offsets). // In the worst case it may reguire kRegionSize/SizeClassMap::kMinSize // elements, but in reality this will not happen. For simplicity we // dedicate 1/8 of the region's virtual space to FreeArray. static const uptr kFreeArraySize = kRegionSize / 8; static const bool kUsingConstantSpaceBeg = kSpaceBeg != ~(uptr)0; uptr NonConstSpaceBeg; uptr SpaceBeg() const { return kUsingConstantSpaceBeg ? kSpaceBeg : NonConstSpaceBeg; } uptr SpaceEnd() const { return SpaceBeg() + kSpaceSize; } // kRegionSize must be >= 2^32. COMPILER_CHECK((kRegionSize) >= (1ULL << (SANITIZER_WORDSIZE / 2))); // kRegionSize must be <= 2^36, see CompactPtrT. COMPILER_CHECK((kRegionSize) <= (1ULL << (SANITIZER_WORDSIZE / 2 + 4))); // Call mmap for user memory with at least this size. static const uptr kUserMapSize = 1 << 16; // Call mmap for metadata memory with at least this size. static const uptr kMetaMapSize = 1 << 16; // Call mmap for free array memory with at least this size. static const uptr kFreeArrayMapSize = 1 << 16; // Granularity of ReleaseToOs (aka madvise). static const uptr kReleaseToOsGranularity = 1 << 12; struct ReleaseToOsInfo { uptr n_freed_at_last_release; uptr num_releases; }; struct RegionInfo { BlockingMutex mutex; uptr num_freed_chunks; // Number of elements in the freearray. uptr mapped_free_array; // Bytes mapped for freearray. uptr allocated_user; // Bytes allocated for user memory. uptr allocated_meta; // Bytes allocated for metadata. uptr mapped_user; // Bytes mapped for user memory. uptr mapped_meta; // Bytes mapped for metadata. u32 rand_state; // Seed for random shuffle, used if kRandomShuffleChunks. uptr n_allocated, n_freed; // Just stats. ReleaseToOsInfo rtoi; }; COMPILER_CHECK(sizeof(RegionInfo) >= kCacheLineSize); u32 Rand(u32 *state) { // ANSI C linear congruential PRNG. return (*state = *state * 1103515245 + 12345) >> 16; } u32 RandN(u32 *state, u32 n) { return Rand(state) % n; } // [0, n) void RandomShuffle(u32 *a, u32 n, u32 *rand_state) { if (n <= 1) return; for (u32 i = n - 1; i > 0; i--) Swap(a[i], a[RandN(rand_state, i + 1)]); } RegionInfo *GetRegionInfo(uptr class_id) { CHECK_LT(class_id, kNumClasses); RegionInfo *regions = reinterpret_cast(SpaceBeg() + kSpaceSize); return ®ions[class_id]; } uptr GetMetadataEnd(uptr region_beg) { return region_beg + kRegionSize - kFreeArraySize; } uptr GetChunkIdx(uptr chunk, uptr size) { if (!kUsingConstantSpaceBeg) chunk -= SpaceBeg(); uptr offset = chunk % kRegionSize; // Here we divide by a non-constant. This is costly. // size always fits into 32-bits. If the offset fits too, use 32-bit div. if (offset >> (SANITIZER_WORDSIZE / 2)) return offset / size; return (u32)offset / (u32)size; } CompactPtrT *GetFreeArray(uptr region_beg) { return reinterpret_cast(region_beg + kRegionSize - kFreeArraySize); } void EnsureFreeArraySpace(RegionInfo *region, uptr region_beg, uptr num_freed_chunks) { uptr needed_space = num_freed_chunks * sizeof(CompactPtrT); if (region->mapped_free_array < needed_space) { CHECK_LE(needed_space, kFreeArraySize); uptr new_mapped_free_array = RoundUpTo(needed_space, kFreeArrayMapSize); uptr current_map_end = reinterpret_cast(GetFreeArray(region_beg)) + region->mapped_free_array; uptr new_map_size = new_mapped_free_array - region->mapped_free_array; MapWithCallback(current_map_end, new_map_size); region->mapped_free_array = new_mapped_free_array; } } NOINLINE void PopulateFreeArray(AllocatorStats *stat, uptr class_id, RegionInfo *region, uptr requested_count) { // region->mutex is held. uptr size = ClassIdToSize(class_id); uptr beg_idx = region->allocated_user; uptr end_idx = beg_idx + requested_count * size; uptr region_beg = GetRegionBeginBySizeClass(class_id); if (end_idx > region->mapped_user) { if (!kUsingConstantSpaceBeg && region->mapped_user == 0) region->rand_state = static_cast(region_beg >> 12); // From ASLR. // Do the mmap for the user memory. uptr map_size = kUserMapSize; while (end_idx > region->mapped_user + map_size) map_size += kUserMapSize; CHECK_GE(region->mapped_user + map_size, end_idx); MapWithCallback(region_beg + region->mapped_user, map_size); stat->Add(AllocatorStatMapped, map_size); region->mapped_user += map_size; } CompactPtrT *free_array = GetFreeArray(region_beg); uptr total_count = (region->mapped_user - beg_idx) / size; uptr num_freed_chunks = region->num_freed_chunks; EnsureFreeArraySpace(region, region_beg, num_freed_chunks + total_count); for (uptr i = 0; i < total_count; i++) { uptr chunk = beg_idx + i * size; free_array[num_freed_chunks + total_count - 1 - i] = PointerToCompactPtr(0, chunk); } if (kRandomShuffleChunks) RandomShuffle(&free_array[num_freed_chunks], total_count, ®ion->rand_state); region->num_freed_chunks += total_count; region->allocated_user += total_count * size; CHECK_LE(region->allocated_user, region->mapped_user); region->allocated_meta += total_count * kMetadataSize; if (region->allocated_meta > region->mapped_meta) { uptr map_size = kMetaMapSize; while (region->allocated_meta > region->mapped_meta + map_size) map_size += kMetaMapSize; // Do the mmap for the metadata. CHECK_GE(region->mapped_meta + map_size, region->allocated_meta); MapWithCallback(GetMetadataEnd(region_beg) - region->mapped_meta - map_size, map_size); region->mapped_meta += map_size; } CHECK_LE(region->allocated_meta, region->mapped_meta); if (region->mapped_user + region->mapped_meta > kRegionSize - kFreeArraySize) { Printf("%s: Out of memory. Dying. ", SanitizerToolName); Printf("The process has exhausted %zuMB for size class %zu.\n", kRegionSize / 1024 / 1024, size); Die(); } } bool MaybeReleaseChunkRange(uptr region_beg, uptr chunk_size, CompactPtrT first, CompactPtrT last) { uptr beg_ptr = CompactPtrToPointer(region_beg, first); uptr end_ptr = CompactPtrToPointer(region_beg, last) + chunk_size; CHECK_GE(end_ptr - beg_ptr, kReleaseToOsGranularity); beg_ptr = RoundUpTo(beg_ptr, kReleaseToOsGranularity); end_ptr = RoundDownTo(end_ptr, kReleaseToOsGranularity); if (end_ptr == beg_ptr) return false; ReleaseMemoryToOS(beg_ptr, end_ptr - beg_ptr); return true; } // Releases some RAM back to OS. // Algorithm: // * Lock the region. // * Sort the chunks. // * Find ranges fully covered by free-d chunks // * Release them to OS with madvise. // // TODO(kcc): make sure we don't do it too frequently. void ReleaseToOS(uptr class_id) { RegionInfo *region = GetRegionInfo(class_id); uptr region_beg = GetRegionBeginBySizeClass(class_id); CompactPtrT *free_array = GetFreeArray(region_beg); uptr chunk_size = ClassIdToSize(class_id); uptr scaled_chunk_size = chunk_size >> kCompactPtrScale; const uptr kScaledGranularity = kReleaseToOsGranularity >> kCompactPtrScale; BlockingMutexLock l(®ion->mutex); uptr n = region->num_freed_chunks; if (n * chunk_size < kReleaseToOsGranularity) return; // No chance to release anything. if ((region->rtoi.n_freed_at_last_release - region->n_freed) * chunk_size < kReleaseToOsGranularity) return; // Nothing new to release. SortArray(free_array, n); uptr beg = free_array[0]; uptr prev = free_array[0]; for (uptr i = 1; i < n; i++) { uptr chunk = free_array[i]; CHECK_GT(chunk, prev); if (chunk - prev != scaled_chunk_size) { CHECK_GT(chunk - prev, scaled_chunk_size); if (prev + scaled_chunk_size - beg >= kScaledGranularity) { MaybeReleaseChunkRange(region_beg, chunk_size, beg, prev); region->rtoi.n_freed_at_last_release = region->n_freed; region->rtoi.num_releases++; } beg = chunk; } prev = chunk; } } }; golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_flags.inc0000664000175000017500000002673413004735206031222 0ustar mwhudsonmwhudson//===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file describes common flags available in all sanitizers. // //===----------------------------------------------------------------------===// #ifndef COMMON_FLAG #error "Define COMMON_FLAG prior to including this file!" #endif // COMMON_FLAG(Type, Name, DefaultValue, Description) // Supported types: bool, const char *, int, uptr. // Default value must be a compile-time constant. // Description must be a string literal. COMMON_FLAG( bool, symbolize, true, "If set, use the online symbolizer from common sanitizer runtime to turn " "virtual addresses to file/line locations.") COMMON_FLAG( const char *, external_symbolizer_path, nullptr, "Path to external symbolizer. If empty, the tool will search $PATH for " "the symbolizer.") COMMON_FLAG( bool, allow_addr2line, false, "If set, allows online symbolizer to run addr2line binary to symbolize " "stack traces (addr2line will only be used if llvm-symbolizer binary is " "unavailable.") COMMON_FLAG(const char *, strip_path_prefix, "", "Strips this prefix from file paths in error reports.") COMMON_FLAG(bool, fast_unwind_on_check, false, "If available, use the fast frame-pointer-based unwinder on " "internal CHECK failures.") COMMON_FLAG(bool, fast_unwind_on_fatal, false, "If available, use the fast frame-pointer-based unwinder on fatal " "errors.") COMMON_FLAG(bool, fast_unwind_on_malloc, true, "If available, use the fast frame-pointer-based unwinder on " "malloc/free.") COMMON_FLAG(bool, handle_ioctl, false, "Intercept and handle ioctl requests.") COMMON_FLAG(int, malloc_context_size, 1, "Max number of stack frames kept for each allocation/deallocation.") COMMON_FLAG( const char *, log_path, "stderr", "Write logs to \"log_path.pid\". The special values are \"stdout\" and " "\"stderr\". The default is \"stderr\".") COMMON_FLAG( bool, log_exe_name, false, "Mention name of executable when reporting error and " "append executable name to logs (as in \"log_path.exe_name.pid\").") COMMON_FLAG( bool, log_to_syslog, SANITIZER_ANDROID || SANITIZER_MAC, "Write all sanitizer output to syslog in addition to other means of " "logging.") COMMON_FLAG( int, verbosity, 0, "Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).") COMMON_FLAG(bool, detect_leaks, true, "Enable memory leak detection.") COMMON_FLAG( bool, leak_check_at_exit, true, "Invoke leak checking in an atexit handler. Has no effect if " "detect_leaks=false, or if __lsan_do_leak_check() is called before the " "handler has a chance to run.") COMMON_FLAG(bool, allocator_may_return_null, false, "If false, the allocator will crash instead of returning 0 on " "out-of-memory.") COMMON_FLAG(bool, print_summary, true, "If false, disable printing error summaries in addition to error " "reports.") COMMON_FLAG(bool, check_printf, true, "Check printf arguments.") COMMON_FLAG(bool, handle_segv, true, "If set, registers the tool's custom SIGSEGV/SIGBUS handler.") COMMON_FLAG(bool, handle_abort, false, "If set, registers the tool's custom SIGABRT handler.") COMMON_FLAG(bool, handle_sigill, false, "If set, registers the tool's custom SIGILL handler.") COMMON_FLAG(bool, handle_sigfpe, true, "If set, registers the tool's custom SIGFPE handler.") COMMON_FLAG(bool, allow_user_segv_handler, false, "If set, allows user to register a SEGV handler even if the tool " "registers one.") COMMON_FLAG(bool, use_sigaltstack, true, "If set, uses alternate stack for signal handling.") COMMON_FLAG(bool, detect_deadlocks, false, "If set, deadlock detection is enabled.") COMMON_FLAG( uptr, clear_shadow_mmap_threshold, 64 * 1024, "Large shadow regions are zero-filled using mmap(NORESERVE) instead of " "memset(). This is the threshold size in bytes.") COMMON_FLAG(const char *, color, "auto", "Colorize reports: (always|never|auto).") COMMON_FLAG( bool, legacy_pthread_cond, false, "Enables support for dynamic libraries linked with libpthread 2.2.5.") COMMON_FLAG(bool, intercept_tls_get_addr, false, "Intercept __tls_get_addr.") COMMON_FLAG(bool, help, false, "Print the flag descriptions.") COMMON_FLAG(uptr, mmap_limit_mb, 0, "Limit the amount of mmap-ed memory (excluding shadow) in Mb; " "not a user-facing flag, used mosly for testing the tools") COMMON_FLAG(uptr, hard_rss_limit_mb, 0, "Hard RSS limit in Mb." " If non-zero, a background thread is spawned at startup" " which periodically reads RSS and aborts the process if the" " limit is reached") COMMON_FLAG(uptr, soft_rss_limit_mb, 0, "Soft RSS limit in Mb." " If non-zero, a background thread is spawned at startup" " which periodically reads RSS. If the limit is reached" " all subsequent malloc/new calls will fail or return NULL" " (depending on the value of allocator_may_return_null)" " until the RSS goes below the soft limit." " This limit does not affect memory allocations other than" " malloc/new.") COMMON_FLAG(bool, heap_profile, false, "Experimental heap profiler, asan-only") COMMON_FLAG(bool, allocator_release_to_os, false, "Experimental. If true, try to periodically release unused" " memory to the OS.\n") COMMON_FLAG(bool, can_use_proc_maps_statm, true, "If false, do not attempt to read /proc/maps/statm." " Mostly useful for testing sanitizers.") COMMON_FLAG( bool, coverage, false, "If set, coverage information will be dumped at program shutdown (if the " "coverage instrumentation was enabled at compile time).") COMMON_FLAG(bool, coverage_pcs, true, "If set (and if 'coverage' is set too), the coverage information " "will be dumped as a set of PC offsets for every module.") COMMON_FLAG(bool, coverage_order_pcs, false, "If true, the PCs will be dumped in the order they've" " appeared during the execution.") COMMON_FLAG(bool, coverage_bitset, false, "If set (and if 'coverage' is set too), the coverage information " "will also be dumped as a bitset to a separate file.") COMMON_FLAG(bool, coverage_counters, false, "If set (and if 'coverage' is set too), the bitmap that corresponds" " to coverage counters will be dumped.") COMMON_FLAG(bool, coverage_direct, SANITIZER_ANDROID, "If set, coverage information will be dumped directly to a memory " "mapped file. This way data is not lost even if the process is " "suddenly killed.") COMMON_FLAG(const char *, coverage_dir, ".", "Target directory for coverage dumps. Defaults to the current " "directory.") COMMON_FLAG(bool, full_address_space, false, "Sanitize complete address space; " "by default kernel area on 32-bit platforms will not be sanitized") COMMON_FLAG(bool, print_suppressions, true, "Print matched suppressions at exit.") COMMON_FLAG( bool, disable_coredump, (SANITIZER_WORDSIZE == 64) && !SANITIZER_GO, "Disable core dumping. By default, disable_coredump=1 on 64-bit to avoid" " dumping a 16T+ core file. Ignored on OSes that don't dump core by" " default and for sanitizers that don't reserve lots of virtual memory.") COMMON_FLAG(bool, use_madv_dontdump, true, "If set, instructs kernel to not store the (huge) shadow " "in core file.") COMMON_FLAG(bool, symbolize_inline_frames, true, "Print inlined frames in stacktraces. Defaults to true.") COMMON_FLAG(bool, symbolize_vs_style, false, "Print file locations in Visual Studio style (e.g: " " file(10,42): ...") COMMON_FLAG(int, dedup_token_length, 0, "If positive, after printing a stack trace also print a short " "string token based on this number of frames that will simplify " "deduplication of the reports. " "Example: 'DEDUP_TOKEN: foo-bar-main'. Default is 0.") COMMON_FLAG(const char *, stack_trace_format, "DEFAULT", "Format string used to render stack frames. " "See sanitizer_stacktrace_printer.h for the format description. " "Use DEFAULT to get default format.") COMMON_FLAG(bool, no_huge_pages_for_shadow, true, "If true, the shadow is not allowed to use huge pages. ") COMMON_FLAG(bool, strict_string_checks, false, "If set check that string arguments are properly null-terminated") COMMON_FLAG(bool, intercept_strstr, true, "If set, uses custom wrappers for strstr and strcasestr functions " "to find more errors.") COMMON_FLAG(bool, intercept_strspn, true, "If set, uses custom wrappers for strspn and strcspn function " "to find more errors.") COMMON_FLAG(bool, intercept_strpbrk, true, "If set, uses custom wrappers for strpbrk function " "to find more errors.") COMMON_FLAG(bool, intercept_strlen, true, "If set, uses custom wrappers for strlen and strnlen functions " "to find more errors.") COMMON_FLAG(bool, intercept_strchr, true, "If set, uses custom wrappers for strchr, strchrnul, and strrchr " "functions to find more errors.") COMMON_FLAG(bool, intercept_memcmp, true, "If set, uses custom wrappers for memcmp function " "to find more errors.") COMMON_FLAG(bool, strict_memcmp, true, "If true, assume that memcmp(p1, p2, n) always reads n bytes before " "comparing p1 and p2.") COMMON_FLAG(bool, intercept_memmem, true, "If set, uses a wrapper for memmem() to find more errors.") COMMON_FLAG(bool, intercept_intrin, true, "If set, uses custom wrappers for memset/memcpy/memmove " "intrinsics to find more errors.") COMMON_FLAG(bool, intercept_stat, true, "If set, uses custom wrappers for *stat functions " "to find more errors.") COMMON_FLAG(bool, intercept_send, true, "If set, uses custom wrappers for send* functions " "to find more errors.") COMMON_FLAG(bool, decorate_proc_maps, false, "If set, decorate sanitizer " "mappings in /proc/self/maps with " "user-readable names") COMMON_FLAG(int, exitcode, 1, "Override the program exit status if the tool " "found an error") COMMON_FLAG( bool, abort_on_error, SANITIZER_ANDROID || SANITIZER_MAC, "If set, the tool calls abort() instead of _exit() after printing the " "error report.") COMMON_FLAG(bool, suppress_equal_pcs, true, "Deduplicate multiple reports for single source location in " "halt_on_error=false mode (asan only).") COMMON_FLAG(bool, print_cmdline, false, "Print command line on crash " "(asan only).") COMMON_FLAG(bool, html_cov_report, false, "Generate html coverage report.") COMMON_FLAG(const char *, sancov_path, "sancov", "Sancov tool location.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_posix.h0000664000175000017500000000751612737271160030751 0ustar mwhudsonmwhudson//===-- sanitizer_posix.h -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and declares some useful POSIX-specific functions. //===----------------------------------------------------------------------===// #ifndef SANITIZER_POSIX_H #define SANITIZER_POSIX_H // ----------- ATTENTION ------------- // This header should NOT include any other headers from sanitizer runtime. #include "sanitizer_internal_defs.h" #include "sanitizer_platform_limits_posix.h" #if !SANITIZER_POSIX // Make it hard to accidentally use any of functions declared in this file: #error This file should only be included on POSIX #endif namespace __sanitizer { // I/O // Don't use directly, use __sanitizer::OpenFile() instead. uptr internal_open(const char *filename, int flags); uptr internal_open(const char *filename, int flags, u32 mode); uptr internal_close(fd_t fd); uptr internal_read(fd_t fd, void *buf, uptr count); uptr internal_write(fd_t fd, const void *buf, uptr count); // Memory uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd, OFF_T offset); uptr internal_munmap(void *addr, uptr length); int internal_mprotect(void *addr, uptr length, int prot); // OS uptr internal_filesize(fd_t fd); // -1 on error. uptr internal_stat(const char *path, void *buf); uptr internal_lstat(const char *path, void *buf); uptr internal_fstat(fd_t fd, void *buf); uptr internal_dup2(int oldfd, int newfd); uptr internal_readlink(const char *path, char *buf, uptr bufsize); uptr internal_unlink(const char *path); uptr internal_rename(const char *oldpath, const char *newpath); uptr internal_lseek(fd_t fd, OFF_T offset, int whence); uptr internal_ptrace(int request, int pid, void *addr, void *data); uptr internal_waitpid(int pid, int *status, int options); int internal_fork(); int internal_forkpty(int *amaster); // These functions call appropriate pthread_ functions directly, bypassing // the interceptor. They are weak and may not be present in some tools. SANITIZER_WEAK_ATTRIBUTE int real_pthread_create(void *th, void *attr, void *(*callback)(void *), void *param); SANITIZER_WEAK_ATTRIBUTE int real_pthread_join(void *th, void **ret); #define DEFINE_REAL_PTHREAD_FUNCTIONS \ namespace __sanitizer { \ int real_pthread_create(void *th, void *attr, void *(*callback)(void *), \ void *param) { \ return REAL(pthread_create)(th, attr, callback, param); \ } \ int real_pthread_join(void *th, void **ret) { \ return REAL(pthread_join(th, ret)); \ } \ } // namespace __sanitizer int my_pthread_attr_getstack(void *attr, void **addr, uptr *size); // A routine named real_sigaction() must be implemented by each sanitizer in // order for internal_sigaction() to bypass interceptors. int internal_sigaction(int signum, const void *act, void *oldact); void internal_sigfillset(__sanitizer_sigset_t *set); void internal_sigemptyset(__sanitizer_sigset_t *set); bool internal_sigismember(__sanitizer_sigset_t *set, int signum); uptr internal_execve(const char *filename, char *const argv[], char *const envp[]); } // namespace __sanitizer #endif // SANITIZER_POSIX_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_stats.h0000664000175000017500000000534412743772761033014 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_stats.h -----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif // Memory allocator statistics enum AllocatorStat { AllocatorStatAllocated, AllocatorStatMapped, AllocatorStatCount }; typedef uptr AllocatorStatCounters[AllocatorStatCount]; // Per-thread stats, live in per-thread cache. class AllocatorStats { public: void Init() { internal_memset(this, 0, sizeof(*this)); } void InitLinkerInitialized() {} void Add(AllocatorStat i, uptr v) { v += atomic_load(&stats_[i], memory_order_relaxed); atomic_store(&stats_[i], v, memory_order_relaxed); } void Sub(AllocatorStat i, uptr v) { v = atomic_load(&stats_[i], memory_order_relaxed) - v; atomic_store(&stats_[i], v, memory_order_relaxed); } void Set(AllocatorStat i, uptr v) { atomic_store(&stats_[i], v, memory_order_relaxed); } uptr Get(AllocatorStat i) const { return atomic_load(&stats_[i], memory_order_relaxed); } private: friend class AllocatorGlobalStats; AllocatorStats *next_; AllocatorStats *prev_; atomic_uintptr_t stats_[AllocatorStatCount]; }; // Global stats, used for aggregation and querying. class AllocatorGlobalStats : public AllocatorStats { public: void InitLinkerInitialized() { next_ = this; prev_ = this; } void Init() { internal_memset(this, 0, sizeof(*this)); InitLinkerInitialized(); } void Register(AllocatorStats *s) { SpinMutexLock l(&mu_); s->next_ = next_; s->prev_ = this; next_->prev_ = s; next_ = s; } void Unregister(AllocatorStats *s) { SpinMutexLock l(&mu_); s->prev_->next_ = s->next_; s->next_->prev_ = s->prev_; for (int i = 0; i < AllocatorStatCount; i++) Add(AllocatorStat(i), s->Get(AllocatorStat(i))); } void Get(AllocatorStatCounters s) const { internal_memset(s, 0, AllocatorStatCount * sizeof(uptr)); SpinMutexLock l(&mu_); const AllocatorStats *stats = this; for (;;) { for (int i = 0; i < AllocatorStatCount; i++) s[i] += stats->Get(AllocatorStat(i)); stats = stats->next_; if (stats == this) break; } // All stats must be non-negative. for (int i = 0; i < AllocatorStatCount; i++) s[i] = ((sptr)s[i]) >= 0 ? s[i] : 0; } private: mutable SpinMutex mu_; }; golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_flag_parser.h0000664000175000017500000000620612553547661032077 0ustar mwhudsonmwhudson//===-- sanitizer_flag_parser.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_FLAG_REGISTRY_H #define SANITIZER_FLAG_REGISTRY_H #include "sanitizer_internal_defs.h" #include "sanitizer_libc.h" #include "sanitizer_common.h" namespace __sanitizer { class FlagHandlerBase { public: virtual bool Parse(const char *value) { return false; } }; template class FlagHandler : public FlagHandlerBase { T *t_; public: explicit FlagHandler(T *t) : t_(t) {} bool Parse(const char *value) final; }; template <> inline bool FlagHandler::Parse(const char *value) { if (internal_strcmp(value, "0") == 0 || internal_strcmp(value, "no") == 0 || internal_strcmp(value, "false") == 0) { *t_ = false; return true; } if (internal_strcmp(value, "1") == 0 || internal_strcmp(value, "yes") == 0 || internal_strcmp(value, "true") == 0) { *t_ = true; return true; } Printf("ERROR: Invalid value for bool option: '%s'\n", value); return false; } template <> inline bool FlagHandler::Parse(const char *value) { *t_ = internal_strdup(value); return true; } template <> inline bool FlagHandler::Parse(const char *value) { char *value_end; *t_ = internal_simple_strtoll(value, &value_end, 10); bool ok = *value_end == 0; if (!ok) Printf("ERROR: Invalid value for int option: '%s'\n", value); return ok; } template <> inline bool FlagHandler::Parse(const char *value) { char *value_end; *t_ = internal_simple_strtoll(value, &value_end, 10); bool ok = *value_end == 0; if (!ok) Printf("ERROR: Invalid value for uptr option: '%s'\n", value); return ok; } class FlagParser { static const int kMaxFlags = 200; struct Flag { const char *name; const char *desc; FlagHandlerBase *handler; } *flags_; int n_flags_; const char *buf_; uptr pos_; public: FlagParser(); void RegisterHandler(const char *name, FlagHandlerBase *handler, const char *desc); void ParseString(const char *s); bool ParseFile(const char *path, bool ignore_missing); void PrintFlagDescriptions(); static LowLevelAllocator Alloc; private: void fatal_error(const char *err); bool is_space(char c); void skip_whitespace(); void parse_flags(); void parse_flag(); bool run_handler(const char *name, const char *value); char *ll_strndup(const char *s, uptr n); }; template static void RegisterFlag(FlagParser *parser, const char *name, const char *desc, T *var) { FlagHandler *fh = new (FlagParser::Alloc) FlagHandler(var); // NOLINT parser->RegisterHandler(name, fh, desc); } void ReportUnrecognizedFlags(); } // namespace __sanitizer #endif // SANITIZER_FLAG_REGISTRY_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_limits_linux.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_limits_linux.0000664000175000017500000000630712766606132034063 0ustar mwhudsonmwhudson//===-- sanitizer_platform_limits_linux.cc --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer common code. // // Sizes and layouts of linux kernel data structures. //===----------------------------------------------------------------------===// // This is a separate compilation unit for linux headers that conflict with // userspace headers. // Most "normal" includes go in sanitizer_platform_limits_posix.cc #include "sanitizer_platform.h" #if SANITIZER_LINUX #include "sanitizer_internal_defs.h" #include "sanitizer_platform_limits_posix.h" // For offsetof -> __builtin_offsetof definition. #include // With old kernels (and even new kernels on powerpc) asm/stat.h uses types that // are not defined anywhere in userspace headers. Fake them. This seems to work // fine with newer headers, too. #include #if defined(__x86_64__) || defined(__mips__) #include #else #define ino_t __kernel_ino_t #define mode_t __kernel_mode_t #define nlink_t __kernel_nlink_t #define uid_t __kernel_uid_t #define gid_t __kernel_gid_t #define off_t __kernel_off_t // This header seems to contain the definitions of _kernel_ stat* structs. #include #undef ino_t #undef mode_t #undef nlink_t #undef uid_t #undef gid_t #undef off_t #endif #include #if !SANITIZER_ANDROID #include #include #endif using namespace __sanitizer; namespace __sanitizer { #if !SANITIZER_ANDROID unsigned struct_statfs64_sz = sizeof(struct statfs64); #endif } // namespace __sanitizer #if !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__aarch64__)\ && !defined(__mips__) && !defined(__s390__) COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat)); #endif COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); #if defined(__i386__) COMPILER_CHECK(struct_kernel_stat64_sz == sizeof(struct stat64)); #endif CHECK_TYPE_SIZE(io_event); CHECK_SIZE_AND_OFFSET(io_event, data); CHECK_SIZE_AND_OFFSET(io_event, obj); CHECK_SIZE_AND_OFFSET(io_event, res); CHECK_SIZE_AND_OFFSET(io_event, res2); #if !SANITIZER_ANDROID COMPILER_CHECK(sizeof(struct __sanitizer_perf_event_attr) <= sizeof(struct perf_event_attr)); CHECK_SIZE_AND_OFFSET(perf_event_attr, type); CHECK_SIZE_AND_OFFSET(perf_event_attr, size); #endif COMPILER_CHECK(iocb_cmd_pread == IOCB_CMD_PREAD); COMPILER_CHECK(iocb_cmd_pwrite == IOCB_CMD_PWRITE); #if !SANITIZER_ANDROID COMPILER_CHECK(iocb_cmd_preadv == IOCB_CMD_PREADV); COMPILER_CHECK(iocb_cmd_pwritev == IOCB_CMD_PWRITEV); #endif CHECK_TYPE_SIZE(iocb); CHECK_SIZE_AND_OFFSET(iocb, aio_data); // Skip aio_key, it's weird. CHECK_SIZE_AND_OFFSET(iocb, aio_lio_opcode); CHECK_SIZE_AND_OFFSET(iocb, aio_reqprio); CHECK_SIZE_AND_OFFSET(iocb, aio_fildes); CHECK_SIZE_AND_OFFSET(iocb, aio_buf); CHECK_SIZE_AND_OFFSET(iocb, aio_nbytes); CHECK_SIZE_AND_OFFSET(iocb, aio_offset); #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/0000775000175000017500000000000013040224626027015 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/sancov.py0000775000175000017500000001762712706366326030714 0ustar mwhudsonmwhudson#!/usr/bin/env python # Merge or print the coverage data collected by asan's coverage. # Input files are sequences of 4-byte integers. # We need to merge these integers into a set and then # either print them (as hex) or dump them into another file. import array import bisect import glob import os.path import struct import subprocess import sys prog_name = "" def Usage(): print >> sys.stderr, "Usage: \n" + \ " " + prog_name + " merge FILE [FILE...] > OUTPUT\n" \ " " + prog_name + " print FILE [FILE...]\n" \ " " + prog_name + " unpack FILE [FILE...]\n" \ " " + prog_name + " rawunpack FILE [FILE ...]\n" \ " " + prog_name + " missing BINARY < LIST_OF_PCS\n" exit(1) def CheckBits(bits): if bits != 32 and bits != 64: raise Exception("Wrong bitness: %d" % bits) def TypeCodeForBits(bits): CheckBits(bits) return 'L' if bits == 64 else 'I' def TypeCodeForStruct(bits): CheckBits(bits) return 'Q' if bits == 64 else 'I' kMagic32SecondHalf = 0xFFFFFF32; kMagic64SecondHalf = 0xFFFFFF64; kMagicFirstHalf = 0xC0BFFFFF; def MagicForBits(bits): CheckBits(bits) if sys.byteorder == 'little': return [kMagic64SecondHalf if bits == 64 else kMagic32SecondHalf, kMagicFirstHalf] else: return [kMagicFirstHalf, kMagic64SecondHalf if bits == 64 else kMagic32SecondHalf] def ReadMagicAndReturnBitness(f, path): magic_bytes = f.read(8) magic_words = struct.unpack('II', magic_bytes); bits = 0 idx = 1 if sys.byteorder == 'little' else 0 if magic_words[idx] == kMagicFirstHalf: if magic_words[1-idx] == kMagic64SecondHalf: bits = 64 elif magic_words[1-idx] == kMagic32SecondHalf: bits = 32 if bits == 0: raise Exception('Bad magic word in %s' % path) return bits def ReadOneFile(path): with open(path, mode="rb") as f: f.seek(0, 2) size = f.tell() f.seek(0, 0) if size < 8: raise Exception('File %s is short (< 8 bytes)' % path) bits = ReadMagicAndReturnBitness(f, path) size -= 8 s = struct.unpack_from(TypeCodeForStruct(bits) * (size * 8 / bits), f.read(size)) print >>sys.stderr, "%s: read %d %d-bit PCs from %s" % (prog_name, size * 8 / bits, bits, path) return s def Merge(files): s = set() for f in files: s = s.union(set(ReadOneFile(f))) print >> sys.stderr, "%s: %d files merged; %d PCs total" % \ (prog_name, len(files), len(s)) return sorted(s) def PrintFiles(files): if len(files) > 1: s = Merge(files) else: # If there is just on file, print the PCs in order. s = ReadOneFile(files[0]) print >> sys.stderr, "%s: 1 file merged; %d PCs total" % \ (prog_name, len(s)) for i in s: print "0x%x" % i def MergeAndPrint(files): if sys.stdout.isatty(): Usage() s = Merge(files) bits = 32 if max(s) > 0xFFFFFFFF: bits = 64 array.array('I', MagicForBits(bits)).tofile(sys.stdout) a = struct.pack(TypeCodeForStruct(bits) * len(s), *s) sys.stdout.write(a) def UnpackOneFile(path): with open(path, mode="rb") as f: print >> sys.stderr, "%s: unpacking %s" % (prog_name, path) while True: header = f.read(12) if not header: return if len(header) < 12: break pid, module_length, blob_size = struct.unpack('iII', header) module = f.read(module_length) blob = f.read(blob_size) assert(len(module) == module_length) assert(len(blob) == blob_size) extracted_file = "%s.%d.sancov" % (module, pid) print >> sys.stderr, "%s: extracting %s" % \ (prog_name, extracted_file) # The packed file may contain multiple blobs for the same pid/module # pair. Append to the end of the file instead of overwriting. with open(extracted_file, 'ab') as f2: f2.write(blob) # fail raise Exception('Error reading file %s' % path) def Unpack(files): for f in files: UnpackOneFile(f) def UnpackOneRawFile(path, map_path): mem_map = [] with open(map_path, mode="rt") as f_map: print >> sys.stderr, "%s: reading map %s" % (prog_name, map_path) bits = int(f_map.readline()) if bits != 32 and bits != 64: raise Exception('Wrong bits size in the map') for line in f_map: parts = line.rstrip().split() mem_map.append((int(parts[0], 16), int(parts[1], 16), int(parts[2], 16), ' '.join(parts[3:]))) mem_map.sort(key=lambda m : m[0]) mem_map_keys = [m[0] for m in mem_map] with open(path, mode="rb") as f: print >> sys.stderr, "%s: unpacking %s" % (prog_name, path) f.seek(0, 2) size = f.tell() f.seek(0, 0) pcs = struct.unpack_from(TypeCodeForStruct(bits) * (size * 8 / bits), f.read(size)) mem_map_pcs = [[] for i in range(0, len(mem_map))] for pc in pcs: if pc == 0: continue map_idx = bisect.bisect(mem_map_keys, pc) - 1 (start, end, base, module_path) = mem_map[map_idx] assert pc >= start if pc >= end: print >> sys.stderr, "warning: %s: pc %x outside of any known mapping" % (prog_name, pc) continue mem_map_pcs[map_idx].append(pc - base) for ((start, end, base, module_path), pc_list) in zip(mem_map, mem_map_pcs): if len(pc_list) == 0: continue assert path.endswith('.sancov.raw') dst_path = module_path + '.' + os.path.basename(path)[:-4] print >> sys.stderr, "%s: writing %d PCs to %s" % (prog_name, len(pc_list), dst_path) sorted_pc_list = sorted(pc_list) pc_buffer = struct.pack(TypeCodeForStruct(bits) * len(pc_list), *sorted_pc_list) with open(dst_path, 'ab+') as f2: array.array('I', MagicForBits(bits)).tofile(f2) f2.seek(0, 2) f2.write(pc_buffer) def RawUnpack(files): for f in files: if not f.endswith('.sancov.raw'): raise Exception('Unexpected raw file name %s' % f) f_map = f[:-3] + 'map' UnpackOneRawFile(f, f_map) def GetInstrumentedPCs(binary): # This looks scary, but all it does is extract all offsets where we call: # - __sanitizer_cov() or __sanitizer_cov_with_check(), # - with call or callq, # - directly or via PLT. cmd = "objdump -d %s | " \ "grep '^\s\+[0-9a-f]\+:.*\scall\(q\|\)\s\+[0-9a-f]\+ <__sanitizer_cov\(_with_check\|\)\(@plt\|\)>' | " \ "grep '^\s\+[0-9a-f]\+' -o" % binary proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) proc.stdin.close() # The PCs we get from objdump are off by 4 bytes, as they point to the # beginning of the callq instruction. Empirically this is true on x86 and # x86_64. return set(int(line.strip(), 16) + 4 for line in proc.stdout) def PrintMissing(binary): if not os.path.isfile(binary): raise Exception('File not found: %s' % binary) instrumented = GetInstrumentedPCs(binary) print >> sys.stderr, "%s: found %d instrumented PCs in %s" % (prog_name, len(instrumented), binary) covered = set(int(line, 16) for line in sys.stdin) print >> sys.stderr, "%s: read %d PCs from stdin" % (prog_name, len(covered)) missing = instrumented - covered print >> sys.stderr, "%s: %d PCs missing from coverage" % (prog_name, len(missing)) if (len(missing) > len(instrumented) - len(covered)): print >> sys.stderr, \ "%s: WARNING: stdin contains PCs not found in binary" % prog_name for pc in sorted(missing): print "0x%x" % pc if __name__ == '__main__': prog_name = sys.argv[0] if len(sys.argv) <= 2: Usage(); if sys.argv[1] == "missing": if len(sys.argv) != 3: Usage() PrintMissing(sys.argv[2]) exit(0) file_list = [] for f in sys.argv[2:]: file_list += glob.glob(f) if not file_list: Usage() if sys.argv[1] == "print": PrintFiles(file_list) elif sys.argv[1] == "merge": MergeAndPrint(file_list) elif sys.argv[1] == "unpack": Unpack(file_list) elif sys.argv[1] == "rawunpack": RawUnpack(file_list) else: Usage() golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/litlint.py0000775000175000017500000000277112531625732031067 0ustar mwhudsonmwhudson#!/usr/bin/env python # # litlint # # Ensure RUN commands in lit tests are free of common errors. # # If any errors are detected, litlint returns a nonzero exit code. # import optparse import re import sys # Compile regex once for all files runRegex = re.compile(r'(? 0: sys.exit(1) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/gen_dynamic_list.py0000775000175000017500000001023212770244515032710 0ustar mwhudsonmwhudson#!/usr/bin/env python #===- lib/sanitizer_common/scripts/gen_dynamic_list.py ---------------------===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===------------------------------------------------------------------------===# # # Generates the list of functions that should be exported from sanitizer # runtimes. The output format is recognized by --dynamic-list linker option. # Usage: # gen_dynamic_list.py libclang_rt.*san*.a [ files ... ] # #===------------------------------------------------------------------------===# import argparse import os import re import subprocess import sys import platform new_delete = set([ '_Znam', '_ZnamRKSt9nothrow_t', # operator new[](unsigned long) '_Znwm', '_ZnwmRKSt9nothrow_t', # operator new(unsigned long) '_Znaj', '_ZnajRKSt9nothrow_t', # operator new[](unsigned int) '_Znwj', '_ZnwjRKSt9nothrow_t', # operator new(unsigned int) '_ZdaPv', '_ZdaPvRKSt9nothrow_t', # operator delete[](void *) '_ZdlPv', '_ZdlPvRKSt9nothrow_t', # operator delete(void *) '_ZdaPvm', # operator delete[](void*, unsigned long) '_ZdlPvm', # operator delete(void*, unsigned long) '_ZdaPvj', # operator delete[](void*, unsigned int) '_ZdlPvj', # operator delete(void*, unsigned int) ]) versioned_functions = set(['memcpy', 'pthread_attr_getaffinity_np', 'pthread_cond_broadcast', 'pthread_cond_destroy', 'pthread_cond_init', 'pthread_cond_signal', 'pthread_cond_timedwait', 'pthread_cond_wait', 'realpath', 'sched_getaffinity']) def get_global_functions(library): functions = [] nm = os.environ.get('NM', 'nm') nm_proc = subprocess.Popen([nm, library], stdout=subprocess.PIPE, stderr=subprocess.PIPE) nm_out = nm_proc.communicate()[0].decode().split('\n') if nm_proc.returncode != 0: raise subprocess.CalledProcessError(nm_proc.returncode, nm) func_symbols = ['T', 'W'] # On PowerPC, nm prints function descriptors from .data section. if platform.uname()[4] in ["powerpc", "ppc64"]: func_symbols += ['D'] for line in nm_out: cols = line.split(' ') if len(cols) == 3 and cols[1] in func_symbols : functions.append(cols[2]) return functions def main(argv): parser = argparse.ArgumentParser() parser.add_argument('--version-list', action='store_true') parser.add_argument('--extra', default=[], action='append') parser.add_argument('libraries', default=[], nargs='+') args = parser.parse_args() result = [] all_functions = [] for library in args.libraries: all_functions.extend(get_global_functions(library)) function_set = set(all_functions) for func in all_functions: # Export new/delete operators. if func in new_delete: result.append(func) continue # Export interceptors. match = re.match('__interceptor_(.*)', func) if match: result.append(func) # We have to avoid exporting the interceptors for versioned library # functions due to gold internal error. orig_name = match.group(1) if orig_name in function_set and (args.version_list or orig_name not in versioned_functions): result.append(orig_name) continue # Export sanitizer interface functions. if re.match('__sanitizer_(.*)', func): result.append(func) # Additional exported functions from files. for fname in args.extra: f = open(fname, 'r') for line in f: result.append(line.rstrip()) # Print the resulting list in the format recognized by ld. print('{') if args.version_list: print('global:') result.sort() for f in result: print(u' %s;' % f) if args.version_list: print('local:') print(' *;') print('};') if __name__ == '__main__': main(sys.argv) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/check_lint.sh0000775000175000017500000001041612475675502031477 0ustar mwhudsonmwhudson#!/bin/sh SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" # Guess path to LLVM_CHECKOUT if not provided if [ "${LLVM_CHECKOUT}" = "" ]; then LLVM_CHECKOUT="${SCRIPT_DIR}/../../../../../" fi # python tools setup CPPLINT=${SCRIPT_DIR}/cpplint.py LITLINT=${SCRIPT_DIR}/litlint.py if [ "${PYTHON_EXECUTABLE}" != "" ]; then CPPLINT="${PYTHON_EXECUTABLE} ${CPPLINT}" LITLINT="${PYTHON_EXECUTABLE} ${LITLINT}" fi # Filters # TODO: remove some of these filters COMMON_LINT_FILTER=-build/include,-build/header_guard,-legal/copyright,-whitespace/comments,-readability/casting,\ -build/namespaces ASAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/int,-runtime/printf,-runtime/threadsafe_fn ASAN_LIT_TEST_LINT_FILTER=${ASAN_TEST_LINT_FILTER},-whitespace/line_length TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER} TSAN_TEST_LINT_FILTER=${TSAN_RTL_LINT_FILTER},-runtime/threadsafe_fn,-runtime/int TSAN_LIT_TEST_LINT_FILTER=${TSAN_TEST_LINT_FILTER},-whitespace/line_length MSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER} LSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER} LSAN_LIT_TEST_LINT_FILTER=${LSAN_RTL_LINT_FILTER},-whitespace/line_length DFSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int,-runtime/printf,-runtime/references,-readability/function COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int,-runtime/sizeof,-runtime/printf,-readability/fn_size SANITIZER_INCLUDES_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int MKTEMP_DIR=$(mktemp -qd /tmp/check_lint.XXXXXXXXXX) MKTEMP="mktemp -q ${MKTEMP_DIR}/tmp.XXXXXXXXXX" cleanup() { rm -rf $MKTEMP_DIR } trap cleanup EXIT cd ${LLVM_CHECKOUT} EXITSTATUS=0 ERROR_LOG=$(${MKTEMP}) run_lint() { FILTER=$1 shift TASK_LOG=$(${MKTEMP}) ${CPPLINT} --filter=${FILTER} "$@" 2>$TASK_LOG if [ "$?" != "0" ]; then cat $TASK_LOG | grep -v "Done processing" | grep -v "Total errors found" \ | grep -v "Skipping input" >> $ERROR_LOG fi if [ "${SILENT}" != "1" ]; then cat $TASK_LOG fi ${LITLINT} "$@" 2>>$ERROR_LOG } if [ "${COMPILER_RT}" = "" ]; then COMPILER_RT=projects/compiler-rt fi LIT_TESTS=${COMPILER_RT}/test # Headers SANITIZER_INCLUDES=${COMPILER_RT}/include/sanitizer run_lint ${SANITIZER_INCLUDES_LINT_FILTER} ${SANITIZER_INCLUDES}/*.h & # Sanitizer_common COMMON_RTL=${COMPILER_RT}/lib/sanitizer_common run_lint ${COMMON_RTL_INC_LINT_FILTER} ${COMMON_RTL}/*.cc \ ${COMMON_RTL}/*.h \ ${COMMON_RTL}/tests/*.cc & # Interception INTERCEPTION=${COMPILER_RT}/lib/interception run_lint ${ASAN_RTL_LINT_FILTER} ${INTERCEPTION}/*.cc \ ${INTERCEPTION}/*.h & # ASan ASAN_RTL=${COMPILER_RT}/lib/asan run_lint ${ASAN_RTL_LINT_FILTER} ${ASAN_RTL}/*.cc \ ${ASAN_RTL}/*.h & run_lint ${ASAN_TEST_LINT_FILTER} ${ASAN_RTL}/tests/*.cc \ ${ASAN_RTL}/tests/*.h & run_lint ${ASAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/asan/*/*.cc & # TSan TSAN_RTL=${COMPILER_RT}/lib/tsan run_lint ${TSAN_RTL_LINT_FILTER} ${TSAN_RTL}/rtl/*.cc \ ${TSAN_RTL}/rtl/*.h & run_lint ${TSAN_TEST_LINT_FILTER} ${TSAN_RTL}/tests/rtl/*.cc \ ${TSAN_RTL}/tests/rtl/*.h \ ${TSAN_RTL}/tests/unit/*.cc & run_lint ${TSAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/tsan/*.cc & # MSan MSAN_RTL=${COMPILER_RT}/lib/msan run_lint ${MSAN_RTL_LINT_FILTER} ${MSAN_RTL}/*.cc \ ${MSAN_RTL}/*.h & # LSan LSAN_RTL=${COMPILER_RT}/lib/lsan run_lint ${LSAN_RTL_LINT_FILTER} ${LSAN_RTL}/*.cc \ ${LSAN_RTL}/*.h & run_lint ${LSAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/lsan/*/*.cc & # DFSan DFSAN_RTL=${COMPILER_RT}/lib/dfsan run_lint ${DFSAN_RTL_LINT_FILTER} ${DFSAN_RTL}/*.cc \ ${DFSAN_RTL}/*.h & ${DFSAN_RTL}/scripts/check_custom_wrappers.sh >> $ERROR_LOG # Misc files FILES=${COMMON_RTL}/*.inc TMPFILES="" for FILE in $FILES; do TMPFILE="$(${MKTEMP}).$(basename ${FILE}).cc" cp -f $FILE $TMPFILE run_lint ${COMMON_RTL_INC_LINT_FILTER} $TMPFILE & TMPFILES="$TMPFILES $TMPFILE" done wait for temp in $TMPFILES; do rm -f $temp done if [ -s $ERROR_LOG ]; then cat $ERROR_LOG exit 1 fi exit 0 golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/cpplint.py0000775000175000017500000046627412531625732031075 0ustar mwhudsonmwhudson#!/usr/bin/env python # # Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * 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. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT # OWNER 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. # Here are some issues that I've had people identify in my code during reviews, # that I think are possible to flag automatically in a lint tool. If these were # caught by lint, it would save time both for myself and that of my reviewers. # Most likely, some of these are beyond the scope of the current lint framework, # but I think it is valuable to retain these wish-list items even if they cannot # be immediately implemented. # # Suggestions # ----------- # - Check for no 'explicit' for multi-arg ctor # - Check for boolean assign RHS in parens # - Check for ctor initializer-list colon position and spacing # - Check that if there's a ctor, there should be a dtor # - Check accessors that return non-pointer member variables are # declared const # - Check accessors that return non-const pointer member vars are # *not* declared const # - Check for using public includes for testing # - Check for spaces between brackets in one-line inline method # - Check for no assert() # - Check for spaces surrounding operators # - Check for 0 in pointer context (should be NULL) # - Check for 0 in char context (should be '\0') # - Check for camel-case method name conventions for methods # that are not simple inline getters and setters # - Do not indent namespace contents # - Avoid inlining non-trivial constructors in header files # - Check for old-school (void) cast for call-sites of functions # ignored return value # - Check gUnit usage of anonymous namespace # - Check for class declaration order (typedefs, consts, enums, # ctor(s?), dtor, friend declarations, methods, member vars) # """Does google-lint on c++ files. The goal of this script is to identify places in the code that *may* be in non-compliance with google style. It does not attempt to fix up these problems -- the point is to educate. It does also not attempt to find all problems, or to ensure that everything it does find is legitimately a problem. In particular, we can get very confused by /* and // inside strings! We do a small hack, which is to ignore //'s with "'s after them on the same line, but it is far from perfect (in either direction). """ import codecs import copy import getopt import math # for log import os import re import sre_compile import string import sys import unicodedata _USAGE = """ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...] [--counting=total|toplevel|detailed] [file] ... The style guidelines this tries to follow are those in http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml Every problem is given a confidence score from 1-5, with 5 meaning we are certain of the problem, and 1 meaning it could be a legitimate construct. This will miss some errors, and is not a substitute for a code review. To suppress false-positive errors of a certain category, add a 'NOLINT(category)' comment to the line. NOLINT or NOLINT(*) suppresses errors of all categories on that line. The files passed in will be linted; at least one file must be provided. Linted extensions are .cc, .cpp, and .h. Other file types will be ignored. Flags: output=vs7 By default, the output is formatted to ease emacs parsing. Visual Studio compatible output (vs7) may also be used. Other formats are unsupported. verbose=# Specify a number 0-5 to restrict errors to certain verbosity levels. filter=-x,+y,... Specify a comma-separated list of category-filters to apply: only error messages whose category names pass the filters will be printed. (Category names are printed with the message and look like "[whitespace/indent]".) Filters are evaluated left to right. "-FOO" and "FOO" means "do not print categories that start with FOO". "+FOO" means "do print categories that start with FOO". Examples: --filter=-whitespace,+whitespace/braces --filter=whitespace,runtime/printf,+runtime/printf_format --filter=-,+build/include_what_you_use To see a list of all the categories used in cpplint, pass no arg: --filter= counting=total|toplevel|detailed The total number of errors found is always printed. If 'toplevel' is provided, then the count of errors in each of the top-level categories like 'build' and 'whitespace' will also be printed. If 'detailed' is provided, then a count is provided for each category like 'build/class'. root=subdir The root directory used for deriving header guard CPP variable. By default, the header guard CPP variable is calculated as the relative path to the directory that contains .git, .hg, or .svn. When this flag is specified, the relative path is calculated from the specified directory. If the specified directory does not exist, this flag is ignored. Examples: Assuing that src/.git exists, the header guard CPP variables for src/chrome/browser/ui/browser.h are: No flag => CHROME_BROWSER_UI_BROWSER_H_ --root=chrome => BROWSER_UI_BROWSER_H_ --root=chrome/browser => UI_BROWSER_H_ """ # We categorize each error message we print. Here are the categories. # We want an explicit list so we can list them all in cpplint --filter=. # If you add a new error message with a new category, add it to the list # here! cpplint_unittest.py should tell you if you forget to do this. # \ used for clearer layout -- pylint: disable-msg=C6013 _ERROR_CATEGORIES = [ 'build/class', 'build/deprecated', 'build/endif_comment', 'build/explicit_make_pair', 'build/forward_decl', 'build/header_guard', 'build/include', 'build/include_alpha', 'build/include_order', 'build/include_what_you_use', 'build/namespaces', 'build/printf_format', 'build/storage_class', 'legal/copyright', 'readability/alt_tokens', 'readability/braces', 'readability/casting', 'readability/check', 'readability/constructors', 'readability/fn_size', 'readability/function', 'readability/multiline_comment', 'readability/multiline_string', 'readability/namespace', 'readability/nolint', 'readability/streams', 'readability/todo', 'readability/utf8', 'runtime/arrays', 'runtime/casting', 'runtime/explicit', 'runtime/int', 'runtime/init', 'runtime/invalid_increment', 'runtime/member_string_references', 'runtime/memset', 'runtime/operator', 'runtime/printf', 'runtime/printf_format', 'runtime/references', 'runtime/rtti', 'runtime/sizeof', 'runtime/string', 'runtime/threadsafe_fn', 'whitespace/blank_line', 'whitespace/braces', 'whitespace/comma', 'whitespace/comments', 'whitespace/empty_loop_body', 'whitespace/end_of_line', 'whitespace/ending_newline', 'whitespace/forcolon', 'whitespace/indent', 'whitespace/labels', 'whitespace/line_length', 'whitespace/newline', 'whitespace/operators', 'whitespace/parens', 'whitespace/semicolon', 'whitespace/tab', 'whitespace/todo' ] # The default state of the category filter. This is overrided by the --filter= # flag. By default all errors are on, so only add here categories that should be # off by default (i.e., categories that must be enabled by the --filter= flags). # All entries here should start with a '-' or '+', as in the --filter= flag. _DEFAULT_FILTERS = ['-build/include_alpha'] # We used to check for high-bit characters, but after much discussion we # decided those were OK, as long as they were in UTF-8 and didn't represent # hard-coded international strings, which belong in a separate i18n file. # Headers that we consider STL headers. _STL_HEADERS = frozenset([ 'algobase.h', 'algorithm', 'alloc.h', 'bitset', 'deque', 'exception', 'function.h', 'functional', 'hash_map', 'hash_map.h', 'hash_set', 'hash_set.h', 'iterator', 'list', 'list.h', 'map', 'memory', 'new', 'pair.h', 'pthread_alloc', 'queue', 'set', 'set.h', 'sstream', 'stack', 'stl_alloc.h', 'stl_relops.h', 'type_traits.h', 'utility', 'vector', 'vector.h', ]) # Non-STL C++ system headers. _CPP_HEADERS = frozenset([ 'algo.h', 'builtinbuf.h', 'bvector.h', 'cassert', 'cctype', 'cerrno', 'cfloat', 'ciso646', 'climits', 'clocale', 'cmath', 'complex', 'complex.h', 'csetjmp', 'csignal', 'cstdarg', 'cstddef', 'cstdio', 'cstdlib', 'cstring', 'ctime', 'cwchar', 'cwctype', 'defalloc.h', 'deque.h', 'editbuf.h', 'exception', 'fstream', 'fstream.h', 'hashtable.h', 'heap.h', 'indstream.h', 'iomanip', 'iomanip.h', 'ios', 'iosfwd', 'iostream', 'iostream.h', 'istream', 'istream.h', 'iterator.h', 'limits', 'map.h', 'multimap.h', 'multiset.h', 'numeric', 'ostream', 'ostream.h', 'parsestream.h', 'pfstream.h', 'PlotFile.h', 'procbuf.h', 'pthread_alloc.h', 'rope', 'rope.h', 'ropeimpl.h', 'SFile.h', 'slist', 'slist.h', 'stack.h', 'stdexcept', 'stdiostream.h', 'streambuf', 'streambuf.h', 'stream.h', 'strfile.h', 'string', 'strstream', 'strstream.h', 'tempbuf.h', 'tree.h', 'typeinfo', 'valarray', ]) # Assertion macros. These are defined in base/logging.h and # testing/base/gunit.h. Note that the _M versions need to come first # for substring matching to work. _CHECK_MACROS = [ 'DCHECK', 'CHECK', 'EXPECT_TRUE_M', 'EXPECT_TRUE', 'ASSERT_TRUE_M', 'ASSERT_TRUE', 'EXPECT_FALSE_M', 'EXPECT_FALSE', 'ASSERT_FALSE_M', 'ASSERT_FALSE', ] # Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE _CHECK_REPLACEMENT = dict([(m, {}) for m in _CHECK_MACROS]) for op, replacement in [('==', 'EQ'), ('!=', 'NE'), ('>=', 'GE'), ('>', 'GT'), ('<=', 'LE'), ('<', 'LT')]: _CHECK_REPLACEMENT['DCHECK'][op] = 'DCHECK_%s' % replacement _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % replacement _CHECK_REPLACEMENT['EXPECT_TRUE_M'][op] = 'EXPECT_%s_M' % replacement _CHECK_REPLACEMENT['ASSERT_TRUE_M'][op] = 'ASSERT_%s_M' % replacement for op, inv_replacement in [('==', 'NE'), ('!=', 'EQ'), ('>=', 'LT'), ('>', 'LE'), ('<=', 'GT'), ('<', 'GE')]: _CHECK_REPLACEMENT['EXPECT_FALSE'][op] = 'EXPECT_%s' % inv_replacement _CHECK_REPLACEMENT['ASSERT_FALSE'][op] = 'ASSERT_%s' % inv_replacement _CHECK_REPLACEMENT['EXPECT_FALSE_M'][op] = 'EXPECT_%s_M' % inv_replacement _CHECK_REPLACEMENT['ASSERT_FALSE_M'][op] = 'ASSERT_%s_M' % inv_replacement # Alternative tokens and their replacements. For full list, see section 2.5 # Alternative tokens [lex.digraph] in the C++ standard. # # Digraphs (such as '%:') are not included here since it's a mess to # match those on a word boundary. _ALT_TOKEN_REPLACEMENT = { 'and': '&&', 'bitor': '|', 'or': '||', 'xor': '^', 'compl': '~', 'bitand': '&', 'and_eq': '&=', 'or_eq': '|=', 'xor_eq': '^=', 'not': '!', 'not_eq': '!=' } # Compile regular expression that matches all the above keywords. The "[ =()]" # bit is meant to avoid matching these keywords outside of boolean expressions. # # False positives include C-style multi-line comments (http://go/nsiut ) # and multi-line strings (http://go/beujw ), but those have always been # troublesome for cpplint. _ALT_TOKEN_REPLACEMENT_PATTERN = re.compile( r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)') # These constants define types of headers for use with # _IncludeState.CheckNextIncludeOrder(). _C_SYS_HEADER = 1 _CPP_SYS_HEADER = 2 _LIKELY_MY_HEADER = 3 _POSSIBLE_MY_HEADER = 4 _OTHER_HEADER = 5 # These constants define the current inline assembly state _NO_ASM = 0 # Outside of inline assembly block _INSIDE_ASM = 1 # Inside inline assembly block _END_ASM = 2 # Last line of inline assembly block _BLOCK_ASM = 3 # The whole block is an inline assembly block # Match start of assembly blocks _MATCH_ASM = re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)' r'(?:\s+(volatile|__volatile__))?' r'\s*[{(]') _regexp_compile_cache = {} # Finds occurrences of NOLINT or NOLINT(...). _RE_SUPPRESSION = re.compile(r'\bNOLINT\b(\([^)]*\))?') # {str, set(int)}: a map from error categories to sets of linenumbers # on which those errors are expected and should be suppressed. _error_suppressions = {} # The root directory used for deriving header guard CPP variable. # This is set by --root flag. _root = None def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. linenum: int, the number of the current line. error: function, an error handler. """ # FIXME(adonovan): "NOLINT(" is misparsed as NOLINT(*). matched = _RE_SUPPRESSION.search(raw_line) if matched: category = matched.group(1) if category in (None, '(*)'): # => "suppress all" _error_suppressions.setdefault(None, set()).add(linenum) else: if category.startswith('(') and category.endswith(')'): category = category[1:-1] if category in _ERROR_CATEGORIES: _error_suppressions.setdefault(category, set()).add(linenum) else: error(filename, linenum, 'readability/nolint', 5, 'Unknown NOLINT error category: %s' % category) def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear() def IsErrorSuppressedByNolint(category, linenum): """Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: bool, True iff the error should be suppressed due to a NOLINT comment. """ return (linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set())) def Match(pattern, s): """Matches the string with the pattern, caching the compiled regexp.""" # The regexp compilation caching is inlined in both Match and Search for # performance reasons; factoring it out into a separate function turns out # to be noticeably expensive. if not pattern in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].match(s) def Search(pattern, s): """Searches the string for the pattern, caching the compiled regexp.""" if not pattern in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].search(s) class _IncludeState(dict): """Tracks line numbers for includes, and the order in which includes appear. As a dict, an _IncludeState object serves as a mapping between include filename and line number on which that file was included. Call CheckNextIncludeOrder() once for each header in the file, passing in the type constants defined above. Calls in an illegal order will raise an _IncludeError with an appropriate error message. """ # self._section will move monotonically through this set. If it ever # needs to move backwards, CheckNextIncludeOrder will raise an error. _INITIAL_SECTION = 0 _MY_H_SECTION = 1 _C_SECTION = 2 _CPP_SECTION = 3 _OTHER_H_SECTION = 4 _TYPE_NAMES = { _C_SYS_HEADER: 'C system header', _CPP_SYS_HEADER: 'C++ system header', _LIKELY_MY_HEADER: 'header this file implements', _POSSIBLE_MY_HEADER: 'header this file may implement', _OTHER_HEADER: 'other header', } _SECTION_NAMES = { _INITIAL_SECTION: "... nothing. (This can't be an error.)", _MY_H_SECTION: 'a header this file implements', _C_SECTION: 'C system header', _CPP_SECTION: 'C++ system header', _OTHER_H_SECTION: 'other header', } def __init__(self): dict.__init__(self) # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' def CanonicalizeAlphabeticalOrder(self, header_path): """Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Returns: Canonicalized path. """ return header_path.replace('-inl.h', '.h').replace('-', '_').lower() def IsInAlphabeticalOrder(self, header_path): """Check if a header is in alphabetical order with the previous header. Args: header_path: Header to be checked. Returns: Returns true if the header is in alphabetical order. """ canonical_header = self.CanonicalizeAlphabeticalOrder(header_path) if self._last_header > canonical_header: return False self._last_header = canonical_header return True def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or an error message describing what's wrong. """ error_message = ('Found %s after %s' % (self._TYPE_NAMES[header_type], self._SECTION_NAMES[self._section])) last_section = self._section if header_type == _C_SYS_HEADER: if self._section <= self._C_SECTION: self._section = self._C_SECTION else: self._last_header = '' return error_message elif header_type == _CPP_SYS_HEADER: if self._section <= self._CPP_SECTION: self._section = self._CPP_SECTION else: self._last_header = '' return error_message elif header_type == _LIKELY_MY_HEADER: if self._section <= self._MY_H_SECTION: self._section = self._MY_H_SECTION else: self._section = self._OTHER_H_SECTION elif header_type == _POSSIBLE_MY_HEADER: if self._section <= self._MY_H_SECTION: self._section = self._MY_H_SECTION else: # This will always be the fallback because we're not sure # enough that the header is associated with this file. self._section = self._OTHER_H_SECTION else: assert header_type == _OTHER_HEADER self._section = self._OTHER_H_SECTION if last_section != self._section: self._last_header = '' return '' class _CppLintState(object): """Maintains module-wide state..""" def __init__(self): self.verbose_level = 1 # global setting. self.error_count = 0 # global count of reported errors # filters to apply when emitting error messages self.filters = _DEFAULT_FILTERS[:] self.counting = 'total' # In what way are we counting errors? self.errors_by_category = {} # string to int dict storing error counts # output format: # "emacs" - format that emacs can parse (default) # "vs7" - format that Microsoft Visual Studio 7 can parse self.output_format = 'emacs' def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format def SetVerboseLevel(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level self.verbose_level = level return last_verbose_level def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style def SetFilters(self, filters): """Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Raises: ValueError: The comma-separated filters did not all start with '+' or '-'. E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" """ # Default filters always have less priority than the flag ones. self.filters = _DEFAULT_FILTERS[:] for filt in filters.split(','): clean_filt = filt.strip() if clean_filt: self.filters.append(clean_filt) for filt in self.filters: if not (filt.startswith('+') or filt.startswith('-')): raise ValueError('Every filter in --filters must start with + or -' ' (%s does not)' % filt) def ResetErrorCounts(self): """Sets the module's error statistic back to zero.""" self.error_count = 0 self.errors_by_category = {} def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_category[category] = 0 self.errors_by_category[category] += 1 def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in self.errors_by_category.iteritems(): sys.stderr.write('Category \'%s\' errors found: %d\n' % (category, count)) sys.stderr.write('Total errors found: %d\n' % self.error_count) _cpplint_state = _CppLintState() def _OutputFormat(): """Gets the module's output format.""" return _cpplint_state.output_format def _SetOutputFormat(output_format): """Sets the module's output format.""" _cpplint_state.SetOutputFormat(output_format) def _VerboseLevel(): """Returns the module's verbosity setting.""" return _cpplint_state.verbose_level def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level) def _SetCountingStyle(level): """Sets the module's counting options.""" _cpplint_state.SetCountingStyle(level) def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters def _SetFilters(filters): """Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint_state.SetFilters(filters) class _FunctionState(object): """Tracks current function name and the number of lines in its body.""" _NORMAL_TRIGGER = 250 # for --v=0, 500 for --v=1, etc. _TEST_TRIGGER = 400 # about 50% more than _NORMAL_TRIGGER. def __init__(self): self.in_a_function = False self.lines_in_function = 0 self.current_function = '' def Begin(self, function_name): """Start analyzing function body. Args: function_name: The name of the function being tracked. """ self.in_a_function = True self.lines_in_function = 0 self.current_function = function_name def Count(self): """Count line in current function body.""" if self.in_a_function: self.lines_in_function += 1 def Check(self, error, filename, linenum): """Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check. """ if Match(r'T(EST|est)', self.current_function): base_trigger = self._TEST_TRIGGER else: base_trigger = self._NORMAL_TRIGGER trigger = base_trigger * 2**_VerboseLevel() if self.lines_in_function > trigger: error_level = int(math.log(self.lines_in_function / base_trigger, 2)) # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ... if error_level > 5: error_level = 5 error(filename, linenum, 'readability/fn_size', error_level, 'Small and focused functions are preferred:' ' %s has %d non-comment lines' ' (error triggered by exceeding %d lines).' % ( self.current_function, self.lines_in_function, trigger)) def End(self): """Stop analyzing function body.""" self.in_a_function = False class _IncludeError(Exception): """Indicates a problem with the include order in a file.""" pass class FileInfo: """Provides utility functions for filenames. FileInfo provides easy access to the components of a file's path relative to the project root. """ def __init__(self, filename): self._filename = filename def FullName(self): """Make Windows paths like Unix.""" return os.path.abspath(self._filename).replace('\\', '/') def RepositoryName(self): """FullName after removing the local path to the repository. If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things like "C:\Documents and Settings\..." or "/home/username/..." in them and thus people on different computers who have checked the source out to different locations won't see bogus errors. """ fullname = self.FullName() if os.path.exists(fullname): project_dir = os.path.dirname(fullname) if os.path.exists(os.path.join(project_dir, ".svn")): # If there's a .svn file in the current directory, we recursively look # up the directory tree for the top of the SVN checkout root_dir = project_dir one_up_dir = os.path.dirname(root_dir) while os.path.exists(os.path.join(one_up_dir, ".svn")): root_dir = os.path.dirname(root_dir) one_up_dir = os.path.dirname(one_up_dir) prefix = os.path.commonprefix([root_dir, project_dir]) return fullname[len(prefix) + 1:] # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by # searching up from the current path. root_dir = os.path.dirname(fullname) while (root_dir != os.path.dirname(root_dir) and not os.path.exists(os.path.join(root_dir, ".git")) and not os.path.exists(os.path.join(root_dir, ".hg")) and not os.path.exists(os.path.join(root_dir, ".svn"))): root_dir = os.path.dirname(root_dir) if (os.path.exists(os.path.join(root_dir, ".git")) or os.path.exists(os.path.join(root_dir, ".hg")) or os.path.exists(os.path.join(root_dir, ".svn"))): prefix = os.path.commonprefix([root_dir, project_dir]) return fullname[len(prefix) + 1:] # Don't know what to do; header guard warnings may be wrong... return fullname def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os.path.split(googlename) return (project,) + os.path.splitext(rest) def BaseName(self): """File base name - text after the final slash, before the final period.""" return self.Split()[1] def Extension(self): """File extension - text following the final period.""" return self.Split()[2] def NoExtension(self): """File has no source file extension.""" return '/'.join(self.Split()[0:2]) def IsSource(self): """File has a source file extension.""" return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters filter it out. if IsErrorSuppressedByNolint(category, linenum): return False if confidence < _cpplint_state.verbose_level: return False is_filtered = False for one_filter in _Filters(): if one_filter.startswith('-'): if category.startswith(one_filter[1:]): is_filtered = True elif one_filter.startswith('+'): if category.startswith(one_filter[1:]): is_filtered = False else: assert False # should have been checked for in SetFilter. if is_filtered: return False return True def Error(filename, linenum, category, confidence, message): """Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. False positives can be suppressed by the use of "cpplint(category)" comments on the offending line. These are parsed into _error_suppressions. Args: filename: The name of the file containing the error. linenum: The number of the line containing the error. category: A string used to describe the "category" this bug falls under: "whitespace", say, or "runtime". Categories may have a hierarchy separated by slashes: "whitespace/indent". confidence: A number from 1-5 representing a confidence score for the error, with 5 meaning that we are certain of the problem, and 1 meaning that it could be a legitimate construct. message: The error message. """ if _ShouldPrintError(category, confidence, linenum): _cpplint_state.IncrementErrorCount(category) if _cpplint_state.output_format == 'vs7': sys.stderr.write('%s(%s): %s [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) elif _cpplint_state.output_format == 'eclipse': sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) else: sys.stderr.write('%s:%s: %s [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) # Matches standard C++ escape esequences per 2.13.2.3 of the C++ standard. _RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile( r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)') # Matches strings. Escape codes should already be removed by ESCAPES. _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES = re.compile(r'"[^"]*"') # Matches characters. Escape codes should already be removed by ESCAPES. _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'.'") # Matches multi-line C++ comments. # This RE is a little bit more complicated than one might expect, because we # have to take care of space removals tools so we can handle comments inside # statements better. # The current rule is: We only clear spaces from both sides when we're at the # end of the line. Otherwise, we try to remove spaces from the right side, # if this doesn't work we try on left side but only if there's a non-character # on the right. _RE_PATTERN_CLEANSE_LINE_C_COMMENTS = re.compile( r"""(\s*/\*.*\*/\s*$| /\*.*\*/\s+| \s+/\*.*\*/(?=\W)| /\*.*\*/)""", re.VERBOSE) def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant. """ line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return lineix lineix += 1 return len(lines) def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines) def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // dummy comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '// dummy' def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) if lineix_end >= len(lines): error(filename, lineix_begin + 1, 'readability/multiline_comment', 5, 'Could not find end of multi-line comment') return RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) lineix = lineix_end + 1 def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos].rstrip() # get rid of /* ... */ return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) class CleansedLines(object): """Holds 3 copies of all lines with different preprocessing applied to them. 1) elided member contains lines without strings and comments, 2) lines member contains lines without comments, and 3) raw_lines member contains all the lines without processing. All these three members are of , and of the same length. """ def __init__(self, lines): self.elided = [] self.lines = [] self.raw_lines = lines self.num_lines = len(lines) for linenum in range(len(lines)): self.lines.append(CleanseComments(lines[linenum])) elided = self._CollapseStrings(lines[linenum]) self.elided.append(CleanseComments(elided)) def NumLines(self): """Returns the number of lines represented.""" return self.num_lines @staticmethod def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if not _RE_PATTERN_INCLUDE.match(elided): # Remove escaped characters first to make quote/single quote collapsing # basic. Things that look like escaped characters shouldn't occur # outside of strings and chars. elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided) elided = _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES.sub("''", elided) elided = _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES.sub('""', elided) return elided def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar): """Find the position just after the matching endchar. Args: line: a CleansedLines line. startpos: start searching at this position. depth: nesting level at startpos. startchar: expression opening character. endchar: expression closing character. Returns: Index just after endchar. """ for i in xrange(startpos, len(line)): if line[i] == startchar: depth += 1 elif line[i] == endchar: depth -= 1 if depth == 0: return i + 1 return -1 def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[', finds the linenum/pos that correspond to the closing of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: A position on the line. Returns: A tuple (line, linenum, pos) pointer *past* the closing brace, or (line, len(lines), -1) if we never find a close. Note we ignore strings and comments when matching; and the line we return is the 'cleansed' line at linenum. """ line = clean_lines.elided[linenum] startchar = line[pos] if startchar not in '({[': return (line, clean_lines.NumLines(), -1) if startchar == '(': endchar = ')' if startchar == '[': endchar = ']' if startchar == '{': endchar = '}' # Check first line end_pos = FindEndOfExpressionInLine(line, pos, 0, startchar, endchar) if end_pos > -1: return (line, linenum, end_pos) tail = line[pos:] num_open = tail.count(startchar) - tail.count(endchar) while linenum < clean_lines.NumLines() - 1: linenum += 1 line = clean_lines.elided[linenum] delta = line.count(startchar) - line.count(endchar) if num_open + delta <= 0: return (line, linenum, FindEndOfExpressionInLine(line, 0, num_open, startchar, endchar)) num_open += delta # Did not find endchar before end of file, give up return (line, clean_lines.NumLines(), -1) def CheckForCopyright(filename, lines, error): """Logs an error if no Copyright message appears at the top of the file.""" # We'll say it should occur by line 10. Don't forget there's a # dummy line at the front. for line in xrange(1, min(len(lines), 11)): if re.search(r'Copyright', lines[line], re.I): break else: # means no copyright line was found error(filename, 0, 'legal/copyright', 5, 'No copyright message found. ' 'You should have a line: "Copyright [year] "') def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is invoked from Emacs's # flymake. filename = re.sub(r'_flymake\.h$', '.h', filename) filename = re.sub(r'/\.flymake/([^/]*)$', r'/\1', filename) fileinfo = FileInfo(filename) file_path_from_root = fileinfo.RepositoryName() if _root: file_path_from_root = re.sub('^' + _root + os.sep, '', file_path_from_root) return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' def CheckForHeaderGuard(filename, lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ cppvar = GetHeaderGuardCPPVariable(filename) ifndef = None ifndef_linenum = 0 define = None endif = None endif_linenum = 0 for linenum, line in enumerate(lines): linesplit = line.split() if len(linesplit) >= 2: # find the first occurrence of #ifndef and #define, save arg if not ifndef and linesplit[0] == '#ifndef': # set ifndef to the header guard presented on the #ifndef line. ifndef = linesplit[1] ifndef_linenum = linenum if not define and linesplit[0] == '#define': define = linesplit[1] # find the last occurrence of #endif, save entire line if line.startswith('#endif'): endif = line endif_linenum = linenum if not ifndef: error(filename, 0, 'build/header_guard', 5, 'No #ifndef header guard found, suggested CPP variable is: %s' % cppvar) return if not define: error(filename, 0, 'build/header_guard', 5, 'No #define header guard found, suggested CPP variable is: %s' % cppvar) return # The guard should be PATH_FILE_H_, but we also allow PATH_FILE_H__ # for backward compatibility. if ifndef != cppvar: error_level = 0 if ifndef != cppvar + '_': error_level = 5 ParseNolintSuppressions(filename, lines[ifndef_linenum], ifndef_linenum, error) error(filename, ifndef_linenum, 'build/header_guard', error_level, '#ifndef header guard has wrong style, please use: %s' % cppvar) if define != ifndef: error(filename, 0, 'build/header_guard', 5, '#ifndef and #define don\'t match, suggested CPP variable is: %s' % cppvar) return if endif != ('#endif // %s' % cppvar): error_level = 0 if endif != ('#endif // %s' % (cppvar + '_')): error_level = 5 ParseNolintSuppressions(filename, lines[endif_linenum], endif_linenum, error) error(filename, endif_linenum, 'build/header_guard', error_level, '#endif line should be "#endif // %s"' % cppvar) def CheckForUnicodeReplacementCharacters(filename, lines, error): """Logs an error for each line containing Unicode replacement characters. These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if the invalid UTF-8 occurred adjacent to a newline. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ for linenum, line in enumerate(lines): if u'\ufffd' in line: error(filename, linenum, 'readability/utf8', 5, 'Line contains invalid UTF-8 (or Unicode replacement character).') def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array lines() was created by adding two newlines to the # original file (go figure), then splitting on \n. # To verify that the file ends in \n, we just have to make sure the # last-but-two element of lines() exists and is empty. if len(lines) < 3 or lines[-2]: error(filename, len(lines) - 2, 'whitespace/ending_newline', 5, 'Could not find a newline character at the end of the file.') def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): """Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings to extend across multiple lines, as long as a line continuation character (backslash) terminates each line. Although not currently prohibited by the C++ style guide, it's ugly and unnecessary. We don't do well with either in this lint program, so we warn about both. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] # Remove all \\ (escaped backslashes) from the line. They are OK, and the # second (escaped) slash may trigger later \" detection erroneously. line = line.replace('\\\\', '') if line.count('/*') > line.count('*/'): error(filename, linenum, 'readability/multiline_comment', 5, 'Complex multi-line /*...*/-style comment found. ' 'Lint may give bogus warnings. ' 'Consider replacing these with //-style comments, ' 'with #if 0...#endif, ' 'or with more clearly structured multi-line comments.') if (line.count('"') - line.count('\\"')) % 2: error(filename, linenum, 'readability/multiline_string', 5, 'Multi-line string ("...") found. This lint script doesn\'t ' 'do well with such strings, and may give bogus warnings. They\'re ' 'ugly and unnecessary, and you should use concatenation instead".') threading_list = ( ('asctime(', 'asctime_r('), ('ctime(', 'ctime_r('), ('getgrgid(', 'getgrgid_r('), ('getgrnam(', 'getgrnam_r('), ('getlogin(', 'getlogin_r('), ('getpwnam(', 'getpwnam_r('), ('getpwuid(', 'getpwuid_r('), ('gmtime(', 'gmtime_r('), ('localtime(', 'localtime_r('), ('rand(', 'rand_r('), ('readdir(', 'readdir_r('), ('strtok(', 'strtok_r('), ('ttyname(', 'ttyname_r('), ) def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when using posix directly). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] for single_thread_function, multithread_safe_function in threading_list: ix = line.find(single_thread_function) # Comparisons made explicit for clarity -- pylint: disable-msg=C6403 if ix >= 0 and (ix == 0 or (not line[ix - 1].isalnum() and line[ix - 1] not in ('_', '.', '>'))): error(filename, linenum, 'runtime/threadsafe_fn', 2, 'Consider using ' + multithread_safe_function + '...) instead of ' + single_thread_function + '...) for improved thread safety.') # Matches invalid increment: *count++, which moves pointer instead of # incrementing a value. _RE_PATTERN_INVALID_INCREMENT = re.compile( r'^\s*\*\w+(\+\+|--);') def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] if _RE_PATTERN_INVALID_INCREMENT.match(line): error(filename, linenum, 'runtime/invalid_increment', 5, 'Changing pointer instead of value (or unused value of operator*).') class _BlockInfo(object): """Stores information about a generic block of code.""" def __init__(self, seen_open_brace): self.seen_open_brace = seen_open_brace self.open_parentheses = 0 self.inline_asm = _NO_ASM def CheckBegin(self, filename, clean_lines, linenum, error): """Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pass. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ pass def CheckEnd(self, filename, clean_lines, linenum, error): """Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ pass class _ClassInfo(_BlockInfo): """Stores information about a class.""" def __init__(self, name, class_or_struct, clean_lines, linenum): _BlockInfo.__init__(self, False) self.name = name self.starting_linenum = linenum self.is_derived = False if class_or_struct == 'struct': self.access = 'public' else: self.access = 'private' # Try to find the end of the class. This will be confused by things like: # class A { # } *x = { ... # # But it's still good enough for CheckSectionSpacing. self.last_line = 0 depth = 0 for i in range(linenum, clean_lines.NumLines()): line = clean_lines.elided[i] depth += line.count('{') - line.count('}') if not depth: self.last_line = i break def CheckBegin(self, filename, clean_lines, linenum, error): # Look for a bare ':' if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]): self.is_derived = True class _NamespaceInfo(_BlockInfo): """Stores information about a namespace.""" def __init__(self, name, linenum): _BlockInfo.__init__(self, False) self.name = name or '' self.starting_linenum = linenum def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply checks if there is already an end of # namespace comment and it's incorrect. # # TODO(unknown): We always want to check end of namespace comments # if a namespace is large, but sometimes we also want to apply the # check if a short namespace contained nontrivial things (something # other than forward declarations). There is currently no logic on # deciding what these nontrivial things are, so this check is # triggered by namespace size only, which works most of the time. if (linenum - self.starting_linenum < 10 and not Match(r'};*\s*(//|/\*).*\bnamespace\b', line)): return # Look for matching comment at end of namespace. # # Note that we accept C style "/* */" comments for terminating # namespaces, so that code that terminate namespaces inside # preprocessor macros can be cpplint clean. Example: http://go/nxpiz # # We also accept stuff like "// end of namespace ." with the # period at the end. # # Besides these, we don't accept anything else, otherwise we might # get false negatives when existing comment is a substring of the # expected namespace. Example: http://go/ldkdc, http://cl/23548205 if self.name: # Named namespace if not Match((r'};*\s*(//|/\*).*\bnamespace\s+' + re.escape(self.name) + r'[\*/\.\\\s]*$'), line): error(filename, linenum, 'readability/namespace', 5, 'Namespace should be terminated with "// namespace %s"' % self.name) else: # Anonymous namespace if not Match(r'};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line): error(filename, linenum, 'readability/namespace', 5, 'Namespace should be terminated with "// namespace"') class _PreprocessorInfo(object): """Stores checkpoints of nesting stacks when #if/#else is seen.""" def __init__(self, stack_before_if): # The entire nesting stack before #if self.stack_before_if = stack_before_if # The entire nesting stack up to #else self.stack_before_else = [] # Whether we have already seen #else or #elif self.seen_else = False class _NestingState(object): """Holds states related to parsing braces.""" def __init__(self): # Stack for tracking all braces. An object is pushed whenever we # see a "{", and popped when we see a "}". Only 3 types of # objects are possible: # - _ClassInfo: a class or struct. # - _NamespaceInfo: a namespace. # - _BlockInfo: some other type of block. self.stack = [] # Stack of _PreprocessorInfo objects. self.pp_stack = [] def SeenOpenBrace(self): """Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace. """ return (not self.stack) or self.stack[-1].seen_open_brace def InNamespaceBody(self): """Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _NamespaceInfo) def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif (see http://go/qwddn for original example) We make the following assumptions (good enough for most files): - Preprocessor condition evaluates to true from #if up to first #else/#elif/#endif. - Preprocessor condition evaluates to false from #else/#elif up to #endif. We still perform lint checks on these lines, but these do not affect nesting stack. Args: line: current line to check. """ if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', line): # Beginning of #if block, save the nesting stack here. The saved # stack will allow us to restore the parsing state in the #else case. self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack))) elif Match(r'^\s*#\s*(else|elif)\b', line): # Beginning of #else block if self.pp_stack: if not self.pp_stack[-1].seen_else: # This is the first #else or #elif block. Remember the # whole nesting stack up to this point. This is what we # keep after the #endif. self.pp_stack[-1].seen_else = True self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack) # Restore the stack to how it was before the #if self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if) else: # TODO(unknown): unexpected #else, issue warning? pass elif Match(r'^\s*#\s*endif\b', line): # End of #if or #else blocks. if self.pp_stack: # If we saw an #else, we will need to restore the nesting # stack to its former state before the #else, otherwise we # will just continue from where we left off. if self.pp_stack[-1].seen_else: # Here we can just use a shallow copy since we are the last # reference to it. self.stack = self.pp_stack[-1].stack_before_else # Drop the corresponding #if self.pp_stack.pop() else: # TODO(unknown): unexpected #endif, issue warning? pass def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] # Update pp_stack first self.UpdatePreprocessor(line) # Count parentheses. This is to avoid adding struct arguments to # the nesting stack. if self.stack: inner_block = self.stack[-1] depth_change = line.count('(') - line.count(')') inner_block.open_parentheses += depth_change # Also check if we are starting or ending an inline assembly block. if inner_block.inline_asm in (_NO_ASM, _END_ASM): if (depth_change != 0 and inner_block.open_parentheses == 1 and _MATCH_ASM.match(line)): # Enter assembly block inner_block.inline_asm = _INSIDE_ASM else: # Not entering assembly block. If previous line was _END_ASM, # we will now shift to _NO_ASM state. inner_block.inline_asm = _NO_ASM elif (inner_block.inline_asm == _INSIDE_ASM and inner_block.open_parentheses == 0): # Exit assembly block inner_block.inline_asm = _END_ASM # Consume namespace declaration at the beginning of the line. Do # this in a loop so that we catch same line declarations like this: # namespace proto2 { namespace bridge { class MessageSet; } } while True: # Match start of namespace. The "\b\s*" below catches namespace # declarations even if it weren't followed by a whitespace, this # is so that we don't confuse our namespace checker. The # missing spaces will be flagged by CheckSpacing. namespace_decl_match = Match(r'^\s*namespace\b\s*([:\w]+)?(.*)$', line) if not namespace_decl_match: break new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum) self.stack.append(new_namespace) line = namespace_decl_match.group(2) if line.find('{') != -1: new_namespace.seen_open_brace = True line = line[line.find('{') + 1:] # Look for a class declaration in whatever is left of the line # after parsing namespaces. The regexp accounts for decorated classes # such as in: # class LOCKABLE API Object { # }; # # Templates with class arguments may confuse the parser, for example: # template , # class Vector = vector > # class HeapQueue { # # Because this parser has no nesting state about templates, by the # time it saw "class Comparator", it may think that it's a new class. # Nested templates have a similar problem: # template < # typename ExportedType, # typename TupleType, # template class ImplTemplate> # # To avoid these cases, we ignore classes that are followed by '=' or '>' class_decl_match = Match( r'\s*(template\s*<[\w\s<>,:]*>\s*)?' '(class|struct)\s+([A-Z_]+\s+)*(\w+(?:::\w+)*)' '(([^=>]|<[^<>]*>)*)$', line) if (class_decl_match and (not self.stack or self.stack[-1].open_parentheses == 0)): self.stack.append(_ClassInfo( class_decl_match.group(4), class_decl_match.group(2), clean_lines, linenum)) line = class_decl_match.group(5) # If we have not yet seen the opening brace for the innermost block, # run checks here. if not self.SeenOpenBrace(): self.stack[-1].CheckBegin(filename, clean_lines, linenum, error) # Update access control if we are inside a class/struct if self.stack and isinstance(self.stack[-1], _ClassInfo): access_match = Match(r'\s*(public|private|protected)\s*:', line) if access_match: self.stack[-1].access = access_match.group(1) # Consume braces or semicolons from what's left of the line while True: # Match first brace, semicolon, or closed parenthesis. matched = Match(r'^[^{;)}]*([{;)}])(.*)$', line) if not matched: break token = matched.group(1) if token == '{': # If namespace or class hasn't seen a opening brace yet, mark # namespace/class head as complete. Push a new block onto the # stack otherwise. if not self.SeenOpenBrace(): self.stack[-1].seen_open_brace = True else: self.stack.append(_BlockInfo(True)) if _MATCH_ASM.match(line): self.stack[-1].inline_asm = _BLOCK_ASM elif token == ';' or token == ')': # If we haven't seen an opening brace yet, but we already saw # a semicolon, this is probably a forward declaration. Pop # the stack for these. # # Similarly, if we haven't seen an opening brace yet, but we # already saw a closing parenthesis, then these are probably # function arguments with extra "class" or "struct" keywords. # Also pop these stack for these. if not self.SeenOpenBrace(): self.stack.pop() else: # token == '}' # Perform end of block checks and pop the stack. if self.stack: self.stack[-1].CheckEnd(filename, clean_lines, linenum, error) self.stack.pop() line = matched.group(2) def InnermostClass(self): """Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise. """ for i in range(len(self.stack), 0, -1): classinfo = self.stack[i - 1] if isinstance(classinfo, _ClassInfo): return classinfo return None def CheckClassFinished(self, filename, error): """Checks that all classes have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: This test can result in false positives if #ifdef constructs # get in the way of brace matching. See the testBuildClass test in # cpplint_unittest.py for an example of this. for obj in self.stack: if isinstance(obj, _ClassInfo): error(filename, obj.starting_linenum, 'build/class', 5, 'Failed to find complete declaration of class %s' % obj.name) def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): """Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const static"). - "%lld" instead of %qd" in printf-type functions. - "%1$d" is non-standard in printf-type functions. - "\%" is an undefined character escape sequence. - text after #endif is not allowed. - invalid inner-style forward declaration. - >? and ?= and )\?=?\s*(\w+|[+-]?\d+)(\.\d*)?', line): error(filename, linenum, 'build/deprecated', 3, '>? and ))?' # r'\s*const\s*' + type_name + '\s*&\s*\w+\s*;' error(filename, linenum, 'runtime/member_string_references', 2, 'const string& members are dangerous. It is much better to use ' 'alternatives, such as pointers or simple constants.') # Everything else in this function operates on class declarations. # Return early if the top of the nesting stack is not a class, or if # the class head is not completed yet. classinfo = nesting_state.InnermostClass() if not classinfo or not classinfo.seen_open_brace: return # The class may have been declared with namespace or classname qualifiers. # The constructor and destructor will not have those qualifiers. base_classname = classinfo.name.split('::')[-1] # Look for single-argument constructors that aren't marked explicit. # Technically a valid construct, but against style. args = Match(r'\s+(?:inline\s+)?%s\s*\(([^,()]+)\)' % re.escape(base_classname), line) if (args and args.group(1) != 'void' and not Match(r'(const\s+)?%s\s*(?:<\w+>\s*)?&' % re.escape(base_classname), args.group(1).strip())): error(filename, linenum, 'runtime/explicit', 5, 'Single-argument constructors should be marked explicit.') def CheckSpacingForFunctionCall(filename, line, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any errors found. """ # Since function calls often occur inside if/for/while/switch # expressions - which have their own, more liberal conventions - we # first see if we should be looking inside such an expression for a # function call, to which we can apply more strict standards. fncall = line # if there's no control flow construct, look at whole line for pattern in (r'\bif\s*\((.*)\)\s*{', r'\bfor\s*\((.*)\)\s*{', r'\bwhile\s*\((.*)\)\s*[{;]', r'\bswitch\s*\((.*)\)\s*{'): match = Search(pattern, line) if match: fncall = match.group(1) # look inside the parens for function calls break # Except in if/for/while/switch, there should never be space # immediately inside parens (eg "f( 3, 4 )"). We make an exception # for nested parens ( (a+b) + c ). Likewise, there should never be # a space before a ( when it's a function argument. I assume it's a # function argument when the char before the whitespace is legal in # a function name (alnum + _) and we're not starting a macro. Also ignore # pointers and references to arrays and functions coz they're too tricky: # we use a very simple way to recognize these: # " (something)(maybe-something)" or # " (something)(maybe-something," or # " (something)[something]" # Note that we assume the contents of [] to be short enough that # they'll never need to wrap. if ( # Ignore control structures. not Search(r'\b(if|for|while|switch|return|delete)\b', fncall) and # Ignore pointers/references to functions. not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and # Ignore pointers/references to arrays. not Search(r' \([^)]+\)\[[^\]]+\]', fncall)): if Search(r'\w\s*\(\s(?!\s*\\$)', fncall): # a ( used for a fn call error(filename, linenum, 'whitespace/parens', 4, 'Extra space after ( in function call') elif Search(r'\(\s+(?!(\s*\\)|\()', fncall): error(filename, linenum, 'whitespace/parens', 2, 'Extra space after (') if (Search(r'\w\s+\(', fncall) and not Search(r'#\s*define|typedef', fncall) and not Search(r'\w\s+\((\w+::)?\*\w+\)\(', fncall)): error(filename, linenum, 'whitespace/parens', 4, 'Extra space before ( in function call') # If the ) is followed only by a newline or a { + newline, assume it's # part of a control statement (if/while/etc), and don't complain if Search(r'[^)]\s+\)\s*[^{\s]', fncall): # If the closing parenthesis is preceded by only whitespaces, # try to give a more descriptive error message. if Search(r'^\s+\)', fncall): error(filename, linenum, 'whitespace/parens', 2, 'Closing ) should be moved to the previous line') else: error(filename, linenum, 'whitespace/parens', 2, 'Extra space before )') def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace() def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error): """Reports for long function bodies. For an overview why this is done, see: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. Only checks unindented functions, so class members are unchecked. Trivial bodies are unchecked, so constructors with huge initializer lists may be missed. Blank/comment lines are not counted so as to avoid encouraging the removal of vertical space and comments just to get through a lint check. NOLINT *on the last line of a function* disables this check. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. function_state: Current function name and lines in body so far. error: The function to call with any errors found. """ lines = clean_lines.lines line = lines[linenum] raw = clean_lines.raw_lines raw_line = raw[linenum] joined_line = '' starting_func = False regexp = r'(\w(\w|::|\*|\&|\s)*)\(' # decls * & space::name( ... match_result = Match(regexp, line) if match_result: # If the name is all caps and underscores, figure it's a macro and # ignore it, unless it's TEST or TEST_F. function_name = match_result.group(1).split()[-1] if function_name == 'TEST' or function_name == 'TEST_F' or ( not Match(r'[A-Z_]+$', function_name)): starting_func = True if starting_func: body_found = False for start_linenum in xrange(linenum, clean_lines.NumLines()): start_line = lines[start_linenum] joined_line += ' ' + start_line.lstrip() if Search(r'(;|})', start_line): # Declarations and trivial functions body_found = True break # ... ignore elif Search(r'{', start_line): body_found = True function = Search(r'((\w|:)*)\(', line).group(1) if Match(r'TEST', function): # Handle TEST... macros parameter_regexp = Search(r'(\(.*\))', joined_line) if parameter_regexp: # Ignore bad syntax function += parameter_regexp.group(1) else: function += '()' function_state.Begin(function) break if not body_found: # No body for the function (or evidence of a non-function) was found. error(filename, linenum, 'readability/fn_size', 5, 'Lint failed to find start of function body.') elif Match(r'^\}\s*$', line): # function end function_state.Check(error, filename, linenum) function_state.End() elif not Match(r'^\s*$', line): function_state.Count() # Count non-blank/non-comment lines. _RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?') def CheckComment(comment, filename, linenum, error): """Checks for common mistakes in TODO comments. Args: comment: The text of the comment from the line in question. filename: The name of the current file. linenum: The number of the line to check. error: The function to call with any errors found. """ match = _RE_PATTERN_TODO.match(comment) if match: # One whitespace is correct; zero whitespace is handled elsewhere. leading_whitespace = match.group(1) if len(leading_whitespace) > 1: error(filename, linenum, 'whitespace/todo', 2, 'Too many spaces before TODO') username = match.group(2) if not username: error(filename, linenum, 'readability/todo', 2, 'Missing username in TODO; it should look like ' '"// TODO(my_username): Stuff."') middle_whitespace = match.group(3) # Comparisons made explicit for correctness -- pylint: disable-msg=C6403 if middle_whitespace != ' ' and middle_whitespace != '': error(filename, linenum, 'whitespace/todo', 2, 'TODO(my_username) should be followed by a space') def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A _NestingState instance which maintains information about the current stack of nested blocks being parsed. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] # get rid of comments and strings matched = Match((r'\s*(DISALLOW_COPY_AND_ASSIGN|' r'DISALLOW_EVIL_CONSTRUCTORS|' r'DISALLOW_IMPLICIT_CONSTRUCTORS)'), line) if not matched: return if nesting_state.stack and isinstance(nesting_state.stack[-1], _ClassInfo): if nesting_state.stack[-1].access != 'private': error(filename, linenum, 'readability/constructors', 3, '%s must be in the private: section' % matched.group(1)) else: # Found DISALLOW* macro outside a class declaration, or perhaps it # was used inside a function when it should have been part of the # class declaration. We could issue a warning here, but it # probably resulted in a compiler error already. pass def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix): """Find the corresponding > to close a template. Args: clean_lines: A CleansedLines instance containing the file. linenum: Current line number. init_suffix: Remainder of the current line after the initial <. Returns: True if a matching bracket exists. """ line = init_suffix nesting_stack = ['<'] while True: # Find the next operator that can tell us whether < is used as an # opening bracket or as a less-than operator. We only want to # warn on the latter case. # # We could also check all other operators and terminate the search # early, e.g. if we got something like this "a(),;\[\]]*([<>(),;\[\]])(.*)$', line) if match: # Found an operator, update nesting stack operator = match.group(1) line = match.group(2) if nesting_stack[-1] == '<': # Expecting closing angle bracket if operator in ('<', '(', '['): nesting_stack.append(operator) elif operator == '>': nesting_stack.pop() if not nesting_stack: # Found matching angle bracket return True elif operator == ',': # Got a comma after a bracket, this is most likely a template # argument. We have not seen a closing angle bracket yet, but # it's probably a few lines later if we look for it, so just # return early here. return True else: # Got some other operator. return False else: # Expecting closing parenthesis or closing bracket if operator in ('<', '(', '['): nesting_stack.append(operator) elif operator in (')', ']'): # We don't bother checking for matching () or []. If we got # something like (] or [), it would have been a syntax error. nesting_stack.pop() else: # Scan the next line linenum += 1 if linenum >= len(clean_lines.elided): break line = clean_lines.elided[linenum] # Exhausted all remaining lines and still no matching angle bracket. # Most likely the input was incomplete, otherwise we should have # seen a semicolon and returned early. return True def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix): """Find the corresponding < that started a template. Args: clean_lines: A CleansedLines instance containing the file. linenum: Current line number. init_prefix: Part of the current line before the initial >. Returns: True if a matching bracket exists. """ line = init_prefix nesting_stack = ['>'] while True: # Find the previous operator match = Search(r'^(.*)([<>(),;\[\]])[^<>(),;\[\]]*$', line) if match: # Found an operator, update nesting stack operator = match.group(2) line = match.group(1) if nesting_stack[-1] == '>': # Expecting opening angle bracket if operator in ('>', ')', ']'): nesting_stack.append(operator) elif operator == '<': nesting_stack.pop() if not nesting_stack: # Found matching angle bracket return True elif operator == ',': # Got a comma before a bracket, this is most likely a # template argument. The opening angle bracket is probably # there if we look for it, so just return early here. return True else: # Got some other operator. return False else: # Expecting opening parenthesis or opening bracket if operator in ('>', ')', ']'): nesting_stack.append(operator) elif operator in ('(', '['): nesting_stack.pop() else: # Scan the previous line linenum -= 1 if linenum < 0: break line = clean_lines.elided[linenum] # Exhausted all earlier lines and still no matching angle bracket. return False def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't add a blank line after public/protected/private, don't have too many blank lines in a row. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A _NestingState instance which maintains information about the current stack of nested blocks being parsed. error: The function to call with any errors found. """ raw = clean_lines.raw_lines line = raw[linenum] # Before nixing comments, check if the line is blank for no good # reason. This includes the first line after a block is opened, and # blank lines at the end of a function (ie, right before a line like '}' # # Skip all the blank line checks if we are immediately inside a # namespace body. In other words, don't issue blank line warnings # for this block: # namespace { # # } # # A warning about missing end of namespace comments will be issued instead. if IsBlankLine(line) and not nesting_state.InNamespaceBody(): elided = clean_lines.elided prev_line = elided[linenum - 1] prevbrace = prev_line.rfind('{') # TODO(unknown): Don't complain if line before blank line, and line after, # both start with alnums and are indented the same amount. # This ignores whitespace at the start of a namespace block # because those are not usually indented. if prevbrace != -1 and prev_line[prevbrace:].find('}') == -1: # OK, we have a blank line at the start of a code block. Before we # complain, we check if it is an exception to the rule: The previous # non-empty line has the parameters of a function header that are indented # 4 spaces (because they did not fit in a 80 column line when placed on # the same line as the function name). We also check for the case where # the previous line is indented 6 spaces, which may happen when the # initializers of a constructor do not fit into a 80 column line. exception = False if Match(r' {6}\w', prev_line): # Initializer list? # We are looking for the opening column of initializer list, which # should be indented 4 spaces to cause 6 space indentation afterwards. search_position = linenum-2 while (search_position >= 0 and Match(r' {6}\w', elided[search_position])): search_position -= 1 exception = (search_position >= 0 and elided[search_position][:5] == ' :') else: # Search for the function arguments or an initializer list. We use a # simple heuristic here: If the line is indented 4 spaces; and we have a # closing paren, without the opening paren, followed by an opening brace # or colon (for initializer lists) we assume that it is the last line of # a function header. If we have a colon indented 4 spaces, it is an # initializer list. exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)', prev_line) or Match(r' {4}:', prev_line)) if not exception: error(filename, linenum, 'whitespace/blank_line', 2, 'Blank line at the start of a code block. Is this needed?') # Ignore blank lines at the end of a block in a long if-else # chain, like this: # if (condition1) { # // Something followed by a blank line # # } else if (condition2) { # // Something else # } if linenum + 1 < clean_lines.NumLines(): next_line = raw[linenum + 1] if (next_line and Match(r'\s*}', next_line) and next_line.find('} else ') == -1): error(filename, linenum, 'whitespace/blank_line', 3, 'Blank line at the end of a code block. Is this needed?') matched = Match(r'\s*(public|protected|private):', prev_line) if matched: error(filename, linenum, 'whitespace/blank_line', 3, 'Do not leave a blank line after "%s:"' % matched.group(1)) # Next, we complain if there's a comment too near the text commentpos = line.find('//') if commentpos != -1: # Check if the // may be in quotes. If so, ignore it # Comparisons made explicit for clarity -- pylint: disable-msg=C6403 if (line.count('"', 0, commentpos) - line.count('\\"', 0, commentpos)) % 2 == 0: # not in quotes # Allow one space for new scopes, two spaces otherwise: if (not Match(r'^\s*{ //', line) and ((commentpos >= 1 and line[commentpos-1] not in string.whitespace) or (commentpos >= 2 and line[commentpos-2] not in string.whitespace))): error(filename, linenum, 'whitespace/comments', 2, 'At least two spaces is best between code and comments') # There should always be a space between the // and the comment commentend = commentpos + 2 if commentend < len(line) and not line[commentend] == ' ': # but some lines are exceptions -- e.g. if they're big # comment delimiters like: # //---------------------------------------------------------- # or are an empty C++ style Doxygen comment, like: # /// # or they begin with multiple slashes followed by a space: # //////// Header comment match = (Search(r'[=/-]{4,}\s*$', line[commentend:]) or Search(r'^/$', line[commentend:]) or Search(r'^/+ ', line[commentend:])) if not match: error(filename, linenum, 'whitespace/comments', 4, 'Should have a space between // and comment') CheckComment(line[commentpos:], filename, linenum, error) line = clean_lines.elided[linenum] # get rid of comments and strings # Don't try to do spacing checks for operator methods line = re.sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line) # We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )". # Otherwise not. Note we only check for non-spaces on *both* sides; # sometimes people put non-spaces on one side when aligning ='s among # many lines (not that this is behavior that I approve of...) if Search(r'[\w.]=[\w.]', line) and not Search(r'\b(if|while) ', line): error(filename, linenum, 'whitespace/operators', 4, 'Missing spaces around =') # It's ok not to have spaces around binary operators like + - * /, but if # there's too little whitespace, we get concerned. It's hard to tell, # though, so we punt on this one for now. TODO. # You should always have whitespace around binary operators. # # Check <= and >= first to avoid false positives with < and >, then # check non-include lines for spacing around < and >. match = Search(r'[^<>=!\s](==|!=|<=|>=)[^<>=!\s]', line) if match: error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around %s' % match.group(1)) # We allow no-spaces around << when used like this: 10<<20, but # not otherwise (particularly, not when used as streams) match = Search(r'(\S)(?:L|UL|ULL|l|ul|ull)?<<(\S)', line) if match and not (match.group(1).isdigit() and match.group(2).isdigit()): error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around <<') elif not Match(r'#.*include', line): # Avoid false positives on -> reduced_line = line.replace('->', '') # Look for < that is not surrounded by spaces. This is only # triggered if both sides are missing spaces, even though # technically should should flag if at least one side is missing a # space. This is done to avoid some false positives with shifts. match = Search(r'[^\s<]<([^\s=<].*)', reduced_line) if (match and not FindNextMatchingAngleBracket(clean_lines, linenum, match.group(1))): error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around <') # Look for > that is not surrounded by spaces. Similar to the # above, we only trigger if both sides are missing spaces to avoid # false positives with shifts. match = Search(r'^(.*[^\s>])>[^\s=>]', reduced_line) if (match and not FindPreviousMatchingAngleBracket(clean_lines, linenum, match.group(1))): error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around >') # We allow no-spaces around >> for almost anything. This is because # C++11 allows ">>" to close nested templates, which accounts for # most cases when ">>" is not followed by a space. # # We still warn on ">>" followed by alpha character, because that is # likely due to ">>" being used for right shifts, e.g.: # value >> alpha # # When ">>" is used to close templates, the alphanumeric letter that # follows would be part of an identifier, and there should still be # a space separating the template type and the identifier. # type> alpha match = Search(r'>>[a-zA-Z_]', line) if match: error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around >>') # There shouldn't be space around unary operators match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line) if match: error(filename, linenum, 'whitespace/operators', 4, 'Extra space for operator %s' % match.group(1)) # A pet peeve of mine: no spaces after an if, while, switch, or for match = Search(r' (if\(|for\(|while\(|switch\()', line) if match: error(filename, linenum, 'whitespace/parens', 5, 'Missing space before ( in %s' % match.group(1)) # For if/for/while/switch, the left and right parens should be # consistent about how many spaces are inside the parens, and # there should either be zero or one spaces inside the parens. # We don't want: "if ( foo)" or "if ( foo )". # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed. match = Search(r'\b(if|for|while|switch)\s*' r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$', line) if match: if len(match.group(2)) != len(match.group(4)): if not (match.group(3) == ';' and len(match.group(2)) == 1 + len(match.group(4)) or not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)): error(filename, linenum, 'whitespace/parens', 5, 'Mismatching spaces inside () in %s' % match.group(1)) if not len(match.group(2)) in [0, 1]: error(filename, linenum, 'whitespace/parens', 5, 'Should have zero or one spaces inside ( and ) in %s' % match.group(1)) # You should always have a space after a comma (either as fn arg or operator) if Search(r',[^\s]', line): error(filename, linenum, 'whitespace/comma', 3, 'Missing space after ,') # You should always have a space after a semicolon # except for few corner cases # TODO(unknown): clarify if 'if (1) { return 1;}' is requires one more # space after ; if Search(r';[^\s};\\)/]', line): error(filename, linenum, 'whitespace/semicolon', 3, 'Missing space after ;') # Next we will look for issues with function calls. CheckSpacingForFunctionCall(filename, line, linenum, error) # Except after an opening paren, or after another opening brace (in case of # an initializer list, for instance), you should have spaces before your # braces. And since you should never have braces at the beginning of a line, # this is an easy test. if Search(r'[^ ({]{', line): error(filename, linenum, 'whitespace/braces', 5, 'Missing space before {') # Make sure '} else {' has spaces. if Search(r'}else', line): error(filename, linenum, 'whitespace/braces', 5, 'Missing space before else') # You shouldn't have spaces before your brackets, except maybe after # 'delete []' or 'new char * []'. if Search(r'\w\s+\[', line) and not Search(r'delete\s+\[', line): error(filename, linenum, 'whitespace/braces', 5, 'Extra space before [') # You shouldn't have a space before a semicolon at the end of the line. # There's a special case for "for" since the style guide allows space before # the semicolon there. if Search(r':\s*;\s*$', line): error(filename, linenum, 'whitespace/semicolon', 5, 'Semicolon defining empty statement. Use {} instead.') elif Search(r'^\s*;\s*$', line): error(filename, linenum, 'whitespace/semicolon', 5, 'Line contains only semicolon. If this should be an empty statement, ' 'use {} instead.') elif (Search(r'\s+;\s*$', line) and not Search(r'\bfor\b', line)): error(filename, linenum, 'whitespace/semicolon', 5, 'Extra space before last semicolon. If this should be an empty ' 'statement, use {} instead.') # In range-based for, we wanted spaces before and after the colon, but # not around "::" tokens that might appear. if (Search('for *\(.*[^:]:[^: ]', line) or Search('for *\(.*[^: ]:[^:]', line)): error(filename, linenum, 'whitespace/forcolon', 2, 'Missing space around colon in range-based for loop') def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number of the line to check. error: The function to call with any errors found. """ # Skip checks if the class is small, where small means 25 lines or less. # 25 lines seems like a good cutoff since that's the usual height of # terminals, and any class that can't fit in one screen can't really # be considered "small". # # Also skip checks if we are on the first line. This accounts for # classes that look like # class Foo { public: ... }; # # If we didn't find the end of the class, last_line would be zero, # and the check will be skipped by the first condition. if (class_info.last_line - class_info.starting_linenum <= 24 or linenum <= class_info.starting_linenum): return matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum]) if matched: # Issue warning if the line before public/protected/private was # not a blank line, but don't do this if the previous line contains # "class" or "struct". This can happen two ways: # - We are at the beginning of the class. # - We are forward-declaring an inner class that is semantically # private, but needed to be public for implementation reasons. # Also ignores cases where the previous line ends with a backslash as can be # common when defining classes in C macros. prev_line = clean_lines.lines[linenum - 1] if (not IsBlankLine(prev_line) and not Search(r'\b(class|struct)\b', prev_line) and not Search(r'\\$', prev_line)): # Try a bit harder to find the beginning of the class. This is to # account for multi-line base-specifier lists, e.g.: # class Derived # : public Base { end_class_head = class_info.starting_linenum for i in range(class_info.starting_linenum, linenum): if Search(r'\{\s*$', clean_lines.lines[i]): end_class_head = i break if end_class_head < linenum - 1: error(filename, linenum, 'whitespace/blank_line', 3, '"%s:" should be preceded by a blank line' % matched.group(1)) def GetPreviousNonBlankLine(clean_lines, linenum): """Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents of the last non-blank line before the current line, or the empty string if this is the first non-blank line. The second is the line number of that line, or -1 if this is the first non-blank line. """ prevlinenum = linenum - 1 while prevlinenum >= 0: prevline = clean_lines.elided[prevlinenum] if not IsBlankLine(prevline): # if not a blank line... return (prevline, prevlinenum) prevlinenum -= 1 return ('', -1) def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] # get rid of comments and strings if Match(r'\s*{\s*$', line): # We allow an open brace to start a line in the case where someone # is using braces in a block to explicitly create a new scope, # which is commonly used to control the lifetime of # stack-allocated variables. We don't detect this perfectly: we # just don't complain if the last non-whitespace character on the # previous non-blank line is ';', ':', '{', or '}', or if the previous # line starts a preprocessor block. prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] if (not Search(r'[;:}{]\s*$', prevline) and not Match(r'\s*#', prevline)): error(filename, linenum, 'whitespace/braces', 4, '{ should almost always be at the end of the previous line') # An else clause should be on the same line as the preceding closing brace. if Match(r'\s*else\s*', line): prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] if Match(r'\s*}\s*$', prevline): error(filename, linenum, 'whitespace/newline', 4, 'An else should appear on the same line as the preceding }') # If braces come on one side of an else, they should be on both. # However, we have to worry about "else if" that spans multiple lines! if Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line): if Search(r'}\s*else if([^{]*)$', line): # could be multi-line if # find the ( after the if pos = line.find('else if') pos = line.find('(', pos) if pos > 0: (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos) if endline[endpos:].find('{') == -1: # must be brace after if error(filename, linenum, 'readability/braces', 5, 'If an else has a brace on one side, it should have it on both') else: # common case: else not followed by a multi-line if error(filename, linenum, 'readability/braces', 5, 'If an else has a brace on one side, it should have it on both') # Likewise, an else should never have the else clause on the same line if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line): error(filename, linenum, 'whitespace/newline', 4, 'Else clause should never be on same line as else (use 2 lines)') # In the same way, a do/while should never be on one line if Match(r'\s*do [^\s{]', line): error(filename, linenum, 'whitespace/newline', 4, 'do/while clauses should not be on a single line') # Braces shouldn't be followed by a ; unless they're defining a struct # or initializing an array. # We can't tell in general, but we can for some common cases. prevlinenum = linenum while True: (prevline, prevlinenum) = GetPreviousNonBlankLine(clean_lines, prevlinenum) if Match(r'\s+{.*}\s*;', line) and not prevline.count(';'): line = prevline + line else: break if (Search(r'{.*}\s*;', line) and line.count('{') == line.count('}') and not Search(r'struct|class|enum|\s*=\s*{', line)): error(filename, linenum, 'readability/braces', 4, "You don't need a ; after a }") def CheckEmptyLoopBody(filename, clean_lines, linenum, error): """Loop for empty loop body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ # Search for loop keywords at the beginning of the line. Because only # whitespaces are allowed before the keywords, this will also ignore most # do-while-loops, since those lines should start with closing brace. line = clean_lines.elided[linenum] if Match(r'\s*(for|while)\s*\(', line): # Find the end of the conditional expression (end_line, end_linenum, end_pos) = CloseExpression( clean_lines, linenum, line.find('(')) # Output warning if what follows the condition expression is a semicolon. # No warning for all other cases, including whitespace or newline, since we # have a separate check for semicolons preceded by whitespace. if end_pos >= 0 and Match(r';', end_line[end_pos:]): error(filename, end_linenum, 'whitespace/empty_loop_body', 5, 'Empty loop bodies should use {} or continue') def ReplaceableCheck(operator, macro, line): """Determine whether a basic CHECK can be replaced with a more specific one. For example suggest using CHECK_EQ instead of CHECK(a == b) and similarly for CHECK_GE, CHECK_GT, CHECK_LE, CHECK_LT, CHECK_NE. Args: operator: The C++ operator used in the CHECK. macro: The CHECK or EXPECT macro being called. line: The current source line. Returns: True if the CHECK can be replaced with a more specific one. """ # This matches decimal and hex integers, strings, and chars (in that order). match_constant = r'([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')' # Expression to match two sides of the operator with something that # looks like a literal, since CHECK(x == iterator) won't compile. # This means we can't catch all the cases where a more specific # CHECK is possible, but it's less annoying than dealing with # extraneous warnings. match_this = (r'\s*' + macro + r'\((\s*' + match_constant + r'\s*' + operator + r'[^<>].*|' r'.*[^<>]' + operator + r'\s*' + match_constant + r'\s*\))') # Don't complain about CHECK(x == NULL) or similar because # CHECK_EQ(x, NULL) won't compile (requires a cast). # Also, don't complain about more complex boolean expressions # involving && or || such as CHECK(a == b || c == d). return Match(match_this, line) and not Search(r'NULL|&&|\|\|', line) def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ # Decide the set of replacement macros that should be suggested raw_lines = clean_lines.raw_lines current_macro = '' for macro in _CHECK_MACROS: if raw_lines[linenum].find(macro) >= 0: current_macro = macro break if not current_macro: # Don't waste time here if line doesn't contain 'CHECK' or 'EXPECT' return line = clean_lines.elided[linenum] # get rid of comments and strings # Encourage replacing plain CHECKs with CHECK_EQ/CHECK_NE/etc. for operator in ['==', '!=', '>=', '>', '<=', '<']: if ReplaceableCheck(operator, current_macro, line): error(filename, linenum, 'readability/check', 2, 'Consider using %s instead of %s(a %s b)' % ( _CHECK_REPLACEMENT[current_macro][operator], current_macro, operator)) break def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] # Avoid preprocessor lines if Match(r'^\s*#', line): return # Last ditch effort to avoid multi-line comments. This will not help # if the comment started before the current line or ended after the # current line, but it catches most of the false positives. At least, # it provides a way to workaround this warning for people who use # multi-line comments in preprocessor macros. # # TODO(unknown): remove this once cpplint has better support for # multi-line comments. if line.find('/*') >= 0 or line.find('*/') >= 0: return for match in _ALT_TOKEN_REPLACEMENT_PATTERN.finditer(line): error(filename, linenum, 'readability/alt_tokens', 2, 'Use operator %s instead of %s' % ( _ALT_TOKEN_REPLACEMENT[match.group(1)], match.group(1))) def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width = 0 for uc in unicodedata.normalize('NFC', line): if unicodedata.east_asian_width(uc) in ('W', 'F'): width += 2 elif not unicodedata.combining(uc): width += 1 return width else: return len(line) def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error): """Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside code, etc. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. file_extension: The extension (without the dot) of the filename. nesting_state: A _NestingState instance which maintains information about the current stack of nested blocks being parsed. error: The function to call with any errors found. """ raw_lines = clean_lines.raw_lines line = raw_lines[linenum] if line.find('\t') != -1: error(filename, linenum, 'whitespace/tab', 1, 'Tab found; better to use spaces') # One or three blank spaces at the beginning of the line is weird; it's # hard to reconcile that with 2-space indents. # NOTE: here are the conditions rob pike used for his tests. Mine aren't # as sophisticated, but it may be worth becoming so: RLENGTH==initial_spaces # if(RLENGTH > 20) complain = 0; # if(match($0, " +(error|private|public|protected):")) complain = 0; # if(match(prev, "&& *$")) complain = 0; # if(match(prev, "\\|\\| *$")) complain = 0; # if(match(prev, "[\",=><] *$")) complain = 0; # if(match($0, " <<")) complain = 0; # if(match(prev, " +for \\(")) complain = 0; # if(prevodd && match(prevprev, " +for \\(")) complain = 0; initial_spaces = 0 cleansed_line = clean_lines.elided[linenum] while initial_spaces < len(line) and line[initial_spaces] == ' ': initial_spaces += 1 if line and line[-1].isspace(): error(filename, linenum, 'whitespace/end_of_line', 4, 'Line ends in whitespace. Consider deleting these extra spaces.') # There are certain situations we allow one space, notably for labels elif ((initial_spaces == 1 or initial_spaces == 3) and not Match(r'\s*\w+\s*:\s*$', cleansed_line)): error(filename, linenum, 'whitespace/indent', 3, 'Weird number of spaces at line-start. ' 'Are you using a 2-space indent?') # Labels should always be indented at least one space. elif not initial_spaces and line[:2] != '//' and Search(r'[^:]:\s*$', line): error(filename, linenum, 'whitespace/labels', 4, 'Labels should always be indented at least one space. ' 'If this is a member-initializer list in a constructor or ' 'the base class list in a class definition, the colon should ' 'be on the following line.') # Check if the line is a header guard. is_header_guard = False if file_extension == 'h': cppvar = GetHeaderGuardCPPVariable(filename) if (line.startswith('#ifndef %s' % cppvar) or line.startswith('#define %s' % cppvar) or line.startswith('#endif // %s' % cppvar)): is_header_guard = True # #include lines and header guards can be long, since there's no clean way to # split them. # # URLs can be long too. It's possible to split these, but it makes them # harder to cut&paste. # # The "$Id:...$" comment may also get very long without it being the # developers fault. if (not line.startswith('#include') and not is_header_guard and not Match(r'^\s*//.*http(s?)://\S*$', line) and not Match(r'^// \$Id:.*#[0-9]+ \$$', line)): line_width = GetLineWidth(line) if line_width > 100: error(filename, linenum, 'whitespace/line_length', 4, 'Lines should very rarely be longer than 100 characters') elif line_width > 80: error(filename, linenum, 'whitespace/line_length', 2, 'Lines should be <= 80 characters long') if (cleansed_line.count(';') > 1 and # for loops are allowed two ;'s (and may run over two lines). cleansed_line.find('for') == -1 and (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and # It's ok to have many commands in a switch case that fits in 1 line not ((cleansed_line.find('case ') != -1 or cleansed_line.find('default:') != -1) and cleansed_line.find('break;') != -1)): error(filename, linenum, 'whitespace/newline', 0, 'More than one command on the same line') # Some more style checks CheckBraces(filename, clean_lines, linenum, error) CheckEmptyLoopBody(filename, clean_lines, linenum, error) CheckAccess(filename, clean_lines, linenum, nesting_state, error) CheckSpacing(filename, clean_lines, linenum, nesting_state, error) CheckCheck(filename, clean_lines, linenum, error) CheckAltTokens(filename, clean_lines, linenum, error) classinfo = nesting_state.InnermostClass() if classinfo: CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error) _RE_PATTERN_INCLUDE_NEW_STYLE = re.compile(r'#include +"[^/]+\.h"') _RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$') # Matches the first component of a filename delimited by -s and _s. That is: # _RE_FIRST_COMPONENT.match('foo').group(0) == 'foo' # _RE_FIRST_COMPONENT.match('foo.cc').group(0) == 'foo' # _RE_FIRST_COMPONENT.match('foo-bar_baz.cc').group(0) == 'foo' # _RE_FIRST_COMPONENT.match('foo_bar-baz.cc').group(0) == 'foo' _RE_FIRST_COMPONENT = re.compile(r'^[^-_.]+') def _DropCommonSuffixes(filename): """Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCommonSuffixes('foo/foo_unusualinternal.h') 'foo/foo_unusualinternal' Args: filename: The input filename. Returns: The filename with the common suffix removed. """ for suffix in ('test.cc', 'regtest.cc', 'unittest.cc', 'inl.h', 'impl.h', 'internal.h'): if (filename.endswith(suffix) and len(filename) > len(suffix) and filename[-len(suffix) - 1] in ('-', '_')): return filename[:-len(suffix) - 1] return os.path.splitext(filename)[0] def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or filename.endswith('_regtest.cc')): return True else: return False def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'stdio.h', True) _C_SYS_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'string', True) _CPP_SYS_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', False) _LIKELY_MY_HEADER >>> _ClassifyInclude(FileInfo('foo/foo_unknown_extension.cc'), ... 'bar/foo_other_ext.h', False) _POSSIBLE_MY_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/bar.h', False) _OTHER_HEADER """ # This is a list of all standard c++ header files, except # those already checked for above. is_stl_h = include in _STL_HEADERS is_cpp_h = is_stl_h or include in _CPP_HEADERS if is_system: if is_cpp_h: return _CPP_SYS_HEADER else: return _C_SYS_HEADER # If the target file and the include we're checking share a # basename when we drop common extensions, and the include # lives in . , then it's likely to be owned by the target file. target_dir, target_base = ( os.path.split(_DropCommonSuffixes(fileinfo.RepositoryName()))) include_dir, include_base = os.path.split(_DropCommonSuffixes(include)) if target_base == include_base and ( include_dir == target_dir or include_dir == os.path.normpath(target_dir + '/../public')): return _LIKELY_MY_HEADER # If the target and include share some initial basename # component, it's possible the target is implementing the # include, so it's allowed to be first, but we'll never # complain if it's not there. target_first_component = _RE_FIRST_COMPONENT.match(target_base) include_first_component = _RE_FIRST_COMPONENT.match(include_base) if (target_first_component and include_first_component and target_first_component.group(0) == include_first_component.group(0)): return _POSSIBLE_MY_HEADER return _OTHER_HEADER def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. include_state: An _IncludeState instance in which the headers are inserted. error: The function to call with any errors found. """ fileinfo = FileInfo(filename) line = clean_lines.lines[linenum] # "include" should use the new style "foo/bar.h" instead of just "bar.h" if _RE_PATTERN_INCLUDE_NEW_STYLE.search(line): error(filename, linenum, 'build/include', 4, 'Include the directory when naming .h files') # we shouldn't include a file more than once. actually, there are a # handful of instances where doing so is okay, but in general it's # not. match = _RE_PATTERN_INCLUDE.search(line) if match: include = match.group(2) is_system = (match.group(1) == '<') if include in include_state: error(filename, linenum, 'build/include', 4, '"%s" already included at %s:%s' % (include, filename, include_state[include])) else: include_state[include] = linenum # We want to ensure that headers appear in the right order: # 1) for foo.cc, foo.h (preferred location) # 2) c system files # 3) cpp system files # 4) for foo.cc, foo.h (deprecated location) # 5) other google headers # # We classify each include statement as one of those 5 types # using a number of techniques. The include_state object keeps # track of the highest type seen, and complains if we see a # lower type after that. error_message = include_state.CheckNextIncludeOrder( _ClassifyInclude(fileinfo, include, is_system)) if error_message: error(filename, linenum, 'build/include_order', 4, '%s. Should be: %s.h, c system, c++ system, other.' % (error_message, fileinfo.BaseName())) if not include_state.IsInAlphabeticalOrder(include): error(filename, linenum, 'build/include_alpha', 4, 'Include "%s" not in alphabetical order' % include) # Look for any of the stream classes that are part of standard C++. match = _RE_PATTERN_INCLUDE.match(line) if match: include = match.group(2) if Match(r'(f|ind|io|i|o|parse|pf|stdio|str|)?stream$', include): # Many unit tests use cout, so we exempt them. if not _IsTestFilename(filename): error(filename, linenum, 'readability/streams', 3, 'Streams are highly discouraged.') def _GetTextInside(text, start_pattern): """Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of the punctuations, so for the text like printf(a(), b(c())); a call to _GetTextInside(text, r'printf\(') will return 'a(), b(c())'. start_pattern must match string having an open punctuation symbol at the end. Args: text: The lines to extract text. Its comments and strings must be elided. It can be single line and can span multiple lines. start_pattern: The regexp string indicating where to start extracting the text. Returns: The extracted text. None if either the opening string or ending punctuation could not be found. """ # TODO(sugawarayu): Audit cpplint.py to see what places could be profitably # rewritten to use _GetTextInside (and use inferior regexp matching today). # Give opening punctuations to get the matching close-punctuations. matching_punctuation = {'(': ')', '{': '}', '[': ']'} closing_punctuation = set(matching_punctuation.itervalues()) # Find the position to start extracting text. match = re.search(start_pattern, text, re.M) if not match: # start_pattern not found in text. return None start_position = match.end(0) assert start_position > 0, ( 'start_pattern must ends with an opening punctuation.') assert text[start_position - 1] in matching_punctuation, ( 'start_pattern must ends with an opening punctuation.') # Stack of closing punctuations we expect to have in text after position. punctuation_stack = [matching_punctuation[text[start_position - 1]]] position = start_position while punctuation_stack and position < len(text): if text[position] == punctuation_stack[-1]: punctuation_stack.pop() elif text[position] in closing_punctuation: # A closing punctuation without matching opening punctuations. return None elif text[position] in matching_punctuation: punctuation_stack.append(matching_punctuation[text[position]]) position += 1 if punctuation_stack: # Opening punctuations left without matching close-punctuations. return None # punctuations match. return text[start_position:position - 1] def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. file_extension: The extension (without the dot) of the filename. include_state: An _IncludeState instance in which the headers are inserted. error: The function to call with any errors found. """ # If the line is empty or consists of entirely a comment, no need to # check it. line = clean_lines.elided[linenum] if not line: return match = _RE_PATTERN_INCLUDE.search(line) if match: CheckIncludeLine(filename, clean_lines, linenum, include_state, error) return # Create an extended_line, which is the concatenation of the current and # next lines, for more effective checking of code that may span more than one # line. if linenum + 1 < clean_lines.NumLines(): extended_line = line + clean_lines.elided[linenum + 1] else: extended_line = line # Make Windows paths like Unix. fullname = os.path.abspath(filename).replace('\\', '/') # TODO(unknown): figure out if they're using default arguments in fn proto. # Check for non-const references in functions. This is tricky because & # is also used to take the address of something. We allow <> for templates, # (ignoring whatever is between the braces) and : for classes. # These are complicated re's. They try to capture the following: # paren (for fn-prototype start), typename, &, varname. For the const # version, we're willing for const to be before typename or after # Don't check the implementation on same line. fnline = line.split('{', 1)[0] if (len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) > len(re.findall(r'\([^()]*\bconst\s+(?:typename\s+)?(?:struct\s+)?' r'(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) + len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+\s+const(\s?&|&\s?)[\w]+', fnline))): # We allow non-const references in a few standard places, like functions # called "swap()" or iostream operators like "<<" or ">>". We also filter # out for loops, which lint otherwise mistakenly thinks are functions. if not Search( r'(for|swap|Swap|operator[<>][<>])\s*\(\s*' r'(?:(?:typename\s*)?[\w:]|<.*>)+\s*&', fnline): error(filename, linenum, 'runtime/references', 2, 'Is this a non-const reference? ' 'If so, make const or use a pointer.') # Check to see if they're using an conversion function cast. # I just try to capture the most common basic types, though there are more. # Parameterless conversion functions, such as bool(), are allowed as they are # probably a member operator declaration or default constructor. match = Search( r'(\bnew\s+)?\b' # Grab 'new' operator, if it's there r'(int|float|double|bool|char|int32|uint32|int64|uint64)\([^)]', line) if match: # gMock methods are defined using some variant of MOCK_METHODx(name, type) # where type may be float(), int(string), etc. Without context they are # virtually indistinguishable from int(x) casts. Likewise, gMock's # MockCallback takes a template parameter of the form return_type(arg_type), # which looks much like the cast we're trying to detect. if (match.group(1) is None and # If new operator, then this isn't a cast not (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or Match(r'^\s*MockCallback<.*>', line))): # Try a bit harder to catch gmock lines: the only place where # something looks like an old-style cast is where we declare the # return type of the mocked method, and the only time when we # are missing context is if MOCK_METHOD was split across # multiple lines (for example http://go/hrfhr ), so we only need # to check the previous line for MOCK_METHOD. if (linenum == 0 or not Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(\S+,\s*$', clean_lines.elided[linenum - 1])): error(filename, linenum, 'readability/casting', 4, 'Using deprecated casting style. ' 'Use static_cast<%s>(...) instead' % match.group(2)) CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum], 'static_cast', r'\((int|float|double|bool|char|u?int(16|32|64))\)', error) # This doesn't catch all cases. Consider (const char * const)"hello". # # (char *) "foo" should always be a const_cast (reinterpret_cast won't # compile). if CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum], 'const_cast', r'\((char\s?\*+\s?)\)\s*"', error): pass else: # Check pointer casts for other than string constants CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum], 'reinterpret_cast', r'\((\w+\s?\*+\s?)\)', error) # In addition, we look for people taking the address of a cast. This # is dangerous -- casts can assign to temporaries, so the pointer doesn't # point where you think. if Search( r'(&\([^)]+\)[\w(])|(&(static|dynamic|reinterpret)_cast\b)', line): error(filename, linenum, 'runtime/casting', 4, ('Are you taking an address of a cast? ' 'This is dangerous: could be a temp var. ' 'Take the address before doing the cast, rather than after')) # Check for people declaring static/global STL strings at the top level. # This is dangerous because the C++ language does not guarantee that # globals with constructors are initialized before the first access. match = Match( r'((?:|static +)(?:|const +))string +([a-zA-Z0-9_:]+)\b(.*)', line) # Make sure it's not a function. # Function template specialization looks like: "string foo(...". # Class template definitions look like: "string Foo::Method(...". if match and not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)?\s*\(([^"]|$)', match.group(3)): error(filename, linenum, 'runtime/string', 4, 'For a static/global string constant, use a C style string instead: ' '"%schar %s[]".' % (match.group(1), match.group(2))) # Check that we're not using RTTI outside of testing code. if Search(r'\bdynamic_cast<', line) and not _IsTestFilename(filename): error(filename, linenum, 'runtime/rtti', 5, 'Do not use dynamic_cast<>. If you need to cast within a class ' "hierarchy, use static_cast<> to upcast. Google doesn't support " 'RTTI.') if Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line): error(filename, linenum, 'runtime/init', 4, 'You seem to be initializing a member variable with itself.') if file_extension == 'h': # TODO(unknown): check that 1-arg constructors are explicit. # How to tell it's a constructor? # (handled in CheckForNonStandardConstructs for now) # TODO(unknown): check that classes have DISALLOW_EVIL_CONSTRUCTORS # (level 1 error) pass # Check if people are using the verboten C basic types. The only exception # we regularly allow is "unsigned short port" for port. if Search(r'\bshort port\b', line): if not Search(r'\bunsigned short port\b', line): error(filename, linenum, 'runtime/int', 4, 'Use "unsigned short" for ports, not "short"') else: match = Search(r'\b(short|long(?! +double)|long long)\b', line) if match: error(filename, linenum, 'runtime/int', 4, 'Use int16/int64/etc, rather than the C type %s' % match.group(1)) # When snprintf is used, the second argument shouldn't be a literal. match = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', line) if match and match.group(2) != '0': # If 2nd arg is zero, snprintf is used to calculate size. error(filename, linenum, 'runtime/printf', 3, 'If you can, use sizeof(%s) instead of %s as the 2nd arg ' 'to snprintf.' % (match.group(1), match.group(2))) # Check if some verboten C functions are being used. if Search(r'\bsprintf\b', line): error(filename, linenum, 'runtime/printf', 5, 'Never use sprintf. Use snprintf instead.') match = Search(r'\b(strcpy|strcat)\b', line) if match: error(filename, linenum, 'runtime/printf', 4, 'Almost always, snprintf is better than %s' % match.group(1)) if Search(r'\bsscanf\b', line): error(filename, linenum, 'runtime/printf', 1, 'sscanf can be ok, but is slow and can overflow buffers.') # Check if some verboten operator overloading is going on # TODO(unknown): catch out-of-line unary operator&: # class X {}; # int operator&(const X& x) { return 42; } // unary operator& # The trick is it's hard to tell apart from binary operator&: # class Y { int operator&(const Y& x) { return 23; } }; // binary operator& if Search(r'\boperator\s*&\s*\(\s*\)', line): error(filename, linenum, 'runtime/operator', 4, 'Unary operator& is dangerous. Do not use it.') # Check for suspicious usage of "if" like # } if (a == b) { if Search(r'\}\s*if\s*\(', line): error(filename, linenum, 'readability/braces', 4, 'Did you mean "else if"? If not, start a new line for "if".') # Check for potential format string bugs like printf(foo). # We constrain the pattern not to pick things like DocidForPrintf(foo). # Not perfect but it can catch printf(foo.c_str()) and printf(foo->c_str()) # TODO(sugawarayu): Catch the following case. Need to change the calling # convention of the whole function to process multiple line to handle it. # printf( # boy_this_is_a_really_long_variable_that_cannot_fit_on_the_prev_line); printf_args = _GetTextInside(line, r'(?i)\b(string)?printf\s*\(') if printf_args: match = Match(r'([\w.\->()]+)$', printf_args) if match and match.group(1) != '__VA_ARGS__': function_name = re.search(r'\b((?:string)?printf)\s*\(', line, re.I).group(1) error(filename, linenum, 'runtime/printf', 4, 'Potential format string bug. Do %s("%%s", %s) instead.' % (function_name, match.group(1))) # Check for potential memset bugs like memset(buf, sizeof(buf), 0). match = Search(r'memset\s*\(([^,]*),\s*([^,]*),\s*0\s*\)', line) if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)): error(filename, linenum, 'runtime/memset', 4, 'Did you mean "memset(%s, 0, %s)"?' % (match.group(1), match.group(2))) if Search(r'\busing namespace\b', line): error(filename, linenum, 'build/namespaces', 5, 'Do not use namespace using-directives. ' 'Use using-declarations instead.') # Detect variable-length arrays. match = Match(r'\s*(.+::)?(\w+) [a-z]\w*\[(.+)];', line) if (match and match.group(2) != 'return' and match.group(2) != 'delete' and match.group(3).find(']') == -1): # Split the size using space and arithmetic operators as delimiters. # If any of the resulting tokens are not compile time constants then # report the error. tokens = re.split(r'\s|\+|\-|\*|\/|<<|>>]', match.group(3)) is_const = True skip_next = False for tok in tokens: if skip_next: skip_next = False continue if Search(r'sizeof\(.+\)', tok): continue if Search(r'arraysize\(\w+\)', tok): continue tok = tok.lstrip('(') tok = tok.rstrip(')') if not tok: continue if Match(r'\d+', tok): continue if Match(r'0[xX][0-9a-fA-F]+', tok): continue if Match(r'k[A-Z0-9]\w*', tok): continue if Match(r'(.+::)?k[A-Z0-9]\w*', tok): continue if Match(r'(.+::)?[A-Z][A-Z0-9_]*', tok): continue # A catch all for tricky sizeof cases, including 'sizeof expression', # 'sizeof(*type)', 'sizeof(const type)', 'sizeof(struct StructName)' # requires skipping the next token because we split on ' ' and '*'. if tok.startswith('sizeof'): skip_next = True continue is_const = False break if not is_const: error(filename, linenum, 'runtime/arrays', 1, 'Do not use variable-length arrays. Use an appropriately named ' "('k' followed by CamelCase) compile-time constant for the size.") # If DISALLOW_EVIL_CONSTRUCTORS, DISALLOW_COPY_AND_ASSIGN, or # DISALLOW_IMPLICIT_CONSTRUCTORS is present, then it should be the last thing # in the class declaration. match = Match( (r'\s*' r'(DISALLOW_(EVIL_CONSTRUCTORS|COPY_AND_ASSIGN|IMPLICIT_CONSTRUCTORS))' r'\(.*\);$'), line) if match and linenum + 1 < clean_lines.NumLines(): next_line = clean_lines.elided[linenum + 1] # We allow some, but not all, declarations of variables to be present # in the statement that defines the class. The [\w\*,\s]* fragment of # the regular expression below allows users to declare instances of # the class or pointers to instances, but not less common types such # as function pointers or arrays. It's a tradeoff between allowing # reasonable code and avoiding trying to parse more C++ using regexps. if not Search(r'^\s*}[\w\*,\s]*;', next_line): error(filename, linenum, 'readability/constructors', 3, match.group(1) + ' should be the last thing in the class') # Check for use of unnamed namespaces in header files. Registration # macros are typically OK, so we allow use of "namespace {" on lines # that end with backslashes. if (file_extension == 'h' and Search(r'\bnamespace\s*{', line) and line[-1] != '\\'): error(filename, linenum, 'build/namespaces', 4, 'Do not use unnamed namespaces in header files. See ' 'http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' ' for more information.') def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. This also handles sizeof(type) warnings, due to similarity of content. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw line of code to check, with comments. cast_type: The string for the C++ cast to recommend. This is either reinterpret_cast, static_cast, or const_cast, depending. pattern: The regular expression used to find C-style casts. error: The function to call with any errors found. Returns: True if an error was emitted. False otherwise. """ match = Search(pattern, line) if not match: return False # e.g., sizeof(int) sizeof_match = Match(r'.*sizeof\s*$', line[0:match.start(1) - 1]) if sizeof_match: error(filename, linenum, 'runtime/sizeof', 1, 'Using sizeof(type). Use sizeof(varname) instead if possible') return True # operator++(int) and operator--(int) if (line[0:match.start(1) - 1].endswith(' operator++') or line[0:match.start(1) - 1].endswith(' operator--')): return False remainder = line[match.end(0):] # The close paren is for function pointers as arguments to a function. # eg, void foo(void (*bar)(int)); # The semicolon check is a more basic function check; also possibly a # function pointer typedef. # eg, void foo(int); or void foo(int) const; # The equals check is for function pointer assignment. # eg, void *(*foo)(int) = ... # The > is for MockCallback<...> ... # # Right now, this will only catch cases where there's a single argument, and # it's unnamed. It should probably be expanded to check for multiple # arguments with some unnamed. function_match = Match(r'\s*(\)|=|(const)?\s*(;|\{|throw\(\)|>))', remainder) if function_match: if (not function_match.group(3) or function_match.group(3) == ';' or ('MockCallback<' not in raw_line and '/*' not in raw_line)): error(filename, linenum, 'readability/function', 3, 'All parameters should be named in a function') return True # At this point, all that should be left is actual casts. error(filename, linenum, 'readability/casting', 4, 'Using C-style cast. Use %s<%s>(...) instead' % (cast_type, match.group(1))) return True _HEADERS_CONTAINING_TEMPLATES = ( ('', ('deque',)), ('', ('unary_function', 'binary_function', 'plus', 'minus', 'multiplies', 'divides', 'modulus', 'negate', 'equal_to', 'not_equal_to', 'greater', 'less', 'greater_equal', 'less_equal', 'logical_and', 'logical_or', 'logical_not', 'unary_negate', 'not1', 'binary_negate', 'not2', 'bind1st', 'bind2nd', 'pointer_to_unary_function', 'pointer_to_binary_function', 'ptr_fun', 'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t', 'mem_fun_ref_t', 'const_mem_fun_t', 'const_mem_fun1_t', 'const_mem_fun_ref_t', 'const_mem_fun1_ref_t', 'mem_fun_ref', )), ('', ('numeric_limits',)), ('', ('list',)), ('', ('map', 'multimap',)), ('', ('allocator',)), ('', ('queue', 'priority_queue',)), ('', ('set', 'multiset',)), ('', ('stack',)), ('', ('char_traits', 'basic_string',)), ('', ('pair',)), ('', ('vector',)), # gcc extensions. # Note: std::hash is their hash, ::hash is our hash ('', ('hash_map', 'hash_multimap',)), ('', ('hash_set', 'hash_multiset',)), ('', ('slist',)), ) _RE_PATTERN_STRING = re.compile(r'\bstring\b') _re_pattern_algorithm_header = [] for _template in ('copy', 'max', 'min', 'min_element', 'sort', 'swap', 'transform'): # Match max(..., ...), max(..., ...), but not foo->max, foo.max or # type::max(). _re_pattern_algorithm_header.append( (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'), _template, '')) _re_pattern_templates = [] for _header, _templates in _HEADERS_CONTAINING_TEMPLATES: for _template in _templates: _re_pattern_templates.append( (re.compile(r'(\<|\b)' + _template + r'\s*\<'), _template + '<>', _header)) def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to the same module here. If the filename_cc contains a longer path than the filename_h, for example, '/absolute/path/to/base/sysinfo.cc', and this file would include 'base/sysinfo.h', this function also produces the prefix needed to open the header. This is used by the caller of this function to more robustly open the header file. We don't have access to the real include paths in this context, so we need this guesswork here. Known bugs: tools/base/bar.cc and base/bar.h belong to the same module according to this implementation. Because of this, this function gives some false positives. This should be sufficiently rare in practice. Args: filename_cc: is the path for the .cc file filename_h: is the path for the header path Returns: Tuple with a bool and a string: bool: True if filename_cc and filename_h belong to the same module. string: the additional prefix needed to open the header file. """ if not filename_cc.endswith('.cc'): return (False, '') filename_cc = filename_cc[:-len('.cc')] if filename_cc.endswith('_unittest'): filename_cc = filename_cc[:-len('_unittest')] elif filename_cc.endswith('_test'): filename_cc = filename_cc[:-len('_test')] filename_cc = filename_cc.replace('/public/', '/') filename_cc = filename_cc.replace('/internal/', '/') if not filename_h.endswith('.h'): return (False, '') filename_h = filename_h[:-len('.h')] if filename_h.endswith('-inl'): filename_h = filename_h[:-len('-inl')] filename_h = filename_h.replace('/public/', '/') filename_h = filename_h.replace('/internal/', '/') files_belong_to_same_module = filename_cc.endswith(filename_h) common_path = '' if files_belong_to_same_module: common_path = filename_cc[:-len(filename_h)] return files_belong_to_same_module, common_path def UpdateIncludeState(filename, include_state, io=codecs): """Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was successfully added. False otherwise. """ headerfile = None try: headerfile = io.open(filename, 'r', 'utf8', 'replace') except IOError: return False linenum = 0 for line in headerfile: linenum += 1 clean_line = CleanseComments(line) match = _RE_PATTERN_INCLUDE.search(clean_line) if match: include = match.group(2) # The value formatting is cute, but not really used right now. # What matters here is that the key is in include_state. include_state.setdefault(include, '%s:%d' % (filename, linenum)) return True def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, io=codecs): """Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one reason to include a header. For example, if you use both equal_to<> and less<> in a .h file, only one (the latter in the file) of these will be reported as a reason to include the . Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. include_state: An _IncludeState instance. error: The function to call with any errors found. io: The IO factory to use to read the header file. Provided for unittest injection. """ required = {} # A map of header name to linenumber and the template entity. # Example of required: { '': (1219, 'less<>') } for linenum in xrange(clean_lines.NumLines()): line = clean_lines.elided[linenum] if not line or line[0] == '#': continue # String is special -- it is a non-templatized type in STL. matched = _RE_PATTERN_STRING.search(line) if matched: # Don't warn about strings in non-STL namespaces: # (We check only the first match per line; good enough.) prefix = line[:matched.start()] if prefix.endswith('std::') or not prefix.endswith('::'): required[''] = (linenum, 'string') for pattern, template, header in _re_pattern_algorithm_header: if pattern.search(line): required[header] = (linenum, template) # The following function is just a speed up, no semantics are changed. if not '<' in line: # Reduces the cpu time usage by skipping lines. continue for pattern, template, header in _re_pattern_templates: if pattern.search(line): required[header] = (linenum, template) # The policy is that if you #include something in foo.h you don't need to # include it again in foo.cc. Here, we will look at possible includes. # Let's copy the include_state so it is only messed up within this function. include_state = include_state.copy() # Did we find the header for this file (if any) and successfully load it? header_found = False # Use the absolute path so that matching works properly. abs_filename = FileInfo(filename).FullName() # For Emacs's flymake. # If cpplint is invoked from Emacs's flymake, a temporary file is generated # by flymake and that file name might end with '_flymake.cc'. In that case, # restore original file name here so that the corresponding header file can be # found. # e.g. If the file name is 'foo_flymake.cc', we should search for 'foo.h' # instead of 'foo_flymake.h' abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename) # include_state is modified during iteration, so we iterate over a copy of # the keys. header_keys = include_state.keys() for header in header_keys: (same_module, common_path) = FilesBelongToSameModule(abs_filename, header) fullpath = common_path + header if same_module and UpdateIncludeState(fullpath, include_state, io): header_found = True # If we can't find the header file for a .cc, assume it's because we don't # know where to look. In that case we'll give up as we're not sure they # didn't include it in the .h file. # TODO(unknown): Do a better job of finding .h files so we are confident that # not having the .h file means there isn't one. if filename.endswith('.cc') and not header_found: return # All the lines have been processed, report the errors found. for required_header_unstripped in required: template = required[required_header_unstripped][1] if required_header_unstripped.strip('<>"') not in include_state: error(filename, required[required_header_unstripped][0], 'build/include_what_you_use', 4, 'Add #include ' + required_header_unstripped + ' for ' + template) _RE_PATTERN_EXPLICIT_MAKEPAIR = re.compile(r'\bmake_pair\s*<') def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): """Check that make_pair's template arguments are deduced. G++ 4.6 in C++0x mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ raw = clean_lines.raw_lines line = raw[linenum] match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line) if match: error(filename, linenum, 'build/explicit_make_pair', 4, # 4 = high confidence 'For C++11-compatibility, omit template arguments from make_pair' ' OR use pair directly OR if appropriate, construct a pair directly') def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[]): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being processed. include_state: An _IncludeState instance in which the headers are inserted. function_state: A _FunctionState instance which counts function lines, etc. nesting_state: A _NestingState instance which maintains information about the current stack of nested blocks being parsed. error: A callable to which errors are reported, which takes 4 arguments: filename, line number, error level, and message extra_check_functions: An array of additional check functions that will be run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error """ raw_lines = clean_lines.raw_lines ParseNolintSuppressions(filename, raw_lines[line], line, error) nesting_state.Update(filename, clean_lines, line, error) if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM: return CheckForFunctionLengths(filename, clean_lines, line, function_state, error) CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) CheckLanguage(filename, clean_lines, line, file_extension, include_state, error) CheckForNonStandardConstructs(filename, clean_lines, line, nesting_state, error) CheckPosixThreading(filename, clean_lines, line, error) CheckInvalidIncrement(filename, clean_lines, line, error) CheckMakePairUsesDeduction(filename, clean_lines, line, error) for check_fn in extra_check_functions: check_fn(filename, clean_lines, line, error) def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=[]): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the last element being empty if the file is terminated with a newline. error: A callable to which errors are reported, which takes 4 arguments: filename, line number, error level, and message extra_check_functions: An array of additional check functions that will be run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error """ lines = (['// marker so line numbers and indices both start at 1'] + lines + ['// marker so line numbers end in a known way']) include_state = _IncludeState() function_state = _FunctionState() nesting_state = _NestingState() ResetNolintSuppressions() CheckForCopyright(filename, lines, error) if file_extension == 'h': CheckForHeaderGuard(filename, lines, error) RemoveMultiLineComments(filename, lines, error) clean_lines = CleansedLines(lines) for line in xrange(clean_lines.NumLines()): ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions) nesting_state.CheckClassFinished(filename, error) CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error) # We check here rather than inside ProcessLine so that we see raw # lines rather than "cleaned" lines. CheckForUnicodeReplacementCharacters(filename, lines, error) CheckForNewlineAtEOF(filename, lines, error) def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error """ _SetVerboseLevel(vlevel) try: # Support the UNIX convention of using "-" for stdin. Note that # we are not opening the file with universal newline support # (which codecs doesn't support anyway), so the resulting lines do # contain trailing '\r' characters if we are reading a file that # has CRLF endings. # If after the split a trailing '\r' is present, it is removed # below. If it is not expected to be present (i.e. os.linesep != # '\r\n' as in Windows), a warning is issued below if this file # is processed. if filename == '-': lines = codecs.StreamReaderWriter(sys.stdin, codecs.getreader('utf8'), codecs.getwriter('utf8'), 'replace').read().split('\n') else: lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n') carriage_return_found = False # Remove trailing '\r'. for linenum in range(len(lines)): if lines[linenum].endswith('\r'): lines[linenum] = lines[linenum].rstrip('\r') carriage_return_found = True except IOError: sys.stderr.write( "Skipping input '%s': Can't open for reading\n" % filename) return # Note, if no dot is found, this will give the entire filename as the ext. file_extension = filename[filename.rfind('.') + 1:] # When reading from stdin, the extension is unknown, so no cpplint tests # should rely on the extension. if (filename != '-' and file_extension != 'cc' and file_extension != 'h' and file_extension != 'cpp'): sys.stderr.write('Ignoring %s; not a .cc or .h file\n' % filename) else: ProcessFileData(filename, file_extension, lines, Error, extra_check_functions) if carriage_return_found and os.linesep != '\r\n': # Use 0 for linenum since outputting only one error for potentially # several lines. Error(filename, 0, 'whitespace/newline', 1, 'One or more unexpected \\r (^M) found;' 'better to use only a \\n') sys.stderr.write('Done processing %s\n' % filename) def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1) def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0) def ParseArguments(args): """Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint. """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', 'counting=', 'filter=', 'root=']) except getopt.GetoptError: PrintUsage('Invalid arguments.') verbosity = _VerboseLevel() output_format = _OutputFormat() filters = '' counting_style = '' for (opt, val) in opts: if opt == '--help': PrintUsage(None) elif opt == '--output': if not val in ('emacs', 'vs7', 'eclipse'): PrintUsage('The only allowed output formats are emacs, vs7 and eclipse.') output_format = val elif opt == '--verbose': verbosity = int(val) elif opt == '--filter': filters = val if not filters: PrintCategories() elif opt == '--counting': if val not in ('total', 'toplevel', 'detailed'): PrintUsage('Valid counting options are total, toplevel, and detailed') counting_style = val elif opt == '--root': global _root _root = val if not filenames: PrintUsage('No files were specified.') _SetOutputFormat(output_format) _SetVerboseLevel(verbosity) _SetFilters(filters) _SetCountingStyle(counting_style) return filenames def main(): filenames = ParseArguments(sys.argv[1:]) # Change stderr to write with replacement characters so we don't die # if we try to print something containing non-ASCII characters. sys.stderr = codecs.StreamReaderWriter(sys.stderr, codecs.getreader('utf8'), codecs.getwriter('utf8'), 'replace') _cpplint_state.ResetErrorCounts() for filename in filenames: ProcessFile(filename, _cpplint_state.verbose_level) _cpplint_state.PrintErrorCounts() sys.exit(_cpplint_state.error_count > 0) if __name__ == '__main__': main() golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/scripts/litlint_test.py0000775000175000017500000000115512335206333032113 0ustar mwhudsonmwhudson#!/usr/bin/python # Tests for litlint.py # # Usage: python litlint_test.py # # Returns nonzero if any test fails import litlint import unittest class TestLintLine(unittest.TestCase): def test_missing_run(self): f = litlint.LintLine self.assertEqual(f(' %t '), ('missing %run before %t', 2)) self.assertEqual(f(' %t\n'), ('missing %run before %t', 2)) self.assertEqual(f(' %t.so '), (None, None)) self.assertEqual(f(' %t.o '), (None, None)) self.assertEqual(f('%run %t '), (None, None)) self.assertEqual(f('-o %t '), (None, None)) if __name__ == '__main__': unittest.main() golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_thread_registry.cc0000664000175000017500000002070313004730632033125 0ustar mwhudsonmwhudson//===-- sanitizer_thread_registry.cc --------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between sanitizer tools. // // General thread bookkeeping functionality. //===----------------------------------------------------------------------===// #include "sanitizer_thread_registry.h" namespace __sanitizer { ThreadContextBase::ThreadContextBase(u32 tid) : tid(tid), unique_id(0), reuse_count(), os_id(0), user_id(0), status(ThreadStatusInvalid), detached(false), parent_tid(0), next(0) { name[0] = '\0'; } ThreadContextBase::~ThreadContextBase() { // ThreadContextBase should never be deleted. CHECK(0); } void ThreadContextBase::SetName(const char *new_name) { name[0] = '\0'; if (new_name) { internal_strncpy(name, new_name, sizeof(name)); name[sizeof(name) - 1] = '\0'; } } void ThreadContextBase::SetDead() { CHECK(status == ThreadStatusRunning || status == ThreadStatusFinished); status = ThreadStatusDead; user_id = 0; OnDead(); } void ThreadContextBase::SetJoined(void *arg) { // FIXME(dvyukov): print message and continue (it's user error). CHECK_EQ(false, detached); CHECK_EQ(ThreadStatusFinished, status); status = ThreadStatusDead; user_id = 0; OnJoined(arg); } void ThreadContextBase::SetFinished() { if (!detached) status = ThreadStatusFinished; OnFinished(); } void ThreadContextBase::SetStarted(uptr _os_id, void *arg) { status = ThreadStatusRunning; os_id = _os_id; OnStarted(arg); } void ThreadContextBase::SetCreated(uptr _user_id, u64 _unique_id, bool _detached, u32 _parent_tid, void *arg) { status = ThreadStatusCreated; user_id = _user_id; unique_id = _unique_id; detached = _detached; // Parent tid makes no sense for the main thread. if (tid != 0) parent_tid = _parent_tid; OnCreated(arg); } void ThreadContextBase::Reset() { status = ThreadStatusInvalid; SetName(0); OnReset(); } // ThreadRegistry implementation. const u32 ThreadRegistry::kUnknownTid = ~0U; ThreadRegistry::ThreadRegistry(ThreadContextFactory factory, u32 max_threads, u32 thread_quarantine_size, u32 max_reuse) : context_factory_(factory), max_threads_(max_threads), thread_quarantine_size_(thread_quarantine_size), max_reuse_(max_reuse), mtx_(), n_contexts_(0), total_threads_(0), alive_threads_(0), max_alive_threads_(0), running_threads_(0) { threads_ = (ThreadContextBase **)MmapOrDie(max_threads_ * sizeof(threads_[0]), "ThreadRegistry"); dead_threads_.clear(); invalid_threads_.clear(); } void ThreadRegistry::GetNumberOfThreads(uptr *total, uptr *running, uptr *alive) { BlockingMutexLock l(&mtx_); if (total) *total = n_contexts_; if (running) *running = running_threads_; if (alive) *alive = alive_threads_; } uptr ThreadRegistry::GetMaxAliveThreads() { BlockingMutexLock l(&mtx_); return max_alive_threads_; } u32 ThreadRegistry::CreateThread(uptr user_id, bool detached, u32 parent_tid, void *arg) { BlockingMutexLock l(&mtx_); u32 tid = kUnknownTid; ThreadContextBase *tctx = QuarantinePop(); if (tctx) { tid = tctx->tid; } else if (n_contexts_ < max_threads_) { // Allocate new thread context and tid. tid = n_contexts_++; tctx = context_factory_(tid); threads_[tid] = tctx; } else { #if !SANITIZER_GO Report("%s: Thread limit (%u threads) exceeded. Dying.\n", SanitizerToolName, max_threads_); #else Printf("race: limit on %u simultaneously alive goroutines is exceeded," " dying\n", max_threads_); #endif Die(); } CHECK_NE(tctx, 0); CHECK_NE(tid, kUnknownTid); CHECK_LT(tid, max_threads_); CHECK_EQ(tctx->status, ThreadStatusInvalid); alive_threads_++; if (max_alive_threads_ < alive_threads_) { max_alive_threads_++; CHECK_EQ(alive_threads_, max_alive_threads_); } tctx->SetCreated(user_id, total_threads_++, detached, parent_tid, arg); return tid; } void ThreadRegistry::RunCallbackForEachThreadLocked(ThreadCallback cb, void *arg) { CheckLocked(); for (u32 tid = 0; tid < n_contexts_; tid++) { ThreadContextBase *tctx = threads_[tid]; if (tctx == 0) continue; cb(tctx, arg); } } u32 ThreadRegistry::FindThread(FindThreadCallback cb, void *arg) { BlockingMutexLock l(&mtx_); for (u32 tid = 0; tid < n_contexts_; tid++) { ThreadContextBase *tctx = threads_[tid]; if (tctx != 0 && cb(tctx, arg)) return tctx->tid; } return kUnknownTid; } ThreadContextBase * ThreadRegistry::FindThreadContextLocked(FindThreadCallback cb, void *arg) { CheckLocked(); for (u32 tid = 0; tid < n_contexts_; tid++) { ThreadContextBase *tctx = threads_[tid]; if (tctx != 0 && cb(tctx, arg)) return tctx; } return 0; } static bool FindThreadContextByOsIdCallback(ThreadContextBase *tctx, void *arg) { return (tctx->os_id == (uptr)arg && tctx->status != ThreadStatusInvalid && tctx->status != ThreadStatusDead); } ThreadContextBase *ThreadRegistry::FindThreadContextByOsIDLocked(uptr os_id) { return FindThreadContextLocked(FindThreadContextByOsIdCallback, (void *)os_id); } void ThreadRegistry::SetThreadName(u32 tid, const char *name) { BlockingMutexLock l(&mtx_); CHECK_LT(tid, n_contexts_); ThreadContextBase *tctx = threads_[tid]; CHECK_NE(tctx, 0); CHECK_EQ(ThreadStatusRunning, tctx->status); tctx->SetName(name); } void ThreadRegistry::SetThreadNameByUserId(uptr user_id, const char *name) { BlockingMutexLock l(&mtx_); for (u32 tid = 0; tid < n_contexts_; tid++) { ThreadContextBase *tctx = threads_[tid]; if (tctx != 0 && tctx->user_id == user_id && tctx->status != ThreadStatusInvalid) { tctx->SetName(name); return; } } } void ThreadRegistry::DetachThread(u32 tid, void *arg) { BlockingMutexLock l(&mtx_); CHECK_LT(tid, n_contexts_); ThreadContextBase *tctx = threads_[tid]; CHECK_NE(tctx, 0); if (tctx->status == ThreadStatusInvalid) { Report("%s: Detach of non-existent thread\n", SanitizerToolName); return; } tctx->OnDetached(arg); if (tctx->status == ThreadStatusFinished) { tctx->SetDead(); QuarantinePush(tctx); } else { tctx->detached = true; } } void ThreadRegistry::JoinThread(u32 tid, void *arg) { BlockingMutexLock l(&mtx_); CHECK_LT(tid, n_contexts_); ThreadContextBase *tctx = threads_[tid]; CHECK_NE(tctx, 0); if (tctx->status == ThreadStatusInvalid) { Report("%s: Join of non-existent thread\n", SanitizerToolName); return; } tctx->SetJoined(arg); QuarantinePush(tctx); } void ThreadRegistry::FinishThread(u32 tid) { BlockingMutexLock l(&mtx_); CHECK_GT(alive_threads_, 0); alive_threads_--; CHECK_GT(running_threads_, 0); running_threads_--; CHECK_LT(tid, n_contexts_); ThreadContextBase *tctx = threads_[tid]; CHECK_NE(tctx, 0); CHECK_EQ(ThreadStatusRunning, tctx->status); tctx->SetFinished(); if (tctx->detached) { tctx->SetDead(); QuarantinePush(tctx); } } void ThreadRegistry::StartThread(u32 tid, uptr os_id, void *arg) { BlockingMutexLock l(&mtx_); running_threads_++; CHECK_LT(tid, n_contexts_); ThreadContextBase *tctx = threads_[tid]; CHECK_NE(tctx, 0); CHECK_EQ(ThreadStatusCreated, tctx->status); tctx->SetStarted(os_id, arg); } void ThreadRegistry::QuarantinePush(ThreadContextBase *tctx) { if (tctx->tid == 0) return; // Don't reuse the main thread. It's a special snowflake. dead_threads_.push_back(tctx); if (dead_threads_.size() <= thread_quarantine_size_) return; tctx = dead_threads_.front(); dead_threads_.pop_front(); CHECK_EQ(tctx->status, ThreadStatusDead); tctx->Reset(); tctx->reuse_count++; if (max_reuse_ > 0 && tctx->reuse_count >= max_reuse_) return; invalid_threads_.push_back(tctx); } ThreadContextBase *ThreadRegistry::QuarantinePop() { if (invalid_threads_.size() == 0) return 0; ThreadContextBase *tctx = invalid_threads_.front(); invalid_threads_.pop_front(); return tctx; } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_addrhashmap.h0000664000175000017500000002162112602553450032050 0ustar mwhudsonmwhudson//===-- sanitizer_addrhashmap.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Concurrent uptr->T hashmap. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ADDRHASHMAP_H #define SANITIZER_ADDRHASHMAP_H #include "sanitizer_common.h" #include "sanitizer_mutex.h" #include "sanitizer_atomic.h" #include "sanitizer_allocator_internal.h" namespace __sanitizer { // Concurrent uptr->T hashmap. // T must be a POD type, kSize is preferably a prime but can be any number. // Usage example: // // typedef AddrHashMap Map; // Map m; // { // Map::Handle h(&m, addr); // use h.operator->() to access the data // if h.created() then the element was just created, and the current thread // has exclusive access to it // otherwise the current thread has only read access to the data // } // { // Map::Handle h(&m, addr, true); // this will remove the data from the map in Handle dtor // the current thread has exclusive access to the data // if !h.exists() then the element never existed // } template class AddrHashMap { private: struct Cell { atomic_uintptr_t addr; T val; }; struct AddBucket { uptr cap; uptr size; Cell cells[1]; // variable len }; static const uptr kBucketSize = 3; struct Bucket { RWMutex mtx; atomic_uintptr_t add; Cell cells[kBucketSize]; }; public: AddrHashMap(); class Handle { public: Handle(AddrHashMap *map, uptr addr); Handle(AddrHashMap *map, uptr addr, bool remove); Handle(AddrHashMap *map, uptr addr, bool remove, bool create); ~Handle(); T *operator->(); bool created() const; bool exists() const; private: friend AddrHashMap; AddrHashMap *map_; Bucket *bucket_; Cell *cell_; uptr addr_; uptr addidx_; bool created_; bool remove_; bool create_; }; private: friend class Handle; Bucket *table_; void acquire(Handle *h); void release(Handle *h); uptr calcHash(uptr addr); }; template AddrHashMap::Handle::Handle(AddrHashMap *map, uptr addr) { map_ = map; addr_ = addr; remove_ = false; create_ = true; map_->acquire(this); } template AddrHashMap::Handle::Handle(AddrHashMap *map, uptr addr, bool remove) { map_ = map; addr_ = addr; remove_ = remove; create_ = true; map_->acquire(this); } template AddrHashMap::Handle::Handle(AddrHashMap *map, uptr addr, bool remove, bool create) { map_ = map; addr_ = addr; remove_ = remove; create_ = create; map_->acquire(this); } template AddrHashMap::Handle::~Handle() { map_->release(this); } template T *AddrHashMap::Handle::operator->() { return &cell_->val; } template bool AddrHashMap::Handle::created() const { return created_; } template bool AddrHashMap::Handle::exists() const { return cell_ != nullptr; } template AddrHashMap::AddrHashMap() { table_ = (Bucket*)MmapOrDie(kSize * sizeof(table_[0]), "AddrHashMap"); } template void AddrHashMap::acquire(Handle *h) { uptr addr = h->addr_; uptr hash = calcHash(addr); Bucket *b = &table_[hash]; h->created_ = false; h->addidx_ = -1U; h->bucket_ = b; h->cell_ = nullptr; // If we want to remove the element, we need exclusive access to the bucket, // so skip the lock-free phase. if (h->remove_) goto locked; retry: // First try to find an existing element w/o read mutex. CHECK(!h->remove_); // Check the embed cells. for (uptr i = 0; i < kBucketSize; i++) { Cell *c = &b->cells[i]; uptr addr1 = atomic_load(&c->addr, memory_order_acquire); if (addr1 == addr) { h->cell_ = c; return; } } // Check the add cells with read lock. if (atomic_load(&b->add, memory_order_relaxed)) { b->mtx.ReadLock(); AddBucket *add = (AddBucket*)atomic_load(&b->add, memory_order_relaxed); for (uptr i = 0; i < add->size; i++) { Cell *c = &add->cells[i]; uptr addr1 = atomic_load(&c->addr, memory_order_relaxed); if (addr1 == addr) { h->addidx_ = i; h->cell_ = c; return; } } b->mtx.ReadUnlock(); } locked: // Re-check existence under write lock. // Embed cells. b->mtx.Lock(); for (uptr i = 0; i < kBucketSize; i++) { Cell *c = &b->cells[i]; uptr addr1 = atomic_load(&c->addr, memory_order_relaxed); if (addr1 == addr) { if (h->remove_) { h->cell_ = c; return; } b->mtx.Unlock(); goto retry; } } // Add cells. AddBucket *add = (AddBucket*)atomic_load(&b->add, memory_order_relaxed); if (add) { for (uptr i = 0; i < add->size; i++) { Cell *c = &add->cells[i]; uptr addr1 = atomic_load(&c->addr, memory_order_relaxed); if (addr1 == addr) { if (h->remove_) { h->addidx_ = i; h->cell_ = c; return; } b->mtx.Unlock(); goto retry; } } } // The element does not exist, no need to create it if we want to remove. if (h->remove_ || !h->create_) { b->mtx.Unlock(); return; } // Now try to create it under the mutex. h->created_ = true; // See if we have a free embed cell. for (uptr i = 0; i < kBucketSize; i++) { Cell *c = &b->cells[i]; uptr addr1 = atomic_load(&c->addr, memory_order_relaxed); if (addr1 == 0) { h->cell_ = c; return; } } // Store in the add cells. if (!add) { // Allocate a new add array. const uptr kInitSize = 64; add = (AddBucket*)InternalAlloc(kInitSize); internal_memset(add, 0, kInitSize); add->cap = (kInitSize - sizeof(*add)) / sizeof(add->cells[0]) + 1; add->size = 0; atomic_store(&b->add, (uptr)add, memory_order_relaxed); } if (add->size == add->cap) { // Grow existing add array. uptr oldsize = sizeof(*add) + (add->cap - 1) * sizeof(add->cells[0]); uptr newsize = oldsize * 2; AddBucket *add1 = (AddBucket*)InternalAlloc(newsize); internal_memset(add1, 0, newsize); add1->cap = (newsize - sizeof(*add)) / sizeof(add->cells[0]) + 1; add1->size = add->size; internal_memcpy(add1->cells, add->cells, add->size * sizeof(add->cells[0])); InternalFree(add); atomic_store(&b->add, (uptr)add1, memory_order_relaxed); add = add1; } // Store. uptr i = add->size++; Cell *c = &add->cells[i]; CHECK_EQ(atomic_load(&c->addr, memory_order_relaxed), 0); h->addidx_ = i; h->cell_ = c; } template void AddrHashMap::release(Handle *h) { if (!h->cell_) return; Bucket *b = h->bucket_; Cell *c = h->cell_; uptr addr1 = atomic_load(&c->addr, memory_order_relaxed); if (h->created_) { // Denote completion of insertion. CHECK_EQ(addr1, 0); // After the following store, the element becomes available // for lock-free reads. atomic_store(&c->addr, h->addr_, memory_order_release); b->mtx.Unlock(); } else if (h->remove_) { // Denote that the cell is empty now. CHECK_EQ(addr1, h->addr_); atomic_store(&c->addr, 0, memory_order_release); // See if we need to compact the bucket. AddBucket *add = (AddBucket*)atomic_load(&b->add, memory_order_relaxed); if (h->addidx_ == -1U) { // Removed from embed array, move an add element into the freed cell. if (add && add->size != 0) { uptr last = --add->size; Cell *c1 = &add->cells[last]; c->val = c1->val; uptr addr1 = atomic_load(&c1->addr, memory_order_relaxed); atomic_store(&c->addr, addr1, memory_order_release); atomic_store(&c1->addr, 0, memory_order_release); } } else { // Removed from add array, compact it. uptr last = --add->size; Cell *c1 = &add->cells[last]; if (c != c1) { *c = *c1; atomic_store(&c1->addr, 0, memory_order_relaxed); } } if (add && add->size == 0) { // FIXME(dvyukov): free add? } b->mtx.Unlock(); } else { CHECK_EQ(addr1, h->addr_); if (h->addidx_ != -1U) b->mtx.ReadUnlock(); } } template uptr AddrHashMap::calcHash(uptr addr) { addr += addr << 10; addr ^= addr >> 6; return addr % kSize; } } // namespace __sanitizer #endif // SANITIZER_ADDRHASHMAP_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_limits_posix.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_limits_posix.0000664000175000017500000014154212766606132034067 0ustar mwhudsonmwhudson//===-- sanitizer_platform_limits_posix.cc --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer common code. // // Sizes and layouts of platform-specific POSIX data structures. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC // Tests in this file assume that off_t-dependent data structures match the // libc ABI. For example, struct dirent here is what readdir() function (as // exported from libc) returns, and not the user-facing "dirent", which // depends on _FILE_OFFSET_BITS setting. // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below. #ifdef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS #endif #if SANITIZER_FREEBSD #define _WANT_RTENTRY #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !SANITIZER_IOS #include #endif #if !SANITIZER_ANDROID #include #include #endif #if SANITIZER_LINUX #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if SANITIZER_FREEBSD # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include #define _KERNEL // to declare 'shminfo' structure # include #undef _KERNEL #undef INLINE // to avoid clashes with sanitizers' definitions #endif #if SANITIZER_FREEBSD || SANITIZER_IOS #undef IOC_DIRMASK #endif #if SANITIZER_LINUX || SANITIZER_FREEBSD # include # include # if defined(__mips64) || defined(__aarch64__) || defined(__arm__) # include # ifdef __arm__ typedef struct user_fpregs elf_fpregset_t; # define ARM_VFPREGS_SIZE_ASAN (32 * 8 /*fpregs*/ + 4 /*fpscr*/) # if !defined(ARM_VFPREGS_SIZE) # define ARM_VFPREGS_SIZE ARM_VFPREGS_SIZE_ASAN # endif # endif # endif # include #endif #if !SANITIZER_ANDROID #include #include #include #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID #include #include #include #include #include #include #include #if HAVE_RPC_XDR_H # include #elif HAVE_TIRPC_RPC_XDR_H # include #endif #include #include #include #include #include #include #if defined(__mips64) # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #endif // SANITIZER_LINUX && !SANITIZER_ANDROID #if SANITIZER_ANDROID #include #include #include #include #endif #if SANITIZER_LINUX #include #include #include #include #endif // SANITIZER_LINUX #if SANITIZER_MAC #include #include #include #endif // Include these after system headers to avoid name clashes and ambiguities. #include "sanitizer_internal_defs.h" #include "sanitizer_platform_limits_posix.h" namespace __sanitizer { unsigned struct_utsname_sz = sizeof(struct utsname); unsigned struct_stat_sz = sizeof(struct stat); #if !SANITIZER_IOS && !SANITIZER_FREEBSD unsigned struct_stat64_sz = sizeof(struct stat64); #endif // !SANITIZER_IOS && !SANITIZER_FREEBSD unsigned struct_rusage_sz = sizeof(struct rusage); unsigned struct_tm_sz = sizeof(struct tm); unsigned struct_passwd_sz = sizeof(struct passwd); unsigned struct_group_sz = sizeof(struct group); unsigned siginfo_t_sz = sizeof(siginfo_t); unsigned struct_sigaction_sz = sizeof(struct sigaction); unsigned struct_itimerval_sz = sizeof(struct itimerval); unsigned pthread_t_sz = sizeof(pthread_t); unsigned pthread_cond_t_sz = sizeof(pthread_cond_t); unsigned pid_t_sz = sizeof(pid_t); unsigned timeval_sz = sizeof(timeval); unsigned uid_t_sz = sizeof(uid_t); unsigned gid_t_sz = sizeof(gid_t); unsigned mbstate_t_sz = sizeof(mbstate_t); unsigned sigset_t_sz = sizeof(sigset_t); unsigned struct_timezone_sz = sizeof(struct timezone); unsigned struct_tms_sz = sizeof(struct tms); unsigned struct_sigevent_sz = sizeof(struct sigevent); unsigned struct_sched_param_sz = sizeof(struct sched_param); #if SANITIZER_MAC && !SANITIZER_IOS unsigned struct_statfs64_sz = sizeof(struct statfs64); #endif // SANITIZER_MAC && !SANITIZER_IOS #if !SANITIZER_ANDROID unsigned struct_statfs_sz = sizeof(struct statfs); unsigned struct_sockaddr_sz = sizeof(struct sockaddr); unsigned ucontext_t_sz = sizeof(ucontext_t); #endif // !SANITIZER_ANDROID #if SANITIZER_LINUX unsigned struct_epoll_event_sz = sizeof(struct epoll_event); unsigned struct_sysinfo_sz = sizeof(struct sysinfo); unsigned __user_cap_header_struct_sz = sizeof(struct __user_cap_header_struct); unsigned __user_cap_data_struct_sz = sizeof(struct __user_cap_data_struct); unsigned struct_new_utsname_sz = sizeof(struct new_utsname); unsigned struct_old_utsname_sz = sizeof(struct old_utsname); unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname); #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD unsigned struct_rlimit_sz = sizeof(struct rlimit); unsigned struct_timespec_sz = sizeof(struct timespec); unsigned struct_utimbuf_sz = sizeof(struct utimbuf); unsigned struct_itimerspec_sz = sizeof(struct itimerspec); #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_LINUX && !SANITIZER_ANDROID unsigned struct_ustat_sz = sizeof(struct ustat); unsigned struct_rlimit64_sz = sizeof(struct rlimit64); unsigned struct_statvfs64_sz = sizeof(struct statvfs64); #endif // SANITIZER_LINUX && !SANITIZER_ANDROID #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID unsigned struct_timex_sz = sizeof(struct timex); unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds); unsigned struct_mq_attr_sz = sizeof(struct mq_attr); unsigned struct_statvfs_sz = sizeof(struct statvfs); #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID uptr sig_ign = (uptr)SIG_IGN; uptr sig_dfl = (uptr)SIG_DFL; uptr sa_siginfo = (uptr)SA_SIGINFO; #if SANITIZER_LINUX int e_tabsz = (int)E_TABSZ; #endif #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID unsigned struct_shminfo_sz = sizeof(struct shminfo); unsigned struct_shm_info_sz = sizeof(struct shm_info); int shmctl_ipc_stat = (int)IPC_STAT; int shmctl_ipc_info = (int)IPC_INFO; int shmctl_shm_info = (int)SHM_INFO; int shmctl_shm_stat = (int)SHM_STAT; #endif int map_fixed = MAP_FIXED; int af_inet = (int)AF_INET; int af_inet6 = (int)AF_INET6; uptr __sanitizer_in_addr_sz(int af) { if (af == AF_INET) return sizeof(struct in_addr); else if (af == AF_INET6) return sizeof(struct in6_addr); else return 0; } #if SANITIZER_LINUX unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr)); #elif SANITIZER_FREEBSD unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); #endif #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID int glob_nomatch = GLOB_NOMATCH; int glob_altdirfunc = GLOB_ALTDIRFUNC; #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID && \ (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \ defined(__s390__)) #if defined(__mips64) || defined(__powerpc64__) || defined(__arm__) unsigned struct_user_regs_struct_sz = sizeof(struct pt_regs); unsigned struct_user_fpregs_struct_sz = sizeof(elf_fpregset_t); #elif defined(__aarch64__) unsigned struct_user_regs_struct_sz = sizeof(struct user_pt_regs); unsigned struct_user_fpregs_struct_sz = sizeof(struct user_fpsimd_state); #elif defined(__s390__) unsigned struct_user_regs_struct_sz = sizeof(struct _user_regs_struct); unsigned struct_user_fpregs_struct_sz = sizeof(struct _user_fpregs_struct); #else unsigned struct_user_regs_struct_sz = sizeof(struct user_regs_struct); unsigned struct_user_fpregs_struct_sz = sizeof(struct user_fpregs_struct); #endif // __mips64 || __powerpc64__ || __aarch64__ #if defined(__x86_64) || defined(__mips64) || defined(__powerpc64__) || \ defined(__aarch64__) || defined(__arm__) || defined(__s390__) unsigned struct_user_fpxregs_struct_sz = 0; #else unsigned struct_user_fpxregs_struct_sz = sizeof(struct user_fpxregs_struct); #endif // __x86_64 || __mips64 || __powerpc64__ || __aarch64__ || __arm__ // || __s390__ #ifdef __arm__ unsigned struct_user_vfpregs_struct_sz = ARM_VFPREGS_SIZE; #else unsigned struct_user_vfpregs_struct_sz = 0; #endif int ptrace_peektext = PTRACE_PEEKTEXT; int ptrace_peekdata = PTRACE_PEEKDATA; int ptrace_peekuser = PTRACE_PEEKUSER; #if (defined(PTRACE_GETREGS) && defined(PTRACE_SETREGS)) || \ (defined(PT_GETREGS) && defined(PT_SETREGS)) int ptrace_getregs = PTRACE_GETREGS; int ptrace_setregs = PTRACE_SETREGS; #else int ptrace_getregs = -1; int ptrace_setregs = -1; #endif #if (defined(PTRACE_GETFPREGS) && defined(PTRACE_SETFPREGS)) || \ (defined(PT_GETFPREGS) && defined(PT_SETFPREGS)) int ptrace_getfpregs = PTRACE_GETFPREGS; int ptrace_setfpregs = PTRACE_SETFPREGS; #else int ptrace_getfpregs = -1; int ptrace_setfpregs = -1; #endif #if (defined(PTRACE_GETFPXREGS) && defined(PTRACE_SETFPXREGS)) || \ (defined(PT_GETFPXREGS) && defined(PT_SETFPXREGS)) int ptrace_getfpxregs = PTRACE_GETFPXREGS; int ptrace_setfpxregs = PTRACE_SETFPXREGS; #else int ptrace_getfpxregs = -1; int ptrace_setfpxregs = -1; #endif // PTRACE_GETFPXREGS/PTRACE_SETFPXREGS #if defined(PTRACE_GETVFPREGS) && defined(PTRACE_SETVFPREGS) int ptrace_getvfpregs = PTRACE_GETVFPREGS; int ptrace_setvfpregs = PTRACE_SETVFPREGS; #else int ptrace_getvfpregs = -1; int ptrace_setvfpregs = -1; #endif int ptrace_geteventmsg = PTRACE_GETEVENTMSG; #if (defined(PTRACE_GETSIGINFO) && defined(PTRACE_SETSIGINFO)) || \ (defined(PT_GETSIGINFO) && defined(PT_SETSIGINFO)) int ptrace_getsiginfo = PTRACE_GETSIGINFO; int ptrace_setsiginfo = PTRACE_SETSIGINFO; #else int ptrace_getsiginfo = -1; int ptrace_setsiginfo = -1; #endif // PTRACE_GETSIGINFO/PTRACE_SETSIGINFO #if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) int ptrace_getregset = PTRACE_GETREGSET; int ptrace_setregset = PTRACE_SETREGSET; #else int ptrace_getregset = -1; int ptrace_setregset = -1; #endif // PTRACE_GETREGSET/PTRACE_SETREGSET #endif unsigned path_max = PATH_MAX; // ioctl arguments unsigned struct_ifreq_sz = sizeof(struct ifreq); unsigned struct_termios_sz = sizeof(struct termios); unsigned struct_winsize_sz = sizeof(struct winsize); #if SANITIZER_LINUX unsigned struct_arpreq_sz = sizeof(struct arpreq); unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf); unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession); unsigned struct_cdrom_read_audio_sz = sizeof(struct cdrom_read_audio); unsigned struct_cdrom_subchnl_sz = sizeof(struct cdrom_subchnl); unsigned struct_cdrom_ti_sz = sizeof(struct cdrom_ti); unsigned struct_cdrom_tocentry_sz = sizeof(struct cdrom_tocentry); unsigned struct_cdrom_tochdr_sz = sizeof(struct cdrom_tochdr); unsigned struct_cdrom_volctrl_sz = sizeof(struct cdrom_volctrl); unsigned struct_ff_effect_sz = sizeof(struct ff_effect); unsigned struct_floppy_drive_params_sz = sizeof(struct floppy_drive_params); unsigned struct_floppy_drive_struct_sz = sizeof(struct floppy_drive_struct); unsigned struct_floppy_fdc_state_sz = sizeof(struct floppy_fdc_state); unsigned struct_floppy_max_errors_sz = sizeof(struct floppy_max_errors); unsigned struct_floppy_raw_cmd_sz = sizeof(struct floppy_raw_cmd); unsigned struct_floppy_struct_sz = sizeof(struct floppy_struct); unsigned struct_floppy_write_errors_sz = sizeof(struct floppy_write_errors); unsigned struct_format_descr_sz = sizeof(struct format_descr); unsigned struct_hd_driveid_sz = sizeof(struct hd_driveid); unsigned struct_hd_geometry_sz = sizeof(struct hd_geometry); unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo); unsigned struct_input_id_sz = sizeof(struct input_id); unsigned struct_mtpos_sz = sizeof(struct mtpos); unsigned struct_termio_sz = sizeof(struct termio); unsigned struct_vt_consize_sz = sizeof(struct vt_consize); unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes); unsigned struct_vt_stat_sz = sizeof(struct vt_stat); #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD #if SOUND_VERSION >= 0x040000 unsigned struct_copr_buffer_sz = 0; unsigned struct_copr_debug_buf_sz = 0; unsigned struct_copr_msg_sz = 0; #else unsigned struct_copr_buffer_sz = sizeof(struct copr_buffer); unsigned struct_copr_debug_buf_sz = sizeof(struct copr_debug_buf); unsigned struct_copr_msg_sz = sizeof(struct copr_msg); #endif unsigned struct_midi_info_sz = sizeof(struct midi_info); unsigned struct_mtget_sz = sizeof(struct mtget); unsigned struct_mtop_sz = sizeof(struct mtop); unsigned struct_rtentry_sz = sizeof(struct rtentry); unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument); unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec); unsigned struct_synth_info_sz = sizeof(struct synth_info); unsigned struct_vt_mode_sz = sizeof(struct vt_mode); #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_LINUX && !SANITIZER_ANDROID unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); #if EV_VERSION > (0x010000) unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); #else unsigned struct_input_keymap_entry_sz = 0; #endif unsigned struct_ipx_config_data_sz = sizeof(struct ipx_config_data); unsigned struct_kbdiacrs_sz = sizeof(struct kbdiacrs); unsigned struct_kbentry_sz = sizeof(struct kbentry); unsigned struct_kbkeycode_sz = sizeof(struct kbkeycode); unsigned struct_kbsentry_sz = sizeof(struct kbsentry); unsigned struct_mtconfiginfo_sz = sizeof(struct mtconfiginfo); unsigned struct_nr_parms_struct_sz = sizeof(struct nr_parms_struct); unsigned struct_scc_modem_sz = sizeof(struct scc_modem); unsigned struct_scc_stat_sz = sizeof(struct scc_stat); unsigned struct_serial_multiport_struct_sz = sizeof(struct serial_multiport_struct); unsigned struct_serial_struct_sz = sizeof(struct serial_struct); unsigned struct_sockaddr_ax25_sz = sizeof(struct sockaddr_ax25); unsigned struct_unimapdesc_sz = sizeof(struct unimapdesc); unsigned struct_unimapinit_sz = sizeof(struct unimapinit); #endif // SANITIZER_LINUX && !SANITIZER_ANDROID #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID unsigned struct_audio_buf_info_sz = sizeof(struct audio_buf_info); unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats); #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID #if !SANITIZER_ANDROID && !SANITIZER_MAC unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req); unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req); #endif const unsigned IOCTL_NOT_PRESENT = 0; unsigned IOCTL_FIOASYNC = FIOASYNC; unsigned IOCTL_FIOCLEX = FIOCLEX; unsigned IOCTL_FIOGETOWN = FIOGETOWN; unsigned IOCTL_FIONBIO = FIONBIO; unsigned IOCTL_FIONCLEX = FIONCLEX; unsigned IOCTL_FIOSETOWN = FIOSETOWN; unsigned IOCTL_SIOCADDMULTI = SIOCADDMULTI; unsigned IOCTL_SIOCATMARK = SIOCATMARK; unsigned IOCTL_SIOCDELMULTI = SIOCDELMULTI; unsigned IOCTL_SIOCGIFADDR = SIOCGIFADDR; unsigned IOCTL_SIOCGIFBRDADDR = SIOCGIFBRDADDR; unsigned IOCTL_SIOCGIFCONF = SIOCGIFCONF; unsigned IOCTL_SIOCGIFDSTADDR = SIOCGIFDSTADDR; unsigned IOCTL_SIOCGIFFLAGS = SIOCGIFFLAGS; unsigned IOCTL_SIOCGIFMETRIC = SIOCGIFMETRIC; unsigned IOCTL_SIOCGIFMTU = SIOCGIFMTU; unsigned IOCTL_SIOCGIFNETMASK = SIOCGIFNETMASK; unsigned IOCTL_SIOCGPGRP = SIOCGPGRP; unsigned IOCTL_SIOCSIFADDR = SIOCSIFADDR; unsigned IOCTL_SIOCSIFBRDADDR = SIOCSIFBRDADDR; unsigned IOCTL_SIOCSIFDSTADDR = SIOCSIFDSTADDR; unsigned IOCTL_SIOCSIFFLAGS = SIOCSIFFLAGS; unsigned IOCTL_SIOCSIFMETRIC = SIOCSIFMETRIC; unsigned IOCTL_SIOCSIFMTU = SIOCSIFMTU; unsigned IOCTL_SIOCSIFNETMASK = SIOCSIFNETMASK; unsigned IOCTL_SIOCSPGRP = SIOCSPGRP; unsigned IOCTL_TIOCCONS = TIOCCONS; unsigned IOCTL_TIOCEXCL = TIOCEXCL; unsigned IOCTL_TIOCGETD = TIOCGETD; unsigned IOCTL_TIOCGPGRP = TIOCGPGRP; unsigned IOCTL_TIOCGWINSZ = TIOCGWINSZ; unsigned IOCTL_TIOCMBIC = TIOCMBIC; unsigned IOCTL_TIOCMBIS = TIOCMBIS; unsigned IOCTL_TIOCMGET = TIOCMGET; unsigned IOCTL_TIOCMSET = TIOCMSET; unsigned IOCTL_TIOCNOTTY = TIOCNOTTY; unsigned IOCTL_TIOCNXCL = TIOCNXCL; unsigned IOCTL_TIOCOUTQ = TIOCOUTQ; unsigned IOCTL_TIOCPKT = TIOCPKT; unsigned IOCTL_TIOCSCTTY = TIOCSCTTY; unsigned IOCTL_TIOCSETD = TIOCSETD; unsigned IOCTL_TIOCSPGRP = TIOCSPGRP; unsigned IOCTL_TIOCSTI = TIOCSTI; unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ; #if ((SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID) unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT; unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT; #endif #if SANITIZER_LINUX unsigned IOCTL_EVIOCGABS = EVIOCGABS(0); unsigned IOCTL_EVIOCGBIT = EVIOCGBIT(0, 0); unsigned IOCTL_EVIOCGEFFECTS = EVIOCGEFFECTS; unsigned IOCTL_EVIOCGID = EVIOCGID; unsigned IOCTL_EVIOCGKEY = EVIOCGKEY(0); unsigned IOCTL_EVIOCGKEYCODE = EVIOCGKEYCODE; unsigned IOCTL_EVIOCGLED = EVIOCGLED(0); unsigned IOCTL_EVIOCGNAME = EVIOCGNAME(0); unsigned IOCTL_EVIOCGPHYS = EVIOCGPHYS(0); unsigned IOCTL_EVIOCGRAB = EVIOCGRAB; unsigned IOCTL_EVIOCGREP = EVIOCGREP; unsigned IOCTL_EVIOCGSND = EVIOCGSND(0); unsigned IOCTL_EVIOCGSW = EVIOCGSW(0); unsigned IOCTL_EVIOCGUNIQ = EVIOCGUNIQ(0); unsigned IOCTL_EVIOCGVERSION = EVIOCGVERSION; unsigned IOCTL_EVIOCRMFF = EVIOCRMFF; unsigned IOCTL_EVIOCSABS = EVIOCSABS(0); unsigned IOCTL_EVIOCSFF = EVIOCSFF; unsigned IOCTL_EVIOCSKEYCODE = EVIOCSKEYCODE; unsigned IOCTL_EVIOCSREP = EVIOCSREP; unsigned IOCTL_BLKFLSBUF = BLKFLSBUF; unsigned IOCTL_BLKGETSIZE = BLKGETSIZE; unsigned IOCTL_BLKRAGET = BLKRAGET; unsigned IOCTL_BLKRASET = BLKRASET; unsigned IOCTL_BLKROGET = BLKROGET; unsigned IOCTL_BLKROSET = BLKROSET; unsigned IOCTL_BLKRRPART = BLKRRPART; unsigned IOCTL_CDROMAUDIOBUFSIZ = CDROMAUDIOBUFSIZ; unsigned IOCTL_CDROMEJECT = CDROMEJECT; unsigned IOCTL_CDROMEJECT_SW = CDROMEJECT_SW; unsigned IOCTL_CDROMMULTISESSION = CDROMMULTISESSION; unsigned IOCTL_CDROMPAUSE = CDROMPAUSE; unsigned IOCTL_CDROMPLAYMSF = CDROMPLAYMSF; unsigned IOCTL_CDROMPLAYTRKIND = CDROMPLAYTRKIND; unsigned IOCTL_CDROMREADAUDIO = CDROMREADAUDIO; unsigned IOCTL_CDROMREADCOOKED = CDROMREADCOOKED; unsigned IOCTL_CDROMREADMODE1 = CDROMREADMODE1; unsigned IOCTL_CDROMREADMODE2 = CDROMREADMODE2; unsigned IOCTL_CDROMREADRAW = CDROMREADRAW; unsigned IOCTL_CDROMREADTOCENTRY = CDROMREADTOCENTRY; unsigned IOCTL_CDROMREADTOCHDR = CDROMREADTOCHDR; unsigned IOCTL_CDROMRESET = CDROMRESET; unsigned IOCTL_CDROMRESUME = CDROMRESUME; unsigned IOCTL_CDROMSEEK = CDROMSEEK; unsigned IOCTL_CDROMSTART = CDROMSTART; unsigned IOCTL_CDROMSTOP = CDROMSTOP; unsigned IOCTL_CDROMSUBCHNL = CDROMSUBCHNL; unsigned IOCTL_CDROMVOLCTRL = CDROMVOLCTRL; unsigned IOCTL_CDROMVOLREAD = CDROMVOLREAD; unsigned IOCTL_CDROM_GET_UPC = CDROM_GET_UPC; unsigned IOCTL_FDCLRPRM = FDCLRPRM; unsigned IOCTL_FDDEFPRM = FDDEFPRM; unsigned IOCTL_FDFLUSH = FDFLUSH; unsigned IOCTL_FDFMTBEG = FDFMTBEG; unsigned IOCTL_FDFMTEND = FDFMTEND; unsigned IOCTL_FDFMTTRK = FDFMTTRK; unsigned IOCTL_FDGETDRVPRM = FDGETDRVPRM; unsigned IOCTL_FDGETDRVSTAT = FDGETDRVSTAT; unsigned IOCTL_FDGETDRVTYP = FDGETDRVTYP; unsigned IOCTL_FDGETFDCSTAT = FDGETFDCSTAT; unsigned IOCTL_FDGETMAXERRS = FDGETMAXERRS; unsigned IOCTL_FDGETPRM = FDGETPRM; unsigned IOCTL_FDMSGOFF = FDMSGOFF; unsigned IOCTL_FDMSGON = FDMSGON; unsigned IOCTL_FDPOLLDRVSTAT = FDPOLLDRVSTAT; unsigned IOCTL_FDRAWCMD = FDRAWCMD; unsigned IOCTL_FDRESET = FDRESET; unsigned IOCTL_FDSETDRVPRM = FDSETDRVPRM; unsigned IOCTL_FDSETEMSGTRESH = FDSETEMSGTRESH; unsigned IOCTL_FDSETMAXERRS = FDSETMAXERRS; unsigned IOCTL_FDSETPRM = FDSETPRM; unsigned IOCTL_FDTWADDLE = FDTWADDLE; unsigned IOCTL_FDWERRORCLR = FDWERRORCLR; unsigned IOCTL_FDWERRORGET = FDWERRORGET; unsigned IOCTL_HDIO_DRIVE_CMD = HDIO_DRIVE_CMD; unsigned IOCTL_HDIO_GETGEO = HDIO_GETGEO; unsigned IOCTL_HDIO_GET_32BIT = HDIO_GET_32BIT; unsigned IOCTL_HDIO_GET_DMA = HDIO_GET_DMA; unsigned IOCTL_HDIO_GET_IDENTITY = HDIO_GET_IDENTITY; unsigned IOCTL_HDIO_GET_KEEPSETTINGS = HDIO_GET_KEEPSETTINGS; unsigned IOCTL_HDIO_GET_MULTCOUNT = HDIO_GET_MULTCOUNT; unsigned IOCTL_HDIO_GET_NOWERR = HDIO_GET_NOWERR; unsigned IOCTL_HDIO_GET_UNMASKINTR = HDIO_GET_UNMASKINTR; unsigned IOCTL_HDIO_SET_32BIT = HDIO_SET_32BIT; unsigned IOCTL_HDIO_SET_DMA = HDIO_SET_DMA; unsigned IOCTL_HDIO_SET_KEEPSETTINGS = HDIO_SET_KEEPSETTINGS; unsigned IOCTL_HDIO_SET_MULTCOUNT = HDIO_SET_MULTCOUNT; unsigned IOCTL_HDIO_SET_NOWERR = HDIO_SET_NOWERR; unsigned IOCTL_HDIO_SET_UNMASKINTR = HDIO_SET_UNMASKINTR; unsigned IOCTL_MTIOCPOS = MTIOCPOS; unsigned IOCTL_PPPIOCGASYNCMAP = PPPIOCGASYNCMAP; unsigned IOCTL_PPPIOCGDEBUG = PPPIOCGDEBUG; unsigned IOCTL_PPPIOCGFLAGS = PPPIOCGFLAGS; unsigned IOCTL_PPPIOCGUNIT = PPPIOCGUNIT; unsigned IOCTL_PPPIOCGXASYNCMAP = PPPIOCGXASYNCMAP; unsigned IOCTL_PPPIOCSASYNCMAP = PPPIOCSASYNCMAP; unsigned IOCTL_PPPIOCSDEBUG = PPPIOCSDEBUG; unsigned IOCTL_PPPIOCSFLAGS = PPPIOCSFLAGS; unsigned IOCTL_PPPIOCSMAXCID = PPPIOCSMAXCID; unsigned IOCTL_PPPIOCSMRU = PPPIOCSMRU; unsigned IOCTL_PPPIOCSXASYNCMAP = PPPIOCSXASYNCMAP; unsigned IOCTL_SIOCADDRT = SIOCADDRT; unsigned IOCTL_SIOCDARP = SIOCDARP; unsigned IOCTL_SIOCDELRT = SIOCDELRT; unsigned IOCTL_SIOCDRARP = SIOCDRARP; unsigned IOCTL_SIOCGARP = SIOCGARP; unsigned IOCTL_SIOCGIFENCAP = SIOCGIFENCAP; unsigned IOCTL_SIOCGIFHWADDR = SIOCGIFHWADDR; unsigned IOCTL_SIOCGIFMAP = SIOCGIFMAP; unsigned IOCTL_SIOCGIFMEM = SIOCGIFMEM; unsigned IOCTL_SIOCGIFNAME = SIOCGIFNAME; unsigned IOCTL_SIOCGIFSLAVE = SIOCGIFSLAVE; unsigned IOCTL_SIOCGRARP = SIOCGRARP; unsigned IOCTL_SIOCGSTAMP = SIOCGSTAMP; unsigned IOCTL_SIOCSARP = SIOCSARP; unsigned IOCTL_SIOCSIFENCAP = SIOCSIFENCAP; unsigned IOCTL_SIOCSIFHWADDR = SIOCSIFHWADDR; unsigned IOCTL_SIOCSIFLINK = SIOCSIFLINK; unsigned IOCTL_SIOCSIFMAP = SIOCSIFMAP; unsigned IOCTL_SIOCSIFMEM = SIOCSIFMEM; unsigned IOCTL_SIOCSIFSLAVE = SIOCSIFSLAVE; unsigned IOCTL_SIOCSRARP = SIOCSRARP; # if SOUND_VERSION >= 0x040000 unsigned IOCTL_SNDCTL_COPR_HALT = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_LOAD = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_RCODE = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_RCVMSG = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_RDATA = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_RESET = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_RUN = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_SENDMSG = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_WCODE = IOCTL_NOT_PRESENT; unsigned IOCTL_SNDCTL_COPR_WDATA = IOCTL_NOT_PRESENT; unsigned IOCTL_SOUND_PCM_READ_BITS = IOCTL_NOT_PRESENT; unsigned IOCTL_SOUND_PCM_READ_CHANNELS = IOCTL_NOT_PRESENT; unsigned IOCTL_SOUND_PCM_READ_FILTER = IOCTL_NOT_PRESENT; unsigned IOCTL_SOUND_PCM_READ_RATE = IOCTL_NOT_PRESENT; unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS = IOCTL_NOT_PRESENT; unsigned IOCTL_SOUND_PCM_WRITE_FILTER = IOCTL_NOT_PRESENT; # else // SOUND_VERSION unsigned IOCTL_SNDCTL_COPR_HALT = SNDCTL_COPR_HALT; unsigned IOCTL_SNDCTL_COPR_LOAD = SNDCTL_COPR_LOAD; unsigned IOCTL_SNDCTL_COPR_RCODE = SNDCTL_COPR_RCODE; unsigned IOCTL_SNDCTL_COPR_RCVMSG = SNDCTL_COPR_RCVMSG; unsigned IOCTL_SNDCTL_COPR_RDATA = SNDCTL_COPR_RDATA; unsigned IOCTL_SNDCTL_COPR_RESET = SNDCTL_COPR_RESET; unsigned IOCTL_SNDCTL_COPR_RUN = SNDCTL_COPR_RUN; unsigned IOCTL_SNDCTL_COPR_SENDMSG = SNDCTL_COPR_SENDMSG; unsigned IOCTL_SNDCTL_COPR_WCODE = SNDCTL_COPR_WCODE; unsigned IOCTL_SNDCTL_COPR_WDATA = SNDCTL_COPR_WDATA; unsigned IOCTL_SOUND_PCM_READ_BITS = SOUND_PCM_READ_BITS; unsigned IOCTL_SOUND_PCM_READ_CHANNELS = SOUND_PCM_READ_CHANNELS; unsigned IOCTL_SOUND_PCM_READ_FILTER = SOUND_PCM_READ_FILTER; unsigned IOCTL_SOUND_PCM_READ_RATE = SOUND_PCM_READ_RATE; unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS = SOUND_PCM_WRITE_CHANNELS; unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER; #endif // SOUND_VERSION unsigned IOCTL_TCFLSH = TCFLSH; unsigned IOCTL_TCGETA = TCGETA; unsigned IOCTL_TCGETS = TCGETS; unsigned IOCTL_TCSBRK = TCSBRK; unsigned IOCTL_TCSBRKP = TCSBRKP; unsigned IOCTL_TCSETA = TCSETA; unsigned IOCTL_TCSETAF = TCSETAF; unsigned IOCTL_TCSETAW = TCSETAW; unsigned IOCTL_TCSETS = TCSETS; unsigned IOCTL_TCSETSF = TCSETSF; unsigned IOCTL_TCSETSW = TCSETSW; unsigned IOCTL_TCXONC = TCXONC; unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS; unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR; unsigned IOCTL_TIOCINQ = TIOCINQ; unsigned IOCTL_TIOCLINUX = TIOCLINUX; unsigned IOCTL_TIOCSERCONFIG = TIOCSERCONFIG; unsigned IOCTL_TIOCSERGETLSR = TIOCSERGETLSR; unsigned IOCTL_TIOCSERGWILD = TIOCSERGWILD; unsigned IOCTL_TIOCSERSWILD = TIOCSERSWILD; unsigned IOCTL_TIOCSLCKTRMIOS = TIOCSLCKTRMIOS; unsigned IOCTL_TIOCSSOFTCAR = TIOCSSOFTCAR; unsigned IOCTL_VT_DISALLOCATE = VT_DISALLOCATE; unsigned IOCTL_VT_GETSTATE = VT_GETSTATE; unsigned IOCTL_VT_RESIZE = VT_RESIZE; unsigned IOCTL_VT_RESIZEX = VT_RESIZEX; unsigned IOCTL_VT_SENDSIG = VT_SENDSIG; #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD unsigned IOCTL_MTIOCGET = MTIOCGET; unsigned IOCTL_MTIOCTOP = MTIOCTOP; unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE = SNDCTL_DSP_GETBLKSIZE; unsigned IOCTL_SNDCTL_DSP_GETFMTS = SNDCTL_DSP_GETFMTS; unsigned IOCTL_SNDCTL_DSP_NONBLOCK = SNDCTL_DSP_NONBLOCK; unsigned IOCTL_SNDCTL_DSP_POST = SNDCTL_DSP_POST; unsigned IOCTL_SNDCTL_DSP_RESET = SNDCTL_DSP_RESET; unsigned IOCTL_SNDCTL_DSP_SETFMT = SNDCTL_DSP_SETFMT; unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT = SNDCTL_DSP_SETFRAGMENT; unsigned IOCTL_SNDCTL_DSP_SPEED = SNDCTL_DSP_SPEED; unsigned IOCTL_SNDCTL_DSP_STEREO = SNDCTL_DSP_STEREO; unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE = SNDCTL_DSP_SUBDIVIDE; unsigned IOCTL_SNDCTL_DSP_SYNC = SNDCTL_DSP_SYNC; unsigned IOCTL_SNDCTL_FM_4OP_ENABLE = SNDCTL_FM_4OP_ENABLE; unsigned IOCTL_SNDCTL_FM_LOAD_INSTR = SNDCTL_FM_LOAD_INSTR; unsigned IOCTL_SNDCTL_MIDI_INFO = SNDCTL_MIDI_INFO; unsigned IOCTL_SNDCTL_MIDI_PRETIME = SNDCTL_MIDI_PRETIME; unsigned IOCTL_SNDCTL_SEQ_CTRLRATE = SNDCTL_SEQ_CTRLRATE; unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT = SNDCTL_SEQ_GETINCOUNT; unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT = SNDCTL_SEQ_GETOUTCOUNT; unsigned IOCTL_SNDCTL_SEQ_NRMIDIS = SNDCTL_SEQ_NRMIDIS; unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS = SNDCTL_SEQ_NRSYNTHS; unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND = SNDCTL_SEQ_OUTOFBAND; unsigned IOCTL_SNDCTL_SEQ_PANIC = SNDCTL_SEQ_PANIC; unsigned IOCTL_SNDCTL_SEQ_PERCMODE = SNDCTL_SEQ_PERCMODE; unsigned IOCTL_SNDCTL_SEQ_RESET = SNDCTL_SEQ_RESET; unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES = SNDCTL_SEQ_RESETSAMPLES; unsigned IOCTL_SNDCTL_SEQ_SYNC = SNDCTL_SEQ_SYNC; unsigned IOCTL_SNDCTL_SEQ_TESTMIDI = SNDCTL_SEQ_TESTMIDI; unsigned IOCTL_SNDCTL_SEQ_THRESHOLD = SNDCTL_SEQ_THRESHOLD; unsigned IOCTL_SNDCTL_SYNTH_INFO = SNDCTL_SYNTH_INFO; unsigned IOCTL_SNDCTL_SYNTH_MEMAVL = SNDCTL_SYNTH_MEMAVL; unsigned IOCTL_SNDCTL_TMR_CONTINUE = SNDCTL_TMR_CONTINUE; unsigned IOCTL_SNDCTL_TMR_METRONOME = SNDCTL_TMR_METRONOME; unsigned IOCTL_SNDCTL_TMR_SELECT = SNDCTL_TMR_SELECT; unsigned IOCTL_SNDCTL_TMR_SOURCE = SNDCTL_TMR_SOURCE; unsigned IOCTL_SNDCTL_TMR_START = SNDCTL_TMR_START; unsigned IOCTL_SNDCTL_TMR_STOP = SNDCTL_TMR_STOP; unsigned IOCTL_SNDCTL_TMR_TEMPO = SNDCTL_TMR_TEMPO; unsigned IOCTL_SNDCTL_TMR_TIMEBASE = SNDCTL_TMR_TIMEBASE; unsigned IOCTL_SOUND_MIXER_READ_ALTPCM = SOUND_MIXER_READ_ALTPCM; unsigned IOCTL_SOUND_MIXER_READ_BASS = SOUND_MIXER_READ_BASS; unsigned IOCTL_SOUND_MIXER_READ_CAPS = SOUND_MIXER_READ_CAPS; unsigned IOCTL_SOUND_MIXER_READ_CD = SOUND_MIXER_READ_CD; unsigned IOCTL_SOUND_MIXER_READ_DEVMASK = SOUND_MIXER_READ_DEVMASK; unsigned IOCTL_SOUND_MIXER_READ_ENHANCE = SOUND_MIXER_READ_ENHANCE; unsigned IOCTL_SOUND_MIXER_READ_IGAIN = SOUND_MIXER_READ_IGAIN; unsigned IOCTL_SOUND_MIXER_READ_IMIX = SOUND_MIXER_READ_IMIX; unsigned IOCTL_SOUND_MIXER_READ_LINE = SOUND_MIXER_READ_LINE; unsigned IOCTL_SOUND_MIXER_READ_LINE1 = SOUND_MIXER_READ_LINE1; unsigned IOCTL_SOUND_MIXER_READ_LINE2 = SOUND_MIXER_READ_LINE2; unsigned IOCTL_SOUND_MIXER_READ_LINE3 = SOUND_MIXER_READ_LINE3; unsigned IOCTL_SOUND_MIXER_READ_LOUD = SOUND_MIXER_READ_LOUD; unsigned IOCTL_SOUND_MIXER_READ_MIC = SOUND_MIXER_READ_MIC; unsigned IOCTL_SOUND_MIXER_READ_MUTE = SOUND_MIXER_READ_MUTE; unsigned IOCTL_SOUND_MIXER_READ_OGAIN = SOUND_MIXER_READ_OGAIN; unsigned IOCTL_SOUND_MIXER_READ_PCM = SOUND_MIXER_READ_PCM; unsigned IOCTL_SOUND_MIXER_READ_RECLEV = SOUND_MIXER_READ_RECLEV; unsigned IOCTL_SOUND_MIXER_READ_RECMASK = SOUND_MIXER_READ_RECMASK; unsigned IOCTL_SOUND_MIXER_READ_RECSRC = SOUND_MIXER_READ_RECSRC; unsigned IOCTL_SOUND_MIXER_READ_SPEAKER = SOUND_MIXER_READ_SPEAKER; unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS = SOUND_MIXER_READ_STEREODEVS; unsigned IOCTL_SOUND_MIXER_READ_SYNTH = SOUND_MIXER_READ_SYNTH; unsigned IOCTL_SOUND_MIXER_READ_TREBLE = SOUND_MIXER_READ_TREBLE; unsigned IOCTL_SOUND_MIXER_READ_VOLUME = SOUND_MIXER_READ_VOLUME; unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM = SOUND_MIXER_WRITE_ALTPCM; unsigned IOCTL_SOUND_MIXER_WRITE_BASS = SOUND_MIXER_WRITE_BASS; unsigned IOCTL_SOUND_MIXER_WRITE_CD = SOUND_MIXER_WRITE_CD; unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE = SOUND_MIXER_WRITE_ENHANCE; unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN = SOUND_MIXER_WRITE_IGAIN; unsigned IOCTL_SOUND_MIXER_WRITE_IMIX = SOUND_MIXER_WRITE_IMIX; unsigned IOCTL_SOUND_MIXER_WRITE_LINE = SOUND_MIXER_WRITE_LINE; unsigned IOCTL_SOUND_MIXER_WRITE_LINE1 = SOUND_MIXER_WRITE_LINE1; unsigned IOCTL_SOUND_MIXER_WRITE_LINE2 = SOUND_MIXER_WRITE_LINE2; unsigned IOCTL_SOUND_MIXER_WRITE_LINE3 = SOUND_MIXER_WRITE_LINE3; unsigned IOCTL_SOUND_MIXER_WRITE_LOUD = SOUND_MIXER_WRITE_LOUD; unsigned IOCTL_SOUND_MIXER_WRITE_MIC = SOUND_MIXER_WRITE_MIC; unsigned IOCTL_SOUND_MIXER_WRITE_MUTE = SOUND_MIXER_WRITE_MUTE; unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN = SOUND_MIXER_WRITE_OGAIN; unsigned IOCTL_SOUND_MIXER_WRITE_PCM = SOUND_MIXER_WRITE_PCM; unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV = SOUND_MIXER_WRITE_RECLEV; unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC = SOUND_MIXER_WRITE_RECSRC; unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER = SOUND_MIXER_WRITE_SPEAKER; unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH = SOUND_MIXER_WRITE_SYNTH; unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE = SOUND_MIXER_WRITE_TREBLE; unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME = SOUND_MIXER_WRITE_VOLUME; unsigned IOCTL_VT_ACTIVATE = VT_ACTIVATE; unsigned IOCTL_VT_GETMODE = VT_GETMODE; unsigned IOCTL_VT_OPENQRY = VT_OPENQRY; unsigned IOCTL_VT_RELDISP = VT_RELDISP; unsigned IOCTL_VT_SETMODE = VT_SETMODE; unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE; #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_LINUX && !SANITIZER_ANDROID unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; unsigned IOCTL_CYGETMON = CYGETMON; unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; unsigned IOCTL_EQL_GETSLAVECFG = EQL_GETSLAVECFG; unsigned IOCTL_EQL_SETMASTRCFG = EQL_SETMASTRCFG; unsigned IOCTL_EQL_SETSLAVECFG = EQL_SETSLAVECFG; #if EV_VERSION > (0x010000) unsigned IOCTL_EVIOCGKEYCODE_V2 = EVIOCGKEYCODE_V2; unsigned IOCTL_EVIOCGPROP = EVIOCGPROP(0); unsigned IOCTL_EVIOCSKEYCODE_V2 = EVIOCSKEYCODE_V2; #else unsigned IOCTL_EVIOCGKEYCODE_V2 = IOCTL_NOT_PRESENT; unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; #endif unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; unsigned IOCTL_GIO_CMAP = GIO_CMAP; unsigned IOCTL_GIO_FONT = GIO_FONT; unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP; unsigned IOCTL_GIO_UNISCRNMAP = GIO_UNISCRNMAP; unsigned IOCTL_KDADDIO = KDADDIO; unsigned IOCTL_KDDELIO = KDDELIO; unsigned IOCTL_KDGETKEYCODE = KDGETKEYCODE; unsigned IOCTL_KDGKBDIACR = KDGKBDIACR; unsigned IOCTL_KDGKBENT = KDGKBENT; unsigned IOCTL_KDGKBLED = KDGKBLED; unsigned IOCTL_KDGKBMETA = KDGKBMETA; unsigned IOCTL_KDGKBSENT = KDGKBSENT; unsigned IOCTL_KDMAPDISP = KDMAPDISP; unsigned IOCTL_KDSETKEYCODE = KDSETKEYCODE; unsigned IOCTL_KDSIGACCEPT = KDSIGACCEPT; unsigned IOCTL_KDSKBDIACR = KDSKBDIACR; unsigned IOCTL_KDSKBENT = KDSKBENT; unsigned IOCTL_KDSKBLED = KDSKBLED; unsigned IOCTL_KDSKBMETA = KDSKBMETA; unsigned IOCTL_KDSKBSENT = KDSKBSENT; unsigned IOCTL_KDUNMAPDISP = KDUNMAPDISP; unsigned IOCTL_LPABORT = LPABORT; unsigned IOCTL_LPABORTOPEN = LPABORTOPEN; unsigned IOCTL_LPCAREFUL = LPCAREFUL; unsigned IOCTL_LPCHAR = LPCHAR; unsigned IOCTL_LPGETIRQ = LPGETIRQ; unsigned IOCTL_LPGETSTATUS = LPGETSTATUS; unsigned IOCTL_LPRESET = LPRESET; unsigned IOCTL_LPSETIRQ = LPSETIRQ; unsigned IOCTL_LPTIME = LPTIME; unsigned IOCTL_LPWAIT = LPWAIT; unsigned IOCTL_MTIOCGETCONFIG = MTIOCGETCONFIG; unsigned IOCTL_MTIOCSETCONFIG = MTIOCSETCONFIG; unsigned IOCTL_PIO_CMAP = PIO_CMAP; unsigned IOCTL_PIO_FONT = PIO_FONT; unsigned IOCTL_PIO_UNIMAP = PIO_UNIMAP; unsigned IOCTL_PIO_UNIMAPCLR = PIO_UNIMAPCLR; unsigned IOCTL_PIO_UNISCRNMAP = PIO_UNISCRNMAP; unsigned IOCTL_SCSI_IOCTL_GET_IDLUN = SCSI_IOCTL_GET_IDLUN; unsigned IOCTL_SCSI_IOCTL_PROBE_HOST = SCSI_IOCTL_PROBE_HOST; unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE = SCSI_IOCTL_TAGGED_DISABLE; unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE = SCSI_IOCTL_TAGGED_ENABLE; unsigned IOCTL_SIOCAIPXITFCRT = SIOCAIPXITFCRT; unsigned IOCTL_SIOCAIPXPRISLT = SIOCAIPXPRISLT; unsigned IOCTL_SIOCAX25ADDUID = SIOCAX25ADDUID; unsigned IOCTL_SIOCAX25DELUID = SIOCAX25DELUID; unsigned IOCTL_SIOCAX25GETPARMS = SIOCAX25GETPARMS; unsigned IOCTL_SIOCAX25GETUID = SIOCAX25GETUID; unsigned IOCTL_SIOCAX25NOUID = SIOCAX25NOUID; unsigned IOCTL_SIOCAX25SETPARMS = SIOCAX25SETPARMS; unsigned IOCTL_SIOCDEVPLIP = SIOCDEVPLIP; unsigned IOCTL_SIOCIPXCFGDATA = SIOCIPXCFGDATA; unsigned IOCTL_SIOCNRDECOBS = SIOCNRDECOBS; unsigned IOCTL_SIOCNRGETPARMS = SIOCNRGETPARMS; unsigned IOCTL_SIOCNRRTCTL = SIOCNRRTCTL; unsigned IOCTL_SIOCNRSETPARMS = SIOCNRSETPARMS; unsigned IOCTL_TIOCGSERIAL = TIOCGSERIAL; unsigned IOCTL_TIOCSERGETMULTI = TIOCSERGETMULTI; unsigned IOCTL_TIOCSERSETMULTI = TIOCSERSETMULTI; unsigned IOCTL_TIOCSSERIAL = TIOCSSERIAL; #endif // SANITIZER_LINUX && !SANITIZER_ANDROID #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID unsigned IOCTL_GIO_SCRNMAP = GIO_SCRNMAP; unsigned IOCTL_KDDISABIO = KDDISABIO; unsigned IOCTL_KDENABIO = KDENABIO; unsigned IOCTL_KDGETLED = KDGETLED; unsigned IOCTL_KDGETMODE = KDGETMODE; unsigned IOCTL_KDGKBMODE = KDGKBMODE; unsigned IOCTL_KDGKBTYPE = KDGKBTYPE; unsigned IOCTL_KDMKTONE = KDMKTONE; unsigned IOCTL_KDSETLED = KDSETLED; unsigned IOCTL_KDSETMODE = KDSETMODE; unsigned IOCTL_KDSKBMODE = KDSKBMODE; unsigned IOCTL_KIOCSOUND = KIOCSOUND; unsigned IOCTL_PIO_SCRNMAP = PIO_SCRNMAP; unsigned IOCTL_SNDCTL_DSP_GETISPACE = SNDCTL_DSP_GETISPACE; unsigned IOCTL_SNDCTL_DSP_GETOSPACE = SNDCTL_DSP_GETOSPACE; #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID const int errno_EINVAL = EINVAL; // EOWNERDEAD is not present in some older platforms. #if defined(EOWNERDEAD) const int errno_EOWNERDEAD = EOWNERDEAD; #else const int errno_EOWNERDEAD = -1; #endif const int si_SEGV_MAPERR = SEGV_MAPERR; const int si_SEGV_ACCERR = SEGV_ACCERR; } // namespace __sanitizer using namespace __sanitizer; COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t)); COMPILER_CHECK(sizeof(socklen_t) == sizeof(unsigned)); CHECK_TYPE_SIZE(pthread_key_t); #if SANITIZER_LINUX // FIXME: We define those on Linux and Mac, but only check on Linux. COMPILER_CHECK(IOC_NRBITS == _IOC_NRBITS); COMPILER_CHECK(IOC_TYPEBITS == _IOC_TYPEBITS); COMPILER_CHECK(IOC_SIZEBITS == _IOC_SIZEBITS); COMPILER_CHECK(IOC_DIRBITS == _IOC_DIRBITS); COMPILER_CHECK(IOC_NRMASK == _IOC_NRMASK); COMPILER_CHECK(IOC_TYPEMASK == _IOC_TYPEMASK); COMPILER_CHECK(IOC_SIZEMASK == _IOC_SIZEMASK); COMPILER_CHECK(IOC_DIRMASK == _IOC_DIRMASK); COMPILER_CHECK(IOC_NRSHIFT == _IOC_NRSHIFT); COMPILER_CHECK(IOC_TYPESHIFT == _IOC_TYPESHIFT); COMPILER_CHECK(IOC_SIZESHIFT == _IOC_SIZESHIFT); COMPILER_CHECK(IOC_DIRSHIFT == _IOC_DIRSHIFT); COMPILER_CHECK(IOC_NONE == _IOC_NONE); COMPILER_CHECK(IOC_WRITE == _IOC_WRITE); COMPILER_CHECK(IOC_READ == _IOC_READ); COMPILER_CHECK(EVIOC_ABS_MAX == ABS_MAX); COMPILER_CHECK(EVIOC_EV_MAX == EV_MAX); COMPILER_CHECK(IOC_SIZE(0x12345678) == _IOC_SIZE(0x12345678)); COMPILER_CHECK(IOC_DIR(0x12345678) == _IOC_DIR(0x12345678)); COMPILER_CHECK(IOC_NR(0x12345678) == _IOC_NR(0x12345678)); COMPILER_CHECK(IOC_TYPE(0x12345678) == _IOC_TYPE(0x12345678)); #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD // There are more undocumented fields in dl_phdr_info that we are not interested // in. COMPILER_CHECK(sizeof(__sanitizer_dl_phdr_info) <= sizeof(dl_phdr_info)); CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_addr); CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_name); CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr); CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum); #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID CHECK_TYPE_SIZE(glob_t); CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc); CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv); CHECK_SIZE_AND_OFFSET(glob_t, gl_offs); CHECK_SIZE_AND_OFFSET(glob_t, gl_flags); CHECK_SIZE_AND_OFFSET(glob_t, gl_closedir); CHECK_SIZE_AND_OFFSET(glob_t, gl_readdir); CHECK_SIZE_AND_OFFSET(glob_t, gl_opendir); CHECK_SIZE_AND_OFFSET(glob_t, gl_lstat); CHECK_SIZE_AND_OFFSET(glob_t, gl_stat); #endif CHECK_TYPE_SIZE(addrinfo); CHECK_SIZE_AND_OFFSET(addrinfo, ai_flags); CHECK_SIZE_AND_OFFSET(addrinfo, ai_family); CHECK_SIZE_AND_OFFSET(addrinfo, ai_socktype); CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol); CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol); CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen); CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname); CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr); CHECK_TYPE_SIZE(hostent); CHECK_SIZE_AND_OFFSET(hostent, h_name); CHECK_SIZE_AND_OFFSET(hostent, h_aliases); CHECK_SIZE_AND_OFFSET(hostent, h_addrtype); CHECK_SIZE_AND_OFFSET(hostent, h_length); CHECK_SIZE_AND_OFFSET(hostent, h_addr_list); CHECK_TYPE_SIZE(iovec); CHECK_SIZE_AND_OFFSET(iovec, iov_base); CHECK_SIZE_AND_OFFSET(iovec, iov_len); CHECK_TYPE_SIZE(msghdr); CHECK_SIZE_AND_OFFSET(msghdr, msg_name); CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen); CHECK_SIZE_AND_OFFSET(msghdr, msg_iov); CHECK_SIZE_AND_OFFSET(msghdr, msg_iovlen); CHECK_SIZE_AND_OFFSET(msghdr, msg_control); CHECK_SIZE_AND_OFFSET(msghdr, msg_controllen); CHECK_SIZE_AND_OFFSET(msghdr, msg_flags); CHECK_TYPE_SIZE(cmsghdr); CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len); CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level); CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent)); CHECK_SIZE_AND_OFFSET(dirent, d_ino); #if SANITIZER_MAC CHECK_SIZE_AND_OFFSET(dirent, d_seekoff); #elif SANITIZER_FREEBSD // There is no 'd_off' field on FreeBSD. #else CHECK_SIZE_AND_OFFSET(dirent, d_off); #endif CHECK_SIZE_AND_OFFSET(dirent, d_reclen); #if SANITIZER_LINUX && !SANITIZER_ANDROID COMPILER_CHECK(sizeof(__sanitizer_dirent64) <= sizeof(dirent64)); CHECK_SIZE_AND_OFFSET(dirent64, d_ino); CHECK_SIZE_AND_OFFSET(dirent64, d_off); CHECK_SIZE_AND_OFFSET(dirent64, d_reclen); #endif CHECK_TYPE_SIZE(ifconf); CHECK_SIZE_AND_OFFSET(ifconf, ifc_len); CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu); CHECK_TYPE_SIZE(pollfd); CHECK_SIZE_AND_OFFSET(pollfd, fd); CHECK_SIZE_AND_OFFSET(pollfd, events); CHECK_SIZE_AND_OFFSET(pollfd, revents); CHECK_TYPE_SIZE(nfds_t); CHECK_TYPE_SIZE(sigset_t); COMPILER_CHECK(sizeof(__sanitizer_sigaction) == sizeof(struct sigaction)); // Can't write checks for sa_handler and sa_sigaction due to them being // preprocessor macros. CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_mask); #ifndef __GLIBC_PREREQ #define __GLIBC_PREREQ(x, y) 0 #endif #if !defined(__s390x__) || __GLIBC_PREREQ (2, 20) // On s390x glibc 2.19 and earlier sa_flags was unsigned long, and sa_resv // didn't exist. CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_flags); #endif #if SANITIZER_LINUX && (!SANITIZER_ANDROID || !SANITIZER_MIPS32) CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_restorer); #endif #if SANITIZER_LINUX CHECK_TYPE_SIZE(__sysctl_args); CHECK_SIZE_AND_OFFSET(__sysctl_args, name); CHECK_SIZE_AND_OFFSET(__sysctl_args, nlen); CHECK_SIZE_AND_OFFSET(__sysctl_args, oldval); CHECK_SIZE_AND_OFFSET(__sysctl_args, oldlenp); CHECK_SIZE_AND_OFFSET(__sysctl_args, newval); CHECK_SIZE_AND_OFFSET(__sysctl_args, newlen); CHECK_TYPE_SIZE(__kernel_uid_t); CHECK_TYPE_SIZE(__kernel_gid_t); #if SANITIZER_USES_UID16_SYSCALLS CHECK_TYPE_SIZE(__kernel_old_uid_t); CHECK_TYPE_SIZE(__kernel_old_gid_t); #endif CHECK_TYPE_SIZE(__kernel_off_t); CHECK_TYPE_SIZE(__kernel_loff_t); CHECK_TYPE_SIZE(__kernel_fd_set); #endif #if !SANITIZER_ANDROID CHECK_TYPE_SIZE(wordexp_t); CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc); CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv); CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs); #endif CHECK_TYPE_SIZE(tm); CHECK_SIZE_AND_OFFSET(tm, tm_sec); CHECK_SIZE_AND_OFFSET(tm, tm_min); CHECK_SIZE_AND_OFFSET(tm, tm_hour); CHECK_SIZE_AND_OFFSET(tm, tm_mday); CHECK_SIZE_AND_OFFSET(tm, tm_mon); CHECK_SIZE_AND_OFFSET(tm, tm_year); CHECK_SIZE_AND_OFFSET(tm, tm_wday); CHECK_SIZE_AND_OFFSET(tm, tm_yday); CHECK_SIZE_AND_OFFSET(tm, tm_isdst); CHECK_SIZE_AND_OFFSET(tm, tm_gmtoff); CHECK_SIZE_AND_OFFSET(tm, tm_zone); #if SANITIZER_LINUX CHECK_TYPE_SIZE(mntent); CHECK_SIZE_AND_OFFSET(mntent, mnt_fsname); CHECK_SIZE_AND_OFFSET(mntent, mnt_dir); CHECK_SIZE_AND_OFFSET(mntent, mnt_type); CHECK_SIZE_AND_OFFSET(mntent, mnt_opts); CHECK_SIZE_AND_OFFSET(mntent, mnt_freq); CHECK_SIZE_AND_OFFSET(mntent, mnt_passno); #endif CHECK_TYPE_SIZE(ether_addr); #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID CHECK_TYPE_SIZE(ipc_perm); # if SANITIZER_FREEBSD CHECK_SIZE_AND_OFFSET(ipc_perm, key); CHECK_SIZE_AND_OFFSET(ipc_perm, seq); # else CHECK_SIZE_AND_OFFSET(ipc_perm, __key); CHECK_SIZE_AND_OFFSET(ipc_perm, __seq); # endif CHECK_SIZE_AND_OFFSET(ipc_perm, uid); CHECK_SIZE_AND_OFFSET(ipc_perm, gid); CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); #if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ CHECK_SIZE_AND_OFFSET(ipc_perm, mode); #endif CHECK_TYPE_SIZE(shmid_ds); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_perm); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_segsz); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_atime); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_dtime); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_ctime); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_cpid); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_lpid); CHECK_SIZE_AND_OFFSET(shmid_ds, shm_nattch); #endif CHECK_TYPE_SIZE(clock_t); #if SANITIZER_LINUX CHECK_TYPE_SIZE(clockid_t); #endif #if !SANITIZER_ANDROID CHECK_TYPE_SIZE(ifaddrs); CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_next); CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_name); CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_addr); CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_netmask); #if SANITIZER_LINUX || SANITIZER_FREEBSD // Compare against the union, because we can't reach into the union in a // compliant way. #ifdef ifa_dstaddr #undef ifa_dstaddr #endif # if SANITIZER_FREEBSD CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr); # else COMPILER_CHECK(sizeof(((__sanitizer_ifaddrs *)nullptr)->ifa_dstaddr) == sizeof(((ifaddrs *)nullptr)->ifa_ifu)); COMPILER_CHECK(offsetof(__sanitizer_ifaddrs, ifa_dstaddr) == offsetof(ifaddrs, ifa_ifu)); # endif // SANITIZER_FREEBSD #else CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr); #endif // SANITIZER_LINUX CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data); #endif #if SANITIZER_LINUX COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo)); #endif #if !SANITIZER_ANDROID CHECK_TYPE_SIZE(timeb); CHECK_SIZE_AND_OFFSET(timeb, time); CHECK_SIZE_AND_OFFSET(timeb, millitm); CHECK_SIZE_AND_OFFSET(timeb, timezone); CHECK_SIZE_AND_OFFSET(timeb, dstflag); #endif CHECK_TYPE_SIZE(passwd); CHECK_SIZE_AND_OFFSET(passwd, pw_name); CHECK_SIZE_AND_OFFSET(passwd, pw_passwd); CHECK_SIZE_AND_OFFSET(passwd, pw_uid); CHECK_SIZE_AND_OFFSET(passwd, pw_gid); CHECK_SIZE_AND_OFFSET(passwd, pw_dir); CHECK_SIZE_AND_OFFSET(passwd, pw_shell); #if !SANITIZER_ANDROID CHECK_SIZE_AND_OFFSET(passwd, pw_gecos); #endif #if SANITIZER_MAC CHECK_SIZE_AND_OFFSET(passwd, pw_change); CHECK_SIZE_AND_OFFSET(passwd, pw_expire); CHECK_SIZE_AND_OFFSET(passwd, pw_class); #endif CHECK_TYPE_SIZE(group); CHECK_SIZE_AND_OFFSET(group, gr_name); CHECK_SIZE_AND_OFFSET(group, gr_passwd); CHECK_SIZE_AND_OFFSET(group, gr_gid); CHECK_SIZE_AND_OFFSET(group, gr_mem); #if HAVE_RPC_XDR_H || HAVE_TIRPC_RPC_XDR_H CHECK_TYPE_SIZE(XDR); CHECK_SIZE_AND_OFFSET(XDR, x_op); CHECK_SIZE_AND_OFFSET(XDR, x_ops); CHECK_SIZE_AND_OFFSET(XDR, x_public); CHECK_SIZE_AND_OFFSET(XDR, x_private); CHECK_SIZE_AND_OFFSET(XDR, x_base); CHECK_SIZE_AND_OFFSET(XDR, x_handy); COMPILER_CHECK(__sanitizer_XDR_ENCODE == XDR_ENCODE); COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE); COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE); #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE)); CHECK_SIZE_AND_OFFSET(FILE, _flags); CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr); CHECK_SIZE_AND_OFFSET(FILE, _IO_read_end); CHECK_SIZE_AND_OFFSET(FILE, _IO_read_base); CHECK_SIZE_AND_OFFSET(FILE, _IO_write_ptr); CHECK_SIZE_AND_OFFSET(FILE, _IO_write_end); CHECK_SIZE_AND_OFFSET(FILE, _IO_write_base); CHECK_SIZE_AND_OFFSET(FILE, _IO_buf_base); CHECK_SIZE_AND_OFFSET(FILE, _IO_buf_end); CHECK_SIZE_AND_OFFSET(FILE, _IO_save_base); CHECK_SIZE_AND_OFFSET(FILE, _IO_backup_base); CHECK_SIZE_AND_OFFSET(FILE, _IO_save_end); CHECK_SIZE_AND_OFFSET(FILE, _markers); CHECK_SIZE_AND_OFFSET(FILE, _chain); CHECK_SIZE_AND_OFFSET(FILE, _fileno); #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk)); CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit); CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev); CHECK_TYPE_SIZE(obstack); CHECK_SIZE_AND_OFFSET(obstack, chunk_size); CHECK_SIZE_AND_OFFSET(obstack, chunk); CHECK_SIZE_AND_OFFSET(obstack, object_base); CHECK_SIZE_AND_OFFSET(obstack, next_free); CHECK_TYPE_SIZE(cookie_io_functions_t); CHECK_SIZE_AND_OFFSET(cookie_io_functions_t, read); CHECK_SIZE_AND_OFFSET(cookie_io_functions_t, write); CHECK_SIZE_AND_OFFSET(cookie_io_functions_t, seek); CHECK_SIZE_AND_OFFSET(cookie_io_functions_t, close); #endif #if SANITIZER_LINUX || SANITIZER_FREEBSD CHECK_TYPE_SIZE(sem_t); #endif #if SANITIZER_LINUX && defined(__arm__) COMPILER_CHECK(ARM_VFPREGS_SIZE == ARM_VFPREGS_SIZE_ASAN); #endif #endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_lfstack.h0000664000175000017500000000406612602553450031227 0ustar mwhudsonmwhudson//===-- sanitizer_lfstack.h -=-----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Lock-free stack. // Uses 32/17 bits as ABA-counter on 32/64-bit platforms. // The memory passed to Push() must not be ever munmap'ed. // The type T must contain T *next field. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_LFSTACK_H #define SANITIZER_LFSTACK_H #include "sanitizer_internal_defs.h" #include "sanitizer_common.h" #include "sanitizer_atomic.h" namespace __sanitizer { template struct LFStack { void Clear() { atomic_store(&head_, 0, memory_order_relaxed); } bool Empty() const { return (atomic_load(&head_, memory_order_relaxed) & kPtrMask) == 0; } void Push(T *p) { u64 cmp = atomic_load(&head_, memory_order_relaxed); for (;;) { u64 cnt = (cmp & kCounterMask) + kCounterInc; u64 xch = (u64)(uptr)p | cnt; p->next = (T*)(uptr)(cmp & kPtrMask); if (atomic_compare_exchange_weak(&head_, &cmp, xch, memory_order_release)) break; } } T *Pop() { u64 cmp = atomic_load(&head_, memory_order_acquire); for (;;) { T *cur = (T*)(uptr)(cmp & kPtrMask); if (!cur) return nullptr; T *nxt = cur->next; u64 cnt = (cmp & kCounterMask); u64 xch = (u64)(uptr)nxt | cnt; if (atomic_compare_exchange_weak(&head_, &cmp, xch, memory_order_acquire)) return cur; } } // private: static const int kCounterBits = FIRST_32_SECOND_64(32, 17); static const u64 kPtrMask = ((u64)-1) >> kCounterBits; static const u64 kCounterMask = ~kPtrMask; static const u64 kCounterInc = kPtrMask + 1; atomic_uint64_t head_; }; } // namespace __sanitizer #endif // SANITIZER_LFSTACK_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.incgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_interceptors_io0000664000175000017500000005406412754655547034157 0ustar mwhudsonmwhudson//===-- sanitizer_common_interceptors_ioctl.inc -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Ioctl handling in common sanitizer interceptors. //===----------------------------------------------------------------------===// #include "sanitizer_flags.h" struct ioctl_desc { unsigned req; // FIXME: support read+write arguments. Currently READWRITE and WRITE do the // same thing. // XXX: The declarations below may use WRITE instead of READWRITE, unless // explicitly noted. enum { NONE, READ, WRITE, READWRITE, CUSTOM } type : 3; unsigned size : 29; const char* name; }; const unsigned ioctl_table_max = 500; static ioctl_desc ioctl_table[ioctl_table_max]; static unsigned ioctl_table_size = 0; // This can not be declared as a global, because references to struct_*_sz // require a global initializer. And this table must be available before global // initializers are run. static void ioctl_table_fill() { #define _(rq, tp, sz) \ if (IOCTL_##rq != IOCTL_NOT_PRESENT) { \ CHECK(ioctl_table_size < ioctl_table_max); \ ioctl_table[ioctl_table_size].req = IOCTL_##rq; \ ioctl_table[ioctl_table_size].type = ioctl_desc::tp; \ ioctl_table[ioctl_table_size].size = sz; \ ioctl_table[ioctl_table_size].name = #rq; \ ++ioctl_table_size; \ } _(FIOASYNC, READ, sizeof(int)); _(FIOCLEX, NONE, 0); _(FIOGETOWN, WRITE, sizeof(int)); _(FIONBIO, READ, sizeof(int)); _(FIONCLEX, NONE, 0); _(FIOSETOWN, READ, sizeof(int)); _(SIOCATMARK, WRITE, sizeof(int)); _(SIOCGIFCONF, CUSTOM, 0); _(SIOCGPGRP, WRITE, sizeof(int)); _(SIOCSPGRP, READ, sizeof(int)); _(TIOCCONS, NONE, 0); _(TIOCEXCL, NONE, 0); _(TIOCGETD, WRITE, sizeof(int)); _(TIOCGPGRP, WRITE, pid_t_sz); _(TIOCGWINSZ, WRITE, struct_winsize_sz); _(TIOCMBIC, READ, sizeof(int)); _(TIOCMBIS, READ, sizeof(int)); _(TIOCMGET, WRITE, sizeof(int)); _(TIOCMSET, READ, sizeof(int)); _(TIOCNOTTY, NONE, 0); _(TIOCNXCL, NONE, 0); _(TIOCOUTQ, WRITE, sizeof(int)); _(TIOCPKT, READ, sizeof(int)); _(TIOCSCTTY, NONE, 0); _(TIOCSETD, READ, sizeof(int)); _(TIOCSPGRP, READ, pid_t_sz); _(TIOCSTI, READ, sizeof(char)); _(TIOCSWINSZ, READ, struct_winsize_sz); #if !SANITIZER_IOS _(SIOCADDMULTI, READ, struct_ifreq_sz); _(SIOCDELMULTI, READ, struct_ifreq_sz); _(SIOCGIFADDR, WRITE, struct_ifreq_sz); _(SIOCGIFBRDADDR, WRITE, struct_ifreq_sz); _(SIOCGIFDSTADDR, WRITE, struct_ifreq_sz); _(SIOCGIFFLAGS, WRITE, struct_ifreq_sz); _(SIOCGIFMETRIC, WRITE, struct_ifreq_sz); _(SIOCGIFMTU, WRITE, struct_ifreq_sz); _(SIOCGIFNETMASK, WRITE, struct_ifreq_sz); _(SIOCSIFADDR, READ, struct_ifreq_sz); _(SIOCSIFBRDADDR, READ, struct_ifreq_sz); _(SIOCSIFDSTADDR, READ, struct_ifreq_sz); _(SIOCSIFFLAGS, READ, struct_ifreq_sz); _(SIOCSIFMETRIC, READ, struct_ifreq_sz); _(SIOCSIFMTU, READ, struct_ifreq_sz); _(SIOCSIFNETMASK, READ, struct_ifreq_sz); #endif #if (SANITIZER_LINUX && !SANITIZER_ANDROID) _(SIOCGETSGCNT, WRITE, struct_sioc_sg_req_sz); _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz); #endif #if SANITIZER_LINUX // Conflicting request ids. // _(CDROMAUDIOBUFSIZ, NONE, 0); // _(SNDCTL_TMR_CONTINUE, NONE, 0); // _(SNDCTL_TMR_START, NONE, 0); // _(SNDCTL_TMR_STOP, NONE, 0); // _(SOUND_MIXER_READ_LOUD, WRITE, sizeof(int)); // same as ...READ_ENHANCE // _(SOUND_MIXER_READ_MUTE, WRITE, sizeof(int)); // same as ...READ_ENHANCE // _(SOUND_MIXER_WRITE_LOUD, WRITE, sizeof(int)); // same as ...WRITE_ENHANCE // _(SOUND_MIXER_WRITE_MUTE, WRITE, sizeof(int)); // same as ...WRITE_ENHANCE _(BLKFLSBUF, NONE, 0); _(BLKGETSIZE, WRITE, sizeof(uptr)); _(BLKRAGET, WRITE, sizeof(int)); _(BLKRASET, NONE, 0); _(BLKROGET, WRITE, sizeof(int)); _(BLKROSET, READ, sizeof(int)); _(BLKRRPART, NONE, 0); _(CDROMEJECT, NONE, 0); _(CDROMEJECT_SW, NONE, 0); _(CDROMMULTISESSION, WRITE, struct_cdrom_multisession_sz); _(CDROMPAUSE, NONE, 0); _(CDROMPLAYMSF, READ, struct_cdrom_msf_sz); _(CDROMPLAYTRKIND, READ, struct_cdrom_ti_sz); _(CDROMREADAUDIO, READ, struct_cdrom_read_audio_sz); _(CDROMREADCOOKED, READ, struct_cdrom_msf_sz); _(CDROMREADMODE1, READ, struct_cdrom_msf_sz); _(CDROMREADMODE2, READ, struct_cdrom_msf_sz); _(CDROMREADRAW, READ, struct_cdrom_msf_sz); _(CDROMREADTOCENTRY, WRITE, struct_cdrom_tocentry_sz); _(CDROMREADTOCHDR, WRITE, struct_cdrom_tochdr_sz); _(CDROMRESET, NONE, 0); _(CDROMRESUME, NONE, 0); _(CDROMSEEK, READ, struct_cdrom_msf_sz); _(CDROMSTART, NONE, 0); _(CDROMSTOP, NONE, 0); _(CDROMSUBCHNL, WRITE, struct_cdrom_subchnl_sz); _(CDROMVOLCTRL, READ, struct_cdrom_volctrl_sz); _(CDROMVOLREAD, WRITE, struct_cdrom_volctrl_sz); _(CDROM_GET_UPC, WRITE, 8); _(EVIOCGABS, WRITE, struct_input_absinfo_sz); // fixup _(EVIOCGBIT, WRITE, struct_input_id_sz); // fixup _(EVIOCGEFFECTS, WRITE, sizeof(int)); _(EVIOCGID, WRITE, struct_input_id_sz); _(EVIOCGKEY, WRITE, 0); _(EVIOCGKEYCODE, WRITE, sizeof(int) * 2); _(EVIOCGLED, WRITE, 0); _(EVIOCGNAME, WRITE, 0); _(EVIOCGPHYS, WRITE, 0); _(EVIOCGRAB, READ, sizeof(int)); _(EVIOCGREP, WRITE, sizeof(int) * 2); _(EVIOCGSND, WRITE, 0); _(EVIOCGSW, WRITE, 0); _(EVIOCGUNIQ, WRITE, 0); _(EVIOCGVERSION, WRITE, sizeof(int)); _(EVIOCRMFF, READ, sizeof(int)); _(EVIOCSABS, READ, struct_input_absinfo_sz); // fixup _(EVIOCSFF, READ, struct_ff_effect_sz); _(EVIOCSKEYCODE, READ, sizeof(int) * 2); _(EVIOCSREP, READ, sizeof(int) * 2); _(FDCLRPRM, NONE, 0); _(FDDEFPRM, READ, struct_floppy_struct_sz); _(FDFLUSH, NONE, 0); _(FDFMTBEG, NONE, 0); _(FDFMTEND, NONE, 0); _(FDFMTTRK, READ, struct_format_descr_sz); _(FDGETDRVPRM, WRITE, struct_floppy_drive_params_sz); _(FDGETDRVSTAT, WRITE, struct_floppy_drive_struct_sz); _(FDGETDRVTYP, WRITE, 16); _(FDGETFDCSTAT, WRITE, struct_floppy_fdc_state_sz); _(FDGETMAXERRS, WRITE, struct_floppy_max_errors_sz); _(FDGETPRM, WRITE, struct_floppy_struct_sz); _(FDMSGOFF, NONE, 0); _(FDMSGON, NONE, 0); _(FDPOLLDRVSTAT, WRITE, struct_floppy_drive_struct_sz); _(FDRAWCMD, WRITE, struct_floppy_raw_cmd_sz); _(FDRESET, NONE, 0); _(FDSETDRVPRM, READ, struct_floppy_drive_params_sz); _(FDSETEMSGTRESH, NONE, 0); _(FDSETMAXERRS, READ, struct_floppy_max_errors_sz); _(FDSETPRM, READ, struct_floppy_struct_sz); _(FDTWADDLE, NONE, 0); _(FDWERRORCLR, NONE, 0); _(FDWERRORGET, WRITE, struct_floppy_write_errors_sz); _(HDIO_DRIVE_CMD, WRITE, sizeof(int)); _(HDIO_GETGEO, WRITE, struct_hd_geometry_sz); _(HDIO_GET_32BIT, WRITE, sizeof(int)); _(HDIO_GET_DMA, WRITE, sizeof(int)); _(HDIO_GET_IDENTITY, WRITE, struct_hd_driveid_sz); _(HDIO_GET_KEEPSETTINGS, WRITE, sizeof(int)); _(HDIO_GET_MULTCOUNT, WRITE, sizeof(int)); _(HDIO_GET_NOWERR, WRITE, sizeof(int)); _(HDIO_GET_UNMASKINTR, WRITE, sizeof(int)); _(HDIO_SET_32BIT, NONE, 0); _(HDIO_SET_DMA, NONE, 0); _(HDIO_SET_KEEPSETTINGS, NONE, 0); _(HDIO_SET_MULTCOUNT, NONE, 0); _(HDIO_SET_NOWERR, NONE, 0); _(HDIO_SET_UNMASKINTR, NONE, 0); _(MTIOCGET, WRITE, struct_mtget_sz); _(MTIOCPOS, WRITE, struct_mtpos_sz); _(MTIOCTOP, READ, struct_mtop_sz); _(PPPIOCGASYNCMAP, WRITE, sizeof(int)); _(PPPIOCGDEBUG, WRITE, sizeof(int)); _(PPPIOCGFLAGS, WRITE, sizeof(int)); _(PPPIOCGUNIT, WRITE, sizeof(int)); _(PPPIOCGXASYNCMAP, WRITE, sizeof(int) * 8); _(PPPIOCSASYNCMAP, READ, sizeof(int)); _(PPPIOCSDEBUG, READ, sizeof(int)); _(PPPIOCSFLAGS, READ, sizeof(int)); _(PPPIOCSMAXCID, READ, sizeof(int)); _(PPPIOCSMRU, READ, sizeof(int)); _(PPPIOCSXASYNCMAP, READ, sizeof(int) * 8); _(SIOCADDRT, READ, struct_rtentry_sz); _(SIOCDARP, READ, struct_arpreq_sz); _(SIOCDELRT, READ, struct_rtentry_sz); _(SIOCDRARP, READ, struct_arpreq_sz); _(SIOCGARP, WRITE, struct_arpreq_sz); _(SIOCGIFENCAP, WRITE, sizeof(int)); _(SIOCGIFHWADDR, WRITE, struct_ifreq_sz); _(SIOCGIFMAP, WRITE, struct_ifreq_sz); _(SIOCGIFMEM, WRITE, struct_ifreq_sz); _(SIOCGIFNAME, NONE, 0); _(SIOCGIFSLAVE, NONE, 0); _(SIOCGRARP, WRITE, struct_arpreq_sz); _(SIOCGSTAMP, WRITE, timeval_sz); _(SIOCSARP, READ, struct_arpreq_sz); _(SIOCSIFENCAP, READ, sizeof(int)); _(SIOCSIFHWADDR, READ, struct_ifreq_sz); _(SIOCSIFLINK, NONE, 0); _(SIOCSIFMAP, READ, struct_ifreq_sz); _(SIOCSIFMEM, READ, struct_ifreq_sz); _(SIOCSIFSLAVE, NONE, 0); _(SIOCSRARP, READ, struct_arpreq_sz); _(SNDCTL_COPR_HALT, WRITE, struct_copr_debug_buf_sz); _(SNDCTL_COPR_LOAD, READ, struct_copr_buffer_sz); _(SNDCTL_COPR_RCODE, WRITE, struct_copr_debug_buf_sz); _(SNDCTL_COPR_RCVMSG, WRITE, struct_copr_msg_sz); _(SNDCTL_COPR_RDATA, WRITE, struct_copr_debug_buf_sz); _(SNDCTL_COPR_RESET, NONE, 0); _(SNDCTL_COPR_RUN, WRITE, struct_copr_debug_buf_sz); _(SNDCTL_COPR_SENDMSG, READ, struct_copr_msg_sz); _(SNDCTL_COPR_WCODE, READ, struct_copr_debug_buf_sz); _(SNDCTL_COPR_WDATA, READ, struct_copr_debug_buf_sz); _(SNDCTL_DSP_GETBLKSIZE, WRITE, sizeof(int)); _(SNDCTL_DSP_GETFMTS, WRITE, sizeof(int)); _(SNDCTL_DSP_NONBLOCK, NONE, 0); _(SNDCTL_DSP_POST, NONE, 0); _(SNDCTL_DSP_RESET, NONE, 0); _(SNDCTL_DSP_SETFMT, WRITE, sizeof(int)); _(SNDCTL_DSP_SETFRAGMENT, WRITE, sizeof(int)); _(SNDCTL_DSP_SPEED, WRITE, sizeof(int)); _(SNDCTL_DSP_STEREO, WRITE, sizeof(int)); _(SNDCTL_DSP_SUBDIVIDE, WRITE, sizeof(int)); _(SNDCTL_DSP_SYNC, NONE, 0); _(SNDCTL_FM_4OP_ENABLE, READ, sizeof(int)); _(SNDCTL_FM_LOAD_INSTR, READ, struct_sbi_instrument_sz); _(SNDCTL_MIDI_INFO, WRITE, struct_midi_info_sz); _(SNDCTL_MIDI_PRETIME, WRITE, sizeof(int)); _(SNDCTL_SEQ_CTRLRATE, WRITE, sizeof(int)); _(SNDCTL_SEQ_GETINCOUNT, WRITE, sizeof(int)); _(SNDCTL_SEQ_GETOUTCOUNT, WRITE, sizeof(int)); _(SNDCTL_SEQ_NRMIDIS, WRITE, sizeof(int)); _(SNDCTL_SEQ_NRSYNTHS, WRITE, sizeof(int)); _(SNDCTL_SEQ_OUTOFBAND, READ, struct_seq_event_rec_sz); _(SNDCTL_SEQ_PANIC, NONE, 0); _(SNDCTL_SEQ_PERCMODE, NONE, 0); _(SNDCTL_SEQ_RESET, NONE, 0); _(SNDCTL_SEQ_RESETSAMPLES, READ, sizeof(int)); _(SNDCTL_SEQ_SYNC, NONE, 0); _(SNDCTL_SEQ_TESTMIDI, READ, sizeof(int)); _(SNDCTL_SEQ_THRESHOLD, READ, sizeof(int)); _(SNDCTL_SYNTH_INFO, WRITE, struct_synth_info_sz); _(SNDCTL_SYNTH_MEMAVL, WRITE, sizeof(int)); _(SNDCTL_TMR_METRONOME, READ, sizeof(int)); _(SNDCTL_TMR_SELECT, WRITE, sizeof(int)); _(SNDCTL_TMR_SOURCE, WRITE, sizeof(int)); _(SNDCTL_TMR_TEMPO, WRITE, sizeof(int)); _(SNDCTL_TMR_TIMEBASE, WRITE, sizeof(int)); _(SOUND_MIXER_READ_ALTPCM, WRITE, sizeof(int)); _(SOUND_MIXER_READ_BASS, WRITE, sizeof(int)); _(SOUND_MIXER_READ_CAPS, WRITE, sizeof(int)); _(SOUND_MIXER_READ_CD, WRITE, sizeof(int)); _(SOUND_MIXER_READ_DEVMASK, WRITE, sizeof(int)); _(SOUND_MIXER_READ_ENHANCE, WRITE, sizeof(int)); _(SOUND_MIXER_READ_IGAIN, WRITE, sizeof(int)); _(SOUND_MIXER_READ_IMIX, WRITE, sizeof(int)); _(SOUND_MIXER_READ_LINE, WRITE, sizeof(int)); _(SOUND_MIXER_READ_LINE1, WRITE, sizeof(int)); _(SOUND_MIXER_READ_LINE2, WRITE, sizeof(int)); _(SOUND_MIXER_READ_LINE3, WRITE, sizeof(int)); _(SOUND_MIXER_READ_MIC, WRITE, sizeof(int)); _(SOUND_MIXER_READ_OGAIN, WRITE, sizeof(int)); _(SOUND_MIXER_READ_PCM, WRITE, sizeof(int)); _(SOUND_MIXER_READ_RECLEV, WRITE, sizeof(int)); _(SOUND_MIXER_READ_RECMASK, WRITE, sizeof(int)); _(SOUND_MIXER_READ_RECSRC, WRITE, sizeof(int)); _(SOUND_MIXER_READ_SPEAKER, WRITE, sizeof(int)); _(SOUND_MIXER_READ_STEREODEVS, WRITE, sizeof(int)); _(SOUND_MIXER_READ_SYNTH, WRITE, sizeof(int)); _(SOUND_MIXER_READ_TREBLE, WRITE, sizeof(int)); _(SOUND_MIXER_READ_VOLUME, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_ALTPCM, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_BASS, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_CD, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_ENHANCE, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_IGAIN, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_IMIX, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_LINE, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_LINE1, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_LINE2, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_LINE3, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_MIC, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_OGAIN, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_PCM, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_RECLEV, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_RECSRC, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_SPEAKER, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_SYNTH, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_TREBLE, WRITE, sizeof(int)); _(SOUND_MIXER_WRITE_VOLUME, WRITE, sizeof(int)); _(SOUND_PCM_READ_BITS, WRITE, sizeof(int)); _(SOUND_PCM_READ_CHANNELS, WRITE, sizeof(int)); _(SOUND_PCM_READ_FILTER, WRITE, sizeof(int)); _(SOUND_PCM_READ_RATE, WRITE, sizeof(int)); _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int)); _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int)); _(TCFLSH, NONE, 0); _(TCGETA, WRITE, struct_termio_sz); _(TCGETS, WRITE, struct_termios_sz); _(TCSBRK, NONE, 0); _(TCSBRKP, NONE, 0); _(TCSETA, READ, struct_termio_sz); _(TCSETAF, READ, struct_termio_sz); _(TCSETAW, READ, struct_termio_sz); _(TCSETS, READ, struct_termios_sz); _(TCSETSF, READ, struct_termios_sz); _(TCSETSW, READ, struct_termios_sz); _(TCXONC, NONE, 0); _(TIOCGLCKTRMIOS, WRITE, struct_termios_sz); _(TIOCGSOFTCAR, WRITE, sizeof(int)); _(TIOCINQ, WRITE, sizeof(int)); _(TIOCLINUX, READ, sizeof(char)); _(TIOCSERCONFIG, NONE, 0); _(TIOCSERGETLSR, WRITE, sizeof(int)); _(TIOCSERGWILD, WRITE, sizeof(int)); _(TIOCSERSWILD, READ, sizeof(int)); _(TIOCSLCKTRMIOS, READ, struct_termios_sz); _(TIOCSSOFTCAR, READ, sizeof(int)); _(VT_ACTIVATE, NONE, 0); _(VT_DISALLOCATE, NONE, 0); _(VT_GETMODE, WRITE, struct_vt_mode_sz); _(VT_GETSTATE, WRITE, struct_vt_stat_sz); _(VT_OPENQRY, WRITE, sizeof(int)); _(VT_RELDISP, NONE, 0); _(VT_RESIZE, READ, struct_vt_sizes_sz); _(VT_RESIZEX, READ, struct_vt_consize_sz); _(VT_SENDSIG, NONE, 0); _(VT_SETMODE, READ, struct_vt_mode_sz); _(VT_WAITACTIVE, NONE, 0); #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE _(CYGETDEFTHRESH, WRITE, sizeof(int)); _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); _(CYGETMON, WRITE, struct_cyclades_monitor_sz); _(CYGETTHRESH, WRITE, sizeof(int)); _(CYGETTIMEOUT, WRITE, sizeof(int)); _(CYSETDEFTHRESH, NONE, 0); _(CYSETDEFTIMEOUT, NONE, 0); _(CYSETTHRESH, NONE, 0); _(CYSETTIMEOUT, NONE, 0); _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); _(EQL_GETSLAVECFG, WRITE, struct_ifreq_sz); _(EQL_SETMASTRCFG, WRITE, struct_ifreq_sz); _(EQL_SETSLAVECFG, WRITE, struct_ifreq_sz); _(EVIOCGKEYCODE_V2, WRITE, struct_input_keymap_entry_sz); _(EVIOCGPROP, WRITE, 0); _(EVIOCSKEYCODE_V2, READ, struct_input_keymap_entry_sz); _(FS_IOC_GETFLAGS, WRITE, sizeof(int)); _(FS_IOC_GETVERSION, WRITE, sizeof(int)); _(FS_IOC_SETFLAGS, READ, sizeof(int)); _(FS_IOC_SETVERSION, READ, sizeof(int)); _(GIO_CMAP, WRITE, 48); _(GIO_FONT, WRITE, 8192); _(GIO_SCRNMAP, WRITE, e_tabsz); _(GIO_UNIMAP, WRITE, struct_unimapdesc_sz); _(GIO_UNISCRNMAP, WRITE, sizeof(short) * e_tabsz); _(KDADDIO, NONE, 0); _(KDDELIO, NONE, 0); _(KDDISABIO, NONE, 0); _(KDENABIO, NONE, 0); _(KDGETKEYCODE, WRITE, struct_kbkeycode_sz); _(KDGETLED, WRITE, 1); _(KDGETMODE, WRITE, sizeof(int)); _(KDGKBDIACR, WRITE, struct_kbdiacrs_sz); _(KDGKBENT, WRITE, struct_kbentry_sz); _(KDGKBLED, WRITE, sizeof(int)); _(KDGKBMETA, WRITE, sizeof(int)); _(KDGKBMODE, WRITE, sizeof(int)); _(KDGKBSENT, WRITE, struct_kbsentry_sz); _(KDGKBTYPE, WRITE, 1); _(KDMAPDISP, NONE, 0); _(KDMKTONE, NONE, 0); _(KDSETKEYCODE, READ, struct_kbkeycode_sz); _(KDSETLED, NONE, 0); _(KDSETMODE, NONE, 0); _(KDSIGACCEPT, NONE, 0); _(KDSKBDIACR, READ, struct_kbdiacrs_sz); _(KDSKBENT, READ, struct_kbentry_sz); _(KDSKBLED, NONE, 0); _(KDSKBMETA, NONE, 0); _(KDSKBMODE, NONE, 0); _(KDSKBSENT, READ, struct_kbsentry_sz); _(KDUNMAPDISP, NONE, 0); _(KIOCSOUND, NONE, 0); _(LPABORT, NONE, 0); _(LPABORTOPEN, NONE, 0); _(LPCAREFUL, NONE, 0); _(LPCHAR, NONE, 0); _(LPGETIRQ, WRITE, sizeof(int)); _(LPGETSTATUS, WRITE, sizeof(int)); _(LPRESET, NONE, 0); _(LPSETIRQ, NONE, 0); _(LPTIME, NONE, 0); _(LPWAIT, NONE, 0); _(MTIOCGETCONFIG, WRITE, struct_mtconfiginfo_sz); _(MTIOCSETCONFIG, READ, struct_mtconfiginfo_sz); _(PIO_CMAP, NONE, 0); _(PIO_FONT, READ, 8192); _(PIO_SCRNMAP, READ, e_tabsz); _(PIO_UNIMAP, READ, struct_unimapdesc_sz); _(PIO_UNIMAPCLR, READ, struct_unimapinit_sz); _(PIO_UNISCRNMAP, READ, sizeof(short) * e_tabsz); _(SCSI_IOCTL_PROBE_HOST, READ, sizeof(int)); _(SCSI_IOCTL_TAGGED_DISABLE, NONE, 0); _(SCSI_IOCTL_TAGGED_ENABLE, NONE, 0); _(SNDCTL_DSP_GETISPACE, WRITE, struct_audio_buf_info_sz); _(SNDCTL_DSP_GETOSPACE, WRITE, struct_audio_buf_info_sz); _(TIOCGSERIAL, WRITE, struct_serial_struct_sz); _(TIOCSERGETMULTI, WRITE, struct_serial_multiport_struct_sz); _(TIOCSERSETMULTI, READ, struct_serial_multiport_struct_sz); _(TIOCSSERIAL, READ, struct_serial_struct_sz); // The following ioctl requests are shared between AX25, IPX, netrom and // mrouted. // _(SIOCAIPXITFCRT, READ, sizeof(char)); // _(SIOCAX25GETUID, READ, struct_sockaddr_ax25_sz); // _(SIOCNRGETPARMS, WRITE, struct_nr_parms_struct_sz); // _(SIOCAIPXPRISLT, READ, sizeof(char)); // _(SIOCNRSETPARMS, READ, struct_nr_parms_struct_sz); // _(SIOCAX25ADDUID, READ, struct_sockaddr_ax25_sz); // _(SIOCNRDECOBS, NONE, 0); // _(SIOCAX25DELUID, READ, struct_sockaddr_ax25_sz); // _(SIOCIPXCFGDATA, WRITE, struct_ipx_config_data_sz); // _(SIOCAX25NOUID, READ, sizeof(int)); // _(SIOCNRRTCTL, READ, sizeof(int)); // _(SIOCAX25DIGCTL, READ, sizeof(int)); // _(SIOCAX25GETPARMS, WRITE, struct_ax25_parms_struct_sz); // _(SIOCAX25SETPARMS, READ, struct_ax25_parms_struct_sz); #endif #undef _ } static bool ioctl_initialized = false; struct ioctl_desc_compare { bool operator()(const ioctl_desc& left, const ioctl_desc& right) const { return left.req < right.req; } }; static void ioctl_init() { ioctl_table_fill(); InternalSort(&ioctl_table, ioctl_table_size, ioctl_desc_compare()); bool bad = false; for (unsigned i = 0; i < ioctl_table_size - 1; ++i) { if (ioctl_table[i].req >= ioctl_table[i + 1].req) { Printf("Duplicate or unsorted ioctl request id %x >= %x (%s vs %s)\n", ioctl_table[i].req, ioctl_table[i + 1].req, ioctl_table[i].name, ioctl_table[i + 1].name); bad = true; } } if (bad) Die(); ioctl_initialized = true; } // Handle the most evil ioctls that encode argument value as part of request id. static unsigned ioctl_request_fixup(unsigned req) { #if SANITIZER_LINUX // Strip size and event number. const unsigned kEviocgbitMask = (IOC_SIZEMASK << IOC_SIZESHIFT) | EVIOC_EV_MAX; if ((req & ~kEviocgbitMask) == IOCTL_EVIOCGBIT) return IOCTL_EVIOCGBIT; // Strip absolute axis number. if ((req & ~EVIOC_ABS_MAX) == IOCTL_EVIOCGABS) return IOCTL_EVIOCGABS; if ((req & ~EVIOC_ABS_MAX) == IOCTL_EVIOCSABS) return IOCTL_EVIOCSABS; #endif return req; } static const ioctl_desc *ioctl_table_lookup(unsigned req) { int left = 0; int right = ioctl_table_size; while (left < right) { int mid = (left + right) / 2; if (ioctl_table[mid].req < req) left = mid + 1; else right = mid; } if (left == right && ioctl_table[left].req == req) return ioctl_table + left; else return nullptr; } static bool ioctl_decode(unsigned req, ioctl_desc *desc) { CHECK(desc); desc->req = req; desc->name = ""; desc->size = IOC_SIZE(req); // Sanity check. if (desc->size > 0xFFFF) return false; unsigned dir = IOC_DIR(req); switch (dir) { case IOC_NONE: desc->type = ioctl_desc::NONE; break; case IOC_READ | IOC_WRITE: desc->type = ioctl_desc::READWRITE; break; case IOC_READ: desc->type = ioctl_desc::WRITE; break; case IOC_WRITE: desc->type = ioctl_desc::READ; break; default: return false; } // Size can be 0 iff type is NONE. if ((desc->type == IOC_NONE) != (desc->size == 0)) return false; // Sanity check. if (IOC_TYPE(req) == 0) return false; return true; } static const ioctl_desc *ioctl_lookup(unsigned req) { req = ioctl_request_fixup(req); const ioctl_desc *desc = ioctl_table_lookup(req); if (desc) return desc; // Try stripping access size from the request id. desc = ioctl_table_lookup(req & ~(IOC_SIZEMASK << IOC_SIZESHIFT)); // Sanity check: requests that encode access size are either read or write and // have size of 0 in the table. if (desc && desc->size == 0 && (desc->type == ioctl_desc::READWRITE || desc->type == ioctl_desc::WRITE || desc->type == ioctl_desc::READ)) return desc; return nullptr; } static void ioctl_common_pre(void *ctx, const ioctl_desc *desc, int d, unsigned request, void *arg) { if (desc->type == ioctl_desc::READ || desc->type == ioctl_desc::READWRITE) { unsigned size = desc->size ? desc->size : IOC_SIZE(request); COMMON_INTERCEPTOR_READ_RANGE(ctx, arg, size); } if (desc->type != ioctl_desc::CUSTOM) return; if (request == IOCTL_SIOCGIFCONF) { struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; COMMON_INTERCEPTOR_READ_RANGE(ctx, (char*)&ifc->ifc_len, sizeof(ifc->ifc_len)); } } static void ioctl_common_post(void *ctx, const ioctl_desc *desc, int res, int d, unsigned request, void *arg) { if (desc->type == ioctl_desc::WRITE || desc->type == ioctl_desc::READWRITE) { // FIXME: add verbose output unsigned size = desc->size ? desc->size : IOC_SIZE(request); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, arg, size); } if (desc->type != ioctl_desc::CUSTOM) return; if (request == IOCTL_SIOCGIFCONF) { struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ifc->ifc_ifcu.ifcu_req, ifc->ifc_len); } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_libbacktrac0000664000175000017500000000272512605323430034066 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_libbacktrace.h ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // Header for libbacktrace symbolizer. //===----------------------------------------------------------------------===// #ifndef SANITIZER_SYMBOLIZER_LIBBACKTRACE_H #define SANITIZER_SYMBOLIZER_LIBBACKTRACE_H #include "sanitizer_platform.h" #include "sanitizer_common.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_symbolizer_internal.h" #ifndef SANITIZER_LIBBACKTRACE # define SANITIZER_LIBBACKTRACE 0 #endif #ifndef SANITIZER_CP_DEMANGLE # define SANITIZER_CP_DEMANGLE 0 #endif namespace __sanitizer { class LibbacktraceSymbolizer : public SymbolizerTool { public: static LibbacktraceSymbolizer *get(LowLevelAllocator *alloc); bool SymbolizePC(uptr addr, SymbolizedStack *stack) override; bool SymbolizeData(uptr addr, DataInfo *info) override; // May return NULL if demangling failed. const char *Demangle(const char *name) override; private: explicit LibbacktraceSymbolizer(void *state) : state_(state) {} void *state_; // Leaked. }; } // namespace __sanitizer #endif // SANITIZER_SYMBOLIZER_LIBBACKTRACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_syscall_generic.inc0000664000175000017500000000166112472450645033275 0ustar mwhudsonmwhudson//===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Generic implementations of internal_syscall and internal_iserror. // //===----------------------------------------------------------------------===// #if SANITIZER_FREEBSD || SANITIZER_MAC # define SYSCALL(name) SYS_ ## name #else # define SYSCALL(name) __NR_ ## name #endif #if (SANITIZER_FREEBSD || SANITIZER_MAC) && defined(__x86_64__) # define internal_syscall __syscall # else # define internal_syscall syscall #endif bool internal_iserror(uptr retval, int *rverrno) { if (retval == (uptr)-1) { if (rverrno) *rverrno = errno; return true; } else { return false; } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_libbacktrac0000664000175000017500000001403312475276164034101 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_libbacktrace.cc ------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // Libbacktrace implementation of symbolizer parts. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #include "sanitizer_internal_defs.h" #include "sanitizer_symbolizer.h" #include "sanitizer_symbolizer_libbacktrace.h" #if SANITIZER_LIBBACKTRACE # include "backtrace-supported.h" # if SANITIZER_POSIX && BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC # include "backtrace.h" # if SANITIZER_CP_DEMANGLE # undef ARRAY_SIZE # include "demangle.h" # endif # else # define SANITIZER_LIBBACKTRACE 0 # endif #endif namespace __sanitizer { static char *DemangleAlloc(const char *name, bool always_alloc); #if SANITIZER_LIBBACKTRACE namespace { # if SANITIZER_CP_DEMANGLE struct CplusV3DemangleData { char *buf; uptr size, allocated; }; extern "C" { static void CplusV3DemangleCallback(const char *s, size_t l, void *vdata) { CplusV3DemangleData *data = (CplusV3DemangleData *)vdata; uptr needed = data->size + l + 1; if (needed > data->allocated) { data->allocated *= 2; if (needed > data->allocated) data->allocated = needed; char *buf = (char *)InternalAlloc(data->allocated); if (data->buf) { internal_memcpy(buf, data->buf, data->size); InternalFree(data->buf); } data->buf = buf; } internal_memcpy(data->buf + data->size, s, l); data->buf[data->size + l] = '\0'; data->size += l; } } // extern "C" char *CplusV3Demangle(const char *name) { CplusV3DemangleData data; data.buf = 0; data.size = 0; data.allocated = 0; if (cplus_demangle_v3_callback(name, DMGL_PARAMS | DMGL_ANSI, CplusV3DemangleCallback, &data)) { if (data.size + 64 > data.allocated) return data.buf; char *buf = internal_strdup(data.buf); InternalFree(data.buf); return buf; } if (data.buf) InternalFree(data.buf); return 0; } # endif // SANITIZER_CP_DEMANGLE struct SymbolizeCodeCallbackArg { SymbolizedStack *first; SymbolizedStack *last; uptr frames_symbolized; AddressInfo *get_new_frame(uintptr_t addr) { CHECK(last); if (frames_symbolized > 0) { SymbolizedStack *cur = SymbolizedStack::New(addr); AddressInfo *info = &cur->info; info->FillModuleInfo(first->info.module, first->info.module_offset); last->next = cur; last = cur; } CHECK_EQ(addr, first->info.address); CHECK_EQ(addr, last->info.address); return &last->info; } }; extern "C" { static int SymbolizeCodePCInfoCallback(void *vdata, uintptr_t addr, const char *filename, int lineno, const char *function) { SymbolizeCodeCallbackArg *cdata = (SymbolizeCodeCallbackArg *)vdata; if (function) { AddressInfo *info = cdata->get_new_frame(addr); info->function = DemangleAlloc(function, /*always_alloc*/ true); if (filename) info->file = internal_strdup(filename); info->line = lineno; cdata->frames_symbolized++; } return 0; } static void SymbolizeCodeCallback(void *vdata, uintptr_t addr, const char *symname, uintptr_t, uintptr_t) { SymbolizeCodeCallbackArg *cdata = (SymbolizeCodeCallbackArg *)vdata; if (symname) { AddressInfo *info = cdata->get_new_frame(addr); info->function = DemangleAlloc(symname, /*always_alloc*/ true); cdata->frames_symbolized++; } } static void SymbolizeDataCallback(void *vdata, uintptr_t, const char *symname, uintptr_t symval, uintptr_t symsize) { DataInfo *info = (DataInfo *)vdata; if (symname && symval) { info->name = DemangleAlloc(symname, /*always_alloc*/ true); info->start = symval; info->size = symsize; } } static void ErrorCallback(void *, const char *, int) {} } // extern "C" } // namespace LibbacktraceSymbolizer *LibbacktraceSymbolizer::get(LowLevelAllocator *alloc) { // State created in backtrace_create_state is leaked. void *state = (void *)(backtrace_create_state("/proc/self/exe", 0, ErrorCallback, NULL)); if (!state) return 0; return new(*alloc) LibbacktraceSymbolizer(state); } bool LibbacktraceSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) { SymbolizeCodeCallbackArg data; data.first = stack; data.last = stack; data.frames_symbolized = 0; backtrace_pcinfo((backtrace_state *)state_, addr, SymbolizeCodePCInfoCallback, ErrorCallback, &data); if (data.frames_symbolized > 0) return true; backtrace_syminfo((backtrace_state *)state_, addr, SymbolizeCodeCallback, ErrorCallback, &data); return (data.frames_symbolized > 0); } bool LibbacktraceSymbolizer::SymbolizeData(uptr addr, DataInfo *info) { backtrace_syminfo((backtrace_state *)state_, addr, SymbolizeDataCallback, ErrorCallback, info); return true; } #else // SANITIZER_LIBBACKTRACE LibbacktraceSymbolizer *LibbacktraceSymbolizer::get(LowLevelAllocator *alloc) { return 0; } bool LibbacktraceSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) { (void)state_; return false; } bool LibbacktraceSymbolizer::SymbolizeData(uptr addr, DataInfo *info) { return false; } #endif // SANITIZER_LIBBACKTRACE static char *DemangleAlloc(const char *name, bool always_alloc) { #if SANITIZER_LIBBACKTRACE && SANITIZER_CP_DEMANGLE if (char *demangled = CplusV3Demangle(name)) return demangled; #endif if (always_alloc) return internal_strdup(name); return 0; } const char *LibbacktraceSymbolizer::Demangle(const char *name) { return DemangleAlloc(name, /*always_alloc*/ false); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_asm.h0000664000175000017500000000423512626320647030364 0ustar mwhudsonmwhudson//===-- sanitizer_asm.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Various support for assemebler. // //===----------------------------------------------------------------------===// // Some toolchains do not support .cfi asm directives, so we have to hide // them inside macros. #if defined(__clang__) || \ (defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)) // GCC defined __GCC_HAVE_DWARF2_CFI_ASM if it supports CFI. // Clang seems to support CFI by default (or not?). // We need two versions of macros: for inline asm and standalone asm files. # define CFI_INL_ADJUST_CFA_OFFSET(n) ".cfi_adjust_cfa_offset " #n ";" # define CFI_STARTPROC .cfi_startproc # define CFI_ENDPROC .cfi_endproc # define CFI_ADJUST_CFA_OFFSET(n) .cfi_adjust_cfa_offset n # define CFI_DEF_CFA_OFFSET(n) .cfi_def_cfa_offset n # define CFI_REL_OFFSET(reg, n) .cfi_rel_offset reg, n # define CFI_OFFSET(reg, n) .cfi_offset reg, n # define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg # define CFI_DEF_CFA(reg, n) .cfi_def_cfa reg, n # define CFI_RESTORE(reg) .cfi_restore reg #else // No CFI # define CFI_INL_ADJUST_CFA_OFFSET(n) # define CFI_STARTPROC # define CFI_ENDPROC # define CFI_ADJUST_CFA_OFFSET(n) # define CFI_DEF_CFA_OFFSET(n) # define CFI_REL_OFFSET(reg, n) # define CFI_OFFSET(reg, n) # define CFI_DEF_CFA_REGISTER(reg) # define CFI_DEF_CFA(reg, n) # define CFI_RESTORE(reg) #endif #if !defined(__APPLE__) # define ASM_HIDDEN(symbol) .hidden symbol # define ASM_TYPE_FUNCTION(symbol) .type symbol, @function # define ASM_SIZE(symbol) .size symbol, .-symbol # define ASM_TSAN_SYMBOL(symbol) symbol # define ASM_TSAN_SYMBOL_INTERCEPTOR(symbol) symbol #else # define ASM_HIDDEN(symbol) # define ASM_TYPE_FUNCTION(symbol) # define ASM_SIZE(symbol) # define ASM_TSAN_SYMBOL(symbol) _##symbol # define ASM_TSAN_SYMBOL_INTERCEPTOR(symbol) _wrap_##symbol #endif ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stoptheworld_linux_lib0000664000175000017500000004643513000005745034153 0ustar mwhudsonmwhudson//===-- sanitizer_stoptheworld_linux_libcdep.cc ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // See sanitizer_stoptheworld.h for details. // This implementation was inspired by Markus Gutschke's linuxthreads.cc. // //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_LINUX && (defined(__x86_64__) || defined(__mips__) || \ defined(__aarch64__) || defined(__powerpc64__) || \ defined(__s390__)) #include "sanitizer_stoptheworld.h" #include "sanitizer_platform_limits_posix.h" #include "sanitizer_atomic.h" #include #include // for CLONE_* definitions #include #include // for PR_* definitions #include // for PTRACE_* definitions #include // for pid_t #include // for iovec #include // for NT_PRSTATUS #if SANITIZER_ANDROID && defined(__arm__) # include // for pt_regs #else # ifdef __aarch64__ // GLIBC 2.20+ sys/user does not include asm/ptrace.h # include # endif # include // for user_regs_struct # if SANITIZER_ANDROID && SANITIZER_MIPS # include // for mips SP register in sys/user.h # endif #endif #include // for signal-related stuff #ifdef sa_handler # undef sa_handler #endif #ifdef sa_sigaction # undef sa_sigaction #endif #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_libc.h" #include "sanitizer_linux.h" #include "sanitizer_mutex.h" #include "sanitizer_placement_new.h" // This module works by spawning a Linux task which then attaches to every // thread in the caller process with ptrace. This suspends the threads, and // PTRACE_GETREGS can then be used to obtain their register state. The callback // supplied to StopTheWorld() is run in the tracer task while the threads are // suspended. // The tracer task must be placed in a different thread group for ptrace to // work, so it cannot be spawned as a pthread. Instead, we use the low-level // clone() interface (we want to share the address space with the caller // process, so we prefer clone() over fork()). // // We don't use any libc functions, relying instead on direct syscalls. There // are two reasons for this: // 1. calling a library function while threads are suspended could cause a // deadlock, if one of the treads happens to be holding a libc lock; // 2. it's generally not safe to call libc functions from the tracer task, // because clone() does not set up a thread-local storage for it. Any // thread-local variables used by libc will be shared between the tracer task // and the thread which spawned it. namespace __sanitizer { COMPILER_CHECK(sizeof(SuspendedThreadID) == sizeof(pid_t)); // Structure for passing arguments into the tracer thread. struct TracerThreadArgument { StopTheWorldCallback callback; void *callback_argument; // The tracer thread waits on this mutex while the parent finishes its // preparations. BlockingMutex mutex; // Tracer thread signals its completion by setting done. atomic_uintptr_t done; uptr parent_pid; }; // This class handles thread suspending/unsuspending in the tracer thread. class ThreadSuspender { public: explicit ThreadSuspender(pid_t pid, TracerThreadArgument *arg) : arg(arg) , pid_(pid) { CHECK_GE(pid, 0); } bool SuspendAllThreads(); void ResumeAllThreads(); void KillAllThreads(); SuspendedThreadsList &suspended_threads_list() { return suspended_threads_list_; } TracerThreadArgument *arg; private: SuspendedThreadsList suspended_threads_list_; pid_t pid_; bool SuspendThread(SuspendedThreadID thread_id); }; bool ThreadSuspender::SuspendThread(SuspendedThreadID tid) { // Are we already attached to this thread? // Currently this check takes linear time, however the number of threads is // usually small. if (suspended_threads_list_.Contains(tid)) return false; int pterrno; if (internal_iserror(internal_ptrace(PTRACE_ATTACH, tid, nullptr, nullptr), &pterrno)) { // Either the thread is dead, or something prevented us from attaching. // Log this event and move on. VReport(1, "Could not attach to thread %d (errno %d).\n", tid, pterrno); return false; } else { VReport(2, "Attached to thread %d.\n", tid); // The thread is not guaranteed to stop before ptrace returns, so we must // wait on it. Note: if the thread receives a signal concurrently, // we can get notification about the signal before notification about stop. // In such case we need to forward the signal to the thread, otherwise // the signal will be missed (as we do PTRACE_DETACH with arg=0) and // any logic relying on signals will break. After forwarding we need to // continue to wait for stopping, because the thread is not stopped yet. // We do ignore delivery of SIGSTOP, because we want to make stop-the-world // as invisible as possible. for (;;) { int status; uptr waitpid_status; HANDLE_EINTR(waitpid_status, internal_waitpid(tid, &status, __WALL)); int wperrno; if (internal_iserror(waitpid_status, &wperrno)) { // Got a ECHILD error. I don't think this situation is possible, but it // doesn't hurt to report it. VReport(1, "Waiting on thread %d failed, detaching (errno %d).\n", tid, wperrno); internal_ptrace(PTRACE_DETACH, tid, nullptr, nullptr); return false; } if (WIFSTOPPED(status) && WSTOPSIG(status) != SIGSTOP) { internal_ptrace(PTRACE_CONT, tid, nullptr, (void*)(uptr)WSTOPSIG(status)); continue; } break; } suspended_threads_list_.Append(tid); return true; } } void ThreadSuspender::ResumeAllThreads() { for (uptr i = 0; i < suspended_threads_list_.thread_count(); i++) { pid_t tid = suspended_threads_list_.GetThreadID(i); int pterrno; if (!internal_iserror(internal_ptrace(PTRACE_DETACH, tid, nullptr, nullptr), &pterrno)) { VReport(2, "Detached from thread %d.\n", tid); } else { // Either the thread is dead, or we are already detached. // The latter case is possible, for instance, if this function was called // from a signal handler. VReport(1, "Could not detach from thread %d (errno %d).\n", tid, pterrno); } } } void ThreadSuspender::KillAllThreads() { for (uptr i = 0; i < suspended_threads_list_.thread_count(); i++) internal_ptrace(PTRACE_KILL, suspended_threads_list_.GetThreadID(i), nullptr, nullptr); } bool ThreadSuspender::SuspendAllThreads() { ThreadLister thread_lister(pid_); bool added_threads; bool first_iteration = true; do { // Run through the directory entries once. added_threads = false; pid_t tid = thread_lister.GetNextTID(); while (tid >= 0) { if (SuspendThread(tid)) added_threads = true; tid = thread_lister.GetNextTID(); } if (thread_lister.error() || (first_iteration && !added_threads)) { // Detach threads and fail. ResumeAllThreads(); return false; } thread_lister.Reset(); first_iteration = false; } while (added_threads); return true; } // Pointer to the ThreadSuspender instance for use in signal handler. static ThreadSuspender *thread_suspender_instance = nullptr; // Synchronous signals that should not be blocked. static const int kSyncSignals[] = { SIGABRT, SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGXCPU, SIGXFSZ }; static void TracerThreadDieCallback() { // Generally a call to Die() in the tracer thread should be fatal to the // parent process as well, because they share the address space. // This really only works correctly if all the threads are suspended at this // point. So we correctly handle calls to Die() from within the callback, but // not those that happen before or after the callback. Hopefully there aren't // a lot of opportunities for that to happen... ThreadSuspender *inst = thread_suspender_instance; if (inst && stoptheworld_tracer_pid == internal_getpid()) { inst->KillAllThreads(); thread_suspender_instance = nullptr; } } // Signal handler to wake up suspended threads when the tracer thread dies. static void TracerThreadSignalHandler(int signum, void *siginfo, void *uctx) { SignalContext ctx = SignalContext::Create(siginfo, uctx); Printf("Tracer caught signal %d: addr=0x%zx pc=0x%zx sp=0x%zx\n", signum, ctx.addr, ctx.pc, ctx.sp); ThreadSuspender *inst = thread_suspender_instance; if (inst) { if (signum == SIGABRT) inst->KillAllThreads(); else inst->ResumeAllThreads(); RAW_CHECK(RemoveDieCallback(TracerThreadDieCallback)); thread_suspender_instance = nullptr; atomic_store(&inst->arg->done, 1, memory_order_relaxed); } internal__exit((signum == SIGABRT) ? 1 : 2); } // Size of alternative stack for signal handlers in the tracer thread. static const int kHandlerStackSize = 4096; // This function will be run as a cloned task. static int TracerThread(void* argument) { TracerThreadArgument *tracer_thread_argument = (TracerThreadArgument *)argument; internal_prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); // Check if parent is already dead. if (internal_getppid() != tracer_thread_argument->parent_pid) internal__exit(4); // Wait for the parent thread to finish preparations. tracer_thread_argument->mutex.Lock(); tracer_thread_argument->mutex.Unlock(); RAW_CHECK(AddDieCallback(TracerThreadDieCallback)); ThreadSuspender thread_suspender(internal_getppid(), tracer_thread_argument); // Global pointer for the signal handler. thread_suspender_instance = &thread_suspender; // Alternate stack for signal handling. InternalScopedBuffer handler_stack_memory(kHandlerStackSize); struct sigaltstack handler_stack; internal_memset(&handler_stack, 0, sizeof(handler_stack)); handler_stack.ss_sp = handler_stack_memory.data(); handler_stack.ss_size = kHandlerStackSize; internal_sigaltstack(&handler_stack, nullptr); // Install our handler for synchronous signals. Other signals should be // blocked by the mask we inherited from the parent thread. for (uptr i = 0; i < ARRAY_SIZE(kSyncSignals); i++) { __sanitizer_sigaction act; internal_memset(&act, 0, sizeof(act)); act.sigaction = TracerThreadSignalHandler; act.sa_flags = SA_ONSTACK | SA_SIGINFO; internal_sigaction_norestorer(kSyncSignals[i], &act, 0); } int exit_code = 0; if (!thread_suspender.SuspendAllThreads()) { VReport(1, "Failed suspending threads.\n"); exit_code = 3; } else { tracer_thread_argument->callback(thread_suspender.suspended_threads_list(), tracer_thread_argument->callback_argument); thread_suspender.ResumeAllThreads(); exit_code = 0; } RAW_CHECK(RemoveDieCallback(TracerThreadDieCallback)); thread_suspender_instance = nullptr; atomic_store(&tracer_thread_argument->done, 1, memory_order_relaxed); return exit_code; } class ScopedStackSpaceWithGuard { public: explicit ScopedStackSpaceWithGuard(uptr stack_size) { stack_size_ = stack_size; guard_size_ = GetPageSizeCached(); // FIXME: Omitting MAP_STACK here works in current kernels but might break // in the future. guard_start_ = (uptr)MmapOrDie(stack_size_ + guard_size_, "ScopedStackWithGuard"); CHECK(MprotectNoAccess((uptr)guard_start_, guard_size_)); } ~ScopedStackSpaceWithGuard() { UnmapOrDie((void *)guard_start_, stack_size_ + guard_size_); } void *Bottom() const { return (void *)(guard_start_ + stack_size_ + guard_size_); } private: uptr stack_size_; uptr guard_size_; uptr guard_start_; }; // We have a limitation on the stack frame size, so some stuff had to be moved // into globals. static __sanitizer_sigset_t blocked_sigset; static __sanitizer_sigset_t old_sigset; class StopTheWorldScope { public: StopTheWorldScope() { // Make this process dumpable. Processes that are not dumpable cannot be // attached to. process_was_dumpable_ = internal_prctl(PR_GET_DUMPABLE, 0, 0, 0, 0); if (!process_was_dumpable_) internal_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); } ~StopTheWorldScope() { // Restore the dumpable flag. if (!process_was_dumpable_) internal_prctl(PR_SET_DUMPABLE, 0, 0, 0, 0); } private: int process_was_dumpable_; }; // When sanitizer output is being redirected to file (i.e. by using log_path), // the tracer should write to the parent's log instead of trying to open a new // file. Alert the logging code to the fact that we have a tracer. struct ScopedSetTracerPID { explicit ScopedSetTracerPID(uptr tracer_pid) { stoptheworld_tracer_pid = tracer_pid; stoptheworld_tracer_ppid = internal_getpid(); } ~ScopedSetTracerPID() { stoptheworld_tracer_pid = 0; stoptheworld_tracer_ppid = 0; } }; void StopTheWorld(StopTheWorldCallback callback, void *argument) { StopTheWorldScope in_stoptheworld; // Prepare the arguments for TracerThread. struct TracerThreadArgument tracer_thread_argument; tracer_thread_argument.callback = callback; tracer_thread_argument.callback_argument = argument; tracer_thread_argument.parent_pid = internal_getpid(); atomic_store(&tracer_thread_argument.done, 0, memory_order_relaxed); const uptr kTracerStackSize = 2 * 1024 * 1024; ScopedStackSpaceWithGuard tracer_stack(kTracerStackSize); // Block the execution of TracerThread until after we have set ptrace // permissions. tracer_thread_argument.mutex.Lock(); // Signal handling story. // We don't want async signals to be delivered to the tracer thread, // so we block all async signals before creating the thread. An async signal // handler can temporary modify errno, which is shared with this thread. // We ought to use pthread_sigmask here, because sigprocmask has undefined // behavior in multithreaded programs. However, on linux sigprocmask is // equivalent to pthread_sigmask with the exception that pthread_sigmask // does not allow to block some signals used internally in pthread // implementation. We are fine with blocking them here, we are really not // going to pthread_cancel the thread. // The tracer thread should not raise any synchronous signals. But in case it // does, we setup a special handler for sync signals that properly kills the // parent as well. Note: we don't pass CLONE_SIGHAND to clone, so handlers // in the tracer thread won't interfere with user program. Double note: if a // user does something along the lines of 'kill -11 pid', that can kill the // process even if user setup own handler for SEGV. // Thing to watch out for: this code should not change behavior of user code // in any observable way. In particular it should not override user signal // handlers. internal_sigfillset(&blocked_sigset); for (uptr i = 0; i < ARRAY_SIZE(kSyncSignals); i++) internal_sigdelset(&blocked_sigset, kSyncSignals[i]); int rv = internal_sigprocmask(SIG_BLOCK, &blocked_sigset, &old_sigset); CHECK_EQ(rv, 0); uptr tracer_pid = internal_clone( TracerThread, tracer_stack.Bottom(), CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_UNTRACED, &tracer_thread_argument, nullptr /* parent_tidptr */, nullptr /* newtls */, nullptr /* child_tidptr */); internal_sigprocmask(SIG_SETMASK, &old_sigset, 0); int local_errno = 0; if (internal_iserror(tracer_pid, &local_errno)) { VReport(1, "Failed spawning a tracer thread (errno %d).\n", local_errno); tracer_thread_argument.mutex.Unlock(); } else { ScopedSetTracerPID scoped_set_tracer_pid(tracer_pid); // On some systems we have to explicitly declare that we want to be traced // by the tracer thread. #ifdef PR_SET_PTRACER internal_prctl(PR_SET_PTRACER, tracer_pid, 0, 0, 0); #endif // Allow the tracer thread to start. tracer_thread_argument.mutex.Unlock(); // NOTE: errno is shared between this thread and the tracer thread. // internal_waitpid() may call syscall() which can access/spoil errno, // so we can't call it now. Instead we for the tracer thread to finish using // the spin loop below. Man page for sched_yield() says "In the Linux // implementation, sched_yield() always succeeds", so let's hope it does not // spoil errno. Note that this spin loop runs only for brief periods before // the tracer thread has suspended us and when it starts unblocking threads. while (atomic_load(&tracer_thread_argument.done, memory_order_relaxed) == 0) sched_yield(); // Now the tracer thread is about to exit and does not touch errno, // wait for it. for (;;) { uptr waitpid_status = internal_waitpid(tracer_pid, nullptr, __WALL); if (!internal_iserror(waitpid_status, &local_errno)) break; if (local_errno == EINTR) continue; VReport(1, "Waiting on the tracer thread failed (errno %d).\n", local_errno); break; } } } // Platform-specific methods from SuspendedThreadsList. #if SANITIZER_ANDROID && defined(__arm__) typedef pt_regs regs_struct; #define REG_SP ARM_sp #elif SANITIZER_LINUX && defined(__arm__) typedef user_regs regs_struct; #define REG_SP uregs[13] #elif defined(__i386__) || defined(__x86_64__) typedef user_regs_struct regs_struct; #if defined(__i386__) #define REG_SP esp #else #define REG_SP rsp #endif #elif defined(__powerpc__) || defined(__powerpc64__) typedef pt_regs regs_struct; #define REG_SP gpr[PT_R1] #elif defined(__mips__) typedef struct user regs_struct; # if SANITIZER_ANDROID # define REG_SP regs[EF_R29] # else # define REG_SP regs[EF_REG29] # endif #elif defined(__aarch64__) typedef struct user_pt_regs regs_struct; #define REG_SP sp #define ARCH_IOVEC_FOR_GETREGSET #elif defined(__s390__) typedef _user_regs_struct regs_struct; #define REG_SP gprs[15] #define ARCH_IOVEC_FOR_GETREGSET #else #error "Unsupported architecture" #endif // SANITIZER_ANDROID && defined(__arm__) int SuspendedThreadsList::GetRegistersAndSP(uptr index, uptr *buffer, uptr *sp) const { pid_t tid = GetThreadID(index); regs_struct regs; int pterrno; #ifdef ARCH_IOVEC_FOR_GETREGSET struct iovec regset_io; regset_io.iov_base = ®s; regset_io.iov_len = sizeof(regs_struct); bool isErr = internal_iserror(internal_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)®set_io), &pterrno); #else bool isErr = internal_iserror(internal_ptrace(PTRACE_GETREGS, tid, nullptr, ®s), &pterrno); #endif if (isErr) { VReport(1, "Could not get registers from thread %d (errno %d).\n", tid, pterrno); return -1; } *sp = regs.REG_SP; internal_memcpy(buffer, ®s, sizeof(regs)); return 0; } uptr SuspendedThreadsList::RegisterCount() { return sizeof(regs_struct) / sizeof(uptr); } } // namespace __sanitizer #endif // SANITIZER_LINUX && (defined(__x86_64__) || defined(__mips__) // || defined(__aarch64__) || defined(__powerpc64__) // || defined(__s390__) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_procmaps_mac.cc0000664000175000017500000001414112662654403032403 0ustar mwhudsonmwhudson//===-- sanitizer_procmaps_mac.cc -----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Information about the process mappings (Mac-specific parts). //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_common.h" #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" #include #include namespace __sanitizer { MemoryMappingLayout::MemoryMappingLayout(bool cache_enabled) { Reset(); } MemoryMappingLayout::~MemoryMappingLayout() { } // More information about Mach-O headers can be found in mach-o/loader.h // Each Mach-O image has a header (mach_header or mach_header_64) starting with // a magic number, and a list of linker load commands directly following the // header. // A load command is at least two 32-bit words: the command type and the // command size in bytes. We're interested only in segment load commands // (LC_SEGMENT and LC_SEGMENT_64), which tell that a part of the file is mapped // into the task's address space. // The |vmaddr|, |vmsize| and |fileoff| fields of segment_command or // segment_command_64 correspond to the memory address, memory size and the // file offset of the current memory segment. // Because these fields are taken from the images as is, one needs to add // _dyld_get_image_vmaddr_slide() to get the actual addresses at runtime. void MemoryMappingLayout::Reset() { // Count down from the top. // TODO(glider): as per man 3 dyld, iterating over the headers with // _dyld_image_count is thread-unsafe. We need to register callbacks for // adding and removing images which will invalidate the MemoryMappingLayout // state. current_image_ = _dyld_image_count(); current_load_cmd_count_ = -1; current_load_cmd_addr_ = 0; current_magic_ = 0; current_filetype_ = 0; } // static void MemoryMappingLayout::CacheMemoryMappings() { // No-op on Mac for now. } void MemoryMappingLayout::LoadFromCache() { // No-op on Mac for now. } // Next and NextSegmentLoad were inspired by base/sysinfo.cc in // Google Perftools, https://github.com/gperftools/gperftools. // NextSegmentLoad scans the current image for the next segment load command // and returns the start and end addresses and file offset of the corresponding // segment. // Note that the segment addresses are not necessarily sorted. template bool MemoryMappingLayout::NextSegmentLoad( uptr *start, uptr *end, uptr *offset, char filename[], uptr filename_size, uptr *protection) { const char* lc = current_load_cmd_addr_; current_load_cmd_addr_ += ((const load_command *)lc)->cmdsize; if (((const load_command *)lc)->cmd == kLCSegment) { const sptr dlloff = _dyld_get_image_vmaddr_slide(current_image_); const SegmentCommand* sc = (const SegmentCommand *)lc; if (start) *start = sc->vmaddr + dlloff; if (protection) { // Return the initial protection. *protection = sc->initprot; } if (end) *end = sc->vmaddr + sc->vmsize + dlloff; if (offset) { if (current_filetype_ == /*MH_EXECUTE*/ 0x2) { *offset = sc->vmaddr; } else { *offset = sc->fileoff; } } if (filename) { internal_strncpy(filename, _dyld_get_image_name(current_image_), filename_size); } return true; } return false; } bool MemoryMappingLayout::Next(uptr *start, uptr *end, uptr *offset, char filename[], uptr filename_size, uptr *protection) { for (; current_image_ >= 0; current_image_--) { const mach_header* hdr = _dyld_get_image_header(current_image_); if (!hdr) continue; if (current_load_cmd_count_ < 0) { // Set up for this image; current_load_cmd_count_ = hdr->ncmds; current_magic_ = hdr->magic; current_filetype_ = hdr->filetype; switch (current_magic_) { #ifdef MH_MAGIC_64 case MH_MAGIC_64: { current_load_cmd_addr_ = (char*)hdr + sizeof(mach_header_64); break; } #endif case MH_MAGIC: { current_load_cmd_addr_ = (char*)hdr + sizeof(mach_header); break; } default: { continue; } } } for (; current_load_cmd_count_ >= 0; current_load_cmd_count_--) { switch (current_magic_) { // current_magic_ may be only one of MH_MAGIC, MH_MAGIC_64. #ifdef MH_MAGIC_64 case MH_MAGIC_64: { if (NextSegmentLoad( start, end, offset, filename, filename_size, protection)) return true; break; } #endif case MH_MAGIC: { if (NextSegmentLoad( start, end, offset, filename, filename_size, protection)) return true; break; } } } // If we get here, no more load_cmd's in this image talk about // segments. Go on to the next image. } return false; } void MemoryMappingLayout::DumpListOfModules( InternalMmapVector *modules) { Reset(); uptr cur_beg, cur_end, prot; InternalScopedString module_name(kMaxPathLength); for (uptr i = 0; Next(&cur_beg, &cur_end, 0, module_name.data(), module_name.size(), &prot); i++) { const char *cur_name = module_name.data(); if (cur_name[0] == '\0') continue; LoadedModule *cur_module = nullptr; if (!modules->empty() && 0 == internal_strcmp(cur_name, modules->back().full_name())) { cur_module = &modules->back(); } else { modules->push_back(LoadedModule()); cur_module = &modules->back(); cur_module->set(cur_name, cur_beg); } cur_module->addAddressRange(cur_beg, cur_end, prot & kProtectionExecute); } } } // namespace __sanitizer #endif // SANITIZER_MAC ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_local_cache.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_local_cache.0000664000175000017500000002067712761423315033715 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_local_cache.h -----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif // Objects of this type should be used as local caches for SizeClassAllocator64 // or SizeClassAllocator32. Since the typical use of this class is to have one // object per thread in TLS, is has to be POD. template struct SizeClassAllocatorLocalCache : SizeClassAllocator::AllocatorCache { }; // Cache used by SizeClassAllocator64. template struct SizeClassAllocator64LocalCache { typedef SizeClassAllocator Allocator; static const uptr kNumClasses = SizeClassAllocator::kNumClasses; typedef typename Allocator::SizeClassMapT SizeClassMap; typedef typename Allocator::CompactPtrT CompactPtrT; void Init(AllocatorGlobalStats *s) { stats_.Init(); if (s) s->Register(&stats_); } void Destroy(SizeClassAllocator *allocator, AllocatorGlobalStats *s) { Drain(allocator); if (s) s->Unregister(&stats_); } void *Allocate(SizeClassAllocator *allocator, uptr class_id) { CHECK_NE(class_id, 0UL); CHECK_LT(class_id, kNumClasses); stats_.Add(AllocatorStatAllocated, Allocator::ClassIdToSize(class_id)); PerClass *c = &per_class_[class_id]; if (UNLIKELY(c->count == 0)) Refill(c, allocator, class_id); CHECK_GT(c->count, 0); CompactPtrT chunk = c->chunks[--c->count]; void *res = reinterpret_cast(allocator->CompactPtrToPointer( allocator->GetRegionBeginBySizeClass(class_id), chunk)); return res; } void Deallocate(SizeClassAllocator *allocator, uptr class_id, void *p) { CHECK_NE(class_id, 0UL); CHECK_LT(class_id, kNumClasses); // If the first allocator call on a new thread is a deallocation, then // max_count will be zero, leading to check failure. InitCache(); stats_.Sub(AllocatorStatAllocated, Allocator::ClassIdToSize(class_id)); PerClass *c = &per_class_[class_id]; CHECK_NE(c->max_count, 0UL); if (UNLIKELY(c->count == c->max_count)) Drain(c, allocator, class_id, c->max_count / 2); CompactPtrT chunk = allocator->PointerToCompactPtr( allocator->GetRegionBeginBySizeClass(class_id), reinterpret_cast(p)); c->chunks[c->count++] = chunk; } void Drain(SizeClassAllocator *allocator) { for (uptr class_id = 0; class_id < kNumClasses; class_id++) { PerClass *c = &per_class_[class_id]; while (c->count > 0) Drain(c, allocator, class_id, c->count); } } // private: struct PerClass { u32 count; u32 max_count; CompactPtrT chunks[2 * SizeClassMap::kMaxNumCachedHint]; }; PerClass per_class_[kNumClasses]; AllocatorStats stats_; void InitCache() { if (per_class_[1].max_count) return; for (uptr i = 0; i < kNumClasses; i++) { PerClass *c = &per_class_[i]; c->max_count = 2 * SizeClassMap::MaxCachedHint(i); } } NOINLINE void Refill(PerClass *c, SizeClassAllocator *allocator, uptr class_id) { InitCache(); uptr num_requested_chunks = SizeClassMap::MaxCachedHint(class_id); allocator->GetFromAllocator(&stats_, class_id, c->chunks, num_requested_chunks); c->count = num_requested_chunks; } NOINLINE void Drain(PerClass *c, SizeClassAllocator *allocator, uptr class_id, uptr count) { InitCache(); CHECK_GE(c->count, count); uptr first_idx_to_drain = c->count - count; c->count -= count; allocator->ReturnToAllocator(&stats_, class_id, &c->chunks[first_idx_to_drain], count); } }; // Cache used by SizeClassAllocator32. template struct SizeClassAllocator32LocalCache { typedef SizeClassAllocator Allocator; typedef typename Allocator::TransferBatch TransferBatch; static const uptr kNumClasses = SizeClassAllocator::kNumClasses; void Init(AllocatorGlobalStats *s) { stats_.Init(); if (s) s->Register(&stats_); } void Destroy(SizeClassAllocator *allocator, AllocatorGlobalStats *s) { Drain(allocator); if (s) s->Unregister(&stats_); } void *Allocate(SizeClassAllocator *allocator, uptr class_id) { CHECK_NE(class_id, 0UL); CHECK_LT(class_id, kNumClasses); stats_.Add(AllocatorStatAllocated, Allocator::ClassIdToSize(class_id)); PerClass *c = &per_class_[class_id]; if (UNLIKELY(c->count == 0)) Refill(allocator, class_id); void *res = c->batch[--c->count]; PREFETCH(c->batch[c->count - 1]); return res; } void Deallocate(SizeClassAllocator *allocator, uptr class_id, void *p) { CHECK_NE(class_id, 0UL); CHECK_LT(class_id, kNumClasses); // If the first allocator call on a new thread is a deallocation, then // max_count will be zero, leading to check failure. InitCache(); stats_.Sub(AllocatorStatAllocated, Allocator::ClassIdToSize(class_id)); PerClass *c = &per_class_[class_id]; CHECK_NE(c->max_count, 0UL); if (UNLIKELY(c->count == c->max_count)) Drain(allocator, class_id); c->batch[c->count++] = p; } void Drain(SizeClassAllocator *allocator) { for (uptr class_id = 0; class_id < kNumClasses; class_id++) { PerClass *c = &per_class_[class_id]; while (c->count > 0) Drain(allocator, class_id); } } // private: typedef typename SizeClassAllocator::SizeClassMapT SizeClassMap; struct PerClass { uptr count; uptr max_count; void *batch[2 * TransferBatch::kMaxNumCached]; }; PerClass per_class_[kNumClasses]; AllocatorStats stats_; void InitCache() { if (per_class_[1].max_count) return; for (uptr i = 0; i < kNumClasses; i++) { PerClass *c = &per_class_[i]; c->max_count = 2 * TransferBatch::MaxCached(i); } } // TransferBatch class is declared in SizeClassAllocator. // We transfer chunks between central and thread-local free lists in batches. // For small size classes we allocate batches separately. // For large size classes we may use one of the chunks to store the batch. // sizeof(TransferBatch) must be a power of 2 for more efficient allocation. static uptr SizeClassForTransferBatch(uptr class_id) { if (Allocator::ClassIdToSize(class_id) < TransferBatch::AllocationSizeRequiredForNElements( TransferBatch::MaxCached(class_id))) return SizeClassMap::ClassID(sizeof(TransferBatch)); return 0; } // Returns a TransferBatch suitable for class_id. // For small size classes allocates the batch from the allocator. // For large size classes simply returns b. TransferBatch *CreateBatch(uptr class_id, SizeClassAllocator *allocator, TransferBatch *b) { if (uptr batch_class_id = SizeClassForTransferBatch(class_id)) return (TransferBatch*)Allocate(allocator, batch_class_id); return b; } // Destroys TransferBatch b. // For small size classes deallocates b to the allocator. // Does notthing for large size classes. void DestroyBatch(uptr class_id, SizeClassAllocator *allocator, TransferBatch *b) { if (uptr batch_class_id = SizeClassForTransferBatch(class_id)) Deallocate(allocator, batch_class_id, b); } NOINLINE void Refill(SizeClassAllocator *allocator, uptr class_id) { InitCache(); PerClass *c = &per_class_[class_id]; TransferBatch *b = allocator->AllocateBatch(&stats_, this, class_id); CHECK_GT(b->Count(), 0); b->CopyToArray(c->batch); c->count = b->Count(); DestroyBatch(class_id, allocator, b); } NOINLINE void Drain(SizeClassAllocator *allocator, uptr class_id) { InitCache(); PerClass *c = &per_class_[class_id]; uptr cnt = Min(c->max_count / 2, c->count); uptr first_idx_to_drain = c->count - cnt; TransferBatch *b = CreateBatch( class_id, allocator, (TransferBatch *)c->batch[first_idx_to_drain]); b->SetFromArray(allocator->GetRegionBeginBySizeClass(class_id), &c->batch[first_idx_to_drain], cnt); c->count -= cnt; allocator->DeallocateBatch(&stats_, class_id, b); } }; ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_coverage_mapping_libcd0000664000175000017500000000755612662654403034032 0ustar mwhudsonmwhudson//===-- sanitizer_coverage_mapping.cc -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Mmap-based implementation of sanitizer coverage. // // This is part of the implementation of code coverage that does not require // __sanitizer_cov_dump() call. Data is stored in 2 files per process. // // $pid.sancov.map describes process memory layout in the following text-based // format: // // 1 line, 32 or 64 // // repeated // ... // Mapping lines are NOT sorted. This file is updated every time memory layout // is changed (i.e. in dlopen() and dlclose() interceptors). // // $pid.sancov.raw is a binary dump of PC values, sizeof(uptr) each. Again, not // sorted. This file is extended by 64Kb at a time and mapped into memory. It // contains one or more 0 words at the end, up to the next 64Kb aligned offset. // // To convert these 2 files to the usual .sancov format, run sancov.py rawunpack // $pid.sancov.raw. // //===----------------------------------------------------------------------===// #include "sanitizer_allocator_internal.h" #include "sanitizer_libc.h" #include "sanitizer_procmaps.h" namespace __sanitizer { static const uptr kMaxTextSize = 64 * 1024; struct CachedMapping { public: bool NeedsUpdate(uptr pc) { int new_pid = internal_getpid(); if (last_pid == new_pid && pc && pc >= last_range_start && pc < last_range_end) return false; last_pid = new_pid; return true; } void SetModuleRange(uptr start, uptr end) { last_range_start = start; last_range_end = end; } private: uptr last_range_start, last_range_end; int last_pid; }; static CachedMapping cached_mapping; static StaticSpinMutex mapping_mu; void CovUpdateMapping(const char *coverage_dir, uptr caller_pc) { if (!common_flags()->coverage_direct) return; SpinMutexLock l(&mapping_mu); if (!cached_mapping.NeedsUpdate(caller_pc)) return; InternalScopedString text(kMaxTextSize); { text.append("%d\n", sizeof(uptr) * 8); ListOfModules modules; modules.init(); for (const LoadedModule &module : modules) { const char *module_name = StripModuleName(module.full_name()); uptr base = module.base_address(); for (const auto &range : module.ranges()) { if (range.executable) { uptr start = range.beg; uptr end = range.end; text.append("%zx %zx %zx %s\n", start, end, base, module_name); if (caller_pc && caller_pc >= start && caller_pc < end) cached_mapping.SetModuleRange(start, end); } } } } error_t err; InternalScopedString tmp_path(64 + internal_strlen(coverage_dir)); uptr res = internal_snprintf((char *)tmp_path.data(), tmp_path.size(), "%s/%zd.sancov.map.tmp", coverage_dir, internal_getpid()); CHECK_LE(res, tmp_path.size()); fd_t map_fd = OpenFile(tmp_path.data(), WrOnly, &err); if (map_fd == kInvalidFd) { Report("Coverage: failed to open %s for writing: %d\n", tmp_path.data(), err); Die(); } if (!WriteToFile(map_fd, text.data(), text.length(), nullptr, &err)) { Printf("sancov.map write failed: %d\n", err); Die(); } CloseFile(map_fd); InternalScopedString path(64 + internal_strlen(coverage_dir)); res = internal_snprintf((char *)path.data(), path.size(), "%s/%zd.sancov.map", coverage_dir, internal_getpid()); CHECK_LE(res, path.size()); if (!RenameFile(tmp_path.data(), path.data(), &err)) { Printf("sancov.map rename failed: %d\n", err); Die(); } } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_persistent_allocator.h0000664000175000017500000000444012602553450034034 0ustar mwhudsonmwhudson//===-- sanitizer_persistent_allocator.h ------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // A fast memory allocator that does not support free() nor realloc(). // All allocations are forever. //===----------------------------------------------------------------------===// #ifndef SANITIZER_PERSISTENT_ALLOCATOR_H #define SANITIZER_PERSISTENT_ALLOCATOR_H #include "sanitizer_internal_defs.h" #include "sanitizer_mutex.h" #include "sanitizer_atomic.h" #include "sanitizer_common.h" namespace __sanitizer { class PersistentAllocator { public: void *alloc(uptr size); private: void *tryAlloc(uptr size); StaticSpinMutex mtx; // Protects alloc of new blocks for region allocator. atomic_uintptr_t region_pos; // Region allocator for Node's. atomic_uintptr_t region_end; }; inline void *PersistentAllocator::tryAlloc(uptr size) { // Optimisic lock-free allocation, essentially try to bump the region ptr. for (;;) { uptr cmp = atomic_load(®ion_pos, memory_order_acquire); uptr end = atomic_load(®ion_end, memory_order_acquire); if (cmp == 0 || cmp + size > end) return nullptr; if (atomic_compare_exchange_weak(®ion_pos, &cmp, cmp + size, memory_order_acquire)) return (void *)cmp; } } inline void *PersistentAllocator::alloc(uptr size) { // First, try to allocate optimisitically. void *s = tryAlloc(size); if (s) return s; // If failed, lock, retry and alloc new superblock. SpinMutexLock l(&mtx); for (;;) { s = tryAlloc(size); if (s) return s; atomic_store(®ion_pos, 0, memory_order_relaxed); uptr allocsz = 64 * 1024; if (allocsz < size) allocsz = size; uptr mem = (uptr)MmapOrDie(allocsz, "stack depot"); atomic_store(®ion_end, mem + allocsz, memory_order_release); atomic_store(®ion_pos, mem, memory_order_release); } } extern PersistentAllocator thePersistentAllocator; inline void *PersistentAlloc(uptr sz) { return thePersistentAllocator.alloc(sz); } } // namespace __sanitizer #endif // SANITIZER_PERSISTENT_ALLOCATOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_posix.cc0000664000175000017500000002722312775261667031121 0ustar mwhudsonmwhudson//===-- sanitizer_posix.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and implements POSIX-specific functions from // sanitizer_posix.h. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_POSIX #include "sanitizer_common.h" #include "sanitizer_libc.h" #include "sanitizer_posix.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #include #include #include #if SANITIZER_LINUX #include #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID #include #endif #if SANITIZER_FREEBSD // The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before // that, it was never implemented. So just define it to zero. #undef MAP_NORESERVE #define MAP_NORESERVE 0 #endif namespace __sanitizer { // ------------- sanitizer_common.h uptr GetMmapGranularity() { return GetPageSize(); } #if SANITIZER_WORDSIZE == 32 // Take care of unusable kernel area in top gigabyte. static uptr GetKernelAreaSize() { #if SANITIZER_LINUX && !SANITIZER_X32 const uptr gbyte = 1UL << 30; // Firstly check if there are writable segments // mapped to top gigabyte (e.g. stack). MemoryMappingLayout proc_maps(/*cache_enabled*/true); uptr end, prot; while (proc_maps.Next(/*start*/nullptr, &end, /*offset*/nullptr, /*filename*/nullptr, /*filename_size*/0, &prot)) { if ((end >= 3 * gbyte) && (prot & MemoryMappingLayout::kProtectionWrite) != 0) return 0; } #if !SANITIZER_ANDROID // Even if nothing is mapped, top Gb may still be accessible // if we are running on 64-bit kernel. // Uname may report misleading results if personality type // is modified (e.g. under schroot) so check this as well. struct utsname uname_info; int pers = personality(0xffffffffUL); if (!(pers & PER_MASK) && uname(&uname_info) == 0 && internal_strstr(uname_info.machine, "64")) return 0; #endif // SANITIZER_ANDROID // Top gigabyte is reserved for kernel. return gbyte; #else return 0; #endif // SANITIZER_LINUX && !SANITIZER_X32 } #endif // SANITIZER_WORDSIZE == 32 uptr GetMaxVirtualAddress() { #if SANITIZER_WORDSIZE == 64 # if defined(__aarch64__) && SANITIZER_IOS && !SANITIZER_IOSSIM // Ideally, we would derive the upper bound from MACH_VM_MAX_ADDRESS. The // upper bound can change depending on the device. return 0x200000000 - 1; # elif defined(__powerpc64__) || defined(__aarch64__) // On PowerPC64 we have two different address space layouts: 44- and 46-bit. // We somehow need to figure out which one we are using now and choose // one of 0x00000fffffffffffUL and 0x00003fffffffffffUL. // Note that with 'ulimit -s unlimited' the stack is moved away from the top // of the address space, so simply checking the stack address is not enough. // This should (does) work for both PowerPC64 Endian modes. // Similarly, aarch64 has multiple address space layouts: 39, 42 and 47-bit. return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1; # elif defined(__mips64) return (1ULL << 40) - 1; // 0x000000ffffffffffUL; # elif defined(__s390x__) return (1ULL << 53) - 1; // 0x001fffffffffffffUL; # else return (1ULL << 47) - 1; // 0x00007fffffffffffUL; # endif #else // SANITIZER_WORDSIZE == 32 # if defined(__s390__) return (1ULL << 31) - 1; // 0x7fffffff; # else uptr res = (1ULL << 32) - 1; // 0xffffffff; if (!common_flags()->full_address_space) res -= GetKernelAreaSize(); CHECK_LT(reinterpret_cast(&res), res); return res; # endif #endif // SANITIZER_WORDSIZE } void *MmapOrDie(uptr size, const char *mem_type, bool raw_report) { size = RoundUpTo(size, GetPageSizeCached()); uptr res = internal_mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); int reserrno; if (internal_iserror(res, &reserrno)) ReportMmapFailureAndDie(size, mem_type, "allocate", reserrno, raw_report); IncreaseTotalMmap(size); return (void *)res; } void UnmapOrDie(void *addr, uptr size) { if (!addr || !size) return; uptr res = internal_munmap(addr, size); if (internal_iserror(res)) { Report("ERROR: %s failed to deallocate 0x%zx (%zd) bytes at address %p\n", SanitizerToolName, size, size, addr); CHECK("unable to unmap" && 0); } DecreaseTotalMmap(size); } // We want to map a chunk of address space aligned to 'alignment'. // We do it by maping a bit more and then unmaping redundant pieces. // We probably can do it with fewer syscalls in some OS-dependent way. void *MmapAlignedOrDie(uptr size, uptr alignment, const char *mem_type) { CHECK(IsPowerOfTwo(size)); CHECK(IsPowerOfTwo(alignment)); uptr map_size = size + alignment; uptr map_res = (uptr)MmapOrDie(map_size, mem_type); uptr map_end = map_res + map_size; uptr res = map_res; if (res & (alignment - 1)) // Not aligned. res = (map_res + alignment) & ~(alignment - 1); uptr end = res + size; if (res != map_res) UnmapOrDie((void*)map_res, res - map_res); if (end != map_end) UnmapOrDie((void*)end, map_end - end); return (void*)res; } void *MmapNoReserveOrDie(uptr size, const char *mem_type) { uptr PageSize = GetPageSizeCached(); uptr p = internal_mmap(nullptr, RoundUpTo(size, PageSize), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, -1, 0); int reserrno; if (internal_iserror(p, &reserrno)) ReportMmapFailureAndDie(size, mem_type, "allocate noreserve", reserrno); IncreaseTotalMmap(size); return (void *)p; } void *MmapFixedOrDie(uptr fixed_addr, uptr size) { uptr PageSize = GetPageSizeCached(); uptr p = internal_mmap((void*)(fixed_addr & ~(PageSize - 1)), RoundUpTo(size, PageSize), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0); int reserrno; if (internal_iserror(p, &reserrno)) { char mem_type[30]; internal_snprintf(mem_type, sizeof(mem_type), "memory at address 0x%zx", fixed_addr); ReportMmapFailureAndDie(size, mem_type, "allocate", reserrno); } IncreaseTotalMmap(size); return (void *)p; } bool MprotectNoAccess(uptr addr, uptr size) { return 0 == internal_mprotect((void*)addr, size, PROT_NONE); } bool MprotectReadOnly(uptr addr, uptr size) { return 0 == internal_mprotect((void *)addr, size, PROT_READ); } fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *errno_p) { int flags; switch (mode) { case RdOnly: flags = O_RDONLY; break; case WrOnly: flags = O_WRONLY | O_CREAT; break; case RdWr: flags = O_RDWR | O_CREAT; break; } fd_t res = internal_open(filename, flags, 0660); if (internal_iserror(res, errno_p)) return kInvalidFd; return res; } void CloseFile(fd_t fd) { internal_close(fd); } bool ReadFromFile(fd_t fd, void *buff, uptr buff_size, uptr *bytes_read, error_t *error_p) { uptr res = internal_read(fd, buff, buff_size); if (internal_iserror(res, error_p)) return false; if (bytes_read) *bytes_read = res; return true; } bool WriteToFile(fd_t fd, const void *buff, uptr buff_size, uptr *bytes_written, error_t *error_p) { uptr res = internal_write(fd, buff, buff_size); if (internal_iserror(res, error_p)) return false; if (bytes_written) *bytes_written = res; return true; } bool RenameFile(const char *oldpath, const char *newpath, error_t *error_p) { uptr res = internal_rename(oldpath, newpath); return !internal_iserror(res, error_p); } void *MapFileToMemory(const char *file_name, uptr *buff_size) { fd_t fd = OpenFile(file_name, RdOnly); CHECK(fd != kInvalidFd); uptr fsize = internal_filesize(fd); CHECK_NE(fsize, (uptr)-1); CHECK_GT(fsize, 0); *buff_size = RoundUpTo(fsize, GetPageSizeCached()); uptr map = internal_mmap(nullptr, *buff_size, PROT_READ, MAP_PRIVATE, fd, 0); return internal_iserror(map) ? nullptr : (void *)map; } void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) { uptr flags = MAP_SHARED; if (addr) flags |= MAP_FIXED; uptr p = internal_mmap(addr, size, PROT_READ | PROT_WRITE, flags, fd, offset); int mmap_errno = 0; if (internal_iserror(p, &mmap_errno)) { Printf("could not map writable file (%d, %lld, %zu): %zd, errno: %d\n", fd, (long long)offset, size, p, mmap_errno); return nullptr; } return (void *)p; } static inline bool IntervalsAreSeparate(uptr start1, uptr end1, uptr start2, uptr end2) { CHECK(start1 <= end1); CHECK(start2 <= end2); return (end1 < start2) || (end2 < start1); } // FIXME: this is thread-unsafe, but should not cause problems most of the time. // When the shadow is mapped only a single thread usually exists (plus maybe // several worker threads on Mac, which aren't expected to map big chunks of // memory). bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) { MemoryMappingLayout proc_maps(/*cache_enabled*/true); uptr start, end; while (proc_maps.Next(&start, &end, /*offset*/nullptr, /*filename*/nullptr, /*filename_size*/0, /*protection*/nullptr)) { if (start == end) continue; // Empty range. CHECK_NE(0, end); if (!IntervalsAreSeparate(start, end - 1, range_start, range_end)) return false; } return true; } void DumpProcessMap() { MemoryMappingLayout proc_maps(/*cache_enabled*/true); uptr start, end; const sptr kBufSize = 4095; char *filename = (char*)MmapOrDie(kBufSize, __func__); Report("Process memory map follows:\n"); while (proc_maps.Next(&start, &end, /* file_offset */nullptr, filename, kBufSize, /* protection */nullptr)) { Printf("\t%p-%p\t%s\n", (void*)start, (void*)end, filename); } Report("End of process memory map.\n"); UnmapOrDie(filename, kBufSize); } const char *GetPwd() { return GetEnv("PWD"); } bool IsPathSeparator(const char c) { return c == '/'; } bool IsAbsolutePath(const char *path) { return path != nullptr && IsPathSeparator(path[0]); } void ReportFile::Write(const char *buffer, uptr length) { SpinMutexLock l(mu); static const char *kWriteError = "ReportFile::Write() can't output requested buffer!\n"; ReopenIfNecessary(); if (length != internal_write(fd, buffer, length)) { internal_write(fd, kWriteError, internal_strlen(kWriteError)); Die(); } } bool GetCodeRangeForFile(const char *module, uptr *start, uptr *end) { uptr s, e, off, prot; InternalScopedString buff(kMaxPathLength); MemoryMappingLayout proc_maps(/*cache_enabled*/false); while (proc_maps.Next(&s, &e, &off, buff.data(), buff.size(), &prot)) { if ((prot & MemoryMappingLayout::kProtectionExecute) != 0 && internal_strcmp(module, buff.data()) == 0) { *start = s; *end = e; return true; } } return false; } SignalContext SignalContext::Create(void *siginfo, void *context) { auto si = (siginfo_t *)siginfo; uptr addr = (uptr)si->si_addr; uptr pc, sp, bp; GetPcSpBp(context, &pc, &sp, &bp); WriteFlag write_flag = GetWriteFlag(context); bool is_memory_access = si->si_signo == SIGSEGV; return SignalContext(context, addr, pc, sp, bp, is_memory_access, write_flag); } } // namespace __sanitizer #endif // SANITIZER_POSIX ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.incgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.i0000664000175000017500000000605712306314612033506 0ustar mwhudsonmwhudson//===-- sanitizer_syscall_linux_x86_64.inc ----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Implementations of internal_syscall and internal_iserror for Linux/x86_64. // //===----------------------------------------------------------------------===// #define SYSCALL(name) __NR_ ## name static uptr internal_syscall(u64 nr) { u64 retval; asm volatile("syscall" : "=a"(retval) : "a"(nr) : "rcx", "r11", "memory", "cc"); return retval; } template static uptr internal_syscall(u64 nr, T1 arg1) { u64 retval; asm volatile("syscall" : "=a"(retval) : "a"(nr), "D"((u64)arg1) : "rcx", "r11", "memory", "cc"); return retval; } template static uptr internal_syscall(u64 nr, T1 arg1, T2 arg2) { u64 retval; asm volatile("syscall" : "=a"(retval) : "a"(nr), "D"((u64)arg1), "S"((u64)arg2) : "rcx", "r11", "memory", "cc"); return retval; } template static uptr internal_syscall(u64 nr, T1 arg1, T2 arg2, T3 arg3) { u64 retval; asm volatile("syscall" : "=a"(retval) : "a"(nr), "D"((u64)arg1), "S"((u64)arg2), "d"((u64)arg3) : "rcx", "r11", "memory", "cc"); return retval; } template static uptr internal_syscall(u64 nr, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { u64 retval; asm volatile("mov %5, %%r10;" "syscall" : "=a"(retval) : "a"(nr), "D"((u64)arg1), "S"((u64)arg2), "d"((u64)arg3), "r"((u64)arg4) : "rcx", "r11", "r10", "memory", "cc"); return retval; } template static uptr internal_syscall(u64 nr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { u64 retval; asm volatile("mov %5, %%r10;" "mov %6, %%r8;" "syscall" : "=a"(retval) : "a"(nr), "D"((u64)arg1), "S"((u64)arg2), "d"((u64)arg3), "r"((u64)arg4), "r"((u64)arg5) : "rcx", "r11", "r10", "r8", "memory", "cc"); return retval; } template static uptr internal_syscall(u64 nr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) { u64 retval; asm volatile("mov %5, %%r10;" "mov %6, %%r8;" "mov %7, %%r9;" "syscall" : "=a"(retval) : "a"(nr), "D"((u64)arg1), "S"((u64)arg2), "d"((u64)arg3), "r"((u64)arg4), "r"((u64)arg5), "r"((u64)arg6) : "rcx", "r11", "r10", "r8", "r9", "memory", "cc"); return retval; } bool internal_iserror(uptr retval, int *rverrno) { if (retval >= (uptr)-4095) { if (rverrno) *rverrno = -retval; return true; } return false; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_linux_x86_64.S0000664000175000017500000000153612730017632031726 0ustar mwhudsonmwhudson// This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // Avoid being marked as needing an executable stack: #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits #endif // Further contents are x86_64-only: #if defined(__linux__) && defined(__x86_64__) #include "../builtins/assembly.h" // If the "naked" function attribute were supported for x86 we could // do this via inline asm. .text .balign 4 DEFINE_COMPILERRT_FUNCTION(internal_sigreturn) mov $0xf, %eax // 0xf == SYS_rt_sigreturn mov %rcx, %r10 syscall ret // Won't normally reach here. END_COMPILERRT_FUNCTION(internal_sigreturn) #endif // defined(__linux__) && defined(__x86_64__) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_libignore.cc0000664000175000017500000000636512616142703031714 0ustar mwhudsonmwhudson//===-- sanitizer_libignore.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC #include "sanitizer_libignore.h" #include "sanitizer_flags.h" #include "sanitizer_posix.h" #include "sanitizer_procmaps.h" namespace __sanitizer { LibIgnore::LibIgnore(LinkerInitialized) { } void LibIgnore::AddIgnoredLibrary(const char *name_templ) { BlockingMutexLock lock(&mutex_); if (count_ >= kMaxLibs) { Report("%s: too many ignored libraries (max: %d)\n", SanitizerToolName, kMaxLibs); Die(); } Lib *lib = &libs_[count_++]; lib->templ = internal_strdup(name_templ); lib->name = nullptr; lib->real_name = nullptr; lib->loaded = false; } void LibIgnore::OnLibraryLoaded(const char *name) { BlockingMutexLock lock(&mutex_); // Try to match suppressions with symlink target. InternalScopedString buf(kMaxPathLength); if (name && internal_readlink(name, buf.data(), buf.size() - 1) > 0 && buf[0]) { for (uptr i = 0; i < count_; i++) { Lib *lib = &libs_[i]; if (!lib->loaded && (!lib->real_name) && TemplateMatch(lib->templ, name)) lib->real_name = internal_strdup(buf.data()); } } // Scan suppressions list and find newly loaded and unloaded libraries. MemoryMappingLayout proc_maps(/*cache_enabled*/false); InternalScopedString module(kMaxPathLength); for (uptr i = 0; i < count_; i++) { Lib *lib = &libs_[i]; bool loaded = false; proc_maps.Reset(); uptr b, e, off, prot; while (proc_maps.Next(&b, &e, &off, module.data(), module.size(), &prot)) { if ((prot & MemoryMappingLayout::kProtectionExecute) == 0) continue; if (TemplateMatch(lib->templ, module.data()) || (lib->real_name && internal_strcmp(lib->real_name, module.data()) == 0)) { if (loaded) { Report("%s: called_from_lib suppression '%s' is matched against" " 2 libraries: '%s' and '%s'\n", SanitizerToolName, lib->templ, lib->name, module.data()); Die(); } loaded = true; if (lib->loaded) continue; VReport(1, "Matched called_from_lib suppression '%s' against library" " '%s'\n", lib->templ, module.data()); lib->loaded = true; lib->name = internal_strdup(module.data()); const uptr idx = atomic_load(&loaded_count_, memory_order_relaxed); code_ranges_[idx].begin = b; code_ranges_[idx].end = e; atomic_store(&loaded_count_, idx + 1, memory_order_release); } } if (lib->loaded && !loaded) { Report("%s: library '%s' that was matched against called_from_lib" " suppression '%s' is unloaded\n", SanitizerToolName, lib->name, lib->templ); Die(); } } } void LibIgnore::OnLibraryUnloaded() { OnLibraryLoaded(nullptr); } } // namespace __sanitizer #endif // #if SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_atomic_clang_other.h0000664000175000017500000000575512334350567033435 0ustar mwhudsonmwhudson//===-- sanitizer_atomic_clang_other.h --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Not intended for direct inclusion. Include sanitizer_atomic.h. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ATOMIC_CLANG_OTHER_H #define SANITIZER_ATOMIC_CLANG_OTHER_H namespace __sanitizer { INLINE void proc_yield(int cnt) { __asm__ __volatile__("" ::: "memory"); } template INLINE typename T::Type atomic_load( const volatile T *a, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_consume | memory_order_acquire | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); typename T::Type v; if (sizeof(*a) < 8 || sizeof(void*) == 8) { // Assume that aligned loads are atomic. if (mo == memory_order_relaxed) { v = a->val_dont_use; } else if (mo == memory_order_consume) { // Assume that processor respects data dependencies // (and that compiler won't break them). __asm__ __volatile__("" ::: "memory"); v = a->val_dont_use; __asm__ __volatile__("" ::: "memory"); } else if (mo == memory_order_acquire) { __asm__ __volatile__("" ::: "memory"); v = a->val_dont_use; __sync_synchronize(); } else { // seq_cst // E.g. on POWER we need a hw fence even before the store. __sync_synchronize(); v = a->val_dont_use; __sync_synchronize(); } } else { // 64-bit load on 32-bit platform. // Gross, but simple and reliable. // Assume that it is not in read-only memory. v = __sync_fetch_and_add( const_cast(&a->val_dont_use), 0); } return v; } template INLINE void atomic_store(volatile T *a, typename T::Type v, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_release | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); if (sizeof(*a) < 8 || sizeof(void*) == 8) { // Assume that aligned loads are atomic. if (mo == memory_order_relaxed) { a->val_dont_use = v; } else if (mo == memory_order_release) { __sync_synchronize(); a->val_dont_use = v; __asm__ __volatile__("" ::: "memory"); } else { // seq_cst __sync_synchronize(); a->val_dont_use = v; __sync_synchronize(); } } else { // 64-bit store on 32-bit platform. // Gross, but simple and reliable. typename T::Type cmp = a->val_dont_use; typename T::Type cur; for (;;) { cur = __sync_val_compare_and_swap(&a->val_dont_use, cmp, v); if (cmp == v) break; cmp = cur; } } } } // namespace __sanitizer #endif // #ifndef SANITIZER_ATOMIC_CLANG_OTHER_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_bitvector.h0000664000175000017500000002261412614736157031612 0ustar mwhudsonmwhudson//===-- sanitizer_bitvector.h -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Specializer BitVector implementation. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_BITVECTOR_H #define SANITIZER_BITVECTOR_H #include "sanitizer_common.h" namespace __sanitizer { // Fixed size bit vector based on a single basic integer. template class BasicBitVector { public: enum SizeEnum { kSize = sizeof(basic_int_t) * 8 }; uptr size() const { return kSize; } // No CTOR. void clear() { bits_ = 0; } void setAll() { bits_ = ~(basic_int_t)0; } bool empty() const { return bits_ == 0; } // Returns true if the bit has changed from 0 to 1. bool setBit(uptr idx) { basic_int_t old = bits_; bits_ |= mask(idx); return bits_ != old; } // Returns true if the bit has changed from 1 to 0. bool clearBit(uptr idx) { basic_int_t old = bits_; bits_ &= ~mask(idx); return bits_ != old; } bool getBit(uptr idx) const { return (bits_ & mask(idx)) != 0; } uptr getAndClearFirstOne() { CHECK(!empty()); uptr idx = LeastSignificantSetBitIndex(bits_); clearBit(idx); return idx; } // Do "this |= v" and return whether new bits have been added. bool setUnion(const BasicBitVector &v) { basic_int_t old = bits_; bits_ |= v.bits_; return bits_ != old; } // Do "this &= v" and return whether any bits have been removed. bool setIntersection(const BasicBitVector &v) { basic_int_t old = bits_; bits_ &= v.bits_; return bits_ != old; } // Do "this &= ~v" and return whether any bits have been removed. bool setDifference(const BasicBitVector &v) { basic_int_t old = bits_; bits_ &= ~v.bits_; return bits_ != old; } void copyFrom(const BasicBitVector &v) { bits_ = v.bits_; } // Returns true if 'this' intersects with 'v'. bool intersectsWith(const BasicBitVector &v) const { return (bits_ & v.bits_) != 0; } // for (BasicBitVector<>::Iterator it(bv); it.hasNext();) { // uptr idx = it.next(); // use(idx); // } class Iterator { public: Iterator() { } explicit Iterator(const BasicBitVector &bv) : bv_(bv) {} bool hasNext() const { return !bv_.empty(); } uptr next() { return bv_.getAndClearFirstOne(); } void clear() { bv_.clear(); } private: BasicBitVector bv_; }; private: basic_int_t mask(uptr idx) const { CHECK_LT(idx, size()); return (basic_int_t)1UL << idx; } basic_int_t bits_; }; // Fixed size bit vector of (kLevel1Size*BV::kSize**2) bits. // The implementation is optimized for better performance on // sparse bit vectors, i.e. the those with few set bits. template > class TwoLevelBitVector { // This is essentially a 2-level bit vector. // Set bit in the first level BV indicates that there are set bits // in the corresponding BV of the second level. // This structure allows O(kLevel1Size) time for clear() and empty(), // as well fast handling of sparse BVs. public: enum SizeEnum { kSize = BV::kSize * BV::kSize * kLevel1Size }; // No CTOR. uptr size() const { return kSize; } void clear() { for (uptr i = 0; i < kLevel1Size; i++) l1_[i].clear(); } void setAll() { for (uptr i0 = 0; i0 < kLevel1Size; i0++) { l1_[i0].setAll(); for (uptr i1 = 0; i1 < BV::kSize; i1++) l2_[i0][i1].setAll(); } } bool empty() const { for (uptr i = 0; i < kLevel1Size; i++) if (!l1_[i].empty()) return false; return true; } // Returns true if the bit has changed from 0 to 1. bool setBit(uptr idx) { check(idx); uptr i0 = idx0(idx); uptr i1 = idx1(idx); uptr i2 = idx2(idx); if (!l1_[i0].getBit(i1)) { l1_[i0].setBit(i1); l2_[i0][i1].clear(); } bool res = l2_[i0][i1].setBit(i2); // Printf("%s: %zd => %zd %zd %zd; %d\n", __func__, // idx, i0, i1, i2, res); return res; } bool clearBit(uptr idx) { check(idx); uptr i0 = idx0(idx); uptr i1 = idx1(idx); uptr i2 = idx2(idx); bool res = false; if (l1_[i0].getBit(i1)) { res = l2_[i0][i1].clearBit(i2); if (l2_[i0][i1].empty()) l1_[i0].clearBit(i1); } return res; } bool getBit(uptr idx) const { check(idx); uptr i0 = idx0(idx); uptr i1 = idx1(idx); uptr i2 = idx2(idx); // Printf("%s: %zd => %zd %zd %zd\n", __func__, idx, i0, i1, i2); return l1_[i0].getBit(i1) && l2_[i0][i1].getBit(i2); } uptr getAndClearFirstOne() { for (uptr i0 = 0; i0 < kLevel1Size; i0++) { if (l1_[i0].empty()) continue; uptr i1 = l1_[i0].getAndClearFirstOne(); uptr i2 = l2_[i0][i1].getAndClearFirstOne(); if (!l2_[i0][i1].empty()) l1_[i0].setBit(i1); uptr res = i0 * BV::kSize * BV::kSize + i1 * BV::kSize + i2; // Printf("getAndClearFirstOne: %zd %zd %zd => %zd\n", i0, i1, i2, res); return res; } CHECK(0); return 0; } // Do "this |= v" and return whether new bits have been added. bool setUnion(const TwoLevelBitVector &v) { bool res = false; for (uptr i0 = 0; i0 < kLevel1Size; i0++) { BV t = v.l1_[i0]; while (!t.empty()) { uptr i1 = t.getAndClearFirstOne(); if (l1_[i0].setBit(i1)) l2_[i0][i1].clear(); if (l2_[i0][i1].setUnion(v.l2_[i0][i1])) res = true; } } return res; } // Do "this &= v" and return whether any bits have been removed. bool setIntersection(const TwoLevelBitVector &v) { bool res = false; for (uptr i0 = 0; i0 < kLevel1Size; i0++) { if (l1_[i0].setIntersection(v.l1_[i0])) res = true; if (!l1_[i0].empty()) { BV t = l1_[i0]; while (!t.empty()) { uptr i1 = t.getAndClearFirstOne(); if (l2_[i0][i1].setIntersection(v.l2_[i0][i1])) res = true; if (l2_[i0][i1].empty()) l1_[i0].clearBit(i1); } } } return res; } // Do "this &= ~v" and return whether any bits have been removed. bool setDifference(const TwoLevelBitVector &v) { bool res = false; for (uptr i0 = 0; i0 < kLevel1Size; i0++) { BV t = l1_[i0]; t.setIntersection(v.l1_[i0]); while (!t.empty()) { uptr i1 = t.getAndClearFirstOne(); if (l2_[i0][i1].setDifference(v.l2_[i0][i1])) res = true; if (l2_[i0][i1].empty()) l1_[i0].clearBit(i1); } } return res; } void copyFrom(const TwoLevelBitVector &v) { clear(); setUnion(v); } // Returns true if 'this' intersects with 'v'. bool intersectsWith(const TwoLevelBitVector &v) const { for (uptr i0 = 0; i0 < kLevel1Size; i0++) { BV t = l1_[i0]; t.setIntersection(v.l1_[i0]); while (!t.empty()) { uptr i1 = t.getAndClearFirstOne(); if (!v.l1_[i0].getBit(i1)) continue; if (l2_[i0][i1].intersectsWith(v.l2_[i0][i1])) return true; } } return false; } // for (TwoLevelBitVector<>::Iterator it(bv); it.hasNext();) { // uptr idx = it.next(); // use(idx); // } class Iterator { public: Iterator() { } explicit Iterator(const TwoLevelBitVector &bv) : bv_(bv), i0_(0), i1_(0) { it1_.clear(); it2_.clear(); } bool hasNext() const { if (it1_.hasNext()) return true; for (uptr i = i0_; i < kLevel1Size; i++) if (!bv_.l1_[i].empty()) return true; return false; } uptr next() { // Printf("++++: %zd %zd; %d %d; size %zd\n", i0_, i1_, it1_.hasNext(), // it2_.hasNext(), kSize); if (!it1_.hasNext() && !it2_.hasNext()) { for (; i0_ < kLevel1Size; i0_++) { if (bv_.l1_[i0_].empty()) continue; it1_ = typename BV::Iterator(bv_.l1_[i0_]); // Printf("+i0: %zd %zd; %d %d; size %zd\n", i0_, i1_, it1_.hasNext(), // it2_.hasNext(), kSize); break; } } if (!it2_.hasNext()) { CHECK(it1_.hasNext()); i1_ = it1_.next(); it2_ = typename BV::Iterator(bv_.l2_[i0_][i1_]); // Printf("++i1: %zd %zd; %d %d; size %zd\n", i0_, i1_, it1_.hasNext(), // it2_.hasNext(), kSize); } CHECK(it2_.hasNext()); uptr i2 = it2_.next(); uptr res = i0_ * BV::kSize * BV::kSize + i1_ * BV::kSize + i2; // Printf("+ret: %zd %zd; %d %d; size %zd; res: %zd\n", i0_, i1_, // it1_.hasNext(), it2_.hasNext(), kSize, res); if (!it1_.hasNext() && !it2_.hasNext()) i0_++; return res; } private: const TwoLevelBitVector &bv_; uptr i0_, i1_; typename BV::Iterator it1_, it2_; }; private: void check(uptr idx) const { CHECK_LE(idx, size()); } uptr idx0(uptr idx) const { uptr res = idx / (BV::kSize * BV::kSize); CHECK_LE(res, kLevel1Size); return res; } uptr idx1(uptr idx) const { uptr res = (idx / BV::kSize) % BV::kSize; CHECK_LE(res, BV::kSize); return res; } uptr idx2(uptr idx) const { uptr res = idx % BV::kSize; CHECK_LE(res, BV::kSize); return res; } BV l1_[kLevel1Size]; BV l2_[kLevel1Size][BV::kSize]; }; } // namespace __sanitizer #endif // SANITIZER_BITVECTOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_malloc_mac.inc0000664000175000017500000002357112630351113032204 0ustar mwhudsonmwhudson//===-- sanitizer_malloc_mac.inc --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains Mac-specific malloc interceptors and a custom zone // implementation, which together replace the system allocator. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if !SANITIZER_MAC #error "This file should only be compiled on Darwin." #endif #include #include #include #include #include #include "interception/interception.h" #include "sanitizer_common/sanitizer_mac.h" // Similar code is used in Google Perftools, // https://github.com/gperftools/gperftools. static malloc_zone_t sanitizer_zone; INTERCEPTOR(malloc_zone_t *, malloc_create_zone, vm_size_t start_size, unsigned zone_flags) { COMMON_MALLOC_ENTER(); uptr page_size = GetPageSizeCached(); uptr allocated_size = RoundUpTo(sizeof(sanitizer_zone), page_size); COMMON_MALLOC_MEMALIGN(page_size, allocated_size); malloc_zone_t *new_zone = (malloc_zone_t *)p; internal_memcpy(new_zone, &sanitizer_zone, sizeof(sanitizer_zone)); new_zone->zone_name = NULL; // The name will be changed anyway. if (GetMacosVersion() >= MACOS_VERSION_LION) { // Prevent the client app from overwriting the zone contents. // Library functions that need to modify the zone will set PROT_WRITE on it. // This matches the behavior of malloc_create_zone() on OSX 10.7 and higher. mprotect(new_zone, allocated_size, PROT_READ); } return new_zone; } INTERCEPTOR(malloc_zone_t *, malloc_default_zone, void) { COMMON_MALLOC_ENTER(); return &sanitizer_zone; } INTERCEPTOR(malloc_zone_t *, malloc_default_purgeable_zone, void) { // FIXME: ASan should support purgeable allocations. // https://github.com/google/sanitizers/issues/139 COMMON_MALLOC_ENTER(); return &sanitizer_zone; } INTERCEPTOR(void, malloc_make_purgeable, void *ptr) { // FIXME: ASan should support purgeable allocations. Ignoring them is fine // for now. COMMON_MALLOC_ENTER(); } INTERCEPTOR(int, malloc_make_nonpurgeable, void *ptr) { // FIXME: ASan should support purgeable allocations. Ignoring them is fine // for now. COMMON_MALLOC_ENTER(); // Must return 0 if the contents were not purged since the last call to // malloc_make_purgeable(). return 0; } INTERCEPTOR(void, malloc_set_zone_name, malloc_zone_t *zone, const char *name) { COMMON_MALLOC_ENTER(); // Allocate |sizeof(COMMON_MALLOC_ZONE_NAME "-") + internal_strlen(name)| // bytes. size_t buflen = sizeof(COMMON_MALLOC_ZONE_NAME "-") + (name ? internal_strlen(name) : 0); InternalScopedString new_name(buflen); if (name && zone->introspect == sanitizer_zone.introspect) { new_name.append(COMMON_MALLOC_ZONE_NAME "-%s", name); name = new_name.data(); } // Call the system malloc's implementation for both external and our zones, // since that appropriately changes VM region protections on the zone. REAL(malloc_set_zone_name)(zone, name); } INTERCEPTOR(void *, malloc, size_t size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_MALLOC(size); return p; } INTERCEPTOR(void, free, void *ptr) { COMMON_MALLOC_ENTER(); if (!ptr) return; COMMON_MALLOC_FREE(ptr); } INTERCEPTOR(void *, realloc, void *ptr, size_t size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_REALLOC(ptr, size); return p; } INTERCEPTOR(void *, calloc, size_t nmemb, size_t size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_CALLOC(nmemb, size); return p; } INTERCEPTOR(void *, valloc, size_t size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_VALLOC(size); return p; } INTERCEPTOR(size_t, malloc_good_size, size_t size) { COMMON_MALLOC_ENTER(); return sanitizer_zone.introspect->good_size(&sanitizer_zone, size); } INTERCEPTOR(int, posix_memalign, void **memptr, size_t alignment, size_t size) { COMMON_MALLOC_ENTER(); CHECK(memptr); COMMON_MALLOC_MEMALIGN(alignment, size); if (p) { *memptr = p; return 0; } return -1; } namespace { // TODO(glider): the __sanitizer_mz_* functions should be united with the Linux // wrappers, as they are basically copied from there. extern "C" SANITIZER_INTERFACE_ATTRIBUTE size_t __sanitizer_mz_size(malloc_zone_t* zone, const void* ptr) { COMMON_MALLOC_SIZE(ptr); return size; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_mz_malloc(malloc_zone_t *zone, uptr size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_MALLOC(size); return p; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_mz_calloc(malloc_zone_t *zone, size_t nmemb, size_t size) { if (UNLIKELY(!COMMON_MALLOC_SANITIZER_INITIALIZED)) { // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. const size_t kCallocPoolSize = 1024; static uptr calloc_memory_for_dlsym[kCallocPoolSize]; static size_t allocated; size_t size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize; void *mem = (void*)&calloc_memory_for_dlsym[allocated]; allocated += size_in_words; CHECK(allocated < kCallocPoolSize); return mem; } COMMON_MALLOC_CALLOC(nmemb, size); return p; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_mz_valloc(malloc_zone_t *zone, size_t size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_VALLOC(size); return p; } // TODO(glider): the allocation callbacks need to be refactored. extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_mz_free(malloc_zone_t *zone, void *ptr) { if (!ptr) return; COMMON_MALLOC_FREE(ptr); } #define GET_ZONE_FOR_PTR(ptr) \ malloc_zone_t *zone_ptr = malloc_zone_from_ptr(ptr); \ const char *zone_name = (zone_ptr == 0) ? 0 : zone_ptr->zone_name extern "C" SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_mz_realloc(malloc_zone_t *zone, void *ptr, size_t new_size) { if (!ptr) { COMMON_MALLOC_MALLOC(new_size); return p; } else { COMMON_MALLOC_SIZE(ptr); if (size) { COMMON_MALLOC_REALLOC(ptr, new_size); return p; } else { // We can't recover from reallocating an unknown address, because // this would require reading at most |new_size| bytes from // potentially unaccessible memory. GET_ZONE_FOR_PTR(ptr); COMMON_MALLOC_REPORT_UNKNOWN_REALLOC(ptr, zone_ptr, zone_name); return nullptr; } } } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_mz_destroy(malloc_zone_t* zone) { // A no-op -- we will not be destroyed! Report("__sanitizer_mz_destroy() called -- ignoring\n"); } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void *__sanitizer_mz_memalign(malloc_zone_t *zone, size_t align, size_t size) { COMMON_MALLOC_ENTER(); COMMON_MALLOC_MEMALIGN(align, size); return p; } // This function is currently unused, and we build with -Werror. #if 0 void __sanitizer_mz_free_definite_size( malloc_zone_t* zone, void *ptr, size_t size) { // TODO(glider): check that |size| is valid. UNIMPLEMENTED(); } #endif kern_return_t mi_enumerator(task_t task, void *, unsigned type_mask, vm_address_t zone_address, memory_reader_t reader, vm_range_recorder_t recorder) { // Should enumerate all the pointers we have. Seems like a lot of work. return KERN_FAILURE; } size_t mi_good_size(malloc_zone_t *zone, size_t size) { // I think it's always safe to return size, but we maybe could do better. return size; } boolean_t mi_check(malloc_zone_t *zone) { UNIMPLEMENTED(); } void mi_print(malloc_zone_t *zone, boolean_t verbose) { UNIMPLEMENTED(); } void mi_log(malloc_zone_t *zone, void *address) { // I don't think we support anything like this } void mi_force_lock(malloc_zone_t *zone) { COMMON_MALLOC_FORCE_LOCK(); } void mi_force_unlock(malloc_zone_t *zone) { COMMON_MALLOC_FORCE_UNLOCK(); } void mi_statistics(malloc_zone_t *zone, malloc_statistics_t *stats) { COMMON_MALLOC_FILL_STATS(zone, stats); } boolean_t mi_zone_locked(malloc_zone_t *zone) { // UNIMPLEMENTED(); return false; } } // unnamed namespace namespace COMMON_MALLOC_NAMESPACE { void ReplaceSystemMalloc() { static malloc_introspection_t sanitizer_zone_introspection; // Ok to use internal_memset, these places are not performance-critical. internal_memset(&sanitizer_zone_introspection, 0, sizeof(sanitizer_zone_introspection)); sanitizer_zone_introspection.enumerator = &mi_enumerator; sanitizer_zone_introspection.good_size = &mi_good_size; sanitizer_zone_introspection.check = &mi_check; sanitizer_zone_introspection.print = &mi_print; sanitizer_zone_introspection.log = &mi_log; sanitizer_zone_introspection.force_lock = &mi_force_lock; sanitizer_zone_introspection.force_unlock = &mi_force_unlock; sanitizer_zone_introspection.statistics = &mi_statistics; sanitizer_zone_introspection.zone_locked = &mi_zone_locked; internal_memset(&sanitizer_zone, 0, sizeof(malloc_zone_t)); // Use version 6 for OSX >= 10.6. sanitizer_zone.version = 6; sanitizer_zone.zone_name = COMMON_MALLOC_ZONE_NAME; sanitizer_zone.size = &__sanitizer_mz_size; sanitizer_zone.malloc = &__sanitizer_mz_malloc; sanitizer_zone.calloc = &__sanitizer_mz_calloc; sanitizer_zone.valloc = &__sanitizer_mz_valloc; sanitizer_zone.free = &__sanitizer_mz_free; sanitizer_zone.realloc = &__sanitizer_mz_realloc; sanitizer_zone.destroy = &__sanitizer_mz_destroy; sanitizer_zone.batch_malloc = 0; sanitizer_zone.batch_free = 0; sanitizer_zone.free_definite_size = 0; sanitizer_zone.memalign = &__sanitizer_mz_memalign; sanitizer_zone.introspect = &sanitizer_zone_introspection; // Register the zone. malloc_zone_register(&sanitizer_zone); } } // namespace COMMON_MALLOC_NAMESPACE golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_linux_s390.cc0000664000175000017500000001337212710673307031657 0ustar mwhudsonmwhudson//===-- sanitizer_linux_s390.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and implements s390-linux-specific functions from // sanitizer_libc.h. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_LINUX && SANITIZER_S390 #include "sanitizer_libc.h" #include "sanitizer_linux.h" #include #include #include #include namespace __sanitizer { // --------------- sanitizer_libc.h uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd, OFF_T offset) { struct s390_mmap_params { unsigned long addr; unsigned long length; unsigned long prot; unsigned long flags; unsigned long fd; unsigned long offset; } params = { (unsigned long)addr, (unsigned long)length, (unsigned long)prot, (unsigned long)flags, (unsigned long)fd, # ifdef __s390x__ (unsigned long)offset, # else (unsigned long)(offset / 4096), # endif }; # ifdef __s390x__ return syscall(__NR_mmap, ¶ms); # else return syscall(__NR_mmap2, ¶ms); # endif } uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { if (!fn || !child_stack) return -EINVAL; CHECK_EQ(0, (uptr)child_stack % 16); // Minimum frame size. #ifdef __s390x__ child_stack = (char *)child_stack - 160; #else child_stack = (char *)child_stack - 96; #endif // Terminate unwind chain. ((unsigned long *)child_stack)[0] = 0; // And pass parameters. ((unsigned long *)child_stack)[1] = (uptr)fn; ((unsigned long *)child_stack)[2] = (uptr)arg; register long res __asm__("r2"); register void *__cstack __asm__("r2") = child_stack; register int __flags __asm__("r3") = flags; register int * __ptidptr __asm__("r4") = parent_tidptr; register int * __ctidptr __asm__("r5") = child_tidptr; register void * __newtls __asm__("r6") = newtls; __asm__ __volatile__( /* Clone. */ "svc %1\n" /* if (%r2 != 0) * return; */ #ifdef __s390x__ "cghi %%r2, 0\n" #else "chi %%r2, 0\n" #endif "jne 1f\n" /* Call "fn(arg)". */ #ifdef __s390x__ "lmg %%r1, %%r2, 8(%%r15)\n" #else "lm %%r1, %%r2, 4(%%r15)\n" #endif "basr %%r14, %%r1\n" /* Call _exit(%r2). */ "svc %2\n" /* Return to parent. */ "1:\n" : "=r" (res) : "i"(__NR_clone), "i"(__NR_exit), "r"(__cstack), "r"(__flags), "r"(__ptidptr), "r"(__ctidptr), "r"(__newtls) : "memory", "cc"); return res; } #if SANITIZER_S390_64 static bool FixedCVE_2016_2143() { // Try to determine if the running kernel has a fix for CVE-2016-2143, // return false if in doubt (better safe than sorry). Distros may want to // adjust this for their own kernels. struct utsname buf; unsigned int major, minor, patch = 0; // This should never fail, but just in case... if (uname(&buf)) return false; char *ptr = buf.release; major = internal_simple_strtoll(ptr, &ptr, 10); // At least first 2 should be matched. if (ptr[0] != '.') return false; minor = internal_simple_strtoll(ptr+1, &ptr, 10); // Third is optional. if (ptr[0] == '.') patch = internal_simple_strtoll(ptr+1, &ptr, 10); if (major < 3) { // <3.0 is bad. return false; } else if (major == 3) { // 3.2.79+ is OK. if (minor == 2 && patch >= 79) return true; // 3.12.58+ is OK. if (minor == 12 && patch >= 58) return true; // Otherwise, bad. return false; } else if (major == 4) { // 4.1.21+ is OK. if (minor == 1 && patch >= 21) return true; // 4.4.6+ is OK. if (minor == 4 && patch >= 6) return true; // Otherwise, OK if 4.5+. return minor >= 5; } else { // Linux 5 and up are fine. return true; } } void AvoidCVE_2016_2143() { // Older kernels are affected by CVE-2016-2143 - they will crash hard // if someone uses 4-level page tables (ie. virtual addresses >= 4TB) // and fork() in the same process. Unfortunately, sanitizers tend to // require such addresses. Since this is very likely to crash the whole // machine (sanitizers themselves use fork() for llvm-symbolizer, for one), // abort the process at initialization instead. if (FixedCVE_2016_2143()) return; if (GetEnv("SANITIZER_IGNORE_CVE_2016_2143")) return; Report( "ERROR: Your kernel seems to be vulnerable to CVE-2016-2143. Using ASan,\n" "MSan, TSan, DFSan or LSan with such kernel can and will crash your\n" "machine, or worse.\n" "\n" "If you are certain your kernel is not vulnerable (you have compiled it\n" "yourself, or are using an unrecognized distribution kernel), you can\n" "override this safety check by exporting SANITIZER_IGNORE_CVE_2016_2143\n" "with any value.\n"); Die(); } #endif } // namespace __sanitizer #endif // SANITIZER_LINUX && SANITIZER_S390 golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_deadlock_detector2.cc0000664000175000017500000002551412356766413033473 0ustar mwhudsonmwhudson//===-- sanitizer_deadlock_detector2.cc -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Deadlock detector implementation based on adjacency lists. // //===----------------------------------------------------------------------===// #include "sanitizer_deadlock_detector_interface.h" #include "sanitizer_common.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_placement_new.h" #include "sanitizer_mutex.h" #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 2 namespace __sanitizer { const int kMaxNesting = 64; const u32 kNoId = -1; const u32 kEndId = -2; const int kMaxLink = 8; const int kL1Size = 1024; const int kL2Size = 1024; const int kMaxMutex = kL1Size * kL2Size; struct Id { u32 id; u32 seq; explicit Id(u32 id = 0, u32 seq = 0) : id(id) , seq(seq) { } }; struct Link { u32 id; u32 seq; u32 tid; u32 stk0; u32 stk1; explicit Link(u32 id = 0, u32 seq = 0, u32 tid = 0, u32 s0 = 0, u32 s1 = 0) : id(id) , seq(seq) , tid(tid) , stk0(s0) , stk1(s1) { } }; struct DDPhysicalThread { DDReport rep; bool report_pending; bool visited[kMaxMutex]; Link pending[kMaxMutex]; Link path[kMaxMutex]; }; struct ThreadMutex { u32 id; u32 stk; }; struct DDLogicalThread { u64 ctx; ThreadMutex locked[kMaxNesting]; int nlocked; }; struct Mutex { StaticSpinMutex mtx; u32 seq; int nlink; Link link[kMaxLink]; }; struct DD : public DDetector { explicit DD(const DDFlags *flags); DDPhysicalThread* CreatePhysicalThread(); void DestroyPhysicalThread(DDPhysicalThread *pt); DDLogicalThread* CreateLogicalThread(u64 ctx); void DestroyLogicalThread(DDLogicalThread *lt); void MutexInit(DDCallback *cb, DDMutex *m); void MutexBeforeLock(DDCallback *cb, DDMutex *m, bool wlock); void MutexAfterLock(DDCallback *cb, DDMutex *m, bool wlock, bool trylock); void MutexBeforeUnlock(DDCallback *cb, DDMutex *m, bool wlock); void MutexDestroy(DDCallback *cb, DDMutex *m); DDReport *GetReport(DDCallback *cb); void CycleCheck(DDPhysicalThread *pt, DDLogicalThread *lt, DDMutex *mtx); void Report(DDPhysicalThread *pt, DDLogicalThread *lt, int npath); u32 allocateId(DDCallback *cb); Mutex *getMutex(u32 id); u32 getMutexId(Mutex *m); DDFlags flags; Mutex* mutex[kL1Size]; SpinMutex mtx; InternalMmapVector free_id; int id_gen; }; DDetector *DDetector::Create(const DDFlags *flags) { (void)flags; void *mem = MmapOrDie(sizeof(DD), "deadlock detector"); return new(mem) DD(flags); } DD::DD(const DDFlags *flags) : flags(*flags) , free_id(1024) { id_gen = 0; } DDPhysicalThread* DD::CreatePhysicalThread() { DDPhysicalThread *pt = (DDPhysicalThread*)MmapOrDie(sizeof(DDPhysicalThread), "deadlock detector (physical thread)"); return pt; } void DD::DestroyPhysicalThread(DDPhysicalThread *pt) { pt->~DDPhysicalThread(); UnmapOrDie(pt, sizeof(DDPhysicalThread)); } DDLogicalThread* DD::CreateLogicalThread(u64 ctx) { DDLogicalThread *lt = (DDLogicalThread*)InternalAlloc( sizeof(DDLogicalThread)); lt->ctx = ctx; lt->nlocked = 0; return lt; } void DD::DestroyLogicalThread(DDLogicalThread *lt) { lt->~DDLogicalThread(); InternalFree(lt); } void DD::MutexInit(DDCallback *cb, DDMutex *m) { VPrintf(2, "#%llu: DD::MutexInit(%p)\n", cb->lt->ctx, m); m->id = kNoId; m->recursion = 0; atomic_store(&m->owner, 0, memory_order_relaxed); } Mutex *DD::getMutex(u32 id) { return &mutex[id / kL2Size][id % kL2Size]; } u32 DD::getMutexId(Mutex *m) { for (int i = 0; i < kL1Size; i++) { Mutex *tab = mutex[i]; if (tab == 0) break; if (m >= tab && m < tab + kL2Size) return i * kL2Size + (m - tab); } return -1; } u32 DD::allocateId(DDCallback *cb) { u32 id = -1; SpinMutexLock l(&mtx); if (free_id.size() > 0) { id = free_id.back(); free_id.pop_back(); } else { CHECK_LT(id_gen, kMaxMutex); if ((id_gen % kL2Size) == 0) { mutex[id_gen / kL2Size] = (Mutex*)MmapOrDie(kL2Size * sizeof(Mutex), "deadlock detector (mutex table)"); } id = id_gen++; } CHECK_LE(id, kMaxMutex); VPrintf(3, "#%llu: DD::allocateId assign id %d\n", cb->lt->ctx, id); return id; } void DD::MutexBeforeLock(DDCallback *cb, DDMutex *m, bool wlock) { VPrintf(2, "#%llu: DD::MutexBeforeLock(%p, wlock=%d) nlocked=%d\n", cb->lt->ctx, m, wlock, cb->lt->nlocked); DDPhysicalThread *pt = cb->pt; DDLogicalThread *lt = cb->lt; uptr owner = atomic_load(&m->owner, memory_order_relaxed); if (owner == (uptr)cb->lt) { VPrintf(3, "#%llu: DD::MutexBeforeLock recursive\n", cb->lt->ctx); return; } CHECK_LE(lt->nlocked, kMaxNesting); // FIXME(dvyukov): don't allocate id if lt->nlocked == 0? if (m->id == kNoId) m->id = allocateId(cb); ThreadMutex *tm = <->locked[lt->nlocked++]; tm->id = m->id; if (flags.second_deadlock_stack) tm->stk = cb->Unwind(); if (lt->nlocked == 1) { VPrintf(3, "#%llu: DD::MutexBeforeLock first mutex\n", cb->lt->ctx); return; } bool added = false; Mutex *mtx = getMutex(m->id); for (int i = 0; i < lt->nlocked - 1; i++) { u32 id1 = lt->locked[i].id; u32 stk1 = lt->locked[i].stk; Mutex *mtx1 = getMutex(id1); SpinMutexLock l(&mtx1->mtx); if (mtx1->nlink == kMaxLink) { // FIXME(dvyukov): check stale links continue; } int li = 0; for (; li < mtx1->nlink; li++) { Link *link = &mtx1->link[li]; if (link->id == m->id) { if (link->seq != mtx->seq) { link->seq = mtx->seq; link->tid = lt->ctx; link->stk0 = stk1; link->stk1 = cb->Unwind(); added = true; VPrintf(3, "#%llu: DD::MutexBeforeLock added %d->%d link\n", cb->lt->ctx, getMutexId(mtx1), m->id); } break; } } if (li == mtx1->nlink) { // FIXME(dvyukov): check stale links Link *link = &mtx1->link[mtx1->nlink++]; link->id = m->id; link->seq = mtx->seq; link->tid = lt->ctx; link->stk0 = stk1; link->stk1 = cb->Unwind(); added = true; VPrintf(3, "#%llu: DD::MutexBeforeLock added %d->%d link\n", cb->lt->ctx, getMutexId(mtx1), m->id); } } if (!added || mtx->nlink == 0) { VPrintf(3, "#%llu: DD::MutexBeforeLock don't check\n", cb->lt->ctx); return; } CycleCheck(pt, lt, m); } void DD::MutexAfterLock(DDCallback *cb, DDMutex *m, bool wlock, bool trylock) { VPrintf(2, "#%llu: DD::MutexAfterLock(%p, wlock=%d, try=%d) nlocked=%d\n", cb->lt->ctx, m, wlock, trylock, cb->lt->nlocked); DDLogicalThread *lt = cb->lt; uptr owner = atomic_load(&m->owner, memory_order_relaxed); if (owner == (uptr)cb->lt) { VPrintf(3, "#%llu: DD::MutexAfterLock recursive\n", cb->lt->ctx); CHECK(wlock); m->recursion++; return; } CHECK_EQ(owner, 0); if (wlock) { VPrintf(3, "#%llu: DD::MutexAfterLock set owner\n", cb->lt->ctx); CHECK_EQ(m->recursion, 0); m->recursion = 1; atomic_store(&m->owner, (uptr)cb->lt, memory_order_relaxed); } if (!trylock) return; CHECK_LE(lt->nlocked, kMaxNesting); if (m->id == kNoId) m->id = allocateId(cb); ThreadMutex *tm = <->locked[lt->nlocked++]; tm->id = m->id; if (flags.second_deadlock_stack) tm->stk = cb->Unwind(); } void DD::MutexBeforeUnlock(DDCallback *cb, DDMutex *m, bool wlock) { VPrintf(2, "#%llu: DD::MutexBeforeUnlock(%p, wlock=%d) nlocked=%d\n", cb->lt->ctx, m, wlock, cb->lt->nlocked); DDLogicalThread *lt = cb->lt; uptr owner = atomic_load(&m->owner, memory_order_relaxed); if (owner == (uptr)cb->lt) { VPrintf(3, "#%llu: DD::MutexBeforeUnlock recursive\n", cb->lt->ctx); if (--m->recursion > 0) return; VPrintf(3, "#%llu: DD::MutexBeforeUnlock reset owner\n", cb->lt->ctx); atomic_store(&m->owner, 0, memory_order_relaxed); } CHECK_NE(m->id, kNoId); int last = lt->nlocked - 1; for (int i = last; i >= 0; i--) { if (cb->lt->locked[i].id == m->id) { lt->locked[i] = lt->locked[last]; lt->nlocked--; break; } } } void DD::MutexDestroy(DDCallback *cb, DDMutex *m) { VPrintf(2, "#%llu: DD::MutexDestroy(%p)\n", cb->lt->ctx, m); DDLogicalThread *lt = cb->lt; if (m->id == kNoId) return; // Remove the mutex from lt->locked if there. int last = lt->nlocked - 1; for (int i = last; i >= 0; i--) { if (lt->locked[i].id == m->id) { lt->locked[i] = lt->locked[last]; lt->nlocked--; break; } } // Clear and invalidate the mutex descriptor. { Mutex *mtx = getMutex(m->id); SpinMutexLock l(&mtx->mtx); mtx->seq++; mtx->nlink = 0; } // Return id to cache. { SpinMutexLock l(&mtx); free_id.push_back(m->id); } } void DD::CycleCheck(DDPhysicalThread *pt, DDLogicalThread *lt, DDMutex *m) { internal_memset(pt->visited, 0, sizeof(pt->visited)); int npath = 0; int npending = 0; { Mutex *mtx = getMutex(m->id); SpinMutexLock l(&mtx->mtx); for (int li = 0; li < mtx->nlink; li++) pt->pending[npending++] = mtx->link[li]; } while (npending > 0) { Link link = pt->pending[--npending]; if (link.id == kEndId) { npath--; continue; } if (pt->visited[link.id]) continue; Mutex *mtx1 = getMutex(link.id); SpinMutexLock l(&mtx1->mtx); if (mtx1->seq != link.seq) continue; pt->visited[link.id] = true; if (mtx1->nlink == 0) continue; pt->path[npath++] = link; pt->pending[npending++] = Link(kEndId); if (link.id == m->id) return Report(pt, lt, npath); // Bingo! for (int li = 0; li < mtx1->nlink; li++) { Link *link1 = &mtx1->link[li]; // Mutex *mtx2 = getMutex(link->id); // FIXME(dvyukov): fast seq check // FIXME(dvyukov): fast nlink != 0 check // FIXME(dvyukov): fast pending check? // FIXME(dvyukov): npending can be larger than kMaxMutex pt->pending[npending++] = *link1; } } } void DD::Report(DDPhysicalThread *pt, DDLogicalThread *lt, int npath) { DDReport *rep = &pt->rep; rep->n = npath; for (int i = 0; i < npath; i++) { Link *link = &pt->path[i]; Link *link0 = &pt->path[i ? i - 1 : npath - 1]; rep->loop[i].thr_ctx = link->tid; rep->loop[i].mtx_ctx0 = link0->id; rep->loop[i].mtx_ctx1 = link->id; rep->loop[i].stk[0] = flags.second_deadlock_stack ? link->stk0 : 0; rep->loop[i].stk[1] = link->stk1; } pt->report_pending = true; } DDReport *DD::GetReport(DDCallback *cb) { if (!cb->pt->report_pending) return 0; cb->pt->report_pending = false; return &cb->pt->rep; } } // namespace __sanitizer #endif // #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 2 golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stackdepotbase.h0000664000175000017500000001306412602553450032572 0ustar mwhudsonmwhudson//===-- sanitizer_stackdepotbase.h ------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Implementation of a mapping from arbitrary values to unique 32-bit // identifiers. //===----------------------------------------------------------------------===// #ifndef SANITIZER_STACKDEPOTBASE_H #define SANITIZER_STACKDEPOTBASE_H #include "sanitizer_internal_defs.h" #include "sanitizer_mutex.h" #include "sanitizer_atomic.h" #include "sanitizer_persistent_allocator.h" namespace __sanitizer { template class StackDepotBase { public: typedef typename Node::args_type args_type; typedef typename Node::handle_type handle_type; // Maps stack trace to an unique id. handle_type Put(args_type args, bool *inserted = nullptr); // Retrieves a stored stack trace by the id. args_type Get(u32 id); StackDepotStats *GetStats() { return &stats; } void LockAll(); void UnlockAll(); private: static Node *find(Node *s, args_type args, u32 hash); static Node *lock(atomic_uintptr_t *p); static void unlock(atomic_uintptr_t *p, Node *s); static const int kTabSize = 1 << kTabSizeLog; // Hash table size. static const int kPartBits = 8; static const int kPartShift = sizeof(u32) * 8 - kPartBits - kReservedBits; static const int kPartCount = 1 << kPartBits; // Number of subparts in the table. static const int kPartSize = kTabSize / kPartCount; static const int kMaxId = 1 << kPartShift; atomic_uintptr_t tab[kTabSize]; // Hash table of Node's. atomic_uint32_t seq[kPartCount]; // Unique id generators. StackDepotStats stats; friend class StackDepotReverseMap; }; template Node *StackDepotBase::find(Node *s, args_type args, u32 hash) { // Searches linked list s for the stack, returns its id. for (; s; s = s->link) { if (s->eq(hash, args)) { return s; } } return nullptr; } template Node *StackDepotBase::lock( atomic_uintptr_t *p) { // Uses the pointer lsb as mutex. for (int i = 0;; i++) { uptr cmp = atomic_load(p, memory_order_relaxed); if ((cmp & 1) == 0 && atomic_compare_exchange_weak(p, &cmp, cmp | 1, memory_order_acquire)) return (Node *)cmp; if (i < 10) proc_yield(10); else internal_sched_yield(); } } template void StackDepotBase::unlock( atomic_uintptr_t *p, Node *s) { DCHECK_EQ((uptr)s & 1, 0); atomic_store(p, (uptr)s, memory_order_release); } template typename StackDepotBase::handle_type StackDepotBase::Put(args_type args, bool *inserted) { if (inserted) *inserted = false; if (!Node::is_valid(args)) return handle_type(); uptr h = Node::hash(args); atomic_uintptr_t *p = &tab[h % kTabSize]; uptr v = atomic_load(p, memory_order_consume); Node *s = (Node *)(v & ~1); // First, try to find the existing stack. Node *node = find(s, args, h); if (node) return node->get_handle(); // If failed, lock, retry and insert new. Node *s2 = lock(p); if (s2 != s) { node = find(s2, args, h); if (node) { unlock(p, s2); return node->get_handle(); } } uptr part = (h % kTabSize) / kPartSize; u32 id = atomic_fetch_add(&seq[part], 1, memory_order_relaxed) + 1; stats.n_uniq_ids++; CHECK_LT(id, kMaxId); id |= part << kPartShift; CHECK_NE(id, 0); CHECK_EQ(id & (((u32)-1) >> kReservedBits), id); uptr memsz = Node::storage_size(args); s = (Node *)PersistentAlloc(memsz); stats.allocated += memsz; s->id = id; s->store(args, h); s->link = s2; unlock(p, s); if (inserted) *inserted = true; return s->get_handle(); } template typename StackDepotBase::args_type StackDepotBase::Get(u32 id) { if (id == 0) { return args_type(); } CHECK_EQ(id & (((u32)-1) >> kReservedBits), id); // High kPartBits contain part id, so we need to scan at most kPartSize lists. uptr part = id >> kPartShift; for (int i = 0; i != kPartSize; i++) { uptr idx = part * kPartSize + i; CHECK_LT(idx, kTabSize); atomic_uintptr_t *p = &tab[idx]; uptr v = atomic_load(p, memory_order_consume); Node *s = (Node *)(v & ~1); for (; s; s = s->link) { if (s->id == id) { return s->load(); } } } return args_type(); } template void StackDepotBase::LockAll() { for (int i = 0; i < kTabSize; ++i) { lock(&tab[i]); } } template void StackDepotBase::UnlockAll() { for (int i = 0; i < kTabSize; ++i) { atomic_uintptr_t *p = &tab[i]; uptr s = atomic_load(p, memory_order_relaxed); unlock(p, (Node *)(s & ~1UL)); } } } // namespace __sanitizer #endif // SANITIZER_STACKDEPOTBASE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_termination.cc0000664000175000017500000000523312722141275032265 0ustar mwhudsonmwhudson//===-- sanitizer_termination.cc --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// This file contains the Sanitizer termination functions CheckFailed and Die, /// and the callback functionalities associated with them. /// //===----------------------------------------------------------------------===// #include "sanitizer_common.h" #include "sanitizer_libc.h" namespace __sanitizer { static const int kMaxNumOfInternalDieCallbacks = 5; static DieCallbackType InternalDieCallbacks[kMaxNumOfInternalDieCallbacks]; bool AddDieCallback(DieCallbackType callback) { for (int i = 0; i < kMaxNumOfInternalDieCallbacks; i++) { if (InternalDieCallbacks[i] == nullptr) { InternalDieCallbacks[i] = callback; return true; } } return false; } bool RemoveDieCallback(DieCallbackType callback) { for (int i = 0; i < kMaxNumOfInternalDieCallbacks; i++) { if (InternalDieCallbacks[i] == callback) { internal_memmove(&InternalDieCallbacks[i], &InternalDieCallbacks[i + 1], sizeof(InternalDieCallbacks[0]) * (kMaxNumOfInternalDieCallbacks - i - 1)); InternalDieCallbacks[kMaxNumOfInternalDieCallbacks - 1] = nullptr; return true; } } return false; } static DieCallbackType UserDieCallback; void SetUserDieCallback(DieCallbackType callback) { UserDieCallback = callback; } void NORETURN Die() { if (UserDieCallback) UserDieCallback(); for (int i = kMaxNumOfInternalDieCallbacks - 1; i >= 0; i--) { if (InternalDieCallbacks[i]) InternalDieCallbacks[i](); } if (common_flags()->abort_on_error) Abort(); internal__exit(common_flags()->exitcode); } static CheckFailedCallbackType CheckFailedCallback; void SetCheckFailedCallback(CheckFailedCallbackType callback) { CheckFailedCallback = callback; } const int kSecondsToSleepWhenRecursiveCheckFailed = 2; void NORETURN CheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) { static atomic_uint32_t num_calls; if (atomic_fetch_add(&num_calls, 1, memory_order_relaxed) > 10) { SleepForSeconds(kSecondsToSleepWhenRecursiveCheckFailed); Trap(); } if (CheckFailedCallback) { CheckFailedCallback(file, line, cond, v1, v2); } Report("Sanitizer CHECK failed: %s:%d %s (%lld, %lld)\n", file, line, cond, v1, v2); Die(); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_syscalls.inc0000664000175000017500000025063612733336670033345 0ustar mwhudsonmwhudson//===-- sanitizer_common_syscalls.inc ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Common syscalls handlers for tools like AddressSanitizer, // ThreadSanitizer, MemorySanitizer, etc. // // This file should be included into the tool's interceptor file, // which has to define it's own macros: // COMMON_SYSCALL_PRE_READ_RANGE // Called in prehook for regions that will be read by the kernel and // must be initialized. // COMMON_SYSCALL_PRE_WRITE_RANGE // Called in prehook for regions that will be written to by the kernel // and must be addressable. The actual write range may be smaller than // reported in the prehook. See POST_WRITE_RANGE. // COMMON_SYSCALL_POST_READ_RANGE // Called in posthook for regions that were read by the kernel. Does // not make much sense. // COMMON_SYSCALL_POST_WRITE_RANGE // Called in posthook for regions that were written to by the kernel // and are now initialized. // COMMON_SYSCALL_ACQUIRE(addr) // Acquire memory visibility from addr. // COMMON_SYSCALL_RELEASE(addr) // Release memory visibility to addr. // COMMON_SYSCALL_FD_CLOSE(fd) // Called before closing file descriptor fd. // COMMON_SYSCALL_FD_ACQUIRE(fd) // Acquire memory visibility from fd. // COMMON_SYSCALL_FD_RELEASE(fd) // Release memory visibility to fd. // COMMON_SYSCALL_PRE_FORK() // Called before fork syscall. // COMMON_SYSCALL_POST_FORK(long res) // Called after fork syscall. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_LINUX #include "sanitizer_libc.h" #define PRE_SYSCALL(name) \ SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_syscall_pre_impl_##name #define PRE_READ(p, s) COMMON_SYSCALL_PRE_READ_RANGE(p, s) #define PRE_WRITE(p, s) COMMON_SYSCALL_PRE_WRITE_RANGE(p, s) #define POST_SYSCALL(name) \ SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_syscall_post_impl_##name #define POST_READ(p, s) COMMON_SYSCALL_POST_READ_RANGE(p, s) #define POST_WRITE(p, s) COMMON_SYSCALL_POST_WRITE_RANGE(p, s) #ifndef COMMON_SYSCALL_ACQUIRE # define COMMON_SYSCALL_ACQUIRE(addr) ((void)(addr)) #endif #ifndef COMMON_SYSCALL_RELEASE # define COMMON_SYSCALL_RELEASE(addr) ((void)(addr)) #endif #ifndef COMMON_SYSCALL_FD_CLOSE # define COMMON_SYSCALL_FD_CLOSE(fd) ((void)(fd)) #endif #ifndef COMMON_SYSCALL_FD_ACQUIRE # define COMMON_SYSCALL_FD_ACQUIRE(fd) ((void)(fd)) #endif #ifndef COMMON_SYSCALL_FD_RELEASE # define COMMON_SYSCALL_FD_RELEASE(fd) ((void)(fd)) #endif #ifndef COMMON_SYSCALL_PRE_FORK # define COMMON_SYSCALL_PRE_FORK() {} #endif #ifndef COMMON_SYSCALL_POST_FORK # define COMMON_SYSCALL_POST_FORK(res) {} #endif // FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such). extern "C" { struct sanitizer_kernel_iovec { void *iov_base; unsigned long iov_len; }; struct sanitizer_kernel_msghdr { void *msg_name; int msg_namelen; struct sanitizer_kernel_iovec *msg_iov; unsigned long msg_iovlen; void *msg_control; unsigned long msg_controllen; unsigned msg_flags; }; struct sanitizer_kernel_mmsghdr { struct sanitizer_kernel_msghdr msg_hdr; unsigned msg_len; }; struct sanitizer_kernel_timespec { long tv_sec; long tv_nsec; }; struct sanitizer_kernel_timeval { long tv_sec; long tv_usec; }; struct sanitizer_kernel_rusage { struct sanitizer_kernel_timeval ru_timeval[2]; long ru_long[14]; }; struct sanitizer_kernel_sockaddr { unsigned short sa_family; char sa_data[14]; }; // Real sigset size is always passed as a syscall argument. // Declare it "void" to catch sizeof(kernel_sigset_t). typedef void kernel_sigset_t; static void kernel_write_iovec(const __sanitizer_iovec *iovec, SIZE_T iovlen, SIZE_T maxlen) { for (SIZE_T i = 0; i < iovlen && maxlen; ++i) { SSIZE_T sz = Min(iovec[i].iov_len, maxlen); POST_WRITE(iovec[i].iov_base, sz); maxlen -= sz; } } // This functions uses POST_READ, because it needs to run after syscall to know // the real read range. static void kernel_read_iovec(const __sanitizer_iovec *iovec, SIZE_T iovlen, SIZE_T maxlen) { POST_READ(iovec, sizeof(*iovec) * iovlen); for (SIZE_T i = 0; i < iovlen && maxlen; ++i) { SSIZE_T sz = Min(iovec[i].iov_len, maxlen); POST_READ(iovec[i].iov_base, sz); maxlen -= sz; } } PRE_SYSCALL(recvmsg)(long sockfd, sanitizer_kernel_msghdr *msg, long flags) { PRE_READ(msg, sizeof(*msg)); } POST_SYSCALL(recvmsg)(long res, long sockfd, sanitizer_kernel_msghdr *msg, long flags) { if (res >= 0) { if (msg) { for (unsigned long i = 0; i < msg->msg_iovlen; ++i) { POST_WRITE(msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len); } POST_WRITE(msg->msg_control, msg->msg_controllen); } } } PRE_SYSCALL(recvmmsg)(long fd, sanitizer_kernel_mmsghdr *msg, long vlen, long flags, void *timeout) { PRE_READ(msg, vlen * sizeof(*msg)); } POST_SYSCALL(recvmmsg)(long res, long fd, sanitizer_kernel_mmsghdr *msg, long vlen, long flags, void *timeout) { if (res >= 0) { if (msg) { for (unsigned long i = 0; i < msg->msg_hdr.msg_iovlen; ++i) { POST_WRITE(msg->msg_hdr.msg_iov[i].iov_base, msg->msg_hdr.msg_iov[i].iov_len); } POST_WRITE(msg->msg_hdr.msg_control, msg->msg_hdr.msg_controllen); POST_WRITE(&msg->msg_len, sizeof(msg->msg_len)); } if (timeout) POST_WRITE(timeout, struct_timespec_sz); } } PRE_SYSCALL(read)(long fd, void *buf, uptr count) { if (buf) { PRE_WRITE(buf, count); } } POST_SYSCALL(read)(long res, long fd, void *buf, uptr count) { if (res > 0 && buf) { POST_WRITE(buf, res); } } PRE_SYSCALL(time)(void *tloc) {} POST_SYSCALL(time)(long res, void *tloc) { if (res >= 0) { if (tloc) POST_WRITE(tloc, sizeof(long)); } } PRE_SYSCALL(stime)(void *tptr) {} POST_SYSCALL(stime)(long res, void *tptr) { if (res >= 0) { if (tptr) POST_WRITE(tptr, sizeof(long)); } } PRE_SYSCALL(gettimeofday)(void *tv, void *tz) {} POST_SYSCALL(gettimeofday)(long res, void *tv, void *tz) { if (res >= 0) { if (tv) POST_WRITE(tv, timeval_sz); if (tz) POST_WRITE(tz, struct_timezone_sz); } } PRE_SYSCALL(settimeofday)(void *tv, void *tz) {} POST_SYSCALL(settimeofday)(long res, void *tv, void *tz) { if (res >= 0) { if (tv) POST_WRITE(tv, timeval_sz); if (tz) POST_WRITE(tz, struct_timezone_sz); } } #if !SANITIZER_ANDROID PRE_SYSCALL(adjtimex)(void *txc_p) {} POST_SYSCALL(adjtimex)(long res, void *txc_p) { if (res >= 0) { if (txc_p) POST_WRITE(txc_p, struct_timex_sz); } } #endif PRE_SYSCALL(times)(void *tbuf) {} POST_SYSCALL(times)(long res, void *tbuf) { if (res >= 0) { if (tbuf) POST_WRITE(tbuf, struct_tms_sz); } } PRE_SYSCALL(gettid)() {} POST_SYSCALL(gettid)(long res) {} PRE_SYSCALL(nanosleep)(void *rqtp, void *rmtp) {} POST_SYSCALL(nanosleep)(long res, void *rqtp, void *rmtp) { if (res >= 0) { if (rqtp) POST_WRITE(rqtp, struct_timespec_sz); if (rmtp) POST_WRITE(rmtp, struct_timespec_sz); } } PRE_SYSCALL(alarm)(long seconds) {} POST_SYSCALL(alarm)(long res, long seconds) {} PRE_SYSCALL(getpid)() {} POST_SYSCALL(getpid)(long res) {} PRE_SYSCALL(getppid)() {} POST_SYSCALL(getppid)(long res) {} PRE_SYSCALL(getuid)() {} POST_SYSCALL(getuid)(long res) {} PRE_SYSCALL(geteuid)() {} POST_SYSCALL(geteuid)(long res) {} PRE_SYSCALL(getgid)() {} POST_SYSCALL(getgid)(long res) {} PRE_SYSCALL(getegid)() {} POST_SYSCALL(getegid)(long res) {} PRE_SYSCALL(getresuid)(void *ruid, void *euid, void *suid) {} POST_SYSCALL(getresuid)(long res, void *ruid, void *euid, void *suid) { if (res >= 0) { if (ruid) POST_WRITE(ruid, sizeof(unsigned)); if (euid) POST_WRITE(euid, sizeof(unsigned)); if (suid) POST_WRITE(suid, sizeof(unsigned)); } } PRE_SYSCALL(getresgid)(void *rgid, void *egid, void *sgid) {} POST_SYSCALL(getresgid)(long res, void *rgid, void *egid, void *sgid) { if (res >= 0) { if (rgid) POST_WRITE(rgid, sizeof(unsigned)); if (egid) POST_WRITE(egid, sizeof(unsigned)); if (sgid) POST_WRITE(sgid, sizeof(unsigned)); } } PRE_SYSCALL(getpgid)(long pid) {} POST_SYSCALL(getpgid)(long res, long pid) {} PRE_SYSCALL(getpgrp)() {} POST_SYSCALL(getpgrp)(long res) {} PRE_SYSCALL(getsid)(long pid) {} POST_SYSCALL(getsid)(long res, long pid) {} PRE_SYSCALL(getgroups)(long gidsetsize, void *grouplist) {} POST_SYSCALL(getgroups)(long res, long gidsetsize, __sanitizer___kernel_gid_t *grouplist) { if (res >= 0) { if (grouplist) POST_WRITE(grouplist, res * sizeof(*grouplist)); } } PRE_SYSCALL(setregid)(long rgid, long egid) {} POST_SYSCALL(setregid)(long res, long rgid, long egid) {} PRE_SYSCALL(setgid)(long gid) {} POST_SYSCALL(setgid)(long res, long gid) {} PRE_SYSCALL(setreuid)(long ruid, long euid) {} POST_SYSCALL(setreuid)(long res, long ruid, long euid) {} PRE_SYSCALL(setuid)(long uid) {} POST_SYSCALL(setuid)(long res, long uid) {} PRE_SYSCALL(setresuid)(long ruid, long euid, long suid) {} POST_SYSCALL(setresuid)(long res, long ruid, long euid, long suid) {} PRE_SYSCALL(setresgid)(long rgid, long egid, long sgid) {} POST_SYSCALL(setresgid)(long res, long rgid, long egid, long sgid) {} PRE_SYSCALL(setfsuid)(long uid) {} POST_SYSCALL(setfsuid)(long res, long uid) {} PRE_SYSCALL(setfsgid)(long gid) {} POST_SYSCALL(setfsgid)(long res, long gid) {} PRE_SYSCALL(setpgid)(long pid, long pgid) {} POST_SYSCALL(setpgid)(long res, long pid, long pgid) {} PRE_SYSCALL(setsid)() {} POST_SYSCALL(setsid)(long res) {} PRE_SYSCALL(setgroups)(long gidsetsize, __sanitizer___kernel_gid_t *grouplist) { if (grouplist) POST_WRITE(grouplist, gidsetsize * sizeof(*grouplist)); } POST_SYSCALL(setgroups)(long res, long gidsetsize, __sanitizer___kernel_gid_t *grouplist) {} PRE_SYSCALL(acct)(const void *name) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(acct)(long res, const void *name) {} PRE_SYSCALL(capget)(void *header, void *dataptr) { if (header) PRE_READ(header, __user_cap_header_struct_sz); } POST_SYSCALL(capget)(long res, void *header, void *dataptr) { if (res >= 0) if (dataptr) POST_WRITE(dataptr, __user_cap_data_struct_sz); } PRE_SYSCALL(capset)(void *header, const void *data) { if (header) PRE_READ(header, __user_cap_header_struct_sz); if (data) PRE_READ(data, __user_cap_data_struct_sz); } POST_SYSCALL(capset)(long res, void *header, const void *data) {} PRE_SYSCALL(personality)(long personality) {} POST_SYSCALL(personality)(long res, long personality) {} PRE_SYSCALL(sigpending)(void *set) {} POST_SYSCALL(sigpending)(long res, void *set) { if (res >= 0) { if (set) POST_WRITE(set, old_sigset_t_sz); } } PRE_SYSCALL(sigprocmask)(long how, void *set, void *oset) {} POST_SYSCALL(sigprocmask)(long res, long how, void *set, void *oset) { if (res >= 0) { if (set) POST_WRITE(set, old_sigset_t_sz); if (oset) POST_WRITE(oset, old_sigset_t_sz); } } PRE_SYSCALL(getitimer)(long which, void *value) {} POST_SYSCALL(getitimer)(long res, long which, void *value) { if (res >= 0) { if (value) POST_WRITE(value, struct_itimerval_sz); } } PRE_SYSCALL(setitimer)(long which, void *value, void *ovalue) {} POST_SYSCALL(setitimer)(long res, long which, void *value, void *ovalue) { if (res >= 0) { if (value) POST_WRITE(value, struct_itimerval_sz); if (ovalue) POST_WRITE(ovalue, struct_itimerval_sz); } } PRE_SYSCALL(timer_create)(long which_clock, void *timer_event_spec, void *created_timer_id) {} POST_SYSCALL(timer_create)(long res, long which_clock, void *timer_event_spec, void *created_timer_id) { if (res >= 0) { if (timer_event_spec) POST_WRITE(timer_event_spec, struct_sigevent_sz); if (created_timer_id) POST_WRITE(created_timer_id, sizeof(long)); } } PRE_SYSCALL(timer_gettime)(long timer_id, void *setting) {} POST_SYSCALL(timer_gettime)(long res, long timer_id, void *setting) { if (res >= 0) { if (setting) POST_WRITE(setting, struct_itimerspec_sz); } } PRE_SYSCALL(timer_getoverrun)(long timer_id) {} POST_SYSCALL(timer_getoverrun)(long res, long timer_id) {} PRE_SYSCALL(timer_settime)(long timer_id, long flags, const void *new_setting, void *old_setting) { if (new_setting) PRE_READ(new_setting, struct_itimerspec_sz); } POST_SYSCALL(timer_settime)(long res, long timer_id, long flags, const void *new_setting, void *old_setting) { if (res >= 0) { if (old_setting) POST_WRITE(old_setting, struct_itimerspec_sz); } } PRE_SYSCALL(timer_delete)(long timer_id) {} POST_SYSCALL(timer_delete)(long res, long timer_id) {} PRE_SYSCALL(clock_settime)(long which_clock, const void *tp) { if (tp) PRE_READ(tp, struct_timespec_sz); } POST_SYSCALL(clock_settime)(long res, long which_clock, const void *tp) {} PRE_SYSCALL(clock_gettime)(long which_clock, void *tp) {} POST_SYSCALL(clock_gettime)(long res, long which_clock, void *tp) { if (res >= 0) { if (tp) POST_WRITE(tp, struct_timespec_sz); } } #if !SANITIZER_ANDROID PRE_SYSCALL(clock_adjtime)(long which_clock, void *tx) {} POST_SYSCALL(clock_adjtime)(long res, long which_clock, void *tx) { if (res >= 0) { if (tx) POST_WRITE(tx, struct_timex_sz); } } #endif PRE_SYSCALL(clock_getres)(long which_clock, void *tp) {} POST_SYSCALL(clock_getres)(long res, long which_clock, void *tp) { if (res >= 0) { if (tp) POST_WRITE(tp, struct_timespec_sz); } } PRE_SYSCALL(clock_nanosleep)(long which_clock, long flags, const void *rqtp, void *rmtp) { if (rqtp) PRE_READ(rqtp, struct_timespec_sz); } POST_SYSCALL(clock_nanosleep)(long res, long which_clock, long flags, const void *rqtp, void *rmtp) { if (res >= 0) { if (rmtp) POST_WRITE(rmtp, struct_timespec_sz); } } PRE_SYSCALL(nice)(long increment) {} POST_SYSCALL(nice)(long res, long increment) {} PRE_SYSCALL(sched_setscheduler)(long pid, long policy, void *param) {} POST_SYSCALL(sched_setscheduler)(long res, long pid, long policy, void *param) { if (res >= 0) { if (param) POST_WRITE(param, struct_sched_param_sz); } } PRE_SYSCALL(sched_setparam)(long pid, void *param) { if (param) PRE_READ(param, struct_sched_param_sz); } POST_SYSCALL(sched_setparam)(long res, long pid, void *param) {} PRE_SYSCALL(sched_getscheduler)(long pid) {} POST_SYSCALL(sched_getscheduler)(long res, long pid) {} PRE_SYSCALL(sched_getparam)(long pid, void *param) {} POST_SYSCALL(sched_getparam)(long res, long pid, void *param) { if (res >= 0) { if (param) POST_WRITE(param, struct_sched_param_sz); } } PRE_SYSCALL(sched_setaffinity)(long pid, long len, void *user_mask_ptr) { if (user_mask_ptr) PRE_READ(user_mask_ptr, len); } POST_SYSCALL(sched_setaffinity)(long res, long pid, long len, void *user_mask_ptr) {} PRE_SYSCALL(sched_getaffinity)(long pid, long len, void *user_mask_ptr) {} POST_SYSCALL(sched_getaffinity)(long res, long pid, long len, void *user_mask_ptr) { if (res >= 0) { if (user_mask_ptr) POST_WRITE(user_mask_ptr, len); } } PRE_SYSCALL(sched_yield)() {} POST_SYSCALL(sched_yield)(long res) {} PRE_SYSCALL(sched_get_priority_max)(long policy) {} POST_SYSCALL(sched_get_priority_max)(long res, long policy) {} PRE_SYSCALL(sched_get_priority_min)(long policy) {} POST_SYSCALL(sched_get_priority_min)(long res, long policy) {} PRE_SYSCALL(sched_rr_get_interval)(long pid, void *interval) {} POST_SYSCALL(sched_rr_get_interval)(long res, long pid, void *interval) { if (res >= 0) { if (interval) POST_WRITE(interval, struct_timespec_sz); } } PRE_SYSCALL(setpriority)(long which, long who, long niceval) {} POST_SYSCALL(setpriority)(long res, long which, long who, long niceval) {} PRE_SYSCALL(getpriority)(long which, long who) {} POST_SYSCALL(getpriority)(long res, long which, long who) {} PRE_SYSCALL(shutdown)(long arg0, long arg1) {} POST_SYSCALL(shutdown)(long res, long arg0, long arg1) {} PRE_SYSCALL(reboot)(long magic1, long magic2, long cmd, void *arg) {} POST_SYSCALL(reboot)(long res, long magic1, long magic2, long cmd, void *arg) {} PRE_SYSCALL(restart_syscall)() {} POST_SYSCALL(restart_syscall)(long res) {} PRE_SYSCALL(kexec_load)(long entry, long nr_segments, void *segments, long flags) {} POST_SYSCALL(kexec_load)(long res, long entry, long nr_segments, void *segments, long flags) { if (res >= 0) { if (segments) POST_WRITE(segments, struct_kexec_segment_sz); } } PRE_SYSCALL(exit)(long error_code) {} POST_SYSCALL(exit)(long res, long error_code) {} PRE_SYSCALL(exit_group)(long error_code) {} POST_SYSCALL(exit_group)(long res, long error_code) {} PRE_SYSCALL(wait4)(long pid, void *stat_addr, long options, void *ru) {} POST_SYSCALL(wait4)(long res, long pid, void *stat_addr, long options, void *ru) { if (res >= 0) { if (stat_addr) POST_WRITE(stat_addr, sizeof(int)); if (ru) POST_WRITE(ru, struct_rusage_sz); } } PRE_SYSCALL(waitid)(long which, long pid, void *infop, long options, void *ru) { } POST_SYSCALL(waitid)(long res, long which, long pid, void *infop, long options, void *ru) { if (res >= 0) { if (infop) POST_WRITE(infop, siginfo_t_sz); if (ru) POST_WRITE(ru, struct_rusage_sz); } } PRE_SYSCALL(waitpid)(long pid, void *stat_addr, long options) {} POST_SYSCALL(waitpid)(long res, long pid, void *stat_addr, long options) { if (res >= 0) { if (stat_addr) POST_WRITE(stat_addr, sizeof(int)); } } PRE_SYSCALL(set_tid_address)(void *tidptr) {} POST_SYSCALL(set_tid_address)(long res, void *tidptr) { if (res >= 0) { if (tidptr) POST_WRITE(tidptr, sizeof(int)); } } PRE_SYSCALL(init_module)(void *umod, long len, const void *uargs) { if (uargs) PRE_READ(uargs, __sanitizer::internal_strlen((const char *)uargs) + 1); } POST_SYSCALL(init_module)(long res, void *umod, long len, const void *uargs) {} PRE_SYSCALL(delete_module)(const void *name_user, long flags) { if (name_user) PRE_READ(name_user, __sanitizer::internal_strlen((const char *)name_user) + 1); } POST_SYSCALL(delete_module)(long res, const void *name_user, long flags) {} PRE_SYSCALL(rt_sigprocmask)(long how, void *set, void *oset, long sigsetsize) {} POST_SYSCALL(rt_sigprocmask)(long res, long how, kernel_sigset_t *set, kernel_sigset_t *oset, long sigsetsize) { if (res >= 0) { if (set) POST_WRITE(set, sigsetsize); if (oset) POST_WRITE(oset, sigsetsize); } } PRE_SYSCALL(rt_sigpending)(void *set, long sigsetsize) {} POST_SYSCALL(rt_sigpending)(long res, kernel_sigset_t *set, long sigsetsize) { if (res >= 0) { if (set) POST_WRITE(set, sigsetsize); } } PRE_SYSCALL(rt_sigtimedwait)(const kernel_sigset_t *uthese, void *uinfo, const void *uts, long sigsetsize) { if (uthese) PRE_READ(uthese, sigsetsize); if (uts) PRE_READ(uts, struct_timespec_sz); } POST_SYSCALL(rt_sigtimedwait)(long res, const void *uthese, void *uinfo, const void *uts, long sigsetsize) { if (res >= 0) { if (uinfo) POST_WRITE(uinfo, siginfo_t_sz); } } PRE_SYSCALL(rt_tgsigqueueinfo)(long tgid, long pid, long sig, void *uinfo) {} POST_SYSCALL(rt_tgsigqueueinfo)(long res, long tgid, long pid, long sig, void *uinfo) { if (res >= 0) { if (uinfo) POST_WRITE(uinfo, siginfo_t_sz); } } PRE_SYSCALL(kill)(long pid, long sig) {} POST_SYSCALL(kill)(long res, long pid, long sig) {} PRE_SYSCALL(tgkill)(long tgid, long pid, long sig) {} POST_SYSCALL(tgkill)(long res, long tgid, long pid, long sig) {} PRE_SYSCALL(tkill)(long pid, long sig) {} POST_SYSCALL(tkill)(long res, long pid, long sig) {} PRE_SYSCALL(rt_sigqueueinfo)(long pid, long sig, void *uinfo) {} POST_SYSCALL(rt_sigqueueinfo)(long res, long pid, long sig, void *uinfo) { if (res >= 0) { if (uinfo) POST_WRITE(uinfo, siginfo_t_sz); } } PRE_SYSCALL(sgetmask)() {} POST_SYSCALL(sgetmask)(long res) {} PRE_SYSCALL(ssetmask)(long newmask) {} POST_SYSCALL(ssetmask)(long res, long newmask) {} PRE_SYSCALL(signal)(long sig, long handler) {} POST_SYSCALL(signal)(long res, long sig, long handler) {} PRE_SYSCALL(pause)() {} POST_SYSCALL(pause)(long res) {} PRE_SYSCALL(sync)() {} POST_SYSCALL(sync)(long res) {} PRE_SYSCALL(fsync)(long fd) {} POST_SYSCALL(fsync)(long res, long fd) {} PRE_SYSCALL(fdatasync)(long fd) {} POST_SYSCALL(fdatasync)(long res, long fd) {} PRE_SYSCALL(bdflush)(long func, long data) {} POST_SYSCALL(bdflush)(long res, long func, long data) {} PRE_SYSCALL(mount)(void *dev_name, void *dir_name, void *type, long flags, void *data) {} POST_SYSCALL(mount)(long res, void *dev_name, void *dir_name, void *type, long flags, void *data) { if (res >= 0) { if (dev_name) POST_WRITE(dev_name, __sanitizer::internal_strlen((const char *)dev_name) + 1); if (dir_name) POST_WRITE(dir_name, __sanitizer::internal_strlen((const char *)dir_name) + 1); if (type) POST_WRITE(type, __sanitizer::internal_strlen((const char *)type) + 1); } } PRE_SYSCALL(umount)(void *name, long flags) {} POST_SYSCALL(umount)(long res, void *name, long flags) { if (res >= 0) { if (name) POST_WRITE(name, __sanitizer::internal_strlen((const char *)name) + 1); } } PRE_SYSCALL(oldumount)(void *name) {} POST_SYSCALL(oldumount)(long res, void *name) { if (res >= 0) { if (name) POST_WRITE(name, __sanitizer::internal_strlen((const char *)name) + 1); } } PRE_SYSCALL(truncate)(const void *path, long length) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(truncate)(long res, const void *path, long length) {} PRE_SYSCALL(ftruncate)(long fd, long length) {} POST_SYSCALL(ftruncate)(long res, long fd, long length) {} PRE_SYSCALL(stat)(const void *filename, void *statbuf) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(stat)(long res, const void *filename, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct___old_kernel_stat_sz); } } #if !SANITIZER_ANDROID PRE_SYSCALL(statfs)(const void *path, void *buf) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(statfs)(long res, const void *path, void *buf) { if (res >= 0) { if (buf) POST_WRITE(buf, struct_statfs_sz); } } PRE_SYSCALL(statfs64)(const void *path, long sz, void *buf) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(statfs64)(long res, const void *path, long sz, void *buf) { if (res >= 0) { if (buf) POST_WRITE(buf, struct_statfs64_sz); } } PRE_SYSCALL(fstatfs)(long fd, void *buf) {} POST_SYSCALL(fstatfs)(long res, long fd, void *buf) { if (res >= 0) { if (buf) POST_WRITE(buf, struct_statfs_sz); } } PRE_SYSCALL(fstatfs64)(long fd, long sz, void *buf) {} POST_SYSCALL(fstatfs64)(long res, long fd, long sz, void *buf) { if (res >= 0) { if (buf) POST_WRITE(buf, struct_statfs64_sz); } } #endif // !SANITIZER_ANDROID PRE_SYSCALL(lstat)(const void *filename, void *statbuf) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(lstat)(long res, const void *filename, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct___old_kernel_stat_sz); } } PRE_SYSCALL(fstat)(long fd, void *statbuf) {} POST_SYSCALL(fstat)(long res, long fd, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct___old_kernel_stat_sz); } } PRE_SYSCALL(newstat)(const void *filename, void *statbuf) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(newstat)(long res, const void *filename, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat_sz); } } PRE_SYSCALL(newlstat)(const void *filename, void *statbuf) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(newlstat)(long res, const void *filename, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat_sz); } } PRE_SYSCALL(newfstat)(long fd, void *statbuf) {} POST_SYSCALL(newfstat)(long res, long fd, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat_sz); } } #if !SANITIZER_ANDROID PRE_SYSCALL(ustat)(long dev, void *ubuf) {} POST_SYSCALL(ustat)(long res, long dev, void *ubuf) { if (res >= 0) { if (ubuf) POST_WRITE(ubuf, struct_ustat_sz); } } #endif // !SANITIZER_ANDROID PRE_SYSCALL(stat64)(const void *filename, void *statbuf) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(stat64)(long res, const void *filename, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat64_sz); } } PRE_SYSCALL(fstat64)(long fd, void *statbuf) {} POST_SYSCALL(fstat64)(long res, long fd, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat64_sz); } } PRE_SYSCALL(lstat64)(const void *filename, void *statbuf) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(lstat64)(long res, const void *filename, void *statbuf) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat64_sz); } } PRE_SYSCALL(setxattr)(const void *path, const void *name, const void *value, long size, long flags) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); if (value) PRE_READ(value, size); } POST_SYSCALL(setxattr)(long res, const void *path, const void *name, const void *value, long size, long flags) {} PRE_SYSCALL(lsetxattr)(const void *path, const void *name, const void *value, long size, long flags) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); if (value) PRE_READ(value, size); } POST_SYSCALL(lsetxattr)(long res, const void *path, const void *name, const void *value, long size, long flags) {} PRE_SYSCALL(fsetxattr)(long fd, const void *name, const void *value, long size, long flags) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); if (value) PRE_READ(value, size); } POST_SYSCALL(fsetxattr)(long res, long fd, const void *name, const void *value, long size, long flags) {} PRE_SYSCALL(getxattr)(const void *path, const void *name, void *value, long size) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(getxattr)(long res, const void *path, const void *name, void *value, long size) { if (size && res > 0) { if (value) POST_WRITE(value, res); } } PRE_SYSCALL(lgetxattr)(const void *path, const void *name, void *value, long size) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(lgetxattr)(long res, const void *path, const void *name, void *value, long size) { if (size && res > 0) { if (value) POST_WRITE(value, res); } } PRE_SYSCALL(fgetxattr)(long fd, const void *name, void *value, long size) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(fgetxattr)(long res, long fd, const void *name, void *value, long size) { if (size && res > 0) { if (value) POST_WRITE(value, res); } } PRE_SYSCALL(listxattr)(const void *path, void *list, long size) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(listxattr)(long res, const void *path, void *list, long size) { if (size && res > 0) { if (list) POST_WRITE(list, res); } } PRE_SYSCALL(llistxattr)(const void *path, void *list, long size) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(llistxattr)(long res, const void *path, void *list, long size) { if (size && res > 0) { if (list) POST_WRITE(list, res); } } PRE_SYSCALL(flistxattr)(long fd, void *list, long size) {} POST_SYSCALL(flistxattr)(long res, long fd, void *list, long size) { if (size && res > 0) { if (list) POST_WRITE(list, res); } } PRE_SYSCALL(removexattr)(const void *path, const void *name) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(removexattr)(long res, const void *path, const void *name) {} PRE_SYSCALL(lremovexattr)(const void *path, const void *name) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(lremovexattr)(long res, const void *path, const void *name) {} PRE_SYSCALL(fremovexattr)(long fd, const void *name) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(fremovexattr)(long res, long fd, const void *name) {} PRE_SYSCALL(brk)(long brk) {} POST_SYSCALL(brk)(long res, long brk) {} PRE_SYSCALL(mprotect)(long start, long len, long prot) {} POST_SYSCALL(mprotect)(long res, long start, long len, long prot) {} PRE_SYSCALL(mremap)(long addr, long old_len, long new_len, long flags, long new_addr) {} POST_SYSCALL(mremap)(long res, long addr, long old_len, long new_len, long flags, long new_addr) {} PRE_SYSCALL(remap_file_pages)(long start, long size, long prot, long pgoff, long flags) {} POST_SYSCALL(remap_file_pages)(long res, long start, long size, long prot, long pgoff, long flags) {} PRE_SYSCALL(msync)(long start, long len, long flags) {} POST_SYSCALL(msync)(long res, long start, long len, long flags) {} PRE_SYSCALL(munmap)(long addr, long len) {} POST_SYSCALL(munmap)(long res, long addr, long len) {} PRE_SYSCALL(mlock)(long start, long len) {} POST_SYSCALL(mlock)(long res, long start, long len) {} PRE_SYSCALL(munlock)(long start, long len) {} POST_SYSCALL(munlock)(long res, long start, long len) {} PRE_SYSCALL(mlockall)(long flags) {} POST_SYSCALL(mlockall)(long res, long flags) {} PRE_SYSCALL(munlockall)() {} POST_SYSCALL(munlockall)(long res) {} PRE_SYSCALL(madvise)(long start, long len, long behavior) {} POST_SYSCALL(madvise)(long res, long start, long len, long behavior) {} PRE_SYSCALL(mincore)(long start, long len, void *vec) {} POST_SYSCALL(mincore)(long res, long start, long len, void *vec) { if (res >= 0) { if (vec) { POST_WRITE(vec, (len + GetPageSizeCached() - 1) / GetPageSizeCached()); } } } PRE_SYSCALL(pivot_root)(const void *new_root, const void *put_old) { if (new_root) PRE_READ(new_root, __sanitizer::internal_strlen((const char *)new_root) + 1); if (put_old) PRE_READ(put_old, __sanitizer::internal_strlen((const char *)put_old) + 1); } POST_SYSCALL(pivot_root)(long res, const void *new_root, const void *put_old) {} PRE_SYSCALL(chroot)(const void *filename) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(chroot)(long res, const void *filename) {} PRE_SYSCALL(mknod)(const void *filename, long mode, long dev) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(mknod)(long res, const void *filename, long mode, long dev) {} PRE_SYSCALL(link)(const void *oldname, const void *newname) { if (oldname) PRE_READ(oldname, __sanitizer::internal_strlen((const char *)oldname) + 1); if (newname) PRE_READ(newname, __sanitizer::internal_strlen((const char *)newname) + 1); } POST_SYSCALL(link)(long res, const void *oldname, const void *newname) {} PRE_SYSCALL(symlink)(const void *old, const void *new_) { if (old) PRE_READ(old, __sanitizer::internal_strlen((const char *)old) + 1); if (new_) PRE_READ(new_, __sanitizer::internal_strlen((const char *)new_) + 1); } POST_SYSCALL(symlink)(long res, const void *old, const void *new_) {} PRE_SYSCALL(unlink)(const void *pathname) { if (pathname) PRE_READ(pathname, __sanitizer::internal_strlen((const char *)pathname) + 1); } POST_SYSCALL(unlink)(long res, const void *pathname) {} PRE_SYSCALL(rename)(const void *oldname, const void *newname) { if (oldname) PRE_READ(oldname, __sanitizer::internal_strlen((const char *)oldname) + 1); if (newname) PRE_READ(newname, __sanitizer::internal_strlen((const char *)newname) + 1); } POST_SYSCALL(rename)(long res, const void *oldname, const void *newname) {} PRE_SYSCALL(chmod)(const void *filename, long mode) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(chmod)(long res, const void *filename, long mode) {} PRE_SYSCALL(fchmod)(long fd, long mode) {} POST_SYSCALL(fchmod)(long res, long fd, long mode) {} PRE_SYSCALL(fcntl)(long fd, long cmd, long arg) {} POST_SYSCALL(fcntl)(long res, long fd, long cmd, long arg) {} PRE_SYSCALL(fcntl64)(long fd, long cmd, long arg) {} POST_SYSCALL(fcntl64)(long res, long fd, long cmd, long arg) {} PRE_SYSCALL(pipe)(void *fildes) {} POST_SYSCALL(pipe)(long res, void *fildes) { if (res >= 0) if (fildes) POST_WRITE(fildes, sizeof(int) * 2); } PRE_SYSCALL(pipe2)(void *fildes, long flags) {} POST_SYSCALL(pipe2)(long res, void *fildes, long flags) { if (res >= 0) if (fildes) POST_WRITE(fildes, sizeof(int) * 2); } PRE_SYSCALL(dup)(long fildes) {} POST_SYSCALL(dup)(long res, long fildes) {} PRE_SYSCALL(dup2)(long oldfd, long newfd) {} POST_SYSCALL(dup2)(long res, long oldfd, long newfd) {} PRE_SYSCALL(dup3)(long oldfd, long newfd, long flags) {} POST_SYSCALL(dup3)(long res, long oldfd, long newfd, long flags) {} PRE_SYSCALL(ioperm)(long from, long num, long on) {} POST_SYSCALL(ioperm)(long res, long from, long num, long on) {} PRE_SYSCALL(ioctl)(long fd, long cmd, long arg) {} POST_SYSCALL(ioctl)(long res, long fd, long cmd, long arg) {} PRE_SYSCALL(flock)(long fd, long cmd) {} POST_SYSCALL(flock)(long res, long fd, long cmd) {} PRE_SYSCALL(io_setup)(long nr_reqs, void **ctx) { if (ctx) PRE_WRITE(ctx, sizeof(*ctx)); } POST_SYSCALL(io_setup)(long res, long nr_reqs, void **ctx) { if (res >= 0) { if (ctx) POST_WRITE(ctx, sizeof(*ctx)); // (*ctx) is actually a pointer to a kernel mapped page, and there are // people out there who are crazy enough to peek into that page's 32-byte // header. if (*ctx) POST_WRITE(*ctx, 32); } } PRE_SYSCALL(io_destroy)(long ctx) {} POST_SYSCALL(io_destroy)(long res, long ctx) {} PRE_SYSCALL(io_getevents)(long ctx_id, long min_nr, long nr, __sanitizer_io_event *ioevpp, void *timeout) { if (timeout) PRE_READ(timeout, struct_timespec_sz); } POST_SYSCALL(io_getevents)(long res, long ctx_id, long min_nr, long nr, __sanitizer_io_event *ioevpp, void *timeout) { if (res >= 0) { if (ioevpp) POST_WRITE(ioevpp, res * sizeof(*ioevpp)); if (timeout) POST_WRITE(timeout, struct_timespec_sz); } for (long i = 0; i < res; i++) { // We synchronize io_submit -> io_getevents/io_cancel using the // user-provided data context. Data is not necessary a pointer, it can be // an int, 0 or whatever; acquire/release will correctly handle this. // This scheme can lead to false negatives, e.g. when all operations // synchronize on 0. But there does not seem to be a better solution // (except wrapping all operations in own context, which is unreliable). // We can not reliably extract fildes in io_getevents. COMMON_SYSCALL_ACQUIRE((void*)ioevpp[i].data); } } PRE_SYSCALL(io_submit)(long ctx_id, long nr, __sanitizer_iocb **iocbpp) { for (long i = 0; i < nr; ++i) { uptr op = iocbpp[i]->aio_lio_opcode; void *data = (void*)iocbpp[i]->aio_data; void *buf = (void*)iocbpp[i]->aio_buf; uptr len = (uptr)iocbpp[i]->aio_nbytes; if (op == iocb_cmd_pwrite && buf && len) { PRE_READ(buf, len); } else if (op == iocb_cmd_pread && buf && len) { POST_WRITE(buf, len); } else if (op == iocb_cmd_pwritev) { __sanitizer_iovec *iovec = (__sanitizer_iovec*)buf; for (uptr v = 0; v < len; v++) PRE_READ(iovec[v].iov_base, iovec[v].iov_len); } else if (op == iocb_cmd_preadv) { __sanitizer_iovec *iovec = (__sanitizer_iovec*)buf; for (uptr v = 0; v < len; v++) POST_WRITE(iovec[v].iov_base, iovec[v].iov_len); } // See comment in io_getevents. COMMON_SYSCALL_RELEASE(data); } } POST_SYSCALL(io_submit)(long res, long ctx_id, long nr, __sanitizer_iocb **iocbpp) {} PRE_SYSCALL(io_cancel)(long ctx_id, __sanitizer_iocb *iocb, __sanitizer_io_event *result) { } POST_SYSCALL(io_cancel)(long res, long ctx_id, __sanitizer_iocb *iocb, __sanitizer_io_event *result) { if (res == 0) { if (result) { // See comment in io_getevents. COMMON_SYSCALL_ACQUIRE((void*)result->data); POST_WRITE(result, sizeof(*result)); } if (iocb) POST_WRITE(iocb, sizeof(*iocb)); } } PRE_SYSCALL(sendfile)(long out_fd, long in_fd, void *offset, long count) {} POST_SYSCALL(sendfile)(long res, long out_fd, long in_fd, __sanitizer___kernel_off_t *offset, long count) { if (res >= 0) { if (offset) POST_WRITE(offset, sizeof(*offset)); } } PRE_SYSCALL(sendfile64)(long out_fd, long in_fd, void *offset, long count) {} POST_SYSCALL(sendfile64)(long res, long out_fd, long in_fd, __sanitizer___kernel_loff_t *offset, long count) { if (res >= 0) { if (offset) POST_WRITE(offset, sizeof(*offset)); } } PRE_SYSCALL(readlink)(const void *path, void *buf, long bufsiz) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(readlink)(long res, const void *path, void *buf, long bufsiz) { if (res >= 0) { if (buf) POST_WRITE(buf, __sanitizer::internal_strlen((const char *)buf) + 1); } } PRE_SYSCALL(creat)(const void *pathname, long mode) { if (pathname) PRE_READ(pathname, __sanitizer::internal_strlen((const char *)pathname) + 1); } POST_SYSCALL(creat)(long res, const void *pathname, long mode) {} PRE_SYSCALL(open)(const void *filename, long flags, long mode) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(open)(long res, const void *filename, long flags, long mode) {} PRE_SYSCALL(close)(long fd) { COMMON_SYSCALL_FD_CLOSE((int)fd); } POST_SYSCALL(close)(long res, long fd) {} PRE_SYSCALL(access)(const void *filename, long mode) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(access)(long res, const void *filename, long mode) {} PRE_SYSCALL(vhangup)() {} POST_SYSCALL(vhangup)(long res) {} PRE_SYSCALL(chown)(const void *filename, long user, long group) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(chown)(long res, const void *filename, long user, long group) {} PRE_SYSCALL(lchown)(const void *filename, long user, long group) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(lchown)(long res, const void *filename, long user, long group) {} PRE_SYSCALL(fchown)(long fd, long user, long group) {} POST_SYSCALL(fchown)(long res, long fd, long user, long group) {} #if SANITIZER_USES_UID16_SYSCALLS PRE_SYSCALL(chown16)(const void *filename, long user, long group) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(chown16)(long res, const void *filename, long user, long group) {} PRE_SYSCALL(lchown16)(const void *filename, long user, long group) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(lchown16)(long res, const void *filename, long user, long group) {} PRE_SYSCALL(fchown16)(long fd, long user, long group) {} POST_SYSCALL(fchown16)(long res, long fd, long user, long group) {} PRE_SYSCALL(setregid16)(long rgid, long egid) {} POST_SYSCALL(setregid16)(long res, long rgid, long egid) {} PRE_SYSCALL(setgid16)(long gid) {} POST_SYSCALL(setgid16)(long res, long gid) {} PRE_SYSCALL(setreuid16)(long ruid, long euid) {} POST_SYSCALL(setreuid16)(long res, long ruid, long euid) {} PRE_SYSCALL(setuid16)(long uid) {} POST_SYSCALL(setuid16)(long res, long uid) {} PRE_SYSCALL(setresuid16)(long ruid, long euid, long suid) {} POST_SYSCALL(setresuid16)(long res, long ruid, long euid, long suid) {} PRE_SYSCALL(getresuid16)(void *ruid, void *euid, void *suid) {} POST_SYSCALL(getresuid16)(long res, __sanitizer___kernel_old_uid_t *ruid, __sanitizer___kernel_old_uid_t *euid, __sanitizer___kernel_old_uid_t *suid) { if (res >= 0) { if (ruid) POST_WRITE(ruid, sizeof(*ruid)); if (euid) POST_WRITE(euid, sizeof(*euid)); if (suid) POST_WRITE(suid, sizeof(*suid)); } } PRE_SYSCALL(setresgid16)(long rgid, long egid, long sgid) {} POST_SYSCALL(setresgid16)(long res, long rgid, long egid, long sgid) {} PRE_SYSCALL(getresgid16)(void *rgid, void *egid, void *sgid) {} POST_SYSCALL(getresgid16)(long res, __sanitizer___kernel_old_gid_t *rgid, __sanitizer___kernel_old_gid_t *egid, __sanitizer___kernel_old_gid_t *sgid) { if (res >= 0) { if (rgid) POST_WRITE(rgid, sizeof(*rgid)); if (egid) POST_WRITE(egid, sizeof(*egid)); if (sgid) POST_WRITE(sgid, sizeof(*sgid)); } } PRE_SYSCALL(setfsuid16)(long uid) {} POST_SYSCALL(setfsuid16)(long res, long uid) {} PRE_SYSCALL(setfsgid16)(long gid) {} POST_SYSCALL(setfsgid16)(long res, long gid) {} PRE_SYSCALL(getgroups16)(long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) {} POST_SYSCALL(getgroups16)(long res, long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) { if (res >= 0) { if (grouplist) POST_WRITE(grouplist, res * sizeof(*grouplist)); } } PRE_SYSCALL(setgroups16)(long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) { if (grouplist) POST_WRITE(grouplist, gidsetsize * sizeof(*grouplist)); } POST_SYSCALL(setgroups16)(long res, long gidsetsize, __sanitizer___kernel_old_gid_t *grouplist) {} PRE_SYSCALL(getuid16)() {} POST_SYSCALL(getuid16)(long res) {} PRE_SYSCALL(geteuid16)() {} POST_SYSCALL(geteuid16)(long res) {} PRE_SYSCALL(getgid16)() {} POST_SYSCALL(getgid16)(long res) {} PRE_SYSCALL(getegid16)() {} POST_SYSCALL(getegid16)(long res) {} #endif // SANITIZER_USES_UID16_SYSCALLS PRE_SYSCALL(utime)(void *filename, void *times) {} POST_SYSCALL(utime)(long res, void *filename, void *times) { if (res >= 0) { if (filename) POST_WRITE(filename, __sanitizer::internal_strlen((const char *)filename) + 1); if (times) POST_WRITE(times, struct_utimbuf_sz); } } PRE_SYSCALL(utimes)(void *filename, void *utimes) {} POST_SYSCALL(utimes)(long res, void *filename, void *utimes) { if (res >= 0) { if (filename) POST_WRITE(filename, __sanitizer::internal_strlen((const char *)filename) + 1); if (utimes) POST_WRITE(utimes, timeval_sz); } } PRE_SYSCALL(lseek)(long fd, long offset, long origin) {} POST_SYSCALL(lseek)(long res, long fd, long offset, long origin) {} PRE_SYSCALL(llseek)(long fd, long offset_high, long offset_low, void *result, long origin) {} POST_SYSCALL(llseek)(long res, long fd, long offset_high, long offset_low, void *result, long origin) { if (res >= 0) { if (result) POST_WRITE(result, sizeof(long long)); } } PRE_SYSCALL(readv)(long fd, const __sanitizer_iovec *vec, long vlen) {} POST_SYSCALL(readv)(long res, long fd, const __sanitizer_iovec *vec, long vlen) { if (res >= 0) { if (vec) kernel_write_iovec(vec, vlen, res); } } PRE_SYSCALL(write)(long fd, const void *buf, long count) { if (buf) PRE_READ(buf, count); } POST_SYSCALL(write)(long res, long fd, const void *buf, long count) {} PRE_SYSCALL(writev)(long fd, const __sanitizer_iovec *vec, long vlen) {} POST_SYSCALL(writev)(long res, long fd, const __sanitizer_iovec *vec, long vlen) { if (res >= 0) { if (vec) kernel_read_iovec(vec, vlen, res); } } #ifdef _LP64 PRE_SYSCALL(pread64)(long fd, void *buf, long count, long pos) {} POST_SYSCALL(pread64)(long res, long fd, void *buf, long count, long pos) { if (res >= 0) { if (buf) POST_WRITE(buf, res); } } PRE_SYSCALL(pwrite64)(long fd, const void *buf, long count, long pos) { if (buf) PRE_READ(buf, count); } POST_SYSCALL(pwrite64)(long res, long fd, const void *buf, long count, long pos) {} #else PRE_SYSCALL(pread64)(long fd, void *buf, long count, long pos0, long pos1) {} POST_SYSCALL(pread64)(long res, long fd, void *buf, long count, long pos0, long pos1) { if (res >= 0) { if (buf) POST_WRITE(buf, res); } } PRE_SYSCALL(pwrite64)(long fd, const void *buf, long count, long pos0, long pos1) { if (buf) PRE_READ(buf, count); } POST_SYSCALL(pwrite64)(long res, long fd, const void *buf, long count, long pos0, long pos1) {} #endif PRE_SYSCALL(preadv)(long fd, const __sanitizer_iovec *vec, long vlen, long pos_l, long pos_h) {} POST_SYSCALL(preadv)(long res, long fd, const __sanitizer_iovec *vec, long vlen, long pos_l, long pos_h) { if (res >= 0) { if (vec) kernel_write_iovec(vec, vlen, res); } } PRE_SYSCALL(pwritev)(long fd, const __sanitizer_iovec *vec, long vlen, long pos_l, long pos_h) {} POST_SYSCALL(pwritev)(long res, long fd, const __sanitizer_iovec *vec, long vlen, long pos_l, long pos_h) { if (res >= 0) { if (vec) kernel_read_iovec(vec, vlen, res); } } PRE_SYSCALL(getcwd)(void *buf, long size) {} POST_SYSCALL(getcwd)(long res, void *buf, long size) { if (res >= 0) { if (buf) POST_WRITE(buf, __sanitizer::internal_strlen((const char *)buf) + 1); } } PRE_SYSCALL(mkdir)(const void *pathname, long mode) { if (pathname) PRE_READ(pathname, __sanitizer::internal_strlen((const char *)pathname) + 1); } POST_SYSCALL(mkdir)(long res, const void *pathname, long mode) {} PRE_SYSCALL(chdir)(const void *filename) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(chdir)(long res, const void *filename) {} PRE_SYSCALL(fchdir)(long fd) {} POST_SYSCALL(fchdir)(long res, long fd) {} PRE_SYSCALL(rmdir)(const void *pathname) { if (pathname) PRE_READ(pathname, __sanitizer::internal_strlen((const char *)pathname) + 1); } POST_SYSCALL(rmdir)(long res, const void *pathname) {} PRE_SYSCALL(lookup_dcookie)(u64 cookie64, void *buf, long len) {} POST_SYSCALL(lookup_dcookie)(long res, u64 cookie64, void *buf, long len) { if (res >= 0) { if (buf) POST_WRITE(buf, __sanitizer::internal_strlen((const char *)buf) + 1); } } PRE_SYSCALL(quotactl)(long cmd, const void *special, long id, void *addr) { if (special) PRE_READ(special, __sanitizer::internal_strlen((const char *)special) + 1); } POST_SYSCALL(quotactl)(long res, long cmd, const void *special, long id, void *addr) {} PRE_SYSCALL(getdents)(long fd, void *dirent, long count) {} POST_SYSCALL(getdents)(long res, long fd, void *dirent, long count) { if (res >= 0) { if (dirent) POST_WRITE(dirent, res); } } PRE_SYSCALL(getdents64)(long fd, void *dirent, long count) {} POST_SYSCALL(getdents64)(long res, long fd, void *dirent, long count) { if (res >= 0) { if (dirent) POST_WRITE(dirent, res); } } PRE_SYSCALL(setsockopt)(long fd, long level, long optname, void *optval, long optlen) {} POST_SYSCALL(setsockopt)(long res, long fd, long level, long optname, void *optval, long optlen) { if (res >= 0) { if (optval) POST_WRITE(optval, __sanitizer::internal_strlen((const char *)optval) + 1); } } PRE_SYSCALL(getsockopt)(long fd, long level, long optname, void *optval, void *optlen) {} POST_SYSCALL(getsockopt)(long res, long fd, long level, long optname, void *optval, void *optlen) { if (res >= 0) { if (optval) POST_WRITE(optval, __sanitizer::internal_strlen((const char *)optval) + 1); if (optlen) POST_WRITE(optlen, sizeof(int)); } } PRE_SYSCALL(bind)(long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) {} POST_SYSCALL(bind)(long res, long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); } } PRE_SYSCALL(connect)(long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) {} POST_SYSCALL(connect)(long res, long arg0, sanitizer_kernel_sockaddr *arg1, long arg2) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); } } PRE_SYSCALL(accept)(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {} POST_SYSCALL(accept)(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); if (arg2) POST_WRITE(arg2, sizeof(unsigned)); } } PRE_SYSCALL(accept4)(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2, long arg3) {} POST_SYSCALL(accept4)(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2, long arg3) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); if (arg2) POST_WRITE(arg2, sizeof(unsigned)); } } PRE_SYSCALL(getsockname)(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {} POST_SYSCALL(getsockname)(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); if (arg2) POST_WRITE(arg2, sizeof(unsigned)); } } PRE_SYSCALL(getpeername)(long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) {} POST_SYSCALL(getpeername)(long res, long arg0, sanitizer_kernel_sockaddr *arg1, void *arg2) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); if (arg2) POST_WRITE(arg2, sizeof(unsigned)); } } PRE_SYSCALL(send)(long arg0, void *arg1, long arg2, long arg3) {} POST_SYSCALL(send)(long res, long arg0, void *arg1, long arg2, long arg3) { if (res) { if (arg1) POST_READ(arg1, res); } } PRE_SYSCALL(sendto)(long arg0, void *arg1, long arg2, long arg3, sanitizer_kernel_sockaddr *arg4, long arg5) {} POST_SYSCALL(sendto)(long res, long arg0, void *arg1, long arg2, long arg3, sanitizer_kernel_sockaddr *arg4, long arg5) { if (res >= 0) { if (arg1) POST_READ(arg1, res); if (arg4) POST_WRITE(arg4, sizeof(*arg4)); } } PRE_SYSCALL(sendmsg)(long fd, void *msg, long flags) {} POST_SYSCALL(sendmsg)(long res, long fd, void *msg, long flags) { // FIXME: POST_READ } PRE_SYSCALL(sendmmsg)(long fd, void *msg, long vlen, long flags) {} POST_SYSCALL(sendmmsg)(long res, long fd, void *msg, long vlen, long flags) { // FIXME: POST_READ } PRE_SYSCALL(recv)(long arg0, void *buf, long len, long flags) {} POST_SYSCALL(recv)(long res, void *buf, long len, long flags) { if (res >= 0) { if (buf) POST_WRITE(buf, res); } } PRE_SYSCALL(recvfrom)(long arg0, void *buf, long len, long flags, sanitizer_kernel_sockaddr *arg4, void *arg5) {} POST_SYSCALL(recvfrom)(long res, long arg0, void *buf, long len, long flags, sanitizer_kernel_sockaddr *arg4, void *arg5) { if (res >= 0) { if (buf) POST_WRITE(buf, res); if (arg4) POST_WRITE(arg4, sizeof(*arg4)); if (arg5) POST_WRITE(arg5, sizeof(int)); } } PRE_SYSCALL(socket)(long arg0, long arg1, long arg2) {} POST_SYSCALL(socket)(long res, long arg0, long arg1, long arg2) {} PRE_SYSCALL(socketpair)(long arg0, long arg1, long arg2, int *sv) {} POST_SYSCALL(socketpair)(long res, long arg0, long arg1, long arg2, int *sv) { if (res >= 0) if (sv) POST_WRITE(sv, sizeof(int) * 2); } PRE_SYSCALL(socketcall)(long call, void *args) {} POST_SYSCALL(socketcall)(long res, long call, void *args) { if (res >= 0) { if (args) POST_WRITE(args, sizeof(long)); } } PRE_SYSCALL(listen)(long arg0, long arg1) {} POST_SYSCALL(listen)(long res, long arg0, long arg1) {} PRE_SYSCALL(poll)(void *ufds, long nfds, long timeout) {} POST_SYSCALL(poll)(long res, __sanitizer_pollfd *ufds, long nfds, long timeout) { if (res >= 0) { if (ufds) POST_WRITE(ufds, nfds * sizeof(*ufds)); } } PRE_SYSCALL(select)(long n, __sanitizer___kernel_fd_set *inp, __sanitizer___kernel_fd_set *outp, __sanitizer___kernel_fd_set *exp, void *tvp) {} POST_SYSCALL(select)(long res, long n, __sanitizer___kernel_fd_set *inp, __sanitizer___kernel_fd_set *outp, __sanitizer___kernel_fd_set *exp, void *tvp) { if (res >= 0) { if (inp) POST_WRITE(inp, sizeof(*inp)); if (outp) POST_WRITE(outp, sizeof(*outp)); if (exp) POST_WRITE(exp, sizeof(*exp)); if (tvp) POST_WRITE(tvp, timeval_sz); } } PRE_SYSCALL(old_select)(void *arg) {} POST_SYSCALL(old_select)(long res, void *arg) {} PRE_SYSCALL(epoll_create)(long size) {} POST_SYSCALL(epoll_create)(long res, long size) {} PRE_SYSCALL(epoll_create1)(long flags) {} POST_SYSCALL(epoll_create1)(long res, long flags) {} PRE_SYSCALL(epoll_ctl)(long epfd, long op, long fd, void *event) {} POST_SYSCALL(epoll_ctl)(long res, long epfd, long op, long fd, void *event) { if (res >= 0) { if (event) POST_WRITE(event, struct_epoll_event_sz); } } PRE_SYSCALL(epoll_wait)(long epfd, void *events, long maxevents, long timeout) { } POST_SYSCALL(epoll_wait)(long res, long epfd, void *events, long maxevents, long timeout) { if (res >= 0) { if (events) POST_WRITE(events, struct_epoll_event_sz); } } PRE_SYSCALL(epoll_pwait)(long epfd, void *events, long maxevents, long timeout, const kernel_sigset_t *sigmask, long sigsetsize) { if (sigmask) PRE_READ(sigmask, sigsetsize); } POST_SYSCALL(epoll_pwait)(long res, long epfd, void *events, long maxevents, long timeout, const void *sigmask, long sigsetsize) { if (res >= 0) { if (events) POST_WRITE(events, struct_epoll_event_sz); } } PRE_SYSCALL(gethostname)(void *name, long len) {} POST_SYSCALL(gethostname)(long res, void *name, long len) { if (res >= 0) { if (name) POST_WRITE(name, __sanitizer::internal_strlen((const char *)name) + 1); } } PRE_SYSCALL(sethostname)(void *name, long len) {} POST_SYSCALL(sethostname)(long res, void *name, long len) { if (res >= 0) { if (name) POST_WRITE(name, __sanitizer::internal_strlen((const char *)name) + 1); } } PRE_SYSCALL(setdomainname)(void *name, long len) {} POST_SYSCALL(setdomainname)(long res, void *name, long len) { if (res >= 0) { if (name) POST_WRITE(name, __sanitizer::internal_strlen((const char *)name) + 1); } } PRE_SYSCALL(newuname)(void *name) {} POST_SYSCALL(newuname)(long res, void *name) { if (res >= 0) { if (name) POST_WRITE(name, struct_new_utsname_sz); } } PRE_SYSCALL(uname)(void *arg0) {} POST_SYSCALL(uname)(long res, void *arg0) { if (res >= 0) { if (arg0) POST_WRITE(arg0, struct_old_utsname_sz); } } PRE_SYSCALL(olduname)(void *arg0) {} POST_SYSCALL(olduname)(long res, void *arg0) { if (res >= 0) { if (arg0) POST_WRITE(arg0, struct_oldold_utsname_sz); } } PRE_SYSCALL(getrlimit)(long resource, void *rlim) {} POST_SYSCALL(getrlimit)(long res, long resource, void *rlim) { if (res >= 0) { if (rlim) POST_WRITE(rlim, struct_rlimit_sz); } } PRE_SYSCALL(old_getrlimit)(long resource, void *rlim) {} POST_SYSCALL(old_getrlimit)(long res, long resource, void *rlim) { if (res >= 0) { if (rlim) POST_WRITE(rlim, struct_rlimit_sz); } } PRE_SYSCALL(setrlimit)(long resource, void *rlim) {} POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) { if (res >= 0) { if (rlim) POST_WRITE(rlim, struct_rlimit_sz); } } #if !SANITIZER_ANDROID PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim, void *old_rlim) { if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz); } POST_SYSCALL(prlimit64)(long res, long pid, long resource, const void *new_rlim, void *old_rlim) { if (res >= 0) { if (old_rlim) POST_WRITE(old_rlim, struct_rlimit64_sz); } } #endif PRE_SYSCALL(getrusage)(long who, void *ru) {} POST_SYSCALL(getrusage)(long res, long who, void *ru) { if (res >= 0) { if (ru) POST_WRITE(ru, struct_rusage_sz); } } PRE_SYSCALL(umask)(long mask) {} POST_SYSCALL(umask)(long res, long mask) {} PRE_SYSCALL(msgget)(long key, long msgflg) {} POST_SYSCALL(msgget)(long res, long key, long msgflg) {} PRE_SYSCALL(msgsnd)(long msqid, void *msgp, long msgsz, long msgflg) { if (msgp) PRE_READ(msgp, msgsz); } POST_SYSCALL(msgsnd)(long res, long msqid, void *msgp, long msgsz, long msgflg) {} PRE_SYSCALL(msgrcv)(long msqid, void *msgp, long msgsz, long msgtyp, long msgflg) {} POST_SYSCALL(msgrcv)(long res, long msqid, void *msgp, long msgsz, long msgtyp, long msgflg) { if (res >= 0) { if (msgp) POST_WRITE(msgp, res); } } #if !SANITIZER_ANDROID PRE_SYSCALL(msgctl)(long msqid, long cmd, void *buf) {} POST_SYSCALL(msgctl)(long res, long msqid, long cmd, void *buf) { if (res >= 0) { if (buf) POST_WRITE(buf, struct_msqid_ds_sz); } } #endif PRE_SYSCALL(semget)(long key, long nsems, long semflg) {} POST_SYSCALL(semget)(long res, long key, long nsems, long semflg) {} PRE_SYSCALL(semop)(long semid, void *sops, long nsops) {} POST_SYSCALL(semop)(long res, long semid, void *sops, long nsops) {} PRE_SYSCALL(semctl)(long semid, long semnum, long cmd, void *arg) {} POST_SYSCALL(semctl)(long res, long semid, long semnum, long cmd, void *arg) {} PRE_SYSCALL(semtimedop)(long semid, void *sops, long nsops, const void *timeout) { if (timeout) PRE_READ(timeout, struct_timespec_sz); } POST_SYSCALL(semtimedop)(long res, long semid, void *sops, long nsops, const void *timeout) {} PRE_SYSCALL(shmat)(long shmid, void *shmaddr, long shmflg) {} POST_SYSCALL(shmat)(long res, long shmid, void *shmaddr, long shmflg) { if (res >= 0) { if (shmaddr) POST_WRITE(shmaddr, __sanitizer::internal_strlen((const char *)shmaddr) + 1); } } PRE_SYSCALL(shmget)(long key, long size, long flag) {} POST_SYSCALL(shmget)(long res, long key, long size, long flag) {} PRE_SYSCALL(shmdt)(void *shmaddr) {} POST_SYSCALL(shmdt)(long res, void *shmaddr) { if (res >= 0) { if (shmaddr) POST_WRITE(shmaddr, __sanitizer::internal_strlen((const char *)shmaddr) + 1); } } PRE_SYSCALL(ipc)(long call, long first, long second, long third, void *ptr, long fifth) {} POST_SYSCALL(ipc)(long res, long call, long first, long second, long third, void *ptr, long fifth) {} #if !SANITIZER_ANDROID PRE_SYSCALL(shmctl)(long shmid, long cmd, void *buf) {} POST_SYSCALL(shmctl)(long res, long shmid, long cmd, void *buf) { if (res >= 0) { if (buf) POST_WRITE(buf, sizeof(__sanitizer_shmid_ds)); } } PRE_SYSCALL(mq_open)(const void *name, long oflag, long mode, void *attr) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(mq_open)(long res, const void *name, long oflag, long mode, void *attr) { if (res >= 0) { if (attr) POST_WRITE(attr, struct_mq_attr_sz); } } PRE_SYSCALL(mq_unlink)(const void *name) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(mq_unlink)(long res, const void *name) {} PRE_SYSCALL(mq_timedsend)(long mqdes, const void *msg_ptr, long msg_len, long msg_prio, const void *abs_timeout) { if (msg_ptr) PRE_READ(msg_ptr, msg_len); if (abs_timeout) PRE_READ(abs_timeout, struct_timespec_sz); } POST_SYSCALL(mq_timedsend)(long res, long mqdes, const void *msg_ptr, long msg_len, long msg_prio, const void *abs_timeout) {} PRE_SYSCALL(mq_timedreceive)(long mqdes, void *msg_ptr, long msg_len, void *msg_prio, const void *abs_timeout) { if (abs_timeout) PRE_READ(abs_timeout, struct_timespec_sz); } POST_SYSCALL(mq_timedreceive)(long res, long mqdes, void *msg_ptr, long msg_len, int *msg_prio, const void *abs_timeout) { if (res >= 0) { if (msg_ptr) POST_WRITE(msg_ptr, res); if (msg_prio) POST_WRITE(msg_prio, sizeof(*msg_prio)); } } PRE_SYSCALL(mq_notify)(long mqdes, const void *notification) { if (notification) PRE_READ(notification, struct_sigevent_sz); } POST_SYSCALL(mq_notify)(long res, long mqdes, const void *notification) {} PRE_SYSCALL(mq_getsetattr)(long mqdes, const void *mqstat, void *omqstat) { if (mqstat) PRE_READ(mqstat, struct_mq_attr_sz); } POST_SYSCALL(mq_getsetattr)(long res, long mqdes, const void *mqstat, void *omqstat) { if (res >= 0) { if (omqstat) POST_WRITE(omqstat, struct_mq_attr_sz); } } #endif // SANITIZER_ANDROID PRE_SYSCALL(pciconfig_iobase)(long which, long bus, long devfn) {} POST_SYSCALL(pciconfig_iobase)(long res, long which, long bus, long devfn) {} PRE_SYSCALL(pciconfig_read)(long bus, long dfn, long off, long len, void *buf) { } POST_SYSCALL(pciconfig_read)(long res, long bus, long dfn, long off, long len, void *buf) {} PRE_SYSCALL(pciconfig_write)(long bus, long dfn, long off, long len, void *buf) {} POST_SYSCALL(pciconfig_write)(long res, long bus, long dfn, long off, long len, void *buf) {} PRE_SYSCALL(swapon)(const void *specialfile, long swap_flags) { if (specialfile) PRE_READ(specialfile, __sanitizer::internal_strlen((const char *)specialfile) + 1); } POST_SYSCALL(swapon)(long res, const void *specialfile, long swap_flags) {} PRE_SYSCALL(swapoff)(const void *specialfile) { if (specialfile) PRE_READ(specialfile, __sanitizer::internal_strlen((const char *)specialfile) + 1); } POST_SYSCALL(swapoff)(long res, const void *specialfile) {} PRE_SYSCALL(sysctl)(__sanitizer___sysctl_args *args) { if (args) { if (args->name) PRE_READ(args->name, args->nlen * sizeof(*args->name)); if (args->newval) PRE_READ(args->name, args->newlen); } } POST_SYSCALL(sysctl)(long res, __sanitizer___sysctl_args *args) { if (res >= 0) { if (args && args->oldval && args->oldlenp) { POST_WRITE(args->oldlenp, sizeof(*args->oldlenp)); POST_WRITE(args->oldval, *args->oldlenp); } } } PRE_SYSCALL(sysinfo)(void *info) {} POST_SYSCALL(sysinfo)(long res, void *info) { if (res >= 0) { if (info) POST_WRITE(info, struct_sysinfo_sz); } } PRE_SYSCALL(sysfs)(long option, long arg1, long arg2) {} POST_SYSCALL(sysfs)(long res, long option, long arg1, long arg2) {} PRE_SYSCALL(syslog)(long type, void *buf, long len) {} POST_SYSCALL(syslog)(long res, long type, void *buf, long len) { if (res >= 0) { if (buf) POST_WRITE(buf, __sanitizer::internal_strlen((const char *)buf) + 1); } } PRE_SYSCALL(uselib)(const void *library) { if (library) PRE_READ(library, __sanitizer::internal_strlen((const char *)library) + 1); } POST_SYSCALL(uselib)(long res, const void *library) {} PRE_SYSCALL(ni_syscall)() {} POST_SYSCALL(ni_syscall)(long res) {} PRE_SYSCALL(ptrace)(long request, long pid, long addr, long data) { #if !SANITIZER_ANDROID && \ (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ defined(__powerpc64__) || defined(__aarch64__) || defined(__s390__)) if (data) { if (request == ptrace_setregs) { PRE_READ((void *)data, struct_user_regs_struct_sz); } else if (request == ptrace_setfpregs) { PRE_READ((void *)data, struct_user_fpregs_struct_sz); } else if (request == ptrace_setfpxregs) { PRE_READ((void *)data, struct_user_fpxregs_struct_sz); } else if (request == ptrace_setsiginfo) { PRE_READ((void *)data, siginfo_t_sz); } else if (request == ptrace_setregset) { __sanitizer_iovec *iov = (__sanitizer_iovec *)data; PRE_READ(iov->iov_base, iov->iov_len); } } #endif } POST_SYSCALL(ptrace)(long res, long request, long pid, long addr, long data) { #if !SANITIZER_ANDROID && \ (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ defined(__powerpc64__) || defined(__aarch64__) || defined(__s390__)) if (res >= 0 && data) { // Note that this is different from the interceptor in // sanitizer_common_interceptors.inc. // PEEK* requests return resulting values through data pointer. if (request == ptrace_getregs) { POST_WRITE((void *)data, struct_user_regs_struct_sz); } else if (request == ptrace_getfpregs) { POST_WRITE((void *)data, struct_user_fpregs_struct_sz); } else if (request == ptrace_getfpxregs) { POST_WRITE((void *)data, struct_user_fpxregs_struct_sz); } else if (request == ptrace_getsiginfo) { POST_WRITE((void *)data, siginfo_t_sz); } else if (request == ptrace_getregset) { __sanitizer_iovec *iov = (__sanitizer_iovec *)data; POST_WRITE(iov->iov_base, iov->iov_len); } else if (request == ptrace_peekdata || request == ptrace_peektext || request == ptrace_peekuser) { POST_WRITE((void *)data, sizeof(void *)); } } #endif } PRE_SYSCALL(add_key)(const void *_type, const void *_description, const void *_payload, long plen, long destringid) { if (_type) PRE_READ(_type, __sanitizer::internal_strlen((const char *)_type) + 1); if (_description) PRE_READ(_description, __sanitizer::internal_strlen((const char *)_description) + 1); } POST_SYSCALL(add_key)(long res, const void *_type, const void *_description, const void *_payload, long plen, long destringid) {} PRE_SYSCALL(request_key)(const void *_type, const void *_description, const void *_callout_info, long destringid) { if (_type) PRE_READ(_type, __sanitizer::internal_strlen((const char *)_type) + 1); if (_description) PRE_READ(_description, __sanitizer::internal_strlen((const char *)_description) + 1); if (_callout_info) PRE_READ(_callout_info, __sanitizer::internal_strlen((const char *)_callout_info) + 1); } POST_SYSCALL(request_key)(long res, const void *_type, const void *_description, const void *_callout_info, long destringid) {} PRE_SYSCALL(keyctl)(long cmd, long arg2, long arg3, long arg4, long arg5) {} POST_SYSCALL(keyctl)(long res, long cmd, long arg2, long arg3, long arg4, long arg5) {} PRE_SYSCALL(ioprio_set)(long which, long who, long ioprio) {} POST_SYSCALL(ioprio_set)(long res, long which, long who, long ioprio) {} PRE_SYSCALL(ioprio_get)(long which, long who) {} POST_SYSCALL(ioprio_get)(long res, long which, long who) {} PRE_SYSCALL(set_mempolicy)(long mode, void *nmask, long maxnode) {} POST_SYSCALL(set_mempolicy)(long res, long mode, void *nmask, long maxnode) { if (res >= 0) { if (nmask) POST_WRITE(nmask, sizeof(long)); } } PRE_SYSCALL(migrate_pages)(long pid, long maxnode, const void *from, const void *to) { if (from) PRE_READ(from, sizeof(long)); if (to) PRE_READ(to, sizeof(long)); } POST_SYSCALL(migrate_pages)(long res, long pid, long maxnode, const void *from, const void *to) {} PRE_SYSCALL(move_pages)(long pid, long nr_pages, const void **pages, const int *nodes, int *status, long flags) { if (pages) PRE_READ(pages, nr_pages * sizeof(*pages)); if (nodes) PRE_READ(nodes, nr_pages * sizeof(*nodes)); } POST_SYSCALL(move_pages)(long res, long pid, long nr_pages, const void **pages, const int *nodes, int *status, long flags) { if (res >= 0) { if (status) POST_WRITE(status, nr_pages * sizeof(*status)); } } PRE_SYSCALL(mbind)(long start, long len, long mode, void *nmask, long maxnode, long flags) {} POST_SYSCALL(mbind)(long res, long start, long len, long mode, void *nmask, long maxnode, long flags) { if (res >= 0) { if (nmask) POST_WRITE(nmask, sizeof(long)); } } PRE_SYSCALL(get_mempolicy)(void *policy, void *nmask, long maxnode, long addr, long flags) {} POST_SYSCALL(get_mempolicy)(long res, void *policy, void *nmask, long maxnode, long addr, long flags) { if (res >= 0) { if (policy) POST_WRITE(policy, sizeof(int)); if (nmask) POST_WRITE(nmask, sizeof(long)); } } PRE_SYSCALL(inotify_init)() {} POST_SYSCALL(inotify_init)(long res) {} PRE_SYSCALL(inotify_init1)(long flags) {} POST_SYSCALL(inotify_init1)(long res, long flags) {} PRE_SYSCALL(inotify_add_watch)(long fd, const void *path, long mask) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(inotify_add_watch)(long res, long fd, const void *path, long mask) {} PRE_SYSCALL(inotify_rm_watch)(long fd, long wd) {} POST_SYSCALL(inotify_rm_watch)(long res, long fd, long wd) {} PRE_SYSCALL(spu_run)(long fd, void *unpc, void *ustatus) {} POST_SYSCALL(spu_run)(long res, long fd, unsigned *unpc, unsigned *ustatus) { if (res >= 0) { if (unpc) POST_WRITE(unpc, sizeof(*unpc)); if (ustatus) POST_WRITE(ustatus, sizeof(*ustatus)); } } PRE_SYSCALL(spu_create)(const void *name, long flags, long mode, long fd) { if (name) PRE_READ(name, __sanitizer::internal_strlen((const char *)name) + 1); } POST_SYSCALL(spu_create)(long res, const void *name, long flags, long mode, long fd) {} PRE_SYSCALL(mknodat)(long dfd, const void *filename, long mode, long dev) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(mknodat)(long res, long dfd, const void *filename, long mode, long dev) {} PRE_SYSCALL(mkdirat)(long dfd, const void *pathname, long mode) { if (pathname) PRE_READ(pathname, __sanitizer::internal_strlen((const char *)pathname) + 1); } POST_SYSCALL(mkdirat)(long res, long dfd, const void *pathname, long mode) {} PRE_SYSCALL(unlinkat)(long dfd, const void *pathname, long flag) { if (pathname) PRE_READ(pathname, __sanitizer::internal_strlen((const char *)pathname) + 1); } POST_SYSCALL(unlinkat)(long res, long dfd, const void *pathname, long flag) {} PRE_SYSCALL(symlinkat)(const void *oldname, long newdfd, const void *newname) { if (oldname) PRE_READ(oldname, __sanitizer::internal_strlen((const char *)oldname) + 1); if (newname) PRE_READ(newname, __sanitizer::internal_strlen((const char *)newname) + 1); } POST_SYSCALL(symlinkat)(long res, const void *oldname, long newdfd, const void *newname) {} PRE_SYSCALL(linkat)(long olddfd, const void *oldname, long newdfd, const void *newname, long flags) { if (oldname) PRE_READ(oldname, __sanitizer::internal_strlen((const char *)oldname) + 1); if (newname) PRE_READ(newname, __sanitizer::internal_strlen((const char *)newname) + 1); } POST_SYSCALL(linkat)(long res, long olddfd, const void *oldname, long newdfd, const void *newname, long flags) {} PRE_SYSCALL(renameat)(long olddfd, const void *oldname, long newdfd, const void *newname) { if (oldname) PRE_READ(oldname, __sanitizer::internal_strlen((const char *)oldname) + 1); if (newname) PRE_READ(newname, __sanitizer::internal_strlen((const char *)newname) + 1); } POST_SYSCALL(renameat)(long res, long olddfd, const void *oldname, long newdfd, const void *newname) {} PRE_SYSCALL(futimesat)(long dfd, const void *filename, void *utimes) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(futimesat)(long res, long dfd, const void *filename, void *utimes) { if (res >= 0) { if (utimes) POST_WRITE(utimes, timeval_sz); } } PRE_SYSCALL(faccessat)(long dfd, const void *filename, long mode) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(faccessat)(long res, long dfd, const void *filename, long mode) {} PRE_SYSCALL(fchmodat)(long dfd, const void *filename, long mode) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(fchmodat)(long res, long dfd, const void *filename, long mode) {} PRE_SYSCALL(fchownat)(long dfd, const void *filename, long user, long group, long flag) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(fchownat)(long res, long dfd, const void *filename, long user, long group, long flag) {} PRE_SYSCALL(openat)(long dfd, const void *filename, long flags, long mode) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(openat)(long res, long dfd, const void *filename, long flags, long mode) {} PRE_SYSCALL(newfstatat)(long dfd, const void *filename, void *statbuf, long flag) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(newfstatat)(long res, long dfd, const void *filename, void *statbuf, long flag) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat_sz); } } PRE_SYSCALL(fstatat64)(long dfd, const void *filename, void *statbuf, long flag) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(fstatat64)(long res, long dfd, const void *filename, void *statbuf, long flag) { if (res >= 0) { if (statbuf) POST_WRITE(statbuf, struct_kernel_stat64_sz); } } PRE_SYSCALL(readlinkat)(long dfd, const void *path, void *buf, long bufsiz) { if (path) PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); } POST_SYSCALL(readlinkat)(long res, long dfd, const void *path, void *buf, long bufsiz) { if (res >= 0) { if (buf) POST_WRITE(buf, __sanitizer::internal_strlen((const char *)buf) + 1); } } PRE_SYSCALL(utimensat)(long dfd, const void *filename, void *utimes, long flags) { if (filename) PRE_READ(filename, __sanitizer::internal_strlen((const char *)filename) + 1); } POST_SYSCALL(utimensat)(long res, long dfd, const void *filename, void *utimes, long flags) { if (res >= 0) { if (utimes) POST_WRITE(utimes, struct_timespec_sz); } } PRE_SYSCALL(unshare)(long unshare_flags) {} POST_SYSCALL(unshare)(long res, long unshare_flags) {} PRE_SYSCALL(splice)(long fd_in, void *off_in, long fd_out, void *off_out, long len, long flags) {} POST_SYSCALL(splice)(long res, long fd_in, void *off_in, long fd_out, void *off_out, long len, long flags) { if (res >= 0) { if (off_in) POST_WRITE(off_in, sizeof(long long)); if (off_out) POST_WRITE(off_out, sizeof(long long)); } } PRE_SYSCALL(vmsplice)(long fd, const __sanitizer_iovec *iov, long nr_segs, long flags) {} POST_SYSCALL(vmsplice)(long res, long fd, const __sanitizer_iovec *iov, long nr_segs, long flags) { if (res >= 0) { if (iov) kernel_read_iovec(iov, nr_segs, res); } } PRE_SYSCALL(tee)(long fdin, long fdout, long len, long flags) {} POST_SYSCALL(tee)(long res, long fdin, long fdout, long len, long flags) {} PRE_SYSCALL(get_robust_list)(long pid, void *head_ptr, void *len_ptr) {} POST_SYSCALL(get_robust_list)(long res, long pid, void *head_ptr, void *len_ptr) {} PRE_SYSCALL(set_robust_list)(void *head, long len) {} POST_SYSCALL(set_robust_list)(long res, void *head, long len) {} PRE_SYSCALL(getcpu)(void *cpu, void *node, void *cache) {} POST_SYSCALL(getcpu)(long res, void *cpu, void *node, void *cache) { if (res >= 0) { if (cpu) POST_WRITE(cpu, sizeof(unsigned)); if (node) POST_WRITE(node, sizeof(unsigned)); // The third argument to this system call is nowadays unused. } } PRE_SYSCALL(signalfd)(long ufd, void *user_mask, long sizemask) {} POST_SYSCALL(signalfd)(long res, long ufd, kernel_sigset_t *user_mask, long sizemask) { if (res >= 0) { if (user_mask) POST_WRITE(user_mask, sizemask); } } PRE_SYSCALL(signalfd4)(long ufd, void *user_mask, long sizemask, long flags) {} POST_SYSCALL(signalfd4)(long res, long ufd, kernel_sigset_t *user_mask, long sizemask, long flags) { if (res >= 0) { if (user_mask) POST_WRITE(user_mask, sizemask); } } PRE_SYSCALL(timerfd_create)(long clockid, long flags) {} POST_SYSCALL(timerfd_create)(long res, long clockid, long flags) {} PRE_SYSCALL(timerfd_settime)(long ufd, long flags, const void *utmr, void *otmr) { if (utmr) PRE_READ(utmr, struct_itimerspec_sz); } POST_SYSCALL(timerfd_settime)(long res, long ufd, long flags, const void *utmr, void *otmr) { if (res >= 0) { if (otmr) POST_WRITE(otmr, struct_itimerspec_sz); } } PRE_SYSCALL(timerfd_gettime)(long ufd, void *otmr) {} POST_SYSCALL(timerfd_gettime)(long res, long ufd, void *otmr) { if (res >= 0) { if (otmr) POST_WRITE(otmr, struct_itimerspec_sz); } } PRE_SYSCALL(eventfd)(long count) {} POST_SYSCALL(eventfd)(long res, long count) {} PRE_SYSCALL(eventfd2)(long count, long flags) {} POST_SYSCALL(eventfd2)(long res, long count, long flags) {} PRE_SYSCALL(old_readdir)(long arg0, void *arg1, long arg2) {} POST_SYSCALL(old_readdir)(long res, long arg0, void *arg1, long arg2) { // Missing definition of 'struct old_linux_dirent'. } PRE_SYSCALL(pselect6)(long arg0, __sanitizer___kernel_fd_set *arg1, __sanitizer___kernel_fd_set *arg2, __sanitizer___kernel_fd_set *arg3, void *arg4, void *arg5) {} POST_SYSCALL(pselect6)(long res, long arg0, __sanitizer___kernel_fd_set *arg1, __sanitizer___kernel_fd_set *arg2, __sanitizer___kernel_fd_set *arg3, void *arg4, void *arg5) { if (res >= 0) { if (arg1) POST_WRITE(arg1, sizeof(*arg1)); if (arg2) POST_WRITE(arg2, sizeof(*arg2)); if (arg3) POST_WRITE(arg3, sizeof(*arg3)); if (arg4) POST_WRITE(arg4, struct_timespec_sz); } } PRE_SYSCALL(ppoll)(__sanitizer_pollfd *arg0, long arg1, void *arg2, const kernel_sigset_t *arg3, long arg4) { if (arg3) PRE_READ(arg3, arg4); } POST_SYSCALL(ppoll)(long res, __sanitizer_pollfd *arg0, long arg1, void *arg2, const void *arg3, long arg4) { if (res >= 0) { if (arg0) POST_WRITE(arg0, sizeof(*arg0)); if (arg2) POST_WRITE(arg2, struct_timespec_sz); } } PRE_SYSCALL(syncfs)(long fd) {} POST_SYSCALL(syncfs)(long res, long fd) {} PRE_SYSCALL(perf_event_open)(__sanitizer_perf_event_attr *attr_uptr, long pid, long cpu, long group_fd, long flags) { if (attr_uptr) PRE_READ(attr_uptr, attr_uptr->size); } POST_SYSCALL(perf_event_open)(long res, __sanitizer_perf_event_attr *attr_uptr, long pid, long cpu, long group_fd, long flags) {} PRE_SYSCALL(mmap_pgoff)(long addr, long len, long prot, long flags, long fd, long pgoff) {} POST_SYSCALL(mmap_pgoff)(long res, long addr, long len, long prot, long flags, long fd, long pgoff) {} PRE_SYSCALL(old_mmap)(void *arg) {} POST_SYSCALL(old_mmap)(long res, void *arg) {} PRE_SYSCALL(name_to_handle_at)(long dfd, const void *name, void *handle, void *mnt_id, long flag) {} POST_SYSCALL(name_to_handle_at)(long res, long dfd, const void *name, void *handle, void *mnt_id, long flag) {} PRE_SYSCALL(open_by_handle_at)(long mountdirfd, void *handle, long flags) {} POST_SYSCALL(open_by_handle_at)(long res, long mountdirfd, void *handle, long flags) {} PRE_SYSCALL(setns)(long fd, long nstype) {} POST_SYSCALL(setns)(long res, long fd, long nstype) {} PRE_SYSCALL(process_vm_readv)(long pid, const __sanitizer_iovec *lvec, long liovcnt, const void *rvec, long riovcnt, long flags) {} POST_SYSCALL(process_vm_readv)(long res, long pid, const __sanitizer_iovec *lvec, long liovcnt, const void *rvec, long riovcnt, long flags) { if (res >= 0) { if (lvec) kernel_write_iovec(lvec, liovcnt, res); } } PRE_SYSCALL(process_vm_writev)(long pid, const __sanitizer_iovec *lvec, long liovcnt, const void *rvec, long riovcnt, long flags) {} POST_SYSCALL(process_vm_writev)(long res, long pid, const __sanitizer_iovec *lvec, long liovcnt, const void *rvec, long riovcnt, long flags) { if (res >= 0) { if (lvec) kernel_read_iovec(lvec, liovcnt, res); } } PRE_SYSCALL(fork)() { COMMON_SYSCALL_PRE_FORK(); } POST_SYSCALL(fork)(long res) { COMMON_SYSCALL_POST_FORK(res); } PRE_SYSCALL(vfork)() { COMMON_SYSCALL_PRE_FORK(); } POST_SYSCALL(vfork)(long res) { COMMON_SYSCALL_POST_FORK(res); } PRE_SYSCALL(sigaction)(long signum, const __sanitizer_kernel_sigaction_t *act, __sanitizer_kernel_sigaction_t *oldact) { if (act) { PRE_READ(&act->sigaction, sizeof(act->sigaction)); PRE_READ(&act->sa_flags, sizeof(act->sa_flags)); PRE_READ(&act->sa_mask, sizeof(act->sa_mask)); } } POST_SYSCALL(sigaction)(long res, long signum, const __sanitizer_kernel_sigaction_t *act, __sanitizer_kernel_sigaction_t *oldact) { if (res >= 0 && oldact) POST_WRITE(oldact, sizeof(*oldact)); } PRE_SYSCALL(rt_sigaction)(long signum, const __sanitizer_kernel_sigaction_t *act, __sanitizer_kernel_sigaction_t *oldact, SIZE_T sz) { if (act) { PRE_READ(&act->sigaction, sizeof(act->sigaction)); PRE_READ(&act->sa_flags, sizeof(act->sa_flags)); PRE_READ(&act->sa_mask, sz); } } POST_SYSCALL(rt_sigaction)(long res, long signum, const __sanitizer_kernel_sigaction_t *act, __sanitizer_kernel_sigaction_t *oldact, SIZE_T sz) { if (res >= 0 && oldact) { SIZE_T oldact_sz = ((char *)&oldact->sa_mask) - ((char *)oldact) + sz; POST_WRITE(oldact, oldact_sz); } } } // extern "C" #undef PRE_SYSCALL #undef PRE_READ #undef PRE_WRITE #undef POST_SYSCALL #undef POST_READ #undef POST_WRITE #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common.cc0000664000175000017500000003445413004730632031226 0ustar mwhudsonmwhudson//===-- sanitizer_common.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_common.h" #include "sanitizer_allocator_interface.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_flags.h" #include "sanitizer_libc.h" #include "sanitizer_placement_new.h" #include "sanitizer_stacktrace_printer.h" #include "sanitizer_symbolizer.h" namespace __sanitizer { const char *SanitizerToolName = "SanitizerTool"; atomic_uint32_t current_verbosity; uptr PageSizeCached; StaticSpinMutex report_file_mu; ReportFile report_file = {&report_file_mu, kStderrFd, "", "", 0}; void RawWrite(const char *buffer) { report_file.Write(buffer, internal_strlen(buffer)); } void ReportFile::ReopenIfNecessary() { mu->CheckLocked(); if (fd == kStdoutFd || fd == kStderrFd) return; uptr pid = internal_getpid(); // If in tracer, use the parent's file. if (pid == stoptheworld_tracer_pid) pid = stoptheworld_tracer_ppid; if (fd != kInvalidFd) { // If the report file is already opened by the current process, // do nothing. Otherwise the report file was opened by the parent // process, close it now. if (fd_pid == pid) return; else CloseFile(fd); } const char *exe_name = GetProcessName(); if (common_flags()->log_exe_name && exe_name) { internal_snprintf(full_path, kMaxPathLength, "%s.%s.%zu", path_prefix, exe_name, pid); } else { internal_snprintf(full_path, kMaxPathLength, "%s.%zu", path_prefix, pid); } fd = OpenFile(full_path, WrOnly); if (fd == kInvalidFd) { const char *ErrorMsgPrefix = "ERROR: Can't open file: "; WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix)); WriteToFile(kStderrFd, full_path, internal_strlen(full_path)); Die(); } fd_pid = pid; } void ReportFile::SetReportPath(const char *path) { if (!path) return; uptr len = internal_strlen(path); if (len > sizeof(path_prefix) - 100) { Report("ERROR: Path is too long: %c%c%c%c%c%c%c%c...\n", path[0], path[1], path[2], path[3], path[4], path[5], path[6], path[7]); Die(); } SpinMutexLock l(mu); if (fd != kStdoutFd && fd != kStderrFd && fd != kInvalidFd) CloseFile(fd); fd = kInvalidFd; if (internal_strcmp(path, "stdout") == 0) { fd = kStdoutFd; } else if (internal_strcmp(path, "stderr") == 0) { fd = kStderrFd; } else { internal_snprintf(path_prefix, kMaxPathLength, "%s", path); } } // PID of the tracer task in StopTheWorld. It shares the address space with the // main process, but has a different PID and thus requires special handling. uptr stoptheworld_tracer_pid = 0; // Cached pid of parent process - if the parent process dies, we want to keep // writing to the same log file. uptr stoptheworld_tracer_ppid = 0; void NORETURN ReportMmapFailureAndDie(uptr size, const char *mem_type, const char *mmap_type, error_t err, bool raw_report) { static int recursion_count; if (raw_report || recursion_count) { // If raw report is requested or we went into recursion, just die. // The Report() and CHECK calls below may call mmap recursively and fail. RawWrite("ERROR: Failed to mmap\n"); Die(); } recursion_count++; Report("ERROR: %s failed to " "%s 0x%zx (%zd) bytes of %s (error code: %d)\n", SanitizerToolName, mmap_type, size, size, mem_type, err); #if !SANITIZER_GO DumpProcessMap(); #endif UNREACHABLE("unable to mmap"); } bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size, uptr *read_len, uptr max_len, error_t *errno_p) { uptr PageSize = GetPageSizeCached(); uptr kMinFileLen = PageSize; *buff = nullptr; *buff_size = 0; *read_len = 0; // The files we usually open are not seekable, so try different buffer sizes. for (uptr size = kMinFileLen; size <= max_len; size *= 2) { fd_t fd = OpenFile(file_name, RdOnly, errno_p); if (fd == kInvalidFd) return false; UnmapOrDie(*buff, *buff_size); *buff = (char*)MmapOrDie(size, __func__); *buff_size = size; *read_len = 0; // Read up to one page at a time. bool reached_eof = false; while (*read_len + PageSize <= size) { uptr just_read; if (!ReadFromFile(fd, *buff + *read_len, PageSize, &just_read, errno_p)) { UnmapOrDie(*buff, *buff_size); return false; } if (just_read == 0) { reached_eof = true; break; } *read_len += just_read; } CloseFile(fd); if (reached_eof) // We've read the whole file. break; } return true; } typedef bool UptrComparisonFunction(const uptr &a, const uptr &b); typedef bool U32ComparisonFunction(const u32 &a, const u32 &b); template static inline bool CompareLess(const T &a, const T &b) { return a < b; } void SortArray(uptr *array, uptr size) { InternalSort(&array, size, CompareLess); } void SortArray(u32 *array, uptr size) { InternalSort(&array, size, CompareLess); } const char *StripPathPrefix(const char *filepath, const char *strip_path_prefix) { if (!filepath) return nullptr; if (!strip_path_prefix) return filepath; const char *res = filepath; if (const char *pos = internal_strstr(filepath, strip_path_prefix)) res = pos + internal_strlen(strip_path_prefix); if (res[0] == '.' && res[1] == '/') res += 2; return res; } const char *StripModuleName(const char *module) { if (!module) return nullptr; if (SANITIZER_WINDOWS) { // On Windows, both slash and backslash are possible. // Pick the one that goes last. if (const char *bslash_pos = internal_strrchr(module, '\\')) return StripModuleName(bslash_pos + 1); } if (const char *slash_pos = internal_strrchr(module, '/')) { return slash_pos + 1; } return module; } void ReportErrorSummary(const char *error_message) { if (!common_flags()->print_summary) return; InternalScopedString buff(kMaxSummaryLength); buff.append("SUMMARY: %s: %s", SanitizerToolName, error_message); __sanitizer_report_error_summary(buff.data()); } #if !SANITIZER_GO void ReportErrorSummary(const char *error_type, const AddressInfo &info) { if (!common_flags()->print_summary) return; InternalScopedString buff(kMaxSummaryLength); buff.append("%s ", error_type); RenderFrame(&buff, "%L %F", 0, info, common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix); ReportErrorSummary(buff.data()); } #endif // Removes the ANSI escape sequences from the input string (in-place). void RemoveANSIEscapeSequencesFromString(char *str) { if (!str) return; // We are going to remove the escape sequences in place. char *s = str; char *z = str; while (*s != '\0') { CHECK_GE(s, z); // Skip over ANSI escape sequences with pointer 's'. if (*s == '\033' && *(s + 1) == '[') { s = internal_strchrnul(s, 'm'); if (*s == '\0') { break; } s++; continue; } // 's' now points at a character we want to keep. Copy over the buffer // content if the escape sequence has been perviously skipped andadvance // both pointers. if (s != z) *z = *s; // If we have not seen an escape sequence, just advance both pointers. z++; s++; } // Null terminate the string. *z = '\0'; } void LoadedModule::set(const char *module_name, uptr base_address) { clear(); full_name_ = internal_strdup(module_name); base_address_ = base_address; } void LoadedModule::clear() { InternalFree(full_name_); full_name_ = nullptr; while (!ranges_.empty()) { AddressRange *r = ranges_.front(); ranges_.pop_front(); InternalFree(r); } } void LoadedModule::addAddressRange(uptr beg, uptr end, bool executable) { void *mem = InternalAlloc(sizeof(AddressRange)); AddressRange *r = new(mem) AddressRange(beg, end, executable); ranges_.push_back(r); } bool LoadedModule::containsAddress(uptr address) const { for (const AddressRange &r : ranges()) { if (r.beg <= address && address < r.end) return true; } return false; } static atomic_uintptr_t g_total_mmaped; void IncreaseTotalMmap(uptr size) { if (!common_flags()->mmap_limit_mb) return; uptr total_mmaped = atomic_fetch_add(&g_total_mmaped, size, memory_order_relaxed) + size; // Since for now mmap_limit_mb is not a user-facing flag, just kill // a program. Use RAW_CHECK to avoid extra mmaps in reporting. RAW_CHECK((total_mmaped >> 20) < common_flags()->mmap_limit_mb); } void DecreaseTotalMmap(uptr size) { if (!common_flags()->mmap_limit_mb) return; atomic_fetch_sub(&g_total_mmaped, size, memory_order_relaxed); } bool TemplateMatch(const char *templ, const char *str) { if ((!str) || str[0] == 0) return false; bool start = false; if (templ && templ[0] == '^') { start = true; templ++; } bool asterisk = false; while (templ && templ[0]) { if (templ[0] == '*') { templ++; start = false; asterisk = true; continue; } if (templ[0] == '$') return str[0] == 0 || asterisk; if (str[0] == 0) return false; char *tpos = (char*)internal_strchr(templ, '*'); char *tpos1 = (char*)internal_strchr(templ, '$'); if ((!tpos) || (tpos1 && tpos1 < tpos)) tpos = tpos1; if (tpos) tpos[0] = 0; const char *str0 = str; const char *spos = internal_strstr(str, templ); str = spos + internal_strlen(templ); templ = tpos; if (tpos) tpos[0] = tpos == tpos1 ? '$' : '*'; if (!spos) return false; if (start && spos != str0) return false; start = false; asterisk = false; } return true; } static const char kPathSeparator = SANITIZER_WINDOWS ? ';' : ':'; char *FindPathToBinary(const char *name) { if (FileExists(name)) { return internal_strdup(name); } const char *path = GetEnv("PATH"); if (!path) return nullptr; uptr name_len = internal_strlen(name); InternalScopedBuffer buffer(kMaxPathLength); const char *beg = path; while (true) { const char *end = internal_strchrnul(beg, kPathSeparator); uptr prefix_len = end - beg; if (prefix_len + name_len + 2 <= kMaxPathLength) { internal_memcpy(buffer.data(), beg, prefix_len); buffer[prefix_len] = '/'; internal_memcpy(&buffer[prefix_len + 1], name, name_len); buffer[prefix_len + 1 + name_len] = '\0'; if (FileExists(buffer.data())) return internal_strdup(buffer.data()); } if (*end == '\0') break; beg = end + 1; } return nullptr; } static char binary_name_cache_str[kMaxPathLength]; static char process_name_cache_str[kMaxPathLength]; const char *GetProcessName() { return process_name_cache_str; } static uptr ReadProcessName(/*out*/ char *buf, uptr buf_len) { ReadLongProcessName(buf, buf_len); char *s = const_cast(StripModuleName(buf)); uptr len = internal_strlen(s); if (s != buf) { internal_memmove(buf, s, len); buf[len] = '\0'; } return len; } void UpdateProcessName() { ReadProcessName(process_name_cache_str, sizeof(process_name_cache_str)); } // Call once to make sure that binary_name_cache_str is initialized void CacheBinaryName() { if (binary_name_cache_str[0] != '\0') return; ReadBinaryName(binary_name_cache_str, sizeof(binary_name_cache_str)); ReadProcessName(process_name_cache_str, sizeof(process_name_cache_str)); } uptr ReadBinaryNameCached(/*out*/char *buf, uptr buf_len) { CacheBinaryName(); uptr name_len = internal_strlen(binary_name_cache_str); name_len = (name_len < buf_len - 1) ? name_len : buf_len - 1; if (buf_len == 0) return 0; internal_memcpy(buf, binary_name_cache_str, name_len); buf[name_len] = '\0'; return name_len; } void PrintCmdline() { char **argv = GetArgv(); if (!argv) return; Printf("\nCommand: "); for (uptr i = 0; argv[i]; ++i) Printf("%s ", argv[i]); Printf("\n\n"); } // Malloc hooks. static const int kMaxMallocFreeHooks = 5; struct MallocFreeHook { void (*malloc_hook)(const void *, uptr); void (*free_hook)(const void *); }; static MallocFreeHook MFHooks[kMaxMallocFreeHooks]; void RunMallocHooks(const void *ptr, uptr size) { for (int i = 0; i < kMaxMallocFreeHooks; i++) { auto hook = MFHooks[i].malloc_hook; if (!hook) return; hook(ptr, size); } } void RunFreeHooks(const void *ptr) { for (int i = 0; i < kMaxMallocFreeHooks; i++) { auto hook = MFHooks[i].free_hook; if (!hook) return; hook(ptr); } } static int InstallMallocFreeHooks(void (*malloc_hook)(const void *, uptr), void (*free_hook)(const void *)) { if (!malloc_hook || !free_hook) return 0; for (int i = 0; i < kMaxMallocFreeHooks; i++) { if (MFHooks[i].malloc_hook == nullptr) { MFHooks[i].malloc_hook = malloc_hook; MFHooks[i].free_hook = free_hook; return i + 1; } } return 0; } } // namespace __sanitizer using namespace __sanitizer; // NOLINT extern "C" { void __sanitizer_set_report_path(const char *path) { report_file.SetReportPath(path); } void __sanitizer_set_report_fd(void *fd) { report_file.fd = (fd_t)reinterpret_cast(fd); report_file.fd_pid = internal_getpid(); } void __sanitizer_report_error_summary(const char *error_summary) { Printf("%s\n", error_summary); } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_set_death_callback(void (*callback)(void)) { SetUserDieCallback(callback); } SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_install_malloc_and_free_hooks(void (*malloc_hook)(const void *, uptr), void (*free_hook)(const void *)) { return InstallMallocFreeHooks(malloc_hook, free_hook); } #if !SANITIZER_GO && !SANITIZER_SUPPORTS_WEAK_HOOKS SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_print_memory_profile(int top_percent) { (void)top_percent; } #endif } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_win.cc0000664000175000017500000002426412742215165033017 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_win.cc ---------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // Windows-specific implementation of symbolizer parts. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_WINDOWS #define WIN32_LEAN_AND_MEAN #include #include #pragma comment(lib, "dbghelp.lib") #include "sanitizer_symbolizer_internal.h" namespace __sanitizer { namespace { class WinSymbolizerTool : public SymbolizerTool { public: bool SymbolizePC(uptr addr, SymbolizedStack *stack) override; bool SymbolizeData(uptr addr, DataInfo *info) override { return false; } const char *Demangle(const char *name) override; }; bool is_dbghelp_initialized = false; bool TrySymInitialize() { SymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME | SYMOPT_LOAD_LINES); return SymInitialize(GetCurrentProcess(), 0, TRUE); // FIXME: We don't call SymCleanup() on exit yet - should we? } } // namespace // Initializes DbgHelp library, if it's not yet initialized. Calls to this // function should be synchronized with respect to other calls to DbgHelp API // (e.g. from WinSymbolizerTool). void InitializeDbgHelpIfNeeded() { if (is_dbghelp_initialized) return; if (!TrySymInitialize()) { // OK, maybe the client app has called SymInitialize already. // That's a bit unfortunate for us as all the DbgHelp functions are // single-threaded and we can't coordinate with the app. // FIXME: Can we stop the other threads at this point? // Anyways, we have to reconfigure stuff to make sure that SymInitialize // has all the appropriate options set. // Cross our fingers and reinitialize DbgHelp. Report("*** WARNING: Failed to initialize DbgHelp! ***\n"); Report("*** Most likely this means that the app is already ***\n"); Report("*** using DbgHelp, possibly with incompatible flags. ***\n"); Report("*** Due to technical reasons, symbolization might crash ***\n"); Report("*** or produce wrong results. ***\n"); SymCleanup(GetCurrentProcess()); TrySymInitialize(); } is_dbghelp_initialized = true; // When an executable is run from a location different from the one where it // was originally built, we may not see the nearby PDB files. // To work around this, let's append the directory of the main module // to the symbol search path. All the failures below are not fatal. const size_t kSymPathSize = 2048; static wchar_t path_buffer[kSymPathSize + 1 + MAX_PATH]; if (!SymGetSearchPathW(GetCurrentProcess(), path_buffer, kSymPathSize)) { Report("*** WARNING: Failed to SymGetSearchPathW ***\n"); return; } size_t sz = wcslen(path_buffer); if (sz) { CHECK_EQ(0, wcscat_s(path_buffer, L";")); sz++; } DWORD res = GetModuleFileNameW(NULL, path_buffer + sz, MAX_PATH); if (res == 0 || res == MAX_PATH) { Report("*** WARNING: Failed to getting the EXE directory ***\n"); return; } // Write the zero character in place of the last backslash to get the // directory of the main module at the end of path_buffer. wchar_t *last_bslash = wcsrchr(path_buffer + sz, L'\\'); CHECK_NE(last_bslash, 0); *last_bslash = L'\0'; if (!SymSetSearchPathW(GetCurrentProcess(), path_buffer)) { Report("*** WARNING: Failed to SymSetSearchPathW\n"); return; } } bool WinSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *frame) { InitializeDbgHelpIfNeeded(); // See http://msdn.microsoft.com/en-us/library/ms680578(VS.85).aspx char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(CHAR)]; PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); symbol->MaxNameLen = MAX_SYM_NAME; DWORD64 offset = 0; BOOL got_objname = SymFromAddr(GetCurrentProcess(), (DWORD64)addr, &offset, symbol); if (!got_objname) return false; DWORD unused; IMAGEHLP_LINE64 line_info; line_info.SizeOfStruct = sizeof(IMAGEHLP_LINE64); BOOL got_fileline = SymGetLineFromAddr64(GetCurrentProcess(), (DWORD64)addr, &unused, &line_info); frame->info.function = internal_strdup(symbol->Name); frame->info.function_offset = (uptr)offset; if (got_fileline) { frame->info.file = internal_strdup(line_info.FileName); frame->info.line = line_info.LineNumber; } // Only consider this a successful symbolization attempt if we got file info. // Otherwise, try llvm-symbolizer. return got_fileline; } const char *WinSymbolizerTool::Demangle(const char *name) { CHECK(is_dbghelp_initialized); static char demangle_buffer[1000]; if (name[0] == '\01' && UnDecorateSymbolName(name + 1, demangle_buffer, sizeof(demangle_buffer), UNDNAME_NAME_ONLY)) return demangle_buffer; else return name; } const char *Symbolizer::PlatformDemangle(const char *name) { return name; } void Symbolizer::PlatformPrepareForSandboxing() { // Do nothing. } namespace { struct ScopedHandle { ScopedHandle() : h_(nullptr) {} explicit ScopedHandle(HANDLE h) : h_(h) {} ~ScopedHandle() { if (h_) ::CloseHandle(h_); } HANDLE get() { return h_; } HANDLE *receive() { return &h_; } HANDLE release() { HANDLE h = h_; h_ = nullptr; return h; } HANDLE h_; }; } // namespace bool SymbolizerProcess::StartSymbolizerSubprocess() { // Create inherited pipes for stdin and stdout. ScopedHandle stdin_read, stdin_write; ScopedHandle stdout_read, stdout_write; SECURITY_ATTRIBUTES attrs; attrs.nLength = sizeof(SECURITY_ATTRIBUTES); attrs.bInheritHandle = TRUE; attrs.lpSecurityDescriptor = nullptr; if (!::CreatePipe(stdin_read.receive(), stdin_write.receive(), &attrs, 0) || !::CreatePipe(stdout_read.receive(), stdout_write.receive(), &attrs, 0)) { VReport(2, "WARNING: %s CreatePipe failed (error code: %d)\n", SanitizerToolName, path_, GetLastError()); return false; } // Don't inherit the writing end of stdin or the reading end of stdout. if (!SetHandleInformation(stdin_write.get(), HANDLE_FLAG_INHERIT, 0) || !SetHandleInformation(stdout_read.get(), HANDLE_FLAG_INHERIT, 0)) { VReport(2, "WARNING: %s SetHandleInformation failed (error code: %d)\n", SanitizerToolName, path_, GetLastError()); return false; } // Compute the command line. Wrap double quotes around everything. const char *argv[kArgVMax]; GetArgV(path_, argv); InternalScopedString command_line(kMaxPathLength * 3); for (int i = 0; argv[i]; i++) { const char *arg = argv[i]; int arglen = internal_strlen(arg); // Check that tool command lines are simple and that complete escaping is // unnecessary. CHECK(!internal_strchr(arg, '"') && "quotes in args unsupported"); CHECK(!internal_strstr(arg, "\\\\") && "double backslashes in args unsupported"); CHECK(arglen > 0 && arg[arglen - 1] != '\\' && "args ending in backslash and empty args unsupported"); command_line.append("\"%s\" ", arg); } VReport(3, "Launching symbolizer command: %s\n", command_line.data()); // Launch llvm-symbolizer with stdin and stdout redirected. STARTUPINFOA si; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); si.dwFlags |= STARTF_USESTDHANDLES; si.hStdInput = stdin_read.get(); si.hStdOutput = stdout_write.get(); PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); if (!CreateProcessA(path_, // Executable command_line.data(), // Command line nullptr, // Process handle not inheritable nullptr, // Thread handle not inheritable TRUE, // Set handle inheritance to TRUE 0, // Creation flags nullptr, // Use parent's environment block nullptr, // Use parent's starting directory &si, &pi)) { VReport(2, "WARNING: %s failed to create process for %s (error code: %d)\n", SanitizerToolName, path_, GetLastError()); return false; } // Process creation succeeded, so transfer handle ownership into the fields. input_fd_ = stdout_read.release(); output_fd_ = stdin_write.release(); // The llvm-symbolizer process is responsible for quitting itself when the // stdin pipe is closed, so we don't need these handles. Close them to prevent // leaks. If we ever want to try to kill the symbolizer process from the // parent, we'll want to hang on to these handles. CloseHandle(pi.hProcess); CloseHandle(pi.hThread); return true; } static void ChooseSymbolizerTools(IntrusiveList *list, LowLevelAllocator *allocator) { if (!common_flags()->symbolize) { VReport(2, "Symbolizer is disabled.\n"); return; } // Add llvm-symbolizer in case the binary has dwarf. const char *user_path = common_flags()->external_symbolizer_path; const char *path = user_path ? user_path : FindPathToBinary("llvm-symbolizer.exe"); if (path) { VReport(2, "Using llvm-symbolizer at %spath: %s\n", user_path ? "user-specified " : "", path); list->push_back(new(*allocator) LLVMSymbolizer(path, allocator)); } else { if (user_path && user_path[0] == '\0') { VReport(2, "External symbolizer is explicitly disabled.\n"); } else { VReport(2, "External symbolizer is not present.\n"); } } // Add the dbghelp based symbolizer. list->push_back(new(*allocator) WinSymbolizerTool()); } Symbolizer *Symbolizer::PlatformInit() { IntrusiveList list; list.clear(); ChooseSymbolizerTools(&list, &symbolizer_allocator_); return new(symbolizer_allocator_) Symbolizer(list); } void Symbolizer::LateInitialize() { Symbolizer::GetOrInit(); } } // namespace __sanitizer #endif // _WIN32 golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc0000664000175000017500000001011412767771650033553 0ustar mwhudsonmwhudson//===-- sanitizer_stacktrace_libcdep.cc -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_common.h" #include "sanitizer_placement_new.h" #include "sanitizer_stacktrace.h" #include "sanitizer_stacktrace_printer.h" #include "sanitizer_symbolizer.h" namespace __sanitizer { void StackTrace::Print() const { if (trace == nullptr || size == 0) { Printf(" \n\n"); return; } InternalScopedString frame_desc(GetPageSizeCached() * 2); InternalScopedString dedup_token(GetPageSizeCached()); int dedup_frames = common_flags()->dedup_token_length; uptr frame_num = 0; for (uptr i = 0; i < size && trace[i]; i++) { // PCs in stack traces are actually the return addresses, that is, // addresses of the next instructions after the call. uptr pc = GetPreviousInstructionPc(trace[i]); SymbolizedStack *frames = Symbolizer::GetOrInit()->SymbolizePC(pc); CHECK(frames); for (SymbolizedStack *cur = frames; cur; cur = cur->next) { frame_desc.clear(); RenderFrame(&frame_desc, common_flags()->stack_trace_format, frame_num++, cur->info, common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix); Printf("%s\n", frame_desc.data()); if (dedup_frames-- > 0) { if (dedup_token.length()) dedup_token.append("--"); dedup_token.append(cur->info.function); } } frames->ClearAll(); } // Always print a trailing empty line after stack trace. Printf("\n"); if (dedup_token.length()) Printf("DEDUP_TOKEN: %s\n", dedup_token.data()); } void BufferedStackTrace::Unwind(u32 max_depth, uptr pc, uptr bp, void *context, uptr stack_top, uptr stack_bottom, bool request_fast_unwind) { top_frame_bp = (max_depth > 0) ? bp : 0; // Avoid doing any work for small max_depth. if (max_depth == 0) { size = 0; return; } if (max_depth == 1) { size = 1; trace_buffer[0] = pc; return; } if (!WillUseFastUnwind(request_fast_unwind)) { #if SANITIZER_CAN_SLOW_UNWIND if (context) SlowUnwindStackWithContext(pc, context, max_depth); else SlowUnwindStack(pc, max_depth); #else UNREACHABLE("slow unwind requested but not available"); #endif } else { FastUnwindStack(pc, bp, stack_top, stack_bottom, max_depth); } } } // namespace __sanitizer using namespace __sanitizer; extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_symbolize_pc(uptr pc, const char *fmt, char *out_buf, uptr out_buf_size) { if (!out_buf_size) return; pc = StackTrace::GetPreviousInstructionPc(pc); SymbolizedStack *frame = Symbolizer::GetOrInit()->SymbolizePC(pc); if (!frame) { internal_strncpy(out_buf, "", out_buf_size); out_buf[out_buf_size - 1] = 0; return; } InternalScopedString frame_desc(GetPageSizeCached()); RenderFrame(&frame_desc, fmt, 0, frame->info, common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix); internal_strncpy(out_buf, frame_desc.data(), out_buf_size); out_buf[out_buf_size - 1] = 0; } SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_symbolize_global(uptr data_addr, const char *fmt, char *out_buf, uptr out_buf_size) { if (!out_buf_size) return; out_buf[0] = 0; DataInfo DI; if (!Symbolizer::GetOrInit()->SymbolizeData(data_addr, &DI)) return; InternalScopedString data_desc(GetPageSizeCached()); RenderData(&data_desc, fmt, &DI, common_flags()->strip_path_prefix); internal_strncpy(out_buf, data_desc.data(), out_buf_size); out_buf[out_buf_size - 1] = 0; } } // extern "C" ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_posix_libcd0000664000175000017500000004135012773316446034140 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_posix_libcdep.cc -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // POSIX-specific implementation of symbolizer parts. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_POSIX #include "sanitizer_allocator_internal.h" #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_internal_defs.h" #include "sanitizer_linux.h" #include "sanitizer_placement_new.h" #include "sanitizer_posix.h" #include "sanitizer_procmaps.h" #include "sanitizer_symbolizer_internal.h" #include "sanitizer_symbolizer_libbacktrace.h" #include "sanitizer_symbolizer_mac.h" #include // for dlsym() #include #include #include #include #include #if SANITIZER_MAC #include // for forkpty() #endif // SANITIZER_MAC // C++ demangling function, as required by Itanium C++ ABI. This is weak, // because we do not require a C++ ABI library to be linked to a program // using sanitizers; if it's not present, we'll just use the mangled name. namespace __cxxabiv1 { extern "C" SANITIZER_WEAK_ATTRIBUTE char *__cxa_demangle(const char *mangled, char *buffer, size_t *length, int *status); } namespace __sanitizer { // Attempts to demangle the name via __cxa_demangle from __cxxabiv1. const char *DemangleCXXABI(const char *name) { // FIXME: __cxa_demangle aggressively insists on allocating memory. // There's not much we can do about that, short of providing our // own demangler (libc++abi's implementation could be adapted so that // it does not allocate). For now, we just call it anyway, and we leak // the returned value. if (__cxxabiv1::__cxa_demangle) if (const char *demangled_name = __cxxabiv1::__cxa_demangle(name, 0, 0, 0)) return demangled_name; return name; } // As of now, there are no headers for the Swift runtime. Once they are // present, we will weakly link since we do not require Swift runtime to be // linked. typedef char *(*swift_demangle_ft)(const char *mangledName, size_t mangledNameLength, char *outputBuffer, size_t *outputBufferSize, uint32_t flags); static swift_demangle_ft swift_demangle_f; // This must not happen lazily at symbolication time, because dlsym uses // malloc and thread-local storage, which is not a good thing to do during // symbolication. static void InitializeSwiftDemangler() { swift_demangle_f = (swift_demangle_ft)dlsym(RTLD_DEFAULT, "swift_demangle"); } // Attempts to demangle a Swift name. The demangler will return nullptr if a // non-Swift name is passed in. const char *DemangleSwift(const char *name) { if (!name) return nullptr; // Check if we are dealing with a Swift mangled name first. if (name[0] != '_' || name[1] != 'T') { return nullptr; } if (swift_demangle_f) return swift_demangle_f(name, internal_strlen(name), 0, 0, 0); return nullptr; } const char *DemangleSwiftAndCXX(const char *name) { if (!name) return nullptr; if (const char *swift_demangled_name = DemangleSwift(name)) return swift_demangled_name; return DemangleCXXABI(name); } bool SymbolizerProcess::StartSymbolizerSubprocess() { if (!FileExists(path_)) { if (!reported_invalid_path_) { Report("WARNING: invalid path to external symbolizer!\n"); reported_invalid_path_ = true; } return false; } int pid; if (use_forkpty_) { #if SANITIZER_MAC fd_t fd = kInvalidFd; // forkpty redirects stdout and stderr into a single stream, so we would // receive error messages as standard replies. To avoid that, let's dup // stderr and restore it in the child. int saved_stderr = dup(STDERR_FILENO); CHECK_GE(saved_stderr, 0); // Use forkpty to disable buffering in the new terminal. pid = internal_forkpty(&fd); if (pid == -1) { // forkpty() failed. Report("WARNING: failed to fork external symbolizer (errno: %d)\n", errno); return false; } else if (pid == 0) { // Child subprocess. // Restore stderr. CHECK_GE(dup2(saved_stderr, STDERR_FILENO), 0); close(saved_stderr); const char *argv[kArgVMax]; GetArgV(path_, argv); execv(path_, const_cast(&argv[0])); internal__exit(1); } // Continue execution in parent process. input_fd_ = output_fd_ = fd; close(saved_stderr); // Disable echo in the new terminal, disable CR. struct termios termflags; tcgetattr(fd, &termflags); termflags.c_oflag &= ~ONLCR; termflags.c_lflag &= ~ECHO; tcsetattr(fd, TCSANOW, &termflags); #else // SANITIZER_MAC UNIMPLEMENTED(); #endif // SANITIZER_MAC } else { int *infd = NULL; int *outfd = NULL; // The client program may close its stdin and/or stdout and/or stderr // thus allowing socketpair to reuse file descriptors 0, 1 or 2. // In this case the communication between the forked processes may be // broken if either the parent or the child tries to close or duplicate // these descriptors. The loop below produces two pairs of file // descriptors, each greater than 2 (stderr). int sock_pair[5][2]; for (int i = 0; i < 5; i++) { if (pipe(sock_pair[i]) == -1) { for (int j = 0; j < i; j++) { internal_close(sock_pair[j][0]); internal_close(sock_pair[j][1]); } Report("WARNING: Can't create a socket pair to start " "external symbolizer (errno: %d)\n", errno); return false; } else if (sock_pair[i][0] > 2 && sock_pair[i][1] > 2) { if (infd == NULL) { infd = sock_pair[i]; } else { outfd = sock_pair[i]; for (int j = 0; j < i; j++) { if (sock_pair[j] == infd) continue; internal_close(sock_pair[j][0]); internal_close(sock_pair[j][1]); } break; } } } CHECK(infd); CHECK(outfd); const char *argv[kArgVMax]; GetArgV(path_, argv); pid = StartSubprocess(path_, argv, /* stdin */ outfd[0], /* stdout */ infd[1]); if (pid < 0) { internal_close(infd[0]); internal_close(outfd[1]); return false; } input_fd_ = infd[0]; output_fd_ = outfd[1]; } // Check that symbolizer subprocess started successfully. SleepForMillis(kSymbolizerStartupTimeMillis); if (!IsProcessRunning(pid)) { // Either waitpid failed, or child has already exited. Report("WARNING: external symbolizer didn't start up correctly!\n"); return false; } return true; } class Addr2LineProcess : public SymbolizerProcess { public: Addr2LineProcess(const char *path, const char *module_name) : SymbolizerProcess(path), module_name_(internal_strdup(module_name)) {} const char *module_name() const { return module_name_; } private: void GetArgV(const char *path_to_binary, const char *(&argv)[kArgVMax]) const override { int i = 0; argv[i++] = path_to_binary; argv[i++] = "-iCfe"; argv[i++] = module_name_; argv[i++] = nullptr; } bool ReachedEndOfOutput(const char *buffer, uptr length) const override; bool ReadFromSymbolizer(char *buffer, uptr max_length) override { if (!SymbolizerProcess::ReadFromSymbolizer(buffer, max_length)) return false; // We should cut out output_terminator_ at the end of given buffer, // appended by addr2line to mark the end of its meaningful output. // We cannot scan buffer from it's beginning, because it is legal for it // to start with output_terminator_ in case given offset is invalid. So, // scanning from second character. char *garbage = internal_strstr(buffer + 1, output_terminator_); // This should never be NULL since buffer must end up with // output_terminator_. CHECK(garbage); // Trim the buffer. garbage[0] = '\0'; return true; } const char *module_name_; // Owned, leaked. static const char output_terminator_[]; }; const char Addr2LineProcess::output_terminator_[] = "??\n??:0\n"; bool Addr2LineProcess::ReachedEndOfOutput(const char *buffer, uptr length) const { const size_t kTerminatorLen = sizeof(output_terminator_) - 1; // Skip, if we read just kTerminatorLen bytes, because Addr2Line output // should consist at least of two pairs of lines: // 1. First one, corresponding to given offset to be symbolized // (may be equal to output_terminator_, if offset is not valid). // 2. Second one for output_terminator_, itself to mark the end of output. if (length <= kTerminatorLen) return false; // Addr2Line output should end up with output_terminator_. return !internal_memcmp(buffer + length - kTerminatorLen, output_terminator_, kTerminatorLen); } class Addr2LinePool : public SymbolizerTool { public: explicit Addr2LinePool(const char *addr2line_path, LowLevelAllocator *allocator) : addr2line_path_(addr2line_path), allocator_(allocator), addr2line_pool_(16) {} bool SymbolizePC(uptr addr, SymbolizedStack *stack) override { if (const char *buf = SendCommand(stack->info.module, stack->info.module_offset)) { ParseSymbolizePCOutput(buf, stack); return true; } return false; } bool SymbolizeData(uptr addr, DataInfo *info) override { return false; } private: const char *SendCommand(const char *module_name, uptr module_offset) { Addr2LineProcess *addr2line = 0; for (uptr i = 0; i < addr2line_pool_.size(); ++i) { if (0 == internal_strcmp(module_name, addr2line_pool_[i]->module_name())) { addr2line = addr2line_pool_[i]; break; } } if (!addr2line) { addr2line = new(*allocator_) Addr2LineProcess(addr2line_path_, module_name); addr2line_pool_.push_back(addr2line); } CHECK_EQ(0, internal_strcmp(module_name, addr2line->module_name())); char buffer[kBufferSize]; internal_snprintf(buffer, kBufferSize, "0x%zx\n0x%zx\n", module_offset, dummy_address_); return addr2line->SendCommand(buffer); } static const uptr kBufferSize = 64; const char *addr2line_path_; LowLevelAllocator *allocator_; InternalMmapVector addr2line_pool_; static const uptr dummy_address_ = FIRST_32_SECOND_64(UINT32_MAX, UINT64_MAX); }; #if SANITIZER_SUPPORTS_WEAK_HOOKS extern "C" { SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE bool __sanitizer_symbolize_code(const char *ModuleName, u64 ModuleOffset, char *Buffer, int MaxLength); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE bool __sanitizer_symbolize_data(const char *ModuleName, u64 ModuleOffset, char *Buffer, int MaxLength); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_symbolize_flush(); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE int __sanitizer_symbolize_demangle(const char *Name, char *Buffer, int MaxLength); } // extern "C" class InternalSymbolizer : public SymbolizerTool { public: static InternalSymbolizer *get(LowLevelAllocator *alloc) { if (__sanitizer_symbolize_code != 0 && __sanitizer_symbolize_data != 0) { return new(*alloc) InternalSymbolizer(); } return 0; } bool SymbolizePC(uptr addr, SymbolizedStack *stack) override { bool result = __sanitizer_symbolize_code( stack->info.module, stack->info.module_offset, buffer_, kBufferSize); if (result) ParseSymbolizePCOutput(buffer_, stack); return result; } bool SymbolizeData(uptr addr, DataInfo *info) override { bool result = __sanitizer_symbolize_data(info->module, info->module_offset, buffer_, kBufferSize); if (result) { ParseSymbolizeDataOutput(buffer_, info); info->start += (addr - info->module_offset); // Add the base address. } return result; } void Flush() override { if (__sanitizer_symbolize_flush) __sanitizer_symbolize_flush(); } const char *Demangle(const char *name) override { if (__sanitizer_symbolize_demangle) { for (uptr res_length = 1024; res_length <= InternalSizeClassMap::kMaxSize;) { char *res_buff = static_cast(InternalAlloc(res_length)); uptr req_length = __sanitizer_symbolize_demangle(name, res_buff, res_length); if (req_length > res_length) { res_length = req_length + 1; InternalFree(res_buff); continue; } return res_buff; } } return name; } private: InternalSymbolizer() { } static const int kBufferSize = 16 * 1024; static const int kMaxDemangledNameSize = 1024; char buffer_[kBufferSize]; }; #else // SANITIZER_SUPPORTS_WEAK_HOOKS class InternalSymbolizer : public SymbolizerTool { public: static InternalSymbolizer *get(LowLevelAllocator *alloc) { return 0; } }; #endif // SANITIZER_SUPPORTS_WEAK_HOOKS const char *Symbolizer::PlatformDemangle(const char *name) { return DemangleSwiftAndCXX(name); } void Symbolizer::PlatformPrepareForSandboxing() {} static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) { const char *path = common_flags()->external_symbolizer_path; const char *binary_name = path ? StripModuleName(path) : ""; if (path && path[0] == '\0') { VReport(2, "External symbolizer is explicitly disabled.\n"); return nullptr; } else if (!internal_strcmp(binary_name, "llvm-symbolizer")) { VReport(2, "Using llvm-symbolizer at user-specified path: %s\n", path); return new(*allocator) LLVMSymbolizer(path, allocator); } else if (!internal_strcmp(binary_name, "atos")) { #if SANITIZER_MAC VReport(2, "Using atos at user-specified path: %s\n", path); return new(*allocator) AtosSymbolizer(path, allocator); #else // SANITIZER_MAC Report("ERROR: Using `atos` is only supported on Darwin.\n"); Die(); #endif // SANITIZER_MAC } else if (!internal_strcmp(binary_name, "addr2line")) { VReport(2, "Using addr2line at user-specified path: %s\n", path); return new(*allocator) Addr2LinePool(path, allocator); } else if (path) { Report("ERROR: External symbolizer path is set to '%s' which isn't " "a known symbolizer. Please set the path to the llvm-symbolizer " "binary or other known tool.\n", path); Die(); } // Otherwise symbolizer program is unknown, let's search $PATH CHECK(path == nullptr); if (const char *found_path = FindPathToBinary("llvm-symbolizer")) { VReport(2, "Using llvm-symbolizer found at: %s\n", found_path); return new(*allocator) LLVMSymbolizer(found_path, allocator); } #if SANITIZER_MAC if (const char *found_path = FindPathToBinary("atos")) { VReport(2, "Using atos found at: %s\n", found_path); return new(*allocator) AtosSymbolizer(found_path, allocator); } #endif // SANITIZER_MAC if (common_flags()->allow_addr2line) { if (const char *found_path = FindPathToBinary("addr2line")) { VReport(2, "Using addr2line found at: %s\n", found_path); return new(*allocator) Addr2LinePool(found_path, allocator); } } return nullptr; } static void ChooseSymbolizerTools(IntrusiveList *list, LowLevelAllocator *allocator) { if (!common_flags()->symbolize) { VReport(2, "Symbolizer is disabled.\n"); return; } if (IsReportingOOM()) { VReport(2, "Cannot use internal symbolizer: out of memory\n"); } else if (SymbolizerTool *tool = InternalSymbolizer::get(allocator)) { VReport(2, "Using internal symbolizer.\n"); list->push_back(tool); return; } if (SymbolizerTool *tool = LibbacktraceSymbolizer::get(allocator)) { VReport(2, "Using libbacktrace symbolizer.\n"); list->push_back(tool); return; } if (SymbolizerTool *tool = ChooseExternalSymbolizer(allocator)) { list->push_back(tool); } #if SANITIZER_MAC VReport(2, "Using dladdr symbolizer.\n"); list->push_back(new(*allocator) DlAddrSymbolizer()); #endif // SANITIZER_MAC } Symbolizer *Symbolizer::PlatformInit() { IntrusiveList list; list.clear(); ChooseSymbolizerTools(&list, &symbolizer_allocator_); return new(symbolizer_allocator_) Symbolizer(list); } void Symbolizer::LateInitialize() { Symbolizer::GetOrInit(); InitializeSwiftDemangler(); } } // namespace __sanitizer #endif // SANITIZER_POSIX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_thread_registry.h0000664000175000017500000001204412602553450032772 0ustar mwhudsonmwhudson//===-- sanitizer_thread_registry.h -----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between sanitizer tools. // // General thread bookkeeping functionality. //===----------------------------------------------------------------------===// #ifndef SANITIZER_THREAD_REGISTRY_H #define SANITIZER_THREAD_REGISTRY_H #include "sanitizer_common.h" #include "sanitizer_list.h" #include "sanitizer_mutex.h" namespace __sanitizer { enum ThreadStatus { ThreadStatusInvalid, // Non-existent thread, data is invalid. ThreadStatusCreated, // Created but not yet running. ThreadStatusRunning, // The thread is currently running. ThreadStatusFinished, // Joinable thread is finished but not yet joined. ThreadStatusDead // Joined, but some info is still available. }; // Generic thread context. Specific sanitizer tools may inherit from it. // If thread is dead, context may optionally be reused for a new thread. class ThreadContextBase { public: explicit ThreadContextBase(u32 tid); ~ThreadContextBase(); // Should never be called. const u32 tid; // Thread ID. Main thread should have tid = 0. u64 unique_id; // Unique thread ID. u32 reuse_count; // Number of times this tid was reused. uptr os_id; // PID (used for reporting). uptr user_id; // Some opaque user thread id (e.g. pthread_t). char name[64]; // As annotated by user. ThreadStatus status; bool detached; u32 parent_tid; ThreadContextBase *next; // For storing thread contexts in a list. void SetName(const char *new_name); void SetDead(); void SetJoined(void *arg); void SetFinished(); void SetStarted(uptr _os_id, void *arg); void SetCreated(uptr _user_id, u64 _unique_id, bool _detached, u32 _parent_tid, void *arg); void Reset(); // The following methods may be overriden by subclasses. // Some of them take opaque arg that may be optionally be used // by subclasses. virtual void OnDead() {} virtual void OnJoined(void *arg) {} virtual void OnFinished() {} virtual void OnStarted(void *arg) {} virtual void OnCreated(void *arg) {} virtual void OnReset() {} virtual void OnDetached(void *arg) {} }; typedef ThreadContextBase* (*ThreadContextFactory)(u32 tid); class ThreadRegistry { public: static const u32 kUnknownTid; ThreadRegistry(ThreadContextFactory factory, u32 max_threads, u32 thread_quarantine_size, u32 max_reuse = 0); void GetNumberOfThreads(uptr *total = nullptr, uptr *running = nullptr, uptr *alive = nullptr); uptr GetMaxAliveThreads(); void Lock() { mtx_.Lock(); } void CheckLocked() { mtx_.CheckLocked(); } void Unlock() { mtx_.Unlock(); } // Should be guarded by ThreadRegistryLock. ThreadContextBase *GetThreadLocked(u32 tid) { DCHECK_LT(tid, n_contexts_); return threads_[tid]; } u32 CreateThread(uptr user_id, bool detached, u32 parent_tid, void *arg); typedef void (*ThreadCallback)(ThreadContextBase *tctx, void *arg); // Invokes callback with a specified arg for each thread context. // Should be guarded by ThreadRegistryLock. void RunCallbackForEachThreadLocked(ThreadCallback cb, void *arg); typedef bool (*FindThreadCallback)(ThreadContextBase *tctx, void *arg); // Finds a thread using the provided callback. Returns kUnknownTid if no // thread is found. u32 FindThread(FindThreadCallback cb, void *arg); // Should be guarded by ThreadRegistryLock. Return 0 if no thread // is found. ThreadContextBase *FindThreadContextLocked(FindThreadCallback cb, void *arg); ThreadContextBase *FindThreadContextByOsIDLocked(uptr os_id); void SetThreadName(u32 tid, const char *name); void SetThreadNameByUserId(uptr user_id, const char *name); void DetachThread(u32 tid, void *arg); void JoinThread(u32 tid, void *arg); void FinishThread(u32 tid); void StartThread(u32 tid, uptr os_id, void *arg); private: const ThreadContextFactory context_factory_; const u32 max_threads_; const u32 thread_quarantine_size_; const u32 max_reuse_; BlockingMutex mtx_; u32 n_contexts_; // Number of created thread contexts, // at most max_threads_. u64 total_threads_; // Total number of created threads. May be greater than // max_threads_ if contexts were reused. uptr alive_threads_; // Created or running. uptr max_alive_threads_; uptr running_threads_; ThreadContextBase **threads_; // Array of thread contexts is leaked. IntrusiveList dead_threads_; IntrusiveList invalid_threads_; void QuarantinePush(ThreadContextBase *tctx); ThreadContextBase *QuarantinePop(); }; typedef GenericScopedLock ThreadRegistryLock; } // namespace __sanitizer #endif // SANITIZER_THREAD_REGISTRY_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer.cc0000664000175000017500000000624712665333544032151 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_allocator_internal.h" #include "sanitizer_platform.h" #include "sanitizer_internal_defs.h" #include "sanitizer_libc.h" #include "sanitizer_placement_new.h" #include "sanitizer_symbolizer_internal.h" namespace __sanitizer { AddressInfo::AddressInfo() { internal_memset(this, 0, sizeof(AddressInfo)); function_offset = kUnknown; } void AddressInfo::Clear() { InternalFree(module); InternalFree(function); InternalFree(file); internal_memset(this, 0, sizeof(AddressInfo)); function_offset = kUnknown; } void AddressInfo::FillModuleInfo(const char *mod_name, uptr mod_offset) { module = internal_strdup(mod_name); module_offset = mod_offset; } SymbolizedStack::SymbolizedStack() : next(nullptr), info() {} SymbolizedStack *SymbolizedStack::New(uptr addr) { void *mem = InternalAlloc(sizeof(SymbolizedStack)); SymbolizedStack *res = new(mem) SymbolizedStack(); res->info.address = addr; return res; } void SymbolizedStack::ClearAll() { info.Clear(); if (next) next->ClearAll(); InternalFree(this); } DataInfo::DataInfo() { internal_memset(this, 0, sizeof(DataInfo)); } void DataInfo::Clear() { InternalFree(module); InternalFree(file); InternalFree(name); internal_memset(this, 0, sizeof(DataInfo)); } Symbolizer *Symbolizer::symbolizer_; StaticSpinMutex Symbolizer::init_mu_; LowLevelAllocator Symbolizer::symbolizer_allocator_; void Symbolizer::AddHooks(Symbolizer::StartSymbolizationHook start_hook, Symbolizer::EndSymbolizationHook end_hook) { CHECK(start_hook_ == 0 && end_hook_ == 0); start_hook_ = start_hook; end_hook_ = end_hook; } const char *Symbolizer::ModuleNameOwner::GetOwnedCopy(const char *str) { mu_->CheckLocked(); // 'str' will be the same string multiple times in a row, optimize this case. if (last_match_ && !internal_strcmp(last_match_, str)) return last_match_; // FIXME: this is linear search. // We should optimize this further if this turns out to be a bottleneck later. for (uptr i = 0; i < storage_.size(); ++i) { if (!internal_strcmp(storage_[i], str)) { last_match_ = storage_[i]; return last_match_; } } last_match_ = internal_strdup(str); storage_.push_back(last_match_); return last_match_; } Symbolizer::Symbolizer(IntrusiveList tools) : module_names_(&mu_), modules_(), modules_fresh_(false), tools_(tools), start_hook_(0), end_hook_(0) {} Symbolizer::SymbolizerScope::SymbolizerScope(const Symbolizer *sym) : sym_(sym) { if (sym_->start_hook_) sym_->start_hook_(); } Symbolizer::SymbolizerScope::~SymbolizerScope() { if (sym_->end_hook_) sym_->end_hook_(); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_procmaps_freebsd.cc0000664000175000017500000000522012371066125033246 0ustar mwhudsonmwhudson//===-- sanitizer_procmaps_freebsd.cc -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Information about the process mappings (FreeBSD-specific parts). //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_FREEBSD #include "sanitizer_common.h" #include "sanitizer_freebsd.h" #include "sanitizer_procmaps.h" #include #include #include // Fix 'kinfo_vmentry' definition on FreeBSD prior v9.2 in 32-bit mode. #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) # include # if __FreeBSD_version <= 902001 // v9.2 # define kinfo_vmentry xkinfo_vmentry # endif #endif namespace __sanitizer { void ReadProcMaps(ProcSelfMapsBuff *proc_maps) { const int Mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid() }; size_t Size = 0; int Err = sysctl(Mib, 4, NULL, &Size, NULL, 0); CHECK_EQ(Err, 0); CHECK_GT(Size, 0); size_t MmapedSize = Size * 4 / 3; void *VmMap = MmapOrDie(MmapedSize, "ReadProcMaps()"); Size = MmapedSize; Err = sysctl(Mib, 4, VmMap, &Size, NULL, 0); CHECK_EQ(Err, 0); proc_maps->data = (char*)VmMap; proc_maps->mmaped_size = MmapedSize; proc_maps->len = Size; } bool MemoryMappingLayout::Next(uptr *start, uptr *end, uptr *offset, char filename[], uptr filename_size, uptr *protection) { char *last = proc_self_maps_.data + proc_self_maps_.len; if (current_ >= last) return false; uptr dummy; if (!start) start = &dummy; if (!end) end = &dummy; if (!offset) offset = &dummy; if (!protection) protection = &dummy; struct kinfo_vmentry *VmEntry = (struct kinfo_vmentry*)current_; *start = (uptr)VmEntry->kve_start; *end = (uptr)VmEntry->kve_end; *offset = (uptr)VmEntry->kve_offset; *protection = 0; if ((VmEntry->kve_protection & KVME_PROT_READ) != 0) *protection |= kProtectionRead; if ((VmEntry->kve_protection & KVME_PROT_WRITE) != 0) *protection |= kProtectionWrite; if ((VmEntry->kve_protection & KVME_PROT_EXEC) != 0) *protection |= kProtectionExecute; if (filename != NULL && filename_size > 0) { internal_snprintf(filename, Min(filename_size, (uptr)PATH_MAX), "%s", VmEntry->kve_path); } current_ += VmEntry->kve_structsize; return true; } } // namespace __sanitizer #endif // SANITIZER_FREEBSD golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_libc.h0000664000175000017500000000661112744212345030511 0ustar mwhudsonmwhudson//===-- sanitizer_libc.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // These tools can not use some of the libc functions directly because those // functions are intercepted. Instead, we implement a tiny subset of libc here. // FIXME: Some of functions declared in this file are in fact POSIX, not libc. //===----------------------------------------------------------------------===// #ifndef SANITIZER_LIBC_H #define SANITIZER_LIBC_H // ----------- ATTENTION ------------- // This header should NOT include any other headers from sanitizer runtime. #include "sanitizer_internal_defs.h" namespace __sanitizer { // internal_X() is a custom implementation of X() for use in RTL. // String functions s64 internal_atoll(const char *nptr); void *internal_memchr(const void *s, int c, uptr n); void *internal_memrchr(const void *s, int c, uptr n); int internal_memcmp(const void* s1, const void* s2, uptr n); void *internal_memcpy(void *dest, const void *src, uptr n); void *internal_memmove(void *dest, const void *src, uptr n); // Set [s, s + n) to 0. Both s and n should be 16-aligned. void internal_bzero_aligned16(void *s, uptr n); // Should not be used in performance-critical places. void *internal_memset(void *s, int c, uptr n); char* internal_strchr(const char *s, int c); char *internal_strchrnul(const char *s, int c); int internal_strcmp(const char *s1, const char *s2); uptr internal_strcspn(const char *s, const char *reject); char *internal_strdup(const char *s); char *internal_strndup(const char *s, uptr n); uptr internal_strlen(const char *s); uptr internal_strlcat(char *dst, const char *src, uptr maxlen); char *internal_strncat(char *dst, const char *src, uptr n); int internal_strncmp(const char *s1, const char *s2, uptr n); uptr internal_strlcpy(char *dst, const char *src, uptr maxlen); char *internal_strncpy(char *dst, const char *src, uptr n); uptr internal_strnlen(const char *s, uptr maxlen); char *internal_strrchr(const char *s, int c); // This is O(N^2), but we are not using it in hot places. uptr internal_wcslen(const wchar_t *s); char *internal_strstr(const char *haystack, const char *needle); // Works only for base=10 and doesn't set errno. s64 internal_simple_strtoll(const char *nptr, char **endptr, int base); int internal_snprintf(char *buffer, uptr length, const char *format, ...); // Return true if all bytes in [mem, mem+size) are zero. // Optimized for the case when the result is true. bool mem_is_zero(const char *mem, uptr size); // I/O // Define these as macros so we can use them in linker initialized global // structs without dynamic initialization. #define kInvalidFd ((fd_t)-1) #define kStdinFd ((fd_t)0) #define kStdoutFd ((fd_t)1) #define kStderrFd ((fd_t)2) uptr internal_ftruncate(fd_t fd, uptr size); // OS void NORETURN internal__exit(int exitcode); unsigned int internal_sleep(unsigned int seconds); uptr internal_getpid(); uptr internal_getppid(); // Threading uptr internal_sched_yield(); // Error handling bool internal_iserror(uptr retval, int *rverrno = nullptr); } // namespace __sanitizer #endif // SANITIZER_LIBC_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/0000775000175000017500000000000013040224626026470 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_test_main.cc0000664000175000017500000000144612766606132033071 0ustar mwhudsonmwhudson//===-- sanitizer_test_main.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "gtest/gtest.h" #include "sanitizer_common/sanitizer_flags.h" const char *argv0; int main(int argc, char **argv) { argv0 = argv[0]; testing::GTEST_FLAG(death_test_style) = "threadsafe"; testing::InitGoogleTest(&argc, argv); __sanitizer::SetCommonFlagsDefaults(); return RUN_ALL_TESTS(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_ioctl_test.cc0000664000175000017500000000701312670457100033244 0ustar mwhudsonmwhudson//===-- sanitizer_ioctl_test.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for ioctl interceptor implementation in sanitizer_common. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX #include #include #include "interception/interception.h" #include "sanitizer_test_utils.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_common.h" #include "gtest/gtest.h" using namespace __sanitizer; #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, sz) \ do { \ (void) ctx; \ (void) ptr; \ (void) sz; \ } while (0) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, sz) \ do { \ (void) ctx; \ (void) ptr; \ (void) sz; \ } while (0) #include "sanitizer_common/sanitizer_common_interceptors_ioctl.inc" static struct IoctlInit { IoctlInit() { ioctl_init(); // Avoid unused function warnings. (void)&ioctl_common_pre; (void)&ioctl_common_post; (void)&ioctl_decode; } } ioctl_static_initializer; TEST(SanitizerIoctl, Fixup) { EXPECT_EQ((unsigned)FIONBIO, ioctl_request_fixup(FIONBIO)); EXPECT_EQ(EVIOCGBIT(0, 0), ioctl_request_fixup(EVIOCGBIT(0, 16))); EXPECT_EQ(EVIOCGBIT(0, 0), ioctl_request_fixup(EVIOCGBIT(1, 16))); EXPECT_EQ(EVIOCGBIT(0, 0), ioctl_request_fixup(EVIOCGBIT(1, 17))); EXPECT_EQ(EVIOCGBIT(0, 0), ioctl_request_fixup(EVIOCGBIT(31, 16))); EXPECT_NE(EVIOCGBIT(0, 0), ioctl_request_fixup(EVIOCGBIT(32, 16))); EXPECT_EQ(EVIOCGABS(0), ioctl_request_fixup(EVIOCGABS(0))); EXPECT_EQ(EVIOCGABS(0), ioctl_request_fixup(EVIOCGABS(5))); EXPECT_EQ(EVIOCGABS(0), ioctl_request_fixup(EVIOCGABS(63))); EXPECT_NE(EVIOCGABS(0), ioctl_request_fixup(EVIOCGABS(64))); EXPECT_EQ(EVIOCSABS(0), ioctl_request_fixup(EVIOCSABS(0))); EXPECT_EQ(EVIOCSABS(0), ioctl_request_fixup(EVIOCSABS(5))); EXPECT_EQ(EVIOCSABS(0), ioctl_request_fixup(EVIOCSABS(63))); EXPECT_NE(EVIOCSABS(0), ioctl_request_fixup(EVIOCSABS(64))); const ioctl_desc *desc = ioctl_lookup(EVIOCGKEY(16)); EXPECT_NE((void *)0, desc); EXPECT_EQ(EVIOCGKEY(0), desc->req); } // Test decoding KVM ioctl numbers. TEST(SanitizerIoctl, KVM_GET_MP_STATE) { ioctl_desc desc; unsigned int desc_value = SANITIZER_MIPS ? 0x4004ae98U : 0x8004ae98U; bool res = ioctl_decode(desc_value, &desc); EXPECT_TRUE(res); EXPECT_EQ(ioctl_desc::WRITE, desc.type); EXPECT_EQ(4U, desc.size); } TEST(SanitizerIoctl, KVM_GET_LAPIC) { ioctl_desc desc; unsigned int desc_value = SANITIZER_MIPS ? 0x4400ae8eU : 0x8400ae8eU; bool res = ioctl_decode(desc_value, &desc); EXPECT_TRUE(res); EXPECT_EQ(ioctl_desc::WRITE, desc.type); EXPECT_EQ(1024U, desc.size); } TEST(SanitizerIoctl, KVM_GET_MSR_INDEX_LIST) { ioctl_desc desc; bool res = ioctl_decode(0xc004ae02U, &desc); EXPECT_TRUE(res); EXPECT_EQ(ioctl_desc::READWRITE, desc.type); EXPECT_EQ(4U, desc.size); } #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_test_config.h0000664000175000017500000000153112334416470033242 0ustar mwhudsonmwhudson//===-- sanitizer_test_config.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of *Sanitizer runtime. // //===----------------------------------------------------------------------===// #if !defined(INCLUDED_FROM_SANITIZER_TEST_UTILS_H) # error "This file should be included into sanitizer_test_utils.h only" #endif #ifndef SANITIZER_TEST_CONFIG_H #define SANITIZER_TEST_CONFIG_H #include #include #include #if SANITIZER_USE_DEJAGNU_GTEST # include "dejagnu-gtest.h" #else # include "gtest/gtest.h" #endif #endif // SANITIZER_TEST_CONFIG_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_deadlock_detector_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_deadlock_detecto0000664000175000017500000003227212451670030033765 0ustar mwhudsonmwhudson//===-- sanitizer_deadlock_detector_test.cc -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. // Tests for sanitizer_deadlock_detector.h // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_deadlock_detector.h" #include "sanitizer_test_utils.h" #include "gtest/gtest.h" #include #include #include using namespace __sanitizer; using namespace std; typedef BasicBitVector BV1; typedef BasicBitVector<> BV2; typedef TwoLevelBitVector<> BV3; typedef TwoLevelBitVector<3, BasicBitVector > BV4; // Poor man's unique_ptr. template struct ScopedDD { ScopedDD() { dp = new DeadlockDetector; dp->clear(); dtls.clear(); } ~ScopedDD() { delete dp; } DeadlockDetector *dp; DeadlockDetectorTLS dtls; }; template void RunBasicTest() { uptr path[10]; ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; set s; for (size_t i = 0; i < d.size() * 3; i++) { uptr node = d.newNode(0); EXPECT_TRUE(s.insert(node).second); } d.clear(); s.clear(); // Add size() nodes. for (size_t i = 0; i < d.size(); i++) { uptr node = d.newNode(0); EXPECT_TRUE(s.insert(node).second); } // Remove all nodes. for (set::iterator it = s.begin(); it != s.end(); ++it) d.removeNode(*it); // The nodes should be reused. for (size_t i = 0; i < d.size(); i++) { uptr node = d.newNode(0); EXPECT_FALSE(s.insert(node).second); } // Cycle: n1->n2->n1 { d.clear(); dtls.clear(); uptr n1 = d.newNode(1); uptr n2 = d.newNode(2); EXPECT_FALSE(d.onLock(&dtls, n1)); EXPECT_FALSE(d.onLock(&dtls, n2)); d.onUnlock(&dtls, n2); d.onUnlock(&dtls, n1); EXPECT_FALSE(d.onLock(&dtls, n2)); EXPECT_EQ(0U, d.findPathToLock(&dtls, n1, path, 1)); EXPECT_EQ(2U, d.findPathToLock(&dtls, n1, path, 10)); EXPECT_EQ(2U, d.findPathToLock(&dtls, n1, path, 2)); EXPECT_TRUE(d.onLock(&dtls, n1)); EXPECT_EQ(path[0], n1); EXPECT_EQ(path[1], n2); EXPECT_EQ(d.getData(n1), 1U); EXPECT_EQ(d.getData(n2), 2U); d.onUnlock(&dtls, n1); d.onUnlock(&dtls, n2); } // Cycle: n1->n2->n3->n1 { d.clear(); dtls.clear(); uptr n1 = d.newNode(1); uptr n2 = d.newNode(2); uptr n3 = d.newNode(3); EXPECT_FALSE(d.onLock(&dtls, n1)); EXPECT_FALSE(d.onLock(&dtls, n2)); d.onUnlock(&dtls, n2); d.onUnlock(&dtls, n1); EXPECT_FALSE(d.onLock(&dtls, n2)); EXPECT_FALSE(d.onLock(&dtls, n3)); d.onUnlock(&dtls, n3); d.onUnlock(&dtls, n2); EXPECT_FALSE(d.onLock(&dtls, n3)); EXPECT_EQ(0U, d.findPathToLock(&dtls, n1, path, 2)); EXPECT_EQ(3U, d.findPathToLock(&dtls, n1, path, 10)); EXPECT_TRUE(d.onLock(&dtls, n1)); EXPECT_EQ(path[0], n1); EXPECT_EQ(path[1], n2); EXPECT_EQ(path[2], n3); EXPECT_EQ(d.getData(n1), 1U); EXPECT_EQ(d.getData(n2), 2U); EXPECT_EQ(d.getData(n3), 3U); d.onUnlock(&dtls, n1); d.onUnlock(&dtls, n3); } } TEST(DeadlockDetector, BasicTest) { RunBasicTest(); RunBasicTest(); RunBasicTest(); RunBasicTest(); } template void RunRemoveNodeTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; uptr l0 = d.newNode(0); uptr l1 = d.newNode(1); uptr l2 = d.newNode(2); uptr l3 = d.newNode(3); uptr l4 = d.newNode(4); uptr l5 = d.newNode(5); // l0=>l1=>l2 d.onLock(&dtls, l0); d.onLock(&dtls, l1); d.onLock(&dtls, l2); d.onUnlock(&dtls, l1); d.onUnlock(&dtls, l0); d.onUnlock(&dtls, l2); // l3=>l4=>l5 d.onLock(&dtls, l3); d.onLock(&dtls, l4); d.onLock(&dtls, l5); d.onUnlock(&dtls, l4); d.onUnlock(&dtls, l3); d.onUnlock(&dtls, l5); set locks; locks.insert(l0); locks.insert(l1); locks.insert(l2); locks.insert(l3); locks.insert(l4); locks.insert(l5); for (uptr i = 6; i < d.size(); i++) { uptr lt = d.newNode(i); locks.insert(lt); d.onLock(&dtls, lt); d.onUnlock(&dtls, lt); d.removeNode(lt); } EXPECT_EQ(locks.size(), d.size()); // l2=>l0 EXPECT_FALSE(d.onLock(&dtls, l2)); EXPECT_TRUE(d.onLock(&dtls, l0)); d.onUnlock(&dtls, l2); d.onUnlock(&dtls, l0); // l4=>l3 EXPECT_FALSE(d.onLock(&dtls, l4)); EXPECT_TRUE(d.onLock(&dtls, l3)); d.onUnlock(&dtls, l4); d.onUnlock(&dtls, l3); EXPECT_EQ(d.size(), d.testOnlyGetEpoch()); d.removeNode(l2); d.removeNode(l3); locks.clear(); // make sure no edges from or to l0,l1,l4,l5 left. for (uptr i = 4; i < d.size(); i++) { uptr lt = d.newNode(i); locks.insert(lt); uptr a, b; // l0 => lt? a = l0; b = lt; EXPECT_FALSE(d.onLock(&dtls, a)); EXPECT_FALSE(d.onLock(&dtls, b)); d.onUnlock(&dtls, a); d.onUnlock(&dtls, b); // l1 => lt? a = l1; b = lt; EXPECT_FALSE(d.onLock(&dtls, a)); EXPECT_FALSE(d.onLock(&dtls, b)); d.onUnlock(&dtls, a); d.onUnlock(&dtls, b); // lt => l4? a = lt; b = l4; EXPECT_FALSE(d.onLock(&dtls, a)); EXPECT_FALSE(d.onLock(&dtls, b)); d.onUnlock(&dtls, a); d.onUnlock(&dtls, b); // lt => l5? a = lt; b = l5; EXPECT_FALSE(d.onLock(&dtls, a)); EXPECT_FALSE(d.onLock(&dtls, b)); d.onUnlock(&dtls, a); d.onUnlock(&dtls, b); d.removeNode(lt); } // Still the same epoch. EXPECT_EQ(d.size(), d.testOnlyGetEpoch()); EXPECT_EQ(locks.size(), d.size() - 4); // l2 and l3 should have ben reused. EXPECT_EQ(locks.count(l2), 1U); EXPECT_EQ(locks.count(l3), 1U); } TEST(DeadlockDetector, RemoveNodeTest) { RunRemoveNodeTest(); RunRemoveNodeTest(); RunRemoveNodeTest(); RunRemoveNodeTest(); } template void RunMultipleEpochsTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; set locks; for (uptr i = 0; i < d.size(); i++) { EXPECT_TRUE(locks.insert(d.newNode(i)).second); } EXPECT_EQ(d.testOnlyGetEpoch(), d.size()); for (uptr i = 0; i < d.size(); i++) { EXPECT_TRUE(locks.insert(d.newNode(i)).second); EXPECT_EQ(d.testOnlyGetEpoch(), d.size() * 2); } locks.clear(); uptr l0 = d.newNode(0); uptr l1 = d.newNode(0); d.onLock(&dtls, l0); d.onLock(&dtls, l1); d.onUnlock(&dtls, l0); EXPECT_EQ(d.testOnlyGetEpoch(), 3 * d.size()); for (uptr i = 0; i < d.size(); i++) { EXPECT_TRUE(locks.insert(d.newNode(i)).second); } EXPECT_EQ(d.testOnlyGetEpoch(), 4 * d.size()); #if !SANITIZER_DEBUG // EXPECT_DEATH clones a thread with 4K stack, // which is overflown by tsan memory accesses functions in debug mode. // Can not handle the locks from the previous epoch. // The caller should update the lock id. EXPECT_DEATH(d.onLock(&dtls, l0), "CHECK failed.*current_epoch_"); #endif } TEST(DeadlockDetector, MultipleEpochsTest) { RunMultipleEpochsTest(); RunMultipleEpochsTest(); RunMultipleEpochsTest(); RunMultipleEpochsTest(); } template void RunCorrectEpochFlush() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; vector locks1; for (uptr i = 0; i < d.size(); i++) locks1.push_back(d.newNode(i)); EXPECT_EQ(d.testOnlyGetEpoch(), d.size()); d.onLock(&dtls, locks1[3]); d.onLock(&dtls, locks1[4]); d.onLock(&dtls, locks1[5]); // We have a new epoch, old locks in dtls will have to be forgotten. uptr l0 = d.newNode(0); EXPECT_EQ(d.testOnlyGetEpoch(), d.size() * 2); uptr l1 = d.newNode(0); EXPECT_EQ(d.testOnlyGetEpoch(), d.size() * 2); d.onLock(&dtls, l0); d.onLock(&dtls, l1); EXPECT_TRUE(d.testOnlyHasEdgeRaw(0, 1)); EXPECT_FALSE(d.testOnlyHasEdgeRaw(1, 0)); EXPECT_FALSE(d.testOnlyHasEdgeRaw(3, 0)); EXPECT_FALSE(d.testOnlyHasEdgeRaw(4, 0)); EXPECT_FALSE(d.testOnlyHasEdgeRaw(5, 0)); } TEST(DeadlockDetector, CorrectEpochFlush) { RunCorrectEpochFlush(); RunCorrectEpochFlush(); } template void RunTryLockTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; uptr l0 = d.newNode(0); uptr l1 = d.newNode(0); uptr l2 = d.newNode(0); EXPECT_FALSE(d.onLock(&dtls, l0)); EXPECT_FALSE(d.onTryLock(&dtls, l1)); EXPECT_FALSE(d.onLock(&dtls, l2)); EXPECT_TRUE(d.isHeld(&dtls, l0)); EXPECT_TRUE(d.isHeld(&dtls, l1)); EXPECT_TRUE(d.isHeld(&dtls, l2)); EXPECT_FALSE(d.testOnlyHasEdge(l0, l1)); EXPECT_TRUE(d.testOnlyHasEdge(l1, l2)); d.onUnlock(&dtls, l0); d.onUnlock(&dtls, l1); d.onUnlock(&dtls, l2); } TEST(DeadlockDetector, TryLockTest) { RunTryLockTest(); RunTryLockTest(); } template void RunOnFirstLockTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; uptr l0 = d.newNode(0); uptr l1 = d.newNode(0); EXPECT_FALSE(d.onFirstLock(&dtls, l0)); // dtls has old epoch. d.onLock(&dtls, l0); d.onUnlock(&dtls, l0); EXPECT_TRUE(d.onFirstLock(&dtls, l0)); // Ok, same ecpoch, first lock. EXPECT_FALSE(d.onFirstLock(&dtls, l1)); // Second lock. d.onLock(&dtls, l1); d.onUnlock(&dtls, l1); d.onUnlock(&dtls, l0); EXPECT_TRUE(d.onFirstLock(&dtls, l0)); // Ok d.onUnlock(&dtls, l0); vector locks1; for (uptr i = 0; i < d.size(); i++) locks1.push_back(d.newNode(i)); EXPECT_TRUE(d.onFirstLock(&dtls, l0)); // Epoch has changed, but not in dtls. uptr l3 = d.newNode(0); d.onLock(&dtls, l3); d.onUnlock(&dtls, l3); EXPECT_FALSE(d.onFirstLock(&dtls, l0)); // Epoch has changed in dtls. } TEST(DeadlockDetector, onFirstLockTest) { RunOnFirstLockTest(); } template void RunRecusriveLockTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; uptr l0 = d.newNode(0); uptr l1 = d.newNode(0); uptr l2 = d.newNode(0); uptr l3 = d.newNode(0); EXPECT_FALSE(d.onLock(&dtls, l0)); EXPECT_FALSE(d.onLock(&dtls, l1)); EXPECT_FALSE(d.onLock(&dtls, l0)); // Recurisve. EXPECT_FALSE(d.onLock(&dtls, l2)); d.onUnlock(&dtls, l0); EXPECT_FALSE(d.onLock(&dtls, l3)); d.onUnlock(&dtls, l0); d.onUnlock(&dtls, l1); d.onUnlock(&dtls, l2); d.onUnlock(&dtls, l3); EXPECT_TRUE(d.testOnlyHasEdge(l0, l1)); EXPECT_TRUE(d.testOnlyHasEdge(l0, l2)); EXPECT_TRUE(d.testOnlyHasEdge(l0, l3)); } TEST(DeadlockDetector, RecusriveLockTest) { RunRecusriveLockTest(); } template void RunLockContextTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; uptr l0 = d.newNode(0); uptr l1 = d.newNode(0); uptr l2 = d.newNode(0); uptr l3 = d.newNode(0); uptr l4 = d.newNode(0); EXPECT_FALSE(d.onLock(&dtls, l0, 10)); EXPECT_FALSE(d.onLock(&dtls, l1, 11)); EXPECT_FALSE(d.onLock(&dtls, l2, 12)); EXPECT_FALSE(d.onLock(&dtls, l3, 13)); EXPECT_EQ(10U, d.findLockContext(&dtls, l0)); EXPECT_EQ(11U, d.findLockContext(&dtls, l1)); EXPECT_EQ(12U, d.findLockContext(&dtls, l2)); EXPECT_EQ(13U, d.findLockContext(&dtls, l3)); d.onUnlock(&dtls, l0); EXPECT_EQ(0U, d.findLockContext(&dtls, l0)); EXPECT_EQ(11U, d.findLockContext(&dtls, l1)); EXPECT_EQ(12U, d.findLockContext(&dtls, l2)); EXPECT_EQ(13U, d.findLockContext(&dtls, l3)); d.onUnlock(&dtls, l2); EXPECT_EQ(0U, d.findLockContext(&dtls, l0)); EXPECT_EQ(11U, d.findLockContext(&dtls, l1)); EXPECT_EQ(0U, d.findLockContext(&dtls, l2)); EXPECT_EQ(13U, d.findLockContext(&dtls, l3)); EXPECT_FALSE(d.onLock(&dtls, l4, 14)); EXPECT_EQ(14U, d.findLockContext(&dtls, l4)); } TEST(DeadlockDetector, LockContextTest) { RunLockContextTest(); } template void RunRemoveEdgesTest() { ScopedDD sdd; DeadlockDetector &d = *sdd.dp; DeadlockDetectorTLS &dtls = sdd.dtls; vector node(BV::kSize); u32 stk_from = 0, stk_to = 0; int unique_tid = 0; for (size_t i = 0; i < BV::kSize; i++) node[i] = d.newNode(0); for (size_t i = 0; i < BV::kSize; i++) EXPECT_FALSE(d.onLock(&dtls, node[i], i + 1)); for (size_t i = 0; i < BV::kSize; i++) { for (uptr j = i + 1; j < BV::kSize; j++) { EXPECT_TRUE( d.findEdge(node[i], node[j], &stk_from, &stk_to, &unique_tid)); EXPECT_EQ(stk_from, i + 1); EXPECT_EQ(stk_to, j + 1); } } EXPECT_EQ(d.testOnlyGetEpoch(), d.size()); // Remove and re-create half of the nodes. for (uptr i = 1; i < BV::kSize; i += 2) d.removeNode(node[i]); for (uptr i = 1; i < BV::kSize; i += 2) node[i] = d.newNode(0); EXPECT_EQ(d.testOnlyGetEpoch(), d.size()); // The edges from or to the removed nodes should be gone. for (size_t i = 0; i < BV::kSize; i++) { for (uptr j = i + 1; j < BV::kSize; j++) { if ((i % 2) || (j % 2)) EXPECT_FALSE( d.findEdge(node[i], node[j], &stk_from, &stk_to, &unique_tid)); else EXPECT_TRUE( d.findEdge(node[i], node[j], &stk_from, &stk_to, &unique_tid)); } } } TEST(DeadlockDetector, RemoveEdgesTest) { RunRemoveEdgesTest(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/standalone_malloc_test.cc0000664000175000017500000000467312074735315033537 0ustar mwhudsonmwhudson#include #include #include #include #include using namespace std; const size_t kNumThreds = 16; const size_t kNumIters = 1 << 23; inline void break_optimization(void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } __attribute__((noinline)) static void *MallocThread(void *t) { size_t total_malloced = 0, total_freed = 0; size_t max_in_use = 0; size_t tid = reinterpret_cast(t); vector > allocated; allocated.reserve(kNumIters); for (size_t i = 1; i < kNumIters; i++) { if ((i % (kNumIters / 4)) == 0 && tid == 0) fprintf(stderr, " T[%ld] iter %ld\n", tid, i); bool allocate = (i % 5) <= 2; // 60% malloc, 40% free if (i > kNumIters / 4) allocate = i % 2; // then switch to 50% malloc, 50% free if (allocate) { size_t size = 1 + (i % 200); if ((i % 10001) == 0) size *= 4096; total_malloced += size; char *x = new char[size]; x[0] = x[size - 1] = x[size / 2] = 0; allocated.push_back(make_pair(x, size)); max_in_use = max(max_in_use, total_malloced - total_freed); } else { if (allocated.empty()) continue; size_t slot = i % allocated.size(); char *p = allocated[slot].first; p[0] = 0; // emulate last user touch of the block size_t size = allocated[slot].second; total_freed += size; swap(allocated[slot], allocated.back()); allocated.pop_back(); delete [] p; } } if (tid == 0) fprintf(stderr, " T[%ld] total_malloced: %ldM in use %ldM max %ldM\n", tid, total_malloced >> 20, (total_malloced - total_freed) >> 20, max_in_use >> 20); for (size_t i = 0; i < allocated.size(); i++) delete [] allocated[i].first; return 0; } template struct DeepStack { __attribute__((noinline)) static void *run(void *t) { break_optimization(0); DeepStack::run(t); break_optimization(0); return 0; } }; template<> struct DeepStack<0> { static void *run(void *t) { MallocThread(t); return 0; } }; // Build with -Dstandalone_malloc_test=main to make it a separate program. int standalone_malloc_test() { pthread_t t[kNumThreds]; for (size_t i = 0; i < kNumThreds; i++) pthread_create(&t[i], 0, DeepStack<200>::run, reinterpret_cast(i)); for (size_t i = 0; i < kNumThreds; i++) pthread_join(t[i], 0); malloc_stats(); return 0; } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stoptheworld_testlib.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stoptheworld_tes0000664000175000017500000000301712144434745034126 0ustar mwhudsonmwhudson//===-- sanitizer_stoptheworld_testlib.cc ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Dynamic library to test StopTheWorld functionality. // When loaded with LD_PRELOAD, it will periodically suspend all threads. //===----------------------------------------------------------------------===// /* Usage: clang++ -fno-exceptions -g -fPIC -I. \ sanitizer_common/tests/sanitizer_stoptheworld_testlib.cc \ sanitizer_common/sanitizer_*.cc -shared -lpthread -o teststoptheworld.so LD_PRELOAD=`pwd`/teststoptheworld.so /your/app */ #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX #include #include #include #include #include #include "sanitizer_common/sanitizer_stoptheworld.h" namespace { const uptr kSuspendDuration = 3; const uptr kRunDuration = 3; void Callback(const SuspendedThreadsList &suspended_threads_list, void *argument) { sleep(kSuspendDuration); } void *SuspenderThread(void *argument) { while (true) { sleep(kRunDuration); StopTheWorld(Callback, NULL); } return NULL; } __attribute__((constructor)) void StopTheWorldTestLibConstructor(void) { pthread_t thread_id; pthread_create(&thread_id, NULL, SuspenderThread, NULL); } } // namespace #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_nolibc_test.cc0000664000175000017500000000167012151122416033374 0ustar mwhudsonmwhudson//===-- sanitizer_nolibc_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Tests for libc independence of sanitizer_common. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #include "gtest/gtest.h" #include extern const char *argv0; #if SANITIZER_LINUX && defined(__x86_64__) TEST(SanitizerCommon, NolibcMain) { std::string NolibcTestPath = argv0; NolibcTestPath += "-Nolibc"; int status = system(NolibcTestPath.c_str()); EXPECT_EQ(true, WIFEXITED(status)); EXPECT_EQ(0, WEXITSTATUS(status)); } #endif ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_nolibc_test_main.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_nolibc_test_main0000664000175000017500000000122212766606132034023 0ustar mwhudsonmwhudson//===-- sanitizer_nolibc_test_main.cc -------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Tests for libc independence of sanitizer_common. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_libc.h" extern "C" void _start() { __sanitizer::internal__exit(0); } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_allocator_testlib.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_allocator_testli0000664000175000017500000001217012757703753034071 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_testlib.cc ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Malloc replacement library based on CombinedAllocator. // The primary purpose of this file is an end-to-end integration test // for CombinedAllocator. //===----------------------------------------------------------------------===// /* Usage: clang++ -std=c++11 -fno-exceptions -g -fPIC -I. -I../include -Isanitizer \ sanitizer_common/tests/sanitizer_allocator_testlib.cc \ $(\ls sanitizer_common/sanitizer_*.cc | grep -v sanitizer_common_nolibc.cc) \ sanitizer_common/sanitizer_linux_x86_64.S \ -shared -lpthread -o testmalloc.so LD_PRELOAD=`pwd`/testmalloc.so /your/app */ #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_common.h" #include #include #include #include #include #ifndef SANITIZER_MALLOC_HOOK # define SANITIZER_MALLOC_HOOK(p, s) #endif #ifndef SANITIZER_FREE_HOOK # define SANITIZER_FREE_HOOK(p) #endif static const uptr kAllocatorSpace = 0x600000000000ULL; static const uptr kAllocatorSize = 0x10000000000ULL; // 1T. struct __AP64 { static const uptr kSpaceBeg = ~(uptr)0; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 0; typedef CompactSizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = SizeClassAllocator64FlagMasks::kRandomShuffleChunks; }; namespace { typedef SizeClassAllocator64<__AP64> PrimaryAllocator; typedef SizeClassAllocatorLocalCache AllocatorCache; typedef LargeMmapAllocator<> SecondaryAllocator; typedef CombinedAllocator Allocator; static Allocator allocator; static bool global_inited; static THREADLOCAL AllocatorCache cache; static THREADLOCAL bool thread_inited; static pthread_key_t pkey; static void thread_dtor(void *v) { if ((uptr)v != 3) { pthread_setspecific(pkey, (void*)((uptr)v + 1)); return; } allocator.SwallowCache(&cache); } static size_t GetRss() { if (FILE *f = fopen("/proc/self/statm", "r")) { size_t size = 0, rss = 0; fscanf(f, "%zd %zd", &size, &rss); fclose(f); return rss << 12; // rss is in pages. } return 0; } struct AtExit { ~AtExit() { allocator.PrintStats(); Printf("RSS: %zdM\n", GetRss() >> 20); } }; static AtExit at_exit; static void NOINLINE thread_init() { if (!global_inited) { global_inited = true; allocator.Init(false /*may_return_null*/); pthread_key_create(&pkey, thread_dtor); } thread_inited = true; pthread_setspecific(pkey, (void*)1); cache.Init(nullptr); } } // namespace extern "C" { void *malloc(size_t size) { if (UNLIKELY(!thread_inited)) thread_init(); void *p = allocator.Allocate(&cache, size, 8); SANITIZER_MALLOC_HOOK(p, size); return p; } void free(void *p) { if (UNLIKELY(!thread_inited)) thread_init(); SANITIZER_FREE_HOOK(p); allocator.Deallocate(&cache, p); } void *calloc(size_t nmemb, size_t size) { if (UNLIKELY(!thread_inited)) thread_init(); size *= nmemb; void *p = allocator.Allocate(&cache, size, 8, false); memset(p, 0, size); SANITIZER_MALLOC_HOOK(p, size); return p; } void *realloc(void *p, size_t size) { if (UNLIKELY(!thread_inited)) thread_init(); if (p) { SANITIZER_FREE_HOOK(p); } p = allocator.Reallocate(&cache, p, size, 8); if (p) { SANITIZER_MALLOC_HOOK(p, size); } return p; } void *memalign(size_t alignment, size_t size) { if (UNLIKELY(!thread_inited)) thread_init(); void *p = allocator.Allocate(&cache, size, alignment); SANITIZER_MALLOC_HOOK(p, size); return p; } int posix_memalign(void **memptr, size_t alignment, size_t size) { if (UNLIKELY(!thread_inited)) thread_init(); *memptr = allocator.Allocate(&cache, size, alignment); SANITIZER_MALLOC_HOOK(*memptr, size); return 0; } void *valloc(size_t size) { if (UNLIKELY(!thread_inited)) thread_init(); if (size == 0) size = GetPageSizeCached(); void *p = allocator.Allocate(&cache, size, GetPageSizeCached()); SANITIZER_MALLOC_HOOK(p, size); return p; } void cfree(void *p) ALIAS("free"); void *pvalloc(size_t size) ALIAS("valloc"); void *__libc_memalign(size_t alignment, size_t size) ALIAS("memalign"); void malloc_usable_size() { } void mallinfo() { } void mallopt() { } } // extern "C" namespace std { struct nothrow_t; } void *operator new(size_t size) ALIAS("malloc"); void *operator new[](size_t size) ALIAS("malloc"); void *operator new(size_t size, std::nothrow_t const&) ALIAS("malloc"); void *operator new[](size_t size, std::nothrow_t const&) ALIAS("malloc"); void operator delete(void *ptr) throw() ALIAS("free"); void operator delete[](void *ptr) throw() ALIAS("free"); void operator delete(void *ptr, std::nothrow_t const&) ALIAS("free"); void operator delete[](void *ptr, std::nothrow_t const&) ALIAS("free"); golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_mutex_test.cc0000664000175000017500000000633712334404755033311 0ustar mwhudsonmwhudson//===-- sanitizer_mutex_test.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_mutex.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_pthread_wrappers.h" #include "gtest/gtest.h" #include namespace __sanitizer { template class TestData { public: explicit TestData(MutexType *mtx) : mtx_(mtx) { for (int i = 0; i < kSize; i++) data_[i] = 0; } void Write() { Lock l(mtx_); T v0 = data_[0]; for (int i = 0; i < kSize; i++) { CHECK_EQ(data_[i], v0); data_[i]++; } } void TryWrite() { if (!mtx_->TryLock()) return; T v0 = data_[0]; for (int i = 0; i < kSize; i++) { CHECK_EQ(data_[i], v0); data_[i]++; } mtx_->Unlock(); } void Backoff() { volatile T data[kSize] = {}; for (int i = 0; i < kSize; i++) { data[i]++; CHECK_EQ(data[i], 1); } } private: typedef GenericScopedLock Lock; static const int kSize = 64; typedef u64 T; MutexType *mtx_; char pad_[kCacheLineSize]; T data_[kSize]; }; const int kThreads = 8; #if SANITIZER_DEBUG const int kIters = 16*1024; #else const int kIters = 64*1024; #endif template static void *lock_thread(void *param) { TestData *data = (TestData*)param; for (int i = 0; i < kIters; i++) { data->Write(); data->Backoff(); } return 0; } template static void *try_thread(void *param) { TestData *data = (TestData*)param; for (int i = 0; i < kIters; i++) { data->TryWrite(); data->Backoff(); } return 0; } template static void check_locked(MutexType *mtx) { GenericScopedLock l(mtx); mtx->CheckLocked(); } TEST(SanitizerCommon, SpinMutex) { SpinMutex mtx; mtx.Init(); TestData data(&mtx); pthread_t threads[kThreads]; for (int i = 0; i < kThreads; i++) PTHREAD_CREATE(&threads[i], 0, lock_thread, &data); for (int i = 0; i < kThreads; i++) PTHREAD_JOIN(threads[i], 0); } TEST(SanitizerCommon, SpinMutexTry) { SpinMutex mtx; mtx.Init(); TestData data(&mtx); pthread_t threads[kThreads]; for (int i = 0; i < kThreads; i++) PTHREAD_CREATE(&threads[i], 0, try_thread, &data); for (int i = 0; i < kThreads; i++) PTHREAD_JOIN(threads[i], 0); } TEST(SanitizerCommon, BlockingMutex) { u64 mtxmem[1024] = {}; BlockingMutex *mtx = new(mtxmem) BlockingMutex(LINKER_INITIALIZED); TestData data(mtx); pthread_t threads[kThreads]; for (int i = 0; i < kThreads; i++) PTHREAD_CREATE(&threads[i], 0, lock_thread, &data); for (int i = 0; i < kThreads; i++) PTHREAD_JOIN(threads[i], 0); check_locked(mtx); } } // namespace __sanitizer ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_bitvector_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_bitvector_test.c0000664000175000017500000001152712300370320033761 0ustar mwhudsonmwhudson//===-- sanitizer_bitvector_test.cc ---------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. // Tests for sanitizer_bitvector.h. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_bitvector.h" #include "sanitizer_test_utils.h" #include "gtest/gtest.h" #include #include #include using namespace __sanitizer; using namespace std; // Check the 'bv' == 's' and that the indexes go in increasing order. // Also check the BV::Iterator template static void CheckBV(const BV &bv, const set &s) { BV t; t.copyFrom(bv); set t_s(s); uptr last_idx = bv.size(); uptr count = 0; for (typename BV::Iterator it(bv); it.hasNext();) { uptr idx = it.next(); count++; if (last_idx != bv.size()) EXPECT_LT(last_idx, idx); last_idx = idx; EXPECT_TRUE(s.count(idx)); } EXPECT_EQ(count, s.size()); last_idx = bv.size(); while (!t.empty()) { uptr idx = t.getAndClearFirstOne(); if (last_idx != bv.size()) EXPECT_LT(last_idx, idx); last_idx = idx; EXPECT_TRUE(t_s.erase(idx)); } EXPECT_TRUE(t_s.empty()); } template void Print(const BV &bv) { BV t; t.copyFrom(bv); while (!t.empty()) { uptr idx = t.getAndClearFirstOne(); fprintf(stderr, "%zd ", idx); } fprintf(stderr, "\n"); } void Print(const set &s) { for (set::iterator it = s.begin(); it != s.end(); ++it) { fprintf(stderr, "%zd ", *it); } fprintf(stderr, "\n"); } template void TestBitVector(uptr expected_size) { BV bv, bv1, t_bv; EXPECT_EQ(expected_size, BV::kSize); bv.clear(); EXPECT_TRUE(bv.empty()); bv.setBit(5); EXPECT_FALSE(bv.empty()); EXPECT_FALSE(bv.getBit(4)); EXPECT_FALSE(bv.getBit(6)); EXPECT_TRUE(bv.getBit(5)); bv.clearBit(5); EXPECT_FALSE(bv.getBit(5)); // test random bits bv.clear(); set s; for (uptr it = 0; it < 1000; it++) { uptr bit = ((uptr)my_rand() % bv.size()); EXPECT_EQ(bv.getBit(bit), s.count(bit) == 1); switch (my_rand() % 2) { case 0: EXPECT_EQ(bv.setBit(bit), s.insert(bit).second); break; case 1: size_t old_size = s.size(); s.erase(bit); EXPECT_EQ(bv.clearBit(bit), old_size > s.size()); break; } EXPECT_EQ(bv.getBit(bit), s.count(bit) == 1); } vectorbits(bv.size()); // Test setUnion, setIntersection, setDifference, // intersectsWith, and getAndClearFirstOne. for (uptr it = 0; it < 30; it++) { // iota for (size_t j = 0; j < bits.size(); j++) bits[j] = j; random_shuffle(bits.begin(), bits.end()); set s, s1, t_s; bv.clear(); bv1.clear(); uptr n_bits = ((uptr)my_rand() % bv.size()) + 1; uptr n_bits1 = (uptr)my_rand() % (bv.size() / 2); EXPECT_TRUE(n_bits > 0 && n_bits <= bv.size()); EXPECT_TRUE(n_bits1 < bv.size() / 2); for (uptr i = 0; i < n_bits; i++) { bv.setBit(bits[i]); s.insert(bits[i]); } CheckBV(bv, s); for (uptr i = 0; i < n_bits1; i++) { bv1.setBit(bits[bv.size() / 2 + i]); s1.insert(bits[bv.size() / 2 + i]); } CheckBV(bv1, s1); vector vec; set_intersection(s.begin(), s.end(), s1.begin(), s1.end(), back_insert_iterator >(vec)); EXPECT_EQ(bv.intersectsWith(bv1), !vec.empty()); // setUnion t_s = s; t_bv.copyFrom(bv); t_s.insert(s1.begin(), s1.end()); EXPECT_EQ(t_bv.setUnion(bv1), s.size() != t_s.size()); CheckBV(t_bv, t_s); // setIntersection t_s = set(vec.begin(), vec.end()); t_bv.copyFrom(bv); EXPECT_EQ(t_bv.setIntersection(bv1), s.size() != t_s.size()); CheckBV(t_bv, t_s); // setDifference vec.clear(); set_difference(s.begin(), s.end(), s1.begin(), s1.end(), back_insert_iterator >(vec)); t_s = set(vec.begin(), vec.end()); t_bv.copyFrom(bv); EXPECT_EQ(t_bv.setDifference(bv1), s.size() != t_s.size()); CheckBV(t_bv, t_s); } } TEST(SanitizerCommon, BasicBitVector) { TestBitVector >(8); TestBitVector >(16); TestBitVector >(SANITIZER_WORDSIZE); } TEST(SanitizerCommon, TwoLevelBitVector) { uptr ws = SANITIZER_WORDSIZE; TestBitVector > >(8 * 8); TestBitVector >(ws * ws); TestBitVector >(ws * ws * 2); TestBitVector >(ws * ws * 3); TestBitVector > >(16 * 16 * 3); } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_pthread_wrappers0000664000175000017500000000464512741247264034100 0ustar mwhudsonmwhudson//===-- sanitizer_pthread_wrappers.h ----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of *Sanitizer runtime. // It provides handy wrappers for thread manipulation, that: // a) assert on any failure rather than returning an error code // b) defines pthread-like interface on platforms where where // is not supplied by default. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_PTHREAD_WRAPPERS_H #define SANITIZER_PTHREAD_WRAPPERS_H #include "sanitizer_test_utils.h" #if !defined(_WIN32) # include // Simply forward the arguments and check that the pthread functions succeed. # define PTHREAD_CREATE(a, b, c, d) ASSERT_EQ(0, pthread_create(a, b, c, d)) # define PTHREAD_JOIN(a, b) ASSERT_EQ(0, pthread_join(a, b)) #else typedef HANDLE pthread_t; struct PthreadHelperCreateThreadInfo { void *(*start_routine)(void *); void *arg; }; inline DWORD WINAPI PthreadHelperThreadProc(void *arg) { PthreadHelperCreateThreadInfo *start_data = reinterpret_cast(arg); void *ret = (start_data->start_routine)(start_data->arg); delete start_data; return (DWORD)ret; } inline void PTHREAD_CREATE(pthread_t *thread, void *attr, void *(*start_routine)(void *), void *arg) { ASSERT_EQ(0, attr) << "Thread attributes are not supported yet."; PthreadHelperCreateThreadInfo *data = new PthreadHelperCreateThreadInfo; data->start_routine = start_routine; data->arg = arg; *thread = CreateThread(0, 0, PthreadHelperThreadProc, data, 0, 0); DWORD err = GetLastError(); ASSERT_NE(nullptr, *thread) << "Failed to create a thread, got error 0x" << std::hex << err; } inline void PTHREAD_JOIN(pthread_t thread, void **value_ptr) { ASSERT_EQ(0, value_ptr) << "Nonzero value_ptr is not supported yet."; ASSERT_EQ(WAIT_OBJECT_0, WaitForSingleObject(thread, INFINITE)); ASSERT_NE(0, CloseHandle(thread)); } inline void pthread_exit(void *retval) { ASSERT_EQ(0, retval) << "Nonzero retval is not supported yet."; ExitThread((DWORD)retval); } #endif // _WIN32 #endif // SANITIZER_PTHREAD_WRAPPERS_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_format_intercept0000664000175000017500000002052112334404755034060 0ustar mwhudsonmwhudson//===-- sanitizer_format_interceptor_test.cc ------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for *scanf interceptors implementation in sanitizer_common. // //===----------------------------------------------------------------------===// #include #include #include "interception/interception.h" #include "sanitizer_test_utils.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_common.h" #include "gtest/gtest.h" using namespace __sanitizer; #define COMMON_INTERCEPTOR_READ_WRITE_RANGE(ctx, ptr, size) \ do { \ ((std::vector *)ctx)->push_back(size); \ ptr = ptr; \ } while (0) #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ COMMON_INTERCEPTOR_READ_WRITE_RANGE(ctx, ptr, size) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ COMMON_INTERCEPTOR_READ_WRITE_RANGE(ctx, ptr, size) #define SANITIZER_INTERCEPT_PRINTF 1 #include "sanitizer_common/sanitizer_common_interceptors_format.inc" static const unsigned I = sizeof(int); static const unsigned L = sizeof(long); static const unsigned LL = sizeof(long long); static const unsigned S = sizeof(short); static const unsigned C = sizeof(char); static const unsigned LC = sizeof(wchar_t); static const unsigned D = sizeof(double); static const unsigned LD = sizeof(long double); static const unsigned F = sizeof(float); static const unsigned P = sizeof(char *); static void verifyFormatResults(const char *format, unsigned n, const std::vector &computed_sizes, va_list expected_sizes) { // "+ 1" because of format string ASSERT_EQ(n + 1, computed_sizes.size()) << "Unexpected number of format arguments: '" << format << "'"; for (unsigned i = 0; i < n; ++i) EXPECT_EQ(va_arg(expected_sizes, unsigned), computed_sizes[i + 1]) << "Unexpect write size for argument " << i << ", format string '" << format << "'"; } static const char test_buf[] = "Test string."; static const size_t test_buf_size = sizeof(test_buf); static const unsigned SCANF_ARGS_MAX = 16; static void testScanf3(void *ctx, int result, bool allowGnuMalloc, const char *format, ...) { va_list ap; va_start(ap, format); scanf_common(ctx, result, allowGnuMalloc, format, ap); va_end(ap); } static void testScanf2(const char *format, int scanf_result, bool allowGnuMalloc, unsigned n, va_list expected_sizes) { std::vector scanf_sizes; // 16 args should be enough. testScanf3((void *)&scanf_sizes, scanf_result, allowGnuMalloc, format, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf); verifyFormatResults(format, n, scanf_sizes, expected_sizes); } static void testScanf(const char *format, unsigned n, ...) { va_list ap; va_start(ap, n); testScanf2(format, SCANF_ARGS_MAX, /* allowGnuMalloc */ true, n, ap); va_end(ap); } static void testScanfPartial(const char *format, int scanf_result, unsigned n, ...) { va_list ap; va_start(ap, n); testScanf2(format, scanf_result, /* allowGnuMalloc */ true, n, ap); va_end(ap); } static void testScanfNoGnuMalloc(const char *format, unsigned n, ...) { va_list ap; va_start(ap, n); testScanf2(format, SCANF_ARGS_MAX, /* allowGnuMalloc */ false, n, ap); va_end(ap); } TEST(SanitizerCommonInterceptors, Scanf) { testScanf("%d", 1, I); testScanf("%d%d%d", 3, I, I, I); testScanf("ab%u%dc", 2, I, I); testScanf("%ld", 1, L); testScanf("%llu", 1, LL); testScanf("%qd", 1, LL); testScanf("a %hd%hhx", 2, S, C); testScanf("%c", 1, C); testScanf("%lc", 1, LC); testScanf("%%", 0); testScanf("a%%", 0); testScanf("a%%b", 0); testScanf("a%%%%b", 0); testScanf("a%%b%%", 0); testScanf("a%%%%%%b", 0); testScanf("a%%%%%b", 0); testScanf("a%%%%%f", 1, F); testScanf("a%%%lxb", 1, L); testScanf("a%lf%%%lxb", 2, D, L); testScanf("%nf", 1, I); testScanf("%10s", 1, 11); testScanf("%10c", 1, 10); testScanf("%10ls", 1, 11 * LC); testScanf("%10lc", 1, 10 * LC); testScanf("%%10s", 0); testScanf("%*10s", 0); testScanf("%*d", 0); testScanf("%4d%8f%c", 3, I, F, C); testScanf("%s%d", 2, test_buf_size, I); testScanf("%[abc]", 1, test_buf_size); testScanf("%4[bcdef]", 1, 5); testScanf("%[]]", 1, test_buf_size); testScanf("%8[^]%d0-9-]%c", 2, 9, C); testScanf("%*[^:]%n:%d:%1[ ]%n", 4, I, I, 2, I); testScanf("%*d%u", 1, I); testScanf("%c%d", 2, C, I); testScanf("%A%lf", 2, F, D); testScanf("%ms %Lf", 2, P, LD); testScanf("s%Las", 1, LD); testScanf("%ar", 1, F); // In the cases with std::min below the format spec can be interpreted as // either floating-something, or (GNU extension) callee-allocated string. // Our conservative implementation reports one of the two possibilities with // the least store range. testScanf("%a[", 0); testScanf("%a[]", 0); testScanf("%a[]]", 1, std::min(F, P)); testScanf("%a[abc]", 1, std::min(F, P)); testScanf("%a[^abc]", 1, std::min(F, P)); testScanf("%a[ab%c] %d", 0); testScanf("%a[^ab%c] %d", 0); testScanf("%as", 1, std::min(F, P)); testScanf("%aS", 1, std::min(F, P)); testScanf("%a13S", 1, std::min(F, P)); testScanf("%alS", 1, std::min(F, P)); testScanfNoGnuMalloc("s%Las", 1, LD); testScanfNoGnuMalloc("%ar", 1, F); testScanfNoGnuMalloc("%a[", 1, F); testScanfNoGnuMalloc("%a[]", 1, F); testScanfNoGnuMalloc("%a[]]", 1, F); testScanfNoGnuMalloc("%a[abc]", 1, F); testScanfNoGnuMalloc("%a[^abc]", 1, F); testScanfNoGnuMalloc("%a[ab%c] %d", 3, F, C, I); testScanfNoGnuMalloc("%a[^ab%c] %d", 3, F, C, I); testScanfNoGnuMalloc("%as", 1, F); testScanfNoGnuMalloc("%aS", 1, F); testScanfNoGnuMalloc("%a13S", 1, F); testScanfNoGnuMalloc("%alS", 1, F); testScanf("%5$d", 0); testScanf("%md", 0); testScanf("%m10s", 0); testScanfPartial("%d%d%d%d //1\n", 1, 1, I); testScanfPartial("%d%d%d%d //2\n", 2, 2, I, I); testScanfPartial("%d%d%d%d //3\n", 3, 3, I, I, I); testScanfPartial("%d%d%d%d //4\n", 4, 4, I, I, I, I); testScanfPartial("%d%n%n%d //1\n", 1, 3, I, I, I); testScanfPartial("%d%n%n%d //2\n", 2, 4, I, I, I, I); testScanfPartial("%d%n%n%d %s %s", 3, 5, I, I, I, I, test_buf_size); testScanfPartial("%d%n%n%d %s %s", 4, 6, I, I, I, I, test_buf_size, test_buf_size); } static void testPrintf3(void *ctx, const char *format, ...) { va_list ap; va_start(ap, format); printf_common(ctx, format, ap); va_end(ap); } static void testPrintf2(const char *format, unsigned n, va_list expected_sizes) { std::vector printf_sizes; // 16 args should be enough. testPrintf3((void *)&printf_sizes, format, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf, test_buf); verifyFormatResults(format, n, printf_sizes, expected_sizes); } static void testPrintf(const char *format, unsigned n, ...) { va_list ap; va_start(ap, n); testPrintf2(format, n, ap); va_end(ap); } TEST(SanitizerCommonInterceptors, Printf) { // Only test functionality which differs from scanf // Indexed arguments testPrintf("%5$d", 0); testPrintf("%.*5$d", 0); // errno testPrintf("%0-m", 0); // Dynamic width testPrintf("%*n", 1, I); testPrintf("%*.10n", 1, I); // Precision testPrintf("%10.10n", 1, I); testPrintf("%.3s", 1, 3); testPrintf("%.20s", 1, test_buf_size); // Dynamic precision testPrintf("%.*n", 1, I); testPrintf("%10.*n", 1, I); // Dynamic precision for strings is not implemented yet. testPrintf("%.*s", 1, 0); // Checks for wide-character strings are not implemented yet. testPrintf("%ls", 1, 0); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_common_test.cc0000664000175000017500000001716112623664550033436 0ustar mwhudsonmwhudson//===-- sanitizer_common_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_platform.h" #include "sanitizer_pthread_wrappers.h" #include "gtest/gtest.h" namespace __sanitizer { static bool IsSorted(const uptr *array, uptr n) { for (uptr i = 1; i < n; i++) { if (array[i] < array[i - 1]) return false; } return true; } TEST(SanitizerCommon, SortTest) { uptr array[100]; uptr n = 100; // Already sorted. for (uptr i = 0; i < n; i++) { array[i] = i; } SortArray(array, n); EXPECT_TRUE(IsSorted(array, n)); // Reverse order. for (uptr i = 0; i < n; i++) { array[i] = n - 1 - i; } SortArray(array, n); EXPECT_TRUE(IsSorted(array, n)); // Mixed order. for (uptr i = 0; i < n; i++) { array[i] = (i % 2 == 0) ? i : n - 1 - i; } SortArray(array, n); EXPECT_TRUE(IsSorted(array, n)); // All equal. for (uptr i = 0; i < n; i++) { array[i] = 42; } SortArray(array, n); EXPECT_TRUE(IsSorted(array, n)); // All but one sorted. for (uptr i = 0; i < n - 1; i++) { array[i] = i; } array[n - 1] = 42; SortArray(array, n); EXPECT_TRUE(IsSorted(array, n)); // Minimal case - sort three elements. array[0] = 1; array[1] = 0; SortArray(array, 2); EXPECT_TRUE(IsSorted(array, 2)); } TEST(SanitizerCommon, MmapAlignedOrDie) { uptr PageSize = GetPageSizeCached(); for (uptr size = 1; size <= 32; size *= 2) { for (uptr alignment = 1; alignment <= 32; alignment *= 2) { for (int iter = 0; iter < 100; iter++) { uptr res = (uptr)MmapAlignedOrDie( size * PageSize, alignment * PageSize, "MmapAlignedOrDieTest"); EXPECT_EQ(0U, res % (alignment * PageSize)); internal_memset((void*)res, 1, size * PageSize); UnmapOrDie((void*)res, size * PageSize); } } } } #if SANITIZER_LINUX TEST(SanitizerCommon, SanitizerSetThreadName) { const char *names[] = { "0123456789012", "01234567890123", "012345678901234", // Larger names will be truncated on linux. }; for (size_t i = 0; i < ARRAY_SIZE(names); i++) { EXPECT_TRUE(SanitizerSetThreadName(names[i])); char buff[100]; EXPECT_TRUE(SanitizerGetThreadName(buff, sizeof(buff) - 1)); EXPECT_EQ(0, internal_strcmp(buff, names[i])); } } #endif TEST(SanitizerCommon, InternalMmapVector) { InternalMmapVector vector(1); for (uptr i = 0; i < 100; i++) { EXPECT_EQ(i, vector.size()); vector.push_back(i); } for (uptr i = 0; i < 100; i++) { EXPECT_EQ(i, vector[i]); } for (int i = 99; i >= 0; i--) { EXPECT_EQ((uptr)i, vector.back()); vector.pop_back(); EXPECT_EQ((uptr)i, vector.size()); } InternalMmapVector empty_vector(0); CHECK_GT(empty_vector.capacity(), 0U); CHECK_EQ(0U, empty_vector.size()); } void TestThreadInfo(bool main) { uptr stk_addr = 0; uptr stk_size = 0; uptr tls_addr = 0; uptr tls_size = 0; GetThreadStackAndTls(main, &stk_addr, &stk_size, &tls_addr, &tls_size); int stack_var; EXPECT_NE(stk_addr, (uptr)0); EXPECT_NE(stk_size, (uptr)0); EXPECT_GT((uptr)&stack_var, stk_addr); EXPECT_LT((uptr)&stack_var, stk_addr + stk_size); #if SANITIZER_LINUX && defined(__x86_64__) static __thread int thread_var; EXPECT_NE(tls_addr, (uptr)0); EXPECT_NE(tls_size, (uptr)0); EXPECT_GT((uptr)&thread_var, tls_addr); EXPECT_LT((uptr)&thread_var, tls_addr + tls_size); // Ensure that tls and stack do not intersect. uptr tls_end = tls_addr + tls_size; EXPECT_TRUE(tls_addr < stk_addr || tls_addr >= stk_addr + stk_size); EXPECT_TRUE(tls_end < stk_addr || tls_end >= stk_addr + stk_size); EXPECT_TRUE((tls_addr < stk_addr) == (tls_end < stk_addr)); #endif } static void *WorkerThread(void *arg) { TestThreadInfo(false); return 0; } TEST(SanitizerCommon, ThreadStackTlsMain) { InitTlsSize(); TestThreadInfo(true); } TEST(SanitizerCommon, ThreadStackTlsWorker) { InitTlsSize(); pthread_t t; PTHREAD_CREATE(&t, 0, WorkerThread, 0); PTHREAD_JOIN(t, 0); } bool UptrLess(uptr a, uptr b) { return a < b; } TEST(SanitizerCommon, InternalBinarySearch) { static const uptr kSize = 5; uptr arr[kSize]; for (uptr i = 0; i < kSize; i++) arr[i] = i * i; for (uptr i = 0; i < kSize; i++) ASSERT_EQ(InternalBinarySearch(arr, 0, kSize, i * i, UptrLess), i); ASSERT_EQ(InternalBinarySearch(arr, 0, kSize, 7, UptrLess), kSize + 1); } #if SANITIZER_LINUX && !SANITIZER_ANDROID TEST(SanitizerCommon, FindPathToBinary) { char *true_path = FindPathToBinary("true"); EXPECT_NE((char*)0, internal_strstr(true_path, "/bin/true")); InternalFree(true_path); EXPECT_EQ(0, FindPathToBinary("unexisting_binary.ergjeorj")); } #elif SANITIZER_WINDOWS TEST(SanitizerCommon, FindPathToBinary) { // ntdll.dll should be on PATH in all supported test environments on all // supported Windows versions. char *ntdll_path = FindPathToBinary("ntdll.dll"); EXPECT_NE((char*)0, internal_strstr(ntdll_path, "ntdll.dll")); InternalFree(ntdll_path); EXPECT_EQ(0, FindPathToBinary("unexisting_binary.ergjeorj")); } #endif TEST(SanitizerCommon, StripPathPrefix) { EXPECT_EQ(0, StripPathPrefix(0, "prefix")); EXPECT_STREQ("foo", StripPathPrefix("foo", 0)); EXPECT_STREQ("dir/file.cc", StripPathPrefix("/usr/lib/dir/file.cc", "/usr/lib/")); EXPECT_STREQ("/file.cc", StripPathPrefix("/usr/myroot/file.cc", "/myroot")); EXPECT_STREQ("file.h", StripPathPrefix("/usr/lib/./file.h", "/usr/lib/")); } TEST(SanitizerCommon, RemoveANSIEscapeSequencesFromString) { RemoveANSIEscapeSequencesFromString(nullptr); const char *buffs[22] = { "Default", "Default", "\033[95mLight magenta", "Light magenta", "\033[30mBlack\033[32mGreen\033[90mGray", "BlackGreenGray", "\033[106mLight cyan \033[107mWhite ", "Light cyan White ", "\033[31mHello\033[0m World", "Hello World", "\033[38;5;82mHello \033[38;5;198mWorld", "Hello World", "123[653456789012", "123[653456789012", "Normal \033[5mBlink \033[25mNormal", "Normal Blink Normal", "\033[106m\033[107m", "", "", "", " ", " ", }; for (size_t i = 0; i < ARRAY_SIZE(buffs); i+=2) { char *buffer_copy = internal_strdup(buffs[i]); RemoveANSIEscapeSequencesFromString(buffer_copy); EXPECT_STREQ(buffer_copy, buffs[i+1]); InternalFree(buffer_copy); } } TEST(SanitizerCommon, InternalScopedString) { InternalScopedString str(10); EXPECT_EQ(0U, str.length()); EXPECT_STREQ("", str.data()); str.append("foo"); EXPECT_EQ(3U, str.length()); EXPECT_STREQ("foo", str.data()); int x = 1234; str.append("%d", x); EXPECT_EQ(7U, str.length()); EXPECT_STREQ("foo1234", str.data()); str.append("%d", x); EXPECT_EQ(9U, str.length()); EXPECT_STREQ("foo123412", str.data()); str.clear(); EXPECT_EQ(0U, str.length()); EXPECT_STREQ("", str.data()); str.append("0123456789"); EXPECT_EQ(9U, str.length()); EXPECT_STREQ("012345678", str.data()); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_flags_test.cc0000664000175000017500000001077412735233221033234 0ustar mwhudsonmwhudson//===-- sanitizer_flags_test.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_allocator_internal.h" #include "gtest/gtest.h" #include namespace __sanitizer { static const char kFlagName[] = "flag_name"; static const char kFlagDesc[] = "flag description"; template static void TestFlag(T start_value, const char *env, T final_value) { T flag = start_value; FlagParser parser; RegisterFlag(&parser, kFlagName, kFlagDesc, &flag); parser.ParseString(env); EXPECT_EQ(final_value, flag); } template <> void TestFlag(const char *start_value, const char *env, const char *final_value) { const char *flag = start_value; FlagParser parser; RegisterFlag(&parser, kFlagName, kFlagDesc, &flag); parser.ParseString(env); EXPECT_EQ(0, internal_strcmp(final_value, flag)); // Reporting unrecognized flags is needed to reset them. ReportUnrecognizedFlags(); } TEST(SanitizerCommon, BooleanFlags) { TestFlag(false, "flag_name=1", true); TestFlag(false, "flag_name=yes", true); TestFlag(false, "flag_name=true", true); TestFlag(true, "flag_name=0", false); TestFlag(true, "flag_name=no", false); TestFlag(true, "flag_name=false", false); } TEST(SanitizerCommon, IntFlags) { TestFlag(-11, 0, -11); TestFlag(-11, "flag_name=0", 0); TestFlag(-11, "flag_name=42", 42); TestFlag(-11, "flag_name=-42", -42); // Unrecognized flags are ignored. TestFlag(-11, "--flag_name=42", -11); TestFlag(-11, "zzzzzzz=42", -11); EXPECT_DEATH(TestFlag(-11, "flag_name", 0), "expected '='"); EXPECT_DEATH(TestFlag(-11, "flag_name=42U", 0), "Invalid value for int option"); } TEST(SanitizerCommon, StrFlags) { TestFlag("zzz", 0, "zzz"); TestFlag("zzz", "flag_name=", ""); TestFlag("zzz", "flag_name=abc", "abc"); TestFlag("", "flag_name=abc", "abc"); TestFlag("", "flag_name='abc zxc'", "abc zxc"); // TestStrFlag("", "flag_name=\"abc qwe\" asd", "abc qwe"); } static void TestTwoFlags(const char *env, bool expected_flag1, const char *expected_flag2, const char *name1 = "flag1", const char *name2 = "flag2") { bool flag1 = !expected_flag1; const char *flag2 = ""; FlagParser parser; RegisterFlag(&parser, name1, kFlagDesc, &flag1); RegisterFlag(&parser, name2, kFlagDesc, &flag2); parser.ParseString(env); EXPECT_EQ(expected_flag1, flag1); EXPECT_EQ(0, internal_strcmp(flag2, expected_flag2)); // Reporting unrecognized flags is needed to reset them. ReportUnrecognizedFlags(); } TEST(SanitizerCommon, MultipleFlags) { TestTwoFlags("flag1=1 flag2='zzz'", true, "zzz"); TestTwoFlags("flag2='qxx' flag1=0", false, "qxx"); TestTwoFlags("flag1=false:flag2='zzz'", false, "zzz"); TestTwoFlags("flag2=qxx:flag1=yes", true, "qxx"); TestTwoFlags("flag2=qxx\nflag1=yes", true, "qxx"); TestTwoFlags("flag2=qxx\r\nflag1=yes", true, "qxx"); TestTwoFlags("flag2=qxx\tflag1=yes", true, "qxx"); } TEST(SanitizerCommon, CommonSuffixFlags) { TestTwoFlags("flag=1 other_flag='zzz'", true, "zzz", "flag", "other_flag"); TestTwoFlags("other_flag='zzz' flag=1", true, "zzz", "flag", "other_flag"); TestTwoFlags("other_flag=' flag=0 ' flag=1", true, " flag=0 ", "flag", "other_flag"); TestTwoFlags("flag=1 other_flag=' flag=0 '", true, " flag=0 ", "flag", "other_flag"); } TEST(SanitizerCommon, CommonFlags) { CommonFlags cf; FlagParser parser; RegisterCommonFlags(&parser, &cf); cf.SetDefaults(); EXPECT_TRUE(cf.symbolize); EXPECT_STREQ(".", cf.coverage_dir); cf.symbolize = false; cf.coverage = true; cf.coverage_direct = true; cf.log_path = "path/one"; parser.ParseString("symbolize=1:coverage_direct=false log_path='path/two'"); EXPECT_TRUE(cf.symbolize); EXPECT_TRUE(cf.coverage); EXPECT_FALSE(cf.coverage_direct); EXPECT_STREQ("path/two", cf.log_path); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/CMakeLists.txt0000664000175000017500000002146213004235372031235 0ustar mwhudsonmwhudsoninclude(CompilerRTCompile) clang_compiler_add_cxx_check() # FIXME: use SANITIZER_COMMON_SUPPORTED_ARCH here filter_available_targets(SANITIZER_UNITTEST_SUPPORTED_ARCH x86_64 i386 mips64 mips64el) if(APPLE) darwin_filter_host_archs(SANITIZER_UNITTEST_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) endif() set(SANITIZER_UNITTESTS sanitizer_allocator_test.cc sanitizer_atomic_test.cc sanitizer_bitvector_test.cc sanitizer_bvgraph_test.cc sanitizer_common_test.cc sanitizer_deadlock_detector_test.cc sanitizer_flags_test.cc sanitizer_format_interceptor_test.cc sanitizer_ioctl_test.cc sanitizer_libc_test.cc sanitizer_linux_test.cc sanitizer_list_test.cc sanitizer_mutex_test.cc sanitizer_nolibc_test.cc sanitizer_posix_test.cc sanitizer_printf_test.cc sanitizer_procmaps_test.cc sanitizer_stackdepot_test.cc sanitizer_stacktrace_printer_test.cc sanitizer_stacktrace_test.cc sanitizer_stoptheworld_test.cc sanitizer_suppressions_test.cc sanitizer_symbolizer_test.cc sanitizer_test_main.cc sanitizer_thread_registry_test.cc) set(SANITIZER_TEST_HEADERS sanitizer_pthread_wrappers.h sanitizer_test_config.h sanitizer_test_utils.h) foreach(header ${SANITIZER_HEADERS}) list(APPEND SANITIZER_TEST_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../${header}) endforeach() set(SANITIZER_TEST_CFLAGS_COMMON ${COMPILER_RT_UNITTEST_CFLAGS} ${COMPILER_RT_GTEST_CFLAGS} -I${COMPILER_RT_SOURCE_DIR}/include -I${COMPILER_RT_SOURCE_DIR}/lib -I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common -fno-rtti -O2 -Werror=sign-compare -Wno-non-virtual-dtor) if(MSVC) # Disable exceptions on Windows until they work reliably. list(APPEND SANITIZER_TEST_CFLAGS_COMMON -fno-exceptions -DGTEST_HAS_SEH=0) endif() # -gline-tables-only must be enough for these tests, so use it if possible. if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang") list(APPEND SANITIZER_TEST_CFLAGS_COMMON -gline-tables-only) else() list(APPEND SANITIZER_TEST_CFLAGS_COMMON -g) endif() if(MSVC) list(APPEND SANITIZER_TEST_CFLAGS_COMMON -gcodeview) endif() list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -g) if(NOT MSVC) list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON --driver-mode=g++) endif() if(ANDROID) list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -pie) endif() if(APPLE) list(APPEND SANITIZER_TEST_CFLAGS_COMMON ${DARWIN_osx_CFLAGS}) list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON ${DARWIN_osx_LINKFLAGS}) endif() # MSVC linker is allocating 1M for the stack by default, which is not # enough for the unittests. Some unittests require more than 2M. # The default stack size for clang is 8M. if(MSVC) list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -Wl,/STACK:0xC00000) endif() set(SANITIZER_TEST_LINK_LIBS) append_list_if(COMPILER_RT_HAS_LIBLOG log SANITIZER_TEST_LINK_LIBS) # NDK r10 requires -latomic almost always. append_list_if(ANDROID atomic SANITIZER_TEST_LINK_LIBS) append_list_if(COMPILER_RT_HAS_LIBDL -ldl SANITIZER_TEST_LINK_FLAGS_COMMON) append_list_if(COMPILER_RT_HAS_LIBRT -lrt SANITIZER_TEST_LINK_FLAGS_COMMON) append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SANITIZER_TEST_LINK_FLAGS_COMMON) # x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests. Also, # 'libm' shall be specified explicitly to build i386 tests. if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE") list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON "-lc++ -lm") endif() include_directories(..) include_directories(../..) # Adds static library which contains sanitizer_common object file # (universal binary on Mac and arch-specific object files on Linux). macro(add_sanitizer_common_lib library) add_library(${library} STATIC ${ARGN}) set_target_properties(${library} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} FOLDER "Compiler-RT Runtime tests") endmacro() function(get_sanitizer_common_lib_for_arch arch lib lib_name) if(APPLE) set(tgt_name "RTSanitizerCommon.test.osx") else() set(tgt_name "RTSanitizerCommon.test.${arch}") endif() set(${lib} "${tgt_name}" PARENT_SCOPE) if(CMAKE_CONFIGURATION_TYPES) set(configuration_path "${CMAKE_CFG_INTDIR}/") else() set(configuration_path "") endif() if(NOT MSVC) set(${lib_name} "${configuration_path}lib${tgt_name}.a" PARENT_SCOPE) else() set(${lib_name} "${configuration_path}${tgt_name}.lib" PARENT_SCOPE) endif() endfunction() # Sanitizer_common unit tests testsuite. add_custom_target(SanitizerUnitTests) set_target_properties(SanitizerUnitTests PROPERTIES FOLDER "Compiler-RT Tests") # Adds sanitizer tests for architecture. macro(add_sanitizer_tests_for_arch arch) get_target_flags_for_arch(${arch} TARGET_FLAGS) set(SANITIZER_TEST_SOURCES ${SANITIZER_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE}) set(SANITIZER_TEST_COMPILE_DEPS ${SANITIZER_TEST_HEADERS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SANITIZER_TEST_COMPILE_DEPS gtest) endif() set(SANITIZER_TEST_OBJECTS) foreach(source ${SANITIZER_TEST_SOURCES}) get_filename_component(basename ${source} NAME) if(CMAKE_CONFIGURATION_TYPES) set(output_obj "${CMAKE_CFG_INTDIR}/${basename}.${arch}.o") else() set(output_obj "${basename}.${arch}.o") endif() clang_compile(${output_obj} ${source} CFLAGS ${SANITIZER_TEST_CFLAGS_COMMON} ${TARGET_FLAGS} DEPS ${SANITIZER_TEST_COMPILE_DEPS}) list(APPEND SANITIZER_TEST_OBJECTS ${output_obj}) endforeach() get_sanitizer_common_lib_for_arch(${arch} SANITIZER_COMMON_LIB SANITIZER_COMMON_LIB_NAME) # Add unittest target. set(SANITIZER_TEST_NAME "Sanitizer-${arch}-Test") add_compiler_rt_test(SanitizerUnitTests ${SANITIZER_TEST_NAME} OBJECTS ${SANITIZER_TEST_OBJECTS} ${SANITIZER_COMMON_LIB_NAME} DEPS ${SANITIZER_TEST_OBJECTS} ${SANITIZER_COMMON_LIB} LINK_FLAGS ${SANITIZER_TEST_LINK_FLAGS_COMMON} ${TARGET_FLAGS}) if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND "${arch}" STREQUAL "x86_64") # Test that the libc-independent part of sanitizer_common is indeed # independent of libc, by linking this binary without libc (here) and # executing it (unit test in sanitizer_nolibc_test.cc). clang_compile(sanitizer_nolibc_test_main.${arch}.o sanitizer_nolibc_test_main.cc CFLAGS ${SANITIZER_TEST_CFLAGS_COMMON} ${TARGET_FLAGS} DEPS ${SANITIZER_TEST_COMPILE_DEPS}) add_compiler_rt_test(SanitizerUnitTests "Sanitizer-${arch}-Test-Nolibc" OBJECTS sanitizer_nolibc_test_main.${arch}.o -Wl,-whole-archive libRTSanitizerCommon.test.nolibc.${arch}.a -Wl,-no-whole-archive DEPS sanitizer_nolibc_test_main.${arch}.o RTSanitizerCommon.test.nolibc.${arch} LINK_FLAGS -nostdlib ${TARGET_FLAGS}) endif() endmacro() if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID) # We use just-built clang to build sanitizer_common unittests, so we must # be sure that produced binaries would work. if(APPLE) add_sanitizer_common_lib("RTSanitizerCommon.test.osx" $ $) else() if(CAN_TARGET_x86_64) add_sanitizer_common_lib("RTSanitizerCommon.test.nolibc.x86_64" $ $) endif() foreach(arch ${SANITIZER_UNITTEST_SUPPORTED_ARCH}) add_sanitizer_common_lib("RTSanitizerCommon.test.${arch}" $ $) endforeach() endif() foreach(arch ${SANITIZER_UNITTEST_SUPPORTED_ARCH}) add_sanitizer_tests_for_arch(${arch}) endforeach() endif() if(ANDROID) foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH}) add_executable(SanitizerTest ${SANITIZER_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE} $ $) set_target_compile_flags(SanitizerTest ${SANITIZER_COMMON_CFLAGS} ${SANITIZER_TEST_CFLAGS_COMMON}) # Setup correct output directory and link flags. set_target_properties(SanitizerTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_target_link_flags(SanitizerTest ${SANITIZER_TEST_LINK_FLAGS_COMMON}) target_link_libraries(SanitizerTest ${SANITIZER_TEST_LINK_LIBS}) # Add unit test to test suite. add_dependencies(SanitizerUnitTests SanitizerTest) endforeach() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_list_test.cc0000664000175000017500000000676512075010402033107 0ustar mwhudsonmwhudson//===-- sanitizer_list_test.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_list.h" #include "gtest/gtest.h" namespace __sanitizer { struct ListItem { ListItem *next; }; typedef IntrusiveList List; static List static_list; static void SetList(List *l, ListItem *x = 0, ListItem *y = 0, ListItem *z = 0) { l->clear(); if (x) l->push_back(x); if (y) l->push_back(y); if (z) l->push_back(z); } static void CheckList(List *l, ListItem *i1, ListItem *i2 = 0, ListItem *i3 = 0, ListItem *i4 = 0, ListItem *i5 = 0, ListItem *i6 = 0) { if (i1) { CHECK_EQ(l->front(), i1); l->pop_front(); } if (i2) { CHECK_EQ(l->front(), i2); l->pop_front(); } if (i3) { CHECK_EQ(l->front(), i3); l->pop_front(); } if (i4) { CHECK_EQ(l->front(), i4); l->pop_front(); } if (i5) { CHECK_EQ(l->front(), i5); l->pop_front(); } if (i6) { CHECK_EQ(l->front(), i6); l->pop_front(); } CHECK(l->empty()); } TEST(SanitizerCommon, IntrusiveList) { ListItem items[6]; CHECK_EQ(static_list.size(), 0); List l; l.clear(); ListItem *x = &items[0]; ListItem *y = &items[1]; ListItem *z = &items[2]; ListItem *a = &items[3]; ListItem *b = &items[4]; ListItem *c = &items[5]; CHECK_EQ(l.size(), 0); l.push_back(x); CHECK_EQ(l.size(), 1); CHECK_EQ(l.back(), x); CHECK_EQ(l.front(), x); l.pop_front(); CHECK(l.empty()); l.CheckConsistency(); l.push_front(x); CHECK_EQ(l.size(), 1); CHECK_EQ(l.back(), x); CHECK_EQ(l.front(), x); l.pop_front(); CHECK(l.empty()); l.CheckConsistency(); l.push_front(x); l.push_front(y); l.push_front(z); CHECK_EQ(l.size(), 3); CHECK_EQ(l.front(), z); CHECK_EQ(l.back(), x); l.CheckConsistency(); l.pop_front(); CHECK_EQ(l.size(), 2); CHECK_EQ(l.front(), y); CHECK_EQ(l.back(), x); l.pop_front(); l.pop_front(); CHECK(l.empty()); l.CheckConsistency(); l.push_back(x); l.push_back(y); l.push_back(z); CHECK_EQ(l.size(), 3); CHECK_EQ(l.front(), x); CHECK_EQ(l.back(), z); l.CheckConsistency(); l.pop_front(); CHECK_EQ(l.size(), 2); CHECK_EQ(l.front(), y); CHECK_EQ(l.back(), z); l.pop_front(); l.pop_front(); CHECK(l.empty()); l.CheckConsistency(); List l1, l2; l1.clear(); l2.clear(); l1.append_front(&l2); CHECK(l1.empty()); CHECK(l2.empty()); l1.append_back(&l2); CHECK(l1.empty()); CHECK(l2.empty()); SetList(&l1, x); CheckList(&l1, x); SetList(&l1, x, y, z); SetList(&l2, a, b, c); l1.append_back(&l2); CheckList(&l1, x, y, z, a, b, c); CHECK(l2.empty()); SetList(&l1, x, y); SetList(&l2); l1.append_front(&l2); CheckList(&l1, x, y); CHECK(l2.empty()); } TEST(SanitizerCommon, IntrusiveListAppendEmpty) { ListItem i; List l; l.clear(); l.push_back(&i); List l2; l2.clear(); l.append_back(&l2); CHECK_EQ(l.back(), &i); CHECK_EQ(l.front(), &i); CHECK_EQ(l.size(), 1); l.append_front(&l2); CHECK_EQ(l.back(), &i); CHECK_EQ(l.front(), &i); CHECK_EQ(l.size(), 1); } } // namespace __sanitizer ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stackdepot_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stackdepot_test.0000664000175000017500000000552712423111513033764 0ustar mwhudsonmwhudson//===-- sanitizer_stackdepot_test.cc --------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_libc.h" #include "gtest/gtest.h" namespace __sanitizer { TEST(SanitizerCommon, StackDepotBasic) { uptr array[] = {1, 2, 3, 4, 5}; StackTrace s1(array, ARRAY_SIZE(array)); u32 i1 = StackDepotPut(s1); StackTrace stack = StackDepotGet(i1); EXPECT_NE(stack.trace, (uptr*)0); EXPECT_EQ(ARRAY_SIZE(array), stack.size); EXPECT_EQ(0, internal_memcmp(stack.trace, array, sizeof(array))); } TEST(SanitizerCommon, StackDepotAbsent) { StackTrace stack = StackDepotGet((1 << 30) - 1); EXPECT_EQ((uptr*)0, stack.trace); } TEST(SanitizerCommon, StackDepotEmptyStack) { u32 i1 = StackDepotPut(StackTrace()); StackTrace stack = StackDepotGet(i1); EXPECT_EQ((uptr*)0, stack.trace); } TEST(SanitizerCommon, StackDepotZeroId) { StackTrace stack = StackDepotGet(0); EXPECT_EQ((uptr*)0, stack.trace); } TEST(SanitizerCommon, StackDepotSame) { uptr array[] = {1, 2, 3, 4, 6}; StackTrace s1(array, ARRAY_SIZE(array)); u32 i1 = StackDepotPut(s1); u32 i2 = StackDepotPut(s1); EXPECT_EQ(i1, i2); StackTrace stack = StackDepotGet(i1); EXPECT_NE(stack.trace, (uptr*)0); EXPECT_EQ(ARRAY_SIZE(array), stack.size); EXPECT_EQ(0, internal_memcmp(stack.trace, array, sizeof(array))); } TEST(SanitizerCommon, StackDepotSeveral) { uptr array1[] = {1, 2, 3, 4, 7}; StackTrace s1(array1, ARRAY_SIZE(array1)); u32 i1 = StackDepotPut(s1); uptr array2[] = {1, 2, 3, 4, 8, 9}; StackTrace s2(array2, ARRAY_SIZE(array2)); u32 i2 = StackDepotPut(s2); EXPECT_NE(i1, i2); } TEST(SanitizerCommon, StackDepotReverseMap) { uptr array1[] = {1, 2, 3, 4, 5}; uptr array2[] = {7, 1, 3, 0}; uptr array3[] = {10, 2, 5, 3}; uptr array4[] = {1, 3, 2, 5}; u32 ids[4] = {0}; StackTrace s1(array1, ARRAY_SIZE(array1)); StackTrace s2(array2, ARRAY_SIZE(array2)); StackTrace s3(array3, ARRAY_SIZE(array3)); StackTrace s4(array4, ARRAY_SIZE(array4)); ids[0] = StackDepotPut(s1); ids[1] = StackDepotPut(s2); ids[2] = StackDepotPut(s3); ids[3] = StackDepotPut(s4); StackDepotReverseMap map; for (uptr i = 0; i < 4; i++) { StackTrace stack = StackDepotGet(ids[i]); StackTrace from_map = map.Get(ids[i]); EXPECT_EQ(stack.size, from_map.size); EXPECT_EQ(stack.trace, from_map.trace); } } } // namespace __sanitizer ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_thread_registry_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_thread_registry_0000664000175000017500000001660312735227246034062 0ustar mwhudsonmwhudson//===-- sanitizer_thread_registry_test.cc ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of shared sanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_thread_registry.h" #include "sanitizer_pthread_wrappers.h" #include "gtest/gtest.h" #include namespace __sanitizer { static BlockingMutex tctx_allocator_lock(LINKER_INITIALIZED); static LowLevelAllocator tctx_allocator; template static ThreadContextBase *GetThreadContext(u32 tid) { BlockingMutexLock l(&tctx_allocator_lock); return new(tctx_allocator) TCTX(tid); } static const u32 kMaxRegistryThreads = 1000; static const u32 kRegistryQuarantine = 2; static void CheckThreadQuantity(ThreadRegistry *registry, uptr exp_total, uptr exp_running, uptr exp_alive) { uptr total, running, alive; registry->GetNumberOfThreads(&total, &running, &alive); EXPECT_EQ(exp_total, total); EXPECT_EQ(exp_running, running); EXPECT_EQ(exp_alive, alive); } static bool is_detached(u32 tid) { return (tid % 2 == 0); } static uptr get_uid(u32 tid) { return tid * 2; } static bool HasName(ThreadContextBase *tctx, void *arg) { char *name = (char*)arg; return (0 == internal_strcmp(tctx->name, name)); } static bool HasUid(ThreadContextBase *tctx, void *arg) { uptr uid = (uptr)arg; return (tctx->user_id == uid); } static void MarkUidAsPresent(ThreadContextBase *tctx, void *arg) { bool *arr = (bool*)arg; arr[tctx->tid] = true; } static void TestRegistry(ThreadRegistry *registry, bool has_quarantine) { // Create and start a main thread. EXPECT_EQ(0U, registry->CreateThread(get_uid(0), true, -1, 0)); registry->StartThread(0, 0, 0); // Create a bunch of threads. for (u32 i = 1; i <= 10; i++) { EXPECT_EQ(i, registry->CreateThread(get_uid(i), is_detached(i), 0, 0)); } CheckThreadQuantity(registry, 11, 1, 11); // Start some of them. for (u32 i = 1; i <= 5; i++) { registry->StartThread(i, 0, 0); } CheckThreadQuantity(registry, 11, 6, 11); // Finish, create and start more threads. for (u32 i = 1; i <= 5; i++) { registry->FinishThread(i); if (!is_detached(i)) registry->JoinThread(i, 0); } for (u32 i = 6; i <= 10; i++) { registry->StartThread(i, 0, 0); } std::vector new_tids; for (u32 i = 11; i <= 15; i++) { new_tids.push_back( registry->CreateThread(get_uid(i), is_detached(i), 0, 0)); } ASSERT_LE(kRegistryQuarantine, 5U); u32 exp_total = 16 - (has_quarantine ? 5 - kRegistryQuarantine : 0); CheckThreadQuantity(registry, exp_total, 6, 11); // Test SetThreadName and FindThread. registry->SetThreadName(6, "six"); registry->SetThreadName(7, "seven"); EXPECT_EQ(7U, registry->FindThread(HasName, (void*)"seven")); EXPECT_EQ(ThreadRegistry::kUnknownTid, registry->FindThread(HasName, (void*)"none")); EXPECT_EQ(0U, registry->FindThread(HasUid, (void*)get_uid(0))); EXPECT_EQ(10U, registry->FindThread(HasUid, (void*)get_uid(10))); EXPECT_EQ(ThreadRegistry::kUnknownTid, registry->FindThread(HasUid, (void*)0x1234)); // Detach and finish and join remaining threads. for (u32 i = 6; i <= 10; i++) { registry->DetachThread(i, 0); registry->FinishThread(i); } for (u32 i = 0; i < new_tids.size(); i++) { u32 tid = new_tids[i]; registry->StartThread(tid, 0, 0); registry->DetachThread(tid, 0); registry->FinishThread(tid); } CheckThreadQuantity(registry, exp_total, 1, 1); // Test methods that require the caller to hold a ThreadRegistryLock. bool has_tid[16]; internal_memset(&has_tid[0], 0, sizeof(has_tid)); { ThreadRegistryLock l(registry); registry->RunCallbackForEachThreadLocked(MarkUidAsPresent, &has_tid[0]); } for (u32 i = 0; i < exp_total; i++) { EXPECT_TRUE(has_tid[i]); } { ThreadRegistryLock l(registry); registry->CheckLocked(); ThreadContextBase *main_thread = registry->GetThreadLocked(0); EXPECT_EQ(main_thread, registry->FindThreadContextLocked( HasUid, (void*)get_uid(0))); } EXPECT_EQ(11U, registry->GetMaxAliveThreads()); } TEST(SanitizerCommon, ThreadRegistryTest) { ThreadRegistry quarantine_registry(GetThreadContext, kMaxRegistryThreads, kRegistryQuarantine); TestRegistry(&quarantine_registry, true); ThreadRegistry no_quarantine_registry(GetThreadContext, kMaxRegistryThreads, kMaxRegistryThreads); TestRegistry(&no_quarantine_registry, false); } static const int kThreadsPerShard = 20; static const int kNumShards = 25; static int num_created[kNumShards + 1]; static int num_started[kNumShards + 1]; static int num_joined[kNumShards + 1]; namespace { struct RunThreadArgs { ThreadRegistry *registry; uptr shard; // started from 1. }; class TestThreadContext : public ThreadContextBase { public: explicit TestThreadContext(int tid) : ThreadContextBase(tid) {} void OnJoined(void *arg) { uptr shard = (uptr)arg; num_joined[shard]++; } void OnStarted(void *arg) { uptr shard = (uptr)arg; num_started[shard]++; } void OnCreated(void *arg) { uptr shard = (uptr)arg; num_created[shard]++; } }; } // namespace void *RunThread(void *arg) { RunThreadArgs *args = static_cast(arg); std::vector tids; for (int i = 0; i < kThreadsPerShard; i++) tids.push_back( args->registry->CreateThread(0, false, 0, (void*)args->shard)); for (int i = 0; i < kThreadsPerShard; i++) args->registry->StartThread(tids[i], 0, (void*)args->shard); for (int i = 0; i < kThreadsPerShard; i++) args->registry->FinishThread(tids[i]); for (int i = 0; i < kThreadsPerShard; i++) args->registry->JoinThread(tids[i], (void*)args->shard); return 0; } static void ThreadedTestRegistry(ThreadRegistry *registry) { // Create and start a main thread. EXPECT_EQ(0U, registry->CreateThread(0, true, -1, 0)); registry->StartThread(0, 0, 0); pthread_t threads[kNumShards]; RunThreadArgs args[kNumShards]; for (int i = 0; i < kNumShards; i++) { args[i].registry = registry; args[i].shard = i + 1; PTHREAD_CREATE(&threads[i], 0, RunThread, &args[i]); } for (int i = 0; i < kNumShards; i++) { PTHREAD_JOIN(threads[i], 0); } // Check that each thread created/started/joined correct amount // of "threads" in thread_registry. EXPECT_EQ(1, num_created[0]); EXPECT_EQ(1, num_started[0]); EXPECT_EQ(0, num_joined[0]); for (int i = 1; i <= kNumShards; i++) { EXPECT_EQ(kThreadsPerShard, num_created[i]); EXPECT_EQ(kThreadsPerShard, num_started[i]); EXPECT_EQ(kThreadsPerShard, num_joined[i]); } } TEST(SanitizerCommon, ThreadRegistryThreadedTest) { memset(&num_created, 0, sizeof(num_created)); memset(&num_started, 0, sizeof(num_created)); memset(&num_joined, 0, sizeof(num_created)); ThreadRegistry registry(GetThreadContext, kThreadsPerShard * kNumShards + 1, 10); ThreadedTestRegistry(®istry); } } // namespace __sanitizer ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stacktrace_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stacktrace_test.0000664000175000017500000001146212734243402033752 0ustar mwhudsonmwhudson//===-- sanitizer_stacktrace_test.cc --------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "gtest/gtest.h" namespace __sanitizer { class FastUnwindTest : public ::testing::Test { protected: virtual void SetUp(); virtual void TearDown(); bool TryFastUnwind(uptr max_depth) { if (!StackTrace::WillUseFastUnwind(true)) return false; trace.Unwind(max_depth, start_pc, (uptr)&fake_stack[0], 0, fake_top, fake_bottom, true); return true; } void *mapping; uhwptr *fake_stack; const uptr fake_stack_size = 10; uhwptr start_pc; uhwptr fake_top; uhwptr fake_bottom; BufferedStackTrace trace; }; static uptr PC(uptr idx) { return (1<<20) + idx; } void FastUnwindTest::SetUp() { size_t ps = GetPageSize(); mapping = MmapOrDie(2 * ps, "FastUnwindTest"); MprotectNoAccess((uptr)mapping, ps); // Unwinder may peek 1 word down from the starting FP. fake_stack = (uhwptr *)((uptr)mapping + ps + sizeof(uhwptr)); // Fill an array of pointers with fake fp+retaddr pairs. Frame pointers have // even indices. for (uptr i = 0; i + 1 < fake_stack_size; i += 2) { fake_stack[i] = (uptr)&fake_stack[i+2]; // fp fake_stack[i+1] = PC(i + 1); // retaddr } // Mark the last fp point back up to terminate the stack trace. fake_stack[RoundDownTo(fake_stack_size - 1, 2)] = (uhwptr)&fake_stack[0]; // Top is two slots past the end because FastUnwindStack subtracts two. fake_top = (uhwptr)&fake_stack[fake_stack_size + 2]; // Bottom is one slot before the start because FastUnwindStack uses >. fake_bottom = (uhwptr)mapping; start_pc = PC(0); } void FastUnwindTest::TearDown() { size_t ps = GetPageSize(); UnmapOrDie(mapping, 2 * ps); } TEST_F(FastUnwindTest, Basic) { if (!TryFastUnwind(kStackTraceMax)) return; // Should get all on-stack retaddrs and start_pc. EXPECT_EQ(6U, trace.size); EXPECT_EQ(start_pc, trace.trace[0]); for (uptr i = 1; i <= 5; i++) { EXPECT_EQ(PC(i*2 - 1), trace.trace[i]); } } // From: https://github.com/google/sanitizers/issues/162 TEST_F(FastUnwindTest, FramePointerLoop) { // Make one fp point to itself. fake_stack[4] = (uhwptr)&fake_stack[4]; if (!TryFastUnwind(kStackTraceMax)) return; // Should get all on-stack retaddrs up to the 4th slot and start_pc. EXPECT_EQ(4U, trace.size); EXPECT_EQ(start_pc, trace.trace[0]); for (uptr i = 1; i <= 3; i++) { EXPECT_EQ(PC(i*2 - 1), trace.trace[i]); } } TEST_F(FastUnwindTest, MisalignedFramePointer) { // Make one fp misaligned. fake_stack[4] += 3; if (!TryFastUnwind(kStackTraceMax)) return; // Should get all on-stack retaddrs up to the 4th slot and start_pc. EXPECT_EQ(4U, trace.size); EXPECT_EQ(start_pc, trace.trace[0]); for (uptr i = 1; i < 4U; i++) { EXPECT_EQ(PC(i*2 - 1), trace.trace[i]); } } TEST_F(FastUnwindTest, OneFrameStackTrace) { if (!TryFastUnwind(1)) return; EXPECT_EQ(1U, trace.size); EXPECT_EQ(start_pc, trace.trace[0]); EXPECT_EQ((uhwptr)&fake_stack[0], trace.top_frame_bp); } TEST_F(FastUnwindTest, ZeroFramesStackTrace) { if (!TryFastUnwind(0)) return; EXPECT_EQ(0U, trace.size); EXPECT_EQ(0U, trace.top_frame_bp); } TEST_F(FastUnwindTest, FPBelowPrevFP) { // The next FP points to unreadable memory inside the stack limits, but below // current FP. fake_stack[0] = (uhwptr)&fake_stack[-50]; fake_stack[1] = PC(1); if (!TryFastUnwind(3)) return; EXPECT_EQ(2U, trace.size); EXPECT_EQ(PC(0), trace.trace[0]); EXPECT_EQ(PC(1), trace.trace[1]); } TEST_F(FastUnwindTest, CloseToZeroFrame) { // Make one pc a NULL pointer. fake_stack[5] = 0x0; if (!TryFastUnwind(kStackTraceMax)) return; // The stack should be truncated at the NULL pointer (and not include it). EXPECT_EQ(3U, trace.size); EXPECT_EQ(start_pc, trace.trace[0]); for (uptr i = 1; i < 3U; i++) { EXPECT_EQ(PC(i*2 - 1), trace.trace[i]); } } TEST(SlowUnwindTest, ShortStackTrace) { if (StackTrace::WillUseFastUnwind(false)) return; BufferedStackTrace stack; uptr pc = StackTrace::GetCurrentPc(); uptr bp = GET_CURRENT_FRAME(); stack.Unwind(0, pc, bp, 0, 0, 0, false); EXPECT_EQ(0U, stack.size); EXPECT_EQ(0U, stack.top_frame_bp); stack.Unwind(1, pc, bp, 0, 0, 0, false); EXPECT_EQ(1U, stack.size); EXPECT_EQ(pc, stack.trace[0]); EXPECT_EQ(bp, stack.top_frame_bp); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_atomic_test.cc0000664000175000017500000001170612267751021033413 0ustar mwhudsonmwhudson//===-- sanitizer_atomic_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_atomic.h" #include "gtest/gtest.h" namespace __sanitizer { template struct ValAndMagic { typename T::Type magic0; T a; typename T::Type magic1; static ValAndMagic *sink; }; template ValAndMagic *ValAndMagic::sink; template void CheckStoreLoad() { typedef typename T::Type Type; ValAndMagic val; // Prevent the compiler from scalarizing the struct. ValAndMagic::sink = &val; // Ensure that surrounding memory is not overwritten. val.magic0 = val.magic1 = (Type)-3; for (u64 i = 0; i < 100; i++) { // Generate a value that occupies all bytes of the variable. u64 v = i; v |= v << 8; v |= v << 16; v |= v << 32; val.a.val_dont_use = (Type)v; EXPECT_EQ(atomic_load(&val.a, load_mo), (Type)v); val.a.val_dont_use = (Type)-1; atomic_store(&val.a, (Type)v, store_mo); EXPECT_EQ(val.a.val_dont_use, (Type)v); } EXPECT_EQ(val.magic0, (Type)-3); EXPECT_EQ(val.magic1, (Type)-3); } TEST(SanitizerCommon, AtomicStoreLoad) { CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad(); CheckStoreLoad (); CheckStoreLoad (); CheckStoreLoad (); CheckStoreLoad (); CheckStoreLoad (); } // Clang crashes while compiling this test for Android: // http://llvm.org/bugs/show_bug.cgi?id=15587 #if !SANITIZER_ANDROID template void CheckAtomicCompareExchange() { typedef typename T::Type Type; { Type old_val = 42; Type new_val = 24; Type var = old_val; EXPECT_TRUE(atomic_compare_exchange_strong((T*)&var, &old_val, new_val, memory_order_relaxed)); EXPECT_FALSE(atomic_compare_exchange_strong((T*)&var, &old_val, new_val, memory_order_relaxed)); EXPECT_EQ(new_val, old_val); } { Type old_val = 42; Type new_val = 24; Type var = old_val; EXPECT_TRUE(atomic_compare_exchange_weak((T*)&var, &old_val, new_val, memory_order_relaxed)); EXPECT_FALSE(atomic_compare_exchange_weak((T*)&var, &old_val, new_val, memory_order_relaxed)); EXPECT_EQ(new_val, old_val); } } TEST(SanitizerCommon, AtomicCompareExchangeTest) { CheckAtomicCompareExchange(); CheckAtomicCompareExchange(); CheckAtomicCompareExchange(); CheckAtomicCompareExchange(); CheckAtomicCompareExchange(); } #endif //!SANITIZER_ANDROID } // namespace __sanitizer ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_suppressions_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_suppressions_tes0000664000175000017500000001056212567650555034160 0ustar mwhudsonmwhudson//===-- sanitizer_suppressions_test.cc ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_suppressions.h" #include "gtest/gtest.h" #include namespace __sanitizer { static bool MyMatch(const char *templ, const char *func) { char tmp[1024]; strcpy(tmp, templ); // NOLINT return TemplateMatch(tmp, func); } TEST(Suppressions, Match) { EXPECT_TRUE(MyMatch("foobar$", "foobar")); EXPECT_TRUE(MyMatch("foobar", "foobar")); EXPECT_TRUE(MyMatch("*foobar*", "foobar")); EXPECT_TRUE(MyMatch("foobar", "prefix_foobar_postfix")); EXPECT_TRUE(MyMatch("*foobar*", "prefix_foobar_postfix")); EXPECT_TRUE(MyMatch("foo*bar", "foo_middle_bar")); EXPECT_TRUE(MyMatch("foo*bar", "foobar")); EXPECT_TRUE(MyMatch("foo*bar*baz", "foo_middle_bar_another_baz")); EXPECT_TRUE(MyMatch("foo*bar*baz", "foo_middle_barbaz")); EXPECT_TRUE(MyMatch("^foobar", "foobar")); EXPECT_TRUE(MyMatch("^foobar", "foobar_postfix")); EXPECT_TRUE(MyMatch("^*foobar", "foobar")); EXPECT_TRUE(MyMatch("^*foobar", "prefix_foobar")); EXPECT_TRUE(MyMatch("foobar$", "foobar")); EXPECT_TRUE(MyMatch("foobar$", "prefix_foobar")); EXPECT_TRUE(MyMatch("*foobar*$", "foobar")); EXPECT_TRUE(MyMatch("*foobar*$", "foobar_postfix")); EXPECT_TRUE(MyMatch("^foobar$", "foobar")); EXPECT_FALSE(MyMatch("foo", "baz")); EXPECT_FALSE(MyMatch("foobarbaz", "foobar")); EXPECT_FALSE(MyMatch("foobarbaz", "barbaz")); EXPECT_FALSE(MyMatch("foo*bar", "foobaz")); EXPECT_FALSE(MyMatch("foo*bar", "foo_baz")); EXPECT_FALSE(MyMatch("^foobar", "prefix_foobar")); EXPECT_FALSE(MyMatch("foobar$", "foobar_postfix")); EXPECT_FALSE(MyMatch("^foobar$", "prefix_foobar")); EXPECT_FALSE(MyMatch("^foobar$", "foobar_postfix")); EXPECT_FALSE(MyMatch("foo^bar", "foobar")); EXPECT_FALSE(MyMatch("foo$bar", "foobar")); EXPECT_FALSE(MyMatch("foo$^bar", "foobar")); } static const char *kTestSuppressionTypes[] = {"race", "thread", "mutex", "signal"}; class SuppressionContextTest : public ::testing::Test { public: SuppressionContextTest() : ctx_(kTestSuppressionTypes, ARRAY_SIZE(kTestSuppressionTypes)) {} protected: SuppressionContext ctx_; void CheckSuppressions(unsigned count, std::vector types, std::vector templs) const { EXPECT_EQ(count, ctx_.SuppressionCount()); for (unsigned i = 0; i < count; i++) { const Suppression *s = ctx_.SuppressionAt(i); EXPECT_STREQ(types[i], s->type); EXPECT_STREQ(templs[i], s->templ); } } }; TEST_F(SuppressionContextTest, Parse) { ctx_.Parse("race:foo\n" " race:bar\n" // NOLINT "race:baz \n" // NOLINT "# a comment\n" "race:quz\n"); // NOLINT CheckSuppressions(4, {"race", "race", "race", "race"}, {"foo", "bar", "baz", "quz"}); } TEST_F(SuppressionContextTest, Parse2) { ctx_.Parse( " # first line comment\n" // NOLINT " race:bar \n" // NOLINT "race:baz* *baz\n" "# a comment\n" "# last line comment\n" ); // NOLINT CheckSuppressions(2, {"race", "race"}, {"bar", "baz* *baz"}); } TEST_F(SuppressionContextTest, Parse3) { ctx_.Parse( "# last suppression w/o line-feed\n" "race:foo\n" "race:bar\r\n" "race:baz" ); // NOLINT CheckSuppressions(3, {"race", "race", "race"}, {"foo", "bar", "baz"}); } TEST_F(SuppressionContextTest, ParseType) { ctx_.Parse( "race:foo\n" "thread:bar\n" "mutex:baz\n" "signal:quz\n" ); // NOLINT CheckSuppressions(4, {"race", "thread", "mutex", "signal"}, {"foo", "bar", "baz", "quz"}); } TEST_F(SuppressionContextTest, HasSuppressionType) { ctx_.Parse( "race:foo\n" "thread:bar\n"); EXPECT_TRUE(ctx_.HasSuppressionType("race")); EXPECT_TRUE(ctx_.HasSuppressionType("thread")); EXPECT_FALSE(ctx_.HasSuppressionType("mutex")); EXPECT_FALSE(ctx_.HasSuppressionType("signal")); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_printf_test.cc0000664000175000017500000001050712735042146033440 0ustar mwhudsonmwhudson//===-- sanitizer_printf_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for sanitizer_printf.cc // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "gtest/gtest.h" #include #include namespace __sanitizer { TEST(Printf, Basic) { char buf[1024]; uptr len = internal_snprintf(buf, sizeof(buf), "a%db%zdc%ue%zuf%xh%zxq%pe%sr", (int)-1, (uptr)-2, // NOLINT (unsigned)-4, (uptr)5, // NOLINT (unsigned)10, (uptr)11, // NOLINT (void*)0x123, "_string_"); EXPECT_EQ(len, strlen(buf)); std::string expectedString = "a-1b-2c4294967292e5fahbq0x"; expectedString += std::string(SANITIZER_POINTER_FORMAT_LENGTH - 3, '0'); expectedString += "123e_string_r"; EXPECT_STREQ(expectedString.c_str(), buf); } TEST(Printf, OverflowStr) { char buf[] = "123456789"; uptr len = internal_snprintf(buf, 4, "%s", "abcdef"); // NOLINT EXPECT_EQ(len, (uptr)6); EXPECT_STREQ("abc", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); EXPECT_EQ(buf[5], '6'); EXPECT_EQ(buf[6], '7'); EXPECT_EQ(buf[7], '8'); EXPECT_EQ(buf[8], '9'); EXPECT_EQ(buf[9], 0); } TEST(Printf, OverflowInt) { char buf[] = "123456789"; internal_snprintf(buf, 4, "%d", -123456789); // NOLINT EXPECT_STREQ("-12", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); EXPECT_EQ(buf[5], '6'); EXPECT_EQ(buf[6], '7'); EXPECT_EQ(buf[7], '8'); EXPECT_EQ(buf[8], '9'); EXPECT_EQ(buf[9], 0); } TEST(Printf, OverflowUint) { char buf[] = "123456789"; uptr val; if (sizeof(val) == 4) { val = (uptr)0x12345678; } else { val = (uptr)0x123456789ULL; } internal_snprintf(buf, 4, "a%zx", val); // NOLINT EXPECT_STREQ("a12", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); EXPECT_EQ(buf[5], '6'); EXPECT_EQ(buf[6], '7'); EXPECT_EQ(buf[7], '8'); EXPECT_EQ(buf[8], '9'); EXPECT_EQ(buf[9], 0); } TEST(Printf, OverflowPtr) { char buf[] = "123456789"; void *p; if (sizeof(p) == 4) { p = (void*)0x1234567; } else { p = (void*)0x123456789ULL; } internal_snprintf(buf, 4, "%p", p); // NOLINT EXPECT_STREQ("0x0", buf); EXPECT_EQ(buf[3], 0); EXPECT_EQ(buf[4], '5'); EXPECT_EQ(buf[5], '6'); EXPECT_EQ(buf[6], '7'); EXPECT_EQ(buf[7], '8'); EXPECT_EQ(buf[8], '9'); EXPECT_EQ(buf[9], 0); } #if defined(_WIN32) // Oh well, MSVS headers don't define snprintf. # define snprintf _snprintf #endif template static void TestAgainstLibc(const char *fmt, T arg1, T arg2) { char buf[1024]; uptr len = internal_snprintf(buf, sizeof(buf), fmt, arg1, arg2); char buf2[1024]; snprintf(buf2, sizeof(buf2), fmt, arg1, arg2); EXPECT_EQ(len, strlen(buf)); EXPECT_STREQ(buf2, buf); } TEST(Printf, MinMax) { TestAgainstLibc("%d-%d", INT_MIN, INT_MAX); // NOLINT TestAgainstLibc("%u-%u", 0, UINT_MAX); // NOLINT TestAgainstLibc("%x-%x", 0, UINT_MAX); // NOLINT #if !defined(_WIN32) // %z* format doesn't seem to be supported by MSVS. TestAgainstLibc("%zd-%zd", LONG_MIN, LONG_MAX); // NOLINT TestAgainstLibc("%zu-%zu", 0, ULONG_MAX); // NOLINT TestAgainstLibc("%zx-%zx", 0, ULONG_MAX); // NOLINT #endif } TEST(Printf, Padding) { TestAgainstLibc("%3d - %3d", 1, 0); TestAgainstLibc("%3d - %3d", -1, 123); TestAgainstLibc("%3d - %3d", -1, -123); TestAgainstLibc("%3d - %3d", 12, 1234); TestAgainstLibc("%3d - %3d", -12, -1234); TestAgainstLibc("%03d - %03d", 1, 0); TestAgainstLibc("%03d - %03d", -1, 123); TestAgainstLibc("%03d - %03d", -1, -123); TestAgainstLibc("%03d - %03d", 12, 1234); TestAgainstLibc("%03d - %03d", -12, -1234); } TEST(Printf, Precision) { char buf[1024]; uptr len = internal_snprintf(buf, sizeof(buf), "%.*s", 3, "12345"); EXPECT_EQ(3U, len); EXPECT_STREQ("123", buf); len = internal_snprintf(buf, sizeof(buf), "%.*s", 6, "12345"); EXPECT_EQ(5U, len); EXPECT_STREQ("12345", buf); } } // namespace __sanitizer ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/malloc_stress_transfer_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/malloc_stress_transfer_tes0000664000175000017500000000174312757136044034063 0ustar mwhudsonmwhudson#include #include const size_t kAllocSize = 16; const size_t kInitialNumAllocs = 1 << 10; const size_t kPeriodicNumAllocs = 1 << 10; const size_t kNumIterations = 1 << 7; const size_t kNumThreads = 16; void Thread() { // int sp; // std::cerr << "Thread starting, sp = " << &sp << std::endl; char *InitialAllocations[kInitialNumAllocs]; char *PeriodicaAllocations[kPeriodicNumAllocs]; for (auto &p : InitialAllocations) p = new char[kAllocSize]; for (size_t i = 0; i < kNumIterations; i++) { for (size_t j = 0; j < kPeriodicNumAllocs; j++) { for (auto &p : PeriodicaAllocations) { p = new char[kAllocSize]; *p = 0; } for (auto p : PeriodicaAllocations) delete [] p; } } for (auto p : InitialAllocations) delete [] p; } int main() { // Thread(); // return 0; std::thread *Threads[kNumThreads]; for (auto &T : Threads) T = new std::thread(&Thread); for (auto T : Threads) { T->join(); delete T; } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_symbolizer_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_symbolizer_test.0000664000175000017500000000411112747450462034030 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_test.cc --------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for sanitizer_symbolizer.h and sanitizer_symbolizer_internal.h // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_symbolizer_internal.h" #include "gtest/gtest.h" namespace __sanitizer { TEST(Symbolizer, ExtractToken) { char *token; const char *rest; rest = ExtractToken("a;b;c", ";", &token); EXPECT_STREQ("a", token); EXPECT_STREQ("b;c", rest); InternalFree(token); rest = ExtractToken("aaa-bbb.ccc", ";.-*", &token); EXPECT_STREQ("aaa", token); EXPECT_STREQ("bbb.ccc", rest); InternalFree(token); } TEST(Symbolizer, ExtractInt) { int token; const char *rest = ExtractInt("123,456;789", ";,", &token); EXPECT_EQ(123, token); EXPECT_STREQ("456;789", rest); } TEST(Symbolizer, ExtractUptr) { uptr token; const char *rest = ExtractUptr("123,456;789", ";,", &token); EXPECT_EQ(123U, token); EXPECT_STREQ("456;789", rest); } TEST(Symbolizer, ExtractTokenUpToDelimiter) { char *token; const char *rest = ExtractTokenUpToDelimiter("aaa-+-bbb-+-ccc", "-+-", &token); EXPECT_STREQ("aaa", token); EXPECT_STREQ("bbb-+-ccc", rest); InternalFree(token); } #if !SANITIZER_WINDOWS TEST(Symbolizer, DemangleSwiftAndCXX) { // Swift names are not demangled in default llvm build because Swift // runtime is not linked in. EXPECT_STREQ("_TtSd", DemangleSwiftAndCXX("_TtSd")); // Check that the rest demangles properly. EXPECT_STREQ("f1(char*, int)", DemangleSwiftAndCXX("_Z2f1Pci")); #if !SANITIZER_FREEBSD // QoI issue with libcxxrt on FreeBSD EXPECT_STREQ("foo", DemangleSwiftAndCXX("foo")); #endif EXPECT_STREQ("", DemangleSwiftAndCXX("")); } #endif } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_test_utils.h0000664000175000017500000000644112446007264033143 0ustar mwhudsonmwhudson//===-- sanitizer_test_utils.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of *Sanitizer runtime. // Common unit tests utilities. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_TEST_UTILS_H #define SANITIZER_TEST_UTILS_H #if defined(_WIN32) // should always be the first include on Windows. # include // MSVS headers define max/min as macros, so std::max/min gets crazy. # undef max # undef min #endif #if !defined(SANITIZER_EXTERNAL_TEST_CONFIG) # define INCLUDED_FROM_SANITIZER_TEST_UTILS_H # include "sanitizer_test_config.h" # undef INCLUDED_FROM_SANITIZER_TEST_UTILS_H #endif #include #if defined(_MSC_VER) # define NOINLINE __declspec(noinline) #else // defined(_MSC_VER) # define NOINLINE __attribute__((noinline)) #endif // defined(_MSC_VER) #if !defined(_MSC_VER) || defined(__clang__) # define UNUSED __attribute__((unused)) # define USED __attribute__((used)) #else # define UNUSED # define USED #endif #if !defined(__has_feature) #define __has_feature(x) 0 #endif #ifndef ATTRIBUTE_NO_SANITIZE_ADDRESS # if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) # define ATTRIBUTE_NO_SANITIZE_ADDRESS \ __attribute__((no_sanitize_address)) # else # define ATTRIBUTE_NO_SANITIZE_ADDRESS # endif #endif // ATTRIBUTE_NO_SANITIZE_ADDRESS #if __LP64__ || defined(_WIN64) # define SANITIZER_WORDSIZE 64 #else # define SANITIZER_WORDSIZE 32 #endif // Make the compiler thinks that something is going on there. inline void break_optimization(void *arg) { #if !defined(_WIN32) || defined(__clang__) __asm__ __volatile__("" : : "r" (arg) : "memory"); #endif } // This function returns its parameter but in such a way that compiler // can not prove it. template NOINLINE static T Ident(T t) { T ret = t; break_optimization(&ret); return ret; } // Simple stand-alone pseudorandom number generator. // Current algorithm is ANSI C linear congruential PRNG. static inline uint32_t my_rand_r(uint32_t* state) { return (*state = *state * 1103515245 + 12345) >> 16; } static uint32_t global_seed = 0; static inline uint32_t my_rand() { return my_rand_r(&global_seed); } // Set availability of platform-specific functions. #if !defined(__APPLE__) && !defined(__ANDROID__) && !defined(_WIN32) # define SANITIZER_TEST_HAS_POSIX_MEMALIGN 1 #else # define SANITIZER_TEST_HAS_POSIX_MEMALIGN 0 #endif #if !defined(__APPLE__) && !defined(__FreeBSD__) && \ !defined(__ANDROID__) && !defined(_WIN32) # define SANITIZER_TEST_HAS_MEMALIGN 1 # define SANITIZER_TEST_HAS_PVALLOC 1 # define SANITIZER_TEST_HAS_MALLOC_USABLE_SIZE 1 #else # define SANITIZER_TEST_HAS_MEMALIGN 0 # define SANITIZER_TEST_HAS_PVALLOC 0 # define SANITIZER_TEST_HAS_MALLOC_USABLE_SIZE 0 #endif #if !defined(__APPLE__) # define SANITIZER_TEST_HAS_STRNLEN 1 #else # define SANITIZER_TEST_HAS_STRNLEN 0 #endif #if defined(__FreeBSD__) # define SANITIZER_TEST_HAS_PRINTF_L 1 #else # define SANITIZER_TEST_HAS_PRINTF_L 0 #endif #endif // SANITIZER_TEST_UTILS_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stoptheworld_tes0000664000175000017500000001610312475117602034123 0ustar mwhudsonmwhudson//===-- sanitizer_stoptheworld_test.cc ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for sanitizer_stoptheworld.h // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX && defined(__x86_64__) #include "sanitizer_common/sanitizer_stoptheworld.h" #include "gtest/gtest.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_common.h" #include #include namespace __sanitizer { static pthread_mutex_t incrementer_thread_exit_mutex; struct CallbackArgument { volatile int counter; volatile bool threads_stopped; volatile bool callback_executed; CallbackArgument() : counter(0), threads_stopped(false), callback_executed(false) {} }; void *IncrementerThread(void *argument) { CallbackArgument *callback_argument = (CallbackArgument *)argument; while (true) { __sync_fetch_and_add(&callback_argument->counter, 1); if (pthread_mutex_trylock(&incrementer_thread_exit_mutex) == 0) { pthread_mutex_unlock(&incrementer_thread_exit_mutex); return NULL; } else { sched_yield(); } } } // This callback checks that IncrementerThread is suspended at the time of its // execution. void Callback(const SuspendedThreadsList &suspended_threads_list, void *argument) { CallbackArgument *callback_argument = (CallbackArgument *)argument; callback_argument->callback_executed = true; int counter_at_init = __sync_fetch_and_add(&callback_argument->counter, 0); for (uptr i = 0; i < 1000; i++) { sched_yield(); if (__sync_fetch_and_add(&callback_argument->counter, 0) != counter_at_init) { callback_argument->threads_stopped = false; return; } } callback_argument->threads_stopped = true; } TEST(StopTheWorld, SuspendThreadsSimple) { pthread_mutex_init(&incrementer_thread_exit_mutex, NULL); CallbackArgument argument; pthread_t thread_id; int pthread_create_result; pthread_mutex_lock(&incrementer_thread_exit_mutex); pthread_create_result = pthread_create(&thread_id, NULL, IncrementerThread, &argument); ASSERT_EQ(0, pthread_create_result); StopTheWorld(&Callback, &argument); pthread_mutex_unlock(&incrementer_thread_exit_mutex); EXPECT_TRUE(argument.callback_executed); EXPECT_TRUE(argument.threads_stopped); // argument is on stack, so we have to wait for the incrementer thread to // terminate before we can return from this function. ASSERT_EQ(0, pthread_join(thread_id, NULL)); pthread_mutex_destroy(&incrementer_thread_exit_mutex); } // A more comprehensive test where we spawn a bunch of threads while executing // StopTheWorld in parallel. static const uptr kThreadCount = 50; static const uptr kStopWorldAfter = 10; // let this many threads spawn first static pthread_mutex_t advanced_incrementer_thread_exit_mutex; struct AdvancedCallbackArgument { volatile uptr thread_index; volatile int counters[kThreadCount]; pthread_t thread_ids[kThreadCount]; volatile bool threads_stopped; volatile bool callback_executed; volatile bool fatal_error; AdvancedCallbackArgument() : thread_index(0), threads_stopped(false), callback_executed(false), fatal_error(false) {} }; void *AdvancedIncrementerThread(void *argument) { AdvancedCallbackArgument *callback_argument = (AdvancedCallbackArgument *)argument; uptr this_thread_index = __sync_fetch_and_add( &callback_argument->thread_index, 1); // Spawn the next thread. int pthread_create_result; if (this_thread_index + 1 < kThreadCount) { pthread_create_result = pthread_create(&callback_argument->thread_ids[this_thread_index + 1], NULL, AdvancedIncrementerThread, argument); // Cannot use ASSERT_EQ in non-void-returning functions. If there's a // problem, defer failing to the main thread. if (pthread_create_result != 0) { callback_argument->fatal_error = true; __sync_fetch_and_add(&callback_argument->thread_index, kThreadCount - callback_argument->thread_index); } } // Do the actual work. while (true) { __sync_fetch_and_add(&callback_argument->counters[this_thread_index], 1); if (pthread_mutex_trylock(&advanced_incrementer_thread_exit_mutex) == 0) { pthread_mutex_unlock(&advanced_incrementer_thread_exit_mutex); return NULL; } else { sched_yield(); } } } void AdvancedCallback(const SuspendedThreadsList &suspended_threads_list, void *argument) { AdvancedCallbackArgument *callback_argument = (AdvancedCallbackArgument *)argument; callback_argument->callback_executed = true; int counters_at_init[kThreadCount]; for (uptr j = 0; j < kThreadCount; j++) counters_at_init[j] = __sync_fetch_and_add(&callback_argument->counters[j], 0); for (uptr i = 0; i < 10; i++) { sched_yield(); for (uptr j = 0; j < kThreadCount; j++) if (__sync_fetch_and_add(&callback_argument->counters[j], 0) != counters_at_init[j]) { callback_argument->threads_stopped = false; return; } } callback_argument->threads_stopped = true; } TEST(StopTheWorld, SuspendThreadsAdvanced) { pthread_mutex_init(&advanced_incrementer_thread_exit_mutex, NULL); AdvancedCallbackArgument argument; pthread_mutex_lock(&advanced_incrementer_thread_exit_mutex); int pthread_create_result; pthread_create_result = pthread_create(&argument.thread_ids[0], NULL, AdvancedIncrementerThread, &argument); ASSERT_EQ(0, pthread_create_result); // Wait for several threads to spawn before proceeding. while (__sync_fetch_and_add(&argument.thread_index, 0) < kStopWorldAfter) sched_yield(); StopTheWorld(&AdvancedCallback, &argument); EXPECT_TRUE(argument.callback_executed); EXPECT_TRUE(argument.threads_stopped); // Wait for all threads to spawn before we start terminating them. while (__sync_fetch_and_add(&argument.thread_index, 0) < kThreadCount) sched_yield(); ASSERT_FALSE(argument.fatal_error); // a pthread_create has failed // Signal the threads to terminate. pthread_mutex_unlock(&advanced_incrementer_thread_exit_mutex); for (uptr i = 0; i < kThreadCount; i++) ASSERT_EQ(0, pthread_join(argument.thread_ids[i], NULL)); pthread_mutex_destroy(&advanced_incrementer_thread_exit_mutex); } static void SegvCallback(const SuspendedThreadsList &suspended_threads_list, void *argument) { *(volatile int*)0x1234 = 0; } TEST(StopTheWorld, SegvInCallback) { // Test that tracer thread catches SIGSEGV. StopTheWorld(&SegvCallback, NULL); } } // namespace __sanitizer #endif // SANITIZER_LINUX && defined(__x86_64__) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_posix_test.cc0000664000175000017500000000507212735274536033313 0ustar mwhudsonmwhudson//===-- sanitizer_posix_test.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for POSIX-specific code. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_POSIX #include "sanitizer_common/sanitizer_common.h" #include "gtest/gtest.h" #include #include namespace __sanitizer { static pthread_key_t key; static bool destructor_executed; extern "C" void destructor(void *arg) { uptr iter = reinterpret_cast(arg); if (iter > 1) { ASSERT_EQ(0, pthread_setspecific(key, reinterpret_cast(iter - 1))); return; } destructor_executed = true; } extern "C" void *thread_func(void *arg) { return reinterpret_cast(pthread_setspecific(key, arg)); } static void SpawnThread(uptr iteration) { destructor_executed = false; pthread_t tid; ASSERT_EQ(0, pthread_create(&tid, 0, &thread_func, reinterpret_cast(iteration))); void *retval; ASSERT_EQ(0, pthread_join(tid, &retval)); ASSERT_EQ(0, retval); } TEST(SanitizerCommon, PthreadDestructorIterations) { ASSERT_EQ(0, pthread_key_create(&key, &destructor)); SpawnThread(GetPthreadDestructorIterations()); EXPECT_TRUE(destructor_executed); SpawnThread(GetPthreadDestructorIterations() + 1); EXPECT_FALSE(destructor_executed); ASSERT_EQ(0, pthread_key_delete(key)); } TEST(SanitizerCommon, IsAccessibleMemoryRange) { const int page_size = GetPageSize(); uptr mem = (uptr)mmap(0, 3 * page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); // Protect the middle page. mprotect((void *)(mem + page_size), page_size, PROT_NONE); EXPECT_TRUE(IsAccessibleMemoryRange(mem, page_size - 1)); EXPECT_TRUE(IsAccessibleMemoryRange(mem, page_size)); EXPECT_FALSE(IsAccessibleMemoryRange(mem, page_size + 1)); EXPECT_TRUE(IsAccessibleMemoryRange(mem + page_size - 1, 1)); EXPECT_FALSE(IsAccessibleMemoryRange(mem + page_size - 1, 2)); EXPECT_FALSE(IsAccessibleMemoryRange(mem + 2 * page_size - 1, 1)); EXPECT_TRUE(IsAccessibleMemoryRange(mem + 2 * page_size, page_size)); EXPECT_FALSE(IsAccessibleMemoryRange(mem, 3 * page_size)); EXPECT_FALSE(IsAccessibleMemoryRange(0x0, 2)); } } // namespace __sanitizer #endif // SANITIZER_POSIX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc0000664000175000017500000000325012662654403033763 0ustar mwhudsonmwhudson//===-- sanitizer_procmaps_test.cc ----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #if !defined(_WIN32) // There are no /proc/maps on Windows. #include "sanitizer_common/sanitizer_procmaps.h" #include "gtest/gtest.h" #include static void noop() {} extern const char *argv0; namespace __sanitizer { #if SANITIZER_LINUX && !SANITIZER_ANDROID TEST(MemoryMappingLayout, CodeRange) { uptr start, end; bool res = GetCodeRangeForFile("[vdso]", &start, &end); EXPECT_EQ(res, true); EXPECT_GT(start, 0U); EXPECT_LT(start, end); } #endif TEST(MemoryMappingLayout, DumpListOfModules) { const char *last_slash = strrchr(argv0, '/'); const char *binary_name = last_slash ? last_slash + 1 : argv0; MemoryMappingLayout memory_mapping(false); const uptr kMaxModules = 100; InternalMmapVector modules(kMaxModules); memory_mapping.DumpListOfModules(&modules); EXPECT_GT(modules.size(), 0U); bool found = false; for (uptr i = 0; i < modules.size(); ++i) { if (modules[i].containsAddress((uptr)&noop)) { // Verify that the module name is sane. if (strstr(modules[i].full_name(), binary_name) != 0) found = true; } modules[i].clear(); } EXPECT_TRUE(found); } } // namespace __sanitizer #endif // !defined(_WIN32) golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_libc_test.cc0000664000175000017500000001664212766606132033062 0ustar mwhudsonmwhudson//===-- sanitizer_libc_test.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Tests for sanitizer_libc.h. //===----------------------------------------------------------------------===// #include #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_platform.h" #include "gtest/gtest.h" #if SANITIZER_WINDOWS #define NOMINMAX #include #undef NOMINMAX #endif #if SANITIZER_POSIX # include # include "sanitizer_common/sanitizer_posix.h" #endif using namespace __sanitizer; // A regression test for internal_memmove() implementation. TEST(SanitizerCommon, InternalMemmoveRegression) { char src[] = "Hello World"; char *dest = src + 6; __sanitizer::internal_memmove(dest, src, 5); EXPECT_EQ(dest[0], src[0]); EXPECT_EQ(dest[4], src[4]); } TEST(SanitizerCommon, mem_is_zero) { size_t size = 128; char *x = new char[size]; memset(x, 0, size); for (size_t pos = 0; pos < size; pos++) { x[pos] = 1; for (size_t beg = 0; beg < size; beg++) { for (size_t end = beg; end < size; end++) { // fprintf(stderr, "pos %zd beg %zd end %zd \n", pos, beg, end); if (beg <= pos && pos < end) EXPECT_FALSE(__sanitizer::mem_is_zero(x + beg, end - beg)); else EXPECT_TRUE(__sanitizer::mem_is_zero(x + beg, end - beg)); } } x[pos] = 0; } delete [] x; } struct stat_and_more { struct stat st; unsigned char z; }; static void temp_file_name(char *buf, size_t bufsize, const char *prefix) { #if SANITIZER_WINDOWS buf[0] = '\0'; char tmp_dir[MAX_PATH]; if (!::GetTempPathA(MAX_PATH, tmp_dir)) return; // GetTempFileNameA needs a MAX_PATH buffer. char tmp_path[MAX_PATH]; if (!::GetTempFileNameA(tmp_dir, prefix, 0, tmp_path)) return; internal_strncpy(buf, tmp_path, bufsize); #else const char *tmpdir = "/tmp"; #if SANITIZER_ANDROID // I don't know a way to query temp directory location on Android without // going through Java interfaces. The code below is not ideal, but should // work. May require "adb root", but it is needed for almost any use of ASan // on Android already. tmpdir = GetEnv("EXTERNAL_STORAGE"); #endif u32 uid = GetUid(); internal_snprintf(buf, bufsize, "%s/%s%d", tmpdir, prefix, uid); #endif } TEST(SanitizerCommon, FileOps) { const char *str1 = "qwerty"; uptr len1 = internal_strlen(str1); const char *str2 = "zxcv"; uptr len2 = internal_strlen(str2); char tmpfile[128]; temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.fileops.tmp."); fd_t fd = OpenFile(tmpfile, WrOnly); ASSERT_NE(fd, kInvalidFd); uptr bytes_written = 0; EXPECT_TRUE(WriteToFile(fd, str1, len1, &bytes_written)); EXPECT_EQ(len1, bytes_written); EXPECT_TRUE(WriteToFile(fd, str2, len2, &bytes_written)); EXPECT_EQ(len2, bytes_written); CloseFile(fd); EXPECT_TRUE(FileExists(tmpfile)); fd = OpenFile(tmpfile, RdOnly); ASSERT_NE(fd, kInvalidFd); #if SANITIZER_POSIX // The stat wrappers are posix-only. uptr fsize = internal_filesize(fd); EXPECT_EQ(len1 + len2, fsize); struct stat st1, st2, st3; EXPECT_EQ(0u, internal_stat(tmpfile, &st1)); EXPECT_EQ(0u, internal_lstat(tmpfile, &st2)); EXPECT_EQ(0u, internal_fstat(fd, &st3)); EXPECT_EQ(fsize, (uptr)st3.st_size); // Verify that internal_fstat does not write beyond the end of the supplied // buffer. struct stat_and_more sam; memset(&sam, 0xAB, sizeof(sam)); EXPECT_EQ(0u, internal_fstat(fd, &sam.st)); EXPECT_EQ(0xAB, sam.z); EXPECT_NE(0xAB, sam.st.st_size); EXPECT_NE(0, sam.st.st_size); #endif char buf[64] = {}; uptr bytes_read = 0; EXPECT_TRUE(ReadFromFile(fd, buf, len1, &bytes_read)); EXPECT_EQ(len1, bytes_read); EXPECT_EQ(0, internal_memcmp(buf, str1, len1)); EXPECT_EQ((char)0, buf[len1 + 1]); internal_memset(buf, 0, len1); EXPECT_TRUE(ReadFromFile(fd, buf, len2, &bytes_read)); EXPECT_EQ(len2, bytes_read); EXPECT_EQ(0, internal_memcmp(buf, str2, len2)); CloseFile(fd); #if SANITIZER_WINDOWS // No sanitizer needs to delete a file on Windows yet. If we ever do, we can // add a portable wrapper and test it from here. ::DeleteFileA(&tmpfile[0]); #else internal_unlink(tmpfile); #endif } static const size_t kStrlcpyBufSize = 8; void test_internal_strlcpy(char *dbuf, const char *sbuf) { uptr retval = 0; retval = internal_strlcpy(dbuf, sbuf, kStrlcpyBufSize); EXPECT_EQ(internal_strncmp(dbuf, sbuf, kStrlcpyBufSize - 1), 0); EXPECT_EQ(internal_strlen(dbuf), std::min(internal_strlen(sbuf), (uptr)(kStrlcpyBufSize - 1))); EXPECT_EQ(retval, internal_strlen(sbuf)); // Test with shorter maxlen. uptr maxlen = 2; if (internal_strlen(sbuf) > maxlen) { retval = internal_strlcpy(dbuf, sbuf, maxlen); EXPECT_EQ(internal_strncmp(dbuf, sbuf, maxlen - 1), 0); EXPECT_EQ(internal_strlen(dbuf), maxlen - 1); } } TEST(SanitizerCommon, InternalStrFunctions) { const char *haystack = "haystack"; EXPECT_EQ(haystack + 2, internal_strchr(haystack, 'y')); EXPECT_EQ(haystack + 2, internal_strchrnul(haystack, 'y')); EXPECT_EQ(0, internal_strchr(haystack, 'z')); EXPECT_EQ(haystack + 8, internal_strchrnul(haystack, 'z')); char dbuf[kStrlcpyBufSize] = {}; const char *samesizestr = "1234567"; const char *shortstr = "123"; const char *longerstr = "123456789"; // Test internal_strlcpy. internal_strlcpy(dbuf, shortstr, 0); EXPECT_EQ(dbuf[0], 0); EXPECT_EQ(dbuf[0], 0); test_internal_strlcpy(dbuf, samesizestr); test_internal_strlcpy(dbuf, shortstr); test_internal_strlcpy(dbuf, longerstr); // Test internal_strlcat. char dcatbuf[kStrlcpyBufSize] = {}; uptr retval = 0; retval = internal_strlcat(dcatbuf, "aaa", 0); EXPECT_EQ(internal_strlen(dcatbuf), (uptr)0); EXPECT_EQ(retval, (uptr)3); retval = internal_strlcat(dcatbuf, "123", kStrlcpyBufSize); EXPECT_EQ(internal_strcmp(dcatbuf, "123"), 0); EXPECT_EQ(internal_strlen(dcatbuf), (uptr)3); EXPECT_EQ(retval, (uptr)3); retval = internal_strlcat(dcatbuf, "123", kStrlcpyBufSize); EXPECT_EQ(internal_strcmp(dcatbuf, "123123"), 0); EXPECT_EQ(internal_strlen(dcatbuf), (uptr)6); EXPECT_EQ(retval, (uptr)6); retval = internal_strlcat(dcatbuf, "123", kStrlcpyBufSize); EXPECT_EQ(internal_strcmp(dcatbuf, "1231231"), 0); EXPECT_EQ(internal_strlen(dcatbuf), (uptr)7); EXPECT_EQ(retval, (uptr)9); } // FIXME: File manipulations are not yet supported on Windows #if SANITIZER_POSIX && !SANITIZER_MAC TEST(SanitizerCommon, InternalMmapWithOffset) { char tmpfile[128]; temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.internalmmapwithoffset.tmp."); fd_t fd = OpenFile(tmpfile, RdWr); ASSERT_NE(fd, kInvalidFd); uptr page_size = GetPageSizeCached(); uptr res = internal_ftruncate(fd, page_size * 2); ASSERT_FALSE(internal_iserror(res)); res = internal_lseek(fd, page_size, SEEK_SET); ASSERT_FALSE(internal_iserror(res)); res = internal_write(fd, "AB", 2); ASSERT_FALSE(internal_iserror(res)); char *p = (char *)MapWritableFileToMemory(nullptr, page_size, fd, page_size); ASSERT_NE(nullptr, p); ASSERT_EQ('A', p[0]); ASSERT_EQ('B', p[1]); CloseFile(fd); UnmapOrDie(p, page_size); internal_unlink(tmpfile); } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_linux_test.cc0000664000175000017500000002335612660257027033306 0ustar mwhudsonmwhudson//===-- sanitizer_linux_test.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tests for sanitizer_linux.h // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_LINUX #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_common.h" #include "gtest/gtest.h" #include #include #include #include #include namespace __sanitizer { struct TidReporterArgument { TidReporterArgument() { pthread_mutex_init(&terminate_thread_mutex, NULL); pthread_mutex_init(&tid_reported_mutex, NULL); pthread_cond_init(&terminate_thread_cond, NULL); pthread_cond_init(&tid_reported_cond, NULL); terminate_thread = false; } ~TidReporterArgument() { pthread_mutex_destroy(&terminate_thread_mutex); pthread_mutex_destroy(&tid_reported_mutex); pthread_cond_destroy(&terminate_thread_cond); pthread_cond_destroy(&tid_reported_cond); } pid_t reported_tid; // For signaling to spawned threads that they should terminate. pthread_cond_t terminate_thread_cond; pthread_mutex_t terminate_thread_mutex; bool terminate_thread; // For signaling to main thread that a child thread has reported its tid. pthread_cond_t tid_reported_cond; pthread_mutex_t tid_reported_mutex; private: // Disallow evil constructors TidReporterArgument(const TidReporterArgument &); void operator=(const TidReporterArgument &); }; class ThreadListerTest : public ::testing::Test { protected: virtual void SetUp() { pthread_t pthread_id; pid_t tid; for (uptr i = 0; i < kThreadCount; i++) { SpawnTidReporter(&pthread_id, &tid); pthread_ids_.push_back(pthread_id); tids_.push_back(tid); } } virtual void TearDown() { pthread_mutex_lock(&thread_arg.terminate_thread_mutex); thread_arg.terminate_thread = true; pthread_cond_broadcast(&thread_arg.terminate_thread_cond); pthread_mutex_unlock(&thread_arg.terminate_thread_mutex); for (uptr i = 0; i < pthread_ids_.size(); i++) pthread_join(pthread_ids_[i], NULL); } void SpawnTidReporter(pthread_t *pthread_id, pid_t *tid); static const uptr kThreadCount = 20; std::vector pthread_ids_; std::vector tids_; TidReporterArgument thread_arg; }; // Writes its TID once to reported_tid and waits until signaled to terminate. void *TidReporterThread(void *argument) { TidReporterArgument *arg = reinterpret_cast(argument); pthread_mutex_lock(&arg->tid_reported_mutex); arg->reported_tid = GetTid(); pthread_cond_broadcast(&arg->tid_reported_cond); pthread_mutex_unlock(&arg->tid_reported_mutex); pthread_mutex_lock(&arg->terminate_thread_mutex); while (!arg->terminate_thread) pthread_cond_wait(&arg->terminate_thread_cond, &arg->terminate_thread_mutex); pthread_mutex_unlock(&arg->terminate_thread_mutex); return NULL; } void ThreadListerTest::SpawnTidReporter(pthread_t *pthread_id, pid_t *tid) { pthread_mutex_lock(&thread_arg.tid_reported_mutex); thread_arg.reported_tid = -1; ASSERT_EQ(0, pthread_create(pthread_id, NULL, TidReporterThread, &thread_arg)); while (thread_arg.reported_tid == -1) pthread_cond_wait(&thread_arg.tid_reported_cond, &thread_arg.tid_reported_mutex); pthread_mutex_unlock(&thread_arg.tid_reported_mutex); *tid = thread_arg.reported_tid; } static std::vector ReadTidsToVector(ThreadLister *thread_lister) { std::vector listed_tids; pid_t tid; while ((tid = thread_lister->GetNextTID()) >= 0) listed_tids.push_back(tid); EXPECT_FALSE(thread_lister->error()); return listed_tids; } static bool Includes(std::vector first, std::vector second) { std::sort(first.begin(), first.end()); std::sort(second.begin(), second.end()); return std::includes(first.begin(), first.end(), second.begin(), second.end()); } static bool HasElement(std::vector vector, pid_t element) { return std::find(vector.begin(), vector.end(), element) != vector.end(); } // ThreadLister's output should include the current thread's TID and the TID of // every thread we spawned. TEST_F(ThreadListerTest, ThreadListerSeesAllSpawnedThreads) { pid_t self_tid = GetTid(); ThreadLister thread_lister(getpid()); std::vector listed_tids = ReadTidsToVector(&thread_lister); ASSERT_TRUE(HasElement(listed_tids, self_tid)); ASSERT_TRUE(Includes(listed_tids, tids_)); } // Calling Reset() should not cause ThreadLister to forget any threads it's // supposed to know about. TEST_F(ThreadListerTest, ResetDoesNotForgetThreads) { ThreadLister thread_lister(getpid()); // Run the loop body twice, because Reset() might behave differently if called // on a freshly created object. for (uptr i = 0; i < 2; i++) { thread_lister.Reset(); std::vector listed_tids = ReadTidsToVector(&thread_lister); ASSERT_TRUE(Includes(listed_tids, tids_)); } } // If new threads have spawned during ThreadLister object's lifetime, calling // Reset() should cause ThreadLister to recognize their existence. TEST_F(ThreadListerTest, ResetMakesNewThreadsKnown) { ThreadLister thread_lister(getpid()); std::vector threads_before_extra = ReadTidsToVector(&thread_lister); pthread_t extra_pthread_id; pid_t extra_tid; SpawnTidReporter(&extra_pthread_id, &extra_tid); // Register the new thread so it gets terminated in TearDown(). pthread_ids_.push_back(extra_pthread_id); // It would be very bizarre if the new TID had been listed before we even // spawned that thread, but it would also cause a false success in this test, // so better check for that. ASSERT_FALSE(HasElement(threads_before_extra, extra_tid)); thread_lister.Reset(); std::vector threads_after_extra = ReadTidsToVector(&thread_lister); ASSERT_TRUE(HasElement(threads_after_extra, extra_tid)); } TEST(SanitizerCommon, SetEnvTest) { const char kEnvName[] = "ENV_FOO"; SetEnv(kEnvName, "value"); EXPECT_STREQ("value", getenv(kEnvName)); unsetenv(kEnvName); EXPECT_EQ(0, getenv(kEnvName)); } #if (defined(__x86_64__) || defined(__i386__)) && !SANITIZER_ANDROID void *thread_self_offset_test_func(void *arg) { bool result = *(uptr *)((char *)ThreadSelf() + ThreadSelfOffset()) == ThreadSelf(); return (void *)result; } TEST(SanitizerLinux, ThreadSelfOffset) { EXPECT_TRUE((bool)thread_self_offset_test_func(0)); pthread_t tid; void *result; ASSERT_EQ(0, pthread_create(&tid, 0, thread_self_offset_test_func, 0)); ASSERT_EQ(0, pthread_join(tid, &result)); EXPECT_TRUE((bool)result); } // libpthread puts the thread descriptor at the end of stack space. void *thread_descriptor_size_test_func(void *arg) { uptr descr_addr = ThreadSelf(); pthread_attr_t attr; pthread_getattr_np(pthread_self(), &attr); void *stackaddr; size_t stacksize; pthread_attr_getstack(&attr, &stackaddr, &stacksize); return (void *)((uptr)stackaddr + stacksize - descr_addr); } TEST(SanitizerLinux, ThreadDescriptorSize) { pthread_t tid; void *result; ASSERT_EQ(0, pthread_create(&tid, 0, thread_descriptor_size_test_func, 0)); ASSERT_EQ(0, pthread_join(tid, &result)); EXPECT_EQ((uptr)result, ThreadDescriptorSize()); } #endif TEST(SanitizerCommon, LibraryNameIs) { EXPECT_FALSE(LibraryNameIs("", "")); char full_name[256]; const char *paths[] = { "", "/", "/path/to/" }; const char *suffixes[] = { "", "-linux", ".1.2", "-linux.1.2" }; const char *base_names[] = { "lib", "lib.0", "lib-i386" }; const char *wrong_names[] = { "", "lib.9", "lib-x86_64" }; for (uptr i = 0; i < ARRAY_SIZE(paths); i++) for (uptr j = 0; j < ARRAY_SIZE(suffixes); j++) { for (uptr k = 0; k < ARRAY_SIZE(base_names); k++) { internal_snprintf(full_name, ARRAY_SIZE(full_name), "%s%s%s.so", paths[i], base_names[k], suffixes[j]); EXPECT_TRUE(LibraryNameIs(full_name, base_names[k])) << "Full name " << full_name << " doesn't match base name " << base_names[k]; for (uptr m = 0; m < ARRAY_SIZE(wrong_names); m++) EXPECT_FALSE(LibraryNameIs(full_name, wrong_names[m])) << "Full name " << full_name << " matches base name " << wrong_names[m]; } } } #if defined(__mips64) // Effectively, this is a test for ThreadDescriptorSize() which is used to // compute ThreadSelf(). TEST(SanitizerLinux, ThreadSelfTest) { ASSERT_EQ(pthread_self(), ThreadSelf()); } #endif TEST(SanitizerCommon, StartSubprocessTest) { int pipe_fds[2]; ASSERT_EQ(0, pipe(pipe_fds)); #if SANITIZER_ANDROID const char *shell = "/system/bin/sh"; #else const char *shell = "/bin/sh"; #endif const char *argv[] = {shell, "-c", "echo -n 'hello'", (char *)NULL}; int pid = StartSubprocess(shell, argv, /* stdin */ kInvalidFd, /* stdout */ pipe_fds[1]); ASSERT_GT(pid, 0); // wait for process to finish. while (IsProcessRunning(pid)) { } ASSERT_FALSE(IsProcessRunning(pid)); char buffer[256]; { char *ptr = buffer; uptr bytes_read; while (ReadFromFile(pipe_fds[0], ptr, 256, &bytes_read)) { if (!bytes_read) { break; } ptr += bytes_read; } ASSERT_EQ(5, ptr - buffer); *ptr = 0; } ASSERT_EQ(0, strcmp(buffer, "hello")) << "Buffer: " << buffer; internal_close(pipe_fds[0]); } } // namespace __sanitizer #endif // SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_bvgraph_test.cc0000664000175000017500000002106612316214006033560 0ustar mwhudsonmwhudson//===-- sanitizer_bvgraph_test.cc -----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. // Tests for sanitizer_bvgraph.h. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_bvgraph.h" #include "sanitizer_test_utils.h" #include "gtest/gtest.h" #include #include #include using namespace __sanitizer; using namespace std; typedef BasicBitVector BV1; typedef BasicBitVector<> BV2; typedef TwoLevelBitVector<> BV3; typedef TwoLevelBitVector<3, BasicBitVector > BV4; template void PrintGraph(const G &g) { for (uptr i = 0; i < g.size(); i++) { for (uptr j = 0; j < g.size(); j++) { fprintf(stderr, "%d", g.hasEdge(i, j)); } fprintf(stderr, "\n"); } } class SimpleGraph { public: void clear() { s_.clear(); } bool addEdge(uptr from, uptr to) { return s_.insert(idx(from, to)).second; } bool removeEdge(uptr from, uptr to) { return s_.erase(idx(from, to)); } template void checkSameAs(G *g) { for (set::iterator it = s_.begin(); it != s_.end(); ++it) { uptr from = *it >> 16; uptr to = *it & ((1 << 16) - 1); EXPECT_TRUE(g->removeEdge(from, to)); } EXPECT_TRUE(g->empty()); } private: uptr idx(uptr from, uptr to) { CHECK_LE(from|to, 1 << 16); return (from << 16) + to; } set s_; }; template void BasicTest() { BVGraph g; g.clear(); BV target; SimpleGraph s_g; set s; set s_target; int num_reachable = 0; for (int it = 0; it < 1000; it++) { target.clear(); s_target.clear(); for (int t = 0; t < 4; t++) { uptr idx = (uptr)my_rand() % g.size(); EXPECT_EQ(target.setBit(idx), s_target.insert(idx).second); } uptr from = my_rand() % g.size(); uptr to = my_rand() % g.size(); EXPECT_EQ(g.addEdge(from, to), s_g.addEdge(from, to)); EXPECT_TRUE(g.hasEdge(from, to)); for (int i = 0; i < 10; i++) { from = my_rand() % g.size(); bool is_reachable = g.isReachable(from, target); if (is_reachable) { uptr path[BV::kSize]; uptr len; for (len = 1; len < BV::kSize; len++) { if (g.findPath(from, target, path, len) == len) break; } EXPECT_LT(len, BV::kSize); EXPECT_TRUE(target.getBit(path[len - 1])); // fprintf(stderr, "reachable: %zd; path %zd {%zd %zd %zd}\n", // from, len, path[0], path[1], path[2]); num_reachable++; } } } EXPECT_GT(num_reachable, 0); } TEST(BVGraph, BasicTest) { BasicTest(); BasicTest(); BasicTest(); BasicTest(); } template void RemoveEdges() { SimpleGraph s_g; BVGraph g; g.clear(); BV bv; set s; for (int it = 0; it < 100; it++) { s.clear(); bv.clear(); s_g.clear(); g.clear(); for (uptr j = 0; j < g.size() * 2; j++) { uptr from = my_rand() % g.size(); uptr to = my_rand() % g.size(); EXPECT_EQ(g.addEdge(from, to), s_g.addEdge(from, to)); } for (uptr j = 0; j < 5; j++) { uptr idx = my_rand() % g.size(); s.insert(idx); bv.setBit(idx); } if (it % 2) { g.removeEdgesFrom(bv); for (set::iterator from = s.begin(); from != s.end(); ++from) { for (uptr to = 0; to < g.size(); to++) s_g.removeEdge(*from, to); } } else { g.removeEdgesTo(bv); for (set::iterator to = s.begin(); to != s.end(); ++to) { for (uptr from = 0; from < g.size(); from++) s_g.removeEdge(from, *to); } } s_g.checkSameAs(&g); } } TEST(BVGraph, RemoveEdges) { RemoveEdges(); RemoveEdges(); RemoveEdges(); RemoveEdges(); } template void Test_isReachable() { uptr path[5]; BVGraph g; g.clear(); BV target; target.clear(); uptr t0 = 0; uptr t1 = g.size() - 1; target.setBit(t0); target.setBit(t1); uptr f0 = 1; uptr f1 = 2; uptr f2 = g.size() / 2; uptr f3 = g.size() - 2; EXPECT_FALSE(g.isReachable(f0, target)); EXPECT_FALSE(g.isReachable(f1, target)); EXPECT_FALSE(g.isReachable(f2, target)); EXPECT_FALSE(g.isReachable(f3, target)); g.addEdge(f0, f1); g.addEdge(f1, f2); g.addEdge(f2, f3); EXPECT_FALSE(g.isReachable(f0, target)); EXPECT_FALSE(g.isReachable(f1, target)); EXPECT_FALSE(g.isReachable(f2, target)); EXPECT_FALSE(g.isReachable(f3, target)); g.addEdge(f1, t0); EXPECT_TRUE(g.isReachable(f0, target)); EXPECT_TRUE(g.isReachable(f1, target)); EXPECT_FALSE(g.isReachable(f2, target)); EXPECT_FALSE(g.isReachable(f3, target)); EXPECT_EQ(g.findPath(f0, target, path, ARRAY_SIZE(path)), 3U); EXPECT_EQ(path[0], f0); EXPECT_EQ(path[1], f1); EXPECT_EQ(path[2], t0); EXPECT_EQ(g.findPath(f1, target, path, ARRAY_SIZE(path)), 2U); EXPECT_EQ(path[0], f1); EXPECT_EQ(path[1], t0); g.addEdge(f3, t1); EXPECT_TRUE(g.isReachable(f0, target)); EXPECT_TRUE(g.isReachable(f1, target)); EXPECT_TRUE(g.isReachable(f2, target)); EXPECT_TRUE(g.isReachable(f3, target)); } TEST(BVGraph, isReachable) { Test_isReachable(); Test_isReachable(); Test_isReachable(); Test_isReachable(); } template void LongCycle() { BVGraph g; g.clear(); vector path_vec(g.size()); uptr *path = path_vec.data(); uptr start = 5; for (uptr i = start; i < g.size() - 1; i++) { g.addEdge(i, i + 1); for (uptr j = 0; j < start; j++) g.addEdge(i, j); } // Bad graph that looks like this: // 00000000000000 // 00000000000000 // 00000000000000 // 00000000000000 // 00000000000000 // 11111010000000 // 11111001000000 // 11111000100000 // 11111000010000 // 11111000001000 // 11111000000100 // 11111000000010 // 11111000000001 // if (g.size() <= 64) PrintGraph(g); BV target; for (uptr i = start + 1; i < g.size(); i += 11) { // if ((i & (i - 1)) == 0) fprintf(stderr, "Path: : %zd\n", i); target.clear(); target.setBit(i); EXPECT_TRUE(g.isReachable(start, target)); EXPECT_EQ(g.findPath(start, target, path, g.size()), i - start + 1); } } TEST(BVGraph, LongCycle) { LongCycle(); LongCycle(); LongCycle(); LongCycle(); } template void ShortestPath() { uptr path[8]; BVGraph g; g.clear(); BV t7; t7.clear(); t7.setBit(7); // 1=>2=>3=>4=>5=>6=>7 // 1=>7 g.addEdge(1, 2); g.addEdge(2, 3); g.addEdge(3, 4); g.addEdge(4, 5); g.addEdge(5, 6); g.addEdge(6, 7); g.addEdge(1, 7); EXPECT_TRUE(g.isReachable(1, t7)); // No path of length 1. EXPECT_EQ(0U, g.findPath(1, t7, path, 1)); // Trying to find a path of len 2..6 gives path of len 2. EXPECT_EQ(2U, g.findPath(1, t7, path, 2)); EXPECT_EQ(2U, g.findPath(1, t7, path, 3)); EXPECT_EQ(2U, g.findPath(1, t7, path, 4)); EXPECT_EQ(2U, g.findPath(1, t7, path, 5)); EXPECT_EQ(2U, g.findPath(1, t7, path, 6)); // Trying to find a path of len 7 gives path of len 7, because this is DFS. EXPECT_EQ(7U, g.findPath(1, t7, path, 7)); // But findShortestPath will find the shortest path. EXPECT_EQ(2U, g.findShortestPath(1, t7, path, 2)); EXPECT_EQ(2U, g.findShortestPath(1, t7, path, 7)); } TEST(BVGraph, ShortestPath) { ShortestPath(); ShortestPath(); ShortestPath(); ShortestPath(); } template void RunAddEdgesTest() { BVGraph g; BV from; const int kMaxEdges = 10; uptr added_edges[kMaxEdges]; g.clear(); from.clear(); EXPECT_EQ(0U, g.addEdges(from, 0, added_edges, kMaxEdges)); EXPECT_EQ(0U, g.addEdges(from, 1, added_edges, kMaxEdges)); from.setBit(0); EXPECT_EQ(1U, g.addEdges(from, 1, added_edges, kMaxEdges)); EXPECT_EQ(0U, added_edges[0]); EXPECT_EQ(0U, g.addEdges(from, 1, added_edges, kMaxEdges)); from.clear(); from.setBit(1); EXPECT_EQ(1U, g.addEdges(from, 4, added_edges, kMaxEdges)); EXPECT_TRUE(g.hasEdge(1, 4)); EXPECT_FALSE(g.hasEdge(1, 5)); EXPECT_EQ(1U, added_edges[0]); from.setBit(2); from.setBit(3); EXPECT_EQ(2U, g.addEdges(from, 4, added_edges, kMaxEdges)); EXPECT_TRUE(g.hasEdge(2, 4)); EXPECT_FALSE(g.hasEdge(2, 5)); EXPECT_TRUE(g.hasEdge(3, 4)); EXPECT_FALSE(g.hasEdge(3, 5)); EXPECT_EQ(2U, added_edges[0]); EXPECT_EQ(3U, added_edges[1]); } TEST(BVGraph, AddEdgesTest) { RunAddEdgesTest(); } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_stacktrace_print0000664000175000017500000001144712533723706034063 0ustar mwhudsonmwhudson//===-- sanitizer_common_printer_test.cc ----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of sanitizer_common test suite. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_stacktrace_printer.h" #include "gtest/gtest.h" namespace __sanitizer { TEST(SanitizerStacktracePrinter, RenderSourceLocation) { InternalScopedString str(128); RenderSourceLocation(&str, "/dir/file.cc", 10, 5, false, ""); EXPECT_STREQ("/dir/file.cc:10:5", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 11, 0, false, ""); EXPECT_STREQ("/dir/file.cc:11", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 0, 0, false, ""); EXPECT_STREQ("/dir/file.cc", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 10, 5, false, "/dir/"); EXPECT_STREQ("file.cc:10:5", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 10, 5, true, ""); EXPECT_STREQ("/dir/file.cc(10,5)", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 11, 0, true, ""); EXPECT_STREQ("/dir/file.cc(11)", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 0, 0, true, ""); EXPECT_STREQ("/dir/file.cc", str.data()); str.clear(); RenderSourceLocation(&str, "/dir/file.cc", 10, 5, true, "/dir/"); EXPECT_STREQ("file.cc(10,5)", str.data()); } TEST(SanitizerStacktracePrinter, RenderModuleLocation) { InternalScopedString str(128); RenderModuleLocation(&str, "/dir/exe", 0x123, ""); EXPECT_STREQ("(/dir/exe+0x123)", str.data()); // Check that we strip file prefix if necessary. str.clear(); RenderModuleLocation(&str, "/dir/exe", 0x123, "/dir/"); EXPECT_STREQ("(exe+0x123)", str.data()); } TEST(SanitizerStacktracePrinter, RenderFrame) { int frame_no = 42; AddressInfo info; info.address = 0x400000; info.module = internal_strdup("/path/to/my/module"); info.module_offset = 0x200; info.function = internal_strdup("function_foo"); info.function_offset = 0x100; info.file = internal_strdup("/path/to/my/source"); info.line = 10; info.column = 5; InternalScopedString str(256); // Dump all the AddressInfo fields. RenderFrame(&str, "%% Frame:%n PC:%p Module:%m ModuleOffset:%o " "Function:%f FunctionOffset:%q Source:%s Line:%l " "Column:%c", frame_no, info, false, "/path/to/", "function_"); EXPECT_STREQ("% Frame:42 PC:0x400000 Module:my/module ModuleOffset:0x200 " "Function:foo FunctionOffset:0x100 Source:my/source Line:10 " "Column:5", str.data()); info.Clear(); str.clear(); // Test special format specifiers. info.address = 0x400000; RenderFrame(&str, "%M", frame_no, info, false); EXPECT_NE(nullptr, internal_strstr(str.data(), "400000")); str.clear(); RenderFrame(&str, "%L", frame_no, info, false); EXPECT_STREQ("()", str.data()); str.clear(); info.module = internal_strdup("/path/to/module"); info.module_offset = 0x200; RenderFrame(&str, "%M", frame_no, info, false); EXPECT_NE(nullptr, internal_strstr(str.data(), "(module+0x")); EXPECT_NE(nullptr, internal_strstr(str.data(), "200")); str.clear(); RenderFrame(&str, "%L", frame_no, info, false); EXPECT_STREQ("(/path/to/module+0x200)", str.data()); str.clear(); info.function = internal_strdup("my_function"); RenderFrame(&str, "%F", frame_no, info, false); EXPECT_STREQ("in my_function", str.data()); str.clear(); info.function_offset = 0x100; RenderFrame(&str, "%F %S", frame_no, info, false); EXPECT_STREQ("in my_function+0x100 ", str.data()); str.clear(); info.file = internal_strdup("my_file"); RenderFrame(&str, "%F %S", frame_no, info, false); EXPECT_STREQ("in my_function my_file", str.data()); str.clear(); info.line = 10; RenderFrame(&str, "%F %S", frame_no, info, false); EXPECT_STREQ("in my_function my_file:10", str.data()); str.clear(); info.column = 5; RenderFrame(&str, "%S %L", frame_no, info, false); EXPECT_STREQ("my_file:10:5 my_file:10:5", str.data()); str.clear(); RenderFrame(&str, "%S %L", frame_no, info, true); EXPECT_STREQ("my_file(10,5) my_file(10,5)", str.data()); str.clear(); info.column = 0; RenderFrame(&str, "%F %S", frame_no, info, true); EXPECT_STREQ("in my_function my_file(10)", str.data()); str.clear(); info.line = 0; RenderFrame(&str, "%F %S", frame_no, info, true); EXPECT_STREQ("in my_function my_file", str.data()); str.clear(); info.Clear(); } } // namespace __sanitizer ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_allocator_test.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/tests/sanitizer_allocator_test.c0000664000175000017500000010061612766621015033756 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_test.cc ---------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Tests for sanitizer_allocator.h. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_test_utils.h" #include "sanitizer_pthread_wrappers.h" #include "gtest/gtest.h" #include #include #include #include using namespace __sanitizer; // Too slow for debug build #if !SANITIZER_DEBUG #if SANITIZER_CAN_USE_ALLOCATOR64 #if SANITIZER_WINDOWS // On Windows 64-bit there is no easy way to find a large enough fixed address // space that is always available. Thus, a dynamically allocated address space // is used instead (i.e. ~(uptr)0). static const uptr kAllocatorSpace = ~(uptr)0; static const uptr kAllocatorSize = 0x8000000000ULL; // 500G static const u64 kAddressSpaceSize = 1ULL << 47; typedef DefaultSizeClassMap SizeClassMap; #elif SANITIZER_ANDROID && defined(__aarch64__) static const uptr kAllocatorSpace = 0x3000000000ULL; static const uptr kAllocatorSize = 0x2000000000ULL; static const u64 kAddressSpaceSize = 1ULL << 39; typedef VeryCompactSizeClassMap SizeClassMap; #else static const uptr kAllocatorSpace = 0x700000000000ULL; static const uptr kAllocatorSize = 0x010000000000ULL; // 1T. static const u64 kAddressSpaceSize = 1ULL << 47; typedef DefaultSizeClassMap SizeClassMap; #endif struct AP64 { // Allocator Params. Short name for shorter demangled names.. static const uptr kSpaceBeg = kAllocatorSpace; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 16; typedef ::SizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; struct AP64Dyn { static const uptr kSpaceBeg = ~(uptr)0; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 16; typedef ::SizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; struct AP64Compact { static const uptr kSpaceBeg = ~(uptr)0; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 16; typedef CompactSizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; struct AP64VeryCompact { static const uptr kSpaceBeg = ~(uptr)0; static const uptr kSpaceSize = 1ULL << 37; static const uptr kMetadataSize = 16; typedef VeryCompactSizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; typedef SizeClassAllocator64 Allocator64; typedef SizeClassAllocator64 Allocator64Dynamic; typedef SizeClassAllocator64 Allocator64Compact; typedef SizeClassAllocator64 Allocator64VeryCompact; #elif defined(__mips64) static const u64 kAddressSpaceSize = 1ULL << 40; #elif defined(__aarch64__) static const u64 kAddressSpaceSize = 1ULL << 39; #elif defined(__s390x__) static const u64 kAddressSpaceSize = 1ULL << 53; #elif defined(__s390__) static const u64 kAddressSpaceSize = 1ULL << 31; #else static const u64 kAddressSpaceSize = 1ULL << 32; #endif static const uptr kRegionSizeLog = FIRST_32_SECOND_64(20, 24); static const uptr kFlatByteMapSize = kAddressSpaceSize >> kRegionSizeLog; typedef SizeClassAllocator32< 0, kAddressSpaceSize, /*kMetadataSize*/16, CompactSizeClassMap, kRegionSizeLog, FlatByteMap > Allocator32Compact; template void TestSizeClassMap() { typedef SizeClassMap SCMap; SCMap::Print(); SCMap::Validate(); } TEST(SanitizerCommon, DefaultSizeClassMap) { TestSizeClassMap(); } TEST(SanitizerCommon, CompactSizeClassMap) { TestSizeClassMap(); } TEST(SanitizerCommon, VeryCompactSizeClassMap) { TestSizeClassMap(); } TEST(SanitizerCommon, InternalSizeClassMap) { TestSizeClassMap(); } template void TestSizeClassAllocator() { Allocator *a = new Allocator; a->Init(); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); static const uptr sizes[] = { 1, 16, 30, 40, 100, 1000, 10000, 50000, 60000, 100000, 120000, 300000, 500000, 1000000, 2000000 }; std::vector allocated; uptr last_total_allocated = 0; for (int i = 0; i < 3; i++) { // Allocate a bunch of chunks. for (uptr s = 0; s < ARRAY_SIZE(sizes); s++) { uptr size = sizes[s]; if (!a->CanAllocate(size, 1)) continue; // printf("s = %ld\n", size); uptr n_iter = std::max((uptr)6, 4000000 / size); // fprintf(stderr, "size: %ld iter: %ld\n", size, n_iter); for (uptr i = 0; i < n_iter; i++) { uptr class_id0 = Allocator::SizeClassMapT::ClassID(size); char *x = (char*)cache.Allocate(a, class_id0); x[0] = 0; x[size - 1] = 0; x[size / 2] = 0; allocated.push_back(x); CHECK_EQ(x, a->GetBlockBegin(x)); CHECK_EQ(x, a->GetBlockBegin(x + size - 1)); CHECK(a->PointerIsMine(x)); CHECK(a->PointerIsMine(x + size - 1)); CHECK(a->PointerIsMine(x + size / 2)); CHECK_GE(a->GetActuallyAllocatedSize(x), size); uptr class_id = a->GetSizeClass(x); CHECK_EQ(class_id, Allocator::SizeClassMapT::ClassID(size)); uptr *metadata = reinterpret_cast(a->GetMetaData(x)); metadata[0] = reinterpret_cast(x) + 1; metadata[1] = 0xABCD; } } // Deallocate all. for (uptr i = 0; i < allocated.size(); i++) { void *x = allocated[i]; uptr *metadata = reinterpret_cast(a->GetMetaData(x)); CHECK_EQ(metadata[0], reinterpret_cast(x) + 1); CHECK_EQ(metadata[1], 0xABCD); cache.Deallocate(a, a->GetSizeClass(x), x); } allocated.clear(); uptr total_allocated = a->TotalMemoryUsed(); if (last_total_allocated == 0) last_total_allocated = total_allocated; CHECK_EQ(last_total_allocated, total_allocated); } // Check that GetBlockBegin never crashes. for (uptr x = 0, step = kAddressSpaceSize / 100000; x < kAddressSpaceSize - step; x += step) if (a->PointerIsMine(reinterpret_cast(x))) Ident(a->GetBlockBegin(reinterpret_cast(x))); a->TestOnlyUnmap(); delete a; } #if SANITIZER_CAN_USE_ALLOCATOR64 // These tests can fail on Windows if memory is somewhat full and lit happens // to run them all at the same time. FIXME: Make them not flaky and reenable. #if !SANITIZER_WINDOWS TEST(SanitizerCommon, SizeClassAllocator64) { TestSizeClassAllocator(); } TEST(SanitizerCommon, SizeClassAllocator64Dynamic) { TestSizeClassAllocator(); } #if !SANITIZER_ANDROID TEST(SanitizerCommon, SizeClassAllocator64Compact) { TestSizeClassAllocator(); } #endif TEST(SanitizerCommon, SizeClassAllocator64VeryCompact) { TestSizeClassAllocator(); } #endif #endif TEST(SanitizerCommon, SizeClassAllocator32Compact) { TestSizeClassAllocator(); } template void SizeClassAllocatorMetadataStress() { Allocator *a = new Allocator; a->Init(); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); const uptr kNumAllocs = 1 << 13; void *allocated[kNumAllocs]; void *meta[kNumAllocs]; for (uptr i = 0; i < kNumAllocs; i++) { void *x = cache.Allocate(a, 1 + i % (Allocator::kNumClasses - 1)); allocated[i] = x; meta[i] = a->GetMetaData(x); } // Get Metadata kNumAllocs^2 times. for (uptr i = 0; i < kNumAllocs * kNumAllocs; i++) { uptr idx = i % kNumAllocs; void *m = a->GetMetaData(allocated[idx]); EXPECT_EQ(m, meta[idx]); } for (uptr i = 0; i < kNumAllocs; i++) { cache.Deallocate(a, 1 + i % (Allocator::kNumClasses - 1), allocated[i]); } a->TestOnlyUnmap(); delete a; } #if SANITIZER_CAN_USE_ALLOCATOR64 // These tests can fail on Windows if memory is somewhat full and lit happens // to run them all at the same time. FIXME: Make them not flaky and reenable. #if !SANITIZER_WINDOWS TEST(SanitizerCommon, SizeClassAllocator64MetadataStress) { SizeClassAllocatorMetadataStress(); } TEST(SanitizerCommon, SizeClassAllocator64DynamicMetadataStress) { SizeClassAllocatorMetadataStress(); } #if !SANITIZER_ANDROID TEST(SanitizerCommon, SizeClassAllocator64CompactMetadataStress) { SizeClassAllocatorMetadataStress(); } #endif #endif #endif // SANITIZER_CAN_USE_ALLOCATOR64 TEST(SanitizerCommon, SizeClassAllocator32CompactMetadataStress) { SizeClassAllocatorMetadataStress(); } template void SizeClassAllocatorGetBlockBeginStress(u64 TotalSize) { Allocator *a = new Allocator; a->Init(); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); uptr max_size_class = Allocator::SizeClassMapT::kLargestClassID; uptr size = Allocator::SizeClassMapT::Size(max_size_class); // Make sure we correctly compute GetBlockBegin() w/o overflow. for (size_t i = 0; i <= TotalSize / size; i++) { void *x = cache.Allocate(a, max_size_class); void *beg = a->GetBlockBegin(x); // if ((i & (i - 1)) == 0) // fprintf(stderr, "[%zd] %p %p\n", i, x, beg); EXPECT_EQ(x, beg); } a->TestOnlyUnmap(); delete a; } #if SANITIZER_CAN_USE_ALLOCATOR64 // These tests can fail on Windows if memory is somewhat full and lit happens // to run them all at the same time. FIXME: Make them not flaky and reenable. #if !SANITIZER_WINDOWS TEST(SanitizerCommon, SizeClassAllocator64GetBlockBegin) { SizeClassAllocatorGetBlockBeginStress( 1ULL << (SANITIZER_ANDROID ? 31 : 33)); } TEST(SanitizerCommon, SizeClassAllocator64DynamicGetBlockBegin) { SizeClassAllocatorGetBlockBeginStress( 1ULL << (SANITIZER_ANDROID ? 31 : 33)); } #if !SANITIZER_ANDROID TEST(SanitizerCommon, SizeClassAllocator64CompactGetBlockBegin) { SizeClassAllocatorGetBlockBeginStress(1ULL << 33); } #endif TEST(SanitizerCommon, SizeClassAllocator64VeryCompactGetBlockBegin) { // Does not have > 4Gb for each class. SizeClassAllocatorGetBlockBeginStress(1ULL << 31); } TEST(SanitizerCommon, SizeClassAllocator32CompactGetBlockBegin) { SizeClassAllocatorGetBlockBeginStress(1ULL << 33); } #endif #endif // SANITIZER_CAN_USE_ALLOCATOR64 struct TestMapUnmapCallback { static int map_count, unmap_count; void OnMap(uptr p, uptr size) const { map_count++; } void OnUnmap(uptr p, uptr size) const { unmap_count++; } }; int TestMapUnmapCallback::map_count; int TestMapUnmapCallback::unmap_count; #if SANITIZER_CAN_USE_ALLOCATOR64 // These tests can fail on Windows if memory is somewhat full and lit happens // to run them all at the same time. FIXME: Make them not flaky and reenable. #if !SANITIZER_WINDOWS struct AP64WithCallback { static const uptr kSpaceBeg = kAllocatorSpace; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 16; typedef ::SizeClassMap SizeClassMap; typedef TestMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; TEST(SanitizerCommon, SizeClassAllocator64MapUnmapCallback) { TestMapUnmapCallback::map_count = 0; TestMapUnmapCallback::unmap_count = 0; typedef SizeClassAllocator64 Allocator64WithCallBack; Allocator64WithCallBack *a = new Allocator64WithCallBack; a->Init(); EXPECT_EQ(TestMapUnmapCallback::map_count, 1); // Allocator state. SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); AllocatorStats stats; stats.Init(); const size_t kNumChunks = 128; uint32_t chunks[kNumChunks]; a->GetFromAllocator(&stats, 30, chunks, kNumChunks); // State + alloc + metadata + freearray. EXPECT_EQ(TestMapUnmapCallback::map_count, 4); a->TestOnlyUnmap(); EXPECT_EQ(TestMapUnmapCallback::unmap_count, 1); // The whole thing. delete a; } #endif #endif TEST(SanitizerCommon, SizeClassAllocator32MapUnmapCallback) { TestMapUnmapCallback::map_count = 0; TestMapUnmapCallback::unmap_count = 0; typedef SizeClassAllocator32< 0, kAddressSpaceSize, /*kMetadataSize*/16, CompactSizeClassMap, kRegionSizeLog, FlatByteMap, TestMapUnmapCallback> Allocator32WithCallBack; Allocator32WithCallBack *a = new Allocator32WithCallBack; a->Init(); EXPECT_EQ(TestMapUnmapCallback::map_count, 0); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); AllocatorStats stats; stats.Init(); a->AllocateBatch(&stats, &cache, 32); EXPECT_EQ(TestMapUnmapCallback::map_count, 1); a->TestOnlyUnmap(); EXPECT_EQ(TestMapUnmapCallback::unmap_count, 1); delete a; // fprintf(stderr, "Map: %d Unmap: %d\n", // TestMapUnmapCallback::map_count, // TestMapUnmapCallback::unmap_count); } TEST(SanitizerCommon, LargeMmapAllocatorMapUnmapCallback) { TestMapUnmapCallback::map_count = 0; TestMapUnmapCallback::unmap_count = 0; LargeMmapAllocator a; a.Init(/* may_return_null */ false); AllocatorStats stats; stats.Init(); void *x = a.Allocate(&stats, 1 << 20, 1); EXPECT_EQ(TestMapUnmapCallback::map_count, 1); a.Deallocate(&stats, x); EXPECT_EQ(TestMapUnmapCallback::unmap_count, 1); } template void FailInAssertionOnOOM() { Allocator a; a.Init(); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); AllocatorStats stats; stats.Init(); const size_t kNumChunks = 128; uint32_t chunks[kNumChunks]; for (int i = 0; i < 1000000; i++) { a.GetFromAllocator(&stats, 52, chunks, kNumChunks); } a.TestOnlyUnmap(); } // Don't test OOM conditions on Win64 because it causes other tests on the same // machine to OOM. #if SANITIZER_CAN_USE_ALLOCATOR64 && !SANITIZER_WINDOWS64 && !SANITIZER_ANDROID TEST(SanitizerCommon, SizeClassAllocator64Overflow) { EXPECT_DEATH(FailInAssertionOnOOM(), "Out of memory"); } #endif TEST(SanitizerCommon, LargeMmapAllocator) { LargeMmapAllocator<> a; a.Init(/* may_return_null */ false); AllocatorStats stats; stats.Init(); static const int kNumAllocs = 1000; char *allocated[kNumAllocs]; static const uptr size = 4000; // Allocate some. for (int i = 0; i < kNumAllocs; i++) { allocated[i] = (char *)a.Allocate(&stats, size, 1); CHECK(a.PointerIsMine(allocated[i])); } // Deallocate all. CHECK_GT(a.TotalMemoryUsed(), size * kNumAllocs); for (int i = 0; i < kNumAllocs; i++) { char *p = allocated[i]; CHECK(a.PointerIsMine(p)); a.Deallocate(&stats, p); } // Check that non left. CHECK_EQ(a.TotalMemoryUsed(), 0); // Allocate some more, also add metadata. for (int i = 0; i < kNumAllocs; i++) { char *x = (char *)a.Allocate(&stats, size, 1); CHECK_GE(a.GetActuallyAllocatedSize(x), size); uptr *meta = reinterpret_cast(a.GetMetaData(x)); *meta = i; allocated[i] = x; } for (int i = 0; i < kNumAllocs * kNumAllocs; i++) { char *p = allocated[i % kNumAllocs]; CHECK(a.PointerIsMine(p)); CHECK(a.PointerIsMine(p + 2000)); } CHECK_GT(a.TotalMemoryUsed(), size * kNumAllocs); // Deallocate all in reverse order. for (int i = 0; i < kNumAllocs; i++) { int idx = kNumAllocs - i - 1; char *p = allocated[idx]; uptr *meta = reinterpret_cast(a.GetMetaData(p)); CHECK_EQ(*meta, idx); CHECK(a.PointerIsMine(p)); a.Deallocate(&stats, p); } CHECK_EQ(a.TotalMemoryUsed(), 0); // Test alignments. Test with 512MB alignment on x64 non-Windows machines. // Windows doesn't overcommit, and many machines do not have 51.2GB of swap. uptr max_alignment = (SANITIZER_WORDSIZE == 64 && !SANITIZER_WINDOWS) ? (1 << 28) : (1 << 24); for (uptr alignment = 8; alignment <= max_alignment; alignment *= 2) { const uptr kNumAlignedAllocs = 100; for (uptr i = 0; i < kNumAlignedAllocs; i++) { uptr size = ((i % 10) + 1) * 4096; char *p = allocated[i] = (char *)a.Allocate(&stats, size, alignment); CHECK_EQ(p, a.GetBlockBegin(p)); CHECK_EQ(p, a.GetBlockBegin(p + size - 1)); CHECK_EQ(p, a.GetBlockBegin(p + size / 2)); CHECK_EQ(0, (uptr)allocated[i] % alignment); p[0] = p[size - 1] = 0; } for (uptr i = 0; i < kNumAlignedAllocs; i++) { a.Deallocate(&stats, allocated[i]); } } // Regression test for boundary condition in GetBlockBegin(). uptr page_size = GetPageSizeCached(); char *p = (char *)a.Allocate(&stats, page_size, 1); CHECK_EQ(p, a.GetBlockBegin(p)); CHECK_EQ(p, (char *)a.GetBlockBegin(p + page_size - 1)); CHECK_NE(p, (char *)a.GetBlockBegin(p + page_size)); a.Deallocate(&stats, p); } template void TestCombinedAllocator() { typedef CombinedAllocator Allocator; Allocator *a = new Allocator; a->Init(/* may_return_null */ true); AllocatorCache cache; memset(&cache, 0, sizeof(cache)); a->InitCache(&cache); EXPECT_EQ(a->Allocate(&cache, -1, 1), (void*)0); EXPECT_EQ(a->Allocate(&cache, -1, 1024), (void*)0); EXPECT_EQ(a->Allocate(&cache, (uptr)-1 - 1024, 1), (void*)0); EXPECT_EQ(a->Allocate(&cache, (uptr)-1 - 1024, 1024), (void*)0); EXPECT_EQ(a->Allocate(&cache, (uptr)-1 - 1023, 1024), (void*)0); // Set to false a->SetMayReturnNull(false); EXPECT_DEATH(a->Allocate(&cache, -1, 1), "allocator is terminating the process"); const uptr kNumAllocs = 100000; const uptr kNumIter = 10; for (uptr iter = 0; iter < kNumIter; iter++) { std::vector allocated; for (uptr i = 0; i < kNumAllocs; i++) { uptr size = (i % (1 << 14)) + 1; if ((i % 1024) == 0) size = 1 << (10 + (i % 14)); void *x = a->Allocate(&cache, size, 1); uptr *meta = reinterpret_cast(a->GetMetaData(x)); CHECK_EQ(*meta, 0); *meta = size; allocated.push_back(x); } random_shuffle(allocated.begin(), allocated.end()); for (uptr i = 0; i < kNumAllocs; i++) { void *x = allocated[i]; uptr *meta = reinterpret_cast(a->GetMetaData(x)); CHECK_NE(*meta, 0); CHECK(a->PointerIsMine(x)); *meta = 0; a->Deallocate(&cache, x); } allocated.clear(); a->SwallowCache(&cache); } a->DestroyCache(&cache); a->TestOnlyUnmap(); } #if SANITIZER_CAN_USE_ALLOCATOR64 TEST(SanitizerCommon, CombinedAllocator64) { TestCombinedAllocator, SizeClassAllocatorLocalCache > (); } TEST(SanitizerCommon, CombinedAllocator64Dynamic) { TestCombinedAllocator, SizeClassAllocatorLocalCache > (); } #if !SANITIZER_ANDROID TEST(SanitizerCommon, CombinedAllocator64Compact) { TestCombinedAllocator, SizeClassAllocatorLocalCache > (); } #endif TEST(SanitizerCommon, CombinedAllocator64VeryCompact) { TestCombinedAllocator, SizeClassAllocatorLocalCache > (); } #endif TEST(SanitizerCommon, CombinedAllocator32Compact) { TestCombinedAllocator, SizeClassAllocatorLocalCache > (); } template void TestSizeClassAllocatorLocalCache() { AllocatorCache cache; typedef typename AllocatorCache::Allocator Allocator; Allocator *a = new Allocator(); a->Init(); memset(&cache, 0, sizeof(cache)); cache.Init(0); const uptr kNumAllocs = 10000; const int kNumIter = 100; uptr saved_total = 0; for (int class_id = 1; class_id <= 5; class_id++) { for (int it = 0; it < kNumIter; it++) { void *allocated[kNumAllocs]; for (uptr i = 0; i < kNumAllocs; i++) { allocated[i] = cache.Allocate(a, class_id); } for (uptr i = 0; i < kNumAllocs; i++) { cache.Deallocate(a, class_id, allocated[i]); } cache.Drain(a); uptr total_allocated = a->TotalMemoryUsed(); if (it) CHECK_EQ(saved_total, total_allocated); saved_total = total_allocated; } } a->TestOnlyUnmap(); delete a; } #if SANITIZER_CAN_USE_ALLOCATOR64 // These tests can fail on Windows if memory is somewhat full and lit happens // to run them all at the same time. FIXME: Make them not flaky and reenable. #if !SANITIZER_WINDOWS TEST(SanitizerCommon, SizeClassAllocator64LocalCache) { TestSizeClassAllocatorLocalCache< SizeClassAllocatorLocalCache >(); } TEST(SanitizerCommon, SizeClassAllocator64DynamicLocalCache) { TestSizeClassAllocatorLocalCache< SizeClassAllocatorLocalCache >(); } #if !SANITIZER_ANDROID TEST(SanitizerCommon, SizeClassAllocator64CompactLocalCache) { TestSizeClassAllocatorLocalCache< SizeClassAllocatorLocalCache >(); } #endif TEST(SanitizerCommon, SizeClassAllocator64VeryCompactLocalCache) { TestSizeClassAllocatorLocalCache< SizeClassAllocatorLocalCache >(); } #endif #endif TEST(SanitizerCommon, SizeClassAllocator32CompactLocalCache) { TestSizeClassAllocatorLocalCache< SizeClassAllocatorLocalCache >(); } #if SANITIZER_CAN_USE_ALLOCATOR64 typedef SizeClassAllocatorLocalCache AllocatorCache; static AllocatorCache static_allocator_cache; void *AllocatorLeakTestWorker(void *arg) { typedef AllocatorCache::Allocator Allocator; Allocator *a = (Allocator*)(arg); static_allocator_cache.Allocate(a, 10); static_allocator_cache.Drain(a); return 0; } TEST(SanitizerCommon, AllocatorLeakTest) { typedef AllocatorCache::Allocator Allocator; Allocator a; a.Init(); uptr total_used_memory = 0; for (int i = 0; i < 100; i++) { pthread_t t; PTHREAD_CREATE(&t, 0, AllocatorLeakTestWorker, &a); PTHREAD_JOIN(t, 0); if (i == 0) total_used_memory = a.TotalMemoryUsed(); EXPECT_EQ(a.TotalMemoryUsed(), total_used_memory); } a.TestOnlyUnmap(); } // Struct which is allocated to pass info to new threads. The new thread frees // it. struct NewThreadParams { AllocatorCache *thread_cache; AllocatorCache::Allocator *allocator; uptr class_id; }; // Called in a new thread. Just frees its argument. static void *DeallocNewThreadWorker(void *arg) { NewThreadParams *params = reinterpret_cast(arg); params->thread_cache->Deallocate(params->allocator, params->class_id, params); return NULL; } // The allocator cache is supposed to be POD and zero initialized. We should be // able to call Deallocate on a zeroed cache, and it will self-initialize. TEST(Allocator, AllocatorCacheDeallocNewThread) { AllocatorCache::Allocator allocator; allocator.Init(); AllocatorCache main_cache; AllocatorCache child_cache; memset(&main_cache, 0, sizeof(main_cache)); memset(&child_cache, 0, sizeof(child_cache)); uptr class_id = DefaultSizeClassMap::ClassID(sizeof(NewThreadParams)); NewThreadParams *params = reinterpret_cast( main_cache.Allocate(&allocator, class_id)); params->thread_cache = &child_cache; params->allocator = &allocator; params->class_id = class_id; pthread_t t; PTHREAD_CREATE(&t, 0, DeallocNewThreadWorker, params); PTHREAD_JOIN(t, 0); allocator.TestOnlyUnmap(); } #endif TEST(Allocator, Basic) { char *p = (char*)InternalAlloc(10); EXPECT_NE(p, (char*)0); char *p2 = (char*)InternalAlloc(20); EXPECT_NE(p2, (char*)0); EXPECT_NE(p2, p); InternalFree(p); InternalFree(p2); } TEST(Allocator, Stress) { const int kCount = 1000; char *ptrs[kCount]; unsigned rnd = 42; for (int i = 0; i < kCount; i++) { uptr sz = my_rand_r(&rnd) % 1000; char *p = (char*)InternalAlloc(sz); EXPECT_NE(p, (char*)0); ptrs[i] = p; } for (int i = 0; i < kCount; i++) { InternalFree(ptrs[i]); } } TEST(Allocator, LargeAlloc) { void *p = InternalAlloc(10 << 20); InternalFree(p); } TEST(Allocator, ScopedBuffer) { const int kSize = 512; { InternalScopedBuffer int_buf(kSize); EXPECT_EQ(sizeof(int) * kSize, int_buf.size()); // NOLINT } InternalScopedBuffer char_buf(kSize); EXPECT_EQ(sizeof(char) * kSize, char_buf.size()); // NOLINT internal_memset(char_buf.data(), 'c', kSize); for (int i = 0; i < kSize; i++) { EXPECT_EQ('c', char_buf[i]); } } void IterationTestCallback(uptr chunk, void *arg) { reinterpret_cast *>(arg)->insert(chunk); } template void TestSizeClassAllocatorIteration() { Allocator *a = new Allocator; a->Init(); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); static const uptr sizes[] = {1, 16, 30, 40, 100, 1000, 10000, 50000, 60000, 100000, 120000, 300000, 500000, 1000000, 2000000}; std::vector allocated; // Allocate a bunch of chunks. for (uptr s = 0; s < ARRAY_SIZE(sizes); s++) { uptr size = sizes[s]; if (!a->CanAllocate(size, 1)) continue; // printf("s = %ld\n", size); uptr n_iter = std::max((uptr)6, 80000 / size); // fprintf(stderr, "size: %ld iter: %ld\n", size, n_iter); for (uptr j = 0; j < n_iter; j++) { uptr class_id0 = Allocator::SizeClassMapT::ClassID(size); void *x = cache.Allocate(a, class_id0); allocated.push_back(x); } } std::set reported_chunks; a->ForceLock(); a->ForEachChunk(IterationTestCallback, &reported_chunks); a->ForceUnlock(); for (uptr i = 0; i < allocated.size(); i++) { // Don't use EXPECT_NE. Reporting the first mismatch is enough. ASSERT_NE(reported_chunks.find(reinterpret_cast(allocated[i])), reported_chunks.end()); } a->TestOnlyUnmap(); delete a; } #if SANITIZER_CAN_USE_ALLOCATOR64 // These tests can fail on Windows if memory is somewhat full and lit happens // to run them all at the same time. FIXME: Make them not flaky and reenable. #if !SANITIZER_WINDOWS TEST(SanitizerCommon, SizeClassAllocator64Iteration) { TestSizeClassAllocatorIteration(); } TEST(SanitizerCommon, SizeClassAllocator64DynamicIteration) { TestSizeClassAllocatorIteration(); } #endif #endif TEST(SanitizerCommon, SizeClassAllocator32Iteration) { TestSizeClassAllocatorIteration(); } TEST(SanitizerCommon, LargeMmapAllocatorIteration) { LargeMmapAllocator<> a; a.Init(/* may_return_null */ false); AllocatorStats stats; stats.Init(); static const uptr kNumAllocs = 1000; char *allocated[kNumAllocs]; static const uptr size = 40; // Allocate some. for (uptr i = 0; i < kNumAllocs; i++) allocated[i] = (char *)a.Allocate(&stats, size, 1); std::set reported_chunks; a.ForceLock(); a.ForEachChunk(IterationTestCallback, &reported_chunks); a.ForceUnlock(); for (uptr i = 0; i < kNumAllocs; i++) { // Don't use EXPECT_NE. Reporting the first mismatch is enough. ASSERT_NE(reported_chunks.find(reinterpret_cast(allocated[i])), reported_chunks.end()); } for (uptr i = 0; i < kNumAllocs; i++) a.Deallocate(&stats, allocated[i]); } TEST(SanitizerCommon, LargeMmapAllocatorBlockBegin) { LargeMmapAllocator<> a; a.Init(/* may_return_null */ false); AllocatorStats stats; stats.Init(); static const uptr kNumAllocs = 1024; static const uptr kNumExpectedFalseLookups = 10000000; char *allocated[kNumAllocs]; static const uptr size = 4096; // Allocate some. for (uptr i = 0; i < kNumAllocs; i++) { allocated[i] = (char *)a.Allocate(&stats, size, 1); } a.ForceLock(); for (uptr i = 0; i < kNumAllocs * kNumAllocs; i++) { // if ((i & (i - 1)) == 0) fprintf(stderr, "[%zd]\n", i); char *p1 = allocated[i % kNumAllocs]; EXPECT_EQ(p1, a.GetBlockBeginFastLocked(p1)); EXPECT_EQ(p1, a.GetBlockBeginFastLocked(p1 + size / 2)); EXPECT_EQ(p1, a.GetBlockBeginFastLocked(p1 + size - 1)); EXPECT_EQ(p1, a.GetBlockBeginFastLocked(p1 - 100)); } for (uptr i = 0; i < kNumExpectedFalseLookups; i++) { void *p = reinterpret_cast(i % 1024); EXPECT_EQ((void *)0, a.GetBlockBeginFastLocked(p)); p = reinterpret_cast(~0L - (i % 1024)); EXPECT_EQ((void *)0, a.GetBlockBeginFastLocked(p)); } a.ForceUnlock(); for (uptr i = 0; i < kNumAllocs; i++) a.Deallocate(&stats, allocated[i]); } // Don't test OOM conditions on Win64 because it causes other tests on the same // machine to OOM. #if SANITIZER_CAN_USE_ALLOCATOR64 && !SANITIZER_WINDOWS64 && !SANITIZER_ANDROID typedef SizeClassMap<3, 4, 8, 63, 128, 16> SpecialSizeClassMap; struct AP64_SpecialSizeClassMap { static const uptr kSpaceBeg = kAllocatorSpace; static const uptr kSpaceSize = kAllocatorSize; static const uptr kMetadataSize = 0; typedef SpecialSizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; // Regression test for out-of-memory condition in PopulateFreeList(). TEST(SanitizerCommon, SizeClassAllocator64PopulateFreeListOOM) { // In a world where regions are small and chunks are huge... typedef SizeClassAllocator64 SpecialAllocator64; const uptr kRegionSize = kAllocatorSize / SpecialSizeClassMap::kNumClassesRounded; SpecialAllocator64 *a = new SpecialAllocator64; a->Init(); SizeClassAllocatorLocalCache cache; memset(&cache, 0, sizeof(cache)); cache.Init(0); // ...one man is on a mission to overflow a region with a series of // successive allocations. const uptr kClassID = 107; const uptr kAllocationSize = SpecialSizeClassMap::Size(kClassID); ASSERT_LT(2 * kAllocationSize, kRegionSize); ASSERT_GT(3 * kAllocationSize, kRegionSize); cache.Allocate(a, kClassID); EXPECT_DEATH(cache.Allocate(a, kClassID) && cache.Allocate(a, kClassID), "The process has exhausted"); const uptr Class2 = 100; const uptr Size2 = SpecialSizeClassMap::Size(Class2); ASSERT_EQ(Size2 * 8, kRegionSize); char *p[7]; for (int i = 0; i < 7; i++) { p[i] = (char*)cache.Allocate(a, Class2); fprintf(stderr, "p[%d] %p s = %lx\n", i, (void*)p[i], Size2); p[i][Size2 - 1] = 42; if (i) ASSERT_LT(p[i - 1], p[i]); } EXPECT_DEATH(cache.Allocate(a, Class2), "The process has exhausted"); cache.Deallocate(a, Class2, p[0]); cache.Drain(a); ASSERT_EQ(p[6][Size2 - 1], 42); a->TestOnlyUnmap(); delete a; } #endif TEST(SanitizerCommon, TwoLevelByteMap) { const u64 kSize1 = 1 << 6, kSize2 = 1 << 12; const u64 n = kSize1 * kSize2; TwoLevelByteMap m; m.TestOnlyInit(); for (u64 i = 0; i < n; i += 7) { m.set(i, (i % 100) + 1); } for (u64 j = 0; j < n; j++) { if (j % 7) EXPECT_EQ(m[j], 0); else EXPECT_EQ(m[j], (j % 100) + 1); } m.TestOnlyUnmap(); } typedef TwoLevelByteMap<1 << 12, 1 << 13, TestMapUnmapCallback> TestByteMap; struct TestByteMapParam { TestByteMap *m; size_t shard; size_t num_shards; }; void *TwoLevelByteMapUserThread(void *param) { TestByteMapParam *p = (TestByteMapParam*)param; for (size_t i = p->shard; i < p->m->size(); i += p->num_shards) { size_t val = (i % 100) + 1; p->m->set(i, val); EXPECT_EQ((*p->m)[i], val); } return 0; } TEST(SanitizerCommon, ThreadedTwoLevelByteMap) { TestByteMap m; m.TestOnlyInit(); TestMapUnmapCallback::map_count = 0; TestMapUnmapCallback::unmap_count = 0; static const int kNumThreads = 4; pthread_t t[kNumThreads]; TestByteMapParam p[kNumThreads]; for (int i = 0; i < kNumThreads; i++) { p[i].m = &m; p[i].shard = i; p[i].num_shards = kNumThreads; PTHREAD_CREATE(&t[i], 0, TwoLevelByteMapUserThread, &p[i]); } for (int i = 0; i < kNumThreads; i++) { PTHREAD_JOIN(t[i], 0); } EXPECT_EQ((uptr)TestMapUnmapCallback::map_count, m.size1()); EXPECT_EQ((uptr)TestMapUnmapCallback::unmap_count, 0UL); m.TestOnlyUnmap(); EXPECT_EQ((uptr)TestMapUnmapCallback::map_count, m.size1()); EXPECT_EQ((uptr)TestMapUnmapCallback::unmap_count, m.size1()); } #endif // #if !SANITIZER_DEBUG golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/.clang-tidy0000664000175000017500000000105412651475373027400 0ustar mwhudsonmwhudsonChecks: '-*,clang-diagnostic-*,llvm-*,misc-*,readability-identifier-naming' CheckOptions: - key: readability-identifier-naming.ClassCase value: CamelCase - key: readability-identifier-naming.EnumCase value: CamelCase - key: readability-identifier-naming.FunctionCase value: CamelCase - key: readability-identifier-naming.UnionCase value: CamelCase - key: readability-identifier-naming.VariableCase value: lower_case golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_primary32.h0000664000175000017500000002332112761423315033465 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_primary32.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif template struct SizeClassAllocator32LocalCache; // SizeClassAllocator32 -- allocator for 32-bit address space. // This allocator can theoretically be used on 64-bit arch, but there it is less // efficient than SizeClassAllocator64. // // [kSpaceBeg, kSpaceBeg + kSpaceSize) is the range of addresses which can // be returned by MmapOrDie(). // // Region: // a result of a single call to MmapAlignedOrDie(kRegionSize, kRegionSize). // Since the regions are aligned by kRegionSize, there are exactly // kNumPossibleRegions possible regions in the address space and so we keep // a ByteMap possible_regions to store the size classes of each Region. // 0 size class means the region is not used by the allocator. // // One Region is used to allocate chunks of a single size class. // A Region looks like this: // UserChunk1 .. UserChunkN MetaChunkN .. MetaChunk1 // // In order to avoid false sharing the objects of this class should be // chache-line aligned. template class SizeClassAllocator32 { public: struct TransferBatch { static const uptr kMaxNumCached = SizeClassMap::kMaxNumCachedHint - 2; void SetFromArray(uptr region_beg_unused, void *batch[], uptr count) { count_ = count; CHECK_LE(count_, kMaxNumCached); for (uptr i = 0; i < count; i++) batch_[i] = batch[i]; } uptr Count() const { return count_; } void Clear() { count_ = 0; } void Add(void *ptr) { batch_[count_++] = ptr; CHECK_LE(count_, kMaxNumCached); } void CopyToArray(void *to_batch[]) { for (uptr i = 0, n = Count(); i < n; i++) to_batch[i] = batch_[i]; } // How much memory do we need for a batch containing n elements. static uptr AllocationSizeRequiredForNElements(uptr n) { return sizeof(uptr) * 2 + sizeof(void *) * n; } static uptr MaxCached(uptr class_id) { return Min(kMaxNumCached, SizeClassMap::MaxCachedHint(class_id)); } TransferBatch *next; private: uptr count_; void *batch_[kMaxNumCached]; }; static const uptr kBatchSize = sizeof(TransferBatch); COMPILER_CHECK((kBatchSize & (kBatchSize - 1)) == 0); COMPILER_CHECK(sizeof(TransferBatch) == SizeClassMap::kMaxNumCachedHint * sizeof(uptr)); static uptr ClassIdToSize(uptr class_id) { return SizeClassMap::Size(class_id); } typedef SizeClassAllocator32 ThisT; typedef SizeClassAllocator32LocalCache AllocatorCache; void Init() { possible_regions.TestOnlyInit(); internal_memset(size_class_info_array, 0, sizeof(size_class_info_array)); } void *MapWithCallback(uptr size) { size = RoundUpTo(size, GetPageSizeCached()); void *res = MmapOrDie(size, "SizeClassAllocator32"); MapUnmapCallback().OnMap((uptr)res, size); return res; } void UnmapWithCallback(uptr beg, uptr size) { MapUnmapCallback().OnUnmap(beg, size); UnmapOrDie(reinterpret_cast(beg), size); } static bool CanAllocate(uptr size, uptr alignment) { return size <= SizeClassMap::kMaxSize && alignment <= SizeClassMap::kMaxSize; } void *GetMetaData(const void *p) { CHECK(PointerIsMine(p)); uptr mem = reinterpret_cast(p); uptr beg = ComputeRegionBeg(mem); uptr size = ClassIdToSize(GetSizeClass(p)); u32 offset = mem - beg; uptr n = offset / (u32)size; // 32-bit division uptr meta = (beg + kRegionSize) - (n + 1) * kMetadataSize; return reinterpret_cast(meta); } NOINLINE TransferBatch *AllocateBatch(AllocatorStats *stat, AllocatorCache *c, uptr class_id) { CHECK_LT(class_id, kNumClasses); SizeClassInfo *sci = GetSizeClassInfo(class_id); SpinMutexLock l(&sci->mutex); if (sci->free_list.empty()) PopulateFreeList(stat, c, sci, class_id); CHECK(!sci->free_list.empty()); TransferBatch *b = sci->free_list.front(); sci->free_list.pop_front(); return b; } NOINLINE void DeallocateBatch(AllocatorStats *stat, uptr class_id, TransferBatch *b) { CHECK_LT(class_id, kNumClasses); SizeClassInfo *sci = GetSizeClassInfo(class_id); SpinMutexLock l(&sci->mutex); CHECK_GT(b->Count(), 0); sci->free_list.push_front(b); } uptr GetRegionBeginBySizeClass(uptr class_id) { return 0; } bool PointerIsMine(const void *p) { uptr mem = reinterpret_cast(p); if (mem < kSpaceBeg || mem >= kSpaceBeg + kSpaceSize) return false; return GetSizeClass(p) != 0; } uptr GetSizeClass(const void *p) { return possible_regions[ComputeRegionId(reinterpret_cast(p))]; } void *GetBlockBegin(const void *p) { CHECK(PointerIsMine(p)); uptr mem = reinterpret_cast(p); uptr beg = ComputeRegionBeg(mem); uptr size = ClassIdToSize(GetSizeClass(p)); u32 offset = mem - beg; u32 n = offset / (u32)size; // 32-bit division uptr res = beg + (n * (u32)size); return reinterpret_cast(res); } uptr GetActuallyAllocatedSize(void *p) { CHECK(PointerIsMine(p)); return ClassIdToSize(GetSizeClass(p)); } uptr ClassID(uptr size) { return SizeClassMap::ClassID(size); } uptr TotalMemoryUsed() { // No need to lock here. uptr res = 0; for (uptr i = 0; i < kNumPossibleRegions; i++) if (possible_regions[i]) res += kRegionSize; return res; } void TestOnlyUnmap() { for (uptr i = 0; i < kNumPossibleRegions; i++) if (possible_regions[i]) UnmapWithCallback((i * kRegionSize), kRegionSize); } // ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone // introspection API. void ForceLock() { for (uptr i = 0; i < kNumClasses; i++) { GetSizeClassInfo(i)->mutex.Lock(); } } void ForceUnlock() { for (int i = kNumClasses - 1; i >= 0; i--) { GetSizeClassInfo(i)->mutex.Unlock(); } } // Iterate over all existing chunks. // The allocator must be locked when calling this function. void ForEachChunk(ForEachChunkCallback callback, void *arg) { for (uptr region = 0; region < kNumPossibleRegions; region++) if (possible_regions[region]) { uptr chunk_size = ClassIdToSize(possible_regions[region]); uptr max_chunks_in_region = kRegionSize / (chunk_size + kMetadataSize); uptr region_beg = region * kRegionSize; for (uptr chunk = region_beg; chunk < region_beg + max_chunks_in_region * chunk_size; chunk += chunk_size) { // Too slow: CHECK_EQ((void *)chunk, GetBlockBegin((void *)chunk)); callback(chunk, arg); } } } void PrintStats() { } static uptr AdditionalSize() { return 0; } // This is empty here. Currently only implemented in 64-bit allocator. void ReleaseToOS() { } typedef SizeClassMap SizeClassMapT; static const uptr kNumClasses = SizeClassMap::kNumClasses; private: static const uptr kRegionSize = 1 << kRegionSizeLog; static const uptr kNumPossibleRegions = kSpaceSize / kRegionSize; struct SizeClassInfo { SpinMutex mutex; IntrusiveList free_list; char padding[kCacheLineSize - sizeof(uptr) - sizeof(IntrusiveList)]; }; COMPILER_CHECK(sizeof(SizeClassInfo) == kCacheLineSize); uptr ComputeRegionId(uptr mem) { uptr res = mem >> kRegionSizeLog; CHECK_LT(res, kNumPossibleRegions); return res; } uptr ComputeRegionBeg(uptr mem) { return mem & ~(kRegionSize - 1); } uptr AllocateRegion(AllocatorStats *stat, uptr class_id) { CHECK_LT(class_id, kNumClasses); uptr res = reinterpret_cast(MmapAlignedOrDie(kRegionSize, kRegionSize, "SizeClassAllocator32")); MapUnmapCallback().OnMap(res, kRegionSize); stat->Add(AllocatorStatMapped, kRegionSize); CHECK_EQ(0U, (res & (kRegionSize - 1))); possible_regions.set(ComputeRegionId(res), static_cast(class_id)); return res; } SizeClassInfo *GetSizeClassInfo(uptr class_id) { CHECK_LT(class_id, kNumClasses); return &size_class_info_array[class_id]; } void PopulateFreeList(AllocatorStats *stat, AllocatorCache *c, SizeClassInfo *sci, uptr class_id) { uptr size = ClassIdToSize(class_id); uptr reg = AllocateRegion(stat, class_id); uptr n_chunks = kRegionSize / (size + kMetadataSize); uptr max_count = TransferBatch::MaxCached(class_id); TransferBatch *b = nullptr; for (uptr i = reg; i < reg + n_chunks * size; i += size) { if (!b) { b = c->CreateBatch(class_id, this, (TransferBatch*)i); b->Clear(); } b->Add((void*)i); if (b->Count() == max_count) { CHECK_GT(b->Count(), 0); sci->free_list.push_back(b); b = nullptr; } } if (b) { CHECK_GT(b->Count(), 0); sci->free_list.push_back(b); } } ByteMap possible_regions; SizeClassInfo size_class_info_array[kNumClasses]; }; golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_quarantine.h0000664000175000017500000001143212703700630031736 0ustar mwhudsonmwhudson//===-- sanitizer_quarantine.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Memory quarantine for AddressSanitizer and potentially other tools. // Quarantine caches some specified amount of memory in per-thread caches, // then evicts to global FIFO queue. When the queue reaches specified threshold, // oldest memory is recycled. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_QUARANTINE_H #define SANITIZER_QUARANTINE_H #include "sanitizer_internal_defs.h" #include "sanitizer_mutex.h" #include "sanitizer_list.h" namespace __sanitizer { template class QuarantineCache; struct QuarantineBatch { static const uptr kSize = 1021; QuarantineBatch *next; uptr size; uptr count; void *batch[kSize]; }; COMPILER_CHECK(sizeof(QuarantineBatch) <= (1 << 13)); // 8Kb. // The callback interface is: // void Callback::Recycle(Node *ptr); // void *cb.Allocate(uptr size); // void cb.Deallocate(void *ptr); template class Quarantine { public: typedef QuarantineCache Cache; explicit Quarantine(LinkerInitialized) : cache_(LINKER_INITIALIZED) { } void Init(uptr size, uptr cache_size) { atomic_store(&max_size_, size, memory_order_release); atomic_store(&min_size_, size / 10 * 9, memory_order_release); // 90% of max size. max_cache_size_ = cache_size; } uptr GetSize() const { return atomic_load(&max_size_, memory_order_acquire); } void Put(Cache *c, Callback cb, Node *ptr, uptr size) { c->Enqueue(cb, ptr, size); if (c->Size() > max_cache_size_) Drain(c, cb); } void NOINLINE Drain(Cache *c, Callback cb) { { SpinMutexLock l(&cache_mutex_); cache_.Transfer(c); } if (cache_.Size() > GetSize() && recycle_mutex_.TryLock()) Recycle(cb); } private: // Read-only data. char pad0_[kCacheLineSize]; atomic_uintptr_t max_size_; atomic_uintptr_t min_size_; uptr max_cache_size_; char pad1_[kCacheLineSize]; SpinMutex cache_mutex_; SpinMutex recycle_mutex_; Cache cache_; char pad2_[kCacheLineSize]; void NOINLINE Recycle(Callback cb) { Cache tmp; uptr min_size = atomic_load(&min_size_, memory_order_acquire); { SpinMutexLock l(&cache_mutex_); while (cache_.Size() > min_size) { QuarantineBatch *b = cache_.DequeueBatch(); tmp.EnqueueBatch(b); } } recycle_mutex_.Unlock(); DoRecycle(&tmp, cb); } void NOINLINE DoRecycle(Cache *c, Callback cb) { while (QuarantineBatch *b = c->DequeueBatch()) { const uptr kPrefetch = 16; CHECK(kPrefetch <= ARRAY_SIZE(b->batch)); for (uptr i = 0; i < kPrefetch; i++) PREFETCH(b->batch[i]); for (uptr i = 0, count = b->count; i < count; i++) { if (i + kPrefetch < count) PREFETCH(b->batch[i + kPrefetch]); cb.Recycle((Node*)b->batch[i]); } cb.Deallocate(b); } } }; // Per-thread cache of memory blocks. template class QuarantineCache { public: explicit QuarantineCache(LinkerInitialized) { } QuarantineCache() : size_() { list_.clear(); } uptr Size() const { return atomic_load(&size_, memory_order_relaxed); } void Enqueue(Callback cb, void *ptr, uptr size) { if (list_.empty() || list_.back()->count == QuarantineBatch::kSize) { AllocBatch(cb); size += sizeof(QuarantineBatch); // Count the batch in Quarantine size. } QuarantineBatch *b = list_.back(); CHECK(b); b->batch[b->count++] = ptr; b->size += size; SizeAdd(size); } void Transfer(QuarantineCache *c) { list_.append_back(&c->list_); SizeAdd(c->Size()); atomic_store(&c->size_, 0, memory_order_relaxed); } void EnqueueBatch(QuarantineBatch *b) { list_.push_back(b); SizeAdd(b->size); } QuarantineBatch *DequeueBatch() { if (list_.empty()) return nullptr; QuarantineBatch *b = list_.front(); list_.pop_front(); SizeSub(b->size); return b; } private: IntrusiveList list_; atomic_uintptr_t size_; void SizeAdd(uptr add) { atomic_store(&size_, Size() + add, memory_order_relaxed); } void SizeSub(uptr sub) { atomic_store(&size_, Size() - sub, memory_order_relaxed); } NOINLINE QuarantineBatch* AllocBatch(Callback cb) { QuarantineBatch *b = (QuarantineBatch *)cb.Allocate(sizeof(*b)); CHECK(b); b->count = 0; b->size = 0; list_.push_back(b); return b; } }; } // namespace __sanitizer #endif // SANITIZER_QUARANTINE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_suppressions.h0000664000175000017500000000325012635062372032353 0ustar mwhudsonmwhudson//===-- sanitizer_suppressions.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Suppression parsing/matching code. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_SUPPRESSIONS_H #define SANITIZER_SUPPRESSIONS_H #include "sanitizer_common.h" #include "sanitizer_atomic.h" #include "sanitizer_internal_defs.h" namespace __sanitizer { struct Suppression { Suppression() { internal_memset(this, 0, sizeof(*this)); } const char *type; char *templ; atomic_uint32_t hit_count; uptr weight; }; class SuppressionContext { public: // Create new SuppressionContext capable of parsing given suppression types. SuppressionContext(const char *supprression_types[], int suppression_types_num); void ParseFromFile(const char *filename); void Parse(const char *str); bool Match(const char *str, const char *type, Suppression **s); uptr SuppressionCount() const; bool HasSuppressionType(const char *type) const; const Suppression *SuppressionAt(uptr i) const; void GetMatched(InternalMmapVector *matched); private: static const int kMaxSuppressionTypes = 32; const char **const suppression_types_; const int suppression_types_num_; InternalMmapVector suppressions_; bool has_suppression_type_[kMaxSuppressionTypes]; bool can_parse_; }; } // namespace __sanitizer #endif // SANITIZER_SUPPRESSIONS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/.clang-format0000664000175000017500000000002512623444376027712 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common.h0000664000175000017500000006370312773522466031107 0ustar mwhudsonmwhudson//===-- sanitizer_common.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between run-time libraries of sanitizers. // // It declares common functions and classes that are used in both runtimes. // Implementation of some functions are provided in sanitizer_common, while // others must be defined by run-time library itself. //===----------------------------------------------------------------------===// #ifndef SANITIZER_COMMON_H #define SANITIZER_COMMON_H #include "sanitizer_flags.h" #include "sanitizer_interface_internal.h" #include "sanitizer_internal_defs.h" #include "sanitizer_libc.h" #include "sanitizer_list.h" #include "sanitizer_mutex.h" #if defined(_MSC_VER) && !defined(__clang__) extern "C" void _ReadWriteBarrier(); #pragma intrinsic(_ReadWriteBarrier) #endif namespace __sanitizer { struct StackTrace; struct AddressInfo; // Constants. const uptr kWordSize = SANITIZER_WORDSIZE / 8; const uptr kWordSizeInBits = 8 * kWordSize; #if defined(__powerpc__) || defined(__powerpc64__) const uptr kCacheLineSize = 128; #else const uptr kCacheLineSize = 64; #endif const uptr kMaxPathLength = 4096; const uptr kMaxThreadStackSize = 1 << 30; // 1Gb static const uptr kErrorMessageBufferSize = 1 << 16; // Denotes fake PC values that come from JIT/JAVA/etc. // For such PC values __tsan_symbolize_external() will be called. const u64 kExternalPCBit = 1ULL << 60; extern const char *SanitizerToolName; // Can be changed by the tool. extern atomic_uint32_t current_verbosity; INLINE void SetVerbosity(int verbosity) { atomic_store(¤t_verbosity, verbosity, memory_order_relaxed); } INLINE int Verbosity() { return atomic_load(¤t_verbosity, memory_order_relaxed); } uptr GetPageSize(); extern uptr PageSizeCached; INLINE uptr GetPageSizeCached() { if (!PageSizeCached) PageSizeCached = GetPageSize(); return PageSizeCached; } uptr GetMmapGranularity(); uptr GetMaxVirtualAddress(); // Threads uptr GetTid(); uptr GetThreadSelf(); void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, uptr *stack_bottom); void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, uptr *tls_addr, uptr *tls_size); // Memory management void *MmapOrDie(uptr size, const char *mem_type, bool raw_report = false); INLINE void *MmapOrDieQuietly(uptr size, const char *mem_type) { return MmapOrDie(size, mem_type, /*raw_report*/ true); } void UnmapOrDie(void *addr, uptr size); void *MmapFixedNoReserve(uptr fixed_addr, uptr size, const char *name = nullptr); void *MmapNoReserveOrDie(uptr size, const char *mem_type); void *MmapFixedOrDie(uptr fixed_addr, uptr size); void *MmapFixedNoAccess(uptr fixed_addr, uptr size, const char *name = nullptr); void *MmapNoAccess(uptr size); // Map aligned chunk of address space; size and alignment are powers of two. void *MmapAlignedOrDie(uptr size, uptr alignment, const char *mem_type); // Disallow access to a memory range. Use MmapFixedNoAccess to allocate an // unaccessible memory. bool MprotectNoAccess(uptr addr, uptr size); bool MprotectReadOnly(uptr addr, uptr size); // Find an available address space. uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding); // Used to check if we can map shadow memory to a fixed location. bool MemoryRangeIsAvailable(uptr range_start, uptr range_end); void ReleaseMemoryToOS(uptr addr, uptr size); void IncreaseTotalMmap(uptr size); void DecreaseTotalMmap(uptr size); uptr GetRSS(); void NoHugePagesInRegion(uptr addr, uptr length); void DontDumpShadowMemory(uptr addr, uptr length); // Check if the built VMA size matches the runtime one. void CheckVMASize(); void RunMallocHooks(const void *ptr, uptr size); void RunFreeHooks(const void *ptr); // InternalScopedBuffer can be used instead of large stack arrays to // keep frame size low. // FIXME: use InternalAlloc instead of MmapOrDie once // InternalAlloc is made libc-free. template class InternalScopedBuffer { public: explicit InternalScopedBuffer(uptr cnt) { cnt_ = cnt; ptr_ = (T *)MmapOrDie(cnt * sizeof(T), "InternalScopedBuffer"); } ~InternalScopedBuffer() { UnmapOrDie(ptr_, cnt_ * sizeof(T)); } T &operator[](uptr i) { return ptr_[i]; } T *data() { return ptr_; } uptr size() { return cnt_ * sizeof(T); } private: T *ptr_; uptr cnt_; // Disallow copies and moves. InternalScopedBuffer(const InternalScopedBuffer &) = delete; InternalScopedBuffer &operator=(const InternalScopedBuffer &) = delete; InternalScopedBuffer(InternalScopedBuffer &&) = delete; InternalScopedBuffer &operator=(InternalScopedBuffer &&) = delete; }; class InternalScopedString : public InternalScopedBuffer { public: explicit InternalScopedString(uptr max_length) : InternalScopedBuffer(max_length), length_(0) { (*this)[0] = '\0'; } uptr length() { return length_; } void clear() { (*this)[0] = '\0'; length_ = 0; } void append(const char *format, ...); private: uptr length_; }; // Simple low-level (mmap-based) allocator for internal use. Doesn't have // constructor, so all instances of LowLevelAllocator should be // linker initialized. class LowLevelAllocator { public: // Requires an external lock. void *Allocate(uptr size); private: char *allocated_end_; char *allocated_current_; }; typedef void (*LowLevelAllocateCallback)(uptr ptr, uptr size); // Allows to register tool-specific callbacks for LowLevelAllocator. // Passing NULL removes the callback. void SetLowLevelAllocateCallback(LowLevelAllocateCallback callback); // IO void RawWrite(const char *buffer); bool ColorizeReports(); void RemoveANSIEscapeSequencesFromString(char *buffer); void Printf(const char *format, ...); void Report(const char *format, ...); void SetPrintfAndReportCallback(void (*callback)(const char *)); #define VReport(level, ...) \ do { \ if ((uptr)Verbosity() >= (level)) Report(__VA_ARGS__); \ } while (0) #define VPrintf(level, ...) \ do { \ if ((uptr)Verbosity() >= (level)) Printf(__VA_ARGS__); \ } while (0) // Can be used to prevent mixing error reports from different sanitizers. extern StaticSpinMutex CommonSanitizerReportMutex; struct ReportFile { void Write(const char *buffer, uptr length); bool SupportsColors(); void SetReportPath(const char *path); // Don't use fields directly. They are only declared public to allow // aggregate initialization. // Protects fields below. StaticSpinMutex *mu; // Opened file descriptor. Defaults to stderr. It may be equal to // kInvalidFd, in which case new file will be opened when necessary. fd_t fd; // Path prefix of report file, set via __sanitizer_set_report_path. char path_prefix[kMaxPathLength]; // Full path to report, obtained as .PID char full_path[kMaxPathLength]; // PID of the process that opened fd. If a fork() occurs, // the PID of child will be different from fd_pid. uptr fd_pid; private: void ReopenIfNecessary(); }; extern ReportFile report_file; extern uptr stoptheworld_tracer_pid; extern uptr stoptheworld_tracer_ppid; enum FileAccessMode { RdOnly, WrOnly, RdWr }; // Returns kInvalidFd on error. fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *errno_p = nullptr); void CloseFile(fd_t); // Return true on success, false on error. bool ReadFromFile(fd_t fd, void *buff, uptr buff_size, uptr *bytes_read = nullptr, error_t *error_p = nullptr); bool WriteToFile(fd_t fd, const void *buff, uptr buff_size, uptr *bytes_written = nullptr, error_t *error_p = nullptr); bool RenameFile(const char *oldpath, const char *newpath, error_t *error_p = nullptr); // Scoped file handle closer. struct FileCloser { explicit FileCloser(fd_t fd) : fd(fd) {} ~FileCloser() { CloseFile(fd); } fd_t fd; }; bool SupportsColoredOutput(fd_t fd); // Opens the file 'file_name" and reads up to 'max_len' bytes. // The resulting buffer is mmaped and stored in '*buff'. // The size of the mmaped region is stored in '*buff_size'. // The total number of read bytes is stored in '*read_len'. // Returns true if file was successfully opened and read. bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size, uptr *read_len, uptr max_len = 1 << 26, error_t *errno_p = nullptr); // Maps given file to virtual memory, and returns pointer to it // (or NULL if mapping fails). Stores the size of mmaped region // in '*buff_size'. void *MapFileToMemory(const char *file_name, uptr *buff_size); void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset); bool IsAccessibleMemoryRange(uptr beg, uptr size); // Error report formatting. const char *StripPathPrefix(const char *filepath, const char *strip_file_prefix); // Strip the directories from the module name. const char *StripModuleName(const char *module); // OS uptr ReadBinaryName(/*out*/char *buf, uptr buf_len); uptr ReadBinaryNameCached(/*out*/char *buf, uptr buf_len); uptr ReadLongProcessName(/*out*/ char *buf, uptr buf_len); const char *GetProcessName(); void UpdateProcessName(); void CacheBinaryName(); void DisableCoreDumperIfNecessary(); void DumpProcessMap(); bool FileExists(const char *filename); const char *GetEnv(const char *name); bool SetEnv(const char *name, const char *value); const char *GetPwd(); char *FindPathToBinary(const char *name); bool IsPathSeparator(const char c); bool IsAbsolutePath(const char *path); // Starts a subprocess and returs its pid. // If *_fd parameters are not kInvalidFd their corresponding input/output // streams will be redirect to the file. The files will always be closed // in parent process even in case of an error. // The child process will close all fds after STDERR_FILENO // before passing control to a program. pid_t StartSubprocess(const char *filename, const char *const argv[], fd_t stdin_fd = kInvalidFd, fd_t stdout_fd = kInvalidFd, fd_t stderr_fd = kInvalidFd); // Checks if specified process is still running bool IsProcessRunning(pid_t pid); // Waits for the process to finish and returns its exit code. // Returns -1 in case of an error. int WaitForProcess(pid_t pid); u32 GetUid(); void ReExec(); char **GetArgv(); void PrintCmdline(); bool StackSizeIsUnlimited(); uptr GetStackSizeLimitInBytes(); void SetStackSizeLimitInBytes(uptr limit); bool AddressSpaceIsUnlimited(); void SetAddressSpaceUnlimited(); void AdjustStackSize(void *attr); void PrepareForSandboxing(__sanitizer_sandbox_arguments *args); void CovPrepareForSandboxing(__sanitizer_sandbox_arguments *args); void SetSandboxingCallback(void (*f)()); void CoverageUpdateMapping(); void CovBeforeFork(); void CovAfterFork(int child_pid); void InitializeCoverage(bool enabled, const char *coverage_dir); void ReInitializeCoverage(bool enabled, const char *coverage_dir); void InitTlsSize(); uptr GetTlsSize(); // Other void SleepForSeconds(int seconds); void SleepForMillis(int millis); u64 NanoTime(); int Atexit(void (*function)(void)); void SortArray(uptr *array, uptr size); void SortArray(u32 *array, uptr size); bool TemplateMatch(const char *templ, const char *str); // Exit void NORETURN Abort(); void NORETURN Die(); void NORETURN CheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2); void NORETURN ReportMmapFailureAndDie(uptr size, const char *mem_type, const char *mmap_type, error_t err, bool raw_report = false); // Set the name of the current thread to 'name', return true on succees. // The name may be truncated to a system-dependent limit. bool SanitizerSetThreadName(const char *name); // Get the name of the current thread (no more than max_len bytes), // return true on succees. name should have space for at least max_len+1 bytes. bool SanitizerGetThreadName(char *name, int max_len); // Specific tools may override behavior of "Die" and "CheckFailed" functions // to do tool-specific job. typedef void (*DieCallbackType)(void); // It's possible to add several callbacks that would be run when "Die" is // called. The callbacks will be run in the opposite order. The tools are // strongly recommended to setup all callbacks during initialization, when there // is only a single thread. bool AddDieCallback(DieCallbackType callback); bool RemoveDieCallback(DieCallbackType callback); void SetUserDieCallback(DieCallbackType callback); typedef void (*CheckFailedCallbackType)(const char *, int, const char *, u64, u64); void SetCheckFailedCallback(CheckFailedCallbackType callback); // Callback will be called if soft_rss_limit_mb is given and the limit is // exceeded (exceeded==true) or if rss went down below the limit // (exceeded==false). // The callback should be registered once at the tool init time. void SetSoftRssLimitExceededCallback(void (*Callback)(bool exceeded)); // Callback to be called when we want to try releasing unused allocator memory // back to the OS. typedef void (*AllocatorReleaseToOSCallback)(); // The callback should be registered once at the tool init time. void SetAllocatorReleaseToOSCallback(AllocatorReleaseToOSCallback Callback); // Functions related to signal handling. typedef void (*SignalHandlerType)(int, void *, void *); bool IsHandledDeadlySignal(int signum); void InstallDeadlySignalHandlers(SignalHandlerType handler); // Alternative signal stack (POSIX-only). void SetAlternateSignalStack(); void UnsetAlternateSignalStack(); // We don't want a summary too long. const int kMaxSummaryLength = 1024; // Construct a one-line string: // SUMMARY: SanitizerToolName: error_message // and pass it to __sanitizer_report_error_summary. void ReportErrorSummary(const char *error_message); // Same as above, but construct error_message as: // error_type file:line[:column][ function] void ReportErrorSummary(const char *error_type, const AddressInfo &info); // Same as above, but obtains AddressInfo by symbolizing top stack trace frame. void ReportErrorSummary(const char *error_type, const StackTrace *trace); // Math #if SANITIZER_WINDOWS && !defined(__clang__) && !defined(__GNUC__) extern "C" { unsigned char _BitScanForward(unsigned long *index, unsigned long mask); // NOLINT unsigned char _BitScanReverse(unsigned long *index, unsigned long mask); // NOLINT #if defined(_WIN64) unsigned char _BitScanForward64(unsigned long *index, unsigned __int64 mask); // NOLINT unsigned char _BitScanReverse64(unsigned long *index, unsigned __int64 mask); // NOLINT #endif } #endif INLINE uptr MostSignificantSetBitIndex(uptr x) { CHECK_NE(x, 0U); unsigned long up; // NOLINT #if !SANITIZER_WINDOWS || defined(__clang__) || defined(__GNUC__) # ifdef _WIN64 up = SANITIZER_WORDSIZE - 1 - __builtin_clzll(x); # else up = SANITIZER_WORDSIZE - 1 - __builtin_clzl(x); # endif #elif defined(_WIN64) _BitScanReverse64(&up, x); #else _BitScanReverse(&up, x); #endif return up; } INLINE uptr LeastSignificantSetBitIndex(uptr x) { CHECK_NE(x, 0U); unsigned long up; // NOLINT #if !SANITIZER_WINDOWS || defined(__clang__) || defined(__GNUC__) # ifdef _WIN64 up = __builtin_ctzll(x); # else up = __builtin_ctzl(x); # endif #elif defined(_WIN64) _BitScanForward64(&up, x); #else _BitScanForward(&up, x); #endif return up; } INLINE bool IsPowerOfTwo(uptr x) { return (x & (x - 1)) == 0; } INLINE uptr RoundUpToPowerOfTwo(uptr size) { CHECK(size); if (IsPowerOfTwo(size)) return size; uptr up = MostSignificantSetBitIndex(size); CHECK_LT(size, (1ULL << (up + 1))); CHECK_GT(size, (1ULL << up)); return 1ULL << (up + 1); } INLINE uptr RoundUpTo(uptr size, uptr boundary) { RAW_CHECK(IsPowerOfTwo(boundary)); return (size + boundary - 1) & ~(boundary - 1); } INLINE uptr RoundDownTo(uptr x, uptr boundary) { return x & ~(boundary - 1); } INLINE bool IsAligned(uptr a, uptr alignment) { return (a & (alignment - 1)) == 0; } INLINE uptr Log2(uptr x) { CHECK(IsPowerOfTwo(x)); return LeastSignificantSetBitIndex(x); } // Don't use std::min, std::max or std::swap, to minimize dependency // on libstdc++. template T Min(T a, T b) { return a < b ? a : b; } template T Max(T a, T b) { return a > b ? a : b; } template void Swap(T& a, T& b) { T tmp = a; a = b; b = tmp; } // Char handling INLINE bool IsSpace(int c) { return (c == ' ') || (c == '\n') || (c == '\t') || (c == '\f') || (c == '\r') || (c == '\v'); } INLINE bool IsDigit(int c) { return (c >= '0') && (c <= '9'); } INLINE int ToLower(int c) { return (c >= 'A' && c <= 'Z') ? (c + 'a' - 'A') : c; } // A low-level vector based on mmap. May incur a significant memory overhead for // small vectors. // WARNING: The current implementation supports only POD types. template class InternalMmapVectorNoCtor { public: void Initialize(uptr initial_capacity) { capacity_ = Max(initial_capacity, (uptr)1); size_ = 0; data_ = (T *)MmapOrDie(capacity_ * sizeof(T), "InternalMmapVectorNoCtor"); } void Destroy() { UnmapOrDie(data_, capacity_ * sizeof(T)); } T &operator[](uptr i) { CHECK_LT(i, size_); return data_[i]; } const T &operator[](uptr i) const { CHECK_LT(i, size_); return data_[i]; } void push_back(const T &element) { CHECK_LE(size_, capacity_); if (size_ == capacity_) { uptr new_capacity = RoundUpToPowerOfTwo(size_ + 1); Resize(new_capacity); } internal_memcpy(&data_[size_++], &element, sizeof(T)); } T &back() { CHECK_GT(size_, 0); return data_[size_ - 1]; } void pop_back() { CHECK_GT(size_, 0); size_--; } uptr size() const { return size_; } const T *data() const { return data_; } T *data() { return data_; } uptr capacity() const { return capacity_; } void clear() { size_ = 0; } bool empty() const { return size() == 0; } const T *begin() const { return data(); } T *begin() { return data(); } const T *end() const { return data() + size(); } T *end() { return data() + size(); } private: void Resize(uptr new_capacity) { CHECK_GT(new_capacity, 0); CHECK_LE(size_, new_capacity); T *new_data = (T *)MmapOrDie(new_capacity * sizeof(T), "InternalMmapVector"); internal_memcpy(new_data, data_, size_ * sizeof(T)); T *old_data = data_; data_ = new_data; UnmapOrDie(old_data, capacity_ * sizeof(T)); capacity_ = new_capacity; } T *data_; uptr capacity_; uptr size_; }; template class InternalMmapVector : public InternalMmapVectorNoCtor { public: explicit InternalMmapVector(uptr initial_capacity) { InternalMmapVectorNoCtor::Initialize(initial_capacity); } ~InternalMmapVector() { InternalMmapVectorNoCtor::Destroy(); } // Disallow evil constructors. InternalMmapVector(const InternalMmapVector&); void operator=(const InternalMmapVector&); }; // HeapSort for arrays and InternalMmapVector. template void InternalSort(Container *v, uptr size, Compare comp) { if (size < 2) return; // Stage 1: insert elements to the heap. for (uptr i = 1; i < size; i++) { uptr j, p; for (j = i; j > 0; j = p) { p = (j - 1) / 2; if (comp((*v)[p], (*v)[j])) Swap((*v)[j], (*v)[p]); else break; } } // Stage 2: swap largest element with the last one, // and sink the new top. for (uptr i = size - 1; i > 0; i--) { Swap((*v)[0], (*v)[i]); uptr j, max_ind; for (j = 0; j < i; j = max_ind) { uptr left = 2 * j + 1; uptr right = 2 * j + 2; max_ind = j; if (left < i && comp((*v)[max_ind], (*v)[left])) max_ind = left; if (right < i && comp((*v)[max_ind], (*v)[right])) max_ind = right; if (max_ind != j) Swap((*v)[j], (*v)[max_ind]); else break; } } } template uptr InternalBinarySearch(const Container &v, uptr first, uptr last, const Value &val, Compare comp) { uptr not_found = last + 1; while (last >= first) { uptr mid = (first + last) / 2; if (comp(v[mid], val)) first = mid + 1; else if (comp(val, v[mid])) last = mid - 1; else return mid; } return not_found; } // Represents a binary loaded into virtual memory (e.g. this can be an // executable or a shared object). class LoadedModule { public: LoadedModule() : full_name_(nullptr), base_address_(0) { ranges_.clear(); } void set(const char *module_name, uptr base_address); void clear(); void addAddressRange(uptr beg, uptr end, bool executable); bool containsAddress(uptr address) const; const char *full_name() const { return full_name_; } uptr base_address() const { return base_address_; } struct AddressRange { AddressRange *next; uptr beg; uptr end; bool executable; AddressRange(uptr beg, uptr end, bool executable) : next(nullptr), beg(beg), end(end), executable(executable) {} }; const IntrusiveList &ranges() const { return ranges_; } private: char *full_name_; // Owned. uptr base_address_; IntrusiveList ranges_; }; // List of LoadedModules. OS-dependent implementation is responsible for // filling this information. class ListOfModules { public: ListOfModules() : modules_(kInitialCapacity) {} ~ListOfModules() { clear(); } void init(); const LoadedModule *begin() const { return modules_.begin(); } LoadedModule *begin() { return modules_.begin(); } const LoadedModule *end() const { return modules_.end(); } LoadedModule *end() { return modules_.end(); } uptr size() const { return modules_.size(); } const LoadedModule &operator[](uptr i) const { CHECK_LT(i, modules_.size()); return modules_[i]; } private: void clear() { for (auto &module : modules_) module.clear(); modules_.clear(); } InternalMmapVector modules_; // We rarely have more than 16K loaded modules. static const uptr kInitialCapacity = 1 << 14; }; // Callback type for iterating over a set of memory ranges. typedef void (*RangeIteratorCallback)(uptr begin, uptr end, void *arg); enum AndroidApiLevel { ANDROID_NOT_ANDROID = 0, ANDROID_KITKAT = 19, ANDROID_LOLLIPOP_MR1 = 22, ANDROID_POST_LOLLIPOP = 23 }; void WriteToSyslog(const char *buffer); #if SANITIZER_MAC void LogFullErrorReport(const char *buffer); #else INLINE void LogFullErrorReport(const char *buffer) {} #endif #if SANITIZER_LINUX || SANITIZER_MAC void WriteOneLineToSyslog(const char *s); void LogMessageOnPrintf(const char *str); #else INLINE void WriteOneLineToSyslog(const char *s) {} INLINE void LogMessageOnPrintf(const char *str) {} #endif #if SANITIZER_LINUX // Initialize Android logging. Any writes before this are silently lost. void AndroidLogInit(); #else INLINE void AndroidLogInit() {} #endif #if SANITIZER_ANDROID void SanitizerInitializeUnwinder(); AndroidApiLevel AndroidGetApiLevel(); #else INLINE void AndroidLogWrite(const char *buffer_unused) {} INLINE void SanitizerInitializeUnwinder() {} INLINE AndroidApiLevel AndroidGetApiLevel() { return ANDROID_NOT_ANDROID; } #endif INLINE uptr GetPthreadDestructorIterations() { #if SANITIZER_ANDROID return (AndroidGetApiLevel() == ANDROID_LOLLIPOP_MR1) ? 8 : 4; #elif SANITIZER_POSIX return 4; #else // Unused on Windows. return 0; #endif } void *internal_start_thread(void(*func)(void*), void *arg); void internal_join_thread(void *th); void MaybeStartBackgroudThread(); // Make the compiler think that something is going on there. // Use this inside a loop that looks like memset/memcpy/etc to prevent the // compiler from recognising it and turning it into an actual call to // memset/memcpy/etc. static inline void SanitizerBreakOptimization(void *arg) { #if defined(_MSC_VER) && !defined(__clang__) _ReadWriteBarrier(); #else __asm__ __volatile__("" : : "r" (arg) : "memory"); #endif } struct SignalContext { void *context; uptr addr; uptr pc; uptr sp; uptr bp; bool is_memory_access; enum WriteFlag { UNKNOWN, READ, WRITE } write_flag; SignalContext(void *context, uptr addr, uptr pc, uptr sp, uptr bp, bool is_memory_access, WriteFlag write_flag) : context(context), addr(addr), pc(pc), sp(sp), bp(bp), is_memory_access(is_memory_access), write_flag(write_flag) {} // Creates signal context in a platform-specific manner. static SignalContext Create(void *siginfo, void *context); // Returns true if the "context" indicates a memory write. static WriteFlag GetWriteFlag(void *context); }; void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp); void MaybeReexec(); template class RunOnDestruction { public: explicit RunOnDestruction(Fn fn) : fn_(fn) {} ~RunOnDestruction() { fn_(); } private: Fn fn_; }; // A simple scope guard. Usage: // auto cleanup = at_scope_exit([]{ do_cleanup; }); template RunOnDestruction at_scope_exit(Fn fn) { return RunOnDestruction(fn); } // Linux on 64-bit s390 had a nasty bug that crashes the whole machine // if a process uses virtual memory over 4TB (as many sanitizers like // to do). This function will abort the process if running on a kernel // that looks vulnerable. #if SANITIZER_LINUX && SANITIZER_S390_64 void AvoidCVE_2016_2143(); #else INLINE void AvoidCVE_2016_2143() {} #endif struct StackDepotStats { uptr n_uniq_ids; uptr allocated; }; } // namespace __sanitizer inline void *operator new(__sanitizer::operator_new_size_type size, __sanitizer::LowLevelAllocator &alloc) { return alloc.Allocate(size); } #endif // SANITIZER_COMMON_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_mutex.h0000664000175000017500000001135412462621273030743 0ustar mwhudsonmwhudson//===-- sanitizer_mutex.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_MUTEX_H #define SANITIZER_MUTEX_H #include "sanitizer_atomic.h" #include "sanitizer_internal_defs.h" #include "sanitizer_libc.h" namespace __sanitizer { class StaticSpinMutex { public: void Init() { atomic_store(&state_, 0, memory_order_relaxed); } void Lock() { if (TryLock()) return; LockSlow(); } bool TryLock() { return atomic_exchange(&state_, 1, memory_order_acquire) == 0; } void Unlock() { atomic_store(&state_, 0, memory_order_release); } void CheckLocked() { CHECK_EQ(atomic_load(&state_, memory_order_relaxed), 1); } private: atomic_uint8_t state_; void NOINLINE LockSlow() { for (int i = 0;; i++) { if (i < 10) proc_yield(10); else internal_sched_yield(); if (atomic_load(&state_, memory_order_relaxed) == 0 && atomic_exchange(&state_, 1, memory_order_acquire) == 0) return; } } }; class SpinMutex : public StaticSpinMutex { public: SpinMutex() { Init(); } private: SpinMutex(const SpinMutex&); void operator=(const SpinMutex&); }; class BlockingMutex { public: #if SANITIZER_WINDOWS // Windows does not currently support LinkerInitialized explicit BlockingMutex(LinkerInitialized); #else explicit constexpr BlockingMutex(LinkerInitialized) : opaque_storage_ {0, }, owner_(0) {} #endif BlockingMutex(); void Lock(); void Unlock(); void CheckLocked(); private: uptr opaque_storage_[10]; uptr owner_; // for debugging }; // Reader-writer spin mutex. class RWMutex { public: RWMutex() { atomic_store(&state_, kUnlocked, memory_order_relaxed); } ~RWMutex() { CHECK_EQ(atomic_load(&state_, memory_order_relaxed), kUnlocked); } void Lock() { u32 cmp = kUnlocked; if (atomic_compare_exchange_strong(&state_, &cmp, kWriteLock, memory_order_acquire)) return; LockSlow(); } void Unlock() { u32 prev = atomic_fetch_sub(&state_, kWriteLock, memory_order_release); DCHECK_NE(prev & kWriteLock, 0); (void)prev; } void ReadLock() { u32 prev = atomic_fetch_add(&state_, kReadLock, memory_order_acquire); if ((prev & kWriteLock) == 0) return; ReadLockSlow(); } void ReadUnlock() { u32 prev = atomic_fetch_sub(&state_, kReadLock, memory_order_release); DCHECK_EQ(prev & kWriteLock, 0); DCHECK_GT(prev & ~kWriteLock, 0); (void)prev; } void CheckLocked() { CHECK_NE(atomic_load(&state_, memory_order_relaxed), kUnlocked); } private: atomic_uint32_t state_; enum { kUnlocked = 0, kWriteLock = 1, kReadLock = 2 }; void NOINLINE LockSlow() { for (int i = 0;; i++) { if (i < 10) proc_yield(10); else internal_sched_yield(); u32 cmp = atomic_load(&state_, memory_order_relaxed); if (cmp == kUnlocked && atomic_compare_exchange_weak(&state_, &cmp, kWriteLock, memory_order_acquire)) return; } } void NOINLINE ReadLockSlow() { for (int i = 0;; i++) { if (i < 10) proc_yield(10); else internal_sched_yield(); u32 prev = atomic_load(&state_, memory_order_acquire); if ((prev & kWriteLock) == 0) return; } } RWMutex(const RWMutex&); void operator = (const RWMutex&); }; template class GenericScopedLock { public: explicit GenericScopedLock(MutexType *mu) : mu_(mu) { mu_->Lock(); } ~GenericScopedLock() { mu_->Unlock(); } private: MutexType *mu_; GenericScopedLock(const GenericScopedLock&); void operator=(const GenericScopedLock&); }; template class GenericScopedReadLock { public: explicit GenericScopedReadLock(MutexType *mu) : mu_(mu) { mu_->ReadLock(); } ~GenericScopedReadLock() { mu_->ReadUnlock(); } private: MutexType *mu_; GenericScopedReadLock(const GenericScopedReadLock&); void operator=(const GenericScopedReadLock&); }; typedef GenericScopedLock SpinMutexLock; typedef GenericScopedLock BlockingMutexLock; typedef GenericScopedLock RWMutexLock; typedef GenericScopedReadLock RWMutexReadLock; } // namespace __sanitizer #endif // SANITIZER_MUTEX_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.incgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.0000664000175000017500000001106312565635274033641 0ustar mwhudsonmwhudson//===-- sanitizer_syscall_linux_aarch64.inc --------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Implementations of internal_syscall and internal_iserror for Linux/aarch64. // //===----------------------------------------------------------------------===// #define SYSCALL(name) __NR_ ## name static uptr __internal_syscall(u64 nr) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0"); asm volatile("svc 0" : "=r"(x0) : "r"(x8) : "memory", "cc"); return x0; } #define __internal_syscall0(n) \ (__internal_syscall)(n) static uptr __internal_syscall(u64 nr, u64 arg1) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0") = arg1; asm volatile("svc 0" : "=r"(x0) : "r"(x8), "0"(x0) : "memory", "cc"); return x0; } #define __internal_syscall1(n, a1) \ (__internal_syscall)(n, (u64)(a1)) static uptr __internal_syscall(u64 nr, u64 arg1, long arg2) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0") = arg1; register u64 x1 asm("x1") = arg2; asm volatile("svc 0" : "=r"(x0) : "r"(x8), "0"(x0), "r"(x1) : "memory", "cc"); return x0; } #define __internal_syscall2(n, a1, a2) \ (__internal_syscall)(n, (u64)(a1), (long)(a2)) static uptr __internal_syscall(u64 nr, u64 arg1, long arg2, long arg3) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0") = arg1; register u64 x1 asm("x1") = arg2; register u64 x2 asm("x2") = arg3; asm volatile("svc 0" : "=r"(x0) : "r"(x8), "0"(x0), "r"(x1), "r"(x2) : "memory", "cc"); return x0; } #define __internal_syscall3(n, a1, a2, a3) \ (__internal_syscall)(n, (u64)(a1), (long)(a2), (long)(a3)) static uptr __internal_syscall(u64 nr, u64 arg1, long arg2, long arg3, u64 arg4) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0") = arg1; register u64 x1 asm("x1") = arg2; register u64 x2 asm("x2") = arg3; register u64 x3 asm("x3") = arg4; asm volatile("svc 0" : "=r"(x0) : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3) : "memory", "cc"); return x0; } #define __internal_syscall4(n, a1, a2, a3, a4) \ (__internal_syscall)(n, (u64)(a1), (long)(a2), (long)(a3), (long)(a4)) static uptr __internal_syscall(u64 nr, u64 arg1, long arg2, long arg3, u64 arg4, long arg5) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0") = arg1; register u64 x1 asm("x1") = arg2; register u64 x2 asm("x2") = arg3; register u64 x3 asm("x3") = arg4; register u64 x4 asm("x4") = arg5; asm volatile("svc 0" : "=r"(x0) : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4) : "memory", "cc"); return x0; } #define __internal_syscall5(n, a1, a2, a3, a4, a5) \ (__internal_syscall)(n, (u64)(a1), (long)(a2), (long)(a3), (long)(a4), \ (u64)(a5)) static uptr __internal_syscall(u64 nr, u64 arg1, long arg2, long arg3, u64 arg4, long arg5, long arg6) { register u64 x8 asm("x8") = nr; register u64 x0 asm("x0") = arg1; register u64 x1 asm("x1") = arg2; register u64 x2 asm("x2") = arg3; register u64 x3 asm("x3") = arg4; register u64 x4 asm("x4") = arg5; register u64 x5 asm("x5") = arg6; asm volatile("svc 0" : "=r"(x0) : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5) : "memory", "cc"); return x0; } #define __internal_syscall6(n, a1, a2, a3, a4, a5, a6) \ (__internal_syscall)(n, (u64)(a1), (long)(a2), (long)(a3), (long)(a4), \ (u64)(a5), (long)(a6)) #define __SYSCALL_NARGS_X(a1, a2, a3, a4, a5, a6, a7, a8, n, ...) n #define __SYSCALL_NARGS(...) \ __SYSCALL_NARGS_X(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0, ) #define __SYSCALL_CONCAT_X(a, b) a##b #define __SYSCALL_CONCAT(a, b) __SYSCALL_CONCAT_X(a, b) #define __SYSCALL_DISP(b, ...) \ __SYSCALL_CONCAT(b, __SYSCALL_NARGS(__VA_ARGS__))(__VA_ARGS__) #define internal_syscall(...) __SYSCALL_DISP(__internal_syscall, __VA_ARGS__) // Helper function used to avoid cobbler errno. bool internal_iserror(uptr retval, int *rverrno) { if (retval >= (uptr)-4095) { if (rverrno) *rverrno = -retval; return true; } return false; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_report_decorator.h0000664000175000017500000000350212346706535033160 0ustar mwhudsonmwhudson//===-- sanitizer_report_decorator.h ----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tags to decorate the sanitizer reports. // Currently supported tags: // * None. // * ANSI color sequences. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_REPORT_DECORATOR_H #define SANITIZER_REPORT_DECORATOR_H #include "sanitizer_common.h" namespace __sanitizer { class SanitizerCommonDecorator { // FIXME: This is not portable. It assumes the special strings are printed to // stdout, which is not the case on Windows (see SetConsoleTextAttribute()). public: SanitizerCommonDecorator() : ansi_(ColorizeReports()) {} const char *Bold() const { return ansi_ ? "\033[1m" : ""; } const char *Default() const { return ansi_ ? "\033[1m\033[0m" : ""; } const char *Warning() { return Red(); } const char *EndWarning() { return Default(); } protected: const char *Black() const { return ansi_ ? "\033[1m\033[30m" : ""; } const char *Red() const { return ansi_ ? "\033[1m\033[31m" : ""; } const char *Green() const { return ansi_ ? "\033[1m\033[32m" : ""; } const char *Yellow() const { return ansi_ ? "\033[1m\033[33m" : ""; } const char *Blue() const { return ansi_ ? "\033[1m\033[34m" : ""; } const char *Magenta() const { return ansi_ ? "\033[1m\033[35m" : ""; } const char *Cyan() const { return ansi_ ? "\033[1m\033[36m" : ""; } const char *White() const { return ansi_ ? "\033[1m\033[37m" : ""; } private: bool ansi_; }; } // namespace __sanitizer #endif // SANITIZER_REPORT_DECORATOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator.h0000664000175000017500000000353512773316446031573 0ustar mwhudsonmwhudson//===-- sanitizer_allocator.h -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Specialized memory allocator for ThreadSanitizer, MemorySanitizer, etc. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #define SANITIZER_ALLOCATOR_H #include "sanitizer_internal_defs.h" #include "sanitizer_common.h" #include "sanitizer_libc.h" #include "sanitizer_list.h" #include "sanitizer_mutex.h" #include "sanitizer_lfstack.h" #include "sanitizer_procmaps.h" namespace __sanitizer { // Returns true if ReportAllocatorCannotReturnNull(true) was called. // Can be use to avoid memory hungry operations. bool IsReportingOOM(); // Prints error message and kills the program. void NORETURN ReportAllocatorCannotReturnNull(bool out_of_memory); // Allocators call these callbacks on mmap/munmap. struct NoOpMapUnmapCallback { void OnMap(uptr p, uptr size) const { } void OnUnmap(uptr p, uptr size) const { } }; // Callback type for iterating over chunks. typedef void (*ForEachChunkCallback)(uptr chunk, void *arg); // Returns true if calloc(size, n) should return 0 due to overflow in size*n. bool CallocShouldReturnNullDueToOverflow(uptr size, uptr n); #include "sanitizer_allocator_size_class_map.h" #include "sanitizer_allocator_stats.h" #include "sanitizer_allocator_primary64.h" #include "sanitizer_allocator_bytemap.h" #include "sanitizer_allocator_primary32.h" #include "sanitizer_allocator_local_cache.h" #include "sanitizer_allocator_secondary.h" #include "sanitizer_allocator_combined.h" } // namespace __sanitizer #endif // SANITIZER_ALLOCATOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/CMakeLists.txt0000664000175000017500000001376612775420063030112 0ustar mwhudsonmwhudson# Build system for the common Sanitizer runtime support library components. # These components are shared between AddressSanitizer and ThreadSanitizer. set(SANITIZER_SOURCES_NOTERMINATION sanitizer_allocator.cc sanitizer_common.cc sanitizer_deadlock_detector1.cc sanitizer_deadlock_detector2.cc sanitizer_flags.cc sanitizer_flag_parser.cc sanitizer_libc.cc sanitizer_libignore.cc sanitizer_linux.cc sanitizer_linux_s390.cc sanitizer_mac.cc sanitizer_persistent_allocator.cc sanitizer_platform_limits_linux.cc sanitizer_platform_limits_posix.cc sanitizer_posix.cc sanitizer_printf.cc sanitizer_procmaps_common.cc sanitizer_procmaps_freebsd.cc sanitizer_procmaps_linux.cc sanitizer_procmaps_mac.cc sanitizer_stackdepot.cc sanitizer_stacktrace.cc sanitizer_stacktrace_printer.cc sanitizer_suppressions.cc sanitizer_symbolizer.cc sanitizer_symbolizer_libbacktrace.cc sanitizer_symbolizer_mac.cc sanitizer_symbolizer_win.cc sanitizer_tls_get_addr.cc sanitizer_thread_registry.cc sanitizer_win.cc) if(UNIX AND NOT APPLE) list(APPEND SANITIZER_SOURCES_NOTERMINATION sanitizer_linux_x86_64.S) list(APPEND SANITIZER_SOURCES_NOTERMINATION sanitizer_linux_mips64.S) endif() set(SANITIZER_SOURCES ${SANITIZER_SOURCES_NOTERMINATION} sanitizer_termination.cc) # Libc functions stubs. These sources should be linked instead of # SANITIZER_LIBCDEP_SOURCES when sanitizer_common library must not depend on # libc. set(SANITIZER_NOLIBC_SOURCES sanitizer_common_nolibc.cc) set(SANITIZER_LIBCDEP_SOURCES sanitizer_common_libcdep.cc sanitizer_coverage_libcdep.cc sanitizer_coverage_mapping_libcdep.cc sanitizer_linux_libcdep.cc sanitizer_posix_libcdep.cc sanitizer_stacktrace_libcdep.cc sanitizer_stoptheworld_linux_libcdep.cc sanitizer_symbolizer_libcdep.cc sanitizer_symbolizer_posix_libcdep.cc sanitizer_unwind_linux_libcdep.cc) # Explicitly list all sanitizer_common headers. Not all of these are # included in sanitizer_common source files, but we need to depend on # headers when building our custom unit tests. set(SANITIZER_HEADERS sanitizer_addrhashmap.h sanitizer_allocator.h sanitizer_allocator_bytemap.h sanitizer_allocator_combined.h sanitizer_allocator_interface.h sanitizer_allocator_internal.h sanitizer_allocator_local_cache.h sanitizer_allocator_primary32.h sanitizer_allocator_primary64.h sanitizer_allocator_secondary.h sanitizer_allocator_size_class_map.h sanitizer_allocator_stats.h sanitizer_atomic.h sanitizer_atomic_clang.h sanitizer_atomic_msvc.h sanitizer_bitvector.h sanitizer_bvgraph.h sanitizer_common.h sanitizer_common_interceptors.inc sanitizer_common_interceptors_ioctl.inc sanitizer_common_interceptors_format.inc sanitizer_common_syscalls.inc sanitizer_deadlock_detector.h sanitizer_deadlock_detector_interface.h sanitizer_flag_parser.h sanitizer_flags.h sanitizer_flags.inc sanitizer_interface_internal.h sanitizer_internal_defs.h sanitizer_lfstack.h sanitizer_libc.h sanitizer_libignore.h sanitizer_linux.h sanitizer_list.h sanitizer_mac.h sanitizer_mutex.h sanitizer_persistent_allocator.h sanitizer_placement_new.h sanitizer_platform.h sanitizer_platform_interceptors.h sanitizer_platform_limits_posix.h sanitizer_posix.h sanitizer_procmaps.h sanitizer_quarantine.h sanitizer_report_decorator.h sanitizer_stackdepot.h sanitizer_stackdepotbase.h sanitizer_stacktrace.h sanitizer_stacktrace_printer.h sanitizer_stoptheworld.h sanitizer_suppressions.h sanitizer_symbolizer.h sanitizer_symbolizer_internal.h sanitizer_symbolizer_libbacktrace.h sanitizer_symbolizer_mac.h sanitizer_syscall_generic.inc sanitizer_syscall_linux_x86_64.inc sanitizer_syscall_linux_aarch64.inc sanitizer_thread_registry.h) set(SANITIZER_COMMON_DEFINITIONS) include(CheckIncludeFile) append_have_file_definition(rpc/xdr.h HAVE_RPC_XDR_H SANITIZER_COMMON_DEFINITIONS) append_have_file_definition(tirpc/rpc/xdr.h HAVE_TIRPC_RPC_XDR_H SANITIZER_COMMON_DEFINITIONS) set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF SANITIZER_CFLAGS) append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=570 SANITIZER_CFLAGS) append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors SANITIZER_CFLAGS) if (LLVM_ENABLE_PEDANTIC AND UNIX AND NOT APPLE) # With -pedantic, our .S files raise warnings about empty macro arguments # from __USER_LABEL_PREFIX__ being an empty arg to GLUE(). Unfortunately, # there is no simple way to test for an empty define, nor to disable just # that warning or to disable -pedantic. There is also no simple way to # remove -pedantic from just this file (we'd have to remove from # CMAKE_C*_FLAGS and re-add as a source property to all the non-.S files). set_source_files_properties(sanitizer_linux_x86_64.S PROPERTIES COMPILE_FLAGS "-w") set_source_files_properties(sanitizer_linux_mips64.S PROPERTIES COMPILE_FLAGS "-w") endif () if(APPLE) set(OS_OPTION OS ${SANITIZER_COMMON_SUPPORTED_OS}) endif() add_compiler_rt_object_libraries(RTSanitizerCommon ${OS_OPTION} ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} SOURCES ${SANITIZER_SOURCES} CFLAGS ${SANITIZER_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) add_compiler_rt_object_libraries(RTSanitizerCommonNoTermination ${OS_OPTION} ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} SOURCES ${SANITIZER_SOURCES_NOTERMINATION} CFLAGS ${SANITIZER_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) add_compiler_rt_object_libraries(RTSanitizerCommonNoLibc ${OS_OPTION} ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} SOURCES ${SANITIZER_NOLIBC_SOURCES} CFLAGS ${SANITIZER_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) add_compiler_rt_object_libraries(RTSanitizerCommonLibc ${OS_OPTION} ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} SOURCES ${SANITIZER_LIBCDEP_SOURCES} CFLAGS ${SANITIZER_CFLAGS} DEFS ${SANITIZER_COMMON_DEFINITIONS}) # Unit tests for common sanitizer runtime. if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_tls_get_addr.cc0000664000175000017500000001207112665227421032371 0ustar mwhudsonmwhudson//===-- sanitizer_tls_get_addr.cc -----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Handle the __tls_get_addr call. // //===----------------------------------------------------------------------===// #include "sanitizer_tls_get_addr.h" #include "sanitizer_flags.h" #include "sanitizer_platform_interceptors.h" namespace __sanitizer { #if SANITIZER_INTERCEPT_TLS_GET_ADDR // The actual parameter that comes to __tls_get_addr // is a pointer to a struct with two words in it: struct TlsGetAddrParam { uptr dso_id; uptr offset; }; // Glibc starting from 2.19 allocates tls using __signal_safe_memalign, // which has such header. struct Glibc_2_19_tls_header { uptr size; uptr start; }; // This must be static TLS __attribute__((tls_model("initial-exec"))) static __thread DTLS dtls; // Make sure we properly destroy the DTLS objects: // this counter should never get too large. static atomic_uintptr_t number_of_live_dtls; static const uptr kDestroyedThread = -1; static inline void DTLS_Deallocate(DTLS::DTV *dtv, uptr size) { if (!size) return; VPrintf(2, "__tls_get_addr: DTLS_Deallocate %p %zd\n", dtv, size); UnmapOrDie(dtv, size * sizeof(DTLS::DTV)); atomic_fetch_sub(&number_of_live_dtls, 1, memory_order_relaxed); } static inline void DTLS_Resize(uptr new_size) { if (dtls.dtv_size >= new_size) return; new_size = RoundUpToPowerOfTwo(new_size); new_size = Max(new_size, 4096UL / sizeof(DTLS::DTV)); DTLS::DTV *new_dtv = (DTLS::DTV *)MmapOrDie(new_size * sizeof(DTLS::DTV), "DTLS_Resize"); uptr num_live_dtls = atomic_fetch_add(&number_of_live_dtls, 1, memory_order_relaxed); VPrintf(2, "__tls_get_addr: DTLS_Resize %p %zd\n", &dtls, num_live_dtls); CHECK_LT(num_live_dtls, 1 << 20); uptr old_dtv_size = dtls.dtv_size; DTLS::DTV *old_dtv = dtls.dtv; if (old_dtv_size) internal_memcpy(new_dtv, dtls.dtv, dtls.dtv_size * sizeof(DTLS::DTV)); dtls.dtv = new_dtv; dtls.dtv_size = new_size; if (old_dtv_size) DTLS_Deallocate(old_dtv, old_dtv_size); } void DTLS_Destroy() { if (!common_flags()->intercept_tls_get_addr) return; VPrintf(2, "__tls_get_addr: DTLS_Destroy %p %zd\n", &dtls, dtls.dtv_size); uptr s = dtls.dtv_size; dtls.dtv_size = kDestroyedThread; // Do this before unmap for AS-safety. DTLS_Deallocate(dtls.dtv, s); } #if defined(__powerpc64__) || defined(__mips__) // This is glibc's TLS_DTV_OFFSET: // "Dynamic thread vector pointers point 0x8000 past the start of each // TLS block." static const uptr kDtvOffset = 0x8000; #else static const uptr kDtvOffset = 0; #endif DTLS::DTV *DTLS_on_tls_get_addr(void *arg_void, void *res, uptr static_tls_begin, uptr static_tls_end) { if (!common_flags()->intercept_tls_get_addr) return 0; TlsGetAddrParam *arg = reinterpret_cast(arg_void); uptr dso_id = arg->dso_id; if (dtls.dtv_size == kDestroyedThread) return 0; DTLS_Resize(dso_id + 1); if (dtls.dtv[dso_id].beg) return 0; uptr tls_size = 0; uptr tls_beg = reinterpret_cast(res) - arg->offset - kDtvOffset; VPrintf(2, "__tls_get_addr: %p {%p,%p} => %p; tls_beg: %p; sp: %p " "num_live_dtls %zd\n", arg, arg->dso_id, arg->offset, res, tls_beg, &tls_beg, atomic_load(&number_of_live_dtls, memory_order_relaxed)); if (dtls.last_memalign_ptr == tls_beg) { tls_size = dtls.last_memalign_size; VPrintf(2, "__tls_get_addr: glibc <=2.18 suspected; tls={%p,%p}\n", tls_beg, tls_size); } else if (tls_beg >= static_tls_begin && tls_beg < static_tls_end) { // This is the static TLS block which was initialized / unpoisoned at thread // creation. VPrintf(2, "__tls_get_addr: static tls: %p\n", tls_beg); tls_size = 0; } else if ((tls_beg % 4096) == sizeof(Glibc_2_19_tls_header)) { // We may want to check gnu_get_libc_version(). Glibc_2_19_tls_header *header = (Glibc_2_19_tls_header *)tls_beg - 1; tls_size = header->size; tls_beg = header->start; VPrintf(2, "__tls_get_addr: glibc >=2.19 suspected; tls={%p %p}\n", tls_beg, tls_size); } else { VPrintf(2, "__tls_get_addr: Can't guess glibc version\n"); // This may happen inside the DTOR of main thread, so just ignore it. tls_size = 0; } dtls.dtv[dso_id].beg = tls_beg; dtls.dtv[dso_id].size = tls_size; return dtls.dtv + dso_id; } void DTLS_on_libc_memalign(void *ptr, uptr size) { if (!common_flags()->intercept_tls_get_addr) return; VPrintf(2, "DTLS_on_libc_memalign: %p %p\n", ptr, size); dtls.last_memalign_ptr = reinterpret_cast(ptr); dtls.last_memalign_size = size; } DTLS *DTLS_Get() { return &dtls; } #else void DTLS_on_libc_memalign(void *ptr, uptr size) {} DTLS::DTV *DTLS_on_tls_get_addr(void *arg, void *res) { return 0; } DTLS *DTLS_Get() { return 0; } void DTLS_Destroy() {} #endif // SANITIZER_INTERCEPT_TLS_GET_ADDR } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_mac.cc0000664000175000017500000006101513004730632030467 0ustar mwhudsonmwhudson//===-- sanitizer_mac.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between various sanitizers' runtime libraries and // implements OSX-specific functions. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_mac.h" // Use 64-bit inodes in file operations. ASan does not support OS X 10.5, so // the clients will most certainly use 64-bit ones as well. #ifndef _DARWIN_USE_64_BIT_INODE #define _DARWIN_USE_64_BIT_INODE 1 #endif #include #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_internal_defs.h" #include "sanitizer_libc.h" #include "sanitizer_placement_new.h" #include "sanitizer_platform_limits_posix.h" #include "sanitizer_procmaps.h" #if !SANITIZER_IOS #include // for _NSGetEnviron #else extern char **environ; #endif #if defined(__has_include) && __has_include() #define SANITIZER_OS_TRACE 1 #include #else #define SANITIZER_OS_TRACE 0 #endif #if !SANITIZER_IOS #include // for _NSGetArgv and _NSGetEnviron #else extern "C" { extern char ***_NSGetArgv(void); } #endif #include #include // for dladdr() #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // From , but we don't have that file on iOS. extern "C" { extern char ***_NSGetArgv(void); extern char ***_NSGetEnviron(void); } // From , but we don't have that file on iOS. extern "C" { extern kern_return_t mach_vm_region_recurse( vm_map_t target_task, mach_vm_address_t *address, mach_vm_size_t *size, natural_t *nesting_depth, vm_region_recurse_info_t info, mach_msg_type_number_t *infoCnt); } namespace __sanitizer { #include "sanitizer_syscall_generic.inc" // Direct syscalls, don't call libmalloc hooks. extern "C" void *__mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); extern "C" int __munmap(void *, size_t); // ---------------------- sanitizer_libc.h uptr internal_mmap(void *addr, size_t length, int prot, int flags, int fd, u64 offset) { if (fd == -1) fd = VM_MAKE_TAG(VM_MEMORY_ANALYSIS_TOOL); return (uptr)__mmap(addr, length, prot, flags, fd, offset); } uptr internal_munmap(void *addr, uptr length) { return __munmap(addr, length); } int internal_mprotect(void *addr, uptr length, int prot) { return mprotect(addr, length, prot); } uptr internal_close(fd_t fd) { return close(fd); } uptr internal_open(const char *filename, int flags) { return open(filename, flags); } uptr internal_open(const char *filename, int flags, u32 mode) { return open(filename, flags, mode); } uptr internal_read(fd_t fd, void *buf, uptr count) { return read(fd, buf, count); } uptr internal_write(fd_t fd, const void *buf, uptr count) { return write(fd, buf, count); } uptr internal_stat(const char *path, void *buf) { return stat(path, (struct stat *)buf); } uptr internal_lstat(const char *path, void *buf) { return lstat(path, (struct stat *)buf); } uptr internal_fstat(fd_t fd, void *buf) { return fstat(fd, (struct stat *)buf); } uptr internal_filesize(fd_t fd) { struct stat st; if (internal_fstat(fd, &st)) return -1; return (uptr)st.st_size; } uptr internal_dup2(int oldfd, int newfd) { return dup2(oldfd, newfd); } uptr internal_readlink(const char *path, char *buf, uptr bufsize) { return readlink(path, buf, bufsize); } uptr internal_unlink(const char *path) { return unlink(path); } uptr internal_sched_yield() { return sched_yield(); } void internal__exit(int exitcode) { _exit(exitcode); } unsigned int internal_sleep(unsigned int seconds) { return sleep(seconds); } uptr internal_getpid() { return getpid(); } int internal_sigaction(int signum, const void *act, void *oldact) { return sigaction(signum, (struct sigaction *)act, (struct sigaction *)oldact); } void internal_sigfillset(__sanitizer_sigset_t *set) { sigfillset(set); } uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) { return sigprocmask(how, set, oldset); } // Doesn't call pthread_atfork() handlers. extern "C" pid_t __fork(void); int internal_fork() { return __fork(); } int internal_forkpty(int *amaster) { int master, slave; if (openpty(&master, &slave, nullptr, nullptr, nullptr) == -1) return -1; int pid = __fork(); if (pid == -1) { close(master); close(slave); return -1; } if (pid == 0) { close(master); if (login_tty(slave) != 0) { // We already forked, there's not much we can do. Let's quit. Report("login_tty failed (errno %d)\n", errno); internal__exit(1); } } else { *amaster = master; close(slave); } return pid; } uptr internal_rename(const char *oldpath, const char *newpath) { return rename(oldpath, newpath); } uptr internal_ftruncate(fd_t fd, uptr size) { return ftruncate(fd, size); } uptr internal_execve(const char *filename, char *const argv[], char *const envp[]) { return execve(filename, argv, envp); } uptr internal_waitpid(int pid, int *status, int options) { return waitpid(pid, status, options); } // ----------------- sanitizer_common.h bool FileExists(const char *filename) { struct stat st; if (stat(filename, &st)) return false; // Sanity check: filename is a regular file. return S_ISREG(st.st_mode); } uptr GetTid() { // FIXME: This can potentially get truncated on 32-bit, where uptr is 4 bytes. uint64_t tid; pthread_threadid_np(nullptr, &tid); return tid; } void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, uptr *stack_bottom) { CHECK(stack_top); CHECK(stack_bottom); uptr stacksize = pthread_get_stacksize_np(pthread_self()); // pthread_get_stacksize_np() returns an incorrect stack size for the main // thread on Mavericks. See // https://github.com/google/sanitizers/issues/261 if ((GetMacosVersion() >= MACOS_VERSION_MAVERICKS) && at_initialization && stacksize == (1 << 19)) { struct rlimit rl; CHECK_EQ(getrlimit(RLIMIT_STACK, &rl), 0); // Most often rl.rlim_cur will be the desired 8M. if (rl.rlim_cur < kMaxThreadStackSize) { stacksize = rl.rlim_cur; } else { stacksize = kMaxThreadStackSize; } } void *stackaddr = pthread_get_stackaddr_np(pthread_self()); *stack_top = (uptr)stackaddr; *stack_bottom = *stack_top - stacksize; } char **GetEnviron() { #if !SANITIZER_IOS char ***env_ptr = _NSGetEnviron(); if (!env_ptr) { Report("_NSGetEnviron() returned NULL. Please make sure __asan_init() is " "called after libSystem_initializer().\n"); CHECK(env_ptr); } char **environ = *env_ptr; #endif CHECK(environ); return environ; } const char *GetEnv(const char *name) { char **env = GetEnviron(); uptr name_len = internal_strlen(name); while (*env != 0) { uptr len = internal_strlen(*env); if (len > name_len) { const char *p = *env; if (!internal_memcmp(p, name, name_len) && p[name_len] == '=') { // Match. return *env + name_len + 1; // String starting after =. } } env++; } return 0; } uptr ReadBinaryName(/*out*/char *buf, uptr buf_len) { CHECK_LE(kMaxPathLength, buf_len); // On OS X the executable path is saved to the stack by dyld. Reading it // from there is much faster than calling dladdr, especially for large // binaries with symbols. InternalScopedString exe_path(kMaxPathLength); uint32_t size = exe_path.size(); if (_NSGetExecutablePath(exe_path.data(), &size) == 0 && realpath(exe_path.data(), buf) != 0) { return internal_strlen(buf); } return 0; } uptr ReadLongProcessName(/*out*/char *buf, uptr buf_len) { return ReadBinaryName(buf, buf_len); } void ReExec() { UNIMPLEMENTED(); } uptr GetPageSize() { return sysconf(_SC_PAGESIZE); } BlockingMutex::BlockingMutex() { internal_memset(this, 0, sizeof(*this)); } void BlockingMutex::Lock() { CHECK(sizeof(OSSpinLock) <= sizeof(opaque_storage_)); CHECK_EQ(OS_SPINLOCK_INIT, 0); CHECK_NE(owner_, (uptr)pthread_self()); OSSpinLockLock((OSSpinLock*)&opaque_storage_); CHECK(!owner_); owner_ = (uptr)pthread_self(); } void BlockingMutex::Unlock() { CHECK(owner_ == (uptr)pthread_self()); owner_ = 0; OSSpinLockUnlock((OSSpinLock*)&opaque_storage_); } void BlockingMutex::CheckLocked() { CHECK_EQ((uptr)pthread_self(), owner_); } u64 NanoTime() { return 0; } uptr GetTlsSize() { return 0; } void InitTlsSize() { } void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, uptr *tls_addr, uptr *tls_size) { #if !SANITIZER_GO uptr stack_top, stack_bottom; GetThreadStackTopAndBottom(main, &stack_top, &stack_bottom); *stk_addr = stack_bottom; *stk_size = stack_top - stack_bottom; *tls_addr = 0; *tls_size = 0; #else *stk_addr = 0; *stk_size = 0; *tls_addr = 0; *tls_size = 0; #endif } void ListOfModules::init() { clear(); MemoryMappingLayout memory_mapping(false); memory_mapping.DumpListOfModules(&modules_); } bool IsHandledDeadlySignal(int signum) { if ((SANITIZER_WATCHOS || SANITIZER_TVOS) && !(SANITIZER_IOSSIM)) // Handling fatal signals on watchOS and tvOS devices is disallowed. return false; if (common_flags()->handle_abort && signum == SIGABRT) return true; return (signum == SIGSEGV || signum == SIGBUS) && common_flags()->handle_segv; } MacosVersion cached_macos_version = MACOS_VERSION_UNINITIALIZED; MacosVersion GetMacosVersionInternal() { int mib[2] = { CTL_KERN, KERN_OSRELEASE }; char version[100]; uptr len = 0, maxlen = sizeof(version) / sizeof(version[0]); for (uptr i = 0; i < maxlen; i++) version[i] = '\0'; // Get the version length. CHECK_NE(sysctl(mib, 2, 0, &len, 0, 0), -1); CHECK_LT(len, maxlen); CHECK_NE(sysctl(mib, 2, version, &len, 0, 0), -1); switch (version[0]) { case '9': return MACOS_VERSION_LEOPARD; case '1': { switch (version[1]) { case '0': return MACOS_VERSION_SNOW_LEOPARD; case '1': return MACOS_VERSION_LION; case '2': return MACOS_VERSION_MOUNTAIN_LION; case '3': return MACOS_VERSION_MAVERICKS; case '4': return MACOS_VERSION_YOSEMITE; default: if (IsDigit(version[1])) return MACOS_VERSION_UNKNOWN_NEWER; else return MACOS_VERSION_UNKNOWN; } } default: return MACOS_VERSION_UNKNOWN; } } MacosVersion GetMacosVersion() { atomic_uint32_t *cache = reinterpret_cast(&cached_macos_version); MacosVersion result = static_cast(atomic_load(cache, memory_order_acquire)); if (result == MACOS_VERSION_UNINITIALIZED) { result = GetMacosVersionInternal(); atomic_store(cache, result, memory_order_release); } return result; } uptr GetRSS() { struct task_basic_info info; unsigned count = TASK_BASIC_INFO_COUNT; kern_return_t result = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &count); if (UNLIKELY(result != KERN_SUCCESS)) { Report("Cannot get task info. Error: %d\n", result); Die(); } return info.resident_size; } void *internal_start_thread(void(*func)(void *arg), void *arg) { // Start the thread with signals blocked, otherwise it can steal user signals. __sanitizer_sigset_t set, old; internal_sigfillset(&set); internal_sigprocmask(SIG_SETMASK, &set, &old); pthread_t th; pthread_create(&th, 0, (void*(*)(void *arg))func, arg); internal_sigprocmask(SIG_SETMASK, &old, 0); return th; } void internal_join_thread(void *th) { pthread_join((pthread_t)th, 0); } #if !SANITIZER_GO static BlockingMutex syslog_lock(LINKER_INITIALIZED); #endif void WriteOneLineToSyslog(const char *s) { #if !SANITIZER_GO syslog_lock.CheckLocked(); asl_log(nullptr, nullptr, ASL_LEVEL_ERR, "%s", s); #endif } void LogMessageOnPrintf(const char *str) { // Log all printf output to CrashLog. if (common_flags()->abort_on_error) CRAppendCrashLogMessage(str); } void LogFullErrorReport(const char *buffer) { #if !SANITIZER_GO // Log with os_trace. This will make it into the crash log. #if SANITIZER_OS_TRACE if (GetMacosVersion() >= MACOS_VERSION_YOSEMITE) { // os_trace requires the message (format parameter) to be a string literal. if (internal_strncmp(SanitizerToolName, "AddressSanitizer", sizeof("AddressSanitizer") - 1) == 0) os_trace("Address Sanitizer reported a failure."); else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer", sizeof("UndefinedBehaviorSanitizer") - 1) == 0) os_trace("Undefined Behavior Sanitizer reported a failure."); else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer", sizeof("ThreadSanitizer") - 1) == 0) os_trace("Thread Sanitizer reported a failure."); else os_trace("Sanitizer tool reported a failure."); if (common_flags()->log_to_syslog) os_trace("Consult syslog for more information."); } #endif // Log to syslog. // The logging on OS X may call pthread_create so we need the threading // environment to be fully initialized. Also, this should never be called when // holding the thread registry lock since that may result in a deadlock. If // the reporting thread holds the thread registry mutex, and asl_log waits // for GCD to dispatch a new thread, the process will deadlock, because the // pthread_create wrapper needs to acquire the lock as well. BlockingMutexLock l(&syslog_lock); if (common_flags()->log_to_syslog) WriteToSyslog(buffer); // The report is added to CrashLog as part of logging all of Printf output. #endif } SignalContext::WriteFlag SignalContext::GetWriteFlag(void *context) { #if defined(__x86_64__) || defined(__i386__) ucontext_t *ucontext = static_cast(context); return ucontext->uc_mcontext->__es.__err & 2 /*T_PF_WRITE*/ ? WRITE : READ; #else return UNKNOWN; #endif } void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { ucontext_t *ucontext = (ucontext_t*)context; # if defined(__aarch64__) *pc = ucontext->uc_mcontext->__ss.__pc; # if defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 *bp = ucontext->uc_mcontext->__ss.__fp; # else *bp = ucontext->uc_mcontext->__ss.__lr; # endif *sp = ucontext->uc_mcontext->__ss.__sp; # elif defined(__x86_64__) *pc = ucontext->uc_mcontext->__ss.__rip; *bp = ucontext->uc_mcontext->__ss.__rbp; *sp = ucontext->uc_mcontext->__ss.__rsp; # elif defined(__arm__) *pc = ucontext->uc_mcontext->__ss.__pc; *bp = ucontext->uc_mcontext->__ss.__r[7]; *sp = ucontext->uc_mcontext->__ss.__sp; # elif defined(__i386__) *pc = ucontext->uc_mcontext->__ss.__eip; *bp = ucontext->uc_mcontext->__ss.__ebp; *sp = ucontext->uc_mcontext->__ss.__esp; # else # error "Unknown architecture" # endif } #if !SANITIZER_GO static const char kDyldInsertLibraries[] = "DYLD_INSERT_LIBRARIES"; LowLevelAllocator allocator_for_env; // Change the value of the env var |name|, leaking the original value. // If |name_value| is NULL, the variable is deleted from the environment, // otherwise the corresponding "NAME=value" string is replaced with // |name_value|. void LeakyResetEnv(const char *name, const char *name_value) { char **env = GetEnviron(); uptr name_len = internal_strlen(name); while (*env != 0) { uptr len = internal_strlen(*env); if (len > name_len) { const char *p = *env; if (!internal_memcmp(p, name, name_len) && p[name_len] == '=') { // Match. if (name_value) { // Replace the old value with the new one. *env = const_cast(name_value); } else { // Shift the subsequent pointers back. char **del = env; do { del[0] = del[1]; } while (*del++); } } } env++; } } SANITIZER_WEAK_CXX_DEFAULT_IMPL bool ReexecDisabled() { return false; } extern "C" SANITIZER_WEAK_ATTRIBUTE double dyldVersionNumber; static const double kMinDyldVersionWithAutoInterposition = 360.0; bool DyldNeedsEnvVariable() { // Although sanitizer support was added to LLVM on OS X 10.7+, GCC users // still may want use them on older systems. On older Darwin platforms, dyld // doesn't export dyldVersionNumber symbol and we simply return true. if (!&dyldVersionNumber) return true; // If running on OS X 10.11+ or iOS 9.0+, dyld will interpose even if // DYLD_INSERT_LIBRARIES is not set. However, checking OS version via // GetMacosVersion() doesn't work for the simulator. Let's instead check // `dyldVersionNumber`, which is exported by dyld, against a known version // number from the first OS release where this appeared. return dyldVersionNumber < kMinDyldVersionWithAutoInterposition; } void MaybeReexec() { if (ReexecDisabled()) return; // Make sure the dynamic runtime library is preloaded so that the // wrappers work. If it is not, set DYLD_INSERT_LIBRARIES and re-exec // ourselves. Dl_info info; RAW_CHECK(dladdr((void*)((uptr)&__sanitizer_report_error_summary), &info)); char *dyld_insert_libraries = const_cast(GetEnv(kDyldInsertLibraries)); uptr old_env_len = dyld_insert_libraries ? internal_strlen(dyld_insert_libraries) : 0; uptr fname_len = internal_strlen(info.dli_fname); const char *dylib_name = StripModuleName(info.dli_fname); uptr dylib_name_len = internal_strlen(dylib_name); bool lib_is_in_env = dyld_insert_libraries && internal_strstr(dyld_insert_libraries, dylib_name); if (DyldNeedsEnvVariable() && !lib_is_in_env) { // DYLD_INSERT_LIBRARIES is not set or does not contain the runtime // library. InternalScopedString program_name(1024); uint32_t buf_size = program_name.size(); _NSGetExecutablePath(program_name.data(), &buf_size); char *new_env = const_cast(info.dli_fname); if (dyld_insert_libraries) { // Append the runtime dylib name to the existing value of // DYLD_INSERT_LIBRARIES. new_env = (char*)allocator_for_env.Allocate(old_env_len + fname_len + 2); internal_strncpy(new_env, dyld_insert_libraries, old_env_len); new_env[old_env_len] = ':'; // Copy fname_len and add a trailing zero. internal_strncpy(new_env + old_env_len + 1, info.dli_fname, fname_len + 1); // Ok to use setenv() since the wrappers don't depend on the value of // asan_inited. setenv(kDyldInsertLibraries, new_env, /*overwrite*/1); } else { // Set DYLD_INSERT_LIBRARIES equal to the runtime dylib name. setenv(kDyldInsertLibraries, info.dli_fname, /*overwrite*/0); } VReport(1, "exec()-ing the program with\n"); VReport(1, "%s=%s\n", kDyldInsertLibraries, new_env); VReport(1, "to enable wrappers.\n"); execv(program_name.data(), *_NSGetArgv()); // We get here only if execv() failed. Report("ERROR: The process is launched without DYLD_INSERT_LIBRARIES, " "which is required for the sanitizer to work. We tried to set the " "environment variable and re-execute itself, but execv() failed, " "possibly because of sandbox restrictions. Make sure to launch the " "executable with:\n%s=%s\n", kDyldInsertLibraries, new_env); RAW_CHECK("execv failed" && 0); } // Verify that interceptors really work. We'll use dlsym to locate // "pthread_create", if interceptors are working, it should really point to // "wrap_pthread_create" within our own dylib. Dl_info info_pthread_create; void *dlopen_addr = dlsym(RTLD_DEFAULT, "pthread_create"); RAW_CHECK(dladdr(dlopen_addr, &info_pthread_create)); if (internal_strcmp(info.dli_fname, info_pthread_create.dli_fname) != 0) { Report( "ERROR: Interceptors are not working. This may be because %s is " "loaded too late (e.g. via dlopen). Please launch the executable " "with:\n%s=%s\n", SanitizerToolName, kDyldInsertLibraries, info.dli_fname); RAW_CHECK("interceptors not installed" && 0); } if (!lib_is_in_env) return; // DYLD_INSERT_LIBRARIES is set and contains the runtime library. Let's remove // the dylib from the environment variable, because interceptors are installed // and we don't want our children to inherit the variable. uptr env_name_len = internal_strlen(kDyldInsertLibraries); // Allocate memory to hold the previous env var name, its value, the '=' // sign and the '\0' char. char *new_env = (char*)allocator_for_env.Allocate( old_env_len + 2 + env_name_len); RAW_CHECK(new_env); internal_memset(new_env, '\0', old_env_len + 2 + env_name_len); internal_strncpy(new_env, kDyldInsertLibraries, env_name_len); new_env[env_name_len] = '='; char *new_env_pos = new_env + env_name_len + 1; // Iterate over colon-separated pieces of |dyld_insert_libraries|. char *piece_start = dyld_insert_libraries; char *piece_end = NULL; char *old_env_end = dyld_insert_libraries + old_env_len; do { if (piece_start[0] == ':') piece_start++; piece_end = internal_strchr(piece_start, ':'); if (!piece_end) piece_end = dyld_insert_libraries + old_env_len; if ((uptr)(piece_start - dyld_insert_libraries) > old_env_len) break; uptr piece_len = piece_end - piece_start; char *filename_start = (char *)internal_memrchr(piece_start, '/', piece_len); uptr filename_len = piece_len; if (filename_start) { filename_start += 1; filename_len = piece_len - (filename_start - piece_start); } else { filename_start = piece_start; } // If the current piece isn't the runtime library name, // append it to new_env. if ((dylib_name_len != filename_len) || (internal_memcmp(filename_start, dylib_name, dylib_name_len) != 0)) { if (new_env_pos != new_env + env_name_len + 1) { new_env_pos[0] = ':'; new_env_pos++; } internal_strncpy(new_env_pos, piece_start, piece_len); new_env_pos += piece_len; } // Move on to the next piece. piece_start = piece_end; } while (piece_start < old_env_end); // Can't use setenv() here, because it requires the allocator to be // initialized. // FIXME: instead of filtering DYLD_INSERT_LIBRARIES here, do it in // a separate function called after InitializeAllocator(). if (new_env_pos == new_env + env_name_len + 1) new_env = NULL; LeakyResetEnv(kDyldInsertLibraries, new_env); } #endif // SANITIZER_GO char **GetArgv() { return *_NSGetArgv(); } uptr FindAvailableMemoryRange(uptr shadow_size, uptr alignment, uptr left_padding) { typedef vm_region_submap_short_info_data_64_t RegionInfo; enum { kRegionInfoSize = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 }; // Start searching for available memory region past PAGEZERO, which is // 4KB on 32-bit and 4GB on 64-bit. mach_vm_address_t start_address = (SANITIZER_WORDSIZE == 32) ? 0x000000001000 : 0x000100000000; mach_vm_address_t address = start_address; mach_vm_address_t free_begin = start_address; kern_return_t kr = KERN_SUCCESS; while (kr == KERN_SUCCESS) { mach_vm_size_t vmsize = 0; natural_t depth = 0; RegionInfo vminfo; mach_msg_type_number_t count = kRegionInfoSize; kr = mach_vm_region_recurse(mach_task_self(), &address, &vmsize, &depth, (vm_region_info_t)&vminfo, &count); if (free_begin != address) { // We found a free region [free_begin..address-1]. uptr shadow_address = RoundUpTo((uptr)free_begin + left_padding, alignment); if (shadow_address + shadow_size < (uptr)address) { return shadow_address; } } // Move to the next region. address += vmsize; free_begin = address; } // We looked at all free regions and could not find one large enough. return 0; } // FIXME implement on this platform. void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size) { } } // namespace __sanitizer #endif // SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_suppressions.cc0000664000175000017500000001242012632073552032507 0ustar mwhudsonmwhudson//===-- sanitizer_suppressions.cc -----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Suppression parsing/matching code. // //===----------------------------------------------------------------------===// #include "sanitizer_suppressions.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_libc.h" #include "sanitizer_placement_new.h" namespace __sanitizer { SuppressionContext::SuppressionContext(const char *suppression_types[], int suppression_types_num) : suppression_types_(suppression_types), suppression_types_num_(suppression_types_num), suppressions_(1), can_parse_(true) { CHECK_LE(suppression_types_num_, kMaxSuppressionTypes); internal_memset(has_suppression_type_, 0, suppression_types_num_); } static bool GetPathAssumingFileIsRelativeToExec(const char *file_path, /*out*/char *new_file_path, uptr new_file_path_size) { InternalScopedString exec(kMaxPathLength); if (ReadBinaryNameCached(exec.data(), exec.size())) { const char *file_name_pos = StripModuleName(exec.data()); uptr path_to_exec_len = file_name_pos - exec.data(); internal_strncat(new_file_path, exec.data(), Min(path_to_exec_len, new_file_path_size - 1)); internal_strncat(new_file_path, file_path, new_file_path_size - internal_strlen(new_file_path) - 1); return true; } return false; } void SuppressionContext::ParseFromFile(const char *filename) { if (filename[0] == '\0') return; // If we cannot find the file, check if its location is relative to // the location of the executable. InternalScopedString new_file_path(kMaxPathLength); if (!FileExists(filename) && !IsAbsolutePath(filename) && GetPathAssumingFileIsRelativeToExec(filename, new_file_path.data(), new_file_path.size())) { filename = new_file_path.data(); } // Read the file. VPrintf(1, "%s: reading suppressions file at %s\n", SanitizerToolName, filename); char *file_contents; uptr buffer_size; uptr contents_size; if (!ReadFileToBuffer(filename, &file_contents, &buffer_size, &contents_size)) { Printf("%s: failed to read suppressions file '%s'\n", SanitizerToolName, filename); Die(); } Parse(file_contents); } bool SuppressionContext::Match(const char *str, const char *type, Suppression **s) { can_parse_ = false; if (!HasSuppressionType(type)) return false; for (uptr i = 0; i < suppressions_.size(); i++) { Suppression &cur = suppressions_[i]; if (0 == internal_strcmp(cur.type, type) && TemplateMatch(cur.templ, str)) { *s = &cur; return true; } } return false; } static const char *StripPrefix(const char *str, const char *prefix) { while (str && *str == *prefix) { str++; prefix++; } if (!*prefix) return str; return 0; } void SuppressionContext::Parse(const char *str) { // Context must not mutate once Match has been called. CHECK(can_parse_); const char *line = str; while (line) { while (line[0] == ' ' || line[0] == '\t') line++; const char *end = internal_strchr(line, '\n'); if (end == 0) end = line + internal_strlen(line); if (line != end && line[0] != '#') { const char *end2 = end; while (line != end2 && (end2[-1] == ' ' || end2[-1] == '\t' || end2[-1] == '\r')) end2--; int type; for (type = 0; type < suppression_types_num_; type++) { const char *next_char = StripPrefix(line, suppression_types_[type]); if (next_char && *next_char == ':') { line = ++next_char; break; } } if (type == suppression_types_num_) { Printf("%s: failed to parse suppressions\n", SanitizerToolName); Die(); } Suppression s; s.type = suppression_types_[type]; s.templ = (char*)InternalAlloc(end2 - line + 1); internal_memcpy(s.templ, line, end2 - line); s.templ[end2 - line] = 0; suppressions_.push_back(s); has_suppression_type_[type] = true; } if (end[0] == 0) break; line = end + 1; } } uptr SuppressionContext::SuppressionCount() const { return suppressions_.size(); } bool SuppressionContext::HasSuppressionType(const char *type) const { for (int i = 0; i < suppression_types_num_; i++) { if (0 == internal_strcmp(type, suppression_types_[i])) return has_suppression_type_[i]; } return false; } const Suppression *SuppressionContext::SuppressionAt(uptr i) const { CHECK_LT(i, suppressions_.size()); return &suppressions_[i]; } void SuppressionContext::GetMatched( InternalMmapVector *matched) { for (uptr i = 0; i < suppressions_.size(); i++) if (atomic_load_relaxed(&suppressions_[i].hit_count)) matched->push_back(&suppressions_[i]); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_bytemap.h0000664000175000017500000000553212743772761033316 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_bytemap.h ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif // Maps integers in rage [0, kSize) to u8 values. template class FlatByteMap { public: void TestOnlyInit() { internal_memset(map_, 0, sizeof(map_)); } void set(uptr idx, u8 val) { CHECK_LT(idx, kSize); CHECK_EQ(0U, map_[idx]); map_[idx] = val; } u8 operator[] (uptr idx) { CHECK_LT(idx, kSize); // FIXME: CHECK may be too expensive here. return map_[idx]; } private: u8 map_[kSize]; }; // TwoLevelByteMap maps integers in range [0, kSize1*kSize2) to u8 values. // It is implemented as a two-dimensional array: array of kSize1 pointers // to kSize2-byte arrays. The secondary arrays are mmaped on demand. // Each value is initially zero and can be set to something else only once. // Setting and getting values from multiple threads is safe w/o extra locking. template class TwoLevelByteMap { public: void TestOnlyInit() { internal_memset(map1_, 0, sizeof(map1_)); mu_.Init(); } void TestOnlyUnmap() { for (uptr i = 0; i < kSize1; i++) { u8 *p = Get(i); if (!p) continue; MapUnmapCallback().OnUnmap(reinterpret_cast(p), kSize2); UnmapOrDie(p, kSize2); } } uptr size() const { return kSize1 * kSize2; } uptr size1() const { return kSize1; } uptr size2() const { return kSize2; } void set(uptr idx, u8 val) { CHECK_LT(idx, kSize1 * kSize2); u8 *map2 = GetOrCreate(idx / kSize2); CHECK_EQ(0U, map2[idx % kSize2]); map2[idx % kSize2] = val; } u8 operator[] (uptr idx) const { CHECK_LT(idx, kSize1 * kSize2); u8 *map2 = Get(idx / kSize2); if (!map2) return 0; return map2[idx % kSize2]; } private: u8 *Get(uptr idx) const { CHECK_LT(idx, kSize1); return reinterpret_cast( atomic_load(&map1_[idx], memory_order_acquire)); } u8 *GetOrCreate(uptr idx) { u8 *res = Get(idx); if (!res) { SpinMutexLock l(&mu_); if (!(res = Get(idx))) { res = (u8*)MmapOrDie(kSize2, "TwoLevelByteMap"); MapUnmapCallback().OnMap(reinterpret_cast(res), kSize2); atomic_store(&map1_[idx], reinterpret_cast(res), memory_order_release); } } return res; } atomic_uintptr_t map1_[kSize1]; StaticSpinMutex mu_; }; golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_deadlock_detector1.cc0000664000175000017500000001310712720016321033442 0ustar mwhudsonmwhudson//===-- sanitizer_deadlock_detector1.cc -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Deadlock detector implementation based on NxN adjacency bit matrix. // //===----------------------------------------------------------------------===// #include "sanitizer_deadlock_detector_interface.h" #include "sanitizer_deadlock_detector.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_placement_new.h" #include "sanitizer_mutex.h" #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 1 namespace __sanitizer { typedef TwoLevelBitVector<> DDBV; // DeadlockDetector's bit vector. struct DDPhysicalThread { }; struct DDLogicalThread { u64 ctx; DeadlockDetectorTLS dd; DDReport rep; bool report_pending; }; struct DD : public DDetector { SpinMutex mtx; DeadlockDetector dd; DDFlags flags; explicit DD(const DDFlags *flags); DDPhysicalThread *CreatePhysicalThread() override; void DestroyPhysicalThread(DDPhysicalThread *pt) override; DDLogicalThread *CreateLogicalThread(u64 ctx) override; void DestroyLogicalThread(DDLogicalThread *lt) override; void MutexInit(DDCallback *cb, DDMutex *m) override; void MutexBeforeLock(DDCallback *cb, DDMutex *m, bool wlock) override; void MutexAfterLock(DDCallback *cb, DDMutex *m, bool wlock, bool trylock) override; void MutexBeforeUnlock(DDCallback *cb, DDMutex *m, bool wlock) override; void MutexDestroy(DDCallback *cb, DDMutex *m) override; DDReport *GetReport(DDCallback *cb) override; void MutexEnsureID(DDLogicalThread *lt, DDMutex *m); void ReportDeadlock(DDCallback *cb, DDMutex *m); }; DDetector *DDetector::Create(const DDFlags *flags) { (void)flags; void *mem = MmapOrDie(sizeof(DD), "deadlock detector"); return new(mem) DD(flags); } DD::DD(const DDFlags *flags) : flags(*flags) { dd.clear(); } DDPhysicalThread* DD::CreatePhysicalThread() { return nullptr; } void DD::DestroyPhysicalThread(DDPhysicalThread *pt) { } DDLogicalThread* DD::CreateLogicalThread(u64 ctx) { DDLogicalThread *lt = (DDLogicalThread*)InternalAlloc(sizeof(*lt)); lt->ctx = ctx; lt->dd.clear(); lt->report_pending = false; return lt; } void DD::DestroyLogicalThread(DDLogicalThread *lt) { lt->~DDLogicalThread(); InternalFree(lt); } void DD::MutexInit(DDCallback *cb, DDMutex *m) { m->id = 0; m->stk = cb->Unwind(); } void DD::MutexEnsureID(DDLogicalThread *lt, DDMutex *m) { if (!dd.nodeBelongsToCurrentEpoch(m->id)) m->id = dd.newNode(reinterpret_cast(m)); dd.ensureCurrentEpoch(<->dd); } void DD::MutexBeforeLock(DDCallback *cb, DDMutex *m, bool wlock) { DDLogicalThread *lt = cb->lt; if (lt->dd.empty()) return; // This will be the first lock held by lt. if (dd.hasAllEdges(<->dd, m->id)) return; // We already have all edges. SpinMutexLock lk(&mtx); MutexEnsureID(lt, m); if (dd.isHeld(<->dd, m->id)) return; // FIXME: allow this only for recursive locks. if (dd.onLockBefore(<->dd, m->id)) { // Actually add this edge now so that we have all the stack traces. dd.addEdges(<->dd, m->id, cb->Unwind(), cb->UniqueTid()); ReportDeadlock(cb, m); } } void DD::ReportDeadlock(DDCallback *cb, DDMutex *m) { DDLogicalThread *lt = cb->lt; uptr path[20]; uptr len = dd.findPathToLock(<->dd, m->id, path, ARRAY_SIZE(path)); if (len == 0U) { // A cycle of 20+ locks? Well, that's a bit odd... Printf("WARNING: too long mutex cycle found\n"); return; } CHECK_EQ(m->id, path[0]); lt->report_pending = true; len = Min(len, DDReport::kMaxLoopSize); DDReport *rep = <->rep; rep->n = len; for (uptr i = 0; i < len; i++) { uptr from = path[i]; uptr to = path[(i + 1) % len]; DDMutex *m0 = (DDMutex*)dd.getData(from); DDMutex *m1 = (DDMutex*)dd.getData(to); u32 stk_from = -1U, stk_to = -1U; int unique_tid = 0; dd.findEdge(from, to, &stk_from, &stk_to, &unique_tid); // Printf("Edge: %zd=>%zd: %u/%u T%d\n", from, to, stk_from, stk_to, // unique_tid); rep->loop[i].thr_ctx = unique_tid; rep->loop[i].mtx_ctx0 = m0->ctx; rep->loop[i].mtx_ctx1 = m1->ctx; rep->loop[i].stk[0] = stk_to; rep->loop[i].stk[1] = stk_from; } } void DD::MutexAfterLock(DDCallback *cb, DDMutex *m, bool wlock, bool trylock) { DDLogicalThread *lt = cb->lt; u32 stk = 0; if (flags.second_deadlock_stack) stk = cb->Unwind(); // Printf("T%p MutexLock: %zx stk %u\n", lt, m->id, stk); if (dd.onFirstLock(<->dd, m->id, stk)) return; if (dd.onLockFast(<->dd, m->id, stk)) return; SpinMutexLock lk(&mtx); MutexEnsureID(lt, m); if (wlock) // Only a recursive rlock may be held. CHECK(!dd.isHeld(<->dd, m->id)); if (!trylock) dd.addEdges(<->dd, m->id, stk ? stk : cb->Unwind(), cb->UniqueTid()); dd.onLockAfter(<->dd, m->id, stk); } void DD::MutexBeforeUnlock(DDCallback *cb, DDMutex *m, bool wlock) { // Printf("T%p MutexUnLock: %zx\n", cb->lt, m->id); dd.onUnlock(&cb->lt->dd, m->id); } void DD::MutexDestroy(DDCallback *cb, DDMutex *m) { if (!m->id) return; SpinMutexLock lk(&mtx); if (dd.nodeBelongsToCurrentEpoch(m->id)) dd.removeNode(m->id); m->id = 0; } DDReport *DD::GetReport(DDCallback *cb) { if (!cb->lt->report_pending) return nullptr; cb->lt->report_pending = false; return &cb->lt->rep; } } // namespace __sanitizer #endif // #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 1 golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_internal_defs.h0000664000175000017500000002617613004730632032417 0ustar mwhudsonmwhudson//===-- sanitizer_internal_defs.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer. // It contains macro used in run-time libraries code. //===----------------------------------------------------------------------===// #ifndef SANITIZER_DEFS_H #define SANITIZER_DEFS_H #include "sanitizer_platform.h" #ifndef SANITIZER_DEBUG # define SANITIZER_DEBUG 0 #endif // Only use SANITIZER_*ATTRIBUTE* before the function return type! #if SANITIZER_WINDOWS # define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport) // FIXME find out what we need on Windows, if anything. # define SANITIZER_WEAK_ATTRIBUTE #elif SANITIZER_GO # define SANITIZER_INTERFACE_ATTRIBUTE # define SANITIZER_WEAK_ATTRIBUTE #else # define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default"))) # define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak)) #endif #if (SANITIZER_LINUX || SANITIZER_WINDOWS) && !SANITIZER_GO # define SANITIZER_SUPPORTS_WEAK_HOOKS 1 #else # define SANITIZER_SUPPORTS_WEAK_HOOKS 0 #endif // We can use .preinit_array section on Linux to call sanitizer initialization // functions very early in the process startup (unless PIC macro is defined). // FIXME: do we have anything like this on Mac? #if SANITIZER_LINUX && !SANITIZER_ANDROID && !defined(PIC) # define SANITIZER_CAN_USE_PREINIT_ARRAY 1 #else # define SANITIZER_CAN_USE_PREINIT_ARRAY 0 #endif // GCC does not understand __has_feature #if !defined(__has_feature) # define __has_feature(x) 0 #endif // For portability reasons we do not include stddef.h, stdint.h or any other // system header, but we do need some basic types that are not defined // in a portable way by the language itself. namespace __sanitizer { #if defined(_WIN64) // 64-bit Windows uses LLP64 data model. typedef unsigned long long uptr; // NOLINT typedef signed long long sptr; // NOLINT #else typedef unsigned long uptr; // NOLINT typedef signed long sptr; // NOLINT #endif // defined(_WIN64) #if defined(__x86_64__) // Since x32 uses ILP32 data model in 64-bit hardware mode, we must use // 64-bit pointer to unwind stack frame. typedef unsigned long long uhwptr; // NOLINT #else typedef uptr uhwptr; // NOLINT #endif typedef unsigned char u8; typedef unsigned short u16; // NOLINT typedef unsigned int u32; typedef unsigned long long u64; // NOLINT typedef signed char s8; typedef signed short s16; // NOLINT typedef signed int s32; typedef signed long long s64; // NOLINT #if SANITIZER_WINDOWS // On Windows, files are HANDLE, which is a synonim of void*. // Use void* to avoid including everywhere. typedef void* fd_t; typedef unsigned error_t; #else typedef int fd_t; typedef int error_t; #endif typedef int pid_t; // WARNING: OFF_T may be different from OS type off_t, depending on the value of // _FILE_OFFSET_BITS. This definition of OFF_T matches the ABI of system calls // like pread and mmap, as opposed to pread64 and mmap64. // FreeBSD, Mac and Linux/x86-64 are special. #if SANITIZER_FREEBSD || SANITIZER_MAC || \ (SANITIZER_LINUX && defined(__x86_64__)) typedef u64 OFF_T; #else typedef uptr OFF_T; #endif typedef u64 OFF64_T; #if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC typedef uptr operator_new_size_type; #else # if defined(__s390__) && !defined(__s390x__) // Special case: 31-bit s390 has unsigned long as size_t. typedef unsigned long operator_new_size_type; # else typedef u32 operator_new_size_type; # endif #endif // ----------- ATTENTION ------------- // This header should NOT include any other headers to avoid portability issues. // Common defs. #define INLINE inline #define INTERFACE_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE #define SANITIZER_WEAK_DEFAULT_IMPL \ extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE #define SANITIZER_WEAK_CXX_DEFAULT_IMPL \ extern "C++" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE // Platform-specific defs. #if defined(_MSC_VER) # define ALWAYS_INLINE __forceinline // FIXME(timurrrr): do we need this on Windows? # define ALIAS(x) # define ALIGNED(x) __declspec(align(x)) # define FORMAT(f, a) # define NOINLINE __declspec(noinline) # define NORETURN __declspec(noreturn) # define THREADLOCAL __declspec(thread) # define LIKELY(x) (x) # define UNLIKELY(x) (x) # define PREFETCH(x) /* _mm_prefetch(x, _MM_HINT_NTA) */ (void)0 #else // _MSC_VER # define ALWAYS_INLINE inline __attribute__((always_inline)) # define ALIAS(x) __attribute__((alias(x))) // Please only use the ALIGNED macro before the type. // Using ALIGNED after the variable declaration is not portable! # define ALIGNED(x) __attribute__((aligned(x))) # define FORMAT(f, a) __attribute__((format(printf, f, a))) # define NOINLINE __attribute__((noinline)) # define NORETURN __attribute__((noreturn)) # define THREADLOCAL __thread # define LIKELY(x) __builtin_expect(!!(x), 1) # define UNLIKELY(x) __builtin_expect(!!(x), 0) # if defined(__i386__) || defined(__x86_64__) // __builtin_prefetch(x) generates prefetchnt0 on x86 # define PREFETCH(x) __asm__("prefetchnta (%0)" : : "r" (x)) # else # define PREFETCH(x) __builtin_prefetch(x) # endif #endif // _MSC_VER #if !defined(_MSC_VER) || defined(__clang__) # define UNUSED __attribute__((unused)) # define USED __attribute__((used)) #else # define UNUSED # define USED #endif #if !defined(_MSC_VER) || defined(__clang__) || MSC_PREREQ(1900) # define NOEXCEPT noexcept #else # define NOEXCEPT throw() #endif // Unaligned versions of basic types. typedef ALIGNED(1) u16 uu16; typedef ALIGNED(1) u32 uu32; typedef ALIGNED(1) u64 uu64; typedef ALIGNED(1) s16 us16; typedef ALIGNED(1) s32 us32; typedef ALIGNED(1) s64 us64; #if SANITIZER_WINDOWS } // namespace __sanitizer typedef unsigned long DWORD; // NOLINT namespace __sanitizer { typedef DWORD thread_return_t; # define THREAD_CALLING_CONV __stdcall #else // _WIN32 typedef void* thread_return_t; # define THREAD_CALLING_CONV #endif // _WIN32 typedef thread_return_t (THREAD_CALLING_CONV *thread_callback_t)(void* arg); // NOTE: Functions below must be defined in each run-time. void NORETURN Die(); // FIXME: No, this shouldn't be in the sanitizer interface. SANITIZER_INTERFACE_ATTRIBUTE void NORETURN CheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2); // Check macro #define RAW_CHECK_MSG(expr, msg) do { \ if (UNLIKELY(!(expr))) { \ RawWrite(msg); \ Die(); \ } \ } while (0) #define RAW_CHECK(expr) RAW_CHECK_MSG(expr, #expr) #define CHECK_IMPL(c1, op, c2) \ do { \ __sanitizer::u64 v1 = (u64)(c1); \ __sanitizer::u64 v2 = (u64)(c2); \ if (UNLIKELY(!(v1 op v2))) \ __sanitizer::CheckFailed(__FILE__, __LINE__, \ "(" #c1 ") " #op " (" #c2 ")", v1, v2); \ } while (false) \ /**/ #define CHECK(a) CHECK_IMPL((a), !=, 0) #define CHECK_EQ(a, b) CHECK_IMPL((a), ==, (b)) #define CHECK_NE(a, b) CHECK_IMPL((a), !=, (b)) #define CHECK_LT(a, b) CHECK_IMPL((a), <, (b)) #define CHECK_LE(a, b) CHECK_IMPL((a), <=, (b)) #define CHECK_GT(a, b) CHECK_IMPL((a), >, (b)) #define CHECK_GE(a, b) CHECK_IMPL((a), >=, (b)) #if SANITIZER_DEBUG #define DCHECK(a) CHECK(a) #define DCHECK_EQ(a, b) CHECK_EQ(a, b) #define DCHECK_NE(a, b) CHECK_NE(a, b) #define DCHECK_LT(a, b) CHECK_LT(a, b) #define DCHECK_LE(a, b) CHECK_LE(a, b) #define DCHECK_GT(a, b) CHECK_GT(a, b) #define DCHECK_GE(a, b) CHECK_GE(a, b) #else #define DCHECK(a) #define DCHECK_EQ(a, b) #define DCHECK_NE(a, b) #define DCHECK_LT(a, b) #define DCHECK_LE(a, b) #define DCHECK_GT(a, b) #define DCHECK_GE(a, b) #endif #define UNREACHABLE(msg) do { \ CHECK(0 && msg); \ Die(); \ } while (0) #define UNIMPLEMENTED() UNREACHABLE("unimplemented") #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__) #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) #define IMPL_PASTE(a, b) a##b #define IMPL_COMPILER_ASSERT(pred, line) \ typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1] // Limits for integral types. We have to redefine it in case we don't // have stdint.h (like in Visual Studio 9). #undef __INT64_C #undef __UINT64_C #if SANITIZER_WORDSIZE == 64 # define __INT64_C(c) c ## L # define __UINT64_C(c) c ## UL #else # define __INT64_C(c) c ## LL # define __UINT64_C(c) c ## ULL #endif // SANITIZER_WORDSIZE == 64 #undef INT32_MIN #define INT32_MIN (-2147483647-1) #undef INT32_MAX #define INT32_MAX (2147483647) #undef UINT32_MAX #define UINT32_MAX (4294967295U) #undef INT64_MIN #define INT64_MIN (-__INT64_C(9223372036854775807)-1) #undef INT64_MAX #define INT64_MAX (__INT64_C(9223372036854775807)) #undef UINT64_MAX #define UINT64_MAX (__UINT64_C(18446744073709551615)) enum LinkerInitialized { LINKER_INITIALIZED = 0 }; #if !defined(_MSC_VER) || defined(__clang__) # define GET_CALLER_PC() (uptr)__builtin_return_address(0) # define GET_CURRENT_FRAME() (uptr)__builtin_frame_address(0) inline void Trap() { __builtin_trap(); } #else extern "C" void* _ReturnAddress(void); extern "C" void* _AddressOfReturnAddress(void); # pragma intrinsic(_ReturnAddress) # pragma intrinsic(_AddressOfReturnAddress) # define GET_CALLER_PC() (uptr)_ReturnAddress() // CaptureStackBackTrace doesn't need to know BP on Windows. # define GET_CURRENT_FRAME() (((uptr)_AddressOfReturnAddress()) + sizeof(uptr)) extern "C" void __ud2(void); # pragma intrinsic(__ud2) inline void Trap() { __ud2(); } #endif #define HANDLE_EINTR(res, f) \ { \ int rverrno; \ do { \ res = (f); \ } while (internal_iserror(res, &rverrno) && rverrno == EINTR); \ } // Forces the compiler to generate a frame pointer in the function. #define ENABLE_FRAME_POINTER \ do { \ volatile uptr enable_fp; \ enable_fp = GET_CURRENT_FRAME(); \ (void)enable_fp; \ } while (0) } // namespace __sanitizer namespace __asan { using namespace __sanitizer; } // NOLINT namespace __dsan { using namespace __sanitizer; } // NOLINT namespace __dfsan { using namespace __sanitizer; } // NOLINT namespace __esan { using namespace __sanitizer; } // NOLINT namespace __lsan { using namespace __sanitizer; } // NOLINT namespace __msan { using namespace __sanitizer; } // NOLINT namespace __tsan { using namespace __sanitizer; } // NOLINT namespace __scudo { using namespace __sanitizer; } // NOLINT namespace __ubsan { using namespace __sanitizer; } // NOLINT namespace __xray { using namespace __sanitizer; } // NOLINT namespace __interception { using namespace __sanitizer; } // NOLINT #endif // SANITIZER_DEFS_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_limits_posix.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_limits_posix.0000664000175000017500000012343312775422666034076 0ustar mwhudsonmwhudson//===-- sanitizer_platform_limits_posix.h ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer common code. // // Sizes and layouts of platform-specific POSIX data structures. //===----------------------------------------------------------------------===// #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H #define SANITIZER_PLATFORM_LIMITS_POSIX_H #include "sanitizer_internal_defs.h" #include "sanitizer_platform.h" #if SANITIZER_FREEBSD // FreeBSD's dlopen() returns a pointer to an Obj_Entry structure that // incorporates the map structure. # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \ ((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 544))) #else # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle)) #endif // !SANITIZER_FREEBSD namespace __sanitizer { extern unsigned struct_utsname_sz; extern unsigned struct_stat_sz; #if !SANITIZER_FREEBSD && !SANITIZER_IOS extern unsigned struct_stat64_sz; #endif extern unsigned struct_rusage_sz; extern unsigned siginfo_t_sz; extern unsigned struct_itimerval_sz; extern unsigned pthread_t_sz; extern unsigned pthread_cond_t_sz; extern unsigned pid_t_sz; extern unsigned timeval_sz; extern unsigned uid_t_sz; extern unsigned gid_t_sz; extern unsigned mbstate_t_sz; extern unsigned struct_timezone_sz; extern unsigned struct_tms_sz; extern unsigned struct_itimerspec_sz; extern unsigned struct_sigevent_sz; extern unsigned struct_sched_param_sz; extern unsigned struct_statfs64_sz; #if !SANITIZER_ANDROID extern unsigned struct_statfs_sz; extern unsigned struct_sockaddr_sz; extern unsigned ucontext_t_sz; #endif // !SANITIZER_ANDROID #if SANITIZER_LINUX #if defined(__x86_64__) const unsigned struct_kernel_stat_sz = 144; const unsigned struct_kernel_stat64_sz = 0; #elif defined(__i386__) const unsigned struct_kernel_stat_sz = 64; const unsigned struct_kernel_stat64_sz = 96; #elif defined(__arm__) const unsigned struct_kernel_stat_sz = 64; const unsigned struct_kernel_stat64_sz = 104; #elif defined(__aarch64__) const unsigned struct_kernel_stat_sz = 128; const unsigned struct_kernel_stat64_sz = 104; #elif defined(__powerpc__) && !defined(__powerpc64__) const unsigned struct_kernel_stat_sz = 72; const unsigned struct_kernel_stat64_sz = 104; #elif defined(__powerpc64__) const unsigned struct_kernel_stat_sz = 144; const unsigned struct_kernel_stat64_sz = 104; #elif defined(__mips__) const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID ? FIRST_32_SECOND_64(104, 128) : FIRST_32_SECOND_64(144, 216); const unsigned struct_kernel_stat64_sz = 104; #elif defined(__s390__) && !defined(__s390x__) const unsigned struct_kernel_stat_sz = 64; const unsigned struct_kernel_stat64_sz = 104; #elif defined(__s390x__) const unsigned struct_kernel_stat_sz = 144; const unsigned struct_kernel_stat64_sz = 0; #endif struct __sanitizer_perf_event_attr { unsigned type; unsigned size; // More fields that vary with the kernel version. }; extern unsigned struct_epoll_event_sz; extern unsigned struct_sysinfo_sz; extern unsigned __user_cap_header_struct_sz; extern unsigned __user_cap_data_struct_sz; extern unsigned struct_new_utsname_sz; extern unsigned struct_old_utsname_sz; extern unsigned struct_oldold_utsname_sz; const unsigned struct_kexec_segment_sz = 4 * sizeof(unsigned long); #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD #if defined(__powerpc64__) || defined(__s390__) const unsigned struct___old_kernel_stat_sz = 0; #else const unsigned struct___old_kernel_stat_sz = 32; #endif extern unsigned struct_rlimit_sz; extern unsigned struct_utimbuf_sz; extern unsigned struct_timespec_sz; struct __sanitizer_iocb { u64 aio_data; u32 aio_key_or_aio_reserved1; // Simply crazy. u32 aio_reserved1_or_aio_key; // Luckily, we don't need these. u16 aio_lio_opcode; s16 aio_reqprio; u32 aio_fildes; u64 aio_buf; u64 aio_nbytes; s64 aio_offset; u64 aio_reserved2; u64 aio_reserved3; }; struct __sanitizer_io_event { u64 data; u64 obj; u64 res; u64 res2; }; const unsigned iocb_cmd_pread = 0; const unsigned iocb_cmd_pwrite = 1; const unsigned iocb_cmd_preadv = 7; const unsigned iocb_cmd_pwritev = 8; struct __sanitizer___sysctl_args { int *name; int nlen; void *oldval; uptr *oldlenp; void *newval; uptr newlen; unsigned long ___unused[4]; }; const unsigned old_sigset_t_sz = sizeof(unsigned long); struct __sanitizer_sem_t { #if SANITIZER_ANDROID && defined(_LP64) int data[4]; #elif SANITIZER_ANDROID && !defined(_LP64) int data; #elif SANITIZER_LINUX uptr data[4]; #elif SANITIZER_FREEBSD u32 data[4]; #endif }; #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_ANDROID struct __sanitizer_mallinfo { uptr v[10]; }; #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID struct __sanitizer_mallinfo { int v[10]; }; extern unsigned struct_ustat_sz; extern unsigned struct_rlimit64_sz; extern unsigned struct_statvfs64_sz; struct __sanitizer_ipc_perm { int __key; int uid; int gid; int cuid; int cgid; #ifdef __powerpc__ unsigned mode; unsigned __seq; u64 __unused1; u64 __unused2; #elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) unsigned int mode; unsigned short __seq; unsigned short __pad1; unsigned long __unused1; unsigned long __unused2; #else unsigned short mode; unsigned short __pad1; unsigned short __seq; unsigned short __pad2; #if defined(__x86_64__) && !defined(_LP64) u64 __unused1; u64 __unused2; #else unsigned long __unused1; unsigned long __unused2; #endif #endif }; struct __sanitizer_shmid_ds { __sanitizer_ipc_perm shm_perm; #ifndef __powerpc__ uptr shm_segsz; #elif !defined(__powerpc64__) uptr __unused0; #endif #if defined(__x86_64__) && !defined(_LP64) u64 shm_atime; u64 shm_dtime; u64 shm_ctime; #else uptr shm_atime; #if !defined(_LP64) && !defined(__mips__) uptr __unused1; #endif uptr shm_dtime; #if !defined(_LP64) && !defined(__mips__) uptr __unused2; #endif uptr shm_ctime; #if !defined(_LP64) && !defined(__mips__) uptr __unused3; #endif #endif #ifdef __powerpc__ uptr shm_segsz; #endif int shm_cpid; int shm_lpid; #if defined(__x86_64__) && !defined(_LP64) u64 shm_nattch; u64 __unused4; u64 __unused5; #else uptr shm_nattch; uptr __unused4; uptr __unused5; #endif }; #elif SANITIZER_FREEBSD struct __sanitizer_ipc_perm { unsigned int cuid; unsigned int cgid; unsigned int uid; unsigned int gid; unsigned short mode; unsigned short seq; long key; }; struct __sanitizer_shmid_ds { __sanitizer_ipc_perm shm_perm; unsigned long shm_segsz; unsigned int shm_lpid; unsigned int shm_cpid; int shm_nattch; unsigned long shm_atime; unsigned long shm_dtime; unsigned long shm_ctime; }; #endif #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID extern unsigned struct_msqid_ds_sz; extern unsigned struct_mq_attr_sz; extern unsigned struct_timex_sz; extern unsigned struct_statvfs_sz; #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID struct __sanitizer_iovec { void *iov_base; uptr iov_len; }; #if !SANITIZER_ANDROID struct __sanitizer_ifaddrs { struct __sanitizer_ifaddrs *ifa_next; char *ifa_name; unsigned int ifa_flags; void *ifa_addr; // (struct sockaddr *) void *ifa_netmask; // (struct sockaddr *) // This is a union on Linux. # ifdef ifa_dstaddr # undef ifa_dstaddr # endif void *ifa_dstaddr; // (struct sockaddr *) void *ifa_data; }; #endif // !SANITIZER_ANDROID #if SANITIZER_MAC typedef unsigned long __sanitizer_pthread_key_t; #else typedef unsigned __sanitizer_pthread_key_t; #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID struct __sanitizer_XDR { int x_op; void *x_ops; uptr x_public; uptr x_private; uptr x_base; unsigned x_handy; }; const int __sanitizer_XDR_ENCODE = 0; const int __sanitizer_XDR_DECODE = 1; const int __sanitizer_XDR_FREE = 2; #endif struct __sanitizer_passwd { char *pw_name; char *pw_passwd; int pw_uid; int pw_gid; #if SANITIZER_MAC || SANITIZER_FREEBSD long pw_change; char *pw_class; #endif #if !(SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32)) char *pw_gecos; #endif char *pw_dir; char *pw_shell; #if SANITIZER_MAC || SANITIZER_FREEBSD long pw_expire; #endif #if SANITIZER_FREEBSD int pw_fields; #endif }; struct __sanitizer_group { char *gr_name; char *gr_passwd; int gr_gid; char **gr_mem; }; #if defined(__x86_64__) && !defined(_LP64) typedef long long __sanitizer_time_t; #else typedef long __sanitizer_time_t; #endif struct __sanitizer_timeb { __sanitizer_time_t time; unsigned short millitm; short timezone; short dstflag; }; struct __sanitizer_ether_addr { u8 octet[6]; }; struct __sanitizer_tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; const char *tm_zone; }; #if SANITIZER_LINUX struct __sanitizer_mntent { char *mnt_fsname; char *mnt_dir; char *mnt_type; char *mnt_opts; int mnt_freq; int mnt_passno; }; #endif #if SANITIZER_MAC || SANITIZER_FREEBSD struct __sanitizer_msghdr { void *msg_name; unsigned msg_namelen; struct __sanitizer_iovec *msg_iov; unsigned msg_iovlen; void *msg_control; unsigned msg_controllen; int msg_flags; }; struct __sanitizer_cmsghdr { unsigned cmsg_len; int cmsg_level; int cmsg_type; }; #else struct __sanitizer_msghdr { void *msg_name; unsigned msg_namelen; struct __sanitizer_iovec *msg_iov; uptr msg_iovlen; void *msg_control; uptr msg_controllen; int msg_flags; }; struct __sanitizer_cmsghdr { uptr cmsg_len; int cmsg_level; int cmsg_type; }; #endif #if SANITIZER_MAC struct __sanitizer_dirent { unsigned long long d_ino; unsigned long long d_seekoff; unsigned short d_reclen; // more fields that we don't care about }; #elif SANITIZER_FREEBSD struct __sanitizer_dirent { unsigned int d_fileno; unsigned short d_reclen; // more fields that we don't care about }; #elif SANITIZER_ANDROID || defined(__x86_64__) struct __sanitizer_dirent { unsigned long long d_ino; unsigned long long d_off; unsigned short d_reclen; // more fields that we don't care about }; #else struct __sanitizer_dirent { uptr d_ino; uptr d_off; unsigned short d_reclen; // more fields that we don't care about }; #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID struct __sanitizer_dirent64 { unsigned long long d_ino; unsigned long long d_off; unsigned short d_reclen; // more fields that we don't care about }; #endif // 'clock_t' is 32 bits wide on x64 FreeBSD #if SANITIZER_FREEBSD typedef int __sanitizer_clock_t; #elif defined(__x86_64__) && !defined(_LP64) typedef long long __sanitizer_clock_t; #else typedef long __sanitizer_clock_t; #endif #if SANITIZER_LINUX typedef int __sanitizer_clockid_t; #endif #if SANITIZER_LINUX || SANITIZER_FREEBSD #if defined(_LP64) || defined(__x86_64__) || defined(__powerpc__)\ || defined(__mips__) typedef unsigned __sanitizer___kernel_uid_t; typedef unsigned __sanitizer___kernel_gid_t; #else typedef unsigned short __sanitizer___kernel_uid_t; typedef unsigned short __sanitizer___kernel_gid_t; #endif #if defined(__x86_64__) && !defined(_LP64) typedef long long __sanitizer___kernel_off_t; #else typedef long __sanitizer___kernel_off_t; #endif #if defined(__powerpc__) || defined(__mips__) typedef unsigned int __sanitizer___kernel_old_uid_t; typedef unsigned int __sanitizer___kernel_old_gid_t; #else typedef unsigned short __sanitizer___kernel_old_uid_t; typedef unsigned short __sanitizer___kernel_old_gid_t; #endif typedef long long __sanitizer___kernel_loff_t; typedef struct { unsigned long fds_bits[1024 / (8 * sizeof(long))]; } __sanitizer___kernel_fd_set; #endif // This thing depends on the platform. We are only interested in the upper // limit. Verified with a compiler assert in .cc. const int pthread_attr_t_max_sz = 128; union __sanitizer_pthread_attr_t { char size[pthread_attr_t_max_sz]; // NOLINT void *align; }; #if SANITIZER_ANDROID # if SANITIZER_MIPS typedef unsigned long __sanitizer_sigset_t[16/sizeof(unsigned long)]; # else typedef unsigned long __sanitizer_sigset_t; # endif #elif SANITIZER_MAC typedef unsigned __sanitizer_sigset_t; #elif SANITIZER_LINUX struct __sanitizer_sigset_t { // The size is determined by looking at sizeof of real sigset_t on linux. uptr val[128 / sizeof(uptr)]; }; #elif SANITIZER_FREEBSD struct __sanitizer_sigset_t { // uint32_t * 4 unsigned int __bits[4]; }; #endif // Linux system headers define the 'sa_handler' and 'sa_sigaction' macros. #if SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) struct __sanitizer_sigaction { unsigned sa_flags; union { void (*sigaction)(int sig, void *siginfo, void *uctx); void (*handler)(int sig); }; __sanitizer_sigset_t sa_mask; void (*sa_restorer)(); }; #elif SANITIZER_ANDROID && SANITIZER_MIPS32 // check this before WORDSIZE == 32 struct __sanitizer_sigaction { unsigned sa_flags; union { void (*sigaction)(int sig, void *siginfo, void *uctx); void (*handler)(int sig); }; __sanitizer_sigset_t sa_mask; }; #elif SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32) struct __sanitizer_sigaction { union { void (*sigaction)(int sig, void *siginfo, void *uctx); void (*handler)(int sig); }; __sanitizer_sigset_t sa_mask; uptr sa_flags; void (*sa_restorer)(); }; #else // !SANITIZER_ANDROID struct __sanitizer_sigaction { #if defined(__mips__) && !SANITIZER_FREEBSD unsigned int sa_flags; #endif union { void (*sigaction)(int sig, void *siginfo, void *uctx); void (*handler)(int sig); }; #if SANITIZER_FREEBSD int sa_flags; __sanitizer_sigset_t sa_mask; #else #if defined(__s390x__) int sa_resv; #else __sanitizer_sigset_t sa_mask; #endif #ifndef __mips__ int sa_flags; #endif #endif #if SANITIZER_LINUX void (*sa_restorer)(); #endif #if defined(__mips__) && (SANITIZER_WORDSIZE == 32) int sa_resv[1]; #endif #if defined(__s390x__) __sanitizer_sigset_t sa_mask; #endif }; #endif // !SANITIZER_ANDROID #if SANITIZER_FREEBSD typedef __sanitizer_sigset_t __sanitizer_kernel_sigset_t; #elif defined(__mips__) struct __sanitizer_kernel_sigset_t { uptr sig[2]; }; #else struct __sanitizer_kernel_sigset_t { u8 sig[8]; }; #endif // Linux system headers define the 'sa_handler' and 'sa_sigaction' macros. #if SANITIZER_MIPS struct __sanitizer_kernel_sigaction_t { unsigned int sa_flags; union { void (*handler)(int signo); void (*sigaction)(int signo, void *info, void *ctx); }; __sanitizer_kernel_sigset_t sa_mask; void (*sa_restorer)(void); }; #else struct __sanitizer_kernel_sigaction_t { union { void (*handler)(int signo); void (*sigaction)(int signo, void *info, void *ctx); }; unsigned long sa_flags; void (*sa_restorer)(void); __sanitizer_kernel_sigset_t sa_mask; }; #endif extern uptr sig_ign; extern uptr sig_dfl; extern uptr sa_siginfo; #if SANITIZER_LINUX extern int e_tabsz; #endif extern int af_inet; extern int af_inet6; uptr __sanitizer_in_addr_sz(int af); #if SANITIZER_LINUX || SANITIZER_FREEBSD struct __sanitizer_dl_phdr_info { uptr dlpi_addr; const char *dlpi_name; const void *dlpi_phdr; short dlpi_phnum; }; extern unsigned struct_ElfW_Phdr_sz; #endif struct __sanitizer_addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; #if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD unsigned ai_addrlen; char *ai_canonname; void *ai_addr; #else // LINUX unsigned ai_addrlen; void *ai_addr; char *ai_canonname; #endif struct __sanitizer_addrinfo *ai_next; }; struct __sanitizer_hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; struct __sanitizer_pollfd { int fd; short events; short revents; }; #if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD typedef unsigned __sanitizer_nfds_t; #else typedef unsigned long __sanitizer_nfds_t; #endif #if !SANITIZER_ANDROID # if SANITIZER_LINUX struct __sanitizer_glob_t { uptr gl_pathc; char **gl_pathv; uptr gl_offs; int gl_flags; void (*gl_closedir)(void *dirp); void *(*gl_readdir)(void *dirp); void *(*gl_opendir)(const char *); int (*gl_lstat)(const char *, void *); int (*gl_stat)(const char *, void *); }; # elif SANITIZER_FREEBSD struct __sanitizer_glob_t { uptr gl_pathc; uptr gl_matchc; uptr gl_offs; int gl_flags; char **gl_pathv; int (*gl_errfunc)(const char*, int); void (*gl_closedir)(void *dirp); struct dirent *(*gl_readdir)(void *dirp); void *(*gl_opendir)(const char*); int (*gl_lstat)(const char*, void* /* struct stat* */); int (*gl_stat)(const char*, void* /* struct stat* */); }; # endif // SANITIZER_FREEBSD # if SANITIZER_LINUX || SANITIZER_FREEBSD extern int glob_nomatch; extern int glob_altdirfunc; # endif #endif // !SANITIZER_ANDROID extern unsigned path_max; struct __sanitizer_wordexp_t { uptr we_wordc; char **we_wordv; uptr we_offs; #if SANITIZER_FREEBSD char *we_strings; uptr we_nbytes; #endif }; #if SANITIZER_LINUX && !SANITIZER_ANDROID struct __sanitizer_FILE { int _flags; char *_IO_read_ptr; char *_IO_read_end; char *_IO_read_base; char *_IO_write_base; char *_IO_write_ptr; char *_IO_write_end; char *_IO_buf_base; char *_IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; void *_markers; __sanitizer_FILE *_chain; int _fileno; }; # define SANITIZER_HAS_STRUCT_FILE 1 #else typedef void __sanitizer_FILE; # define SANITIZER_HAS_STRUCT_FILE 0 #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID && \ (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \ defined(__s390__)) extern unsigned struct_user_regs_struct_sz; extern unsigned struct_user_fpregs_struct_sz; extern unsigned struct_user_fpxregs_struct_sz; extern unsigned struct_user_vfpregs_struct_sz; extern int ptrace_peektext; extern int ptrace_peekdata; extern int ptrace_peekuser; extern int ptrace_getregs; extern int ptrace_setregs; extern int ptrace_getfpregs; extern int ptrace_setfpregs; extern int ptrace_getfpxregs; extern int ptrace_setfpxregs; extern int ptrace_getvfpregs; extern int ptrace_setvfpregs; extern int ptrace_getsiginfo; extern int ptrace_setsiginfo; extern int ptrace_getregset; extern int ptrace_setregset; extern int ptrace_geteventmsg; #endif #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID extern unsigned struct_shminfo_sz; extern unsigned struct_shm_info_sz; extern int shmctl_ipc_stat; extern int shmctl_ipc_info; extern int shmctl_shm_info; extern int shmctl_shm_stat; #endif extern int map_fixed; // ioctl arguments struct __sanitizer_ifconf { int ifc_len; union { void *ifcu_req; } ifc_ifcu; #if SANITIZER_MAC } __attribute__((packed)); #else }; #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID struct __sanitizer__obstack_chunk { char *limit; struct __sanitizer__obstack_chunk *prev; }; struct __sanitizer_obstack { long chunk_size; struct __sanitizer__obstack_chunk *chunk; char *object_base; char *next_free; uptr more_fields[7]; }; typedef uptr (*__sanitizer_cookie_io_read)(void *cookie, char *buf, uptr size); typedef uptr (*__sanitizer_cookie_io_write)(void *cookie, const char *buf, uptr size); typedef int (*__sanitizer_cookie_io_seek)(void *cookie, u64 *offset, int whence); typedef int (*__sanitizer_cookie_io_close)(void *cookie); struct __sanitizer_cookie_io_functions_t { __sanitizer_cookie_io_read read; __sanitizer_cookie_io_write write; __sanitizer_cookie_io_seek seek; __sanitizer_cookie_io_close close; }; #endif #define IOC_NRBITS 8 #define IOC_TYPEBITS 8 #if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) #define IOC_SIZEBITS 13 #define IOC_DIRBITS 3 #define IOC_NONE 1U #define IOC_WRITE 4U #define IOC_READ 2U #else #define IOC_SIZEBITS 14 #define IOC_DIRBITS 2 #define IOC_NONE 0U #define IOC_WRITE 1U #define IOC_READ 2U #endif #define IOC_NRMASK ((1 << IOC_NRBITS) - 1) #define IOC_TYPEMASK ((1 << IOC_TYPEBITS) - 1) #define IOC_SIZEMASK ((1 << IOC_SIZEBITS) - 1) #if defined(IOC_DIRMASK) #undef IOC_DIRMASK #endif #define IOC_DIRMASK ((1 << IOC_DIRBITS) - 1) #define IOC_NRSHIFT 0 #define IOC_TYPESHIFT (IOC_NRSHIFT + IOC_NRBITS) #define IOC_SIZESHIFT (IOC_TYPESHIFT + IOC_TYPEBITS) #define IOC_DIRSHIFT (IOC_SIZESHIFT + IOC_SIZEBITS) #define EVIOC_EV_MAX 0x1f #define EVIOC_ABS_MAX 0x3f #define IOC_DIR(nr) (((nr) >> IOC_DIRSHIFT) & IOC_DIRMASK) #define IOC_TYPE(nr) (((nr) >> IOC_TYPESHIFT) & IOC_TYPEMASK) #define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK) #define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK) extern unsigned struct_ifreq_sz; extern unsigned struct_termios_sz; extern unsigned struct_winsize_sz; #if SANITIZER_LINUX extern unsigned struct_arpreq_sz; extern unsigned struct_cdrom_msf_sz; extern unsigned struct_cdrom_multisession_sz; extern unsigned struct_cdrom_read_audio_sz; extern unsigned struct_cdrom_subchnl_sz; extern unsigned struct_cdrom_ti_sz; extern unsigned struct_cdrom_tocentry_sz; extern unsigned struct_cdrom_tochdr_sz; extern unsigned struct_cdrom_volctrl_sz; extern unsigned struct_ff_effect_sz; extern unsigned struct_floppy_drive_params_sz; extern unsigned struct_floppy_drive_struct_sz; extern unsigned struct_floppy_fdc_state_sz; extern unsigned struct_floppy_max_errors_sz; extern unsigned struct_floppy_raw_cmd_sz; extern unsigned struct_floppy_struct_sz; extern unsigned struct_floppy_write_errors_sz; extern unsigned struct_format_descr_sz; extern unsigned struct_hd_driveid_sz; extern unsigned struct_hd_geometry_sz; extern unsigned struct_input_absinfo_sz; extern unsigned struct_input_id_sz; extern unsigned struct_mtpos_sz; extern unsigned struct_termio_sz; extern unsigned struct_vt_consize_sz; extern unsigned struct_vt_sizes_sz; extern unsigned struct_vt_stat_sz; #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD extern unsigned struct_copr_buffer_sz; extern unsigned struct_copr_debug_buf_sz; extern unsigned struct_copr_msg_sz; extern unsigned struct_midi_info_sz; extern unsigned struct_mtget_sz; extern unsigned struct_mtop_sz; extern unsigned struct_rtentry_sz; extern unsigned struct_sbi_instrument_sz; extern unsigned struct_seq_event_rec_sz; extern unsigned struct_synth_info_sz; extern unsigned struct_vt_mode_sz; #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_LINUX && !SANITIZER_ANDROID extern unsigned struct_ax25_parms_struct_sz; extern unsigned struct_cyclades_monitor_sz; extern unsigned struct_input_keymap_entry_sz; extern unsigned struct_ipx_config_data_sz; extern unsigned struct_kbdiacrs_sz; extern unsigned struct_kbentry_sz; extern unsigned struct_kbkeycode_sz; extern unsigned struct_kbsentry_sz; extern unsigned struct_mtconfiginfo_sz; extern unsigned struct_nr_parms_struct_sz; extern unsigned struct_scc_modem_sz; extern unsigned struct_scc_stat_sz; extern unsigned struct_serial_multiport_struct_sz; extern unsigned struct_serial_struct_sz; extern unsigned struct_sockaddr_ax25_sz; extern unsigned struct_unimapdesc_sz; extern unsigned struct_unimapinit_sz; #endif // SANITIZER_LINUX && !SANITIZER_ANDROID #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID extern unsigned struct_audio_buf_info_sz; extern unsigned struct_ppp_stats_sz; #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID #if !SANITIZER_ANDROID && !SANITIZER_MAC extern unsigned struct_sioc_sg_req_sz; extern unsigned struct_sioc_vif_req_sz; #endif // ioctl request identifiers // A special value to mark ioctls that are not present on the target platform, // when it can not be determined without including any system headers. extern const unsigned IOCTL_NOT_PRESENT; extern unsigned IOCTL_FIOASYNC; extern unsigned IOCTL_FIOCLEX; extern unsigned IOCTL_FIOGETOWN; extern unsigned IOCTL_FIONBIO; extern unsigned IOCTL_FIONCLEX; extern unsigned IOCTL_FIOSETOWN; extern unsigned IOCTL_SIOCADDMULTI; extern unsigned IOCTL_SIOCATMARK; extern unsigned IOCTL_SIOCDELMULTI; extern unsigned IOCTL_SIOCGIFADDR; extern unsigned IOCTL_SIOCGIFBRDADDR; extern unsigned IOCTL_SIOCGIFCONF; extern unsigned IOCTL_SIOCGIFDSTADDR; extern unsigned IOCTL_SIOCGIFFLAGS; extern unsigned IOCTL_SIOCGIFMETRIC; extern unsigned IOCTL_SIOCGIFMTU; extern unsigned IOCTL_SIOCGIFNETMASK; extern unsigned IOCTL_SIOCGPGRP; extern unsigned IOCTL_SIOCSIFADDR; extern unsigned IOCTL_SIOCSIFBRDADDR; extern unsigned IOCTL_SIOCSIFDSTADDR; extern unsigned IOCTL_SIOCSIFFLAGS; extern unsigned IOCTL_SIOCSIFMETRIC; extern unsigned IOCTL_SIOCSIFMTU; extern unsigned IOCTL_SIOCSIFNETMASK; extern unsigned IOCTL_SIOCSPGRP; extern unsigned IOCTL_TIOCCONS; extern unsigned IOCTL_TIOCEXCL; extern unsigned IOCTL_TIOCGETD; extern unsigned IOCTL_TIOCGPGRP; extern unsigned IOCTL_TIOCGWINSZ; extern unsigned IOCTL_TIOCMBIC; extern unsigned IOCTL_TIOCMBIS; extern unsigned IOCTL_TIOCMGET; extern unsigned IOCTL_TIOCMSET; extern unsigned IOCTL_TIOCNOTTY; extern unsigned IOCTL_TIOCNXCL; extern unsigned IOCTL_TIOCOUTQ; extern unsigned IOCTL_TIOCPKT; extern unsigned IOCTL_TIOCSCTTY; extern unsigned IOCTL_TIOCSETD; extern unsigned IOCTL_TIOCSPGRP; extern unsigned IOCTL_TIOCSTI; extern unsigned IOCTL_TIOCSWINSZ; #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID extern unsigned IOCTL_SIOCGETSGCNT; extern unsigned IOCTL_SIOCGETVIFCNT; #endif #if SANITIZER_LINUX extern unsigned IOCTL_EVIOCGABS; extern unsigned IOCTL_EVIOCGBIT; extern unsigned IOCTL_EVIOCGEFFECTS; extern unsigned IOCTL_EVIOCGID; extern unsigned IOCTL_EVIOCGKEY; extern unsigned IOCTL_EVIOCGKEYCODE; extern unsigned IOCTL_EVIOCGLED; extern unsigned IOCTL_EVIOCGNAME; extern unsigned IOCTL_EVIOCGPHYS; extern unsigned IOCTL_EVIOCGRAB; extern unsigned IOCTL_EVIOCGREP; extern unsigned IOCTL_EVIOCGSND; extern unsigned IOCTL_EVIOCGSW; extern unsigned IOCTL_EVIOCGUNIQ; extern unsigned IOCTL_EVIOCGVERSION; extern unsigned IOCTL_EVIOCRMFF; extern unsigned IOCTL_EVIOCSABS; extern unsigned IOCTL_EVIOCSFF; extern unsigned IOCTL_EVIOCSKEYCODE; extern unsigned IOCTL_EVIOCSREP; extern unsigned IOCTL_BLKFLSBUF; extern unsigned IOCTL_BLKGETSIZE; extern unsigned IOCTL_BLKRAGET; extern unsigned IOCTL_BLKRASET; extern unsigned IOCTL_BLKROGET; extern unsigned IOCTL_BLKROSET; extern unsigned IOCTL_BLKRRPART; extern unsigned IOCTL_CDROMAUDIOBUFSIZ; extern unsigned IOCTL_CDROMEJECT; extern unsigned IOCTL_CDROMEJECT_SW; extern unsigned IOCTL_CDROMMULTISESSION; extern unsigned IOCTL_CDROMPAUSE; extern unsigned IOCTL_CDROMPLAYMSF; extern unsigned IOCTL_CDROMPLAYTRKIND; extern unsigned IOCTL_CDROMREADAUDIO; extern unsigned IOCTL_CDROMREADCOOKED; extern unsigned IOCTL_CDROMREADMODE1; extern unsigned IOCTL_CDROMREADMODE2; extern unsigned IOCTL_CDROMREADRAW; extern unsigned IOCTL_CDROMREADTOCENTRY; extern unsigned IOCTL_CDROMREADTOCHDR; extern unsigned IOCTL_CDROMRESET; extern unsigned IOCTL_CDROMRESUME; extern unsigned IOCTL_CDROMSEEK; extern unsigned IOCTL_CDROMSTART; extern unsigned IOCTL_CDROMSTOP; extern unsigned IOCTL_CDROMSUBCHNL; extern unsigned IOCTL_CDROMVOLCTRL; extern unsigned IOCTL_CDROMVOLREAD; extern unsigned IOCTL_CDROM_GET_UPC; extern unsigned IOCTL_FDCLRPRM; extern unsigned IOCTL_FDDEFPRM; extern unsigned IOCTL_FDFLUSH; extern unsigned IOCTL_FDFMTBEG; extern unsigned IOCTL_FDFMTEND; extern unsigned IOCTL_FDFMTTRK; extern unsigned IOCTL_FDGETDRVPRM; extern unsigned IOCTL_FDGETDRVSTAT; extern unsigned IOCTL_FDGETDRVTYP; extern unsigned IOCTL_FDGETFDCSTAT; extern unsigned IOCTL_FDGETMAXERRS; extern unsigned IOCTL_FDGETPRM; extern unsigned IOCTL_FDMSGOFF; extern unsigned IOCTL_FDMSGON; extern unsigned IOCTL_FDPOLLDRVSTAT; extern unsigned IOCTL_FDRAWCMD; extern unsigned IOCTL_FDRESET; extern unsigned IOCTL_FDSETDRVPRM; extern unsigned IOCTL_FDSETEMSGTRESH; extern unsigned IOCTL_FDSETMAXERRS; extern unsigned IOCTL_FDSETPRM; extern unsigned IOCTL_FDTWADDLE; extern unsigned IOCTL_FDWERRORCLR; extern unsigned IOCTL_FDWERRORGET; extern unsigned IOCTL_HDIO_DRIVE_CMD; extern unsigned IOCTL_HDIO_GETGEO; extern unsigned IOCTL_HDIO_GET_32BIT; extern unsigned IOCTL_HDIO_GET_DMA; extern unsigned IOCTL_HDIO_GET_IDENTITY; extern unsigned IOCTL_HDIO_GET_KEEPSETTINGS; extern unsigned IOCTL_HDIO_GET_MULTCOUNT; extern unsigned IOCTL_HDIO_GET_NOWERR; extern unsigned IOCTL_HDIO_GET_UNMASKINTR; extern unsigned IOCTL_HDIO_SET_32BIT; extern unsigned IOCTL_HDIO_SET_DMA; extern unsigned IOCTL_HDIO_SET_KEEPSETTINGS; extern unsigned IOCTL_HDIO_SET_MULTCOUNT; extern unsigned IOCTL_HDIO_SET_NOWERR; extern unsigned IOCTL_HDIO_SET_UNMASKINTR; extern unsigned IOCTL_MTIOCPOS; extern unsigned IOCTL_PPPIOCGASYNCMAP; extern unsigned IOCTL_PPPIOCGDEBUG; extern unsigned IOCTL_PPPIOCGFLAGS; extern unsigned IOCTL_PPPIOCGUNIT; extern unsigned IOCTL_PPPIOCGXASYNCMAP; extern unsigned IOCTL_PPPIOCSASYNCMAP; extern unsigned IOCTL_PPPIOCSDEBUG; extern unsigned IOCTL_PPPIOCSFLAGS; extern unsigned IOCTL_PPPIOCSMAXCID; extern unsigned IOCTL_PPPIOCSMRU; extern unsigned IOCTL_PPPIOCSXASYNCMAP; extern unsigned IOCTL_SIOCDARP; extern unsigned IOCTL_SIOCDRARP; extern unsigned IOCTL_SIOCGARP; extern unsigned IOCTL_SIOCGIFENCAP; extern unsigned IOCTL_SIOCGIFHWADDR; extern unsigned IOCTL_SIOCGIFMAP; extern unsigned IOCTL_SIOCGIFMEM; extern unsigned IOCTL_SIOCGIFNAME; extern unsigned IOCTL_SIOCGIFSLAVE; extern unsigned IOCTL_SIOCGRARP; extern unsigned IOCTL_SIOCGSTAMP; extern unsigned IOCTL_SIOCSARP; extern unsigned IOCTL_SIOCSIFENCAP; extern unsigned IOCTL_SIOCSIFHWADDR; extern unsigned IOCTL_SIOCSIFLINK; extern unsigned IOCTL_SIOCSIFMAP; extern unsigned IOCTL_SIOCSIFMEM; extern unsigned IOCTL_SIOCSIFSLAVE; extern unsigned IOCTL_SIOCSRARP; extern unsigned IOCTL_SNDCTL_COPR_HALT; extern unsigned IOCTL_SNDCTL_COPR_LOAD; extern unsigned IOCTL_SNDCTL_COPR_RCODE; extern unsigned IOCTL_SNDCTL_COPR_RCVMSG; extern unsigned IOCTL_SNDCTL_COPR_RDATA; extern unsigned IOCTL_SNDCTL_COPR_RESET; extern unsigned IOCTL_SNDCTL_COPR_RUN; extern unsigned IOCTL_SNDCTL_COPR_SENDMSG; extern unsigned IOCTL_SNDCTL_COPR_WCODE; extern unsigned IOCTL_SNDCTL_COPR_WDATA; extern unsigned IOCTL_TCFLSH; extern unsigned IOCTL_TCGETA; extern unsigned IOCTL_TCGETS; extern unsigned IOCTL_TCSBRK; extern unsigned IOCTL_TCSBRKP; extern unsigned IOCTL_TCSETA; extern unsigned IOCTL_TCSETAF; extern unsigned IOCTL_TCSETAW; extern unsigned IOCTL_TCSETS; extern unsigned IOCTL_TCSETSF; extern unsigned IOCTL_TCSETSW; extern unsigned IOCTL_TCXONC; extern unsigned IOCTL_TIOCGLCKTRMIOS; extern unsigned IOCTL_TIOCGSOFTCAR; extern unsigned IOCTL_TIOCINQ; extern unsigned IOCTL_TIOCLINUX; extern unsigned IOCTL_TIOCSERCONFIG; extern unsigned IOCTL_TIOCSERGETLSR; extern unsigned IOCTL_TIOCSERGWILD; extern unsigned IOCTL_TIOCSERSWILD; extern unsigned IOCTL_TIOCSLCKTRMIOS; extern unsigned IOCTL_TIOCSSOFTCAR; extern unsigned IOCTL_VT_DISALLOCATE; extern unsigned IOCTL_VT_GETSTATE; extern unsigned IOCTL_VT_RESIZE; extern unsigned IOCTL_VT_RESIZEX; extern unsigned IOCTL_VT_SENDSIG; #endif // SANITIZER_LINUX #if SANITIZER_LINUX || SANITIZER_FREEBSD extern unsigned IOCTL_MTIOCGET; extern unsigned IOCTL_MTIOCTOP; extern unsigned IOCTL_SIOCADDRT; extern unsigned IOCTL_SIOCDELRT; extern unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE; extern unsigned IOCTL_SNDCTL_DSP_GETFMTS; extern unsigned IOCTL_SNDCTL_DSP_NONBLOCK; extern unsigned IOCTL_SNDCTL_DSP_POST; extern unsigned IOCTL_SNDCTL_DSP_RESET; extern unsigned IOCTL_SNDCTL_DSP_SETFMT; extern unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT; extern unsigned IOCTL_SNDCTL_DSP_SPEED; extern unsigned IOCTL_SNDCTL_DSP_STEREO; extern unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE; extern unsigned IOCTL_SNDCTL_DSP_SYNC; extern unsigned IOCTL_SNDCTL_FM_4OP_ENABLE; extern unsigned IOCTL_SNDCTL_FM_LOAD_INSTR; extern unsigned IOCTL_SNDCTL_MIDI_INFO; extern unsigned IOCTL_SNDCTL_MIDI_PRETIME; extern unsigned IOCTL_SNDCTL_SEQ_CTRLRATE; extern unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT; extern unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT; extern unsigned IOCTL_SNDCTL_SEQ_NRMIDIS; extern unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS; extern unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND; extern unsigned IOCTL_SNDCTL_SEQ_PANIC; extern unsigned IOCTL_SNDCTL_SEQ_PERCMODE; extern unsigned IOCTL_SNDCTL_SEQ_RESET; extern unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES; extern unsigned IOCTL_SNDCTL_SEQ_SYNC; extern unsigned IOCTL_SNDCTL_SEQ_TESTMIDI; extern unsigned IOCTL_SNDCTL_SEQ_THRESHOLD; extern unsigned IOCTL_SNDCTL_SYNTH_INFO; extern unsigned IOCTL_SNDCTL_SYNTH_MEMAVL; extern unsigned IOCTL_SNDCTL_TMR_CONTINUE; extern unsigned IOCTL_SNDCTL_TMR_METRONOME; extern unsigned IOCTL_SNDCTL_TMR_SELECT; extern unsigned IOCTL_SNDCTL_TMR_SOURCE; extern unsigned IOCTL_SNDCTL_TMR_START; extern unsigned IOCTL_SNDCTL_TMR_STOP; extern unsigned IOCTL_SNDCTL_TMR_TEMPO; extern unsigned IOCTL_SNDCTL_TMR_TIMEBASE; extern unsigned IOCTL_SOUND_MIXER_READ_ALTPCM; extern unsigned IOCTL_SOUND_MIXER_READ_BASS; extern unsigned IOCTL_SOUND_MIXER_READ_CAPS; extern unsigned IOCTL_SOUND_MIXER_READ_CD; extern unsigned IOCTL_SOUND_MIXER_READ_DEVMASK; extern unsigned IOCTL_SOUND_MIXER_READ_ENHANCE; extern unsigned IOCTL_SOUND_MIXER_READ_IGAIN; extern unsigned IOCTL_SOUND_MIXER_READ_IMIX; extern unsigned IOCTL_SOUND_MIXER_READ_LINE1; extern unsigned IOCTL_SOUND_MIXER_READ_LINE2; extern unsigned IOCTL_SOUND_MIXER_READ_LINE3; extern unsigned IOCTL_SOUND_MIXER_READ_LINE; extern unsigned IOCTL_SOUND_MIXER_READ_LOUD; extern unsigned IOCTL_SOUND_MIXER_READ_MIC; extern unsigned IOCTL_SOUND_MIXER_READ_MUTE; extern unsigned IOCTL_SOUND_MIXER_READ_OGAIN; extern unsigned IOCTL_SOUND_MIXER_READ_PCM; extern unsigned IOCTL_SOUND_MIXER_READ_RECLEV; extern unsigned IOCTL_SOUND_MIXER_READ_RECMASK; extern unsigned IOCTL_SOUND_MIXER_READ_RECSRC; extern unsigned IOCTL_SOUND_MIXER_READ_SPEAKER; extern unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS; extern unsigned IOCTL_SOUND_MIXER_READ_SYNTH; extern unsigned IOCTL_SOUND_MIXER_READ_TREBLE; extern unsigned IOCTL_SOUND_MIXER_READ_VOLUME; extern unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM; extern unsigned IOCTL_SOUND_MIXER_WRITE_BASS; extern unsigned IOCTL_SOUND_MIXER_WRITE_CD; extern unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE; extern unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN; extern unsigned IOCTL_SOUND_MIXER_WRITE_IMIX; extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE1; extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE2; extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE3; extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE; extern unsigned IOCTL_SOUND_MIXER_WRITE_LOUD; extern unsigned IOCTL_SOUND_MIXER_WRITE_MIC; extern unsigned IOCTL_SOUND_MIXER_WRITE_MUTE; extern unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN; extern unsigned IOCTL_SOUND_MIXER_WRITE_PCM; extern unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV; extern unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC; extern unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER; extern unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH; extern unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE; extern unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME; extern unsigned IOCTL_SOUND_PCM_READ_BITS; extern unsigned IOCTL_SOUND_PCM_READ_CHANNELS; extern unsigned IOCTL_SOUND_PCM_READ_FILTER; extern unsigned IOCTL_SOUND_PCM_READ_RATE; extern unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS; extern unsigned IOCTL_SOUND_PCM_WRITE_FILTER; extern unsigned IOCTL_VT_ACTIVATE; extern unsigned IOCTL_VT_GETMODE; extern unsigned IOCTL_VT_OPENQRY; extern unsigned IOCTL_VT_RELDISP; extern unsigned IOCTL_VT_SETMODE; extern unsigned IOCTL_VT_WAITACTIVE; #endif // SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_LINUX && !SANITIZER_ANDROID extern unsigned IOCTL_CYGETDEFTHRESH; extern unsigned IOCTL_CYGETDEFTIMEOUT; extern unsigned IOCTL_CYGETMON; extern unsigned IOCTL_CYGETTHRESH; extern unsigned IOCTL_CYGETTIMEOUT; extern unsigned IOCTL_CYSETDEFTHRESH; extern unsigned IOCTL_CYSETDEFTIMEOUT; extern unsigned IOCTL_CYSETTHRESH; extern unsigned IOCTL_CYSETTIMEOUT; extern unsigned IOCTL_EQL_EMANCIPATE; extern unsigned IOCTL_EQL_ENSLAVE; extern unsigned IOCTL_EQL_GETMASTRCFG; extern unsigned IOCTL_EQL_GETSLAVECFG; extern unsigned IOCTL_EQL_SETMASTRCFG; extern unsigned IOCTL_EQL_SETSLAVECFG; extern unsigned IOCTL_EVIOCGKEYCODE_V2; extern unsigned IOCTL_EVIOCGPROP; extern unsigned IOCTL_EVIOCSKEYCODE_V2; extern unsigned IOCTL_FS_IOC_GETFLAGS; extern unsigned IOCTL_FS_IOC_GETVERSION; extern unsigned IOCTL_FS_IOC_SETFLAGS; extern unsigned IOCTL_FS_IOC_SETVERSION; extern unsigned IOCTL_GIO_CMAP; extern unsigned IOCTL_GIO_FONT; extern unsigned IOCTL_GIO_UNIMAP; extern unsigned IOCTL_GIO_UNISCRNMAP; extern unsigned IOCTL_KDADDIO; extern unsigned IOCTL_KDDELIO; extern unsigned IOCTL_KDGETKEYCODE; extern unsigned IOCTL_KDGKBDIACR; extern unsigned IOCTL_KDGKBENT; extern unsigned IOCTL_KDGKBLED; extern unsigned IOCTL_KDGKBMETA; extern unsigned IOCTL_KDGKBSENT; extern unsigned IOCTL_KDMAPDISP; extern unsigned IOCTL_KDSETKEYCODE; extern unsigned IOCTL_KDSIGACCEPT; extern unsigned IOCTL_KDSKBDIACR; extern unsigned IOCTL_KDSKBENT; extern unsigned IOCTL_KDSKBLED; extern unsigned IOCTL_KDSKBMETA; extern unsigned IOCTL_KDSKBSENT; extern unsigned IOCTL_KDUNMAPDISP; extern unsigned IOCTL_LPABORT; extern unsigned IOCTL_LPABORTOPEN; extern unsigned IOCTL_LPCAREFUL; extern unsigned IOCTL_LPCHAR; extern unsigned IOCTL_LPGETIRQ; extern unsigned IOCTL_LPGETSTATUS; extern unsigned IOCTL_LPRESET; extern unsigned IOCTL_LPSETIRQ; extern unsigned IOCTL_LPTIME; extern unsigned IOCTL_LPWAIT; extern unsigned IOCTL_MTIOCGETCONFIG; extern unsigned IOCTL_MTIOCSETCONFIG; extern unsigned IOCTL_PIO_CMAP; extern unsigned IOCTL_PIO_FONT; extern unsigned IOCTL_PIO_UNIMAP; extern unsigned IOCTL_PIO_UNIMAPCLR; extern unsigned IOCTL_PIO_UNISCRNMAP; extern unsigned IOCTL_SCSI_IOCTL_GET_IDLUN; extern unsigned IOCTL_SCSI_IOCTL_PROBE_HOST; extern unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE; extern unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE; extern unsigned IOCTL_SIOCAIPXITFCRT; extern unsigned IOCTL_SIOCAIPXPRISLT; extern unsigned IOCTL_SIOCAX25ADDUID; extern unsigned IOCTL_SIOCAX25DELUID; extern unsigned IOCTL_SIOCAX25GETPARMS; extern unsigned IOCTL_SIOCAX25GETUID; extern unsigned IOCTL_SIOCAX25NOUID; extern unsigned IOCTL_SIOCAX25SETPARMS; extern unsigned IOCTL_SIOCDEVPLIP; extern unsigned IOCTL_SIOCIPXCFGDATA; extern unsigned IOCTL_SIOCNRDECOBS; extern unsigned IOCTL_SIOCNRGETPARMS; extern unsigned IOCTL_SIOCNRRTCTL; extern unsigned IOCTL_SIOCNRSETPARMS; extern unsigned IOCTL_SNDCTL_DSP_GETISPACE; extern unsigned IOCTL_SNDCTL_DSP_GETOSPACE; extern unsigned IOCTL_TIOCGSERIAL; extern unsigned IOCTL_TIOCSERGETMULTI; extern unsigned IOCTL_TIOCSERSETMULTI; extern unsigned IOCTL_TIOCSSERIAL; #endif // SANITIZER_LINUX && !SANITIZER_ANDROID #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID extern unsigned IOCTL_GIO_SCRNMAP; extern unsigned IOCTL_KDDISABIO; extern unsigned IOCTL_KDENABIO; extern unsigned IOCTL_KDGETLED; extern unsigned IOCTL_KDGETMODE; extern unsigned IOCTL_KDGKBMODE; extern unsigned IOCTL_KDGKBTYPE; extern unsigned IOCTL_KDMKTONE; extern unsigned IOCTL_KDSETLED; extern unsigned IOCTL_KDSETMODE; extern unsigned IOCTL_KDSKBMODE; extern unsigned IOCTL_KIOCSOUND; extern unsigned IOCTL_PIO_SCRNMAP; #endif extern const int errno_EINVAL; extern const int errno_EOWNERDEAD; extern const int si_SEGV_MAPERR; extern const int si_SEGV_ACCERR; } // namespace __sanitizer #define CHECK_TYPE_SIZE(TYPE) \ COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE)) #define CHECK_SIZE_AND_OFFSET(CLASS, MEMBER) \ COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \ sizeof(((CLASS *) NULL)->MEMBER)); \ COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \ offsetof(CLASS, MEMBER)) // For sigaction, which is a function and struct at the same time, // and thus requires explicit "struct" in sizeof() expression. #define CHECK_STRUCT_SIZE_AND_OFFSET(CLASS, MEMBER) \ COMPILER_CHECK(sizeof(((struct __sanitizer_##CLASS *) NULL)->MEMBER) == \ sizeof(((struct CLASS *) NULL)->MEMBER)); \ COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) == \ offsetof(struct CLASS, MEMBER)) #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_procmaps.h0000664000175000017500000000621112662654403031424 0ustar mwhudsonmwhudson//===-- sanitizer_procmaps.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer. // // Information about the process mappings. //===----------------------------------------------------------------------===// #ifndef SANITIZER_PROCMAPS_H #define SANITIZER_PROCMAPS_H #include "sanitizer_common.h" #include "sanitizer_internal_defs.h" #include "sanitizer_mutex.h" namespace __sanitizer { #if SANITIZER_FREEBSD || SANITIZER_LINUX struct ProcSelfMapsBuff { char *data; uptr mmaped_size; uptr len; }; // Reads process memory map in an OS-specific way. void ReadProcMaps(ProcSelfMapsBuff *proc_maps); #endif // SANITIZER_FREEBSD || SANITIZER_LINUX class MemoryMappingLayout { public: explicit MemoryMappingLayout(bool cache_enabled); ~MemoryMappingLayout(); bool Next(uptr *start, uptr *end, uptr *offset, char filename[], uptr filename_size, uptr *protection); void Reset(); // In some cases, e.g. when running under a sandbox on Linux, ASan is unable // to obtain the memory mappings. It should fall back to pre-cached data // instead of aborting. static void CacheMemoryMappings(); // Adds all mapped objects into a vector. void DumpListOfModules(InternalMmapVector *modules); // Memory protection masks. static const uptr kProtectionRead = 1; static const uptr kProtectionWrite = 2; static const uptr kProtectionExecute = 4; static const uptr kProtectionShared = 8; private: void LoadFromCache(); // FIXME: Hide implementation details for different platforms in // platform-specific files. # if SANITIZER_FREEBSD || SANITIZER_LINUX ProcSelfMapsBuff proc_self_maps_; const char *current_; // Static mappings cache. static ProcSelfMapsBuff cached_proc_self_maps_; static StaticSpinMutex cache_lock_; // protects cached_proc_self_maps_. # elif SANITIZER_MAC template bool NextSegmentLoad(uptr *start, uptr *end, uptr *offset, char filename[], uptr filename_size, uptr *protection); int current_image_; u32 current_magic_; u32 current_filetype_; int current_load_cmd_count_; char *current_load_cmd_addr_; # endif }; typedef void (*fill_profile_f)(uptr start, uptr rss, bool file, /*out*/uptr *stats, uptr stats_size); // Parse the contents of /proc/self/smaps and generate a memory profile. // |cb| is a tool-specific callback that fills the |stats| array containing // |stats_size| elements. void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size); // Returns code range for the specified module. bool GetCodeRangeForFile(const char *module, uptr *start, uptr *end); bool IsDecimal(char c); uptr ParseDecimal(const char **p); bool IsHex(char c); uptr ParseHex(const char **p); } // namespace __sanitizer #endif // SANITIZER_PROCMAPS_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_size_class_map.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_size_class_m0000664000175000017500000002170012761614567034074 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_size_class_map.h --------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Part of the Sanitizer Allocator. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_H #error This file must be included inside sanitizer_allocator.h #endif // SizeClassMap maps allocation sizes into size classes and back. // Class 0 always corresponds to size 0. // The other sizes are controlled by the template parameters: // kMinSizeLog: defines the class 1 as 2^kMinSizeLog. // kMaxSizeLog: defines the last class as 2^kMaxSizeLog. // kMidSizeLog: the classes starting from 1 increase with step // 2^kMinSizeLog until 2^kMidSizeLog. // kNumBits: the number of non-zero bits in sizes after 2^kMidSizeLog. // E.g. with kNumBits==3 all size classes after 2^kMidSizeLog // look like 0b1xx0..0, where x is either 0 or 1. // // Example: kNumBits=3, kMidSizeLog=4, kMidSizeLog=8, kMaxSizeLog=17: // // Classes 1 - 16 correspond to sizes 16 to 256 (size = class_id * 16). // Next 4 classes: 256 + i * 64 (i = 1 to 4). // Next 4 classes: 512 + i * 128 (i = 1 to 4). // ... // Next 4 classes: 2^k + i * 2^(k-2) (i = 1 to 4). // Last class corresponds to kMaxSize = 1 << kMaxSizeLog. // // This structure of the size class map gives us: // - Efficient table-free class-to-size and size-to-class functions. // - Difference between two consequent size classes is between 14% and 25% // // This class also gives a hint to a thread-caching allocator about the amount // of chunks that need to be cached per-thread: // - kMaxNumCachedHint is a hint for maximal number of chunks per size class. // The actual number is computed in TransferBatch. // - (1 << kMaxBytesCachedLog) is the maximal number of bytes per size class. // // Part of output of SizeClassMap::Print(): // c00 => s: 0 diff: +0 00% l 0 cached: 0 0; id 0 // c01 => s: 16 diff: +16 00% l 4 cached: 256 4096; id 1 // c02 => s: 32 diff: +16 100% l 5 cached: 256 8192; id 2 // c03 => s: 48 diff: +16 50% l 5 cached: 256 12288; id 3 // c04 => s: 64 diff: +16 33% l 6 cached: 256 16384; id 4 // c05 => s: 80 diff: +16 25% l 6 cached: 256 20480; id 5 // c06 => s: 96 diff: +16 20% l 6 cached: 256 24576; id 6 // c07 => s: 112 diff: +16 16% l 6 cached: 256 28672; id 7 // // c08 => s: 128 diff: +16 14% l 7 cached: 256 32768; id 8 // c09 => s: 144 diff: +16 12% l 7 cached: 256 36864; id 9 // c10 => s: 160 diff: +16 11% l 7 cached: 256 40960; id 10 // c11 => s: 176 diff: +16 10% l 7 cached: 256 45056; id 11 // c12 => s: 192 diff: +16 09% l 7 cached: 256 49152; id 12 // c13 => s: 208 diff: +16 08% l 7 cached: 256 53248; id 13 // c14 => s: 224 diff: +16 07% l 7 cached: 256 57344; id 14 // c15 => s: 240 diff: +16 07% l 7 cached: 256 61440; id 15 // // c16 => s: 256 diff: +16 06% l 8 cached: 256 65536; id 16 // c17 => s: 320 diff: +64 25% l 8 cached: 204 65280; id 17 // c18 => s: 384 diff: +64 20% l 8 cached: 170 65280; id 18 // c19 => s: 448 diff: +64 16% l 8 cached: 146 65408; id 19 // // c20 => s: 512 diff: +64 14% l 9 cached: 128 65536; id 20 // c21 => s: 640 diff: +128 25% l 9 cached: 102 65280; id 21 // c22 => s: 768 diff: +128 20% l 9 cached: 85 65280; id 22 // c23 => s: 896 diff: +128 16% l 9 cached: 73 65408; id 23 // // c24 => s: 1024 diff: +128 14% l 10 cached: 64 65536; id 24 // c25 => s: 1280 diff: +256 25% l 10 cached: 51 65280; id 25 // c26 => s: 1536 diff: +256 20% l 10 cached: 42 64512; id 26 // c27 => s: 1792 diff: +256 16% l 10 cached: 36 64512; id 27 // // ... // // c48 => s: 65536 diff: +8192 14% l 16 cached: 1 65536; id 48 // c49 => s: 81920 diff: +16384 25% l 16 cached: 1 81920; id 49 // c50 => s: 98304 diff: +16384 20% l 16 cached: 1 98304; id 50 // c51 => s: 114688 diff: +16384 16% l 16 cached: 1 114688; id 51 // // c52 => s: 131072 diff: +16384 14% l 17 cached: 1 131072; id 52 // // // Another example (kNumBits=2): // c00 => s: 0 diff: +0 00% l 0 cached: 0 0; id 0 // c01 => s: 32 diff: +32 00% l 5 cached: 64 2048; id 1 // c02 => s: 64 diff: +32 100% l 6 cached: 64 4096; id 2 // c03 => s: 96 diff: +32 50% l 6 cached: 64 6144; id 3 // c04 => s: 128 diff: +32 33% l 7 cached: 64 8192; id 4 // c05 => s: 160 diff: +32 25% l 7 cached: 64 10240; id 5 // c06 => s: 192 diff: +32 20% l 7 cached: 64 12288; id 6 // c07 => s: 224 diff: +32 16% l 7 cached: 64 14336; id 7 // c08 => s: 256 diff: +32 14% l 8 cached: 64 16384; id 8 // c09 => s: 384 diff: +128 50% l 8 cached: 42 16128; id 9 // c10 => s: 512 diff: +128 33% l 9 cached: 32 16384; id 10 // c11 => s: 768 diff: +256 50% l 9 cached: 21 16128; id 11 // c12 => s: 1024 diff: +256 33% l 10 cached: 16 16384; id 12 // c13 => s: 1536 diff: +512 50% l 10 cached: 10 15360; id 13 // c14 => s: 2048 diff: +512 33% l 11 cached: 8 16384; id 14 // c15 => s: 3072 diff: +1024 50% l 11 cached: 5 15360; id 15 // c16 => s: 4096 diff: +1024 33% l 12 cached: 4 16384; id 16 // c17 => s: 6144 diff: +2048 50% l 12 cached: 2 12288; id 17 // c18 => s: 8192 diff: +2048 33% l 13 cached: 2 16384; id 18 // c19 => s: 12288 diff: +4096 50% l 13 cached: 1 12288; id 19 // c20 => s: 16384 diff: +4096 33% l 14 cached: 1 16384; id 20 // c21 => s: 24576 diff: +8192 50% l 14 cached: 1 24576; id 21 // c22 => s: 32768 diff: +8192 33% l 15 cached: 1 32768; id 22 // c23 => s: 49152 diff: +16384 50% l 15 cached: 1 49152; id 23 // c24 => s: 65536 diff: +16384 33% l 16 cached: 1 65536; id 24 // c25 => s: 98304 diff: +32768 50% l 16 cached: 1 98304; id 25 // c26 => s: 131072 diff: +32768 33% l 17 cached: 1 131072; id 26 template class SizeClassMap { static const uptr kMinSize = 1 << kMinSizeLog; static const uptr kMidSize = 1 << kMidSizeLog; static const uptr kMidClass = kMidSize / kMinSize; static const uptr S = kNumBits - 1; static const uptr M = (1 << S) - 1; public: // kMaxNumCachedHintT is a power of two. It serves as a hint // for the size of TransferBatch, the actual size could be a bit smaller. static const uptr kMaxNumCachedHint = kMaxNumCachedHintT; COMPILER_CHECK((kMaxNumCachedHint & (kMaxNumCachedHint - 1)) == 0); static const uptr kMaxSize = 1UL << kMaxSizeLog; static const uptr kNumClasses = kMidClass + ((kMaxSizeLog - kMidSizeLog) << S) + 1; static const uptr kLargestClassID = kNumClasses - 2; COMPILER_CHECK(kNumClasses >= 16 && kNumClasses <= 256); static const uptr kNumClassesRounded = kNumClasses <= 32 ? 32 : kNumClasses <= 64 ? 64 : kNumClasses <= 128 ? 128 : 256; static uptr Size(uptr class_id) { if (class_id <= kMidClass) return kMinSize * class_id; class_id -= kMidClass; uptr t = kMidSize << (class_id >> S); return t + (t >> S) * (class_id & M); } static uptr ClassID(uptr size) { if (size <= kMidSize) return (size + kMinSize - 1) >> kMinSizeLog; if (size > kMaxSize) return 0; uptr l = MostSignificantSetBitIndex(size); uptr hbits = (size >> (l - S)) & M; uptr lbits = size & ((1 << (l - S)) - 1); uptr l1 = l - kMidSizeLog; return kMidClass + (l1 << S) + hbits + (lbits > 0); } static uptr MaxCachedHint(uptr class_id) { if (class_id == 0) return 0; uptr n = (1UL << kMaxBytesCachedLog) / Size(class_id); return Max(1, Min(kMaxNumCachedHint, n)); } static void Print() { uptr prev_s = 0; uptr total_cached = 0; for (uptr i = 0; i < kNumClasses; i++) { uptr s = Size(i); if (s >= kMidSize / 2 && (s & (s - 1)) == 0) Printf("\n"); uptr d = s - prev_s; uptr p = prev_s ? (d * 100 / prev_s) : 0; uptr l = s ? MostSignificantSetBitIndex(s) : 0; uptr cached = MaxCachedHint(i) * s; Printf("c%02zd => s: %zd diff: +%zd %02zd%% l %zd " "cached: %zd %zd; id %zd\n", i, Size(i), d, p, l, MaxCachedHint(i), cached, ClassID(s)); total_cached += cached; prev_s = s; } Printf("Total cached: %zd\n", total_cached); } static void Validate() { for (uptr c = 1; c < kNumClasses; c++) { // Printf("Validate: c%zd\n", c); uptr s = Size(c); CHECK_NE(s, 0U); CHECK_EQ(ClassID(s), c); if (c != kNumClasses - 1) CHECK_EQ(ClassID(s + 1), c + 1); CHECK_EQ(ClassID(s - 1), c); if (c) CHECK_GT(Size(c), Size(c-1)); } CHECK_EQ(ClassID(kMaxSize + 1), 0); for (uptr s = 1; s <= kMaxSize; s++) { uptr c = ClassID(s); // Printf("s%zd => c%zd\n", s, c); CHECK_LT(c, kNumClasses); CHECK_GE(Size(c), s); if (c > 0) CHECK_LT(Size(c-1), s); } } }; typedef SizeClassMap<3, 4, 8, 17, 128, 16> DefaultSizeClassMap; typedef SizeClassMap<3, 4, 8, 17, 64, 14> CompactSizeClassMap; typedef SizeClassMap<2, 5, 9, 16, 64, 14> VeryCompactSizeClassMap; ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.c0000664000175000017500000001333612734471500034001 0ustar mwhudsonmwhudson//===-- sanitizer_unwind_linux_libcdep.cc ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the unwind.h-based (aka "slow") stack unwinding routines // available to the tools on Linux, Android, and FreeBSD. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "sanitizer_common.h" #include "sanitizer_stacktrace.h" #if SANITIZER_ANDROID #include // for dlopen() #endif #if SANITIZER_FREEBSD #define _GNU_SOURCE // to declare _Unwind_Backtrace() from #endif #include namespace __sanitizer { //------------------------- SlowUnwindStack ----------------------------------- typedef struct { uptr absolute_pc; uptr stack_top; uptr stack_size; } backtrace_frame_t; extern "C" { typedef void *(*acquire_my_map_info_list_func)(); typedef void (*release_my_map_info_list_func)(void *map); typedef sptr (*unwind_backtrace_signal_arch_func)( void *siginfo, void *sigcontext, void *map_info_list, backtrace_frame_t *backtrace, uptr ignore_depth, uptr max_depth); acquire_my_map_info_list_func acquire_my_map_info_list; release_my_map_info_list_func release_my_map_info_list; unwind_backtrace_signal_arch_func unwind_backtrace_signal_arch; } // extern "C" #if SANITIZER_ANDROID void SanitizerInitializeUnwinder() { if (AndroidGetApiLevel() >= ANDROID_LOLLIPOP_MR1) return; // Pre-lollipop Android can not unwind through signal handler frames with // libgcc unwinder, but it has a libcorkscrew.so library with the necessary // workarounds. void *p = dlopen("libcorkscrew.so", RTLD_LAZY); if (!p) { VReport(1, "Failed to open libcorkscrew.so. You may see broken stack traces " "in SEGV reports."); return; } acquire_my_map_info_list = (acquire_my_map_info_list_func)(uptr)dlsym(p, "acquire_my_map_info_list"); release_my_map_info_list = (release_my_map_info_list_func)(uptr)dlsym(p, "release_my_map_info_list"); unwind_backtrace_signal_arch = (unwind_backtrace_signal_arch_func)(uptr)dlsym( p, "unwind_backtrace_signal_arch"); if (!acquire_my_map_info_list || !release_my_map_info_list || !unwind_backtrace_signal_arch) { VReport(1, "Failed to find one of the required symbols in libcorkscrew.so. " "You may see broken stack traces in SEGV reports."); acquire_my_map_info_list = 0; unwind_backtrace_signal_arch = 0; release_my_map_info_list = 0; } } #endif #ifdef __arm__ #define UNWIND_STOP _URC_END_OF_STACK #define UNWIND_CONTINUE _URC_NO_REASON #else #define UNWIND_STOP _URC_NORMAL_STOP #define UNWIND_CONTINUE _URC_NO_REASON #endif uptr Unwind_GetIP(struct _Unwind_Context *ctx) { #if defined(__arm__) && !SANITIZER_MAC uptr val; _Unwind_VRS_Result res = _Unwind_VRS_Get(ctx, _UVRSC_CORE, 15 /* r15 = PC */, _UVRSD_UINT32, &val); CHECK(res == _UVRSR_OK && "_Unwind_VRS_Get failed"); // Clear the Thumb bit. return val & ~(uptr)1; #else return _Unwind_GetIP(ctx); #endif } struct UnwindTraceArg { BufferedStackTrace *stack; u32 max_depth; }; _Unwind_Reason_Code Unwind_Trace(struct _Unwind_Context *ctx, void *param) { UnwindTraceArg *arg = (UnwindTraceArg*)param; CHECK_LT(arg->stack->size, arg->max_depth); uptr pc = Unwind_GetIP(ctx); const uptr kPageSize = GetPageSizeCached(); // Let's assume that any pointer in the 0th page (i.e. <0x1000 on i386 and // x86_64) is invalid and stop unwinding here. If we're adding support for // a platform where this isn't true, we need to reconsider this check. if (pc < kPageSize) return UNWIND_STOP; arg->stack->trace_buffer[arg->stack->size++] = pc; if (arg->stack->size == arg->max_depth) return UNWIND_STOP; return UNWIND_CONTINUE; } void BufferedStackTrace::SlowUnwindStack(uptr pc, u32 max_depth) { CHECK_GE(max_depth, 2); size = 0; UnwindTraceArg arg = {this, Min(max_depth + 1, kStackTraceMax)}; _Unwind_Backtrace(Unwind_Trace, &arg); // We need to pop a few frames so that pc is on top. uptr to_pop = LocatePcInTrace(pc); // trace_buffer[0] belongs to the current function so we always pop it, // unless there is only 1 frame in the stack trace (1 frame is always better // than 0!). // 1-frame stacks don't normally happen, but this depends on the actual // unwinder implementation (libgcc, libunwind, etc) which is outside of our // control. if (to_pop == 0 && size > 1) to_pop = 1; PopStackFrames(to_pop); trace_buffer[0] = pc; } void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context, u32 max_depth) { CHECK_GE(max_depth, 2); if (!unwind_backtrace_signal_arch) { SlowUnwindStack(pc, max_depth); return; } void *map = acquire_my_map_info_list(); CHECK(map); InternalScopedBuffer frames(kStackTraceMax); // siginfo argument appears to be unused. sptr res = unwind_backtrace_signal_arch(/* siginfo */ 0, context, map, frames.data(), /* ignore_depth */ 0, max_depth); release_my_map_info_list(map); if (res < 0) return; CHECK_LE((uptr)res, kStackTraceMax); size = 0; // +2 compensate for libcorkscrew unwinder returning addresses of call // instructions instead of raw return addresses. for (sptr i = 0; i < res; ++i) trace_buffer[size++] = frames[i].absolute_pc + 2; } } // namespace __sanitizer #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_internal.h0000664000175000017500000001217712704277144033703 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_internal.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Header for internal classes and functions to be used by implementations of // symbolizers. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_SYMBOLIZER_INTERNAL_H #define SANITIZER_SYMBOLIZER_INTERNAL_H #include "sanitizer_symbolizer.h" namespace __sanitizer { // Parsing helpers, 'str' is searched for delimiter(s) and a string or uptr // is extracted. When extracting a string, a newly allocated (using // InternalAlloc) and null-terminataed buffer is returned. They return a pointer // to the next characted after the found delimiter. const char *ExtractToken(const char *str, const char *delims, char **result); const char *ExtractInt(const char *str, const char *delims, int *result); const char *ExtractUptr(const char *str, const char *delims, uptr *result); const char *ExtractTokenUpToDelimiter(const char *str, const char *delimiter, char **result); const char *DemangleSwiftAndCXX(const char *name); // SymbolizerTool is an interface that is implemented by individual "tools" // that can perform symbolication (external llvm-symbolizer, libbacktrace, // Windows DbgHelp symbolizer, etc.). class SymbolizerTool { public: // The main |Symbolizer| class implements a "fallback chain" of symbolizer // tools. In a request to symbolize an address, if one tool returns false, // the next tool in the chain will be tried. SymbolizerTool *next; SymbolizerTool() : next(nullptr) { } // Can't declare pure virtual functions in sanitizer runtimes: // __cxa_pure_virtual might be unavailable. // The |stack| parameter is inout. It is pre-filled with the address, // module base and module offset values and is to be used to construct // other stack frames. virtual bool SymbolizePC(uptr addr, SymbolizedStack *stack) { UNIMPLEMENTED(); } // The |info| parameter is inout. It is pre-filled with the module base // and module offset values. virtual bool SymbolizeData(uptr addr, DataInfo *info) { UNIMPLEMENTED(); } virtual void Flush() {} // Return nullptr to fallback to the default platform-specific demangler. virtual const char *Demangle(const char *name) { return nullptr; } }; // SymbolizerProcess encapsulates communication between the tool and // external symbolizer program, running in a different subprocess. // SymbolizerProcess may not be used from two threads simultaneously. class SymbolizerProcess { public: explicit SymbolizerProcess(const char *path, bool use_forkpty = false); const char *SendCommand(const char *command); protected: virtual bool ReachedEndOfOutput(const char *buffer, uptr length) const { UNIMPLEMENTED(); } /// The maximum number of arguments required to invoke a tool process. enum { kArgVMax = 6 }; /// Fill in an argv array to invoke the child process. virtual void GetArgV(const char *path_to_binary, const char *(&argv)[kArgVMax]) const { UNIMPLEMENTED(); } virtual bool ReadFromSymbolizer(char *buffer, uptr max_length); private: bool Restart(); const char *SendCommandImpl(const char *command); bool WriteToSymbolizer(const char *buffer, uptr length); bool StartSymbolizerSubprocess(); const char *path_; fd_t input_fd_; fd_t output_fd_; static const uptr kBufferSize = 16 * 1024; char buffer_[kBufferSize]; static const uptr kMaxTimesRestarted = 5; static const int kSymbolizerStartupTimeMillis = 10; uptr times_restarted_; bool failed_to_start_; bool reported_invalid_path_; bool use_forkpty_; }; class LLVMSymbolizerProcess; // This tool invokes llvm-symbolizer in a subprocess. It should be as portable // as the llvm-symbolizer tool is. class LLVMSymbolizer : public SymbolizerTool { public: explicit LLVMSymbolizer(const char *path, LowLevelAllocator *allocator); bool SymbolizePC(uptr addr, SymbolizedStack *stack) override; bool SymbolizeData(uptr addr, DataInfo *info) override; private: const char *SendCommand(bool is_data, const char *module_name, uptr module_offset); LLVMSymbolizerProcess *symbolizer_process_; static const uptr kBufferSize = 16 * 1024; char buffer_[kBufferSize]; }; // Parses one or more two-line strings in the following format: // // :[:] // Used by LLVMSymbolizer, Addr2LinePool and InternalSymbolizer, since all of // them use the same output format. Returns true if any useful debug // information was found. void ParseSymbolizePCOutput(const char *str, SymbolizedStack *res); // Parses a two-line string in the following format: // // // Used by LLVMSymbolizer and InternalSymbolizer. void ParseSymbolizeDataOutput(const char *str, DataInfo *info); } // namespace __sanitizer #endif // SANITIZER_SYMBOLIZER_INTERNAL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform.h0000664000175000017500000001621013004730632031412 0ustar mwhudsonmwhudson//===-- sanitizer_platform.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Common platform macros. //===----------------------------------------------------------------------===// #ifndef SANITIZER_PLATFORM_H #define SANITIZER_PLATFORM_H #if !defined(__linux__) && !defined(__FreeBSD__) && \ !defined(__APPLE__) && !defined(_WIN32) # error "This operating system is not supported" #endif #if defined(__linux__) # define SANITIZER_LINUX 1 #else # define SANITIZER_LINUX 0 #endif #if defined(__FreeBSD__) # define SANITIZER_FREEBSD 1 #else # define SANITIZER_FREEBSD 0 #endif #if defined(__APPLE__) # define SANITIZER_MAC 1 # include # if TARGET_OS_IPHONE # define SANITIZER_IOS 1 # else # define SANITIZER_IOS 0 # endif # if TARGET_IPHONE_SIMULATOR # define SANITIZER_IOSSIM 1 # else # define SANITIZER_IOSSIM 0 # endif #else # define SANITIZER_MAC 0 # define SANITIZER_IOS 0 # define SANITIZER_IOSSIM 0 #endif #if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_WATCH # define SANITIZER_WATCHOS 1 #else # define SANITIZER_WATCHOS 0 #endif #if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_TV # define SANITIZER_TVOS 1 #else # define SANITIZER_TVOS 0 #endif #if defined(_WIN32) # define SANITIZER_WINDOWS 1 #else # define SANITIZER_WINDOWS 0 #endif #if defined(_WIN64) # define SANITIZER_WINDOWS64 1 #else # define SANITIZER_WINDOWS64 0 #endif #if defined(__ANDROID__) # define SANITIZER_ANDROID 1 #else # define SANITIZER_ANDROID 0 #endif #define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC) #if __LP64__ || defined(_WIN64) # define SANITIZER_WORDSIZE 64 #else # define SANITIZER_WORDSIZE 32 #endif #if SANITIZER_WORDSIZE == 64 # define FIRST_32_SECOND_64(a, b) (b) #else # define FIRST_32_SECOND_64(a, b) (a) #endif #if defined(__x86_64__) && !defined(_LP64) # define SANITIZER_X32 1 #else # define SANITIZER_X32 0 #endif #if defined(__mips__) # define SANITIZER_MIPS 1 # if defined(__mips64) # define SANITIZER_MIPS32 0 # define SANITIZER_MIPS64 1 # else # define SANITIZER_MIPS32 1 # define SANITIZER_MIPS64 0 # endif #else # define SANITIZER_MIPS 0 # define SANITIZER_MIPS32 0 # define SANITIZER_MIPS64 0 #endif #if defined(__s390__) # define SANITIZER_S390 1 # if defined(__s390x__) # define SANITIZER_S390_31 0 # define SANITIZER_S390_64 1 # else # define SANITIZER_S390_31 1 # define SANITIZER_S390_64 0 # endif #else # define SANITIZER_S390 0 # define SANITIZER_S390_31 0 # define SANITIZER_S390_64 0 #endif #if defined(__powerpc__) # define SANITIZER_PPC 1 # if defined(__powerpc64__) # define SANITIZER_PPC32 0 # define SANITIZER_PPC64 1 // 64-bit PPC has two ABIs (v1 and v2). The old powerpc64 target is // big-endian, and uses v1 ABI (known for its function descriptors), // while the new powerpc64le target is little-endian and uses v2. // In theory, you could convince gcc to compile for their evil twins // (eg. big-endian v2), but you won't find such combinations in the wild // (it'd require bootstrapping a whole system, which would be quite painful // - there's no target triple for that). LLVM doesn't support them either. # if _CALL_ELF == 2 # define SANITIZER_PPC64V1 0 # define SANITIZER_PPC64V2 1 # else # define SANITIZER_PPC64V1 1 # define SANITIZER_PPC64V2 0 # endif # else # define SANITIZER_PPC32 1 # define SANITIZER_PPC64 0 # define SANITIZER_PPC64V1 0 # define SANITIZER_PPC64V2 0 # endif #else # define SANITIZER_PPC 0 # define SANITIZER_PPC32 0 # define SANITIZER_PPC64 0 # define SANITIZER_PPC64V1 0 # define SANITIZER_PPC64V2 0 #endif // By default we allow to use SizeClassAllocator64 on 64-bit platform. // But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64 // does not work well and we need to fallback to SizeClassAllocator32. // For such platforms build this code with -DSANITIZER_CAN_USE_ALLOCATOR64=0 or // change the definition of SANITIZER_CAN_USE_ALLOCATOR64 here. #ifndef SANITIZER_CAN_USE_ALLOCATOR64 # if SANITIZER_ANDROID && defined(__aarch64__) # define SANITIZER_CAN_USE_ALLOCATOR64 1 # elif defined(__mips64) || defined(__aarch64__) # define SANITIZER_CAN_USE_ALLOCATOR64 0 # else # define SANITIZER_CAN_USE_ALLOCATOR64 (SANITIZER_WORDSIZE == 64) # endif #endif // The range of addresses which can be returned my mmap. // FIXME: this value should be different on different platforms. Larger values // will still work but will consume more memory for TwoLevelByteMap. #if defined(__mips__) # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 40) #elif defined(__aarch64__) # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 48) #else # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47) #endif // The AArch64 linux port uses the canonical syscall set as mandated by // the upstream linux community for all new ports. Other ports may still // use legacy syscalls. #ifndef SANITIZER_USES_CANONICAL_LINUX_SYSCALLS # if defined(__aarch64__) && SANITIZER_LINUX # define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1 # else # define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 0 # endif #endif // udi16 syscalls can only be used when the following conditions are // met: // * target is one of arm32, x86-32, sparc32, sh or m68k // * libc version is libc5, glibc-2.0, glibc-2.1 or glibc-2.2 to 2.15 // built against > linux-2.2 kernel headers // Since we don't want to include libc headers here, we check the // target only. #if defined(__arm__) || SANITIZER_X32 || defined(__sparc__) #define SANITIZER_USES_UID16_SYSCALLS 1 #else #define SANITIZER_USES_UID16_SYSCALLS 0 #endif #if defined(__mips__) # define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 10) #else # define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 12) #endif // Assume obsolete RPC headers are available by default #if !defined(HAVE_RPC_XDR_H) && !defined(HAVE_TIRPC_RPC_XDR_H) # define HAVE_RPC_XDR_H (SANITIZER_LINUX && !SANITIZER_ANDROID) # define HAVE_TIRPC_RPC_XDR_H 0 #endif /// \macro MSC_PREREQ /// \brief Is the compiler MSVC of at least the specified version? /// The common \param version values to check for are: /// * 1800: Microsoft Visual Studio 2013 / 12.0 /// * 1900: Microsoft Visual Studio 2015 / 14.0 #ifdef _MSC_VER # define MSC_PREREQ(version) (_MSC_VER >= (version)) #else # define MSC_PREREQ(version) 0 #endif #if defined(__arm64__) && SANITIZER_IOS # define SANITIZER_NON_UNIQUE_TYPEINFO 1 #else # define SANITIZER_NON_UNIQUE_TYPEINFO 0 #endif // On linux, some architectures had an ABI transition from 64-bit long double // (ie. same as double) to 128-bit long double. On those, glibc symbols // involving long doubles come in two versions, and we need to pass the // correct one to dlvsym when intercepting them. #if SANITIZER_LINUX && (SANITIZER_S390 || SANITIZER_PPC32 || SANITIZER_PPC64V1) #define SANITIZER_NLDBL_VERSION "GLIBC_2.4" #endif #if SANITIZER_GO == 0 # define SANITIZER_GO 0 #endif #endif // SANITIZER_PLATFORM_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stackdepot.h0000664000175000017500000000412112602553450031731 0ustar mwhudsonmwhudson//===-- sanitizer_stackdepot.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #ifndef SANITIZER_STACKDEPOT_H #define SANITIZER_STACKDEPOT_H #include "sanitizer_common.h" #include "sanitizer_internal_defs.h" #include "sanitizer_stacktrace.h" namespace __sanitizer { // StackDepot efficiently stores huge amounts of stack traces. struct StackDepotNode; struct StackDepotHandle { StackDepotNode *node_; StackDepotHandle() : node_(nullptr) {} explicit StackDepotHandle(StackDepotNode *node) : node_(node) {} bool valid() { return node_; } u32 id(); int use_count(); void inc_use_count_unsafe(); }; const int kStackDepotMaxUseCount = 1U << 20; StackDepotStats *StackDepotGetStats(); u32 StackDepotPut(StackTrace stack); StackDepotHandle StackDepotPut_WithHandle(StackTrace stack); // Retrieves a stored stack trace by the id. StackTrace StackDepotGet(u32 id); void StackDepotLockAll(); void StackDepotUnlockAll(); // Instantiating this class creates a snapshot of StackDepot which can be // efficiently queried with StackDepotGet(). You can use it concurrently with // StackDepot, but the snapshot is only guaranteed to contain those stack traces // which were stored before it was instantiated. class StackDepotReverseMap { public: StackDepotReverseMap(); StackTrace Get(u32 id); private: struct IdDescPair { u32 id; StackDepotNode *desc; static bool IdComparator(const IdDescPair &a, const IdDescPair &b); }; InternalMmapVector map_; // Disallow evil constructors. StackDepotReverseMap(const StackDepotReverseMap&); void operator=(const StackDepotReverseMap&); }; } // namespace __sanitizer #endif // SANITIZER_STACKDEPOT_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_libignore.h0000664000175000017500000000434312471465061031554 0ustar mwhudsonmwhudson//===-- sanitizer_libignore.h -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // LibIgnore allows to ignore all interceptors called from a particular set // of dynamic libraries. LibIgnore can be initialized with several templates // of names of libraries to be ignored. It finds code ranges for the libraries; // and checks whether the provided PC value belongs to the code ranges. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_LIBIGNORE_H #define SANITIZER_LIBIGNORE_H #include "sanitizer_internal_defs.h" #include "sanitizer_common.h" #include "sanitizer_atomic.h" #include "sanitizer_mutex.h" namespace __sanitizer { class LibIgnore { public: explicit LibIgnore(LinkerInitialized); // Must be called during initialization. void AddIgnoredLibrary(const char *name_templ); // Must be called after a new dynamic library is loaded. void OnLibraryLoaded(const char *name); // Must be called after a dynamic library is unloaded. void OnLibraryUnloaded(); // Checks whether the provided PC belongs to one of the ignored libraries. bool IsIgnored(uptr pc) const; private: struct Lib { char *templ; char *name; char *real_name; // target of symlink bool loaded; }; struct LibCodeRange { uptr begin; uptr end; }; static const uptr kMaxLibs = 128; // Hot part: atomic_uintptr_t loaded_count_; LibCodeRange code_ranges_[kMaxLibs]; // Cold part: BlockingMutex mutex_; uptr count_; Lib libs_[kMaxLibs]; // Disallow copying of LibIgnore objects. LibIgnore(const LibIgnore&); // not implemented void operator = (const LibIgnore&); // not implemented }; inline bool LibIgnore::IsIgnored(uptr pc) const { const uptr n = atomic_load(&loaded_count_, memory_order_acquire); for (uptr i = 0; i < n; i++) { if (pc >= code_ranges_[i].begin && pc < code_ranges_[i].end) return true; } return false; } } // namespace __sanitizer #endif // SANITIZER_LIBIGNORE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_flags.h0000664000175000017500000000401412673053307030671 0ustar mwhudsonmwhudson//===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_FLAGS_H #define SANITIZER_FLAGS_H #include "sanitizer_internal_defs.h" namespace __sanitizer { struct CommonFlags { #define COMMON_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "sanitizer_flags.inc" #undef COMMON_FLAG void SetDefaults(); void CopyFrom(const CommonFlags &other); }; // Functions to get/set global CommonFlags shared by all sanitizer runtimes: extern CommonFlags common_flags_dont_use; inline const CommonFlags *common_flags() { return &common_flags_dont_use; } inline void SetCommonFlagsDefaults() { common_flags_dont_use.SetDefaults(); } // This function can only be used to setup tool-specific overrides for // CommonFlags defaults. Generally, it should only be used right after // SetCommonFlagsDefaults(), but before ParseCommonFlagsFromString(), and // only during the flags initialization (i.e. before they are used for // the first time). inline void OverrideCommonFlags(const CommonFlags &cf) { common_flags_dont_use.CopyFrom(cf); } void SubstituteForFlagValue(const char *s, char *out, uptr out_size); class FlagParser; void RegisterCommonFlags(FlagParser *parser, CommonFlags *cf = &common_flags_dont_use); void RegisterIncludeFlags(FlagParser *parser, CommonFlags *cf); // Should be called after parsing all flags. Sets up common flag values // and perform initializations common to all sanitizers (e.g. setting // verbosity). void InitializeCommonFlags(CommonFlags *cf = &common_flags_dont_use); } // namespace __sanitizer #endif // SANITIZER_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stackdepot.cc0000664000175000017500000001130412603072726032073 0ustar mwhudsonmwhudson//===-- sanitizer_stackdepot.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_stackdepot.h" #include "sanitizer_common.h" #include "sanitizer_stackdepotbase.h" namespace __sanitizer { struct StackDepotNode { StackDepotNode *link; u32 id; atomic_uint32_t hash_and_use_count; // hash_bits : 12; use_count : 20; u32 size; u32 tag; uptr stack[1]; // [size] static const u32 kTabSizeLog = 20; // Lower kTabSizeLog bits are equal for all items in one bucket. // We use these bits to store the per-stack use counter. static const u32 kUseCountBits = kTabSizeLog; static const u32 kMaxUseCount = 1 << kUseCountBits; static const u32 kUseCountMask = (1 << kUseCountBits) - 1; static const u32 kHashMask = ~kUseCountMask; typedef StackTrace args_type; bool eq(u32 hash, const args_type &args) const { u32 hash_bits = atomic_load(&hash_and_use_count, memory_order_relaxed) & kHashMask; if ((hash & kHashMask) != hash_bits || args.size != size || args.tag != tag) return false; uptr i = 0; for (; i < size; i++) { if (stack[i] != args.trace[i]) return false; } return true; } static uptr storage_size(const args_type &args) { return sizeof(StackDepotNode) + (args.size - 1) * sizeof(uptr); } static u32 hash(const args_type &args) { // murmur2 const u32 m = 0x5bd1e995; const u32 seed = 0x9747b28c; const u32 r = 24; u32 h = seed ^ (args.size * sizeof(uptr)); for (uptr i = 0; i < args.size; i++) { u32 k = args.trace[i]; k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; } h ^= h >> 13; h *= m; h ^= h >> 15; return h; } static bool is_valid(const args_type &args) { return args.size > 0 && args.trace; } void store(const args_type &args, u32 hash) { atomic_store(&hash_and_use_count, hash & kHashMask, memory_order_relaxed); size = args.size; tag = args.tag; internal_memcpy(stack, args.trace, size * sizeof(uptr)); } args_type load() const { return args_type(&stack[0], size, tag); } StackDepotHandle get_handle() { return StackDepotHandle(this); } typedef StackDepotHandle handle_type; }; COMPILER_CHECK(StackDepotNode::kMaxUseCount == (u32)kStackDepotMaxUseCount); u32 StackDepotHandle::id() { return node_->id; } int StackDepotHandle::use_count() { return atomic_load(&node_->hash_and_use_count, memory_order_relaxed) & StackDepotNode::kUseCountMask; } void StackDepotHandle::inc_use_count_unsafe() { u32 prev = atomic_fetch_add(&node_->hash_and_use_count, 1, memory_order_relaxed) & StackDepotNode::kUseCountMask; CHECK_LT(prev + 1, StackDepotNode::kMaxUseCount); } // FIXME(dvyukov): this single reserved bit is used in TSan. typedef StackDepotBase StackDepot; static StackDepot theDepot; StackDepotStats *StackDepotGetStats() { return theDepot.GetStats(); } u32 StackDepotPut(StackTrace stack) { StackDepotHandle h = theDepot.Put(stack); return h.valid() ? h.id() : 0; } StackDepotHandle StackDepotPut_WithHandle(StackTrace stack) { return theDepot.Put(stack); } StackTrace StackDepotGet(u32 id) { return theDepot.Get(id); } void StackDepotLockAll() { theDepot.LockAll(); } void StackDepotUnlockAll() { theDepot.UnlockAll(); } bool StackDepotReverseMap::IdDescPair::IdComparator( const StackDepotReverseMap::IdDescPair &a, const StackDepotReverseMap::IdDescPair &b) { return a.id < b.id; } StackDepotReverseMap::StackDepotReverseMap() : map_(StackDepotGetStats()->n_uniq_ids + 100) { for (int idx = 0; idx < StackDepot::kTabSize; idx++) { atomic_uintptr_t *p = &theDepot.tab[idx]; uptr v = atomic_load(p, memory_order_consume); StackDepotNode *s = (StackDepotNode*)(v & ~1); for (; s; s = s->link) { IdDescPair pair = {s->id, s}; map_.push_back(pair); } } InternalSort(&map_, map_.size(), IdDescPair::IdComparator); } StackTrace StackDepotReverseMap::Get(u32 id) { if (!map_.size()) return StackTrace(); IdDescPair pair = {id, nullptr}; uptr idx = InternalBinarySearch(map_, 0, map_.size(), pair, IdDescPair::IdComparator); if (idx > map_.size()) return StackTrace(); return map_[idx].desc->load(); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_flags.cc0000664000175000017500000000737712750432072031042 0ustar mwhudsonmwhudson//===-- sanitizer_flags.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // //===----------------------------------------------------------------------===// #include "sanitizer_flags.h" #include "sanitizer_common.h" #include "sanitizer_libc.h" #include "sanitizer_list.h" #include "sanitizer_flag_parser.h" namespace __sanitizer { CommonFlags common_flags_dont_use; struct FlagDescription { const char *name; const char *description; FlagDescription *next; }; IntrusiveList flag_descriptions; void CommonFlags::SetDefaults() { #define COMMON_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "sanitizer_flags.inc" #undef COMMON_FLAG } void CommonFlags::CopyFrom(const CommonFlags &other) { internal_memcpy(this, &other, sizeof(*this)); } // Copy the string from "s" to "out", making the following substitutions: // %b = binary basename // %p = pid void SubstituteForFlagValue(const char *s, char *out, uptr out_size) { char *out_end = out + out_size; while (*s && out < out_end - 1) { if (s[0] != '%') { *out++ = *s++; continue; } switch (s[1]) { case 'b': { const char *base = GetProcessName(); CHECK(base); while (*base && out < out_end - 1) *out++ = *base++; s += 2; // skip "%b" break; } case 'p': { int pid = internal_getpid(); char buf[32]; char *buf_pos = buf + 32; do { *--buf_pos = (pid % 10) + '0'; pid /= 10; } while (pid); while (buf_pos < buf + 32 && out < out_end - 1) *out++ = *buf_pos++; s += 2; // skip "%p" break; } default: *out++ = *s++; break; } } CHECK(out < out_end - 1); *out = '\0'; } class FlagHandlerInclude : public FlagHandlerBase { FlagParser *parser_; bool ignore_missing_; public: explicit FlagHandlerInclude(FlagParser *parser, bool ignore_missing) : parser_(parser), ignore_missing_(ignore_missing) {} bool Parse(const char *value) final { if (internal_strchr(value, '%')) { char *buf = (char *)MmapOrDie(kMaxPathLength, "FlagHandlerInclude"); SubstituteForFlagValue(value, buf, kMaxPathLength); bool res = parser_->ParseFile(buf, ignore_missing_); UnmapOrDie(buf, kMaxPathLength); return res; } return parser_->ParseFile(value, ignore_missing_); } }; void RegisterIncludeFlags(FlagParser *parser, CommonFlags *cf) { FlagHandlerInclude *fh_include = new (FlagParser::Alloc) // NOLINT FlagHandlerInclude(parser, /*ignore_missing*/ false); parser->RegisterHandler("include", fh_include, "read more options from the given file"); FlagHandlerInclude *fh_include_if_exists = new (FlagParser::Alloc) // NOLINT FlagHandlerInclude(parser, /*ignore_missing*/ true); parser->RegisterHandler( "include_if_exists", fh_include_if_exists, "read more options from the given file (if it exists)"); } void RegisterCommonFlags(FlagParser *parser, CommonFlags *cf) { #define COMMON_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &cf->Name); #include "sanitizer_flags.inc" #undef COMMON_FLAG RegisterIncludeFlags(parser, cf); } void InitializeCommonFlags(CommonFlags *cf) { // need to record coverage to generate coverage report. cf->coverage |= cf->html_cov_report; SetVerbosity(cf->verbosity); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_mac.cc0000664000175000017500000001232312766606136032763 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_mac.cc ---------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between various sanitizers' runtime libraries. // // Implementation of Mac-specific "atos" symbolizer. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_allocator_internal.h" #include "sanitizer_mac.h" #include "sanitizer_symbolizer_mac.h" #include #include #include #include #include #include namespace __sanitizer { bool DlAddrSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) { Dl_info info; int result = dladdr((const void *)addr, &info); if (!result) return false; const char *demangled = DemangleSwiftAndCXX(info.dli_sname); if (!demangled) return false; stack->info.function = internal_strdup(demangled); return true; } bool DlAddrSymbolizer::SymbolizeData(uptr addr, DataInfo *datainfo) { Dl_info info; int result = dladdr((const void *)addr, &info); if (!result) return false; const char *demangled = DemangleSwiftAndCXX(info.dli_sname); datainfo->name = internal_strdup(demangled); datainfo->start = (uptr)info.dli_saddr; return true; } class AtosSymbolizerProcess : public SymbolizerProcess { public: explicit AtosSymbolizerProcess(const char *path, pid_t parent_pid) : SymbolizerProcess(path, /*use_forkpty*/ true) { // Put the string command line argument in the object so that it outlives // the call to GetArgV. internal_snprintf(pid_str_, sizeof(pid_str_), "%d", parent_pid); } private: bool ReachedEndOfOutput(const char *buffer, uptr length) const override { return (length >= 1 && buffer[length - 1] == '\n'); } void GetArgV(const char *path_to_binary, const char *(&argv)[kArgVMax]) const override { int i = 0; argv[i++] = path_to_binary; argv[i++] = "-p"; argv[i++] = &pid_str_[0]; if (GetMacosVersion() == MACOS_VERSION_MAVERICKS) { // On Mavericks atos prints a deprecation warning which we suppress by // passing -d. The warning isn't present on other OSX versions, even the // newer ones. argv[i++] = "-d"; } argv[i++] = nullptr; } char pid_str_[16]; }; static bool ParseCommandOutput(const char *str, uptr addr, char **out_name, char **out_module, char **out_file, uptr *line, uptr *start_address) { // Trim ending newlines. char *trim; ExtractTokenUpToDelimiter(str, "\n", &trim); // The line from `atos` is in one of these formats: // myfunction (in library.dylib) (sourcefile.c:17) // myfunction (in library.dylib) + 0x1fe // myfunction (in library.dylib) + 15 // 0xdeadbeef (in library.dylib) + 0x1fe // 0xdeadbeef (in library.dylib) + 15 // 0xdeadbeef (in library.dylib) // 0xdeadbeef const char *rest = trim; char *symbol_name; rest = ExtractTokenUpToDelimiter(rest, " (in ", &symbol_name); if (rest[0] == '\0') { InternalFree(symbol_name); InternalFree(trim); return false; } if (internal_strncmp(symbol_name, "0x", 2) != 0) *out_name = symbol_name; else InternalFree(symbol_name); rest = ExtractTokenUpToDelimiter(rest, ") ", out_module); if (rest[0] == '(') { if (out_file) { rest++; rest = ExtractTokenUpToDelimiter(rest, ":", out_file); char *extracted_line_number; rest = ExtractTokenUpToDelimiter(rest, ")", &extracted_line_number); if (line) *line = (uptr)internal_atoll(extracted_line_number); InternalFree(extracted_line_number); } } else if (rest[0] == '+') { rest += 2; uptr offset = internal_atoll(rest); if (start_address) *start_address = addr - offset; } InternalFree(trim); return true; } AtosSymbolizer::AtosSymbolizer(const char *path, LowLevelAllocator *allocator) : process_(new(*allocator) AtosSymbolizerProcess(path, getpid())) {} bool AtosSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) { if (!process_) return false; if (addr == 0) return false; char command[32]; internal_snprintf(command, sizeof(command), "0x%zx\n", addr); const char *buf = process_->SendCommand(command); if (!buf) return false; uptr line; if (!ParseCommandOutput(buf, addr, &stack->info.function, &stack->info.module, &stack->info.file, &line, nullptr)) { process_ = nullptr; return false; } stack->info.line = (int)line; return true; } bool AtosSymbolizer::SymbolizeData(uptr addr, DataInfo *info) { if (!process_) return false; char command[32]; internal_snprintf(command, sizeof(command), "0x%zx\n", addr); const char *buf = process_->SendCommand(command); if (!buf) return false; if (!ParseCommandOutput(buf, addr, &info->name, &info->module, nullptr, nullptr, &info->start)) { process_ = nullptr; return false; } return true; } } // namespace __sanitizer #endif // SANITIZER_MAC golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_procmaps_common.cc0000664000175000017500000001224712662654403033140 0ustar mwhudsonmwhudson//===-- sanitizer_procmaps_common.cc --------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Information about the process mappings (common parts). //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "sanitizer_common.h" #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" namespace __sanitizer { // Linker initialized. ProcSelfMapsBuff MemoryMappingLayout::cached_proc_self_maps_; StaticSpinMutex MemoryMappingLayout::cache_lock_; // Linker initialized. static int TranslateDigit(char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 10; if (c >= 'A' && c <= 'F') return c - 'A' + 10; return -1; } // Parse a number and promote 'p' up to the first non-digit character. static uptr ParseNumber(const char **p, int base) { uptr n = 0; int d; CHECK(base >= 2 && base <= 16); while ((d = TranslateDigit(**p)) >= 0 && d < base) { n = n * base + d; (*p)++; } return n; } bool IsDecimal(char c) { int d = TranslateDigit(c); return d >= 0 && d < 10; } uptr ParseDecimal(const char **p) { return ParseNumber(p, 10); } bool IsHex(char c) { int d = TranslateDigit(c); return d >= 0 && d < 16; } uptr ParseHex(const char **p) { return ParseNumber(p, 16); } MemoryMappingLayout::MemoryMappingLayout(bool cache_enabled) { ReadProcMaps(&proc_self_maps_); if (cache_enabled) { if (proc_self_maps_.mmaped_size == 0) { LoadFromCache(); CHECK_GT(proc_self_maps_.len, 0); } } else { CHECK_GT(proc_self_maps_.mmaped_size, 0); } Reset(); // FIXME: in the future we may want to cache the mappings on demand only. if (cache_enabled) CacheMemoryMappings(); } MemoryMappingLayout::~MemoryMappingLayout() { // Only unmap the buffer if it is different from the cached one. Otherwise // it will be unmapped when the cache is refreshed. if (proc_self_maps_.data != cached_proc_self_maps_.data) { UnmapOrDie(proc_self_maps_.data, proc_self_maps_.mmaped_size); } } void MemoryMappingLayout::Reset() { current_ = proc_self_maps_.data; } // static void MemoryMappingLayout::CacheMemoryMappings() { SpinMutexLock l(&cache_lock_); // Don't invalidate the cache if the mappings are unavailable. ProcSelfMapsBuff old_proc_self_maps; old_proc_self_maps = cached_proc_self_maps_; ReadProcMaps(&cached_proc_self_maps_); if (cached_proc_self_maps_.mmaped_size == 0) { cached_proc_self_maps_ = old_proc_self_maps; } else { if (old_proc_self_maps.mmaped_size) { UnmapOrDie(old_proc_self_maps.data, old_proc_self_maps.mmaped_size); } } } void MemoryMappingLayout::LoadFromCache() { SpinMutexLock l(&cache_lock_); if (cached_proc_self_maps_.data) { proc_self_maps_ = cached_proc_self_maps_; } } void MemoryMappingLayout::DumpListOfModules( InternalMmapVector *modules) { Reset(); uptr cur_beg, cur_end, cur_offset, prot; InternalScopedString module_name(kMaxPathLength); for (uptr i = 0; Next(&cur_beg, &cur_end, &cur_offset, module_name.data(), module_name.size(), &prot); i++) { const char *cur_name = module_name.data(); if (cur_name[0] == '\0') continue; // Don't subtract 'cur_beg' from the first entry: // * If a binary is compiled w/o -pie, then the first entry in // process maps is likely the binary itself (all dynamic libs // are mapped higher in address space). For such a binary, // instruction offset in binary coincides with the actual // instruction address in virtual memory (as code section // is mapped to a fixed memory range). // * If a binary is compiled with -pie, all the modules are // mapped high at address space (in particular, higher than // shadow memory of the tool), so the module can't be the // first entry. uptr base_address = (i ? cur_beg : 0) - cur_offset; LoadedModule cur_module; cur_module.set(cur_name, base_address); cur_module.addAddressRange(cur_beg, cur_end, prot & kProtectionExecute); modules->push_back(cur_module); } } void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size) { char *smaps = nullptr; uptr smaps_cap = 0; uptr smaps_len = 0; if (!ReadFileToBuffer("/proc/self/smaps", &smaps, &smaps_cap, &smaps_len)) return; uptr start = 0; bool file = false; const char *pos = smaps; while (pos < smaps + smaps_len) { if (IsHex(pos[0])) { start = ParseHex(&pos); for (; *pos != '/' && *pos > '\n'; pos++) {} file = *pos == '/'; } else if (internal_strncmp(pos, "Rss:", 4) == 0) { while (!IsDecimal(*pos)) pos++; uptr rss = ParseDecimal(&pos) * 1024; cb(start, rss, file, stats, stats_size); } while (*pos++ != '\n') {} } UnmapOrDie(smaps, smaps_cap); } } // namespace __sanitizer #endif // SANITIZER_FREEBSD || SANITIZER_LINUX ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_deadlock_detector_interface.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_deadlock_detector_inte0000664000175000017500000000520412720016321034013 0ustar mwhudsonmwhudson//===-- sanitizer_deadlock_detector_interface.h -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. // Abstract deadlock detector interface. // FIXME: this is work in progress, nothing really works yet. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_DEADLOCK_DETECTOR_INTERFACE_H #define SANITIZER_DEADLOCK_DETECTOR_INTERFACE_H #ifndef SANITIZER_DEADLOCK_DETECTOR_VERSION # define SANITIZER_DEADLOCK_DETECTOR_VERSION 1 #endif #include "sanitizer_internal_defs.h" #include "sanitizer_atomic.h" namespace __sanitizer { // dd - deadlock detector. // lt - logical (user) thread. // pt - physical (OS) thread. struct DDPhysicalThread; struct DDLogicalThread; struct DDMutex { #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 1 uptr id; u32 stk; // creation stack #elif SANITIZER_DEADLOCK_DETECTOR_VERSION == 2 u32 id; u32 recursion; atomic_uintptr_t owner; #else # error "BAD SANITIZER_DEADLOCK_DETECTOR_VERSION" #endif u64 ctx; }; struct DDFlags { bool second_deadlock_stack; }; struct DDReport { enum { kMaxLoopSize = 20 }; int n; // number of entries in loop struct { u64 thr_ctx; // user thread context u64 mtx_ctx0; // user mutex context, start of the edge u64 mtx_ctx1; // user mutex context, end of the edge u32 stk[2]; // stack ids for the edge } loop[kMaxLoopSize]; }; struct DDCallback { DDPhysicalThread *pt; DDLogicalThread *lt; virtual u32 Unwind() { return 0; } virtual int UniqueTid() { return 0; } }; struct DDetector { static DDetector *Create(const DDFlags *flags); virtual DDPhysicalThread* CreatePhysicalThread() { return nullptr; } virtual void DestroyPhysicalThread(DDPhysicalThread *pt) {} virtual DDLogicalThread* CreateLogicalThread(u64 ctx) { return nullptr; } virtual void DestroyLogicalThread(DDLogicalThread *lt) {} virtual void MutexInit(DDCallback *cb, DDMutex *m) {} virtual void MutexBeforeLock(DDCallback *cb, DDMutex *m, bool wlock) {} virtual void MutexAfterLock(DDCallback *cb, DDMutex *m, bool wlock, bool trylock) {} virtual void MutexBeforeUnlock(DDCallback *cb, DDMutex *m, bool wlock) {} virtual void MutexDestroy(DDCallback *cb, DDMutex *m) {} virtual DDReport *GetReport(DDCallback *cb) { return nullptr; } }; } // namespace __sanitizer #endif // SANITIZER_DEADLOCK_DETECTOR_INTERFACE_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stacktrace.cc0000664000175000017500000001104212734471500032053 0ustar mwhudsonmwhudson//===-- sanitizer_stacktrace.cc -------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_stacktrace.h" namespace __sanitizer { uptr StackTrace::GetNextInstructionPc(uptr pc) { #if defined(__mips__) return pc + 8; #elif defined(__powerpc__) return pc + 4; #else return pc + 1; #endif } uptr StackTrace::GetCurrentPc() { return GET_CALLER_PC(); } void BufferedStackTrace::Init(const uptr *pcs, uptr cnt, uptr extra_top_pc) { size = cnt + !!extra_top_pc; CHECK_LE(size, kStackTraceMax); internal_memcpy(trace_buffer, pcs, cnt * sizeof(trace_buffer[0])); if (extra_top_pc) trace_buffer[cnt] = extra_top_pc; top_frame_bp = 0; } // In GCC on ARM bp points to saved lr, not fp, so we should check the next // cell in stack to be a saved frame pointer. GetCanonicFrame returns the // pointer to saved frame pointer in any case. static inline uhwptr *GetCanonicFrame(uptr bp, uptr stack_top, uptr stack_bottom) { #ifdef __arm__ if (!IsValidFrame(bp, stack_top, stack_bottom)) return 0; uhwptr *bp_prev = (uhwptr *)bp; if (IsValidFrame((uptr)bp_prev[0], stack_top, stack_bottom)) return bp_prev; // The next frame pointer does not look right. This could be a GCC frame, step // back by 1 word and try again. if (IsValidFrame((uptr)bp_prev[-1], stack_top, stack_bottom)) return bp_prev - 1; // Nope, this does not look right either. This means the frame after next does // not have a valid frame pointer, but we can still extract the caller PC. // Unfortunately, there is no way to decide between GCC and LLVM frame // layouts. Assume LLVM. return bp_prev; #else return (uhwptr*)bp; #endif } void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top, uptr stack_bottom, u32 max_depth) { const uptr kPageSize = GetPageSizeCached(); CHECK_GE(max_depth, 2); trace_buffer[0] = pc; size = 1; if (stack_top < 4096) return; // Sanity check for stack top. uhwptr *frame = GetCanonicFrame(bp, stack_top, stack_bottom); // Lowest possible address that makes sense as the next frame pointer. // Goes up as we walk the stack. uptr bottom = stack_bottom; // Avoid infinite loop when frame == frame[0] by using frame > prev_frame. while (IsValidFrame((uptr)frame, stack_top, bottom) && IsAligned((uptr)frame, sizeof(*frame)) && size < max_depth) { #ifdef __powerpc__ // PowerPC ABIs specify that the return address is saved at offset // 16 of the *caller's* stack frame. Thus we must dereference the // back chain to find the caller frame before extracting it. uhwptr *caller_frame = (uhwptr*)frame[0]; if (!IsValidFrame((uptr)caller_frame, stack_top, bottom) || !IsAligned((uptr)caller_frame, sizeof(uhwptr))) break; uhwptr pc1 = caller_frame[2]; #elif defined(__s390__) uhwptr pc1 = frame[14]; #else uhwptr pc1 = frame[1]; #endif // Let's assume that any pointer in the 0th page (i.e. <0x1000 on i386 and // x86_64) is invalid and stop unwinding here. If we're adding support for // a platform where this isn't true, we need to reconsider this check. if (pc1 < kPageSize) break; if (pc1 != pc) { trace_buffer[size++] = (uptr) pc1; } bottom = (uptr)frame; frame = GetCanonicFrame((uptr)frame[0], stack_top, bottom); } } static bool MatchPc(uptr cur_pc, uptr trace_pc, uptr threshold) { return cur_pc - trace_pc <= threshold || trace_pc - cur_pc <= threshold; } void BufferedStackTrace::PopStackFrames(uptr count) { CHECK_LT(count, size); size -= count; for (uptr i = 0; i < size; ++i) { trace_buffer[i] = trace_buffer[i + count]; } } uptr BufferedStackTrace::LocatePcInTrace(uptr pc) { // Use threshold to find PC in stack trace, as PC we want to unwind from may // slightly differ from return address in the actual unwinded stack trace. const int kPcThreshold = 350; for (uptr i = 0; i < size; ++i) { if (MatchPc(pc, trace[i], kPcThreshold)) return i; } return 0; } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stacktrace_printer.cc0000664000175000017500000001254512767671510033640 0ustar mwhudsonmwhudson//===-- sanitizer_common.cc -----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between sanitizers' run-time libraries. // //===----------------------------------------------------------------------===// #include "sanitizer_stacktrace_printer.h" namespace __sanitizer { static const char *StripFunctionName(const char *function, const char *prefix) { if (!function) return nullptr; if (!prefix) return function; uptr prefix_len = internal_strlen(prefix); if (0 == internal_strncmp(function, prefix, prefix_len)) return function + prefix_len; return function; } static const char kDefaultFormat[] = " #%n %p %F %L"; void RenderFrame(InternalScopedString *buffer, const char *format, int frame_no, const AddressInfo &info, bool vs_style, const char *strip_path_prefix, const char *strip_func_prefix) { if (0 == internal_strcmp(format, "DEFAULT")) format = kDefaultFormat; for (const char *p = format; *p != '\0'; p++) { if (*p != '%') { buffer->append("%c", *p); continue; } p++; switch (*p) { case '%': buffer->append("%%"); break; // Frame number and all fields of AddressInfo structure. case 'n': buffer->append("%zu", frame_no); break; case 'p': buffer->append("0x%zx", info.address); break; case 'm': buffer->append("%s", StripPathPrefix(info.module, strip_path_prefix)); break; case 'o': buffer->append("0x%zx", info.module_offset); break; case 'f': buffer->append("%s", StripFunctionName(info.function, strip_func_prefix)); break; case 'q': buffer->append("0x%zx", info.function_offset != AddressInfo::kUnknown ? info.function_offset : 0x0); break; case 's': buffer->append("%s", StripPathPrefix(info.file, strip_path_prefix)); break; case 'l': buffer->append("%d", info.line); break; case 'c': buffer->append("%d", info.column); break; // Smarter special cases. case 'F': // Function name and offset, if file is unknown. if (info.function) { buffer->append("in %s", StripFunctionName(info.function, strip_func_prefix)); if (!info.file && info.function_offset != AddressInfo::kUnknown) buffer->append("+0x%zx", info.function_offset); } break; case 'S': // File/line information. RenderSourceLocation(buffer, info.file, info.line, info.column, vs_style, strip_path_prefix); break; case 'L': // Source location, or module location. if (info.file) { RenderSourceLocation(buffer, info.file, info.line, info.column, vs_style, strip_path_prefix); } else if (info.module) { RenderModuleLocation(buffer, info.module, info.module_offset, strip_path_prefix); } else { buffer->append("()"); } break; case 'M': // Module basename and offset, or PC. if (info.address & kExternalPCBit) {} // There PCs are not meaningful. else if (info.module) buffer->append("(%s+%p)", StripModuleName(info.module), (void *)info.module_offset); else buffer->append("(%p)", (void *)info.address); break; default: Report("Unsupported specifier in stack frame format: %c (0x%zx)!\n", *p, *p); Die(); } } } void RenderData(InternalScopedString *buffer, const char *format, const DataInfo *DI, const char *strip_path_prefix) { for (const char *p = format; *p != '\0'; p++) { if (*p != '%') { buffer->append("%c", *p); continue; } p++; switch (*p) { case '%': buffer->append("%%"); break; case 's': buffer->append("%s", StripPathPrefix(DI->file, strip_path_prefix)); break; case 'l': buffer->append("%d", DI->line); break; case 'g': buffer->append("%s", DI->name); break; default: Report("Unsupported specifier in stack frame format: %c (0x%zx)!\n", *p, *p); Die(); } } } void RenderSourceLocation(InternalScopedString *buffer, const char *file, int line, int column, bool vs_style, const char *strip_path_prefix) { if (vs_style && line > 0) { buffer->append("%s(%d", StripPathPrefix(file, strip_path_prefix), line); if (column > 0) buffer->append(",%d", column); buffer->append(")"); return; } buffer->append("%s", StripPathPrefix(file, strip_path_prefix)); if (line > 0) { buffer->append(":%d", line); if (column > 0) buffer->append(":%d", column); } } void RenderModuleLocation(InternalScopedString *buffer, const char *module, uptr offset, const char *strip_path_prefix) { buffer->append("(%s+0x%zx)", StripPathPrefix(module, strip_path_prefix), offset); } } // namespace __sanitizer ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_interceptors.hgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_platform_interceptors.0000664000175000017500000003203412764640456034065 0ustar mwhudsonmwhudson//===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines macro telling whether sanitizer tools can/should intercept // given library functions on a given platform. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H #define SANITIZER_PLATFORM_INTERCEPTORS_H #include "sanitizer_internal_defs.h" #if !SANITIZER_WINDOWS # define SI_NOT_WINDOWS 1 # include "sanitizer_platform_limits_posix.h" #else # define SI_NOT_WINDOWS 0 #endif #if SANITIZER_LINUX && !SANITIZER_ANDROID # define SI_LINUX_NOT_ANDROID 1 #else # define SI_LINUX_NOT_ANDROID 0 #endif #if SANITIZER_ANDROID # define SI_ANDROID 1 #else # define SI_ANDROID 0 #endif #if SANITIZER_FREEBSD # define SI_FREEBSD 1 #else # define SI_FREEBSD 0 #endif #if SANITIZER_LINUX # define SI_LINUX 1 #else # define SI_LINUX 0 #endif #if SANITIZER_MAC # define SI_MAC 1 # define SI_NOT_MAC 0 #else # define SI_MAC 0 # define SI_NOT_MAC 1 #endif #if SANITIZER_IOS # define SI_IOS 1 #else # define SI_IOS 0 #endif #if !SANITIZER_WINDOWS && !SANITIZER_MAC # define SI_UNIX_NOT_MAC 1 #else # define SI_UNIX_NOT_MAC 0 #endif #define SANITIZER_INTERCEPT_STRLEN 1 #define SANITIZER_INTERCEPT_STRNLEN SI_NOT_MAC #define SANITIZER_INTERCEPT_STRCMP 1 #define SANITIZER_INTERCEPT_STRSTR 1 #define SANITIZER_INTERCEPT_STRCASESTR SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_STRCHR 1 #define SANITIZER_INTERCEPT_STRCHRNUL SI_UNIX_NOT_MAC #define SANITIZER_INTERCEPT_STRRCHR 1 #define SANITIZER_INTERCEPT_STRSPN 1 #define SANITIZER_INTERCEPT_STRPBRK 1 #define SANITIZER_INTERCEPT_TEXTDOMAIN SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRCASECMP SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MEMSET 1 #define SANITIZER_INTERCEPT_MEMMOVE 1 #define SANITIZER_INTERCEPT_MEMCPY 1 #define SANITIZER_INTERCEPT_MEMCMP 1 // FIXME: enable memmem on Windows. #define SANITIZER_INTERCEPT_MEMMEM SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MEMCHR 1 #define SANITIZER_INTERCEPT_MEMRCHR SI_FREEBSD || SI_LINUX #define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_READV SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WRITEV SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PREADV SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PWRITEV SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PREADV64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PWRITEV64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PRCTL SI_LINUX #define SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_STRPTIME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SCANF SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX_NOT_ANDROID #ifndef SANITIZER_INTERCEPT_PRINTF # define SANITIZER_INTERCEPT_PRINTF SI_NOT_WINDOWS # define SANITIZER_INTERCEPT_PRINTF_L SI_FREEBSD # define SANITIZER_INTERCEPT_ISOC99_PRINTF SI_LINUX_NOT_ANDROID #endif #define SANITIZER_INTERCEPT_FREXP 1 #define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETPWENT \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETPWENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SETPWENT SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_CLOCK_GETTIME SI_FREEBSD || SI_LINUX #define SANITIZER_INTERCEPT_GETITIMER SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_TIME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_WAIT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_INET SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_GETSCHEDPARAM SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETADDRINFO SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETNAMEINFO SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETSOCKNAME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETHOSTBYNAME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETHOSTBYNAME_R SI_FREEBSD || SI_LINUX #define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETHOSTBYADDR_R SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETHOSTENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETSOCKOPT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ACCEPT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ACCEPT4 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_MODF SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_RECVMSG SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SENDMSG SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETPEERNAME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_IOCTL SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_INET_ATON SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SYSINFO SI_LINUX #define SANITIZER_INTERCEPT_READDIR SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_READDIR64 SI_LINUX_NOT_ANDROID #if SI_LINUX_NOT_ANDROID && \ (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \ defined(__s390__)) #define SANITIZER_INTERCEPT_PTRACE 1 #else #define SANITIZER_INTERCEPT_PTRACE 0 #endif #define SANITIZER_INTERCEPT_SETLOCALE SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETCWD SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRTOIMAX SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MBSTOWCS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MBSNRTOWCS SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_WCSTOMBS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WCSNRTOMBS \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_WCRTOMB \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_TCGETATTR SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_REALPATH SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_CONFSTR \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCHED_GETAFFINITY SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCHED_GETPARAM SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRERROR SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_STRERROR_R SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_XPG_STRERROR_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCANDIR \ SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCANDIR64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETGROUPS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_POLL SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_WORDEXP \ SI_FREEBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGWAIT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SIGWAITINFO SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGTIMEDWAIT SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGSETOPS \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGPENDING SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SIGPROCMASK SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_BACKTRACE SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETMNTENT SI_LINUX #define SANITIZER_INTERCEPT_GETMNTENT_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STATFS SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STATFS64 \ (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STATVFS SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STATVFS64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_INITGROUPS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ETHER_NTOA_ATON SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ETHER_HOST \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_ETHER_R SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SHMCTL \ ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && SANITIZER_WORDSIZE == 64) #define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETAFFINITY_NP SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPSHARED SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETTYPE SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPROTOCOL \ SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPRIOCEILING \ SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST_NP SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETPSHARED SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETKIND_NP SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETPSHARED SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETCLOCK SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PTHREAD_BARRIERATTR_GETPSHARED SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_TMPNAM SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_TMPNAM_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_TTYNAME_R SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_TEMPNAM SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SINCOS SI_LINUX #define SANITIZER_INTERCEPT_REMQUO SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_LGAMMA SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_LGAMMA_R SI_FREEBSD || SI_LINUX #define SANITIZER_INTERCEPT_LGAMMAL_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_DRAND48_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_RAND_R \ SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_ICONV SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_TIMES SI_NOT_WINDOWS // FIXME: getline seems to be available on OSX 10.7 #define SANITIZER_INTERCEPT_GETLINE SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT__EXIT SI_LINUX || SI_FREEBSD || SI_MAC #define SANITIZER_INTERCEPT_PHTREAD_MUTEX SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP \ SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_TLS_GET_ADDR \ SI_FREEBSD || SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_LISTXATTR SI_LINUX #define SANITIZER_INTERCEPT_GETXATTR SI_LINUX #define SANITIZER_INTERCEPT_GETRESID SI_LINUX #define SANITIZER_INTERCEPT_GETIFADDRS \ SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC #define SANITIZER_INTERCEPT_IF_INDEXTONAME \ SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC #define SANITIZER_INTERCEPT_CAPGET SI_LINUX_NOT_ANDROID #if SI_LINUX && defined(__arm__) #define SANITIZER_INTERCEPT_AEABI_MEM 1 #else #define SANITIZER_INTERCEPT_AEABI_MEM 0 #endif #define SANITIZER_INTERCEPT___BZERO SI_MAC #define SANITIZER_INTERCEPT_FTIME !SI_FREEBSD && SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_XDR SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_TSEARCH SI_LINUX_NOT_ANDROID || SI_MAC #define SANITIZER_INTERCEPT_LIBIO_INTERNALS SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_FOPEN SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_FOPEN64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_OPEN_MEMSTREAM SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_OBSTACK SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_FFLUSH SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_FCLOSE SI_NOT_WINDOWS #ifndef SANITIZER_INTERCEPT_DLOPEN_DLCLOSE #define SANITIZER_INTERCEPT_DLOPEN_DLCLOSE \ SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC #endif #define SANITIZER_INTERCEPT_GETPASS SI_LINUX_NOT_ANDROID || SI_MAC #define SANITIZER_INTERCEPT_TIMERFD SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_MLOCKX SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_FOPENCOOKIE SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SEM SI_LINUX || SI_FREEBSD #define SANITIZER_INTERCEPT_PTHREAD_SETCANCEL SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MINCORE SI_LINUX #define SANITIZER_INTERCEPT_PROCESS_VM_READV SI_LINUX #define SANITIZER_INTERCEPT_CTERMID SI_LINUX || SI_MAC || SI_FREEBSD #define SANITIZER_INTERCEPT_CTERMID_R SI_MAC || SI_FREEBSD #define SANITIZER_INTERCEPTOR_HOOKS SI_LINUX #define SANITIZER_INTERCEPT_RECV_RECVFROM SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SEND_SENDTO SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_EVENTFD_READ_WRITE SI_LINUX #define SANITIZER_INTERCEPT_STAT (SI_FREEBSD || SI_MAC || SI_ANDROID) #define SANITIZER_INTERCEPT___XSTAT !SANITIZER_INTERCEPT_STAT && SI_NOT_WINDOWS #define SANITIZER_INTERCEPT___XSTAT64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT #define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID #endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_nolibc.cc0000664000175000017500000000207512764312716032561 0ustar mwhudsonmwhudson//===-- sanitizer_common_nolibc.cc ----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains stubs for libc function to facilitate optional use of // libc in no-libcdep sources. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #include "sanitizer_common.h" #include "sanitizer_libc.h" namespace __sanitizer { // The Windows implementations of these functions use the win32 API directly, // bypassing libc. #if !SANITIZER_WINDOWS #if SANITIZER_LINUX bool ShouldLogAfterPrintf() { return false; } void LogMessageOnPrintf(const char *str) {} #endif void WriteToSyslog(const char *buffer) {} void Abort() { internal__exit(1); } void SleepForSeconds(int seconds) { internal_sleep(seconds); } #endif // !SANITIZER_WINDOWS } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator.cc0000664000175000017500000001630213004730632031706 0ustar mwhudsonmwhudson//===-- sanitizer_allocator.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // This allocator is used inside run-times. //===----------------------------------------------------------------------===// #include "sanitizer_allocator.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_atomic.h" #include "sanitizer_common.h" namespace __sanitizer { // ThreadSanitizer for Go uses libc malloc/free. #if SANITIZER_GO || defined(SANITIZER_USE_MALLOC) # if SANITIZER_LINUX && !SANITIZER_ANDROID extern "C" void *__libc_malloc(uptr size); # if !SANITIZER_GO extern "C" void *__libc_memalign(uptr alignment, uptr size); # endif extern "C" void *__libc_realloc(void *ptr, uptr size); extern "C" void __libc_free(void *ptr); # else # include # define __libc_malloc malloc # if !SANITIZER_GO static void *__libc_memalign(uptr alignment, uptr size) { void *p; uptr error = posix_memalign(&p, alignment, size); if (error) return nullptr; return p; } # endif # define __libc_realloc realloc # define __libc_free free # endif static void *RawInternalAlloc(uptr size, InternalAllocatorCache *cache, uptr alignment) { (void)cache; #if !SANITIZER_GO if (alignment == 0) return __libc_malloc(size); else return __libc_memalign(alignment, size); #else // Windows does not provide __libc_memalign/posix_memalign. It provides // __aligned_malloc, but the allocated blocks can't be passed to free, // they need to be passed to __aligned_free. InternalAlloc interface does // not account for such requirement. Alignemnt does not seem to be used // anywhere in runtime, so just call __libc_malloc for now. DCHECK_EQ(alignment, 0); return __libc_malloc(size); #endif } static void *RawInternalRealloc(void *ptr, uptr size, InternalAllocatorCache *cache) { (void)cache; return __libc_realloc(ptr, size); } static void RawInternalFree(void *ptr, InternalAllocatorCache *cache) { (void)cache; __libc_free(ptr); } InternalAllocator *internal_allocator() { return 0; } #else // SANITIZER_GO || defined(SANITIZER_USE_MALLOC) static ALIGNED(64) char internal_alloc_placeholder[sizeof(InternalAllocator)]; static atomic_uint8_t internal_allocator_initialized; static StaticSpinMutex internal_alloc_init_mu; static InternalAllocatorCache internal_allocator_cache; static StaticSpinMutex internal_allocator_cache_mu; InternalAllocator *internal_allocator() { InternalAllocator *internal_allocator_instance = reinterpret_cast(&internal_alloc_placeholder); if (atomic_load(&internal_allocator_initialized, memory_order_acquire) == 0) { SpinMutexLock l(&internal_alloc_init_mu); if (atomic_load(&internal_allocator_initialized, memory_order_relaxed) == 0) { internal_allocator_instance->Init(/* may_return_null*/ false); atomic_store(&internal_allocator_initialized, 1, memory_order_release); } } return internal_allocator_instance; } static void *RawInternalAlloc(uptr size, InternalAllocatorCache *cache, uptr alignment) { if (alignment == 0) alignment = 8; if (cache == 0) { SpinMutexLock l(&internal_allocator_cache_mu); return internal_allocator()->Allocate(&internal_allocator_cache, size, alignment, false); } return internal_allocator()->Allocate(cache, size, alignment, false); } static void *RawInternalRealloc(void *ptr, uptr size, InternalAllocatorCache *cache) { uptr alignment = 8; if (cache == 0) { SpinMutexLock l(&internal_allocator_cache_mu); return internal_allocator()->Reallocate(&internal_allocator_cache, ptr, size, alignment); } return internal_allocator()->Reallocate(cache, ptr, size, alignment); } static void RawInternalFree(void *ptr, InternalAllocatorCache *cache) { if (!cache) { SpinMutexLock l(&internal_allocator_cache_mu); return internal_allocator()->Deallocate(&internal_allocator_cache, ptr); } internal_allocator()->Deallocate(cache, ptr); } #endif // SANITIZER_GO || defined(SANITIZER_USE_MALLOC) const u64 kBlockMagic = 0x6A6CB03ABCEBC041ull; void *InternalAlloc(uptr size, InternalAllocatorCache *cache, uptr alignment) { if (size + sizeof(u64) < size) return nullptr; void *p = RawInternalAlloc(size + sizeof(u64), cache, alignment); if (!p) return nullptr; ((u64*)p)[0] = kBlockMagic; return (char*)p + sizeof(u64); } void *InternalRealloc(void *addr, uptr size, InternalAllocatorCache *cache) { if (!addr) return InternalAlloc(size, cache); if (size + sizeof(u64) < size) return nullptr; addr = (char*)addr - sizeof(u64); size = size + sizeof(u64); CHECK_EQ(kBlockMagic, ((u64*)addr)[0]); void *p = RawInternalRealloc(addr, size, cache); if (!p) return nullptr; return (char*)p + sizeof(u64); } void *InternalCalloc(uptr count, uptr size, InternalAllocatorCache *cache) { if (CallocShouldReturnNullDueToOverflow(count, size)) return internal_allocator()->ReturnNullOrDieOnBadRequest(); void *p = InternalAlloc(count * size, cache); if (p) internal_memset(p, 0, count * size); return p; } void InternalFree(void *addr, InternalAllocatorCache *cache) { if (!addr) return; addr = (char*)addr - sizeof(u64); CHECK_EQ(kBlockMagic, ((u64*)addr)[0]); ((u64*)addr)[0] = 0; RawInternalFree(addr, cache); } // LowLevelAllocator static LowLevelAllocateCallback low_level_alloc_callback; void *LowLevelAllocator::Allocate(uptr size) { // Align allocation size. size = RoundUpTo(size, 8); if (allocated_end_ - allocated_current_ < (sptr)size) { uptr size_to_allocate = Max(size, GetPageSizeCached()); allocated_current_ = (char*)MmapOrDie(size_to_allocate, __func__); allocated_end_ = allocated_current_ + size_to_allocate; if (low_level_alloc_callback) { low_level_alloc_callback((uptr)allocated_current_, size_to_allocate); } } CHECK(allocated_end_ - allocated_current_ >= (sptr)size); void *res = allocated_current_; allocated_current_ += size; return res; } void SetLowLevelAllocateCallback(LowLevelAllocateCallback callback) { low_level_alloc_callback = callback; } bool CallocShouldReturnNullDueToOverflow(uptr size, uptr n) { if (!size) return false; uptr max = (uptr)-1L; return (max / size) < n; } static atomic_uint8_t reporting_out_of_memory = {0}; bool IsReportingOOM() { return atomic_load_relaxed(&reporting_out_of_memory); } void NORETURN ReportAllocatorCannotReturnNull(bool out_of_memory) { if (out_of_memory) atomic_store_relaxed(&reporting_out_of_memory, 1); Report("%s's allocator is terminating the process instead of returning 0\n", SanitizerToolName); Report("If you don't like this behavior set allocator_may_return_null=1\n"); CHECK(0); Die(); } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_list.h0000664000175000017500000000707512646057256030571 0ustar mwhudsonmwhudson//===-- sanitizer_list.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains implementation of a list class to be used by // ThreadSanitizer, etc run-times. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_LIST_H #define SANITIZER_LIST_H #include "sanitizer_internal_defs.h" namespace __sanitizer { // Intrusive singly-linked list with size(), push_back(), push_front() // pop_front(), append_front() and append_back(). // This class should be a POD (so that it can be put into TLS) // and an object with all zero fields should represent a valid empty list. // This class does not have a CTOR, so clear() should be called on all // non-zero-initialized objects before using. template struct IntrusiveList { friend class Iterator; void clear() { first_ = last_ = nullptr; size_ = 0; } bool empty() const { return size_ == 0; } uptr size() const { return size_; } void push_back(Item *x) { if (empty()) { x->next = nullptr; first_ = last_ = x; size_ = 1; } else { x->next = nullptr; last_->next = x; last_ = x; size_++; } } void push_front(Item *x) { if (empty()) { x->next = nullptr; first_ = last_ = x; size_ = 1; } else { x->next = first_; first_ = x; size_++; } } void pop_front() { CHECK(!empty()); first_ = first_->next; if (!first_) last_ = nullptr; size_--; } Item *front() { return first_; } const Item *front() const { return first_; } Item *back() { return last_; } const Item *back() const { return last_; } void append_front(IntrusiveList *l) { CHECK_NE(this, l); if (l->empty()) return; if (empty()) { *this = *l; } else if (!l->empty()) { l->last_->next = first_; first_ = l->first_; size_ += l->size(); } l->clear(); } void append_back(IntrusiveList *l) { CHECK_NE(this, l); if (l->empty()) return; if (empty()) { *this = *l; } else { last_->next = l->first_; last_ = l->last_; size_ += l->size(); } l->clear(); } void CheckConsistency() { if (size_ == 0) { CHECK_EQ(first_, 0); CHECK_EQ(last_, 0); } else { uptr count = 0; for (Item *i = first_; ; i = i->next) { count++; if (i == last_) break; } CHECK_EQ(size(), count); CHECK_EQ(last_->next, 0); } } template class IteratorBase { public: explicit IteratorBase(ItemTy *current) : current_(current) {} IteratorBase &operator++() { current_ = current_->next; return *this; } bool operator!=(IteratorBase other) const { return current_ != other.current_; } ItemTy &operator*() { return *current_; } private: ItemTy *current_; }; typedef IteratorBase Iterator; typedef IteratorBase ConstIterator; Iterator begin() { return Iterator(first_); } Iterator end() { return Iterator(0); } ConstIterator begin() const { return ConstIterator(first_); } ConstIterator end() const { return ConstIterator(0); } // private, don't use directly. uptr size_; Item *first_; Item *last_; }; } // namespace __sanitizer #endif // SANITIZER_LIST_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_bvgraph.h0000664000175000017500000001113312316214006031213 0ustar mwhudsonmwhudson//===-- sanitizer_bvgraph.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. // BVGraph -- a directed graph. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_BVGRAPH_H #define SANITIZER_BVGRAPH_H #include "sanitizer_common.h" #include "sanitizer_bitvector.h" namespace __sanitizer { // Directed graph of fixed size implemented as an array of bit vectors. // Not thread-safe, all accesses should be protected by an external lock. template class BVGraph { public: enum SizeEnum { kSize = BV::kSize }; uptr size() const { return kSize; } // No CTOR. void clear() { for (uptr i = 0; i < size(); i++) v[i].clear(); } bool empty() const { for (uptr i = 0; i < size(); i++) if (!v[i].empty()) return false; return true; } // Returns true if a new edge was added. bool addEdge(uptr from, uptr to) { check(from, to); return v[from].setBit(to); } // Returns true if at least one new edge was added. uptr addEdges(const BV &from, uptr to, uptr added_edges[], uptr max_added_edges) { uptr res = 0; t1.copyFrom(from); while (!t1.empty()) { uptr node = t1.getAndClearFirstOne(); if (v[node].setBit(to)) if (res < max_added_edges) added_edges[res++] = node; } return res; } // *EXPERIMENTAL* // Returns true if an edge from=>to exist. // This function does not use any global state except for 'this' itself, // and thus can be called from different threads w/o locking. // This would be racy. // FIXME: investigate how much we can prove about this race being "benign". bool hasEdge(uptr from, uptr to) { return v[from].getBit(to); } // Returns true if the edge from=>to was removed. bool removeEdge(uptr from, uptr to) { return v[from].clearBit(to); } // Returns true if at least one edge *=>to was removed. bool removeEdgesTo(const BV &to) { bool res = 0; for (uptr from = 0; from < size(); from++) { if (v[from].setDifference(to)) res = true; } return res; } // Returns true if at least one edge from=>* was removed. bool removeEdgesFrom(const BV &from) { bool res = false; t1.copyFrom(from); while (!t1.empty()) { uptr idx = t1.getAndClearFirstOne(); if (!v[idx].empty()) { v[idx].clear(); res = true; } } return res; } void removeEdgesFrom(uptr from) { return v[from].clear(); } bool hasEdge(uptr from, uptr to) const { check(from, to); return v[from].getBit(to); } // Returns true if there is a path from the node 'from' // to any of the nodes in 'targets'. bool isReachable(uptr from, const BV &targets) { BV &to_visit = t1, &visited = t2; to_visit.copyFrom(v[from]); visited.clear(); visited.setBit(from); while (!to_visit.empty()) { uptr idx = to_visit.getAndClearFirstOne(); if (visited.setBit(idx)) to_visit.setUnion(v[idx]); } return targets.intersectsWith(visited); } // Finds a path from 'from' to one of the nodes in 'target', // stores up to 'path_size' items of the path into 'path', // returns the path length, or 0 if there is no path of size 'path_size'. uptr findPath(uptr from, const BV &targets, uptr *path, uptr path_size) { if (path_size == 0) return 0; path[0] = from; if (targets.getBit(from)) return 1; // The function is recursive, so we don't want to create BV on stack. // Instead of a getAndClearFirstOne loop we use the slower iterator. for (typename BV::Iterator it(v[from]); it.hasNext(); ) { uptr idx = it.next(); if (uptr res = findPath(idx, targets, path + 1, path_size - 1)) return res + 1; } return 0; } // Same as findPath, but finds a shortest path. uptr findShortestPath(uptr from, const BV &targets, uptr *path, uptr path_size) { for (uptr p = 1; p <= path_size; p++) if (findPath(from, targets, path, p) == p) return p; return 0; } private: void check(uptr idx1, uptr idx2) const { CHECK_LT(idx1, size()); CHECK_LT(idx2, size()); } BV v[kSize]; // Keep temporary vectors here since we can not create large objects on stack. BV t1, t2; }; } // namespace __sanitizer #endif // SANITIZER_BVGRAPH_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer.h0000664000175000017500000001352312742215165032000 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Symbolizer is used by sanitizers to map instruction address to a location in // source code at run-time. Symbolizer either uses __sanitizer_symbolize_* // defined in the program, or (if they are missing) tries to find and // launch "llvm-symbolizer" commandline tool in a separate process and // communicate with it. // // Generally we should try to avoid calling system library functions during // symbolization (and use their replacements from sanitizer_libc.h instead). //===----------------------------------------------------------------------===// #ifndef SANITIZER_SYMBOLIZER_H #define SANITIZER_SYMBOLIZER_H #include "sanitizer_common.h" #include "sanitizer_mutex.h" namespace __sanitizer { struct AddressInfo { // Owns all the string members. Storage for them is // (de)allocated using sanitizer internal allocator. uptr address; char *module; uptr module_offset; static const uptr kUnknown = ~(uptr)0; char *function; uptr function_offset; char *file; int line; int column; AddressInfo(); // Deletes all strings and resets all fields. void Clear(); void FillModuleInfo(const char *mod_name, uptr mod_offset); }; // Linked list of symbolized frames (each frame is described by AddressInfo). struct SymbolizedStack { SymbolizedStack *next; AddressInfo info; static SymbolizedStack *New(uptr addr); // Deletes current, and all subsequent frames in the linked list. // The object cannot be accessed after the call to this function. void ClearAll(); private: SymbolizedStack(); }; // For now, DataInfo is used to describe global variable. struct DataInfo { // Owns all the string members. Storage for them is // (de)allocated using sanitizer internal allocator. char *module; uptr module_offset; char *file; uptr line; char *name; uptr start; uptr size; DataInfo(); void Clear(); }; class SymbolizerTool; class Symbolizer final { public: /// Initialize and return platform-specific implementation of symbolizer /// (if it wasn't already initialized). static Symbolizer *GetOrInit(); static void LateInitialize(); // Returns a list of symbolized frames for a given address (containing // all inlined functions, if necessary). SymbolizedStack *SymbolizePC(uptr address); bool SymbolizeData(uptr address, DataInfo *info); // The module names Symbolizer returns are stable and unique for every given // module. It is safe to store and compare them as pointers. bool GetModuleNameAndOffsetForPC(uptr pc, const char **module_name, uptr *module_address); const char *GetModuleNameForPc(uptr pc) { const char *module_name = nullptr; uptr unused; if (GetModuleNameAndOffsetForPC(pc, &module_name, &unused)) return module_name; return nullptr; } // Release internal caches (if any). void Flush(); // Attempts to demangle the provided C++ mangled name. const char *Demangle(const char *name); void PrepareForSandboxing(); // Allow user to install hooks that would be called before/after Symbolizer // does the actual file/line info fetching. Specific sanitizers may need this // to distinguish system library calls made in user code from calls made // during in-process symbolization. typedef void (*StartSymbolizationHook)(); typedef void (*EndSymbolizationHook)(); // May be called at most once. void AddHooks(StartSymbolizationHook start_hook, EndSymbolizationHook end_hook); const LoadedModule *FindModuleForAddress(uptr address); private: // GetModuleNameAndOffsetForPC has to return a string to the caller. // Since the corresponding module might get unloaded later, we should create // our owned copies of the strings that we can safely return. // ModuleNameOwner does not provide any synchronization, thus calls to // its method should be protected by |mu_|. class ModuleNameOwner { public: explicit ModuleNameOwner(BlockingMutex *synchronized_by) : storage_(kInitialCapacity), last_match_(nullptr), mu_(synchronized_by) {} const char *GetOwnedCopy(const char *str); private: static const uptr kInitialCapacity = 1000; InternalMmapVector storage_; const char *last_match_; BlockingMutex *mu_; } module_names_; /// Platform-specific function for creating a Symbolizer object. static Symbolizer *PlatformInit(); bool FindModuleNameAndOffsetForAddress(uptr address, const char **module_name, uptr *module_offset); ListOfModules modules_; // If stale, need to reload the modules before looking up addresses. bool modules_fresh_; // Platform-specific default demangler, must not return nullptr. const char *PlatformDemangle(const char *name); void PlatformPrepareForSandboxing(); static Symbolizer *symbolizer_; static StaticSpinMutex init_mu_; // Mutex locked from public methods of |Symbolizer|, so that the internals // (including individual symbolizer tools and platform-specific methods) are // always synchronized. BlockingMutex mu_; IntrusiveList tools_; explicit Symbolizer(IntrusiveList tools); static LowLevelAllocator symbolizer_allocator_; StartSymbolizationHook start_hook_; EndSymbolizationHook end_hook_; class SymbolizerScope { public: explicit SymbolizerScope(const Symbolizer *sym); ~SymbolizerScope(); private: const Symbolizer *sym_; }; }; #ifdef SANITIZER_WINDOWS void InitializeDbgHelpIfNeeded(); #endif } // namespace __sanitizer #endif // SANITIZER_SYMBOLIZER_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_placement_new.h0000664000175000017500000000153112232136353032411 0ustar mwhudsonmwhudson//===-- sanitizer_placement_new.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. // // The file provides 'placement new'. // Do not include it into header files, only into source files. //===----------------------------------------------------------------------===// #ifndef SANITIZER_PLACEMENT_NEW_H #define SANITIZER_PLACEMENT_NEW_H #include "sanitizer_internal_defs.h" inline void *operator new(__sanitizer::operator_new_size_type sz, void *p) { return p; } #endif // SANITIZER_PLACEMENT_NEW_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_linux.cc0000664000175000017500000013043613004730632031072 0ustar mwhudsonmwhudson//===-- sanitizer_linux.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and implements linux-specific functions from // sanitizer_libc.h. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_internal_defs.h" #include "sanitizer_libc.h" #include "sanitizer_linux.h" #include "sanitizer_mutex.h" #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" #if !SANITIZER_FREEBSD #include #endif // For mips64, syscall(__NR_stat) fills the buffer in the 'struct kernel_stat' // format. Struct kernel_stat is defined as 'struct stat' in asm/stat.h. To // access stat from asm/stat.h, without conflicting with definition in // sys/stat.h, we use this trick. #if defined(__mips64) #include #include #define stat kernel_stat #include #undef stat #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if SANITIZER_FREEBSD #include #include #include #include #include extern "C" { // must be included after and on // FreeBSD 9.2 and 10.0. #include } extern char **environ; // provided by crt1 #endif // SANITIZER_FREEBSD #if !SANITIZER_ANDROID #include #endif #if SANITIZER_LINUX // struct kernel_timeval { long tv_sec; long tv_usec; }; // is broken on some linux distributions. const int FUTEX_WAIT = 0; const int FUTEX_WAKE = 1; #endif // SANITIZER_LINUX // Are we using 32-bit or 64-bit Linux syscalls? // x32 (which defines __x86_64__) has SANITIZER_WORDSIZE == 32 // but it still needs to use 64-bit syscalls. #if SANITIZER_LINUX && (defined(__x86_64__) || defined(__powerpc64__) || \ SANITIZER_WORDSIZE == 64) # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 1 #else # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 0 #endif #if defined(__x86_64__) || SANITIZER_MIPS64 extern "C" { extern void internal_sigreturn(); } #endif namespace __sanitizer { #if SANITIZER_LINUX && defined(__x86_64__) #include "sanitizer_syscall_linux_x86_64.inc" #elif SANITIZER_LINUX && defined(__aarch64__) #include "sanitizer_syscall_linux_aarch64.inc" #else #include "sanitizer_syscall_generic.inc" #endif // --------------- sanitizer_libc.h #if !SANITIZER_S390 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd, OFF_T offset) { #if SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd, offset); #else // mmap2 specifies file offset in 4096-byte units. CHECK(IsAligned(offset, 4096)); return internal_syscall(SYSCALL(mmap2), addr, length, prot, flags, fd, offset / 4096); #endif } #endif // !SANITIZER_S390 uptr internal_munmap(void *addr, uptr length) { return internal_syscall(SYSCALL(munmap), (uptr)addr, length); } int internal_mprotect(void *addr, uptr length, int prot) { return internal_syscall(SYSCALL(mprotect), (uptr)addr, length, prot); } uptr internal_close(fd_t fd) { return internal_syscall(SYSCALL(close), fd); } uptr internal_open(const char *filename, int flags) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags); #else return internal_syscall(SYSCALL(open), (uptr)filename, flags); #endif } uptr internal_open(const char *filename, int flags, u32 mode) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags, mode); #else return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode); #endif } uptr internal_read(fd_t fd, void *buf, uptr count) { sptr res; HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(read), fd, (uptr)buf, count)); return res; } uptr internal_write(fd_t fd, const void *buf, uptr count) { sptr res; HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(write), fd, (uptr)buf, count)); return res; } uptr internal_ftruncate(fd_t fd, uptr size) { sptr res; HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd, (OFF_T)size)); return res; } #if !SANITIZER_LINUX_USES_64BIT_SYSCALLS && !SANITIZER_FREEBSD static void stat64_to_stat(struct stat64 *in, struct stat *out) { internal_memset(out, 0, sizeof(*out)); out->st_dev = in->st_dev; out->st_ino = in->st_ino; out->st_mode = in->st_mode; out->st_nlink = in->st_nlink; out->st_uid = in->st_uid; out->st_gid = in->st_gid; out->st_rdev = in->st_rdev; out->st_size = in->st_size; out->st_blksize = in->st_blksize; out->st_blocks = in->st_blocks; out->st_atime = in->st_atime; out->st_mtime = in->st_mtime; out->st_ctime = in->st_ctime; out->st_ino = in->st_ino; } #endif #if defined(__mips64) static void kernel_stat_to_stat(struct kernel_stat *in, struct stat *out) { internal_memset(out, 0, sizeof(*out)); out->st_dev = in->st_dev; out->st_ino = in->st_ino; out->st_mode = in->st_mode; out->st_nlink = in->st_nlink; out->st_uid = in->st_uid; out->st_gid = in->st_gid; out->st_rdev = in->st_rdev; out->st_size = in->st_size; out->st_blksize = in->st_blksize; out->st_blocks = in->st_blocks; out->st_atime = in->st_atime_nsec; out->st_mtime = in->st_mtime_nsec; out->st_ctime = in->st_ctime_nsec; out->st_ino = in->st_ino; } #endif uptr internal_stat(const char *path, void *buf) { #if SANITIZER_FREEBSD return internal_syscall(SYSCALL(stat), path, buf); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS # if defined(__mips64) // For mips64, stat syscall fills buffer in the format of kernel_stat struct kernel_stat kbuf; int res = internal_syscall(SYSCALL(stat), path, &kbuf); kernel_stat_to_stat(&kbuf, (struct stat *)buf); return res; # else return internal_syscall(SYSCALL(stat), (uptr)path, (uptr)buf); # endif #else struct stat64 buf64; int res = internal_syscall(SYSCALL(stat64), path, &buf64); stat64_to_stat(&buf64, (struct stat *)buf); return res; #endif } uptr internal_lstat(const char *path, void *buf) { #if SANITIZER_FREEBSD return internal_syscall(SYSCALL(lstat), path, buf); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS # if SANITIZER_MIPS64 // For mips64, lstat syscall fills buffer in the format of kernel_stat struct kernel_stat kbuf; int res = internal_syscall(SYSCALL(lstat), path, &kbuf); kernel_stat_to_stat(&kbuf, (struct stat *)buf); return res; # else return internal_syscall(SYSCALL(lstat), (uptr)path, (uptr)buf); # endif #else struct stat64 buf64; int res = internal_syscall(SYSCALL(lstat64), path, &buf64); stat64_to_stat(&buf64, (struct stat *)buf); return res; #endif } uptr internal_fstat(fd_t fd, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS # if SANITIZER_MIPS64 // For mips64, fstat syscall fills buffer in the format of kernel_stat struct kernel_stat kbuf; int res = internal_syscall(SYSCALL(fstat), fd, &kbuf); kernel_stat_to_stat(&kbuf, (struct stat *)buf); return res; # else return internal_syscall(SYSCALL(fstat), fd, (uptr)buf); # endif #else struct stat64 buf64; int res = internal_syscall(SYSCALL(fstat64), fd, &buf64); stat64_to_stat(&buf64, (struct stat *)buf); return res; #endif } uptr internal_filesize(fd_t fd) { struct stat st; if (internal_fstat(fd, &st)) return -1; return (uptr)st.st_size; } uptr internal_dup2(int oldfd, int newfd) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(dup3), oldfd, newfd, 0); #else return internal_syscall(SYSCALL(dup2), oldfd, newfd); #endif } uptr internal_readlink(const char *path, char *buf, uptr bufsize) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, (uptr)buf, bufsize); #else return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize); #endif } uptr internal_unlink(const char *path) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0); #else return internal_syscall(SYSCALL(unlink), (uptr)path); #endif } uptr internal_rename(const char *oldpath, const char *newpath) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD, (uptr)newpath); #else return internal_syscall(SYSCALL(rename), (uptr)oldpath, (uptr)newpath); #endif } uptr internal_sched_yield() { return internal_syscall(SYSCALL(sched_yield)); } void internal__exit(int exitcode) { #if SANITIZER_FREEBSD internal_syscall(SYSCALL(exit), exitcode); #else internal_syscall(SYSCALL(exit_group), exitcode); #endif Die(); // Unreachable. } unsigned int internal_sleep(unsigned int seconds) { struct timespec ts; ts.tv_sec = 1; ts.tv_nsec = 0; int res = internal_syscall(SYSCALL(nanosleep), &ts, &ts); if (res) return ts.tv_sec; return 0; } uptr internal_execve(const char *filename, char *const argv[], char *const envp[]) { return internal_syscall(SYSCALL(execve), (uptr)filename, (uptr)argv, (uptr)envp); } // ----------------- sanitizer_common.h bool FileExists(const char *filename) { struct stat st; #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS if (internal_syscall(SYSCALL(newfstatat), AT_FDCWD, filename, &st, 0)) #else if (internal_stat(filename, &st)) #endif return false; // Sanity check: filename is a regular file. return S_ISREG(st.st_mode); } uptr GetTid() { #if SANITIZER_FREEBSD return (uptr)pthread_self(); #else return internal_syscall(SYSCALL(gettid)); #endif } u64 NanoTime() { #if SANITIZER_FREEBSD timeval tv; #else kernel_timeval tv; #endif internal_memset(&tv, 0, sizeof(tv)); internal_syscall(SYSCALL(gettimeofday), (uptr)&tv, 0); return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000; } // Like getenv, but reads env directly from /proc (on Linux) or parses the // 'environ' array (on FreeBSD) and does not use libc. This function should be // called first inside __asan_init. const char *GetEnv(const char *name) { #if SANITIZER_FREEBSD if (::environ != 0) { uptr NameLen = internal_strlen(name); for (char **Env = ::environ; *Env != 0; Env++) { if (internal_strncmp(*Env, name, NameLen) == 0 && (*Env)[NameLen] == '=') return (*Env) + NameLen + 1; } } return 0; // Not found. #elif SANITIZER_LINUX static char *environ; static uptr len; static bool inited; if (!inited) { inited = true; uptr environ_size; if (!ReadFileToBuffer("/proc/self/environ", &environ, &environ_size, &len)) environ = nullptr; } if (!environ || len == 0) return nullptr; uptr namelen = internal_strlen(name); const char *p = environ; while (*p != '\0') { // will happen at the \0\0 that terminates the buffer // proc file has the format NAME=value\0NAME=value\0NAME=value\0... const char* endp = (char*)internal_memchr(p, '\0', len - (p - environ)); if (!endp) // this entry isn't NUL terminated return nullptr; else if (!internal_memcmp(p, name, namelen) && p[namelen] == '=') // Match. return p + namelen + 1; // point after = p = endp + 1; } return nullptr; // Not found. #else #error "Unsupported platform" #endif } #if !SANITIZER_FREEBSD extern "C" { SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end; } #endif #if !SANITIZER_GO && !SANITIZER_FREEBSD static void ReadNullSepFileToArray(const char *path, char ***arr, int arr_size) { char *buff; uptr buff_size; uptr buff_len; *arr = (char **)MmapOrDie(arr_size * sizeof(char *), "NullSepFileArray"); if (!ReadFileToBuffer(path, &buff, &buff_size, &buff_len, 1024 * 1024)) { (*arr)[0] = nullptr; return; } (*arr)[0] = buff; int count, i; for (count = 1, i = 1; ; i++) { if (buff[i] == 0) { if (buff[i+1] == 0) break; (*arr)[count] = &buff[i+1]; CHECK_LE(count, arr_size - 1); // FIXME: make this more flexible. count++; } } (*arr)[count] = nullptr; } #endif static void GetArgsAndEnv(char ***argv, char ***envp) { #if !SANITIZER_FREEBSD #if !SANITIZER_GO if (&__libc_stack_end) { #endif uptr* stack_end = (uptr*)__libc_stack_end; int argc = *stack_end; *argv = (char**)(stack_end + 1); *envp = (char**)(stack_end + argc + 2); #if !SANITIZER_GO } else { static const int kMaxArgv = 2000, kMaxEnvp = 2000; ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv); ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp); } #endif #else // On FreeBSD, retrieving the argument and environment arrays is done via the // kern.ps_strings sysctl, which returns a pointer to a structure containing // this information. See also . ps_strings *pss; size_t sz = sizeof(pss); if (sysctlbyname("kern.ps_strings", &pss, &sz, NULL, 0) == -1) { Printf("sysctl kern.ps_strings failed\n"); Die(); } *argv = pss->ps_argvstr; *envp = pss->ps_envstr; #endif } char **GetArgv() { char **argv, **envp; GetArgsAndEnv(&argv, &envp); return argv; } void ReExec() { char **argv, **envp; GetArgsAndEnv(&argv, &envp); uptr rv = internal_execve("/proc/self/exe", argv, envp); int rverrno; CHECK_EQ(internal_iserror(rv, &rverrno), true); Printf("execve failed, errno %d\n", rverrno); Die(); } enum MutexState { MtxUnlocked = 0, MtxLocked = 1, MtxSleeping = 2 }; BlockingMutex::BlockingMutex() { internal_memset(this, 0, sizeof(*this)); } void BlockingMutex::Lock() { CHECK_EQ(owner_, 0); atomic_uint32_t *m = reinterpret_cast(&opaque_storage_); if (atomic_exchange(m, MtxLocked, memory_order_acquire) == MtxUnlocked) return; while (atomic_exchange(m, MtxSleeping, memory_order_acquire) != MtxUnlocked) { #if SANITIZER_FREEBSD _umtx_op(m, UMTX_OP_WAIT_UINT, MtxSleeping, 0, 0); #else internal_syscall(SYSCALL(futex), (uptr)m, FUTEX_WAIT, MtxSleeping, 0, 0, 0); #endif } } void BlockingMutex::Unlock() { atomic_uint32_t *m = reinterpret_cast(&opaque_storage_); u32 v = atomic_exchange(m, MtxUnlocked, memory_order_relaxed); CHECK_NE(v, MtxUnlocked); if (v == MtxSleeping) { #if SANITIZER_FREEBSD _umtx_op(m, UMTX_OP_WAKE, 1, 0, 0); #else internal_syscall(SYSCALL(futex), (uptr)m, FUTEX_WAKE, 1, 0, 0, 0); #endif } } void BlockingMutex::CheckLocked() { atomic_uint32_t *m = reinterpret_cast(&opaque_storage_); CHECK_NE(MtxUnlocked, atomic_load(m, memory_order_relaxed)); } // ----------------- sanitizer_linux.h // The actual size of this structure is specified by d_reclen. // Note that getdents64 uses a different structure format. We only provide the // 32-bit syscall here. struct linux_dirent { #if SANITIZER_X32 || defined(__aarch64__) u64 d_ino; u64 d_off; #else unsigned long d_ino; unsigned long d_off; #endif unsigned short d_reclen; #ifdef __aarch64__ unsigned char d_type; #endif char d_name[256]; }; // Syscall wrappers. uptr internal_ptrace(int request, int pid, void *addr, void *data) { return internal_syscall(SYSCALL(ptrace), request, pid, (uptr)addr, (uptr)data); } uptr internal_waitpid(int pid, int *status, int options) { return internal_syscall(SYSCALL(wait4), pid, (uptr)status, options, 0 /* rusage */); } uptr internal_getpid() { return internal_syscall(SYSCALL(getpid)); } uptr internal_getppid() { return internal_syscall(SYSCALL(getppid)); } uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count); #else return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count); #endif } uptr internal_lseek(fd_t fd, OFF_T offset, int whence) { return internal_syscall(SYSCALL(lseek), fd, offset, whence); } #if SANITIZER_LINUX uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) { return internal_syscall(SYSCALL(prctl), option, arg2, arg3, arg4, arg5); } #endif uptr internal_sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } int internal_fork() { #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(clone), SIGCHLD, 0); #else return internal_syscall(SYSCALL(fork)); #endif } #if SANITIZER_LINUX #define SA_RESTORER 0x04000000 // Doesn't set sa_restorer if the caller did not set it, so use with caution //(see below). int internal_sigaction_norestorer(int signum, const void *act, void *oldact) { __sanitizer_kernel_sigaction_t k_act, k_oldact; internal_memset(&k_act, 0, sizeof(__sanitizer_kernel_sigaction_t)); internal_memset(&k_oldact, 0, sizeof(__sanitizer_kernel_sigaction_t)); const __sanitizer_sigaction *u_act = (const __sanitizer_sigaction *)act; __sanitizer_sigaction *u_oldact = (__sanitizer_sigaction *)oldact; if (u_act) { k_act.handler = u_act->handler; k_act.sigaction = u_act->sigaction; internal_memcpy(&k_act.sa_mask, &u_act->sa_mask, sizeof(__sanitizer_kernel_sigset_t)); // Without SA_RESTORER kernel ignores the calls (probably returns EINVAL). k_act.sa_flags = u_act->sa_flags | SA_RESTORER; // FIXME: most often sa_restorer is unset, however the kernel requires it // to point to a valid signal restorer that calls the rt_sigreturn syscall. // If sa_restorer passed to the kernel is NULL, the program may crash upon // signal delivery or fail to unwind the stack in the signal handler. // libc implementation of sigaction() passes its own restorer to // rt_sigaction, so we need to do the same (we'll need to reimplement the // restorers; for x86_64 the restorer address can be obtained from // oldact->sa_restorer upon a call to sigaction(xxx, NULL, oldact). #if !SANITIZER_ANDROID || !SANITIZER_MIPS32 k_act.sa_restorer = u_act->sa_restorer; #endif } uptr result = internal_syscall(SYSCALL(rt_sigaction), (uptr)signum, (uptr)(u_act ? &k_act : nullptr), (uptr)(u_oldact ? &k_oldact : nullptr), (uptr)sizeof(__sanitizer_kernel_sigset_t)); if ((result == 0) && u_oldact) { u_oldact->handler = k_oldact.handler; u_oldact->sigaction = k_oldact.sigaction; internal_memcpy(&u_oldact->sa_mask, &k_oldact.sa_mask, sizeof(__sanitizer_kernel_sigset_t)); u_oldact->sa_flags = k_oldact.sa_flags; #if !SANITIZER_ANDROID || !SANITIZER_MIPS32 u_oldact->sa_restorer = k_oldact.sa_restorer; #endif } return result; } // Invokes sigaction via a raw syscall with a restorer, but does not support // all platforms yet. // We disable for Go simply because we have not yet added to buildgo.sh. #if (defined(__x86_64__) || SANITIZER_MIPS64) && !SANITIZER_GO int internal_sigaction_syscall(int signum, const void *act, void *oldact) { if (act == nullptr) return internal_sigaction_norestorer(signum, act, oldact); __sanitizer_sigaction u_adjust; internal_memcpy(&u_adjust, act, sizeof(u_adjust)); #if !SANITIZER_ANDROID || !SANITIZER_MIPS32 if (u_adjust.sa_restorer == nullptr) { u_adjust.sa_restorer = internal_sigreturn; } #endif return internal_sigaction_norestorer(signum, (const void *)&u_adjust, oldact); } #endif // defined(__x86_64__) && !SANITIZER_GO #endif // SANITIZER_LINUX uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) { #if SANITIZER_FREEBSD return internal_syscall(SYSCALL(sigprocmask), how, set, oldset); #else __sanitizer_kernel_sigset_t *k_set = (__sanitizer_kernel_sigset_t *)set; __sanitizer_kernel_sigset_t *k_oldset = (__sanitizer_kernel_sigset_t *)oldset; return internal_syscall(SYSCALL(rt_sigprocmask), (uptr)how, (uptr)&k_set->sig[0], (uptr)&k_oldset->sig[0], sizeof(__sanitizer_kernel_sigset_t)); #endif } void internal_sigfillset(__sanitizer_sigset_t *set) { internal_memset(set, 0xff, sizeof(*set)); } void internal_sigemptyset(__sanitizer_sigset_t *set) { internal_memset(set, 0, sizeof(*set)); } #if SANITIZER_LINUX void internal_sigdelset(__sanitizer_sigset_t *set, int signum) { signum -= 1; CHECK_GE(signum, 0); CHECK_LT(signum, sizeof(*set) * 8); __sanitizer_kernel_sigset_t *k_set = (__sanitizer_kernel_sigset_t *)set; const uptr idx = signum / (sizeof(k_set->sig[0]) * 8); const uptr bit = signum % (sizeof(k_set->sig[0]) * 8); k_set->sig[idx] &= ~(1 << bit); } bool internal_sigismember(__sanitizer_sigset_t *set, int signum) { signum -= 1; CHECK_GE(signum, 0); CHECK_LT(signum, sizeof(*set) * 8); __sanitizer_kernel_sigset_t *k_set = (__sanitizer_kernel_sigset_t *)set; const uptr idx = signum / (sizeof(k_set->sig[0]) * 8); const uptr bit = signum % (sizeof(k_set->sig[0]) * 8); return k_set->sig[idx] & (1 << bit); } #endif // SANITIZER_LINUX // ThreadLister implementation. ThreadLister::ThreadLister(int pid) : pid_(pid), descriptor_(-1), buffer_(4096), error_(true), entry_((struct linux_dirent *)buffer_.data()), bytes_read_(0) { char task_directory_path[80]; internal_snprintf(task_directory_path, sizeof(task_directory_path), "/proc/%d/task/", pid); uptr openrv = internal_open(task_directory_path, O_RDONLY | O_DIRECTORY); if (internal_iserror(openrv)) { error_ = true; Report("Can't open /proc/%d/task for reading.\n", pid); } else { error_ = false; descriptor_ = openrv; } } int ThreadLister::GetNextTID() { int tid = -1; do { if (error_) return -1; if ((char *)entry_ >= &buffer_[bytes_read_] && !GetDirectoryEntries()) return -1; if (entry_->d_ino != 0 && entry_->d_name[0] >= '0' && entry_->d_name[0] <= '9') { // Found a valid tid. tid = (int)internal_atoll(entry_->d_name); } entry_ = (struct linux_dirent *)(((char *)entry_) + entry_->d_reclen); } while (tid < 0); return tid; } void ThreadLister::Reset() { if (error_ || descriptor_ < 0) return; internal_lseek(descriptor_, 0, SEEK_SET); } ThreadLister::~ThreadLister() { if (descriptor_ >= 0) internal_close(descriptor_); } bool ThreadLister::error() { return error_; } bool ThreadLister::GetDirectoryEntries() { CHECK_GE(descriptor_, 0); CHECK_NE(error_, true); bytes_read_ = internal_getdents(descriptor_, (struct linux_dirent *)buffer_.data(), buffer_.size()); if (internal_iserror(bytes_read_)) { Report("Can't read directory entries from /proc/%d/task.\n", pid_); error_ = true; return false; } else if (bytes_read_ == 0) { return false; } entry_ = (struct linux_dirent *)buffer_.data(); return true; } uptr GetPageSize() { // Android post-M sysconf(_SC_PAGESIZE) crashes if called from .preinit_array. #if SANITIZER_ANDROID return 4096; #elif SANITIZER_LINUX && (defined(__x86_64__) || defined(__i386__)) return EXEC_PAGESIZE; #else return sysconf(_SC_PAGESIZE); // EXEC_PAGESIZE may not be trustworthy. #endif } uptr ReadBinaryName(/*out*/char *buf, uptr buf_len) { #if SANITIZER_FREEBSD const int Mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; const char *default_module_name = "kern.proc.pathname"; size_t Size = buf_len; bool IsErr = (sysctl(Mib, ARRAY_SIZE(Mib), buf, &Size, NULL, 0) != 0); int readlink_error = IsErr ? errno : 0; uptr module_name_len = Size; #else const char *default_module_name = "/proc/self/exe"; uptr module_name_len = internal_readlink( default_module_name, buf, buf_len); int readlink_error; bool IsErr = internal_iserror(module_name_len, &readlink_error); #endif if (IsErr) { // We can't read binary name for some reason, assume it's unknown. Report("WARNING: reading executable name failed with errno %d, " "some stack frames may not be symbolized\n", readlink_error); module_name_len = internal_snprintf(buf, buf_len, "%s", default_module_name); CHECK_LT(module_name_len, buf_len); } return module_name_len; } uptr ReadLongProcessName(/*out*/ char *buf, uptr buf_len) { #if SANITIZER_LINUX char *tmpbuf; uptr tmpsize; uptr tmplen; if (ReadFileToBuffer("/proc/self/cmdline", &tmpbuf, &tmpsize, &tmplen, 1024 * 1024)) { internal_strncpy(buf, tmpbuf, buf_len); UnmapOrDie(tmpbuf, tmpsize); return internal_strlen(buf); } #endif return ReadBinaryName(buf, buf_len); } // Match full names of the form /path/to/base_name{-,.}* bool LibraryNameIs(const char *full_name, const char *base_name) { const char *name = full_name; // Strip path. while (*name != '\0') name++; while (name > full_name && *name != '/') name--; if (*name == '/') name++; uptr base_name_length = internal_strlen(base_name); if (internal_strncmp(name, base_name, base_name_length)) return false; return (name[base_name_length] == '-' || name[base_name_length] == '.'); } #if !SANITIZER_ANDROID // Call cb for each region mapped by map. void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr)) { CHECK_NE(map, nullptr); #if !SANITIZER_FREEBSD typedef ElfW(Phdr) Elf_Phdr; typedef ElfW(Ehdr) Elf_Ehdr; #endif // !SANITIZER_FREEBSD char *base = (char *)map->l_addr; Elf_Ehdr *ehdr = (Elf_Ehdr *)base; char *phdrs = base + ehdr->e_phoff; char *phdrs_end = phdrs + ehdr->e_phnum * ehdr->e_phentsize; // Find the segment with the minimum base so we can "relocate" the p_vaddr // fields. Typically ET_DYN objects (DSOs) have base of zero and ET_EXEC // objects have a non-zero base. uptr preferred_base = (uptr)-1; for (char *iter = phdrs; iter != phdrs_end; iter += ehdr->e_phentsize) { Elf_Phdr *phdr = (Elf_Phdr *)iter; if (phdr->p_type == PT_LOAD && preferred_base > (uptr)phdr->p_vaddr) preferred_base = (uptr)phdr->p_vaddr; } // Compute the delta from the real base to get a relocation delta. sptr delta = (uptr)base - preferred_base; // Now we can figure out what the loader really mapped. for (char *iter = phdrs; iter != phdrs_end; iter += ehdr->e_phentsize) { Elf_Phdr *phdr = (Elf_Phdr *)iter; if (phdr->p_type == PT_LOAD) { uptr seg_start = phdr->p_vaddr + delta; uptr seg_end = seg_start + phdr->p_memsz; // None of these values are aligned. We consider the ragged edges of the // load command as defined, since they are mapped from the file. seg_start = RoundDownTo(seg_start, GetPageSizeCached()); seg_end = RoundUpTo(seg_end, GetPageSizeCached()); cb((void *)seg_start, seg_end - seg_start); } } } #endif #if defined(__x86_64__) && SANITIZER_LINUX // We cannot use glibc's clone wrapper, because it messes with the child // task's TLS. It writes the PID and TID of the child task to its thread // descriptor, but in our case the child task shares the thread descriptor with // the parent (because we don't know how to allocate a new thread // descriptor to keep glibc happy). So the stock version of clone(), when // used with CLONE_VM, would end up corrupting the parent's thread descriptor. uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; if (!fn || !child_stack) return -EINVAL; CHECK_EQ(0, (uptr)child_stack % 16); child_stack = (char *)child_stack - 2 * sizeof(unsigned long long); ((unsigned long long *)child_stack)[0] = (uptr)fn; ((unsigned long long *)child_stack)[1] = (uptr)arg; register void *r8 __asm__("r8") = newtls; register int *r10 __asm__("r10") = child_tidptr; __asm__ __volatile__( /* %rax = syscall(%rax = SYSCALL(clone), * %rdi = flags, * %rsi = child_stack, * %rdx = parent_tidptr, * %r8 = new_tls, * %r10 = child_tidptr) */ "syscall\n" /* if (%rax != 0) * return; */ "testq %%rax,%%rax\n" "jnz 1f\n" /* In the child. Terminate unwind chain. */ // XXX: We should also terminate the CFI unwind chain // here. Unfortunately clang 3.2 doesn't support the // necessary CFI directives, so we skip that part. "xorq %%rbp,%%rbp\n" /* Call "fn(arg)". */ "popq %%rax\n" "popq %%rdi\n" "call *%%rax\n" /* Call _exit(%rax). */ "movq %%rax,%%rdi\n" "movq %2,%%rax\n" "syscall\n" /* Return to parent. */ "1:\n" : "=a" (res) : "a"(SYSCALL(clone)), "i"(SYSCALL(exit)), "S"(child_stack), "D"(flags), "d"(parent_tidptr), "r"(r8), "r"(r10) : "rsp", "memory", "r11", "rcx"); return res; } #elif defined(__mips__) uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; if (!fn || !child_stack) return -EINVAL; CHECK_EQ(0, (uptr)child_stack % 16); child_stack = (char *)child_stack - 2 * sizeof(unsigned long long); ((unsigned long long *)child_stack)[0] = (uptr)fn; ((unsigned long long *)child_stack)[1] = (uptr)arg; register void *a3 __asm__("$7") = newtls; register int *a4 __asm__("$8") = child_tidptr; // We don't have proper CFI directives here because it requires alot of code // for very marginal benefits. __asm__ __volatile__( /* $v0 = syscall($v0 = __NR_clone, * $a0 = flags, * $a1 = child_stack, * $a2 = parent_tidptr, * $a3 = new_tls, * $a4 = child_tidptr) */ ".cprestore 16;\n" "move $4,%1;\n" "move $5,%2;\n" "move $6,%3;\n" "move $7,%4;\n" /* Store the fifth argument on stack * if we are using 32-bit abi. */ #if SANITIZER_WORDSIZE == 32 "lw %5,16($29);\n" #else "move $8,%5;\n" #endif "li $2,%6;\n" "syscall;\n" /* if ($v0 != 0) * return; */ "bnez $2,1f;\n" /* Call "fn(arg)". */ #if SANITIZER_WORDSIZE == 32 #ifdef __BIG_ENDIAN__ "lw $25,4($29);\n" "lw $4,12($29);\n" #else "lw $25,0($29);\n" "lw $4,8($29);\n" #endif #else "ld $25,0($29);\n" "ld $4,8($29);\n" #endif "jal $25;\n" /* Call _exit($v0). */ "move $4,$2;\n" "li $2,%7;\n" "syscall;\n" /* Return to parent. */ "1:\n" : "=r" (res) : "r"(flags), "r"(child_stack), "r"(parent_tidptr), "r"(a3), "r"(a4), "i"(__NR_clone), "i"(__NR_exit) : "memory", "$29" ); return res; } #elif defined(__aarch64__) uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; if (!fn || !child_stack) return -EINVAL; CHECK_EQ(0, (uptr)child_stack % 16); child_stack = (char *)child_stack - 2 * sizeof(unsigned long long); ((unsigned long long *)child_stack)[0] = (uptr)fn; ((unsigned long long *)child_stack)[1] = (uptr)arg; register int (*__fn)(void *) __asm__("x0") = fn; register void *__stack __asm__("x1") = child_stack; register int __flags __asm__("x2") = flags; register void *__arg __asm__("x3") = arg; register int *__ptid __asm__("x4") = parent_tidptr; register void *__tls __asm__("x5") = newtls; register int *__ctid __asm__("x6") = child_tidptr; __asm__ __volatile__( "mov x0,x2\n" /* flags */ "mov x2,x4\n" /* ptid */ "mov x3,x5\n" /* tls */ "mov x4,x6\n" /* ctid */ "mov x8,%9\n" /* clone */ "svc 0x0\n" /* if (%r0 != 0) * return %r0; */ "cmp x0, #0\n" "bne 1f\n" /* In the child, now. Call "fn(arg)". */ "ldp x1, x0, [sp], #16\n" "blr x1\n" /* Call _exit(%r0). */ "mov x8, %10\n" "svc 0x0\n" "1:\n" : "=r" (res) : "i"(-EINVAL), "r"(__fn), "r"(__stack), "r"(__flags), "r"(__arg), "r"(__ptid), "r"(__tls), "r"(__ctid), "i"(__NR_clone), "i"(__NR_exit) : "x30", "memory"); return res; } #elif defined(__powerpc64__) uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; /* Stack frame offsets. */ #if _CALL_ELF != 2 #define FRAME_MIN_SIZE 112 #define FRAME_TOC_SAVE 40 #else #define FRAME_MIN_SIZE 32 #define FRAME_TOC_SAVE 24 #endif if (!fn || !child_stack) return -EINVAL; CHECK_EQ(0, (uptr)child_stack % 16); child_stack = (char *)child_stack - 2 * sizeof(unsigned long long); ((unsigned long long *)child_stack)[0] = (uptr)fn; ((unsigned long long *)child_stack)[1] = (uptr)arg; register int (*__fn)(void *) __asm__("r3") = fn; register void *__cstack __asm__("r4") = child_stack; register int __flags __asm__("r5") = flags; register void * __arg __asm__("r6") = arg; register int * __ptidptr __asm__("r7") = parent_tidptr; register void * __newtls __asm__("r8") = newtls; register int * __ctidptr __asm__("r9") = child_tidptr; __asm__ __volatile__( /* fn, arg, child_stack are saved acrVoss the syscall */ "mr 28, %5\n\t" "mr 29, %6\n\t" "mr 27, %8\n\t" /* syscall r3 == flags r4 == child_stack r5 == parent_tidptr r6 == newtls r7 == child_tidptr */ "mr 3, %7\n\t" "mr 5, %9\n\t" "mr 6, %10\n\t" "mr 7, %11\n\t" "li 0, %3\n\t" "sc\n\t" /* Test if syscall was successful */ "cmpdi cr1, 3, 0\n\t" "crandc cr1*4+eq, cr1*4+eq, cr0*4+so\n\t" "bne- cr1, 1f\n\t" /* Do the function call */ "std 2, %13(1)\n\t" #if _CALL_ELF != 2 "ld 0, 0(28)\n\t" "ld 2, 8(28)\n\t" "mtctr 0\n\t" #else "mr 12, 28\n\t" "mtctr 12\n\t" #endif "mr 3, 27\n\t" "bctrl\n\t" "ld 2, %13(1)\n\t" /* Call _exit(r3) */ "li 0, %4\n\t" "sc\n\t" /* Return to parent */ "1:\n\t" "mr %0, 3\n\t" : "=r" (res) : "0" (-1), "i" (EINVAL), "i" (__NR_clone), "i" (__NR_exit), "r" (__fn), "r" (__cstack), "r" (__flags), "r" (__arg), "r" (__ptidptr), "r" (__newtls), "r" (__ctidptr), "i" (FRAME_MIN_SIZE), "i" (FRAME_TOC_SAVE) : "cr0", "cr1", "memory", "ctr", "r0", "r29", "r27", "r28"); return res; } #endif // defined(__x86_64__) && SANITIZER_LINUX #if SANITIZER_ANDROID #if __ANDROID_API__ < 21 extern "C" __attribute__((weak)) int dl_iterate_phdr( int (*)(struct dl_phdr_info *, size_t, void *), void *); #endif static int dl_iterate_phdr_test_cb(struct dl_phdr_info *info, size_t size, void *data) { // Any name starting with "lib" indicates a bug in L where library base names // are returned instead of paths. if (info->dlpi_name && info->dlpi_name[0] == 'l' && info->dlpi_name[1] == 'i' && info->dlpi_name[2] == 'b') { *(bool *)data = true; return 1; } return 0; } static atomic_uint32_t android_api_level; static AndroidApiLevel AndroidDetectApiLevel() { if (!&dl_iterate_phdr) return ANDROID_KITKAT; // K or lower bool base_name_seen = false; dl_iterate_phdr(dl_iterate_phdr_test_cb, &base_name_seen); if (base_name_seen) return ANDROID_LOLLIPOP_MR1; // L MR1 return ANDROID_POST_LOLLIPOP; // post-L // Plain L (API level 21) is completely broken wrt ASan and not very // interesting to detect. } AndroidApiLevel AndroidGetApiLevel() { AndroidApiLevel level = (AndroidApiLevel)atomic_load(&android_api_level, memory_order_relaxed); if (level) return level; level = AndroidDetectApiLevel(); atomic_store(&android_api_level, level, memory_order_relaxed); return level; } #endif bool IsHandledDeadlySignal(int signum) { if (common_flags()->handle_abort && signum == SIGABRT) return true; if (common_flags()->handle_sigill && signum == SIGILL) return true; if (common_flags()->handle_sigfpe && signum == SIGFPE) return true; return (signum == SIGSEGV || signum == SIGBUS) && common_flags()->handle_segv; } #if !SANITIZER_GO void *internal_start_thread(void(*func)(void *arg), void *arg) { // Start the thread with signals blocked, otherwise it can steal user signals. __sanitizer_sigset_t set, old; internal_sigfillset(&set); #if SANITIZER_LINUX && !SANITIZER_ANDROID // Glibc uses SIGSETXID signal during setuid call. If this signal is blocked // on any thread, setuid call hangs (see test/tsan/setuid.c). internal_sigdelset(&set, 33); #endif internal_sigprocmask(SIG_SETMASK, &set, &old); void *th; real_pthread_create(&th, nullptr, (void*(*)(void *arg))func, arg); internal_sigprocmask(SIG_SETMASK, &old, nullptr); return th; } void internal_join_thread(void *th) { real_pthread_join(th, nullptr); } #else void *internal_start_thread(void (*func)(void *), void *arg) { return 0; } void internal_join_thread(void *th) {} #endif #if defined(__aarch64__) // Android headers in the older NDK releases miss this definition. struct __sanitizer_esr_context { struct _aarch64_ctx head; uint64_t esr; }; static bool Aarch64GetESR(ucontext_t *ucontext, u64 *esr) { static const u32 kEsrMagic = 0x45535201; u8 *aux = ucontext->uc_mcontext.__reserved; while (true) { _aarch64_ctx *ctx = (_aarch64_ctx *)aux; if (ctx->size == 0) break; if (ctx->magic == kEsrMagic) { *esr = ((__sanitizer_esr_context *)ctx)->esr; return true; } aux += ctx->size; } return false; } #endif SignalContext::WriteFlag SignalContext::GetWriteFlag(void *context) { ucontext_t *ucontext = (ucontext_t *)context; #if defined(__x86_64__) || defined(__i386__) static const uptr PF_WRITE = 1U << 1; #if SANITIZER_FREEBSD uptr err = ucontext->uc_mcontext.mc_err; #else uptr err = ucontext->uc_mcontext.gregs[REG_ERR]; #endif return err & PF_WRITE ? WRITE : READ; #elif defined(__arm__) static const uptr FSR_WRITE = 1U << 11; uptr fsr = ucontext->uc_mcontext.error_code; return fsr & FSR_WRITE ? WRITE : READ; #elif defined(__aarch64__) static const u64 ESR_ELx_WNR = 1U << 6; u64 esr; if (!Aarch64GetESR(ucontext, &esr)) return UNKNOWN; return esr & ESR_ELx_WNR ? WRITE : READ; #else (void)ucontext; return UNKNOWN; // FIXME: Implement. #endif } void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { #if defined(__arm__) ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.arm_pc; *bp = ucontext->uc_mcontext.arm_fp; *sp = ucontext->uc_mcontext.arm_sp; #elif defined(__aarch64__) ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.pc; *bp = ucontext->uc_mcontext.regs[29]; *sp = ucontext->uc_mcontext.sp; #elif defined(__hppa__) ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.sc_iaoq[0]; /* GCC uses %r3 whenever a frame pointer is needed. */ *bp = ucontext->uc_mcontext.sc_gr[3]; *sp = ucontext->uc_mcontext.sc_gr[30]; #elif defined(__x86_64__) # if SANITIZER_FREEBSD ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.mc_rip; *bp = ucontext->uc_mcontext.mc_rbp; *sp = ucontext->uc_mcontext.mc_rsp; # else ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.gregs[REG_RIP]; *bp = ucontext->uc_mcontext.gregs[REG_RBP]; *sp = ucontext->uc_mcontext.gregs[REG_RSP]; # endif #elif defined(__i386__) # if SANITIZER_FREEBSD ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.mc_eip; *bp = ucontext->uc_mcontext.mc_ebp; *sp = ucontext->uc_mcontext.mc_esp; # else ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.gregs[REG_EIP]; *bp = ucontext->uc_mcontext.gregs[REG_EBP]; *sp = ucontext->uc_mcontext.gregs[REG_ESP]; # endif #elif defined(__powerpc__) || defined(__powerpc64__) ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.regs->nip; *sp = ucontext->uc_mcontext.regs->gpr[PT_R1]; // The powerpc{,64}-linux ABIs do not specify r31 as the frame // pointer, but GCC always uses r31 when we need a frame pointer. *bp = ucontext->uc_mcontext.regs->gpr[PT_R31]; #elif defined(__sparc__) ucontext_t *ucontext = (ucontext_t*)context; uptr *stk_ptr; # if defined (__arch64__) *pc = ucontext->uc_mcontext.mc_gregs[MC_PC]; *sp = ucontext->uc_mcontext.mc_gregs[MC_O6]; stk_ptr = (uptr *) (*sp + 2047); *bp = stk_ptr[15]; # else *pc = ucontext->uc_mcontext.gregs[REG_PC]; *sp = ucontext->uc_mcontext.gregs[REG_O6]; stk_ptr = (uptr *) *sp; *bp = stk_ptr[15]; # endif #elif defined(__mips__) ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.pc; *bp = ucontext->uc_mcontext.gregs[30]; *sp = ucontext->uc_mcontext.gregs[29]; #elif defined(__s390__) ucontext_t *ucontext = (ucontext_t*)context; # if defined(__s390x__) *pc = ucontext->uc_mcontext.psw.addr; # else *pc = ucontext->uc_mcontext.psw.addr & 0x7fffffff; # endif *bp = ucontext->uc_mcontext.gregs[11]; *sp = ucontext->uc_mcontext.gregs[15]; #else # error "Unsupported arch" #endif } void MaybeReexec() { // No need to re-exec on Linux. } uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding) { UNREACHABLE("FindAvailableMemoryRange is not available"); return 0; } } // namespace __sanitizer #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_libc.cc0000664000175000017500000001703712742007225030650 0ustar mwhudsonmwhudson//===-- sanitizer_libc.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. See sanitizer_libc.h for details. //===----------------------------------------------------------------------===// #include "sanitizer_allocator_internal.h" #include "sanitizer_common.h" #include "sanitizer_libc.h" namespace __sanitizer { s64 internal_atoll(const char *nptr) { return internal_simple_strtoll(nptr, nullptr, 10); } void *internal_memchr(const void *s, int c, uptr n) { const char *t = (const char *)s; for (uptr i = 0; i < n; ++i, ++t) if (*t == c) return reinterpret_cast(const_cast(t)); return nullptr; } void *internal_memrchr(const void *s, int c, uptr n) { const char *t = (const char *)s; void *res = nullptr; for (uptr i = 0; i < n; ++i, ++t) { if (*t == c) res = reinterpret_cast(const_cast(t)); } return res; } int internal_memcmp(const void* s1, const void* s2, uptr n) { const char *t1 = (const char *)s1; const char *t2 = (const char *)s2; for (uptr i = 0; i < n; ++i, ++t1, ++t2) if (*t1 != *t2) return *t1 < *t2 ? -1 : 1; return 0; } void *internal_memcpy(void *dest, const void *src, uptr n) { char *d = (char*)dest; const char *s = (const char *)src; for (uptr i = 0; i < n; ++i) d[i] = s[i]; return dest; } void *internal_memmove(void *dest, const void *src, uptr n) { char *d = (char*)dest; const char *s = (const char *)src; sptr i, signed_n = (sptr)n; CHECK_GE(signed_n, 0); if (d < s) { for (i = 0; i < signed_n; ++i) d[i] = s[i]; } else { if (d > s && signed_n > 0) for (i = signed_n - 1; i >= 0 ; --i) { d[i] = s[i]; } } return dest; } // Semi-fast bzero for 16-aligned data. Still far from peak performance. void internal_bzero_aligned16(void *s, uptr n) { struct ALIGNED(16) S16 { u64 a, b; }; CHECK_EQ((reinterpret_cast(s) | n) & 15, 0); for (S16 *p = reinterpret_cast(s), *end = p + n / 16; p < end; p++) { p->a = p->b = 0; // Make sure this does not become memset. SanitizerBreakOptimization(nullptr); } } void *internal_memset(void* s, int c, uptr n) { // The next line prevents Clang from making a call to memset() instead of the // loop below. // FIXME: building the runtime with -ffreestanding is a better idea. However // there currently are linktime problems due to PR12396. char volatile *t = (char*)s; for (uptr i = 0; i < n; ++i, ++t) { *t = c; } return s; } uptr internal_strcspn(const char *s, const char *reject) { uptr i; for (i = 0; s[i]; i++) { if (internal_strchr(reject, s[i])) return i; } return i; } char* internal_strdup(const char *s) { uptr len = internal_strlen(s); char *s2 = (char*)InternalAlloc(len + 1); internal_memcpy(s2, s, len); s2[len] = 0; return s2; } char* internal_strndup(const char *s, uptr n) { uptr len = internal_strnlen(s, n); char *s2 = (char*)InternalAlloc(len + 1); internal_memcpy(s2, s, len); s2[len] = 0; return s2; } int internal_strcmp(const char *s1, const char *s2) { while (true) { unsigned c1 = *s1; unsigned c2 = *s2; if (c1 != c2) return (c1 < c2) ? -1 : 1; if (c1 == 0) break; s1++; s2++; } return 0; } int internal_strncmp(const char *s1, const char *s2, uptr n) { for (uptr i = 0; i < n; i++) { unsigned c1 = *s1; unsigned c2 = *s2; if (c1 != c2) return (c1 < c2) ? -1 : 1; if (c1 == 0) break; s1++; s2++; } return 0; } char* internal_strchr(const char *s, int c) { while (true) { if (*s == (char)c) return const_cast(s); if (*s == 0) return nullptr; s++; } } char *internal_strchrnul(const char *s, int c) { char *res = internal_strchr(s, c); if (!res) res = const_cast(s) + internal_strlen(s); return res; } char *internal_strrchr(const char *s, int c) { const char *res = nullptr; for (uptr i = 0; s[i]; i++) { if (s[i] == c) res = s + i; } return const_cast(res); } uptr internal_strlen(const char *s) { uptr i = 0; while (s[i]) i++; return i; } uptr internal_strlcat(char *dst, const char *src, uptr maxlen) { const uptr srclen = internal_strlen(src); const uptr dstlen = internal_strnlen(dst, maxlen); if (dstlen == maxlen) return maxlen + srclen; if (srclen < maxlen - dstlen) { internal_memmove(dst + dstlen, src, srclen + 1); } else { internal_memmove(dst + dstlen, src, maxlen - dstlen - 1); dst[maxlen - 1] = '\0'; } return dstlen + srclen; } char *internal_strncat(char *dst, const char *src, uptr n) { uptr len = internal_strlen(dst); uptr i; for (i = 0; i < n && src[i]; i++) dst[len + i] = src[i]; dst[len + i] = 0; return dst; } uptr internal_strlcpy(char *dst, const char *src, uptr maxlen) { const uptr srclen = internal_strlen(src); if (srclen < maxlen) { internal_memmove(dst, src, srclen + 1); } else if (maxlen != 0) { internal_memmove(dst, src, maxlen - 1); dst[maxlen - 1] = '\0'; } return srclen; } char *internal_strncpy(char *dst, const char *src, uptr n) { uptr i; for (i = 0; i < n && src[i]; i++) dst[i] = src[i]; internal_memset(dst + i, '\0', n - i); return dst; } uptr internal_strnlen(const char *s, uptr maxlen) { uptr i = 0; while (i < maxlen && s[i]) i++; return i; } char *internal_strstr(const char *haystack, const char *needle) { // This is O(N^2), but we are not using it in hot places. uptr len1 = internal_strlen(haystack); uptr len2 = internal_strlen(needle); if (len1 < len2) return nullptr; for (uptr pos = 0; pos <= len1 - len2; pos++) { if (internal_memcmp(haystack + pos, needle, len2) == 0) return const_cast(haystack) + pos; } return nullptr; } uptr internal_wcslen(const wchar_t *s) { uptr i = 0; while (s[i]) i++; return i; } s64 internal_simple_strtoll(const char *nptr, char **endptr, int base) { CHECK_EQ(base, 10); while (IsSpace(*nptr)) nptr++; int sgn = 1; u64 res = 0; bool have_digits = false; char *old_nptr = const_cast(nptr); if (*nptr == '+') { sgn = 1; nptr++; } else if (*nptr == '-') { sgn = -1; nptr++; } while (IsDigit(*nptr)) { res = (res <= UINT64_MAX / 10) ? res * 10 : UINT64_MAX; int digit = ((*nptr) - '0'); res = (res <= UINT64_MAX - digit) ? res + digit : UINT64_MAX; have_digits = true; nptr++; } if (endptr) { *endptr = (have_digits) ? const_cast(nptr) : old_nptr; } if (sgn > 0) { return (s64)(Min((u64)INT64_MAX, res)); } else { return (res > INT64_MAX) ? INT64_MIN : ((s64)res * -1); } } bool mem_is_zero(const char *beg, uptr size) { CHECK_LE(size, 1ULL << FIRST_32_SECOND_64(30, 40)); // Sanity check. const char *end = beg + size; uptr *aligned_beg = (uptr *)RoundUpTo((uptr)beg, sizeof(uptr)); uptr *aligned_end = (uptr *)RoundDownTo((uptr)end, sizeof(uptr)); uptr all = 0; // Prologue. for (const char *mem = beg; mem < (char*)aligned_beg && mem < end; mem++) all |= *mem; // Aligned loop. for (; aligned_beg < aligned_end; aligned_beg++) all |= *aligned_beg; // Epilogue. if ((char*)aligned_end >= beg) for (const char *mem = (char*)aligned_end; mem < end; mem++) all |= *mem; return all == 0; } } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_tls_get_addr.h0000664000175000017500000000412312525510207032222 0ustar mwhudsonmwhudson//===-- sanitizer_tls_get_addr.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Handle the __tls_get_addr call. // // All this magic is specific to glibc and is required to workaround // the lack of interface that would tell us about the Dynamic TLS (DTLS). // https://sourceware.org/bugzilla/show_bug.cgi?id=16291 // // The matters get worse because the glibc implementation changed between // 2.18 and 2.19: // https://groups.google.com/forum/#!topic/address-sanitizer/BfwYD8HMxTM // // Before 2.19, every DTLS chunk is allocated with __libc_memalign, // which we intercept and thus know where is the DTLS. // Since 2.19, DTLS chunks are allocated with __signal_safe_memalign, // which is an internal function that wraps a mmap call, neither of which // we can intercept. Luckily, __signal_safe_memalign has a simple parseable // header which we can use. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_TLS_GET_ADDR_H #define SANITIZER_TLS_GET_ADDR_H #include "sanitizer_common.h" namespace __sanitizer { struct DTLS { // Array of DTLS chunks for the current Thread. // If beg == 0, the chunk is unused. struct DTV { uptr beg, size; }; uptr dtv_size; DTV *dtv; // dtv_size elements, allocated by MmapOrDie. // Auxiliary fields, don't access them outside sanitizer_tls_get_addr.cc uptr last_memalign_size; uptr last_memalign_ptr; }; // Returns pointer and size of a linker-allocated TLS block. // Each block is returned exactly once. DTLS::DTV *DTLS_on_tls_get_addr(void *arg, void *res, uptr static_tls_begin, uptr static_tls_end); void DTLS_on_libc_memalign(void *ptr, uptr size); DTLS *DTLS_Get(); void DTLS_Destroy(); // Make sure to call this before the thread is destroyed. } // namespace __sanitizer #endif // SANITIZER_TLS_GET_ADDR_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_persistent_allocator.ccgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_persistent_allocator.c0000664000175000017500000000122312337065625034032 0ustar mwhudsonmwhudson//===-- sanitizer_persistent_allocator.cc -----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_persistent_allocator.h" namespace __sanitizer { PersistentAllocator thePersistentAllocator; } // namespace __sanitizer golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_linux_libcdep.cc0000664000175000017500000004140612772714063032565 0ustar mwhudsonmwhudson//===-- sanitizer_linux_libcdep.cc ----------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and implements linux-specific functions from // sanitizer_libc.h. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "sanitizer_allocator_internal.h" #include "sanitizer_atomic.h" #include "sanitizer_common.h" #include "sanitizer_flags.h" #include "sanitizer_freebsd.h" #include "sanitizer_linux.h" #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #if SANITIZER_ANDROID || SANITIZER_FREEBSD #include // for dlsym() #endif #include #include #include #include #include #if SANITIZER_FREEBSD #include #include #define pthread_getattr_np pthread_attr_get_np #endif #if SANITIZER_LINUX #include #endif #if SANITIZER_ANDROID #include #endif #if SANITIZER_ANDROID && __ANDROID_API__ < 21 #include #endif #if !SANITIZER_ANDROID #include #include #endif namespace __sanitizer { SANITIZER_WEAK_ATTRIBUTE int real_sigaction(int signum, const void *act, void *oldact); int internal_sigaction(int signum, const void *act, void *oldact) { #if !SANITIZER_GO if (&real_sigaction) return real_sigaction(signum, act, oldact); #endif return sigaction(signum, (const struct sigaction *)act, (struct sigaction *)oldact); } void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, uptr *stack_bottom) { CHECK(stack_top); CHECK(stack_bottom); if (at_initialization) { // This is the main thread. Libpthread may not be initialized yet. struct rlimit rl; CHECK_EQ(getrlimit(RLIMIT_STACK, &rl), 0); // Find the mapping that contains a stack variable. MemoryMappingLayout proc_maps(/*cache_enabled*/true); uptr start, end, offset; uptr prev_end = 0; while (proc_maps.Next(&start, &end, &offset, nullptr, 0, /* protection */nullptr)) { if ((uptr)&rl < end) break; prev_end = end; } CHECK((uptr)&rl >= start && (uptr)&rl < end); // Get stacksize from rlimit, but clip it so that it does not overlap // with other mappings. uptr stacksize = rl.rlim_cur; if (stacksize > end - prev_end) stacksize = end - prev_end; // When running with unlimited stack size, we still want to set some limit. // The unlimited stack size is caused by 'ulimit -s unlimited'. // Also, for some reason, GNU make spawns subprocesses with unlimited stack. if (stacksize > kMaxThreadStackSize) stacksize = kMaxThreadStackSize; *stack_top = end; *stack_bottom = end - stacksize; return; } pthread_attr_t attr; pthread_attr_init(&attr); CHECK_EQ(pthread_getattr_np(pthread_self(), &attr), 0); uptr stacksize = 0; void *stackaddr = nullptr; my_pthread_attr_getstack(&attr, &stackaddr, &stacksize); pthread_attr_destroy(&attr); CHECK_LE(stacksize, kMaxThreadStackSize); // Sanity check. *stack_top = (uptr)stackaddr + stacksize; *stack_bottom = (uptr)stackaddr; } #if !SANITIZER_GO bool SetEnv(const char *name, const char *value) { void *f = dlsym(RTLD_NEXT, "setenv"); if (!f) return false; typedef int(*setenv_ft)(const char *name, const char *value, int overwrite); setenv_ft setenv_f; CHECK_EQ(sizeof(setenv_f), sizeof(f)); internal_memcpy(&setenv_f, &f, sizeof(f)); return setenv_f(name, value, 1) == 0; } #endif bool SanitizerSetThreadName(const char *name) { #ifdef PR_SET_NAME return 0 == prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); // NOLINT #else return false; #endif } bool SanitizerGetThreadName(char *name, int max_len) { #ifdef PR_GET_NAME char buff[17]; if (prctl(PR_GET_NAME, (unsigned long)buff, 0, 0, 0)) // NOLINT return false; internal_strncpy(name, buff, max_len); name[max_len] = 0; return true; #else return false; #endif } #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO static uptr g_tls_size; #ifdef __i386__ # define DL_INTERNAL_FUNCTION __attribute__((regparm(3), stdcall)) #else # define DL_INTERNAL_FUNCTION #endif void InitTlsSize() { // all current supported platforms have 16 bytes stack alignment const size_t kStackAlign = 16; typedef void (*get_tls_func)(size_t*, size_t*) DL_INTERNAL_FUNCTION; get_tls_func get_tls; void *get_tls_static_info_ptr = dlsym(RTLD_NEXT, "_dl_get_tls_static_info"); CHECK_EQ(sizeof(get_tls), sizeof(get_tls_static_info_ptr)); internal_memcpy(&get_tls, &get_tls_static_info_ptr, sizeof(get_tls_static_info_ptr)); CHECK_NE(get_tls, 0); size_t tls_size = 0; size_t tls_align = 0; get_tls(&tls_size, &tls_align); if (tls_align < kStackAlign) tls_align = kStackAlign; g_tls_size = RoundUpTo(tls_size, tls_align); } #else void InitTlsSize() { } #endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) \ || defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__)) \ && SANITIZER_LINUX && !SANITIZER_ANDROID // sizeof(struct pthread) from glibc. static atomic_uintptr_t kThreadDescriptorSize; uptr ThreadDescriptorSize() { uptr val = atomic_load(&kThreadDescriptorSize, memory_order_relaxed); if (val) return val; #if defined(__x86_64__) || defined(__i386__) #ifdef _CS_GNU_LIBC_VERSION char buf[64]; uptr len = confstr(_CS_GNU_LIBC_VERSION, buf, sizeof(buf)); if (len < sizeof(buf) && internal_strncmp(buf, "glibc 2.", 8) == 0) { char *end; int minor = internal_simple_strtoll(buf + 8, &end, 10); if (end != buf + 8 && (*end == '\0' || *end == '.')) { int patch = 0; if (*end == '.') // strtoll will return 0 if no valid conversion could be performed patch = internal_simple_strtoll(end + 1, nullptr, 10); /* sizeof(struct pthread) values from various glibc versions. */ if (SANITIZER_X32) val = 1728; // Assume only one particular version for x32. else if (minor <= 3) val = FIRST_32_SECOND_64(1104, 1696); else if (minor == 4) val = FIRST_32_SECOND_64(1120, 1728); else if (minor == 5) val = FIRST_32_SECOND_64(1136, 1728); else if (minor <= 9) val = FIRST_32_SECOND_64(1136, 1712); else if (minor == 10) val = FIRST_32_SECOND_64(1168, 1776); else if (minor == 11 || (minor == 12 && patch == 1)) val = FIRST_32_SECOND_64(1168, 2288); else if (minor <= 13) val = FIRST_32_SECOND_64(1168, 2304); else val = FIRST_32_SECOND_64(1216, 2304); } if (val) atomic_store(&kThreadDescriptorSize, val, memory_order_relaxed); return val; } #endif #elif defined(__mips__) // TODO(sagarthakur): add more values as per different glibc versions. val = FIRST_32_SECOND_64(1152, 1776); if (val) atomic_store(&kThreadDescriptorSize, val, memory_order_relaxed); return val; #elif defined(__aarch64__) // The sizeof (struct pthread) is the same from GLIBC 2.17 to 2.22. val = 1776; atomic_store(&kThreadDescriptorSize, val, memory_order_relaxed); return val; #elif defined(__powerpc64__) val = 1776; // from glibc.ppc64le 2.20-8.fc21 atomic_store(&kThreadDescriptorSize, val, memory_order_relaxed); return val; #elif defined(__s390__) val = FIRST_32_SECOND_64(1152, 1776); // valid for glibc 2.22 atomic_store(&kThreadDescriptorSize, val, memory_order_relaxed); #endif return 0; } // The offset at which pointer to self is located in the thread descriptor. const uptr kThreadSelfOffset = FIRST_32_SECOND_64(8, 16); uptr ThreadSelfOffset() { return kThreadSelfOffset; } #if defined(__mips__) || defined(__powerpc64__) // TlsPreTcbSize includes size of struct pthread_descr and size of tcb // head structure. It lies before the static tls blocks. static uptr TlsPreTcbSize() { # if defined(__mips__) const uptr kTcbHead = 16; // sizeof (tcbhead_t) # elif defined(__powerpc64__) const uptr kTcbHead = 88; // sizeof (tcbhead_t) # endif const uptr kTlsAlign = 16; const uptr kTlsPreTcbSize = (ThreadDescriptorSize() + kTcbHead + kTlsAlign - 1) & ~(kTlsAlign - 1); InitTlsSize(); g_tls_size = (g_tls_size + kTlsPreTcbSize + kTlsAlign -1) & ~(kTlsAlign - 1); return kTlsPreTcbSize; } #endif uptr ThreadSelf() { uptr descr_addr; # if defined(__i386__) asm("mov %%gs:%c1,%0" : "=r"(descr_addr) : "i"(kThreadSelfOffset)); # elif defined(__x86_64__) asm("mov %%fs:%c1,%0" : "=r"(descr_addr) : "i"(kThreadSelfOffset)); # elif defined(__mips__) // MIPS uses TLS variant I. The thread pointer (in hardware register $29) // points to the end of the TCB + 0x7000. The pthread_descr structure is // immediately in front of the TCB. TlsPreTcbSize() includes the size of the // TCB and the size of pthread_descr. const uptr kTlsTcbOffset = 0x7000; uptr thread_pointer; asm volatile(".set push;\ .set mips64r2;\ rdhwr %0,$29;\ .set pop" : "=r" (thread_pointer)); descr_addr = thread_pointer - kTlsTcbOffset - TlsPreTcbSize(); # elif defined(__aarch64__) descr_addr = reinterpret_cast(__builtin_thread_pointer()) - ThreadDescriptorSize(); # elif defined(__s390__) descr_addr = reinterpret_cast(__builtin_thread_pointer()); # elif defined(__powerpc64__) // PPC64LE uses TLS variant I. The thread pointer (in GPR 13) // points to the end of the TCB + 0x7000. The pthread_descr structure is // immediately in front of the TCB. TlsPreTcbSize() includes the size of the // TCB and the size of pthread_descr. const uptr kTlsTcbOffset = 0x7000; uptr thread_pointer; asm("addi %0,13,%1" : "=r"(thread_pointer) : "I"(-kTlsTcbOffset)); descr_addr = thread_pointer - TlsPreTcbSize(); # else # error "unsupported CPU arch" # endif return descr_addr; } #endif // (x86_64 || i386 || MIPS) && SANITIZER_LINUX #if SANITIZER_FREEBSD static void **ThreadSelfSegbase() { void **segbase = 0; # if defined(__i386__) // sysarch(I386_GET_GSBASE, segbase); __asm __volatile("mov %%gs:0, %0" : "=r" (segbase)); # elif defined(__x86_64__) // sysarch(AMD64_GET_FSBASE, segbase); __asm __volatile("movq %%fs:0, %0" : "=r" (segbase)); # else # error "unsupported CPU arch for FreeBSD platform" # endif return segbase; } uptr ThreadSelf() { return (uptr)ThreadSelfSegbase()[2]; } #endif // SANITIZER_FREEBSD #if !SANITIZER_GO static void GetTls(uptr *addr, uptr *size) { #if SANITIZER_LINUX && !SANITIZER_ANDROID # if defined(__x86_64__) || defined(__i386__) || defined(__s390__) *addr = ThreadSelf(); *size = GetTlsSize(); *addr -= *size; *addr += ThreadDescriptorSize(); # elif defined(__mips__) || defined(__aarch64__) || defined(__powerpc64__) *addr = ThreadSelf(); *size = GetTlsSize(); # else *addr = 0; *size = 0; # endif #elif SANITIZER_FREEBSD void** segbase = ThreadSelfSegbase(); *addr = 0; *size = 0; if (segbase != 0) { // tcbalign = 16 // tls_size = round(tls_static_space, tcbalign); // dtv = segbase[1]; // dtv[2] = segbase - tls_static_space; void **dtv = (void**) segbase[1]; *addr = (uptr) dtv[2]; *size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]); } #elif SANITIZER_ANDROID *addr = 0; *size = 0; #else # error "Unknown OS" #endif } #endif #if !SANITIZER_GO uptr GetTlsSize() { #if SANITIZER_FREEBSD || SANITIZER_ANDROID uptr addr, size; GetTls(&addr, &size); return size; #else return g_tls_size; #endif } #endif void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, uptr *tls_addr, uptr *tls_size) { #if SANITIZER_GO // Stub implementation for Go. *stk_addr = *stk_size = *tls_addr = *tls_size = 0; #else GetTls(tls_addr, tls_size); uptr stack_top, stack_bottom; GetThreadStackTopAndBottom(main, &stack_top, &stack_bottom); *stk_addr = stack_bottom; *stk_size = stack_top - stack_bottom; if (!main) { // If stack and tls intersect, make them non-intersecting. if (*tls_addr > *stk_addr && *tls_addr < *stk_addr + *stk_size) { CHECK_GT(*tls_addr + *tls_size, *stk_addr); CHECK_LE(*tls_addr + *tls_size, *stk_addr + *stk_size); *stk_size -= *tls_size; *tls_addr = *stk_addr + *stk_size; } } #endif } # if !SANITIZER_FREEBSD typedef ElfW(Phdr) Elf_Phdr; # elif SANITIZER_WORDSIZE == 32 && __FreeBSD_version <= 902001 // v9.2 # define Elf_Phdr XElf32_Phdr # define dl_phdr_info xdl_phdr_info # define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b)) # endif struct DlIteratePhdrData { InternalMmapVector *modules; bool first; }; static int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *arg) { DlIteratePhdrData *data = (DlIteratePhdrData*)arg; InternalScopedString module_name(kMaxPathLength); if (data->first) { data->first = false; // First module is the binary itself. ReadBinaryNameCached(module_name.data(), module_name.size()); } else if (info->dlpi_name) { module_name.append("%s", info->dlpi_name); } if (module_name[0] == '\0') return 0; LoadedModule cur_module; cur_module.set(module_name.data(), info->dlpi_addr); for (int i = 0; i < info->dlpi_phnum; i++) { const Elf_Phdr *phdr = &info->dlpi_phdr[i]; if (phdr->p_type == PT_LOAD) { uptr cur_beg = info->dlpi_addr + phdr->p_vaddr; uptr cur_end = cur_beg + phdr->p_memsz; bool executable = phdr->p_flags & PF_X; cur_module.addAddressRange(cur_beg, cur_end, executable); } } data->modules->push_back(cur_module); return 0; } #if SANITIZER_ANDROID && __ANDROID_API__ < 21 extern "C" __attribute__((weak)) int dl_iterate_phdr( int (*)(struct dl_phdr_info *, size_t, void *), void *); #endif void ListOfModules::init() { clear(); #if SANITIZER_ANDROID && __ANDROID_API__ <= 22 u32 api_level = AndroidGetApiLevel(); // Fall back to /proc/maps if dl_iterate_phdr is unavailable or broken. // The runtime check allows the same library to work with // both K and L (and future) Android releases. if (api_level <= ANDROID_LOLLIPOP_MR1) { // L or earlier MemoryMappingLayout memory_mapping(false); memory_mapping.DumpListOfModules(&modules_); return; } #endif DlIteratePhdrData data = {&modules_, true}; dl_iterate_phdr(dl_iterate_phdr_cb, &data); } // getrusage does not give us the current RSS, only the max RSS. // Still, this is better than nothing if /proc/self/statm is not available // for some reason, e.g. due to a sandbox. static uptr GetRSSFromGetrusage() { struct rusage usage; if (getrusage(RUSAGE_SELF, &usage)) // Failed, probably due to a sandbox. return 0; return usage.ru_maxrss << 10; // ru_maxrss is in Kb. } uptr GetRSS() { if (!common_flags()->can_use_proc_maps_statm) return GetRSSFromGetrusage(); fd_t fd = OpenFile("/proc/self/statm", RdOnly); if (fd == kInvalidFd) return GetRSSFromGetrusage(); char buf[64]; uptr len = internal_read(fd, buf, sizeof(buf) - 1); internal_close(fd); if ((sptr)len <= 0) return 0; buf[len] = 0; // The format of the file is: // 1084 89 69 11 0 79 0 // We need the second number which is RSS in pages. char *pos = buf; // Skip the first number. while (*pos >= '0' && *pos <= '9') pos++; // Skip whitespaces. while (!(*pos >= '0' && *pos <= '9') && *pos != 0) pos++; // Read the number. uptr rss = 0; while (*pos >= '0' && *pos <= '9') rss = rss * 10 + *pos++ - '0'; return rss * GetPageSizeCached(); } // 64-bit Android targets don't provide the deprecated __android_log_write. // Starting with the L release, syslog() works and is preferable to // __android_log_write. #if SANITIZER_LINUX #if SANITIZER_ANDROID static atomic_uint8_t android_log_initialized; void AndroidLogInit() { openlog(GetProcessName(), 0, LOG_USER); atomic_store(&android_log_initialized, 1, memory_order_release); } static bool ShouldLogAfterPrintf() { return atomic_load(&android_log_initialized, memory_order_acquire); } #else void AndroidLogInit() {} static bool ShouldLogAfterPrintf() { return true; } #endif // SANITIZER_ANDROID void WriteOneLineToSyslog(const char *s) { #if SANITIZER_ANDROID &&__ANDROID_API__ < 21 __android_log_write(ANDROID_LOG_INFO, NULL, s); #else syslog(LOG_INFO, "%s", s); #endif } void LogMessageOnPrintf(const char *str) { if (common_flags()->log_to_syslog && ShouldLogAfterPrintf()) WriteToSyslog(str); } #endif // SANITIZER_LINUX } // namespace __sanitizer #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_allocator_internal.h0000664000175000017500000000471612766606132033465 0ustar mwhudsonmwhudson//===-- sanitizer_allocator_internal.h --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This allocator is used inside run-times. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ALLOCATOR_INTERNAL_H #define SANITIZER_ALLOCATOR_INTERNAL_H #include "sanitizer_allocator.h" #include "sanitizer_internal_defs.h" namespace __sanitizer { // FIXME: Check if we may use even more compact size class map for internal // purposes. typedef CompactSizeClassMap InternalSizeClassMap; static const uptr kInternalAllocatorSpace = 0; static const u64 kInternalAllocatorSize = SANITIZER_MMAP_RANGE_SIZE; static const uptr kInternalAllocatorRegionSizeLog = 20; #if SANITIZER_WORDSIZE == 32 static const uptr kInternalAllocatorNumRegions = kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog; typedef FlatByteMap ByteMap; #else static const uptr kInternalAllocatorNumRegions = kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog; typedef TwoLevelByteMap<(kInternalAllocatorNumRegions >> 12), 1 << 12> ByteMap; #endif typedef SizeClassAllocator32< kInternalAllocatorSpace, kInternalAllocatorSize, 0, InternalSizeClassMap, kInternalAllocatorRegionSizeLog, ByteMap> PrimaryInternalAllocator; typedef SizeClassAllocatorLocalCache InternalAllocatorCache; typedef CombinedAllocator > InternalAllocator; void *InternalAlloc(uptr size, InternalAllocatorCache *cache = nullptr, uptr alignment = 0); void *InternalRealloc(void *p, uptr size, InternalAllocatorCache *cache = nullptr); void *InternalCalloc(uptr countr, uptr size, InternalAllocatorCache *cache = nullptr); void InternalFree(void *p, InternalAllocatorCache *cache = nullptr); InternalAllocator *internal_allocator(); enum InternalAllocEnum { INTERNAL_ALLOC }; } // namespace __sanitizer inline void *operator new(__sanitizer::operator_new_size_type size, __sanitizer::InternalAllocEnum) { return __sanitizer::InternalAlloc(size); } #endif // SANITIZER_ALLOCATOR_INTERNAL_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_interceptors_format.incgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_interceptors_fo0000664000175000017500000004116512602553450034130 0ustar mwhudsonmwhudson//===-- sanitizer_common_interceptors_format.inc ----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Scanf/printf implementation for use in *Sanitizer interceptors. // Follows http://pubs.opengroup.org/onlinepubs/9699919799/functions/fscanf.html // and http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html // with a few common GNU extensions. // //===----------------------------------------------------------------------===// #include static const char *parse_number(const char *p, int *out) { *out = internal_atoll(p); while (*p >= '0' && *p <= '9') ++p; return p; } static const char *maybe_parse_param_index(const char *p, int *out) { // n$ if (*p >= '0' && *p <= '9') { int number; const char *q = parse_number(p, &number); CHECK(q); if (*q == '$') { *out = number; p = q + 1; } } // Otherwise, do not change p. This will be re-parsed later as the field // width. return p; } static bool char_is_one_of(char c, const char *s) { return !!internal_strchr(s, c); } static const char *maybe_parse_length_modifier(const char *p, char ll[2]) { if (char_is_one_of(*p, "jztLq")) { ll[0] = *p; ++p; } else if (*p == 'h') { ll[0] = 'h'; ++p; if (*p == 'h') { ll[1] = 'h'; ++p; } } else if (*p == 'l') { ll[0] = 'l'; ++p; if (*p == 'l') { ll[1] = 'l'; ++p; } } return p; } // Returns true if the character is an integer conversion specifier. static bool format_is_integer_conv(char c) { return char_is_one_of(c, "diouxXn"); } // Returns true if the character is an floating point conversion specifier. static bool format_is_float_conv(char c) { return char_is_one_of(c, "aAeEfFgG"); } // Returns string output character size for string-like conversions, // or 0 if the conversion is invalid. static int format_get_char_size(char convSpecifier, const char lengthModifier[2]) { if (char_is_one_of(convSpecifier, "CS")) { return sizeof(wchar_t); } if (char_is_one_of(convSpecifier, "cs[")) { if (lengthModifier[0] == 'l' && lengthModifier[1] == '\0') return sizeof(wchar_t); else if (lengthModifier[0] == '\0') return sizeof(char); } return 0; } enum FormatStoreSize { // Store size not known in advance; can be calculated as wcslen() of the // destination buffer. FSS_WCSLEN = -2, // Store size not known in advance; can be calculated as strlen() of the // destination buffer. FSS_STRLEN = -1, // Invalid conversion specifier. FSS_INVALID = 0 }; // Returns the memory size of a format directive (if >0), or a value of // FormatStoreSize. static int format_get_value_size(char convSpecifier, const char lengthModifier[2], bool promote_float) { if (format_is_integer_conv(convSpecifier)) { switch (lengthModifier[0]) { case 'h': return lengthModifier[1] == 'h' ? sizeof(char) : sizeof(short); case 'l': return lengthModifier[1] == 'l' ? sizeof(long long) : sizeof(long); case 'q': return sizeof(long long); case 'L': return sizeof(long long); case 'j': return sizeof(INTMAX_T); case 'z': return sizeof(SIZE_T); case 't': return sizeof(PTRDIFF_T); case 0: return sizeof(int); default: return FSS_INVALID; } } if (format_is_float_conv(convSpecifier)) { switch (lengthModifier[0]) { case 'L': case 'q': return sizeof(long double); case 'l': return lengthModifier[1] == 'l' ? sizeof(long double) : sizeof(double); case 0: // Printf promotes floats to doubles but scanf does not return promote_float ? sizeof(double) : sizeof(float); default: return FSS_INVALID; } } if (convSpecifier == 'p') { if (lengthModifier[0] != 0) return FSS_INVALID; return sizeof(void *); } return FSS_INVALID; } struct ScanfDirective { int argIdx; // argument index, or -1 if not specified ("%n$") int fieldWidth; const char *begin; const char *end; bool suppressed; // suppress assignment ("*") bool allocate; // allocate space ("m") char lengthModifier[2]; char convSpecifier; bool maybeGnuMalloc; }; // Parse scanf format string. If a valid directive in encountered, it is // returned in dir. This function returns the pointer to the first // unprocessed character, or 0 in case of error. // In case of the end-of-string, a pointer to the closing \0 is returned. static const char *scanf_parse_next(const char *p, bool allowGnuMalloc, ScanfDirective *dir) { internal_memset(dir, 0, sizeof(*dir)); dir->argIdx = -1; while (*p) { if (*p != '%') { ++p; continue; } dir->begin = p; ++p; // %% if (*p == '%') { ++p; continue; } if (*p == '\0') { return nullptr; } // %n$ p = maybe_parse_param_index(p, &dir->argIdx); CHECK(p); // * if (*p == '*') { dir->suppressed = true; ++p; } // Field width if (*p >= '0' && *p <= '9') { p = parse_number(p, &dir->fieldWidth); CHECK(p); if (dir->fieldWidth <= 0) // Width if at all must be non-zero return nullptr; } // m if (*p == 'm') { dir->allocate = true; ++p; } // Length modifier. p = maybe_parse_length_modifier(p, dir->lengthModifier); // Conversion specifier. dir->convSpecifier = *p++; // Consume %[...] expression. if (dir->convSpecifier == '[') { if (*p == '^') ++p; if (*p == ']') ++p; while (*p && *p != ']') ++p; if (*p == 0) return nullptr; // unexpected end of string // Consume the closing ']'. ++p; } // This is unfortunately ambiguous between old GNU extension // of %as, %aS and %a[...] and newer POSIX %a followed by // letters s, S or [. if (allowGnuMalloc && dir->convSpecifier == 'a' && !dir->lengthModifier[0]) { if (*p == 's' || *p == 'S') { dir->maybeGnuMalloc = true; ++p; } else if (*p == '[') { // Watch for %a[h-j%d], if % appears in the // [...] range, then we need to give up, we don't know // if scanf will parse it as POSIX %a [h-j %d ] or // GNU allocation of string with range dh-j plus %. const char *q = p + 1; if (*q == '^') ++q; if (*q == ']') ++q; while (*q && *q != ']' && *q != '%') ++q; if (*q == 0 || *q == '%') return nullptr; p = q + 1; // Consume the closing ']'. dir->maybeGnuMalloc = true; } } dir->end = p; break; } return p; } static int scanf_get_value_size(ScanfDirective *dir) { if (dir->allocate) { if (!char_is_one_of(dir->convSpecifier, "cCsS[")) return FSS_INVALID; return sizeof(char *); } if (dir->maybeGnuMalloc) { if (dir->convSpecifier != 'a' || dir->lengthModifier[0]) return FSS_INVALID; // This is ambiguous, so check the smaller size of char * (if it is // a GNU extension of %as, %aS or %a[...]) and float (if it is // POSIX %a followed by s, S or [ letters). return sizeof(char *) < sizeof(float) ? sizeof(char *) : sizeof(float); } if (char_is_one_of(dir->convSpecifier, "cCsS[")) { bool needsTerminator = char_is_one_of(dir->convSpecifier, "sS["); unsigned charSize = format_get_char_size(dir->convSpecifier, dir->lengthModifier); if (charSize == 0) return FSS_INVALID; if (dir->fieldWidth == 0) { if (!needsTerminator) return charSize; return (charSize == sizeof(char)) ? FSS_STRLEN : FSS_WCSLEN; } return (dir->fieldWidth + needsTerminator) * charSize; } return format_get_value_size(dir->convSpecifier, dir->lengthModifier, false); } // Common part of *scanf interceptors. // Process format string and va_list, and report all store ranges. // Stops when "consuming" n_inputs input items. static void scanf_common(void *ctx, int n_inputs, bool allowGnuMalloc, const char *format, va_list aq) { CHECK_GT(n_inputs, 0); const char *p = format; COMMON_INTERCEPTOR_READ_RANGE(ctx, format, internal_strlen(format) + 1); while (*p) { ScanfDirective dir; p = scanf_parse_next(p, allowGnuMalloc, &dir); if (!p) break; if (dir.convSpecifier == 0) { // This can only happen at the end of the format string. CHECK_EQ(*p, 0); break; } // Here the directive is valid. Do what it says. if (dir.argIdx != -1) { // Unsupported. break; } if (dir.suppressed) continue; int size = scanf_get_value_size(&dir); if (size == FSS_INVALID) { Report("WARNING: unexpected format specifier in scanf interceptor: " "%.*s\n", dir.end - dir.begin, dir.begin); break; } void *argp = va_arg(aq, void *); if (dir.convSpecifier != 'n') --n_inputs; if (n_inputs < 0) break; if (size == FSS_STRLEN) { size = internal_strlen((const char *)argp) + 1; } else if (size == FSS_WCSLEN) { // FIXME: actually use wcslen() to calculate it. size = 0; } COMMON_INTERCEPTOR_WRITE_RANGE(ctx, argp, size); } } #if SANITIZER_INTERCEPT_PRINTF struct PrintfDirective { int fieldWidth; int fieldPrecision; int argIdx; // width argument index, or -1 if not specified ("%*n$") int precisionIdx; // precision argument index, or -1 if not specified (".*n$") const char *begin; const char *end; bool starredWidth; bool starredPrecision; char lengthModifier[2]; char convSpecifier; }; static const char *maybe_parse_number(const char *p, int *out) { if (*p >= '0' && *p <= '9') p = parse_number(p, out); return p; } static const char *maybe_parse_number_or_star(const char *p, int *out, bool *star) { if (*p == '*') { *star = true; ++p; } else { *star = false; p = maybe_parse_number(p, out); } return p; } // Parse printf format string. Same as scanf_parse_next. static const char *printf_parse_next(const char *p, PrintfDirective *dir) { internal_memset(dir, 0, sizeof(*dir)); dir->argIdx = -1; dir->precisionIdx = -1; while (*p) { if (*p != '%') { ++p; continue; } dir->begin = p; ++p; // %% if (*p == '%') { ++p; continue; } if (*p == '\0') { return nullptr; } // %n$ p = maybe_parse_param_index(p, &dir->precisionIdx); CHECK(p); // Flags while (char_is_one_of(*p, "'-+ #0")) { ++p; } // Field width p = maybe_parse_number_or_star(p, &dir->fieldWidth, &dir->starredWidth); if (!p) return nullptr; // Precision if (*p == '.') { ++p; // Actual precision is optional (surprise!) p = maybe_parse_number_or_star(p, &dir->fieldPrecision, &dir->starredPrecision); if (!p) return nullptr; // m$ if (dir->starredPrecision) { p = maybe_parse_param_index(p, &dir->precisionIdx); CHECK(p); } } // Length modifier. p = maybe_parse_length_modifier(p, dir->lengthModifier); // Conversion specifier. dir->convSpecifier = *p++; dir->end = p; break; } return p; } static int printf_get_value_size(PrintfDirective *dir) { if (dir->convSpecifier == 'm') { return sizeof(char *); } if (char_is_one_of(dir->convSpecifier, "cCsS")) { unsigned charSize = format_get_char_size(dir->convSpecifier, dir->lengthModifier); if (charSize == 0) return FSS_INVALID; if (char_is_one_of(dir->convSpecifier, "sS")) { return (charSize == sizeof(char)) ? FSS_STRLEN : FSS_WCSLEN; } return charSize; } return format_get_value_size(dir->convSpecifier, dir->lengthModifier, true); } #define SKIP_SCALAR_ARG(aq, convSpecifier, size) \ do { \ if (format_is_float_conv(convSpecifier)) { \ switch (size) { \ case 8: \ va_arg(*aq, double); \ break; \ case 12: \ va_arg(*aq, long double); \ break; \ case 16: \ va_arg(*aq, long double); \ break; \ default: \ Report("WARNING: unexpected floating-point arg size" \ " in printf interceptor: %d\n", size); \ return; \ } \ } else { \ switch (size) { \ case 1: \ case 2: \ case 4: \ va_arg(*aq, u32); \ break; \ case 8: \ va_arg(*aq, u64); \ break; \ default: \ Report("WARNING: unexpected arg size" \ " in printf interceptor: %d\n", size); \ return; \ } \ } \ } while (0) // Common part of *printf interceptors. // Process format string and va_list, and report all load ranges. static void printf_common(void *ctx, const char *format, va_list aq) { COMMON_INTERCEPTOR_READ_RANGE(ctx, format, internal_strlen(format) + 1); const char *p = format; while (*p) { PrintfDirective dir; p = printf_parse_next(p, &dir); if (!p) break; if (dir.convSpecifier == 0) { // This can only happen at the end of the format string. CHECK_EQ(*p, 0); break; } // Here the directive is valid. Do what it says. if (dir.argIdx != -1 || dir.precisionIdx != -1) { // Unsupported. break; } if (dir.starredWidth) { // Dynamic width SKIP_SCALAR_ARG(&aq, 'd', sizeof(int)); } if (dir.starredPrecision) { // Dynamic precision SKIP_SCALAR_ARG(&aq, 'd', sizeof(int)); } int size = printf_get_value_size(&dir); if (size == FSS_INVALID) { Report("WARNING: unexpected format specifier in printf " "interceptor: %.*s\n", dir.end - dir.begin, dir.begin); break; } if (dir.convSpecifier == 'n') { void *argp = va_arg(aq, void *); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, argp, size); continue; } else if (size == FSS_STRLEN) { if (void *argp = va_arg(aq, void *)) { if (dir.starredPrecision) { // FIXME: properly support starred precision for strings. size = 0; } else if (dir.fieldPrecision > 0) { // Won't read more than "precision" symbols. size = internal_strnlen((const char *)argp, dir.fieldPrecision); if (size < dir.fieldPrecision) size++; } else { // Whole string will be accessed. size = internal_strlen((const char *)argp) + 1; } COMMON_INTERCEPTOR_READ_RANGE(ctx, argp, size); } } else if (size == FSS_WCSLEN) { if (void *argp = va_arg(aq, void *)) { // FIXME: Properly support wide-character strings (via wcsrtombs). size = 0; COMMON_INTERCEPTOR_READ_RANGE(ctx, argp, size); } } else { // Skip non-pointer args SKIP_SCALAR_ARG(&aq, dir.convSpecifier, size); } } } #endif // SANITIZER_INTERCEPT_PRINTF golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_win.cc0000664000175000017500000006734713004730632030542 0ustar mwhudsonmwhudson//===-- sanitizer_win.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries and implements windows-specific functions from // sanitizer_libc.h. //===----------------------------------------------------------------------===// #include "sanitizer_platform.h" #if SANITIZER_WINDOWS #define WIN32_LEAN_AND_MEAN #define NOGDI #include #include #include #include #include #include "sanitizer_common.h" #include "sanitizer_libc.h" #include "sanitizer_mutex.h" #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" namespace __sanitizer { #include "sanitizer_syscall_generic.inc" // --------------------- sanitizer_common.h uptr GetPageSize() { SYSTEM_INFO si; GetSystemInfo(&si); return si.dwPageSize; } uptr GetMmapGranularity() { SYSTEM_INFO si; GetSystemInfo(&si); return si.dwAllocationGranularity; } uptr GetMaxVirtualAddress() { SYSTEM_INFO si; GetSystemInfo(&si); return (uptr)si.lpMaximumApplicationAddress; } bool FileExists(const char *filename) { return ::GetFileAttributesA(filename) != INVALID_FILE_ATTRIBUTES; } uptr internal_getpid() { return GetProcessId(GetCurrentProcess()); } // In contrast to POSIX, on Windows GetCurrentThreadId() // returns a system-unique identifier. uptr GetTid() { return GetCurrentThreadId(); } uptr GetThreadSelf() { return GetTid(); } #if !SANITIZER_GO void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, uptr *stack_bottom) { CHECK(stack_top); CHECK(stack_bottom); MEMORY_BASIC_INFORMATION mbi; CHECK_NE(VirtualQuery(&mbi /* on stack */, &mbi, sizeof(mbi)), 0); // FIXME: is it possible for the stack to not be a single allocation? // Are these values what ASan expects to get (reserved, not committed; // including stack guard page) ? *stack_top = (uptr)mbi.BaseAddress + mbi.RegionSize; *stack_bottom = (uptr)mbi.AllocationBase; } #endif // #if !SANITIZER_GO void *MmapOrDie(uptr size, const char *mem_type, bool raw_report) { void *rv = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (rv == 0) ReportMmapFailureAndDie(size, mem_type, "allocate", GetLastError(), raw_report); return rv; } void UnmapOrDie(void *addr, uptr size) { if (!size || !addr) return; MEMORY_BASIC_INFORMATION mbi; CHECK(VirtualQuery(addr, &mbi, sizeof(mbi))); // MEM_RELEASE can only be used to unmap whole regions previously mapped with // VirtualAlloc. So we first try MEM_RELEASE since it is better, and if that // fails try MEM_DECOMMIT. if (VirtualFree(addr, 0, MEM_RELEASE) == 0) { if (VirtualFree(addr, size, MEM_DECOMMIT) == 0) { Report("ERROR: %s failed to " "deallocate 0x%zx (%zd) bytes at address %p (error code: %d)\n", SanitizerToolName, size, size, addr, GetLastError()); CHECK("unable to unmap" && 0); } } } // We want to map a chunk of address space aligned to 'alignment'. void *MmapAlignedOrDie(uptr size, uptr alignment, const char *mem_type) { CHECK(IsPowerOfTwo(size)); CHECK(IsPowerOfTwo(alignment)); // Windows will align our allocations to at least 64K. alignment = Max(alignment, GetMmapGranularity()); uptr mapped_addr = (uptr)VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (!mapped_addr) ReportMmapFailureAndDie(size, mem_type, "allocate aligned", GetLastError()); // If we got it right on the first try, return. Otherwise, unmap it and go to // the slow path. if (IsAligned(mapped_addr, alignment)) return (void*)mapped_addr; if (VirtualFree((void *)mapped_addr, 0, MEM_RELEASE) == 0) ReportMmapFailureAndDie(size, mem_type, "deallocate", GetLastError()); // If we didn't get an aligned address, overallocate, find an aligned address, // unmap, and try to allocate at that aligned address. int retries = 0; const int kMaxRetries = 10; for (; retries < kMaxRetries && (mapped_addr == 0 || !IsAligned(mapped_addr, alignment)); retries++) { // Overallocate size + alignment bytes. mapped_addr = (uptr)VirtualAlloc(0, size + alignment, MEM_RESERVE, PAGE_NOACCESS); if (!mapped_addr) ReportMmapFailureAndDie(size, mem_type, "allocate aligned", GetLastError()); // Find the aligned address. uptr aligned_addr = RoundUpTo(mapped_addr, alignment); // Free the overallocation. if (VirtualFree((void *)mapped_addr, 0, MEM_RELEASE) == 0) ReportMmapFailureAndDie(size, mem_type, "deallocate", GetLastError()); // Attempt to allocate exactly the number of bytes we need at the aligned // address. This may fail for a number of reasons, in which case we continue // the loop. mapped_addr = (uptr)VirtualAlloc((void *)aligned_addr, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); } // Fail if we can't make this work quickly. if (retries == kMaxRetries && mapped_addr == 0) ReportMmapFailureAndDie(size, mem_type, "allocate aligned", GetLastError()); return (void *)mapped_addr; } void *MmapFixedNoReserve(uptr fixed_addr, uptr size, const char *name) { // FIXME: is this really "NoReserve"? On Win32 this does not matter much, // but on Win64 it does. (void)name; // unsupported #if !SANITIZER_GO && SANITIZER_WINDOWS64 // On asan/Windows64, use MEM_COMMIT would result in error // 1455:ERROR_COMMITMENT_LIMIT. // Asan uses exception handler to commit page on demand. void *p = VirtualAlloc((LPVOID)fixed_addr, size, MEM_RESERVE, PAGE_READWRITE); #else void *p = VirtualAlloc((LPVOID)fixed_addr, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); #endif if (p == 0) Report("ERROR: %s failed to " "allocate %p (%zd) bytes at %p (error code: %d)\n", SanitizerToolName, size, size, fixed_addr, GetLastError()); return p; } // Memory space mapped by 'MmapFixedOrDie' must have been reserved by // 'MmapFixedNoAccess'. void *MmapFixedOrDie(uptr fixed_addr, uptr size) { void *p = VirtualAlloc((LPVOID)fixed_addr, size, MEM_COMMIT, PAGE_READWRITE); if (p == 0) { char mem_type[30]; internal_snprintf(mem_type, sizeof(mem_type), "memory at address 0x%zx", fixed_addr); ReportMmapFailureAndDie(size, mem_type, "allocate", GetLastError()); } return p; } void *MmapNoReserveOrDie(uptr size, const char *mem_type) { // FIXME: make this really NoReserve? return MmapOrDie(size, mem_type); } void *MmapFixedNoAccess(uptr fixed_addr, uptr size, const char *name) { (void)name; // unsupported void *res = VirtualAlloc((LPVOID)fixed_addr, size, MEM_RESERVE, PAGE_NOACCESS); if (res == 0) Report("WARNING: %s failed to " "mprotect %p (%zd) bytes at %p (error code: %d)\n", SanitizerToolName, size, size, fixed_addr, GetLastError()); return res; } void *MmapNoAccess(uptr size) { void *res = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_NOACCESS); if (res == 0) Report("WARNING: %s failed to " "mprotect %p (%zd) bytes (error code: %d)\n", SanitizerToolName, size, size, GetLastError()); return res; } bool MprotectNoAccess(uptr addr, uptr size) { DWORD old_protection; return VirtualProtect((LPVOID)addr, size, PAGE_NOACCESS, &old_protection); } void ReleaseMemoryToOS(uptr addr, uptr size) { // This is almost useless on 32-bits. // FIXME: add madvise-analog when we move to 64-bits. } void NoHugePagesInRegion(uptr addr, uptr size) { // FIXME: probably similar to ReleaseMemoryToOS. } void DontDumpShadowMemory(uptr addr, uptr length) { // This is almost useless on 32-bits. // FIXME: add madvise-analog when we move to 64-bits. } uptr FindAvailableMemoryRange(uptr size, uptr alignment, uptr left_padding) { uptr address = 0; while (true) { MEMORY_BASIC_INFORMATION info; if (!::VirtualQuery((void*)address, &info, sizeof(info))) return 0; if (info.State == MEM_FREE) { uptr shadow_address = RoundUpTo((uptr)info.BaseAddress + left_padding, alignment); if (shadow_address + size < (uptr)info.BaseAddress + info.RegionSize) return shadow_address; } // Move to the next region. address = (uptr)info.BaseAddress + info.RegionSize; } return 0; } bool MemoryRangeIsAvailable(uptr range_start, uptr range_end) { MEMORY_BASIC_INFORMATION mbi; CHECK(VirtualQuery((void *)range_start, &mbi, sizeof(mbi))); return mbi.Protect == PAGE_NOACCESS && (uptr)mbi.BaseAddress + mbi.RegionSize >= range_end; } void *MapFileToMemory(const char *file_name, uptr *buff_size) { UNIMPLEMENTED(); } void *MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) { UNIMPLEMENTED(); } static const int kMaxEnvNameLength = 128; static const DWORD kMaxEnvValueLength = 32767; namespace { struct EnvVariable { char name[kMaxEnvNameLength]; char value[kMaxEnvValueLength]; }; } // namespace static const int kEnvVariables = 5; static EnvVariable env_vars[kEnvVariables]; static int num_env_vars; const char *GetEnv(const char *name) { // Note: this implementation caches the values of the environment variables // and limits their quantity. for (int i = 0; i < num_env_vars; i++) { if (0 == internal_strcmp(name, env_vars[i].name)) return env_vars[i].value; } CHECK_LT(num_env_vars, kEnvVariables); DWORD rv = GetEnvironmentVariableA(name, env_vars[num_env_vars].value, kMaxEnvValueLength); if (rv > 0 && rv < kMaxEnvValueLength) { CHECK_LT(internal_strlen(name), kMaxEnvNameLength); internal_strncpy(env_vars[num_env_vars].name, name, kMaxEnvNameLength); num_env_vars++; return env_vars[num_env_vars - 1].value; } return 0; } const char *GetPwd() { UNIMPLEMENTED(); } u32 GetUid() { UNIMPLEMENTED(); } namespace { struct ModuleInfo { const char *filepath; uptr base_address; uptr end_address; }; #if !SANITIZER_GO int CompareModulesBase(const void *pl, const void *pr) { const ModuleInfo *l = (ModuleInfo *)pl, *r = (ModuleInfo *)pr; if (l->base_address < r->base_address) return -1; return l->base_address > r->base_address; } #endif } // namespace #if !SANITIZER_GO void DumpProcessMap() { Report("Dumping process modules:\n"); ListOfModules modules; modules.init(); uptr num_modules = modules.size(); InternalScopedBuffer module_infos(num_modules); for (size_t i = 0; i < num_modules; ++i) { module_infos[i].filepath = modules[i].full_name(); module_infos[i].base_address = modules[i].ranges().front()->beg; module_infos[i].end_address = modules[i].ranges().back()->end; } qsort(module_infos.data(), num_modules, sizeof(ModuleInfo), CompareModulesBase); for (size_t i = 0; i < num_modules; ++i) { const ModuleInfo &mi = module_infos[i]; if (mi.end_address != 0) { Printf("\t%p-%p %s\n", mi.base_address, mi.end_address, mi.filepath[0] ? mi.filepath : "[no name]"); } else if (mi.filepath[0]) { Printf("\t??\?-??? %s\n", mi.filepath); } else { Printf("\t???\n"); } } } #endif void DisableCoreDumperIfNecessary() { // Do nothing. } void ReExec() { UNIMPLEMENTED(); } void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) { #if !SANITIZER_GO CovPrepareForSandboxing(args); #endif } bool StackSizeIsUnlimited() { UNIMPLEMENTED(); } void SetStackSizeLimitInBytes(uptr limit) { UNIMPLEMENTED(); } bool AddressSpaceIsUnlimited() { UNIMPLEMENTED(); } void SetAddressSpaceUnlimited() { UNIMPLEMENTED(); } bool IsPathSeparator(const char c) { return c == '\\' || c == '/'; } bool IsAbsolutePath(const char *path) { UNIMPLEMENTED(); } void SleepForSeconds(int seconds) { Sleep(seconds * 1000); } void SleepForMillis(int millis) { Sleep(millis); } u64 NanoTime() { return 0; } void Abort() { if (::IsDebuggerPresent()) __debugbreak(); internal__exit(3); } #if !SANITIZER_GO // Read the file to extract the ImageBase field from the PE header. If ASLR is // disabled and this virtual address is available, the loader will typically // load the image at this address. Therefore, we call it the preferred base. Any // addresses in the DWARF typically assume that the object has been loaded at // this address. static uptr GetPreferredBase(const char *modname) { fd_t fd = OpenFile(modname, RdOnly, nullptr); if (fd == kInvalidFd) return 0; FileCloser closer(fd); // Read just the DOS header. IMAGE_DOS_HEADER dos_header; uptr bytes_read; if (!ReadFromFile(fd, &dos_header, sizeof(dos_header), &bytes_read) || bytes_read != sizeof(dos_header)) return 0; // The file should start with the right signature. if (dos_header.e_magic != IMAGE_DOS_SIGNATURE) return 0; // The layout at e_lfanew is: // "PE\0\0" // IMAGE_FILE_HEADER // IMAGE_OPTIONAL_HEADER // Seek to e_lfanew and read all that data. char buf[4 + sizeof(IMAGE_FILE_HEADER) + sizeof(IMAGE_OPTIONAL_HEADER)]; if (::SetFilePointer(fd, dos_header.e_lfanew, nullptr, FILE_BEGIN) == INVALID_SET_FILE_POINTER) return 0; if (!ReadFromFile(fd, &buf[0], sizeof(buf), &bytes_read) || bytes_read != sizeof(buf)) return 0; // Check for "PE\0\0" before the PE header. char *pe_sig = &buf[0]; if (internal_memcmp(pe_sig, "PE\0\0", 4) != 0) return 0; // Skip over IMAGE_FILE_HEADER. We could do more validation here if we wanted. IMAGE_OPTIONAL_HEADER *pe_header = (IMAGE_OPTIONAL_HEADER *)(pe_sig + 4 + sizeof(IMAGE_FILE_HEADER)); // Check for more magic in the PE header. if (pe_header->Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC) return 0; // Finally, return the ImageBase. return (uptr)pe_header->ImageBase; } void ListOfModules::init() { clear(); HANDLE cur_process = GetCurrentProcess(); // Query the list of modules. Start by assuming there are no more than 256 // modules and retry if that's not sufficient. HMODULE *hmodules = 0; uptr modules_buffer_size = sizeof(HMODULE) * 256; DWORD bytes_required; while (!hmodules) { hmodules = (HMODULE *)MmapOrDie(modules_buffer_size, __FUNCTION__); CHECK(EnumProcessModules(cur_process, hmodules, modules_buffer_size, &bytes_required)); if (bytes_required > modules_buffer_size) { // Either there turned out to be more than 256 hmodules, or new hmodules // could have loaded since the last try. Retry. UnmapOrDie(hmodules, modules_buffer_size); hmodules = 0; modules_buffer_size = bytes_required; } } // |num_modules| is the number of modules actually present, size_t num_modules = bytes_required / sizeof(HMODULE); for (size_t i = 0; i < num_modules; ++i) { HMODULE handle = hmodules[i]; MODULEINFO mi; if (!GetModuleInformation(cur_process, handle, &mi, sizeof(mi))) continue; // Get the UTF-16 path and convert to UTF-8. wchar_t modname_utf16[kMaxPathLength]; int modname_utf16_len = GetModuleFileNameW(handle, modname_utf16, kMaxPathLength); if (modname_utf16_len == 0) modname_utf16[0] = '\0'; char module_name[kMaxPathLength]; int module_name_len = ::WideCharToMultiByte(CP_UTF8, 0, modname_utf16, modname_utf16_len + 1, &module_name[0], kMaxPathLength, NULL, NULL); module_name[module_name_len] = '\0'; uptr base_address = (uptr)mi.lpBaseOfDll; uptr end_address = (uptr)mi.lpBaseOfDll + mi.SizeOfImage; // Adjust the base address of the module so that we get a VA instead of an // RVA when computing the module offset. This helps llvm-symbolizer find the // right DWARF CU. In the common case that the image is loaded at it's // preferred address, we will now print normal virtual addresses. uptr preferred_base = GetPreferredBase(&module_name[0]); uptr adjusted_base = base_address - preferred_base; LoadedModule cur_module; cur_module.set(module_name, adjusted_base); // We add the whole module as one single address range. cur_module.addAddressRange(base_address, end_address, /*executable*/ true); modules_.push_back(cur_module); } UnmapOrDie(hmodules, modules_buffer_size); }; // We can't use atexit() directly at __asan_init time as the CRT is not fully // initialized at this point. Place the functions into a vector and use // atexit() as soon as it is ready for use (i.e. after .CRT$XIC initializers). InternalMmapVectorNoCtor atexit_functions; int Atexit(void (*function)(void)) { atexit_functions.push_back(function); return 0; } static int RunAtexit() { int ret = 0; for (uptr i = 0; i < atexit_functions.size(); ++i) { ret |= atexit(atexit_functions[i]); } return ret; } #pragma section(".CRT$XID", long, read) // NOLINT __declspec(allocate(".CRT$XID")) int (*__run_atexit)() = RunAtexit; #endif // ------------------ sanitizer_libc.h fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *last_error) { // FIXME: Use the wide variants to handle Unicode filenames. fd_t res; if (mode == RdOnly) { res = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); } else if (mode == WrOnly) { res = CreateFileA(filename, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); } else { UNIMPLEMENTED(); } CHECK(res != kStdoutFd || kStdoutFd == kInvalidFd); CHECK(res != kStderrFd || kStderrFd == kInvalidFd); if (res == kInvalidFd && last_error) *last_error = GetLastError(); return res; } void CloseFile(fd_t fd) { CloseHandle(fd); } bool ReadFromFile(fd_t fd, void *buff, uptr buff_size, uptr *bytes_read, error_t *error_p) { CHECK(fd != kInvalidFd); // bytes_read can't be passed directly to ReadFile: // uptr is unsigned long long on 64-bit Windows. unsigned long num_read_long; bool success = ::ReadFile(fd, buff, buff_size, &num_read_long, nullptr); if (!success && error_p) *error_p = GetLastError(); if (bytes_read) *bytes_read = num_read_long; return success; } bool SupportsColoredOutput(fd_t fd) { // FIXME: support colored output. return false; } bool WriteToFile(fd_t fd, const void *buff, uptr buff_size, uptr *bytes_written, error_t *error_p) { CHECK(fd != kInvalidFd); // Handle null optional parameters. error_t dummy_error; error_p = error_p ? error_p : &dummy_error; uptr dummy_bytes_written; bytes_written = bytes_written ? bytes_written : &dummy_bytes_written; // Initialize output parameters in case we fail. *error_p = 0; *bytes_written = 0; // Map the conventional Unix fds 1 and 2 to Windows handles. They might be // closed, in which case this will fail. if (fd == kStdoutFd || fd == kStderrFd) { fd = GetStdHandle(fd == kStdoutFd ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE); if (fd == 0) { *error_p = ERROR_INVALID_HANDLE; return false; } } DWORD bytes_written_32; if (!WriteFile(fd, buff, buff_size, &bytes_written_32, 0)) { *error_p = GetLastError(); return false; } else { *bytes_written = bytes_written_32; return true; } } bool RenameFile(const char *oldpath, const char *newpath, error_t *error_p) { UNIMPLEMENTED(); } uptr internal_sched_yield() { Sleep(0); return 0; } void internal__exit(int exitcode) { ExitProcess(exitcode); } uptr internal_ftruncate(fd_t fd, uptr size) { UNIMPLEMENTED(); } uptr GetRSS() { return 0; } void *internal_start_thread(void (*func)(void *arg), void *arg) { return 0; } void internal_join_thread(void *th) { } // ---------------------- BlockingMutex ---------------- {{{1 const uptr LOCK_UNINITIALIZED = 0; const uptr LOCK_READY = (uptr)-1; BlockingMutex::BlockingMutex(LinkerInitialized li) { // FIXME: see comments in BlockingMutex::Lock() for the details. CHECK(li == LINKER_INITIALIZED || owner_ == LOCK_UNINITIALIZED); CHECK(sizeof(CRITICAL_SECTION) <= sizeof(opaque_storage_)); InitializeCriticalSection((LPCRITICAL_SECTION)opaque_storage_); owner_ = LOCK_READY; } BlockingMutex::BlockingMutex() { CHECK(sizeof(CRITICAL_SECTION) <= sizeof(opaque_storage_)); InitializeCriticalSection((LPCRITICAL_SECTION)opaque_storage_); owner_ = LOCK_READY; } void BlockingMutex::Lock() { if (owner_ == LOCK_UNINITIALIZED) { // FIXME: hm, global BlockingMutex objects are not initialized?!? // This might be a side effect of the clang+cl+link Frankenbuild... new(this) BlockingMutex((LinkerInitialized)(LINKER_INITIALIZED + 1)); // FIXME: If it turns out the linker doesn't invoke our // constructors, we should probably manually Lock/Unlock all the global // locks while we're starting in one thread to avoid double-init races. } EnterCriticalSection((LPCRITICAL_SECTION)opaque_storage_); CHECK_EQ(owner_, LOCK_READY); owner_ = GetThreadSelf(); } void BlockingMutex::Unlock() { CHECK_EQ(owner_, GetThreadSelf()); owner_ = LOCK_READY; LeaveCriticalSection((LPCRITICAL_SECTION)opaque_storage_); } void BlockingMutex::CheckLocked() { CHECK_EQ(owner_, GetThreadSelf()); } uptr GetTlsSize() { return 0; } void InitTlsSize() { } void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, uptr *tls_addr, uptr *tls_size) { #if SANITIZER_GO *stk_addr = 0; *stk_size = 0; *tls_addr = 0; *tls_size = 0; #else uptr stack_top, stack_bottom; GetThreadStackTopAndBottom(main, &stack_top, &stack_bottom); *stk_addr = stack_bottom; *stk_size = stack_top - stack_bottom; *tls_addr = 0; *tls_size = 0; #endif } #if !SANITIZER_GO void BufferedStackTrace::SlowUnwindStack(uptr pc, u32 max_depth) { CHECK_GE(max_depth, 2); // FIXME: CaptureStackBackTrace might be too slow for us. // FIXME: Compare with StackWalk64. // FIXME: Look at LLVMUnhandledExceptionFilter in Signals.inc size = CaptureStackBackTrace(1, Min(max_depth, kStackTraceMax), (void**)trace, 0); if (size == 0) return; // Skip the RTL frames by searching for the PC in the stacktrace. uptr pc_location = LocatePcInTrace(pc); PopStackFrames(pc_location); } void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context, u32 max_depth) { CONTEXT ctx = *(CONTEXT *)context; STACKFRAME64 stack_frame; memset(&stack_frame, 0, sizeof(stack_frame)); InitializeDbgHelpIfNeeded(); size = 0; #if defined(_WIN64) int machine_type = IMAGE_FILE_MACHINE_AMD64; stack_frame.AddrPC.Offset = ctx.Rip; stack_frame.AddrFrame.Offset = ctx.Rbp; stack_frame.AddrStack.Offset = ctx.Rsp; #else int machine_type = IMAGE_FILE_MACHINE_I386; stack_frame.AddrPC.Offset = ctx.Eip; stack_frame.AddrFrame.Offset = ctx.Ebp; stack_frame.AddrStack.Offset = ctx.Esp; #endif stack_frame.AddrPC.Mode = AddrModeFlat; stack_frame.AddrFrame.Mode = AddrModeFlat; stack_frame.AddrStack.Mode = AddrModeFlat; while (StackWalk64(machine_type, GetCurrentProcess(), GetCurrentThread(), &stack_frame, &ctx, NULL, &SymFunctionTableAccess64, &SymGetModuleBase64, NULL) && size < Min(max_depth, kStackTraceMax)) { trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset; } } #endif // #if !SANITIZER_GO void ReportFile::Write(const char *buffer, uptr length) { SpinMutexLock l(mu); ReopenIfNecessary(); if (!WriteToFile(fd, buffer, length)) { // stderr may be closed, but we may be able to print to the debugger // instead. This is the case when launching a program from Visual Studio, // and the following routine should write to its console. OutputDebugStringA(buffer); } } void SetAlternateSignalStack() { // FIXME: Decide what to do on Windows. } void UnsetAlternateSignalStack() { // FIXME: Decide what to do on Windows. } void InstallDeadlySignalHandlers(SignalHandlerType handler) { (void)handler; // FIXME: Decide what to do on Windows. } bool IsHandledDeadlySignal(int signum) { // FIXME: Decide what to do on Windows. return false; } bool IsAccessibleMemoryRange(uptr beg, uptr size) { SYSTEM_INFO si; GetNativeSystemInfo(&si); uptr page_size = si.dwPageSize; uptr page_mask = ~(page_size - 1); for (uptr page = beg & page_mask, end = (beg + size - 1) & page_mask; page <= end;) { MEMORY_BASIC_INFORMATION info; if (VirtualQuery((LPCVOID)page, &info, sizeof(info)) != sizeof(info)) return false; if (info.Protect == 0 || info.Protect == PAGE_NOACCESS || info.Protect == PAGE_EXECUTE) return false; if (info.RegionSize == 0) return false; page += info.RegionSize; } return true; } SignalContext SignalContext::Create(void *siginfo, void *context) { EXCEPTION_RECORD *exception_record = (EXCEPTION_RECORD *)siginfo; CONTEXT *context_record = (CONTEXT *)context; uptr pc = (uptr)exception_record->ExceptionAddress; #ifdef _WIN64 uptr bp = (uptr)context_record->Rbp; uptr sp = (uptr)context_record->Rsp; #else uptr bp = (uptr)context_record->Ebp; uptr sp = (uptr)context_record->Esp; #endif uptr access_addr = exception_record->ExceptionInformation[1]; // The contents of this array are documented at // https://msdn.microsoft.com/en-us/library/windows/desktop/aa363082(v=vs.85).aspx // The first element indicates read as 0, write as 1, or execute as 8. The // second element is the faulting address. WriteFlag write_flag = SignalContext::UNKNOWN; switch (exception_record->ExceptionInformation[0]) { case 0: write_flag = SignalContext::READ; break; case 1: write_flag = SignalContext::WRITE; break; case 8: write_flag = SignalContext::UNKNOWN; break; } bool is_memory_access = write_flag != SignalContext::UNKNOWN; return SignalContext(context, access_addr, pc, sp, bp, is_memory_access, write_flag); } uptr ReadBinaryName(/*out*/char *buf, uptr buf_len) { // FIXME: Actually implement this function. CHECK_GT(buf_len, 0); buf[0] = 0; return 0; } uptr ReadLongProcessName(/*out*/char *buf, uptr buf_len) { return ReadBinaryName(buf, buf_len); } void CheckVMASize() { // Do nothing. } void MaybeReexec() { // No need to re-exec on Windows. } char **GetArgv() { // FIXME: Actually implement this function. return 0; } pid_t StartSubprocess(const char *program, const char *const argv[], fd_t stdin_fd, fd_t stdout_fd, fd_t stderr_fd) { // FIXME: implement on this platform // Should be implemented based on // SymbolizerProcess::StarAtSymbolizerSubprocess // from lib/sanitizer_common/sanitizer_symbolizer_win.cc. return -1; } bool IsProcessRunning(pid_t pid) { // FIXME: implement on this platform. return false; } int WaitForProcess(pid_t pid) { return -1; } // FIXME implement on this platform. void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size) { } } // namespace __sanitizer #if !SANITIZER_GO // Workaround to implement weak hooks on Windows. COFF doesn't directly support // weak symbols, but it does support /alternatename, which is similar. If the // user does not override the hook, we will use this default definition instead // of null. extern "C" void __sanitizer_print_memory_profile(int top_percent) {} #ifdef _WIN64 #pragma comment(linker, "/alternatename:__sanitizer_print_memory_profile=__sanitizer_default_print_memory_profile") // NOLINT #else #pragma comment(linker, "/alternatename:___sanitizer_print_memory_profile=___sanitizer_default_print_memory_profile") // NOLINT #endif #endif #endif // _WIN32 golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_stacktrace_printer.h0000664000175000017500000000601112767671510033471 0ustar mwhudsonmwhudson//===-- sanitizer_stacktrace_printer.h --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between sanitizers' run-time libraries. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_STACKTRACE_PRINTER_H #define SANITIZER_STACKTRACE_PRINTER_H #include "sanitizer_common.h" #include "sanitizer_symbolizer.h" namespace __sanitizer { // Render the contents of "info" structure, which represents the contents of // stack frame "frame_no" and appends it to the "buffer". "format" is a // string with placeholders, which is copied to the output with // placeholders substituted with the contents of "info". For example, // format string // " frame %n: function %F at %S" // will be turned into // " frame 10: function foo::bar() at my/file.cc:10" // You may additionally pass "strip_path_prefix" to strip prefixes of paths to // source files and modules, and "strip_func_prefix" to strip prefixes of // function names. // Here's the full list of available placeholders: // %% - represents a '%' character; // %n - frame number (copy of frame_no); // %p - PC in hex format; // %m - path to module (binary or shared object); // %o - offset in the module in hex format; // %f - function name; // %q - offset in the function in hex format (*if available*); // %s - path to source file; // %l - line in the source file; // %c - column in the source file; // %F - if function is known to be , prints "in ", possibly // followed by the offset in this function, but only if source file // is unknown; // %S - prints file/line/column information; // %L - prints location information: file/line/column, if it is known, or // module+offset if it is known, or () string. // %M - prints module basename and offset, if it is known, or PC. void RenderFrame(InternalScopedString *buffer, const char *format, int frame_no, const AddressInfo &info, bool vs_style, const char *strip_path_prefix = "", const char *strip_func_prefix = ""); void RenderSourceLocation(InternalScopedString *buffer, const char *file, int line, int column, bool vs_style, const char *strip_path_prefix); void RenderModuleLocation(InternalScopedString *buffer, const char *module, uptr offset, const char *strip_path_prefix); // Same as RenderFrame, but for data section (global variables). // Accepts %s, %l from above. // Also accepts: // %g - name of the global variable. void RenderData(InternalScopedString *buffer, const char *format, const DataInfo *DI, const char *strip_path_prefix = ""); } // namespace __sanitizer #endif // SANITIZER_STACKTRACE_PRINTER_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_atomic_clang_x86.h0000664000175000017500000000766412267751021032735 0ustar mwhudsonmwhudson//===-- sanitizer_atomic_clang_x86.h ----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Not intended for direct inclusion. Include sanitizer_atomic.h. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ATOMIC_CLANG_X86_H #define SANITIZER_ATOMIC_CLANG_X86_H namespace __sanitizer { INLINE void proc_yield(int cnt) { __asm__ __volatile__("" ::: "memory"); for (int i = 0; i < cnt; i++) __asm__ __volatile__("pause"); __asm__ __volatile__("" ::: "memory"); } template INLINE typename T::Type atomic_load( const volatile T *a, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_consume | memory_order_acquire | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); typename T::Type v; if (sizeof(*a) < 8 || sizeof(void*) == 8) { // Assume that aligned loads are atomic. if (mo == memory_order_relaxed) { v = a->val_dont_use; } else if (mo == memory_order_consume) { // Assume that processor respects data dependencies // (and that compiler won't break them). __asm__ __volatile__("" ::: "memory"); v = a->val_dont_use; __asm__ __volatile__("" ::: "memory"); } else if (mo == memory_order_acquire) { __asm__ __volatile__("" ::: "memory"); v = a->val_dont_use; // On x86 loads are implicitly acquire. __asm__ __volatile__("" ::: "memory"); } else { // seq_cst // On x86 plain MOV is enough for seq_cst store. __asm__ __volatile__("" ::: "memory"); v = a->val_dont_use; __asm__ __volatile__("" ::: "memory"); } } else { // 64-bit load on 32-bit platform. __asm__ __volatile__( "movq %1, %%mm0;" // Use mmx reg for 64-bit atomic moves "movq %%mm0, %0;" // (ptr could be read-only) "emms;" // Empty mmx state/Reset FP regs : "=m" (v) : "m" (a->val_dont_use) : // mark the FP stack and mmx registers as clobbered "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)", #ifdef __MMX__ "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", #endif // #ifdef __MMX__ "memory"); } return v; } template INLINE void atomic_store(volatile T *a, typename T::Type v, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_release | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); if (sizeof(*a) < 8 || sizeof(void*) == 8) { // Assume that aligned loads are atomic. if (mo == memory_order_relaxed) { a->val_dont_use = v; } else if (mo == memory_order_release) { // On x86 stores are implicitly release. __asm__ __volatile__("" ::: "memory"); a->val_dont_use = v; __asm__ __volatile__("" ::: "memory"); } else { // seq_cst // On x86 stores are implicitly release. __asm__ __volatile__("" ::: "memory"); a->val_dont_use = v; __sync_synchronize(); } } else { // 64-bit store on 32-bit platform. __asm__ __volatile__( "movq %1, %%mm0;" // Use mmx reg for 64-bit atomic moves "movq %%mm0, %0;" "emms;" // Empty mmx state/Reset FP regs : "=m" (a->val_dont_use) : "m" (v) : // mark the FP stack and mmx registers as clobbered "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)", #ifdef __MMX__ "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", #endif // #ifdef __MMX__ "memory"); if (mo == memory_order_seq_cst) __sync_synchronize(); } } } // namespace __sanitizer #endif // #ifndef SANITIZER_ATOMIC_CLANG_X86_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_linux.h0000664000175000017500000000622412775420063030741 0ustar mwhudsonmwhudson//===-- sanitizer_linux.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Linux-specific syscall wrappers and classes. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_LINUX_H #define SANITIZER_LINUX_H #include "sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "sanitizer_common.h" #include "sanitizer_internal_defs.h" #include "sanitizer_posix.h" #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from // the one in , which is used by readdir(). struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); uptr internal_sigaltstack(const struct sigaltstack* ss, struct sigaltstack* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); // Linux-only syscalls. #if SANITIZER_LINUX uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5); // Used only by sanitizer_stoptheworld. Signal handlers that are actually used // (like the process-wide error reporting SEGV handler) must use // internal_sigaction instead. int internal_sigaction_norestorer(int signum, const void *act, void *oldact); #if (defined(__x86_64__) || SANITIZER_MIPS64) && !SANITIZER_GO // Uses a raw system call to avoid interceptors. int internal_sigaction_syscall(int signum, const void *act, void *oldact); #endif void internal_sigdelset(__sanitizer_sigset_t *set, int signum); #if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) \ || defined(__powerpc64__) || defined(__s390__) uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr); #endif #endif // SANITIZER_LINUX // This class reads thread IDs from /proc//task using only syscalls. class ThreadLister { public: explicit ThreadLister(int pid); ~ThreadLister(); // GetNextTID returns -1 if the list of threads is exhausted, or if there has // been an error. int GetNextTID(); void Reset(); bool error(); private: bool GetDirectoryEntries(); int pid_; int descriptor_; InternalScopedBuffer buffer_; bool error_; struct linux_dirent* entry_; int bytes_read_; }; // Exposed for testing. uptr ThreadDescriptorSize(); uptr ThreadSelf(); uptr ThreadSelfOffset(); // Matches a library's file name against a base name (stripping path and version // information). bool LibraryNameIs(const char *full_name, const char *base_name); // Call cb for each region mapped by map. void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr)); } // namespace __sanitizer #endif // SANITIZER_FREEBSD || SANITIZER_LINUX #endif // SANITIZER_LINUX_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_symbolizer_mac.h0000664000175000017500000000250112500270036032600 0ustar mwhudsonmwhudson//===-- sanitizer_symbolizer_mac.h ------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between various sanitizers' runtime libraries. // // Header for Mac-specific "atos" symbolizer. //===----------------------------------------------------------------------===// #ifndef SANITIZER_SYMBOLIZER_MAC_H #define SANITIZER_SYMBOLIZER_MAC_H #include "sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_symbolizer_internal.h" namespace __sanitizer { class DlAddrSymbolizer : public SymbolizerTool { public: bool SymbolizePC(uptr addr, SymbolizedStack *stack) override; bool SymbolizeData(uptr addr, DataInfo *info) override; }; class AtosSymbolizerProcess; class AtosSymbolizer : public SymbolizerTool { public: explicit AtosSymbolizer(const char *path, LowLevelAllocator *allocator); bool SymbolizePC(uptr addr, SymbolizedStack *stack) override; bool SymbolizeData(uptr addr, DataInfo *info) override; private: AtosSymbolizerProcess *process_; }; } // namespace __sanitizer #endif // SANITIZER_MAC #endif // SANITIZER_SYMBOLIZER_MAC_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_mac.h0000664000175000017500000000332412766606132030343 0ustar mwhudsonmwhudson//===-- sanitizer_mac.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between various sanitizers' runtime libraries and // provides definitions for OSX-specific functions. //===----------------------------------------------------------------------===// #ifndef SANITIZER_MAC_H #define SANITIZER_MAC_H #include "sanitizer_common.h" #include "sanitizer_platform.h" #if SANITIZER_MAC #include "sanitizer_posix.h" namespace __sanitizer { enum MacosVersion { MACOS_VERSION_UNINITIALIZED = 0, MACOS_VERSION_UNKNOWN, MACOS_VERSION_LEOPARD, MACOS_VERSION_SNOW_LEOPARD, MACOS_VERSION_LION, MACOS_VERSION_MOUNTAIN_LION, MACOS_VERSION_MAVERICKS, MACOS_VERSION_YOSEMITE, MACOS_VERSION_UNKNOWN_NEWER }; MacosVersion GetMacosVersion(); char **GetEnviron(); } // namespace __sanitizer extern "C" { static char __crashreporter_info_buff__[__sanitizer::kErrorMessageBufferSize] = {}; static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0]; asm(".desc ___crashreporter_info__, 0x10"); } // extern "C" namespace __sanitizer { static BlockingMutex crashreporter_info_mutex(LINKER_INITIALIZED); INLINE void CRAppendCrashLogMessage(const char *msg) { BlockingMutexLock l(&crashreporter_info_mutex); internal_strlcat(__crashreporter_info_buff__, msg, sizeof(__crashreporter_info_buff__)); } } // namespace __sanitizer #endif // SANITIZER_MAC #endif // SANITIZER_MAC_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_libcdep.cc0000664000175000017500000001377313004656655032725 0ustar mwhudsonmwhudson//===-- sanitizer_common_libcdep.cc ---------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between AddressSanitizer and ThreadSanitizer // run-time libraries. //===----------------------------------------------------------------------===// #include "sanitizer_common.h" #include "sanitizer_allocator_interface.h" #include "sanitizer_flags.h" #include "sanitizer_stackdepot.h" #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" #if SANITIZER_POSIX #include "sanitizer_posix.h" #endif namespace __sanitizer { bool ReportFile::SupportsColors() { SpinMutexLock l(mu); ReopenIfNecessary(); return SupportsColoredOutput(fd); } bool ColorizeReports() { // FIXME: Add proper Windows support to AnsiColorDecorator and re-enable color // printing on Windows. if (SANITIZER_WINDOWS) return false; const char *flag = common_flags()->color; return internal_strcmp(flag, "always") == 0 || (internal_strcmp(flag, "auto") == 0 && report_file.SupportsColors()); } static void (*sandboxing_callback)(); void SetSandboxingCallback(void (*f)()) { sandboxing_callback = f; } void ReportErrorSummary(const char *error_type, const StackTrace *stack) { #if !SANITIZER_GO if (!common_flags()->print_summary) return; if (stack->size == 0) { ReportErrorSummary(error_type); return; } // Currently, we include the first stack frame into the report summary. // Maybe sometimes we need to choose another frame (e.g. skip memcpy/etc). uptr pc = StackTrace::GetPreviousInstructionPc(stack->trace[0]); SymbolizedStack *frame = Symbolizer::GetOrInit()->SymbolizePC(pc); ReportErrorSummary(error_type, frame->info); frame->ClearAll(); #endif } static void (*SoftRssLimitExceededCallback)(bool exceeded); void SetSoftRssLimitExceededCallback(void (*Callback)(bool exceeded)) { CHECK_EQ(SoftRssLimitExceededCallback, nullptr); SoftRssLimitExceededCallback = Callback; } static AllocatorReleaseToOSCallback ReleseCallback; void SetAllocatorReleaseToOSCallback(AllocatorReleaseToOSCallback Callback) { CHECK_EQ(ReleseCallback, nullptr); ReleseCallback = Callback; } #if SANITIZER_LINUX && !SANITIZER_GO void BackgroundThread(void *arg) { uptr hard_rss_limit_mb = common_flags()->hard_rss_limit_mb; uptr soft_rss_limit_mb = common_flags()->soft_rss_limit_mb; bool heap_profile = common_flags()->heap_profile; bool allocator_release_to_os = common_flags()->allocator_release_to_os; uptr prev_reported_rss = 0; uptr prev_reported_stack_depot_size = 0; bool reached_soft_rss_limit = false; uptr rss_during_last_reported_profile = 0; while (true) { SleepForMillis(100); uptr current_rss_mb = GetRSS() >> 20; if (Verbosity()) { // If RSS has grown 10% since last time, print some information. if (prev_reported_rss * 11 / 10 < current_rss_mb) { Printf("%s: RSS: %zdMb\n", SanitizerToolName, current_rss_mb); prev_reported_rss = current_rss_mb; } // If stack depot has grown 10% since last time, print it too. StackDepotStats *stack_depot_stats = StackDepotGetStats(); if (prev_reported_stack_depot_size * 11 / 10 < stack_depot_stats->allocated) { Printf("%s: StackDepot: %zd ids; %zdM allocated\n", SanitizerToolName, stack_depot_stats->n_uniq_ids, stack_depot_stats->allocated >> 20); prev_reported_stack_depot_size = stack_depot_stats->allocated; } } // Check RSS against the limit. if (hard_rss_limit_mb && hard_rss_limit_mb < current_rss_mb) { Report("%s: hard rss limit exhausted (%zdMb vs %zdMb)\n", SanitizerToolName, hard_rss_limit_mb, current_rss_mb); DumpProcessMap(); Die(); } if (soft_rss_limit_mb) { if (soft_rss_limit_mb < current_rss_mb && !reached_soft_rss_limit) { reached_soft_rss_limit = true; Report("%s: soft rss limit exhausted (%zdMb vs %zdMb)\n", SanitizerToolName, soft_rss_limit_mb, current_rss_mb); if (SoftRssLimitExceededCallback) SoftRssLimitExceededCallback(true); } else if (soft_rss_limit_mb >= current_rss_mb && reached_soft_rss_limit) { reached_soft_rss_limit = false; if (SoftRssLimitExceededCallback) SoftRssLimitExceededCallback(false); } } if (allocator_release_to_os && ReleseCallback) ReleseCallback(); if (heap_profile && current_rss_mb > rss_during_last_reported_profile * 1.1) { Printf("\n\nHEAP PROFILE at RSS %zdMb\n", current_rss_mb); __sanitizer_print_memory_profile(90); rss_during_last_reported_profile = current_rss_mb; } } } #endif void WriteToSyslog(const char *msg) { InternalScopedString msg_copy(kErrorMessageBufferSize); msg_copy.append("%s", msg); char *p = msg_copy.data(); char *q; // Print one line at a time. // syslog, at least on Android, has an implicit message length limit. do { q = internal_strchr(p, '\n'); if (q) *q = '\0'; WriteOneLineToSyslog(p); if (q) p = q + 1; } while (q); } void MaybeStartBackgroudThread() { #if SANITIZER_LINUX && \ !SANITIZER_GO // Need to implement/test on other platforms. // Start the background thread if one of the rss limits is given. if (!common_flags()->hard_rss_limit_mb && !common_flags()->soft_rss_limit_mb && !common_flags()->allocator_release_to_os && !common_flags()->heap_profile) return; if (!&real_pthread_create) return; // Can't spawn the thread anyway. internal_start_thread(BackgroundThread, nullptr); #endif } } // namespace __sanitizer void NOINLINE __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args) { __sanitizer::PrepareForSandboxing(args); if (__sanitizer::sandboxing_callback) __sanitizer::sandboxing_callback(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_deadlock_detector.h0000664000175000017500000003306012444557456033251 0ustar mwhudsonmwhudson//===-- sanitizer_deadlock_detector.h ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of Sanitizer runtime. // The deadlock detector maintains a directed graph of lock acquisitions. // When a lock event happens, the detector checks if the locks already held by // the current thread are reachable from the newly acquired lock. // // The detector can handle only a fixed amount of simultaneously live locks // (a lock is alive if it has been locked at least once and has not been // destroyed). When the maximal number of locks is reached the entire graph // is flushed and the new lock epoch is started. The node ids from the old // epochs can not be used with any of the detector methods except for // nodeBelongsToCurrentEpoch(). // // FIXME: this is work in progress, nothing really works yet. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_DEADLOCK_DETECTOR_H #define SANITIZER_DEADLOCK_DETECTOR_H #include "sanitizer_common.h" #include "sanitizer_bvgraph.h" namespace __sanitizer { // Thread-local state for DeadlockDetector. // It contains the locks currently held by the owning thread. template class DeadlockDetectorTLS { public: // No CTOR. void clear() { bv_.clear(); epoch_ = 0; n_recursive_locks = 0; n_all_locks_ = 0; } bool empty() const { return bv_.empty(); } void ensureCurrentEpoch(uptr current_epoch) { if (epoch_ == current_epoch) return; bv_.clear(); epoch_ = current_epoch; n_recursive_locks = 0; n_all_locks_ = 0; } uptr getEpoch() const { return epoch_; } // Returns true if this is the first (non-recursive) acquisition of this lock. bool addLock(uptr lock_id, uptr current_epoch, u32 stk) { // Printf("addLock: %zx %zx stk %u\n", lock_id, current_epoch, stk); CHECK_EQ(epoch_, current_epoch); if (!bv_.setBit(lock_id)) { // The lock is already held by this thread, it must be recursive. CHECK_LT(n_recursive_locks, ARRAY_SIZE(recursive_locks)); recursive_locks[n_recursive_locks++] = lock_id; return false; } CHECK_LT(n_all_locks_, ARRAY_SIZE(all_locks_with_contexts_)); // lock_id < BV::kSize, can cast to a smaller int. u32 lock_id_short = static_cast(lock_id); LockWithContext l = {lock_id_short, stk}; all_locks_with_contexts_[n_all_locks_++] = l; return true; } void removeLock(uptr lock_id) { if (n_recursive_locks) { for (sptr i = n_recursive_locks - 1; i >= 0; i--) { if (recursive_locks[i] == lock_id) { n_recursive_locks--; Swap(recursive_locks[i], recursive_locks[n_recursive_locks]); return; } } } // Printf("remLock: %zx %zx\n", lock_id, epoch_); if (!bv_.clearBit(lock_id)) return; // probably addLock happened before flush if (n_all_locks_) { for (sptr i = n_all_locks_ - 1; i >= 0; i--) { if (all_locks_with_contexts_[i].lock == static_cast(lock_id)) { Swap(all_locks_with_contexts_[i], all_locks_with_contexts_[n_all_locks_ - 1]); n_all_locks_--; break; } } } } u32 findLockContext(uptr lock_id) { for (uptr i = 0; i < n_all_locks_; i++) if (all_locks_with_contexts_[i].lock == static_cast(lock_id)) return all_locks_with_contexts_[i].stk; return 0; } const BV &getLocks(uptr current_epoch) const { CHECK_EQ(epoch_, current_epoch); return bv_; } uptr getNumLocks() const { return n_all_locks_; } uptr getLock(uptr idx) const { return all_locks_with_contexts_[idx].lock; } private: BV bv_; uptr epoch_; uptr recursive_locks[64]; uptr n_recursive_locks; struct LockWithContext { u32 lock; u32 stk; }; LockWithContext all_locks_with_contexts_[64]; uptr n_all_locks_; }; // DeadlockDetector. // For deadlock detection to work we need one global DeadlockDetector object // and one DeadlockDetectorTLS object per evey thread. // This class is not thread safe, all concurrent accesses should be guarded // by an external lock. // Most of the methods of this class are not thread-safe (i.e. should // be protected by an external lock) unless explicitly told otherwise. template class DeadlockDetector { public: typedef BV BitVector; uptr size() const { return g_.size(); } // No CTOR. void clear() { current_epoch_ = 0; available_nodes_.clear(); recycled_nodes_.clear(); g_.clear(); n_edges_ = 0; } // Allocate new deadlock detector node. // If we are out of available nodes first try to recycle some. // If there is nothing to recycle, flush the graph and increment the epoch. // Associate 'data' (opaque user's object) with the new node. uptr newNode(uptr data) { if (!available_nodes_.empty()) return getAvailableNode(data); if (!recycled_nodes_.empty()) { // Printf("recycling: n_edges_ %zd\n", n_edges_); for (sptr i = n_edges_ - 1; i >= 0; i--) { if (recycled_nodes_.getBit(edges_[i].from) || recycled_nodes_.getBit(edges_[i].to)) { Swap(edges_[i], edges_[n_edges_ - 1]); n_edges_--; } } CHECK(available_nodes_.empty()); // removeEdgesFrom was called in removeNode. g_.removeEdgesTo(recycled_nodes_); available_nodes_.setUnion(recycled_nodes_); recycled_nodes_.clear(); return getAvailableNode(data); } // We are out of vacant nodes. Flush and increment the current_epoch_. current_epoch_ += size(); recycled_nodes_.clear(); available_nodes_.setAll(); g_.clear(); n_edges_ = 0; return getAvailableNode(data); } // Get data associated with the node created by newNode(). uptr getData(uptr node) const { return data_[nodeToIndex(node)]; } bool nodeBelongsToCurrentEpoch(uptr node) { return node && (node / size() * size()) == current_epoch_; } void removeNode(uptr node) { uptr idx = nodeToIndex(node); CHECK(!available_nodes_.getBit(idx)); CHECK(recycled_nodes_.setBit(idx)); g_.removeEdgesFrom(idx); } void ensureCurrentEpoch(DeadlockDetectorTLS *dtls) { dtls->ensureCurrentEpoch(current_epoch_); } // Returns true if there is a cycle in the graph after this lock event. // Ideally should be called before the lock is acquired so that we can // report a deadlock before a real deadlock happens. bool onLockBefore(DeadlockDetectorTLS *dtls, uptr cur_node) { ensureCurrentEpoch(dtls); uptr cur_idx = nodeToIndex(cur_node); return g_.isReachable(cur_idx, dtls->getLocks(current_epoch_)); } u32 findLockContext(DeadlockDetectorTLS *dtls, uptr node) { return dtls->findLockContext(nodeToIndex(node)); } // Add cur_node to the set of locks held currently by dtls. void onLockAfter(DeadlockDetectorTLS *dtls, uptr cur_node, u32 stk = 0) { ensureCurrentEpoch(dtls); uptr cur_idx = nodeToIndex(cur_node); dtls->addLock(cur_idx, current_epoch_, stk); } // Experimental *racy* fast path function. // Returns true if all edges from the currently held locks to cur_node exist. bool hasAllEdges(DeadlockDetectorTLS *dtls, uptr cur_node) { uptr local_epoch = dtls->getEpoch(); // Read from current_epoch_ is racy. if (cur_node && local_epoch == current_epoch_ && local_epoch == nodeToEpoch(cur_node)) { uptr cur_idx = nodeToIndexUnchecked(cur_node); for (uptr i = 0, n = dtls->getNumLocks(); i < n; i++) { if (!g_.hasEdge(dtls->getLock(i), cur_idx)) return false; } return true; } return false; } // Adds edges from currently held locks to cur_node, // returns the number of added edges, and puts the sources of added edges // into added_edges[]. // Should be called before onLockAfter. uptr addEdges(DeadlockDetectorTLS *dtls, uptr cur_node, u32 stk, int unique_tid) { ensureCurrentEpoch(dtls); uptr cur_idx = nodeToIndex(cur_node); uptr added_edges[40]; uptr n_added_edges = g_.addEdges(dtls->getLocks(current_epoch_), cur_idx, added_edges, ARRAY_SIZE(added_edges)); for (uptr i = 0; i < n_added_edges; i++) { if (n_edges_ < ARRAY_SIZE(edges_)) { Edge e = {(u16)added_edges[i], (u16)cur_idx, dtls->findLockContext(added_edges[i]), stk, unique_tid}; edges_[n_edges_++] = e; } // Printf("Edge%zd: %u %zd=>%zd in T%d\n", // n_edges_, stk, added_edges[i], cur_idx, unique_tid); } return n_added_edges; } bool findEdge(uptr from_node, uptr to_node, u32 *stk_from, u32 *stk_to, int *unique_tid) { uptr from_idx = nodeToIndex(from_node); uptr to_idx = nodeToIndex(to_node); for (uptr i = 0; i < n_edges_; i++) { if (edges_[i].from == from_idx && edges_[i].to == to_idx) { *stk_from = edges_[i].stk_from; *stk_to = edges_[i].stk_to; *unique_tid = edges_[i].unique_tid; return true; } } return false; } // Test-only function. Handles the before/after lock events, // returns true if there is a cycle. bool onLock(DeadlockDetectorTLS *dtls, uptr cur_node, u32 stk = 0) { ensureCurrentEpoch(dtls); bool is_reachable = !isHeld(dtls, cur_node) && onLockBefore(dtls, cur_node); addEdges(dtls, cur_node, stk, 0); onLockAfter(dtls, cur_node, stk); return is_reachable; } // Handles the try_lock event, returns false. // When a try_lock event happens (i.e. a try_lock call succeeds) we need // to add this lock to the currently held locks, but we should not try to // change the lock graph or to detect a cycle. We may want to investigate // whether a more aggressive strategy is possible for try_lock. bool onTryLock(DeadlockDetectorTLS *dtls, uptr cur_node, u32 stk = 0) { ensureCurrentEpoch(dtls); uptr cur_idx = nodeToIndex(cur_node); dtls->addLock(cur_idx, current_epoch_, stk); return false; } // Returns true iff dtls is empty (no locks are currently held) and we can // add the node to the currently held locks w/o chanding the global state. // This operation is thread-safe as it only touches the dtls. bool onFirstLock(DeadlockDetectorTLS *dtls, uptr node, u32 stk = 0) { if (!dtls->empty()) return false; if (dtls->getEpoch() && dtls->getEpoch() == nodeToEpoch(node)) { dtls->addLock(nodeToIndexUnchecked(node), nodeToEpoch(node), stk); return true; } return false; } // Finds a path between the lock 'cur_node' (currently not held in dtls) // and some currently held lock, returns the length of the path // or 0 on failure. uptr findPathToLock(DeadlockDetectorTLS *dtls, uptr cur_node, uptr *path, uptr path_size) { tmp_bv_.copyFrom(dtls->getLocks(current_epoch_)); uptr idx = nodeToIndex(cur_node); CHECK(!tmp_bv_.getBit(idx)); uptr res = g_.findShortestPath(idx, tmp_bv_, path, path_size); for (uptr i = 0; i < res; i++) path[i] = indexToNode(path[i]); if (res) CHECK_EQ(path[0], cur_node); return res; } // Handle the unlock event. // This operation is thread-safe as it only touches the dtls. void onUnlock(DeadlockDetectorTLS *dtls, uptr node) { if (dtls->getEpoch() == nodeToEpoch(node)) dtls->removeLock(nodeToIndexUnchecked(node)); } // Tries to handle the lock event w/o writing to global state. // Returns true on success. // This operation is thread-safe as it only touches the dtls // (modulo racy nature of hasAllEdges). bool onLockFast(DeadlockDetectorTLS *dtls, uptr node, u32 stk = 0) { if (hasAllEdges(dtls, node)) { dtls->addLock(nodeToIndexUnchecked(node), nodeToEpoch(node), stk); return true; } return false; } bool isHeld(DeadlockDetectorTLS *dtls, uptr node) const { return dtls->getLocks(current_epoch_).getBit(nodeToIndex(node)); } uptr testOnlyGetEpoch() const { return current_epoch_; } bool testOnlyHasEdge(uptr l1, uptr l2) { return g_.hasEdge(nodeToIndex(l1), nodeToIndex(l2)); } // idx1 and idx2 are raw indices to g_, not lock IDs. bool testOnlyHasEdgeRaw(uptr idx1, uptr idx2) { return g_.hasEdge(idx1, idx2); } void Print() { for (uptr from = 0; from < size(); from++) for (uptr to = 0; to < size(); to++) if (g_.hasEdge(from, to)) Printf(" %zx => %zx\n", from, to); } private: void check_idx(uptr idx) const { CHECK_LT(idx, size()); } void check_node(uptr node) const { CHECK_GE(node, size()); CHECK_EQ(current_epoch_, nodeToEpoch(node)); } uptr indexToNode(uptr idx) const { check_idx(idx); return idx + current_epoch_; } uptr nodeToIndexUnchecked(uptr node) const { return node % size(); } uptr nodeToIndex(uptr node) const { check_node(node); return nodeToIndexUnchecked(node); } uptr nodeToEpoch(uptr node) const { return node / size() * size(); } uptr getAvailableNode(uptr data) { uptr idx = available_nodes_.getAndClearFirstOne(); data_[idx] = data; return indexToNode(idx); } struct Edge { u16 from; u16 to; u32 stk_from; u32 stk_to; int unique_tid; }; uptr current_epoch_; BV available_nodes_; BV recycled_nodes_; BV tmp_bv_; BVGraph g_; uptr data_[BV::kSize]; Edge edges_[BV::kSize * 32]; uptr n_edges_; }; } // namespace __sanitizer #endif // SANITIZER_DEADLOCK_DETECTOR_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_interceptors.incgolang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_common_interceptors.in0000664000175000017500000065104413002525072034046 0ustar mwhudsonmwhudson//===-- sanitizer_common_interceptors.inc -----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Common function interceptors for tools like AddressSanitizer, // ThreadSanitizer, MemorySanitizer, etc. // // This file should be included into the tool's interceptor file, // which has to define its own macros: // COMMON_INTERCEPTOR_ENTER // COMMON_INTERCEPTOR_ENTER_NOIGNORE // COMMON_INTERCEPTOR_READ_RANGE // COMMON_INTERCEPTOR_WRITE_RANGE // COMMON_INTERCEPTOR_INITIALIZE_RANGE // COMMON_INTERCEPTOR_DIR_ACQUIRE // COMMON_INTERCEPTOR_FD_ACQUIRE // COMMON_INTERCEPTOR_FD_RELEASE // COMMON_INTERCEPTOR_FD_ACCESS // COMMON_INTERCEPTOR_SET_THREAD_NAME // COMMON_INTERCEPTOR_ON_DLOPEN // COMMON_INTERCEPTOR_ON_EXIT // COMMON_INTERCEPTOR_MUTEX_LOCK // COMMON_INTERCEPTOR_MUTEX_UNLOCK // COMMON_INTERCEPTOR_MUTEX_REPAIR // COMMON_INTERCEPTOR_SET_PTHREAD_NAME // COMMON_INTERCEPTOR_HANDLE_RECVMSG // COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED //===----------------------------------------------------------------------===// #include "interception/interception.h" #include "sanitizer_addrhashmap.h" #include "sanitizer_placement_new.h" #include "sanitizer_platform_interceptors.h" #include "sanitizer_tls_get_addr.h" #include #if SANITIZER_INTERCEPTOR_HOOKS #define CALL_WEAK_INTERCEPTOR_HOOK(f, ...) \ do { \ if (f) \ f(__VA_ARGS__); \ } while (false); #define DECLARE_WEAK_INTERCEPTOR_HOOK(f, ...) \ extern "C" { \ SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void f(__VA_ARGS__); \ } // extern "C" #else #define DECLARE_WEAK_INTERCEPTOR_HOOK(f, ...) #define CALL_WEAK_INTERCEPTOR_HOOK(f, ...) #endif // SANITIZER_INTERCEPTOR_HOOKS #if SANITIZER_WINDOWS && !defined(va_copy) #define va_copy(dst, src) ((dst) = (src)) #endif // _WIN32 #if SANITIZER_FREEBSD #define pthread_setname_np pthread_set_name_np #define inet_aton __inet_aton #define inet_pton __inet_pton #define iconv __bsd_iconv #endif #ifndef COMMON_INTERCEPTOR_INITIALIZE_RANGE #define COMMON_INTERCEPTOR_INITIALIZE_RANGE(p, size) {} #endif #ifndef COMMON_INTERCEPTOR_UNPOISON_PARAM #define COMMON_INTERCEPTOR_UNPOISON_PARAM(count) {} #endif #ifndef COMMON_INTERCEPTOR_FD_ACCESS #define COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd) {} #endif #ifndef COMMON_INTERCEPTOR_MUTEX_LOCK #define COMMON_INTERCEPTOR_MUTEX_LOCK(ctx, m) {} #endif #ifndef COMMON_INTERCEPTOR_MUTEX_UNLOCK #define COMMON_INTERCEPTOR_MUTEX_UNLOCK(ctx, m) {} #endif #ifndef COMMON_INTERCEPTOR_MUTEX_REPAIR #define COMMON_INTERCEPTOR_MUTEX_REPAIR(ctx, m) {} #endif #ifndef COMMON_INTERCEPTOR_MUTEX_INVALID #define COMMON_INTERCEPTOR_MUTEX_INVALID(ctx, m) {} #endif #ifndef COMMON_INTERCEPTOR_HANDLE_RECVMSG #define COMMON_INTERCEPTOR_HANDLE_RECVMSG(ctx, msg) ((void)(msg)) #endif #ifndef COMMON_INTERCEPTOR_FILE_OPEN #define COMMON_INTERCEPTOR_FILE_OPEN(ctx, file, path) {} #endif #ifndef COMMON_INTERCEPTOR_FILE_CLOSE #define COMMON_INTERCEPTOR_FILE_CLOSE(ctx, file) {} #endif #ifndef COMMON_INTERCEPTOR_LIBRARY_LOADED #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) {} #endif #ifndef COMMON_INTERCEPTOR_LIBRARY_UNLOADED #define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() {} #endif #ifndef COMMON_INTERCEPTOR_ENTER_NOIGNORE #define COMMON_INTERCEPTOR_ENTER_NOIGNORE(ctx, ...) \ COMMON_INTERCEPTOR_ENTER(ctx, __VA_ARGS__) #endif #ifndef COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED #define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED (0) #endif #define COMMON_INTERCEPTOR_READ_STRING_OF_LEN(ctx, s, len, n) \ COMMON_INTERCEPTOR_READ_RANGE((ctx), (s), \ common_flags()->strict_string_checks ? (len) + 1 : (n) ) #define COMMON_INTERCEPTOR_READ_STRING(ctx, s, n) \ COMMON_INTERCEPTOR_READ_STRING_OF_LEN((ctx), (s), REAL(strlen)(s), (n)) #ifndef COMMON_INTERCEPTOR_ON_DLOPEN #define COMMON_INTERCEPTOR_ON_DLOPEN(filename, flag) {} #endif #ifndef COMMON_INTERCEPTOR_GET_TLS_RANGE #define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end) *begin = *end = 0; #endif #ifndef COMMON_INTERCEPTOR_ACQUIRE #define COMMON_INTERCEPTOR_ACQUIRE(ctx, u) {} #endif #ifndef COMMON_INTERCEPTOR_RELEASE #define COMMON_INTERCEPTOR_RELEASE(ctx, u) {} #endif #ifndef COMMON_INTERCEPTOR_USER_CALLBACK_START #define COMMON_INTERCEPTOR_USER_CALLBACK_START() {} #endif #ifndef COMMON_INTERCEPTOR_USER_CALLBACK_END #define COMMON_INTERCEPTOR_USER_CALLBACK_END() {} #endif #ifdef SANITIZER_NLDBL_VERSION #define COMMON_INTERCEPT_FUNCTION_LDBL(fn) \ COMMON_INTERCEPT_FUNCTION_VER(fn, SANITIZER_NLDBL_VERSION) #else #define COMMON_INTERCEPT_FUNCTION_LDBL(fn) \ COMMON_INTERCEPT_FUNCTION(fn) #endif struct FileMetadata { // For open_memstream(). char **addr; SIZE_T *size; }; struct CommonInterceptorMetadata { enum { CIMT_INVALID = 0, CIMT_FILE } type; union { FileMetadata file; }; }; typedef AddrHashMap MetadataHashMap; static MetadataHashMap *interceptor_metadata_map; #if SI_NOT_WINDOWS UNUSED static void SetInterceptorMetadata(__sanitizer_FILE *addr, const FileMetadata &file) { MetadataHashMap::Handle h(interceptor_metadata_map, (uptr)addr); CHECK(h.created()); h->type = CommonInterceptorMetadata::CIMT_FILE; h->file = file; } UNUSED static const FileMetadata *GetInterceptorMetadata( __sanitizer_FILE *addr) { MetadataHashMap::Handle h(interceptor_metadata_map, (uptr)addr, /* remove */ false, /* create */ false); if (h.exists()) { CHECK(!h.created()); CHECK(h->type == CommonInterceptorMetadata::CIMT_FILE); return &h->file; } else { return 0; } } UNUSED static void DeleteInterceptorMetadata(void *addr) { MetadataHashMap::Handle h(interceptor_metadata_map, (uptr)addr, true); CHECK(h.exists()); } #endif // SI_NOT_WINDOWS #if SANITIZER_INTERCEPT_STRLEN INTERCEPTOR(SIZE_T, strlen, const char *s) { // Sometimes strlen is called prior to InitializeCommonInterceptors, // in which case the REAL(strlen) typically used in // COMMON_INTERCEPTOR_ENTER will fail. We use internal_strlen here // to handle that. if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_strlen(s); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strlen, s); SIZE_T result = REAL(strlen)(s); if (common_flags()->intercept_strlen) COMMON_INTERCEPTOR_READ_RANGE(ctx, s, result + 1); return result; } #define INIT_STRLEN COMMON_INTERCEPT_FUNCTION(strlen) #else #define INIT_STRLEN #endif #if SANITIZER_INTERCEPT_STRNLEN INTERCEPTOR(SIZE_T, strnlen, const char *s, SIZE_T maxlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strnlen, s, maxlen); SIZE_T length = REAL(strnlen)(s, maxlen); if (common_flags()->intercept_strlen) COMMON_INTERCEPTOR_READ_RANGE(ctx, s, Min(length + 1, maxlen)); return length; } #define INIT_STRNLEN COMMON_INTERCEPT_FUNCTION(strnlen) #else #define INIT_STRNLEN #endif #if SANITIZER_INTERCEPT_TEXTDOMAIN INTERCEPTOR(char*, textdomain, const char *domainname) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, textdomain, domainname); COMMON_INTERCEPTOR_READ_STRING(ctx, domainname, 0); char *domain = REAL(textdomain)(domainname); if (domain) { COMMON_INTERCEPTOR_INITIALIZE_RANGE(domain, REAL(strlen)(domain) + 1); } return domain; } #define INIT_TEXTDOMAIN COMMON_INTERCEPT_FUNCTION(textdomain) #else #define INIT_TEXTDOMAIN #endif #if SANITIZER_INTERCEPT_STRCMP static inline int CharCmpX(unsigned char c1, unsigned char c2) { return (c1 == c2) ? 0 : (c1 < c2) ? -1 : 1; } DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strcmp, uptr called_pc, const char *s1, const char *s2, int result) INTERCEPTOR(int, strcmp, const char *s1, const char *s2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strcmp, s1, s2); unsigned char c1, c2; uptr i; for (i = 0;; i++) { c1 = (unsigned char)s1[i]; c2 = (unsigned char)s2[i]; if (c1 != c2 || c1 == '\0') break; } COMMON_INTERCEPTOR_READ_STRING(ctx, s1, i + 1); COMMON_INTERCEPTOR_READ_STRING(ctx, s2, i + 1); int result = CharCmpX(c1, c2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strcmp, GET_CALLER_PC(), s1, s2, result); return result; } DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strncmp, uptr called_pc, const char *s1, const char *s2, uptr n, int result) INTERCEPTOR(int, strncmp, const char *s1, const char *s2, uptr size) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_strncmp(s1, s2, size); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strncmp, s1, s2, size); unsigned char c1 = 0, c2 = 0; uptr i; for (i = 0; i < size; i++) { c1 = (unsigned char)s1[i]; c2 = (unsigned char)s2[i]; if (c1 != c2 || c1 == '\0') break; } COMMON_INTERCEPTOR_READ_STRING(ctx, s1, Min(i + 1, size)); COMMON_INTERCEPTOR_READ_STRING(ctx, s2, Min(i + 1, size)); int result = CharCmpX(c1, c2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strncmp, GET_CALLER_PC(), s1, s2, size, result); return result; } #define INIT_STRCMP COMMON_INTERCEPT_FUNCTION(strcmp) #define INIT_STRNCMP COMMON_INTERCEPT_FUNCTION(strncmp) #else #define INIT_STRCMP #define INIT_STRNCMP #endif #if SANITIZER_INTERCEPT_STRCASECMP static inline int CharCaseCmp(unsigned char c1, unsigned char c2) { int c1_low = ToLower(c1); int c2_low = ToLower(c2); return c1_low - c2_low; } DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strcasecmp, uptr called_pc, const char *s1, const char *s2, int result) INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strcasecmp, s1, s2); unsigned char c1 = 0, c2 = 0; uptr i; for (i = 0;; i++) { c1 = (unsigned char)s1[i]; c2 = (unsigned char)s2[i]; if (CharCaseCmp(c1, c2) != 0 || c1 == '\0') break; } COMMON_INTERCEPTOR_READ_STRING(ctx, s1, i + 1); COMMON_INTERCEPTOR_READ_STRING(ctx, s2, i + 1); int result = CharCaseCmp(c1, c2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strcasecmp, GET_CALLER_PC(), s1, s2, result); return result; } DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strncasecmp, uptr called_pc, const char *s1, const char *s2, uptr n, int result) INTERCEPTOR(int, strncasecmp, const char *s1, const char *s2, SIZE_T n) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strncasecmp, s1, s2, n); unsigned char c1 = 0, c2 = 0; uptr i; for (i = 0; i < n; i++) { c1 = (unsigned char)s1[i]; c2 = (unsigned char)s2[i]; if (CharCaseCmp(c1, c2) != 0 || c1 == '\0') break; } COMMON_INTERCEPTOR_READ_RANGE(ctx, s1, Min(i + 1, n)); COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, Min(i + 1, n)); int result = CharCaseCmp(c1, c2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strncasecmp, GET_CALLER_PC(), s1, s2, n, result); return result; } #define INIT_STRCASECMP COMMON_INTERCEPT_FUNCTION(strcasecmp) #define INIT_STRNCASECMP COMMON_INTERCEPT_FUNCTION(strncasecmp) #else #define INIT_STRCASECMP #define INIT_STRNCASECMP #endif #if SANITIZER_INTERCEPT_STRSTR || SANITIZER_INTERCEPT_STRCASESTR static inline void StrstrCheck(void *ctx, char *r, const char *s1, const char *s2) { uptr len1 = REAL(strlen)(s1); uptr len2 = REAL(strlen)(s2); COMMON_INTERCEPTOR_READ_STRING_OF_LEN(ctx, s1, len1, r ? r - s1 + len2 : len1 + 1); COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, len2 + 1); } #endif #if SANITIZER_INTERCEPT_STRSTR DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strstr, uptr called_pc, const char *s1, const char *s2, char *result) INTERCEPTOR(char*, strstr, const char *s1, const char *s2) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_strstr(s1, s2); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strstr, s1, s2); char *r = REAL(strstr)(s1, s2); if (common_flags()->intercept_strstr) StrstrCheck(ctx, r, s1, s2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strstr, GET_CALLER_PC(), s1, s2, r); return r; } #define INIT_STRSTR COMMON_INTERCEPT_FUNCTION(strstr); #else #define INIT_STRSTR #endif #if SANITIZER_INTERCEPT_STRCASESTR DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strcasestr, uptr called_pc, const char *s1, const char *s2, char *result) INTERCEPTOR(char*, strcasestr, const char *s1, const char *s2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strcasestr, s1, s2); char *r = REAL(strcasestr)(s1, s2); if (common_flags()->intercept_strstr) StrstrCheck(ctx, r, s1, s2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_strcasestr, GET_CALLER_PC(), s1, s2, r); return r; } #define INIT_STRCASESTR COMMON_INTERCEPT_FUNCTION(strcasestr); #else #define INIT_STRCASESTR #endif #if SANITIZER_INTERCEPT_MEMMEM DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_memmem, uptr called_pc, const void *s1, SIZE_T len1, const void *s2, SIZE_T len2, void *result) INTERCEPTOR(void*, memmem, const void *s1, SIZE_T len1, const void *s2, SIZE_T len2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memmem, s1, len1, s2, len2); void *r = REAL(memmem)(s1, len1, s2, len2); if (common_flags()->intercept_memmem) { COMMON_INTERCEPTOR_READ_RANGE(ctx, s1, len1); COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, len2); } CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_memmem, GET_CALLER_PC(), s1, len1, s2, len2, r); return r; } #define INIT_MEMMEM COMMON_INTERCEPT_FUNCTION(memmem); #else #define INIT_MEMMEM #endif // SANITIZER_INTERCEPT_MEMMEM #if SANITIZER_INTERCEPT_STRCHR INTERCEPTOR(char*, strchr, const char *s, int c) { void *ctx; if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_strchr(s, c); COMMON_INTERCEPTOR_ENTER(ctx, strchr, s, c); char *result = REAL(strchr)(s, c); uptr len = internal_strlen(s); uptr n = result ? result - s + 1 : len + 1; if (common_flags()->intercept_strchr) COMMON_INTERCEPTOR_READ_STRING_OF_LEN(ctx, s, len, n); return result; } #define INIT_STRCHR COMMON_INTERCEPT_FUNCTION(strchr) #else #define INIT_STRCHR #endif #if SANITIZER_INTERCEPT_STRCHRNUL INTERCEPTOR(char*, strchrnul, const char *s, int c) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strchrnul, s, c); char *result = REAL(strchrnul)(s, c); uptr len = result - s + 1; if (common_flags()->intercept_strchr) COMMON_INTERCEPTOR_READ_STRING(ctx, s, len); return result; } #define INIT_STRCHRNUL COMMON_INTERCEPT_FUNCTION(strchrnul) #else #define INIT_STRCHRNUL #endif #if SANITIZER_INTERCEPT_STRRCHR INTERCEPTOR(char*, strrchr, const char *s, int c) { void *ctx; if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_strrchr(s, c); COMMON_INTERCEPTOR_ENTER(ctx, strrchr, s, c); uptr len = internal_strlen(s); if (common_flags()->intercept_strchr) COMMON_INTERCEPTOR_READ_STRING_OF_LEN(ctx, s, len, len + 1); return REAL(strrchr)(s, c); } #define INIT_STRRCHR COMMON_INTERCEPT_FUNCTION(strrchr) #else #define INIT_STRRCHR #endif #if SANITIZER_INTERCEPT_STRSPN INTERCEPTOR(SIZE_T, strspn, const char *s1, const char *s2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strspn, s1, s2); SIZE_T r = REAL(strspn)(s1, s2); if (common_flags()->intercept_strspn) { COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, REAL(strlen)(s2) + 1); COMMON_INTERCEPTOR_READ_STRING(ctx, s1, r + 1); } return r; } INTERCEPTOR(SIZE_T, strcspn, const char *s1, const char *s2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strcspn, s1, s2); SIZE_T r = REAL(strcspn)(s1, s2); if (common_flags()->intercept_strspn) { COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, REAL(strlen)(s2) + 1); COMMON_INTERCEPTOR_READ_STRING(ctx, s1, r + 1); } return r; } #define INIT_STRSPN \ COMMON_INTERCEPT_FUNCTION(strspn); \ COMMON_INTERCEPT_FUNCTION(strcspn); #else #define INIT_STRSPN #endif #if SANITIZER_INTERCEPT_STRPBRK INTERCEPTOR(char *, strpbrk, const char *s1, const char *s2) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strpbrk, s1, s2); char *r = REAL(strpbrk)(s1, s2); if (common_flags()->intercept_strpbrk) { COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, REAL(strlen)(s2) + 1); COMMON_INTERCEPTOR_READ_STRING(ctx, s1, r ? r - s1 + 1 : REAL(strlen)(s1) + 1); } return r; } #define INIT_STRPBRK COMMON_INTERCEPT_FUNCTION(strpbrk); #else #define INIT_STRPBRK #endif #if SANITIZER_INTERCEPT_MEMSET INTERCEPTOR(void*, memset, void *dst, int v, uptr size) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_memset(dst, v, size); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memset, dst, v, size); if (common_flags()->intercept_intrin) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, size); return REAL(memset)(dst, v, size); } #define INIT_MEMSET COMMON_INTERCEPT_FUNCTION(memset) #else #define INIT_MEMSET #endif #if SANITIZER_INTERCEPT_MEMMOVE INTERCEPTOR(void*, memmove, void *dst, const void *src, uptr size) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_memmove(dst, src, size); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memmove, dst, src, size); if (common_flags()->intercept_intrin) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, size); COMMON_INTERCEPTOR_READ_RANGE(ctx, src, size); } return REAL(memmove)(dst, src, size); } #define INIT_MEMMOVE COMMON_INTERCEPT_FUNCTION(memmove) #else #define INIT_MEMMOVE #endif #if SANITIZER_INTERCEPT_MEMCPY INTERCEPTOR(void*, memcpy, void *dst, const void *src, uptr size) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) { // On OS X, calling internal_memcpy here will cause memory corruptions, // because memcpy and memmove are actually aliases of the same // implementation. We need to use internal_memmove here. return internal_memmove(dst, src, size); } void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memcpy, dst, src, size); if (common_flags()->intercept_intrin) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, size); COMMON_INTERCEPTOR_READ_RANGE(ctx, src, size); } // N.B.: If we switch this to internal_ we'll have to use internal_memmove // due to memcpy being an alias of memmove on OS X. return REAL(memcpy)(dst, src, size); } #define INIT_MEMCPY COMMON_INTERCEPT_FUNCTION(memcpy) #else #define INIT_MEMCPY #endif #if SANITIZER_INTERCEPT_MEMCMP DECLARE_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_memcmp, uptr called_pc, const void *s1, const void *s2, uptr n, int result) INTERCEPTOR(int, memcmp, const void *a1, const void *a2, uptr size) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_memcmp(a1, a2, size); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memcmp, a1, a2, size); if (common_flags()->intercept_memcmp) { if (common_flags()->strict_memcmp) { // Check the entire regions even if the first bytes of the buffers are // different. COMMON_INTERCEPTOR_READ_RANGE(ctx, a1, size); COMMON_INTERCEPTOR_READ_RANGE(ctx, a2, size); // Fallthrough to REAL(memcmp) below. } else { unsigned char c1 = 0, c2 = 0; const unsigned char *s1 = (const unsigned char*)a1; const unsigned char *s2 = (const unsigned char*)a2; uptr i; for (i = 0; i < size; i++) { c1 = s1[i]; c2 = s2[i]; if (c1 != c2) break; } COMMON_INTERCEPTOR_READ_RANGE(ctx, s1, Min(i + 1, size)); COMMON_INTERCEPTOR_READ_RANGE(ctx, s2, Min(i + 1, size)); int r = CharCmpX(c1, c2); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_memcmp, GET_CALLER_PC(), a1, a2, size, r); return r; } } int result = REAL(memcmp(a1, a2, size)); CALL_WEAK_INTERCEPTOR_HOOK(__sanitizer_weak_hook_memcmp, GET_CALLER_PC(), a1, a2, size, result); return result; } #define INIT_MEMCMP COMMON_INTERCEPT_FUNCTION(memcmp) #else #define INIT_MEMCMP #endif #if SANITIZER_INTERCEPT_MEMCHR INTERCEPTOR(void*, memchr, const void *s, int c, SIZE_T n) { if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return internal_memchr(s, c, n); void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memchr, s, c, n); #if SANITIZER_WINDOWS void *res; if (REAL(memchr)) { res = REAL(memchr)(s, c, n); } else { res = internal_memchr(s, c, n); } #else void *res = REAL(memchr)(s, c, n); #endif uptr len = res ? (char *)res - (const char *)s + 1 : n; COMMON_INTERCEPTOR_READ_RANGE(ctx, s, len); return res; } #define INIT_MEMCHR COMMON_INTERCEPT_FUNCTION(memchr) #else #define INIT_MEMCHR #endif #if SANITIZER_INTERCEPT_MEMRCHR INTERCEPTOR(void*, memrchr, const void *s, int c, SIZE_T n) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, memrchr, s, c, n); COMMON_INTERCEPTOR_READ_RANGE(ctx, s, n); return REAL(memrchr)(s, c, n); } #define INIT_MEMRCHR COMMON_INTERCEPT_FUNCTION(memrchr) #else #define INIT_MEMRCHR #endif #if SANITIZER_INTERCEPT_FREXP INTERCEPTOR(double, frexp, double x, int *exp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, frexp, x, exp); // Assuming frexp() always writes to |exp|. COMMON_INTERCEPTOR_WRITE_RANGE(ctx, exp, sizeof(*exp)); double res = REAL(frexp)(x, exp); return res; } #define INIT_FREXP COMMON_INTERCEPT_FUNCTION(frexp); #else #define INIT_FREXP #endif // SANITIZER_INTERCEPT_FREXP #if SANITIZER_INTERCEPT_FREXPF_FREXPL INTERCEPTOR(float, frexpf, float x, int *exp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, frexpf, x, exp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. float res = REAL(frexpf)(x, exp); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, exp, sizeof(*exp)); return res; } INTERCEPTOR(long double, frexpl, long double x, int *exp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, frexpl, x, exp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. long double res = REAL(frexpl)(x, exp); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, exp, sizeof(*exp)); return res; } #define INIT_FREXPF_FREXPL \ COMMON_INTERCEPT_FUNCTION(frexpf); \ COMMON_INTERCEPT_FUNCTION_LDBL(frexpl) #else #define INIT_FREXPF_FREXPL #endif // SANITIZER_INTERCEPT_FREXPF_FREXPL #if SI_NOT_WINDOWS static void write_iovec(void *ctx, struct __sanitizer_iovec *iovec, SIZE_T iovlen, SIZE_T maxlen) { for (SIZE_T i = 0; i < iovlen && maxlen; ++i) { SSIZE_T sz = Min(iovec[i].iov_len, maxlen); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iovec[i].iov_base, sz); maxlen -= sz; } } static void read_iovec(void *ctx, struct __sanitizer_iovec *iovec, SIZE_T iovlen, SIZE_T maxlen) { COMMON_INTERCEPTOR_READ_RANGE(ctx, iovec, sizeof(*iovec) * iovlen); for (SIZE_T i = 0; i < iovlen && maxlen; ++i) { SSIZE_T sz = Min(iovec[i].iov_len, maxlen); COMMON_INTERCEPTOR_READ_RANGE(ctx, iovec[i].iov_base, sz); maxlen -= sz; } } #endif #if SANITIZER_INTERCEPT_READ INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, read, fd, ptr, count); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(read)(fd, ptr, count); if (res > 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res); if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } #define INIT_READ COMMON_INTERCEPT_FUNCTION(read) #else #define INIT_READ #endif #if SANITIZER_INTERCEPT_PREAD INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pread, fd, ptr, count, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(pread)(fd, ptr, count, offset); if (res > 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res); if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } #define INIT_PREAD COMMON_INTERCEPT_FUNCTION(pread) #else #define INIT_PREAD #endif #if SANITIZER_INTERCEPT_PREAD64 INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pread64, fd, ptr, count, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(pread64)(fd, ptr, count, offset); if (res > 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res); if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } #define INIT_PREAD64 COMMON_INTERCEPT_FUNCTION(pread64) #else #define INIT_PREAD64 #endif #if SANITIZER_INTERCEPT_READV INTERCEPTOR_WITH_SUFFIX(SSIZE_T, readv, int fd, __sanitizer_iovec *iov, int iovcnt) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, readv, fd, iov, iovcnt); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); SSIZE_T res = REAL(readv)(fd, iov, iovcnt); if (res > 0) write_iovec(ctx, iov, iovcnt, res); if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } #define INIT_READV COMMON_INTERCEPT_FUNCTION(readv) #else #define INIT_READV #endif #if SANITIZER_INTERCEPT_PREADV INTERCEPTOR(SSIZE_T, preadv, int fd, __sanitizer_iovec *iov, int iovcnt, OFF_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, preadv, fd, iov, iovcnt, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); SSIZE_T res = REAL(preadv)(fd, iov, iovcnt, offset); if (res > 0) write_iovec(ctx, iov, iovcnt, res); if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } #define INIT_PREADV COMMON_INTERCEPT_FUNCTION(preadv) #else #define INIT_PREADV #endif #if SANITIZER_INTERCEPT_PREADV64 INTERCEPTOR(SSIZE_T, preadv64, int fd, __sanitizer_iovec *iov, int iovcnt, OFF64_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, preadv64, fd, iov, iovcnt, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); SSIZE_T res = REAL(preadv64)(fd, iov, iovcnt, offset); if (res > 0) write_iovec(ctx, iov, iovcnt, res); if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } #define INIT_PREADV64 COMMON_INTERCEPT_FUNCTION(preadv64) #else #define INIT_PREADV64 #endif #if SANITIZER_INTERCEPT_WRITE INTERCEPTOR(SSIZE_T, write, int fd, void *ptr, SIZE_T count) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, write, fd, ptr, count); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); SSIZE_T res = REAL(write)(fd, ptr, count); // FIXME: this check should be _before_ the call to REAL(write), not after if (res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res); return res; } #define INIT_WRITE COMMON_INTERCEPT_FUNCTION(write) #else #define INIT_WRITE #endif #if SANITIZER_INTERCEPT_PWRITE INTERCEPTOR(SSIZE_T, pwrite, int fd, void *ptr, SIZE_T count, OFF_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pwrite, fd, ptr, count, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); SSIZE_T res = REAL(pwrite)(fd, ptr, count, offset); if (res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res); return res; } #define INIT_PWRITE COMMON_INTERCEPT_FUNCTION(pwrite) #else #define INIT_PWRITE #endif #if SANITIZER_INTERCEPT_PWRITE64 INTERCEPTOR(SSIZE_T, pwrite64, int fd, void *ptr, OFF64_T count, OFF64_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pwrite64, fd, ptr, count, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); SSIZE_T res = REAL(pwrite64)(fd, ptr, count, offset); if (res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res); return res; } #define INIT_PWRITE64 COMMON_INTERCEPT_FUNCTION(pwrite64) #else #define INIT_PWRITE64 #endif #if SANITIZER_INTERCEPT_WRITEV INTERCEPTOR_WITH_SUFFIX(SSIZE_T, writev, int fd, __sanitizer_iovec *iov, int iovcnt) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, writev, fd, iov, iovcnt); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); SSIZE_T res = REAL(writev)(fd, iov, iovcnt); if (res > 0) read_iovec(ctx, iov, iovcnt, res); return res; } #define INIT_WRITEV COMMON_INTERCEPT_FUNCTION(writev) #else #define INIT_WRITEV #endif #if SANITIZER_INTERCEPT_PWRITEV INTERCEPTOR(SSIZE_T, pwritev, int fd, __sanitizer_iovec *iov, int iovcnt, OFF_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pwritev, fd, iov, iovcnt, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); SSIZE_T res = REAL(pwritev)(fd, iov, iovcnt, offset); if (res > 0) read_iovec(ctx, iov, iovcnt, res); return res; } #define INIT_PWRITEV COMMON_INTERCEPT_FUNCTION(pwritev) #else #define INIT_PWRITEV #endif #if SANITIZER_INTERCEPT_PWRITEV64 INTERCEPTOR(SSIZE_T, pwritev64, int fd, __sanitizer_iovec *iov, int iovcnt, OFF64_T offset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pwritev64, fd, iov, iovcnt, offset); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); SSIZE_T res = REAL(pwritev64)(fd, iov, iovcnt, offset); if (res > 0) read_iovec(ctx, iov, iovcnt, res); return res; } #define INIT_PWRITEV64 COMMON_INTERCEPT_FUNCTION(pwritev64) #else #define INIT_PWRITEV64 #endif #if SANITIZER_INTERCEPT_PRCTL INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3, // NOLINT unsigned long arg4, unsigned long arg5) { // NOLINT void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, prctl, option, arg2, arg3, arg4, arg5); static const int PR_SET_NAME = 15; int res = REAL(prctl(option, arg2, arg3, arg4, arg5)); if (option == PR_SET_NAME) { char buff[16]; internal_strncpy(buff, (char *)arg2, 15); buff[15] = 0; COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, buff); } return res; } #define INIT_PRCTL COMMON_INTERCEPT_FUNCTION(prctl) #else #define INIT_PRCTL #endif // SANITIZER_INTERCEPT_PRCTL #if SANITIZER_INTERCEPT_TIME INTERCEPTOR(unsigned long, time, unsigned long *t) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, time, t); unsigned long local_t; unsigned long res = REAL(time)(&local_t); if (t && res != (unsigned long)-1) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, t, sizeof(*t)); *t = local_t; } return res; } #define INIT_TIME COMMON_INTERCEPT_FUNCTION(time); #else #define INIT_TIME #endif // SANITIZER_INTERCEPT_TIME #if SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS static void unpoison_tm(void *ctx, __sanitizer_tm *tm) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, tm, sizeof(*tm)); if (tm->tm_zone) { // Can not use COMMON_INTERCEPTOR_WRITE_RANGE here, because tm->tm_zone // can point to shared memory and tsan would report a data race. COMMON_INTERCEPTOR_INITIALIZE_RANGE(tm->tm_zone, REAL(strlen(tm->tm_zone)) + 1); } } INTERCEPTOR(__sanitizer_tm *, localtime, unsigned long *timep) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, localtime, timep); __sanitizer_tm *res = REAL(localtime)(timep); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, timep, sizeof(*timep)); unpoison_tm(ctx, res); } return res; } INTERCEPTOR(__sanitizer_tm *, localtime_r, unsigned long *timep, void *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, localtime_r, timep, result); __sanitizer_tm *res = REAL(localtime_r)(timep, result); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, timep, sizeof(*timep)); unpoison_tm(ctx, res); } return res; } INTERCEPTOR(__sanitizer_tm *, gmtime, unsigned long *timep) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gmtime, timep); __sanitizer_tm *res = REAL(gmtime)(timep); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, timep, sizeof(*timep)); unpoison_tm(ctx, res); } return res; } INTERCEPTOR(__sanitizer_tm *, gmtime_r, unsigned long *timep, void *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gmtime_r, timep, result); __sanitizer_tm *res = REAL(gmtime_r)(timep, result); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, timep, sizeof(*timep)); unpoison_tm(ctx, res); } return res; } INTERCEPTOR(char *, ctime, unsigned long *timep) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ctime, timep); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(ctime)(timep); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, timep, sizeof(*timep)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); } return res; } INTERCEPTOR(char *, ctime_r, unsigned long *timep, char *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ctime_r, timep, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(ctime_r)(timep, result); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, timep, sizeof(*timep)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); } return res; } INTERCEPTOR(char *, asctime, __sanitizer_tm *tm) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, asctime, tm); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(asctime)(tm); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, tm, sizeof(*tm)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); } return res; } INTERCEPTOR(char *, asctime_r, __sanitizer_tm *tm, char *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, asctime_r, tm, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(asctime_r)(tm, result); if (res) { COMMON_INTERCEPTOR_READ_RANGE(ctx, tm, sizeof(*tm)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); } return res; } INTERCEPTOR(long, mktime, __sanitizer_tm *tm) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mktime, tm); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_sec, sizeof(tm->tm_sec)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_min, sizeof(tm->tm_min)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_hour, sizeof(tm->tm_hour)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_mday, sizeof(tm->tm_mday)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_mon, sizeof(tm->tm_mon)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_year, sizeof(tm->tm_year)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &tm->tm_isdst, sizeof(tm->tm_isdst)); long res = REAL(mktime)(tm); if (res != -1) unpoison_tm(ctx, tm); return res; } #define INIT_LOCALTIME_AND_FRIENDS \ COMMON_INTERCEPT_FUNCTION(localtime); \ COMMON_INTERCEPT_FUNCTION(localtime_r); \ COMMON_INTERCEPT_FUNCTION(gmtime); \ COMMON_INTERCEPT_FUNCTION(gmtime_r); \ COMMON_INTERCEPT_FUNCTION(ctime); \ COMMON_INTERCEPT_FUNCTION(ctime_r); \ COMMON_INTERCEPT_FUNCTION(asctime); \ COMMON_INTERCEPT_FUNCTION(asctime_r); \ COMMON_INTERCEPT_FUNCTION(mktime); #else #define INIT_LOCALTIME_AND_FRIENDS #endif // SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS #if SANITIZER_INTERCEPT_STRPTIME INTERCEPTOR(char *, strptime, char *s, char *format, __sanitizer_tm *tm) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strptime, s, format, tm); if (format) COMMON_INTERCEPTOR_READ_RANGE(ctx, format, REAL(strlen)(format) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(strptime)(s, format, tm); COMMON_INTERCEPTOR_READ_STRING(ctx, s, res ? res - s : 0); if (res && tm) { // Do not call unpoison_tm here, because strptime does not, in fact, // initialize the entire struct tm. For example, tm_zone pointer is left // uninitialized. COMMON_INTERCEPTOR_WRITE_RANGE(ctx, tm, sizeof(*tm)); } return res; } #define INIT_STRPTIME COMMON_INTERCEPT_FUNCTION(strptime); #else #define INIT_STRPTIME #endif #if SANITIZER_INTERCEPT_SCANF || SANITIZER_INTERCEPT_PRINTF #include "sanitizer_common_interceptors_format.inc" #define FORMAT_INTERCEPTOR_IMPL(name, vname, ...) \ { \ void *ctx; \ va_list ap; \ va_start(ap, format); \ COMMON_INTERCEPTOR_ENTER(ctx, vname, __VA_ARGS__, ap); \ int res = WRAP(vname)(__VA_ARGS__, ap); \ va_end(ap); \ return res; \ } #endif #if SANITIZER_INTERCEPT_SCANF #define VSCANF_INTERCEPTOR_IMPL(vname, allowGnuMalloc, ...) \ { \ void *ctx; \ COMMON_INTERCEPTOR_ENTER(ctx, vname, __VA_ARGS__); \ va_list aq; \ va_copy(aq, ap); \ int res = REAL(vname)(__VA_ARGS__); \ if (res > 0) \ scanf_common(ctx, res, allowGnuMalloc, format, aq); \ va_end(aq); \ return res; \ } INTERCEPTOR(int, vscanf, const char *format, va_list ap) VSCANF_INTERCEPTOR_IMPL(vscanf, true, format, ap) INTERCEPTOR(int, vsscanf, const char *str, const char *format, va_list ap) VSCANF_INTERCEPTOR_IMPL(vsscanf, true, str, format, ap) INTERCEPTOR(int, vfscanf, void *stream, const char *format, va_list ap) VSCANF_INTERCEPTOR_IMPL(vfscanf, true, stream, format, ap) #if SANITIZER_INTERCEPT_ISOC99_SCANF INTERCEPTOR(int, __isoc99_vscanf, const char *format, va_list ap) VSCANF_INTERCEPTOR_IMPL(__isoc99_vscanf, false, format, ap) INTERCEPTOR(int, __isoc99_vsscanf, const char *str, const char *format, va_list ap) VSCANF_INTERCEPTOR_IMPL(__isoc99_vsscanf, false, str, format, ap) INTERCEPTOR(int, __isoc99_vfscanf, void *stream, const char *format, va_list ap) VSCANF_INTERCEPTOR_IMPL(__isoc99_vfscanf, false, stream, format, ap) #endif // SANITIZER_INTERCEPT_ISOC99_SCANF INTERCEPTOR(int, scanf, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(scanf, vscanf, format) INTERCEPTOR(int, fscanf, void *stream, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(fscanf, vfscanf, stream, format) INTERCEPTOR(int, sscanf, const char *str, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(sscanf, vsscanf, str, format) #if SANITIZER_INTERCEPT_ISOC99_SCANF INTERCEPTOR(int, __isoc99_scanf, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_scanf, __isoc99_vscanf, format) INTERCEPTOR(int, __isoc99_fscanf, void *stream, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_fscanf, __isoc99_vfscanf, stream, format) INTERCEPTOR(int, __isoc99_sscanf, const char *str, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_sscanf, __isoc99_vsscanf, str, format) #endif #endif #if SANITIZER_INTERCEPT_SCANF #define INIT_SCANF \ COMMON_INTERCEPT_FUNCTION(scanf); \ COMMON_INTERCEPT_FUNCTION(sscanf); \ COMMON_INTERCEPT_FUNCTION(fscanf); \ COMMON_INTERCEPT_FUNCTION(vscanf); \ COMMON_INTERCEPT_FUNCTION(vsscanf); \ COMMON_INTERCEPT_FUNCTION(vfscanf); #else #define INIT_SCANF #endif #if SANITIZER_INTERCEPT_ISOC99_SCANF #define INIT_ISOC99_SCANF \ COMMON_INTERCEPT_FUNCTION(__isoc99_scanf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_sscanf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_fscanf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vscanf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vsscanf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vfscanf); #else #define INIT_ISOC99_SCANF #endif #if SANITIZER_INTERCEPT_PRINTF #define VPRINTF_INTERCEPTOR_ENTER(vname, ...) \ void *ctx; \ COMMON_INTERCEPTOR_ENTER(ctx, vname, __VA_ARGS__); \ va_list aq; \ va_copy(aq, ap); #define VPRINTF_INTERCEPTOR_RETURN() \ va_end(aq); #define VPRINTF_INTERCEPTOR_IMPL(vname, ...) \ { \ VPRINTF_INTERCEPTOR_ENTER(vname, __VA_ARGS__); \ if (common_flags()->check_printf) \ printf_common(ctx, format, aq); \ int res = REAL(vname)(__VA_ARGS__); \ VPRINTF_INTERCEPTOR_RETURN(); \ return res; \ } // FIXME: under ASan the REAL() call below may write to freed memory and // corrupt its metadata. See // https://github.com/google/sanitizers/issues/321. #define VSPRINTF_INTERCEPTOR_IMPL(vname, str, ...) \ { \ VPRINTF_INTERCEPTOR_ENTER(vname, str, __VA_ARGS__) \ if (common_flags()->check_printf) { \ printf_common(ctx, format, aq); \ } \ int res = REAL(vname)(str, __VA_ARGS__); \ if (res >= 0) { \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, str, res + 1); \ } \ VPRINTF_INTERCEPTOR_RETURN(); \ return res; \ } // FIXME: under ASan the REAL() call below may write to freed memory and // corrupt its metadata. See // https://github.com/google/sanitizers/issues/321. #define VSNPRINTF_INTERCEPTOR_IMPL(vname, str, size, ...) \ { \ VPRINTF_INTERCEPTOR_ENTER(vname, str, size, __VA_ARGS__) \ if (common_flags()->check_printf) { \ printf_common(ctx, format, aq); \ } \ int res = REAL(vname)(str, size, __VA_ARGS__); \ if (res >= 0) { \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, str, Min(size, (SIZE_T)(res + 1))); \ } \ VPRINTF_INTERCEPTOR_RETURN(); \ return res; \ } // FIXME: under ASan the REAL() call below may write to freed memory and // corrupt its metadata. See // https://github.com/google/sanitizers/issues/321. #define VASPRINTF_INTERCEPTOR_IMPL(vname, strp, ...) \ { \ VPRINTF_INTERCEPTOR_ENTER(vname, strp, __VA_ARGS__) \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, strp, sizeof(char *)); \ if (common_flags()->check_printf) { \ printf_common(ctx, format, aq); \ } \ int res = REAL(vname)(strp, __VA_ARGS__); \ if (res >= 0) { \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *strp, res + 1); \ } \ VPRINTF_INTERCEPTOR_RETURN(); \ return res; \ } INTERCEPTOR(int, vprintf, const char *format, va_list ap) VPRINTF_INTERCEPTOR_IMPL(vprintf, format, ap) INTERCEPTOR(int, vfprintf, __sanitizer_FILE *stream, const char *format, va_list ap) VPRINTF_INTERCEPTOR_IMPL(vfprintf, stream, format, ap) INTERCEPTOR(int, vsnprintf, char *str, SIZE_T size, const char *format, va_list ap) VSNPRINTF_INTERCEPTOR_IMPL(vsnprintf, str, size, format, ap) #if SANITIZER_INTERCEPT_PRINTF_L INTERCEPTOR(int, vsnprintf_l, char *str, SIZE_T size, void *loc, const char *format, va_list ap) VSNPRINTF_INTERCEPTOR_IMPL(vsnprintf_l, str, size, loc, format, ap) INTERCEPTOR(int, snprintf_l, char *str, SIZE_T size, void *loc, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(snprintf_l, vsnprintf_l, str, size, loc, format) #endif // SANITIZER_INTERCEPT_PRINTF_L INTERCEPTOR(int, vsprintf, char *str, const char *format, va_list ap) VSPRINTF_INTERCEPTOR_IMPL(vsprintf, str, format, ap) INTERCEPTOR(int, vasprintf, char **strp, const char *format, va_list ap) VASPRINTF_INTERCEPTOR_IMPL(vasprintf, strp, format, ap) #if SANITIZER_INTERCEPT_ISOC99_PRINTF INTERCEPTOR(int, __isoc99_vprintf, const char *format, va_list ap) VPRINTF_INTERCEPTOR_IMPL(__isoc99_vprintf, format, ap) INTERCEPTOR(int, __isoc99_vfprintf, __sanitizer_FILE *stream, const char *format, va_list ap) VPRINTF_INTERCEPTOR_IMPL(__isoc99_vfprintf, stream, format, ap) INTERCEPTOR(int, __isoc99_vsnprintf, char *str, SIZE_T size, const char *format, va_list ap) VSNPRINTF_INTERCEPTOR_IMPL(__isoc99_vsnprintf, str, size, format, ap) INTERCEPTOR(int, __isoc99_vsprintf, char *str, const char *format, va_list ap) VSPRINTF_INTERCEPTOR_IMPL(__isoc99_vsprintf, str, format, ap) #endif // SANITIZER_INTERCEPT_ISOC99_PRINTF INTERCEPTOR(int, printf, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(printf, vprintf, format) INTERCEPTOR(int, fprintf, __sanitizer_FILE *stream, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(fprintf, vfprintf, stream, format) INTERCEPTOR(int, sprintf, char *str, const char *format, ...) // NOLINT FORMAT_INTERCEPTOR_IMPL(sprintf, vsprintf, str, format) // NOLINT INTERCEPTOR(int, snprintf, char *str, SIZE_T size, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(snprintf, vsnprintf, str, size, format) INTERCEPTOR(int, asprintf, char **strp, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(asprintf, vasprintf, strp, format) #if SANITIZER_INTERCEPT_ISOC99_PRINTF INTERCEPTOR(int, __isoc99_printf, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_printf, __isoc99_vprintf, format) INTERCEPTOR(int, __isoc99_fprintf, __sanitizer_FILE *stream, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_fprintf, __isoc99_vfprintf, stream, format) INTERCEPTOR(int, __isoc99_sprintf, char *str, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_sprintf, __isoc99_vsprintf, str, format) INTERCEPTOR(int, __isoc99_snprintf, char *str, SIZE_T size, const char *format, ...) FORMAT_INTERCEPTOR_IMPL(__isoc99_snprintf, __isoc99_vsnprintf, str, size, format) #endif // SANITIZER_INTERCEPT_ISOC99_PRINTF #endif // SANITIZER_INTERCEPT_PRINTF #if SANITIZER_INTERCEPT_PRINTF #define INIT_PRINTF \ COMMON_INTERCEPT_FUNCTION(printf); \ COMMON_INTERCEPT_FUNCTION(sprintf); \ COMMON_INTERCEPT_FUNCTION(snprintf); \ COMMON_INTERCEPT_FUNCTION(asprintf); \ COMMON_INTERCEPT_FUNCTION(fprintf); \ COMMON_INTERCEPT_FUNCTION(vprintf); \ COMMON_INTERCEPT_FUNCTION(vsprintf); \ COMMON_INTERCEPT_FUNCTION(vsnprintf); \ COMMON_INTERCEPT_FUNCTION(vasprintf); \ COMMON_INTERCEPT_FUNCTION(vfprintf); #else #define INIT_PRINTF #endif #if SANITIZER_INTERCEPT_PRINTF_L #define INIT_PRINTF_L \ COMMON_INTERCEPT_FUNCTION(snprintf_l); \ COMMON_INTERCEPT_FUNCTION(vsnprintf_l); #else #define INIT_PRINTF_L #endif #if SANITIZER_INTERCEPT_ISOC99_PRINTF #define INIT_ISOC99_PRINTF \ COMMON_INTERCEPT_FUNCTION(__isoc99_printf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_sprintf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_snprintf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_fprintf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vprintf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vsprintf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vsnprintf); \ COMMON_INTERCEPT_FUNCTION(__isoc99_vfprintf); #else #define INIT_ISOC99_PRINTF #endif #if SANITIZER_INTERCEPT_IOCTL #include "sanitizer_common_interceptors_ioctl.inc" INTERCEPTOR(int, ioctl, int d, unsigned long request, ...) { // We need a frame pointer, because we call into ioctl_common_[pre|post] which // can trigger a report and we need to be able to unwind through this // function. On Mac in debug mode we might not have a frame pointer, because // ioctl_common_[pre|post] doesn't get inlined here. ENABLE_FRAME_POINTER; void *ctx; va_list ap; va_start(ap, request); void *arg = va_arg(ap, void *); va_end(ap); COMMON_INTERCEPTOR_ENTER(ctx, ioctl, d, request, arg); CHECK(ioctl_initialized); // Note: TSan does not use common flags, and they are zero-initialized. // This effectively disables ioctl handling in TSan. if (!common_flags()->handle_ioctl) return REAL(ioctl)(d, request, arg); // Although request is unsigned long, the rest of the interceptor uses it // as just "unsigned" to save space, because we know that all values fit in // "unsigned" - they are compile-time constants. const ioctl_desc *desc = ioctl_lookup(request); ioctl_desc decoded_desc; if (!desc) { VPrintf(2, "Decoding unknown ioctl 0x%x\n", request); if (!ioctl_decode(request, &decoded_desc)) Printf("WARNING: failed decoding unknown ioctl 0x%x\n", request); else desc = &decoded_desc; } if (desc) ioctl_common_pre(ctx, desc, d, request, arg); int res = REAL(ioctl)(d, request, arg); // FIXME: some ioctls have different return values for success and failure. if (desc && res != -1) ioctl_common_post(ctx, desc, res, d, request, arg); return res; } #define INIT_IOCTL \ ioctl_init(); \ COMMON_INTERCEPT_FUNCTION(ioctl); #else #define INIT_IOCTL #endif #if SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS || \ SANITIZER_INTERCEPT_GETPWENT || SANITIZER_INTERCEPT_FGETPWENT || \ SANITIZER_INTERCEPT_GETPWENT_R || SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS static void unpoison_passwd(void *ctx, __sanitizer_passwd *pwd) { if (pwd) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwd, sizeof(*pwd)); if (pwd->pw_name) COMMON_INTERCEPTOR_INITIALIZE_RANGE(pwd->pw_name, REAL(strlen)(pwd->pw_name) + 1); if (pwd->pw_passwd) COMMON_INTERCEPTOR_INITIALIZE_RANGE(pwd->pw_passwd, REAL(strlen)(pwd->pw_passwd) + 1); #if !SANITIZER_ANDROID if (pwd->pw_gecos) COMMON_INTERCEPTOR_INITIALIZE_RANGE(pwd->pw_gecos, REAL(strlen)(pwd->pw_gecos) + 1); #endif #if SANITIZER_MAC if (pwd->pw_class) COMMON_INTERCEPTOR_INITIALIZE_RANGE(pwd->pw_class, REAL(strlen)(pwd->pw_class) + 1); #endif if (pwd->pw_dir) COMMON_INTERCEPTOR_INITIALIZE_RANGE(pwd->pw_dir, REAL(strlen)(pwd->pw_dir) + 1); if (pwd->pw_shell) COMMON_INTERCEPTOR_INITIALIZE_RANGE(pwd->pw_shell, REAL(strlen)(pwd->pw_shell) + 1); } } static void unpoison_group(void *ctx, __sanitizer_group *grp) { if (grp) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, grp, sizeof(*grp)); if (grp->gr_name) COMMON_INTERCEPTOR_INITIALIZE_RANGE(grp->gr_name, REAL(strlen)(grp->gr_name) + 1); if (grp->gr_passwd) COMMON_INTERCEPTOR_INITIALIZE_RANGE(grp->gr_passwd, REAL(strlen)(grp->gr_passwd) + 1); char **p = grp->gr_mem; for (; *p; ++p) { COMMON_INTERCEPTOR_INITIALIZE_RANGE(*p, REAL(strlen)(*p) + 1); } COMMON_INTERCEPTOR_INITIALIZE_RANGE(grp->gr_mem, (p - grp->gr_mem + 1) * sizeof(*p)); } } #endif // SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS || // SANITIZER_INTERCEPT_GETPWENT || SANITIZER_INTERCEPT_FGETPWENT || // SANITIZER_INTERCEPT_GETPWENT_R || // SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS #if SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS INTERCEPTOR(__sanitizer_passwd *, getpwnam, const char *name) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwnam, name); COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); __sanitizer_passwd *res = REAL(getpwnam)(name); if (res) unpoison_passwd(ctx, res); return res; } INTERCEPTOR(__sanitizer_passwd *, getpwuid, u32 uid) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwuid, uid); __sanitizer_passwd *res = REAL(getpwuid)(uid); if (res) unpoison_passwd(ctx, res); return res; } INTERCEPTOR(__sanitizer_group *, getgrnam, const char *name) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgrnam, name); COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); __sanitizer_group *res = REAL(getgrnam)(name); if (res) unpoison_group(ctx, res); return res; } INTERCEPTOR(__sanitizer_group *, getgrgid, u32 gid) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgrgid, gid); __sanitizer_group *res = REAL(getgrgid)(gid); if (res) unpoison_group(ctx, res); return res; } #define INIT_GETPWNAM_AND_FRIENDS \ COMMON_INTERCEPT_FUNCTION(getpwnam); \ COMMON_INTERCEPT_FUNCTION(getpwuid); \ COMMON_INTERCEPT_FUNCTION(getgrnam); \ COMMON_INTERCEPT_FUNCTION(getgrgid); #else #define INIT_GETPWNAM_AND_FRIENDS #endif #if SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS INTERCEPTOR(int, getpwnam_r, const char *name, __sanitizer_passwd *pwd, char *buf, SIZE_T buflen, __sanitizer_passwd **result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwnam_r, name, pwd, buf, buflen, result); COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getpwnam_r)(name, pwd, buf, buflen, result); if (!res) { if (result && *result) unpoison_passwd(ctx, *result); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } INTERCEPTOR(int, getpwuid_r, u32 uid, __sanitizer_passwd *pwd, char *buf, SIZE_T buflen, __sanitizer_passwd **result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwuid_r, uid, pwd, buf, buflen, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getpwuid_r)(uid, pwd, buf, buflen, result); if (!res) { if (result && *result) unpoison_passwd(ctx, *result); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } INTERCEPTOR(int, getgrnam_r, const char *name, __sanitizer_group *grp, char *buf, SIZE_T buflen, __sanitizer_group **result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgrnam_r, name, grp, buf, buflen, result); COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getgrnam_r)(name, grp, buf, buflen, result); if (!res) { if (result && *result) unpoison_group(ctx, *result); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } INTERCEPTOR(int, getgrgid_r, u32 gid, __sanitizer_group *grp, char *buf, SIZE_T buflen, __sanitizer_group **result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgrgid_r, gid, grp, buf, buflen, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getgrgid_r)(gid, grp, buf, buflen, result); if (!res) { if (result && *result) unpoison_group(ctx, *result); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } #define INIT_GETPWNAM_R_AND_FRIENDS \ COMMON_INTERCEPT_FUNCTION(getpwnam_r); \ COMMON_INTERCEPT_FUNCTION(getpwuid_r); \ COMMON_INTERCEPT_FUNCTION(getgrnam_r); \ COMMON_INTERCEPT_FUNCTION(getgrgid_r); #else #define INIT_GETPWNAM_R_AND_FRIENDS #endif #if SANITIZER_INTERCEPT_GETPWENT INTERCEPTOR(__sanitizer_passwd *, getpwent, int dummy) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwent, dummy); __sanitizer_passwd *res = REAL(getpwent)(dummy); if (res) unpoison_passwd(ctx, res); return res; } INTERCEPTOR(__sanitizer_group *, getgrent, int dummy) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgrent, dummy); __sanitizer_group *res = REAL(getgrent)(dummy); if (res) unpoison_group(ctx, res);; return res; } #define INIT_GETPWENT \ COMMON_INTERCEPT_FUNCTION(getpwent); \ COMMON_INTERCEPT_FUNCTION(getgrent); #else #define INIT_GETPWENT #endif #if SANITIZER_INTERCEPT_FGETPWENT INTERCEPTOR(__sanitizer_passwd *, fgetpwent, void *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fgetpwent, fp); __sanitizer_passwd *res = REAL(fgetpwent)(fp); if (res) unpoison_passwd(ctx, res); return res; } INTERCEPTOR(__sanitizer_group *, fgetgrent, void *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fgetgrent, fp); __sanitizer_group *res = REAL(fgetgrent)(fp); if (res) unpoison_group(ctx, res); return res; } #define INIT_FGETPWENT \ COMMON_INTERCEPT_FUNCTION(fgetpwent); \ COMMON_INTERCEPT_FUNCTION(fgetgrent); #else #define INIT_FGETPWENT #endif #if SANITIZER_INTERCEPT_GETPWENT_R INTERCEPTOR(int, getpwent_r, __sanitizer_passwd *pwbuf, char *buf, SIZE_T buflen, __sanitizer_passwd **pwbufp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwent_r, pwbuf, buf, buflen, pwbufp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getpwent_r)(pwbuf, buf, buflen, pwbufp); if (!res) { if (pwbufp && *pwbufp) unpoison_passwd(ctx, *pwbufp); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp)); return res; } INTERCEPTOR(int, fgetpwent_r, void *fp, __sanitizer_passwd *pwbuf, char *buf, SIZE_T buflen, __sanitizer_passwd **pwbufp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fgetpwent_r, fp, pwbuf, buf, buflen, pwbufp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(fgetpwent_r)(fp, pwbuf, buf, buflen, pwbufp); if (!res) { if (pwbufp && *pwbufp) unpoison_passwd(ctx, *pwbufp); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp)); return res; } INTERCEPTOR(int, getgrent_r, __sanitizer_group *pwbuf, char *buf, SIZE_T buflen, __sanitizer_group **pwbufp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgrent_r, pwbuf, buf, buflen, pwbufp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getgrent_r)(pwbuf, buf, buflen, pwbufp); if (!res) { if (pwbufp && *pwbufp) unpoison_group(ctx, *pwbufp); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp)); return res; } INTERCEPTOR(int, fgetgrent_r, void *fp, __sanitizer_group *pwbuf, char *buf, SIZE_T buflen, __sanitizer_group **pwbufp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fgetgrent_r, fp, pwbuf, buf, buflen, pwbufp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(fgetgrent_r)(fp, pwbuf, buf, buflen, pwbufp); if (!res) { if (pwbufp && *pwbufp) unpoison_group(ctx, *pwbufp); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen); } if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp)); return res; } #define INIT_GETPWENT_R \ COMMON_INTERCEPT_FUNCTION(getpwent_r); \ COMMON_INTERCEPT_FUNCTION(fgetpwent_r); \ COMMON_INTERCEPT_FUNCTION(getgrent_r); \ COMMON_INTERCEPT_FUNCTION(fgetgrent_r); #else #define INIT_GETPWENT_R #endif #if SANITIZER_INTERCEPT_SETPWENT // The only thing these interceptors do is disable any nested interceptors. // These functions may open nss modules and call uninstrumented functions from // them, and we don't want things like strlen() to trigger. INTERCEPTOR(void, setpwent, int dummy) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, setpwent, dummy); REAL(setpwent)(dummy); } INTERCEPTOR(void, endpwent, int dummy) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, endpwent, dummy); REAL(endpwent)(dummy); } INTERCEPTOR(void, setgrent, int dummy) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, setgrent, dummy); REAL(setgrent)(dummy); } INTERCEPTOR(void, endgrent, int dummy) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, endgrent, dummy); REAL(endgrent)(dummy); } #define INIT_SETPWENT \ COMMON_INTERCEPT_FUNCTION(setpwent); \ COMMON_INTERCEPT_FUNCTION(endpwent); \ COMMON_INTERCEPT_FUNCTION(setgrent); \ COMMON_INTERCEPT_FUNCTION(endgrent); #else #define INIT_SETPWENT #endif #if SANITIZER_INTERCEPT_CLOCK_GETTIME INTERCEPTOR(int, clock_getres, u32 clk_id, void *tp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, clock_getres, clk_id, tp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(clock_getres)(clk_id, tp); if (!res && tp) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, tp, struct_timespec_sz); } return res; } INTERCEPTOR(int, clock_gettime, u32 clk_id, void *tp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, clock_gettime, clk_id, tp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(clock_gettime)(clk_id, tp); if (!res) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, tp, struct_timespec_sz); } return res; } INTERCEPTOR(int, clock_settime, u32 clk_id, const void *tp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, clock_settime, clk_id, tp); COMMON_INTERCEPTOR_READ_RANGE(ctx, tp, struct_timespec_sz); return REAL(clock_settime)(clk_id, tp); } #define INIT_CLOCK_GETTIME \ COMMON_INTERCEPT_FUNCTION(clock_getres); \ COMMON_INTERCEPT_FUNCTION(clock_gettime); \ COMMON_INTERCEPT_FUNCTION(clock_settime); #else #define INIT_CLOCK_GETTIME #endif #if SANITIZER_INTERCEPT_GETITIMER INTERCEPTOR(int, getitimer, int which, void *curr_value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getitimer, which, curr_value); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getitimer)(which, curr_value); if (!res && curr_value) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, curr_value, struct_itimerval_sz); } return res; } INTERCEPTOR(int, setitimer, int which, const void *new_value, void *old_value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, setitimer, which, new_value, old_value); if (new_value) COMMON_INTERCEPTOR_READ_RANGE(ctx, new_value, struct_itimerval_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(setitimer)(which, new_value, old_value); if (!res && old_value) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, old_value, struct_itimerval_sz); } return res; } #define INIT_GETITIMER \ COMMON_INTERCEPT_FUNCTION(getitimer); \ COMMON_INTERCEPT_FUNCTION(setitimer); #else #define INIT_GETITIMER #endif #if SANITIZER_INTERCEPT_GLOB static void unpoison_glob_t(void *ctx, __sanitizer_glob_t *pglob) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pglob, sizeof(*pglob)); // +1 for NULL pointer at the end. if (pglob->gl_pathv) COMMON_INTERCEPTOR_WRITE_RANGE( ctx, pglob->gl_pathv, (pglob->gl_pathc + 1) * sizeof(*pglob->gl_pathv)); for (SIZE_T i = 0; i < pglob->gl_pathc; ++i) { char *p = pglob->gl_pathv[i]; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, REAL(strlen)(p) + 1); } } static THREADLOCAL __sanitizer_glob_t *pglob_copy; static void wrapped_gl_closedir(void *dir) { COMMON_INTERCEPTOR_UNPOISON_PARAM(1); pglob_copy->gl_closedir(dir); } static void *wrapped_gl_readdir(void *dir) { COMMON_INTERCEPTOR_UNPOISON_PARAM(1); return pglob_copy->gl_readdir(dir); } static void *wrapped_gl_opendir(const char *s) { COMMON_INTERCEPTOR_UNPOISON_PARAM(1); COMMON_INTERCEPTOR_INITIALIZE_RANGE(s, REAL(strlen)(s) + 1); return pglob_copy->gl_opendir(s); } static int wrapped_gl_lstat(const char *s, void *st) { COMMON_INTERCEPTOR_UNPOISON_PARAM(2); COMMON_INTERCEPTOR_INITIALIZE_RANGE(s, REAL(strlen)(s) + 1); return pglob_copy->gl_lstat(s, st); } static int wrapped_gl_stat(const char *s, void *st) { COMMON_INTERCEPTOR_UNPOISON_PARAM(2); COMMON_INTERCEPTOR_INITIALIZE_RANGE(s, REAL(strlen)(s) + 1); return pglob_copy->gl_stat(s, st); } static const __sanitizer_glob_t kGlobCopy = { 0, 0, 0, 0, wrapped_gl_closedir, wrapped_gl_readdir, wrapped_gl_opendir, wrapped_gl_lstat, wrapped_gl_stat}; INTERCEPTOR(int, glob, const char *pattern, int flags, int (*errfunc)(const char *epath, int eerrno), __sanitizer_glob_t *pglob) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, glob, pattern, flags, errfunc, pglob); COMMON_INTERCEPTOR_READ_STRING(ctx, pattern, 0); __sanitizer_glob_t glob_copy; internal_memcpy(&glob_copy, &kGlobCopy, sizeof(glob_copy)); if (flags & glob_altdirfunc) { Swap(pglob->gl_closedir, glob_copy.gl_closedir); Swap(pglob->gl_readdir, glob_copy.gl_readdir); Swap(pglob->gl_opendir, glob_copy.gl_opendir); Swap(pglob->gl_lstat, glob_copy.gl_lstat); Swap(pglob->gl_stat, glob_copy.gl_stat); pglob_copy = &glob_copy; } int res = REAL(glob)(pattern, flags, errfunc, pglob); if (flags & glob_altdirfunc) { Swap(pglob->gl_closedir, glob_copy.gl_closedir); Swap(pglob->gl_readdir, glob_copy.gl_readdir); Swap(pglob->gl_opendir, glob_copy.gl_opendir); Swap(pglob->gl_lstat, glob_copy.gl_lstat); Swap(pglob->gl_stat, glob_copy.gl_stat); } pglob_copy = 0; if ((!res || res == glob_nomatch) && pglob) unpoison_glob_t(ctx, pglob); return res; } INTERCEPTOR(int, glob64, const char *pattern, int flags, int (*errfunc)(const char *epath, int eerrno), __sanitizer_glob_t *pglob) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, glob64, pattern, flags, errfunc, pglob); COMMON_INTERCEPTOR_READ_STRING(ctx, pattern, 0); __sanitizer_glob_t glob_copy; internal_memcpy(&glob_copy, &kGlobCopy, sizeof(glob_copy)); if (flags & glob_altdirfunc) { Swap(pglob->gl_closedir, glob_copy.gl_closedir); Swap(pglob->gl_readdir, glob_copy.gl_readdir); Swap(pglob->gl_opendir, glob_copy.gl_opendir); Swap(pglob->gl_lstat, glob_copy.gl_lstat); Swap(pglob->gl_stat, glob_copy.gl_stat); pglob_copy = &glob_copy; } int res = REAL(glob64)(pattern, flags, errfunc, pglob); if (flags & glob_altdirfunc) { Swap(pglob->gl_closedir, glob_copy.gl_closedir); Swap(pglob->gl_readdir, glob_copy.gl_readdir); Swap(pglob->gl_opendir, glob_copy.gl_opendir); Swap(pglob->gl_lstat, glob_copy.gl_lstat); Swap(pglob->gl_stat, glob_copy.gl_stat); } pglob_copy = 0; if ((!res || res == glob_nomatch) && pglob) unpoison_glob_t(ctx, pglob); return res; } #define INIT_GLOB \ COMMON_INTERCEPT_FUNCTION(glob); \ COMMON_INTERCEPT_FUNCTION(glob64); #else // SANITIZER_INTERCEPT_GLOB #define INIT_GLOB #endif // SANITIZER_INTERCEPT_GLOB #if SANITIZER_INTERCEPT_WAIT // According to sys/wait.h, wait(), waitid(), waitpid() may have symbol version // suffixes on Darwin. See the declaration of INTERCEPTOR_WITH_SUFFIX for // details. INTERCEPTOR_WITH_SUFFIX(int, wait, int *status) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wait, status); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(wait)(status); if (res != -1 && status) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, status, sizeof(*status)); return res; } // On FreeBSD id_t is always 64-bit wide. #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) INTERCEPTOR_WITH_SUFFIX(int, waitid, int idtype, long long id, void *infop, int options) { #else INTERCEPTOR_WITH_SUFFIX(int, waitid, int idtype, int id, void *infop, int options) { #endif void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, waitid, idtype, id, infop, options); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(waitid)(idtype, id, infop, options); if (res != -1 && infop) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, infop, siginfo_t_sz); return res; } INTERCEPTOR_WITH_SUFFIX(int, waitpid, int pid, int *status, int options) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, waitpid, pid, status, options); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(waitpid)(pid, status, options); if (res != -1 && status) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, status, sizeof(*status)); return res; } INTERCEPTOR(int, wait3, int *status, int options, void *rusage) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wait3, status, options, rusage); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(wait3)(status, options, rusage); if (res != -1) { if (status) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, status, sizeof(*status)); if (rusage) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, rusage, struct_rusage_sz); } return res; } #if SANITIZER_ANDROID INTERCEPTOR(int, __wait4, int pid, int *status, int options, void *rusage) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __wait4, pid, status, options, rusage); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(__wait4)(pid, status, options, rusage); if (res != -1) { if (status) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, status, sizeof(*status)); if (rusage) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, rusage, struct_rusage_sz); } return res; } #define INIT_WAIT4 COMMON_INTERCEPT_FUNCTION(__wait4); #else INTERCEPTOR(int, wait4, int pid, int *status, int options, void *rusage) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wait4, pid, status, options, rusage); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(wait4)(pid, status, options, rusage); if (res != -1) { if (status) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, status, sizeof(*status)); if (rusage) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, rusage, struct_rusage_sz); } return res; } #define INIT_WAIT4 COMMON_INTERCEPT_FUNCTION(wait4); #endif // SANITIZER_ANDROID #define INIT_WAIT \ COMMON_INTERCEPT_FUNCTION(wait); \ COMMON_INTERCEPT_FUNCTION(waitid); \ COMMON_INTERCEPT_FUNCTION(waitpid); \ COMMON_INTERCEPT_FUNCTION(wait3); #else #define INIT_WAIT #define INIT_WAIT4 #endif #if SANITIZER_INTERCEPT_INET INTERCEPTOR(char *, inet_ntop, int af, const void *src, char *dst, u32 size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, inet_ntop, af, src, dst, size); uptr sz = __sanitizer_in_addr_sz(af); if (sz) COMMON_INTERCEPTOR_READ_RANGE(ctx, src, sz); // FIXME: figure out read size based on the address family. // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(inet_ntop)(af, src, dst, size); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } INTERCEPTOR(int, inet_pton, int af, const char *src, void *dst) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, inet_pton, af, src, dst); COMMON_INTERCEPTOR_READ_STRING(ctx, src, 0); // FIXME: figure out read size based on the address family. // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(inet_pton)(af, src, dst); if (res == 1) { uptr sz = __sanitizer_in_addr_sz(af); if (sz) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, sz); } return res; } #define INIT_INET \ COMMON_INTERCEPT_FUNCTION(inet_ntop); \ COMMON_INTERCEPT_FUNCTION(inet_pton); #else #define INIT_INET #endif #if SANITIZER_INTERCEPT_INET INTERCEPTOR(int, inet_aton, const char *cp, void *dst) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, inet_aton, cp, dst); if (cp) COMMON_INTERCEPTOR_READ_RANGE(ctx, cp, REAL(strlen)(cp) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(inet_aton)(cp, dst); if (res != 0) { uptr sz = __sanitizer_in_addr_sz(af_inet); if (sz) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dst, sz); } return res; } #define INIT_INET_ATON COMMON_INTERCEPT_FUNCTION(inet_aton); #else #define INIT_INET_ATON #endif #if SANITIZER_INTERCEPT_PTHREAD_GETSCHEDPARAM INTERCEPTOR(int, pthread_getschedparam, uptr thread, int *policy, int *param) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_getschedparam, thread, policy, param); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(pthread_getschedparam)(thread, policy, param); if (res == 0) { if (policy) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, policy, sizeof(*policy)); if (param) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, param, sizeof(*param)); } return res; } #define INIT_PTHREAD_GETSCHEDPARAM \ COMMON_INTERCEPT_FUNCTION(pthread_getschedparam); #else #define INIT_PTHREAD_GETSCHEDPARAM #endif #if SANITIZER_INTERCEPT_GETADDRINFO INTERCEPTOR(int, getaddrinfo, char *node, char *service, struct __sanitizer_addrinfo *hints, struct __sanitizer_addrinfo **out) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getaddrinfo, node, service, hints, out); if (node) COMMON_INTERCEPTOR_READ_RANGE(ctx, node, REAL(strlen)(node) + 1); if (service) COMMON_INTERCEPTOR_READ_RANGE(ctx, service, REAL(strlen)(service) + 1); if (hints) COMMON_INTERCEPTOR_READ_RANGE(ctx, hints, sizeof(__sanitizer_addrinfo)); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getaddrinfo)(node, service, hints, out); if (res == 0 && out) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, out, sizeof(*out)); struct __sanitizer_addrinfo *p = *out; while (p) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, sizeof(*p)); if (p->ai_addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->ai_addr, p->ai_addrlen); if (p->ai_canonname) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->ai_canonname, REAL(strlen)(p->ai_canonname) + 1); p = p->ai_next; } } return res; } #define INIT_GETADDRINFO COMMON_INTERCEPT_FUNCTION(getaddrinfo); #else #define INIT_GETADDRINFO #endif #if SANITIZER_INTERCEPT_GETNAMEINFO INTERCEPTOR(int, getnameinfo, void *sockaddr, unsigned salen, char *host, unsigned hostlen, char *serv, unsigned servlen, int flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getnameinfo, sockaddr, salen, host, hostlen, serv, servlen, flags); // FIXME: consider adding READ_RANGE(sockaddr, salen) // There is padding in in_addr that may make this too noisy // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getnameinfo)(sockaddr, salen, host, hostlen, serv, servlen, flags); if (res == 0) { if (host && hostlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, host, REAL(strlen)(host) + 1); if (serv && servlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, serv, REAL(strlen)(serv) + 1); } return res; } #define INIT_GETNAMEINFO COMMON_INTERCEPT_FUNCTION(getnameinfo); #else #define INIT_GETNAMEINFO #endif #if SANITIZER_INTERCEPT_GETSOCKNAME INTERCEPTOR(int, getsockname, int sock_fd, void *addr, int *addrlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getsockname, sock_fd, addr, addrlen); COMMON_INTERCEPTOR_READ_RANGE(ctx, addrlen, sizeof(*addrlen)); int addrlen_in = *addrlen; // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getsockname)(sock_fd, addr, addrlen); if (res == 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, Min(addrlen_in, *addrlen)); } return res; } #define INIT_GETSOCKNAME COMMON_INTERCEPT_FUNCTION(getsockname); #else #define INIT_GETSOCKNAME #endif #if SANITIZER_INTERCEPT_GETHOSTBYNAME || SANITIZER_INTERCEPT_GETHOSTBYNAME_R static void write_hostent(void *ctx, struct __sanitizer_hostent *h) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, h, sizeof(__sanitizer_hostent)); if (h->h_name) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, h->h_name, REAL(strlen)(h->h_name) + 1); char **p = h->h_aliases; while (*p) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *p, REAL(strlen)(*p) + 1); ++p; } COMMON_INTERCEPTOR_WRITE_RANGE( ctx, h->h_aliases, (p - h->h_aliases + 1) * sizeof(*h->h_aliases)); p = h->h_addr_list; while (*p) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *p, h->h_length); ++p; } COMMON_INTERCEPTOR_WRITE_RANGE( ctx, h->h_addr_list, (p - h->h_addr_list + 1) * sizeof(*h->h_addr_list)); } #endif #if SANITIZER_INTERCEPT_GETHOSTBYNAME INTERCEPTOR(struct __sanitizer_hostent *, gethostbyname, char *name) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostbyname, name); struct __sanitizer_hostent *res = REAL(gethostbyname)(name); if (res) write_hostent(ctx, res); return res; } INTERCEPTOR(struct __sanitizer_hostent *, gethostbyaddr, void *addr, int len, int type) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostbyaddr, addr, len, type); COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, len); struct __sanitizer_hostent *res = REAL(gethostbyaddr)(addr, len, type); if (res) write_hostent(ctx, res); return res; } INTERCEPTOR(struct __sanitizer_hostent *, gethostent, int fake) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostent, fake); struct __sanitizer_hostent *res = REAL(gethostent)(fake); if (res) write_hostent(ctx, res); return res; } INTERCEPTOR(struct __sanitizer_hostent *, gethostbyname2, char *name, int af) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostbyname2, name, af); struct __sanitizer_hostent *res = REAL(gethostbyname2)(name, af); if (res) write_hostent(ctx, res); return res; } #define INIT_GETHOSTBYNAME \ COMMON_INTERCEPT_FUNCTION(gethostent); \ COMMON_INTERCEPT_FUNCTION(gethostbyaddr); \ COMMON_INTERCEPT_FUNCTION(gethostbyname); \ COMMON_INTERCEPT_FUNCTION(gethostbyname2); #else #define INIT_GETHOSTBYNAME #endif #if SANITIZER_INTERCEPT_GETHOSTBYNAME_R INTERCEPTOR(int, gethostbyname_r, char *name, struct __sanitizer_hostent *ret, char *buf, SIZE_T buflen, __sanitizer_hostent **result, int *h_errnop) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostbyname_r, name, ret, buf, buflen, result, h_errnop); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(gethostbyname_r)(name, ret, buf, buflen, result, h_errnop); if (result) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); if (res == 0 && *result) write_hostent(ctx, *result); } if (h_errnop) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, h_errnop, sizeof(*h_errnop)); return res; } #define INIT_GETHOSTBYNAME_R COMMON_INTERCEPT_FUNCTION(gethostbyname_r); #else #define INIT_GETHOSTBYNAME_R #endif #if SANITIZER_INTERCEPT_GETHOSTENT_R INTERCEPTOR(int, gethostent_r, struct __sanitizer_hostent *ret, char *buf, SIZE_T buflen, __sanitizer_hostent **result, int *h_errnop) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostent_r, ret, buf, buflen, result, h_errnop); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(gethostent_r)(ret, buf, buflen, result, h_errnop); if (result) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); if (res == 0 && *result) write_hostent(ctx, *result); } if (h_errnop) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, h_errnop, sizeof(*h_errnop)); return res; } #define INIT_GETHOSTENT_R \ COMMON_INTERCEPT_FUNCTION(gethostent_r); #else #define INIT_GETHOSTENT_R #endif #if SANITIZER_INTERCEPT_GETHOSTBYADDR_R INTERCEPTOR(int, gethostbyaddr_r, void *addr, int len, int type, struct __sanitizer_hostent *ret, char *buf, SIZE_T buflen, __sanitizer_hostent **result, int *h_errnop) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostbyaddr_r, addr, len, type, ret, buf, buflen, result, h_errnop); COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, len); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(gethostbyaddr_r)(addr, len, type, ret, buf, buflen, result, h_errnop); if (result) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); if (res == 0 && *result) write_hostent(ctx, *result); } if (h_errnop) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, h_errnop, sizeof(*h_errnop)); return res; } #define INIT_GETHOSTBYADDR_R \ COMMON_INTERCEPT_FUNCTION(gethostbyaddr_r); #else #define INIT_GETHOSTBYADDR_R #endif #if SANITIZER_INTERCEPT_GETHOSTBYNAME2_R INTERCEPTOR(int, gethostbyname2_r, char *name, int af, struct __sanitizer_hostent *ret, char *buf, SIZE_T buflen, __sanitizer_hostent **result, int *h_errnop) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, gethostbyname2_r, name, af, ret, buf, buflen, result, h_errnop); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(gethostbyname2_r)(name, af, ret, buf, buflen, result, h_errnop); if (result) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); if (res == 0 && *result) write_hostent(ctx, *result); } if (h_errnop) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, h_errnop, sizeof(*h_errnop)); return res; } #define INIT_GETHOSTBYNAME2_R \ COMMON_INTERCEPT_FUNCTION(gethostbyname2_r); #else #define INIT_GETHOSTBYNAME2_R #endif #if SANITIZER_INTERCEPT_GETSOCKOPT INTERCEPTOR(int, getsockopt, int sockfd, int level, int optname, void *optval, int *optlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getsockopt, sockfd, level, optname, optval, optlen); if (optlen) COMMON_INTERCEPTOR_READ_RANGE(ctx, optlen, sizeof(*optlen)); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getsockopt)(sockfd, level, optname, optval, optlen); if (res == 0) if (optval && optlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, optval, *optlen); return res; } #define INIT_GETSOCKOPT COMMON_INTERCEPT_FUNCTION(getsockopt); #else #define INIT_GETSOCKOPT #endif #if SANITIZER_INTERCEPT_ACCEPT INTERCEPTOR(int, accept, int fd, void *addr, unsigned *addrlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, accept, fd, addr, addrlen); unsigned addrlen0 = 0; if (addrlen) { COMMON_INTERCEPTOR_READ_RANGE(ctx, addrlen, sizeof(*addrlen)); addrlen0 = *addrlen; } int fd2 = REAL(accept)(fd, addr, addrlen); if (fd2 >= 0) { if (fd >= 0) COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, fd2); if (addr && addrlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, Min(*addrlen, addrlen0)); } return fd2; } #define INIT_ACCEPT COMMON_INTERCEPT_FUNCTION(accept); #else #define INIT_ACCEPT #endif #if SANITIZER_INTERCEPT_ACCEPT4 INTERCEPTOR(int, accept4, int fd, void *addr, unsigned *addrlen, int f) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, accept4, fd, addr, addrlen, f); unsigned addrlen0 = 0; if (addrlen) { COMMON_INTERCEPTOR_READ_RANGE(ctx, addrlen, sizeof(*addrlen)); addrlen0 = *addrlen; } // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int fd2 = REAL(accept4)(fd, addr, addrlen, f); if (fd2 >= 0) { if (fd >= 0) COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, fd2); if (addr && addrlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, Min(*addrlen, addrlen0)); } return fd2; } #define INIT_ACCEPT4 COMMON_INTERCEPT_FUNCTION(accept4); #else #define INIT_ACCEPT4 #endif #if SANITIZER_INTERCEPT_MODF INTERCEPTOR(double, modf, double x, double *iptr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, modf, x, iptr); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. double res = REAL(modf)(x, iptr); if (iptr) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iptr, sizeof(*iptr)); } return res; } INTERCEPTOR(float, modff, float x, float *iptr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, modff, x, iptr); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. float res = REAL(modff)(x, iptr); if (iptr) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iptr, sizeof(*iptr)); } return res; } INTERCEPTOR(long double, modfl, long double x, long double *iptr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, modfl, x, iptr); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. long double res = REAL(modfl)(x, iptr); if (iptr) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iptr, sizeof(*iptr)); } return res; } #define INIT_MODF \ COMMON_INTERCEPT_FUNCTION(modf); \ COMMON_INTERCEPT_FUNCTION(modff); \ COMMON_INTERCEPT_FUNCTION_LDBL(modfl); #else #define INIT_MODF #endif #if SANITIZER_INTERCEPT_RECVMSG static void write_msghdr(void *ctx, struct __sanitizer_msghdr *msg, SSIZE_T maxlen) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, msg, sizeof(*msg)); if (msg->msg_name && msg->msg_namelen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, msg->msg_name, msg->msg_namelen); if (msg->msg_iov && msg->msg_iovlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, msg->msg_iov, sizeof(*msg->msg_iov) * msg->msg_iovlen); write_iovec(ctx, msg->msg_iov, msg->msg_iovlen, maxlen); if (msg->msg_control && msg->msg_controllen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, msg->msg_control, msg->msg_controllen); } INTERCEPTOR(SSIZE_T, recvmsg, int fd, struct __sanitizer_msghdr *msg, int flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, recvmsg, fd, msg, flags); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(recvmsg)(fd, msg, flags); if (res >= 0) { if (fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); if (msg) { write_msghdr(ctx, msg, res); COMMON_INTERCEPTOR_HANDLE_RECVMSG(ctx, msg); } } return res; } #define INIT_RECVMSG COMMON_INTERCEPT_FUNCTION(recvmsg); #else #define INIT_RECVMSG #endif #if SANITIZER_INTERCEPT_SENDMSG static void read_msghdr_control(void *ctx, void *control, uptr controllen) { const unsigned kCmsgDataOffset = RoundUpTo(sizeof(__sanitizer_cmsghdr), sizeof(uptr)); char *p = (char *)control; char *const control_end = p + controllen; while (true) { if (p + sizeof(__sanitizer_cmsghdr) > control_end) break; __sanitizer_cmsghdr *cmsg = (__sanitizer_cmsghdr *)p; COMMON_INTERCEPTOR_READ_RANGE(ctx, &cmsg->cmsg_len, sizeof(cmsg->cmsg_len)); if (p + RoundUpTo(cmsg->cmsg_len, sizeof(uptr)) > control_end) break; COMMON_INTERCEPTOR_READ_RANGE(ctx, &cmsg->cmsg_level, sizeof(cmsg->cmsg_level)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &cmsg->cmsg_type, sizeof(cmsg->cmsg_type)); if (cmsg->cmsg_len > kCmsgDataOffset) { char *data = p + kCmsgDataOffset; unsigned data_len = cmsg->cmsg_len - kCmsgDataOffset; if (data_len > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, data, data_len); } p += RoundUpTo(cmsg->cmsg_len, sizeof(uptr)); } } static void read_msghdr(void *ctx, struct __sanitizer_msghdr *msg, SSIZE_T maxlen) { #define R(f) \ COMMON_INTERCEPTOR_READ_RANGE(ctx, &msg->msg_##f, sizeof(msg->msg_##f)) R(name); R(namelen); R(iov); R(iovlen); R(control); R(controllen); R(flags); #undef R if (msg->msg_name && msg->msg_namelen) COMMON_INTERCEPTOR_READ_RANGE(ctx, msg->msg_name, msg->msg_namelen); if (msg->msg_iov && msg->msg_iovlen) COMMON_INTERCEPTOR_READ_RANGE(ctx, msg->msg_iov, sizeof(*msg->msg_iov) * msg->msg_iovlen); read_iovec(ctx, msg->msg_iov, msg->msg_iovlen, maxlen); if (msg->msg_control && msg->msg_controllen) read_msghdr_control(ctx, msg->msg_control, msg->msg_controllen); } INTERCEPTOR(SSIZE_T, sendmsg, int fd, struct __sanitizer_msghdr *msg, int flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sendmsg, fd, msg, flags); if (fd >= 0) { COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); } SSIZE_T res = REAL(sendmsg)(fd, msg, flags); if (common_flags()->intercept_send && res >= 0 && msg) read_msghdr(ctx, msg, res); return res; } #define INIT_SENDMSG COMMON_INTERCEPT_FUNCTION(sendmsg); #else #define INIT_SENDMSG #endif #if SANITIZER_INTERCEPT_GETPEERNAME INTERCEPTOR(int, getpeername, int sockfd, void *addr, unsigned *addrlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpeername, sockfd, addr, addrlen); unsigned addr_sz; if (addrlen) addr_sz = *addrlen; // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getpeername)(sockfd, addr, addrlen); if (!res && addr && addrlen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, Min(addr_sz, *addrlen)); return res; } #define INIT_GETPEERNAME COMMON_INTERCEPT_FUNCTION(getpeername); #else #define INIT_GETPEERNAME #endif #if SANITIZER_INTERCEPT_SYSINFO INTERCEPTOR(int, sysinfo, void *info) { void *ctx; // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. COMMON_INTERCEPTOR_ENTER(ctx, sysinfo, info); int res = REAL(sysinfo)(info); if (!res && info) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, info, struct_sysinfo_sz); return res; } #define INIT_SYSINFO COMMON_INTERCEPT_FUNCTION(sysinfo); #else #define INIT_SYSINFO #endif #if SANITIZER_INTERCEPT_READDIR INTERCEPTOR(__sanitizer_dirent *, opendir, const char *path) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, opendir, path); COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); __sanitizer_dirent *res = REAL(opendir)(path); if (res) COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path); return res; } INTERCEPTOR(__sanitizer_dirent *, readdir, void *dirp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, readdir, dirp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. __sanitizer_dirent *res = REAL(readdir)(dirp); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, res->d_reclen); return res; } INTERCEPTOR(int, readdir_r, void *dirp, __sanitizer_dirent *entry, __sanitizer_dirent **result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, readdir_r, dirp, entry, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(readdir_r)(dirp, entry, result); if (!res) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); if (*result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *result, (*result)->d_reclen); } return res; } #define INIT_READDIR \ COMMON_INTERCEPT_FUNCTION(opendir); \ COMMON_INTERCEPT_FUNCTION(readdir); \ COMMON_INTERCEPT_FUNCTION(readdir_r); #else #define INIT_READDIR #endif #if SANITIZER_INTERCEPT_READDIR64 INTERCEPTOR(__sanitizer_dirent64 *, readdir64, void *dirp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, readdir64, dirp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. __sanitizer_dirent64 *res = REAL(readdir64)(dirp); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, res->d_reclen); return res; } INTERCEPTOR(int, readdir64_r, void *dirp, __sanitizer_dirent64 *entry, __sanitizer_dirent64 **result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, readdir64_r, dirp, entry, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(readdir64_r)(dirp, entry, result); if (!res) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); if (*result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *result, (*result)->d_reclen); } return res; } #define INIT_READDIR64 \ COMMON_INTERCEPT_FUNCTION(readdir64); \ COMMON_INTERCEPT_FUNCTION(readdir64_r); #else #define INIT_READDIR64 #endif #if SANITIZER_INTERCEPT_PTRACE INTERCEPTOR(uptr, ptrace, int request, int pid, void *addr, void *data) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ptrace, request, pid, addr, data); __sanitizer_iovec local_iovec; if (data) { if (request == ptrace_setregs) COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_regs_struct_sz); else if (request == ptrace_setfpregs) COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_fpregs_struct_sz); else if (request == ptrace_setfpxregs) COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_fpxregs_struct_sz); else if (request == ptrace_setvfpregs) COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_vfpregs_struct_sz); else if (request == ptrace_setsiginfo) COMMON_INTERCEPTOR_READ_RANGE(ctx, data, siginfo_t_sz); // Some kernel might zero the iovec::iov_base in case of invalid // write access. In this case copy the invalid address for further // inspection. else if (request == ptrace_setregset || request == ptrace_getregset) { __sanitizer_iovec *iovec = (__sanitizer_iovec*)data; COMMON_INTERCEPTOR_READ_RANGE(ctx, iovec, sizeof(*iovec)); local_iovec = *iovec; if (request == ptrace_setregset) COMMON_INTERCEPTOR_READ_RANGE(ctx, iovec->iov_base, iovec->iov_len); } } // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. uptr res = REAL(ptrace)(request, pid, addr, data); if (!res && data) { // Note that PEEK* requests assign different meaning to the return value. // This function does not handle them (nor does it need to). if (request == ptrace_getregs) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_regs_struct_sz); else if (request == ptrace_getfpregs) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_fpregs_struct_sz); else if (request == ptrace_getfpxregs) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_fpxregs_struct_sz); else if (request == ptrace_getvfpregs) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_vfpregs_struct_sz); else if (request == ptrace_getsiginfo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, siginfo_t_sz); else if (request == ptrace_geteventmsg) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, sizeof(unsigned long)); else if (request == ptrace_getregset) { __sanitizer_iovec *iovec = (__sanitizer_iovec*)data; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iovec, sizeof(*iovec)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, local_iovec.iov_base, local_iovec.iov_len); } } return res; } #define INIT_PTRACE COMMON_INTERCEPT_FUNCTION(ptrace); #else #define INIT_PTRACE #endif #if SANITIZER_INTERCEPT_SETLOCALE INTERCEPTOR(char *, setlocale, int category, char *locale) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, setlocale, category, locale); if (locale) COMMON_INTERCEPTOR_READ_RANGE(ctx, locale, REAL(strlen)(locale) + 1); char *res = REAL(setlocale)(category, locale); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } #define INIT_SETLOCALE COMMON_INTERCEPT_FUNCTION(setlocale); #else #define INIT_SETLOCALE #endif #if SANITIZER_INTERCEPT_GETCWD INTERCEPTOR(char *, getcwd, char *buf, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getcwd, buf, size); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(getcwd)(buf, size); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } #define INIT_GETCWD COMMON_INTERCEPT_FUNCTION(getcwd); #else #define INIT_GETCWD #endif #if SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME INTERCEPTOR(char *, get_current_dir_name, int fake) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, get_current_dir_name, fake); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(get_current_dir_name)(fake); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } #define INIT_GET_CURRENT_DIR_NAME \ COMMON_INTERCEPT_FUNCTION(get_current_dir_name); #else #define INIT_GET_CURRENT_DIR_NAME #endif UNUSED static inline void FixRealStrtolEndptr(const char *nptr, char **endptr) { CHECK(endptr); if (nptr == *endptr) { // No digits were found at strtol call, we need to find out the last // symbol accessed by strtoll on our own. // We get this symbol by skipping leading blanks and optional +/- sign. while (IsSpace(*nptr)) nptr++; if (*nptr == '+' || *nptr == '-') nptr++; *endptr = const_cast(nptr); } CHECK(*endptr >= nptr); } UNUSED static inline void StrtolFixAndCheck(void *ctx, const char *nptr, char **endptr, char *real_endptr, int base) { if (endptr) { *endptr = real_endptr; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, endptr, sizeof(*endptr)); } // If base has unsupported value, strtol can exit with EINVAL // without reading any characters. So do additional checks only // if base is valid. bool is_valid_base = (base == 0) || (2 <= base && base <= 36); if (is_valid_base) { FixRealStrtolEndptr(nptr, &real_endptr); } COMMON_INTERCEPTOR_READ_STRING(ctx, nptr, is_valid_base ? (real_endptr - nptr) + 1 : 0); } #if SANITIZER_INTERCEPT_STRTOIMAX INTERCEPTOR(INTMAX_T, strtoimax, const char *nptr, char **endptr, int base) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strtoimax, nptr, endptr, base); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *real_endptr; INTMAX_T res = REAL(strtoimax)(nptr, &real_endptr, base); StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base); return res; } INTERCEPTOR(INTMAX_T, strtoumax, const char *nptr, char **endptr, int base) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strtoumax, nptr, endptr, base); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *real_endptr; INTMAX_T res = REAL(strtoumax)(nptr, &real_endptr, base); StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base); return res; } #define INIT_STRTOIMAX \ COMMON_INTERCEPT_FUNCTION(strtoimax); \ COMMON_INTERCEPT_FUNCTION(strtoumax); #else #define INIT_STRTOIMAX #endif #if SANITIZER_INTERCEPT_MBSTOWCS INTERCEPTOR(SIZE_T, mbstowcs, wchar_t *dest, const char *src, SIZE_T len) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mbstowcs, dest, src, len); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(mbstowcs)(dest, src, len); if (res != (SIZE_T) - 1 && dest) { SIZE_T write_cnt = res + (res < len); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt * sizeof(wchar_t)); } return res; } INTERCEPTOR(SIZE_T, mbsrtowcs, wchar_t *dest, const char **src, SIZE_T len, void *ps) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mbsrtowcs, dest, src, len, ps); if (src) COMMON_INTERCEPTOR_READ_RANGE(ctx, src, sizeof(*src)); if (ps) COMMON_INTERCEPTOR_READ_RANGE(ctx, ps, mbstate_t_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(mbsrtowcs)(dest, src, len, ps); if (res != (SIZE_T)(-1) && dest && src) { // This function, and several others, may or may not write the terminating // \0 character. They write it iff they clear *src. SIZE_T write_cnt = res + !*src; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt * sizeof(wchar_t)); } return res; } #define INIT_MBSTOWCS \ COMMON_INTERCEPT_FUNCTION(mbstowcs); \ COMMON_INTERCEPT_FUNCTION(mbsrtowcs); #else #define INIT_MBSTOWCS #endif #if SANITIZER_INTERCEPT_MBSNRTOWCS INTERCEPTOR(SIZE_T, mbsnrtowcs, wchar_t *dest, const char **src, SIZE_T nms, SIZE_T len, void *ps) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mbsnrtowcs, dest, src, nms, len, ps); if (src) { COMMON_INTERCEPTOR_READ_RANGE(ctx, src, sizeof(*src)); if (nms) COMMON_INTERCEPTOR_READ_RANGE(ctx, *src, nms); } if (ps) COMMON_INTERCEPTOR_READ_RANGE(ctx, ps, mbstate_t_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(mbsnrtowcs)(dest, src, nms, len, ps); if (res != (SIZE_T)(-1) && dest && src) { SIZE_T write_cnt = res + !*src; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt * sizeof(wchar_t)); } return res; } #define INIT_MBSNRTOWCS COMMON_INTERCEPT_FUNCTION(mbsnrtowcs); #else #define INIT_MBSNRTOWCS #endif #if SANITIZER_INTERCEPT_WCSTOMBS INTERCEPTOR(SIZE_T, wcstombs, char *dest, const wchar_t *src, SIZE_T len) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wcstombs, dest, src, len); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(wcstombs)(dest, src, len); if (res != (SIZE_T) - 1 && dest) { SIZE_T write_cnt = res + (res < len); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt); } return res; } INTERCEPTOR(SIZE_T, wcsrtombs, char *dest, const wchar_t **src, SIZE_T len, void *ps) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wcsrtombs, dest, src, len, ps); if (src) COMMON_INTERCEPTOR_READ_RANGE(ctx, src, sizeof(*src)); if (ps) COMMON_INTERCEPTOR_READ_RANGE(ctx, ps, mbstate_t_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(wcsrtombs)(dest, src, len, ps); if (res != (SIZE_T) - 1 && dest && src) { SIZE_T write_cnt = res + !*src; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt); } return res; } #define INIT_WCSTOMBS \ COMMON_INTERCEPT_FUNCTION(wcstombs); \ COMMON_INTERCEPT_FUNCTION(wcsrtombs); #else #define INIT_WCSTOMBS #endif #if SANITIZER_INTERCEPT_WCSNRTOMBS INTERCEPTOR(SIZE_T, wcsnrtombs, char *dest, const wchar_t **src, SIZE_T nms, SIZE_T len, void *ps) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wcsnrtombs, dest, src, nms, len, ps); if (src) { COMMON_INTERCEPTOR_READ_RANGE(ctx, src, sizeof(*src)); if (nms) COMMON_INTERCEPTOR_READ_RANGE(ctx, *src, nms); } if (ps) COMMON_INTERCEPTOR_READ_RANGE(ctx, ps, mbstate_t_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(wcsnrtombs)(dest, src, nms, len, ps); if (res != ((SIZE_T)-1) && dest && src) { SIZE_T write_cnt = res + !*src; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt); } return res; } #define INIT_WCSNRTOMBS COMMON_INTERCEPT_FUNCTION(wcsnrtombs); #else #define INIT_WCSNRTOMBS #endif #if SANITIZER_INTERCEPT_WCRTOMB INTERCEPTOR(SIZE_T, wcrtomb, char *dest, wchar_t src, void *ps) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wcrtomb, dest, src, ps); if (ps) COMMON_INTERCEPTOR_READ_RANGE(ctx, ps, mbstate_t_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(wcrtomb)(dest, src, ps); if (res != ((SIZE_T)-1) && dest) { SIZE_T write_cnt = res; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, write_cnt); } return res; } #define INIT_WCRTOMB COMMON_INTERCEPT_FUNCTION(wcrtomb); #else #define INIT_WCRTOMB #endif #if SANITIZER_INTERCEPT_TCGETATTR INTERCEPTOR(int, tcgetattr, int fd, void *termios_p) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, tcgetattr, fd, termios_p); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(tcgetattr)(fd, termios_p); if (!res && termios_p) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, termios_p, struct_termios_sz); return res; } #define INIT_TCGETATTR COMMON_INTERCEPT_FUNCTION(tcgetattr); #else #define INIT_TCGETATTR #endif #if SANITIZER_INTERCEPT_REALPATH INTERCEPTOR(char *, realpath, const char *path, char *resolved_path) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, realpath, path, resolved_path); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // Workaround a bug in glibc where dlsym(RTLD_NEXT, ...) returns the oldest // version of a versioned symbol. For realpath(), this gives us something // (called __old_realpath) that does not handle NULL in the second argument. // Handle it as part of the interceptor. char *allocated_path = nullptr; if (!resolved_path) allocated_path = resolved_path = (char *)WRAP(malloc)(path_max + 1); char *res = REAL(realpath)(path, resolved_path); if (allocated_path && !res) WRAP(free)(allocated_path); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } #define INIT_REALPATH COMMON_INTERCEPT_FUNCTION(realpath); #else #define INIT_REALPATH #endif #if SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME INTERCEPTOR(char *, canonicalize_file_name, const char *path) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, canonicalize_file_name, path); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); char *res = REAL(canonicalize_file_name)(path); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } #define INIT_CANONICALIZE_FILE_NAME \ COMMON_INTERCEPT_FUNCTION(canonicalize_file_name); #else #define INIT_CANONICALIZE_FILE_NAME #endif #if SANITIZER_INTERCEPT_CONFSTR INTERCEPTOR(SIZE_T, confstr, int name, char *buf, SIZE_T len) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, confstr, name, buf, len); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(confstr)(name, buf, len); if (buf && res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, res < len ? res : len); return res; } #define INIT_CONFSTR COMMON_INTERCEPT_FUNCTION(confstr); #else #define INIT_CONFSTR #endif #if SANITIZER_INTERCEPT_SCHED_GETAFFINITY INTERCEPTOR(int, sched_getaffinity, int pid, SIZE_T cpusetsize, void *mask) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sched_getaffinity, pid, cpusetsize, mask); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sched_getaffinity)(pid, cpusetsize, mask); if (mask && !res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mask, cpusetsize); return res; } #define INIT_SCHED_GETAFFINITY COMMON_INTERCEPT_FUNCTION(sched_getaffinity); #else #define INIT_SCHED_GETAFFINITY #endif #if SANITIZER_INTERCEPT_SCHED_GETPARAM INTERCEPTOR(int, sched_getparam, int pid, void *param) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sched_getparam, pid, param); int res = REAL(sched_getparam)(pid, param); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, param, struct_sched_param_sz); return res; } #define INIT_SCHED_GETPARAM COMMON_INTERCEPT_FUNCTION(sched_getparam); #else #define INIT_SCHED_GETPARAM #endif #if SANITIZER_INTERCEPT_STRERROR INTERCEPTOR(char *, strerror, int errnum) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strerror, errnum); char *res = REAL(strerror)(errnum); if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1); return res; } #define INIT_STRERROR COMMON_INTERCEPT_FUNCTION(strerror); #else #define INIT_STRERROR #endif #if SANITIZER_INTERCEPT_STRERROR_R INTERCEPTOR(char *, strerror_r, int errnum, char *buf, SIZE_T buflen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, strerror_r, errnum, buf, buflen); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(strerror_r)(errnum, buf, buflen); // There are 2 versions of strerror_r: // * POSIX version returns 0 on success, negative error code on failure, // writes message to buf. // * GNU version returns message pointer, which points to either buf or some // static storage. SIZE_T posix_res = (SIZE_T)res; if (posix_res < 1024 || posix_res > (SIZE_T) - 1024) { // POSIX version. Spec is not clear on whether buf is NULL-terminated. // At least on OSX, buf contents are valid even when the call fails. SIZE_T sz = internal_strnlen(buf, buflen); if (sz < buflen) ++sz; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, sz); } else { // GNU version. COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); } return res; } #define INIT_STRERROR_R COMMON_INTERCEPT_FUNCTION(strerror_r); #else #define INIT_STRERROR_R #endif #if SANITIZER_INTERCEPT_XPG_STRERROR_R INTERCEPTOR(int, __xpg_strerror_r, int errnum, char *buf, SIZE_T buflen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __xpg_strerror_r, errnum, buf, buflen); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(__xpg_strerror_r)(errnum, buf, buflen); // This version always returns a null-terminated string. if (buf && buflen) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, REAL(strlen)(buf) + 1); return res; } #define INIT_XPG_STRERROR_R COMMON_INTERCEPT_FUNCTION(__xpg_strerror_r); #else #define INIT_XPG_STRERROR_R #endif #if SANITIZER_INTERCEPT_SCANDIR typedef int (*scandir_filter_f)(const struct __sanitizer_dirent *); typedef int (*scandir_compar_f)(const struct __sanitizer_dirent **, const struct __sanitizer_dirent **); static THREADLOCAL scandir_filter_f scandir_filter; static THREADLOCAL scandir_compar_f scandir_compar; static int wrapped_scandir_filter(const struct __sanitizer_dirent *dir) { COMMON_INTERCEPTOR_UNPOISON_PARAM(1); COMMON_INTERCEPTOR_INITIALIZE_RANGE(dir, dir->d_reclen); return scandir_filter(dir); } static int wrapped_scandir_compar(const struct __sanitizer_dirent **a, const struct __sanitizer_dirent **b) { COMMON_INTERCEPTOR_UNPOISON_PARAM(2); COMMON_INTERCEPTOR_INITIALIZE_RANGE(a, sizeof(*a)); COMMON_INTERCEPTOR_INITIALIZE_RANGE(*a, (*a)->d_reclen); COMMON_INTERCEPTOR_INITIALIZE_RANGE(b, sizeof(*b)); COMMON_INTERCEPTOR_INITIALIZE_RANGE(*b, (*b)->d_reclen); return scandir_compar(a, b); } INTERCEPTOR(int, scandir, char *dirp, __sanitizer_dirent ***namelist, scandir_filter_f filter, scandir_compar_f compar) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, scandir, dirp, namelist, filter, compar); if (dirp) COMMON_INTERCEPTOR_READ_RANGE(ctx, dirp, REAL(strlen)(dirp) + 1); scandir_filter = filter; scandir_compar = compar; // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(scandir)(dirp, namelist, filter ? wrapped_scandir_filter : nullptr, compar ? wrapped_scandir_compar : nullptr); scandir_filter = nullptr; scandir_compar = nullptr; if (namelist && res > 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, namelist, sizeof(*namelist)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *namelist, sizeof(**namelist) * res); for (int i = 0; i < res; ++i) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (*namelist)[i], (*namelist)[i]->d_reclen); } return res; } #define INIT_SCANDIR COMMON_INTERCEPT_FUNCTION(scandir); #else #define INIT_SCANDIR #endif #if SANITIZER_INTERCEPT_SCANDIR64 typedef int (*scandir64_filter_f)(const struct __sanitizer_dirent64 *); typedef int (*scandir64_compar_f)(const struct __sanitizer_dirent64 **, const struct __sanitizer_dirent64 **); static THREADLOCAL scandir64_filter_f scandir64_filter; static THREADLOCAL scandir64_compar_f scandir64_compar; static int wrapped_scandir64_filter(const struct __sanitizer_dirent64 *dir) { COMMON_INTERCEPTOR_UNPOISON_PARAM(1); COMMON_INTERCEPTOR_INITIALIZE_RANGE(dir, dir->d_reclen); return scandir64_filter(dir); } static int wrapped_scandir64_compar(const struct __sanitizer_dirent64 **a, const struct __sanitizer_dirent64 **b) { COMMON_INTERCEPTOR_UNPOISON_PARAM(2); COMMON_INTERCEPTOR_INITIALIZE_RANGE(a, sizeof(*a)); COMMON_INTERCEPTOR_INITIALIZE_RANGE(*a, (*a)->d_reclen); COMMON_INTERCEPTOR_INITIALIZE_RANGE(b, sizeof(*b)); COMMON_INTERCEPTOR_INITIALIZE_RANGE(*b, (*b)->d_reclen); return scandir64_compar(a, b); } INTERCEPTOR(int, scandir64, char *dirp, __sanitizer_dirent64 ***namelist, scandir64_filter_f filter, scandir64_compar_f compar) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, scandir64, dirp, namelist, filter, compar); if (dirp) COMMON_INTERCEPTOR_READ_RANGE(ctx, dirp, REAL(strlen)(dirp) + 1); scandir64_filter = filter; scandir64_compar = compar; // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(scandir64)(dirp, namelist, filter ? wrapped_scandir64_filter : nullptr, compar ? wrapped_scandir64_compar : nullptr); scandir64_filter = nullptr; scandir64_compar = nullptr; if (namelist && res > 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, namelist, sizeof(*namelist)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *namelist, sizeof(**namelist) * res); for (int i = 0; i < res; ++i) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (*namelist)[i], (*namelist)[i]->d_reclen); } return res; } #define INIT_SCANDIR64 COMMON_INTERCEPT_FUNCTION(scandir64); #else #define INIT_SCANDIR64 #endif #if SANITIZER_INTERCEPT_GETGROUPS INTERCEPTOR(int, getgroups, int size, u32 *lst) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getgroups, size, lst); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getgroups)(size, lst); if (res && lst) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, lst, res * sizeof(*lst)); return res; } #define INIT_GETGROUPS COMMON_INTERCEPT_FUNCTION(getgroups); #else #define INIT_GETGROUPS #endif #if SANITIZER_INTERCEPT_POLL static void read_pollfd(void *ctx, __sanitizer_pollfd *fds, __sanitizer_nfds_t nfds) { for (unsigned i = 0; i < nfds; ++i) { COMMON_INTERCEPTOR_READ_RANGE(ctx, &fds[i].fd, sizeof(fds[i].fd)); COMMON_INTERCEPTOR_READ_RANGE(ctx, &fds[i].events, sizeof(fds[i].events)); } } static void write_pollfd(void *ctx, __sanitizer_pollfd *fds, __sanitizer_nfds_t nfds) { for (unsigned i = 0; i < nfds; ++i) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &fds[i].revents, sizeof(fds[i].revents)); } INTERCEPTOR(int, poll, __sanitizer_pollfd *fds, __sanitizer_nfds_t nfds, int timeout) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, poll, fds, nfds, timeout); if (fds && nfds) read_pollfd(ctx, fds, nfds); int res = COMMON_INTERCEPTOR_BLOCK_REAL(poll)(fds, nfds, timeout); if (fds && nfds) write_pollfd(ctx, fds, nfds); return res; } #define INIT_POLL COMMON_INTERCEPT_FUNCTION(poll); #else #define INIT_POLL #endif #if SANITIZER_INTERCEPT_PPOLL INTERCEPTOR(int, ppoll, __sanitizer_pollfd *fds, __sanitizer_nfds_t nfds, void *timeout_ts, __sanitizer_sigset_t *sigmask) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ppoll, fds, nfds, timeout_ts, sigmask); if (fds && nfds) read_pollfd(ctx, fds, nfds); if (timeout_ts) COMMON_INTERCEPTOR_READ_RANGE(ctx, timeout_ts, struct_timespec_sz); // FIXME: read sigmask when all of sigemptyset, etc are intercepted. int res = COMMON_INTERCEPTOR_BLOCK_REAL(ppoll)(fds, nfds, timeout_ts, sigmask); if (fds && nfds) write_pollfd(ctx, fds, nfds); return res; } #define INIT_PPOLL COMMON_INTERCEPT_FUNCTION(ppoll); #else #define INIT_PPOLL #endif #if SANITIZER_INTERCEPT_WORDEXP INTERCEPTOR(int, wordexp, char *s, __sanitizer_wordexp_t *p, int flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, wordexp, s, p, flags); if (s) COMMON_INTERCEPTOR_READ_RANGE(ctx, s, REAL(strlen)(s) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(wordexp)(s, p, flags); if (!res && p) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, sizeof(*p)); if (p->we_wordc) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->we_wordv, sizeof(*p->we_wordv) * p->we_wordc); for (uptr i = 0; i < p->we_wordc; ++i) { char *w = p->we_wordv[i]; if (w) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, w, REAL(strlen)(w) + 1); } } return res; } #define INIT_WORDEXP COMMON_INTERCEPT_FUNCTION(wordexp); #else #define INIT_WORDEXP #endif #if SANITIZER_INTERCEPT_SIGWAIT INTERCEPTOR(int, sigwait, __sanitizer_sigset_t *set, int *sig) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigwait, set, sig); // FIXME: read sigset_t when all of sigemptyset, etc are intercepted // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigwait)(set, sig); if (!res && sig) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sig, sizeof(*sig)); return res; } #define INIT_SIGWAIT COMMON_INTERCEPT_FUNCTION(sigwait); #else #define INIT_SIGWAIT #endif #if SANITIZER_INTERCEPT_SIGWAITINFO INTERCEPTOR(int, sigwaitinfo, __sanitizer_sigset_t *set, void *info) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigwaitinfo, set, info); // FIXME: read sigset_t when all of sigemptyset, etc are intercepted // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigwaitinfo)(set, info); if (res > 0 && info) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, info, siginfo_t_sz); return res; } #define INIT_SIGWAITINFO COMMON_INTERCEPT_FUNCTION(sigwaitinfo); #else #define INIT_SIGWAITINFO #endif #if SANITIZER_INTERCEPT_SIGTIMEDWAIT INTERCEPTOR(int, sigtimedwait, __sanitizer_sigset_t *set, void *info, void *timeout) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigtimedwait, set, info, timeout); if (timeout) COMMON_INTERCEPTOR_READ_RANGE(ctx, timeout, struct_timespec_sz); // FIXME: read sigset_t when all of sigemptyset, etc are intercepted // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigtimedwait)(set, info, timeout); if (res > 0 && info) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, info, siginfo_t_sz); return res; } #define INIT_SIGTIMEDWAIT COMMON_INTERCEPT_FUNCTION(sigtimedwait); #else #define INIT_SIGTIMEDWAIT #endif #if SANITIZER_INTERCEPT_SIGSETOPS INTERCEPTOR(int, sigemptyset, __sanitizer_sigset_t *set) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigemptyset, set); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigemptyset)(set); if (!res && set) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, set, sizeof(*set)); return res; } INTERCEPTOR(int, sigfillset, __sanitizer_sigset_t *set) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigfillset, set); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigfillset)(set); if (!res && set) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, set, sizeof(*set)); return res; } #define INIT_SIGSETOPS \ COMMON_INTERCEPT_FUNCTION(sigemptyset); \ COMMON_INTERCEPT_FUNCTION(sigfillset); #else #define INIT_SIGSETOPS #endif #if SANITIZER_INTERCEPT_SIGPENDING INTERCEPTOR(int, sigpending, __sanitizer_sigset_t *set) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigpending, set); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigpending)(set); if (!res && set) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, set, sizeof(*set)); return res; } #define INIT_SIGPENDING COMMON_INTERCEPT_FUNCTION(sigpending); #else #define INIT_SIGPENDING #endif #if SANITIZER_INTERCEPT_SIGPROCMASK INTERCEPTOR(int, sigprocmask, int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sigprocmask, how, set, oldset); // FIXME: read sigset_t when all of sigemptyset, etc are intercepted // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(sigprocmask)(how, set, oldset); if (!res && oldset) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldset, sizeof(*oldset)); return res; } #define INIT_SIGPROCMASK COMMON_INTERCEPT_FUNCTION(sigprocmask); #else #define INIT_SIGPROCMASK #endif #if SANITIZER_INTERCEPT_BACKTRACE INTERCEPTOR(int, backtrace, void **buffer, int size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, backtrace, buffer, size); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(backtrace)(buffer, size); if (res && buffer) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buffer, res * sizeof(*buffer)); return res; } INTERCEPTOR(char **, backtrace_symbols, void **buffer, int size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, backtrace_symbols, buffer, size); if (buffer && size) COMMON_INTERCEPTOR_READ_RANGE(ctx, buffer, size * sizeof(*buffer)); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char **res = REAL(backtrace_symbols)(buffer, size); if (res && size) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, size * sizeof(*res)); for (int i = 0; i < size; ++i) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res[i], REAL(strlen(res[i])) + 1); } return res; } #define INIT_BACKTRACE \ COMMON_INTERCEPT_FUNCTION(backtrace); \ COMMON_INTERCEPT_FUNCTION(backtrace_symbols); #else #define INIT_BACKTRACE #endif #if SANITIZER_INTERCEPT__EXIT INTERCEPTOR(void, _exit, int status) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, _exit, status); COMMON_INTERCEPTOR_USER_CALLBACK_START(); int status1 = COMMON_INTERCEPTOR_ON_EXIT(ctx); COMMON_INTERCEPTOR_USER_CALLBACK_END(); if (status == 0) status = status1; REAL(_exit)(status); } #define INIT__EXIT COMMON_INTERCEPT_FUNCTION(_exit); #else #define INIT__EXIT #endif #if SANITIZER_INTERCEPT_PHTREAD_MUTEX INTERCEPTOR(int, pthread_mutex_lock, void *m) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_mutex_lock, m); int res = REAL(pthread_mutex_lock)(m); if (res == errno_EOWNERDEAD) COMMON_INTERCEPTOR_MUTEX_REPAIR(ctx, m); if (res == 0 || res == errno_EOWNERDEAD) COMMON_INTERCEPTOR_MUTEX_LOCK(ctx, m); if (res == errno_EINVAL) COMMON_INTERCEPTOR_MUTEX_INVALID(ctx, m); return res; } INTERCEPTOR(int, pthread_mutex_unlock, void *m) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_mutex_unlock, m); COMMON_INTERCEPTOR_MUTEX_UNLOCK(ctx, m); int res = REAL(pthread_mutex_unlock)(m); if (res == errno_EINVAL) COMMON_INTERCEPTOR_MUTEX_INVALID(ctx, m); return res; } #define INIT_PTHREAD_MUTEX_LOCK COMMON_INTERCEPT_FUNCTION(pthread_mutex_lock) #define INIT_PTHREAD_MUTEX_UNLOCK \ COMMON_INTERCEPT_FUNCTION(pthread_mutex_unlock) #else #define INIT_PTHREAD_MUTEX_LOCK #define INIT_PTHREAD_MUTEX_UNLOCK #endif #if SANITIZER_INTERCEPT_GETMNTENT || SANITIZER_INTERCEPT_GETMNTENT_R static void write_mntent(void *ctx, __sanitizer_mntent *mnt) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mnt, sizeof(*mnt)); if (mnt->mnt_fsname) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mnt->mnt_fsname, REAL(strlen)(mnt->mnt_fsname) + 1); if (mnt->mnt_dir) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mnt->mnt_dir, REAL(strlen)(mnt->mnt_dir) + 1); if (mnt->mnt_type) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mnt->mnt_type, REAL(strlen)(mnt->mnt_type) + 1); if (mnt->mnt_opts) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mnt->mnt_opts, REAL(strlen)(mnt->mnt_opts) + 1); } #endif #if SANITIZER_INTERCEPT_GETMNTENT INTERCEPTOR(__sanitizer_mntent *, getmntent, void *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getmntent, fp); __sanitizer_mntent *res = REAL(getmntent)(fp); if (res) write_mntent(ctx, res); return res; } #define INIT_GETMNTENT COMMON_INTERCEPT_FUNCTION(getmntent); #else #define INIT_GETMNTENT #endif #if SANITIZER_INTERCEPT_GETMNTENT_R INTERCEPTOR(__sanitizer_mntent *, getmntent_r, void *fp, __sanitizer_mntent *mntbuf, char *buf, int buflen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getmntent_r, fp, mntbuf, buf, buflen); __sanitizer_mntent *res = REAL(getmntent_r)(fp, mntbuf, buf, buflen); if (res) write_mntent(ctx, res); return res; } #define INIT_GETMNTENT_R COMMON_INTERCEPT_FUNCTION(getmntent_r); #else #define INIT_GETMNTENT_R #endif #if SANITIZER_INTERCEPT_STATFS INTERCEPTOR(int, statfs, char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, statfs, path, buf); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(statfs)(path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs_sz); return res; } INTERCEPTOR(int, fstatfs, int fd, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fstatfs, fd, buf); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(fstatfs)(fd, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs_sz); return res; } #define INIT_STATFS \ COMMON_INTERCEPT_FUNCTION(statfs); \ COMMON_INTERCEPT_FUNCTION(fstatfs); #else #define INIT_STATFS #endif #if SANITIZER_INTERCEPT_STATFS64 INTERCEPTOR(int, statfs64, char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, statfs64, path, buf); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(statfs64)(path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs64_sz); return res; } INTERCEPTOR(int, fstatfs64, int fd, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fstatfs64, fd, buf); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(fstatfs64)(fd, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs64_sz); return res; } #define INIT_STATFS64 \ COMMON_INTERCEPT_FUNCTION(statfs64); \ COMMON_INTERCEPT_FUNCTION(fstatfs64); #else #define INIT_STATFS64 #endif #if SANITIZER_INTERCEPT_STATVFS INTERCEPTOR(int, statvfs, char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, statvfs, path, buf); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(statvfs)(path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs_sz); return res; } INTERCEPTOR(int, fstatvfs, int fd, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fstatvfs, fd, buf); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(fstatvfs)(fd, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs_sz); return res; } #define INIT_STATVFS \ COMMON_INTERCEPT_FUNCTION(statvfs); \ COMMON_INTERCEPT_FUNCTION(fstatvfs); #else #define INIT_STATVFS #endif #if SANITIZER_INTERCEPT_STATVFS64 INTERCEPTOR(int, statvfs64, char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, statvfs64, path, buf); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(statvfs64)(path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs64_sz); return res; } INTERCEPTOR(int, fstatvfs64, int fd, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fstatvfs64, fd, buf); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(fstatvfs64)(fd, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs64_sz); return res; } #define INIT_STATVFS64 \ COMMON_INTERCEPT_FUNCTION(statvfs64); \ COMMON_INTERCEPT_FUNCTION(fstatvfs64); #else #define INIT_STATVFS64 #endif #if SANITIZER_INTERCEPT_INITGROUPS INTERCEPTOR(int, initgroups, char *user, u32 group) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, initgroups, user, group); if (user) COMMON_INTERCEPTOR_READ_RANGE(ctx, user, REAL(strlen)(user) + 1); int res = REAL(initgroups)(user, group); return res; } #define INIT_INITGROUPS COMMON_INTERCEPT_FUNCTION(initgroups); #else #define INIT_INITGROUPS #endif #if SANITIZER_INTERCEPT_ETHER_NTOA_ATON INTERCEPTOR(char *, ether_ntoa, __sanitizer_ether_addr *addr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_ntoa, addr); if (addr) COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, sizeof(*addr)); char *res = REAL(ether_ntoa)(addr); if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1); return res; } INTERCEPTOR(__sanitizer_ether_addr *, ether_aton, char *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_aton, buf); if (buf) COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, REAL(strlen)(buf) + 1); __sanitizer_ether_addr *res = REAL(ether_aton)(buf); if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, sizeof(*res)); return res; } #define INIT_ETHER_NTOA_ATON \ COMMON_INTERCEPT_FUNCTION(ether_ntoa); \ COMMON_INTERCEPT_FUNCTION(ether_aton); #else #define INIT_ETHER_NTOA_ATON #endif #if SANITIZER_INTERCEPT_ETHER_HOST INTERCEPTOR(int, ether_ntohost, char *hostname, __sanitizer_ether_addr *addr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_ntohost, hostname, addr); if (addr) COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, sizeof(*addr)); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(ether_ntohost)(hostname, addr); if (!res && hostname) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, hostname, REAL(strlen)(hostname) + 1); return res; } INTERCEPTOR(int, ether_hostton, char *hostname, __sanitizer_ether_addr *addr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_hostton, hostname, addr); if (hostname) COMMON_INTERCEPTOR_READ_RANGE(ctx, hostname, REAL(strlen)(hostname) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(ether_hostton)(hostname, addr); if (!res && addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, sizeof(*addr)); return res; } INTERCEPTOR(int, ether_line, char *line, __sanitizer_ether_addr *addr, char *hostname) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_line, line, addr, hostname); if (line) COMMON_INTERCEPTOR_READ_RANGE(ctx, line, REAL(strlen)(line) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(ether_line)(line, addr, hostname); if (!res) { if (addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, sizeof(*addr)); if (hostname) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, hostname, REAL(strlen)(hostname) + 1); } return res; } #define INIT_ETHER_HOST \ COMMON_INTERCEPT_FUNCTION(ether_ntohost); \ COMMON_INTERCEPT_FUNCTION(ether_hostton); \ COMMON_INTERCEPT_FUNCTION(ether_line); #else #define INIT_ETHER_HOST #endif #if SANITIZER_INTERCEPT_ETHER_R INTERCEPTOR(char *, ether_ntoa_r, __sanitizer_ether_addr *addr, char *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_ntoa_r, addr, buf); if (addr) COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, sizeof(*addr)); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(ether_ntoa_r)(addr, buf); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1); return res; } INTERCEPTOR(__sanitizer_ether_addr *, ether_aton_r, char *buf, __sanitizer_ether_addr *addr) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ether_aton_r, buf, addr); if (buf) COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, REAL(strlen)(buf) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. __sanitizer_ether_addr *res = REAL(ether_aton_r)(buf, addr); if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, sizeof(*res)); return res; } #define INIT_ETHER_R \ COMMON_INTERCEPT_FUNCTION(ether_ntoa_r); \ COMMON_INTERCEPT_FUNCTION(ether_aton_r); #else #define INIT_ETHER_R #endif #if SANITIZER_INTERCEPT_SHMCTL INTERCEPTOR(int, shmctl, int shmid, int cmd, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, shmctl, shmid, cmd, buf); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(shmctl)(shmid, cmd, buf); if (res >= 0) { unsigned sz = 0; if (cmd == shmctl_ipc_stat || cmd == shmctl_shm_stat) sz = sizeof(__sanitizer_shmid_ds); else if (cmd == shmctl_ipc_info) sz = struct_shminfo_sz; else if (cmd == shmctl_shm_info) sz = struct_shm_info_sz; if (sz) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, sz); } return res; } #define INIT_SHMCTL COMMON_INTERCEPT_FUNCTION(shmctl); #else #define INIT_SHMCTL #endif #if SANITIZER_INTERCEPT_RANDOM_R INTERCEPTOR(int, random_r, void *buf, u32 *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, random_r, buf, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(random_r)(buf, result); if (!res && result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } #define INIT_RANDOM_R COMMON_INTERCEPT_FUNCTION(random_r); #else #define INIT_RANDOM_R #endif // FIXME: under ASan the REAL() call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. #if SANITIZER_INTERCEPT_PTHREAD_ATTR_GET || \ SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSSCHED || \ SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GET || \ SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GET || \ SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GET || \ SANITIZER_INTERCEPT_PTHREAD_BARRIERATTR_GET #define INTERCEPTOR_PTHREAD_OBJECT_ATTR_GET(fn, sz) \ INTERCEPTOR(int, fn, void *attr, void *r) { \ void *ctx; \ COMMON_INTERCEPTOR_ENTER(ctx, fn, attr, r); \ int res = REAL(fn)(attr, r); \ if (!res && r) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, r, sz); \ return res; \ } #define INTERCEPTOR_PTHREAD_ATTR_GET(what, sz) \ INTERCEPTOR_PTHREAD_OBJECT_ATTR_GET(pthread_attr_get##what, sz) #define INTERCEPTOR_PTHREAD_MUTEXATTR_GET(what, sz) \ INTERCEPTOR_PTHREAD_OBJECT_ATTR_GET(pthread_mutexattr_get##what, sz) #define INTERCEPTOR_PTHREAD_RWLOCKATTR_GET(what, sz) \ INTERCEPTOR_PTHREAD_OBJECT_ATTR_GET(pthread_rwlockattr_get##what, sz) #define INTERCEPTOR_PTHREAD_CONDATTR_GET(what, sz) \ INTERCEPTOR_PTHREAD_OBJECT_ATTR_GET(pthread_condattr_get##what, sz) #define INTERCEPTOR_PTHREAD_BARRIERATTR_GET(what, sz) \ INTERCEPTOR_PTHREAD_OBJECT_ATTR_GET(pthread_barrierattr_get##what, sz) #endif #if SANITIZER_INTERCEPT_PTHREAD_ATTR_GET INTERCEPTOR_PTHREAD_ATTR_GET(detachstate, sizeof(int)) INTERCEPTOR_PTHREAD_ATTR_GET(guardsize, sizeof(SIZE_T)) INTERCEPTOR_PTHREAD_ATTR_GET(schedparam, struct_sched_param_sz) INTERCEPTOR_PTHREAD_ATTR_GET(schedpolicy, sizeof(int)) INTERCEPTOR_PTHREAD_ATTR_GET(scope, sizeof(int)) INTERCEPTOR_PTHREAD_ATTR_GET(stacksize, sizeof(SIZE_T)) INTERCEPTOR(int, pthread_attr_getstack, void *attr, void **addr, SIZE_T *size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_attr_getstack, attr, addr, size); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(pthread_attr_getstack)(attr, addr, size); if (!res) { if (addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, sizeof(*addr)); if (size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, size, sizeof(*size)); } return res; } // We may need to call the real pthread_attr_getstack from the run-time // in sanitizer_common, but we don't want to include the interception headers // there. So, just define this function here. namespace __sanitizer { extern "C" { int real_pthread_attr_getstack(void *attr, void **addr, SIZE_T *size) { return REAL(pthread_attr_getstack)(attr, addr, size); } } // extern "C" } // namespace __sanitizer #define INIT_PTHREAD_ATTR_GET \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getdetachstate); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getguardsize); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getschedparam); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getschedpolicy); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getscope); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getstacksize); \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getstack); #else #define INIT_PTHREAD_ATTR_GET #endif #if SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED INTERCEPTOR_PTHREAD_ATTR_GET(inheritsched, sizeof(int)) #define INIT_PTHREAD_ATTR_GETINHERITSCHED \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getinheritsched); #else #define INIT_PTHREAD_ATTR_GETINHERITSCHED #endif #if SANITIZER_INTERCEPT_PTHREAD_ATTR_GETAFFINITY_NP INTERCEPTOR(int, pthread_attr_getaffinity_np, void *attr, SIZE_T cpusetsize, void *cpuset) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_attr_getaffinity_np, attr, cpusetsize, cpuset); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(pthread_attr_getaffinity_np)(attr, cpusetsize, cpuset); if (!res && cpusetsize && cpuset) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, cpuset, cpusetsize); return res; } #define INIT_PTHREAD_ATTR_GETAFFINITY_NP \ COMMON_INTERCEPT_FUNCTION(pthread_attr_getaffinity_np); #else #define INIT_PTHREAD_ATTR_GETAFFINITY_NP #endif #if SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPSHARED INTERCEPTOR_PTHREAD_MUTEXATTR_GET(pshared, sizeof(int)) #define INIT_PTHREAD_MUTEXATTR_GETPSHARED \ COMMON_INTERCEPT_FUNCTION(pthread_mutexattr_getpshared); #else #define INIT_PTHREAD_MUTEXATTR_GETPSHARED #endif #if SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETTYPE INTERCEPTOR_PTHREAD_MUTEXATTR_GET(type, sizeof(int)) #define INIT_PTHREAD_MUTEXATTR_GETTYPE \ COMMON_INTERCEPT_FUNCTION(pthread_mutexattr_gettype); #else #define INIT_PTHREAD_MUTEXATTR_GETTYPE #endif #if SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPROTOCOL INTERCEPTOR_PTHREAD_MUTEXATTR_GET(protocol, sizeof(int)) #define INIT_PTHREAD_MUTEXATTR_GETPROTOCOL \ COMMON_INTERCEPT_FUNCTION(pthread_mutexattr_getprotocol); #else #define INIT_PTHREAD_MUTEXATTR_GETPROTOCOL #endif #if SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETPRIOCEILING INTERCEPTOR_PTHREAD_MUTEXATTR_GET(prioceiling, sizeof(int)) #define INIT_PTHREAD_MUTEXATTR_GETPRIOCEILING \ COMMON_INTERCEPT_FUNCTION(pthread_mutexattr_getprioceiling); #else #define INIT_PTHREAD_MUTEXATTR_GETPRIOCEILING #endif #if SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST INTERCEPTOR_PTHREAD_MUTEXATTR_GET(robust, sizeof(int)) #define INIT_PTHREAD_MUTEXATTR_GETROBUST \ COMMON_INTERCEPT_FUNCTION(pthread_mutexattr_getrobust); #else #define INIT_PTHREAD_MUTEXATTR_GETROBUST #endif #if SANITIZER_INTERCEPT_PTHREAD_MUTEXATTR_GETROBUST_NP INTERCEPTOR_PTHREAD_MUTEXATTR_GET(robust_np, sizeof(int)) #define INIT_PTHREAD_MUTEXATTR_GETROBUST_NP \ COMMON_INTERCEPT_FUNCTION(pthread_mutexattr_getrobust_np); #else #define INIT_PTHREAD_MUTEXATTR_GETROBUST_NP #endif #if SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETPSHARED INTERCEPTOR_PTHREAD_RWLOCKATTR_GET(pshared, sizeof(int)) #define INIT_PTHREAD_RWLOCKATTR_GETPSHARED \ COMMON_INTERCEPT_FUNCTION(pthread_rwlockattr_getpshared); #else #define INIT_PTHREAD_RWLOCKATTR_GETPSHARED #endif #if SANITIZER_INTERCEPT_PTHREAD_RWLOCKATTR_GETKIND_NP INTERCEPTOR_PTHREAD_RWLOCKATTR_GET(kind_np, sizeof(int)) #define INIT_PTHREAD_RWLOCKATTR_GETKIND_NP \ COMMON_INTERCEPT_FUNCTION(pthread_rwlockattr_getkind_np); #else #define INIT_PTHREAD_RWLOCKATTR_GETKIND_NP #endif #if SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETPSHARED INTERCEPTOR_PTHREAD_CONDATTR_GET(pshared, sizeof(int)) #define INIT_PTHREAD_CONDATTR_GETPSHARED \ COMMON_INTERCEPT_FUNCTION(pthread_condattr_getpshared); #else #define INIT_PTHREAD_CONDATTR_GETPSHARED #endif #if SANITIZER_INTERCEPT_PTHREAD_CONDATTR_GETCLOCK INTERCEPTOR_PTHREAD_CONDATTR_GET(clock, sizeof(int)) #define INIT_PTHREAD_CONDATTR_GETCLOCK \ COMMON_INTERCEPT_FUNCTION(pthread_condattr_getclock); #else #define INIT_PTHREAD_CONDATTR_GETCLOCK #endif #if SANITIZER_INTERCEPT_PTHREAD_BARRIERATTR_GETPSHARED INTERCEPTOR_PTHREAD_BARRIERATTR_GET(pshared, sizeof(int)) // !mac !android #define INIT_PTHREAD_BARRIERATTR_GETPSHARED \ COMMON_INTERCEPT_FUNCTION(pthread_barrierattr_getpshared); #else #define INIT_PTHREAD_BARRIERATTR_GETPSHARED #endif #if SANITIZER_INTERCEPT_TMPNAM INTERCEPTOR(char *, tmpnam, char *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, tmpnam, s); char *res = REAL(tmpnam)(s); if (res) { if (s) // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. COMMON_INTERCEPTOR_WRITE_RANGE(ctx, s, REAL(strlen)(s) + 1); else COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1); } return res; } #define INIT_TMPNAM COMMON_INTERCEPT_FUNCTION(tmpnam); #else #define INIT_TMPNAM #endif #if SANITIZER_INTERCEPT_TMPNAM_R INTERCEPTOR(char *, tmpnam_r, char *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, tmpnam_r, s); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(tmpnam_r)(s); if (res && s) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, s, REAL(strlen)(s) + 1); return res; } #define INIT_TMPNAM_R COMMON_INTERCEPT_FUNCTION(tmpnam_r); #else #define INIT_TMPNAM_R #endif #if SANITIZER_INTERCEPT_TTYNAME_R INTERCEPTOR(int, ttyname_r, int fd, char *name, SIZE_T namesize) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ttyname_r, fd, name, namesize); int res = REAL(ttyname_r)(fd, name, namesize); if (res == 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, REAL(strlen)(name) + 1); return res; } #define INIT_TTYNAME_R COMMON_INTERCEPT_FUNCTION(ttyname_r); #else #define INIT_TTYNAME_R #endif #if SANITIZER_INTERCEPT_TEMPNAM INTERCEPTOR(char *, tempnam, char *dir, char *pfx) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, tempnam, dir, pfx); if (dir) COMMON_INTERCEPTOR_READ_RANGE(ctx, dir, REAL(strlen)(dir) + 1); if (pfx) COMMON_INTERCEPTOR_READ_RANGE(ctx, pfx, REAL(strlen)(pfx) + 1); char *res = REAL(tempnam)(dir, pfx); if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1); return res; } #define INIT_TEMPNAM COMMON_INTERCEPT_FUNCTION(tempnam); #else #define INIT_TEMPNAM #endif #if SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP INTERCEPTOR(int, pthread_setname_np, uptr thread, const char *name) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_setname_np, thread, name); COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0); COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name); return REAL(pthread_setname_np)(thread, name); } #define INIT_PTHREAD_SETNAME_NP COMMON_INTERCEPT_FUNCTION(pthread_setname_np); #else #define INIT_PTHREAD_SETNAME_NP #endif #if SANITIZER_INTERCEPT_SINCOS INTERCEPTOR(void, sincos, double x, double *sin, double *cos) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sincos, x, sin, cos); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. REAL(sincos)(x, sin, cos); if (sin) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sin, sizeof(*sin)); if (cos) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, cos, sizeof(*cos)); } INTERCEPTOR(void, sincosf, float x, float *sin, float *cos) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sincosf, x, sin, cos); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. REAL(sincosf)(x, sin, cos); if (sin) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sin, sizeof(*sin)); if (cos) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, cos, sizeof(*cos)); } INTERCEPTOR(void, sincosl, long double x, long double *sin, long double *cos) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sincosl, x, sin, cos); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. REAL(sincosl)(x, sin, cos); if (sin) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sin, sizeof(*sin)); if (cos) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, cos, sizeof(*cos)); } #define INIT_SINCOS \ COMMON_INTERCEPT_FUNCTION(sincos); \ COMMON_INTERCEPT_FUNCTION(sincosf); \ COMMON_INTERCEPT_FUNCTION_LDBL(sincosl); #else #define INIT_SINCOS #endif #if SANITIZER_INTERCEPT_REMQUO INTERCEPTOR(double, remquo, double x, double y, int *quo) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, remquo, x, y, quo); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. double res = REAL(remquo)(x, y, quo); if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo)); return res; } INTERCEPTOR(float, remquof, float x, float y, int *quo) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, remquof, x, y, quo); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. float res = REAL(remquof)(x, y, quo); if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo)); return res; } INTERCEPTOR(long double, remquol, long double x, long double y, int *quo) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, remquol, x, y, quo); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. long double res = REAL(remquol)(x, y, quo); if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo)); return res; } #define INIT_REMQUO \ COMMON_INTERCEPT_FUNCTION(remquo); \ COMMON_INTERCEPT_FUNCTION(remquof); \ COMMON_INTERCEPT_FUNCTION_LDBL(remquol); #else #define INIT_REMQUO #endif #if SANITIZER_INTERCEPT_LGAMMA extern int signgam; INTERCEPTOR(double, lgamma, double x) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgamma, x); double res = REAL(lgamma)(x); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam)); return res; } INTERCEPTOR(float, lgammaf, float x) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgammaf, x); float res = REAL(lgammaf)(x); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam)); return res; } INTERCEPTOR(long double, lgammal, long double x) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgammal, x); long double res = REAL(lgammal)(x); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam)); return res; } #define INIT_LGAMMA \ COMMON_INTERCEPT_FUNCTION(lgamma); \ COMMON_INTERCEPT_FUNCTION(lgammaf); \ COMMON_INTERCEPT_FUNCTION_LDBL(lgammal); #else #define INIT_LGAMMA #endif #if SANITIZER_INTERCEPT_LGAMMA_R INTERCEPTOR(double, lgamma_r, double x, int *signp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgamma_r, x, signp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. double res = REAL(lgamma_r)(x, signp); if (signp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, signp, sizeof(*signp)); return res; } INTERCEPTOR(float, lgammaf_r, float x, int *signp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgammaf_r, x, signp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. float res = REAL(lgammaf_r)(x, signp); if (signp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, signp, sizeof(*signp)); return res; } #define INIT_LGAMMA_R \ COMMON_INTERCEPT_FUNCTION(lgamma_r); \ COMMON_INTERCEPT_FUNCTION(lgammaf_r); #else #define INIT_LGAMMA_R #endif #if SANITIZER_INTERCEPT_LGAMMAL_R INTERCEPTOR(long double, lgammal_r, long double x, int *signp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgammal_r, x, signp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. long double res = REAL(lgammal_r)(x, signp); if (signp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, signp, sizeof(*signp)); return res; } #define INIT_LGAMMAL_R COMMON_INTERCEPT_FUNCTION_LDBL(lgammal_r); #else #define INIT_LGAMMAL_R #endif #if SANITIZER_INTERCEPT_DRAND48_R INTERCEPTOR(int, drand48_r, void *buffer, double *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, drand48_r, buffer, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(drand48_r)(buffer, result); if (result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } INTERCEPTOR(int, lrand48_r, void *buffer, long *result) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lrand48_r, buffer, result); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(lrand48_r)(buffer, result); if (result) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, result, sizeof(*result)); return res; } #define INIT_DRAND48_R \ COMMON_INTERCEPT_FUNCTION(drand48_r); \ COMMON_INTERCEPT_FUNCTION(lrand48_r); #else #define INIT_DRAND48_R #endif #if SANITIZER_INTERCEPT_RAND_R INTERCEPTOR(int, rand_r, unsigned *seedp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, rand_r, seedp); COMMON_INTERCEPTOR_READ_RANGE(ctx, seedp, sizeof(*seedp)); return REAL(rand_r)(seedp); } #define INIT_RAND_R COMMON_INTERCEPT_FUNCTION(rand_r); #else #define INIT_RAND_R #endif #if SANITIZER_INTERCEPT_GETLINE INTERCEPTOR(SSIZE_T, getline, char **lineptr, SIZE_T *n, void *stream) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getline, lineptr, n, stream); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(getline)(lineptr, n, stream); if (res > 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, lineptr, sizeof(*lineptr)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n, sizeof(*n)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *lineptr, res + 1); } return res; } // FIXME: under ASan the call below may write to freed memory and corrupt its // metadata. See // https://github.com/google/sanitizers/issues/321. #define GETDELIM_INTERCEPTOR_IMPL(vname) \ { \ void *ctx; \ COMMON_INTERCEPTOR_ENTER(ctx, vname, lineptr, n, delim, stream); \ SSIZE_T res = REAL(vname)(lineptr, n, delim, stream); \ if (res > 0) { \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, lineptr, sizeof(*lineptr)); \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n, sizeof(*n)); \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *lineptr, res + 1); \ } \ return res; \ } INTERCEPTOR(SSIZE_T, __getdelim, char **lineptr, SIZE_T *n, int delim, void *stream) GETDELIM_INTERCEPTOR_IMPL(__getdelim) // There's no __getdelim() on FreeBSD so we supply the getdelim() interceptor // with its own body. INTERCEPTOR(SSIZE_T, getdelim, char **lineptr, SIZE_T *n, int delim, void *stream) GETDELIM_INTERCEPTOR_IMPL(getdelim) #define INIT_GETLINE \ COMMON_INTERCEPT_FUNCTION(getline); \ COMMON_INTERCEPT_FUNCTION(__getdelim); \ COMMON_INTERCEPT_FUNCTION(getdelim); #else #define INIT_GETLINE #endif #if SANITIZER_INTERCEPT_ICONV INTERCEPTOR(SIZE_T, iconv, void *cd, char **inbuf, SIZE_T *inbytesleft, char **outbuf, SIZE_T *outbytesleft) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, iconv, cd, inbuf, inbytesleft, outbuf, outbytesleft); if (inbytesleft) COMMON_INTERCEPTOR_READ_RANGE(ctx, inbytesleft, sizeof(*inbytesleft)); if (inbuf && inbytesleft) COMMON_INTERCEPTOR_READ_RANGE(ctx, *inbuf, *inbytesleft); if (outbytesleft) COMMON_INTERCEPTOR_READ_RANGE(ctx, outbytesleft, sizeof(*outbytesleft)); void *outbuf_orig = outbuf ? *outbuf : nullptr; // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SIZE_T res = REAL(iconv)(cd, inbuf, inbytesleft, outbuf, outbytesleft); if (res != (SIZE_T) - 1 && outbuf && *outbuf > outbuf_orig) { SIZE_T sz = (char *)*outbuf - (char *)outbuf_orig; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, outbuf_orig, sz); } return res; } #define INIT_ICONV COMMON_INTERCEPT_FUNCTION(iconv); #else #define INIT_ICONV #endif #if SANITIZER_INTERCEPT_TIMES INTERCEPTOR(__sanitizer_clock_t, times, void *tms) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, times, tms); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. __sanitizer_clock_t res = REAL(times)(tms); if (res != (__sanitizer_clock_t)-1 && tms) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, tms, struct_tms_sz); return res; } #define INIT_TIMES COMMON_INTERCEPT_FUNCTION(times); #else #define INIT_TIMES #endif #if SANITIZER_INTERCEPT_TLS_GET_ADDR #if !SANITIZER_S390 #define INIT_TLS_GET_ADDR COMMON_INTERCEPT_FUNCTION(__tls_get_addr) // If you see any crashes around this functions, there are 2 known issues with // it: 1. __tls_get_addr can be called with mis-aligned stack due to: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066 // 2. It can be called recursively if sanitizer code uses __tls_get_addr // to access thread local variables (it should not happen normally, // because sanitizers use initial-exec tls model). INTERCEPTOR(void *, __tls_get_addr, void *arg) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __tls_get_addr, arg); void *res = REAL(__tls_get_addr)(arg); uptr tls_begin, tls_end; COMMON_INTERCEPTOR_GET_TLS_RANGE(&tls_begin, &tls_end); DTLS::DTV *dtv = DTLS_on_tls_get_addr(arg, res, tls_begin, tls_end); if (dtv) { // New DTLS block has been allocated. COMMON_INTERCEPTOR_INITIALIZE_RANGE((void *)dtv->beg, dtv->size); } return res; } #if SANITIZER_PPC // On PowerPC, we also need to intercept __tls_get_addr_opt, which has // mostly the same semantics as __tls_get_addr, but its presence enables // some optimizations in linker (which are safe to ignore here). extern "C" __attribute__((alias("__interceptor___tls_get_addr"), visibility("default"))) void *__tls_get_addr_opt(void *arg); #endif #else // SANITIZER_S390 // On s390, we have to intercept two functions here: // - __tls_get_addr_internal, which is a glibc-internal function that is like // the usual __tls_get_addr, but returns a TP-relative offset instead of // a proper pointer. It is used by dlsym for TLS symbols. // - __tls_get_offset, which is like the above, but also takes a GOT-relative // descriptor offset as an argument instead of a pointer. GOT address // is passed in r12, so it's necessary to write it in assembly. This is // the function used by the compiler. #define INIT_TLS_GET_ADDR COMMON_INTERCEPT_FUNCTION(__tls_get_addr_internal) INTERCEPTOR(uptr, __tls_get_addr_internal, void *arg) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __tls_get_addr_internal, arg); uptr res = REAL(__tls_get_addr_internal)(arg); uptr tp = reinterpret_cast(__builtin_thread_pointer()); void *ptr = reinterpret_cast(res + tp); uptr tls_begin, tls_end; COMMON_INTERCEPTOR_GET_TLS_RANGE(&tls_begin, &tls_end); DTLS::DTV *dtv = DTLS_on_tls_get_addr(arg, ptr, tls_begin, tls_end); if (dtv) { // New DTLS block has been allocated. COMMON_INTERCEPTOR_INITIALIZE_RANGE((void *)dtv->beg, dtv->size); } return res; } // We need a protected symbol aliasing the above, so that we can jump // directly to it from the assembly below. extern "C" __attribute__((alias("__interceptor___tls_get_addr_internal"), visibility("protected"))) uptr __interceptor___tls_get_addr_internal_protected(void *arg); // Now carefully intercept __tls_get_offset. asm( ".text\n" ".global __tls_get_offset\n" "__tls_get_offset:\n" // The __intercept_ version has to exist, so that gen_dynamic_list.py // exports our symbol. ".global __interceptor___tls_get_offset\n" "__interceptor___tls_get_offset:\n" #ifdef __s390x__ "la %r2, 0(%r2,%r12)\n" "jg __interceptor___tls_get_addr_internal_protected\n" #else "basr %r3,0\n" "0: la %r2,0(%r2,%r12)\n" "l %r4,1f-0b(%r3)\n" "b 0(%r4,%r3)\n" "1: .long __interceptor___tls_get_addr_internal_protected - 0b\n" #endif ".type __tls_get_offset, @function\n" ".size __tls_get_offset, .-__tls_get_offset\n" ); #endif // SANITIZER_S390 #else #define INIT_TLS_GET_ADDR #endif #if SANITIZER_INTERCEPT_LISTXATTR INTERCEPTOR(SSIZE_T, listxattr, const char *path, char *list, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, listxattr, path, list, size); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(listxattr)(path, list, size); // Here and below, size == 0 is a special case where nothing is written to the // buffer, and res contains the desired buffer size. if (size && res > 0 && list) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, res); return res; } INTERCEPTOR(SSIZE_T, llistxattr, const char *path, char *list, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, llistxattr, path, list, size); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(llistxattr)(path, list, size); if (size && res > 0 && list) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, res); return res; } INTERCEPTOR(SSIZE_T, flistxattr, int fd, char *list, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, flistxattr, fd, list, size); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(flistxattr)(fd, list, size); if (size && res > 0 && list) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, res); return res; } #define INIT_LISTXATTR \ COMMON_INTERCEPT_FUNCTION(listxattr); \ COMMON_INTERCEPT_FUNCTION(llistxattr); \ COMMON_INTERCEPT_FUNCTION(flistxattr); #else #define INIT_LISTXATTR #endif #if SANITIZER_INTERCEPT_GETXATTR INTERCEPTOR(SSIZE_T, getxattr, const char *path, const char *name, char *value, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getxattr, path, name, value, size); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); if (name) COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(getxattr)(path, name, value, size); if (size && res > 0 && value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, res); return res; } INTERCEPTOR(SSIZE_T, lgetxattr, const char *path, const char *name, char *value, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgetxattr, path, name, value, size); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); if (name) COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(lgetxattr)(path, name, value, size); if (size && res > 0 && value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, res); return res; } INTERCEPTOR(SSIZE_T, fgetxattr, int fd, const char *name, char *value, SIZE_T size) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fgetxattr, fd, name, value, size); if (name) COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. SSIZE_T res = REAL(fgetxattr)(fd, name, value, size); if (size && res > 0 && value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, res); return res; } #define INIT_GETXATTR \ COMMON_INTERCEPT_FUNCTION(getxattr); \ COMMON_INTERCEPT_FUNCTION(lgetxattr); \ COMMON_INTERCEPT_FUNCTION(fgetxattr); #else #define INIT_GETXATTR #endif #if SANITIZER_INTERCEPT_GETRESID INTERCEPTOR(int, getresuid, void *ruid, void *euid, void *suid) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getresuid, ruid, euid, suid); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getresuid)(ruid, euid, suid); if (res >= 0) { if (ruid) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ruid, uid_t_sz); if (euid) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, euid, uid_t_sz); if (suid) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, suid, uid_t_sz); } return res; } INTERCEPTOR(int, getresgid, void *rgid, void *egid, void *sgid) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getresgid, rgid, egid, sgid); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getresgid)(rgid, egid, sgid); if (res >= 0) { if (rgid) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, rgid, gid_t_sz); if (egid) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, egid, gid_t_sz); if (sgid) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sgid, gid_t_sz); } return res; } #define INIT_GETRESID \ COMMON_INTERCEPT_FUNCTION(getresuid); \ COMMON_INTERCEPT_FUNCTION(getresgid); #else #define INIT_GETRESID #endif #if SANITIZER_INTERCEPT_GETIFADDRS // As long as getifaddrs()/freeifaddrs() use calloc()/free(), we don't need to // intercept freeifaddrs(). If that ceases to be the case, we might need to // intercept it to poison the memory again. INTERCEPTOR(int, getifaddrs, __sanitizer_ifaddrs **ifap) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getifaddrs, ifap); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(getifaddrs)(ifap); if (res == 0 && ifap) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ifap, sizeof(void *)); __sanitizer_ifaddrs *p = *ifap; while (p) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, sizeof(__sanitizer_ifaddrs)); if (p->ifa_name) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->ifa_name, REAL(strlen)(p->ifa_name) + 1); if (p->ifa_addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->ifa_addr, struct_sockaddr_sz); if (p->ifa_netmask) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->ifa_netmask, struct_sockaddr_sz); // On Linux this is a union, but the other member also points to a // struct sockaddr, so the following is sufficient. if (p->ifa_dstaddr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->ifa_dstaddr, struct_sockaddr_sz); // FIXME(smatveev): Unpoison p->ifa_data as well. p = p->ifa_next; } } return res; } #define INIT_GETIFADDRS \ COMMON_INTERCEPT_FUNCTION(getifaddrs); #else #define INIT_GETIFADDRS #endif #if SANITIZER_INTERCEPT_IF_INDEXTONAME INTERCEPTOR(char *, if_indextoname, unsigned int ifindex, char* ifname) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, if_indextoname, ifindex, ifname); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. char *res = REAL(if_indextoname)(ifindex, ifname); if (res && ifname) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ifname, REAL(strlen)(ifname) + 1); return res; } INTERCEPTOR(unsigned int, if_nametoindex, const char* ifname) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, if_nametoindex, ifname); if (ifname) COMMON_INTERCEPTOR_READ_RANGE(ctx, ifname, REAL(strlen)(ifname) + 1); return REAL(if_nametoindex)(ifname); } #define INIT_IF_INDEXTONAME \ COMMON_INTERCEPT_FUNCTION(if_indextoname); \ COMMON_INTERCEPT_FUNCTION(if_nametoindex); #else #define INIT_IF_INDEXTONAME #endif #if SANITIZER_INTERCEPT_CAPGET INTERCEPTOR(int, capget, void *hdrp, void *datap) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, capget, hdrp, datap); if (hdrp) COMMON_INTERCEPTOR_READ_RANGE(ctx, hdrp, __user_cap_header_struct_sz); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(capget)(hdrp, datap); if (res == 0 && datap) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, datap, __user_cap_data_struct_sz); // We can also return -1 and write to hdrp->version if the version passed in // hdrp->version is unsupported. But that's not a trivial condition to check, // and anyway COMMON_INTERCEPTOR_READ_RANGE protects us to some extent. return res; } INTERCEPTOR(int, capset, void *hdrp, const void *datap) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, capset, hdrp, datap); if (hdrp) COMMON_INTERCEPTOR_READ_RANGE(ctx, hdrp, __user_cap_header_struct_sz); if (datap) COMMON_INTERCEPTOR_READ_RANGE(ctx, datap, __user_cap_data_struct_sz); return REAL(capset)(hdrp, datap); } #define INIT_CAPGET \ COMMON_INTERCEPT_FUNCTION(capget); \ COMMON_INTERCEPT_FUNCTION(capset); #else #define INIT_CAPGET #endif #if SANITIZER_INTERCEPT_AEABI_MEM DECLARE_REAL_AND_INTERCEPTOR(void *, memmove, void *, const void *, uptr) DECLARE_REAL_AND_INTERCEPTOR(void *, memcpy, void *, const void *, uptr) DECLARE_REAL_AND_INTERCEPTOR(void *, memset, void *, int, uptr) INTERCEPTOR(void *, __aeabi_memmove, void *to, const void *from, uptr size) { return WRAP(memmove)(to, from, size); } INTERCEPTOR(void *, __aeabi_memmove4, void *to, const void *from, uptr size) { return WRAP(memmove)(to, from, size); } INTERCEPTOR(void *, __aeabi_memmove8, void *to, const void *from, uptr size) { return WRAP(memmove)(to, from, size); } INTERCEPTOR(void *, __aeabi_memcpy, void *to, const void *from, uptr size) { return WRAP(memcpy)(to, from, size); } INTERCEPTOR(void *, __aeabi_memcpy4, void *to, const void *from, uptr size) { return WRAP(memcpy)(to, from, size); } INTERCEPTOR(void *, __aeabi_memcpy8, void *to, const void *from, uptr size) { return WRAP(memcpy)(to, from, size); } // Note the argument order. INTERCEPTOR(void *, __aeabi_memset, void *block, uptr size, int c) { return WRAP(memset)(block, c, size); } INTERCEPTOR(void *, __aeabi_memset4, void *block, uptr size, int c) { return WRAP(memset)(block, c, size); } INTERCEPTOR(void *, __aeabi_memset8, void *block, uptr size, int c) { return WRAP(memset)(block, c, size); } INTERCEPTOR(void *, __aeabi_memclr, void *block, uptr size) { return WRAP(memset)(block, 0, size); } INTERCEPTOR(void *, __aeabi_memclr4, void *block, uptr size) { return WRAP(memset)(block, 0, size); } INTERCEPTOR(void *, __aeabi_memclr8, void *block, uptr size) { return WRAP(memset)(block, 0, size); } #define INIT_AEABI_MEM \ COMMON_INTERCEPT_FUNCTION(__aeabi_memmove); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memmove4); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memmove8); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memcpy); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memcpy4); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memcpy8); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memset); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memset4); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memset8); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memclr); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memclr4); \ COMMON_INTERCEPT_FUNCTION(__aeabi_memclr8); #else #define INIT_AEABI_MEM #endif // SANITIZER_INTERCEPT_AEABI_MEM #if SANITIZER_INTERCEPT___BZERO DECLARE_REAL_AND_INTERCEPTOR(void *, memset, void *, int, uptr); INTERCEPTOR(void *, __bzero, void *block, uptr size) { return WRAP(memset)(block, 0, size); } #define INIT___BZERO COMMON_INTERCEPT_FUNCTION(__bzero); #else #define INIT___BZERO #endif // SANITIZER_INTERCEPT___BZERO #if SANITIZER_INTERCEPT_FTIME INTERCEPTOR(int, ftime, __sanitizer_timeb *tp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ftime, tp); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(ftime)(tp); if (tp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, tp, sizeof(*tp)); return res; } #define INIT_FTIME COMMON_INTERCEPT_FUNCTION(ftime); #else #define INIT_FTIME #endif // SANITIZER_INTERCEPT_FTIME #if SANITIZER_INTERCEPT_XDR INTERCEPTOR(void, xdrmem_create, __sanitizer_XDR *xdrs, uptr addr, unsigned size, int op) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, xdrmem_create, xdrs, addr, size, op); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. REAL(xdrmem_create)(xdrs, addr, size, op); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, xdrs, sizeof(*xdrs)); if (op == __sanitizer_XDR_ENCODE) { // It's not obvious how much data individual xdr_ routines write. // Simply unpoison the entire target buffer in advance. COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (void *)addr, size); } } INTERCEPTOR(void, xdrstdio_create, __sanitizer_XDR *xdrs, void *file, int op) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, xdrstdio_create, xdrs, file, op); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. REAL(xdrstdio_create)(xdrs, file, op); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, xdrs, sizeof(*xdrs)); } // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. #define XDR_INTERCEPTOR(F, T) \ INTERCEPTOR(int, F, __sanitizer_XDR *xdrs, T *p) { \ void *ctx; \ COMMON_INTERCEPTOR_ENTER(ctx, F, xdrs, p); \ if (p && xdrs->x_op == __sanitizer_XDR_ENCODE) \ COMMON_INTERCEPTOR_READ_RANGE(ctx, p, sizeof(*p)); \ int res = REAL(F)(xdrs, p); \ if (res && p && xdrs->x_op == __sanitizer_XDR_DECODE) \ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, sizeof(*p)); \ return res; \ } XDR_INTERCEPTOR(xdr_short, short) XDR_INTERCEPTOR(xdr_u_short, unsigned short) XDR_INTERCEPTOR(xdr_int, int) XDR_INTERCEPTOR(xdr_u_int, unsigned) XDR_INTERCEPTOR(xdr_long, long) XDR_INTERCEPTOR(xdr_u_long, unsigned long) XDR_INTERCEPTOR(xdr_hyper, long long) XDR_INTERCEPTOR(xdr_u_hyper, unsigned long long) XDR_INTERCEPTOR(xdr_longlong_t, long long) XDR_INTERCEPTOR(xdr_u_longlong_t, unsigned long long) XDR_INTERCEPTOR(xdr_int8_t, u8) XDR_INTERCEPTOR(xdr_uint8_t, u8) XDR_INTERCEPTOR(xdr_int16_t, u16) XDR_INTERCEPTOR(xdr_uint16_t, u16) XDR_INTERCEPTOR(xdr_int32_t, u32) XDR_INTERCEPTOR(xdr_uint32_t, u32) XDR_INTERCEPTOR(xdr_int64_t, u64) XDR_INTERCEPTOR(xdr_uint64_t, u64) XDR_INTERCEPTOR(xdr_quad_t, long long) XDR_INTERCEPTOR(xdr_u_quad_t, unsigned long long) XDR_INTERCEPTOR(xdr_bool, bool) XDR_INTERCEPTOR(xdr_enum, int) XDR_INTERCEPTOR(xdr_char, char) XDR_INTERCEPTOR(xdr_u_char, unsigned char) XDR_INTERCEPTOR(xdr_float, float) XDR_INTERCEPTOR(xdr_double, double) // FIXME: intercept xdr_array, opaque, union, vector, reference, pointer, // wrapstring, sizeof INTERCEPTOR(int, xdr_bytes, __sanitizer_XDR *xdrs, char **p, unsigned *sizep, unsigned maxsize) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, xdr_bytes, xdrs, p, sizep, maxsize); if (p && sizep && xdrs->x_op == __sanitizer_XDR_ENCODE) { COMMON_INTERCEPTOR_READ_RANGE(ctx, p, sizeof(*p)); COMMON_INTERCEPTOR_READ_RANGE(ctx, sizep, sizeof(*sizep)); COMMON_INTERCEPTOR_READ_RANGE(ctx, *p, *sizep); } // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(xdr_bytes)(xdrs, p, sizep, maxsize); if (p && sizep && xdrs->x_op == __sanitizer_XDR_DECODE) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, sizeof(*p)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sizep, sizeof(*sizep)); if (res && *p && *sizep) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *p, *sizep); } return res; } INTERCEPTOR(int, xdr_string, __sanitizer_XDR *xdrs, char **p, unsigned maxsize) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, xdr_string, xdrs, p, maxsize); if (p && xdrs->x_op == __sanitizer_XDR_ENCODE) { COMMON_INTERCEPTOR_READ_RANGE(ctx, p, sizeof(*p)); COMMON_INTERCEPTOR_READ_RANGE(ctx, *p, REAL(strlen)(*p) + 1); } // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. int res = REAL(xdr_string)(xdrs, p, maxsize); if (p && xdrs->x_op == __sanitizer_XDR_DECODE) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p, sizeof(*p)); if (res && *p) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *p, REAL(strlen)(*p) + 1); } return res; } #define INIT_XDR \ COMMON_INTERCEPT_FUNCTION(xdrmem_create); \ COMMON_INTERCEPT_FUNCTION(xdrstdio_create); \ COMMON_INTERCEPT_FUNCTION(xdr_short); \ COMMON_INTERCEPT_FUNCTION(xdr_u_short); \ COMMON_INTERCEPT_FUNCTION(xdr_int); \ COMMON_INTERCEPT_FUNCTION(xdr_u_int); \ COMMON_INTERCEPT_FUNCTION(xdr_long); \ COMMON_INTERCEPT_FUNCTION(xdr_u_long); \ COMMON_INTERCEPT_FUNCTION(xdr_hyper); \ COMMON_INTERCEPT_FUNCTION(xdr_u_hyper); \ COMMON_INTERCEPT_FUNCTION(xdr_longlong_t); \ COMMON_INTERCEPT_FUNCTION(xdr_u_longlong_t); \ COMMON_INTERCEPT_FUNCTION(xdr_int8_t); \ COMMON_INTERCEPT_FUNCTION(xdr_uint8_t); \ COMMON_INTERCEPT_FUNCTION(xdr_int16_t); \ COMMON_INTERCEPT_FUNCTION(xdr_uint16_t); \ COMMON_INTERCEPT_FUNCTION(xdr_int32_t); \ COMMON_INTERCEPT_FUNCTION(xdr_uint32_t); \ COMMON_INTERCEPT_FUNCTION(xdr_int64_t); \ COMMON_INTERCEPT_FUNCTION(xdr_uint64_t); \ COMMON_INTERCEPT_FUNCTION(xdr_quad_t); \ COMMON_INTERCEPT_FUNCTION(xdr_u_quad_t); \ COMMON_INTERCEPT_FUNCTION(xdr_bool); \ COMMON_INTERCEPT_FUNCTION(xdr_enum); \ COMMON_INTERCEPT_FUNCTION(xdr_char); \ COMMON_INTERCEPT_FUNCTION(xdr_u_char); \ COMMON_INTERCEPT_FUNCTION(xdr_float); \ COMMON_INTERCEPT_FUNCTION(xdr_double); \ COMMON_INTERCEPT_FUNCTION(xdr_bytes); \ COMMON_INTERCEPT_FUNCTION(xdr_string); #else #define INIT_XDR #endif // SANITIZER_INTERCEPT_XDR #if SANITIZER_INTERCEPT_TSEARCH INTERCEPTOR(void *, tsearch, void *key, void **rootp, int (*compar)(const void *, const void *)) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, tsearch, key, rootp, compar); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. void *res = REAL(tsearch)(key, rootp, compar); if (res && *(void **)res == key) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, sizeof(void *)); return res; } #define INIT_TSEARCH COMMON_INTERCEPT_FUNCTION(tsearch); #else #define INIT_TSEARCH #endif #if SANITIZER_INTERCEPT_LIBIO_INTERNALS || SANITIZER_INTERCEPT_FOPEN || \ SANITIZER_INTERCEPT_OPEN_MEMSTREAM void unpoison_file(__sanitizer_FILE *fp) { #if SANITIZER_HAS_STRUCT_FILE COMMON_INTERCEPTOR_INITIALIZE_RANGE(fp, sizeof(*fp)); if (fp->_IO_read_base && fp->_IO_read_base < fp->_IO_read_end) COMMON_INTERCEPTOR_INITIALIZE_RANGE(fp->_IO_read_base, fp->_IO_read_end - fp->_IO_read_base); #endif // SANITIZER_HAS_STRUCT_FILE } #endif #if SANITIZER_INTERCEPT_LIBIO_INTERNALS // These guys are called when a .c source is built with -O2. INTERCEPTOR(int, __uflow, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __uflow, fp); int res = REAL(__uflow)(fp); unpoison_file(fp); return res; } INTERCEPTOR(int, __underflow, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __underflow, fp); int res = REAL(__underflow)(fp); unpoison_file(fp); return res; } INTERCEPTOR(int, __overflow, __sanitizer_FILE *fp, int ch) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __overflow, fp, ch); int res = REAL(__overflow)(fp, ch); unpoison_file(fp); return res; } INTERCEPTOR(int, __wuflow, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __wuflow, fp); int res = REAL(__wuflow)(fp); unpoison_file(fp); return res; } INTERCEPTOR(int, __wunderflow, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __wunderflow, fp); int res = REAL(__wunderflow)(fp); unpoison_file(fp); return res; } INTERCEPTOR(int, __woverflow, __sanitizer_FILE *fp, int ch) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __woverflow, fp, ch); int res = REAL(__woverflow)(fp, ch); unpoison_file(fp); return res; } #define INIT_LIBIO_INTERNALS \ COMMON_INTERCEPT_FUNCTION(__uflow); \ COMMON_INTERCEPT_FUNCTION(__underflow); \ COMMON_INTERCEPT_FUNCTION(__overflow); \ COMMON_INTERCEPT_FUNCTION(__wuflow); \ COMMON_INTERCEPT_FUNCTION(__wunderflow); \ COMMON_INTERCEPT_FUNCTION(__woverflow); #else #define INIT_LIBIO_INTERNALS #endif #if SANITIZER_INTERCEPT_FOPEN INTERCEPTOR(__sanitizer_FILE *, fopen, const char *path, const char *mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fopen, path, mode); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1); __sanitizer_FILE *res = REAL(fopen)(path, mode); COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path); if (res) unpoison_file(res); return res; } INTERCEPTOR(__sanitizer_FILE *, fdopen, int fd, const char *mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fdopen, fd, mode); COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1); __sanitizer_FILE *res = REAL(fdopen)(fd, mode); if (res) unpoison_file(res); return res; } INTERCEPTOR(__sanitizer_FILE *, freopen, const char *path, const char *mode, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, freopen, path, mode, fp); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1); COMMON_INTERCEPTOR_FILE_CLOSE(ctx, fp); __sanitizer_FILE *res = REAL(freopen)(path, mode, fp); COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path); if (res) unpoison_file(res); return res; } #define INIT_FOPEN \ COMMON_INTERCEPT_FUNCTION(fopen); \ COMMON_INTERCEPT_FUNCTION(fdopen); \ COMMON_INTERCEPT_FUNCTION(freopen); #else #define INIT_FOPEN #endif #if SANITIZER_INTERCEPT_FOPEN64 INTERCEPTOR(__sanitizer_FILE *, fopen64, const char *path, const char *mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fopen64, path, mode); COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1); __sanitizer_FILE *res = REAL(fopen64)(path, mode); COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path); if (res) unpoison_file(res); return res; } INTERCEPTOR(__sanitizer_FILE *, freopen64, const char *path, const char *mode, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, freopen64, path, mode, fp); if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1); COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1); COMMON_INTERCEPTOR_FILE_CLOSE(ctx, fp); __sanitizer_FILE *res = REAL(freopen64)(path, mode, fp); COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path); if (res) unpoison_file(res); return res; } #define INIT_FOPEN64 \ COMMON_INTERCEPT_FUNCTION(fopen64); \ COMMON_INTERCEPT_FUNCTION(freopen64); #else #define INIT_FOPEN64 #endif #if SANITIZER_INTERCEPT_OPEN_MEMSTREAM INTERCEPTOR(__sanitizer_FILE *, open_memstream, char **ptr, SIZE_T *sizeloc) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, open_memstream, ptr, sizeloc); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. __sanitizer_FILE *res = REAL(open_memstream)(ptr, sizeloc); if (res) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, sizeof(*ptr)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sizeloc, sizeof(*sizeloc)); unpoison_file(res); FileMetadata file = {ptr, sizeloc}; SetInterceptorMetadata(res, file); } return res; } INTERCEPTOR(__sanitizer_FILE *, open_wmemstream, wchar_t **ptr, SIZE_T *sizeloc) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, open_wmemstream, ptr, sizeloc); __sanitizer_FILE *res = REAL(open_wmemstream)(ptr, sizeloc); if (res) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, sizeof(*ptr)); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sizeloc, sizeof(*sizeloc)); unpoison_file(res); FileMetadata file = {(char **)ptr, sizeloc}; SetInterceptorMetadata(res, file); } return res; } INTERCEPTOR(__sanitizer_FILE *, fmemopen, void *buf, SIZE_T size, const char *mode) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fmemopen, buf, size, mode); // FIXME: under ASan the call below may write to freed memory and corrupt // its metadata. See // https://github.com/google/sanitizers/issues/321. __sanitizer_FILE *res = REAL(fmemopen)(buf, size, mode); if (res) unpoison_file(res); return res; } #define INIT_OPEN_MEMSTREAM \ COMMON_INTERCEPT_FUNCTION(open_memstream); \ COMMON_INTERCEPT_FUNCTION(open_wmemstream); \ COMMON_INTERCEPT_FUNCTION(fmemopen); #else #define INIT_OPEN_MEMSTREAM #endif #if SANITIZER_INTERCEPT_OBSTACK static void initialize_obstack(__sanitizer_obstack *obstack) { COMMON_INTERCEPTOR_INITIALIZE_RANGE(obstack, sizeof(*obstack)); if (obstack->chunk) COMMON_INTERCEPTOR_INITIALIZE_RANGE(obstack->chunk, sizeof(*obstack->chunk)); } INTERCEPTOR(int, _obstack_begin_1, __sanitizer_obstack *obstack, int sz, int align, void *(*alloc_fn)(uptr arg, uptr sz), void (*free_fn)(uptr arg, void *p)) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, _obstack_begin_1, obstack, sz, align, alloc_fn, free_fn); int res = REAL(_obstack_begin_1)(obstack, sz, align, alloc_fn, free_fn); if (res) initialize_obstack(obstack); return res; } INTERCEPTOR(int, _obstack_begin, __sanitizer_obstack *obstack, int sz, int align, void *(*alloc_fn)(uptr sz), void (*free_fn)(void *p)) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, _obstack_begin, obstack, sz, align, alloc_fn, free_fn); int res = REAL(_obstack_begin)(obstack, sz, align, alloc_fn, free_fn); if (res) initialize_obstack(obstack); return res; } INTERCEPTOR(void, _obstack_newchunk, __sanitizer_obstack *obstack, int length) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, _obstack_newchunk, obstack, length); REAL(_obstack_newchunk)(obstack, length); if (obstack->chunk) COMMON_INTERCEPTOR_INITIALIZE_RANGE( obstack->chunk, obstack->next_free - (char *)obstack->chunk); } #define INIT_OBSTACK \ COMMON_INTERCEPT_FUNCTION(_obstack_begin_1); \ COMMON_INTERCEPT_FUNCTION(_obstack_begin); \ COMMON_INTERCEPT_FUNCTION(_obstack_newchunk); #else #define INIT_OBSTACK #endif #if SANITIZER_INTERCEPT_FFLUSH INTERCEPTOR(int, fflush, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fflush, fp); int res = REAL(fflush)(fp); // FIXME: handle fp == NULL if (fp) { const FileMetadata *m = GetInterceptorMetadata(fp); if (m) COMMON_INTERCEPTOR_INITIALIZE_RANGE(*m->addr, *m->size); } return res; } #define INIT_FFLUSH COMMON_INTERCEPT_FUNCTION(fflush); #else #define INIT_FFLUSH #endif #if SANITIZER_INTERCEPT_FCLOSE INTERCEPTOR(int, fclose, __sanitizer_FILE *fp) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fclose, fp); COMMON_INTERCEPTOR_FILE_CLOSE(ctx, fp); const FileMetadata *m = GetInterceptorMetadata(fp); int res = REAL(fclose)(fp); if (m) { COMMON_INTERCEPTOR_INITIALIZE_RANGE(*m->addr, *m->size); DeleteInterceptorMetadata(fp); } return res; } #define INIT_FCLOSE COMMON_INTERCEPT_FUNCTION(fclose); #else #define INIT_FCLOSE #endif #if SANITIZER_INTERCEPT_DLOPEN_DLCLOSE INTERCEPTOR(void*, dlopen, const char *filename, int flag) { void *ctx; COMMON_INTERCEPTOR_ENTER_NOIGNORE(ctx, dlopen, filename, flag); if (filename) COMMON_INTERCEPTOR_READ_STRING(ctx, filename, 0); COMMON_INTERCEPTOR_ON_DLOPEN(filename, flag); void *res = REAL(dlopen)(filename, flag); COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, res); return res; } INTERCEPTOR(int, dlclose, void *handle) { void *ctx; COMMON_INTERCEPTOR_ENTER_NOIGNORE(ctx, dlclose, handle); int res = REAL(dlclose)(handle); COMMON_INTERCEPTOR_LIBRARY_UNLOADED(); return res; } #define INIT_DLOPEN_DLCLOSE \ COMMON_INTERCEPT_FUNCTION(dlopen); \ COMMON_INTERCEPT_FUNCTION(dlclose); #else #define INIT_DLOPEN_DLCLOSE #endif #if SANITIZER_INTERCEPT_GETPASS INTERCEPTOR(char *, getpass, const char *prompt) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpass, prompt); if (prompt) COMMON_INTERCEPTOR_READ_RANGE(ctx, prompt, REAL(strlen)(prompt)+1); char *res = REAL(getpass)(prompt); if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res)+1); return res; } #define INIT_GETPASS COMMON_INTERCEPT_FUNCTION(getpass); #else #define INIT_GETPASS #endif #if SANITIZER_INTERCEPT_TIMERFD INTERCEPTOR(int, timerfd_settime, int fd, int flags, void *new_value, void *old_value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, timerfd_settime, fd, flags, new_value, old_value); COMMON_INTERCEPTOR_READ_RANGE(ctx, new_value, struct_itimerspec_sz); int res = REAL(timerfd_settime)(fd, flags, new_value, old_value); if (res != -1 && old_value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, old_value, struct_itimerspec_sz); return res; } INTERCEPTOR(int, timerfd_gettime, int fd, void *curr_value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, timerfd_gettime, fd, curr_value); int res = REAL(timerfd_gettime)(fd, curr_value); if (res != -1 && curr_value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, curr_value, struct_itimerspec_sz); return res; } #define INIT_TIMERFD \ COMMON_INTERCEPT_FUNCTION(timerfd_settime); \ COMMON_INTERCEPT_FUNCTION(timerfd_gettime); #else #define INIT_TIMERFD #endif #if SANITIZER_INTERCEPT_MLOCKX // Linux kernel has a bug that leads to kernel deadlock if a process // maps TBs of memory and then calls mlock(). static void MlockIsUnsupported() { static atomic_uint8_t printed; if (atomic_exchange(&printed, 1, memory_order_relaxed)) return; VPrintf(1, "%s ignores mlock/mlockall/munlock/munlockall\n", SanitizerToolName); } INTERCEPTOR(int, mlock, const void *addr, uptr len) { MlockIsUnsupported(); return 0; } INTERCEPTOR(int, munlock, const void *addr, uptr len) { MlockIsUnsupported(); return 0; } INTERCEPTOR(int, mlockall, int flags) { MlockIsUnsupported(); return 0; } INTERCEPTOR(int, munlockall, void) { MlockIsUnsupported(); return 0; } #define INIT_MLOCKX \ COMMON_INTERCEPT_FUNCTION(mlock); \ COMMON_INTERCEPT_FUNCTION(munlock); \ COMMON_INTERCEPT_FUNCTION(mlockall); \ COMMON_INTERCEPT_FUNCTION(munlockall); #else #define INIT_MLOCKX #endif // SANITIZER_INTERCEPT_MLOCKX #if SANITIZER_INTERCEPT_FOPENCOOKIE struct WrappedCookie { void *real_cookie; __sanitizer_cookie_io_functions_t real_io_funcs; }; static uptr wrapped_read(void *cookie, char *buf, uptr size) { COMMON_INTERCEPTOR_UNPOISON_PARAM(3); WrappedCookie *wrapped_cookie = (WrappedCookie *)cookie; __sanitizer_cookie_io_read real_read = wrapped_cookie->real_io_funcs.read; return real_read ? real_read(wrapped_cookie->real_cookie, buf, size) : 0; } static uptr wrapped_write(void *cookie, const char *buf, uptr size) { COMMON_INTERCEPTOR_UNPOISON_PARAM(3); WrappedCookie *wrapped_cookie = (WrappedCookie *)cookie; __sanitizer_cookie_io_write real_write = wrapped_cookie->real_io_funcs.write; return real_write ? real_write(wrapped_cookie->real_cookie, buf, size) : size; } static int wrapped_seek(void *cookie, u64 *offset, int whence) { COMMON_INTERCEPTOR_UNPOISON_PARAM(3); COMMON_INTERCEPTOR_INITIALIZE_RANGE(offset, sizeof(*offset)); WrappedCookie *wrapped_cookie = (WrappedCookie *)cookie; __sanitizer_cookie_io_seek real_seek = wrapped_cookie->real_io_funcs.seek; return real_seek ? real_seek(wrapped_cookie->real_cookie, offset, whence) : -1; } static int wrapped_close(void *cookie) { COMMON_INTERCEPTOR_UNPOISON_PARAM(1); WrappedCookie *wrapped_cookie = (WrappedCookie *)cookie; __sanitizer_cookie_io_close real_close = wrapped_cookie->real_io_funcs.close; int res = real_close ? real_close(wrapped_cookie->real_cookie) : 0; InternalFree(wrapped_cookie); return res; } INTERCEPTOR(__sanitizer_FILE *, fopencookie, void *cookie, const char *mode, __sanitizer_cookie_io_functions_t io_funcs) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, fopencookie, cookie, mode, io_funcs); WrappedCookie *wrapped_cookie = (WrappedCookie *)InternalAlloc(sizeof(WrappedCookie)); wrapped_cookie->real_cookie = cookie; wrapped_cookie->real_io_funcs = io_funcs; __sanitizer_FILE *res = REAL(fopencookie)(wrapped_cookie, mode, {wrapped_read, wrapped_write, wrapped_seek, wrapped_close}); return res; } #define INIT_FOPENCOOKIE COMMON_INTERCEPT_FUNCTION(fopencookie); #else #define INIT_FOPENCOOKIE #endif // SANITIZER_INTERCEPT_FOPENCOOKIE #if SANITIZER_INTERCEPT_SEM INTERCEPTOR(int, sem_init, __sanitizer_sem_t *s, int pshared, unsigned value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_init, s, pshared, value); // Workaround a bug in glibc's "old" semaphore implementation by // zero-initializing the sem_t contents. This has to be done here because // interceptors bind to the lowest symbols version by default, hitting the // buggy code path while the non-sanitized build of the same code works fine. REAL(memset)(s, 0, sizeof(*s)); int res = REAL(sem_init)(s, pshared, value); return res; } INTERCEPTOR(int, sem_destroy, __sanitizer_sem_t *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_destroy, s); int res = REAL(sem_destroy)(s); return res; } INTERCEPTOR(int, sem_wait, __sanitizer_sem_t *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_wait, s); int res = COMMON_INTERCEPTOR_BLOCK_REAL(sem_wait)(s); if (res == 0) { COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s); } return res; } INTERCEPTOR(int, sem_trywait, __sanitizer_sem_t *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_trywait, s); int res = COMMON_INTERCEPTOR_BLOCK_REAL(sem_trywait)(s); if (res == 0) { COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s); } return res; } INTERCEPTOR(int, sem_timedwait, __sanitizer_sem_t *s, void *abstime) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_timedwait, s, abstime); COMMON_INTERCEPTOR_READ_RANGE(ctx, abstime, struct_timespec_sz); int res = COMMON_INTERCEPTOR_BLOCK_REAL(sem_timedwait)(s, abstime); if (res == 0) { COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s); } return res; } INTERCEPTOR(int, sem_post, __sanitizer_sem_t *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_post, s); COMMON_INTERCEPTOR_RELEASE(ctx, (uptr)s); int res = REAL(sem_post)(s); return res; } INTERCEPTOR(int, sem_getvalue, __sanitizer_sem_t *s, int *sval) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sem_getvalue, s, sval); int res = REAL(sem_getvalue)(s, sval); if (res == 0) { COMMON_INTERCEPTOR_ACQUIRE(ctx, (uptr)s); COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sval, sizeof(*sval)); } return res; } #define INIT_SEM \ COMMON_INTERCEPT_FUNCTION(sem_init); \ COMMON_INTERCEPT_FUNCTION(sem_destroy); \ COMMON_INTERCEPT_FUNCTION(sem_wait); \ COMMON_INTERCEPT_FUNCTION(sem_trywait); \ COMMON_INTERCEPT_FUNCTION(sem_timedwait); \ COMMON_INTERCEPT_FUNCTION(sem_post); \ COMMON_INTERCEPT_FUNCTION(sem_getvalue); #else #define INIT_SEM #endif // SANITIZER_INTERCEPT_SEM #if SANITIZER_INTERCEPT_PTHREAD_SETCANCEL INTERCEPTOR(int, pthread_setcancelstate, int state, int *oldstate) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_setcancelstate, state, oldstate); int res = REAL(pthread_setcancelstate)(state, oldstate); if (res == 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldstate, sizeof(*oldstate)); return res; } INTERCEPTOR(int, pthread_setcanceltype, int type, int *oldtype) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, pthread_setcanceltype, type, oldtype); int res = REAL(pthread_setcanceltype)(type, oldtype); if (res == 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldtype, sizeof(*oldtype)); return res; } #define INIT_PTHREAD_SETCANCEL \ COMMON_INTERCEPT_FUNCTION(pthread_setcancelstate); \ COMMON_INTERCEPT_FUNCTION(pthread_setcanceltype); #else #define INIT_PTHREAD_SETCANCEL #endif #if SANITIZER_INTERCEPT_MINCORE INTERCEPTOR(int, mincore, void *addr, uptr length, unsigned char *vec) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, mincore, addr, length, vec); int res = REAL(mincore)(addr, length, vec); if (res == 0) { uptr page_size = GetPageSizeCached(); uptr vec_size = ((length + page_size - 1) & (~(page_size - 1))) / page_size; COMMON_INTERCEPTOR_WRITE_RANGE(ctx, vec, vec_size); } return res; } #define INIT_MINCORE COMMON_INTERCEPT_FUNCTION(mincore); #else #define INIT_MINCORE #endif #if SANITIZER_INTERCEPT_PROCESS_VM_READV INTERCEPTOR(SSIZE_T, process_vm_readv, int pid, __sanitizer_iovec *local_iov, uptr liovcnt, __sanitizer_iovec *remote_iov, uptr riovcnt, uptr flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, process_vm_readv, pid, local_iov, liovcnt, remote_iov, riovcnt, flags); SSIZE_T res = REAL(process_vm_readv)(pid, local_iov, liovcnt, remote_iov, riovcnt, flags); if (res > 0) write_iovec(ctx, local_iov, liovcnt, res); return res; } INTERCEPTOR(SSIZE_T, process_vm_writev, int pid, __sanitizer_iovec *local_iov, uptr liovcnt, __sanitizer_iovec *remote_iov, uptr riovcnt, uptr flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, process_vm_writev, pid, local_iov, liovcnt, remote_iov, riovcnt, flags); SSIZE_T res = REAL(process_vm_writev)(pid, local_iov, liovcnt, remote_iov, riovcnt, flags); if (res > 0) read_iovec(ctx, local_iov, liovcnt, res); return res; } #define INIT_PROCESS_VM_READV \ COMMON_INTERCEPT_FUNCTION(process_vm_readv); \ COMMON_INTERCEPT_FUNCTION(process_vm_writev); #else #define INIT_PROCESS_VM_READV #endif #if SANITIZER_INTERCEPT_CTERMID INTERCEPTOR(char *, ctermid, char *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ctermid, s); char *res = REAL(ctermid)(s); if (res) { COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1); } return res; } #define INIT_CTERMID COMMON_INTERCEPT_FUNCTION(ctermid); #else #define INIT_CTERMID #endif #if SANITIZER_INTERCEPT_CTERMID_R INTERCEPTOR(char *, ctermid_r, char *s) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, ctermid_r, s); char *res = REAL(ctermid_r)(s); if (res) { COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1); } return res; } #define INIT_CTERMID_R COMMON_INTERCEPT_FUNCTION(ctermid_r); #else #define INIT_CTERMID_R #endif #if SANITIZER_INTERCEPT_RECV_RECVFROM INTERCEPTOR(SSIZE_T, recv, int fd, void *buf, SIZE_T len, int flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, recv, fd, buf, len, flags); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); SSIZE_T res = REAL(recv)(fd, buf, len, flags); if (res > 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, Min((SIZE_T)res, len)); } if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); return res; } INTERCEPTOR(SSIZE_T, recvfrom, int fd, void *buf, SIZE_T len, int flags, void *srcaddr, int *addrlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, recvfrom, fd, buf, len, flags, srcaddr, addrlen); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); SIZE_T srcaddr_sz; if (srcaddr) srcaddr_sz = *addrlen; (void)srcaddr_sz; // prevent "set but not used" warning SSIZE_T res = REAL(recvfrom)(fd, buf, len, flags, srcaddr, addrlen); if (res > 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, Min((SIZE_T)res, len)); if (srcaddr) COMMON_INTERCEPTOR_INITIALIZE_RANGE(srcaddr, Min((SIZE_T)*addrlen, srcaddr_sz)); } return res; } #define INIT_RECV_RECVFROM \ COMMON_INTERCEPT_FUNCTION(recv); \ COMMON_INTERCEPT_FUNCTION(recvfrom); #else #define INIT_RECV_RECVFROM #endif #if SANITIZER_INTERCEPT_SEND_SENDTO INTERCEPTOR(SSIZE_T, send, int fd, void *buf, SIZE_T len, int flags) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, send, fd, buf, len, flags); if (fd >= 0) { COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); } SSIZE_T res = REAL(send)(fd, buf, len, flags); if (common_flags()->intercept_send && res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, Min((SIZE_T)res, len)); return res; } INTERCEPTOR(SSIZE_T, sendto, int fd, void *buf, SIZE_T len, int flags, void *dstaddr, int addrlen) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, sendto, fd, buf, len, flags, dstaddr, addrlen); if (fd >= 0) { COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); } // Can't check dstaddr as it may have uninitialized padding at the end. SSIZE_T res = REAL(sendto)(fd, buf, len, flags, dstaddr, addrlen); if (common_flags()->intercept_send && res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, Min((SIZE_T)res, len)); return res; } #define INIT_SEND_SENDTO \ COMMON_INTERCEPT_FUNCTION(send); \ COMMON_INTERCEPT_FUNCTION(sendto); #else #define INIT_SEND_SENDTO #endif #if SANITIZER_INTERCEPT_EVENTFD_READ_WRITE INTERCEPTOR(int, eventfd_read, int fd, u64 *value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, eventfd_read, fd, value); COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); int res = REAL(eventfd_read)(fd, value); if (res == 0) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, sizeof(*value)); if (fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd); } return res; } INTERCEPTOR(int, eventfd_write, int fd, u64 value) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, eventfd_write, fd, value); if (fd >= 0) { COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd); COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd); } int res = REAL(eventfd_write)(fd, value); return res; } #define INIT_EVENTFD_READ_WRITE \ COMMON_INTERCEPT_FUNCTION(eventfd_read); \ COMMON_INTERCEPT_FUNCTION(eventfd_write) #else #define INIT_EVENTFD_READ_WRITE #endif #if SANITIZER_INTERCEPT_STAT INTERCEPTOR(int, stat, const char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, stat, path, buf); if (common_flags()->intercept_stat) COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); int res = REAL(stat)(path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, __sanitizer::struct_stat_sz); return res; } #define INIT_STAT COMMON_INTERCEPT_FUNCTION(stat) #else #define INIT_STAT #endif #if SANITIZER_INTERCEPT___XSTAT INTERCEPTOR(int, __xstat, int version, const char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __xstat, version, path, buf); if (common_flags()->intercept_stat) COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); int res = REAL(__xstat)(version, path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, __sanitizer::struct_stat_sz); return res; } #define INIT___XSTAT COMMON_INTERCEPT_FUNCTION(__xstat) #else #define INIT___XSTAT #endif #if SANITIZER_INTERCEPT___XSTAT64 INTERCEPTOR(int, __xstat64, int version, const char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __xstat64, version, path, buf); if (common_flags()->intercept_stat) COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); int res = REAL(__xstat64)(version, path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, __sanitizer::struct_stat64_sz); return res; } #define INIT___XSTAT64 COMMON_INTERCEPT_FUNCTION(__xstat64) #else #define INIT___XSTAT64 #endif #if SANITIZER_INTERCEPT___LXSTAT INTERCEPTOR(int, __lxstat, int version, const char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __lxstat, version, path, buf); if (common_flags()->intercept_stat) COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); int res = REAL(__lxstat)(version, path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, __sanitizer::struct_stat_sz); return res; } #define INIT___LXSTAT COMMON_INTERCEPT_FUNCTION(__lxstat) #else #define INIT___LXSTAT #endif #if SANITIZER_INTERCEPT___LXSTAT64 INTERCEPTOR(int, __lxstat64, int version, const char *path, void *buf) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, __lxstat64, version, path, buf); if (common_flags()->intercept_stat) COMMON_INTERCEPTOR_READ_STRING(ctx, path, 0); int res = REAL(__lxstat64)(version, path, buf); if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, __sanitizer::struct_stat64_sz); return res; } #define INIT___LXSTAT64 COMMON_INTERCEPT_FUNCTION(__lxstat64) #else #define INIT___LXSTAT64 #endif // FIXME: add other *stat interceptor static void InitializeCommonInterceptors() { static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1]; interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap(); INIT_TEXTDOMAIN; INIT_STRLEN; INIT_STRNLEN; INIT_STRCMP; INIT_STRNCMP; INIT_STRCASECMP; INIT_STRNCASECMP; INIT_STRSTR; INIT_STRCASESTR; INIT_STRCHR; INIT_STRCHRNUL; INIT_STRRCHR; INIT_STRSPN; INIT_STRPBRK; INIT_MEMSET; INIT_MEMMOVE; INIT_MEMCPY; INIT_MEMCHR; INIT_MEMCMP; INIT_MEMRCHR; INIT_MEMMEM; INIT_READ; INIT_PREAD; INIT_PREAD64; INIT_READV; INIT_PREADV; INIT_PREADV64; INIT_WRITE; INIT_PWRITE; INIT_PWRITE64; INIT_WRITEV; INIT_PWRITEV; INIT_PWRITEV64; INIT_PRCTL; INIT_LOCALTIME_AND_FRIENDS; INIT_STRPTIME; INIT_SCANF; INIT_ISOC99_SCANF; INIT_PRINTF; INIT_PRINTF_L; INIT_ISOC99_PRINTF; INIT_FREXP; INIT_FREXPF_FREXPL; INIT_GETPWNAM_AND_FRIENDS; INIT_GETPWNAM_R_AND_FRIENDS; INIT_GETPWENT; INIT_FGETPWENT; INIT_GETPWENT_R; INIT_SETPWENT; INIT_CLOCK_GETTIME; INIT_GETITIMER; INIT_TIME; INIT_GLOB; INIT_WAIT; INIT_WAIT4; INIT_INET; INIT_PTHREAD_GETSCHEDPARAM; INIT_GETADDRINFO; INIT_GETNAMEINFO; INIT_GETSOCKNAME; INIT_GETHOSTBYNAME; INIT_GETHOSTBYNAME_R; INIT_GETHOSTBYNAME2_R; INIT_GETHOSTBYADDR_R; INIT_GETHOSTENT_R; INIT_GETSOCKOPT; INIT_ACCEPT; INIT_ACCEPT4; INIT_MODF; INIT_RECVMSG; INIT_SENDMSG; INIT_GETPEERNAME; INIT_IOCTL; INIT_INET_ATON; INIT_SYSINFO; INIT_READDIR; INIT_READDIR64; INIT_PTRACE; INIT_SETLOCALE; INIT_GETCWD; INIT_GET_CURRENT_DIR_NAME; INIT_STRTOIMAX; INIT_MBSTOWCS; INIT_MBSNRTOWCS; INIT_WCSTOMBS; INIT_WCSNRTOMBS; INIT_WCRTOMB; INIT_TCGETATTR; INIT_REALPATH; INIT_CANONICALIZE_FILE_NAME; INIT_CONFSTR; INIT_SCHED_GETAFFINITY; INIT_SCHED_GETPARAM; INIT_STRERROR; INIT_STRERROR_R; INIT_XPG_STRERROR_R; INIT_SCANDIR; INIT_SCANDIR64; INIT_GETGROUPS; INIT_POLL; INIT_PPOLL; INIT_WORDEXP; INIT_SIGWAIT; INIT_SIGWAITINFO; INIT_SIGTIMEDWAIT; INIT_SIGSETOPS; INIT_SIGPENDING; INIT_SIGPROCMASK; INIT_BACKTRACE; INIT__EXIT; INIT_PTHREAD_MUTEX_LOCK; INIT_PTHREAD_MUTEX_UNLOCK; INIT_GETMNTENT; INIT_GETMNTENT_R; INIT_STATFS; INIT_STATFS64; INIT_STATVFS; INIT_STATVFS64; INIT_INITGROUPS; INIT_ETHER_NTOA_ATON; INIT_ETHER_HOST; INIT_ETHER_R; INIT_SHMCTL; INIT_RANDOM_R; INIT_PTHREAD_ATTR_GET; INIT_PTHREAD_ATTR_GETINHERITSCHED; INIT_PTHREAD_ATTR_GETAFFINITY_NP; INIT_PTHREAD_MUTEXATTR_GETPSHARED; INIT_PTHREAD_MUTEXATTR_GETTYPE; INIT_PTHREAD_MUTEXATTR_GETPROTOCOL; INIT_PTHREAD_MUTEXATTR_GETPRIOCEILING; INIT_PTHREAD_MUTEXATTR_GETROBUST; INIT_PTHREAD_MUTEXATTR_GETROBUST_NP; INIT_PTHREAD_RWLOCKATTR_GETPSHARED; INIT_PTHREAD_RWLOCKATTR_GETKIND_NP; INIT_PTHREAD_CONDATTR_GETPSHARED; INIT_PTHREAD_CONDATTR_GETCLOCK; INIT_PTHREAD_BARRIERATTR_GETPSHARED; INIT_TMPNAM; INIT_TMPNAM_R; INIT_TTYNAME_R; INIT_TEMPNAM; INIT_PTHREAD_SETNAME_NP; INIT_SINCOS; INIT_REMQUO; INIT_LGAMMA; INIT_LGAMMA_R; INIT_LGAMMAL_R; INIT_DRAND48_R; INIT_RAND_R; INIT_GETLINE; INIT_ICONV; INIT_TIMES; INIT_TLS_GET_ADDR; INIT_LISTXATTR; INIT_GETXATTR; INIT_GETRESID; INIT_GETIFADDRS; INIT_IF_INDEXTONAME; INIT_CAPGET; INIT_AEABI_MEM; INIT___BZERO; INIT_FTIME; INIT_XDR; INIT_TSEARCH; INIT_LIBIO_INTERNALS; INIT_FOPEN; INIT_FOPEN64; INIT_OPEN_MEMSTREAM; INIT_OBSTACK; INIT_FFLUSH; INIT_FCLOSE; INIT_DLOPEN_DLCLOSE; INIT_GETPASS; INIT_TIMERFD; INIT_MLOCKX; INIT_FOPENCOOKIE; INIT_SEM; INIT_PTHREAD_SETCANCEL; INIT_MINCORE; INIT_PROCESS_VM_READV; INIT_CTERMID; INIT_CTERMID_R; INIT_RECV_RECVFROM; INIT_SEND_SENDTO; INIT_STAT; INIT_EVENTFD_READ_WRITE; INIT___XSTAT; INIT___XSTAT64; INIT___LXSTAT; INIT___LXSTAT64; // FIXME: add other *stat interceptors. } golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_interface_internal.h0000664000175000017500000000544012723005143033424 0ustar mwhudsonmwhudson//===-- sanitizer_interface_internal.h --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is shared between run-time libraries of sanitizers. // // This header declares the sanitizer runtime interface functions. // The runtime library has to define these functions so the instrumented program // could call them. // // See also include/sanitizer/common_interface_defs.h //===----------------------------------------------------------------------===// #ifndef SANITIZER_INTERFACE_INTERNAL_H #define SANITIZER_INTERFACE_INTERNAL_H #include "sanitizer_internal_defs.h" extern "C" { // Tell the tools to write their reports to "path." instead of stderr. // The special values are "stdout" and "stderr". SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_set_report_path(const char *path); // Tell the tools to write their reports to the provided file descriptor // (casted to void *). SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_set_report_fd(void *fd); typedef struct { int coverage_sandboxed; __sanitizer::sptr coverage_fd; unsigned int coverage_max_block_size; } __sanitizer_sandbox_arguments; // Notify the tools that the sandbox is going to be turned on. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args); // This function is called by the tool when it has just finished reporting // an error. 'error_summary' is a one-line string that summarizes // the error message. This function can be overridden by the client. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_report_error_summary(const char *error_summary); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump(); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_init(); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov(__sanitizer::u32 *guard); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_annotate_contiguous_container(const void *beg, const void *end, const void *old_mid, const void *new_mid); SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_verify_contiguous_container(const void *beg, const void *mid, const void *end); SANITIZER_INTERFACE_ATTRIBUTE const void *__sanitizer_contiguous_container_find_bad_address( const void *beg, const void *mid, const void *end); } // extern "C" #endif // SANITIZER_INTERFACE_INTERNAL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/sanitizer_common/sanitizer_atomic_msvc.h0000664000175000017500000002101612737231365032105 0ustar mwhudsonmwhudson//===-- sanitizer_atomic_msvc.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Not intended for direct inclusion. Include sanitizer_atomic.h. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ATOMIC_MSVC_H #define SANITIZER_ATOMIC_MSVC_H extern "C" void _ReadWriteBarrier(); #pragma intrinsic(_ReadWriteBarrier) extern "C" void _mm_mfence(); #pragma intrinsic(_mm_mfence) extern "C" void _mm_pause(); #pragma intrinsic(_mm_pause) extern "C" char _InterlockedExchange8( // NOLINT char volatile *Addend, char Value); // NOLINT #pragma intrinsic(_InterlockedExchange8) extern "C" short _InterlockedExchange16( // NOLINT short volatile *Addend, short Value); // NOLINT #pragma intrinsic(_InterlockedExchange16) extern "C" long _InterlockedExchange( // NOLINT long volatile *Addend, long Value); // NOLINT #pragma intrinsic(_InterlockedExchange) extern "C" long _InterlockedExchangeAdd( // NOLINT long volatile * Addend, long Value); // NOLINT #pragma intrinsic(_InterlockedExchangeAdd) extern "C" char _InterlockedCompareExchange8( // NOLINT char volatile *Destination, // NOLINT char Exchange, char Comparand); // NOLINT #pragma intrinsic(_InterlockedCompareExchange8) extern "C" short _InterlockedCompareExchange16( // NOLINT short volatile *Destination, // NOLINT short Exchange, short Comparand); // NOLINT #pragma intrinsic(_InterlockedCompareExchange16) extern "C" long long _InterlockedCompareExchange64( // NOLINT long long volatile *Destination, // NOLINT long long Exchange, long long Comparand); // NOLINT #pragma intrinsic(_InterlockedCompareExchange64) extern "C" void *_InterlockedCompareExchangePointer( void *volatile *Destination, void *Exchange, void *Comparand); #pragma intrinsic(_InterlockedCompareExchangePointer) extern "C" long __cdecl _InterlockedCompareExchange( // NOLINT long volatile *Destination, // NOLINT long Exchange, long Comparand); // NOLINT #pragma intrinsic(_InterlockedCompareExchange) #ifdef _WIN64 extern "C" long long _InterlockedExchangeAdd64( // NOLINT long long volatile * Addend, long long Value); // NOLINT #pragma intrinsic(_InterlockedExchangeAdd64) #endif namespace __sanitizer { INLINE void atomic_signal_fence(memory_order) { _ReadWriteBarrier(); } INLINE void atomic_thread_fence(memory_order) { _mm_mfence(); } INLINE void proc_yield(int cnt) { for (int i = 0; i < cnt; i++) _mm_pause(); } template INLINE typename T::Type atomic_load( const volatile T *a, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_consume | memory_order_acquire | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); typename T::Type v; // FIXME(dvyukov): 64-bit load is not atomic on 32-bits. if (mo == memory_order_relaxed) { v = a->val_dont_use; } else { atomic_signal_fence(memory_order_seq_cst); v = a->val_dont_use; atomic_signal_fence(memory_order_seq_cst); } return v; } template INLINE void atomic_store(volatile T *a, typename T::Type v, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_release | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); // FIXME(dvyukov): 64-bit store is not atomic on 32-bits. if (mo == memory_order_relaxed) { a->val_dont_use = v; } else { atomic_signal_fence(memory_order_seq_cst); a->val_dont_use = v; atomic_signal_fence(memory_order_seq_cst); } if (mo == memory_order_seq_cst) atomic_thread_fence(memory_order_seq_cst); } INLINE u32 atomic_fetch_add(volatile atomic_uint32_t *a, u32 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return (u32)_InterlockedExchangeAdd( (volatile long*)&a->val_dont_use, (long)v); // NOLINT } INLINE uptr atomic_fetch_add(volatile atomic_uintptr_t *a, uptr v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); #ifdef _WIN64 return (uptr)_InterlockedExchangeAdd64( (volatile long long*)&a->val_dont_use, (long long)v); // NOLINT #else return (uptr)_InterlockedExchangeAdd( (volatile long*)&a->val_dont_use, (long)v); // NOLINT #endif } INLINE u32 atomic_fetch_sub(volatile atomic_uint32_t *a, u32 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return (u32)_InterlockedExchangeAdd( (volatile long*)&a->val_dont_use, -(long)v); // NOLINT } INLINE uptr atomic_fetch_sub(volatile atomic_uintptr_t *a, uptr v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); #ifdef _WIN64 return (uptr)_InterlockedExchangeAdd64( (volatile long long*)&a->val_dont_use, -(long long)v); // NOLINT #else return (uptr)_InterlockedExchangeAdd( (volatile long*)&a->val_dont_use, -(long)v); // NOLINT #endif } INLINE u8 atomic_exchange(volatile atomic_uint8_t *a, u8 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return (u8)_InterlockedExchange8((volatile char*)&a->val_dont_use, v); } INLINE u16 atomic_exchange(volatile atomic_uint16_t *a, u16 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return (u16)_InterlockedExchange16((volatile short*)&a->val_dont_use, v); } INLINE u32 atomic_exchange(volatile atomic_uint32_t *a, u32 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return (u32)_InterlockedExchange((volatile long*)&a->val_dont_use, v); } INLINE bool atomic_compare_exchange_strong(volatile atomic_uint8_t *a, u8 *cmp, u8 xchgv, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); u8 cmpv = *cmp; #ifdef _WIN64 u8 prev = (u8)_InterlockedCompareExchange8( (volatile char*)&a->val_dont_use, (char)xchgv, (char)cmpv); #else u8 prev; __asm { mov al, cmpv mov ecx, a mov dl, xchgv lock cmpxchg [ecx], dl mov prev, al } #endif if (prev == cmpv) return true; *cmp = prev; return false; } INLINE bool atomic_compare_exchange_strong(volatile atomic_uintptr_t *a, uptr *cmp, uptr xchg, memory_order mo) { uptr cmpv = *cmp; uptr prev = (uptr)_InterlockedCompareExchangePointer( (void*volatile*)&a->val_dont_use, (void*)xchg, (void*)cmpv); if (prev == cmpv) return true; *cmp = prev; return false; } INLINE bool atomic_compare_exchange_strong(volatile atomic_uint16_t *a, u16 *cmp, u16 xchg, memory_order mo) { u16 cmpv = *cmp; u16 prev = (u16)_InterlockedCompareExchange16( (volatile short*)&a->val_dont_use, (short)xchg, (short)cmpv); if (prev == cmpv) return true; *cmp = prev; return false; } INLINE bool atomic_compare_exchange_strong(volatile atomic_uint32_t *a, u32 *cmp, u32 xchg, memory_order mo) { u32 cmpv = *cmp; u32 prev = (u32)_InterlockedCompareExchange( (volatile long*)&a->val_dont_use, (long)xchg, (long)cmpv); if (prev == cmpv) return true; *cmp = prev; return false; } INLINE bool atomic_compare_exchange_strong(volatile atomic_uint64_t *a, u64 *cmp, u64 xchg, memory_order mo) { u64 cmpv = *cmp; u64 prev = (u64)_InterlockedCompareExchange64( (volatile long long*)&a->val_dont_use, (long long)xchg, (long long)cmpv); if (prev == cmpv) return true; *cmp = prev; return false; } template INLINE bool atomic_compare_exchange_weak(volatile T *a, typename T::Type *cmp, typename T::Type xchg, memory_order mo) { return atomic_compare_exchange_strong(a, cmp, xchg, mo); } } // namespace __sanitizer #endif // SANITIZER_ATOMIC_CLANG_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/0000775000175000017500000000000013040224626022703 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_common.h0000664000175000017500000001407712646312565025405 0ustar mwhudsonmwhudson//=-- lsan_common.h -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Private LSan header. // //===----------------------------------------------------------------------===// #ifndef LSAN_COMMON_H #define LSAN_COMMON_H #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_platform.h" #include "sanitizer_common/sanitizer_stoptheworld.h" #include "sanitizer_common/sanitizer_symbolizer.h" #if (SANITIZER_LINUX && !SANITIZER_ANDROID) && (SANITIZER_WORDSIZE == 64) \ && (defined(__x86_64__) || defined(__mips64) || defined(__aarch64__)) #define CAN_SANITIZE_LEAKS 1 #else #define CAN_SANITIZE_LEAKS 0 #endif namespace __sanitizer { class FlagParser; struct DTLS; } namespace __lsan { // Chunk tags. enum ChunkTag { kDirectlyLeaked = 0, // default kIndirectlyLeaked = 1, kReachable = 2, kIgnored = 3 }; struct Flags { #define LSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "lsan_flags.inc" #undef LSAN_FLAG void SetDefaults(); uptr pointer_alignment() const { return use_unaligned ? 1 : sizeof(uptr); } }; extern Flags lsan_flags; inline Flags *flags() { return &lsan_flags; } void RegisterLsanFlags(FlagParser *parser, Flags *f); struct Leak { u32 id; uptr hit_count; uptr total_size; u32 stack_trace_id; bool is_directly_leaked; bool is_suppressed; }; struct LeakedObject { u32 leak_id; uptr addr; uptr size; }; // Aggregates leaks by stack trace prefix. class LeakReport { public: LeakReport() : next_id_(0), leaks_(1), leaked_objects_(1) {} void AddLeakedChunk(uptr chunk, u32 stack_trace_id, uptr leaked_size, ChunkTag tag); void ReportTopLeaks(uptr max_leaks); void PrintSummary(); void ApplySuppressions(); uptr UnsuppressedLeakCount(); private: void PrintReportForLeak(uptr index); void PrintLeakedObjectsForLeak(uptr index); u32 next_id_; InternalMmapVector leaks_; InternalMmapVector leaked_objects_; }; typedef InternalMmapVector Frontier; // Platform-specific functions. void InitializePlatformSpecificModules(); void ProcessGlobalRegions(Frontier *frontier); void ProcessPlatformSpecificAllocations(Frontier *frontier); // Run stoptheworld while holding any platform-specific locks. void DoStopTheWorld(StopTheWorldCallback callback, void* argument); void ScanRangeForPointers(uptr begin, uptr end, Frontier *frontier, const char *region_type, ChunkTag tag); enum IgnoreObjectResult { kIgnoreObjectSuccess, kIgnoreObjectAlreadyIgnored, kIgnoreObjectInvalid }; // Functions called from the parent tool. void InitCommonLsan(); void DoLeakCheck(); bool DisabledInThisThread(); // Used to implement __lsan::ScopedDisabler. void DisableInThisThread(); void EnableInThisThread(); // Can be used to ignore memory allocated by an intercepted // function. struct ScopedInterceptorDisabler { ScopedInterceptorDisabler() { DisableInThisThread(); } ~ScopedInterceptorDisabler() { EnableInThisThread(); } }; // Special case for "new T[0]" where T is a type with DTOR. // new T[0] will allocate one word for the array size (0) and store a pointer // to the end of allocated chunk. inline bool IsSpecialCaseOfOperatorNew0(uptr chunk_beg, uptr chunk_size, uptr addr) { return chunk_size == sizeof(uptr) && chunk_beg + chunk_size == addr && *reinterpret_cast(chunk_beg) == 0; } // The following must be implemented in the parent tool. void ForEachChunk(ForEachChunkCallback callback, void *arg); // Returns the address range occupied by the global allocator object. void GetAllocatorGlobalRange(uptr *begin, uptr *end); // Wrappers for allocator's ForceLock()/ForceUnlock(). void LockAllocator(); void UnlockAllocator(); // Returns true if [addr, addr + sizeof(void *)) is poisoned. bool WordIsPoisoned(uptr addr); // Wrappers for ThreadRegistry access. void LockThreadRegistry(); void UnlockThreadRegistry(); bool GetThreadRangesLocked(uptr os_id, uptr *stack_begin, uptr *stack_end, uptr *tls_begin, uptr *tls_end, uptr *cache_begin, uptr *cache_end, DTLS **dtls); void ForEachExtraStackRange(uptr os_id, RangeIteratorCallback callback, void *arg); // If called from the main thread, updates the main thread's TID in the thread // registry. We need this to handle processes that fork() without a subsequent // exec(), which invalidates the recorded TID. To update it, we must call // gettid() from the main thread. Our solution is to call this function before // leak checking and also before every call to pthread_create() (to handle cases // where leak checking is initiated from a non-main thread). void EnsureMainThreadIDIsCorrect(); // If p points into a chunk that has been allocated to the user, returns its // user-visible address. Otherwise, returns 0. uptr PointsIntoChunk(void *p); // Returns address of user-visible chunk contained in this allocator chunk. uptr GetUserBegin(uptr chunk); // Helper for __lsan_ignore_object(). IgnoreObjectResult IgnoreObjectLocked(const void *p); // Wrapper for chunk metadata operations. class LsanMetadata { public: // Constructor accepts address of user-visible chunk. explicit LsanMetadata(uptr chunk); bool allocated() const; ChunkTag tag() const; void set_tag(ChunkTag value); uptr requested_size() const; u32 stack_trace_id() const; private: void *metadata_; }; } // namespace __lsan extern "C" { SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE int __lsan_is_turned_off(); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char *__lsan_default_suppressions(); } // extern "C" #endif // LSAN_COMMON_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_thread.cc0000664000175000017500000001124612771243055025511 0ustar mwhudsonmwhudson//=-- lsan_thread.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // See lsan_thread.h for details. // //===----------------------------------------------------------------------===// #include "lsan_thread.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_thread_registry.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "lsan_allocator.h" namespace __lsan { const u32 kInvalidTid = (u32) -1; static ThreadRegistry *thread_registry; static THREADLOCAL u32 current_thread_tid = kInvalidTid; static ThreadContextBase *CreateThreadContext(u32 tid) { void *mem = MmapOrDie(sizeof(ThreadContext), "ThreadContext"); return new(mem) ThreadContext(tid); } static const uptr kMaxThreads = 1 << 13; static const uptr kThreadQuarantineSize = 64; void InitializeThreadRegistry() { static ALIGNED(64) char thread_registry_placeholder[sizeof(ThreadRegistry)]; thread_registry = new(thread_registry_placeholder) ThreadRegistry(CreateThreadContext, kMaxThreads, kThreadQuarantineSize); } u32 GetCurrentThread() { return current_thread_tid; } void SetCurrentThread(u32 tid) { current_thread_tid = tid; } ThreadContext::ThreadContext(int tid) : ThreadContextBase(tid), stack_begin_(0), stack_end_(0), cache_begin_(0), cache_end_(0), tls_begin_(0), tls_end_(0), dtls_(nullptr) {} struct OnStartedArgs { uptr stack_begin, stack_end, cache_begin, cache_end, tls_begin, tls_end; DTLS *dtls; }; void ThreadContext::OnStarted(void *arg) { OnStartedArgs *args = reinterpret_cast(arg); stack_begin_ = args->stack_begin; stack_end_ = args->stack_end; tls_begin_ = args->tls_begin; tls_end_ = args->tls_end; cache_begin_ = args->cache_begin; cache_end_ = args->cache_end; dtls_ = args->dtls; } void ThreadContext::OnFinished() { AllocatorThreadFinish(); DTLS_Destroy(); } u32 ThreadCreate(u32 parent_tid, uptr user_id, bool detached) { return thread_registry->CreateThread(user_id, detached, parent_tid, /* arg */ nullptr); } void ThreadStart(u32 tid, uptr os_id) { OnStartedArgs args; uptr stack_size = 0; uptr tls_size = 0; GetThreadStackAndTls(tid == 0, &args.stack_begin, &stack_size, &args.tls_begin, &tls_size); args.stack_end = args.stack_begin + stack_size; args.tls_end = args.tls_begin + tls_size; GetAllocatorCacheRange(&args.cache_begin, &args.cache_end); args.dtls = DTLS_Get(); thread_registry->StartThread(tid, os_id, &args); } void ThreadFinish() { thread_registry->FinishThread(GetCurrentThread()); } ThreadContext *CurrentThreadContext() { if (!thread_registry) return nullptr; if (GetCurrentThread() == kInvalidTid) return nullptr; // No lock needed when getting current thread. return (ThreadContext *)thread_registry->GetThreadLocked(GetCurrentThread()); } static bool FindThreadByUid(ThreadContextBase *tctx, void *arg) { uptr uid = (uptr)arg; if (tctx->user_id == uid && tctx->status != ThreadStatusInvalid) { return true; } return false; } u32 ThreadTid(uptr uid) { return thread_registry->FindThread(FindThreadByUid, (void*)uid); } void ThreadJoin(u32 tid) { CHECK_NE(tid, kInvalidTid); thread_registry->JoinThread(tid, /* arg */nullptr); } void EnsureMainThreadIDIsCorrect() { if (GetCurrentThread() == 0) CurrentThreadContext()->os_id = GetTid(); } ///// Interface to the common LSan module. ///// bool GetThreadRangesLocked(uptr os_id, uptr *stack_begin, uptr *stack_end, uptr *tls_begin, uptr *tls_end, uptr *cache_begin, uptr *cache_end, DTLS **dtls) { ThreadContext *context = static_cast( thread_registry->FindThreadContextByOsIDLocked(os_id)); if (!context) return false; *stack_begin = context->stack_begin(); *stack_end = context->stack_end(); *tls_begin = context->tls_begin(); *tls_end = context->tls_end(); *cache_begin = context->cache_begin(); *cache_end = context->cache_end(); *dtls = context->dtls(); return true; } void ForEachExtraStackRange(uptr os_id, RangeIteratorCallback callback, void *arg) { } void LockThreadRegistry() { thread_registry->Lock(); } void UnlockThreadRegistry() { thread_registry->Unlock(); } } // namespace __lsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_common_linux.cc0000664000175000017500000001635213004051663026744 0ustar mwhudsonmwhudson//=-- lsan_common_linux.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Implementation of common leak checking functionality. Linux-specific code. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #include "lsan_common.h" #if CAN_SANITIZE_LEAKS && SANITIZER_LINUX #include #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_stackdepot.h" namespace __lsan { static const char kLinkerName[] = "ld"; static char linker_placeholder[sizeof(LoadedModule)] ALIGNED(64); static LoadedModule *linker = nullptr; static bool IsLinker(const char* full_name) { return LibraryNameIs(full_name, kLinkerName); } void InitializePlatformSpecificModules() { ListOfModules modules; modules.init(); for (LoadedModule &module : modules) { if (!IsLinker(module.full_name())) continue; if (linker == nullptr) { linker = reinterpret_cast(linker_placeholder); *linker = module; module = LoadedModule(); } else { VReport(1, "LeakSanitizer: Multiple modules match \"%s\". " "TLS will not be handled correctly.\n", kLinkerName); linker->clear(); linker = nullptr; return; } } VReport(1, "LeakSanitizer: Dynamic linker not found. " "TLS will not be handled correctly.\n"); } static int ProcessGlobalRegionsCallback(struct dl_phdr_info *info, size_t size, void *data) { Frontier *frontier = reinterpret_cast(data); for (uptr j = 0; j < info->dlpi_phnum; j++) { const ElfW(Phdr) *phdr = &(info->dlpi_phdr[j]); // We're looking for .data and .bss sections, which reside in writeable, // loadable segments. if (!(phdr->p_flags & PF_W) || (phdr->p_type != PT_LOAD) || (phdr->p_memsz == 0)) continue; uptr begin = info->dlpi_addr + phdr->p_vaddr; uptr end = begin + phdr->p_memsz; uptr allocator_begin = 0, allocator_end = 0; GetAllocatorGlobalRange(&allocator_begin, &allocator_end); if (begin <= allocator_begin && allocator_begin < end) { CHECK_LE(allocator_begin, allocator_end); CHECK_LE(allocator_end, end); if (begin < allocator_begin) ScanRangeForPointers(begin, allocator_begin, frontier, "GLOBAL", kReachable); if (allocator_end < end) ScanRangeForPointers(allocator_end, end, frontier, "GLOBAL", kReachable); } else { ScanRangeForPointers(begin, end, frontier, "GLOBAL", kReachable); } } return 0; } // Scans global variables for heap pointers. void ProcessGlobalRegions(Frontier *frontier) { if (!flags()->use_globals) return; dl_iterate_phdr(ProcessGlobalRegionsCallback, frontier); } static uptr GetCallerPC(u32 stack_id, StackDepotReverseMap *map) { CHECK(stack_id); StackTrace stack = map->Get(stack_id); // The top frame is our malloc/calloc/etc. The next frame is the caller. if (stack.size >= 2) return stack.trace[1]; return 0; } struct ProcessPlatformAllocParam { Frontier *frontier; StackDepotReverseMap *stack_depot_reverse_map; bool skip_linker_allocations; }; // ForEachChunk callback. Identifies unreachable chunks which must be treated as // reachable. Marks them as reachable and adds them to the frontier. static void ProcessPlatformSpecificAllocationsCb(uptr chunk, void *arg) { CHECK(arg); ProcessPlatformAllocParam *param = reinterpret_cast(arg); chunk = GetUserBegin(chunk); LsanMetadata m(chunk); if (m.allocated() && m.tag() != kReachable && m.tag() != kIgnored) { u32 stack_id = m.stack_trace_id(); uptr caller_pc = 0; if (stack_id > 0) caller_pc = GetCallerPC(stack_id, param->stack_depot_reverse_map); // If caller_pc is unknown, this chunk may be allocated in a coroutine. Mark // it as reachable, as we can't properly report its allocation stack anyway. if (caller_pc == 0 || (param->skip_linker_allocations && linker->containsAddress(caller_pc))) { m.set_tag(kReachable); param->frontier->push_back(chunk); } } } // Handles dynamically allocated TLS blocks by treating all chunks allocated // from ld-linux.so as reachable. // Dynamic TLS blocks contain the TLS variables of dynamically loaded modules. // They are allocated with a __libc_memalign() call in allocate_and_init() // (elf/dl-tls.c). Glibc won't tell us the address ranges occupied by those // blocks, but we can make sure they come from our own allocator by intercepting // __libc_memalign(). On top of that, there is no easy way to reach them. Their // addresses are stored in a dynamically allocated array (the DTV) which is // referenced from the static TLS. Unfortunately, we can't just rely on the DTV // being reachable from the static TLS, and the dynamic TLS being reachable from // the DTV. This is because the initial DTV is allocated before our interception // mechanism kicks in, and thus we don't recognize it as allocated memory. We // can't special-case it either, since we don't know its size. // Our solution is to include in the root set all allocations made from // ld-linux.so (which is where allocate_and_init() is implemented). This is // guaranteed to include all dynamic TLS blocks (and possibly other allocations // which we don't care about). void ProcessPlatformSpecificAllocations(Frontier *frontier) { StackDepotReverseMap stack_depot_reverse_map; ProcessPlatformAllocParam arg; arg.frontier = frontier; arg.stack_depot_reverse_map = &stack_depot_reverse_map; arg.skip_linker_allocations = flags()->use_tls && flags()->use_ld_allocations && linker != nullptr; ForEachChunk(ProcessPlatformSpecificAllocationsCb, &arg); } struct DoStopTheWorldParam { StopTheWorldCallback callback; void *argument; }; static int DoStopTheWorldCallback(struct dl_phdr_info *info, size_t size, void *data) { DoStopTheWorldParam *param = reinterpret_cast(data); StopTheWorld(param->callback, param->argument); return 1; } // LSan calls dl_iterate_phdr() from the tracer task. This may deadlock: if one // of the threads is frozen while holding the libdl lock, the tracer will hang // in dl_iterate_phdr() forever. // Luckily, (a) the lock is reentrant and (b) libc can't distinguish between the // tracer task and the thread that spawned it. Thus, if we run the tracer task // while holding the libdl lock in the parent thread, we can safely reenter it // in the tracer. The solution is to run stoptheworld from a dl_iterate_phdr() // callback in the parent thread. void DoStopTheWorld(StopTheWorldCallback callback, void *argument) { DoStopTheWorldParam param = {callback, argument}; dl_iterate_phdr(DoStopTheWorldCallback, ¶m); } } // namespace __lsan #endif // CAN_SANITIZE_LEAKS && SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_thread.h0000664000175000017500000000313112645766741025361 0ustar mwhudsonmwhudson//=-- lsan_thread.h -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Thread registry for standalone LSan. // //===----------------------------------------------------------------------===// #ifndef LSAN_THREAD_H #define LSAN_THREAD_H #include "sanitizer_common/sanitizer_thread_registry.h" namespace __sanitizer { struct DTLS; } namespace __lsan { class ThreadContext : public ThreadContextBase { public: explicit ThreadContext(int tid); void OnStarted(void *arg) override; void OnFinished() override; uptr stack_begin() { return stack_begin_; } uptr stack_end() { return stack_end_; } uptr tls_begin() { return tls_begin_; } uptr tls_end() { return tls_end_; } uptr cache_begin() { return cache_begin_; } uptr cache_end() { return cache_end_; } DTLS *dtls() { return dtls_; } private: uptr stack_begin_, stack_end_, cache_begin_, cache_end_, tls_begin_, tls_end_; DTLS *dtls_; }; void InitializeThreadRegistry(); void ThreadStart(u32 tid, uptr os_id); void ThreadFinish(); u32 ThreadCreate(u32 tid, uptr uid, bool detached); void ThreadJoin(u32 tid); u32 ThreadTid(uptr uid); u32 GetCurrentThread(); void SetCurrentThread(u32 tid); ThreadContext *CurrentThreadContext(); void EnsureMainThreadIDIsCorrect(); } // namespace __lsan #endif // LSAN_THREAD_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_allocator.cc0000664000175000017500000001675712757703753026250 0ustar mwhudsonmwhudson//=-- lsan_allocator.cc ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // See lsan_allocator.h for details. // //===----------------------------------------------------------------------===// #include "lsan_allocator.h" #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_allocator_interface.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "lsan_common.h" extern "C" void *memset(void *ptr, int value, uptr num); namespace __lsan { struct ChunkMetadata { u8 allocated : 8; // Must be first. ChunkTag tag : 2; uptr requested_size : 54; u32 stack_trace_id; }; #if defined(__mips64) || defined(__aarch64__) static const uptr kMaxAllowedMallocSize = 4UL << 30; static const uptr kRegionSizeLog = 20; static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; typedef CompactSizeClassMap SizeClassMap; typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(ChunkMetadata), SizeClassMap, kRegionSizeLog, ByteMap> PrimaryAllocator; #else static const uptr kMaxAllowedMallocSize = 8UL << 30; struct AP64 { // Allocator64 parameters. Deliberately using a short name. static const uptr kSpaceBeg = 0x600000000000ULL; static const uptr kSpaceSize = 0x40000000000ULL; // 4T. static const uptr kMetadataSize = sizeof(ChunkMetadata); typedef DefaultSizeClassMap SizeClassMap; typedef NoOpMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; typedef SizeClassAllocator64 PrimaryAllocator; #endif typedef SizeClassAllocatorLocalCache AllocatorCache; typedef LargeMmapAllocator<> SecondaryAllocator; typedef CombinedAllocator Allocator; static Allocator allocator; static THREADLOCAL AllocatorCache cache; void InitializeAllocator() { allocator.InitLinkerInitialized(common_flags()->allocator_may_return_null); } void AllocatorThreadFinish() { allocator.SwallowCache(&cache); } static ChunkMetadata *Metadata(const void *p) { return reinterpret_cast(allocator.GetMetaData(p)); } static void RegisterAllocation(const StackTrace &stack, void *p, uptr size) { if (!p) return; ChunkMetadata *m = Metadata(p); CHECK(m); m->tag = DisabledInThisThread() ? kIgnored : kDirectlyLeaked; m->stack_trace_id = StackDepotPut(stack); m->requested_size = size; atomic_store(reinterpret_cast(m), 1, memory_order_relaxed); } static void RegisterDeallocation(void *p) { if (!p) return; ChunkMetadata *m = Metadata(p); CHECK(m); atomic_store(reinterpret_cast(m), 0, memory_order_relaxed); } void *Allocate(const StackTrace &stack, uptr size, uptr alignment, bool cleared) { if (size == 0) size = 1; if (size > kMaxAllowedMallocSize) { Report("WARNING: LeakSanitizer failed to allocate %zu bytes\n", size); return nullptr; } void *p = allocator.Allocate(&cache, size, alignment, false); // Do not rely on the allocator to clear the memory (it's slow). if (cleared && allocator.FromPrimary(p)) memset(p, 0, size); RegisterAllocation(stack, p, size); if (&__sanitizer_malloc_hook) __sanitizer_malloc_hook(p, size); RunMallocHooks(p, size); return p; } void Deallocate(void *p) { if (&__sanitizer_free_hook) __sanitizer_free_hook(p); RunFreeHooks(p); RegisterDeallocation(p); allocator.Deallocate(&cache, p); } void *Reallocate(const StackTrace &stack, void *p, uptr new_size, uptr alignment) { RegisterDeallocation(p); if (new_size > kMaxAllowedMallocSize) { Report("WARNING: LeakSanitizer failed to allocate %zu bytes\n", new_size); allocator.Deallocate(&cache, p); return nullptr; } p = allocator.Reallocate(&cache, p, new_size, alignment); RegisterAllocation(stack, p, new_size); return p; } void GetAllocatorCacheRange(uptr *begin, uptr *end) { *begin = (uptr)&cache; *end = *begin + sizeof(cache); } uptr GetMallocUsableSize(const void *p) { ChunkMetadata *m = Metadata(p); if (!m) return 0; return m->requested_size; } ///// Interface to the common LSan module. ///// void LockAllocator() { allocator.ForceLock(); } void UnlockAllocator() { allocator.ForceUnlock(); } void GetAllocatorGlobalRange(uptr *begin, uptr *end) { *begin = (uptr)&allocator; *end = *begin + sizeof(allocator); } uptr PointsIntoChunk(void* p) { uptr addr = reinterpret_cast(p); uptr chunk = reinterpret_cast(allocator.GetBlockBeginFastLocked(p)); if (!chunk) return 0; // LargeMmapAllocator considers pointers to the meta-region of a chunk to be // valid, but we don't want that. if (addr < chunk) return 0; ChunkMetadata *m = Metadata(reinterpret_cast(chunk)); CHECK(m); if (!m->allocated) return 0; if (addr < chunk + m->requested_size) return chunk; if (IsSpecialCaseOfOperatorNew0(chunk, m->requested_size, addr)) return chunk; return 0; } uptr GetUserBegin(uptr chunk) { return chunk; } LsanMetadata::LsanMetadata(uptr chunk) { metadata_ = Metadata(reinterpret_cast(chunk)); CHECK(metadata_); } bool LsanMetadata::allocated() const { return reinterpret_cast(metadata_)->allocated; } ChunkTag LsanMetadata::tag() const { return reinterpret_cast(metadata_)->tag; } void LsanMetadata::set_tag(ChunkTag value) { reinterpret_cast(metadata_)->tag = value; } uptr LsanMetadata::requested_size() const { return reinterpret_cast(metadata_)->requested_size; } u32 LsanMetadata::stack_trace_id() const { return reinterpret_cast(metadata_)->stack_trace_id; } void ForEachChunk(ForEachChunkCallback callback, void *arg) { allocator.ForEachChunk(callback, arg); } IgnoreObjectResult IgnoreObjectLocked(const void *p) { void *chunk = allocator.GetBlockBegin(p); if (!chunk || p < chunk) return kIgnoreObjectInvalid; ChunkMetadata *m = Metadata(chunk); CHECK(m); if (m->allocated && (uptr)p < (uptr)chunk + m->requested_size) { if (m->tag == kIgnored) return kIgnoreObjectAlreadyIgnored; m->tag = kIgnored; return kIgnoreObjectSuccess; } else { return kIgnoreObjectInvalid; } } } // namespace __lsan using namespace __lsan; extern "C" { SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_current_allocated_bytes() { uptr stats[AllocatorStatCount]; allocator.GetStats(stats); return stats[AllocatorStatAllocated]; } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_heap_size() { uptr stats[AllocatorStatCount]; allocator.GetStats(stats); return stats[AllocatorStatMapped]; } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_free_bytes() { return 0; } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_unmapped_bytes() { return 0; } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_estimated_allocated_size(uptr size) { return size; } SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_get_ownership(const void *p) { return Metadata(p) != nullptr; } SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_allocated_size(const void *p) { return GetMallocUsableSize(p); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/.clang-format0000664000175000017500000000002512623444376025267 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan.h0000664000175000017500000000425412717003426024021 0ustar mwhudsonmwhudson//=-- lsan.h --------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Private header for standalone LSan RTL. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_stacktrace.h" #define GET_STACK_TRACE(max_size, fast) \ BufferedStackTrace stack; \ { \ uptr stack_top = 0, stack_bottom = 0; \ ThreadContext *t; \ if (fast && (t = CurrentThreadContext())) { \ stack_top = t->stack_end(); \ stack_bottom = t->stack_begin(); \ } \ if (!SANITIZER_MIPS || \ IsValidFrame(GET_CURRENT_FRAME(), stack_top, stack_bottom)) { \ stack.Unwind(max_size, StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ /* context */ 0, stack_top, stack_bottom, fast); \ } \ } #define GET_STACK_TRACE_FATAL \ GET_STACK_TRACE(kStackTraceMax, common_flags()->fast_unwind_on_fatal) #define GET_STACK_TRACE_MALLOC \ GET_STACK_TRACE(__sanitizer::common_flags()->malloc_context_size, \ common_flags()->fast_unwind_on_malloc) namespace __lsan { void InitializeInterceptors(); } // namespace __lsan extern bool lsan_inited; extern bool lsan_init_is_running; extern "C" void __lsan_init(); golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_common.cc0000664000175000017500000006306713004572421025532 0ustar mwhudsonmwhudson//=-- lsan_common.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Implementation of common leak checking functionality. // //===----------------------------------------------------------------------===// #include "lsan_common.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_placement_new.h" #include "sanitizer_common/sanitizer_procmaps.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_suppressions.h" #include "sanitizer_common/sanitizer_report_decorator.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #if CAN_SANITIZE_LEAKS namespace __lsan { // This mutex is used to prevent races between DoLeakCheck and IgnoreObject, and // also to protect the global list of root regions. BlockingMutex global_mutex(LINKER_INITIALIZED); __attribute__((tls_model("initial-exec"))) THREADLOCAL int disable_counter; bool DisabledInThisThread() { return disable_counter > 0; } void DisableInThisThread() { disable_counter++; } void EnableInThisThread() { if (!disable_counter && common_flags()->detect_leaks) { Report("Unmatched call to __lsan_enable().\n"); Die(); } disable_counter--; } Flags lsan_flags; void Flags::SetDefaults() { #define LSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "lsan_flags.inc" #undef LSAN_FLAG } void RegisterLsanFlags(FlagParser *parser, Flags *f) { #define LSAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "lsan_flags.inc" #undef LSAN_FLAG } #define LOG_POINTERS(...) \ do { \ if (flags()->log_pointers) Report(__VA_ARGS__); \ } while (0); #define LOG_THREADS(...) \ do { \ if (flags()->log_threads) Report(__VA_ARGS__); \ } while (0); ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)]; static SuppressionContext *suppression_ctx = nullptr; static const char kSuppressionLeak[] = "leak"; static const char *kSuppressionTypes[] = { kSuppressionLeak }; void InitializeSuppressions() { CHECK_EQ(nullptr, suppression_ctx); suppression_ctx = new (suppression_placeholder) // NOLINT SuppressionContext(kSuppressionTypes, ARRAY_SIZE(kSuppressionTypes)); suppression_ctx->ParseFromFile(flags()->suppressions); if (&__lsan_default_suppressions) suppression_ctx->Parse(__lsan_default_suppressions()); } static SuppressionContext *GetSuppressionContext() { CHECK(suppression_ctx); return suppression_ctx; } struct RootRegion { const void *begin; uptr size; }; InternalMmapVector *root_regions; void InitializeRootRegions() { CHECK(!root_regions); ALIGNED(64) static char placeholder[sizeof(InternalMmapVector)]; root_regions = new(placeholder) InternalMmapVector(1); } void InitCommonLsan() { InitializeRootRegions(); if (common_flags()->detect_leaks) { // Initialization which can fail or print warnings should only be done if // LSan is actually enabled. InitializeSuppressions(); InitializePlatformSpecificModules(); } } class Decorator: public __sanitizer::SanitizerCommonDecorator { public: Decorator() : SanitizerCommonDecorator() { } const char *Error() { return Red(); } const char *Leak() { return Blue(); } const char *End() { return Default(); } }; static inline bool CanBeAHeapPointer(uptr p) { // Since our heap is located in mmap-ed memory, we can assume a sensible lower // bound on heap addresses. const uptr kMinAddress = 4 * 4096; if (p < kMinAddress) return false; #if defined(__x86_64__) // Accept only canonical form user-space addresses. return ((p >> 47) == 0); #elif defined(__mips64) return ((p >> 40) == 0); #elif defined(__aarch64__) unsigned runtimeVMA = (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1); return ((p >> runtimeVMA) == 0); #else return true; #endif } // Scans the memory range, looking for byte patterns that point into allocator // chunks. Marks those chunks with |tag| and adds them to |frontier|. // There are two usage modes for this function: finding reachable chunks // (|tag| = kReachable) and finding indirectly leaked chunks // (|tag| = kIndirectlyLeaked). In the second case, there's no flood fill, // so |frontier| = 0. void ScanRangeForPointers(uptr begin, uptr end, Frontier *frontier, const char *region_type, ChunkTag tag) { CHECK(tag == kReachable || tag == kIndirectlyLeaked); const uptr alignment = flags()->pointer_alignment(); LOG_POINTERS("Scanning %s range %p-%p.\n", region_type, begin, end); uptr pp = begin; if (pp % alignment) pp = pp + alignment - pp % alignment; for (; pp + sizeof(void *) <= end; pp += alignment) { // NOLINT void *p = *reinterpret_cast(pp); if (!CanBeAHeapPointer(reinterpret_cast(p))) continue; uptr chunk = PointsIntoChunk(p); if (!chunk) continue; // Pointers to self don't count. This matters when tag == kIndirectlyLeaked. if (chunk == begin) continue; LsanMetadata m(chunk); if (m.tag() == kReachable || m.tag() == kIgnored) continue; // Do this check relatively late so we can log only the interesting cases. if (!flags()->use_poisoned && WordIsPoisoned(pp)) { LOG_POINTERS( "%p is poisoned: ignoring %p pointing into chunk %p-%p of size " "%zu.\n", pp, p, chunk, chunk + m.requested_size(), m.requested_size()); continue; } m.set_tag(tag); LOG_POINTERS("%p: found %p pointing into chunk %p-%p of size %zu.\n", pp, p, chunk, chunk + m.requested_size(), m.requested_size()); if (frontier) frontier->push_back(chunk); } } void ForEachExtraStackRangeCb(uptr begin, uptr end, void* arg) { Frontier *frontier = reinterpret_cast(arg); ScanRangeForPointers(begin, end, frontier, "FAKE STACK", kReachable); } // Scans thread data (stacks and TLS) for heap pointers. static void ProcessThreads(SuspendedThreadsList const &suspended_threads, Frontier *frontier) { InternalScopedBuffer registers(SuspendedThreadsList::RegisterCount()); uptr registers_begin = reinterpret_cast(registers.data()); uptr registers_end = registers_begin + registers.size(); for (uptr i = 0; i < suspended_threads.thread_count(); i++) { uptr os_id = static_cast(suspended_threads.GetThreadID(i)); LOG_THREADS("Processing thread %d.\n", os_id); uptr stack_begin, stack_end, tls_begin, tls_end, cache_begin, cache_end; DTLS *dtls; bool thread_found = GetThreadRangesLocked(os_id, &stack_begin, &stack_end, &tls_begin, &tls_end, &cache_begin, &cache_end, &dtls); if (!thread_found) { // If a thread can't be found in the thread registry, it's probably in the // process of destruction. Log this event and move on. LOG_THREADS("Thread %d not found in registry.\n", os_id); continue; } uptr sp; bool have_registers = (suspended_threads.GetRegistersAndSP(i, registers.data(), &sp) == 0); if (!have_registers) { Report("Unable to get registers from thread %d.\n"); // If unable to get SP, consider the entire stack to be reachable. sp = stack_begin; } if (flags()->use_registers && have_registers) ScanRangeForPointers(registers_begin, registers_end, frontier, "REGISTERS", kReachable); if (flags()->use_stacks) { LOG_THREADS("Stack at %p-%p (SP = %p).\n", stack_begin, stack_end, sp); if (sp < stack_begin || sp >= stack_end) { // SP is outside the recorded stack range (e.g. the thread is running a // signal handler on alternate stack, or swapcontext was used). // Again, consider the entire stack range to be reachable. LOG_THREADS("WARNING: stack pointer not in stack range.\n"); uptr page_size = GetPageSizeCached(); int skipped = 0; while (stack_begin < stack_end && !IsAccessibleMemoryRange(stack_begin, 1)) { skipped++; stack_begin += page_size; } LOG_THREADS("Skipped %d guard page(s) to obtain stack %p-%p.\n", skipped, stack_begin, stack_end); } else { // Shrink the stack range to ignore out-of-scope values. stack_begin = sp; } ScanRangeForPointers(stack_begin, stack_end, frontier, "STACK", kReachable); ForEachExtraStackRange(os_id, ForEachExtraStackRangeCb, frontier); } if (flags()->use_tls) { LOG_THREADS("TLS at %p-%p.\n", tls_begin, tls_end); if (cache_begin == cache_end) { ScanRangeForPointers(tls_begin, tls_end, frontier, "TLS", kReachable); } else { // Because LSan should not be loaded with dlopen(), we can assume // that allocator cache will be part of static TLS image. CHECK_LE(tls_begin, cache_begin); CHECK_GE(tls_end, cache_end); if (tls_begin < cache_begin) ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS", kReachable); if (tls_end > cache_end) ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", kReachable); } if (dtls) { for (uptr j = 0; j < dtls->dtv_size; ++j) { uptr dtls_beg = dtls->dtv[j].beg; uptr dtls_end = dtls_beg + dtls->dtv[j].size; if (dtls_beg < dtls_end) { LOG_THREADS("DTLS %zu at %p-%p.\n", j, dtls_beg, dtls_end); ScanRangeForPointers(dtls_beg, dtls_end, frontier, "DTLS", kReachable); } } } } } } static void ProcessRootRegion(Frontier *frontier, uptr root_begin, uptr root_end) { MemoryMappingLayout proc_maps(/*cache_enabled*/true); uptr begin, end, prot; while (proc_maps.Next(&begin, &end, /*offset*/ nullptr, /*filename*/ nullptr, /*filename_size*/ 0, &prot)) { uptr intersection_begin = Max(root_begin, begin); uptr intersection_end = Min(end, root_end); if (intersection_begin >= intersection_end) continue; bool is_readable = prot & MemoryMappingLayout::kProtectionRead; LOG_POINTERS("Root region %p-%p intersects with mapped region %p-%p (%s)\n", root_begin, root_end, begin, end, is_readable ? "readable" : "unreadable"); if (is_readable) ScanRangeForPointers(intersection_begin, intersection_end, frontier, "ROOT", kReachable); } } // Scans root regions for heap pointers. static void ProcessRootRegions(Frontier *frontier) { if (!flags()->use_root_regions) return; CHECK(root_regions); for (uptr i = 0; i < root_regions->size(); i++) { RootRegion region = (*root_regions)[i]; uptr begin_addr = reinterpret_cast(region.begin); ProcessRootRegion(frontier, begin_addr, begin_addr + region.size); } } static void FloodFillTag(Frontier *frontier, ChunkTag tag) { while (frontier->size()) { uptr next_chunk = frontier->back(); frontier->pop_back(); LsanMetadata m(next_chunk); ScanRangeForPointers(next_chunk, next_chunk + m.requested_size(), frontier, "HEAP", tag); } } // ForEachChunk callback. If the chunk is marked as leaked, marks all chunks // which are reachable from it as indirectly leaked. static void MarkIndirectlyLeakedCb(uptr chunk, void *arg) { chunk = GetUserBegin(chunk); LsanMetadata m(chunk); if (m.allocated() && m.tag() != kReachable) { ScanRangeForPointers(chunk, chunk + m.requested_size(), /* frontier */ nullptr, "HEAP", kIndirectlyLeaked); } } // ForEachChunk callback. If chunk is marked as ignored, adds its address to // frontier. static void CollectIgnoredCb(uptr chunk, void *arg) { CHECK(arg); chunk = GetUserBegin(chunk); LsanMetadata m(chunk); if (m.allocated() && m.tag() == kIgnored) { LOG_POINTERS("Ignored: chunk %p-%p of size %zu.\n", chunk, chunk + m.requested_size(), m.requested_size()); reinterpret_cast(arg)->push_back(chunk); } } // Sets the appropriate tag on each chunk. static void ClassifyAllChunks(SuspendedThreadsList const &suspended_threads) { // Holds the flood fill frontier. Frontier frontier(1); ForEachChunk(CollectIgnoredCb, &frontier); ProcessGlobalRegions(&frontier); ProcessThreads(suspended_threads, &frontier); ProcessRootRegions(&frontier); FloodFillTag(&frontier, kReachable); // The check here is relatively expensive, so we do this in a separate flood // fill. That way we can skip the check for chunks that are reachable // otherwise. LOG_POINTERS("Processing platform-specific allocations.\n"); CHECK_EQ(0, frontier.size()); ProcessPlatformSpecificAllocations(&frontier); FloodFillTag(&frontier, kReachable); // Iterate over leaked chunks and mark those that are reachable from other // leaked chunks. LOG_POINTERS("Scanning leaked chunks.\n"); ForEachChunk(MarkIndirectlyLeakedCb, nullptr); } // ForEachChunk callback. Resets the tags to pre-leak-check state. static void ResetTagsCb(uptr chunk, void *arg) { (void)arg; chunk = GetUserBegin(chunk); LsanMetadata m(chunk); if (m.allocated() && m.tag() != kIgnored) m.set_tag(kDirectlyLeaked); } static void PrintStackTraceById(u32 stack_trace_id) { CHECK(stack_trace_id); StackDepotGet(stack_trace_id).Print(); } // ForEachChunk callback. Aggregates information about unreachable chunks into // a LeakReport. static void CollectLeaksCb(uptr chunk, void *arg) { CHECK(arg); LeakReport *leak_report = reinterpret_cast(arg); chunk = GetUserBegin(chunk); LsanMetadata m(chunk); if (!m.allocated()) return; if (m.tag() == kDirectlyLeaked || m.tag() == kIndirectlyLeaked) { u32 resolution = flags()->resolution; u32 stack_trace_id = 0; if (resolution > 0) { StackTrace stack = StackDepotGet(m.stack_trace_id()); stack.size = Min(stack.size, resolution); stack_trace_id = StackDepotPut(stack); } else { stack_trace_id = m.stack_trace_id(); } leak_report->AddLeakedChunk(chunk, stack_trace_id, m.requested_size(), m.tag()); } } static void PrintMatchedSuppressions() { InternalMmapVector matched(1); GetSuppressionContext()->GetMatched(&matched); if (!matched.size()) return; const char *line = "-----------------------------------------------------"; Printf("%s\n", line); Printf("Suppressions used:\n"); Printf(" count bytes template\n"); for (uptr i = 0; i < matched.size(); i++) Printf("%7zu %10zu %s\n", static_cast(atomic_load_relaxed( &matched[i]->hit_count)), matched[i]->weight, matched[i]->templ); Printf("%s\n\n", line); } struct CheckForLeaksParam { bool success; LeakReport leak_report; }; static void CheckForLeaksCallback(const SuspendedThreadsList &suspended_threads, void *arg) { CheckForLeaksParam *param = reinterpret_cast(arg); CHECK(param); CHECK(!param->success); ClassifyAllChunks(suspended_threads); ForEachChunk(CollectLeaksCb, ¶m->leak_report); // Clean up for subsequent leak checks. This assumes we did not overwrite any // kIgnored tags. ForEachChunk(ResetTagsCb, nullptr); param->success = true; } static bool CheckForLeaks() { if (&__lsan_is_turned_off && __lsan_is_turned_off()) return false; EnsureMainThreadIDIsCorrect(); CheckForLeaksParam param; param.success = false; LockThreadRegistry(); LockAllocator(); DoStopTheWorld(CheckForLeaksCallback, ¶m); UnlockAllocator(); UnlockThreadRegistry(); if (!param.success) { Report("LeakSanitizer has encountered a fatal error.\n"); Report( "HINT: For debugging, try setting environment variable " "LSAN_OPTIONS=verbosity=1:log_threads=1\n"); Report( "HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)\n"); Die(); } param.leak_report.ApplySuppressions(); uptr unsuppressed_count = param.leak_report.UnsuppressedLeakCount(); if (unsuppressed_count > 0) { Decorator d; Printf("\n" "=================================================================" "\n"); Printf("%s", d.Error()); Report("ERROR: LeakSanitizer: detected memory leaks\n"); Printf("%s", d.End()); param.leak_report.ReportTopLeaks(flags()->max_leaks); } if (common_flags()->print_suppressions) PrintMatchedSuppressions(); if (unsuppressed_count > 0) { param.leak_report.PrintSummary(); return true; } return false; } void DoLeakCheck() { BlockingMutexLock l(&global_mutex); static bool already_done; if (already_done) return; already_done = true; bool have_leaks = CheckForLeaks(); if (!have_leaks) { return; } if (common_flags()->exitcode) { Die(); } } static int DoRecoverableLeakCheck() { BlockingMutexLock l(&global_mutex); bool have_leaks = CheckForLeaks(); return have_leaks ? 1 : 0; } static Suppression *GetSuppressionForAddr(uptr addr) { Suppression *s = nullptr; // Suppress by module name. SuppressionContext *suppressions = GetSuppressionContext(); if (const char *module_name = Symbolizer::GetOrInit()->GetModuleNameForPc(addr)) if (suppressions->Match(module_name, kSuppressionLeak, &s)) return s; // Suppress by file or function name. SymbolizedStack *frames = Symbolizer::GetOrInit()->SymbolizePC(addr); for (SymbolizedStack *cur = frames; cur; cur = cur->next) { if (suppressions->Match(cur->info.function, kSuppressionLeak, &s) || suppressions->Match(cur->info.file, kSuppressionLeak, &s)) { break; } } frames->ClearAll(); return s; } static Suppression *GetSuppressionForStack(u32 stack_trace_id) { StackTrace stack = StackDepotGet(stack_trace_id); for (uptr i = 0; i < stack.size; i++) { Suppression *s = GetSuppressionForAddr( StackTrace::GetPreviousInstructionPc(stack.trace[i])); if (s) return s; } return nullptr; } ///// LeakReport implementation. ///// // A hard limit on the number of distinct leaks, to avoid quadratic complexity // in LeakReport::AddLeakedChunk(). We don't expect to ever see this many leaks // in real-world applications. // FIXME: Get rid of this limit by changing the implementation of LeakReport to // use a hash table. const uptr kMaxLeaksConsidered = 5000; void LeakReport::AddLeakedChunk(uptr chunk, u32 stack_trace_id, uptr leaked_size, ChunkTag tag) { CHECK(tag == kDirectlyLeaked || tag == kIndirectlyLeaked); bool is_directly_leaked = (tag == kDirectlyLeaked); uptr i; for (i = 0; i < leaks_.size(); i++) { if (leaks_[i].stack_trace_id == stack_trace_id && leaks_[i].is_directly_leaked == is_directly_leaked) { leaks_[i].hit_count++; leaks_[i].total_size += leaked_size; break; } } if (i == leaks_.size()) { if (leaks_.size() == kMaxLeaksConsidered) return; Leak leak = { next_id_++, /* hit_count */ 1, leaked_size, stack_trace_id, is_directly_leaked, /* is_suppressed */ false }; leaks_.push_back(leak); } if (flags()->report_objects) { LeakedObject obj = {leaks_[i].id, chunk, leaked_size}; leaked_objects_.push_back(obj); } } static bool LeakComparator(const Leak &leak1, const Leak &leak2) { if (leak1.is_directly_leaked == leak2.is_directly_leaked) return leak1.total_size > leak2.total_size; else return leak1.is_directly_leaked; } void LeakReport::ReportTopLeaks(uptr num_leaks_to_report) { CHECK(leaks_.size() <= kMaxLeaksConsidered); Printf("\n"); if (leaks_.size() == kMaxLeaksConsidered) Printf("Too many leaks! Only the first %zu leaks encountered will be " "reported.\n", kMaxLeaksConsidered); uptr unsuppressed_count = UnsuppressedLeakCount(); if (num_leaks_to_report > 0 && num_leaks_to_report < unsuppressed_count) Printf("The %zu top leak(s):\n", num_leaks_to_report); InternalSort(&leaks_, leaks_.size(), LeakComparator); uptr leaks_reported = 0; for (uptr i = 0; i < leaks_.size(); i++) { if (leaks_[i].is_suppressed) continue; PrintReportForLeak(i); leaks_reported++; if (leaks_reported == num_leaks_to_report) break; } if (leaks_reported < unsuppressed_count) { uptr remaining = unsuppressed_count - leaks_reported; Printf("Omitting %zu more leak(s).\n", remaining); } } void LeakReport::PrintReportForLeak(uptr index) { Decorator d; Printf("%s", d.Leak()); Printf("%s leak of %zu byte(s) in %zu object(s) allocated from:\n", leaks_[index].is_directly_leaked ? "Direct" : "Indirect", leaks_[index].total_size, leaks_[index].hit_count); Printf("%s", d.End()); PrintStackTraceById(leaks_[index].stack_trace_id); if (flags()->report_objects) { Printf("Objects leaked above:\n"); PrintLeakedObjectsForLeak(index); Printf("\n"); } } void LeakReport::PrintLeakedObjectsForLeak(uptr index) { u32 leak_id = leaks_[index].id; for (uptr j = 0; j < leaked_objects_.size(); j++) { if (leaked_objects_[j].leak_id == leak_id) Printf("%p (%zu bytes)\n", leaked_objects_[j].addr, leaked_objects_[j].size); } } void LeakReport::PrintSummary() { CHECK(leaks_.size() <= kMaxLeaksConsidered); uptr bytes = 0, allocations = 0; for (uptr i = 0; i < leaks_.size(); i++) { if (leaks_[i].is_suppressed) continue; bytes += leaks_[i].total_size; allocations += leaks_[i].hit_count; } InternalScopedString summary(kMaxSummaryLength); summary.append("%zu byte(s) leaked in %zu allocation(s).", bytes, allocations); ReportErrorSummary(summary.data()); } void LeakReport::ApplySuppressions() { for (uptr i = 0; i < leaks_.size(); i++) { Suppression *s = GetSuppressionForStack(leaks_[i].stack_trace_id); if (s) { s->weight += leaks_[i].total_size; atomic_store_relaxed(&s->hit_count, atomic_load_relaxed(&s->hit_count) + leaks_[i].hit_count); leaks_[i].is_suppressed = true; } } } uptr LeakReport::UnsuppressedLeakCount() { uptr result = 0; for (uptr i = 0; i < leaks_.size(); i++) if (!leaks_[i].is_suppressed) result++; return result; } } // namespace __lsan #else // CAN_SANITIZE_LEAKS namespace __lsan { void InitCommonLsan() { } void DoLeakCheck() { } void DisableInThisThread() { } void EnableInThisThread() { } } #endif // CAN_SANITIZE_LEAKS using namespace __lsan; // NOLINT extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __lsan_ignore_object(const void *p) { #if CAN_SANITIZE_LEAKS if (!common_flags()->detect_leaks) return; // Cannot use PointsIntoChunk or LsanMetadata here, since the allocator is not // locked. BlockingMutexLock l(&global_mutex); IgnoreObjectResult res = IgnoreObjectLocked(p); if (res == kIgnoreObjectInvalid) VReport(1, "__lsan_ignore_object(): no heap object found at %p", p); if (res == kIgnoreObjectAlreadyIgnored) VReport(1, "__lsan_ignore_object(): " "heap object at %p is already being ignored\n", p); if (res == kIgnoreObjectSuccess) VReport(1, "__lsan_ignore_object(): ignoring heap object at %p\n", p); #endif // CAN_SANITIZE_LEAKS } SANITIZER_INTERFACE_ATTRIBUTE void __lsan_register_root_region(const void *begin, uptr size) { #if CAN_SANITIZE_LEAKS BlockingMutexLock l(&global_mutex); CHECK(root_regions); RootRegion region = {begin, size}; root_regions->push_back(region); VReport(1, "Registered root region at %p of size %llu\n", begin, size); #endif // CAN_SANITIZE_LEAKS } SANITIZER_INTERFACE_ATTRIBUTE void __lsan_unregister_root_region(const void *begin, uptr size) { #if CAN_SANITIZE_LEAKS BlockingMutexLock l(&global_mutex); CHECK(root_regions); bool removed = false; for (uptr i = 0; i < root_regions->size(); i++) { RootRegion region = (*root_regions)[i]; if (region.begin == begin && region.size == size) { removed = true; uptr last_index = root_regions->size() - 1; (*root_regions)[i] = (*root_regions)[last_index]; root_regions->pop_back(); VReport(1, "Unregistered root region at %p of size %llu\n", begin, size); break; } } if (!removed) { Report( "__lsan_unregister_root_region(): region at %p of size %llu has not " "been registered.\n", begin, size); Die(); } #endif // CAN_SANITIZE_LEAKS } SANITIZER_INTERFACE_ATTRIBUTE void __lsan_disable() { #if CAN_SANITIZE_LEAKS __lsan::DisableInThisThread(); #endif } SANITIZER_INTERFACE_ATTRIBUTE void __lsan_enable() { #if CAN_SANITIZE_LEAKS __lsan::EnableInThisThread(); #endif } SANITIZER_INTERFACE_ATTRIBUTE void __lsan_do_leak_check() { #if CAN_SANITIZE_LEAKS if (common_flags()->detect_leaks) __lsan::DoLeakCheck(); #endif // CAN_SANITIZE_LEAKS } SANITIZER_INTERFACE_ATTRIBUTE int __lsan_do_recoverable_leak_check() { #if CAN_SANITIZE_LEAKS if (common_flags()->detect_leaks) return __lsan::DoRecoverableLeakCheck(); #endif // CAN_SANITIZE_LEAKS return 0; } #if !SANITIZER_SUPPORTS_WEAK_HOOKS SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE int __lsan_is_turned_off() { return 0; } #endif } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/CMakeLists.txt0000664000175000017500000000200412760126006025440 0ustar mwhudsonmwhudsoninclude_directories(..) set(LSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF LSAN_CFLAGS) set(LSAN_COMMON_SOURCES lsan_common.cc lsan_common_linux.cc) set(LSAN_SOURCES lsan.cc lsan_allocator.cc lsan_interceptors.cc lsan_preinit.cc lsan_thread.cc) set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) add_compiler_rt_object_libraries(RTLSanCommon OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${LSAN_COMMON_SUPPORTED_ARCH} SOURCES ${LSAN_COMMON_SOURCES} CFLAGS ${LSAN_CFLAGS}) if(COMPILER_RT_HAS_LSAN) foreach(arch ${LSAN_SUPPORTED_ARCH}) add_compiler_rt_component(lsan) add_compiler_rt_runtime(clang_rt.lsan STATIC ARCHS ${arch} SOURCES ${LSAN_SOURCES} $ $ $ $ CFLAGS ${LSAN_CFLAGS} PARENT_TARGET lsan) endforeach() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_flags.inc0000664000175000017500000000406112645771765025535 0ustar mwhudsonmwhudson//===-- lsan_flags.inc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // LSan runtime flags. // //===----------------------------------------------------------------------===// #ifndef LSAN_FLAG # error "Define LSAN_FLAG prior to including this file!" #endif // LSAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. LSAN_FLAG(bool, report_objects, false, "Print addresses of leaked objects after main leak report.") LSAN_FLAG( int, resolution, 0, "Aggregate two objects into one leak if this many stack frames match. If " "zero, the entire stack trace must match.") LSAN_FLAG(int, max_leaks, 0, "The number of leaks reported.") // Flags controlling the root set of reachable memory. LSAN_FLAG(bool, use_globals, true, "Root set: include global variables (.data and .bss)") LSAN_FLAG(bool, use_stacks, true, "Root set: include thread stacks") LSAN_FLAG(bool, use_registers, true, "Root set: include thread registers") LSAN_FLAG(bool, use_tls, true, "Root set: include TLS and thread-specific storage") LSAN_FLAG(bool, use_root_regions, true, "Root set: include regions added via __lsan_register_root_region().") LSAN_FLAG(bool, use_ld_allocations, true, "Root set: mark as reachable all allocations made from dynamic " "linker. This was the old way to handle dynamic TLS, and will " "be removed soon. Do not use this flag.") LSAN_FLAG(bool, use_unaligned, false, "Consider unaligned pointers valid.") LSAN_FLAG(bool, use_poisoned, false, "Consider pointers found in poisoned memory to be valid.") LSAN_FLAG(bool, log_pointers, false, "Debug logging") LSAN_FLAG(bool, log_threads, false, "Debug logging") LSAN_FLAG(const char *, suppressions, "", "Suppressions file name.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_allocator.h0000664000175000017500000000223412377114614026061 0ustar mwhudsonmwhudson//=-- lsan_allocator.h ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Allocator for standalone LSan. // //===----------------------------------------------------------------------===// #ifndef LSAN_ALLOCATOR_H #define LSAN_ALLOCATOR_H #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_internal_defs.h" namespace __lsan { void *Allocate(const StackTrace &stack, uptr size, uptr alignment, bool cleared); void Deallocate(void *p); void *Reallocate(const StackTrace &stack, void *p, uptr new_size, uptr alignment); uptr GetMallocUsableSize(const void *p); template void ForEachChunk(const Callable &callback); void GetAllocatorCacheRange(uptr *begin, uptr *end); void AllocatorThreadFinish(); void InitializeAllocator(); } // namespace __lsan #endif // LSAN_ALLOCATOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_interceptors.cc0000664000175000017500000002123512646312565026766 0ustar mwhudsonmwhudson//=-- lsan_interceptors.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Interceptors for standalone LSan. // //===----------------------------------------------------------------------===// #include "interception/interception.h" #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "lsan.h" #include "lsan_allocator.h" #include "lsan_common.h" #include "lsan_thread.h" using namespace __lsan; extern "C" { int pthread_attr_init(void *attr); int pthread_attr_destroy(void *attr); int pthread_attr_getdetachstate(void *attr, int *v); int pthread_key_create(unsigned *key, void (*destructor)(void* v)); int pthread_setspecific(unsigned key, const void *v); } #define ENSURE_LSAN_INITED do { \ CHECK(!lsan_init_is_running); \ if (!lsan_inited) \ __lsan_init(); \ } while (0) ///// Malloc/free interceptors. ///// const bool kAlwaysClearMemory = true; namespace std { struct nothrow_t; } INTERCEPTOR(void*, malloc, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; return Allocate(stack, size, 1, kAlwaysClearMemory); } INTERCEPTOR(void, free, void *p) { ENSURE_LSAN_INITED; Deallocate(p); } INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { if (lsan_init_is_running) { // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. const uptr kCallocPoolSize = 1024; static uptr calloc_memory_for_dlsym[kCallocPoolSize]; static uptr allocated; uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize; void *mem = (void*)&calloc_memory_for_dlsym[allocated]; allocated += size_in_words; CHECK(allocated < kCallocPoolSize); return mem; } if (CallocShouldReturnNullDueToOverflow(size, nmemb)) return nullptr; ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; size *= nmemb; return Allocate(stack, size, 1, true); } INTERCEPTOR(void*, realloc, void *q, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; return Reallocate(stack, q, size, 1); } INTERCEPTOR(void*, memalign, uptr alignment, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; return Allocate(stack, size, alignment, kAlwaysClearMemory); } INTERCEPTOR(void*, aligned_alloc, uptr alignment, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; return Allocate(stack, size, alignment, kAlwaysClearMemory); } INTERCEPTOR(int, posix_memalign, void **memptr, uptr alignment, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; *memptr = Allocate(stack, size, alignment, kAlwaysClearMemory); // FIXME: Return ENOMEM if user requested more than max alloc size. return 0; } INTERCEPTOR(void *, __libc_memalign, uptr alignment, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; void *res = Allocate(stack, size, alignment, kAlwaysClearMemory); DTLS_on_libc_memalign(res, size); return res; } INTERCEPTOR(void*, valloc, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; if (size == 0) size = GetPageSizeCached(); return Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory); } INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { ENSURE_LSAN_INITED; return GetMallocUsableSize(ptr); } struct fake_mallinfo { int x[10]; }; INTERCEPTOR(struct fake_mallinfo, mallinfo, void) { struct fake_mallinfo res; internal_memset(&res, 0, sizeof(res)); return res; } INTERCEPTOR(int, mallopt, int cmd, int value) { return -1; } INTERCEPTOR(void*, pvalloc, uptr size) { ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; uptr PageSize = GetPageSizeCached(); size = RoundUpTo(size, PageSize); if (size == 0) { // pvalloc(0) should allocate one page. size = PageSize; } return Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory); } INTERCEPTOR(void, cfree, void *p) ALIAS(WRAPPER_NAME(free)); #define OPERATOR_NEW_BODY \ ENSURE_LSAN_INITED; \ GET_STACK_TRACE_MALLOC; \ return Allocate(stack, size, 1, kAlwaysClearMemory); INTERCEPTOR_ATTRIBUTE void *operator new(uptr size) { OPERATOR_NEW_BODY; } INTERCEPTOR_ATTRIBUTE void *operator new[](uptr size) { OPERATOR_NEW_BODY; } INTERCEPTOR_ATTRIBUTE void *operator new(uptr size, std::nothrow_t const&) { OPERATOR_NEW_BODY; } INTERCEPTOR_ATTRIBUTE void *operator new[](uptr size, std::nothrow_t const&) { OPERATOR_NEW_BODY; } #define OPERATOR_DELETE_BODY \ ENSURE_LSAN_INITED; \ Deallocate(ptr); INTERCEPTOR_ATTRIBUTE void operator delete(void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY; } INTERCEPTOR_ATTRIBUTE void operator delete[](void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY; } INTERCEPTOR_ATTRIBUTE void operator delete(void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY; } INTERCEPTOR_ATTRIBUTE void operator delete[](void *ptr, std::nothrow_t const &) { OPERATOR_DELETE_BODY; } ///// Thread initialization and finalization. ///// static unsigned g_thread_finalize_key; static void thread_finalize(void *v) { uptr iter = (uptr)v; if (iter > 1) { if (pthread_setspecific(g_thread_finalize_key, (void*)(iter - 1))) { Report("LeakSanitizer: failed to set thread key.\n"); Die(); } return; } ThreadFinish(); } struct ThreadParam { void *(*callback)(void *arg); void *param; atomic_uintptr_t tid; }; extern "C" void *__lsan_thread_start_func(void *arg) { ThreadParam *p = (ThreadParam*)arg; void* (*callback)(void *arg) = p->callback; void *param = p->param; // Wait until the last iteration to maximize the chance that we are the last // destructor to run. if (pthread_setspecific(g_thread_finalize_key, (void*)GetPthreadDestructorIterations())) { Report("LeakSanitizer: failed to set thread key.\n"); Die(); } int tid = 0; while ((tid = atomic_load(&p->tid, memory_order_acquire)) == 0) internal_sched_yield(); SetCurrentThread(tid); ThreadStart(tid, GetTid()); atomic_store(&p->tid, 0, memory_order_release); return callback(param); } INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void *), void *param) { ENSURE_LSAN_INITED; EnsureMainThreadIDIsCorrect(); __sanitizer_pthread_attr_t myattr; if (!attr) { pthread_attr_init(&myattr); attr = &myattr; } AdjustStackSize(attr); int detached = 0; pthread_attr_getdetachstate(attr, &detached); ThreadParam p; p.callback = callback; p.param = param; atomic_store(&p.tid, 0, memory_order_relaxed); int res; { // Ignore all allocations made by pthread_create: thread stack/TLS may be // stored by pthread for future reuse even after thread destruction, and // the linked list it's stored in doesn't even hold valid pointers to the // objects, the latter are calculated by obscure pointer arithmetic. ScopedInterceptorDisabler disabler; res = REAL(pthread_create)(th, attr, __lsan_thread_start_func, &p); } if (res == 0) { int tid = ThreadCreate(GetCurrentThread(), *(uptr *)th, detached); CHECK_NE(tid, 0); atomic_store(&p.tid, tid, memory_order_release); while (atomic_load(&p.tid, memory_order_acquire) != 0) internal_sched_yield(); } if (attr == &myattr) pthread_attr_destroy(&myattr); return res; } INTERCEPTOR(int, pthread_join, void *th, void **ret) { ENSURE_LSAN_INITED; int tid = ThreadTid((uptr)th); int res = REAL(pthread_join)(th, ret); if (res == 0) ThreadJoin(tid); return res; } namespace __lsan { void InitializeInterceptors() { INTERCEPT_FUNCTION(malloc); INTERCEPT_FUNCTION(free); INTERCEPT_FUNCTION(cfree); INTERCEPT_FUNCTION(calloc); INTERCEPT_FUNCTION(realloc); INTERCEPT_FUNCTION(memalign); INTERCEPT_FUNCTION(posix_memalign); INTERCEPT_FUNCTION(__libc_memalign); INTERCEPT_FUNCTION(valloc); INTERCEPT_FUNCTION(pvalloc); INTERCEPT_FUNCTION(malloc_usable_size); INTERCEPT_FUNCTION(mallinfo); INTERCEPT_FUNCTION(mallopt); INTERCEPT_FUNCTION(pthread_create); INTERCEPT_FUNCTION(pthread_join); if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) { Report("LeakSanitizer: failed to create thread key.\n"); Die(); } } } // namespace __lsan golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan.cc0000664000175000017500000000470012710174750024155 0ustar mwhudsonmwhudson//=-- lsan.cc -------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // Standalone LSan RTL. // //===----------------------------------------------------------------------===// #include "lsan.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "lsan_allocator.h" #include "lsan_common.h" #include "lsan_thread.h" bool lsan_inited; bool lsan_init_is_running; namespace __lsan { ///// Interface to the common LSan module. ///// bool WordIsPoisoned(uptr addr) { return false; } } // namespace __lsan using namespace __lsan; // NOLINT static void InitializeFlags() { // Set all the default values. SetCommonFlagsDefaults(); { CommonFlags cf; cf.CopyFrom(*common_flags()); cf.external_symbolizer_path = GetEnv("LSAN_SYMBOLIZER_PATH"); cf.malloc_context_size = 30; cf.intercept_tls_get_addr = true; cf.detect_leaks = true; cf.exitcode = 23; OverrideCommonFlags(cf); } Flags *f = flags(); f->SetDefaults(); FlagParser parser; RegisterLsanFlags(&parser, f); RegisterCommonFlags(&parser); parser.ParseString(GetEnv("LSAN_OPTIONS")); SetVerbosity(common_flags()->verbosity); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) parser.PrintFlagDescriptions(); } extern "C" void __lsan_init() { CHECK(!lsan_init_is_running); if (lsan_inited) return; lsan_init_is_running = true; SanitizerToolName = "LeakSanitizer"; CacheBinaryName(); AvoidCVE_2016_2143(); InitializeFlags(); InitCommonLsan(); InitializeAllocator(); InitTlsSize(); InitializeInterceptors(); InitializeThreadRegistry(); u32 tid = ThreadCreate(0, 0, true); CHECK_EQ(tid, 0); ThreadStart(tid, GetTid()); SetCurrentThread(tid); if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) Atexit(DoLeakCheck); InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir); lsan_inited = true; lsan_init_is_running = false; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_print_stack_trace() { GET_STACK_TRACE_FATAL; stack.Print(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/lsan/lsan_preinit.cc0000664000175000017500000000144512364552216025714 0ustar mwhudsonmwhudson//===-- lsan_preinit.cc ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer. // // Call __lsan_init at the very early stage of process startup. //===----------------------------------------------------------------------===// #include "lsan.h" #if SANITIZER_CAN_USE_PREINIT_ARRAY // We force __lsan_init to be called before anyone else by placing it into // .preinit_array section. __attribute__((section(".preinit_array"), used)) void (*__local_lsan_preinit)(void) = __lsan_init; #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/BlocksRuntime/0000775000175000017500000000000013040224626024527 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/BlocksRuntime/data.c0000664000175000017500000000366711363500146025620 0ustar mwhudsonmwhudson/* * data.c * * Copyright 2008-2010 Apple, Inc. Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ /******************** NSBlock support We allocate space and export a symbol to be used as the Class for the on-stack and malloc'ed copies until ObjC arrives on the scene. These data areas are set up by Foundation to link in as real classes post facto. We keep these in a separate file so that we can include the runtime code in test subprojects but not include the data so that compiled code that sees the data in libSystem doesn't get confused by a second copy. Somehow these don't get unified in a common block. **********************/ void * _NSConcreteStackBlock[32] = { 0 }; void * _NSConcreteMallocBlock[32] = { 0 }; void * _NSConcreteAutoBlock[32] = { 0 }; void * _NSConcreteFinalizingBlock[32] = { 0 }; void * _NSConcreteGlobalBlock[32] = { 0 }; void * _NSConcreteWeakBlockVariable[32] = { 0 }; void _Block_copy_error(void) { } golang-1.8-race-detector-runtime_0.0+svn285455/lib/BlocksRuntime/Block_private.h0000664000175000017500000001370111366414700027471 0ustar mwhudsonmwhudson/* * Block_private.h * * Copyright 2008-2010 Apple, Inc. Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifndef _BLOCK_PRIVATE_H_ #define _BLOCK_PRIVATE_H_ #if !defined(BLOCK_EXPORT) # if defined(__cplusplus) # define BLOCK_EXPORT extern "C" # else # define BLOCK_EXPORT extern # endif #endif #ifndef _MSC_VER #include #else /* MSVC doesn't have . Compensate. */ typedef char bool; #define true (bool)1 #define false (bool)0 #endif #if defined(__cplusplus) extern "C" { #endif enum { BLOCK_REFCOUNT_MASK = (0xffff), BLOCK_NEEDS_FREE = (1 << 24), BLOCK_HAS_COPY_DISPOSE = (1 << 25), BLOCK_HAS_CTOR = (1 << 26), /* Helpers have C++ code. */ BLOCK_IS_GC = (1 << 27), BLOCK_IS_GLOBAL = (1 << 28), BLOCK_HAS_DESCRIPTOR = (1 << 29) }; /* Revised new layout. */ struct Block_descriptor { unsigned long int reserved; unsigned long int size; void (*copy)(void *dst, void *src); void (*dispose)(void *); }; struct Block_layout { void *isa; int flags; int reserved; void (*invoke)(void *, ...); struct Block_descriptor *descriptor; /* Imported variables. */ }; struct Block_byref { void *isa; struct Block_byref *forwarding; int flags; /* refcount; */ int size; void (*byref_keep)(struct Block_byref *dst, struct Block_byref *src); void (*byref_destroy)(struct Block_byref *); /* long shared[0]; */ }; struct Block_byref_header { void *isa; struct Block_byref *forwarding; int flags; int size; }; /* Runtime support functions used by compiler when generating copy/dispose helpers. */ enum { /* See function implementation for a more complete description of these fields and combinations */ BLOCK_FIELD_IS_OBJECT = 3, /* id, NSObject, __attribute__((NSObject)), block, ... */ BLOCK_FIELD_IS_BLOCK = 7, /* a block variable */ BLOCK_FIELD_IS_BYREF = 8, /* the on stack structure holding the __block variable */ BLOCK_FIELD_IS_WEAK = 16, /* declared __weak, only used in byref copy helpers */ BLOCK_BYREF_CALLER = 128 /* called from __block (byref) copy/dispose support routines. */ }; /* Runtime entry point called by compiler when assigning objects inside copy helper routines */ BLOCK_EXPORT void _Block_object_assign(void *destAddr, const void *object, const int flags); /* BLOCK_FIELD_IS_BYREF is only used from within block copy helpers */ /* runtime entry point called by the compiler when disposing of objects inside dispose helper routine */ BLOCK_EXPORT void _Block_object_dispose(const void *object, const int flags); /* Other support functions */ /* Runtime entry to get total size of a closure */ BLOCK_EXPORT unsigned long int Block_size(void *block_basic); /* the raw data space for runtime classes for blocks */ /* class+meta used for stack, malloc, and collectable based blocks */ BLOCK_EXPORT void * _NSConcreteStackBlock[32]; BLOCK_EXPORT void * _NSConcreteMallocBlock[32]; BLOCK_EXPORT void * _NSConcreteAutoBlock[32]; BLOCK_EXPORT void * _NSConcreteFinalizingBlock[32]; BLOCK_EXPORT void * _NSConcreteGlobalBlock[32]; BLOCK_EXPORT void * _NSConcreteWeakBlockVariable[32]; /* the intercept routines that must be used under GC */ BLOCK_EXPORT void _Block_use_GC( void *(*alloc)(const unsigned long, const bool isOne, const bool isObject), void (*setHasRefcount)(const void *, const bool), void (*gc_assign_strong)(void *, void **), void (*gc_assign_weak)(const void *, void *), void (*gc_memmove)(void *, void *, unsigned long)); /* earlier version, now simply transitional */ BLOCK_EXPORT void _Block_use_GC5( void *(*alloc)(const unsigned long, const bool isOne, const bool isObject), void (*setHasRefcount)(const void *, const bool), void (*gc_assign_strong)(void *, void **), void (*gc_assign_weak)(const void *, void *)); BLOCK_EXPORT void _Block_use_RR( void (*retain)(const void *), void (*release)(const void *)); /* make a collectable GC heap based Block. Not useful under non-GC. */ BLOCK_EXPORT void *_Block_copy_collectable(const void *aBlock); /* thread-unsafe diagnostic */ BLOCK_EXPORT const char *_Block_dump(const void *block); /* Obsolete */ /* first layout */ struct Block_basic { void *isa; int Block_flags; /* int32_t */ int Block_size; /* XXX should be packed into Block_flags */ void (*Block_invoke)(void *); void (*Block_copy)(void *dst, void *src); /* iff BLOCK_HAS_COPY_DISPOSE */ void (*Block_dispose)(void *); /* iff BLOCK_HAS_COPY_DISPOSE */ /* long params[0]; // where const imports, __block storage references, etc. get laid down */ }; #if defined(__cplusplus) } #endif #endif /* _BLOCK_PRIVATE_H_ */ golang-1.8-race-detector-runtime_0.0+svn285455/lib/BlocksRuntime/Block.h0000664000175000017500000000373011363500146025735 0ustar mwhudsonmwhudson/* * Block.h * * Copyright 2008-2010 Apple, Inc. Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifndef _BLOCK_H_ #define _BLOCK_H_ #if !defined(BLOCK_EXPORT) # if defined(__cplusplus) # define BLOCK_EXPORT extern "C" # else # define BLOCK_EXPORT extern # endif #endif #if defined(__cplusplus) extern "C" { #endif /* Create a heap based copy of a Block or simply add a reference to an existing one. * This must be paired with Block_release to recover memory, even when running * under Objective-C Garbage Collection. */ BLOCK_EXPORT void *_Block_copy(const void *aBlock); /* Lose the reference, and if heap based and last reference, recover the memory. */ BLOCK_EXPORT void _Block_release(const void *aBlock); #if defined(__cplusplus) } #endif /* Type correct macros. */ #define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__))) #define Block_release(...) _Block_release((const void *)(__VA_ARGS__)) #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/BlocksRuntime/runtime.c0000664000175000017500000006360011366414700026366 0ustar mwhudsonmwhudson/* * runtime.c * * Copyright 2008-2010 Apple, Inc. Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #include "Block_private.h" #include #include #include #include #include "config.h" #ifdef HAVE_AVAILABILITY_MACROS_H #include #endif /* HAVE_AVAILABILITY_MACROS_H */ #ifdef HAVE_TARGET_CONDITIONALS_H #include #endif /* HAVE_TARGET_CONDITIONALS_H */ #if defined(HAVE_OSATOMIC_COMPARE_AND_SWAP_INT) && defined(HAVE_OSATOMIC_COMPARE_AND_SWAP_LONG) #ifdef HAVE_LIBKERN_OSATOMIC_H #include #endif /* HAVE_LIBKERN_OSATOMIC_H */ #elif defined(__WIN32__) || defined(_WIN32) #define _CRT_SECURE_NO_WARNINGS 1 #include static __inline bool OSAtomicCompareAndSwapLong(long oldl, long newl, long volatile *dst) { /* fixme barrier is overkill -- see objc-os.h */ long original = InterlockedCompareExchange(dst, newl, oldl); return (original == oldl); } static __inline bool OSAtomicCompareAndSwapInt(int oldi, int newi, int volatile *dst) { /* fixme barrier is overkill -- see objc-os.h */ int original = InterlockedCompareExchange(dst, newi, oldi); return (original == oldi); } /* * Check to see if the GCC atomic built-ins are available. If we're on * a 64-bit system, make sure we have an 8-byte atomic function * available. * */ #elif defined(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT) && defined(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_LONG) static __inline bool OSAtomicCompareAndSwapLong(long oldl, long newl, long volatile *dst) { return __sync_bool_compare_and_swap(dst, oldl, newl); } static __inline bool OSAtomicCompareAndSwapInt(int oldi, int newi, int volatile *dst) { return __sync_bool_compare_and_swap(dst, oldi, newi); } #else #error unknown atomic compare-and-swap primitive #endif /* HAVE_OSATOMIC_COMPARE_AND_SWAP_INT && HAVE_OSATOMIC_COMPARE_AND_SWAP_LONG */ /* * Globals: */ static void *_Block_copy_class = _NSConcreteMallocBlock; static void *_Block_copy_finalizing_class = _NSConcreteMallocBlock; static int _Block_copy_flag = BLOCK_NEEDS_FREE; static int _Byref_flag_initial_value = BLOCK_NEEDS_FREE | 2; static const int WANTS_ONE = (1 << 16); static bool isGC = false; /* * Internal Utilities: */ #if 0 static unsigned long int latching_incr_long(unsigned long int *where) { while (1) { unsigned long int old_value = *(volatile unsigned long int *)where; if ((old_value & BLOCK_REFCOUNT_MASK) == BLOCK_REFCOUNT_MASK) { return BLOCK_REFCOUNT_MASK; } if (OSAtomicCompareAndSwapLong(old_value, old_value+1, (volatile long int *)where)) { return old_value+1; } } } #endif /* if 0 */ static int latching_incr_int(int *where) { while (1) { int old_value = *(volatile int *)where; if ((old_value & BLOCK_REFCOUNT_MASK) == BLOCK_REFCOUNT_MASK) { return BLOCK_REFCOUNT_MASK; } if (OSAtomicCompareAndSwapInt(old_value, old_value+1, (volatile int *)where)) { return old_value+1; } } } #if 0 static int latching_decr_long(unsigned long int *where) { while (1) { unsigned long int old_value = *(volatile int *)where; if ((old_value & BLOCK_REFCOUNT_MASK) == BLOCK_REFCOUNT_MASK) { return BLOCK_REFCOUNT_MASK; } if ((old_value & BLOCK_REFCOUNT_MASK) == 0) { return 0; } if (OSAtomicCompareAndSwapLong(old_value, old_value-1, (volatile long int *)where)) { return old_value-1; } } } #endif /* if 0 */ static int latching_decr_int(int *where) { while (1) { int old_value = *(volatile int *)where; if ((old_value & BLOCK_REFCOUNT_MASK) == BLOCK_REFCOUNT_MASK) { return BLOCK_REFCOUNT_MASK; } if ((old_value & BLOCK_REFCOUNT_MASK) == 0) { return 0; } if (OSAtomicCompareAndSwapInt(old_value, old_value-1, (volatile int *)where)) { return old_value-1; } } } /* * GC support stub routines: */ #if 0 #pragma mark GC Support Routines #endif /* if 0 */ static void *_Block_alloc_default(const unsigned long size, const bool initialCountIsOne, const bool isObject) { return malloc(size); } static void _Block_assign_default(void *value, void **destptr) { *destptr = value; } static void _Block_setHasRefcount_default(const void *ptr, const bool hasRefcount) { } static void _Block_do_nothing(const void *aBlock) { } static void _Block_retain_object_default(const void *ptr) { if (!ptr) return; } static void _Block_release_object_default(const void *ptr) { if (!ptr) return; } static void _Block_assign_weak_default(const void *ptr, void *dest) { *(void **)dest = (void *)ptr; } static void _Block_memmove_default(void *dst, void *src, unsigned long size) { memmove(dst, src, (size_t)size); } static void _Block_memmove_gc_broken(void *dest, void *src, unsigned long size) { void **destp = (void **)dest; void **srcp = (void **)src; while (size) { _Block_assign_default(*srcp, destp); destp++; srcp++; size -= sizeof(void *); } } /* * GC support callout functions - initially set to stub routines: */ static void *(*_Block_allocator)(const unsigned long, const bool isOne, const bool isObject) = _Block_alloc_default; static void (*_Block_deallocator)(const void *) = (void (*)(const void *))free; static void (*_Block_assign)(void *value, void **destptr) = _Block_assign_default; static void (*_Block_setHasRefcount)(const void *ptr, const bool hasRefcount) = _Block_setHasRefcount_default; static void (*_Block_retain_object)(const void *ptr) = _Block_retain_object_default; static void (*_Block_release_object)(const void *ptr) = _Block_release_object_default; static void (*_Block_assign_weak)(const void *dest, void *ptr) = _Block_assign_weak_default; static void (*_Block_memmove)(void *dest, void *src, unsigned long size) = _Block_memmove_default; /* * GC support SPI functions - called from ObjC runtime and CoreFoundation: */ /* Public SPI * Called from objc-auto to turn on GC. * version 3, 4 arg, but changed 1st arg */ void _Block_use_GC( void *(*alloc)(const unsigned long, const bool isOne, const bool isObject), void (*setHasRefcount)(const void *, const bool), void (*gc_assign)(void *, void **), void (*gc_assign_weak)(const void *, void *), void (*gc_memmove)(void *, void *, unsigned long)) { isGC = true; _Block_allocator = alloc; _Block_deallocator = _Block_do_nothing; _Block_assign = gc_assign; _Block_copy_flag = BLOCK_IS_GC; _Block_copy_class = _NSConcreteAutoBlock; /* blocks with ctors & dtors need to have the dtor run from a class with a finalizer */ _Block_copy_finalizing_class = _NSConcreteFinalizingBlock; _Block_setHasRefcount = setHasRefcount; _Byref_flag_initial_value = BLOCK_IS_GC; // no refcount _Block_retain_object = _Block_do_nothing; _Block_release_object = _Block_do_nothing; _Block_assign_weak = gc_assign_weak; _Block_memmove = gc_memmove; } /* transitional */ void _Block_use_GC5( void *(*alloc)(const unsigned long, const bool isOne, const bool isObject), void (*setHasRefcount)(const void *, const bool), void (*gc_assign)(void *, void **), void (*gc_assign_weak)(const void *, void *)) { /* until objc calls _Block_use_GC it will call us; supply a broken internal memmove implementation until then */ _Block_use_GC(alloc, setHasRefcount, gc_assign, gc_assign_weak, _Block_memmove_gc_broken); } /* * Called from objc-auto to alternatively turn on retain/release. * Prior to this the only "object" support we can provide is for those * super special objects that live in libSystem, namely dispatch queues. * Blocks and Block_byrefs have their own special entry points. * */ void _Block_use_RR( void (*retain)(const void *), void (*release)(const void *)) { _Block_retain_object = retain; _Block_release_object = release; } /* * Internal Support routines for copying: */ #if 0 #pragma mark Copy/Release support #endif /* if 0 */ /* Copy, or bump refcount, of a block. If really copying, call the copy helper if present. */ static void *_Block_copy_internal(const void *arg, const int flags) { struct Block_layout *aBlock; const bool wantsOne = (WANTS_ONE & flags) == WANTS_ONE; //printf("_Block_copy_internal(%p, %x)\n", arg, flags); if (!arg) return NULL; // The following would be better done as a switch statement aBlock = (struct Block_layout *)arg; if (aBlock->flags & BLOCK_NEEDS_FREE) { // latches on high latching_incr_int(&aBlock->flags); return aBlock; } else if (aBlock->flags & BLOCK_IS_GC) { // GC refcounting is expensive so do most refcounting here. if (wantsOne && ((latching_incr_int(&aBlock->flags) & BLOCK_REFCOUNT_MASK) == 1)) { // Tell collector to hang on this - it will bump the GC refcount version _Block_setHasRefcount(aBlock, true); } return aBlock; } else if (aBlock->flags & BLOCK_IS_GLOBAL) { return aBlock; } // Its a stack block. Make a copy. if (!isGC) { struct Block_layout *result = malloc(aBlock->descriptor->size); if (!result) return (void *)0; memmove(result, aBlock, aBlock->descriptor->size); // bitcopy first // reset refcount result->flags &= ~(BLOCK_REFCOUNT_MASK); // XXX not needed result->flags |= BLOCK_NEEDS_FREE | 1; result->isa = _NSConcreteMallocBlock; if (result->flags & BLOCK_HAS_COPY_DISPOSE) { //printf("calling block copy helper %p(%p, %p)...\n", aBlock->descriptor->copy, result, aBlock); (*aBlock->descriptor->copy)(result, aBlock); // do fixup } return result; } else { // Under GC want allocation with refcount 1 so we ask for "true" if wantsOne // This allows the copy helper routines to make non-refcounted block copies under GC unsigned long int flags = aBlock->flags; bool hasCTOR = (flags & BLOCK_HAS_CTOR) != 0; struct Block_layout *result = _Block_allocator(aBlock->descriptor->size, wantsOne, hasCTOR); if (!result) return (void *)0; memmove(result, aBlock, aBlock->descriptor->size); // bitcopy first // reset refcount // if we copy a malloc block to a GC block then we need to clear NEEDS_FREE. flags &= ~(BLOCK_NEEDS_FREE|BLOCK_REFCOUNT_MASK); // XXX not needed if (wantsOne) flags |= BLOCK_IS_GC | 1; else flags |= BLOCK_IS_GC; result->flags = flags; if (flags & BLOCK_HAS_COPY_DISPOSE) { //printf("calling block copy helper...\n"); (*aBlock->descriptor->copy)(result, aBlock); // do fixup } if (hasCTOR) { result->isa = _NSConcreteFinalizingBlock; } else { result->isa = _NSConcreteAutoBlock; } return result; } } /* * Runtime entry points for maintaining the sharing knowledge of byref data blocks. * * A closure has been copied and its fixup routine is asking us to fix up the reference to the shared byref data * Closures that aren't copied must still work, so everyone always accesses variables after dereferencing the forwarding ptr. * We ask if the byref pointer that we know about has already been copied to the heap, and if so, increment it. * Otherwise we need to copy it and update the stack forwarding pointer * XXX We need to account for weak/nonretained read-write barriers. */ static void _Block_byref_assign_copy(void *dest, const void *arg, const int flags) { struct Block_byref **destp = (struct Block_byref **)dest; struct Block_byref *src = (struct Block_byref *)arg; //printf("_Block_byref_assign_copy called, byref destp %p, src %p, flags %x\n", destp, src, flags); //printf("src dump: %s\n", _Block_byref_dump(src)); if (src->forwarding->flags & BLOCK_IS_GC) { ; // don't need to do any more work } else if ((src->forwarding->flags & BLOCK_REFCOUNT_MASK) == 0) { //printf("making copy\n"); // src points to stack bool isWeak = ((flags & (BLOCK_FIELD_IS_BYREF|BLOCK_FIELD_IS_WEAK)) == (BLOCK_FIELD_IS_BYREF|BLOCK_FIELD_IS_WEAK)); // if its weak ask for an object (only matters under GC) struct Block_byref *copy = (struct Block_byref *)_Block_allocator(src->size, false, isWeak); copy->flags = src->flags | _Byref_flag_initial_value; // non-GC one for caller, one for stack copy->forwarding = copy; // patch heap copy to point to itself (skip write-barrier) src->forwarding = copy; // patch stack to point to heap copy copy->size = src->size; if (isWeak) { copy->isa = &_NSConcreteWeakBlockVariable; // mark isa field so it gets weak scanning } if (src->flags & BLOCK_HAS_COPY_DISPOSE) { // Trust copy helper to copy everything of interest // If more than one field shows up in a byref block this is wrong XXX copy->byref_keep = src->byref_keep; copy->byref_destroy = src->byref_destroy; (*src->byref_keep)(copy, src); } else { // just bits. Blast 'em using _Block_memmove in case they're __strong _Block_memmove( (void *)©->byref_keep, (void *)&src->byref_keep, src->size - sizeof(struct Block_byref_header)); } } // already copied to heap else if ((src->forwarding->flags & BLOCK_NEEDS_FREE) == BLOCK_NEEDS_FREE) { latching_incr_int(&src->forwarding->flags); } // assign byref data block pointer into new Block _Block_assign(src->forwarding, (void **)destp); } // Old compiler SPI static void _Block_byref_release(const void *arg) { struct Block_byref *shared_struct = (struct Block_byref *)arg; int refcount; // dereference the forwarding pointer since the compiler isn't doing this anymore (ever?) shared_struct = shared_struct->forwarding; //printf("_Block_byref_release %p called, flags are %x\n", shared_struct, shared_struct->flags); // To support C++ destructors under GC we arrange for there to be a finalizer for this // by using an isa that directs the code to a finalizer that calls the byref_destroy method. if ((shared_struct->flags & BLOCK_NEEDS_FREE) == 0) { return; // stack or GC or global } refcount = shared_struct->flags & BLOCK_REFCOUNT_MASK; if (refcount <= 0) { printf("_Block_byref_release: Block byref data structure at %p underflowed\n", arg); } else if ((latching_decr_int(&shared_struct->flags) & BLOCK_REFCOUNT_MASK) == 0) { //printf("disposing of heap based byref block\n"); if (shared_struct->flags & BLOCK_HAS_COPY_DISPOSE) { //printf("calling out to helper\n"); (*shared_struct->byref_destroy)(shared_struct); } _Block_deallocator((struct Block_layout *)shared_struct); } } /* * * API supporting SPI * _Block_copy, _Block_release, and (old) _Block_destroy * */ #if 0 #pragma mark SPI/API #endif /* if 0 */ void *_Block_copy(const void *arg) { return _Block_copy_internal(arg, WANTS_ONE); } // API entry point to release a copied Block void _Block_release(void *arg) { struct Block_layout *aBlock = (struct Block_layout *)arg; int32_t newCount; if (!aBlock) return; newCount = latching_decr_int(&aBlock->flags) & BLOCK_REFCOUNT_MASK; if (newCount > 0) return; // Hit zero if (aBlock->flags & BLOCK_IS_GC) { // Tell GC we no longer have our own refcounts. GC will decr its refcount // and unless someone has done a CFRetain or marked it uncollectable it will // now be subject to GC reclamation. _Block_setHasRefcount(aBlock, false); } else if (aBlock->flags & BLOCK_NEEDS_FREE) { if (aBlock->flags & BLOCK_HAS_COPY_DISPOSE)(*aBlock->descriptor->dispose)(aBlock); _Block_deallocator(aBlock); } else if (aBlock->flags & BLOCK_IS_GLOBAL) { ; } else { printf("Block_release called upon a stack Block: %p, ignored\n", (void *)aBlock); } } // Old Compiler SPI point to release a copied Block used by the compiler in dispose helpers static void _Block_destroy(const void *arg) { struct Block_layout *aBlock; if (!arg) return; aBlock = (struct Block_layout *)arg; if (aBlock->flags & BLOCK_IS_GC) { // assert(aBlock->Block_flags & BLOCK_HAS_CTOR); return; // ignore, we are being called because of a DTOR } _Block_release(aBlock); } /* * * SPI used by other layers * */ // SPI, also internal. Called from NSAutoBlock only under GC void *_Block_copy_collectable(const void *aBlock) { return _Block_copy_internal(aBlock, 0); } // SPI unsigned long int Block_size(void *arg) { return ((struct Block_layout *)arg)->descriptor->size; } #if 0 #pragma mark Compiler SPI entry points #endif /* if 0 */ /******************************************************* Entry points used by the compiler - the real API! A Block can reference four different kinds of things that require help when the Block is copied to the heap. 1) C++ stack based objects 2) References to Objective-C objects 3) Other Blocks 4) __block variables In these cases helper functions are synthesized by the compiler for use in Block_copy and Block_release, called the copy and dispose helpers. The copy helper emits a call to the C++ const copy constructor for C++ stack based objects and for the rest calls into the runtime support function _Block_object_assign. The dispose helper has a call to the C++ destructor for case 1 and a call into _Block_object_dispose for the rest. The flags parameter of _Block_object_assign and _Block_object_dispose is set to * BLOCK_FIELD_IS_OBJECT (3), for the case of an Objective-C Object, * BLOCK_FIELD_IS_BLOCK (7), for the case of another Block, and * BLOCK_FIELD_IS_BYREF (8), for the case of a __block variable. If the __block variable is marked weak the compiler also or's in BLOCK_FIELD_IS_WEAK (16). So the Block copy/dispose helpers should only ever generate the four flag values of 3, 7, 8, and 24. When a __block variable is either a C++ object, an Objective-C object, or another Block then the compiler also generates copy/dispose helper functions. Similarly to the Block copy helper, the "__block" copy helper (formerly and still a.k.a. "byref" copy helper) will do a C++ copy constructor (not a const one though!) and the dispose helper will do the destructor. And similarly the helpers will call into the same two support functions with the same values for objects and Blocks with the additional BLOCK_BYREF_CALLER (128) bit of information supplied. So the __block copy/dispose helpers will generate flag values of 3 or 7 for objects and Blocks respectively, with BLOCK_FIELD_IS_WEAK (16) or'ed as appropriate and always 128 or'd in, for the following set of possibilities: __block id 128+3 __weak block id 128+3+16 __block (^Block) 128+7 __weak __block (^Block) 128+7+16 The implementation of the two routines would be improved by switch statements enumerating the eight cases. ********************************************************/ /* * When Blocks or Block_byrefs hold objects then their copy routine helpers use this entry point * to do the assignment. */ void _Block_object_assign(void *destAddr, const void *object, const int flags) { //printf("_Block_object_assign(*%p, %p, %x)\n", destAddr, object, flags); if ((flags & BLOCK_BYREF_CALLER) == BLOCK_BYREF_CALLER) { if ((flags & BLOCK_FIELD_IS_WEAK) == BLOCK_FIELD_IS_WEAK) { _Block_assign_weak(object, destAddr); } else { // do *not* retain or *copy* __block variables whatever they are _Block_assign((void *)object, destAddr); } } else if ((flags & BLOCK_FIELD_IS_BYREF) == BLOCK_FIELD_IS_BYREF) { // copying a __block reference from the stack Block to the heap // flags will indicate if it holds a __weak reference and needs a special isa _Block_byref_assign_copy(destAddr, object, flags); } // (this test must be before next one) else if ((flags & BLOCK_FIELD_IS_BLOCK) == BLOCK_FIELD_IS_BLOCK) { // copying a Block declared variable from the stack Block to the heap _Block_assign(_Block_copy_internal(object, flags), destAddr); } // (this test must be after previous one) else if ((flags & BLOCK_FIELD_IS_OBJECT) == BLOCK_FIELD_IS_OBJECT) { //printf("retaining object at %p\n", object); _Block_retain_object(object); //printf("done retaining object at %p\n", object); _Block_assign((void *)object, destAddr); } } // When Blocks or Block_byrefs hold objects their destroy helper routines call this entry point // to help dispose of the contents // Used initially only for __attribute__((NSObject)) marked pointers. void _Block_object_dispose(const void *object, const int flags) { //printf("_Block_object_dispose(%p, %x)\n", object, flags); if (flags & BLOCK_FIELD_IS_BYREF) { // get rid of the __block data structure held in a Block _Block_byref_release(object); } else if ((flags & (BLOCK_FIELD_IS_BLOCK|BLOCK_BYREF_CALLER)) == BLOCK_FIELD_IS_BLOCK) { // get rid of a referenced Block held by this Block // (ignore __block Block variables, compiler doesn't need to call us) _Block_destroy(object); } else if ((flags & (BLOCK_FIELD_IS_WEAK|BLOCK_FIELD_IS_BLOCK|BLOCK_BYREF_CALLER)) == BLOCK_FIELD_IS_OBJECT) { // get rid of a referenced object held by this Block // (ignore __block object variables, compiler doesn't need to call us) _Block_release_object(object); } } /* * Debugging support: */ #if 0 #pragma mark Debugging #endif /* if 0 */ const char *_Block_dump(const void *block) { struct Block_layout *closure = (struct Block_layout *)block; static char buffer[512]; char *cp = buffer; if (closure == NULL) { sprintf(cp, "NULL passed to _Block_dump\n"); return buffer; } if (! (closure->flags & BLOCK_HAS_DESCRIPTOR)) { printf("Block compiled by obsolete compiler, please recompile source for this Block\n"); exit(1); } cp += sprintf(cp, "^%p (new layout) =\n", (void *)closure); if (closure->isa == NULL) { cp += sprintf(cp, "isa: NULL\n"); } else if (closure->isa == _NSConcreteStackBlock) { cp += sprintf(cp, "isa: stack Block\n"); } else if (closure->isa == _NSConcreteMallocBlock) { cp += sprintf(cp, "isa: malloc heap Block\n"); } else if (closure->isa == _NSConcreteAutoBlock) { cp += sprintf(cp, "isa: GC heap Block\n"); } else if (closure->isa == _NSConcreteGlobalBlock) { cp += sprintf(cp, "isa: global Block\n"); } else if (closure->isa == _NSConcreteFinalizingBlock) { cp += sprintf(cp, "isa: finalizing Block\n"); } else { cp += sprintf(cp, "isa?: %p\n", (void *)closure->isa); } cp += sprintf(cp, "flags:"); if (closure->flags & BLOCK_HAS_DESCRIPTOR) { cp += sprintf(cp, " HASDESCRIPTOR"); } if (closure->flags & BLOCK_NEEDS_FREE) { cp += sprintf(cp, " FREEME"); } if (closure->flags & BLOCK_IS_GC) { cp += sprintf(cp, " ISGC"); } if (closure->flags & BLOCK_HAS_COPY_DISPOSE) { cp += sprintf(cp, " HASHELP"); } if (closure->flags & BLOCK_HAS_CTOR) { cp += sprintf(cp, " HASCTOR"); } cp += sprintf(cp, "\nrefcount: %u\n", closure->flags & BLOCK_REFCOUNT_MASK); cp += sprintf(cp, "invoke: %p\n", (void *)(uintptr_t)closure->invoke); { struct Block_descriptor *dp = closure->descriptor; cp += sprintf(cp, "descriptor: %p\n", (void *)dp); cp += sprintf(cp, "descriptor->reserved: %lu\n", dp->reserved); cp += sprintf(cp, "descriptor->size: %lu\n", dp->size); if (closure->flags & BLOCK_HAS_COPY_DISPOSE) { cp += sprintf(cp, "descriptor->copy helper: %p\n", (void *)(uintptr_t)dp->copy); cp += sprintf(cp, "descriptor->dispose helper: %p\n", (void *)(uintptr_t)dp->dispose); } } return buffer; } const char *_Block_byref_dump(struct Block_byref *src) { static char buffer[256]; char *cp = buffer; cp += sprintf(cp, "byref data block %p contents:\n", (void *)src); cp += sprintf(cp, " forwarding: %p\n", (void *)src->forwarding); cp += sprintf(cp, " flags: 0x%x\n", src->flags); cp += sprintf(cp, " size: %d\n", src->size); if (src->flags & BLOCK_HAS_COPY_DISPOSE) { cp += sprintf(cp, " copy helper: %p\n", (void *)(uintptr_t)src->byref_keep); cp += sprintf(cp, " dispose helper: %p\n", (void *)(uintptr_t)src->byref_destroy); } return buffer; } golang-1.8-race-detector-runtime_0.0+svn285455/lib/stats/0000775000175000017500000000000013040224626023104 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/stats/stats_client.cc0000664000175000017500000000427512761364562026134 0ustar mwhudsonmwhudson//===-- stats_client.cc ---------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Sanitizer statistics gathering. Manages statistics for a module (executable // or DSO) and registers statistics with the process. // // This is linked into each individual modle and cannot directly use functions // declared in sanitizer_common. // //===----------------------------------------------------------------------===// #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #else #include #endif #include #include #include "sanitizer_common/sanitizer_internal_defs.h" #include "stats/stats.h" using namespace __sanitizer; namespace { void *LookupSymbolFromMain(const char *name) { #ifdef _WIN32 return reinterpret_cast(GetProcAddress(GetModuleHandle(0), name)); #else return dlsym(RTLD_DEFAULT, name); #endif } StatModule *list; struct RegisterSanStats { unsigned module_id; RegisterSanStats() { typedef unsigned (*reg_func_t)(StatModule **); reg_func_t reg_func = reinterpret_cast( LookupSymbolFromMain("__sanitizer_stats_register")); if (reg_func) module_id = reg_func(&list); } ~RegisterSanStats() { typedef void (*unreg_func_t)(unsigned); unreg_func_t unreg_func = reinterpret_cast( LookupSymbolFromMain("__sanitizer_stats_unregister")); if (unreg_func) unreg_func(module_id); } } reg; } extern "C" void __sanitizer_stat_init(StatModule *mod) { mod->next = list; list = mod; } extern "C" void __sanitizer_stat_report(StatInfo *s) { s->addr = GET_CALLER_PC(); #if defined(_WIN64) && !defined(__clang__) uptr old_data = InterlockedIncrement64(reinterpret_cast(&s->data)); #elif defined(_WIN32) && !defined(__clang__) uptr old_data = InterlockedIncrement(&s->data); #else uptr old_data = __sync_fetch_and_add(&s->data, 1); #endif // Overflow check. if (CountFromData(old_data + 1) == 0) Trap(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/stats/CMakeLists.txt0000664000175000017500000000131312741012374025644 0ustar mwhudsonmwhudsoninclude_directories(..) add_custom_target(stats) set_target_properties(stats PROPERTIES FOLDER "Compiler-RT Misc") if(APPLE) set(STATS_LIB_FLAVOR SHARED) else() set(STATS_LIB_FLAVOR STATIC) endif() add_compiler_rt_runtime(clang_rt.stats ${STATS_LIB_FLAVOR} ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} OS ${SANITIZER_COMMON_SUPPORTED_OS} SOURCES stats.cc OBJECT_LIBS RTSanitizerCommon RTSanitizerCommonLibc CFLAGS ${SANITIZER_COMMON_CFLAGS} PARENT_TARGET stats) add_compiler_rt_runtime(clang_rt.stats_client STATIC ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH} OS ${SANITIZER_COMMON_SUPPORTED_OS} SOURCES stats_client.cc CFLAGS ${SANITIZER_COMMON_CFLAGS} PARENT_TARGET stats) golang-1.8-race-detector-runtime_0.0+svn285455/lib/stats/stats.cc0000664000175000017500000000663512662654403024574 0ustar mwhudsonmwhudson//===-- stats.cc ----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Sanitizer statistics gathering. Manages statistics for a process and is // responsible for writing the report file. // //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_internal_defs.h" #if SANITIZER_POSIX #include "sanitizer_common/sanitizer_posix.h" #endif #include "sanitizer_common/sanitizer_symbolizer.h" #include "stats/stats.h" #if SANITIZER_POSIX #include #endif using namespace __sanitizer; namespace { InternalMmapVectorNoCtor modules; StaticSpinMutex modules_mutex; fd_t stats_fd; void WriteLE(fd_t fd, uptr val) { char chars[sizeof(uptr)]; for (unsigned i = 0; i != sizeof(uptr); ++i) { chars[i] = val >> (i * 8); } WriteToFile(fd, chars, sizeof(uptr)); } void OpenStatsFile(const char *path_env) { InternalScopedBuffer path(kMaxPathLength); SubstituteForFlagValue(path_env, path.data(), kMaxPathLength); error_t err; stats_fd = OpenFile(path.data(), WrOnly, &err); if (stats_fd == kInvalidFd) { Report("stats: failed to open %s for writing (reason: %d)\n", path.data(), err); return; } char sizeof_uptr = sizeof(uptr); WriteToFile(stats_fd, &sizeof_uptr, 1); } void WriteModuleReport(StatModule **smodp) { CHECK(smodp); const char *path_env = GetEnv("SANITIZER_STATS_PATH"); if (!path_env || stats_fd == kInvalidFd) return; if (!stats_fd) OpenStatsFile(path_env); const LoadedModule *mod = Symbolizer::GetOrInit()->FindModuleForAddress( reinterpret_cast(smodp)); WriteToFile(stats_fd, mod->full_name(), internal_strlen(mod->full_name()) + 1); for (StatModule *smod = *smodp; smod; smod = smod->next) { for (u32 i = 0; i != smod->size; ++i) { StatInfo *s = &smod->infos[i]; if (!s->addr) continue; WriteLE(stats_fd, s->addr - mod->base_address()); WriteLE(stats_fd, s->data); } } WriteLE(stats_fd, 0); WriteLE(stats_fd, 0); } } // namespace extern "C" SANITIZER_INTERFACE_ATTRIBUTE unsigned __sanitizer_stats_register(StatModule **mod) { SpinMutexLock l(&modules_mutex); modules.push_back(mod); return modules.size() - 1; } extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_stats_unregister(unsigned index) { SpinMutexLock l(&modules_mutex); WriteModuleReport(modules[index]); modules[index] = 0; } namespace { void WriteFullReport() { SpinMutexLock l(&modules_mutex); for (StatModule **mod : modules) { if (!mod) continue; WriteModuleReport(mod); } if (stats_fd != 0 && stats_fd != kInvalidFd) { CloseFile(stats_fd); stats_fd = kInvalidFd; } } #if SANITIZER_POSIX void USR2Handler(int sig) { WriteFullReport(); } #endif struct WriteReportOnExitOrSignal { WriteReportOnExitOrSignal() { #if SANITIZER_POSIX struct sigaction sigact; internal_memset(&sigact, 0, sizeof(sigact)); sigact.sa_handler = USR2Handler; internal_sigaction(SIGUSR2, &sigact, nullptr); #endif } ~WriteReportOnExitOrSignal() { WriteFullReport(); } } wr; } // namespace golang-1.8-race-detector-runtime_0.0+svn285455/lib/stats/stats.h0000664000175000017500000000205112646307541024422 0ustar mwhudsonmwhudson//===-- stats.h -------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Data definitions for sanitizer statistics gathering. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_STATS_STATS_H #define SANITIZER_STATS_STATS_H #include "sanitizer_common/sanitizer_internal_defs.h" namespace __sanitizer { // Number of bits in data that are used for the sanitizer kind. Needs to match // llvm::kSanitizerStatKindBits in // llvm/include/llvm/Transforms/Utils/SanitizerStats.h enum { kKindBits = 3 }; struct StatInfo { uptr addr; uptr data; }; struct StatModule { StatModule *next; u32 size; StatInfo infos[1]; }; inline uptr CountFromData(uptr data) { return data & ((1ull << (sizeof(uptr) * 8 - kKindBits)) - 1); } } #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/0000775000175000017500000000000013040224626022704 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_chained_origin_depot.h0000664000175000017500000000165212402040236030226 0ustar mwhudsonmwhudson//===-- msan_chained_origin_depot.h --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // A storage for chained origins. //===----------------------------------------------------------------------===// #ifndef MSAN_CHAINED_ORIGIN_DEPOT_H #define MSAN_CHAINED_ORIGIN_DEPOT_H #include "sanitizer_common/sanitizer_common.h" namespace __msan { StackDepotStats *ChainedOriginDepotGetStats(); bool ChainedOriginDepotPut(u32 here_id, u32 prev_id, u32 *new_id); // Retrieves a stored stack trace by the id. u32 ChainedOriginDepotGet(u32 id, u32 *other); void ChainedOriginDepotLockAll(); void ChainedOriginDepotUnlockAll(); } // namespace __msan #endif // MSAN_CHAINED_ORIGIN_DEPOT_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_report.cc0000664000175000017500000001743112663772072025567 0ustar mwhudsonmwhudson//===-- msan_report.cc ----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // Error reporting. //===----------------------------------------------------------------------===// #include "msan.h" #include "msan_chained_origin_depot.h" #include "msan_origin.h" #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_mutex.h" #include "sanitizer_common/sanitizer_report_decorator.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_symbolizer.h" using namespace __sanitizer; namespace __msan { class Decorator: public __sanitizer::SanitizerCommonDecorator { public: Decorator() : SanitizerCommonDecorator() { } const char *Warning() { return Red(); } const char *Origin() { return Magenta(); } const char *Name() { return Green(); } const char *End() { return Default(); } }; static void DescribeStackOrigin(const char *so, uptr pc) { Decorator d; char *s = internal_strdup(so); char *sep = internal_strchr(s, '@'); CHECK(sep); *sep = '\0'; Printf("%s", d.Origin()); Printf( " %sUninitialized value was created by an allocation of '%s%s%s'" " in the stack frame of function '%s%s%s'%s\n", d.Origin(), d.Name(), s, d.Origin(), d.Name(), sep + 1, d.Origin(), d.End()); InternalFree(s); if (pc) { // For some reason function address in LLVM IR is 1 less then the address // of the first instruction. pc = StackTrace::GetNextInstructionPc(pc); StackTrace(&pc, 1).Print(); } } static void DescribeOrigin(u32 id) { VPrintf(1, " raw origin id: %d\n", id); Decorator d; Origin o = Origin::FromRawId(id); while (o.isChainedOrigin()) { StackTrace stack; o = o.getNextChainedOrigin(&stack); Printf(" %sUninitialized value was stored to memory at%s\n", d.Origin(), d.End()); stack.Print(); } if (o.isStackOrigin()) { uptr pc; const char *so = GetStackOriginDescr(o.getStackId(), &pc); DescribeStackOrigin(so, pc); } else { StackTrace stack = o.getStackTraceForHeapOrigin(); switch (stack.tag) { case StackTrace::TAG_ALLOC: Printf(" %sUninitialized value was created by a heap allocation%s\n", d.Origin(), d.End()); break; case StackTrace::TAG_DEALLOC: Printf(" %sUninitialized value was created by a heap deallocation%s\n", d.Origin(), d.End()); break; case STACK_TRACE_TAG_POISON: Printf(" %sMemory was marked as uninitialized%s\n", d.Origin(), d.End()); break; default: Printf(" %sUninitialized value was created%s\n", d.Origin(), d.End()); break; } stack.Print(); } } void ReportUMR(StackTrace *stack, u32 origin) { if (!__msan::flags()->report_umrs) return; SpinMutexLock l(&CommonSanitizerReportMutex); Decorator d; Printf("%s", d.Warning()); Report("WARNING: MemorySanitizer: use-of-uninitialized-value\n"); Printf("%s", d.End()); stack->Print(); if (origin) { DescribeOrigin(origin); } ReportErrorSummary("use-of-uninitialized-value", stack); } void ReportExpectedUMRNotFound(StackTrace *stack) { SpinMutexLock l(&CommonSanitizerReportMutex); Printf("WARNING: Expected use of uninitialized value not found\n"); stack->Print(); } void ReportStats() { SpinMutexLock l(&CommonSanitizerReportMutex); if (__msan_get_track_origins() > 0) { StackDepotStats *stack_depot_stats = StackDepotGetStats(); // FIXME: we want this at normal exit, too! // FIXME: but only with verbosity=1 or something Printf("Unique heap origins: %zu\n", stack_depot_stats->n_uniq_ids); Printf("Stack depot allocated bytes: %zu\n", stack_depot_stats->allocated); StackDepotStats *chained_origin_depot_stats = ChainedOriginDepotGetStats(); Printf("Unique origin histories: %zu\n", chained_origin_depot_stats->n_uniq_ids); Printf("History depot allocated bytes: %zu\n", chained_origin_depot_stats->allocated); } } void ReportAtExitStatistics() { SpinMutexLock l(&CommonSanitizerReportMutex); if (msan_report_count > 0) { Decorator d; Printf("%s", d.Warning()); Printf("MemorySanitizer: %d warnings reported.\n", msan_report_count); Printf("%s", d.End()); } } class OriginSet { public: OriginSet() : next_id_(0) {} int insert(u32 o) { // Scan from the end for better locality. for (int i = next_id_ - 1; i >= 0; --i) if (origins_[i] == o) return i; if (next_id_ == kMaxSize_) return OVERFLOW; int id = next_id_++; origins_[id] = o; return id; } int size() { return next_id_; } u32 get(int id) { return origins_[id]; } static char asChar(int id) { switch (id) { case MISSING: return '.'; case OVERFLOW: return '*'; default: return 'A' + id; } } static const int OVERFLOW = -1; static const int MISSING = -2; private: static const int kMaxSize_ = 'Z' - 'A' + 1; u32 origins_[kMaxSize_]; int next_id_; }; void DescribeMemoryRange(const void *x, uptr size) { // Real limits. uptr start = MEM_TO_SHADOW(x); uptr end = start + size; // Scan limits: align start down to 4; align size up to 16. uptr s = start & ~3UL; size = end - s; size = (size + 15) & ~15UL; uptr e = s + size; // Single letter names to origin id mapping. OriginSet origin_set; uptr pos = 0; // Offset from aligned start. bool with_origins = __msan_get_track_origins(); // True if there is at least 1 poisoned bit in the last 4-byte group. bool last_quad_poisoned; int origin_ids[4]; // Single letter origin ids for the current line. Decorator d; Printf("%s", d.Warning()); Printf("Shadow map of [%p, %p), %zu bytes:\n", start, end, end - start); Printf("%s", d.End()); while (s < e) { // Line start. if (pos % 16 == 0) { for (int i = 0; i < 4; ++i) origin_ids[i] = -1; Printf("%p:", s); } // Group start. if (pos % 4 == 0) { Printf(" "); last_quad_poisoned = false; } // Print shadow byte. if (s < start || s >= end) { Printf(".."); } else { unsigned char v = *(unsigned char *)s; if (v) last_quad_poisoned = true; Printf("%x%x", v >> 4, v & 0xf); } // Group end. if (pos % 4 == 3 && with_origins) { int id = OriginSet::MISSING; if (last_quad_poisoned) { u32 o = *(u32 *)SHADOW_TO_ORIGIN(s - 3); id = origin_set.insert(o); } origin_ids[(pos % 16) / 4] = id; } // Line end. if (pos % 16 == 15) { if (with_origins) { Printf(" |"); for (int i = 0; i < 4; ++i) { char c = OriginSet::asChar(origin_ids[i]); Printf("%c", c); if (i != 3) Printf(" "); } Printf("|"); } Printf("\n"); } size--; s++; pos++; } Printf("\n"); for (int i = 0; i < origin_set.size(); ++i) { u32 o = origin_set.get(i); Printf("Origin %c (origin_id %x):\n", OriginSet::asChar(i), o); DescribeOrigin(o); } } void ReportUMRInsideAddressRange(const char *what, const void *start, uptr size, uptr offset) { Decorator d; Printf("%s", d.Warning()); Printf("%sUninitialized bytes in %s%s%s at offset %zu inside [%p, %zu)%s\n", d.Warning(), d.Name(), what, d.Warning(), offset, start, size, d.End()); if (__sanitizer::Verbosity()) DescribeMemoryRange(start, size); } } // namespace __msan golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_interface_internal.h0000664000175000017500000001325312766606132027745 0ustar mwhudsonmwhudson//===-- msan_interface_internal.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // Private MSan interface header. //===----------------------------------------------------------------------===// #ifndef MSAN_INTERFACE_INTERNAL_H #define MSAN_INTERFACE_INTERNAL_H #include "sanitizer_common/sanitizer_internal_defs.h" extern "C" { // FIXME: document all interface functions. SANITIZER_INTERFACE_ATTRIBUTE int __msan_get_track_origins(); SANITIZER_INTERFACE_ATTRIBUTE void __msan_init(); // Print a warning and maybe return. // This function can die based on common_flags()->exitcode. SANITIZER_INTERFACE_ATTRIBUTE void __msan_warning(); // Print a warning and die. // Intrumentation inserts calls to this function when building in "fast" mode // (i.e. -mllvm -msan-keep-going) SANITIZER_INTERFACE_ATTRIBUTE __attribute__((noreturn)) void __msan_warning_noreturn(); using __sanitizer::uptr; using __sanitizer::sptr; using __sanitizer::uu64; using __sanitizer::uu32; using __sanitizer::uu16; using __sanitizer::u64; using __sanitizer::u32; using __sanitizer::u16; using __sanitizer::u8; SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_warning_1(u8 s, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_warning_2(u16 s, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_warning_4(u32 s, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_warning_8(u64 s, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_store_origin_1(u8 s, void *p, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_store_origin_2(u16 s, void *p, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_store_origin_4(u32 s, void *p, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_maybe_store_origin_8(u64 s, void *p, u32 o); SANITIZER_INTERFACE_ATTRIBUTE void __msan_unpoison(const void *a, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __msan_unpoison_string(const char *s); SANITIZER_INTERFACE_ATTRIBUTE void __msan_clear_and_unpoison(void *a, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void* __msan_memcpy(void *dst, const void *src, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void* __msan_memset(void *s, int c, uptr n); SANITIZER_INTERFACE_ATTRIBUTE void* __msan_memmove(void* dest, const void* src, uptr n); SANITIZER_INTERFACE_ATTRIBUTE void __msan_poison(const void *a, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __msan_poison_stack(void *a, uptr size); // Copy size bytes from src to dst and unpoison the result. // Useful to implement unsafe loads. SANITIZER_INTERFACE_ATTRIBUTE void __msan_load_unpoisoned(void *src, uptr size, void *dst); // Returns the offset of the first (at least partially) poisoned byte, // or -1 if the whole range is good. SANITIZER_INTERFACE_ATTRIBUTE sptr __msan_test_shadow(const void *x, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __msan_check_mem_is_initialized(const void *x, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_origin(const void *a, uptr size, u32 origin); SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_alloca_origin(void *a, uptr size, char *descr); SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_alloca_origin4(void *a, uptr size, char *descr, uptr pc); SANITIZER_INTERFACE_ATTRIBUTE u32 __msan_chain_origin(u32 id); SANITIZER_INTERFACE_ATTRIBUTE u32 __msan_get_origin(const void *a); // Test that this_id is a descendant of prev_id (or they are simply equal). // "descendant" here means that are part of the same chain, created with // __msan_chain_origin. SANITIZER_INTERFACE_ATTRIBUTE int __msan_origin_is_descendant_or_same(u32 this_id, u32 prev_id); SANITIZER_INTERFACE_ATTRIBUTE void __msan_clear_on_return(); SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_keep_going(int keep_going); SANITIZER_INTERFACE_ATTRIBUTE int __msan_set_poison_in_malloc(int do_poison); SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE /* OPTIONAL */ const char* __msan_default_options(); // For testing. SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_expect_umr(int expect_umr); SANITIZER_INTERFACE_ATTRIBUTE void __msan_print_shadow(const void *x, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __msan_dump_shadow(const void *x, uptr size); SANITIZER_INTERFACE_ATTRIBUTE int __msan_has_dynamic_component(); // For testing. SANITIZER_INTERFACE_ATTRIBUTE u32 __msan_get_umr_origin(); SANITIZER_INTERFACE_ATTRIBUTE void __msan_partial_poison(const void* data, void* shadow, uptr size); // Tell MSan about newly allocated memory (ex.: custom allocator). // Memory will be marked uninitialized, with origin at the call site. SANITIZER_INTERFACE_ATTRIBUTE void __msan_allocated_memory(const void* data, uptr size); // Tell MSan about newly destroyed memory. Memory will be marked // uninitialized. SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dtor_callback(const void* data, uptr size); SANITIZER_INTERFACE_ATTRIBUTE u16 __sanitizer_unaligned_load16(const uu16 *p); SANITIZER_INTERFACE_ATTRIBUTE u32 __sanitizer_unaligned_load32(const uu32 *p); SANITIZER_INTERFACE_ATTRIBUTE u64 __sanitizer_unaligned_load64(const uu64 *p); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store16(uu16 *p, u16 x); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store32(uu32 *p, u32 x); SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_unaligned_store64(uu64 *p, u64 x); SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_death_callback(void (*callback)(void)); SANITIZER_INTERFACE_ATTRIBUTE void __msan_copy_shadow(void *dst, const void *src, uptr size); } // extern "C" #endif // MSAN_INTERFACE_INTERNAL_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_flags.h0000664000175000017500000000136012455754447025211 0ustar mwhudsonmwhudson//===-- msan_flags.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // //===----------------------------------------------------------------------===// #ifndef MSAN_FLAGS_H #define MSAN_FLAGS_H namespace __msan { struct Flags { #define MSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; #include "msan_flags.inc" #undef MSAN_FLAG void SetDefaults(); }; Flags *flags(); } // namespace __msan #endif // MSAN_FLAGS_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan.syms.extra0000664000175000017500000000002312517560142025700 0ustar mwhudsonmwhudson__msan_* __ubsan_* golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_poisoning.h0000664000175000017500000000431112457753366026122 0ustar mwhudsonmwhudson//===-- msan_poisoning.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // //===----------------------------------------------------------------------===// #ifndef MSAN_POISONING_H #define MSAN_POISONING_H #include "msan.h" namespace __msan { // Return origin for the first poisoned byte in the memory range, or 0. u32 GetOriginIfPoisoned(uptr addr, uptr size); // Walk [addr, addr+size) app memory region, copying origin tags from the // corresponding positions in [src_origin, src_origin+size) where the // corresponding shadow in [src_shadow, src_shadow+size) is non-zero. void SetOriginIfPoisoned(uptr addr, uptr src_shadow, uptr size, u32 src_origin); // Copy origin from src (app address) to dst (app address), creating chained // origin ids as necessary, without overriding origin for fully initialized // quads. void CopyOrigin(const void *dst, const void *src, uptr size, StackTrace *stack); // memmove() shadow and origin. Dst and src are application addresses. // See CopyOrigin() for the origin copying logic. void MoveShadowAndOrigin(const void *dst, const void *src, uptr size, StackTrace *stack); // memcpy() shadow and origin. Dst and src are application addresses. // See CopyOrigin() for the origin copying logic. void CopyShadowAndOrigin(const void *dst, const void *src, uptr size, StackTrace *stack); // memcpy() app memory, and do "the right thing" to the corresponding shadow and // origin regions. void CopyMemory(void *dst, const void *src, uptr size, StackTrace *stack); // Fill shadow will value. Ptr is an application address. void SetShadow(const void *ptr, uptr size, u8 value); // Set origin for the memory region. void SetOrigin(const void *dst, uptr size, u32 origin); // Mark memory region uninitialized, with origins. void PoisonMemory(const void *dst, uptr size, StackTrace *stack); } // namespace __msan #endif // MSAN_POISONING_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/tests/0000775000175000017500000000000013040224626024046 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/tests/msan_test.cc0000664000175000017500000035003612755723237026377 0ustar mwhudsonmwhudson//===-- msan_test.cc ------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // MemorySanitizer unit tests. //===----------------------------------------------------------------------===// #ifndef MSAN_EXTERNAL_TEST_CONFIG #include "msan_test_config.h" #endif // MSAN_EXTERNAL_TEST_CONFIG #include "sanitizer_common/tests/sanitizer_test_utils.h" #include "sanitizer/allocator_interface.h" #include "sanitizer/msan_interface.h" #if defined(__FreeBSD__) # define _KERNEL // To declare 'shminfo' structure. # include # undef _KERNEL extern "C" { // doesn't declare these functions in _KERNEL mode. void *shmat(int, const void *, int); int shmget(key_t, size_t, int); int shmctl(int, int, struct shmid_ds *); int shmdt(const void *); } #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(__FreeBSD__) # include # include # include # include # include #else # include # include # include # include # include # include # include # define f_namelen f_namemax // FreeBSD names this statfs field so. # define cpu_set_t cpuset_t extern "C" { // FreeBSD's defines mempcpy() to be a macro expanding into // a __builtin___mempcpy_chk() call, but since Msan RTL defines it as an // ordinary function, we can declare it here to complete the tests. void *mempcpy(void *dest, const void *src, size_t n); } #endif #if defined(__i386__) || defined(__x86_64__) # include # define MSAN_HAS_M128 1 #else # define MSAN_HAS_M128 0 #endif #ifdef __AVX2__ # include #endif // On FreeBSD procfs is not enabled by default. #if defined(__FreeBSD__) # define FILE_TO_READ "/bin/cat" # define DIR_TO_READ "/bin" # define SUBFILE_TO_READ "cat" # define SYMLINK_TO_READ "/usr/bin/tar" # define SUPERUSER_GROUP "wheel" #else # define FILE_TO_READ "/proc/self/stat" # define DIR_TO_READ "/proc/self" # define SUBFILE_TO_READ "stat" # define SYMLINK_TO_READ "/proc/self/exe" # define SUPERUSER_GROUP "root" #endif static uintptr_t GetPageSize() { return sysconf(_SC_PAGESIZE); } const size_t kMaxPathLength = 4096; typedef unsigned char U1; typedef unsigned short U2; // NOLINT typedef unsigned int U4; typedef unsigned long long U8; // NOLINT typedef signed char S1; typedef signed short S2; // NOLINT typedef signed int S4; typedef signed long long S8; // NOLINT #define NOINLINE __attribute__((noinline)) #define INLINE __attribute__((always_inline)) static bool TrackingOrigins() { S8 x; __msan_set_origin(&x, sizeof(x), 0x1234); U4 origin = __msan_get_origin(&x); __msan_set_origin(&x, sizeof(x), 0); return __msan_origin_is_descendant_or_same(origin, 0x1234); } #define EXPECT_ORIGIN(expected, origin) \ EXPECT_TRUE(__msan_origin_is_descendant_or_same((origin), (expected))) #define EXPECT_UMR(action) \ do { \ __msan_set_expect_umr(1); \ action; \ __msan_set_expect_umr(0); \ } while (0) #define EXPECT_UMR_O(action, origin) \ do { \ __msan_set_expect_umr(1); \ action; \ __msan_set_expect_umr(0); \ if (TrackingOrigins()) EXPECT_ORIGIN(origin, __msan_get_umr_origin()); \ } while (0) #define EXPECT_POISONED(x) ExpectPoisoned(x) template void ExpectPoisoned(const T& t) { EXPECT_NE(-1, __msan_test_shadow((void*)&t, sizeof(t))); } #define EXPECT_POISONED_O(x, origin) \ ExpectPoisonedWithOrigin(x, origin) template void ExpectPoisonedWithOrigin(const T& t, unsigned origin) { EXPECT_NE(-1, __msan_test_shadow((void*)&t, sizeof(t))); if (TrackingOrigins()) EXPECT_ORIGIN(origin, __msan_get_origin((void *)&t)); } #define EXPECT_NOT_POISONED(x) EXPECT_EQ(true, TestForNotPoisoned((x))) template bool TestForNotPoisoned(const T& t) { return __msan_test_shadow((void*)&t, sizeof(t)) == -1; } static U8 poisoned_array[100]; template T *GetPoisoned(int i = 0, T val = 0) { T *res = (T*)&poisoned_array[i]; *res = val; __msan_poison(&poisoned_array[i], sizeof(T)); return res; } template T *GetPoisonedO(int i, U4 origin, T val = 0) { T *res = (T*)&poisoned_array[i]; *res = val; __msan_poison(&poisoned_array[i], sizeof(T)); __msan_set_origin(&poisoned_array[i], sizeof(T), origin); return res; } template T Poisoned(T v = 0, T s = (T)(-1)) { __msan_partial_poison(&v, &s, sizeof(T)); return v; } template NOINLINE T ReturnPoisoned() { return *GetPoisoned(); } static volatile int g_one = 1; static volatile int g_zero = 0; static volatile int g_0 = 0; static volatile int g_1 = 1; S4 a_s4[100]; S8 a_s8[100]; // Check that malloc poisons memory. // A lot of tests below depend on this. TEST(MemorySanitizerSanity, PoisonInMalloc) { int *x = (int*)malloc(sizeof(int)); EXPECT_POISONED(*x); free(x); } TEST(MemorySanitizer, NegativeTest1) { S4 *x = GetPoisoned(); if (g_one) *x = 0; EXPECT_NOT_POISONED(*x); } TEST(MemorySanitizer, PositiveTest1) { // Load to store. EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); // S->S conversions. EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); // ZExt EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(*GetPoisoned()); // Unary ops. EXPECT_POISONED(- *GetPoisoned()); EXPECT_UMR(a_s4[g_zero] = 100 / *GetPoisoned(0, 1)); a_s4[g_zero] = 1 - *GetPoisoned(); a_s4[g_zero] = 1 + *GetPoisoned(); } TEST(MemorySanitizer, Phi1) { S4 c; if (g_one) { c = *GetPoisoned(); } else { break_optimization(0); c = 0; } EXPECT_POISONED(c); } TEST(MemorySanitizer, Phi2) { S4 i = *GetPoisoned(); S4 n = g_one; EXPECT_UMR(for (; i < g_one; i++);); EXPECT_POISONED(i); } NOINLINE void Arg1ExpectUMR(S4 a1) { EXPECT_POISONED(a1); } NOINLINE void Arg2ExpectUMR(S4 a1, S4 a2) { EXPECT_POISONED(a2); } NOINLINE void Arg3ExpectUMR(S1 a1, S4 a2, S8 a3) { EXPECT_POISONED(a3); } TEST(MemorySanitizer, ArgTest) { Arg1ExpectUMR(*GetPoisoned()); Arg2ExpectUMR(0, *GetPoisoned()); Arg3ExpectUMR(0, 1, *GetPoisoned()); } TEST(MemorySanitizer, CallAndRet) { ReturnPoisoned(); ReturnPoisoned(); ReturnPoisoned(); ReturnPoisoned(); EXPECT_POISONED(ReturnPoisoned()); EXPECT_POISONED(ReturnPoisoned()); EXPECT_POISONED(ReturnPoisoned()); EXPECT_POISONED(ReturnPoisoned()); } // malloc() in the following test may be optimized to produce a compile-time // undef value. Check that we trap on the volatile assignment anyway. TEST(MemorySanitizer, DISABLED_MallocNoIdent) { S4 *x = (int*)malloc(sizeof(S4)); EXPECT_POISONED(*x); free(x); } TEST(MemorySanitizer, Malloc) { S4 *x = (int*)Ident(malloc(sizeof(S4))); EXPECT_POISONED(*x); free(x); } TEST(MemorySanitizer, Realloc) { S4 *x = (int*)Ident(realloc(0, sizeof(S4))); EXPECT_POISONED(x[0]); x[0] = 1; x = (int*)Ident(realloc(x, 2 * sizeof(S4))); EXPECT_NOT_POISONED(x[0]); // Ok, was inited before. EXPECT_POISONED(x[1]); x = (int*)Ident(realloc(x, 3 * sizeof(S4))); EXPECT_NOT_POISONED(x[0]); // Ok, was inited before. EXPECT_POISONED(x[2]); EXPECT_POISONED(x[1]); x[2] = 1; // Init this here. Check that after realloc it is poisoned again. x = (int*)Ident(realloc(x, 2 * sizeof(S4))); EXPECT_NOT_POISONED(x[0]); // Ok, was inited before. EXPECT_POISONED(x[1]); x = (int*)Ident(realloc(x, 3 * sizeof(S4))); EXPECT_POISONED(x[1]); EXPECT_POISONED(x[2]); free(x); } TEST(MemorySanitizer, Calloc) { S4 *x = (int*)Ident(calloc(1, sizeof(S4))); EXPECT_NOT_POISONED(*x); // Should not be poisoned. EXPECT_EQ(0, *x); free(x); } TEST(MemorySanitizer, CallocReturnsZeroMem) { size_t sizes[] = {16, 1000, 10000, 100000, 2100000}; for (size_t s = 0; s < sizeof(sizes)/sizeof(sizes[0]); s++) { size_t size = sizes[s]; for (size_t iter = 0; iter < 5; iter++) { char *x = Ident((char*)calloc(1, size)); EXPECT_EQ(x[0], 0); EXPECT_EQ(x[size - 1], 0); EXPECT_EQ(x[size / 2], 0); EXPECT_EQ(x[size / 3], 0); EXPECT_EQ(x[size / 4], 0); memset(x, 0x42, size); free(Ident(x)); } } } TEST(MemorySanitizer, AndOr) { U4 *p = GetPoisoned(); // We poison two bytes in the midle of a 4-byte word to make the test // correct regardless of endianness. ((U1*)p)[1] = 0; ((U1*)p)[2] = 0xff; EXPECT_NOT_POISONED(*p & 0x00ffff00); EXPECT_NOT_POISONED(*p & 0x00ff0000); EXPECT_NOT_POISONED(*p & 0x0000ff00); EXPECT_POISONED(*p & 0xff000000); EXPECT_POISONED(*p & 0x000000ff); EXPECT_POISONED(*p & 0x0000ffff); EXPECT_POISONED(*p & 0xffff0000); EXPECT_NOT_POISONED(*p | 0xff0000ff); EXPECT_NOT_POISONED(*p | 0xff00ffff); EXPECT_NOT_POISONED(*p | 0xffff00ff); EXPECT_POISONED(*p | 0xff000000); EXPECT_POISONED(*p | 0x000000ff); EXPECT_POISONED(*p | 0x0000ffff); EXPECT_POISONED(*p | 0xffff0000); EXPECT_POISONED(*GetPoisoned() & *GetPoisoned()); } template static bool applyNot(T value, T shadow) { __msan_partial_poison(&value, &shadow, sizeof(T)); return !value; } TEST(MemorySanitizer, Not) { EXPECT_NOT_POISONED(applyNot(0x0, 0x0)); EXPECT_NOT_POISONED(applyNot(0xFFFFFFFF, 0x0)); EXPECT_POISONED(applyNot(0xFFFFFFFF, 0xFFFFFFFF)); EXPECT_NOT_POISONED(applyNot(0xFF000000, 0x0FFFFFFF)); EXPECT_NOT_POISONED(applyNot(0xFF000000, 0x00FFFFFF)); EXPECT_NOT_POISONED(applyNot(0xFF000000, 0x0000FFFF)); EXPECT_NOT_POISONED(applyNot(0xFF000000, 0x00000000)); EXPECT_POISONED(applyNot(0xFF000000, 0xFF000000)); EXPECT_NOT_POISONED(applyNot(0xFF800000, 0xFF000000)); EXPECT_POISONED(applyNot(0x00008000, 0x00008000)); EXPECT_NOT_POISONED(applyNot(0x0, 0x0)); EXPECT_NOT_POISONED(applyNot(0xFF, 0xFE)); EXPECT_NOT_POISONED(applyNot(0xFF, 0x0)); EXPECT_POISONED(applyNot(0xFF, 0xFF)); EXPECT_POISONED(applyNot((void*)0xFFFFFF, (void*)(-1))); EXPECT_NOT_POISONED(applyNot((void*)0xFFFFFF, (void*)(-2))); } TEST(MemorySanitizer, Shift) { U4 *up = GetPoisoned(); ((U1*)up)[0] = 0; ((U1*)up)[3] = 0xff; EXPECT_NOT_POISONED(*up >> 30); EXPECT_NOT_POISONED(*up >> 24); EXPECT_POISONED(*up >> 23); EXPECT_POISONED(*up >> 10); EXPECT_NOT_POISONED(*up << 30); EXPECT_NOT_POISONED(*up << 24); EXPECT_POISONED(*up << 23); EXPECT_POISONED(*up << 10); S4 *sp = (S4*)up; EXPECT_NOT_POISONED(*sp >> 30); EXPECT_NOT_POISONED(*sp >> 24); EXPECT_POISONED(*sp >> 23); EXPECT_POISONED(*sp >> 10); sp = GetPoisoned(); ((S1*)sp)[1] = 0; ((S1*)sp)[2] = 0; EXPECT_POISONED(*sp >> 31); EXPECT_POISONED(100 >> *GetPoisoned()); EXPECT_POISONED(100U >> *GetPoisoned()); } NOINLINE static int GetPoisonedZero() { int *zero = new int; *zero = 0; __msan_poison(zero, sizeof(*zero)); int res = *zero; delete zero; return res; } TEST(MemorySanitizer, LoadFromDirtyAddress) { int *a = new int; *a = 0; EXPECT_UMR(break_optimization((void*)(U8)a[GetPoisonedZero()])); delete a; } TEST(MemorySanitizer, StoreToDirtyAddress) { int *a = new int; EXPECT_UMR(a[GetPoisonedZero()] = 0); break_optimization(a); delete a; } NOINLINE void StackTestFunc() { S4 p4; S4 ok4 = 1; S2 p2; S2 ok2 = 1; S1 p1; S1 ok1 = 1; break_optimization(&p4); break_optimization(&ok4); break_optimization(&p2); break_optimization(&ok2); break_optimization(&p1); break_optimization(&ok1); EXPECT_POISONED(p4); EXPECT_POISONED(p2); EXPECT_POISONED(p1); EXPECT_NOT_POISONED(ok1); EXPECT_NOT_POISONED(ok2); EXPECT_NOT_POISONED(ok4); } TEST(MemorySanitizer, StackTest) { StackTestFunc(); } NOINLINE void StackStressFunc() { int foo[10000]; break_optimization(foo); } TEST(MemorySanitizer, DISABLED_StackStressTest) { for (int i = 0; i < 1000000; i++) StackStressFunc(); } template void TestFloatingPoint() { static volatile T v; static T g[100]; break_optimization(&g); T *x = GetPoisoned(); T *y = GetPoisoned(1); EXPECT_POISONED(*x); EXPECT_POISONED((long long)*x); EXPECT_POISONED((int)*x); g[0] = *x; g[1] = *x + *y; g[2] = *x - *y; g[3] = *x * *y; } TEST(MemorySanitizer, FloatingPointTest) { TestFloatingPoint(); TestFloatingPoint(); } TEST(MemorySanitizer, DynMem) { S4 x = 0; S4 *y = GetPoisoned(); memcpy(y, &x, g_one * sizeof(S4)); EXPECT_NOT_POISONED(*y); } static char *DynRetTestStr; TEST(MemorySanitizer, DynRet) { ReturnPoisoned(); EXPECT_NOT_POISONED(atoi("0")); } TEST(MemorySanitizer, DynRet1) { ReturnPoisoned(); } struct LargeStruct { S4 x[10]; }; NOINLINE LargeStruct LargeRetTest() { LargeStruct res; res.x[0] = *GetPoisoned(); res.x[1] = *GetPoisoned(); res.x[2] = *GetPoisoned(); res.x[3] = *GetPoisoned(); res.x[4] = *GetPoisoned(); res.x[5] = *GetPoisoned(); res.x[6] = *GetPoisoned(); res.x[7] = *GetPoisoned(); res.x[8] = *GetPoisoned(); res.x[9] = *GetPoisoned(); return res; } TEST(MemorySanitizer, strcmp) { char s1[10]; char s2[10]; strncpy(s1, "foo", 10); s2[0] = 'f'; s2[1] = 'n'; EXPECT_GT(strcmp(s1, s2), 0); s2[1] = 'o'; int res; EXPECT_UMR(res = strcmp(s1, s2)); EXPECT_NOT_POISONED(res); EXPECT_EQ(strncmp(s1, s2, 1), 0); } TEST(MemorySanitizer, LargeRet) { LargeStruct a = LargeRetTest(); EXPECT_POISONED(a.x[0]); EXPECT_POISONED(a.x[9]); } TEST(MemorySanitizer, strerror) { char *buf = strerror(EINVAL); EXPECT_NOT_POISONED(strlen(buf)); buf = strerror(123456); EXPECT_NOT_POISONED(strlen(buf)); } TEST(MemorySanitizer, strerror_r) { errno = 0; char buf[1000]; char *res = (char*) (size_t) strerror_r(EINVAL, buf, sizeof(buf)); ASSERT_EQ(0, errno); if (!res) res = buf; // POSIX version success. EXPECT_NOT_POISONED(strlen(res)); } TEST(MemorySanitizer, fread) { char *x = new char[32]; FILE *f = fopen(FILE_TO_READ, "r"); ASSERT_TRUE(f != NULL); fread(x, 1, 32, f); EXPECT_NOT_POISONED(x[0]); EXPECT_NOT_POISONED(x[16]); EXPECT_NOT_POISONED(x[31]); fclose(f); delete[] x; } TEST(MemorySanitizer, read) { char *x = new char[32]; int fd = open(FILE_TO_READ, O_RDONLY); ASSERT_GT(fd, 0); int sz = read(fd, x, 32); ASSERT_EQ(sz, 32); EXPECT_NOT_POISONED(x[0]); EXPECT_NOT_POISONED(x[16]); EXPECT_NOT_POISONED(x[31]); close(fd); delete[] x; } TEST(MemorySanitizer, pread) { char *x = new char[32]; int fd = open(FILE_TO_READ, O_RDONLY); ASSERT_GT(fd, 0); int sz = pread(fd, x, 32, 0); ASSERT_EQ(sz, 32); EXPECT_NOT_POISONED(x[0]); EXPECT_NOT_POISONED(x[16]); EXPECT_NOT_POISONED(x[31]); close(fd); delete[] x; } TEST(MemorySanitizer, readv) { char buf[2011]; struct iovec iov[2]; iov[0].iov_base = buf + 1; iov[0].iov_len = 5; iov[1].iov_base = buf + 10; iov[1].iov_len = 2000; int fd = open(FILE_TO_READ, O_RDONLY); ASSERT_GT(fd, 0); int sz = readv(fd, iov, 2); ASSERT_GE(sz, 0); ASSERT_LE(sz, 5 + 2000); ASSERT_GT((size_t)sz, iov[0].iov_len); EXPECT_POISONED(buf[0]); EXPECT_NOT_POISONED(buf[1]); EXPECT_NOT_POISONED(buf[5]); EXPECT_POISONED(buf[6]); EXPECT_POISONED(buf[9]); EXPECT_NOT_POISONED(buf[10]); EXPECT_NOT_POISONED(buf[10 + (sz - 1) - 5]); EXPECT_POISONED(buf[11 + (sz - 1) - 5]); close(fd); } TEST(MemorySanitizer, preadv) { char buf[2011]; struct iovec iov[2]; iov[0].iov_base = buf + 1; iov[0].iov_len = 5; iov[1].iov_base = buf + 10; iov[1].iov_len = 2000; int fd = open(FILE_TO_READ, O_RDONLY); ASSERT_GT(fd, 0); int sz = preadv(fd, iov, 2, 3); ASSERT_GE(sz, 0); ASSERT_LE(sz, 5 + 2000); ASSERT_GT((size_t)sz, iov[0].iov_len); EXPECT_POISONED(buf[0]); EXPECT_NOT_POISONED(buf[1]); EXPECT_NOT_POISONED(buf[5]); EXPECT_POISONED(buf[6]); EXPECT_POISONED(buf[9]); EXPECT_NOT_POISONED(buf[10]); EXPECT_NOT_POISONED(buf[10 + (sz - 1) - 5]); EXPECT_POISONED(buf[11 + (sz - 1) - 5]); close(fd); } // FIXME: fails now. TEST(MemorySanitizer, DISABLED_ioctl) { struct winsize ws; EXPECT_EQ(ioctl(2, TIOCGWINSZ, &ws), 0); EXPECT_NOT_POISONED(ws.ws_col); } TEST(MemorySanitizer, readlink) { char *x = new char[1000]; readlink(SYMLINK_TO_READ, x, 1000); EXPECT_NOT_POISONED(x[0]); delete [] x; } TEST(MemorySanitizer, stat) { struct stat* st = new struct stat; int res = stat(FILE_TO_READ, st); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(st->st_dev); EXPECT_NOT_POISONED(st->st_mode); EXPECT_NOT_POISONED(st->st_size); } TEST(MemorySanitizer, fstatat) { struct stat* st = new struct stat; int dirfd = open(DIR_TO_READ, O_RDONLY); ASSERT_GT(dirfd, 0); int res = fstatat(dirfd, SUBFILE_TO_READ, st, 0); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(st->st_dev); EXPECT_NOT_POISONED(st->st_mode); EXPECT_NOT_POISONED(st->st_size); close(dirfd); } TEST(MemorySanitizer, statfs) { struct statfs st; int res = statfs("/", &st); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(st.f_type); EXPECT_NOT_POISONED(st.f_bfree); EXPECT_NOT_POISONED(st.f_namelen); } TEST(MemorySanitizer, statvfs) { struct statvfs st; int res = statvfs("/", &st); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(st.f_bsize); EXPECT_NOT_POISONED(st.f_blocks); EXPECT_NOT_POISONED(st.f_bfree); EXPECT_NOT_POISONED(st.f_namemax); } TEST(MemorySanitizer, fstatvfs) { struct statvfs st; int fd = open("/", O_RDONLY | O_DIRECTORY); int res = fstatvfs(fd, &st); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(st.f_bsize); EXPECT_NOT_POISONED(st.f_blocks); EXPECT_NOT_POISONED(st.f_bfree); EXPECT_NOT_POISONED(st.f_namemax); close(fd); } TEST(MemorySanitizer, pipe) { int* pipefd = new int[2]; int res = pipe(pipefd); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(pipefd[0]); EXPECT_NOT_POISONED(pipefd[1]); close(pipefd[0]); close(pipefd[1]); } TEST(MemorySanitizer, pipe2) { int* pipefd = new int[2]; int res = pipe2(pipefd, O_NONBLOCK); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(pipefd[0]); EXPECT_NOT_POISONED(pipefd[1]); close(pipefd[0]); close(pipefd[1]); } TEST(MemorySanitizer, socketpair) { int sv[2]; int res = socketpair(AF_UNIX, SOCK_STREAM, 0, sv); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(sv[0]); EXPECT_NOT_POISONED(sv[1]); close(sv[0]); close(sv[1]); } TEST(MemorySanitizer, poll) { int* pipefd = new int[2]; int res = pipe(pipefd); ASSERT_EQ(0, res); char data = 42; res = write(pipefd[1], &data, 1); ASSERT_EQ(1, res); pollfd fds[2]; fds[0].fd = pipefd[0]; fds[0].events = POLLIN; fds[1].fd = pipefd[1]; fds[1].events = POLLIN; res = poll(fds, 2, 500); ASSERT_EQ(1, res); EXPECT_NOT_POISONED(fds[0].revents); EXPECT_NOT_POISONED(fds[1].revents); close(pipefd[0]); close(pipefd[1]); } // There is no ppoll() on FreeBSD. #if !defined (__FreeBSD__) TEST(MemorySanitizer, ppoll) { int* pipefd = new int[2]; int res = pipe(pipefd); ASSERT_EQ(0, res); char data = 42; res = write(pipefd[1], &data, 1); ASSERT_EQ(1, res); pollfd fds[2]; fds[0].fd = pipefd[0]; fds[0].events = POLLIN; fds[1].fd = pipefd[1]; fds[1].events = POLLIN; sigset_t ss; sigemptyset(&ss); res = ppoll(fds, 2, NULL, &ss); ASSERT_EQ(1, res); EXPECT_NOT_POISONED(fds[0].revents); EXPECT_NOT_POISONED(fds[1].revents); close(pipefd[0]); close(pipefd[1]); } #endif TEST(MemorySanitizer, poll_positive) { int* pipefd = new int[2]; int res = pipe(pipefd); ASSERT_EQ(0, res); pollfd fds[2]; fds[0].fd = pipefd[0]; fds[0].events = POLLIN; // fds[1].fd uninitialized fds[1].events = POLLIN; EXPECT_UMR(poll(fds, 2, 0)); close(pipefd[0]); close(pipefd[1]); } TEST(MemorySanitizer, bind_getsockname) { int sock = socket(AF_UNIX, SOCK_STREAM, 0); struct sockaddr_in sai; memset(&sai, 0, sizeof(sai)); sai.sin_family = AF_UNIX; int res = bind(sock, (struct sockaddr *)&sai, sizeof(sai)); ASSERT_EQ(0, res); char buf[200]; socklen_t addrlen; EXPECT_UMR(getsockname(sock, (struct sockaddr *)&buf, &addrlen)); addrlen = sizeof(buf); res = getsockname(sock, (struct sockaddr *)&buf, &addrlen); EXPECT_NOT_POISONED(addrlen); EXPECT_NOT_POISONED(buf[0]); EXPECT_NOT_POISONED(buf[addrlen - 1]); EXPECT_POISONED(buf[addrlen]); close(sock); } TEST(MemorySanitizer, accept) { int listen_socket = socket(AF_INET, SOCK_STREAM, 0); ASSERT_LT(0, listen_socket); struct sockaddr_in sai; memset(&sai, 0, sizeof(sai)); sai.sin_family = AF_INET; sai.sin_port = 0; sai.sin_addr.s_addr = htonl(INADDR_LOOPBACK); int res = bind(listen_socket, (struct sockaddr *)&sai, sizeof(sai)); ASSERT_EQ(0, res); res = listen(listen_socket, 1); ASSERT_EQ(0, res); socklen_t sz = sizeof(sai); res = getsockname(listen_socket, (struct sockaddr *)&sai, &sz); ASSERT_EQ(0, res); ASSERT_EQ(sizeof(sai), sz); int connect_socket = socket(AF_INET, SOCK_STREAM, 0); ASSERT_LT(0, connect_socket); res = fcntl(connect_socket, F_SETFL, O_NONBLOCK); ASSERT_EQ(0, res); res = connect(connect_socket, (struct sockaddr *)&sai, sizeof(sai)); // On FreeBSD this connection completes immediately. if (res != 0) { ASSERT_EQ(-1, res); ASSERT_EQ(EINPROGRESS, errno); } __msan_poison(&sai, sizeof(sai)); int new_sock = accept(listen_socket, (struct sockaddr *)&sai, &sz); ASSERT_LT(0, new_sock); ASSERT_EQ(sizeof(sai), sz); EXPECT_NOT_POISONED(sai); __msan_poison(&sai, sizeof(sai)); res = getpeername(new_sock, (struct sockaddr *)&sai, &sz); ASSERT_EQ(0, res); ASSERT_EQ(sizeof(sai), sz); EXPECT_NOT_POISONED(sai); close(new_sock); close(connect_socket); close(listen_socket); } TEST(MemorySanitizer, getaddrinfo) { struct addrinfo *ai; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; int res = getaddrinfo("localhost", NULL, &hints, &ai); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(*ai); ASSERT_EQ(sizeof(sockaddr_in), ai->ai_addrlen); EXPECT_NOT_POISONED(*(sockaddr_in*)ai->ai_addr); } TEST(MemorySanitizer, getnameinfo) { struct sockaddr_in sai; memset(&sai, 0, sizeof(sai)); sai.sin_family = AF_INET; sai.sin_port = 80; sai.sin_addr.s_addr = htonl(INADDR_LOOPBACK); char host[500]; char serv[500]; int res = getnameinfo((struct sockaddr *)&sai, sizeof(sai), host, sizeof(host), serv, sizeof(serv), 0); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(host[0]); EXPECT_POISONED(host[sizeof(host) - 1]); ASSERT_NE(0U, strlen(host)); EXPECT_NOT_POISONED(serv[0]); EXPECT_POISONED(serv[sizeof(serv) - 1]); ASSERT_NE(0U, strlen(serv)); } #define EXPECT_HOSTENT_NOT_POISONED(he) \ do { \ EXPECT_NOT_POISONED(*(he)); \ ASSERT_NE((void *) 0, (he)->h_name); \ ASSERT_NE((void *) 0, (he)->h_aliases); \ ASSERT_NE((void *) 0, (he)->h_addr_list); \ EXPECT_NOT_POISONED(strlen((he)->h_name)); \ char **p = (he)->h_aliases; \ while (*p) { \ EXPECT_NOT_POISONED(strlen(*p)); \ ++p; \ } \ char **q = (he)->h_addr_list; \ while (*q) { \ EXPECT_NOT_POISONED(*q[0]); \ ++q; \ } \ EXPECT_NOT_POISONED(*q); \ } while (0) TEST(MemorySanitizer, gethostent) { struct hostent *he = gethostent(); ASSERT_NE((void *)NULL, he); EXPECT_HOSTENT_NOT_POISONED(he); } #ifndef MSAN_TEST_DISABLE_GETHOSTBYNAME TEST(MemorySanitizer, gethostbyname) { struct hostent *he = gethostbyname("localhost"); ASSERT_NE((void *)NULL, he); EXPECT_HOSTENT_NOT_POISONED(he); } #endif // MSAN_TEST_DISABLE_GETHOSTBYNAME TEST(MemorySanitizer, recvmsg) { int server_socket = socket(AF_INET, SOCK_DGRAM, 0); ASSERT_LT(0, server_socket); struct sockaddr_in sai; memset(&sai, 0, sizeof(sai)); sai.sin_family = AF_INET; sai.sin_port = 0; sai.sin_addr.s_addr = htonl(INADDR_LOOPBACK); int res = bind(server_socket, (struct sockaddr *)&sai, sizeof(sai)); ASSERT_EQ(0, res); socklen_t sz = sizeof(sai); res = getsockname(server_socket, (struct sockaddr *)&sai, &sz); ASSERT_EQ(0, res); ASSERT_EQ(sizeof(sai), sz); int client_socket = socket(AF_INET, SOCK_DGRAM, 0); ASSERT_LT(0, client_socket); struct sockaddr_in client_sai; memset(&client_sai, 0, sizeof(client_sai)); client_sai.sin_family = AF_INET; client_sai.sin_port = 0; client_sai.sin_addr.s_addr = htonl(INADDR_LOOPBACK); res = bind(client_socket, (struct sockaddr *)&client_sai, sizeof(client_sai)); ASSERT_EQ(0, res); sz = sizeof(client_sai); res = getsockname(client_socket, (struct sockaddr *)&client_sai, &sz); ASSERT_EQ(0, res); ASSERT_EQ(sizeof(client_sai), sz); const char *s = "message text"; struct iovec iov; iov.iov_base = (void *)s; iov.iov_len = strlen(s) + 1; struct msghdr msg; memset(&msg, 0, sizeof(msg)); msg.msg_name = &sai; msg.msg_namelen = sizeof(sai); msg.msg_iov = &iov; msg.msg_iovlen = 1; res = sendmsg(client_socket, &msg, 0); ASSERT_LT(0, res); char buf[1000]; struct iovec recv_iov; recv_iov.iov_base = (void *)&buf; recv_iov.iov_len = sizeof(buf); struct sockaddr_in recv_sai; struct msghdr recv_msg; memset(&recv_msg, 0, sizeof(recv_msg)); recv_msg.msg_name = &recv_sai; recv_msg.msg_namelen = sizeof(recv_sai); recv_msg.msg_iov = &recv_iov; recv_msg.msg_iovlen = 1; res = recvmsg(server_socket, &recv_msg, 0); ASSERT_LT(0, res); ASSERT_EQ(sizeof(recv_sai), recv_msg.msg_namelen); EXPECT_NOT_POISONED(*(struct sockaddr_in *)recv_msg.msg_name); EXPECT_STREQ(s, buf); close(server_socket); close(client_socket); } TEST(MemorySanitizer, gethostbyname2) { struct hostent *he = gethostbyname2("localhost", AF_INET); ASSERT_NE((void *)NULL, he); EXPECT_HOSTENT_NOT_POISONED(he); } TEST(MemorySanitizer, gethostbyaddr) { in_addr_t addr = inet_addr("127.0.0.1"); EXPECT_NOT_POISONED(addr); struct hostent *he = gethostbyaddr(&addr, sizeof(addr), AF_INET); ASSERT_NE((void *)NULL, he); EXPECT_HOSTENT_NOT_POISONED(he); } TEST(MemorySanitizer, gethostent_r) { char buf[2000]; struct hostent he; struct hostent *result; int err; int res = gethostent_r(&he, buf, sizeof(buf), &result, &err); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(result); ASSERT_NE((void *)NULL, result); EXPECT_HOSTENT_NOT_POISONED(result); EXPECT_NOT_POISONED(err); } TEST(MemorySanitizer, gethostbyname_r) { char buf[2000]; struct hostent he; struct hostent *result; int err; int res = gethostbyname_r("localhost", &he, buf, sizeof(buf), &result, &err); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(result); ASSERT_NE((void *)NULL, result); EXPECT_HOSTENT_NOT_POISONED(result); EXPECT_NOT_POISONED(err); } TEST(MemorySanitizer, gethostbyname_r_bad_host_name) { char buf[2000]; struct hostent he; struct hostent *result; int err; int res = gethostbyname_r("bad-host-name", &he, buf, sizeof(buf), &result, &err); ASSERT_EQ((struct hostent *)0, result); EXPECT_NOT_POISONED(err); } TEST(MemorySanitizer, gethostbyname_r_erange) { char buf[5]; struct hostent he; struct hostent *result; int err; gethostbyname_r("localhost", &he, buf, sizeof(buf), &result, &err); ASSERT_EQ(ERANGE, errno); EXPECT_NOT_POISONED(err); } TEST(MemorySanitizer, gethostbyname2_r) { char buf[2000]; struct hostent he; struct hostent *result; int err; int res = gethostbyname2_r("localhost", AF_INET, &he, buf, sizeof(buf), &result, &err); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(result); ASSERT_NE((void *)NULL, result); EXPECT_HOSTENT_NOT_POISONED(result); EXPECT_NOT_POISONED(err); } TEST(MemorySanitizer, gethostbyaddr_r) { char buf[2000]; struct hostent he; struct hostent *result; int err; in_addr_t addr = inet_addr("127.0.0.1"); EXPECT_NOT_POISONED(addr); int res = gethostbyaddr_r(&addr, sizeof(addr), AF_INET, &he, buf, sizeof(buf), &result, &err); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(result); ASSERT_NE((void *)NULL, result); EXPECT_HOSTENT_NOT_POISONED(result); EXPECT_NOT_POISONED(err); } TEST(MemorySanitizer, getsockopt) { int sock = socket(AF_UNIX, SOCK_STREAM, 0); struct linger l[2]; socklen_t sz = sizeof(l[0]); int res = getsockopt(sock, SOL_SOCKET, SO_LINGER, &l[0], &sz); ASSERT_EQ(0, res); ASSERT_EQ(sizeof(l[0]), sz); EXPECT_NOT_POISONED(l[0]); EXPECT_POISONED(*(char *)(l + 1)); } TEST(MemorySanitizer, getcwd) { char path[PATH_MAX + 1]; char* res = getcwd(path, sizeof(path)); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(path[0]); } TEST(MemorySanitizer, getcwd_gnu) { char* res = getcwd(NULL, 0); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(res[0]); free(res); } // There's no get_current_dir_name() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, get_current_dir_name) { char* res = get_current_dir_name(); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(res[0]); free(res); } #endif TEST(MemorySanitizer, shmctl) { int id = shmget(IPC_PRIVATE, 4096, 0644 | IPC_CREAT); ASSERT_GT(id, -1); struct shmid_ds ds; int res = shmctl(id, IPC_STAT, &ds); ASSERT_GT(res, -1); EXPECT_NOT_POISONED(ds); // FreeBSD does not support shmctl(IPC_INFO) and shmctl(SHM_INFO). #if !defined(__FreeBSD__) struct shminfo si; res = shmctl(id, IPC_INFO, (struct shmid_ds *)&si); ASSERT_GT(res, -1); EXPECT_NOT_POISONED(si); struct shm_info s_i; res = shmctl(id, SHM_INFO, (struct shmid_ds *)&s_i); ASSERT_GT(res, -1); EXPECT_NOT_POISONED(s_i); #endif res = shmctl(id, IPC_RMID, 0); ASSERT_GT(res, -1); } TEST(MemorySanitizer, shmat) { const int kShmSize = 4096; void *mapping_start = mmap(NULL, kShmSize + SHMLBA, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT_NE(MAP_FAILED, mapping_start); void *p = (void *)(((unsigned long)mapping_start + SHMLBA - 1) / SHMLBA * SHMLBA); // p is now SHMLBA-aligned; ((char *)p)[10] = *GetPoisoned(); ((char *)p)[kShmSize - 1] = *GetPoisoned(); int res = munmap(mapping_start, kShmSize + SHMLBA); ASSERT_EQ(0, res); int id = shmget(IPC_PRIVATE, kShmSize, 0644 | IPC_CREAT); ASSERT_GT(id, -1); void *q = shmat(id, p, 0); ASSERT_EQ(p, q); EXPECT_NOT_POISONED(((char *)q)[0]); EXPECT_NOT_POISONED(((char *)q)[10]); EXPECT_NOT_POISONED(((char *)q)[kShmSize - 1]); res = shmdt(q); ASSERT_EQ(0, res); res = shmctl(id, IPC_RMID, 0); ASSERT_GT(res, -1); } // There's no random_r() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, random_r) { int32_t x; char z[64]; memset(z, 0, sizeof(z)); struct random_data buf; memset(&buf, 0, sizeof(buf)); int res = initstate_r(0, z, sizeof(z), &buf); ASSERT_EQ(0, res); res = random_r(&buf, &x); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(x); } #endif TEST(MemorySanitizer, confstr) { char buf[3]; size_t res = confstr(_CS_PATH, buf, sizeof(buf)); ASSERT_GT(res, sizeof(buf)); EXPECT_NOT_POISONED(buf[0]); EXPECT_NOT_POISONED(buf[sizeof(buf) - 1]); char buf2[1000]; res = confstr(_CS_PATH, buf2, sizeof(buf2)); ASSERT_LT(res, sizeof(buf2)); EXPECT_NOT_POISONED(buf2[0]); EXPECT_NOT_POISONED(buf2[res - 1]); EXPECT_POISONED(buf2[res]); ASSERT_EQ(res, strlen(buf2) + 1); } TEST(MemorySanitizer, opendir) { DIR *dir = opendir("."); closedir(dir); char name[10] = "."; __msan_poison(name, sizeof(name)); EXPECT_UMR(dir = opendir(name)); closedir(dir); } TEST(MemorySanitizer, readdir) { DIR *dir = opendir("."); struct dirent *d = readdir(dir); ASSERT_TRUE(d != NULL); EXPECT_NOT_POISONED(d->d_name[0]); closedir(dir); } TEST(MemorySanitizer, readdir_r) { DIR *dir = opendir("."); struct dirent d; struct dirent *pd; int res = readdir_r(dir, &d, &pd); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(pd); EXPECT_NOT_POISONED(d.d_name[0]); closedir(dir); } TEST(MemorySanitizer, realpath) { const char* relpath = "."; char path[PATH_MAX + 1]; char* res = realpath(relpath, path); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(path[0]); } TEST(MemorySanitizer, realpath_null) { const char* relpath = "."; char* res = realpath(relpath, NULL); printf("%d, %s\n", errno, strerror(errno)); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(res[0]); free(res); } // There's no canonicalize_file_name() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, canonicalize_file_name) { const char* relpath = "."; char* res = canonicalize_file_name(relpath); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(res[0]); free(res); } #endif extern char **environ; TEST(MemorySanitizer, setenv) { setenv("AAA", "BBB", 1); for (char **envp = environ; *envp; ++envp) { EXPECT_NOT_POISONED(*envp); EXPECT_NOT_POISONED(*envp[0]); } } TEST(MemorySanitizer, putenv) { char s[] = "AAA=BBB"; putenv(s); for (char **envp = environ; *envp; ++envp) { EXPECT_NOT_POISONED(*envp); EXPECT_NOT_POISONED(*envp[0]); } } TEST(MemorySanitizer, memcpy) { char* x = new char[2]; char* y = new char[2]; x[0] = 1; x[1] = *GetPoisoned(); memcpy(y, x, 2); EXPECT_NOT_POISONED(y[0]); EXPECT_POISONED(y[1]); } void TestUnalignedMemcpy(unsigned left, unsigned right, bool src_is_aligned, bool src_is_poisoned, bool dst_is_poisoned) { fprintf(stderr, "%s(%d, %d, %d, %d, %d)\n", __func__, left, right, src_is_aligned, src_is_poisoned, dst_is_poisoned); const unsigned sz = 20; U4 dst_origin, src_origin; char *dst = (char *)malloc(sz); if (dst_is_poisoned) dst_origin = __msan_get_origin(dst); else memset(dst, 0, sz); char *src = (char *)malloc(sz); if (src_is_poisoned) src_origin = __msan_get_origin(src); else memset(src, 0, sz); memcpy(dst + left, src_is_aligned ? src + left : src, sz - left - right); for (unsigned i = 0; i < (left & (~3U)); ++i) if (dst_is_poisoned) EXPECT_POISONED_O(dst[i], dst_origin); else EXPECT_NOT_POISONED(dst[i]); for (unsigned i = 0; i < (right & (~3U)); ++i) if (dst_is_poisoned) EXPECT_POISONED_O(dst[sz - i - 1], dst_origin); else EXPECT_NOT_POISONED(dst[sz - i - 1]); for (unsigned i = left; i < sz - right; ++i) if (src_is_poisoned) EXPECT_POISONED_O(dst[i], src_origin); else EXPECT_NOT_POISONED(dst[i]); free(dst); free(src); } TEST(MemorySanitizer, memcpy_unaligned) { for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) for (int aligned = 0; aligned < 2; ++aligned) for (int srcp = 0; srcp < 2; ++srcp) for (int dstp = 0; dstp < 2; ++dstp) TestUnalignedMemcpy(i, j, aligned, srcp, dstp); } TEST(MemorySanitizer, memmove) { char* x = new char[2]; char* y = new char[2]; x[0] = 1; x[1] = *GetPoisoned(); memmove(y, x, 2); EXPECT_NOT_POISONED(y[0]); EXPECT_POISONED(y[1]); } TEST(MemorySanitizer, memccpy_nomatch) { char* x = new char[5]; char* y = new char[5]; strcpy(x, "abc"); memccpy(y, x, 'd', 4); EXPECT_NOT_POISONED(y[0]); EXPECT_NOT_POISONED(y[1]); EXPECT_NOT_POISONED(y[2]); EXPECT_NOT_POISONED(y[3]); EXPECT_POISONED(y[4]); delete[] x; delete[] y; } TEST(MemorySanitizer, memccpy_match) { char* x = new char[5]; char* y = new char[5]; strcpy(x, "abc"); memccpy(y, x, 'b', 4); EXPECT_NOT_POISONED(y[0]); EXPECT_NOT_POISONED(y[1]); EXPECT_POISONED(y[2]); EXPECT_POISONED(y[3]); EXPECT_POISONED(y[4]); delete[] x; delete[] y; } TEST(MemorySanitizer, memccpy_nomatch_positive) { char* x = new char[5]; char* y = new char[5]; strcpy(x, "abc"); EXPECT_UMR(memccpy(y, x, 'd', 5)); delete[] x; delete[] y; } TEST(MemorySanitizer, memccpy_match_positive) { char* x = new char[5]; char* y = new char[5]; x[0] = 'a'; x[2] = 'b'; EXPECT_UMR(memccpy(y, x, 'b', 5)); delete[] x; delete[] y; } TEST(MemorySanitizer, bcopy) { char* x = new char[2]; char* y = new char[2]; x[0] = 1; x[1] = *GetPoisoned(); bcopy(x, y, 2); EXPECT_NOT_POISONED(y[0]); EXPECT_POISONED(y[1]); } TEST(MemorySanitizer, strdup) { char buf[4] = "abc"; __msan_poison(buf + 2, sizeof(*buf)); char *x = strdup(buf); EXPECT_NOT_POISONED(x[0]); EXPECT_NOT_POISONED(x[1]); EXPECT_POISONED(x[2]); EXPECT_NOT_POISONED(x[3]); free(x); } TEST(MemorySanitizer, strndup) { char buf[4] = "abc"; __msan_poison(buf + 2, sizeof(*buf)); char *x = strndup(buf, 3); EXPECT_NOT_POISONED(x[0]); EXPECT_NOT_POISONED(x[1]); EXPECT_POISONED(x[2]); EXPECT_NOT_POISONED(x[3]); free(x); } TEST(MemorySanitizer, strndup_short) { char buf[4] = "abc"; __msan_poison(buf + 1, sizeof(*buf)); __msan_poison(buf + 2, sizeof(*buf)); char *x = strndup(buf, 2); EXPECT_NOT_POISONED(x[0]); EXPECT_POISONED(x[1]); EXPECT_NOT_POISONED(x[2]); free(x); } template void TestOverlapMemmove() { T *x = new T[size]; ASSERT_GE(size, 3); x[2] = 0; memmove(x, x + 1, (size - 1) * sizeof(T)); EXPECT_NOT_POISONED(x[1]); EXPECT_POISONED(x[0]); EXPECT_POISONED(x[2]); delete [] x; } TEST(MemorySanitizer, overlap_memmove) { TestOverlapMemmove(); TestOverlapMemmove(); TestOverlapMemmove(); TestOverlapMemmove(); } TEST(MemorySanitizer, strcpy) { // NOLINT char* x = new char[3]; char* y = new char[3]; x[0] = 'a'; x[1] = *GetPoisoned(1, 1); x[2] = 0; strcpy(y, x); // NOLINT EXPECT_NOT_POISONED(y[0]); EXPECT_POISONED(y[1]); EXPECT_NOT_POISONED(y[2]); } TEST(MemorySanitizer, strncpy) { // NOLINT char* x = new char[3]; char* y = new char[5]; x[0] = 'a'; x[1] = *GetPoisoned(1, 1); x[2] = '\0'; strncpy(y, x, 4); // NOLINT EXPECT_NOT_POISONED(y[0]); EXPECT_POISONED(y[1]); EXPECT_NOT_POISONED(y[2]); EXPECT_NOT_POISONED(y[3]); EXPECT_POISONED(y[4]); } TEST(MemorySanitizer, stpcpy) { // NOLINT char* x = new char[3]; char* y = new char[3]; x[0] = 'a'; x[1] = *GetPoisoned(1, 1); x[2] = 0; char *res = stpcpy(y, x); // NOLINT ASSERT_EQ(res, y + 2); EXPECT_NOT_POISONED(y[0]); EXPECT_POISONED(y[1]); EXPECT_NOT_POISONED(y[2]); } TEST(MemorySanitizer, strcat) { // NOLINT char a[10]; char b[] = "def"; strcpy(a, "abc"); __msan_poison(b + 1, 1); strcat(a, b); EXPECT_NOT_POISONED(a[3]); EXPECT_POISONED(a[4]); EXPECT_NOT_POISONED(a[5]); EXPECT_NOT_POISONED(a[6]); EXPECT_POISONED(a[7]); } TEST(MemorySanitizer, strncat) { // NOLINT char a[10]; char b[] = "def"; strcpy(a, "abc"); __msan_poison(b + 1, 1); strncat(a, b, 5); EXPECT_NOT_POISONED(a[3]); EXPECT_POISONED(a[4]); EXPECT_NOT_POISONED(a[5]); EXPECT_NOT_POISONED(a[6]); EXPECT_POISONED(a[7]); } TEST(MemorySanitizer, strncat_overflow) { // NOLINT char a[10]; char b[] = "def"; strcpy(a, "abc"); __msan_poison(b + 1, 1); strncat(a, b, 2); EXPECT_NOT_POISONED(a[3]); EXPECT_POISONED(a[4]); EXPECT_NOT_POISONED(a[5]); EXPECT_POISONED(a[6]); EXPECT_POISONED(a[7]); } #define TEST_STRTO_INT(func_name, char_type, str_prefix) \ TEST(MemorySanitizer, func_name) { \ char_type *e; \ EXPECT_EQ(1U, func_name(str_prefix##"1", &e, 10)); \ EXPECT_NOT_POISONED((S8)e); \ } #define TEST_STRTO_FLOAT(func_name, char_type, str_prefix) \ TEST(MemorySanitizer, func_name) { \ char_type *e; \ EXPECT_NE(0, func_name(str_prefix##"1.5", &e)); \ EXPECT_NOT_POISONED((S8)e); \ } #define TEST_STRTO_FLOAT_LOC(func_name, char_type, str_prefix) \ TEST(MemorySanitizer, func_name) { \ locale_t loc = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); \ char_type *e; \ EXPECT_NE(0, func_name(str_prefix##"1.5", &e, loc)); \ EXPECT_NOT_POISONED((S8)e); \ freelocale(loc); \ } #define TEST_STRTO_INT_LOC(func_name, char_type, str_prefix) \ TEST(MemorySanitizer, func_name) { \ locale_t loc = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); \ char_type *e; \ ASSERT_EQ(1U, func_name(str_prefix##"1", &e, 10, loc)); \ EXPECT_NOT_POISONED((S8)e); \ freelocale(loc); \ } TEST_STRTO_INT(strtol, char, ) TEST_STRTO_INT(strtoll, char, ) TEST_STRTO_INT(strtoul, char, ) TEST_STRTO_INT(strtoull, char, ) TEST_STRTO_FLOAT(strtof, char, ) TEST_STRTO_FLOAT(strtod, char, ) TEST_STRTO_FLOAT(strtold, char, ) TEST_STRTO_FLOAT_LOC(strtof_l, char, ) TEST_STRTO_FLOAT_LOC(strtod_l, char, ) TEST_STRTO_FLOAT_LOC(strtold_l, char, ) TEST_STRTO_INT_LOC(strtol_l, char, ) TEST_STRTO_INT_LOC(strtoll_l, char, ) TEST_STRTO_INT_LOC(strtoul_l, char, ) TEST_STRTO_INT_LOC(strtoull_l, char, ) TEST_STRTO_INT(wcstol, wchar_t, L) TEST_STRTO_INT(wcstoll, wchar_t, L) TEST_STRTO_INT(wcstoul, wchar_t, L) TEST_STRTO_INT(wcstoull, wchar_t, L) TEST_STRTO_FLOAT(wcstof, wchar_t, L) TEST_STRTO_FLOAT(wcstod, wchar_t, L) TEST_STRTO_FLOAT(wcstold, wchar_t, L) TEST_STRTO_FLOAT_LOC(wcstof_l, wchar_t, L) TEST_STRTO_FLOAT_LOC(wcstod_l, wchar_t, L) TEST_STRTO_FLOAT_LOC(wcstold_l, wchar_t, L) TEST_STRTO_INT_LOC(wcstol_l, wchar_t, L) TEST_STRTO_INT_LOC(wcstoll_l, wchar_t, L) TEST_STRTO_INT_LOC(wcstoul_l, wchar_t, L) TEST_STRTO_INT_LOC(wcstoull_l, wchar_t, L) TEST(MemorySanitizer, strtoimax) { char *e; ASSERT_EQ(1, strtoimax("1", &e, 10)); EXPECT_NOT_POISONED((S8) e); } TEST(MemorySanitizer, strtoumax) { char *e; ASSERT_EQ(1U, strtoumax("1", &e, 10)); EXPECT_NOT_POISONED((S8) e); } #ifdef __GLIBC__ extern "C" float __strtof_l(const char *nptr, char **endptr, locale_t loc); TEST_STRTO_FLOAT_LOC(__strtof_l, char, ) extern "C" double __strtod_l(const char *nptr, char **endptr, locale_t loc); TEST_STRTO_FLOAT_LOC(__strtod_l, char, ) extern "C" long double __strtold_l(const char *nptr, char **endptr, locale_t loc); TEST_STRTO_FLOAT_LOC(__strtold_l, char, ) extern "C" float __wcstof_l(const wchar_t *nptr, wchar_t **endptr, locale_t loc); TEST_STRTO_FLOAT_LOC(__wcstof_l, wchar_t, L) extern "C" double __wcstod_l(const wchar_t *nptr, wchar_t **endptr, locale_t loc); TEST_STRTO_FLOAT_LOC(__wcstod_l, wchar_t, L) extern "C" long double __wcstold_l(const wchar_t *nptr, wchar_t **endptr, locale_t loc); TEST_STRTO_FLOAT_LOC(__wcstold_l, wchar_t, L) #endif // __GLIBC__ TEST(MemorySanitizer, modf) { double x, y; x = modf(2.1, &y); EXPECT_NOT_POISONED(y); } TEST(MemorySanitizer, modff) { float x, y; x = modff(2.1, &y); EXPECT_NOT_POISONED(y); } TEST(MemorySanitizer, modfl) { long double x, y; x = modfl(2.1, &y); EXPECT_NOT_POISONED(y); } // There's no sincos() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, sincos) { double s, c; sincos(0.2, &s, &c); EXPECT_NOT_POISONED(s); EXPECT_NOT_POISONED(c); } #endif // There's no sincosf() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, sincosf) { float s, c; sincosf(0.2, &s, &c); EXPECT_NOT_POISONED(s); EXPECT_NOT_POISONED(c); } #endif // There's no sincosl() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, sincosl) { long double s, c; sincosl(0.2, &s, &c); EXPECT_NOT_POISONED(s); EXPECT_NOT_POISONED(c); } #endif TEST(MemorySanitizer, remquo) { int quo; double res = remquo(29.0, 3.0, &quo); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(quo); } TEST(MemorySanitizer, remquof) { int quo; float res = remquof(29.0, 3.0, &quo); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(quo); } TEST(MemorySanitizer, remquol) { int quo; long double res = remquof(29.0, 3.0, &quo); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(quo); } TEST(MemorySanitizer, lgamma) { double res = lgamma(1.1); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(signgam); } TEST(MemorySanitizer, lgammaf) { float res = lgammaf(1.1); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(signgam); } TEST(MemorySanitizer, lgammal) { long double res = lgammal(1.1); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(signgam); } TEST(MemorySanitizer, lgamma_r) { int sgn; double res = lgamma_r(1.1, &sgn); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(sgn); } TEST(MemorySanitizer, lgammaf_r) { int sgn; float res = lgammaf_r(1.1, &sgn); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(sgn); } // There's no lgammal_r() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, lgammal_r) { int sgn; long double res = lgammal_r(1.1, &sgn); ASSERT_NE(0.0, res); EXPECT_NOT_POISONED(sgn); } #endif // There's no drand48_r() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, drand48_r) { struct drand48_data buf; srand48_r(0, &buf); double d; drand48_r(&buf, &d); EXPECT_NOT_POISONED(d); } #endif // There's no lrand48_r() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, lrand48_r) { struct drand48_data buf; srand48_r(0, &buf); long d; lrand48_r(&buf, &d); EXPECT_NOT_POISONED(d); } #endif TEST(MemorySanitizer, sprintf) { // NOLINT char buff[10]; break_optimization(buff); EXPECT_POISONED(buff[0]); int res = sprintf(buff, "%d", 1234567); // NOLINT ASSERT_EQ(res, 7); ASSERT_EQ(buff[0], '1'); ASSERT_EQ(buff[1], '2'); ASSERT_EQ(buff[2], '3'); ASSERT_EQ(buff[6], '7'); ASSERT_EQ(buff[7], 0); EXPECT_POISONED(buff[8]); } TEST(MemorySanitizer, snprintf) { char buff[10]; break_optimization(buff); EXPECT_POISONED(buff[0]); int res = snprintf(buff, sizeof(buff), "%d", 1234567); ASSERT_EQ(res, 7); ASSERT_EQ(buff[0], '1'); ASSERT_EQ(buff[1], '2'); ASSERT_EQ(buff[2], '3'); ASSERT_EQ(buff[6], '7'); ASSERT_EQ(buff[7], 0); EXPECT_POISONED(buff[8]); } TEST(MemorySanitizer, swprintf) { wchar_t buff[10]; ASSERT_EQ(4U, sizeof(wchar_t)); break_optimization(buff); EXPECT_POISONED(buff[0]); int res = swprintf(buff, 9, L"%d", 1234567); ASSERT_EQ(res, 7); ASSERT_EQ(buff[0], '1'); ASSERT_EQ(buff[1], '2'); ASSERT_EQ(buff[2], '3'); ASSERT_EQ(buff[6], '7'); ASSERT_EQ(buff[7], L'\0'); EXPECT_POISONED(buff[8]); } TEST(MemorySanitizer, asprintf) { // NOLINT char *pbuf; EXPECT_POISONED(pbuf); int res = asprintf(&pbuf, "%d", 1234567); // NOLINT ASSERT_EQ(res, 7); EXPECT_NOT_POISONED(pbuf); ASSERT_EQ(pbuf[0], '1'); ASSERT_EQ(pbuf[1], '2'); ASSERT_EQ(pbuf[2], '3'); ASSERT_EQ(pbuf[6], '7'); ASSERT_EQ(pbuf[7], 0); free(pbuf); } TEST(MemorySanitizer, mbstowcs) { const char *x = "abc"; wchar_t buff[10]; int res = mbstowcs(buff, x, 2); EXPECT_EQ(2, res); EXPECT_EQ(L'a', buff[0]); EXPECT_EQ(L'b', buff[1]); EXPECT_POISONED(buff[2]); res = mbstowcs(buff, x, 10); EXPECT_EQ(3, res); EXPECT_NOT_POISONED(buff[3]); } TEST(MemorySanitizer, wcstombs) { const wchar_t *x = L"abc"; char buff[10]; int res = wcstombs(buff, x, 4); EXPECT_EQ(res, 3); EXPECT_EQ(buff[0], 'a'); EXPECT_EQ(buff[1], 'b'); EXPECT_EQ(buff[2], 'c'); } TEST(MemorySanitizer, wcsrtombs) { const wchar_t *x = L"abc"; const wchar_t *p = x; char buff[10]; mbstate_t mbs; memset(&mbs, 0, sizeof(mbs)); int res = wcsrtombs(buff, &p, 4, &mbs); EXPECT_EQ(res, 3); EXPECT_EQ(buff[0], 'a'); EXPECT_EQ(buff[1], 'b'); EXPECT_EQ(buff[2], 'c'); EXPECT_EQ(buff[3], '\0'); EXPECT_POISONED(buff[4]); } TEST(MemorySanitizer, wcsnrtombs) { const wchar_t *x = L"abc"; const wchar_t *p = x; char buff[10]; mbstate_t mbs; memset(&mbs, 0, sizeof(mbs)); int res = wcsnrtombs(buff, &p, 2, 4, &mbs); EXPECT_EQ(res, 2); EXPECT_EQ(buff[0], 'a'); EXPECT_EQ(buff[1], 'b'); EXPECT_POISONED(buff[2]); } TEST(MemorySanitizer, wcrtomb) { wchar_t x = L'a'; char buff[10]; mbstate_t mbs; memset(&mbs, 0, sizeof(mbs)); size_t res = wcrtomb(buff, x, &mbs); EXPECT_EQ(res, (size_t)1); EXPECT_EQ(buff[0], 'a'); } TEST(MemorySanitizer, wmemset) { wchar_t x[25]; break_optimization(x); EXPECT_POISONED(x[0]); wmemset(x, L'A', 10); EXPECT_EQ(x[0], L'A'); EXPECT_EQ(x[9], L'A'); EXPECT_POISONED(x[10]); } TEST(MemorySanitizer, mbtowc) { const char *x = "abc"; wchar_t wx; int res = mbtowc(&wx, x, 3); EXPECT_GT(res, 0); EXPECT_NOT_POISONED(wx); } TEST(MemorySanitizer, mbrtowc) { const char *x = "abc"; wchar_t wx; mbstate_t mbs; memset(&mbs, 0, sizeof(mbs)); int res = mbrtowc(&wx, x, 3, &mbs); EXPECT_GT(res, 0); EXPECT_NOT_POISONED(wx); } TEST(MemorySanitizer, wcsftime) { wchar_t x[100]; time_t t = time(NULL); struct tm tms; struct tm *tmres = localtime_r(&t, &tms); ASSERT_NE((void *)0, tmres); size_t res = wcsftime(x, sizeof(x) / sizeof(x[0]), L"%Y-%m-%d", tmres); EXPECT_GT(res, 0UL); EXPECT_EQ(res, wcslen(x)); } TEST(MemorySanitizer, gettimeofday) { struct timeval tv; struct timezone tz; break_optimization(&tv); break_optimization(&tz); ASSERT_EQ(16U, sizeof(tv)); ASSERT_EQ(8U, sizeof(tz)); EXPECT_POISONED(tv.tv_sec); EXPECT_POISONED(tv.tv_usec); EXPECT_POISONED(tz.tz_minuteswest); EXPECT_POISONED(tz.tz_dsttime); ASSERT_EQ(0, gettimeofday(&tv, &tz)); EXPECT_NOT_POISONED(tv.tv_sec); EXPECT_NOT_POISONED(tv.tv_usec); EXPECT_NOT_POISONED(tz.tz_minuteswest); EXPECT_NOT_POISONED(tz.tz_dsttime); } TEST(MemorySanitizer, clock_gettime) { struct timespec tp; EXPECT_POISONED(tp.tv_sec); EXPECT_POISONED(tp.tv_nsec); ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &tp)); EXPECT_NOT_POISONED(tp.tv_sec); EXPECT_NOT_POISONED(tp.tv_nsec); } TEST(MemorySanitizer, clock_getres) { struct timespec tp; EXPECT_POISONED(tp.tv_sec); EXPECT_POISONED(tp.tv_nsec); ASSERT_EQ(0, clock_getres(CLOCK_REALTIME, 0)); EXPECT_POISONED(tp.tv_sec); EXPECT_POISONED(tp.tv_nsec); ASSERT_EQ(0, clock_getres(CLOCK_REALTIME, &tp)); EXPECT_NOT_POISONED(tp.tv_sec); EXPECT_NOT_POISONED(tp.tv_nsec); } TEST(MemorySanitizer, getitimer) { struct itimerval it1, it2; int res; EXPECT_POISONED(it1.it_interval.tv_sec); EXPECT_POISONED(it1.it_interval.tv_usec); EXPECT_POISONED(it1.it_value.tv_sec); EXPECT_POISONED(it1.it_value.tv_usec); res = getitimer(ITIMER_VIRTUAL, &it1); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(it1.it_interval.tv_sec); EXPECT_NOT_POISONED(it1.it_interval.tv_usec); EXPECT_NOT_POISONED(it1.it_value.tv_sec); EXPECT_NOT_POISONED(it1.it_value.tv_usec); it1.it_interval.tv_sec = it1.it_value.tv_sec = 10000; it1.it_interval.tv_usec = it1.it_value.tv_usec = 0; res = setitimer(ITIMER_VIRTUAL, &it1, &it2); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(it2.it_interval.tv_sec); EXPECT_NOT_POISONED(it2.it_interval.tv_usec); EXPECT_NOT_POISONED(it2.it_value.tv_sec); EXPECT_NOT_POISONED(it2.it_value.tv_usec); // Check that old_value can be 0, and disable the timer. memset(&it1, 0, sizeof(it1)); res = setitimer(ITIMER_VIRTUAL, &it1, 0); ASSERT_EQ(0, res); } TEST(MemorySanitizer, setitimer_null) { setitimer(ITIMER_VIRTUAL, 0, 0); // Not testing the return value, since it the behaviour seems to differ // between libc implementations and POSIX. // Should never crash, though. } TEST(MemorySanitizer, time) { time_t t; EXPECT_POISONED(t); time_t t2 = time(&t); ASSERT_NE(t2, (time_t)-1); EXPECT_NOT_POISONED(t); } TEST(MemorySanitizer, strptime) { struct tm time; char *p = strptime("11/1/2013-05:39", "%m/%d/%Y-%H:%M", &time); ASSERT_TRUE(p != NULL); EXPECT_NOT_POISONED(time.tm_sec); EXPECT_NOT_POISONED(time.tm_hour); EXPECT_NOT_POISONED(time.tm_year); } TEST(MemorySanitizer, localtime) { time_t t = 123; struct tm *time = localtime(&t); ASSERT_TRUE(time != NULL); EXPECT_NOT_POISONED(time->tm_sec); EXPECT_NOT_POISONED(time->tm_hour); EXPECT_NOT_POISONED(time->tm_year); EXPECT_NOT_POISONED(time->tm_isdst); EXPECT_NE(0U, strlen(time->tm_zone)); } TEST(MemorySanitizer, localtime_r) { time_t t = 123; struct tm time; struct tm *res = localtime_r(&t, &time); ASSERT_TRUE(res != NULL); EXPECT_NOT_POISONED(time.tm_sec); EXPECT_NOT_POISONED(time.tm_hour); EXPECT_NOT_POISONED(time.tm_year); EXPECT_NOT_POISONED(time.tm_isdst); EXPECT_NE(0U, strlen(time.tm_zone)); } // There's no getmntent() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, getmntent) { FILE *fp = setmntent("/etc/fstab", "r"); struct mntent *mnt = getmntent(fp); ASSERT_TRUE(mnt != NULL); ASSERT_NE(0U, strlen(mnt->mnt_fsname)); ASSERT_NE(0U, strlen(mnt->mnt_dir)); ASSERT_NE(0U, strlen(mnt->mnt_type)); ASSERT_NE(0U, strlen(mnt->mnt_opts)); EXPECT_NOT_POISONED(mnt->mnt_freq); EXPECT_NOT_POISONED(mnt->mnt_passno); fclose(fp); } #endif // There's no getmntent_r() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, getmntent_r) { FILE *fp = setmntent("/etc/fstab", "r"); struct mntent mntbuf; char buf[1000]; struct mntent *mnt = getmntent_r(fp, &mntbuf, buf, sizeof(buf)); ASSERT_TRUE(mnt != NULL); ASSERT_NE(0U, strlen(mnt->mnt_fsname)); ASSERT_NE(0U, strlen(mnt->mnt_dir)); ASSERT_NE(0U, strlen(mnt->mnt_type)); ASSERT_NE(0U, strlen(mnt->mnt_opts)); EXPECT_NOT_POISONED(mnt->mnt_freq); EXPECT_NOT_POISONED(mnt->mnt_passno); fclose(fp); } #endif TEST(MemorySanitizer, ether) { const char *asc = "11:22:33:44:55:66"; struct ether_addr *paddr = ether_aton(asc); EXPECT_NOT_POISONED(*paddr); struct ether_addr addr; paddr = ether_aton_r(asc, &addr); ASSERT_EQ(paddr, &addr); EXPECT_NOT_POISONED(addr); char *s = ether_ntoa(&addr); ASSERT_NE(0U, strlen(s)); char buf[100]; s = ether_ntoa_r(&addr, buf); ASSERT_EQ(s, buf); ASSERT_NE(0U, strlen(buf)); } TEST(MemorySanitizer, mmap) { const int size = 4096; void *p1, *p2; p1 = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); __msan_poison(p1, size); munmap(p1, size); for (int i = 0; i < 1000; i++) { p2 = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); if (p2 == p1) break; else munmap(p2, size); } if (p1 == p2) { EXPECT_NOT_POISONED(*(char*)p2); munmap(p2, size); } } // There's no fcvt() on FreeBSD. #if !defined(__FreeBSD__) // FIXME: enable and add ecvt. // FIXME: check why msandr does nt handle fcvt. TEST(MemorySanitizer, fcvt) { int a, b; break_optimization(&a); break_optimization(&b); EXPECT_POISONED(a); EXPECT_POISONED(b); char *str = fcvt(12345.6789, 10, &a, &b); EXPECT_NOT_POISONED(a); EXPECT_NOT_POISONED(b); ASSERT_NE(nullptr, str); EXPECT_NOT_POISONED(str[0]); ASSERT_NE(0U, strlen(str)); } #endif // There's no fcvt_long() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, fcvt_long) { int a, b; break_optimization(&a); break_optimization(&b); EXPECT_POISONED(a); EXPECT_POISONED(b); char *str = fcvt(111111112345.6789, 10, &a, &b); EXPECT_NOT_POISONED(a); EXPECT_NOT_POISONED(b); ASSERT_NE(nullptr, str); EXPECT_NOT_POISONED(str[0]); ASSERT_NE(0U, strlen(str)); } #endif TEST(MemorySanitizer, memchr) { char x[10]; break_optimization(x); EXPECT_POISONED(x[0]); x[2] = '2'; void *res; EXPECT_UMR(res = memchr(x, '2', 10)); EXPECT_NOT_POISONED(res); x[0] = '0'; x[1] = '1'; res = memchr(x, '2', 10); EXPECT_EQ(&x[2], res); EXPECT_UMR(res = memchr(x, '3', 10)); EXPECT_NOT_POISONED(res); } TEST(MemorySanitizer, memrchr) { char x[10]; break_optimization(x); EXPECT_POISONED(x[0]); x[9] = '9'; void *res; EXPECT_UMR(res = memrchr(x, '9', 10)); EXPECT_NOT_POISONED(res); x[0] = '0'; x[1] = '1'; res = memrchr(x, '0', 2); EXPECT_EQ(&x[0], res); EXPECT_UMR(res = memrchr(x, '7', 10)); EXPECT_NOT_POISONED(res); } TEST(MemorySanitizer, frexp) { int x; x = *GetPoisoned(); double r = frexp(1.1, &x); EXPECT_NOT_POISONED(r); EXPECT_NOT_POISONED(x); x = *GetPoisoned(); float rf = frexpf(1.1, &x); EXPECT_NOT_POISONED(rf); EXPECT_NOT_POISONED(x); x = *GetPoisoned(); double rl = frexpl(1.1, &x); EXPECT_NOT_POISONED(rl); EXPECT_NOT_POISONED(x); } namespace { static int cnt; void SigactionHandler(int signo, siginfo_t* si, void* uc) { ASSERT_EQ(signo, SIGPROF); ASSERT_TRUE(si != NULL); EXPECT_NOT_POISONED(si->si_errno); EXPECT_NOT_POISONED(si->si_pid); #if __linux__ # if defined(__x86_64__) EXPECT_NOT_POISONED(((ucontext_t*)uc)->uc_mcontext.gregs[REG_RIP]); # elif defined(__i386__) EXPECT_NOT_POISONED(((ucontext_t*)uc)->uc_mcontext.gregs[REG_EIP]); # endif #endif ++cnt; } TEST(MemorySanitizer, sigaction) { struct sigaction act = {}; struct sigaction oldact = {}; struct sigaction origact = {}; sigaction(SIGPROF, 0, &origact); act.sa_flags |= SA_SIGINFO; act.sa_sigaction = &SigactionHandler; sigaction(SIGPROF, &act, 0); kill(getpid(), SIGPROF); act.sa_flags &= ~SA_SIGINFO; act.sa_handler = SIG_DFL; sigaction(SIGPROF, &act, 0); act.sa_flags &= ~SA_SIGINFO; act.sa_handler = SIG_IGN; sigaction(SIGPROF, &act, &oldact); EXPECT_FALSE(oldact.sa_flags & SA_SIGINFO); EXPECT_EQ(SIG_DFL, oldact.sa_handler); kill(getpid(), SIGPROF); act.sa_flags |= SA_SIGINFO; act.sa_sigaction = &SigactionHandler; sigaction(SIGPROF, &act, &oldact); EXPECT_FALSE(oldact.sa_flags & SA_SIGINFO); EXPECT_EQ(SIG_IGN, oldact.sa_handler); kill(getpid(), SIGPROF); act.sa_flags &= ~SA_SIGINFO; act.sa_handler = SIG_DFL; sigaction(SIGPROF, &act, &oldact); EXPECT_TRUE(oldact.sa_flags & SA_SIGINFO); EXPECT_EQ(&SigactionHandler, oldact.sa_sigaction); EXPECT_EQ(2, cnt); sigaction(SIGPROF, &origact, 0); } } // namespace TEST(MemorySanitizer, sigemptyset) { sigset_t s; EXPECT_POISONED(s); int res = sigemptyset(&s); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(s); } TEST(MemorySanitizer, sigfillset) { sigset_t s; EXPECT_POISONED(s); int res = sigfillset(&s); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(s); } TEST(MemorySanitizer, sigpending) { sigset_t s; EXPECT_POISONED(s); int res = sigpending(&s); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(s); } TEST(MemorySanitizer, sigprocmask) { sigset_t s; EXPECT_POISONED(s); int res = sigprocmask(SIG_BLOCK, 0, &s); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(s); } struct StructWithDtor { ~StructWithDtor(); }; NOINLINE StructWithDtor::~StructWithDtor() { break_optimization(0); } TEST(MemorySanitizer, Invoke) { StructWithDtor s; // Will cause the calls to become invokes. EXPECT_NOT_POISONED(0); EXPECT_POISONED(*GetPoisoned()); EXPECT_NOT_POISONED(0); EXPECT_POISONED(*GetPoisoned()); EXPECT_POISONED(ReturnPoisoned()); } TEST(MemorySanitizer, ptrtoint) { // Test that shadow is propagated through pointer-to-integer conversion. unsigned char c = 0; __msan_poison(&c, 1); uintptr_t u = (uintptr_t)c << 8; EXPECT_NOT_POISONED(u & 0xFF00FF); EXPECT_POISONED(u & 0xFF00); break_optimization(&u); void* p = (void*)u; break_optimization(&p); EXPECT_POISONED(p); EXPECT_NOT_POISONED(((uintptr_t)p) & 0xFF00FF); EXPECT_POISONED(((uintptr_t)p) & 0xFF00); } static void vaargsfn2(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, double)); va_end(vl); } static void vaargsfn(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); // The following call will overwrite __msan_param_tls. // Checks after it test that arg shadow was somehow saved across the call. vaargsfn2(1, 2, 3, 4, *GetPoisoned()); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); va_end(vl); } TEST(MemorySanitizer, VAArgTest) { int* x = GetPoisoned(); int* y = GetPoisoned(4); vaargsfn(1, 13, *x, 42, *y); } static void vaargsfn_many(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); va_end(vl); } TEST(MemorySanitizer, VAArgManyTest) { int* x = GetPoisoned(); int* y = GetPoisoned(4); vaargsfn_many(1, 2, *x, 3, 4, 5, 6, 7, 8, 9, *y); } static void vaargsfn_manyfix(int g1, int g2, int g3, int g4, int g5, int g6, int g7, int g8, int g9, ...) { va_list vl; va_start(vl, g9); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); va_end(vl); } TEST(MemorySanitizer, VAArgManyFixTest) { int* x = GetPoisoned(); int* y = GetPoisoned(); vaargsfn_manyfix(1, *x, 3, 4, 5, 6, 7, 8, 9, 10, *y); } static void vaargsfn_pass2(va_list vl) { EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); } static void vaargsfn_pass(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_POISONED(va_arg(vl, int)); vaargsfn_pass2(vl); va_end(vl); } TEST(MemorySanitizer, VAArgPass) { int* x = GetPoisoned(); int* y = GetPoisoned(4); vaargsfn_pass(1, *x, 2, 3, *y); } static void vaargsfn_copy2(va_list vl) { EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); } static void vaargsfn_copy(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); va_list vl2; va_copy(vl2, vl); vaargsfn_copy2(vl2); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); va_end(vl); } TEST(MemorySanitizer, VAArgCopy) { int* x = GetPoisoned(); int* y = GetPoisoned(4); vaargsfn_copy(1, 2, *x, 3, *y); } static void vaargsfn_ptr(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_NOT_POISONED(va_arg(vl, int*)); EXPECT_POISONED(va_arg(vl, int*)); EXPECT_NOT_POISONED(va_arg(vl, int*)); EXPECT_POISONED(va_arg(vl, double*)); va_end(vl); } TEST(MemorySanitizer, VAArgPtr) { int** x = GetPoisoned(); double** y = GetPoisoned(8); int z; vaargsfn_ptr(1, &z, *x, &z, *y); } static void vaargsfn_overflow(int guard, ...) { va_list vl; va_start(vl, guard); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_POISONED(va_arg(vl, double)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_POISONED(va_arg(vl, int*)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, double)); EXPECT_POISONED(va_arg(vl, int*)); EXPECT_NOT_POISONED(va_arg(vl, int)); EXPECT_NOT_POISONED(va_arg(vl, double)); EXPECT_NOT_POISONED(va_arg(vl, int*)); EXPECT_POISONED(va_arg(vl, int)); EXPECT_POISONED(va_arg(vl, double)); EXPECT_POISONED(va_arg(vl, int*)); va_end(vl); } TEST(MemorySanitizer, VAArgOverflow) { int* x = GetPoisoned(); double* y = GetPoisoned(8); int** p = GetPoisoned(16); int z; vaargsfn_overflow(1, 1, 2, *x, 4, 5, 6, 1.1, 2.2, 3.3, *y, 5.5, *p, 7.7, 8.8, // the following args will overflow for sure *x, *y, *p, 7, 9.9, &z, *x, *y, *p); } static void vaargsfn_tlsoverwrite2(int guard, ...) { va_list vl; va_start(vl, guard); for (int i = 0; i < 20; ++i) EXPECT_NOT_POISONED(va_arg(vl, int)); va_end(vl); } static void vaargsfn_tlsoverwrite(int guard, ...) { // This call will overwrite TLS contents unless it's backed up somewhere. vaargsfn_tlsoverwrite2(2, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42); // 20x va_list vl; va_start(vl, guard); for (int i = 0; i < 20; ++i) EXPECT_POISONED(va_arg(vl, int)); va_end(vl); } TEST(MemorySanitizer, VAArgTLSOverwrite) { int* x = GetPoisoned(); vaargsfn_tlsoverwrite(1, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x, *x); // 20x } struct StructByVal { int a, b, c, d, e, f; }; static void vaargsfn_structbyval(int guard, ...) { va_list vl; va_start(vl, guard); { StructByVal s = va_arg(vl, StructByVal); EXPECT_NOT_POISONED(s.a); EXPECT_POISONED(s.b); EXPECT_NOT_POISONED(s.c); EXPECT_POISONED(s.d); EXPECT_NOT_POISONED(s.e); EXPECT_POISONED(s.f); } { StructByVal s = va_arg(vl, StructByVal); EXPECT_NOT_POISONED(s.a); EXPECT_POISONED(s.b); EXPECT_NOT_POISONED(s.c); EXPECT_POISONED(s.d); EXPECT_NOT_POISONED(s.e); EXPECT_POISONED(s.f); } va_end(vl); } TEST(MemorySanitizer, VAArgStructByVal) { StructByVal s; s.a = 1; s.b = *GetPoisoned(); s.c = 2; s.d = *GetPoisoned(); s.e = 3; s.f = *GetPoisoned(); vaargsfn_structbyval(0, s, s); } NOINLINE void StructByValTestFunc(struct StructByVal s) { EXPECT_NOT_POISONED(s.a); EXPECT_POISONED(s.b); EXPECT_NOT_POISONED(s.c); EXPECT_POISONED(s.d); EXPECT_NOT_POISONED(s.e); EXPECT_POISONED(s.f); } NOINLINE void StructByValTestFunc1(struct StructByVal s) { StructByValTestFunc(s); } NOINLINE void StructByValTestFunc2(int z, struct StructByVal s) { StructByValTestFunc(s); } TEST(MemorySanitizer, StructByVal) { // Large aggregates are passed as "byval" pointer argument in LLVM. struct StructByVal s; s.a = 1; s.b = *GetPoisoned(); s.c = 2; s.d = *GetPoisoned(); s.e = 3; s.f = *GetPoisoned(); StructByValTestFunc(s); StructByValTestFunc1(s); StructByValTestFunc2(0, s); } #if MSAN_HAS_M128 NOINLINE __m128i m128Eq(__m128i *a, __m128i *b) { return _mm_cmpeq_epi16(*a, *b); } NOINLINE __m128i m128Lt(__m128i *a, __m128i *b) { return _mm_cmplt_epi16(*a, *b); } TEST(MemorySanitizer, m128) { __m128i a = _mm_set1_epi16(0x1234); __m128i b = _mm_set1_epi16(0x7890); EXPECT_NOT_POISONED(m128Eq(&a, &b)); EXPECT_NOT_POISONED(m128Lt(&a, &b)); } // FIXME: add more tests for __m128i. #endif // MSAN_HAS_M128 // We should not complain when copying this poisoned hole. struct StructWithHole { U4 a; // 4-byte hole. U8 b; }; NOINLINE StructWithHole ReturnStructWithHole() { StructWithHole res; __msan_poison(&res, sizeof(res)); res.a = 1; res.b = 2; return res; } TEST(MemorySanitizer, StructWithHole) { StructWithHole a = ReturnStructWithHole(); break_optimization(&a); } template NOINLINE T ReturnStruct() { T res; __msan_poison(&res, sizeof(res)); res.a = 1; return res; } template NOINLINE void TestReturnStruct() { T s1 = ReturnStruct(); EXPECT_NOT_POISONED(s1.a); EXPECT_POISONED(s1.b); } struct SSS1 { int a, b, c; }; struct SSS2 { int b, a, c; }; struct SSS3 { int b, c, a; }; struct SSS4 { int c, b, a; }; struct SSS5 { int a; float b; }; struct SSS6 { int a; double b; }; struct SSS7 { S8 b; int a; }; struct SSS8 { S2 b; S8 a; }; TEST(MemorySanitizer, IntStruct3) { TestReturnStruct(); TestReturnStruct(); TestReturnStruct(); TestReturnStruct(); TestReturnStruct(); TestReturnStruct(); TestReturnStruct(); TestReturnStruct(); } struct LongStruct { U1 a1, b1; U2 a2, b2; U4 a4, b4; U8 a8, b8; }; NOINLINE LongStruct ReturnLongStruct1() { LongStruct res; __msan_poison(&res, sizeof(res)); res.a1 = res.a2 = res.a4 = res.a8 = 111; // leaves b1, .., b8 poisoned. return res; } NOINLINE LongStruct ReturnLongStruct2() { LongStruct res; __msan_poison(&res, sizeof(res)); res.b1 = res.b2 = res.b4 = res.b8 = 111; // leaves a1, .., a8 poisoned. return res; } TEST(MemorySanitizer, LongStruct) { LongStruct s1 = ReturnLongStruct1(); __msan_print_shadow(&s1, sizeof(s1)); EXPECT_NOT_POISONED(s1.a1); EXPECT_NOT_POISONED(s1.a2); EXPECT_NOT_POISONED(s1.a4); EXPECT_NOT_POISONED(s1.a8); EXPECT_POISONED(s1.b1); EXPECT_POISONED(s1.b2); EXPECT_POISONED(s1.b4); EXPECT_POISONED(s1.b8); LongStruct s2 = ReturnLongStruct2(); __msan_print_shadow(&s2, sizeof(s2)); EXPECT_NOT_POISONED(s2.b1); EXPECT_NOT_POISONED(s2.b2); EXPECT_NOT_POISONED(s2.b4); EXPECT_NOT_POISONED(s2.b8); EXPECT_POISONED(s2.a1); EXPECT_POISONED(s2.a2); EXPECT_POISONED(s2.a4); EXPECT_POISONED(s2.a8); } #ifdef __GLIBC__ #define MSAN_TEST_PRLIMIT __GLIBC_PREREQ(2, 13) #else #define MSAN_TEST_PRLIMIT 1 #endif TEST(MemorySanitizer, getrlimit) { struct rlimit limit; __msan_poison(&limit, sizeof(limit)); int result = getrlimit(RLIMIT_DATA, &limit); ASSERT_EQ(result, 0); EXPECT_NOT_POISONED(limit.rlim_cur); EXPECT_NOT_POISONED(limit.rlim_max); #if MSAN_TEST_PRLIMIT struct rlimit limit2; __msan_poison(&limit2, sizeof(limit2)); result = prlimit(getpid(), RLIMIT_DATA, &limit, &limit2); ASSERT_EQ(result, 0); EXPECT_NOT_POISONED(limit2.rlim_cur); EXPECT_NOT_POISONED(limit2.rlim_max); __msan_poison(&limit, sizeof(limit)); result = prlimit(getpid(), RLIMIT_DATA, nullptr, &limit); ASSERT_EQ(result, 0); EXPECT_NOT_POISONED(limit.rlim_cur); EXPECT_NOT_POISONED(limit.rlim_max); result = prlimit(getpid(), RLIMIT_DATA, &limit, nullptr); ASSERT_EQ(result, 0); #endif } TEST(MemorySanitizer, getrusage) { struct rusage usage; __msan_poison(&usage, sizeof(usage)); int result = getrusage(RUSAGE_SELF, &usage); ASSERT_EQ(result, 0); EXPECT_NOT_POISONED(usage.ru_utime.tv_sec); EXPECT_NOT_POISONED(usage.ru_utime.tv_usec); EXPECT_NOT_POISONED(usage.ru_stime.tv_sec); EXPECT_NOT_POISONED(usage.ru_stime.tv_usec); EXPECT_NOT_POISONED(usage.ru_maxrss); EXPECT_NOT_POISONED(usage.ru_minflt); EXPECT_NOT_POISONED(usage.ru_majflt); EXPECT_NOT_POISONED(usage.ru_inblock); EXPECT_NOT_POISONED(usage.ru_oublock); EXPECT_NOT_POISONED(usage.ru_nvcsw); EXPECT_NOT_POISONED(usage.ru_nivcsw); } #if defined(__FreeBSD__) static void GetProgramPath(char *buf, size_t sz) { int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; int res = sysctl(mib, 4, buf, &sz, NULL, 0); ASSERT_EQ(0, res); } #elif defined(__GLIBC__) static void GetProgramPath(char *buf, size_t sz) { extern char *program_invocation_name; int res = snprintf(buf, sz, "%s", program_invocation_name); ASSERT_GE(res, 0); ASSERT_LT((size_t)res, sz); } #else # error "TODO: port this" #endif static void dladdr_testfn() {} TEST(MemorySanitizer, dladdr) { Dl_info info; __msan_poison(&info, sizeof(info)); int result = dladdr((const void*)dladdr_testfn, &info); ASSERT_NE(result, 0); EXPECT_NOT_POISONED((unsigned long)info.dli_fname); if (info.dli_fname) EXPECT_NOT_POISONED(strlen(info.dli_fname)); EXPECT_NOT_POISONED((unsigned long)info.dli_fbase); EXPECT_NOT_POISONED((unsigned long)info.dli_sname); if (info.dli_sname) EXPECT_NOT_POISONED(strlen(info.dli_sname)); EXPECT_NOT_POISONED((unsigned long)info.dli_saddr); } #ifndef MSAN_TEST_DISABLE_DLOPEN static int dl_phdr_callback(struct dl_phdr_info *info, size_t size, void *data) { (*(int *)data)++; EXPECT_NOT_POISONED(info->dlpi_addr); EXPECT_NOT_POISONED(strlen(info->dlpi_name)); EXPECT_NOT_POISONED(info->dlpi_phnum); for (int i = 0; i < info->dlpi_phnum; ++i) EXPECT_NOT_POISONED(info->dlpi_phdr[i]); return 0; } // Compute the path to our loadable DSO. We assume it's in the same // directory. Only use string routines that we intercept so far to do this. static void GetPathToLoadable(char *buf, size_t sz) { char program_path[kMaxPathLength]; GetProgramPath(program_path, sizeof(program_path)); const char *last_slash = strrchr(program_path, '/'); ASSERT_NE(nullptr, last_slash); size_t dir_len = (size_t)(last_slash - program_path); #if defined(__x86_64__) static const char basename[] = "libmsan_loadable.x86_64.so"; #elif defined(__MIPSEB__) || defined(MIPSEB) static const char basename[] = "libmsan_loadable.mips64.so"; #elif defined(__mips64) static const char basename[] = "libmsan_loadable.mips64el.so"; #elif defined(__aarch64__) static const char basename[] = "libmsan_loadable.aarch64.so"; #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ static const char basename[] = "libmsan_loadable.powerpc64.so"; #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ static const char basename[] = "libmsan_loadable.powerpc64le.so"; #endif int res = snprintf(buf, sz, "%.*s/%s", (int)dir_len, program_path, basename); ASSERT_GE(res, 0); ASSERT_LT((size_t)res, sz); } TEST(MemorySanitizer, dl_iterate_phdr) { char path[kMaxPathLength]; GetPathToLoadable(path, sizeof(path)); // Having at least one dlopen'ed library in the process makes this more // entertaining. void *lib = dlopen(path, RTLD_LAZY); ASSERT_NE((void*)0, lib); int count = 0; int result = dl_iterate_phdr(dl_phdr_callback, &count); ASSERT_GT(count, 0); dlclose(lib); } TEST(MemorySanitizer, dlopen) { char path[kMaxPathLength]; GetPathToLoadable(path, sizeof(path)); // We need to clear shadow for globals when doing dlopen. In order to test // this, we have to poison the shadow for the DSO before we load it. In // general this is difficult, but the loader tends to reload things in the // same place, so we open, close, and then reopen. The global should always // start out clean after dlopen. for (int i = 0; i < 2; i++) { void *lib = dlopen(path, RTLD_LAZY); if (lib == NULL) { printf("dlerror: %s\n", dlerror()); ASSERT_TRUE(lib != NULL); } void **(*get_dso_global)() = (void **(*)())dlsym(lib, "get_dso_global"); ASSERT_TRUE(get_dso_global != NULL); void **dso_global = get_dso_global(); EXPECT_NOT_POISONED(*dso_global); __msan_poison(dso_global, sizeof(*dso_global)); EXPECT_POISONED(*dso_global); dlclose(lib); } } // Regression test for a crash in dlopen() interceptor. TEST(MemorySanitizer, dlopenFailed) { const char *path = "/libmsan_loadable_does_not_exist.so"; void *lib = dlopen(path, RTLD_LAZY); ASSERT_TRUE(lib == NULL); } #endif // MSAN_TEST_DISABLE_DLOPEN // There's no sched_getaffinity() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, sched_getaffinity) { cpu_set_t mask; int res = sched_getaffinity(getpid(), sizeof(mask), &mask); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(mask); } #endif TEST(MemorySanitizer, scanf) { const char *input = "42 hello"; int* d = new int; char* s = new char[7]; int res = sscanf(input, "%d %5s", d, s); printf("res %d\n", res); ASSERT_EQ(res, 2); EXPECT_NOT_POISONED(*d); EXPECT_NOT_POISONED(s[0]); EXPECT_NOT_POISONED(s[1]); EXPECT_NOT_POISONED(s[2]); EXPECT_NOT_POISONED(s[3]); EXPECT_NOT_POISONED(s[4]); EXPECT_NOT_POISONED(s[5]); EXPECT_POISONED(s[6]); delete[] s; delete d; } static void *SimpleThread_threadfn(void* data) { return new int; } TEST(MemorySanitizer, SimpleThread) { pthread_t t; void *p; int res = pthread_create(&t, NULL, SimpleThread_threadfn, NULL); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(t); res = pthread_join(t, &p); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(p); delete (int*)p; } static void *SmallStackThread_threadfn(void* data) { return 0; } #ifdef PTHREAD_STACK_MIN # define SMALLSTACKSIZE PTHREAD_STACK_MIN # define SMALLPRESTACKSIZE PTHREAD_STACK_MIN #else # define SMALLSTACKSIZE 64 * 1024 # define SMALLPRESTACKSIZE 16 * 1024 #endif TEST(MemorySanitizer, SmallStackThread) { pthread_attr_t attr; pthread_t t; void *p; int res; res = pthread_attr_init(&attr); ASSERT_EQ(0, res); res = pthread_attr_setstacksize(&attr, SMALLSTACKSIZE); ASSERT_EQ(0, res); res = pthread_create(&t, &attr, SmallStackThread_threadfn, NULL); ASSERT_EQ(0, res); res = pthread_join(t, &p); ASSERT_EQ(0, res); res = pthread_attr_destroy(&attr); ASSERT_EQ(0, res); } TEST(MemorySanitizer, SmallPreAllocatedStackThread) { pthread_attr_t attr; pthread_t t; int res; res = pthread_attr_init(&attr); ASSERT_EQ(0, res); void *stack; const size_t kStackSize = SMALLPRESTACKSIZE; res = posix_memalign(&stack, 4096, kStackSize); ASSERT_EQ(0, res); res = pthread_attr_setstack(&attr, stack, kStackSize); ASSERT_EQ(0, res); res = pthread_create(&t, &attr, SmallStackThread_threadfn, NULL); EXPECT_EQ(0, res); res = pthread_join(t, NULL); ASSERT_EQ(0, res); res = pthread_attr_destroy(&attr); ASSERT_EQ(0, res); } TEST(MemorySanitizer, pthread_attr_get) { pthread_attr_t attr; int res; res = pthread_attr_init(&attr); ASSERT_EQ(0, res); { int v; res = pthread_attr_getdetachstate(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { size_t v; res = pthread_attr_getguardsize(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { struct sched_param v; res = pthread_attr_getschedparam(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { int v; res = pthread_attr_getschedpolicy(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { int v; res = pthread_attr_getinheritsched(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { int v; res = pthread_attr_getscope(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { size_t v; res = pthread_attr_getstacksize(&attr, &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } { void *v; size_t w; res = pthread_attr_getstack(&attr, &v, &w); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); EXPECT_NOT_POISONED(w); } { cpu_set_t v; res = pthread_attr_getaffinity_np(&attr, sizeof(v), &v); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(v); } res = pthread_attr_destroy(&attr); ASSERT_EQ(0, res); } TEST(MemorySanitizer, pthread_getschedparam) { int policy; struct sched_param param; int res = pthread_getschedparam(pthread_self(), &policy, ¶m); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(policy); EXPECT_NOT_POISONED(param.sched_priority); } TEST(MemorySanitizer, pthread_key_create) { pthread_key_t key; int res = pthread_key_create(&key, NULL); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(key); res = pthread_key_delete(key); ASSERT_EQ(0, res); } namespace { struct SignalCondArg { pthread_cond_t* cond; pthread_mutex_t* mu; bool broadcast; }; void *SignalCond(void *param) { SignalCondArg *arg = reinterpret_cast(param); pthread_mutex_lock(arg->mu); if (arg->broadcast) pthread_cond_broadcast(arg->cond); else pthread_cond_signal(arg->cond); pthread_mutex_unlock(arg->mu); return 0; } } // namespace TEST(MemorySanitizer, pthread_cond_wait) { pthread_cond_t cond; pthread_mutex_t mu; SignalCondArg args = {&cond, &mu, false}; pthread_cond_init(&cond, 0); pthread_mutex_init(&mu, 0); pthread_mutex_lock(&mu); // signal pthread_t thr; pthread_create(&thr, 0, SignalCond, &args); int res = pthread_cond_wait(&cond, &mu); ASSERT_EQ(0, res); pthread_join(thr, 0); // broadcast args.broadcast = true; pthread_create(&thr, 0, SignalCond, &args); res = pthread_cond_wait(&cond, &mu); ASSERT_EQ(0, res); pthread_join(thr, 0); pthread_mutex_unlock(&mu); pthread_mutex_destroy(&mu); pthread_cond_destroy(&cond); } TEST(MemorySanitizer, tmpnam) { char s[L_tmpnam]; char *res = tmpnam(s); ASSERT_EQ(s, res); EXPECT_NOT_POISONED(strlen(res)); } TEST(MemorySanitizer, tempnam) { char *res = tempnam(NULL, "zzz"); EXPECT_NOT_POISONED(strlen(res)); free(res); } TEST(MemorySanitizer, posix_memalign) { void *p; EXPECT_POISONED(p); int res = posix_memalign(&p, 4096, 13); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(p); EXPECT_EQ(0U, (uintptr_t)p % 4096); free(p); } // There's no memalign() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, memalign) { void *p = memalign(4096, 13); EXPECT_EQ(0U, (uintptr_t)p % 4096); free(p); } #endif TEST(MemorySanitizer, valloc) { void *a = valloc(100); uintptr_t PageSize = GetPageSize(); EXPECT_EQ(0U, (uintptr_t)a % PageSize); free(a); } // There's no pvalloc() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, pvalloc) { uintptr_t PageSize = GetPageSize(); void *p = pvalloc(PageSize + 100); EXPECT_EQ(0U, (uintptr_t)p % PageSize); EXPECT_EQ(2 * PageSize, __sanitizer_get_allocated_size(p)); free(p); p = pvalloc(0); // pvalloc(0) should allocate at least one page. EXPECT_EQ(0U, (uintptr_t)p % PageSize); EXPECT_EQ(PageSize, __sanitizer_get_allocated_size(p)); free(p); } #endif TEST(MemorySanitizer, inet_pton) { const char *s = "1:0:0:0:0:0:0:8"; unsigned char buf[sizeof(struct in6_addr)]; int res = inet_pton(AF_INET6, s, buf); ASSERT_EQ(1, res); EXPECT_NOT_POISONED(buf[0]); EXPECT_NOT_POISONED(buf[sizeof(struct in6_addr) - 1]); char s_out[INET6_ADDRSTRLEN]; EXPECT_POISONED(s_out[3]); const char *q = inet_ntop(AF_INET6, buf, s_out, INET6_ADDRSTRLEN); ASSERT_NE((void*)0, q); EXPECT_NOT_POISONED(s_out[3]); } TEST(MemorySanitizer, inet_aton) { const char *s = "127.0.0.1"; struct in_addr in[2]; int res = inet_aton(s, in); ASSERT_NE(0, res); EXPECT_NOT_POISONED(in[0]); EXPECT_POISONED(*(char *)(in + 1)); } TEST(MemorySanitizer, uname) { struct utsname u; int res = uname(&u); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(strlen(u.sysname)); EXPECT_NOT_POISONED(strlen(u.nodename)); EXPECT_NOT_POISONED(strlen(u.release)); EXPECT_NOT_POISONED(strlen(u.version)); EXPECT_NOT_POISONED(strlen(u.machine)); } TEST(MemorySanitizer, gethostname) { char buf[100]; int res = gethostname(buf, 100); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(strlen(buf)); } // There's no sysinfo() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, sysinfo) { struct sysinfo info; int res = sysinfo(&info); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(info); } #endif TEST(MemorySanitizer, getpwuid) { struct passwd *p = getpwuid(0); // root ASSERT_TRUE(p != NULL); EXPECT_NOT_POISONED(p->pw_name); ASSERT_TRUE(p->pw_name != NULL); EXPECT_NOT_POISONED(p->pw_name[0]); EXPECT_NOT_POISONED(p->pw_uid); ASSERT_EQ(0U, p->pw_uid); } TEST(MemorySanitizer, getpwuid_r) { struct passwd pwd; struct passwd *pwdres; char buf[10000]; int res = getpwuid_r(0, &pwd, buf, sizeof(buf), &pwdres); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(pwd.pw_name); ASSERT_TRUE(pwd.pw_name != NULL); EXPECT_NOT_POISONED(pwd.pw_name[0]); EXPECT_NOT_POISONED(pwd.pw_uid); ASSERT_EQ(0U, pwd.pw_uid); EXPECT_NOT_POISONED(pwdres); } TEST(MemorySanitizer, getpwnam_r) { struct passwd pwd; struct passwd *pwdres; char buf[10000]; int res = getpwnam_r("root", &pwd, buf, sizeof(buf), &pwdres); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(pwd.pw_name); ASSERT_TRUE(pwd.pw_name != NULL); EXPECT_NOT_POISONED(pwd.pw_name[0]); EXPECT_NOT_POISONED(pwd.pw_uid); ASSERT_EQ(0U, pwd.pw_uid); EXPECT_NOT_POISONED(pwdres); } TEST(MemorySanitizer, getpwnam_r_positive) { struct passwd pwd; struct passwd *pwdres; char s[5]; strncpy(s, "abcd", 5); __msan_poison(s, 5); char buf[10000]; int res; EXPECT_UMR(res = getpwnam_r(s, &pwd, buf, sizeof(buf), &pwdres)); } TEST(MemorySanitizer, getgrnam_r) { struct group grp; struct group *grpres; char buf[10000]; int res = getgrnam_r(SUPERUSER_GROUP, &grp, buf, sizeof(buf), &grpres); ASSERT_EQ(0, res); // Note that getgrnam_r() returns 0 if the matching group is not found. ASSERT_NE(nullptr, grpres); EXPECT_NOT_POISONED(grp.gr_name); ASSERT_TRUE(grp.gr_name != NULL); EXPECT_NOT_POISONED(grp.gr_name[0]); EXPECT_NOT_POISONED(grp.gr_gid); EXPECT_NOT_POISONED(grpres); } TEST(MemorySanitizer, getpwent) { setpwent(); struct passwd *p = getpwent(); ASSERT_TRUE(p != NULL); EXPECT_NOT_POISONED(p->pw_name); ASSERT_TRUE(p->pw_name != NULL); EXPECT_NOT_POISONED(p->pw_name[0]); EXPECT_NOT_POISONED(p->pw_uid); } TEST(MemorySanitizer, getpwent_r) { struct passwd pwd; struct passwd *pwdres; char buf[10000]; setpwent(); int res = getpwent_r(&pwd, buf, sizeof(buf), &pwdres); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(pwd.pw_name); ASSERT_TRUE(pwd.pw_name != NULL); EXPECT_NOT_POISONED(pwd.pw_name[0]); EXPECT_NOT_POISONED(pwd.pw_uid); EXPECT_NOT_POISONED(pwdres); } // There's no fgetpwent() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, fgetpwent) { FILE *fp = fopen("/etc/passwd", "r"); struct passwd *p = fgetpwent(fp); ASSERT_TRUE(p != NULL); EXPECT_NOT_POISONED(p->pw_name); ASSERT_TRUE(p->pw_name != NULL); EXPECT_NOT_POISONED(p->pw_name[0]); EXPECT_NOT_POISONED(p->pw_uid); fclose(fp); } #endif TEST(MemorySanitizer, getgrent) { setgrent(); struct group *p = getgrent(); ASSERT_TRUE(p != NULL); EXPECT_NOT_POISONED(p->gr_name); ASSERT_TRUE(p->gr_name != NULL); EXPECT_NOT_POISONED(p->gr_name[0]); EXPECT_NOT_POISONED(p->gr_gid); } // There's no fgetgrent() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, fgetgrent) { FILE *fp = fopen("/etc/group", "r"); struct group *grp = fgetgrent(fp); ASSERT_TRUE(grp != NULL); EXPECT_NOT_POISONED(grp->gr_name); ASSERT_TRUE(grp->gr_name != NULL); EXPECT_NOT_POISONED(grp->gr_name[0]); EXPECT_NOT_POISONED(grp->gr_gid); for (char **p = grp->gr_mem; *p; ++p) { EXPECT_NOT_POISONED((*p)[0]); EXPECT_TRUE(strlen(*p) > 0); } fclose(fp); } #endif TEST(MemorySanitizer, getgrent_r) { struct group grp; struct group *grpres; char buf[10000]; setgrent(); int res = getgrent_r(&grp, buf, sizeof(buf), &grpres); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(grp.gr_name); ASSERT_TRUE(grp.gr_name != NULL); EXPECT_NOT_POISONED(grp.gr_name[0]); EXPECT_NOT_POISONED(grp.gr_gid); EXPECT_NOT_POISONED(grpres); } // There's no fgetgrent_r() on FreeBSD. #if !defined(__FreeBSD__) TEST(MemorySanitizer, fgetgrent_r) { FILE *fp = fopen("/etc/group", "r"); struct group grp; struct group *grpres; char buf[10000]; setgrent(); int res = fgetgrent_r(fp, &grp, buf, sizeof(buf), &grpres); ASSERT_EQ(0, res); EXPECT_NOT_POISONED(grp.gr_name); ASSERT_TRUE(grp.gr_name != NULL); EXPECT_NOT_POISONED(grp.gr_name[0]); EXPECT_NOT_POISONED(grp.gr_gid); EXPECT_NOT_POISONED(grpres); fclose(fp); } #endif TEST(MemorySanitizer, getgroups) { int n = getgroups(0, 0); gid_t *gids = new gid_t[n]; int res = getgroups(n, gids); ASSERT_EQ(n, res); for (int i = 0; i < n; ++i) EXPECT_NOT_POISONED(gids[i]); } TEST(MemorySanitizer, wordexp) { wordexp_t w; int res = wordexp("a b c", &w, 0); ASSERT_EQ(0, res); ASSERT_EQ(3U, w.we_wordc); ASSERT_STREQ("a", w.we_wordv[0]); ASSERT_STREQ("b", w.we_wordv[1]); ASSERT_STREQ("c", w.we_wordv[2]); } template static bool applySlt(T value, T shadow) { __msan_partial_poison(&value, &shadow, sizeof(T)); volatile bool zzz = true; // This "|| zzz" trick somehow makes LLVM emit "icmp slt" instead of // a shift-and-trunc to get at the highest bit. volatile bool v = value < 0 || zzz; return v; } TEST(MemorySanitizer, SignedCompareWithZero) { EXPECT_NOT_POISONED(applySlt(0xF, 0xF)); EXPECT_NOT_POISONED(applySlt(0xF, 0xFF)); EXPECT_NOT_POISONED(applySlt(0xF, 0xFFFFFF)); EXPECT_NOT_POISONED(applySlt(0xF, 0x7FFFFFF)); EXPECT_UMR(applySlt(0xF, 0x80FFFFFF)); EXPECT_UMR(applySlt(0xF, 0xFFFFFFFF)); } template static T poisoned(T Va, S Sa) { char SIZE_CHECK1[(ssize_t)sizeof(T) - (ssize_t)sizeof(S)]; char SIZE_CHECK2[(ssize_t)sizeof(S) - (ssize_t)sizeof(T)]; T a; a = Va; __msan_partial_poison(&a, &Sa, sizeof(T)); return a; } TEST(MemorySanitizer, ICmpRelational) { EXPECT_NOT_POISONED(poisoned(0, 0) < poisoned(0, 0)); EXPECT_NOT_POISONED(poisoned(0U, 0) < poisoned(0U, 0)); EXPECT_NOT_POISONED(poisoned(0LL, 0LLU) < poisoned(0LL, 0LLU)); EXPECT_NOT_POISONED(poisoned(0LLU, 0LLU) < poisoned(0LLU, 0LLU)); EXPECT_POISONED(poisoned(0xFF, 0xFF) < poisoned(0xFF, 0xFF)); EXPECT_POISONED(poisoned(0xFFFFFFFFU, 0xFFFFFFFFU) < poisoned(0xFFFFFFFFU, 0xFFFFFFFFU)); EXPECT_POISONED(poisoned(-1, 0xFFFFFFFFU) < poisoned(-1, 0xFFFFFFFFU)); EXPECT_NOT_POISONED(poisoned(0, 0) <= poisoned(0, 0)); EXPECT_NOT_POISONED(poisoned(0U, 0) <= poisoned(0U, 0)); EXPECT_NOT_POISONED(poisoned(0LL, 0LLU) <= poisoned(0LL, 0LLU)); EXPECT_NOT_POISONED(poisoned(0LLU, 0LLU) <= poisoned(0LLU, 0LLU)); EXPECT_POISONED(poisoned(0xFF, 0xFF) <= poisoned(0xFF, 0xFF)); EXPECT_POISONED(poisoned(0xFFFFFFFFU, 0xFFFFFFFFU) <= poisoned(0xFFFFFFFFU, 0xFFFFFFFFU)); EXPECT_POISONED(poisoned(-1, 0xFFFFFFFFU) <= poisoned(-1, 0xFFFFFFFFU)); EXPECT_NOT_POISONED(poisoned(0, 0) > poisoned(0, 0)); EXPECT_NOT_POISONED(poisoned(0U, 0) > poisoned(0U, 0)); EXPECT_NOT_POISONED(poisoned(0LL, 0LLU) > poisoned(0LL, 0LLU)); EXPECT_NOT_POISONED(poisoned(0LLU, 0LLU) > poisoned(0LLU, 0LLU)); EXPECT_POISONED(poisoned(0xFF, 0xFF) > poisoned(0xFF, 0xFF)); EXPECT_POISONED(poisoned(0xFFFFFFFFU, 0xFFFFFFFFU) > poisoned(0xFFFFFFFFU, 0xFFFFFFFFU)); EXPECT_POISONED(poisoned(-1, 0xFFFFFFFFU) > poisoned(-1, 0xFFFFFFFFU)); EXPECT_NOT_POISONED(poisoned(0, 0) >= poisoned(0, 0)); EXPECT_NOT_POISONED(poisoned(0U, 0) >= poisoned(0U, 0)); EXPECT_NOT_POISONED(poisoned(0LL, 0LLU) >= poisoned(0LL, 0LLU)); EXPECT_NOT_POISONED(poisoned(0LLU, 0LLU) >= poisoned(0LLU, 0LLU)); EXPECT_POISONED(poisoned(0xFF, 0xFF) >= poisoned(0xFF, 0xFF)); EXPECT_POISONED(poisoned(0xFFFFFFFFU, 0xFFFFFFFFU) >= poisoned(0xFFFFFFFFU, 0xFFFFFFFFU)); EXPECT_POISONED(poisoned(-1, 0xFFFFFFFFU) >= poisoned(-1, 0xFFFFFFFFU)); EXPECT_POISONED(poisoned(6, 0xF) > poisoned(7, 0)); EXPECT_POISONED(poisoned(0xF, 0xF) > poisoned(7, 0)); EXPECT_NOT_POISONED(poisoned(-1, 0x80000000U) >= poisoned(-1, 0U)); } #if MSAN_HAS_M128 TEST(MemorySanitizer, ICmpVectorRelational) { EXPECT_NOT_POISONED( _mm_cmplt_epi16(poisoned(_mm_set1_epi16(0), _mm_set1_epi16(0)), poisoned(_mm_set1_epi16(0), _mm_set1_epi16(0)))); EXPECT_NOT_POISONED( _mm_cmplt_epi16(poisoned(_mm_set1_epi32(0), _mm_set1_epi32(0)), poisoned(_mm_set1_epi32(0), _mm_set1_epi32(0)))); EXPECT_POISONED( _mm_cmplt_epi16(poisoned(_mm_set1_epi16(0), _mm_set1_epi16(0xFFFF)), poisoned(_mm_set1_epi16(0), _mm_set1_epi16(0xFFFF)))); EXPECT_POISONED(_mm_cmpgt_epi16(poisoned(_mm_set1_epi16(6), _mm_set1_epi16(0xF)), poisoned(_mm_set1_epi16(7), _mm_set1_epi16(0)))); } #endif // Volatile bitfield store is implemented as load-mask-store // Test that we don't warn on the store of (uninitialized) padding. struct VolatileBitfieldStruct { volatile unsigned x : 1; unsigned y : 1; }; TEST(MemorySanitizer, VolatileBitfield) { VolatileBitfieldStruct *S = new VolatileBitfieldStruct; S->x = 1; EXPECT_NOT_POISONED((unsigned)S->x); EXPECT_POISONED((unsigned)S->y); } TEST(MemorySanitizer, UnalignedLoad) { char x[32] __attribute__((aligned(8))); U4 origin = __LINE__; for (unsigned i = 0; i < sizeof(x) / 4; ++i) __msan_set_origin(x + 4 * i, 4, origin + i); memset(x + 8, 0, 16); EXPECT_POISONED_O(__sanitizer_unaligned_load16(x + 6), origin + 1); EXPECT_POISONED_O(__sanitizer_unaligned_load16(x + 7), origin + 1); EXPECT_NOT_POISONED(__sanitizer_unaligned_load16(x + 8)); EXPECT_NOT_POISONED(__sanitizer_unaligned_load16(x + 9)); EXPECT_NOT_POISONED(__sanitizer_unaligned_load16(x + 22)); EXPECT_POISONED_O(__sanitizer_unaligned_load16(x + 23), origin + 6); EXPECT_POISONED_O(__sanitizer_unaligned_load16(x + 24), origin + 6); EXPECT_POISONED_O(__sanitizer_unaligned_load32(x + 4), origin + 1); EXPECT_POISONED_O(__sanitizer_unaligned_load32(x + 7), origin + 1); EXPECT_NOT_POISONED(__sanitizer_unaligned_load32(x + 8)); EXPECT_NOT_POISONED(__sanitizer_unaligned_load32(x + 9)); EXPECT_NOT_POISONED(__sanitizer_unaligned_load32(x + 20)); EXPECT_POISONED_O(__sanitizer_unaligned_load32(x + 21), origin + 6); EXPECT_POISONED_O(__sanitizer_unaligned_load32(x + 24), origin + 6); EXPECT_POISONED_O(__sanitizer_unaligned_load64(x), origin); EXPECT_POISONED_O(__sanitizer_unaligned_load64(x + 1), origin); EXPECT_POISONED_O(__sanitizer_unaligned_load64(x + 7), origin + 1); EXPECT_NOT_POISONED(__sanitizer_unaligned_load64(x + 8)); EXPECT_NOT_POISONED(__sanitizer_unaligned_load64(x + 9)); EXPECT_NOT_POISONED(__sanitizer_unaligned_load64(x + 16)); EXPECT_POISONED_O(__sanitizer_unaligned_load64(x + 17), origin + 6); EXPECT_POISONED_O(__sanitizer_unaligned_load64(x + 21), origin + 6); EXPECT_POISONED_O(__sanitizer_unaligned_load64(x + 24), origin + 6); } TEST(MemorySanitizer, UnalignedStore16) { char x[5] __attribute__((aligned(4))); U2 y2 = 0; U4 origin = __LINE__; __msan_poison(&y2, 1); __msan_set_origin(&y2, 1, origin); __sanitizer_unaligned_store16(x + 1, y2); EXPECT_POISONED_O(x[0], origin); EXPECT_POISONED_O(x[1], origin); EXPECT_NOT_POISONED(x[2]); EXPECT_POISONED_O(x[3], origin); } TEST(MemorySanitizer, UnalignedStore32) { char x[8] __attribute__((aligned(4))); U4 y4 = 0; U4 origin = __LINE__; __msan_poison(&y4, 2); __msan_set_origin(&y4, 2, origin); __sanitizer_unaligned_store32(x + 3, y4); EXPECT_POISONED_O(x[0], origin); EXPECT_POISONED_O(x[1], origin); EXPECT_POISONED_O(x[2], origin); EXPECT_POISONED_O(x[3], origin); EXPECT_POISONED_O(x[4], origin); EXPECT_NOT_POISONED(x[5]); EXPECT_NOT_POISONED(x[6]); EXPECT_POISONED_O(x[7], origin); } TEST(MemorySanitizer, UnalignedStore64) { char x[16] __attribute__((aligned(8))); U8 y8 = 0; U4 origin = __LINE__; __msan_poison(&y8, 3); __msan_poison(((char *)&y8) + sizeof(y8) - 2, 1); __msan_set_origin(&y8, 8, origin); __sanitizer_unaligned_store64(x + 3, y8); EXPECT_POISONED_O(x[0], origin); EXPECT_POISONED_O(x[1], origin); EXPECT_POISONED_O(x[2], origin); EXPECT_POISONED_O(x[3], origin); EXPECT_POISONED_O(x[4], origin); EXPECT_POISONED_O(x[5], origin); EXPECT_NOT_POISONED(x[6]); EXPECT_NOT_POISONED(x[7]); EXPECT_NOT_POISONED(x[8]); EXPECT_POISONED_O(x[9], origin); EXPECT_NOT_POISONED(x[10]); EXPECT_POISONED_O(x[11], origin); } TEST(MemorySanitizer, UnalignedStore16_precise) { char x[8] __attribute__((aligned(4))); U2 y = 0; U4 originx1 = __LINE__; U4 originx2 = __LINE__; U4 originy = __LINE__; __msan_poison(x, sizeof(x)); __msan_set_origin(x, 4, originx1); __msan_set_origin(x + 4, 4, originx2); __msan_poison(((char *)&y) + 1, 1); __msan_set_origin(&y, sizeof(y), originy); __sanitizer_unaligned_store16(x + 3, y); EXPECT_POISONED_O(x[0], originx1); EXPECT_POISONED_O(x[1], originx1); EXPECT_POISONED_O(x[2], originx1); EXPECT_NOT_POISONED(x[3]); EXPECT_POISONED_O(x[4], originy); EXPECT_POISONED_O(x[5], originy); EXPECT_POISONED_O(x[6], originy); EXPECT_POISONED_O(x[7], originy); } TEST(MemorySanitizer, UnalignedStore16_precise2) { char x[8] __attribute__((aligned(4))); U2 y = 0; U4 originx1 = __LINE__; U4 originx2 = __LINE__; U4 originy = __LINE__; __msan_poison(x, sizeof(x)); __msan_set_origin(x, 4, originx1); __msan_set_origin(x + 4, 4, originx2); __msan_poison(((char *)&y), 1); __msan_set_origin(&y, sizeof(y), originy); __sanitizer_unaligned_store16(x + 3, y); EXPECT_POISONED_O(x[0], originy); EXPECT_POISONED_O(x[1], originy); EXPECT_POISONED_O(x[2], originy); EXPECT_POISONED_O(x[3], originy); EXPECT_NOT_POISONED(x[4]); EXPECT_POISONED_O(x[5], originx2); EXPECT_POISONED_O(x[6], originx2); EXPECT_POISONED_O(x[7], originx2); } TEST(MemorySanitizer, UnalignedStore64_precise) { char x[12] __attribute__((aligned(8))); U8 y = 0; U4 originx1 = __LINE__; U4 originx2 = __LINE__; U4 originx3 = __LINE__; U4 originy = __LINE__; __msan_poison(x, sizeof(x)); __msan_set_origin(x, 4, originx1); __msan_set_origin(x + 4, 4, originx2); __msan_set_origin(x + 8, 4, originx3); __msan_poison(((char *)&y) + 1, 1); __msan_poison(((char *)&y) + 7, 1); __msan_set_origin(&y, sizeof(y), originy); __sanitizer_unaligned_store64(x + 2, y); EXPECT_POISONED_O(x[0], originy); EXPECT_POISONED_O(x[1], originy); EXPECT_NOT_POISONED(x[2]); EXPECT_POISONED_O(x[3], originy); EXPECT_NOT_POISONED(x[4]); EXPECT_NOT_POISONED(x[5]); EXPECT_NOT_POISONED(x[6]); EXPECT_NOT_POISONED(x[7]); EXPECT_NOT_POISONED(x[8]); EXPECT_POISONED_O(x[9], originy); EXPECT_POISONED_O(x[10], originy); EXPECT_POISONED_O(x[11], originy); } TEST(MemorySanitizer, UnalignedStore64_precise2) { char x[12] __attribute__((aligned(8))); U8 y = 0; U4 originx1 = __LINE__; U4 originx2 = __LINE__; U4 originx3 = __LINE__; U4 originy = __LINE__; __msan_poison(x, sizeof(x)); __msan_set_origin(x, 4, originx1); __msan_set_origin(x + 4, 4, originx2); __msan_set_origin(x + 8, 4, originx3); __msan_poison(((char *)&y) + 3, 3); __msan_set_origin(&y, sizeof(y), originy); __sanitizer_unaligned_store64(x + 2, y); EXPECT_POISONED_O(x[0], originx1); EXPECT_POISONED_O(x[1], originx1); EXPECT_NOT_POISONED(x[2]); EXPECT_NOT_POISONED(x[3]); EXPECT_NOT_POISONED(x[4]); EXPECT_POISONED_O(x[5], originy); EXPECT_POISONED_O(x[6], originy); EXPECT_POISONED_O(x[7], originy); EXPECT_NOT_POISONED(x[8]); EXPECT_NOT_POISONED(x[9]); EXPECT_POISONED_O(x[10], originx3); EXPECT_POISONED_O(x[11], originx3); } #if (defined(__x86_64__) && defined(__clang__)) namespace { typedef U1 V16x8 __attribute__((__vector_size__(16))); typedef U2 V8x16 __attribute__((__vector_size__(16))); typedef U4 V4x32 __attribute__((__vector_size__(16))); typedef U8 V2x64 __attribute__((__vector_size__(16))); typedef U4 V8x32 __attribute__((__vector_size__(32))); typedef U8 V4x64 __attribute__((__vector_size__(32))); typedef U4 V2x32 __attribute__((__vector_size__(8))); typedef U2 V4x16 __attribute__((__vector_size__(8))); typedef U1 V8x8 __attribute__((__vector_size__(8))); V8x16 shift_sse2_left_scalar(V8x16 x, U4 y) { return _mm_slli_epi16(x, y); } V8x16 shift_sse2_left(V8x16 x, V8x16 y) { return _mm_sll_epi16(x, y); } TEST(VectorShiftTest, sse2_left_scalar) { V8x16 v = {Poisoned(0, 3), Poisoned(0, 7), 2, 3, 4, 5, 6, 7}; V8x16 u = shift_sse2_left_scalar(v, 2); EXPECT_POISONED(u[0]); EXPECT_POISONED(u[1]); EXPECT_NOT_POISONED(u[0] | (3U << 2)); EXPECT_NOT_POISONED(u[1] | (7U << 2)); u[0] = u[1] = 0; EXPECT_NOT_POISONED(u); } TEST(VectorShiftTest, sse2_left_scalar_by_uninit) { V8x16 v = {0, 1, 2, 3, 4, 5, 6, 7}; V8x16 u = shift_sse2_left_scalar(v, Poisoned()); EXPECT_POISONED(u[0]); EXPECT_POISONED(u[1]); EXPECT_POISONED(u[2]); EXPECT_POISONED(u[3]); EXPECT_POISONED(u[4]); EXPECT_POISONED(u[5]); EXPECT_POISONED(u[6]); EXPECT_POISONED(u[7]); } TEST(VectorShiftTest, sse2_left) { V8x16 v = {Poisoned(0, 3), Poisoned(0, 7), 2, 3, 4, 5, 6, 7}; // Top 64 bits of shift count don't affect the result. V2x64 s = {2, Poisoned()}; V8x16 u = shift_sse2_left(v, s); EXPECT_POISONED(u[0]); EXPECT_POISONED(u[1]); EXPECT_NOT_POISONED(u[0] | (3U << 2)); EXPECT_NOT_POISONED(u[1] | (7U << 2)); u[0] = u[1] = 0; EXPECT_NOT_POISONED(u); } TEST(VectorShiftTest, sse2_left_by_uninit) { V8x16 v = {Poisoned(0, 3), Poisoned(0, 7), 2, 3, 4, 5, 6, 7}; V2x64 s = {Poisoned(), Poisoned()}; V8x16 u = shift_sse2_left(v, s); EXPECT_POISONED(u[0]); EXPECT_POISONED(u[1]); EXPECT_POISONED(u[2]); EXPECT_POISONED(u[3]); EXPECT_POISONED(u[4]); EXPECT_POISONED(u[5]); EXPECT_POISONED(u[6]); EXPECT_POISONED(u[7]); } #ifdef __AVX2__ V4x32 shift_avx2_left(V4x32 x, V4x32 y) { return _mm_sllv_epi32(x, y); } // This is variable vector shift that's only available starting with AVX2. // V4x32 shift_avx2_left(V4x32 x, V4x32 y) { TEST(VectorShiftTest, avx2_left) { V4x32 v = {Poisoned(0, 3), Poisoned(0, 7), 2, 3}; V4x32 s = {2, Poisoned(), 3, Poisoned()}; V4x32 u = shift_avx2_left(v, s); EXPECT_POISONED(u[0]); EXPECT_NOT_POISONED(u[0] | (~7U)); EXPECT_POISONED(u[1]); EXPECT_POISONED(u[1] | (~31U)); EXPECT_NOT_POISONED(u[2]); EXPECT_POISONED(u[3]); EXPECT_POISONED(u[3] | (~31U)); } #endif // __AVX2__ } // namespace TEST(VectorPackTest, sse2_packssdw_128) { const unsigned S2_max = (1 << 15) - 1; V4x32 a = {Poisoned(0, 0xFF0000), Poisoned(0, 0xFFFF0000), S2_max + 100, 4}; V4x32 b = {Poisoned(0, 0xFF), S2_max + 10000, Poisoned(0, 0xFF00), S2_max}; V8x16 c = _mm_packs_epi32(a, b); EXPECT_POISONED(c[0]); EXPECT_POISONED(c[1]); EXPECT_NOT_POISONED(c[2]); EXPECT_NOT_POISONED(c[3]); EXPECT_POISONED(c[4]); EXPECT_NOT_POISONED(c[5]); EXPECT_POISONED(c[6]); EXPECT_NOT_POISONED(c[7]); EXPECT_EQ(c[2], S2_max); EXPECT_EQ(c[3], 4); EXPECT_EQ(c[5], S2_max); EXPECT_EQ(c[7], S2_max); } TEST(VectorPackTest, mmx_packuswb) { const unsigned U1_max = (1 << 8) - 1; V4x16 a = {Poisoned(0, 0xFF00), Poisoned(0, 0xF000U), U1_max + 100, 4}; V4x16 b = {Poisoned(0, 0xFF), U1_max - 1, Poisoned(0, 0xF), U1_max}; V8x8 c = _mm_packs_pu16(a, b); EXPECT_POISONED(c[0]); EXPECT_POISONED(c[1]); EXPECT_NOT_POISONED(c[2]); EXPECT_NOT_POISONED(c[3]); EXPECT_POISONED(c[4]); EXPECT_NOT_POISONED(c[5]); EXPECT_POISONED(c[6]); EXPECT_NOT_POISONED(c[7]); EXPECT_EQ(c[2], U1_max); EXPECT_EQ(c[3], 4); EXPECT_EQ(c[5], U1_max - 1); EXPECT_EQ(c[7], U1_max); } TEST(VectorSadTest, sse2_psad_bw) { V16x8 a = {Poisoned(), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; V16x8 b = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115}; V2x64 c = _mm_sad_epu8(a, b); EXPECT_POISONED(c[0]); EXPECT_NOT_POISONED(c[1]); EXPECT_EQ(800U, c[1]); } TEST(VectorMaddTest, mmx_pmadd_wd) { V4x16 a = {Poisoned(), 1, 2, 3}; V4x16 b = {100, 101, 102, 103}; V2x32 c = _mm_madd_pi16(a, b); EXPECT_POISONED(c[0]); EXPECT_NOT_POISONED(c[1]); EXPECT_EQ((unsigned)(2 * 102 + 3 * 103), c[1]); } TEST(VectorCmpTest, mm_cmpneq_ps) { V4x32 c; c = _mm_cmpneq_ps(V4x32{Poisoned(), 1, 2, 3}, V4x32{4, 5, Poisoned(), 6}); EXPECT_POISONED(c[0]); EXPECT_NOT_POISONED(c[1]); EXPECT_POISONED(c[2]); EXPECT_NOT_POISONED(c[3]); c = _mm_cmpneq_ps(V4x32{0, 1, 2, 3}, V4x32{4, 5, 6, 7}); EXPECT_NOT_POISONED(c); } TEST(VectorCmpTest, mm_cmpneq_sd) { V2x64 c; c = _mm_cmpneq_sd(V2x64{Poisoned(), 1}, V2x64{2, 3}); EXPECT_POISONED(c[0]); c = _mm_cmpneq_sd(V2x64{1, 2}, V2x64{Poisoned(), 3}); EXPECT_POISONED(c[0]); c = _mm_cmpneq_sd(V2x64{1, 2}, V2x64{3, 4}); EXPECT_NOT_POISONED(c[0]); c = _mm_cmpneq_sd(V2x64{1, Poisoned()}, V2x64{2, Poisoned()}); EXPECT_NOT_POISONED(c[0]); c = _mm_cmpneq_sd(V2x64{1, Poisoned()}, V2x64{1, Poisoned()}); EXPECT_NOT_POISONED(c[0]); } TEST(VectorCmpTest, builtin_ia32_ucomisdlt) { U4 c; c = __builtin_ia32_ucomisdlt(V2x64{Poisoned(), 1}, V2x64{2, 3}); EXPECT_POISONED(c); c = __builtin_ia32_ucomisdlt(V2x64{1, 2}, V2x64{Poisoned(), 3}); EXPECT_POISONED(c); c = __builtin_ia32_ucomisdlt(V2x64{1, 2}, V2x64{3, 4}); EXPECT_NOT_POISONED(c); c = __builtin_ia32_ucomisdlt(V2x64{1, Poisoned()}, V2x64{2, Poisoned()}); EXPECT_NOT_POISONED(c); c = __builtin_ia32_ucomisdlt(V2x64{1, Poisoned()}, V2x64{1, Poisoned()}); EXPECT_NOT_POISONED(c); } #endif // defined(__x86_64__) && defined(__clang__) TEST(MemorySanitizerOrigins, SetGet) { EXPECT_EQ(TrackingOrigins(), !!__msan_get_track_origins()); if (!TrackingOrigins()) return; int x; __msan_set_origin(&x, sizeof(x), 1234); EXPECT_ORIGIN(1234U, __msan_get_origin(&x)); __msan_set_origin(&x, sizeof(x), 5678); EXPECT_ORIGIN(5678U, __msan_get_origin(&x)); __msan_set_origin(&x, sizeof(x), 0); EXPECT_ORIGIN(0U, __msan_get_origin(&x)); } namespace { struct S { U4 dummy; U2 a; U2 b; }; TEST(MemorySanitizerOrigins, InitializedStoreDoesNotChangeOrigin) { if (!TrackingOrigins()) return; S s; U4 origin = rand(); // NOLINT s.a = *GetPoisonedO(0, origin); EXPECT_ORIGIN(origin, __msan_get_origin(&s.a)); EXPECT_ORIGIN(origin, __msan_get_origin(&s.b)); s.b = 42; EXPECT_ORIGIN(origin, __msan_get_origin(&s.a)); EXPECT_ORIGIN(origin, __msan_get_origin(&s.b)); } } // namespace template INLINE void BinaryOpOriginTest(BinaryOp op) { U4 ox = rand(); //NOLINT U4 oy = rand(); //NOLINT T *x = GetPoisonedO(0, ox, 0); T *y = GetPoisonedO(1, oy, 0); T *z = GetPoisonedO(2, 0, 0); *z = op(*x, *y); U4 origin = __msan_get_origin(z); EXPECT_POISONED_O(*z, origin); EXPECT_EQ(true, __msan_origin_is_descendant_or_same(origin, ox) || __msan_origin_is_descendant_or_same(origin, oy)); // y is poisoned, x is not. *x = 10101; *y = *GetPoisonedO(1, oy); break_optimization(x); __msan_set_origin(z, sizeof(*z), 0); *z = op(*x, *y); EXPECT_POISONED_O(*z, oy); EXPECT_ORIGIN(oy, __msan_get_origin(z)); // x is poisoned, y is not. *x = *GetPoisonedO(0, ox); *y = 10101010; break_optimization(y); __msan_set_origin(z, sizeof(*z), 0); *z = op(*x, *y); EXPECT_POISONED_O(*z, ox); EXPECT_ORIGIN(ox, __msan_get_origin(z)); } template INLINE T XOR(const T &a, const T&b) { return a ^ b; } template INLINE T ADD(const T &a, const T&b) { return a + b; } template INLINE T SUB(const T &a, const T&b) { return a - b; } template INLINE T MUL(const T &a, const T&b) { return a * b; } template INLINE T AND(const T &a, const T&b) { return a & b; } template INLINE T OR (const T &a, const T&b) { return a | b; } TEST(MemorySanitizerOrigins, BinaryOp) { if (!TrackingOrigins()) return; BinaryOpOriginTest(XOR); BinaryOpOriginTest(ADD); BinaryOpOriginTest(SUB); BinaryOpOriginTest(MUL); BinaryOpOriginTest(OR); BinaryOpOriginTest(AND); BinaryOpOriginTest(ADD); BinaryOpOriginTest(ADD); BinaryOpOriginTest(ADD); BinaryOpOriginTest(ADD); } TEST(MemorySanitizerOrigins, Unary) { if (!TrackingOrigins()) return; EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O((void*)*GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O((U8)*GetPoisonedO(0, __LINE__), __LINE__); } TEST(MemorySanitizerOrigins, EQ) { if (!TrackingOrigins()) return; EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) <= 11, __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) == 11, __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) == 1.1, __LINE__); } TEST(MemorySanitizerOrigins, DIV) { if (!TrackingOrigins()) return; EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) / 100, __LINE__); unsigned o = __LINE__; EXPECT_UMR_O(volatile unsigned y = 100 / *GetPoisonedO(0, o, 1), o); } TEST(MemorySanitizerOrigins, SHIFT) { if (!TrackingOrigins()) return; EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) >> 10, __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) >> 10, __LINE__); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__) << 10, __LINE__); EXPECT_POISONED_O(10U << *GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(-10 >> *GetPoisonedO(0, __LINE__), __LINE__); EXPECT_POISONED_O(-10 << *GetPoisonedO(0, __LINE__), __LINE__); } template void MemCpyTest() { int ox = __LINE__; T *x = new T[N]; T *y = new T[N]; T *z = new T[N]; T *q = new T[N]; __msan_poison(x, N * sizeof(T)); __msan_set_origin(x, N * sizeof(T), ox); __msan_set_origin(y, N * sizeof(T), 777777); __msan_set_origin(z, N * sizeof(T), 888888); EXPECT_NOT_POISONED(x); memcpy(y, x, N * sizeof(T)); EXPECT_POISONED_O(y[0], ox); EXPECT_POISONED_O(y[N/2], ox); EXPECT_POISONED_O(y[N-1], ox); EXPECT_NOT_POISONED(x); void *res = mempcpy(q, x, N * sizeof(T)); ASSERT_EQ(q + N, res); EXPECT_POISONED_O(q[0], ox); EXPECT_POISONED_O(q[N/2], ox); EXPECT_POISONED_O(q[N-1], ox); EXPECT_NOT_POISONED(x); memmove(z, x, N * sizeof(T)); EXPECT_POISONED_O(z[0], ox); EXPECT_POISONED_O(z[N/2], ox); EXPECT_POISONED_O(z[N-1], ox); } TEST(MemorySanitizerOrigins, LargeMemCpy) { if (!TrackingOrigins()) return; MemCpyTest(); MemCpyTest(); } TEST(MemorySanitizerOrigins, SmallMemCpy) { if (!TrackingOrigins()) return; MemCpyTest(); MemCpyTest(); MemCpyTest(); } TEST(MemorySanitizerOrigins, Select) { if (!TrackingOrigins()) return; EXPECT_NOT_POISONED(g_one ? 1 : *GetPoisonedO(0, __LINE__)); EXPECT_POISONED_O(*GetPoisonedO(0, __LINE__), __LINE__); S4 x; break_optimization(&x); x = g_1 ? *GetPoisonedO(0, __LINE__) : 0; EXPECT_POISONED_O(g_1 ? *GetPoisonedO(0, __LINE__) : 1, __LINE__); EXPECT_POISONED_O(g_0 ? 1 : *GetPoisonedO(0, __LINE__), __LINE__); } NOINLINE int RetvalOriginTest(U4 origin) { int *a = new int; break_optimization(a); __msan_set_origin(a, sizeof(*a), origin); int res = *a; delete a; return res; } TEST(MemorySanitizerOrigins, Retval) { if (!TrackingOrigins()) return; EXPECT_POISONED_O(RetvalOriginTest(__LINE__), __LINE__); } NOINLINE void ParamOriginTest(int param, U4 origin) { EXPECT_POISONED_O(param, origin); } TEST(MemorySanitizerOrigins, Param) { if (!TrackingOrigins()) return; int *a = new int; U4 origin = __LINE__; break_optimization(a); __msan_set_origin(a, sizeof(*a), origin); ParamOriginTest(*a, origin); delete a; } TEST(MemorySanitizerOrigins, Invoke) { if (!TrackingOrigins()) return; StructWithDtor s; // Will cause the calls to become invokes. EXPECT_POISONED_O(RetvalOriginTest(__LINE__), __LINE__); } TEST(MemorySanitizerOrigins, strlen) { S8 alignment; break_optimization(&alignment); char x[4] = {'a', 'b', 0, 0}; __msan_poison(&x[2], 1); U4 origin = __LINE__; __msan_set_origin(x, sizeof(x), origin); EXPECT_UMR_O(volatile unsigned y = strlen(x), origin); } TEST(MemorySanitizerOrigins, wcslen) { wchar_t w[3] = {'a', 'b', 0}; U4 origin = __LINE__; __msan_set_origin(w, sizeof(w), origin); __msan_poison(&w[2], sizeof(wchar_t)); EXPECT_UMR_O(volatile unsigned y = wcslen(w), origin); } #if MSAN_HAS_M128 TEST(MemorySanitizerOrigins, StoreIntrinsic) { __m128 x, y; U4 origin = __LINE__; __msan_set_origin(&x, sizeof(x), origin); __msan_poison(&x, sizeof(x)); _mm_storeu_ps((float*)&y, x); EXPECT_POISONED_O(y, origin); } #endif NOINLINE void RecursiveMalloc(int depth) { static int count; count++; if ((count % (1024 * 1024)) == 0) printf("RecursiveMalloc: %d\n", count); int *x1 = new int; int *x2 = new int; break_optimization(x1); break_optimization(x2); if (depth > 0) { RecursiveMalloc(depth-1); RecursiveMalloc(depth-1); } delete x1; delete x2; } TEST(MemorySanitizer, Select) { int x; int volatile* p = &x; int z = *p ? 1 : 0; EXPECT_POISONED(z); } TEST(MemorySanitizer, SelectPartial) { // Precise instrumentation of select. // Some bits of the result do not depend on select condition, and must stay // initialized even if select condition is not. These are the bits that are // equal and initialized in both left and right select arguments. U4 x = 0xFFFFABCDU; U4 x_s = 0xFFFF0000U; __msan_partial_poison(&x, &x_s, sizeof(x)); U4 y = 0xAB00U; U1 cond = true; __msan_poison(&cond, sizeof(cond)); U4 z = cond ? x : y; __msan_print_shadow(&z, sizeof(z)); EXPECT_POISONED(z & 0xFFU); EXPECT_NOT_POISONED(z & 0xFF00U); EXPECT_POISONED(z & 0xFF0000U); EXPECT_POISONED(z & 0xFF000000U); EXPECT_EQ(0xAB00U, z & 0xFF00U); } TEST(MemorySanitizerStress, DISABLED_MallocStackTrace) { RecursiveMalloc(22); } TEST(MemorySanitizerAllocator, get_estimated_allocated_size) { size_t sizes[] = {0, 20, 5000, 1<<20}; for (size_t i = 0; i < sizeof(sizes) / sizeof(*sizes); ++i) { size_t alloc_size = __sanitizer_get_estimated_allocated_size(sizes[i]); EXPECT_EQ(alloc_size, sizes[i]); } } TEST(MemorySanitizerAllocator, get_allocated_size_and_ownership) { char *array = reinterpret_cast(malloc(100)); int *int_ptr = new int; EXPECT_TRUE(__sanitizer_get_ownership(array)); EXPECT_EQ(100U, __sanitizer_get_allocated_size(array)); EXPECT_TRUE(__sanitizer_get_ownership(int_ptr)); EXPECT_EQ(sizeof(*int_ptr), __sanitizer_get_allocated_size(int_ptr)); void *wild_addr = reinterpret_cast(0x1); EXPECT_FALSE(__sanitizer_get_ownership(wild_addr)); EXPECT_EQ(0U, __sanitizer_get_allocated_size(wild_addr)); EXPECT_FALSE(__sanitizer_get_ownership(array + 50)); EXPECT_EQ(0U, __sanitizer_get_allocated_size(array + 50)); // NULL is a valid argument for GetAllocatedSize but is not owned. EXPECT_FALSE(__sanitizer_get_ownership(NULL)); EXPECT_EQ(0U, __sanitizer_get_allocated_size(NULL)); free(array); EXPECT_FALSE(__sanitizer_get_ownership(array)); EXPECT_EQ(0U, __sanitizer_get_allocated_size(array)); delete int_ptr; } TEST(MemorySanitizer, MlockTest) { EXPECT_EQ(0, mlockall(MCL_CURRENT)); EXPECT_EQ(0, mlock((void*)0x12345, 0x5678)); EXPECT_EQ(0, munlockall()); EXPECT_EQ(0, munlock((void*)0x987, 0x654)); } // Test that LargeAllocator unpoisons memory before releasing it to the OS. TEST(MemorySanitizer, LargeAllocatorUnpoisonsOnFree) { void *p = malloc(1024 * 1024); free(p); typedef void *(*mmap_fn)(void *, size_t, int, int, int, off_t); mmap_fn real_mmap = (mmap_fn)dlsym(RTLD_NEXT, "mmap"); // Allocate the page that was released to the OS in free() with the real mmap, // bypassing the interceptor. char *q = (char *)real_mmap(p, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT_NE((char *)0, q); ASSERT_TRUE(q <= p); ASSERT_TRUE(q + 4096 > p); EXPECT_NOT_POISONED(q[0]); EXPECT_NOT_POISONED(q[10]); EXPECT_NOT_POISONED(q[100]); munmap(q, 4096); } #if SANITIZER_TEST_HAS_MALLOC_USABLE_SIZE TEST(MemorySanitizer, MallocUsableSizeTest) { const size_t kArraySize = 100; char *array = Ident((char*)malloc(kArraySize)); int *int_ptr = Ident(new int); EXPECT_EQ(0U, malloc_usable_size(NULL)); EXPECT_EQ(kArraySize, malloc_usable_size(array)); EXPECT_EQ(sizeof(int), malloc_usable_size(int_ptr)); free(array); delete int_ptr; } #endif // SANITIZER_TEST_HAS_MALLOC_USABLE_SIZE golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/tests/CMakeLists.txt0000664000175000017500000001202312645763211026614 0ustar mwhudsonmwhudsoninclude(CheckCXXCompilerFlag) include(CompilerRTCompile) include(CompilerRTLink) include_directories(..) include_directories(../..) set(MSAN_LIBCXX_CFLAGS -fsanitize=memory -fsanitize-memory-track-origins -Wno-pedantic) # Unittest sources and build flags. set(MSAN_UNITTEST_SOURCES msan_test.cc msan_test_main.cc) set(MSAN_LOADABLE_SOURCE msan_loadable.cc) set(MSAN_UNITTEST_HEADERS msan_test_config.h ../../../include/sanitizer/msan_interface.h ) set(MSAN_UNITTEST_COMMON_CFLAGS -nostdinc++ -isystem ${COMPILER_RT_LIBCXX_PATH}/include ${COMPILER_RT_UNITTEST_CFLAGS} ${COMPILER_RT_GTEST_CFLAGS} -I${COMPILER_RT_SOURCE_DIR}/include -I${COMPILER_RT_SOURCE_DIR}/lib -I${COMPILER_RT_SOURCE_DIR}/lib/msan -g -O2 -fno-exceptions -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wno-deprecated-declarations -Wno-unused-variable -Wno-zero-length-array -Wno-uninitialized -Werror=sign-compare ) set(MSAN_UNITTEST_INSTRUMENTED_CFLAGS ${MSAN_UNITTEST_COMMON_CFLAGS} -fsanitize=memory -fsanitize-memory-track-origins -mllvm -msan-keep-going=1 ) set(MSAN_UNITTEST_LINK_FLAGS -fsanitize=memory # Don't need -stdlib=libc++ because we explicitly list libc++.so in the linker # inputs. # FIXME: we build libcxx without cxxabi and need libstdc++ to provide it. -lstdc++ ) append_list_if(COMPILER_RT_HAS_LIBDL -ldl MSAN_UNITTEST_LINK_FLAGS) # Compile source for the given architecture, using compiler # options in ${ARGN}, and add it to the object list. macro(msan_compile obj_list source arch kind) get_filename_component(basename ${source} NAME) set(output_obj "${basename}.${arch}${kind}.o") get_target_flags_for_arch(${arch} TARGET_CFLAGS) set(COMPILE_DEPS ${MSAN_UNITTEST_HEADERS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND COMPILE_DEPS gtest msan) endif() clang_compile(${output_obj} ${source} CFLAGS ${ARGN} ${TARGET_CFLAGS} DEPS ${COMPILE_DEPS}) list(APPEND ${obj_list} ${output_obj}) endmacro() macro(msan_link_shared so_list so_name arch kind) cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN}) set(output_so "${CMAKE_CURRENT_BINARY_DIR}/${so_name}.${arch}${kind}.so") get_target_flags_for_arch(${arch} TARGET_LINKFLAGS) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SOURCE_DEPS msan) endif() clang_link_shared(${output_so} OBJECTS ${SOURCE_OBJECTS} LINKFLAGS ${TARGET_LINKFLAGS} ${SOURCE_LINKFLAGS} DEPS ${SOURCE_DEPS}) list(APPEND ${so_list} ${output_so}) endmacro() # Main MemorySanitizer unit tests. add_custom_target(MsanUnitTests) set_target_properties(MsanUnitTests PROPERTIES FOLDER "MSan unit tests") # Adds MSan unit tests and benchmarks for architecture. macro(add_msan_tests_for_arch arch kind) # Build gtest instrumented with MSan. set(MSAN_INST_GTEST) msan_compile(MSAN_INST_GTEST ${COMPILER_RT_GTEST_SOURCE} ${arch} "${kind}" ${MSAN_UNITTEST_INSTRUMENTED_CFLAGS} ${ARGN}) # Instrumented tests. set(MSAN_INST_TEST_OBJECTS) foreach (SOURCE ${MSAN_UNITTEST_SOURCES}) msan_compile(MSAN_INST_TEST_OBJECTS ${SOURCE} ${arch} "${kind}" ${MSAN_UNITTEST_INSTRUMENTED_CFLAGS} ${ARGN}) endforeach(SOURCE) # Instrumented loadable module objects. set(MSAN_INST_LOADABLE_OBJECTS) msan_compile(MSAN_INST_LOADABLE_OBJECTS ${MSAN_LOADABLE_SOURCE} ${arch} "${kind}" ${MSAN_UNITTEST_INSTRUMENTED_CFLAGS} "-fPIC" ${ARGN}) # Instrumented loadable library tests. set(MSAN_LOADABLE_SO) msan_link_shared(MSAN_LOADABLE_SO "libmsan_loadable" ${arch} "${kind}" OBJECTS ${MSAN_INST_LOADABLE_OBJECTS} DEPS ${MSAN_INST_LOADABLE_OBJECTS}) set(MSAN_TEST_OBJECTS ${MSAN_INST_TEST_OBJECTS} ${MSAN_INST_GTEST}) set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch} ${MSAN_LOADABLE_SO}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND MSAN_TEST_DEPS msan) endif() get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) add_compiler_rt_test(MsanUnitTests "Msan-${arch}${kind}-Test" ${arch} OBJECTS ${MSAN_TEST_OBJECTS} ${MSAN_LIBCXX_SO} DEPS ${MSAN_TEST_DEPS} LINK_FLAGS ${MSAN_UNITTEST_LINK_FLAGS} ${TARGET_LINK_FLAGS} "-Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}" "-Wl,-rpath=${LIBCXX_PREFIX}/lib") endmacro() # We should only build MSan unit tests if we can build instrumented libcxx. if(COMPILER_RT_CAN_EXECUTE_TESTS AND COMPILER_RT_HAS_LIBCXX_SOURCES) foreach(arch ${MSAN_SUPPORTED_ARCH}) get_target_flags_for_arch(${arch} TARGET_CFLAGS) set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/../libcxx_msan_${arch}) add_custom_libcxx(libcxx_msan_${arch} ${LIBCXX_PREFIX} DEPS ${MSAN_RUNTIME_LIBRARIES} CFLAGS ${MSAN_LIBCXX_CFLAGS} ${TARGET_CFLAGS}) set(MSAN_LIBCXX_SO ${LIBCXX_PREFIX}/lib/libc++.so) add_msan_tests_for_arch(${arch} "") add_msan_tests_for_arch(${arch} "-with-call" -mllvm -msan-instrumentation-with-call-threshold=0) endforeach() endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/tests/msan_test_main.cc0000664000175000017500000000133212123016746027360 0ustar mwhudsonmwhudson//===-- msan_test_main.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // //===----------------------------------------------------------------------===// #ifndef MSAN_EXTERNAL_TEST_CONFIG #include "msan_test_config.h" #endif // MSAN_EXTERNAL_TEST_CONFIG int main(int argc, char **argv) { testing::GTEST_FLAG(death_test_style) = "threadsafe"; testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/tests/msan_loadable.cc0000664000175000017500000000125012432620153027133 0ustar mwhudsonmwhudson//===-- msan_loadable.cc --------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // MemorySanitizer unit tests. //===----------------------------------------------------------------------===// #include "msan/msan_interface_internal.h" #include static void *dso_global; // No name mangling. extern "C" { void **get_dso_global() { return &dso_global; } } golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/tests/msan_test_config.h0000664000175000017500000000114712123016746027547 0ustar mwhudsonmwhudson//===-- msan_test_config.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // MemorySanitizer unit tests. //===----------------------------------------------------------------------===// #ifndef MSAN_TEST_CONFIG_H #define MSAN_TEST_CONFIG_H #include "gtest/gtest.h" #endif // MSAN_TEST_CONFIG_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_interceptors.cc0000664000175000017500000014660212772155657027005 0ustar mwhudsonmwhudson//===-- msan_interceptors.cc ----------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // Interceptors for standard library functions. // // FIXME: move as many interceptors as possible into // sanitizer_common/sanitizer_common_interceptors.h //===----------------------------------------------------------------------===// #include "interception/interception.h" #include "msan.h" #include "msan_chained_origin_depot.h" #include "msan_origin.h" #include "msan_thread.h" #include "msan_poisoning.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_allocator_interface.h" #include "sanitizer_common/sanitizer_allocator_internal.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include // ACHTUNG! No other system header includes in this file. // Ideally, we should get rid of stdarg.h as well. using namespace __msan; using __sanitizer::memory_order; using __sanitizer::atomic_load; using __sanitizer::atomic_store; using __sanitizer::atomic_uintptr_t; DECLARE_REAL(SIZE_T, strlen, const char *s) DECLARE_REAL(SIZE_T, strnlen, const char *s, SIZE_T maxlen) #if SANITIZER_FREEBSD #define __errno_location __error #endif // True if this is a nested interceptor. static THREADLOCAL int in_interceptor_scope; extern "C" int *__errno_location(void); struct InterceptorScope { InterceptorScope() { ++in_interceptor_scope; } ~InterceptorScope() { --in_interceptor_scope; } }; bool IsInInterceptorScope() { return in_interceptor_scope; } static uptr allocated_for_dlsym; static const uptr kDlsymAllocPoolSize = 1024; static uptr alloc_memory_for_dlsym[kDlsymAllocPoolSize]; static bool IsInDlsymAllocPool(const void *ptr) { uptr off = (uptr)ptr - (uptr)alloc_memory_for_dlsym; return off < sizeof(alloc_memory_for_dlsym); } static void *AllocateFromLocalPool(uptr size_in_bytes) { uptr size_in_words = RoundUpTo(size_in_bytes, kWordSize) / kWordSize; void *mem = (void *)&alloc_memory_for_dlsym[allocated_for_dlsym]; allocated_for_dlsym += size_in_words; CHECK_LT(allocated_for_dlsym, kDlsymAllocPoolSize); return mem; } #define ENSURE_MSAN_INITED() do { \ CHECK(!msan_init_is_running); \ if (!msan_inited) { \ __msan_init(); \ } \ } while (0) // Check that [x, x+n) range is unpoisoned. #define CHECK_UNPOISONED_0(x, n) \ do { \ sptr offset = __msan_test_shadow(x, n); \ if (__msan::IsInSymbolizer()) \ break; \ if (offset >= 0 && __msan::flags()->report_umrs) { \ GET_CALLER_PC_BP_SP; \ (void) sp; \ ReportUMRInsideAddressRange(__func__, x, n, offset); \ __msan::PrintWarningWithOrigin( \ pc, bp, __msan_get_origin((const char *)x + offset)); \ if (__msan::flags()->halt_on_error) { \ Printf("Exiting\n"); \ Die(); \ } \ } \ } while (0) // Check that [x, x+n) range is unpoisoned unless we are in a nested // interceptor. #define CHECK_UNPOISONED(x, n) \ do { \ if (!IsInInterceptorScope()) CHECK_UNPOISONED_0(x, n); \ } while (0); #define CHECK_UNPOISONED_STRING_OF_LEN(x, len, n) \ CHECK_UNPOISONED((x), \ common_flags()->strict_string_checks ? (len) + 1 : (n) ) #define CHECK_UNPOISONED_STRING(x, n) \ CHECK_UNPOISONED_STRING_OF_LEN((x), internal_strlen(x), (n)) INTERCEPTOR(SIZE_T, fread, void *ptr, SIZE_T size, SIZE_T nmemb, void *file) { ENSURE_MSAN_INITED(); SIZE_T res = REAL(fread)(ptr, size, nmemb, file); if (res > 0) __msan_unpoison(ptr, res *size); return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(SIZE_T, fread_unlocked, void *ptr, SIZE_T size, SIZE_T nmemb, void *file) { ENSURE_MSAN_INITED(); SIZE_T res = REAL(fread_unlocked)(ptr, size, nmemb, file); if (res > 0) __msan_unpoison(ptr, res *size); return res; } #define MSAN_MAYBE_INTERCEPT_FREAD_UNLOCKED INTERCEPT_FUNCTION(fread_unlocked) #else #define MSAN_MAYBE_INTERCEPT_FREAD_UNLOCKED #endif INTERCEPTOR(SSIZE_T, readlink, const char *path, char *buf, SIZE_T bufsiz) { ENSURE_MSAN_INITED(); CHECK_UNPOISONED_STRING(path, 0) SSIZE_T res = REAL(readlink)(path, buf, bufsiz); if (res > 0) __msan_unpoison(buf, res); return res; } INTERCEPTOR(void *, memcpy, void *dest, const void *src, SIZE_T n) { return __msan_memcpy(dest, src, n); } INTERCEPTOR(void *, mempcpy, void *dest, const void *src, SIZE_T n) { return (char *)__msan_memcpy(dest, src, n) + n; } INTERCEPTOR(void *, memccpy, void *dest, const void *src, int c, SIZE_T n) { ENSURE_MSAN_INITED(); void *res = REAL(memccpy)(dest, src, c, n); CHECK(!res || (res >= dest && res <= (char *)dest + n)); SIZE_T sz = res ? (char *)res - (char *)dest : n; CHECK_UNPOISONED(src, sz); __msan_unpoison(dest, sz); return res; } INTERCEPTOR(void *, memmove, void *dest, const void *src, SIZE_T n) { return __msan_memmove(dest, src, n); } INTERCEPTOR(void *, memset, void *s, int c, SIZE_T n) { return __msan_memset(s, c, n); } INTERCEPTOR(void *, bcopy, const void *src, void *dest, SIZE_T n) { return __msan_memmove(dest, src, n); } INTERCEPTOR(int, posix_memalign, void **memptr, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; CHECK_EQ(alignment & (alignment - 1), 0); CHECK_NE(memptr, 0); *memptr = MsanReallocate(&stack, nullptr, size, alignment, false); CHECK_NE(*memptr, 0); __msan_unpoison(memptr, sizeof(*memptr)); return 0; } #if !SANITIZER_FREEBSD INTERCEPTOR(void *, memalign, SIZE_T boundary, SIZE_T size) { GET_MALLOC_STACK_TRACE; CHECK_EQ(boundary & (boundary - 1), 0); void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); return ptr; } #define MSAN_MAYBE_INTERCEPT_MEMALIGN INTERCEPT_FUNCTION(memalign) #else #define MSAN_MAYBE_INTERCEPT_MEMALIGN #endif INTERCEPTOR(void *, aligned_alloc, SIZE_T boundary, SIZE_T size) { GET_MALLOC_STACK_TRACE; CHECK_EQ(boundary & (boundary - 1), 0); void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); return ptr; } INTERCEPTOR(void *, __libc_memalign, SIZE_T boundary, SIZE_T size) { GET_MALLOC_STACK_TRACE; CHECK_EQ(boundary & (boundary - 1), 0); void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); DTLS_on_libc_memalign(ptr, size); return ptr; } INTERCEPTOR(void *, valloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; void *ptr = MsanReallocate(&stack, nullptr, size, GetPageSizeCached(), false); return ptr; } #if !SANITIZER_FREEBSD INTERCEPTOR(void *, pvalloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; uptr PageSize = GetPageSizeCached(); size = RoundUpTo(size, PageSize); if (size == 0) { // pvalloc(0) should allocate one page. size = PageSize; } void *ptr = MsanReallocate(&stack, nullptr, size, PageSize, false); return ptr; } #define MSAN_MAYBE_INTERCEPT_PVALLOC INTERCEPT_FUNCTION(pvalloc) #else #define MSAN_MAYBE_INTERCEPT_PVALLOC #endif INTERCEPTOR(void, free, void *ptr) { GET_MALLOC_STACK_TRACE; if (!ptr || UNLIKELY(IsInDlsymAllocPool(ptr))) return; MsanDeallocate(&stack, ptr); } #if !SANITIZER_FREEBSD INTERCEPTOR(void, cfree, void *ptr) { GET_MALLOC_STACK_TRACE; if (!ptr || UNLIKELY(IsInDlsymAllocPool(ptr))) return; MsanDeallocate(&stack, ptr); } #define MSAN_MAYBE_INTERCEPT_CFREE INTERCEPT_FUNCTION(cfree) #else #define MSAN_MAYBE_INTERCEPT_CFREE #endif INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { return __sanitizer_get_allocated_size(ptr); } #if !SANITIZER_FREEBSD // This function actually returns a struct by value, but we can't unpoison a // temporary! The following is equivalent on all supported platforms but // aarch64 (which uses a different register for sret value). We have a test // to confirm that. INTERCEPTOR(void, mallinfo, __sanitizer_mallinfo *sret) { #ifdef __aarch64__ uptr r8; asm volatile("mov %0,x8" : "=r" (r8)); sret = reinterpret_cast<__sanitizer_mallinfo*>(r8); #endif REAL(memset)(sret, 0, sizeof(*sret)); __msan_unpoison(sret, sizeof(*sret)); } #define MSAN_MAYBE_INTERCEPT_MALLINFO INTERCEPT_FUNCTION(mallinfo) #else #define MSAN_MAYBE_INTERCEPT_MALLINFO #endif #if !SANITIZER_FREEBSD INTERCEPTOR(int, mallopt, int cmd, int value) { return -1; } #define MSAN_MAYBE_INTERCEPT_MALLOPT INTERCEPT_FUNCTION(mallopt) #else #define MSAN_MAYBE_INTERCEPT_MALLOPT #endif #if !SANITIZER_FREEBSD INTERCEPTOR(void, malloc_stats, void) { // FIXME: implement, but don't call REAL(malloc_stats)! } #define MSAN_MAYBE_INTERCEPT_MALLOC_STATS INTERCEPT_FUNCTION(malloc_stats) #else #define MSAN_MAYBE_INTERCEPT_MALLOC_STATS #endif INTERCEPTOR(char *, strcpy, char *dest, const char *src) { // NOLINT ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T n = REAL(strlen)(src); CHECK_UNPOISONED_STRING(src + n, 0); char *res = REAL(strcpy)(dest, src); // NOLINT CopyShadowAndOrigin(dest, src, n + 1, &stack); return res; } INTERCEPTOR(char *, strncpy, char *dest, const char *src, SIZE_T n) { // NOLINT ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T copy_size = REAL(strnlen)(src, n); if (copy_size < n) copy_size++; // trailing \0 char *res = REAL(strncpy)(dest, src, n); // NOLINT CopyShadowAndOrigin(dest, src, copy_size, &stack); __msan_unpoison(dest + copy_size, n - copy_size); return res; } INTERCEPTOR(char *, stpcpy, char *dest, const char *src) { // NOLINT ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T n = REAL(strlen)(src); CHECK_UNPOISONED_STRING(src + n, 0); char *res = REAL(stpcpy)(dest, src); // NOLINT CopyShadowAndOrigin(dest, src, n + 1, &stack); return res; } INTERCEPTOR(char *, strdup, char *src) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; // On FreeBSD strdup() leverages strlen(). InterceptorScope interceptor_scope; SIZE_T n = REAL(strlen)(src); CHECK_UNPOISONED_STRING(src + n, 0); char *res = REAL(strdup)(src); CopyShadowAndOrigin(res, src, n + 1, &stack); return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(char *, __strdup, char *src) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T n = REAL(strlen)(src); CHECK_UNPOISONED_STRING(src + n, 0); char *res = REAL(__strdup)(src); CopyShadowAndOrigin(res, src, n + 1, &stack); return res; } #define MSAN_MAYBE_INTERCEPT___STRDUP INTERCEPT_FUNCTION(__strdup) #else #define MSAN_MAYBE_INTERCEPT___STRDUP #endif INTERCEPTOR(char *, strndup, char *src, SIZE_T n) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; // On FreeBSD strndup() leverages strnlen(). InterceptorScope interceptor_scope; SIZE_T copy_size = REAL(strnlen)(src, n); char *res = REAL(strndup)(src, n); CopyShadowAndOrigin(res, src, copy_size, &stack); __msan_unpoison(res + copy_size, 1); // \0 return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(char *, __strndup, char *src, SIZE_T n) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T copy_size = REAL(strnlen)(src, n); char *res = REAL(__strndup)(src, n); CopyShadowAndOrigin(res, src, copy_size, &stack); __msan_unpoison(res + copy_size, 1); // \0 return res; } #define MSAN_MAYBE_INTERCEPT___STRNDUP INTERCEPT_FUNCTION(__strndup) #else #define MSAN_MAYBE_INTERCEPT___STRNDUP #endif INTERCEPTOR(char *, gcvt, double number, SIZE_T ndigit, char *buf) { ENSURE_MSAN_INITED(); char *res = REAL(gcvt)(number, ndigit, buf); SIZE_T n = REAL(strlen)(buf); __msan_unpoison(buf, n + 1); return res; } INTERCEPTOR(char *, strcat, char *dest, const char *src) { // NOLINT ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T src_size = REAL(strlen)(src); SIZE_T dest_size = REAL(strlen)(dest); CHECK_UNPOISONED_STRING(src + src_size, 0); CHECK_UNPOISONED_STRING(dest + dest_size, 0); char *res = REAL(strcat)(dest, src); // NOLINT CopyShadowAndOrigin(dest + dest_size, src, src_size + 1, &stack); return res; } INTERCEPTOR(char *, strncat, char *dest, const char *src, SIZE_T n) { // NOLINT ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; SIZE_T dest_size = REAL(strlen)(dest); SIZE_T copy_size = REAL(strnlen)(src, n); CHECK_UNPOISONED_STRING(dest + dest_size, 0); char *res = REAL(strncat)(dest, src, n); // NOLINT CopyShadowAndOrigin(dest + dest_size, src, copy_size, &stack); __msan_unpoison(dest + dest_size + copy_size, 1); // \0 return res; } // Hack: always pass nptr and endptr as part of __VA_ARGS_ to avoid having to // deal with empty __VA_ARGS__ in the case of INTERCEPTOR_STRTO. #define INTERCEPTOR_STRTO_BODY(ret_type, func, ...) \ ENSURE_MSAN_INITED(); \ ret_type res = REAL(func)(__VA_ARGS__); \ __msan_unpoison(endptr, sizeof(*endptr)); \ return res; #define INTERCEPTOR_STRTO(ret_type, func, char_type) \ INTERCEPTOR(ret_type, func, const char_type *nptr, char_type **endptr) { \ INTERCEPTOR_STRTO_BODY(ret_type, func, nptr, endptr); \ } #define INTERCEPTOR_STRTO_BASE(ret_type, func, char_type) \ INTERCEPTOR(ret_type, func, const char_type *nptr, char_type **endptr, \ int base) { \ INTERCEPTOR_STRTO_BODY(ret_type, func, nptr, endptr, base); \ } #define INTERCEPTOR_STRTO_LOC(ret_type, func, char_type) \ INTERCEPTOR(ret_type, func, const char_type *nptr, char_type **endptr, \ void *loc) { \ INTERCEPTOR_STRTO_BODY(ret_type, func, nptr, endptr, loc); \ } #define INTERCEPTOR_STRTO_BASE_LOC(ret_type, func, char_type) \ INTERCEPTOR(ret_type, func, const char_type *nptr, char_type **endptr, \ int base, void *loc) { \ INTERCEPTOR_STRTO_BODY(ret_type, func, nptr, endptr, base, loc); \ } #define INTERCEPTORS_STRTO(ret_type, func, char_type) \ INTERCEPTOR_STRTO(ret_type, func, char_type) \ INTERCEPTOR_STRTO_LOC(ret_type, func##_l, char_type) \ INTERCEPTOR_STRTO_LOC(ret_type, __##func##_l, char_type) \ INTERCEPTOR_STRTO_LOC(ret_type, __##func##_internal, char_type) #define INTERCEPTORS_STRTO_BASE(ret_type, func, char_type) \ INTERCEPTOR_STRTO_BASE(ret_type, func, char_type) \ INTERCEPTOR_STRTO_BASE_LOC(ret_type, func##_l, char_type) \ INTERCEPTOR_STRTO_BASE_LOC(ret_type, __##func##_l, char_type) \ INTERCEPTOR_STRTO_BASE_LOC(ret_type, __##func##_internal, char_type) INTERCEPTORS_STRTO(double, strtod, char) // NOLINT INTERCEPTORS_STRTO(float, strtof, char) // NOLINT INTERCEPTORS_STRTO(long double, strtold, char) // NOLINT INTERCEPTORS_STRTO_BASE(long, strtol, char) // NOLINT INTERCEPTORS_STRTO_BASE(long long, strtoll, char) // NOLINT INTERCEPTORS_STRTO_BASE(unsigned long, strtoul, char) // NOLINT INTERCEPTORS_STRTO_BASE(unsigned long long, strtoull, char) // NOLINT INTERCEPTORS_STRTO(double, wcstod, wchar_t) // NOLINT INTERCEPTORS_STRTO(float, wcstof, wchar_t) // NOLINT INTERCEPTORS_STRTO(long double, wcstold, wchar_t) // NOLINT INTERCEPTORS_STRTO_BASE(long, wcstol, wchar_t) // NOLINT INTERCEPTORS_STRTO_BASE(long long, wcstoll, wchar_t) // NOLINT INTERCEPTORS_STRTO_BASE(unsigned long, wcstoul, wchar_t) // NOLINT INTERCEPTORS_STRTO_BASE(unsigned long long, wcstoull, wchar_t) // NOLINT #define INTERCEPT_STRTO(func) \ INTERCEPT_FUNCTION(func); \ INTERCEPT_FUNCTION(func##_l); \ INTERCEPT_FUNCTION(__##func##_l); \ INTERCEPT_FUNCTION(__##func##_internal); // FIXME: support *wprintf in common format interceptors. INTERCEPTOR(int, vswprintf, void *str, uptr size, void *format, va_list ap) { ENSURE_MSAN_INITED(); int res = REAL(vswprintf)(str, size, format, ap); if (res >= 0) { __msan_unpoison(str, 4 * (res + 1)); } return res; } INTERCEPTOR(int, swprintf, void *str, uptr size, void *format, ...) { ENSURE_MSAN_INITED(); va_list ap; va_start(ap, format); int res = vswprintf(str, size, format, ap); va_end(ap); return res; } INTERCEPTOR(SIZE_T, strxfrm, char *dest, const char *src, SIZE_T n) { ENSURE_MSAN_INITED(); CHECK_UNPOISONED(src, REAL(strlen)(src) + 1); SIZE_T res = REAL(strxfrm)(dest, src, n); if (res < n) __msan_unpoison(dest, res + 1); return res; } INTERCEPTOR(SIZE_T, strxfrm_l, char *dest, const char *src, SIZE_T n, void *loc) { ENSURE_MSAN_INITED(); CHECK_UNPOISONED(src, REAL(strlen)(src) + 1); SIZE_T res = REAL(strxfrm_l)(dest, src, n, loc); if (res < n) __msan_unpoison(dest, res + 1); return res; } #define INTERCEPTOR_STRFTIME_BODY(char_type, ret_type, func, s, ...) \ ENSURE_MSAN_INITED(); \ ret_type res = REAL(func)(s, __VA_ARGS__); \ if (s) __msan_unpoison(s, sizeof(char_type) * (res + 1)); \ return res; INTERCEPTOR(SIZE_T, strftime, char *s, SIZE_T max, const char *format, __sanitizer_tm *tm) { INTERCEPTOR_STRFTIME_BODY(char, SIZE_T, strftime, s, max, format, tm); } INTERCEPTOR(SIZE_T, strftime_l, char *s, SIZE_T max, const char *format, __sanitizer_tm *tm, void *loc) { INTERCEPTOR_STRFTIME_BODY(char, SIZE_T, strftime_l, s, max, format, tm, loc); } #if !SANITIZER_FREEBSD INTERCEPTOR(SIZE_T, __strftime_l, char *s, SIZE_T max, const char *format, __sanitizer_tm *tm, void *loc) { INTERCEPTOR_STRFTIME_BODY(char, SIZE_T, __strftime_l, s, max, format, tm, loc); } #define MSAN_MAYBE_INTERCEPT___STRFTIME_L INTERCEPT_FUNCTION(__strftime_l) #else #define MSAN_MAYBE_INTERCEPT___STRFTIME_L #endif INTERCEPTOR(SIZE_T, wcsftime, wchar_t *s, SIZE_T max, const wchar_t *format, __sanitizer_tm *tm) { INTERCEPTOR_STRFTIME_BODY(wchar_t, SIZE_T, wcsftime, s, max, format, tm); } INTERCEPTOR(SIZE_T, wcsftime_l, wchar_t *s, SIZE_T max, const wchar_t *format, __sanitizer_tm *tm, void *loc) { INTERCEPTOR_STRFTIME_BODY(wchar_t, SIZE_T, wcsftime_l, s, max, format, tm, loc); } #if !SANITIZER_FREEBSD INTERCEPTOR(SIZE_T, __wcsftime_l, wchar_t *s, SIZE_T max, const wchar_t *format, __sanitizer_tm *tm, void *loc) { INTERCEPTOR_STRFTIME_BODY(wchar_t, SIZE_T, __wcsftime_l, s, max, format, tm, loc); } #define MSAN_MAYBE_INTERCEPT___WCSFTIME_L INTERCEPT_FUNCTION(__wcsftime_l) #else #define MSAN_MAYBE_INTERCEPT___WCSFTIME_L #endif INTERCEPTOR(int, mbtowc, wchar_t *dest, const char *src, SIZE_T n) { ENSURE_MSAN_INITED(); int res = REAL(mbtowc)(dest, src, n); if (res != -1 && dest) __msan_unpoison(dest, sizeof(wchar_t)); return res; } INTERCEPTOR(int, mbrtowc, wchar_t *dest, const char *src, SIZE_T n, void *ps) { ENSURE_MSAN_INITED(); SIZE_T res = REAL(mbrtowc)(dest, src, n, ps); if (res != (SIZE_T)-1 && dest) __msan_unpoison(dest, sizeof(wchar_t)); return res; } INTERCEPTOR(SIZE_T, wcslen, const wchar_t *s) { ENSURE_MSAN_INITED(); SIZE_T res = REAL(wcslen)(s); CHECK_UNPOISONED(s, sizeof(wchar_t) * (res + 1)); return res; } // wchar_t *wcschr(const wchar_t *wcs, wchar_t wc); INTERCEPTOR(wchar_t *, wcschr, void *s, wchar_t wc, void *ps) { ENSURE_MSAN_INITED(); wchar_t *res = REAL(wcschr)(s, wc, ps); return res; } // wchar_t *wcscpy(wchar_t *dest, const wchar_t *src); INTERCEPTOR(wchar_t *, wcscpy, wchar_t *dest, const wchar_t *src) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; wchar_t *res = REAL(wcscpy)(dest, src); CopyShadowAndOrigin(dest, src, sizeof(wchar_t) * (REAL(wcslen)(src) + 1), &stack); return res; } // wchar_t *wmemcpy(wchar_t *dest, const wchar_t *src, SIZE_T n); INTERCEPTOR(wchar_t *, wmemcpy, wchar_t *dest, const wchar_t *src, SIZE_T n) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; wchar_t *res = REAL(wmemcpy)(dest, src, n); CopyShadowAndOrigin(dest, src, n * sizeof(wchar_t), &stack); return res; } INTERCEPTOR(wchar_t *, wmempcpy, wchar_t *dest, const wchar_t *src, SIZE_T n) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; wchar_t *res = REAL(wmempcpy)(dest, src, n); CopyShadowAndOrigin(dest, src, n * sizeof(wchar_t), &stack); return res; } INTERCEPTOR(wchar_t *, wmemset, wchar_t *s, wchar_t c, SIZE_T n) { CHECK(MEM_IS_APP(s)); ENSURE_MSAN_INITED(); wchar_t *res = REAL(wmemset)(s, c, n); __msan_unpoison(s, n * sizeof(wchar_t)); return res; } INTERCEPTOR(wchar_t *, wmemmove, wchar_t *dest, const wchar_t *src, SIZE_T n) { ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; wchar_t *res = REAL(wmemmove)(dest, src, n); MoveShadowAndOrigin(dest, src, n * sizeof(wchar_t), &stack); return res; } INTERCEPTOR(int, wcscmp, const wchar_t *s1, const wchar_t *s2) { ENSURE_MSAN_INITED(); int res = REAL(wcscmp)(s1, s2); return res; } INTERCEPTOR(int, gettimeofday, void *tv, void *tz) { ENSURE_MSAN_INITED(); int res = REAL(gettimeofday)(tv, tz); if (tv) __msan_unpoison(tv, 16); if (tz) __msan_unpoison(tz, 8); return res; } INTERCEPTOR(char *, fcvt, double x, int a, int *b, int *c) { ENSURE_MSAN_INITED(); char *res = REAL(fcvt)(x, a, b, c); __msan_unpoison(b, sizeof(*b)); __msan_unpoison(c, sizeof(*c)); if (res) __msan_unpoison(res, REAL(strlen)(res) + 1); return res; } INTERCEPTOR(char *, getenv, char *name) { if (msan_init_is_running) return REAL(getenv)(name); ENSURE_MSAN_INITED(); char *res = REAL(getenv)(name); if (res) __msan_unpoison(res, REAL(strlen)(res) + 1); return res; } extern char **environ; static void UnpoisonEnviron() { char **envp = environ; for (; *envp; ++envp) { __msan_unpoison(envp, sizeof(*envp)); __msan_unpoison(*envp, REAL(strlen)(*envp) + 1); } // Trailing NULL pointer. __msan_unpoison(envp, sizeof(*envp)); } INTERCEPTOR(int, setenv, const char *name, const char *value, int overwrite) { ENSURE_MSAN_INITED(); CHECK_UNPOISONED_STRING(name, 0) int res = REAL(setenv)(name, value, overwrite); if (!res) UnpoisonEnviron(); return res; } INTERCEPTOR(int, putenv, char *string) { ENSURE_MSAN_INITED(); int res = REAL(putenv)(string); if (!res) UnpoisonEnviron(); return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(int, __fxstat, int magic, int fd, void *buf) { ENSURE_MSAN_INITED(); int res = REAL(__fxstat)(magic, fd, buf); if (!res) __msan_unpoison(buf, __sanitizer::struct_stat_sz); return res; } #define MSAN_MAYBE_INTERCEPT___FXSTAT INTERCEPT_FUNCTION(__fxstat) #else #define MSAN_MAYBE_INTERCEPT___FXSTAT #endif #if !SANITIZER_FREEBSD INTERCEPTOR(int, __fxstat64, int magic, int fd, void *buf) { ENSURE_MSAN_INITED(); int res = REAL(__fxstat64)(magic, fd, buf); if (!res) __msan_unpoison(buf, __sanitizer::struct_stat64_sz); return res; } #define MSAN_MAYBE_INTERCEPT___FXSTAT64 INTERCEPT_FUNCTION(__fxstat64) #else #define MSAN_MAYBE_INTERCEPT___FXSTAT64 #endif #if SANITIZER_FREEBSD INTERCEPTOR(int, fstatat, int fd, char *pathname, void *buf, int flags) { ENSURE_MSAN_INITED(); int res = REAL(fstatat)(fd, pathname, buf, flags); if (!res) __msan_unpoison(buf, __sanitizer::struct_stat_sz); return res; } # define MSAN_INTERCEPT_FSTATAT INTERCEPT_FUNCTION(fstatat) #else INTERCEPTOR(int, __fxstatat, int magic, int fd, char *pathname, void *buf, int flags) { ENSURE_MSAN_INITED(); int res = REAL(__fxstatat)(magic, fd, pathname, buf, flags); if (!res) __msan_unpoison(buf, __sanitizer::struct_stat_sz); return res; } # define MSAN_INTERCEPT_FSTATAT INTERCEPT_FUNCTION(__fxstatat) #endif #if !SANITIZER_FREEBSD INTERCEPTOR(int, __fxstatat64, int magic, int fd, char *pathname, void *buf, int flags) { ENSURE_MSAN_INITED(); int res = REAL(__fxstatat64)(magic, fd, pathname, buf, flags); if (!res) __msan_unpoison(buf, __sanitizer::struct_stat64_sz); return res; } #define MSAN_MAYBE_INTERCEPT___FXSTATAT64 INTERCEPT_FUNCTION(__fxstatat64) #else #define MSAN_MAYBE_INTERCEPT___FXSTATAT64 #endif INTERCEPTOR(int, pipe, int pipefd[2]) { if (msan_init_is_running) return REAL(pipe)(pipefd); ENSURE_MSAN_INITED(); int res = REAL(pipe)(pipefd); if (!res) __msan_unpoison(pipefd, sizeof(int[2])); return res; } INTERCEPTOR(int, pipe2, int pipefd[2], int flags) { ENSURE_MSAN_INITED(); int res = REAL(pipe2)(pipefd, flags); if (!res) __msan_unpoison(pipefd, sizeof(int[2])); return res; } INTERCEPTOR(int, socketpair, int domain, int type, int protocol, int sv[2]) { ENSURE_MSAN_INITED(); int res = REAL(socketpair)(domain, type, protocol, sv); if (!res) __msan_unpoison(sv, sizeof(int[2])); return res; } INTERCEPTOR(char *, fgets, char *s, int size, void *stream) { ENSURE_MSAN_INITED(); char *res = REAL(fgets)(s, size, stream); if (res) __msan_unpoison(s, REAL(strlen)(s) + 1); return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(char *, fgets_unlocked, char *s, int size, void *stream) { ENSURE_MSAN_INITED(); char *res = REAL(fgets_unlocked)(s, size, stream); if (res) __msan_unpoison(s, REAL(strlen)(s) + 1); return res; } #define MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED INTERCEPT_FUNCTION(fgets_unlocked) #else #define MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED #endif INTERCEPTOR(int, getrlimit, int resource, void *rlim) { if (msan_init_is_running) return REAL(getrlimit)(resource, rlim); ENSURE_MSAN_INITED(); int res = REAL(getrlimit)(resource, rlim); if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit_sz); return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(int, getrlimit64, int resource, void *rlim) { if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim); ENSURE_MSAN_INITED(); int res = REAL(getrlimit64)(resource, rlim); if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit64_sz); return res; } INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit, void *old_rlimit) { if (msan_init_is_running) return REAL(prlimit)(pid, resource, new_rlimit, old_rlimit); ENSURE_MSAN_INITED(); CHECK_UNPOISONED(new_rlimit, __sanitizer::struct_rlimit_sz); int res = REAL(prlimit)(pid, resource, new_rlimit, old_rlimit); if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit_sz); return res; } INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit, void *old_rlimit) { if (msan_init_is_running) return REAL(prlimit64)(pid, resource, new_rlimit, old_rlimit); ENSURE_MSAN_INITED(); CHECK_UNPOISONED(new_rlimit, __sanitizer::struct_rlimit64_sz); int res = REAL(prlimit64)(pid, resource, new_rlimit, old_rlimit); if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit64_sz); return res; } #define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64) #define MSAN_MAYBE_INTERCEPT_PRLIMIT INTERCEPT_FUNCTION(prlimit) #define MSAN_MAYBE_INTERCEPT_PRLIMIT64 INTERCEPT_FUNCTION(prlimit64) #else #define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 #define MSAN_MAYBE_INTERCEPT_PRLIMIT #define MSAN_MAYBE_INTERCEPT_PRLIMIT64 #endif #if SANITIZER_FREEBSD // FreeBSD's define uname() as // static __inline int uname(struct utsname *name) { // return __xuname(SYS_NMLN, (void*)name); // } INTERCEPTOR(int, __xuname, int size, void *utsname) { ENSURE_MSAN_INITED(); int res = REAL(__xuname)(size, utsname); if (!res) __msan_unpoison(utsname, __sanitizer::struct_utsname_sz); return res; } #define MSAN_INTERCEPT_UNAME INTERCEPT_FUNCTION(__xuname) #else INTERCEPTOR(int, uname, struct utsname *utsname) { ENSURE_MSAN_INITED(); int res = REAL(uname)(utsname); if (!res) __msan_unpoison(utsname, __sanitizer::struct_utsname_sz); return res; } #define MSAN_INTERCEPT_UNAME INTERCEPT_FUNCTION(uname) #endif INTERCEPTOR(int, gethostname, char *name, SIZE_T len) { ENSURE_MSAN_INITED(); int res = REAL(gethostname)(name, len); if (!res) { SIZE_T real_len = REAL(strnlen)(name, len); if (real_len < len) ++real_len; __msan_unpoison(name, real_len); } return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(int, epoll_wait, int epfd, void *events, int maxevents, int timeout) { ENSURE_MSAN_INITED(); int res = REAL(epoll_wait)(epfd, events, maxevents, timeout); if (res > 0) { __msan_unpoison(events, __sanitizer::struct_epoll_event_sz * res); } return res; } #define MSAN_MAYBE_INTERCEPT_EPOLL_WAIT INTERCEPT_FUNCTION(epoll_wait) #else #define MSAN_MAYBE_INTERCEPT_EPOLL_WAIT #endif #if !SANITIZER_FREEBSD INTERCEPTOR(int, epoll_pwait, int epfd, void *events, int maxevents, int timeout, void *sigmask) { ENSURE_MSAN_INITED(); int res = REAL(epoll_pwait)(epfd, events, maxevents, timeout, sigmask); if (res > 0) { __msan_unpoison(events, __sanitizer::struct_epoll_event_sz * res); } return res; } #define MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT INTERCEPT_FUNCTION(epoll_pwait) #else #define MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT #endif INTERCEPTOR(void *, calloc, SIZE_T nmemb, SIZE_T size) { GET_MALLOC_STACK_TRACE; if (UNLIKELY(!msan_inited)) // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. return AllocateFromLocalPool(nmemb * size); return MsanCalloc(&stack, nmemb, size); } INTERCEPTOR(void *, realloc, void *ptr, SIZE_T size) { GET_MALLOC_STACK_TRACE; if (UNLIKELY(IsInDlsymAllocPool(ptr))) { uptr offset = (uptr)ptr - (uptr)alloc_memory_for_dlsym; uptr copy_size = Min(size, kDlsymAllocPoolSize - offset); void *new_ptr; if (UNLIKELY(!msan_inited)) { new_ptr = AllocateFromLocalPool(copy_size); } else { copy_size = size; new_ptr = MsanReallocate(&stack, nullptr, copy_size, sizeof(u64), false); } internal_memcpy(new_ptr, ptr, copy_size); return new_ptr; } return MsanReallocate(&stack, ptr, size, sizeof(u64), false); } INTERCEPTOR(void *, malloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; if (UNLIKELY(!msan_inited)) // Hack: dlsym calls malloc before REAL(malloc) is retrieved from dlsym. return AllocateFromLocalPool(size); return MsanReallocate(&stack, nullptr, size, sizeof(u64), false); } void __msan_allocated_memory(const void *data, uptr size) { GET_MALLOC_STACK_TRACE; if (flags()->poison_in_malloc) { stack.tag = STACK_TRACE_TAG_POISON; PoisonMemory(data, size, &stack); } } void __msan_copy_shadow(void *dest, const void *src, uptr n) { GET_STORE_STACK_TRACE; MoveShadowAndOrigin(dest, src, n, &stack); } void __sanitizer_dtor_callback(const void *data, uptr size) { GET_MALLOC_STACK_TRACE; if (flags()->poison_in_dtor) { stack.tag = STACK_TRACE_TAG_POISON; PoisonMemory(data, size, &stack); } } INTERCEPTOR(void *, mmap, void *addr, SIZE_T length, int prot, int flags, int fd, OFF_T offset) { if (msan_init_is_running) return REAL(mmap)(addr, length, prot, flags, fd, offset); ENSURE_MSAN_INITED(); if (addr && !MEM_IS_APP(addr)) { if (flags & map_fixed) { *__errno_location() = errno_EINVAL; return (void *)-1; } else { addr = nullptr; } } void *res = REAL(mmap)(addr, length, prot, flags, fd, offset); if (res != (void*)-1) __msan_unpoison(res, RoundUpTo(length, GetPageSize())); return res; } #if !SANITIZER_FREEBSD INTERCEPTOR(void *, mmap64, void *addr, SIZE_T length, int prot, int flags, int fd, OFF64_T offset) { ENSURE_MSAN_INITED(); if (addr && !MEM_IS_APP(addr)) { if (flags & map_fixed) { *__errno_location() = errno_EINVAL; return (void *)-1; } else { addr = nullptr; } } void *res = REAL(mmap64)(addr, length, prot, flags, fd, offset); if (res != (void*)-1) __msan_unpoison(res, RoundUpTo(length, GetPageSize())); return res; } #define MSAN_MAYBE_INTERCEPT_MMAP64 INTERCEPT_FUNCTION(mmap64) #else #define MSAN_MAYBE_INTERCEPT_MMAP64 #endif INTERCEPTOR(int, getrusage, int who, void *usage) { ENSURE_MSAN_INITED(); int res = REAL(getrusage)(who, usage); if (res == 0) { __msan_unpoison(usage, __sanitizer::struct_rusage_sz); } return res; } class SignalHandlerScope { public: SignalHandlerScope() { if (MsanThread *t = GetCurrentThread()) t->EnterSignalHandler(); } ~SignalHandlerScope() { if (MsanThread *t = GetCurrentThread()) t->LeaveSignalHandler(); } }; // sigactions_mu guarantees atomicity of sigaction() and signal() calls. // Access to sigactions[] is gone with relaxed atomics to avoid data race with // the signal handler. const int kMaxSignals = 1024; static atomic_uintptr_t sigactions[kMaxSignals]; static StaticSpinMutex sigactions_mu; static void SignalHandler(int signo) { SignalHandlerScope signal_handler_scope; ScopedThreadLocalStateBackup stlsb; UnpoisonParam(1); typedef void (*signal_cb)(int x); signal_cb cb = (signal_cb)atomic_load(&sigactions[signo], memory_order_relaxed); cb(signo); } static void SignalAction(int signo, void *si, void *uc) { SignalHandlerScope signal_handler_scope; ScopedThreadLocalStateBackup stlsb; UnpoisonParam(3); __msan_unpoison(si, sizeof(__sanitizer_sigaction)); __msan_unpoison(uc, __sanitizer::ucontext_t_sz); typedef void (*sigaction_cb)(int, void *, void *); sigaction_cb cb = (sigaction_cb)atomic_load(&sigactions[signo], memory_order_relaxed); cb(signo, si, uc); } INTERCEPTOR(int, sigaction, int signo, const __sanitizer_sigaction *act, __sanitizer_sigaction *oldact) { ENSURE_MSAN_INITED(); // FIXME: check that *act is unpoisoned. // That requires intercepting all of sigemptyset, sigfillset, etc. int res; if (flags()->wrap_signals) { SpinMutexLock lock(&sigactions_mu); CHECK_LT(signo, kMaxSignals); uptr old_cb = atomic_load(&sigactions[signo], memory_order_relaxed); __sanitizer_sigaction new_act; __sanitizer_sigaction *pnew_act = act ? &new_act : nullptr; if (act) { REAL(memcpy)(pnew_act, act, sizeof(__sanitizer_sigaction)); uptr cb = (uptr)pnew_act->sigaction; uptr new_cb = (pnew_act->sa_flags & __sanitizer::sa_siginfo) ? (uptr)SignalAction : (uptr)SignalHandler; if (cb != __sanitizer::sig_ign && cb != __sanitizer::sig_dfl) { atomic_store(&sigactions[signo], cb, memory_order_relaxed); pnew_act->sigaction = (void (*)(int, void *, void *))new_cb; } } res = REAL(sigaction)(signo, pnew_act, oldact); if (res == 0 && oldact) { uptr cb = (uptr)oldact->sigaction; if (cb != __sanitizer::sig_ign && cb != __sanitizer::sig_dfl) { oldact->sigaction = (void (*)(int, void *, void *))old_cb; } } } else { res = REAL(sigaction)(signo, act, oldact); } if (res == 0 && oldact) { __msan_unpoison(oldact, sizeof(__sanitizer_sigaction)); } return res; } INTERCEPTOR(int, signal, int signo, uptr cb) { ENSURE_MSAN_INITED(); if (flags()->wrap_signals) { CHECK_LT(signo, kMaxSignals); SpinMutexLock lock(&sigactions_mu); if (cb != __sanitizer::sig_ign && cb != __sanitizer::sig_dfl) { atomic_store(&sigactions[signo], cb, memory_order_relaxed); cb = (uptr) SignalHandler; } return REAL(signal)(signo, cb); } else { return REAL(signal)(signo, cb); } } extern "C" int pthread_attr_init(void *attr); extern "C" int pthread_attr_destroy(void *attr); static void *MsanThreadStartFunc(void *arg) { MsanThread *t = (MsanThread *)arg; SetCurrentThread(t); return t->ThreadStart(); } INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*), void * param) { ENSURE_MSAN_INITED(); // for GetTlsSize() __sanitizer_pthread_attr_t myattr; if (!attr) { pthread_attr_init(&myattr); attr = &myattr; } AdjustStackSize(attr); MsanThread *t = MsanThread::Create(callback, param); int res = REAL(pthread_create)(th, attr, MsanThreadStartFunc, t); if (attr == &myattr) pthread_attr_destroy(&myattr); if (!res) { __msan_unpoison(th, __sanitizer::pthread_t_sz); } return res; } INTERCEPTOR(int, pthread_key_create, __sanitizer_pthread_key_t *key, void (*dtor)(void *value)) { if (msan_init_is_running) return REAL(pthread_key_create)(key, dtor); ENSURE_MSAN_INITED(); int res = REAL(pthread_key_create)(key, dtor); if (!res && key) __msan_unpoison(key, sizeof(*key)); return res; } INTERCEPTOR(int, pthread_join, void *th, void **retval) { ENSURE_MSAN_INITED(); int res = REAL(pthread_join)(th, retval); if (!res && retval) __msan_unpoison(retval, sizeof(*retval)); return res; } extern char *tzname[2]; INTERCEPTOR(void, tzset, int fake) { ENSURE_MSAN_INITED(); REAL(tzset)(fake); if (tzname[0]) __msan_unpoison(tzname[0], REAL(strlen)(tzname[0]) + 1); if (tzname[1]) __msan_unpoison(tzname[1], REAL(strlen)(tzname[1]) + 1); return; } struct MSanAtExitRecord { void (*func)(void *arg); void *arg; }; void MSanAtExitWrapper(void *arg) { UnpoisonParam(1); MSanAtExitRecord *r = (MSanAtExitRecord *)arg; r->func(r->arg); InternalFree(r); } // Unpoison argument shadow for C++ module destructors. INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg, void *dso_handle) { if (msan_init_is_running) return REAL(__cxa_atexit)(func, arg, dso_handle); ENSURE_MSAN_INITED(); MSanAtExitRecord *r = (MSanAtExitRecord *)InternalAlloc(sizeof(MSanAtExitRecord)); r->func = func; r->arg = arg; return REAL(__cxa_atexit)(MSanAtExitWrapper, r, dso_handle); } DECLARE_REAL(int, shmctl, int shmid, int cmd, void *buf) INTERCEPTOR(void *, shmat, int shmid, const void *shmaddr, int shmflg) { ENSURE_MSAN_INITED(); void *p = REAL(shmat)(shmid, shmaddr, shmflg); if (p != (void *)-1) { __sanitizer_shmid_ds ds; int res = REAL(shmctl)(shmid, shmctl_ipc_stat, &ds); if (!res) { __msan_unpoison(p, ds.shm_segsz); } } return p; } static void BeforeFork() { StackDepotLockAll(); ChainedOriginDepotLockAll(); } static void AfterFork() { ChainedOriginDepotUnlockAll(); StackDepotUnlockAll(); } INTERCEPTOR(int, fork, void) { ENSURE_MSAN_INITED(); BeforeFork(); int pid = REAL(fork)(); AfterFork(); return pid; } INTERCEPTOR(int, openpty, int *amaster, int *aslave, char *name, const void *termp, const void *winp) { ENSURE_MSAN_INITED(); InterceptorScope interceptor_scope; int res = REAL(openpty)(amaster, aslave, name, termp, winp); if (!res) { __msan_unpoison(amaster, sizeof(*amaster)); __msan_unpoison(aslave, sizeof(*aslave)); } return res; } INTERCEPTOR(int, forkpty, int *amaster, char *name, const void *termp, const void *winp) { ENSURE_MSAN_INITED(); InterceptorScope interceptor_scope; int res = REAL(forkpty)(amaster, name, termp, winp); if (res != -1) __msan_unpoison(amaster, sizeof(*amaster)); return res; } struct MSanInterceptorContext { bool in_interceptor_scope; }; namespace __msan { int OnExit() { // FIXME: ask frontend whether we need to return failure. return 0; } } // namespace __msan // A version of CHECK_UNPOISONED using a saved scope value. Used in common // interceptors. #define CHECK_UNPOISONED_CTX(ctx, x, n) \ do { \ if (!((MSanInterceptorContext *)ctx)->in_interceptor_scope) \ CHECK_UNPOISONED_0(x, n); \ } while (0) #define MSAN_INTERCEPT_FUNC(name) \ do { \ if ((!INTERCEPT_FUNCTION(name) || !REAL(name))) \ VReport(1, "MemorySanitizer: failed to intercept '" #name "'\n"); \ } while (0) #define MSAN_INTERCEPT_FUNC_VER(name, ver) \ do { \ if ((!INTERCEPT_FUNCTION_VER(name, ver) || !REAL(name))) \ VReport( \ 1, "MemorySanitizer: failed to intercept '" #name "@@" #ver "'\n"); \ } while (0) #define COMMON_INTERCEPT_FUNCTION(name) MSAN_INTERCEPT_FUNC(name) #define COMMON_INTERCEPT_FUNCTION_VER(name, ver) \ MSAN_INTERCEPT_FUNC_VER(name, ver) #define COMMON_INTERCEPTOR_UNPOISON_PARAM(count) \ UnpoisonParam(count) #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \ __msan_unpoison(ptr, size) #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ CHECK_UNPOISONED_CTX(ctx, ptr, size) #define COMMON_INTERCEPTOR_INITIALIZE_RANGE(ptr, size) \ __msan_unpoison(ptr, size) #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \ if (msan_init_is_running) return REAL(func)(__VA_ARGS__); \ ENSURE_MSAN_INITED(); \ MSanInterceptorContext msan_ctx = {IsInInterceptorScope()}; \ ctx = (void *)&msan_ctx; \ (void)ctx; \ InterceptorScope interceptor_scope; \ __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */ #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \ do { \ } while (false) #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \ do { \ } while (false) #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \ do { \ } while (false) #define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \ do { \ } while (false) #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \ do { \ } while (false) // FIXME #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \ do { \ } while (false) // FIXME #define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name) #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit() #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \ do { \ link_map *map = GET_LINK_MAP_BY_DLOPEN_HANDLE((handle)); \ if (filename && map) \ ForEachMappedRegion(map, __msan_unpoison); \ } while (false) #define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end) \ if (MsanThread *t = GetCurrentThread()) { \ *begin = t->tls_begin(); \ *end = t->tls_end(); \ } else { \ *begin = *end = 0; \ } #include "sanitizer_common/sanitizer_platform_interceptors.h" // Msan needs custom handling of these: #undef SANITIZER_INTERCEPT_MEMSET #undef SANITIZER_INTERCEPT_MEMMOVE #undef SANITIZER_INTERCEPT_MEMCPY #include "sanitizer_common/sanitizer_common_interceptors.inc" #define COMMON_SYSCALL_PRE_READ_RANGE(p, s) CHECK_UNPOISONED(p, s) #define COMMON_SYSCALL_PRE_WRITE_RANGE(p, s) \ do { \ } while (false) #define COMMON_SYSCALL_POST_READ_RANGE(p, s) \ do { \ } while (false) #define COMMON_SYSCALL_POST_WRITE_RANGE(p, s) __msan_unpoison(p, s) #include "sanitizer_common/sanitizer_common_syscalls.inc" struct dlinfo { char *dli_fname; void *dli_fbase; char *dli_sname; void *dli_saddr; }; INTERCEPTOR(int, dladdr, void *addr, dlinfo *info) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, dladdr, addr, info); int res = REAL(dladdr)(addr, info); if (res != 0) { __msan_unpoison(info, sizeof(*info)); if (info->dli_fname) __msan_unpoison(info->dli_fname, REAL(strlen)(info->dli_fname) + 1); if (info->dli_sname) __msan_unpoison(info->dli_sname, REAL(strlen)(info->dli_sname) + 1); } return res; } INTERCEPTOR(char *, dlerror, int fake) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, dlerror, fake); char *res = REAL(dlerror)(fake); if (res) __msan_unpoison(res, REAL(strlen)(res) + 1); return res; } typedef int (*dl_iterate_phdr_cb)(__sanitizer_dl_phdr_info *info, SIZE_T size, void *data); struct dl_iterate_phdr_data { dl_iterate_phdr_cb callback; void *data; }; static int msan_dl_iterate_phdr_cb(__sanitizer_dl_phdr_info *info, SIZE_T size, void *data) { if (info) { __msan_unpoison(info, size); if (info->dlpi_phdr && info->dlpi_phnum) __msan_unpoison(info->dlpi_phdr, struct_ElfW_Phdr_sz * info->dlpi_phnum); if (info->dlpi_name) __msan_unpoison(info->dlpi_name, REAL(strlen)(info->dlpi_name) + 1); } dl_iterate_phdr_data *cbdata = (dl_iterate_phdr_data *)data; UnpoisonParam(3); return cbdata->callback(info, size, cbdata->data); } INTERCEPTOR(int, dl_iterate_phdr, dl_iterate_phdr_cb callback, void *data) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, dl_iterate_phdr, callback, data); dl_iterate_phdr_data cbdata; cbdata.callback = callback; cbdata.data = data; int res = REAL(dl_iterate_phdr)(msan_dl_iterate_phdr_cb, (void *)&cbdata); return res; } // These interface functions reside here so that they can use // REAL(memset), etc. void __msan_unpoison(const void *a, uptr size) { if (!MEM_IS_APP(a)) return; SetShadow(a, size, 0); } void __msan_poison(const void *a, uptr size) { if (!MEM_IS_APP(a)) return; SetShadow(a, size, __msan::flags()->poison_heap_with_zeroes ? 0 : -1); } void __msan_poison_stack(void *a, uptr size) { if (!MEM_IS_APP(a)) return; SetShadow(a, size, __msan::flags()->poison_stack_with_zeroes ? 0 : -1); } void __msan_clear_and_unpoison(void *a, uptr size) { REAL(memset)(a, 0, size); SetShadow(a, size, 0); } void *__msan_memcpy(void *dest, const void *src, SIZE_T n) { if (!msan_inited) return internal_memcpy(dest, src, n); if (msan_init_is_running || __msan::IsInSymbolizer()) return REAL(memcpy)(dest, src, n); ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; void *res = REAL(memcpy)(dest, src, n); CopyShadowAndOrigin(dest, src, n, &stack); return res; } void *__msan_memset(void *s, int c, SIZE_T n) { if (!msan_inited) return internal_memset(s, c, n); if (msan_init_is_running) return REAL(memset)(s, c, n); ENSURE_MSAN_INITED(); void *res = REAL(memset)(s, c, n); __msan_unpoison(s, n); return res; } void *__msan_memmove(void *dest, const void *src, SIZE_T n) { if (!msan_inited) return internal_memmove(dest, src, n); if (msan_init_is_running) return REAL(memmove)(dest, src, n); ENSURE_MSAN_INITED(); GET_STORE_STACK_TRACE; void *res = REAL(memmove)(dest, src, n); MoveShadowAndOrigin(dest, src, n, &stack); return res; } void __msan_unpoison_string(const char* s) { if (!MEM_IS_APP(s)) return; __msan_unpoison(s, REAL(strlen)(s) + 1); } namespace __msan { void InitializeInterceptors() { static int inited = 0; CHECK_EQ(inited, 0); InitializeCommonInterceptors(); INTERCEPT_FUNCTION(mmap); MSAN_MAYBE_INTERCEPT_MMAP64; INTERCEPT_FUNCTION(posix_memalign); MSAN_MAYBE_INTERCEPT_MEMALIGN; INTERCEPT_FUNCTION(__libc_memalign); INTERCEPT_FUNCTION(valloc); MSAN_MAYBE_INTERCEPT_PVALLOC; INTERCEPT_FUNCTION(malloc); INTERCEPT_FUNCTION(calloc); INTERCEPT_FUNCTION(realloc); INTERCEPT_FUNCTION(free); MSAN_MAYBE_INTERCEPT_CFREE; INTERCEPT_FUNCTION(malloc_usable_size); MSAN_MAYBE_INTERCEPT_MALLINFO; MSAN_MAYBE_INTERCEPT_MALLOPT; MSAN_MAYBE_INTERCEPT_MALLOC_STATS; INTERCEPT_FUNCTION(fread); MSAN_MAYBE_INTERCEPT_FREAD_UNLOCKED; INTERCEPT_FUNCTION(readlink); INTERCEPT_FUNCTION(memcpy); INTERCEPT_FUNCTION(memccpy); INTERCEPT_FUNCTION(mempcpy); INTERCEPT_FUNCTION(memset); INTERCEPT_FUNCTION(memmove); INTERCEPT_FUNCTION(bcopy); INTERCEPT_FUNCTION(wmemset); INTERCEPT_FUNCTION(wmemcpy); INTERCEPT_FUNCTION(wmempcpy); INTERCEPT_FUNCTION(wmemmove); INTERCEPT_FUNCTION(strcpy); // NOLINT INTERCEPT_FUNCTION(stpcpy); // NOLINT INTERCEPT_FUNCTION(strdup); MSAN_MAYBE_INTERCEPT___STRDUP; INTERCEPT_FUNCTION(strndup); MSAN_MAYBE_INTERCEPT___STRNDUP; INTERCEPT_FUNCTION(strncpy); // NOLINT INTERCEPT_FUNCTION(gcvt); INTERCEPT_FUNCTION(strcat); // NOLINT INTERCEPT_FUNCTION(strncat); // NOLINT INTERCEPT_STRTO(strtod); INTERCEPT_STRTO(strtof); INTERCEPT_STRTO(strtold); INTERCEPT_STRTO(strtol); INTERCEPT_STRTO(strtoul); INTERCEPT_STRTO(strtoll); INTERCEPT_STRTO(strtoull); INTERCEPT_STRTO(wcstod); INTERCEPT_STRTO(wcstof); INTERCEPT_STRTO(wcstold); INTERCEPT_STRTO(wcstol); INTERCEPT_STRTO(wcstoul); INTERCEPT_STRTO(wcstoll); INTERCEPT_STRTO(wcstoull); #ifdef SANITIZER_NLDBL_VERSION INTERCEPT_FUNCTION_VER(vswprintf, SANITIZER_NLDBL_VERSION); INTERCEPT_FUNCTION_VER(swprintf, SANITIZER_NLDBL_VERSION); #else INTERCEPT_FUNCTION(vswprintf); INTERCEPT_FUNCTION(swprintf); #endif INTERCEPT_FUNCTION(strxfrm); INTERCEPT_FUNCTION(strxfrm_l); INTERCEPT_FUNCTION(strftime); INTERCEPT_FUNCTION(strftime_l); MSAN_MAYBE_INTERCEPT___STRFTIME_L; INTERCEPT_FUNCTION(wcsftime); INTERCEPT_FUNCTION(wcsftime_l); MSAN_MAYBE_INTERCEPT___WCSFTIME_L; INTERCEPT_FUNCTION(mbtowc); INTERCEPT_FUNCTION(mbrtowc); INTERCEPT_FUNCTION(wcslen); INTERCEPT_FUNCTION(wcschr); INTERCEPT_FUNCTION(wcscpy); INTERCEPT_FUNCTION(wcscmp); INTERCEPT_FUNCTION(getenv); INTERCEPT_FUNCTION(setenv); INTERCEPT_FUNCTION(putenv); INTERCEPT_FUNCTION(gettimeofday); INTERCEPT_FUNCTION(fcvt); MSAN_MAYBE_INTERCEPT___FXSTAT; MSAN_INTERCEPT_FSTATAT; MSAN_MAYBE_INTERCEPT___FXSTAT64; MSAN_MAYBE_INTERCEPT___FXSTATAT64; INTERCEPT_FUNCTION(pipe); INTERCEPT_FUNCTION(pipe2); INTERCEPT_FUNCTION(socketpair); INTERCEPT_FUNCTION(fgets); MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED; INTERCEPT_FUNCTION(getrlimit); MSAN_MAYBE_INTERCEPT_GETRLIMIT64; MSAN_MAYBE_INTERCEPT_PRLIMIT; MSAN_MAYBE_INTERCEPT_PRLIMIT64; MSAN_INTERCEPT_UNAME; INTERCEPT_FUNCTION(gethostname); MSAN_MAYBE_INTERCEPT_EPOLL_WAIT; MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT; INTERCEPT_FUNCTION(dladdr); INTERCEPT_FUNCTION(dlerror); INTERCEPT_FUNCTION(dl_iterate_phdr); INTERCEPT_FUNCTION(getrusage); INTERCEPT_FUNCTION(sigaction); INTERCEPT_FUNCTION(signal); #if defined(__mips__) INTERCEPT_FUNCTION_VER(pthread_create, "GLIBC_2.2"); #else INTERCEPT_FUNCTION(pthread_create); #endif INTERCEPT_FUNCTION(pthread_key_create); INTERCEPT_FUNCTION(pthread_join); INTERCEPT_FUNCTION(tzset); INTERCEPT_FUNCTION(__cxa_atexit); INTERCEPT_FUNCTION(shmat); INTERCEPT_FUNCTION(fork); INTERCEPT_FUNCTION(openpty); INTERCEPT_FUNCTION(forkpty); inited = 1; } } // namespace __msan golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/.clang-format0000664000175000017500000000002512623444376025270 0ustar mwhudsonmwhudsonBasedOnStyle: Google golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/CMakeLists.txt0000664000175000017500000000353012760126006025446 0ustar mwhudsonmwhudsoninclude_directories(..) # Runtime library sources and build flags. set(MSAN_RTL_SOURCES msan.cc msan_allocator.cc msan_chained_origin_depot.cc msan_interceptors.cc msan_linux.cc msan_report.cc msan_thread.cc msan_poisoning.cc ) set(MSAN_RTL_CXX_SOURCES msan_new_delete.cc) set(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF MSAN_RTL_CFLAGS) append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS) # Prevent clang from generating libc calls. append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS) set(MSAN_RUNTIME_LIBRARIES) # Static runtime library. add_compiler_rt_component(msan) foreach(arch ${MSAN_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.msan STATIC ARCHS ${arch} SOURCES ${MSAN_RTL_SOURCES} $ $ $ $ CFLAGS ${MSAN_RTL_CFLAGS} PARENT_TARGET msan) add_compiler_rt_runtime(clang_rt.msan_cxx STATIC ARCHS ${arch} SOURCES ${MSAN_RTL_CXX_SOURCES} $ CFLAGS ${MSAN_RTL_CFLAGS} PARENT_TARGET msan) list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch} clang_rt.msan_cxx-${arch}) if(UNIX) add_sanitizer_rt_symbols(clang_rt.msan ARCHS ${arch} EXTRA msan.syms.extra) add_sanitizer_rt_symbols(clang_rt.msan_cxx ARCHS ${arch} EXTRA msan.syms.extra) add_dependencies(msan clang_rt.msan-${arch}-symbols clang_rt.msan_cxx-${arch}-symbols) endif() endforeach() add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt msan) if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_thread.h0000664000175000017500000000371712603076275025363 0ustar mwhudsonmwhudson//===-- msan_thread.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // //===----------------------------------------------------------------------===// #ifndef MSAN_THREAD_H #define MSAN_THREAD_H #include "msan_allocator.h" #include "sanitizer_common/sanitizer_common.h" namespace __msan { class MsanThread { public: static MsanThread *Create(thread_callback_t start_routine, void *arg); static void TSDDtor(void *tsd); void Destroy(); void Init(); // Should be called from the thread itself. thread_return_t ThreadStart(); uptr stack_top() { return stack_top_; } uptr stack_bottom() { return stack_bottom_; } uptr tls_begin() { return tls_begin_; } uptr tls_end() { return tls_end_; } bool IsMainThread() { return start_routine_ == nullptr; } bool AddrIsInStack(uptr addr) { return addr >= stack_bottom_ && addr < stack_top_; } bool InSignalHandler() { return in_signal_handler_; } void EnterSignalHandler() { in_signal_handler_++; } void LeaveSignalHandler() { in_signal_handler_--; } MsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; } int destructor_iterations_; private: // NOTE: There is no MsanThread constructor. It is allocated // via mmap() and *must* be valid in zero-initialized state. void SetThreadStackAndTls(); void ClearShadowForThreadStackAndTLS(); thread_callback_t start_routine_; void *arg_; uptr stack_top_; uptr stack_bottom_; uptr tls_begin_; uptr tls_end_; unsigned in_signal_handler_; MsanThreadLocalMallocStorage malloc_storage_; }; MsanThread *GetCurrentThread(); void SetCurrentThread(MsanThread *t); } // namespace __msan #endif // MSAN_THREAD_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_allocator.cc0000664000175000017500000002110112773316446026222 0ustar mwhudsonmwhudson//===-- msan_allocator.cc --------------------------- ---------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // MemorySanitizer allocator. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator.h" #include "sanitizer_common/sanitizer_allocator_interface.h" #include "msan.h" #include "msan_allocator.h" #include "msan_origin.h" #include "msan_thread.h" #include "msan_poisoning.h" namespace __msan { struct Metadata { uptr requested_size; }; struct MsanMapUnmapCallback { void OnMap(uptr p, uptr size) const {} void OnUnmap(uptr p, uptr size) const { __msan_unpoison((void *)p, size); // We are about to unmap a chunk of user memory. // Mark the corresponding shadow memory as not needed. ReleaseMemoryToOS(MEM_TO_SHADOW(p), size); if (__msan_get_track_origins()) ReleaseMemoryToOS(MEM_TO_ORIGIN(p), size); } }; #if defined(__mips64) static const uptr kMaxAllowedMallocSize = 2UL << 30; static const uptr kRegionSizeLog = 20; static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; typedef CompactSizeClassMap SizeClassMap; typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(Metadata), SizeClassMap, kRegionSizeLog, ByteMap, MsanMapUnmapCallback> PrimaryAllocator; #elif defined(__x86_64__) #if SANITIZER_LINUX && !defined(MSAN_LINUX_X86_64_OLD_MAPPING) static const uptr kAllocatorSpace = 0x700000000000ULL; #else static const uptr kAllocatorSpace = 0x600000000000ULL; #endif static const uptr kMaxAllowedMallocSize = 8UL << 30; struct AP64 { // Allocator64 parameters. Deliberately using a short name. static const uptr kSpaceBeg = kAllocatorSpace; static const uptr kSpaceSize = 0x40000000000; // 4T. static const uptr kMetadataSize = sizeof(Metadata); typedef DefaultSizeClassMap SizeClassMap; typedef MsanMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; typedef SizeClassAllocator64 PrimaryAllocator; #elif defined(__powerpc64__) static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G struct AP64 { // Allocator64 parameters. Deliberately using a short name. static const uptr kSpaceBeg = 0x300000000000; static const uptr kSpaceSize = 0x020000000000; // 2T. static const uptr kMetadataSize = sizeof(Metadata); typedef DefaultSizeClassMap SizeClassMap; typedef MsanMapUnmapCallback MapUnmapCallback; static const uptr kFlags = 0; }; typedef SizeClassAllocator64 PrimaryAllocator; #elif defined(__aarch64__) static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G static const uptr kRegionSizeLog = 20; static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; typedef CompactSizeClassMap SizeClassMap; typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(Metadata), SizeClassMap, kRegionSizeLog, ByteMap, MsanMapUnmapCallback> PrimaryAllocator; #endif typedef SizeClassAllocatorLocalCache AllocatorCache; typedef LargeMmapAllocator SecondaryAllocator; typedef CombinedAllocator Allocator; static Allocator allocator; static AllocatorCache fallback_allocator_cache; static SpinMutex fallback_mutex; void MsanAllocatorInit() { allocator.Init(common_flags()->allocator_may_return_null); } AllocatorCache *GetAllocatorCache(MsanThreadLocalMallocStorage *ms) { CHECK(ms); CHECK_LE(sizeof(AllocatorCache), sizeof(ms->allocator_cache)); return reinterpret_cast(ms->allocator_cache); } void MsanThreadLocalMallocStorage::CommitBack() { allocator.SwallowCache(GetAllocatorCache(this)); } static void *MsanAllocate(StackTrace *stack, uptr size, uptr alignment, bool zeroise) { if (size > kMaxAllowedMallocSize) { Report("WARNING: MemorySanitizer failed to allocate %p bytes\n", (void *)size); return allocator.ReturnNullOrDieOnBadRequest(); } MsanThread *t = GetCurrentThread(); void *allocated; if (t) { AllocatorCache *cache = GetAllocatorCache(&t->malloc_storage()); allocated = allocator.Allocate(cache, size, alignment, false); } else { SpinMutexLock l(&fallback_mutex); AllocatorCache *cache = &fallback_allocator_cache; allocated = allocator.Allocate(cache, size, alignment, false); } Metadata *meta = reinterpret_cast(allocator.GetMetaData(allocated)); meta->requested_size = size; if (zeroise) { __msan_clear_and_unpoison(allocated, size); } else if (flags()->poison_in_malloc) { __msan_poison(allocated, size); if (__msan_get_track_origins()) { stack->tag = StackTrace::TAG_ALLOC; Origin o = Origin::CreateHeapOrigin(stack); __msan_set_origin(allocated, size, o.raw_id()); } } MSAN_MALLOC_HOOK(allocated, size); return allocated; } void MsanDeallocate(StackTrace *stack, void *p) { CHECK(p); MSAN_FREE_HOOK(p); Metadata *meta = reinterpret_cast(allocator.GetMetaData(p)); uptr size = meta->requested_size; meta->requested_size = 0; // This memory will not be reused by anyone else, so we are free to keep it // poisoned. if (flags()->poison_in_free) { __msan_poison(p, size); if (__msan_get_track_origins()) { stack->tag = StackTrace::TAG_DEALLOC; Origin o = Origin::CreateHeapOrigin(stack); __msan_set_origin(p, size, o.raw_id()); } } MsanThread *t = GetCurrentThread(); if (t) { AllocatorCache *cache = GetAllocatorCache(&t->malloc_storage()); allocator.Deallocate(cache, p); } else { SpinMutexLock l(&fallback_mutex); AllocatorCache *cache = &fallback_allocator_cache; allocator.Deallocate(cache, p); } } void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) { if (CallocShouldReturnNullDueToOverflow(size, nmemb)) return allocator.ReturnNullOrDieOnBadRequest(); return MsanReallocate(stack, nullptr, nmemb * size, sizeof(u64), true); } void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size, uptr alignment, bool zeroise) { if (!old_p) return MsanAllocate(stack, new_size, alignment, zeroise); if (!new_size) { MsanDeallocate(stack, old_p); return nullptr; } Metadata *meta = reinterpret_cast(allocator.GetMetaData(old_p)); uptr old_size = meta->requested_size; uptr actually_allocated_size = allocator.GetActuallyAllocatedSize(old_p); if (new_size <= actually_allocated_size) { // We are not reallocating here. meta->requested_size = new_size; if (new_size > old_size) { if (zeroise) { __msan_clear_and_unpoison((char *)old_p + old_size, new_size - old_size); } else if (flags()->poison_in_malloc) { stack->tag = StackTrace::TAG_ALLOC; PoisonMemory((char *)old_p + old_size, new_size - old_size, stack); } } return old_p; } uptr memcpy_size = Min(new_size, old_size); void *new_p = MsanAllocate(stack, new_size, alignment, zeroise); // Printf("realloc: old_size %zd new_size %zd\n", old_size, new_size); if (new_p) { CopyMemory(new_p, old_p, memcpy_size, stack); MsanDeallocate(stack, old_p); } return new_p; } static uptr AllocationSize(const void *p) { if (!p) return 0; const void *beg = allocator.GetBlockBegin(p); if (beg != p) return 0; Metadata *b = (Metadata *)allocator.GetMetaData(p); return b->requested_size; } } // namespace __msan using namespace __msan; uptr __sanitizer_get_current_allocated_bytes() { uptr stats[AllocatorStatCount]; allocator.GetStats(stats); return stats[AllocatorStatAllocated]; } uptr __sanitizer_get_heap_size() { uptr stats[AllocatorStatCount]; allocator.GetStats(stats); return stats[AllocatorStatMapped]; } uptr __sanitizer_get_free_bytes() { return 1; } uptr __sanitizer_get_unmapped_bytes() { return 1; } uptr __sanitizer_get_estimated_allocated_size(uptr size) { return size; } int __sanitizer_get_ownership(const void *p) { return AllocationSize(p) != 0; } uptr __sanitizer_get_allocated_size(const void *p) { return AllocationSize(p); } golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_allocator.h0000664000175000017500000000174112614736157026073 0ustar mwhudsonmwhudson//===-- msan_allocator.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // //===----------------------------------------------------------------------===// #ifndef MSAN_ALLOCATOR_H #define MSAN_ALLOCATOR_H #include "sanitizer_common/sanitizer_common.h" namespace __msan { struct MsanThreadLocalMallocStorage { uptr quarantine_cache[16]; // Allocator cache contains atomic_uint64_t which must be 8-byte aligned. ALIGNED(8) uptr allocator_cache[96 * (512 * 8 + 16)]; // Opaque. void CommitBack(); private: // These objects are allocated via mmap() and are zero-initialized. MsanThreadLocalMallocStorage() {} }; } // namespace __msan #endif // MSAN_ALLOCATOR_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan.cc0000664000175000017500000004627512710227010024160 0ustar mwhudsonmwhudson//===-- msan.cc -----------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // MemorySanitizer runtime. //===----------------------------------------------------------------------===// #include "msan.h" #include "msan_chained_origin_depot.h" #include "msan_origin.h" #include "msan_thread.h" #include "msan_poisoning.h" #include "sanitizer_common/sanitizer_atomic.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_procmaps.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_symbolizer.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "ubsan/ubsan_flags.h" #include "ubsan/ubsan_init.h" // ACHTUNG! No system header includes in this file. using namespace __sanitizer; // Globals. static THREADLOCAL int msan_expect_umr = 0; static THREADLOCAL int msan_expected_umr_found = 0; // Function argument shadow. Each argument starts at the next available 8-byte // aligned address. SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL u64 __msan_param_tls[kMsanParamTlsSize / sizeof(u64)]; // Function argument origin. Each argument starts at the same offset as the // corresponding shadow in (__msan_param_tls). Slightly weird, but changing this // would break compatibility with older prebuilt binaries. SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL u32 __msan_param_origin_tls[kMsanParamTlsSize / sizeof(u32)]; SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL u64 __msan_retval_tls[kMsanRetvalTlsSize / sizeof(u64)]; SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL u32 __msan_retval_origin_tls; SANITIZER_INTERFACE_ATTRIBUTE ALIGNED(16) THREADLOCAL u64 __msan_va_arg_tls[kMsanParamTlsSize / sizeof(u64)]; SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL u64 __msan_va_arg_overflow_size_tls; SANITIZER_INTERFACE_ATTRIBUTE THREADLOCAL u32 __msan_origin_tls; static THREADLOCAL int is_in_symbolizer; extern "C" SANITIZER_WEAK_ATTRIBUTE const int __msan_track_origins; int __msan_get_track_origins() { return &__msan_track_origins ? __msan_track_origins : 0; } extern "C" SANITIZER_WEAK_ATTRIBUTE const int __msan_keep_going; namespace __msan { void EnterSymbolizer() { ++is_in_symbolizer; } void ExitSymbolizer() { --is_in_symbolizer; } bool IsInSymbolizer() { return is_in_symbolizer; } static Flags msan_flags; Flags *flags() { return &msan_flags; } int msan_inited = 0; bool msan_init_is_running; int msan_report_count = 0; // Array of stack origins. // FIXME: make it resizable. static const uptr kNumStackOriginDescrs = 1024 * 1024; static const char *StackOriginDescr[kNumStackOriginDescrs]; static uptr StackOriginPC[kNumStackOriginDescrs]; static atomic_uint32_t NumStackOriginDescrs; void Flags::SetDefaults() { #define MSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "msan_flags.inc" #undef MSAN_FLAG } // keep_going is an old name for halt_on_error, // and it has inverse meaning. class FlagHandlerKeepGoing : public FlagHandlerBase { bool *halt_on_error_; public: explicit FlagHandlerKeepGoing(bool *halt_on_error) : halt_on_error_(halt_on_error) {} bool Parse(const char *value) final { bool tmp; FlagHandler h(&tmp); if (!h.Parse(value)) return false; *halt_on_error_ = !tmp; return true; } }; static void RegisterMsanFlags(FlagParser *parser, Flags *f) { #define MSAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "msan_flags.inc" #undef MSAN_FLAG FlagHandlerKeepGoing *fh_keep_going = new (FlagParser::Alloc) // NOLINT FlagHandlerKeepGoing(&f->halt_on_error); parser->RegisterHandler("keep_going", fh_keep_going, "deprecated, use halt_on_error"); } static void InitializeFlags() { SetCommonFlagsDefaults(); { CommonFlags cf; cf.CopyFrom(*common_flags()); cf.external_symbolizer_path = GetEnv("MSAN_SYMBOLIZER_PATH"); cf.malloc_context_size = 20; cf.handle_ioctl = true; // FIXME: test and enable. cf.check_printf = false; cf.intercept_tls_get_addr = true; cf.exitcode = 77; OverrideCommonFlags(cf); } Flags *f = flags(); f->SetDefaults(); FlagParser parser; RegisterMsanFlags(&parser, f); RegisterCommonFlags(&parser); #if MSAN_CONTAINS_UBSAN __ubsan::Flags *uf = __ubsan::flags(); uf->SetDefaults(); FlagParser ubsan_parser; __ubsan::RegisterUbsanFlags(&ubsan_parser, uf); RegisterCommonFlags(&ubsan_parser); #endif // Override from user-specified string. if (__msan_default_options) parser.ParseString(__msan_default_options()); #if MSAN_CONTAINS_UBSAN const char *ubsan_default_options = __ubsan::MaybeCallUbsanDefaultOptions(); ubsan_parser.ParseString(ubsan_default_options); #endif const char *msan_options = GetEnv("MSAN_OPTIONS"); parser.ParseString(msan_options); #if MSAN_CONTAINS_UBSAN ubsan_parser.ParseString(GetEnv("UBSAN_OPTIONS")); #endif VPrintf(1, "MSAN_OPTIONS: %s\n", msan_options ? msan_options : ""); InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) parser.PrintFlagDescriptions(); // Check if deprecated exit_code MSan flag is set. if (f->exit_code != -1) { if (Verbosity()) Printf("MSAN_OPTIONS=exit_code is deprecated! " "Please use MSAN_OPTIONS=exitcode instead.\n"); CommonFlags cf; cf.CopyFrom(*common_flags()); cf.exitcode = f->exit_code; OverrideCommonFlags(cf); } // Check flag values: if (f->origin_history_size < 0 || f->origin_history_size > Origin::kMaxDepth) { Printf( "Origin history size invalid: %d. Must be 0 (unlimited) or in [1, %d] " "range.\n", f->origin_history_size, Origin::kMaxDepth); Die(); } // Limiting to kStackDepotMaxUseCount / 2 to avoid overflow in // StackDepotHandle::inc_use_count_unsafe. if (f->origin_history_per_stack_limit < 0 || f->origin_history_per_stack_limit > kStackDepotMaxUseCount / 2) { Printf( "Origin per-stack limit invalid: %d. Must be 0 (unlimited) or in [1, " "%d] range.\n", f->origin_history_per_stack_limit, kStackDepotMaxUseCount / 2); Die(); } if (f->store_context_size < 1) f->store_context_size = 1; } void GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc, uptr bp, bool request_fast_unwind) { MsanThread *t = GetCurrentThread(); if (!t || !StackTrace::WillUseFastUnwind(request_fast_unwind)) { // Block reports from our interceptors during _Unwind_Backtrace. SymbolizerScope sym_scope; return stack->Unwind(max_s, pc, bp, nullptr, 0, 0, request_fast_unwind); } stack->Unwind(max_s, pc, bp, nullptr, t->stack_top(), t->stack_bottom(), request_fast_unwind); } void PrintWarning(uptr pc, uptr bp) { PrintWarningWithOrigin(pc, bp, __msan_origin_tls); } void PrintWarningWithOrigin(uptr pc, uptr bp, u32 origin) { if (msan_expect_umr) { // Printf("Expected UMR\n"); __msan_origin_tls = origin; msan_expected_umr_found = 1; return; } ++msan_report_count; GET_FATAL_STACK_TRACE_PC_BP(pc, bp); u32 report_origin = (__msan_get_track_origins() && Origin::isValidId(origin)) ? origin : 0; ReportUMR(&stack, report_origin); if (__msan_get_track_origins() && !Origin::isValidId(origin)) { Printf( " ORIGIN: invalid (%x). Might be a bug in MemorySanitizer origin " "tracking.\n This could still be a bug in your code, too!\n", origin); } } void UnpoisonParam(uptr n) { internal_memset(__msan_param_tls, 0, n * sizeof(*__msan_param_tls)); } // Backup MSan runtime TLS state. // Implementation must be async-signal-safe. // Instances of this class may live on the signal handler stack, and data size // may be an issue. void ScopedThreadLocalStateBackup::Backup() { va_arg_overflow_size_tls = __msan_va_arg_overflow_size_tls; } void ScopedThreadLocalStateBackup::Restore() { // A lame implementation that only keeps essential state and resets the rest. __msan_va_arg_overflow_size_tls = va_arg_overflow_size_tls; internal_memset(__msan_param_tls, 0, sizeof(__msan_param_tls)); internal_memset(__msan_retval_tls, 0, sizeof(__msan_retval_tls)); internal_memset(__msan_va_arg_tls, 0, sizeof(__msan_va_arg_tls)); if (__msan_get_track_origins()) { internal_memset(&__msan_retval_origin_tls, 0, sizeof(__msan_retval_origin_tls)); internal_memset(__msan_param_origin_tls, 0, sizeof(__msan_param_origin_tls)); } } void UnpoisonThreadLocalState() { } const char *GetStackOriginDescr(u32 id, uptr *pc) { CHECK_LT(id, kNumStackOriginDescrs); if (pc) *pc = StackOriginPC[id]; return StackOriginDescr[id]; } u32 ChainOrigin(u32 id, StackTrace *stack) { MsanThread *t = GetCurrentThread(); if (t && t->InSignalHandler()) return id; Origin o = Origin::FromRawId(id); stack->tag = StackTrace::TAG_UNKNOWN; Origin chained = Origin::CreateChainedOrigin(o, stack); return chained.raw_id(); } } // namespace __msan // Interface. using namespace __msan; #define MSAN_MAYBE_WARNING(type, size) \ void __msan_maybe_warning_##size(type s, u32 o) { \ GET_CALLER_PC_BP_SP; \ (void) sp; \ if (UNLIKELY(s)) { \ PrintWarningWithOrigin(pc, bp, o); \ if (__msan::flags()->halt_on_error) { \ Printf("Exiting\n"); \ Die(); \ } \ } \ } MSAN_MAYBE_WARNING(u8, 1) MSAN_MAYBE_WARNING(u16, 2) MSAN_MAYBE_WARNING(u32, 4) MSAN_MAYBE_WARNING(u64, 8) #define MSAN_MAYBE_STORE_ORIGIN(type, size) \ void __msan_maybe_store_origin_##size(type s, void *p, u32 o) { \ if (UNLIKELY(s)) { \ if (__msan_get_track_origins() > 1) { \ GET_CALLER_PC_BP_SP; \ (void) sp; \ GET_STORE_STACK_TRACE_PC_BP(pc, bp); \ o = ChainOrigin(o, &stack); \ } \ *(u32 *)MEM_TO_ORIGIN((uptr)p & ~3UL) = o; \ } \ } MSAN_MAYBE_STORE_ORIGIN(u8, 1) MSAN_MAYBE_STORE_ORIGIN(u16, 2) MSAN_MAYBE_STORE_ORIGIN(u32, 4) MSAN_MAYBE_STORE_ORIGIN(u64, 8) void __msan_warning() { GET_CALLER_PC_BP_SP; (void)sp; PrintWarning(pc, bp); if (__msan::flags()->halt_on_error) { if (__msan::flags()->print_stats) ReportStats(); Printf("Exiting\n"); Die(); } } void __msan_warning_noreturn() { GET_CALLER_PC_BP_SP; (void)sp; PrintWarning(pc, bp); if (__msan::flags()->print_stats) ReportStats(); Printf("Exiting\n"); Die(); } void __msan_init() { CHECK(!msan_init_is_running); if (msan_inited) return; msan_init_is_running = 1; SanitizerToolName = "MemorySanitizer"; AvoidCVE_2016_2143(); InitTlsSize(); CacheBinaryName(); InitializeFlags(); __sanitizer_set_report_path(common_flags()->log_path); InitializeInterceptors(); InstallAtExitHandler(); // Needs __cxa_atexit interceptor. DisableCoreDumperIfNecessary(); if (StackSizeIsUnlimited()) { VPrintf(1, "Unlimited stack, doing reexec\n"); // A reasonably large stack size. It is bigger than the usual 8Mb, because, // well, the program could have been run with unlimited stack for a reason. SetStackSizeLimitInBytes(32 * 1024 * 1024); ReExec(); } __msan_clear_on_return(); if (__msan_get_track_origins()) VPrintf(1, "msan_track_origins\n"); if (!InitShadow(__msan_get_track_origins())) { Printf("FATAL: MemorySanitizer can not mmap the shadow memory.\n"); Printf("FATAL: Make sure to compile with -fPIE and to link with -pie.\n"); Printf("FATAL: Disabling ASLR is known to cause this error.\n"); Printf("FATAL: If running under GDB, try " "'set disable-randomization off'.\n"); DumpProcessMap(); Die(); } Symbolizer::GetOrInit()->AddHooks(EnterSymbolizer, ExitSymbolizer); InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir); MsanTSDInit(MsanTSDDtor); MsanAllocatorInit(); MsanThread *main_thread = MsanThread::Create(nullptr, nullptr); SetCurrentThread(main_thread); main_thread->ThreadStart(); #if MSAN_CONTAINS_UBSAN __ubsan::InitAsPlugin(); #endif VPrintf(1, "MemorySanitizer init done\n"); msan_init_is_running = 0; msan_inited = 1; } void __msan_set_keep_going(int keep_going) { flags()->halt_on_error = !keep_going; } void __msan_set_expect_umr(int expect_umr) { if (expect_umr) { msan_expected_umr_found = 0; } else if (!msan_expected_umr_found) { GET_CALLER_PC_BP_SP; (void)sp; GET_FATAL_STACK_TRACE_PC_BP(pc, bp); ReportExpectedUMRNotFound(&stack); Die(); } msan_expect_umr = expect_umr; } void __msan_print_shadow(const void *x, uptr size) { if (!MEM_IS_APP(x)) { Printf("Not a valid application address: %p\n", x); return; } DescribeMemoryRange(x, size); } void __msan_dump_shadow(const void *x, uptr size) { if (!MEM_IS_APP(x)) { Printf("Not a valid application address: %p\n", x); return; } unsigned char *s = (unsigned char*)MEM_TO_SHADOW(x); for (uptr i = 0; i < size; i++) Printf("%x%x ", s[i] >> 4, s[i] & 0xf); Printf("\n"); } sptr __msan_test_shadow(const void *x, uptr size) { if (!MEM_IS_APP(x)) return -1; unsigned char *s = (unsigned char *)MEM_TO_SHADOW((uptr)x); for (uptr i = 0; i < size; ++i) if (s[i]) return i; return -1; } void __msan_check_mem_is_initialized(const void *x, uptr size) { if (!__msan::flags()->report_umrs) return; sptr offset = __msan_test_shadow(x, size); if (offset < 0) return; GET_CALLER_PC_BP_SP; (void)sp; ReportUMRInsideAddressRange(__func__, x, size, offset); __msan::PrintWarningWithOrigin(pc, bp, __msan_get_origin(((const char *)x) + offset)); if (__msan::flags()->halt_on_error) { Printf("Exiting\n"); Die(); } } int __msan_set_poison_in_malloc(int do_poison) { int old = flags()->poison_in_malloc; flags()->poison_in_malloc = do_poison; return old; } int __msan_has_dynamic_component() { return false; } NOINLINE void __msan_clear_on_return() { __msan_param_tls[0] = 0; } void __msan_partial_poison(const void* data, void* shadow, uptr size) { internal_memcpy((void*)MEM_TO_SHADOW((uptr)data), shadow, size); } void __msan_load_unpoisoned(const void *src, uptr size, void *dst) { internal_memcpy(dst, src, size); __msan_unpoison(dst, size); } void __msan_set_origin(const void *a, uptr size, u32 origin) { if (__msan_get_track_origins()) SetOrigin(a, size, origin); } // 'descr' is created at compile time and contains '----' in the beginning. // When we see descr for the first time we replace '----' with a uniq id // and set the origin to (id | (31-th bit)). void __msan_set_alloca_origin(void *a, uptr size, char *descr) { __msan_set_alloca_origin4(a, size, descr, 0); } void __msan_set_alloca_origin4(void *a, uptr size, char *descr, uptr pc) { static const u32 dash = '-'; static const u32 first_timer = dash + (dash << 8) + (dash << 16) + (dash << 24); u32 *id_ptr = (u32*)descr; bool print = false; // internal_strstr(descr + 4, "AllocaTOTest") != 0; u32 id = *id_ptr; if (id == first_timer) { u32 idx = atomic_fetch_add(&NumStackOriginDescrs, 1, memory_order_relaxed); CHECK_LT(idx, kNumStackOriginDescrs); StackOriginDescr[idx] = descr + 4; #if SANITIZER_PPC64V1 // On PowerPC64 ELFv1, the address of a function actually points to a // three-doubleword data structure with the first field containing // the address of the function's code. if (pc) pc = *reinterpret_cast(pc); #endif StackOriginPC[idx] = pc; id = Origin::CreateStackOrigin(idx).raw_id(); *id_ptr = id; if (print) Printf("First time: idx=%d id=%d %s %p \n", idx, id, descr + 4, pc); } if (print) Printf("__msan_set_alloca_origin: descr=%s id=%x\n", descr + 4, id); __msan_set_origin(a, size, id); } u32 __msan_chain_origin(u32 id) { GET_CALLER_PC_BP_SP; (void)sp; GET_STORE_STACK_TRACE_PC_BP(pc, bp); return ChainOrigin(id, &stack); } u32 __msan_get_origin(const void *a) { if (!__msan_get_track_origins()) return 0; uptr x = (uptr)a; uptr aligned = x & ~3ULL; uptr origin_ptr = MEM_TO_ORIGIN(aligned); return *(u32*)origin_ptr; } int __msan_origin_is_descendant_or_same(u32 this_id, u32 prev_id) { Origin o = Origin::FromRawId(this_id); while (o.raw_id() != prev_id && o.isChainedOrigin()) o = o.getNextChainedOrigin(nullptr); return o.raw_id() == prev_id; } u32 __msan_get_umr_origin() { return __msan_origin_tls; } u16 __sanitizer_unaligned_load16(const uu16 *p) { *(uu16 *)&__msan_retval_tls[0] = *(uu16 *)MEM_TO_SHADOW((uptr)p); if (__msan_get_track_origins()) __msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p)); return *p; } u32 __sanitizer_unaligned_load32(const uu32 *p) { *(uu32 *)&__msan_retval_tls[0] = *(uu32 *)MEM_TO_SHADOW((uptr)p); if (__msan_get_track_origins()) __msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p)); return *p; } u64 __sanitizer_unaligned_load64(const uu64 *p) { __msan_retval_tls[0] = *(uu64 *)MEM_TO_SHADOW((uptr)p); if (__msan_get_track_origins()) __msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p)); return *p; } void __sanitizer_unaligned_store16(uu16 *p, u16 x) { u16 s = *(uu16 *)&__msan_param_tls[1]; *(uu16 *)MEM_TO_SHADOW((uptr)p) = s; if (s && __msan_get_track_origins()) if (uu32 o = __msan_param_origin_tls[2]) SetOriginIfPoisoned((uptr)p, (uptr)&s, sizeof(s), o); *p = x; } void __sanitizer_unaligned_store32(uu32 *p, u32 x) { u32 s = *(uu32 *)&__msan_param_tls[1]; *(uu32 *)MEM_TO_SHADOW((uptr)p) = s; if (s && __msan_get_track_origins()) if (uu32 o = __msan_param_origin_tls[2]) SetOriginIfPoisoned((uptr)p, (uptr)&s, sizeof(s), o); *p = x; } void __sanitizer_unaligned_store64(uu64 *p, u64 x) { u64 s = __msan_param_tls[1]; *(uu64 *)MEM_TO_SHADOW((uptr)p) = s; if (s && __msan_get_track_origins()) if (uu32 o = __msan_param_origin_tls[2]) SetOriginIfPoisoned((uptr)p, (uptr)&s, sizeof(s), o); *p = x; } void __msan_set_death_callback(void (*callback)(void)) { SetUserDieCallback(callback); } #if !SANITIZER_SUPPORTS_WEAK_HOOKS extern "C" { SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const char* __msan_default_options() { return ""; } } // extern "C" #endif extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_print_stack_trace() { GET_FATAL_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME()); stack.Print(); } } // extern "C" golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_new_delete.cc0000664000175000017500000000341112562141046026345 0ustar mwhudsonmwhudson//===-- msan_new_delete.cc ------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // Interceptors for operators new and delete. //===----------------------------------------------------------------------===// #include "msan.h" #include "interception/interception.h" #if MSAN_REPLACE_OPERATORS_NEW_AND_DELETE #include using namespace __msan; // NOLINT // Fake std::nothrow_t to avoid including . namespace std { struct nothrow_t {}; } // namespace std #define OPERATOR_NEW_BODY \ GET_MALLOC_STACK_TRACE; \ return MsanReallocate(&stack, 0, size, sizeof(u64), false) INTERCEPTOR_ATTRIBUTE void *operator new(size_t size) { OPERATOR_NEW_BODY; } INTERCEPTOR_ATTRIBUTE void *operator new[](size_t size) { OPERATOR_NEW_BODY; } INTERCEPTOR_ATTRIBUTE void *operator new(size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY; } INTERCEPTOR_ATTRIBUTE void *operator new[](size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY; } #define OPERATOR_DELETE_BODY \ GET_MALLOC_STACK_TRACE; \ if (ptr) MsanDeallocate(&stack, ptr) INTERCEPTOR_ATTRIBUTE void operator delete(void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY; } INTERCEPTOR_ATTRIBUTE void operator delete[](void *ptr) NOEXCEPT { OPERATOR_DELETE_BODY; } INTERCEPTOR_ATTRIBUTE void operator delete(void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY; } INTERCEPTOR_ATTRIBUTE void operator delete[](void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY; } #endif // MSAN_REPLACE_OPERATORS_NEW_AND_DELETE golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_flags.inc0000664000175000017500000000257412565707341025534 0ustar mwhudsonmwhudson//===-- msan_flags.inc ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // MSan runtime flags. // //===----------------------------------------------------------------------===// #ifndef MSAN_FLAG # error "Define MSAN_FLAG prior to including this file!" #endif // MSAN_FLAG(Type, Name, DefaultValue, Description) // See COMMON_FLAG in sanitizer_flags.inc for more details. MSAN_FLAG(int, exit_code, -1, "DEPRECATED. Use exitcode from common flags instead.") MSAN_FLAG(int, origin_history_size, Origin::kMaxDepth, "") MSAN_FLAG(int, origin_history_per_stack_limit, 20000, "") MSAN_FLAG(bool, poison_heap_with_zeroes, false, "") MSAN_FLAG(bool, poison_stack_with_zeroes, false, "") MSAN_FLAG(bool, poison_in_malloc, true, "") MSAN_FLAG(bool, poison_in_free, true, "") MSAN_FLAG(bool, poison_in_dtor, false, "") MSAN_FLAG(bool, report_umrs, true, "") MSAN_FLAG(bool, wrap_signals, true, "") MSAN_FLAG(bool, print_stats, false, "") MSAN_FLAG(bool, halt_on_error, !&__msan_keep_going, "") MSAN_FLAG(bool, atexit, false, "") MSAN_FLAG(int, store_context_size, 20, "Like malloc_context_size, but for uninit stores.") golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_origin.h0000664000175000017500000001237212473634605025402 0ustar mwhudsonmwhudson//===-- msan_origin.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Origin id utils. //===----------------------------------------------------------------------===// #ifndef MSAN_ORIGIN_H #define MSAN_ORIGIN_H #include "sanitizer_common/sanitizer_stackdepot.h" #include "msan_chained_origin_depot.h" namespace __msan { // Origin handling. // // Origin is a 32-bit identifier that is attached to any uninitialized value in // the program and describes, more or less exactly, how this memory came to be // uninitialized. // // There are 3 kinds of origin ids: // 1xxx xxxx xxxx xxxx heap origin id // 0000 xxxx xxxx xxxx stack origin id // 0zzz xxxx xxxx xxxx chained origin id // // Heap origin id describes a heap memory allocation and contains (in the xxx // part) a value of StackDepot. // // Stack origin id describes a stack memory allocation and contains (in the xxx // part) an index into StackOriginDescr and StackOriginPC. We don't store a // stack trace for such origins for performance reasons. // // Chained origin id describes an event of storing an uninitialized value to // memory. The xxx part is a value of ChainedOriginDepot, which is a mapping of // (stack_id, prev_id) -> id, where // * stack_id describes the event. // StackDepot keeps a mapping between those and corresponding stack traces. // * prev_id is another origin id that describes the earlier part of the // uninitialized value history. // Following a chain of prev_id provides the full recorded history of an // uninitialized value. // // This, effectively, defines a tree (or 2 trees, see below) where nodes are // points in value history marked with origin ids, and edges are events that are // marked with stack_id. // // The "zzz" bits of chained origin id are used to store the length (or depth) // of the origin chain. class Origin { public: static bool isValidId(u32 id) { return id != 0 && id != (u32)-1; } u32 raw_id() const { return raw_id_; } bool isHeapOrigin() const { // 1xxx xxxx xxxx xxxx return raw_id_ >> kHeapShift == 0; } bool isStackOrigin() const { // 1000 xxxx xxxx xxxx return (raw_id_ >> kDepthShift) == (1 << kDepthBits); } bool isChainedOrigin() const { // 1zzz xxxx xxxx xxxx, zzz != 000 return (raw_id_ >> kDepthShift) > (1 << kDepthBits); } u32 getChainedId() const { CHECK(isChainedOrigin()); return raw_id_ & kChainedIdMask; } u32 getStackId() const { CHECK(isStackOrigin()); return raw_id_ & kChainedIdMask; } u32 getHeapId() const { CHECK(isHeapOrigin()); return raw_id_ & kHeapIdMask; } // Returns the next origin in the chain and the current stack trace. Origin getNextChainedOrigin(StackTrace *stack) const { CHECK(isChainedOrigin()); u32 prev_id; u32 stack_id = ChainedOriginDepotGet(getChainedId(), &prev_id); if (stack) *stack = StackDepotGet(stack_id); return Origin(prev_id); } StackTrace getStackTraceForHeapOrigin() const { return StackDepotGet(getHeapId()); } static Origin CreateStackOrigin(u32 id) { CHECK((id & kStackIdMask) == id); return Origin((1 << kHeapShift) | id); } static Origin CreateHeapOrigin(StackTrace *stack) { u32 stack_id = StackDepotPut(*stack); CHECK(stack_id); CHECK((stack_id & kHeapIdMask) == stack_id); return Origin(stack_id); } static Origin CreateChainedOrigin(Origin prev, StackTrace *stack) { int depth = prev.isChainedOrigin() ? prev.depth() : 0; // depth is the length of the chain minus 1. // origin_history_size of 0 means unlimited depth. if (flags()->origin_history_size > 0) { if (depth + 1 >= flags()->origin_history_size) { return prev; } else { ++depth; CHECK(depth < (1 << kDepthBits)); } } StackDepotHandle h = StackDepotPut_WithHandle(*stack); if (!h.valid()) return prev; if (flags()->origin_history_per_stack_limit > 0) { int use_count = h.use_count(); if (use_count > flags()->origin_history_per_stack_limit) return prev; } u32 chained_id; bool inserted = ChainedOriginDepotPut(h.id(), prev.raw_id(), &chained_id); CHECK((chained_id & kChainedIdMask) == chained_id); if (inserted && flags()->origin_history_per_stack_limit > 0) h.inc_use_count_unsafe(); return Origin((1 << kHeapShift) | (depth << kDepthShift) | chained_id); } static Origin FromRawId(u32 id) { return Origin(id); } private: static const int kDepthBits = 3; static const int kDepthShift = 32 - kDepthBits - 1; static const int kHeapShift = 31; static const u32 kChainedIdMask = ((u32)-1) >> (32 - kDepthShift); static const u32 kStackIdMask = ((u32)-1) >> (32 - kDepthShift); static const u32 kHeapIdMask = ((u32)-1) >> (32 - kHeapShift); u32 raw_id_; explicit Origin(u32 raw_id) : raw_id_(raw_id) {} int depth() const { CHECK(isChainedOrigin()); return (raw_id_ >> kDepthShift) & ((1 << kDepthBits) - 1); } public: static const int kMaxDepth = (1 << kDepthBits) - 1; }; } // namespace __msan #endif // MSAN_ORIGIN_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan.h0000664000175000017500000004431112757622564024037 0ustar mwhudsonmwhudson//===-- msan.h --------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // Private MSan header. //===----------------------------------------------------------------------===// #ifndef MSAN_H #define MSAN_H #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_stacktrace.h" #include "msan_interface_internal.h" #include "msan_flags.h" #include "ubsan/ubsan_platform.h" #ifndef MSAN_REPLACE_OPERATORS_NEW_AND_DELETE # define MSAN_REPLACE_OPERATORS_NEW_AND_DELETE 1 #endif #ifndef MSAN_CONTAINS_UBSAN # define MSAN_CONTAINS_UBSAN CAN_SANITIZE_UB #endif struct MappingDesc { uptr start; uptr end; enum Type { INVALID, APP, SHADOW, ORIGIN } type; const char *name; }; #if SANITIZER_LINUX && defined(__mips64) // MIPS64 maps: // - 0x0000000000-0x0200000000: Program own segments // - 0xa200000000-0xc000000000: PIE program segments // - 0xe200000000-0xffffffffff: libraries segments. const MappingDesc kMemoryLayout[] = { {0x000000000000ULL, 0x000200000000ULL, MappingDesc::APP, "app-1"}, {0x000200000000ULL, 0x002200000000ULL, MappingDesc::INVALID, "invalid"}, {0x002200000000ULL, 0x004000000000ULL, MappingDesc::SHADOW, "shadow-2"}, {0x004000000000ULL, 0x004200000000ULL, MappingDesc::INVALID, "invalid"}, {0x004200000000ULL, 0x006000000000ULL, MappingDesc::ORIGIN, "origin-2"}, {0x006000000000ULL, 0x006200000000ULL, MappingDesc::INVALID, "invalid"}, {0x006200000000ULL, 0x008000000000ULL, MappingDesc::SHADOW, "shadow-3"}, {0x008000000000ULL, 0x008200000000ULL, MappingDesc::SHADOW, "shadow-1"}, {0x008200000000ULL, 0x00a000000000ULL, MappingDesc::ORIGIN, "origin-3"}, {0x00a000000000ULL, 0x00a200000000ULL, MappingDesc::ORIGIN, "origin-1"}, {0x00a200000000ULL, 0x00c000000000ULL, MappingDesc::APP, "app-2"}, {0x00c000000000ULL, 0x00e200000000ULL, MappingDesc::INVALID, "invalid"}, {0x00e200000000ULL, 0x00ffffffffffULL, MappingDesc::APP, "app-3"}}; #define MEM_TO_SHADOW(mem) (((uptr)(mem)) ^ 0x8000000000ULL) #define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x2000000000ULL) #elif SANITIZER_LINUX && defined(__aarch64__) // The mapping describes both 39-bits, 42-bits, and 48-bits VMA. AArch64 // maps: // - 0x0000000000000-0x0000010000000: 39/42/48-bits program own segments // - 0x0005500000000-0x0005600000000: 39-bits PIE program segments // - 0x0007f80000000-0x0007fffffffff: 39-bits libraries segments // - 0x002aa00000000-0x002ab00000000: 42-bits PIE program segments // - 0x003ff00000000-0x003ffffffffff: 42-bits libraries segments // - 0x0aaaaa0000000-0x0aaab00000000: 48-bits PIE program segments // - 0xffff000000000-0x1000000000000: 48-bits libraries segments // It is fragmented in multiples segments to increase the memory available // on 42-bits (12.21% of total VMA available for 42-bits and 13.28 for // 39 bits). The 48-bits segments only cover the usual PIE/default segments // plus some more segments (262144GB total, 0.39% total VMA). const MappingDesc kMemoryLayout[] = { {0x00000000000ULL, 0x01000000000ULL, MappingDesc::INVALID, "invalid"}, {0x01000000000ULL, 0x02000000000ULL, MappingDesc::SHADOW, "shadow-2"}, {0x02000000000ULL, 0x03000000000ULL, MappingDesc::ORIGIN, "origin-2"}, {0x03000000000ULL, 0x04000000000ULL, MappingDesc::SHADOW, "shadow-1"}, {0x04000000000ULL, 0x05000000000ULL, MappingDesc::ORIGIN, "origin-1"}, {0x05000000000ULL, 0x06000000000ULL, MappingDesc::APP, "app-1"}, {0x06000000000ULL, 0x07000000000ULL, MappingDesc::INVALID, "invalid"}, {0x07000000000ULL, 0x08000000000ULL, MappingDesc::APP, "app-2"}, {0x08000000000ULL, 0x09000000000ULL, MappingDesc::INVALID, "invalid"}, // The mappings below are used only for 42-bits VMA. {0x09000000000ULL, 0x0A000000000ULL, MappingDesc::SHADOW, "shadow-3"}, {0x0A000000000ULL, 0x0B000000000ULL, MappingDesc::ORIGIN, "origin-3"}, {0x0B000000000ULL, 0x0F000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0F000000000ULL, 0x10000000000ULL, MappingDesc::APP, "app-3"}, {0x10000000000ULL, 0x11000000000ULL, MappingDesc::INVALID, "invalid"}, {0x11000000000ULL, 0x12000000000ULL, MappingDesc::APP, "app-4"}, {0x12000000000ULL, 0x17000000000ULL, MappingDesc::INVALID, "invalid"}, {0x17000000000ULL, 0x18000000000ULL, MappingDesc::SHADOW, "shadow-4"}, {0x18000000000ULL, 0x19000000000ULL, MappingDesc::ORIGIN, "origin-4"}, {0x19000000000ULL, 0x20000000000ULL, MappingDesc::INVALID, "invalid"}, {0x20000000000ULL, 0x21000000000ULL, MappingDesc::APP, "app-5"}, {0x21000000000ULL, 0x26000000000ULL, MappingDesc::INVALID, "invalid"}, {0x26000000000ULL, 0x27000000000ULL, MappingDesc::SHADOW, "shadow-5"}, {0x27000000000ULL, 0x28000000000ULL, MappingDesc::ORIGIN, "origin-5"}, {0x28000000000ULL, 0x29000000000ULL, MappingDesc::SHADOW, "shadow-7"}, {0x29000000000ULL, 0x2A000000000ULL, MappingDesc::ORIGIN, "origin-7"}, {0x2A000000000ULL, 0x2B000000000ULL, MappingDesc::APP, "app-6"}, {0x2B000000000ULL, 0x2C000000000ULL, MappingDesc::INVALID, "invalid"}, {0x2C000000000ULL, 0x2D000000000ULL, MappingDesc::SHADOW, "shadow-6"}, {0x2D000000000ULL, 0x2E000000000ULL, MappingDesc::ORIGIN, "origin-6"}, {0x2E000000000ULL, 0x2F000000000ULL, MappingDesc::APP, "app-7"}, {0x2F000000000ULL, 0x39000000000ULL, MappingDesc::INVALID, "invalid"}, {0x39000000000ULL, 0x3A000000000ULL, MappingDesc::SHADOW, "shadow-9"}, {0x3A000000000ULL, 0x3B000000000ULL, MappingDesc::ORIGIN, "origin-9"}, {0x3B000000000ULL, 0x3C000000000ULL, MappingDesc::APP, "app-8"}, {0x3C000000000ULL, 0x3D000000000ULL, MappingDesc::INVALID, "invalid"}, {0x3D000000000ULL, 0x3E000000000ULL, MappingDesc::SHADOW, "shadow-8"}, {0x3E000000000ULL, 0x3F000000000ULL, MappingDesc::ORIGIN, "origin-8"}, {0x3F000000000ULL, 0x40000000000ULL, MappingDesc::APP, "app-9"}, // The mappings below are used only for 48-bits VMA. // TODO(unknown): 48-bit mapping ony covers the usual PIE, non-PIE // segments and some more segments totalizing 262144GB of VMA (which cover // only 0.32% of all 48-bit VMA). Memory avaliability can be increase by // adding multiple application segments like 39 and 42 mapping. {0x0040000000000ULL, 0x0041000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0041000000000ULL, 0x0042000000000ULL, MappingDesc::APP, "app-10"}, {0x0042000000000ULL, 0x0047000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0047000000000ULL, 0x0048000000000ULL, MappingDesc::SHADOW, "shadow-10"}, {0x0048000000000ULL, 0x0049000000000ULL, MappingDesc::ORIGIN, "origin-10"}, {0x0049000000000ULL, 0x0050000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0050000000000ULL, 0x0051000000000ULL, MappingDesc::APP, "app-11"}, {0x0051000000000ULL, 0x0056000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0056000000000ULL, 0x0057000000000ULL, MappingDesc::SHADOW, "shadow-11"}, {0x0057000000000ULL, 0x0058000000000ULL, MappingDesc::ORIGIN, "origin-11"}, {0x0058000000000ULL, 0x0059000000000ULL, MappingDesc::APP, "app-12"}, {0x0059000000000ULL, 0x005E000000000ULL, MappingDesc::INVALID, "invalid"}, {0x005E000000000ULL, 0x005F000000000ULL, MappingDesc::SHADOW, "shadow-12"}, {0x005F000000000ULL, 0x0060000000000ULL, MappingDesc::ORIGIN, "origin-12"}, {0x0060000000000ULL, 0x0061000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0061000000000ULL, 0x0062000000000ULL, MappingDesc::APP, "app-13"}, {0x0062000000000ULL, 0x0067000000000ULL, MappingDesc::INVALID, "invalid"}, {0x0067000000000ULL, 0x0068000000000ULL, MappingDesc::SHADOW, "shadow-13"}, {0x0068000000000ULL, 0x0069000000000ULL, MappingDesc::ORIGIN, "origin-13"}, {0x0069000000000ULL, 0x0AAAAA0000000ULL, MappingDesc::INVALID, "invalid"}, {0x0AAAAA0000000ULL, 0x0AAAB00000000ULL, MappingDesc::APP, "app-14"}, {0x0AAAB00000000ULL, 0x0AACAA0000000ULL, MappingDesc::INVALID, "invalid"}, {0x0AACAA0000000ULL, 0x0AACB00000000ULL, MappingDesc::SHADOW, "shadow-14"}, {0x0AACB00000000ULL, 0x0AADAA0000000ULL, MappingDesc::INVALID, "invalid"}, {0x0AADAA0000000ULL, 0x0AADB00000000ULL, MappingDesc::ORIGIN, "origin-14"}, {0x0AADB00000000ULL, 0x0FF9F00000000ULL, MappingDesc::INVALID, "invalid"}, {0x0FF9F00000000ULL, 0x0FFA000000000ULL, MappingDesc::SHADOW, "shadow-15"}, {0x0FFA000000000ULL, 0x0FFAF00000000ULL, MappingDesc::INVALID, "invalid"}, {0x0FFAF00000000ULL, 0x0FFB000000000ULL, MappingDesc::ORIGIN, "origin-15"}, {0x0FFB000000000ULL, 0x0FFFF00000000ULL, MappingDesc::INVALID, "invalid"}, {0x0FFFF00000000ULL, 0x1000000000000ULL, MappingDesc::APP, "app-15"}, }; # define MEM_TO_SHADOW(mem) ((uptr)mem ^ 0x6000000000ULL) # define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x1000000000ULL) #elif SANITIZER_LINUX && SANITIZER_PPC64 const MappingDesc kMemoryLayout[] = { {0x000000000000ULL, 0x000100000000ULL, MappingDesc::APP, "low memory"}, {0x000100000000ULL, 0x080000000000ULL, MappingDesc::INVALID, "invalid"}, {0x080000000000ULL, 0x180100000000ULL, MappingDesc::SHADOW, "shadow"}, {0x180100000000ULL, 0x1C0000000000ULL, MappingDesc::INVALID, "invalid"}, {0x1C0000000000ULL, 0x2C0100000000ULL, MappingDesc::ORIGIN, "origin"}, {0x2C0100000000ULL, 0x300000000000ULL, MappingDesc::INVALID, "invalid"}, {0x300000000000ULL, 0x400000000000ULL, MappingDesc::APP, "high memory"}}; // Maps low and high app ranges to contiguous space with zero base: // Low: 0000 0000 0000 - 0000 ffff ffff -> 1000 0000 0000 - 1000 ffff ffff // High: 3000 0000 0000 - 3fff ffff ffff -> 0000 0000 0000 - 0fff ffff ffff #define LINEARIZE_MEM(mem) \ (((uptr)(mem) & ~0x200000000000ULL) ^ 0x100000000000ULL) #define MEM_TO_SHADOW(mem) (LINEARIZE_MEM((mem)) + 0x080000000000ULL) #define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x140000000000ULL) #elif SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 64 // Low memory: main binary, MAP_32BIT mappings and modules // High memory: heap, modules and main thread stack const MappingDesc kMemoryLayout[] = { {0x000000000000ULL, 0x010000000000ULL, MappingDesc::APP, "low memory"}, {0x010000000000ULL, 0x100000000000ULL, MappingDesc::INVALID, "invalid"}, {0x100000000000ULL, 0x310000000000ULL, MappingDesc::SHADOW, "shadow"}, {0x310000000000ULL, 0x380000000000ULL, MappingDesc::INVALID, "invalid"}, {0x380000000000ULL, 0x590000000000ULL, MappingDesc::ORIGIN, "origin"}, {0x590000000000ULL, 0x600000000000ULL, MappingDesc::INVALID, "invalid"}, {0x600000000000ULL, 0x800000000000ULL, MappingDesc::APP, "high memory"}}; // Maps low and high app ranges to contiguous space with zero base: // Low: 0000 0000 0000 - 00ff ffff ffff -> 2000 0000 0000 - 20ff ffff ffff // High: 6000 0000 0000 - 7fff ffff ffff -> 0000 0000 0000 - 1fff ffff ffff #define LINEARIZE_MEM(mem) \ (((uptr)(mem) & ~0xc00000000000ULL) ^ 0x200000000000ULL) #define MEM_TO_SHADOW(mem) (LINEARIZE_MEM((mem)) + 0x100000000000ULL) #define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x280000000000) #elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64 #ifdef MSAN_LINUX_X86_64_OLD_MAPPING // Requries PIE binary and ASLR enabled. // Main thread stack and DSOs at 0x7f0000000000 (sometimes 0x7e0000000000). // Heap at 0x600000000000. const MappingDesc kMemoryLayout[] = { {0x000000000000ULL, 0x200000000000ULL, MappingDesc::INVALID, "invalid"}, {0x200000000000ULL, 0x400000000000ULL, MappingDesc::SHADOW, "shadow"}, {0x400000000000ULL, 0x600000000000ULL, MappingDesc::ORIGIN, "origin"}, {0x600000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app"}}; #define MEM_TO_SHADOW(mem) (((uptr)(mem)) & ~0x400000000000ULL) #define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x200000000000ULL) #else // MSAN_LINUX_X86_64_OLD_MAPPING // All of the following configurations are supported. // ASLR disabled: main executable and DSOs at 0x555550000000 // PIE and ASLR: main executable and DSOs at 0x7f0000000000 // non-PIE: main executable below 0x100000000, DSOs at 0x7f0000000000 // Heap at 0x700000000000. const MappingDesc kMemoryLayout[] = { {0x000000000000ULL, 0x010000000000ULL, MappingDesc::APP, "app-1"}, {0x010000000000ULL, 0x100000000000ULL, MappingDesc::SHADOW, "shadow-2"}, {0x100000000000ULL, 0x110000000000ULL, MappingDesc::INVALID, "invalid"}, {0x110000000000ULL, 0x200000000000ULL, MappingDesc::ORIGIN, "origin-2"}, {0x200000000000ULL, 0x300000000000ULL, MappingDesc::SHADOW, "shadow-3"}, {0x300000000000ULL, 0x400000000000ULL, MappingDesc::ORIGIN, "origin-3"}, {0x400000000000ULL, 0x500000000000ULL, MappingDesc::INVALID, "invalid"}, {0x500000000000ULL, 0x510000000000ULL, MappingDesc::SHADOW, "shadow-1"}, {0x510000000000ULL, 0x600000000000ULL, MappingDesc::APP, "app-2"}, {0x600000000000ULL, 0x610000000000ULL, MappingDesc::ORIGIN, "origin-1"}, {0x610000000000ULL, 0x700000000000ULL, MappingDesc::INVALID, "invalid"}, {0x700000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app-3"}}; #define MEM_TO_SHADOW(mem) (((uptr)(mem)) ^ 0x500000000000ULL) #define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x100000000000ULL) #endif // MSAN_LINUX_X86_64_OLD_MAPPING #else #error "Unsupported platform" #endif const uptr kMemoryLayoutSize = sizeof(kMemoryLayout) / sizeof(kMemoryLayout[0]); #define MEM_TO_ORIGIN(mem) (SHADOW_TO_ORIGIN(MEM_TO_SHADOW((mem)))) #ifndef __clang__ __attribute__((optimize("unroll-loops"))) #endif inline bool addr_is_type(uptr addr, MappingDesc::Type mapping_type) { // It is critical for performance that this loop is unrolled (because then it is // simplified into just a few constant comparisons). #ifdef __clang__ #pragma unroll #endif for (unsigned i = 0; i < kMemoryLayoutSize; ++i) if (kMemoryLayout[i].type == mapping_type && addr >= kMemoryLayout[i].start && addr < kMemoryLayout[i].end) return true; return false; } #define MEM_IS_APP(mem) addr_is_type((uptr)(mem), MappingDesc::APP) #define MEM_IS_SHADOW(mem) addr_is_type((uptr)(mem), MappingDesc::SHADOW) #define MEM_IS_ORIGIN(mem) addr_is_type((uptr)(mem), MappingDesc::ORIGIN) // These constants must be kept in sync with the ones in MemorySanitizer.cc. const int kMsanParamTlsSize = 800; const int kMsanRetvalTlsSize = 800; namespace __msan { extern int msan_inited; extern bool msan_init_is_running; extern int msan_report_count; bool ProtectRange(uptr beg, uptr end); bool InitShadow(bool init_origins); char *GetProcSelfMaps(); void InitializeInterceptors(); void MsanAllocatorInit(); void MsanAllocatorThreadFinish(); void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size); void *MsanReallocate(StackTrace *stack, void *oldp, uptr size, uptr alignment, bool zeroise); void MsanDeallocate(StackTrace *stack, void *ptr); void InstallTrapHandler(); void InstallAtExitHandler(); const char *GetStackOriginDescr(u32 id, uptr *pc); void EnterSymbolizer(); void ExitSymbolizer(); bool IsInSymbolizer(); struct SymbolizerScope { SymbolizerScope() { EnterSymbolizer(); } ~SymbolizerScope() { ExitSymbolizer(); } }; void PrintWarning(uptr pc, uptr bp); void PrintWarningWithOrigin(uptr pc, uptr bp, u32 origin); void GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc, uptr bp, bool request_fast_unwind); void ReportUMR(StackTrace *stack, u32 origin); void ReportExpectedUMRNotFound(StackTrace *stack); void ReportStats(); void ReportAtExitStatistics(); void DescribeMemoryRange(const void *x, uptr size); void ReportUMRInsideAddressRange(const char *what, const void *start, uptr size, uptr offset); // Unpoison first n function arguments. void UnpoisonParam(uptr n); void UnpoisonThreadLocalState(); // Returns a "chained" origin id, pointing to the given stack trace followed by // the previous origin id. u32 ChainOrigin(u32 id, StackTrace *stack); const int STACK_TRACE_TAG_POISON = StackTrace::TAG_CUSTOM + 1; #define GET_MALLOC_STACK_TRACE \ BufferedStackTrace stack; \ if (__msan_get_track_origins() && msan_inited) \ GetStackTrace(&stack, common_flags()->malloc_context_size, \ StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ common_flags()->fast_unwind_on_malloc) #define GET_STORE_STACK_TRACE_PC_BP(pc, bp) \ BufferedStackTrace stack; \ if (__msan_get_track_origins() > 1 && msan_inited) \ GetStackTrace(&stack, flags()->store_context_size, pc, bp, \ common_flags()->fast_unwind_on_malloc) #define GET_FATAL_STACK_TRACE_PC_BP(pc, bp) \ BufferedStackTrace stack; \ if (msan_inited) \ GetStackTrace(&stack, kStackTraceMax, pc, bp, \ common_flags()->fast_unwind_on_fatal) #define GET_STORE_STACK_TRACE \ GET_STORE_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME()) class ScopedThreadLocalStateBackup { public: ScopedThreadLocalStateBackup() { Backup(); } ~ScopedThreadLocalStateBackup() { Restore(); } void Backup(); void Restore(); private: u64 va_arg_overflow_size_tls; }; void MsanTSDInit(void (*destructor)(void *tsd)); void *MsanTSDGet(); void MsanTSDSet(void *tsd); void MsanTSDDtor(void *tsd); } // namespace __msan #define MSAN_MALLOC_HOOK(ptr, size) \ do { \ if (&__sanitizer_malloc_hook) { \ UnpoisonParam(2); \ __sanitizer_malloc_hook(ptr, size); \ } \ RunMallocHooks(ptr, size); \ } while (false) #define MSAN_FREE_HOOK(ptr) \ do { \ if (&__sanitizer_free_hook) { \ UnpoisonParam(1); \ __sanitizer_free_hook(ptr); \ } \ RunFreeHooks(ptr); \ } while (false) #endif // MSAN_H golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_poisoning.cc0000664000175000017500000001321512543064377026254 0ustar mwhudsonmwhudson//===-- msan_poisoning.cc ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // //===----------------------------------------------------------------------===// #include "msan_poisoning.h" #include "interception/interception.h" #include "msan_origin.h" #include "sanitizer_common/sanitizer_common.h" DECLARE_REAL(void *, memset, void *dest, int c, uptr n) DECLARE_REAL(void *, memcpy, void *dest, const void *src, uptr n) DECLARE_REAL(void *, memmove, void *dest, const void *src, uptr n) namespace __msan { u32 GetOriginIfPoisoned(uptr addr, uptr size) { unsigned char *s = (unsigned char *)MEM_TO_SHADOW(addr); for (uptr i = 0; i < size; ++i) if (s[i]) return *(u32 *)SHADOW_TO_ORIGIN(((uptr)s + i) & ~3UL); return 0; } void SetOriginIfPoisoned(uptr addr, uptr src_shadow, uptr size, u32 src_origin) { uptr dst_s = MEM_TO_SHADOW(addr); uptr src_s = src_shadow; uptr src_s_end = src_s + size; for (; src_s < src_s_end; ++dst_s, ++src_s) if (*(u8 *)src_s) *(u32 *)SHADOW_TO_ORIGIN(dst_s & ~3UL) = src_origin; } void CopyOrigin(const void *dst, const void *src, uptr size, StackTrace *stack) { if (!MEM_IS_APP(dst) || !MEM_IS_APP(src)) return; uptr d = (uptr)dst; uptr beg = d & ~3UL; // Copy left unaligned origin if that memory is poisoned. if (beg < d) { u32 o = GetOriginIfPoisoned((uptr)src, d - beg); if (o) { if (__msan_get_track_origins() > 1) o = ChainOrigin(o, stack); *(u32 *)MEM_TO_ORIGIN(beg) = o; } beg += 4; } uptr end = (d + size) & ~3UL; // If both ends fall into the same 4-byte slot, we are done. if (end < beg) return; // Copy right unaligned origin if that memory is poisoned. if (end < d + size) { u32 o = GetOriginIfPoisoned((uptr)src + (end - d), (d + size) - end); if (o) { if (__msan_get_track_origins() > 1) o = ChainOrigin(o, stack); *(u32 *)MEM_TO_ORIGIN(end) = o; } } if (beg < end) { // Align src up. uptr s = ((uptr)src + 3) & ~3UL; // FIXME: factor out to msan_copy_origin_aligned if (__msan_get_track_origins() > 1) { u32 *src = (u32 *)MEM_TO_ORIGIN(s); u32 *src_s = (u32 *)MEM_TO_SHADOW(s); u32 *src_end = (u32 *)MEM_TO_ORIGIN(s + (end - beg)); u32 *dst = (u32 *)MEM_TO_ORIGIN(beg); u32 src_o = 0; u32 dst_o = 0; for (; src < src_end; ++src, ++src_s, ++dst) { if (!*src_s) continue; if (*src != src_o) { src_o = *src; dst_o = ChainOrigin(src_o, stack); } *dst = dst_o; } } else { REAL(memcpy)((void *)MEM_TO_ORIGIN(beg), (void *)MEM_TO_ORIGIN(s), end - beg); } } } void MoveShadowAndOrigin(const void *dst, const void *src, uptr size, StackTrace *stack) { if (!MEM_IS_APP(dst)) return; if (!MEM_IS_APP(src)) return; if (src == dst) return; REAL(memmove)((void *)MEM_TO_SHADOW((uptr)dst), (void *)MEM_TO_SHADOW((uptr)src), size); if (__msan_get_track_origins()) CopyOrigin(dst, src, size, stack); } void CopyShadowAndOrigin(const void *dst, const void *src, uptr size, StackTrace *stack) { if (!MEM_IS_APP(dst)) return; if (!MEM_IS_APP(src)) return; REAL(memcpy)((void *)MEM_TO_SHADOW((uptr)dst), (void *)MEM_TO_SHADOW((uptr)src), size); if (__msan_get_track_origins()) CopyOrigin(dst, src, size, stack); } void CopyMemory(void *dst, const void *src, uptr size, StackTrace *stack) { REAL(memcpy)(dst, src, size); CopyShadowAndOrigin(dst, src, size, stack); } void SetShadow(const void *ptr, uptr size, u8 value) { uptr PageSize = GetPageSizeCached(); uptr shadow_beg = MEM_TO_SHADOW(ptr); uptr shadow_end = shadow_beg + size; if (value || shadow_end - shadow_beg < common_flags()->clear_shadow_mmap_threshold) { REAL(memset)((void *)shadow_beg, value, shadow_end - shadow_beg); } else { uptr page_beg = RoundUpTo(shadow_beg, PageSize); uptr page_end = RoundDownTo(shadow_end, PageSize); if (page_beg >= page_end) { REAL(memset)((void *)shadow_beg, 0, shadow_end - shadow_beg); } else { if (page_beg != shadow_beg) { REAL(memset)((void *)shadow_beg, 0, page_beg - shadow_beg); } if (page_end != shadow_end) { REAL(memset)((void *)page_end, 0, shadow_end - page_end); } MmapFixedNoReserve(page_beg, page_end - page_beg); } } } void SetOrigin(const void *dst, uptr size, u32 origin) { // Origin mapping is 4 bytes per 4 bytes of application memory. // Here we extend the range such that its left and right bounds are both // 4 byte aligned. uptr x = MEM_TO_ORIGIN((uptr)dst); uptr beg = x & ~3UL; // align down. uptr end = (x + size + 3) & ~3UL; // align up. u64 origin64 = ((u64)origin << 32) | origin; // This is like memset, but the value is 32-bit. We unroll by 2 to write // 64 bits at once. May want to unroll further to get 128-bit stores. if (beg & 7ULL) { *(u32 *)beg = origin; beg += 4; } for (uptr addr = beg; addr < (end & ~7UL); addr += 8) *(u64 *)addr = origin64; if (end & 7ULL) *(u32 *)(end - 4) = origin; } void PoisonMemory(const void *dst, uptr size, StackTrace *stack) { SetShadow(dst, size, (u8)-1); if (__msan_get_track_origins()) { Origin o = Origin::CreateHeapOrigin(stack); SetOrigin(dst, size, o.raw_id()); } } } // namespace __msan golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_blacklist.txt0000664000175000017500000000042712146676354026455 0ustar mwhudsonmwhudson# Blacklist for MemorySanitizer. Turns off instrumentation of particular # functions or sources. Use with care. You may set location of blacklist # at compile-time using -fsanitize-blacklist= flag. # Example usage: # fun:*bad_function_name* # src:file_with_tricky_code.cc golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_thread.cc0000664000175000017500000000440712544325207025512 0ustar mwhudsonmwhudson #include "msan.h" #include "msan_thread.h" #include "msan_interface_internal.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" namespace __msan { MsanThread *MsanThread::Create(thread_callback_t start_routine, void *arg) { uptr PageSize = GetPageSizeCached(); uptr size = RoundUpTo(sizeof(MsanThread), PageSize); MsanThread *thread = (MsanThread*)MmapOrDie(size, __func__); thread->start_routine_ = start_routine; thread->arg_ = arg; thread->destructor_iterations_ = GetPthreadDestructorIterations(); return thread; } void MsanThread::SetThreadStackAndTls() { uptr tls_size = 0; uptr stack_size = 0; GetThreadStackAndTls(IsMainThread(), &stack_bottom_, &stack_size, &tls_begin_, &tls_size); stack_top_ = stack_bottom_ + stack_size; tls_end_ = tls_begin_ + tls_size; int local; CHECK(AddrIsInStack((uptr)&local)); } void MsanThread::ClearShadowForThreadStackAndTLS() { __msan_unpoison((void *)stack_bottom_, stack_top_ - stack_bottom_); if (tls_begin_ != tls_end_) __msan_unpoison((void *)tls_begin_, tls_end_ - tls_begin_); DTLS *dtls = DTLS_Get(); CHECK_NE(dtls, 0); for (uptr i = 0; i < dtls->dtv_size; ++i) __msan_unpoison((void *)(dtls->dtv[i].beg), dtls->dtv[i].size); } void MsanThread::Init() { SetThreadStackAndTls(); CHECK(MEM_IS_APP(stack_bottom_)); CHECK(MEM_IS_APP(stack_top_ - 1)); ClearShadowForThreadStackAndTLS(); } void MsanThread::TSDDtor(void *tsd) { MsanThread *t = (MsanThread*)tsd; t->Destroy(); } void MsanThread::Destroy() { malloc_storage().CommitBack(); // We also clear the shadow on thread destruction because // some code may still be executing in later TSD destructors // and we don't want it to have any poisoned stack. ClearShadowForThreadStackAndTLS(); uptr size = RoundUpTo(sizeof(MsanThread), GetPageSizeCached()); UnmapOrDie(this, size); DTLS_Destroy(); } thread_return_t MsanThread::ThreadStart() { Init(); if (!start_routine_) { // start_routine_ == 0 if we're on the main thread or on one of the // OS X libdispatch worker threads. But nobody is supposed to call // ThreadStart() for the worker threads. return 0; } thread_return_t res = start_routine_(arg_); return res; } } // namespace __msan golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_chained_origin_depot.cc0000664000175000017500000000662212603076275030405 0ustar mwhudsonmwhudson//===-- msan_chained_origin_depot.cc -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // A storage for chained origins. //===----------------------------------------------------------------------===// #include "msan_chained_origin_depot.h" #include "sanitizer_common/sanitizer_stackdepotbase.h" namespace __msan { struct ChainedOriginDepotDesc { u32 here_id; u32 prev_id; }; struct ChainedOriginDepotNode { ChainedOriginDepotNode *link; u32 id; u32 here_id; u32 prev_id; typedef ChainedOriginDepotDesc args_type; bool eq(u32 hash, const args_type &args) const { return here_id == args.here_id && prev_id == args.prev_id; } static uptr storage_size(const args_type &args) { return sizeof(ChainedOriginDepotNode); } /* This is murmur2 hash for the 64->32 bit case. It does not behave all that well because the keys have a very biased distribution (I've seen 7-element buckets with the table only 14% full). here_id is built of * (1 bits) Reserved, zero. * (8 bits) Part id = bits 13..20 of the hash value of here_id's key. * (23 bits) Sequential number (each part has each own sequence). prev_id has either the same distribution as here_id (but with 3:8:21) split, or one of two reserved values (-1) or (-2). Either case can dominate depending on the workload. */ static u32 hash(const args_type &args) { const u32 m = 0x5bd1e995; const u32 seed = 0x9747b28c; const u32 r = 24; u32 h = seed; u32 k = args.here_id; k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; k = args.prev_id; k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; h ^= h >> 13; h *= m; h ^= h >> 15; return h; } static bool is_valid(const args_type &args) { return true; } void store(const args_type &args, u32 other_hash) { here_id = args.here_id; prev_id = args.prev_id; } args_type load() const { args_type ret = {here_id, prev_id}; return ret; } struct Handle { ChainedOriginDepotNode *node_; Handle() : node_(nullptr) {} explicit Handle(ChainedOriginDepotNode *node) : node_(node) {} bool valid() { return node_; } u32 id() { return node_->id; } int here_id() { return node_->here_id; } int prev_id() { return node_->prev_id; } }; Handle get_handle() { return Handle(this); } typedef Handle handle_type; }; static StackDepotBase chainedOriginDepot; StackDepotStats *ChainedOriginDepotGetStats() { return chainedOriginDepot.GetStats(); } bool ChainedOriginDepotPut(u32 here_id, u32 prev_id, u32 *new_id) { ChainedOriginDepotDesc desc = {here_id, prev_id}; bool inserted; ChainedOriginDepotNode::Handle h = chainedOriginDepot.Put(desc, &inserted); *new_id = h.valid() ? h.id() : 0; return inserted; } // Retrieves a stored stack trace by the id. u32 ChainedOriginDepotGet(u32 id, u32 *other) { ChainedOriginDepotDesc desc = chainedOriginDepot.Get(id); *other = desc.prev_id; return desc.here_id; } void ChainedOriginDepotLockAll() { chainedOriginDepot.LockAll(); } void ChainedOriginDepotUnlockAll() { chainedOriginDepot.UnlockAll(); } } // namespace __msan golang-1.8-race-detector-runtime_0.0+svn285455/lib/msan/msan_linux.cc0000664000175000017500000001432712757622564025420 0ustar mwhudsonmwhudson//===-- msan_linux.cc -----------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of MemorySanitizer. // // Linux- and FreeBSD-specific code. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_FREEBSD || SANITIZER_LINUX #include "msan.h" #include "msan_thread.h" #include #include #include #include #include #include #include #include #include #include #include #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_procmaps.h" namespace __msan { void ReportMapRange(const char *descr, uptr beg, uptr size) { if (size > 0) { uptr end = beg + size - 1; VPrintf(1, "%s : %p - %p\n", descr, beg, end); } } static bool CheckMemoryRangeAvailability(uptr beg, uptr size) { if (size > 0) { uptr end = beg + size - 1; if (!MemoryRangeIsAvailable(beg, end)) { Printf("FATAL: Memory range %p - %p is not available.\n", beg, end); return false; } } return true; } static bool ProtectMemoryRange(uptr beg, uptr size, const char *name) { if (size > 0) { void *addr = MmapFixedNoAccess(beg, size, name); if (beg == 0 && addr) { // Depending on the kernel configuration, we may not be able to protect // the page at address zero. uptr gap = 16 * GetPageSizeCached(); beg += gap; size -= gap; addr = MmapFixedNoAccess(beg, size, name); } if ((uptr)addr != beg) { uptr end = beg + size - 1; Printf("FATAL: Cannot protect memory range %p - %p (%s).\n", beg, end, name); return false; } } return true; } static void CheckMemoryLayoutSanity() { uptr prev_end = 0; for (unsigned i = 0; i < kMemoryLayoutSize; ++i) { uptr start = kMemoryLayout[i].start; uptr end = kMemoryLayout[i].end; MappingDesc::Type type = kMemoryLayout[i].type; CHECK_LT(start, end); CHECK_EQ(prev_end, start); CHECK(addr_is_type(start, type)); CHECK(addr_is_type((start + end) / 2, type)); CHECK(addr_is_type(end - 1, type)); if (type == MappingDesc::APP) { uptr addr = start; CHECK(MEM_IS_SHADOW(MEM_TO_SHADOW(addr))); CHECK(MEM_IS_ORIGIN(MEM_TO_ORIGIN(addr))); CHECK_EQ(MEM_TO_ORIGIN(addr), SHADOW_TO_ORIGIN(MEM_TO_SHADOW(addr))); addr = (start + end) / 2; CHECK(MEM_IS_SHADOW(MEM_TO_SHADOW(addr))); CHECK(MEM_IS_ORIGIN(MEM_TO_ORIGIN(addr))); CHECK_EQ(MEM_TO_ORIGIN(addr), SHADOW_TO_ORIGIN(MEM_TO_SHADOW(addr))); addr = end - 1; CHECK(MEM_IS_SHADOW(MEM_TO_SHADOW(addr))); CHECK(MEM_IS_ORIGIN(MEM_TO_ORIGIN(addr))); CHECK_EQ(MEM_TO_ORIGIN(addr), SHADOW_TO_ORIGIN(MEM_TO_SHADOW(addr))); } prev_end = end; } } bool InitShadow(bool init_origins) { // Let user know mapping parameters first. VPrintf(1, "__msan_init %p\n", &__msan_init); for (unsigned i = 0; i < kMemoryLayoutSize; ++i) VPrintf(1, "%s: %zx - %zx\n", kMemoryLayout[i].name, kMemoryLayout[i].start, kMemoryLayout[i].end - 1); CheckMemoryLayoutSanity(); if (!MEM_IS_APP(&__msan_init)) { Printf("FATAL: Code %p is out of application range. Non-PIE build?\n", (uptr)&__msan_init); return false; } const uptr maxVirtualAddress = GetMaxVirtualAddress(); for (unsigned i = 0; i < kMemoryLayoutSize; ++i) { uptr start = kMemoryLayout[i].start; uptr end = kMemoryLayout[i].end; uptr size= end - start; MappingDesc::Type type = kMemoryLayout[i].type; // Check if the segment should be mapped based on platform constraints. if (start >= maxVirtualAddress) continue; bool map = type == MappingDesc::SHADOW || (init_origins && type == MappingDesc::ORIGIN); bool protect = type == MappingDesc::INVALID || (!init_origins && type == MappingDesc::ORIGIN); CHECK(!(map && protect)); if (!map && !protect) CHECK(type == MappingDesc::APP); if (map) { if (!CheckMemoryRangeAvailability(start, size)) return false; if ((uptr)MmapFixedNoReserve(start, size, kMemoryLayout[i].name) != start) return false; if (common_flags()->use_madv_dontdump) DontDumpShadowMemory(start, size); } if (protect) { if (!CheckMemoryRangeAvailability(start, size)) return false; if (!ProtectMemoryRange(start, size, kMemoryLayout[i].name)) return false; } } return true; } static void MsanAtExit(void) { if (flags()->print_stats && (flags()->atexit || msan_report_count > 0)) ReportStats(); if (msan_report_count > 0) { ReportAtExitStatistics(); if (common_flags()->exitcode) internal__exit(common_flags()->exitcode); } } void InstallAtExitHandler() { atexit(MsanAtExit); } // ---------------------- TSD ---------------- {{{1 static pthread_key_t tsd_key; static bool tsd_key_inited = false; void MsanTSDInit(void (*destructor)(void *tsd)) { CHECK(!tsd_key_inited); tsd_key_inited = true; CHECK_EQ(0, pthread_key_create(&tsd_key, destructor)); } static THREADLOCAL MsanThread* msan_current_thread; MsanThread *GetCurrentThread() { return msan_current_thread; } void SetCurrentThread(MsanThread *t) { // Make sure we do not reset the current MsanThread. CHECK_EQ(0, msan_current_thread); msan_current_thread = t; // Make sure that MsanTSDDtor gets called at the end. CHECK(tsd_key_inited); pthread_setspecific(tsd_key, (void *)t); } void MsanTSDDtor(void *tsd) { MsanThread *t = (MsanThread*)tsd; if (t->destructor_iterations_ > 1) { t->destructor_iterations_--; CHECK_EQ(0, pthread_setspecific(tsd_key, tsd)); return; } msan_current_thread = nullptr; // Make sure that signal handler can not see a stale current thread pointer. atomic_signal_fence(memory_order_seq_cst); MsanThread::TSDDtor(tsd); } } // namespace __msan #endif // SANITIZER_FREEBSD || SANITIZER_LINUX golang-1.8-race-detector-runtime_0.0+svn285455/lib/interception/0000775000175000017500000000000013040224626024451 5ustar mwhudsonmwhudsongolang-1.8-race-detector-runtime_0.0+svn285455/lib/interception/interception_type_test.cc0000664000175000017500000000254712250077712031577 0ustar mwhudsonmwhudson//===-- interception_type_test.cc -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Compile-time tests of the internal type definitions. //===----------------------------------------------------------------------===// #if defined(__linux__) || defined(__APPLE__) #include "interception.h" #include #include #include COMPILER_CHECK(sizeof(::SIZE_T) == sizeof(size_t)); COMPILER_CHECK(sizeof(::SSIZE_T) == sizeof(ssize_t)); COMPILER_CHECK(sizeof(::PTRDIFF_T) == sizeof(ptrdiff_t)); COMPILER_CHECK(sizeof(::INTMAX_T) == sizeof(intmax_t)); #ifndef __APPLE__ COMPILER_CHECK(sizeof(::OFF64_T) == sizeof(off64_t)); #endif // The following are the cases when pread (and friends) is used instead of // pread64. In those cases we need OFF_T to match off_t. We don't care about the // rest (they depend on _FILE_OFFSET_BITS setting when building an application). # if defined(__ANDROID__) || !defined _FILE_OFFSET_BITS || \ _FILE_OFFSET_BITS != 64 COMPILER_CHECK(sizeof(::OFF_T) == sizeof(off_t)); # endif #endif golang-1.8-race-detector-runtime_0.0+svn285455/lib/interception/interception_win.cc0000664000175000017500000010207612773537347030371 0ustar mwhudsonmwhudson//===-- interception_linux.cc -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Windows-specific interception methods. // // This file is implementing several hooking techniques to intercept calls // to functions. The hooks are dynamically installed by modifying the assembly // code. // // The hooking techniques are making assumptions on the way the code is // generated and are safe under these assumptions. // // On 64-bit architecture, there is no direct 64-bit jump instruction. To allow // arbitrary branching on the whole memory space, the notion of trampoline // region is used. A trampoline region is a memory space withing 2G boundary // where it is safe to add custom assembly code to build 64-bit jumps. // // Hooking techniques // ================== // // 1) Detour // // The Detour hooking technique is assuming the presence of an header with // padding and an overridable 2-bytes nop instruction (mov edi, edi). The // nop instruction can safely be replaced by a 2-bytes jump without any need // to save the instruction. A jump to the target is encoded in the function // header and the nop instruction is replaced by a short jump to the header. // // head: 5 x nop head: jmp // func: mov edi, edi --> func: jmp short // [...] real: [...] // // This technique is only implemented on 32-bit architecture. // Most of the time, Windows API are hookable with the detour technique. // // 2) Redirect Jump // // The redirect jump is applicable when the first instruction is a direct // jump. The instruction is replaced by jump to the hook. // // func: jmp